.social-page {
  padding: 1.5rem 0 3rem;
}

.social-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.social-head h1,
.social-page > h1 {
  margin: 0 0 0.5rem;
}

.social-lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.social-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-actions .auth-submit {
  margin: 0;
  padding: 0.5rem 0.9rem;
}

.notif-list,
.feed-list {
  display: grid;
  gap: 0.65rem;
}

.notif-item,
.feed-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.notif-item.is-unread {
  border-color: rgba(77, 107, 254, 0.55);
  background: rgba(77, 107, 254, 0.08);
}

.notif-item h3,
.feed-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.notif-item p,
.feed-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.notif-item .meta,
.feed-item .meta {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: #6f7588;
}

.public-profile {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.public-profile img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.public-profile h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.public-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.following-box {
  margin-top: 2rem;
}

.following-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.following-list a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.following-list img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.header-bell {
  position: relative;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  text-decoration: none;
}

.header-bell .badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ff5a5a;
  color: #fff;
  font-size: 0.7rem;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.friends-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin: 0 0 1.25rem;
}

.friends-toolbar .search {
  flex: 1;
  min-width: 220px;
}

.friends-toolbar .auth-submit {
  margin: 0;
  padding: 0.75rem 1.1rem;
}

.friends-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.friend-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.friend-card img,
.friend-card__ph {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.friend-card h2 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.friend-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.friend-card h2 a:hover {
  color: var(--accent);
}

.friend-card__name,
.friend-card__bio {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.friend-card__genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.friend-chip.is-match {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(77, 107, 254, 0.18);
}

.friend-card__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.friend-card__actions .auth-submit,
.friend-card__actions .header__logout {
  margin: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
}

.social-lead a {
  color: var(--accent);
}

@media (max-width: 720px) {
  .friends-toolbar .auth-submit {
    width: 100%;
  }
}

.reco-section {
  margin: 0 0 1.5rem;
}

.reco-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.reco-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 180px);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

.reco-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.reco-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: #12141c;
}

.reco-card__body {
  padding: 0.55rem 0.65rem 0.7rem;
}

.reco-card__body h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  line-height: 1.25;
}

.reco-card__body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.75rem;
}

.score-row button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.score-row button.is-active {
  border-color: var(--accent);
  background: rgba(77, 107, 254, 0.25);
}

@media (max-width: 720px) {
  .public-profile {
    grid-template-columns: 72px 1fr;
  }
  .public-profile .profile-follow {
    grid-column: 1 / -1;
  }
}

.dm-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 62vh;
  align-items: stretch;
}

.dm-list,
.dm-chat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 0;
}

.dm-list {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 0.55rem;
}

.dm-list-empty,
.dm-empty {
  color: var(--muted);
  padding: 1.25rem;
  line-height: 1.45;
}

.dm-person {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 10px;
  padding: 0.45rem;
  cursor: pointer;
}

.dm-person.is-active,
.dm-person:hover {
  background: rgba(77, 107, 254, 0.16);
}

.dm-person img,
.dm-ph {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.dm-person strong,
.dm-person small {
  display: block;
}

.dm-person small {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.dm-person em {
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-style: normal;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
  padding: 0 0.3rem;
}

.dm-chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.dm-chat-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.dm-chat-head a {
  color: #fff;
  font-weight: 600;
}

.dm-thread {
  overflow: auto;
  padding: 0.85rem;
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.dm-bubble {
  max-width: min(80%, 34rem);
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #1c1c22;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dm-bubble.is-mine {
  justify-self: end;
  background: rgba(77, 107, 254, 0.28);
}

.dm-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--border);
}

.dm-form input {
  width: 100%;
  border: 1px solid var(--border);
  background: #101014;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  color: inherit;
}

.dm-form .auth-submit {
  margin: 0;
}

.friend-card__hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .dm-layout {
    grid-template-columns: 1fr;
    min-height: 68vh;
  }
  .dm-layout.is-chat .dm-list { display: none; }
  .dm-layout:not(.is-chat) .dm-chat { display: none; }
}
