/* website/css/social.css — Social hub page styles */

/* ─── Page wrap ─────────────────────────────────────────────────── */
/*     Uses same --app-max-width as home so proportions stay identical
       on desktop and mobile. app-main already handles outer padding. */
.social-page-wrap {
  width: 100%;
  min-width: 0;            /* prevent CSS Grid blowout → no horizontal scroll */
  max-width: var(--app-max-width, min(1600px, 96vw));
  margin: 0 auto;
  padding: 0 0 clamp(2rem, 5vw, 4rem);
}

/* ─── Social sub-nav (persistent across all /social/* pages) ─────── */
.social-subnav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 12px;
  padding: 0.3rem;
  margin-bottom: 1.375rem;
  position: sticky;
  top: 62px;
  z-index: 10;
}
.social-subnav::-webkit-scrollbar { display: none; }

.ssn-link {
  flex: 1;
  min-width: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.ssn-link:hover {
  background: var(--color-surface-3, #334155);
  color: var(--color-text, #f1f5f9);
}
.ssn-link.is-active {
  background: var(--color-brand, #f59e0b);
  color: #0f172a;
  font-weight: 700;
}

.ssn-icon { font-size: 1.05em; }
.ssn-text { }

.ssn-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  border-radius: 99px;
}
.ssn-badge.has-count { display: inline-flex; }

/* keep old tab-badge selector working in community page */
.tab-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  border-radius: 99px;
}
.tab-badge.has-count { display: inline-flex; }

@media (max-width: 768px) {
  .social-subnav { position: static; border-radius: 10px; }
}
@media (max-width: 480px) {
  .ssn-link {
    min-width: 2.75rem;
    flex: 1;
    padding: 0.55rem 0.25rem;
    flex-direction: column;
    gap: 0;
    font-size: 1.1rem;
  }
  .ssn-text { display: none; }
  .ssn-badge {
    position: absolute;
    top: 0.1rem;
    right: 0.1rem;
  }
  .social-subnav { position: relative; gap: 0.15rem; }
}



/* ─── Panels ─────────────────────────────────────────────────────── */
.social-panel { display: none; }
.social-panel.is-visible { display: block; }

/* ─── User search ────────────────────────────────────────────────── */
.social-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.social-search-wrap input[type="search"] {
  flex: 1;
  min-width: 180px;
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.social-search-wrap input[type="search"]:focus {
  border-color: var(--color-brand, #f59e0b);
  outline: none;
}
.social-search-wrap input[type="search"]::placeholder { color: var(--color-text-muted, #94a3b8); }
.search-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted, #94a3b8);
  white-space: nowrap;
}

/* ─── User grid ──────────────────────────────────────────────────── */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.875rem;
}

/* ─── User card ──────────────────────────────────────────────────── */
.user-card {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: border-color 0.15s;
  overflow: hidden;       /* prevent child text overflow */
  min-width: 0;           /* fix grid item min-width */
}
.user-card:hover { border-color: var(--color-brand, #f59e0b); }

.user-card__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;    /* ensure flex children can shrink */
  overflow: hidden;
}

.user-card__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.user-card__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-surface-3, #334155);
  display: block;
}

.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--color-surface-2, #1e293b);
}
.online-dot.offline { background: #64748b; }

.user-card__info { flex: 1; min-width: 0; }
.user-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #eaf2ff;    /* explicit: always light on dark card */
  max-width: 100%;
}
.user-card__status {
  font-size: 0.75rem;
  color: var(--color-text-muted, #94a3b8);
  margin-top: 0.1rem;
}
.user-card__status.is-online { color: #22c55e; }

.user-card__actions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.125rem;
}
.user-card__actions .uc-btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  text-align: center;
  border-radius: 6px;
  border: 1px solid var(--color-border, #334155);
  background: transparent;
  color: var(--color-text, #f1f5f9);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.user-card__actions .uc-btn:hover { background: var(--color-surface-3, #334155); }
.user-card__actions .uc-btn.primary {
  background: var(--color-brand, #f59e0b);
  border-color: var(--color-brand, #f59e0b);
  color: #0f172a;
  font-weight: 600;
}
.user-card__actions .uc-btn.primary:hover { opacity: 0.85; }
.user-card__actions .uc-btn:disabled {
  opacity: 0.38;
  cursor: default;
}
.user-card__actions .uc-btn.danger {
  border-color: #ef4444;
  color: #ef4444;
}
.user-card__actions .uc-btn.danger:hover { background: rgba(239,68,68,0.12); }

/* ─── Panel section title ─────────────────────────────────────────── */
.panel-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #94a3b8);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border, #334155);
}

/* ─── Empty / loading states ──────────────────────────────────────── */
.empty-state,
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.9rem;
  padding: 2.5rem 1rem;
}
.loading-state {
  animation: social-pulse 1.4s ease-in-out infinite;
}
@keyframes social-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ─── Requests section layout ─────────────────────────────────────── */
.requests-section { display: flex; flex-direction: column; gap: 1.5rem; }

/* ─── Profile editor ──────────────────────────────────────────────── */
.profile-editor-card {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  max-width: 640px;
}
@media (max-width: 540px) {
  .profile-editor-card { flex-direction: column; align-items: center; }
}

.profile-editor-card__avatar-zone {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}
.avatar-preview-wrap {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
}
.profile-avatar-large {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--color-brand, #f59e0b);
  background: var(--color-surface-3, #334155);
  display: block;
}
.avatar-edit-label {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--color-brand, #f59e0b);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: opacity 0.15s;
  line-height: 1;
}
.avatar-edit-label:hover { opacity: 0.8; }

.upload-progress-wrap {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 5.5rem;
}
.upload-progress-track {
  width: 100%;
  height: 4px;
  background: var(--color-surface-3, #334155);
  border-radius: 2px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: var(--color-brand, #f59e0b);
  border-radius: 2px;
  transition: width 0.2s;
  width: 0%;
}
.upload-progress-text {
  font-size: 0.7rem;
  color: var(--color-text-muted, #94a3b8);
}

.profile-editor-card__fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.pf-group { display: flex; flex-direction: column; gap: 0.35rem; }
.pf-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #94a3b8);
}
.pf-group input,
.pf-group textarea {
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}
.pf-group input:focus,
.pf-group textarea:focus {
  border-color: var(--color-brand, #f59e0b);
  outline: none;
}
.pf-group textarea { min-height: 4.5rem; }
.pf-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.pf-feedback {
  font-size: 0.82rem;
  color: var(--color-text-muted, #94a3b8);
  transition: color 0.15s;
}
.pf-feedback.success { color: #22c55e; }
.pf-feedback.error   { color: #ef4444; }

/* ─── Mobile responsive ─────────────────────────────────────────── */

/* ── 768px and below: tighten grid ── */
@media (max-width: 768px) {
  .social-page-wrap {
    padding-bottom: 3rem;
  }

  .user-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .user-card {
    padding: 0.875rem 0.75rem;
  }

  .invite-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ── 480px and below: single column ── */
@media (max-width: 480px) {
  .user-grid {
    grid-template-columns: 1fr;
    gap: 0.625rem;
    padding-bottom: 1.5rem; /* ensure last/only card is fully visible */
    overflow: visible;
  }

  .user-card__actions .uc-btn {
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
  }

  .invite-grid {
    grid-template-columns: 1fr;
  }

  .profile-editor-card {
    padding: 1rem;
    gap: 1rem;
  }

  .profile-avatar-large {
    width: 4.5rem;
    height: 4.5rem;
  }

  .avatar-preview-wrap {
    width: 4.5rem;
    height: 4.5rem;
  }
}

/* ─── Private chat slide-in panel ────────────────────────────────── */
.private-chat-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(100vw, 380px);
  height: 70vh;
  max-height: 600px;
  background: var(--color-surface-1, #0f172a);
  border: 1px solid var(--color-border, #334155);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateY(110%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 -6px 32px rgba(0,0,0,0.45);
}
.private-chat-panel.is-open { transform: translateY(0); }

.pc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border, #334155);
  flex-shrink: 0;
}
.pc-header__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.pc-header__user img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-surface-3, #334155);
}
.pc-header__user span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text, #f1f5f9);
}
.pc-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
  font-family: inherit;
}
.pc-close-btn:hover { background: var(--color-surface-3, #334155); }

.pc-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: thin;
}

.chat-msg {
  max-width: 76%;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
}
.chat-msg.mine {
  align-self: flex-end;
  background: var(--color-brand, #f59e0b);
  color: #0f172a;
  border-bottom-right-radius: 3px;
}
.chat-msg.theirs {
  align-self: flex-start;
  background: var(--color-surface-2, #1e293b);
  color: var(--color-text, #f1f5f9);
  border-bottom-left-radius: 3px;
}
.chat-msg__time {
  font-size: 0.65rem;
  opacity: 0.65;
  display: block;
  margin-top: 0.2rem;
  text-align: right;
}

.pc-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border, #334155);
  flex-shrink: 0;
}
.pc-form input {
  flex: 1;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.pc-form input:focus {
  border-color: var(--color-brand, #f59e0b);
  outline: none;
}
.pc-form button {
  background: var(--color-brand, #f59e0b);
  color: #0f172a;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.pc-form button:hover { opacity: 0.85; }

/* ─── Private chat backdrop ───────────────────────────────────────── */
.pc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}
.pc-backdrop.is-open { display: block; }

/* ─── Invite section ──────────────────────────────────────────────── */
.invite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
  margin-top: 1rem;
}
.invite-card {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.invite-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text, #f1f5f9);
}
.invite-card p {
  font-size: 0.82rem;
  color: var(--color-text-muted, #94a3b8);
  margin: 0;
  flex: 1;
}

/* ─── Profile editor collapsible ─────────────────────────────────── */
.profile-editor-details {
  margin-bottom: 1.25rem;
}
.profile-editor-details > summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  padding: 0.4rem 0;
  user-select: none;
  list-style: none;
}
.profile-editor-details > summary::-webkit-details-marker { display: none; }
.profile-editor-details > summary::before { content: '▶  '; font-size: 0.7rem; }
.profile-editor-details[open] > summary::before { content: '▼  '; }
.profile-editor-details .profile-editor-card { margin-top: 0.875rem; max-width: 100%; }

/* ─── Post wall section ───────────────────────────────────────────── */
.wall-section { display: flex; flex-direction: column; }

.post-composer {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.post-composer textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  display: block;
  transition: border-color 0.15s;
}
.post-composer textarea:focus { border-color: var(--color-brand, #f59e0b); outline: none; }
.post-composer textarea::placeholder { color: var(--color-text-muted, #94a3b8); }

.composer-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.625rem;
}
.post-char-count {
  font-size: 0.74rem;
  color: var(--color-text-muted, #94a3b8);
  margin-right: auto;
  white-space: nowrap;
}
.post-char-count.is-near-limit { color: #ef4444; }

.composer-attach-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 7px;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}
.composer-attach-btn:hover { border-color: var(--color-brand, #f59e0b); color: var(--color-text, #f1f5f9); }

.composer-privacy-select {
  flex: 1;
  min-width: 110px;
  max-width: 150px;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 7px;
  padding: 0.35rem 0.5rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
}

.composer-media-preview {
  margin-top: 0.625rem;
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.composer-preview-media {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.composer-remove-media {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}

/* Wall feed */
.wall-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.wall-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #94a3b8);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border, #334155);
  margin: 0.25rem 0 0.875rem;
}

/* Post card */
.post-card {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s;
}
.post-card:hover { border-color: var(--color-brand, #f59e0b); }

.post-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.post-privacy-icon { font-size: 0.85rem; }
.post-time {
  font-size: 0.74rem;
  color: var(--color-text-muted, #94a3b8);
}
.post-text {
  font-size: 0.9rem;
  color: var(--color-text, #f1f5f9);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.post-media {
  max-width: 100%;
  border-radius: 8px;
  max-height: 360px;
  object-fit: cover;
  display: block;
}
.post-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.35;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
  transition: opacity 0.15s, background 0.15s;
}
.post-delete-btn:hover { opacity: 1; background: rgba(239,68,68,0.12); }

/* ─── Profile viewer panel ────────────────────────────────────────── */
.profile-viewer-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(100vw, 480px);
  background: var(--color-surface-1, #0f172a);
  border-left: 1px solid var(--color-border, #334155);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -6px 0 40px rgba(0,0,0,0.5);
}
.profile-viewer-panel.is-open { transform: translateX(0); }

.pv-inner {
  overflow-y: auto;
  height: 100%;
  padding: 1.25rem 1.25rem 2.5rem;
  scrollbar-width: thin;
}
.pv-close-btn {
  display: block;
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--color-text-muted, #94a3b8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-family: inherit;
  transition: background 0.15s;
  line-height: 1;
}
.pv-close-btn:hover { background: var(--color-surface-3, #334155); }

.pv-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}
.pv-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--color-brand, #f59e0b);
  flex-shrink: 0;
  background: var(--color-surface-3, #334155);
}
.pv-hero-info { flex: 1; min-width: 0; }
.pv-hero-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  color: var(--color-text, #f1f5f9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-bio {
  font-size: 0.85rem;
  color: var(--color-text-muted, #94a3b8);
  line-height: 1.5;
  margin: 0 0 0.25rem;
}
.pv-location {
  font-size: 0.8rem;
  color: var(--color-text-muted, #94a3b8);
  margin: 0;
}
.pv-status {
  font-size: 0.78rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.pv-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  flex-shrink: 0;
}
.pv-action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.pv-action-row .btn {
  flex: 1;
  min-width: 5rem;
  text-align: center;
  justify-content: center;
}
.pv-wall-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #94a3b8);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border, #334155);
  margin-bottom: 0.875rem;
}
.pv-feed { /* inherits .wall-feed */ }

/* ─── Wall post composer (profile viewer) ───────────────────────── */
.pv-wall-composer {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 10px;
  padding: 0.875rem;
  margin-bottom: 1rem;
}
.pv-wall-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #475569);
  border-radius: 7px;
  color: var(--color-text, #e2e8f0);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.55rem 0.75rem;
  resize: vertical;
  min-height: 3rem;
}
.pv-wall-textarea:focus {
  outline: none;
  border-color: var(--color-brand, #f59e0b);
}
.pv-wall-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
.pv-char-count {
  font-size: 0.75rem;
  color: var(--color-text-muted, #94a3b8);
}
.post-from {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-brand, #f59e0b);
  margin-right: 0.4rem;
}

.pv-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 299;
}
.pv-backdrop.is-open { display: block; }

/* ─── Contacts modal ──────────────────────────────────────────────── */
.contacts-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
}
.contacts-modal.is-open { display: flex; }

.contacts-modal__inner {
  background: var(--color-surface-1, #0f172a);
  border: 1px solid var(--color-border, #334155);
  border-radius: 16px;
  width: min(94vw, 440px);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.65);
  position: relative;
  z-index: 401;
}
.contacts-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border, #334155);
  flex-shrink: 0;
}
.contacts-modal__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #f1f5f9);
}
.contacts-modal__header button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted, #94a3b8);
  font-size: 1.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: inherit;
  line-height: 1;
  transition: background 0.15s;
}
.contacts-modal__header button:hover { background: var(--color-surface-3, #334155); }

.contacts-modal__body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}
.contacts-modal__hint {
  font-size: 0.8rem;
  color: var(--color-text-muted, #94a3b8);
  margin: 0;
  padding: 0.75rem 1.25rem 0.5rem;
}
.contacts-list { display: flex; flex-direction: column; }

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  transition: background 0.12s;
}
.contact-row:hover { background: var(--color-surface-2, #1e293b); }
.contact-checkbox {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--color-brand, #f59e0b);
  flex-shrink: 0;
  cursor: pointer;
}
.contact-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-surface-3, #334155);
  color: var(--color-text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.contact-info { flex: 1; min-width: 0; }
.contact-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-detail {
  display: block;
  font-size: 0.74rem;
  color: var(--color-text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contacts-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--color-border, #334155);
  flex-shrink: 0;
  gap: 0.75rem;
}
.contacts-selected-count {
  font-size: 0.82rem;
  color: var(--color-text-muted, #94a3b8);
}
.contacts-modal-bd {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 399;
}
.contacts-modal-bd.is-open { display: block; }

/* ─── Invite internal search (PC) ────────────────────────────────── */
.invite-internal-search {
  grid-column: 1 / -1;   /* span full row on desktop */
}
.invite-internal-search__row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
  flex-wrap: wrap;
}
.invite-internal-search__row input[type="search"] {
  flex: 1;
  min-width: 160px;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.invite-internal-search__row input[type="search"]:focus { border-color: var(--color-brand, #f59e0b); outline: none; }
.invite-internal-search__row input::placeholder { color: var(--color-text-muted, #94a3b8); }

.invite-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.invite-result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface-3, #334155);
  border-radius: 8px;
}
.invite-result-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-surface-2, #1e293b);
  flex-shrink: 0;
}
.invite-result-info { flex: 1; min-width: 0; }
.invite-result-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.invite-result-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--color-text-muted, #94a3b8);
}
/* platform badge on contacts card */
.invite-platform-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
  background: rgba(245,158,11,0.15);
  color: var(--color-brand, #f59e0b);
  border: 1px solid rgba(245,158,11,0.35);
}

.contact-invite-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--color-border, #334155);
}
.contact-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}
.contact-actions .btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   Sub-page component aliases & additions
   (social-requests / social-friends / social-invite / social-profile)
   ═══════════════════════════════════════════════════════════════════ */

/* Post composer card (alternate class name used in social-profile.html) */
.post-composer-card {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.post-composer-card .composer-title {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--color-text-muted, #94a3b8);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.post-composer-card .composer-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  display: block;
  transition: border-color 0.15s;
}
.post-composer-card .composer-textarea:focus { border-color: var(--color-brand, #f59e0b); outline: none; }
.post-composer-card .composer-textarea::placeholder { color: var(--color-text-muted, #94a3b8); }
.post-composer-card .composer-media-btn {
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  color: var(--color-text-muted, #94a3b8);
  padding: 0.35rem 0.65rem;
  border-radius: 7px;
  font-size: 0.85rem;
  cursor: pointer;
}
.post-composer-card .composer-privacy {
  flex: 1;
  min-width: 110px;
  max-width: 150px;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 7px;
  padding: 0.35rem 0.5rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.82rem;
  font-family: inherit;
}
.post-upload-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  height: 1.25rem;
}
.post-upload-bar  { height: 4px; background: var(--color-brand, #f59e0b); border-radius: 4px; transition: width 0.2s; }
.post-upload-text { font-size: 0.74rem; color: var(--color-text-muted, #94a3b8); }

/* Wall section title */
.wall-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #94a3b8);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border, #334155);
}

/* Profile editor content + fields (used by social-profile.html) */
.profile-editor-summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  padding: 0.4rem 0;
  user-select: none;
  list-style: none;
}
.profile-editor-content {
  margin-top: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.avatar-editor-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.avatar-preview-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border, #334155);
  background: var(--color-surface-3, #334155);
}
.avatar-editor-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.profile-fields { display: flex; flex-direction: column; gap: 0.75rem; }
.pf-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--color-text-muted, #94a3b8);
  font-weight: 500;
}
.pf-input {
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.pf-input:focus { border-color: var(--color-brand, #f59e0b); outline: none; }
.pf-textarea { resize: vertical; min-height: 70px; }
.pf-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.pf-feedback {
  font-size: 0.82rem;
  color: var(--color-text-muted, #94a3b8);
  flex: 1;
}
.pf-feedback.success { color: #22c55e; }
.pf-feedback.error   { color: #ef4444; }

/* Invite card BEM classes (used by social-invite.html) */
.invite-card h3,
.invite-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text, #f1f5f9);
  margin: 0 0 0.5rem;
}
.invite-card__icon {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
  display: block;
}
.invite-card__desc { font-size: 0.82rem; color: var(--color-text-muted, #94a3b8); margin: 0 0 0.75rem; line-height: 1.5; }
.invite-search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.invite-search-row input {
  flex: 1;
  min-width: 0;
  background: var(--color-surface-3, #334155);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--color-text, #f1f5f9);
  font-size: 0.9rem;
  font-family: inherit;
}
.invite-search-row input:focus { border-color: var(--color-brand, #f59e0b); outline: none; }



/* ── Profile viewer gallery grid ────────────────────────── */
.pv-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.pv-gallery-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid var(--color-border, #e0e0e0);
  transition: filter 0.2s, transform 0.15s;
}
.pv-gallery-thumb:hover { filter: brightness(0.8); transform: scale(1.03); }

/* ── Profile viewer lightbox ────────────────────────────── */
.pv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.pv-lightbox.is-open { opacity: 1; pointer-events: all; }
.pv-lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.pv-lb-close:hover { background: rgba(255,255,255,0.3); }
.pv-lb-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 10px;
  object-fit: contain;
}

/* ── pv-section spacing helper ──────────────────────────── */
.pv-section { margin-bottom: 0.5rem; }

/* ── Verified badge ──────────────────────────────────────────────── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-brand, #f59e0b);
  color: #0f172a;
  border-radius: 50%;
  width: 1.05em;
  height: 1.05em;
  font-size: 0.72em;
  font-weight: 800;
  vertical-align: middle;
  margin-left: 0.25em;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Directory load-more button ──────────────────────────────────── */
.dir-load-more {
  display: block;
  margin: 1.25rem auto 0;
  padding: 0.6rem 1.75rem;
  background: transparent;
  border: 1.5px solid var(--color-border, #334155);
  border-radius: 99px;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.dir-load-more:hover {
  border-color: var(--color-brand, #f59e0b);
  color: var(--color-brand, #f59e0b);
  background: rgba(245,158,11,0.07);
}

/* ── Post reactions ──────────────────────────────────────────────── */
.post-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.6rem;
}
.post-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--color-surface-2, #1e293b);
  border: 1.5px solid var(--color-border, #334155);
  border-radius: 99px;
  padding: 0.2rem 0.55rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  color: var(--color-text, #f1f5f9);
  line-height: 1.4;
}
.post-react-btn:hover {
  background: var(--color-surface-3, #334155);
  transform: scale(1.12);
}
.post-react-btn.is-mine {
  background: rgba(245,158,11,0.18);
  border-color: var(--color-brand, #f59e0b);
}
.react-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted, #94a3b8);
  min-width: 0.9em;
  text-align: center;
}
.post-react-btn.is-mine .react-count { color: var(--color-brand, #f59e0b); }

/* ── Friends Feed page ───────────────────────────────────────────────────── */

.feed-wrap {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.feed-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted, #94a3b8);
  margin: 0;
}
.feed-refresh-btn {
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  flex-shrink: 0;
}

.friends-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Feed post card — full-width with author header */
.feed-post-card {
  background: var(--color-surface-2, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: border-color 0.15s;
}
.feed-post-card:hover { border-color: var(--color-brand, #f59e0b); }

.feed-post-card__author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.feed-author-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  flex: 1;
  border-radius: 8px;
  transition: background 0.12s;
  padding: 0.2rem 0.4rem 0.2rem 0.2rem;
}
.feed-author-btn:hover { background: var(--color-surface-3, #334155); }

.feed-author-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface-3, #334155);
  border: 2px solid var(--color-border, #334155);
}
.feed-author-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}
.feed-author-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-author-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  color: var(--color-text-muted, #94a3b8);
}
.feed-privacy-icon { font-size: 0.8em; }

.feed-chat-btn {
  background: none;
  border: 1.5px solid var(--color-border, #334155);
  border-radius: 8px;
  color: var(--color-text-muted, #94a3b8);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.feed-chat-btn:hover {
  border-color: var(--color-brand, #f59e0b);
  color: var(--color-brand, #f59e0b);
  background: rgba(245,158,11,0.07);
}

/* Feed empty state with action link */
.feed-empty {
  text-align: center;
  padding: 2.5rem 1rem;
}
.feed-empty-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted, #94a3b8);
  margin: 0.5rem 0 0;
}
.feed-link {
  color: var(--color-brand, #f59e0b);
  text-decoration: none;
  font-weight: 600;
}
.feed-link:hover { text-decoration: underline; }

/* ── Gallery drag-and-drop states ────────────────────────────────── */
.gallery-slot.filled[draggable="true"] { cursor: grab; }
.gallery-slot.filled[draggable="true"]:active { cursor: grabbing; }
.gallery-slot.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
}
.gallery-slot.drag-over {
  outline: 2.5px dashed var(--color-brand, #f59e0b);
  outline-offset: 2px;
  background: rgba(245,158,11,0.08);
}
