/* ============================================================
   LONELY CLUB — Design System
   Dark moody / violet / rose — "beautifully alone together"
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  /* Core palette */
  --bg-void:       #09080f;
  --bg-deep:       #0e0c1a;
  --bg-surface:    #14111f;
  --bg-raised:     #1c1829;
  --bg-hover:      #231f33;
  --bg-card:       #1a1627;

  /* Violet spectrum */
  --violet-dim:    #3d2f6e;
  --violet-mid:    #6b48c8;
  --violet-bright: #8b6dda;
  --violet-glow:   #a98bf0;
  --violet-pale:   #d4c6f7;

  /* Rose spectrum */
  --rose-dim:      #6b2d4e;
  --rose-mid:      #c2547a;
  --rose-bright:   #e87fa6;
  --rose-pale:     #f5c2d7;

  /* Text */
  --text-primary:  #ede8f7;
  --text-secondary:#a89fc2;
  --text-muted:    #6b6285;
  --text-faint:    #3d3758;

  /* Accents */
  --accent-main:   #9b72ef;
  --accent-rose:   #d9689a;
  --accent-glow:   rgba(155, 114, 239, 0.25);
  --accent-border: rgba(155, 114, 239, 0.3);

  /* Borders */
  --border-faint:  rgba(255,255,255,0.05);
  --border-soft:   rgba(255,255,255,0.09);
  --border-mid:    rgba(155,114,239,0.2);

  /* Fonts */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-ui:       'DM Sans', system-ui, sans-serif;

  /* Sizing */
  --nav-height:    64px;
  --sidebar-w:     260px;
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --radius-full:   999px;

  /* Shadows */
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 24px rgba(0,0,0,0.5);
  --shadow-violet: 0 0 40px rgba(155,114,239,0.15);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--violet-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet-mid); }

/* ── Selection ── */
::selection { background: rgba(155,114,239,0.3); color: var(--text-primary); }

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 300; letter-spacing: 0.01em; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

a { color: var(--violet-glow); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--violet-pale); }

/* ── Background SVG illustration ── */
/* Injected via JS as #bg-illustration div — see navbar.js */
#bg-illustration {
  position: fixed;
  inset: 0;
  background-image: url('bg.svg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

/* ── Noise texture overlay (atmospheric) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* ── Ambient background glow ── */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}
.bg-glow-violet {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(107,72,200,0.12) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.bg-glow-rose {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(194,84,122,0.09) 0%, transparent 70%);
  bottom: 0; right: -80px;
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(9,8,15,0.95);
  border-bottom: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 8px;
  z-index: 100;
}

@supports (backdrop-filter: blur(1px)) {
  .navbar {
    background: rgba(9,8,15,0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  margin-right: auto;
  text-decoration: none;
}
.nav-logo span { color: var(--accent-main); }

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active { background: rgba(155,114,239,0.12); color: var(--violet-glow); }
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-divider { width: 1px; height: 24px; background: var(--border-faint); margin: 0 4px; }

.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--violet-dim);
  object-fit: cover;
  cursor: pointer;
  transition: border-color 0.2s;
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--violet-glow);
  font-weight: 500;
}
.nav-avatar:hover { border-color: var(--accent-main); }

.nav-badge {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-badge::after {
  content: '';
  position: absolute;
  top: 6px; right: 10px;
  width: 6px; height: 6px;
  background: var(--accent-rose);
  border-radius: 50%;
  border: 2px solid var(--bg-void);
}

/* ── Page layout ── */
.page-wrapper {
  padding-top: calc(var(--nav-height) + 32px);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.feed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .feed-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-soft); }

.card-sm { padding: 16px; border-radius: var(--radius-md); }
.card-flush { padding: 0; overflow: hidden; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet-mid), var(--rose-dim));
  color: white;
  box-shadow: 0 2px 16px rgba(107,72,200,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(107,72,200,0.45);
  filter: brightness(1.1);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-mid); }

.btn-violet {
  background: rgba(155,114,239,0.12);
  color: var(--violet-glow);
  border: 1px solid rgba(155,114,239,0.2);
}
.btn-violet:hover { background: rgba(155,114,239,0.2); }

.btn-rose {
  background: rgba(216,104,154,0.12);
  color: var(--rose-bright);
  border: 1px solid rgba(216,104,154,0.2);
}
.btn-rose:hover { background: rgba(216,104,154,0.2); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }
.btn-icon { padding: 8px; border-radius: 50%; width: 36px; height: 36px; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ── Inputs ── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 0.8rem; color: var(--text-secondary); letter-spacing: 0.04em; text-transform: uppercase; }

.input {
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: var(--accent-main); box-shadow: 0 0 0 3px rgba(155,114,239,0.12); }
.input:focus + .input-line { transform: scaleX(1); }

textarea.input { resize: vertical; min-height: 80px; }

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-raised);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500;
  color: var(--violet-glow);
  overflow: hidden;
}
.avatar-xs  { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-sm  { width: 36px; height: 36px; font-size: 0.85rem; }
.avatar-md  { width: 48px; height: 48px; font-size: 1rem; }
.avatar-lg  { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-xl  { width: 96px; height: 96px; font-size: 1.8rem; }
.avatar-xxl { width: 120px; height: 120px; font-size: 2.2rem; }

.avatar-ring { border: 2px solid var(--violet-mid); }
.avatar-rose  { border: 2px solid var(--rose-mid); color: var(--rose-bright); }
.avatar-img   { background: var(--bg-raised); }

/* ── Badge / Pill ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.badge-violet { background: rgba(155,114,239,0.15); color: var(--violet-glow); }
.badge-rose   { background: rgba(216,104,154,0.15); color: var(--rose-bright); }
.badge-muted  { background: var(--bg-raised); color: var(--text-muted); }
.badge-online { background: rgba(52,211,153,0.15); color: #6ee7b7; }
.badge-dot::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; }

/* ── Post card ── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s;
}
.post-card:hover { border-color: var(--border-mid); }

.post-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 0;
}

.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 500; font-size: 0.9rem; color: var(--text-primary); }
.post-time   { font-size: 0.78rem; color: var(--text-muted); }

.post-body { padding: 14px 20px; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.65; }
.post-body-text { color: var(--text-primary); }

.post-mood {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--accent-rose);
  margin-bottom: 8px;
}

.post-actions {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 16px 16px;
  border-top: 1px solid var(--border-faint);
  margin-top: 4px;
}

.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.18s;
}
.action-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.action-btn.liked { color: var(--rose-bright); }
.action-btn.liked svg { fill: currentColor; }
.action-btn svg { width: 16px; height: 16px; }

/* ── Comments ── */
.comments-section { padding: 0 20px 16px; }
.comment-item {
  display: flex; gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border-faint);
}
.comment-body { flex: 1; }
.comment-author { font-size: 0.82rem; font-weight: 500; color: var(--text-primary); }
.comment-text { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.comment-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }

.comment-input-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-faint);
}
.comment-input {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 9px 16px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.comment-input::placeholder { color: var(--text-faint); }
.comment-input:focus { border-color: var(--accent-main); }

/* ── Compose box ── */
.compose-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.compose-row { display: flex; gap: 12px; }
.compose-box {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  outline: none;
  resize: none;
  min-height: 80px;
  transition: border-color 0.2s;
  width: 100%;
}
.compose-box::placeholder { color: var(--text-faint); font-style: italic; }
.compose-box:focus { border-color: var(--accent-main); }

.compose-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 12px; flex-wrap: wrap; }
.mood-select {
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}
.mood-select:focus { border-color: var(--accent-main); }

/* ── Members grid ── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  transition: all 0.25s;
  cursor: pointer;
}
.member-card:hover { border-color: var(--border-mid); transform: translateY(-2px); box-shadow: var(--shadow-violet); }

.member-name { font-weight: 500; font-size: 0.95rem; margin-top: 12px; color: var(--text-primary); }
.member-bio  { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.member-stats { display: flex; justify-content: center; gap: 16px; margin: 12px 0; }
.member-stat-val { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); }
.member-stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Chat ── */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - var(--nav-height) - 48px);
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-sidebar {
  border-right: 1px solid var(--border-faint);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-sidebar-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border-faint);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-primary);
}

.chat-search {
  padding: 12px 12px 0;
}
.chat-search input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  outline: none;
}
.chat-search input::placeholder { color: var(--text-faint); }
.chat-search input:focus { border-color: var(--accent-main); }

.chat-list { flex: 1; overflow-y: auto; padding: 8px 0; }

.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
}
.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: rgba(155,114,239,0.1); }

.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); }
.chat-item-preview { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item-time { font-size: 0.72rem; color: var(--text-faint); }
.chat-item-unread {
  background: var(--accent-main);
  color: white;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.chat-main { display: flex; flex-direction: column; overflow: hidden; }
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-faint);
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
}
.chat-header-info .chat-name { font-weight: 500; font-size: 0.95rem; }
.chat-header-info .chat-status { font-size: 0.75rem; color: var(--text-muted); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}

.message-group { display: flex; flex-direction: column; gap: 4px; }

.message-row { display: flex; align-items: flex-end; gap: 8px; }
.message-row.own { flex-direction: row-reverse; }

.message-bubble {
  max-width: 68%;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}
.message-bubble.other {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.message-bubble.own {
  background: linear-gradient(135deg, var(--violet-mid), var(--rose-dim));
  color: white;
  border-bottom-right-radius: 4px;
}

.message-time { font-size: 0.68rem; color: var(--text-faint); padding: 0 4px; }
.message-author-name { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 2px; padding: 0 4px; }

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-faint);
  display: flex; align-items: flex-end; gap: 12px;
}
.chat-input {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  outline: none;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.2s;
  line-height: 1.5;
}
.chat-input::placeholder { color: var(--text-faint); }
.chat-input:focus { border-color: var(--accent-main); }

/* ── Profile ── */
.profile-cover {
  height: 220px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1a0f2e 0%, #2d1040 40%, #1f0d35 70%, #160a28 100%);
}
.profile-cover-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 25% 50%, rgba(155,114,239,0.15) 0%, transparent 50%),
                    radial-gradient(circle at 75% 30%, rgba(194,84,122,0.12) 0%, transparent 50%);
}
.profile-cover-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 20%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 10% 65%, rgba(255,255,255,0.2) 0%, transparent 100%);
}

.profile-info-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 0 32px 24px;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: -52px;
  margin-bottom: 16px;
}
.profile-avatar-wrap .avatar-xxl {
  border: 4px solid var(--bg-card);
  box-shadow: 0 0 40px rgba(107,72,200,0.25);
}

.profile-top-row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.profile-name { font-family: var(--font-display); font-size: 1.9rem; font-weight: 300; letter-spacing: 0.01em; }
.profile-handle { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.profile-bio { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; margin: 12px 0; max-width: 540px; }
.profile-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.profile-stat { text-align: center; }
.profile-stat-val { font-size: 1.15rem; font-weight: 500; color: var(--text-primary); }
.profile-stat-lbl { font-size: 0.73rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }

/* ── Sidebar widgets ── */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.widget-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-xl);
  padding: 40px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-style: italic;
  font-weight: 300;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.auth-logo span { color: var(--accent-main); }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 32px; font-style: italic; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--text-faint); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background:var(--border-faint); }
.auth-switch { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

/* ── Landing page ── */
.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
}
.landing-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-main);
  margin-bottom: 24px;
}
.landing-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.landing-title em { font-style: italic; color: var(--accent-main); }
.landing-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 40px;
}
.landing-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 80px auto 0;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: left;
  transition: border-color 0.25s, transform 0.25s;
}
.feature-card:hover { border-color: var(--border-mid); transform: translateY(-3px); }
.feature-icon { font-size: 1.6rem; margin-bottom: 14px; display: block; }
.feature-title { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-primary); margin-bottom: 6px; }
.feature-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease forwards;
  max-width: 300px;
}
.toast.success { border-color: rgba(110,231,183,0.3); color: #6ee7b7; }
.toast.error   { border-color: rgba(248,113,113,0.3); color: #f87171; }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(8px); } }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.5; display: block; }
.empty-state-title { font-family: var(--font-display); font-size: 1.1rem; font-style: italic; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc { font-size: 0.85rem; line-height: 1.6; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-faint); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent-main); border-bottom-color: var(--accent-main); }

/* ── Online indicator ── */
.online-dot {
  width: 10px; height: 10px;
  background: #34d399;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  position: absolute;
  bottom: 2px; right: 2px;
}

/* ── Utility ── */
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Fade-in animation ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.fade-up { animation: fadeUp 0.4s ease forwards; }
.fade-up-2 { animation: fadeUp 0.4s 0.08s ease both; }
.fade-up-3 { animation: fadeUp 0.4s 0.16s ease both; }
.fade-up-4 { animation: fadeUp 0.4s 0.24s ease both; }

/* ── Friend request badge ── */
.friend-req-count {
  background: var(--accent-rose);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .auth-card { padding: 28px 20px; }
  .profile-info-bar { padding: 0 20px 20px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .nav-link span { display: none; }
}
