:root {
  --bg: #150F1B;
  --bg-elevated: #1C1524;
  --card: #1F1829;
  --border: #332A3D;
  --border-soft: #2A2233;
  --text: #F3EFE9;
  --text-dim: #B6ADC4;
  --text-faint: #7C7390;
  --gold: #F2B705;
  --teal: #3FD6C6;
  --coral: #FF6B4A;
  --danger: #FF5470;
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button { font-family: inherit; cursor: pointer; }

.app-shell {
  max-width: 1180px; margin: 0 auto; display: grid;
  grid-template-columns: 240px minmax(0,600px) 320px;
}

/* ---- left nav ---- */
.side-left { padding: 20px 12px; border-right: 1px solid var(--border-soft); position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; padding: 8px 14px 22px; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.logo-dot { width: 26px; height: 26px; border-radius: 8px; background: var(--gold); display: inline-block; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 999px; color: var(--text-dim); text-decoration: none; font-family: var(--font-display); font-size: 15.5px; font-weight: 500; }
.nav-item.active, .nav-item:hover { background: var(--bg-elevated); color: var(--text); }
.post-btn { margin-top: 18px; width: 100%; padding: 13px 0; border-radius: 999px; font-size: 15px; }

.btn-primary { background: var(--gold); color: #150F1B; border: none; font-family: var(--font-display); font-weight: 700; padding: 10px 20px; border-radius: 999px; text-decoration: none; text-align: center; display: inline-block; }
.btn-primary:disabled { background: var(--border-soft); color: var(--text-faint); cursor: default; }
.btn-outline { background: transparent; border: 1px solid var(--gold); color: var(--gold); font-weight: 600; font-size: 12.5px; padding: 6px 14px; border-radius: 999px; }
.btn-sm { font-size: 11.5px; padding: 5px 12px; }

/* ---- feed ---- */
.feed-col { border-right: 1px solid var(--border-soft); min-height: 100vh; }
.feed-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: rgba(21,15,27,0.92); backdrop-filter: blur(6px); }
.feed-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.live-indicator { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-faint); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); display: inline-block; }
.signal-bar { height: 2px; width: 100%; background: var(--border-soft); position: sticky; top: 48px; z-index: 5; overflow: hidden; }
.signal-fill { height: 100%; width: 0; background: var(--teal); transition: width .3s linear; }

.new-posts-pill { position: sticky; top: 56px; z-index: 6; margin: 10px auto 0; display: flex; align-items: center; gap: 6px; background: var(--gold); color: #150F1B; border: none; font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 9px 18px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,0.35); left: 50%; transform: translateX(-50%); }

.composer { display: flex; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); }
.composer-body { flex: 1; }
.composer-body textarea { width: 100%; background: transparent; border: none; outline: none; resize: none; color: var(--text); font-family: var(--font-body); font-size: 15px; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.composer-tools { display: flex; gap: 14px; color: var(--gold); }
.composer-tools svg { width: 18px; height: 18px; cursor: pointer; }

.avatar { border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: #150F1B; }
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }

.post { display: flex; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); }
.post-body { flex: 1; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.post-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.verified { width: 15px; height: 15px; fill: var(--teal); stroke: none; }
.post-handle { font-size: 13px; color: var(--text-faint); }
.post-time { font-size: 12.5px; color: var(--text-faint); margin-left: auto; }
.post-text { font-size: 14.5px; line-height: 1.5; margin: 6px 0 0; }
.post-image { margin-top: 10px; max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }

.post-actions { display: flex; align-items: center; gap: 34px; margin-top: 10px; max-width: 420px; }
.action { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-faint); font-size: 13px; font-family: var(--font-body); padding: 0; }
.action svg { width: 17px; height: 17px; }
.action-active-like { color: var(--danger); }
.action-active-like svg { fill: var(--danger); }
.action-active-repost { color: var(--teal); }

/* ---- poll ---- */
.poll { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.poll-option { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; overflow: hidden; cursor: pointer; display: flex; justify-content: space-between; font-size: 13.5px; }
.poll-option-voted { border-color: var(--gold); }
.poll-fill { position: absolute; inset: 0; background: rgba(255,255,255,0.04); z-index: 0; }
.poll-option-voted .poll-fill { background: rgba(242,183,5,0.16); }
.poll-label, .poll-pct { position: relative; z-index: 1; }
.poll-pct { color: var(--text-dim); }
.poll-total { font-size: 11.5px; color: var(--text-faint); }

/* ---- paywall ---- */
.paywall-card { margin-top: 12px; border: 1px solid var(--border-soft); border-radius: 14px; padding: 26px 20px; text-align: center; background: var(--bg-elevated); }
.paywall-lock { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #150F1B; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 16px; }
.paywall-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.paywall-price { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.paywall-btn { margin-top: 16px; width: 100%; }

/* ---- video / VAST ---- */
.video-wrap { margin-top: 10px; max-width: 420px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); position: relative; }
.vast-preroll { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg,#0E0813,#241832); display: flex; align-items: center; justify-content: center; }
.vast-play-icon { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--gold); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.vast-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.55); color: var(--text); font-size: 11px; padding: 3px 8px; border-radius: 5px; }
.vast-progress { position: absolute; bottom: 0; left: 0; height: 3px; width: 0; background: var(--gold); transition: width 1s linear; }
.content-video { width: 100%; display: block; background: #000; }

/* ---- ads ---- */
.ad-post { flex-direction: column; align-items: stretch; }
.ad-eyebrow { font-size: 11px; color: var(--text-faint); letter-spacing: .4px; margin-bottom: 8px; }
.ad-link { text-decoration: none; color: inherit; }
.ad-body { display: flex; gap: 12px; }
.ad-cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.ad-cover-fallback { background: linear-gradient(135deg, var(--gold), var(--coral)); }
.ad-company { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.ad-description { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.ad-cta { margin-top: 12px; display: inline-block; }

.feed-end { padding: 26px 18px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---- right sidebar ---- */
.side-right { padding: 20px 18px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border-radius: 999px; padding: 10px 16px; border: 1px solid var(--border-soft); }
.search-box svg { width: 16px; height: 16px; color: var(--text-faint); }
.search-box input { background: transparent; border: none; outline: none; color: var(--text); font-size: 13.5px; width: 100%; }
.panel { margin-top: 20px; background: var(--bg-elevated); border-radius: 16px; border: 1px solid var(--border-soft); overflow: hidden; padding-bottom: 4px; }
.panel-title { padding: 14px 16px; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.panel-empty { padding: 0 16px 14px; font-size: 12.5px; color: var(--text-faint); }
.trend-row { display: block; padding: 10px 16px; border-top: 1px solid var(--border-soft); text-decoration: none; }
.trend-tag { font-weight: 600; font-size: 13.5px; color: var(--teal); }
.trend-count { font-size: 11.5px; color: var(--text-faint); }
.suggest-row { display: flex; align-items: center; gap: 10px; padding: 6px 16px; }
.suggest-name { flex: 1; min-width: 0; }
.suggest-fullname { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-handle { font-size: 11.5px; color: var(--text-faint); }

/* ---- mobile bottom nav ---- */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-elevated); border-top: 1px solid var(--border-soft); justify-content: space-around; padding: 10px 0 12px; z-index: 20; }
.bottom-nav a { color: var(--text-dim); }
.bottom-nav .bn-active { color: var(--gold); }

.zx-mobile-only { display: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .zx-desktop-only { display: none !important; }
  .zx-mobile-only { display: flex !important; }
  .feed-col { padding-bottom: 64px; border-right: none; }
}

/* ---- toast ---- */
.toast { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 12.5px; z-index: 30; max-width: 88%; text-align: center; }

/* ---- auth pages ---- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { width: 360px; max-width: 90vw; background: var(--card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 28px 26px; }
.auth-logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.auth-card h1 { font-family: var(--font-display); font-size: 20px; margin: 0 0 16px; }
.auth-card label { display: block; font-size: 12.5px; color: var(--text-dim); margin: 14px 0 6px; }
.auth-card input { width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 14px; outline: none; }
.auth-card .btn-primary { width: 100%; margin-top: 20px; padding: 11px 0; border: none; }
.auth-error { background: rgba(255,84,112,0.12); color: var(--danger); border: 1px solid rgba(255,84,112,0.35); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 6px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 18px; }
.auth-switch a { color: var(--gold); text-decoration: none; }

/* ---- wallet ---- */
.wallet-page { display: flex; justify-content: center; padding: 40px 16px; }
.wallet-card { width: 480px; max-width: 100%; }
.back-link { font-size: 13px; color: var(--text-dim); text-decoration: none; }
.wallet-card h1 { font-family: var(--font-display); }
.wallet-balance { background: var(--bg-elevated); border-radius: 16px; padding: 22px; margin: 16px 0; }
.wallet-label { display: block; font-size: 12.5px; color: var(--text-dim); }
.wallet-amount { font-family: var(--font-display); font-weight: 700; font-size: 32px; color: var(--gold); }
.wallet-note { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.wallet-cta { display: block; text-align: center; margin: 16px 0 26px; }
.wallet-history { list-style: none; padding: 0; margin: 0; }
.wallet-history li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border-soft); font-size: 13.5px; }
.wallet-history-amount { color: var(--gold); font-weight: 600; }
.wallet-empty { color: var(--text-faint); font-size: 13px; }
