/* Klovvo v3 *//* ============================================================
   Klovvo — social platform stylesheet
   Green / Blue / Black. Dark default + light theme. 3-column.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   THEME TOKENS
   ============================================================ */
:root {
  /* Dark mode (default) — Black / Blue / Green */
  --bg-primary: #0a0f1a;
  --bg-secondary: #0f1623;
  --bg-tertiary: #16202f;
  --bg-input: #0c1320;
  --border: #1e2a3d;
  --border-light: #172030;
  --text-primary: #e8eef5;
  --text-secondary: #8ea0b8;
  --text-muted: #5a6b80;
  --accent: #2563eb;          /* Blue */
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --accent-2: #22c55e;        /* Green */
  --accent-2-hover: #16a34a;
  --accent-2-soft: rgba(34, 197, 94, 0.14);
  --like: #22c55e;            /* Green hearts */
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #eab308;
  --gold: #eab308;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.20);

  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;

  --header-h: 0px;
  --bottom-nav-h: 0px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eef1f4;
  --bg-input: #f0f3f6;
  --border: #d8dee4;
  --border-light: #e8ebef;
  --text-primary: #1c2330;
  --text-secondary: #5a6573;
  --text-muted: #8b95a1;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-2-soft: rgba(34, 197, 94, 0.08);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--text-primary); }
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

ul { list-style: none; padding: 0; }

::selection { background: var(--accent-soft); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; border: 3px solid transparent; }

/* ============================================================
   APP LAYOUT — 3 columns desktop
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  gap: 0;
  max-width: 100%;
  min-height: 100vh;
}

.sidebar-left {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  padding: 20px 16px;
  overflow-y: auto;
}

.main-content {
  min-width: 0;
  width: 100%;
  padding: 28px 24px calc(28px + var(--bottom-nav-h));
}
.main-content > .main-inner {
  max-width: 680px;
  margin: 0 auto;
}

.sidebar-right {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 20px;
  overflow-y: auto;
}

/* ---------- Left sidebar contents ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text-primary);
  padding: 6px 10px 18px;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--text-primary); }
.brand .brand-logo { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; object-fit: cover; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.30); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-link .nav-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  font-weight: 600;
}

.sidebar-spacer { flex: 1 1 auto; }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border); }
.theme-toggle .nav-icon { font-size: 18px; width: 22px; text-align: center; }

/* User mini profile */
.user-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  margin-top: 12px;
}
.user-mini .user-mini-info { min-width: 0; flex: 1; }
.user-mini .user-mini-name {
  font-weight: 600; font-size: 14px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-mini .user-mini-handle { font-size: 12px; color: var(--text-muted); }
.user-mini .logout-link {
  color: var(--text-muted); font-size: 18px; padding: 6px; border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease; flex-shrink: 0;
}
.user-mini .logout-link:hover { background: var(--bg-input); color: var(--danger); }

/* Logged-out sidebar CTA */
.sidebar-cta { padding: 10px; }
.sidebar-cta .btn-block + .btn-block { margin-top: 8px; }

/* ============================================================
   RIGHT SIDEBAR WIDGETS
   ============================================================ */
.widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.widget-title {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.search-form { position: relative; }
.search-form .search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px 10px 38px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-form .search-input::placeholder { color: var(--text-muted); }
.search-form .search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-glow); }
.search-form .search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: 0.7; pointer-events: none; }

.widget-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.widget-item + .widget-item { border-top: 1px solid var(--border-light); }
.widget-item .widget-emoji {
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--accent-soft); flex-shrink: 0;
}
.widget-item .widget-meta { min-width: 0; flex: 1; }
.widget-item .widget-name { font-weight: 600; font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-item .widget-sub { font-size: 12px; color: var(--text-muted); }

.privacy-badge {
  margin-top: auto;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--border-light);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.45;
}
.privacy-badge .lock { font-size: 15px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, .btn-ghost, .btn-danger, .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.30); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 6px 20px rgba(37, 99, 235, 0.40); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: rgba(248, 81, 73, 0.12); color: var(--danger); }

.btn-icon {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 0;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-primary[disabled], .btn-ghost[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.input-field, .input-field[type="text"], .input-field[type="password"],
.input-field[type="search"], .input-field[type="email"], input[type="datetime-local"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input-field { resize: vertical; min-height: 96px; line-height: 1.5; }
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus, input[type="datetime-local"]:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--shadow-glow);
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ba6b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ============================================================
   BADGES & AVATARS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
  line-height: 1.4;
}
.badge-owner { background: rgba(227, 179, 65, 0.15); color: var(--gold); }
.badge-muted { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-success { background: rgba(63, 185, 80, 0.15); color: var(--success); }
.badge-live { background: rgba(240, 72, 72, 0.15); color: var(--danger); }
.badge-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: var(--danger); }

.avatar {
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--bg-tertiary);
  display: grid; place-items: center;
  font-size: 20px; flex-shrink: 0;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.avatar-lg { width: 80px; height: 80px; font-size: 40px; border-width: 4px; }
.avatar-sm { width: 28px; height: 28px; font-size: 15px; }
.avatar-md { width: 44px; height: 44px; font-size: 22px; }

/* ============================================================
   CARDS (generic)
   ============================================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.post-card:hover { border-color: var(--border); box-shadow: var(--shadow); }

.post-votes {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  min-width: 52px;
}
.vote-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.vote-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
[data-theme="light"] .vote-btn:hover { background: rgba(15,23,42,0.06); }
.vote-btn.up.active { color: var(--accent); }
.vote-btn.down.active { color: #7aa2f7; }
.vote-btn:active { transform: scale(0.9); }
.post-score { font-weight: 700; font-size: 14px; color: var(--text-primary); min-height: 18px; }
.post-score.up { color: var(--accent); }
.post-score.down { color: #7aa2f7; }

.post-body-area { flex: 1; min-width: 0; padding: 14px 16px; }

.post-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted); margin-bottom: 6px;
}
.post-meta .meta-author { font-weight: 700; color: var(--text-primary); }
.post-meta .meta-dot { opacity: 0.5; }
.post-meta .meta-place { color: var(--accent); font-weight: 600; }
.post-meta .meta-place:hover { text-decoration: underline; }
.post-meta .meta-time { color: var(--text-muted); }
.post-meta .avatar { width: 32px; height: 32px; font-size: 16px; }

.post-title { font-weight: 700; font-size: 17px; color: var(--text-primary); margin-bottom: 6px; letter-spacing: -0.01em; }
.post-content { font-size: 15px; line-height: 1.6; color: var(--text-secondary); white-space: pre-wrap; word-wrap: break-word; }

.post-actions {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin-top: 12px;
}
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; cursor: pointer;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.action-btn:hover { background: var(--bg-tertiary); color: var(--text-secondary); }
.action-btn .act-icon { font-size: 15px; }
.action-btn.like-btn.active { color: var(--like); }
.action-btn.like-btn.active .act-icon { animation: pop 0.25s ease; }
.action-btn.bookmark-btn.active { color: var(--accent); }
.action-btn.dislike-btn.active { color: #ef4444; }
@keyframes pop { 0%{transform:scale(1);} 50%{transform:scale(1.35);} 100%{transform:scale(1);} }

.post-delete { margin-left: auto; }
/* Reply actions row (shared by compose & reply forms) */
.reply-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ============================================================
   PLACE CARD
   ============================================================ */
.place-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.place-card:hover { border-color: var(--border); box-shadow: var(--shadow); transform: translateY(-1px); }
.place-card .place-emoji {
  width: 48px; height: 48px; border-radius: 999px;
  background: var(--accent-soft);
  display: grid; place-items: center; font-size: 24px; flex-shrink: 0;
}
.place-card .place-info { flex: 1; min-width: 0; }
.place-card .place-name { font-weight: 700; font-size: 16px; color: var(--text-primary); }
.place-card .place-name:hover { color: var(--accent); }
.place-card .place-desc { font-size: 13px; color: var(--text-muted); margin: 3px 0 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.place-card .place-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.place-card .place-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }

.place-list { display: flex; flex-direction: column; gap: 14px; }
.grid-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ============================================================
   TAB BAR
   ============================================================ */
.tab-bar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 12px 18px;
  font-weight: 600; font-size: 14px; color: var(--text-muted);
  border: none; background: transparent; cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================================
   COMPOSE BOX
   ============================================================ */
.compose-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.compose-box:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.compose-box .compose-trigger {
  flex: 1; color: var(--text-muted); font-size: 15px;
  background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 10px 16px;
}

.compose-form { display: none; margin-top: 14px; }
.compose-form.open { display: block; }
.compose-form .field { margin-bottom: 12px; }

/* ============================================================
   JOIN CTA (non-members)
   ============================================================ */
.join-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.join-cta-text strong {
  display: block;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.join-cta-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .join-cta {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================================
   REPLY FORMS (toggle open/closed — same .open pattern as compose)
   ============================================================ */
.reply-form { display: none; margin-top: 10px; }
.reply-form.open { display: block; }
.reply-row {
  display: flex; gap: 10px; align-items: flex-start;
}
.reply-row .input-field { font-size: 0.875rem; }

/* ============================================================
   COMMENT THREADS (visual nesting for replies)
   ============================================================ */
.post-thread {
  margin-top: 10px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Reply posts — visually distinct from top-level posts (legacy fallback) */
.post-card.reply {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 8px;
}
.post-card.reply .post-votes { width: 32px; font-size: 0.7rem; }
.post-card.reply .vote-btn { font-size: 0.65rem; }
.post-card.reply .post-title { font-size: 0.95rem; }
.post-card.reply .post-content { font-size: 0.875rem; }
.post-card.reply .post-meta { font-size: 0.75rem; }
.post-card.reply .avatar-sm { width: 24px; height: 24px; font-size: 0.8rem; }
.post-card.reply .post-actions { gap: 6px; }
.post-card.reply .action-btn { font-size: 0.75rem; }
.post-card.reply .post-image { max-height: 320px; }

/* ============================================================
   COMMENT ENTRIES (depth > 0) — Facebook-style nested comments
   Avatar + name + bubble inline, compact text action buttons.
   ============================================================ */
.comment-entry {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 5px 0;
}
.comment-avatar {
  width: 32px; height: 32px; font-size: 16px;
  flex-shrink: 0;
}
.comment-main { flex: 1; min-width: 0; }
.comment-head {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.comment-author { font-weight: 700; font-size: 13px; color: var(--text-primary); }
.comment-time-inline { font-size: 11px; color: var(--text-muted); }
.comment-delete {
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; opacity: 0.5; padding: 0 2px; color: var(--text-muted);
}
.comment-delete:hover { opacity: 1; }
.comment-text {
  font-size: 14px; line-height: 1.5; color: var(--text-secondary);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  margin: 2px 0 4px;
}
.comment-image { max-height: 280px; border-radius: var(--radius); margin-top: 4px; }
.comment-actions {
  display: flex; align-items: center; gap: 14px;
  margin-top: 2px;
}
.text-action {
  background: transparent; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  padding: 2px 0;
  transition: color 0.15s ease;
}
.text-action:hover { color: var(--text-secondary); }
.text-action.like-btn.active { color: var(--like); }
.text-action.dislike-btn.active { color: #ef4444; font-weight: 700; }

/* Deep nesting — each level gets slightly more indent + lighter bg */
.post-thread .post-thread {
  margin-left: 12px;
  padding-left: 12px;
}
.post-thread .post-thread .post-card.reply {
  background: var(--bg-secondary);
}

/* Mobile: tighter indent */
@media (max-width: 767px) {
  .post-thread {
    margin-left: 10px;
    padding-left: 10px;
  }
  .post-thread .post-thread {
    margin-left: 8px;
    padding-left: 8px;
  }
  .post-card.reply .post-image {
    max-height: 240px;
  }
  .comment-avatar { width: 28px; height: 28px; font-size: 14px; }
  .comment-actions { gap: 12px; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 56px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty-state .empty-emoji { font-size: 48px; margin-bottom: 8px; }
.empty-state h3 { font-size: 18px; }
.empty-state p { color: var(--text-muted); font-size: 14px; max-width: 380px; }
.empty-state .btn-primary, .empty-state .btn-ghost { margin-top: 12px; }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 37%, var(--bg-tertiary) 63%);
  background-size: 400% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s ease infinite;
}
.skeleton.line { height: 12px; margin-bottom: 8px; }
.skeleton.line.w-60 { width: 60%; }
.skeleton.line.w-40 { width: 40%; }
.skeleton.line.w-80 { width: 80%; }
.skeleton.avatar { width: 40px; height: 40px; border-radius: 999px; }
.skeleton.card { height: 120px; border-radius: var(--radius-lg); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================================================
   FAB (mobile)
   ============================================================ */
.fab {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  right: 18px;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  font-size: 26px; line-height: 1;
  display: none;
  place-items: center;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
  z-index: 100;
  transition: background 0.15s ease, transform 0.15s ease;
}
.fab:hover { background: var(--accent-hover); }
.fab:active { transform: scale(0.92); }

/* ============================================================
   BOTTOM NAV (mobile)
   ============================================================ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: none;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  justify-content: space-around;
  align-items: flex-end;
}
.bottom-nav .bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 11px; font-weight: 600;
  padding: 6px 4px; border-radius: var(--radius-sm);
  min-width: 44px; min-height: 44px; justify-content: center;
  transition: color 0.15s ease;
}
.bottom-nav .bn-item .bn-icon { font-size: 21px; line-height: 1; }
.bottom-nav .bn-item.active { color: var(--accent); }
.bottom-nav .bn-item.bn-create {
  background: transparent;
  margin-top: 0;
  border: none;
  box-shadow: none;
}
.bottom-nav .bn-item.bn-create .bn-icon {
  width: 50px; height: 50px; border-radius: 999px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; border: 4px solid var(--bg-secondary);
  box-shadow: 0 6px 16px rgba(37,99,235,0.4);
  margin-top: -22px;
}
.bottom-nav .bn-item.bn-create .bn-label {
  display: block;
  font-size: 9px;
  margin-top: 2px;
  white-space: nowrap;
}

/* ============================================================
   MOBILE HEADER (mobile only)
   ============================================================ */
.mobile-header {
  display: none;
  position: sticky; top: 0; z-index: 150;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 16px;
  align-items: center; justify-content: space-between;
}
.mobile-header .brand { padding: 0; font-size: 18px; }

/* Member counter — mobile header */
.member-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: auto;
  margin-left: 12px;
}
.member-counter .member-count {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}
.member-counter .member-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Member counter — desktop sidebar */
.sidebar-member-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 0 8px;
}
.sidebar-member-count strong {
  color: var(--accent);
  font-size: 14px;
}
.sidebar-member-count .member-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-dot 2s infinite;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  width: min(92vw, 420px); pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 14px; color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.25s ease;
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-info { border-left: 3px solid var(--accent); }
.toast .toast-close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
.toast.leaving { animation: slideOut 0.2s ease forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-14px); } }

/* ============================================================
   FLASH MESSAGES (server-rendered)
   ============================================================ */
.flash-wrap { margin-bottom: 16px; }
.flash {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.flash + .flash { margin-top: 8px; }
.flash-success { background: rgba(63,185,80,0.10); border-color: rgba(63,185,80,0.4); color: var(--success); }
.flash-error { background: rgba(248,81,73,0.10); border-color: rgba(248,81,73,0.4); color: var(--danger); }
.flash-info { background: var(--accent-soft); border-color: rgba(37,99,235,0.4); color: var(--accent); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.page-head .page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 8px 0 12px; letter-spacing: -0.01em; }

/* ============================================================
   PLACE HEADER (shared tab page header)
   ============================================================ */
.place-header {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.place-header .ph-top { display: flex; align-items: center; gap: 16px; }
.place-header .ph-emoji { width: 64px; height: 64px; border-radius: var(--radius); background: var(--accent-soft); display: grid; place-items: center; font-size: 32px; flex-shrink: 0; }
.place-header h1 { font-size: 22px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.place-header .ph-desc { color: var(--text-secondary); font-size: 14px; margin-top: 6px; line-height: 1.5; }
.place-header .ph-stats { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.place-header .ph-stats strong { color: var(--text-primary); font-weight: 700; }
.place-header .ph-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ============================================================
   CHAT — Messenger / iMessage style bubbles
   ============================================================ */
.chat-shell { display: flex; flex-direction: column; min-height: 300px; height: calc(100vh - 120px); }
.online-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.online-chips .oc-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 2px; }
.online-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: none;
  font-size: 12px; color: var(--text-muted);
}
.online-chip .online-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 2px rgba(63,185,80,0.18); }
.online-chip .oc-emoji { font-size: 13px; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 8px 4px;
  background: transparent; border: none;
  border-radius: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-msg { display: flex; gap: 8px; max-width: 75%; align-items: flex-start; }
.chat-msg .chat-content { display: flex; flex-direction: column; min-width: 0; }
.chat-msg .chat-bubble {
  background: var(--bg-tertiary); padding: 9px 13px; border-radius: 18px;
  border-bottom-left-radius: 5px;
  font-size: 14px; line-height: 1.45; color: var(--text-primary);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.chat-msg .chat-author { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin: 0 12px 2px; }
.chat-msg .chat-time { font-size: 10px; color: var(--text-muted); margin: 3px 12px 0; }
.chat-msg.own { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.own .chat-bubble {
  background: var(--accent); color: #fff;
  border-bottom-left-radius: 18px; border-bottom-right-radius: 5px;
  border: none;
}
.chat-msg.own .chat-author { display: none; }
.chat-msg.own .chat-time { text-align: right; }
.chat-msg.system { align-self: center; max-width: 90%; }
.chat-msg.system .chat-bubble { background: transparent; color: var(--text-muted); font-size: 12px; font-style: italic; border-radius: 0; }
/* Avatars in chat stay compact */
.chat-msg .avatar.avatar-sm { width: 30px; height: 30px; font-size: 15px; flex-shrink: 0; }
.chat-msg.own .avatar.avatar-sm { display: none; }

.chat-input-bar {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  position: sticky; bottom: 0;
  margin-top: 8px;
}
.chat-input-bar input { flex: 1; border: none; background: transparent; }
.chat-input-bar .btn-primary { border-radius: 999px; padding: 9px 18px; flex-shrink: 0; }
.chat-input-bar[disabled] .input-field, .chat-input-bar.disabled .input-field { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-primary); }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--shadow-lg);
}
.auth-hero { text-align: center; margin-bottom: 26px; }
.auth-hero .auth-logo { font-size: 44px; }
.auth-hero h1 { font-size: 24px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; }
.auth-hero p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-muted); }
.auth-alt a { font-weight: 600; }

/* ---------- Custom math captcha ---------- */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.captcha-question {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 8px 16px;
  border-radius: var(--radius);
  white-space: nowrap;
  letter-spacing: 0.05em;
}
.captcha-box .input-field {
  width: 80px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-banner {
  height: 120px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  position: relative;
}
.profile-header-card {
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 0 24px 24px; margin-top: -40px;
  box-shadow: var(--shadow-sm); position: relative; z-index: 1;
}
.profile-header-card .ph-avatar { margin-top: -40px; border: 4px solid var(--bg-secondary); }
.profile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.profile-name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.profile-handle { color: var(--text-muted); font-size: 14px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin-top: 10px; line-height: 1.5; }
.stats-row { display: flex; gap: 28px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-light); flex-wrap: wrap; }
.stats-row .stat-num { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.stats-row .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================================================
   EVENTS
   ============================================================ */
.event-card {
  display: flex; gap: 16px;
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.event-card:hover { border-color: var(--border); box-shadow: var(--shadow); }
.event-card.past { opacity: 0.65; }
.event-date {
  flex-shrink: 0; width: 60px; text-align: center;
  background: var(--bg-tertiary); border-radius: var(--radius);
  padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.event-date .ed-day { font-size: 24px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.event-date .ed-month { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--accent); margin-top: 2px; }
.event-body { flex: 1; min-width: 0; }
.event-body h3 { font-size: 16px; margin-bottom: 4px; }
.event-body .event-time { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.event-body .event-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.rsvp-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rsvp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-tertiary); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.rsvp-btn:hover { border-color: var(--border); color: var(--text-primary); }
.rsvp-btn[data-status="going"].active { background: rgba(63,185,80,0.15); border-color: var(--success); color: var(--success); }
.rsvp-btn[data-status="maybe"].active { background: rgba(210,153,34,0.15); border-color: var(--warning); color: var(--warning); }
.rsvp-btn[data-status="not_going"].active { background: rgba(248,81,73,0.15); border-color: var(--danger); color: var(--danger); }

/* ============================================================
   LIVE PAGE
   ============================================================ */
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; background: var(--danger); box-shadow: 0 0 0 4px rgba(240,72,72,0.18); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.45;} }

/* ============================================================
   UTILITIES
   ============================================================ */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.center { text-align: center; }
.mt-0{margin-top:0}.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-0{margin-bottom:0}.mb-8{margin-bottom:8px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.hide { display: none !important; }
.spacer { flex: 1; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.bold { font-weight: 700; }
.divider { height: 1px; background: var(--border-light); margin: 16px 0; border: none; }
.nowrap { white-space: nowrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: 768-1023 → icons-only left sidebar, hide right */
@media (max-width: 1023px) {
  .app-grid { grid-template-columns: 64px 1fr; }
  .sidebar-right { display: none; }
  .sidebar-left { padding: 16px 8px; align-items: center; }
  .brand { padding: 6px 0 16px; font-size: 0; justify-content: center; }
  .brand .brand-logo { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; object-fit: cover; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.30); }
  .nav-link { justify-content: center; padding: 12px; gap: 0; border-left: none; border-radius: var(--radius); }
  .nav-link .nav-text { display: none; }
  .nav-link.active { border-left: none; }
  .nav-link.active::after { content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; background: var(--accent); border-radius: 999px; }
  .theme-toggle { justify-content: center; padding: 12px; gap: 0; }
  .theme-toggle .nav-text { display: none; }
  .user-mini { flex-direction: column; gap: 8px; padding: 8px 4px; }
  .user-mini .user-mini-info { display: none; }
  .user-mini .logout-link { padding: 4px; }
  .sidebar-cta .btn-block { padding: 10px 6px; font-size: 0; }
  .sidebar-cta .btn-block::first-letter { font-size: 16px; }
  .main-content { padding: 22px 18px 28px; }
}

/* Mobile: <768 → single column, bottom nav */
@media (max-width: 767px) {
  :root { --bottom-nav-h: 72px; }
  .app-grid { grid-template-columns: 1fr; }
  .sidebar-left { display: none; }
  .main-content { padding: 16px 16px calc(20px + var(--bottom-nav-h)); }
  .main-content > .main-inner { max-width: 100%; }
  .mobile-header { display: flex; }
  .fab { display: grid; }
  .bottom-nav { display: flex; }
  .page-head h1 { font-size: 22px; }
  .post-card { flex-direction: row; }
  .post-votes { min-width: 46px; padding: 12px 6px; }
  .post-body-area { padding: 12px 14px; }
  .post-title { font-size: 16px; }
  .post-meta { font-size: 12px; }
  .action-btn { padding: 7px 10px; }
  .profile-header-card { padding: 0 16px 18px; }
  .grid-places { grid-template-columns: 1fr; }
  .chat-shell { height: calc(100vh - 180px); min-height: 280px; }
  h1 { font-size: 22px; }
  .toast-container { top: 8px; }
}

/* Very small */
@media (max-width: 380px) {
  .post-votes { min-width: 42px; }
  .event-card { flex-direction: column; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   POST IMAGES
   ============================================================ */
.post-image-wrap {
  margin: 10px 0;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  background: var(--bg-tertiary);
}
.post-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
  transition: max-height 0.3s ease;
}
.post-image.expanded {
  max-height: none;
  cursor: zoom-out;
  object-fit: contain;
}
.post-image.reply-img {
  max-height: 300px;
}

/* ============================================================
   UPLOAD / FILE PICKER
   ============================================================ */
.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.upload-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--accent, #2563EB);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.upload-label:hover .upload-btn { opacity: 0.85; }
.upload-filename {
  font-size: 0.8rem;
  color: var(--text-muted, #8896AC);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Reply upload (compact) */
.reply-upload-row {

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing {
  max-width: 900px;
  margin: 0 auto;
}
.landing-hero {
  text-align: center;
  padding: 48px 20px 40px;
}
.landing-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.3);
  margin-bottom: 20px;
}
.landing-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.landing-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}
.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 1rem; margin-bottom: 6px; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

.landing-communities {
  padding: 32px 20px;
  text-align: center;
}
.landing-communities h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}
.landing-place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}
.landing-place-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s, transform 0.15s;
}
.landing-place-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.landing-place-emoji { font-size: 1.5rem; }
.landing-place-card strong { display: block; font-size: 0.95rem; }
.landing-place-card span { font-size: 0.8rem; color: var(--text-muted); }

.landing-bottom {
  text-align: center;
  padding: 48px 20px 60px;
}
.landing-bottom h2 { font-size: 1.6rem; margin-bottom: 8px; }
.landing-bottom p { color: var(--text-muted); margin-bottom: 20px; }

@media (max-width: 767px) {
  .landing-title { font-size: 1.6rem; }
  .landing-subtitle { font-size: 0.95rem; }
  .landing-features { grid-template-columns: 1fr; }
}

.reply-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.upload-btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 8px;
}
.reply-upload-filename {
  font-size: 0.75rem;
}

/* ============================================================
   LANDING v2 — Premium Hero (2026 redesign)
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 58px 24px 62px;
  margin: 0 -8px 0;
  border-radius: 0 0 28px 28px;
  background:
    radial-gradient(115% 78% at 50% -18%, rgba(37, 99, 235, 0.30), transparent 60%),
    radial-gradient(90% 60% at 85% 0%, rgba(34, 197, 94, 0.18), transparent 55%),
    linear-gradient(180deg, #0b1322 0%, #0a0f1a 100%);
  border-bottom: 1px solid rgba(37, 99, 235, 0.16);
}
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(55% 45% at 50% -6%, rgba(59, 130, 246, 0.20), transparent 70%);
}
.hero-logo {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 16px;
  filter: drop-shadow(0 10px 26px rgba(37, 99, 235, 0.45));
}
.hero-logo svg { width: 64px; height: 64px; display: block; }

.hero-eyebrow {
  display: inline-block;
  position: relative;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.28);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero-title {
  position: relative;
  font-size: clamp(2.1rem, 8vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 auto 14px;
  max-width: 640px;
  background: linear-gradient(120deg, #ffffff 0%, #cfe0ff 42%, #86efac 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  position: relative;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 24px;
}
.hero-subtitle strong { color: var(--text-primary); font-weight: 700; }

.hero-trust {
  position: relative;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}
.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.trust-check { flex-shrink: 0; }

.hero-cta {
  position: relative;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-btn-primary { box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45); }
.hero-btn-primary:hover { box-shadow: 0 10px 30px rgba(37, 99, 235, 0.55); }

/* Fade-in animation for hero elements */
@keyframes klovvoFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  opacity: 0;
  animation: klovvoFadeUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; opacity: 1; }
}

@media (max-width: 767px) {
  .hero { padding: 44px 18px 46px; }
  .hero-subtitle { font-size: 0.98rem; }
  .hero-logo { margin-bottom: 18px; }
}

/* ============================================================
   HOME BANNER — logged-in welcome header
   ============================================================ */
.home-banner {
  position: relative;
  overflow: hidden;
  margin: 0 -8px 24px;
  padding: 40px 20px 44px;
  border-radius: 0 0 24px 24px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.14);
  background:
    radial-gradient(110% 72% at 50% -20%, rgba(37, 99, 235, 0.24), transparent 60%),
    radial-gradient(80% 50% at 90% 0%, rgba(34, 197, 94, 0.14), transparent 55%),
    linear-gradient(180deg, #0b1322 0%, var(--bg-primary) 100%);
}
.home-banner-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 40% at 50% -4%, rgba(59, 130, 246, 0.16), transparent 70%);
}
.home-banner-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.home-banner-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 8px 22px rgba(37, 99, 235, 0.40));
}
.home-banner-title {
  font-size: clamp(1.5rem, 5.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(120deg, #ffffff 0%, #cfe0ff 50%, #86efac 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.home-banner-sub {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.home-banner-sub strong { color: var(--text-primary); font-weight: 700; }
.home-banner-cta {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.40);
}
[data-theme="light"] .home-banner {
  background:
    radial-gradient(110% 72% at 50% -20%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(80% 50% at 90% 0%, rgba(34, 197, 94, 0.07), transparent 55%),
    linear-gradient(180deg, #f0f4ff 0%, var(--bg-primary) 100%);
}
[data-theme="light"] .home-banner-title {
  background: linear-gradient(120deg, #1e3a5f 0%, #2563eb 50%, #16a34a 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   FOLLOW FEATURE (user follow on profile + post follow 🔔)
   ============================================================ */
/* Profile follow button — builds on shared .btn-* base styles.
   When not following it's a filled blue (.btn-primary); when
   following it becomes a subtle ghost (.btn-ghost.active). */
.follow-btn.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.30);
}
.follow-btn.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.follow-btn.active {
  color: var(--accent);
}
.follow-btn.active:hover {
  background: var(--accent-soft);
}

/* Post follow button reuses .action-btn; active = accent color + pop */
.action-btn.follow-post-btn.active {
  color: var(--accent);
}
.action-btn.follow-post-btn.active .act-icon {
  animation: pop 0.25s ease;
}

/* Feed tabs (Latest / Following switcher) */
.feed-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.feed-tab-links {
  font-size: 13px;
  font-weight: 600;
}
.feed-tab-links a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.feed-tab-links a:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   KLOVVO COMMENTS — Reddit-style compact comment system
   ============================================================ */
.klovvo-box {
  display: none;
  margin-top: 8px;
}
.klovvo-box.open { display: block; }

/* The comment thread container */
.klovvo-scroll {
  max-height: 400px;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}
.klovvo-scroll::-webkit-scrollbar { width: 4px; }
.klovvo-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.klovvo-scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Individual comment ── */
.klovvo-item { padding: 2px 0; }

.klovvo-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 10px 4px;
  border-radius: 6px;
  transition: background 0.12s;
}
.klovvo-entry:hover {
  background: rgba(128, 128, 128, 0.04);
}

/* Avatar — slightly bigger circle, clearly visible */
.klovvo-avatar {
  width: 24px; height: 24px;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.klovvo-content { flex: 1; min-width: 0; }

/* Header: username + time — inline, Reddit style */
.klovvo-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
}
.klovvo-author {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
}
.klovvo-time {
  font-size: 11px;
  color: var(--text-muted);
}
.klovvo-delete {
  background: none; border: none; cursor: pointer;
  font-size: 10px; opacity: 0.25; padding: 0 2px;
  margin-left: auto;
  transition: opacity 0.15s;
}
.klovvo-delete:hover { opacity: 0.7; }

/* Comment body — readable, properly sized */
.klovvo-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  word-wrap: break-word;
  margin-bottom: 2px;
}
.klovvo-img-wrap { margin-top: 4px; margin-bottom: 2px; }
.klovvo-img {
  max-width: 160px;
  max-height: 120px;
  border-radius: 6px;
  cursor: pointer;
  transition: max-width 0.2s, max-height 0.2s;
}
.klovvo-img.expanded { max-width: 100%; max-height: none; }

/* ── Action bar — Reddit-style compact buttons ── */
.klovvo-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
}
.klovvo-act {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background 0.12s, color 0.12s;
}
.klovvo-act:hover {
  background: rgba(128, 128, 128, 0.08);
  color: var(--text-secondary);
}
.klovvo-act.like-btn.active {
  color: #e55050;
  background: rgba(229, 80, 80, 0.08);
}
.klovvo-act.dislike-btn.active {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.08);
}

/* ── Nested replies — Reddit-style thread lines ── */
.klovvo-nested {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--border-light);
}
.klovvo-nested .klovvo-nested { border-left-color: rgba(128,128,128,0.12); }
.klovvo-nested .klovvo-nested .klovvo-nested { border-left-color: rgba(128,128,128,0.08); }

/* Wrapper around each Klovvo entry */
.klovvo-item { }

/* Lazy-loaded Klovvos: fade in on expand */
.klovvo-item.klovvo-revealing {
  animation: klovvo-reveal 0.22s ease-out;
}
@keyframes klovvo-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Legacy — no longer used by lazy-load approach */
.klovvo-collapsed { display: none; }

/* ── Expand/collapse button ── */
.klovvo-expand-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; width: 100%; padding: 5px 2px; margin-top: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 500;
  color: var(--accent);
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
  border-radius: 6px;
}
.klovvo-expand-btn:hover {
  opacity: 1;
  background: var(--accent-soft);
}
.klovvo-expand-btn:disabled { opacity: 0.4; cursor: default; }
.klovvo-expand-text { font-weight: 500; }
.klovvo-expand-arrow {
  font-size: 12px; transition: transform 0.2s; line-height: 1;
}

/* Backwards compat */
.klovvo-hidden { display: none; }
.expand-klovvos-btn { display: none; }

