* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #f3f6fb;
  color: #2c3e50;
}

header .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1b2838;
  color: #fff;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.site-title {
  font-size: 26px;
  font-weight: 700;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.main-nav a {
  color: #ecf0f1;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
}

.main-nav a:hover {
  background: #2c3e50;
}

.username-display {
  font-size: 12px;
  margin-left: 10px;
}

main {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 15px 40px;
}

footer {
  background: #1b2838;
  color: #ecf0f1;
  padding: 10px 20px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-nav a {
  color: #ecf0f1;
  text-decoration: none;
  font-size: 13px;
}

h1, h2, h3 {
  margin-top: 0;
}

section.home ul {
  list-style: disc;
  padding-left: 20px;
}

.error {
  color: #c0392b;
  background: #fceaea;
  border: 1px solid #e6b0b0;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

form {
  background: #ffffff;
  border-radius: 6px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

form label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form select,
form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border-radius: 4px;
  border: 1px solid #ccd1d9;
  font-size: 14px;
}

form textarea {
  min-height: 80px;
}

button,
input[type="submit"] {
  background: #27ae60;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

button:hover,
input[type="submit"]:hover {
  background: #219150;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.profile-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  padding: 10px;
  display: block;
}

.profile-picture img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.no-picture-box {
  width: 200px;
  height: 200px;
  border-radius: 4px;
  border: 1px dashed #999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
}

.profile-info {
  margin-top: 8px;
}

.profile-info .screen-name {
  font-weight: 600;
}

.profile-info .location {
  font-size: 13px;
  color: #7f8c8d;
}

.profile-info .intro {
  font-size: 13px;
  margin-top: 4px;
}

.picture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

.picture-slot img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.primary-label {
  font-size: 12px;
  color: #27ae60;
  margin-top: 4px;
}

.message-list .message-item {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 10px;
  padding: 10px;
}

.message-meta {
  font-size: 12px;
  color: #7f8c8d;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.message-body {
  font-size: 14px;
}

.message-actions a {
  font-size: 13px;
  color: #2980b9;
  text-decoration: none;
}

.message-actions a:hover {
  text-decoration: underline;
}

.badge {
  background: #e74c3c;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  margin-left: 4px;
}

@media (max-width: 600px) {
  header .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}