/* =====================================================================
   CUVA AI — "Eclipse" design system
   Diturunkan dari logo: dua bilah merah melengkung membentuk C / gerhana.
   Palet: void hitam + crimson metalik. Motif: crescent.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --void:        #07070a;
  --void-2:      #0b0b10;
  --panel:       #101017;
  --panel-2:     #15151e;
  --panel-hi:    #1b1b26;
  --line:        rgba(255,255,255,.07);
  --line-2:      rgba(255,255,255,.12);

  --red:         #ff2a36;
  --red-bright:  #ff4b54;
  --red-deep:    #c00f1b;
  --red-dark:    #7a0911;
  --ember:       #ff7a45;
  --glow:        rgba(255,42,54,.55);
  --glow-soft:   rgba(255,42,54,.18);

  --text:        #ededf2;
  --text-2:      #b7b7c2;
  --muted:       #7c7c8a;
  --faint:       #54545f;

  --crimson-grad: linear-gradient(135deg, #ff4b54 0%, #ff2a36 38%, #c00f1b 100%);
  --metal-grad:   linear-gradient(160deg, #ff5a62 0%, #e21422 45%, #8e0a14 100%);

  --radius:      16px;
  --radius-sm:   11px;
  --radius-xs:   8px;

  --rail-w:      290px;
  --feed-max:    640px;
  --gap:         20px;

  --shadow:      0 24px 60px -20px rgba(0,0,0,.85);
  --shadow-red:  0 0 0 1px rgba(255,42,54,.35), 0 18px 50px -18px rgba(255,42,54,.45);

  --ease:        cubic-bezier(.4,.0,.1,1);
  --font:        'Inter', system-ui, sans-serif;
  --font-head:   'Space Grotesk', 'Inter', sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--void);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}
h1,h2,h3,h4 { font-family: var(--font-head); margin: 0; font-weight: 600; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
ul, ol { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--red); color: #fff; }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #26262f; border-radius: 20px; border: 3px solid var(--void); }
::-webkit-scrollbar-thumb:hover { background: #3a3a46; }

/* =====================================================================
   Backdrop: eclipse glow + particles + grain
   ===================================================================== */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.eclipse-glow {
  position: fixed; z-index: 0; pointer-events: none;
  top: -28vh; left: 50%; transform: translateX(-50%);
  width: 120vw; height: 100vh;
  background:
    radial-gradient(46% 46% at 50% 38%, rgba(255,42,54,.16), rgba(255,42,54,.05) 45%, transparent 70%),
    radial-gradient(30% 30% at 72% 22%, rgba(255,90,70,.10), transparent 60%);
  filter: blur(8px);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =====================================================================
   Top bar
   ===================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,8,12,.72);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex; align-items: center; gap: 18px;
  max-width: 1440px; margin: 0 auto;
  padding: 11px 22px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand__mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  filter: drop-shadow(0 4px 14px rgba(255,42,54,.5));
  transition: transform .5s var(--ease);
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.brand:hover .brand__mark { transform: rotate(-12deg) scale(1.06); }
.brand__word {
  font-family: var(--font-head); font-weight: 700; font-size: 22px;
  letter-spacing: .02em; line-height: 1;
}
.brand__ai {
  color: var(--red); margin-left: 3px;
  text-shadow: 0 0 18px var(--glow);
}

/* Search */
.searchbar {
  flex: 1; max-width: 520px; position: relative;
  display: flex; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 14px; height: 42px;
  transition: border-color .25s, box-shadow .25s;
}
.searchbar:focus-within { border-color: rgba(255,42,54,.5); box-shadow: 0 0 0 4px var(--glow-soft); }
.searchbar__icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.searchbar input {
  flex: 1; background: none; border: 0; outline: 0;
  color: var(--text); font-size: 14.5px; padding: 0 10px;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar__kbd {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px;
}

/* Top nav */
.topnav { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 14px; border-radius: 999px;
  padding: 0 16px; height: 40px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, box-shadow .25s, border-color .2s, color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn--primary {
  background: var(--crimson-grad); color: #fff;
  box-shadow: 0 6px 22px -8px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn--primary:hover { box-shadow: 0 10px 30px -8px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); filter: brightness(1.06); }
.btn--ghost { background: var(--panel); border: 1px solid var(--line-2); color: var(--text-2); }
.btn--ghost:hover { color: var(--text); border-color: rgba(255,42,54,.5); background: var(--panel-hi); }
.btn--outline { background: transparent; border: 1px dashed var(--line-2); color: var(--text-2); }
.btn--outline:hover { border-color: var(--red); color: var(--text); }
.btn--block { width: 100%; }
.btn--lg { height: 48px; padding: 0 24px; font-size: 15.5px; }

/* X (Twitter) */
.btn--icon { width: 40px; padding: 0; flex-shrink: 0; }
.x-btn:hover { border-color: rgba(255,255,255,.35); color: var(--text); }
.x-icon { width: 17px; height: 17px; fill: currentColor; }
.x-icon--sm { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.rail-footer__x {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--text-2); font-weight: 600;
}
.rail-footer__x:hover { color: var(--text); }

.ask-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,42,54,.6); }
  70% { box-shadow: 0 0 0 7px rgba(255,42,54,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,42,54,0); }
}

.karma {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--text-2); padding: 0 6px;
}
.karma__icon { width: 18px; height: 18px; color: var(--ember); fill: rgba(255,122,69,.18); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 16px; color: #fff;
  background: var(--metal-grad);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 14px -4px var(--glow);
  border: 1px solid rgba(255,255,255,.12);
}
.avatar--sm { width: 36px; height: 36px; font-size: 14px; flex-shrink: 0; }

.hamburger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* =====================================================================
   Layout
   ===================================================================== */
.layout {
  position: relative; z-index: 2;
  max-width: 1440px; margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0,1fr) var(--rail-w);
  gap: var(--gap);
  align-items: start;
}
.rail__scroll {
  position: sticky; top: 78px;
  max-height: calc(100vh - 96px);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: var(--gap);
  padding-right: 4px;
  scrollbar-width: thin;
}
/* Panels with overflow:hidden (ask/about) would otherwise be shrunk to 0 by
   the flex column when content exceeds the rail height — keep them intact. */
.rail__scroll > * { flex-shrink: 0; }
/* Tidy: hide the rail's own scrollbar (content still scrolls on hover/wheel) */
.rail__scroll { scrollbar-width: none; -ms-overflow-style: none; }
.rail__scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.feed { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* =====================================================================
   Panels (generic card)
   ===================================================================== */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--void-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}
.panel--mini { padding: 14px 16px; }
.panel__title {
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 13px;
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
}
.panel__title--flush { margin-bottom: 0; }
.crescent-bullet {
  width: 13px; height: 13px; flex-shrink: 0;
  background: var(--red);
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle at 70% 50%, transparent 42%, #000 43%);
          mask: radial-gradient(circle at 70% 50%, transparent 42%, #000 43%);
  box-shadow: 0 0 10px var(--glow);
}

/* =====================================================================
   Community lists (left rail)
   ===================================================================== */
.community-list { display: flex; flex-direction: column; gap: 2px; }
.community-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 9px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .18s; width: 100%; text-align: left;
}
.community-item:hover { background: var(--panel-hi); }
.community-item.is-active { background: rgba(255,42,54,.1); }
.c-badge {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px;
  background: var(--panel-hi); border: 1px solid var(--line-2);
}
.community-item .c-meta { min-width: 0; flex: 1; }
.community-item .c-name { font-weight: 600; font-size: 13.5px; }
.community-item .c-count { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.community-item .c-join {
  font-size: 11px; font-weight: 700; color: var(--red);
  border: 1px solid rgba(255,42,54,.4); border-radius: 999px; padding: 3px 9px;
  opacity: 0; transition: opacity .18s, background .18s, color .18s;
}
.community-item:hover .c-join { opacity: 1; }
.community-item .c-join.is-joined { color: var(--muted); border-color: var(--line-2); }
.community-item .c-join.is-joined::after { content: "✓ Joined"; }
.community-item .c-join:not(.is-joined)::after { content: "+ Join"; }

.shortcut-list button {
  display: block; width: 100%; text-align: left;
  padding: 8px 9px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-2); transition: .18s;
}
.shortcut-list button:hover { background: var(--panel-hi); color: var(--text); }

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 130% at 88% -10%, rgba(255,42,54,.16), transparent 55%),
    linear-gradient(180deg, #14060a 0%, #0a0a10 100%);
  padding: 34px 32px 30px;
}
.hero__crescent {
  position: absolute; right: -90px; top: 50%; transform: translateY(-50%);
  width: 360px; height: 360px; border-radius: 50%;
  background: var(--metal-grad);
  -webkit-mask: radial-gradient(circle at 78% 50%, transparent 52%, #000 53%);
          mask: radial-gradient(circle at 78% 50%, transparent 52%, #000 53%);
  filter: drop-shadow(0 0 60px var(--glow)) blur(.4px);
  opacity: .9;
  animation: floatY 8s ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(-50%) rotate(0); } 50% { transform: translateY(-54%) rotate(-7deg); } }
.hero__content { position: relative; z-index: 2; max-width: 560px; }
.hero__eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em;
  color: var(--red); text-shadow: 0 0 14px var(--glow);
}
.hero__title {
  font-size: clamp(30px, 4.4vw, 46px); line-height: 1.02; font-weight: 700;
  margin: 12px 0 14px; letter-spacing: -.02em;
}
.hero__title em { font-style: normal; color: transparent; background: var(--crimson-grad); -webkit-background-clip: text; background-clip: text; }
.hero__sub { color: var(--text-2); font-size: 15.5px; max-width: 470px; }
.hero__sub strong { color: var(--text); }
.hero__actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero__stats .stat { display: flex; flex-direction: column; }
.hero__stats .stat b { font-family: var(--font-mono); font-size: 20px; color: var(--text); }
.hero__stats .stat span { font-size: 12px; color: var(--muted); letter-spacing: .04em; }

/* =====================================================================
   Composer bar
   ===================================================================== */
.composer-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 14px;
}
.composer-bar__fake {
  flex: 1; text-align: left; height: 42px; padding: 0 16px;
  background: var(--void-2); border: 1px solid var(--line);
  border-radius: 999px; color: var(--faint); font-size: 14px;
  transition: border-color .2s, color .2s;
}
.composer-bar__fake:hover { border-color: rgba(255,42,54,.5); color: var(--text-2); }
.composer-bar__icon {
  width: 42px; height: 42px; border-radius: 12px; font-size: 17px;
  background: var(--void-2); border: 1px solid var(--line); transition: .18s;
}
.composer-bar__icon:hover { background: var(--panel-hi); border-color: var(--line-2); }

/* =====================================================================
   Sort bar
   ===================================================================== */
.sortbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sortbar__tabs {
  display: flex; gap: 4px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px;
}
.sort-tab {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 7px 15px; border-radius: 999px; transition: .2s;
}
.sort-tab .sort-ico { font-size: 13px; }
.sort-tab:hover { color: var(--text-2); }
.sort-tab.is-active { color: #fff; background: var(--crimson-grad); box-shadow: 0 4px 14px -6px var(--glow); }
.sortbar__meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.active-filter {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2);
  background: rgba(255,42,54,.08); border: 1px solid rgba(255,42,54,.25);
  border-radius: 999px; padding: 7px 8px 7px 15px; align-self: flex-start;
}
.active-filter button { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 12px; }
.active-filter button:hover { background: var(--red); color: #fff; }

/* =====================================================================
   Post card  — the signature component
   ===================================================================== */
.post-list { display: flex; flex-direction: column; gap: var(--gap); }
.post {
  display: grid; grid-template-columns: 52px 1fr;
  background: linear-gradient(180deg, var(--panel) 0%, var(--void-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: relative;
  transition: border-color .25s, box-shadow .3s, transform .25s var(--ease);
  opacity: 0; transform: translateY(14px);
  animation: rise .55s var(--ease) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.post:hover { border-color: rgba(255,42,54,.4); box-shadow: var(--shadow-red); }
.post::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--crimson-grad); opacity: 0; transition: opacity .25s;
}
.post:hover::before { opacity: 1; }
.post--showcase { border-color: rgba(255,42,54,.28); }

/* Vote rail */
.vote {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 0; background: rgba(0,0,0,.22);
  border-right: 1px solid var(--line);
}
.vote button {
  width: 30px; height: 26px; display: grid; place-items: center;
  color: var(--muted); border-radius: 7px; transition: .15s;
}
.vote button svg { width: 18px; height: 18px; }
.vote .up:hover { color: var(--red); background: rgba(255,42,54,.12); }
.vote .down:hover { color: #4a8dff; background: rgba(74,141,255,.12); }
.vote .up.is-on { color: var(--red); filter: drop-shadow(0 0 6px var(--glow)); }
.vote .down.is-on { color: #4a8dff; }
.vote .score { font-family: var(--font-mono); font-weight: 700; font-size: 13.5px; color: var(--text); }
.vote .score.pos { color: var(--red); }
.vote .score.neg { color: #4a8dff; }

/* Body */
.post__main { padding: 14px 18px 13px; min-width: 0; }
.post__meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin-bottom: 9px;
}
.post__cuva {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--text); font-size: 13px;
}
.post__cuva .c-dot { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; background: var(--panel-hi); }
.post__meta .sep { opacity: .5; }
.post__meta a:hover { color: var(--text-2); }
.type-pill {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-2);
}
.type-pill--showcase { color: var(--red); border-color: rgba(255,42,54,.4); background: rgba(255,42,54,.08); }
.type-pill--question { color: var(--ember); border-color: rgba(255,122,69,.4); background: rgba(255,122,69,.08); }

.post__title {
  font-size: 18px; font-weight: 600; line-height: 1.28; cursor: pointer;
  letter-spacing: -.01em; margin-bottom: 7px;
}
.post__title:hover { color: var(--red-bright); }
.post__excerpt { color: var(--text-2); font-size: 14px; line-height: 1.55; }
.post__excerpt code { font-family: var(--font-mono); font-size: 12.5px; background: var(--void); padding: 1px 6px; border-radius: 6px; color: var(--ember); }

/* Showcase preview strip */
.showcase-strip {
  margin-top: 13px; display: flex; align-items: center; gap: 14px;
  background: var(--void); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.showcase-strip .thumb {
  width: 60px; height: 60px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 26px;
  background: var(--metal-grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.showcase-strip .ss-meta { flex: 1; min-width: 0; }
.showcase-strip .ss-meta b { font-size: 14px; }
.showcase-strip .ss-meta p { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.showcase-strip .ss-link {
  font-family: var(--font-mono); font-size: 12px; color: var(--red);
  border: 1px solid rgba(255,42,54,.4); border-radius: 8px; padding: 6px 11px;
  white-space: nowrap; transition: .18s;
}
.showcase-strip .ss-link:hover { background: var(--red); color: #fff; }

/* Tags */
.post__tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  font-size: 12px; color: var(--text-2);
  background: var(--panel-hi); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 11px; transition: .18s;
}
.tag:hover { border-color: rgba(255,42,54,.5); color: var(--text); }
.tag::before { content: "#"; color: var(--faint); margin-right: 1px; }

/* Footer actions */
.post__foot { display: flex; align-items: center; gap: 4px; margin-top: 13px; }
.post__act {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 7px 11px; border-radius: 9px; transition: .15s;
}
.post__act svg { width: 16px; height: 16px; }
.post__act:hover { background: var(--panel-hi); color: var(--text); }
.post__act.is-saved { color: var(--ember); }

/* =====================================================================
   Right rail widgets
   ===================================================================== */
.panel--ask { background: linear-gradient(180deg, #160a0d 0%, var(--void-2) 100%); border-color: rgba(255,42,54,.22); overflow: hidden; }
.ask-head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.ask-orb {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 32% 30%, #ff7a7f, var(--red) 45%, var(--red-deep) 100%);
  box-shadow: 0 0 22px var(--glow), inset 0 2px 4px rgba(255,255,255,.35);
  position: relative; animation: orbPulse 3.5s ease-in-out infinite;
}
.ask-orb::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid rgba(255,42,54,.4); animation: orbRing 3.5s ease-in-out infinite;
}
@keyframes orbPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes orbRing { 0%,100% { opacity: .2; transform: scale(1); } 50% { opacity: .7; transform: scale(1.15); } }
.ask-orb--lg { width: 46px; height: 46px; }
.ask-sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.ask-mini {
  background: var(--void); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 12px;
}
.ask-mini__msg { font-size: 13.5px; color: var(--text-2); margin: 0; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.ask-chip {
  font-size: 12px; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px; transition: .18s;
}
.ask-chip:hover { border-color: var(--red); color: var(--text); background: rgba(255,42,54,.08); }

.trending-list { counter-reset: t; display: flex; flex-direction: column; gap: 3px; }
.trending-list li { counter-increment: t; }
.trending-list button {
  display: flex; align-items: baseline; gap: 11px; width: 100%; text-align: left;
  padding: 8px 9px; border-radius: var(--radius-sm); transition: background .18s;
}
.trending-list button:hover { background: var(--panel-hi); }
.trending-list button::before {
  content: counter(t); font-family: var(--font-mono); font-weight: 700;
  font-size: 14px; color: var(--red); width: 18px; flex-shrink: 0;
}
.trending-list .t-tag { font-weight: 600; font-size: 13.5px; }
.trending-list .t-count { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); display: block; }

.builder-list { display: flex; flex-direction: column; gap: 9px; }
.builder-item { display: flex; align-items: center; gap: 11px; }
.builder-item .b-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
  font-family: var(--font-head);
}
.builder-item .b-meta { flex: 1; min-width: 0; }
.builder-item .b-name { font-weight: 600; font-size: 13.5px; }
.builder-item .b-karma { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.builder-item .b-follow { font-size: 11px; font-weight: 700; color: var(--red); border: 1px solid rgba(255,42,54,.4); border-radius: 999px; padding: 4px 11px; transition:.18s; }
.builder-item .b-follow:hover { background: var(--red); color: #fff; }

.panel--about { position: relative; overflow: hidden; }
.about-glow { position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 70%); filter: blur(20px); }
.panel--about p { font-size: 13.5px; color: var(--text-2); position: relative; margin: 8px 0 0; }
.about-rule { height: 1px; background: var(--line); margin: 14px 0; }
.about-meta { display: flex; justify-content: space-between; position: relative; }
.about-meta li { display: flex; flex-direction: column; gap: 2px; }
.about-meta strong { font-family: var(--font-mono); font-size: 17px; color: var(--text); }
.about-meta span { font-size: 11px; color: var(--muted); }

.rail-footer { padding: 4px 6px 20px; font-size: 11.5px; color: var(--faint); }
.rail-footer__links { margin-top: 4px; }
.rail-footer a:hover { color: var(--text-2); }

.empty-note { font-size: 13px; color: var(--muted); padding: 10px 4px; line-height: 1.5; }

.empty-feed {
  text-align: center; padding: 60px 30px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--void-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.empty-feed__crescent {
  width: 64px; height: 64px; margin: 0 auto 20px;
  background: var(--metal-grad); border-radius: 50%;
  -webkit-mask: radial-gradient(circle at 72% 50%, transparent 50%, #000 51%);
          mask: radial-gradient(circle at 72% 50%, transparent 50%, #000 51%);
  filter: drop-shadow(0 0 24px var(--glow)); opacity: .85;
}
.empty-feed h3 { font-size: 19px; margin-bottom: 8px; }
.empty-feed p { color: var(--text-2); font-size: 14px; max-width: 360px; margin: 0 auto; }

.feed-end {
  text-align: center; padding: 30px 0 50px; color: var(--faint);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .1em;
}
.feed-end::before { content: "◗ "; color: var(--red); }
.feed-end::after { content: " ◖"; color: var(--red); }

/* =====================================================================
   Modals
   ===================================================================== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(3,3,6,.74); backdrop-filter: blur(6px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal__panel {
  position: relative; z-index: 2; width: 100%; max-width: 680px;
  max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel) 0%, var(--void-2) 100%);
  border: 1px solid var(--line-2); border-radius: 20px;
  box-shadow: var(--shadow); padding: 28px;
  animation: pop .32s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.modal__panel--ask { max-width: 560px; padding: 0; overflow: hidden; }
.modal__close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px;
  background: var(--panel-hi); border: 1px solid var(--line-2); color: var(--text-2); transition: .18s;
}
.modal__close:hover { background: var(--red); color: #fff; border-color: var(--red); }
.modal__close--inline { position: static; margin-left: auto; }
.modal__title { font-size: 22px; margin-bottom: 20px; }

/* Composer form */
.composer__types { display: flex; gap: 8px; margin-bottom: 18px; }
.ctype { font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--void-2); transition: .18s; }
.ctype:hover { border-color: var(--line-2); }
.ctype.is-active { color: #fff; background: rgba(255,42,54,.14); border-color: rgba(255,42,54,.5); }
.field { display: block; margin-bottom: 16px; position: relative; }
.field__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; letter-spacing: .02em; }
.field__hint { color: var(--faint); font-weight: 400; }
.field__input {
  width: 100%; background: var(--void); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px; color: var(--text); font-size: 14.5px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.field__input:focus { border-color: rgba(255,42,54,.5); box-shadow: 0 0 0 4px var(--glow-soft); }
.field__input--area { resize: vertical; line-height: 1.55; }
select.field__input { appearance: none; cursor: pointer; }
.field__count { position: absolute; right: 4px; bottom: -18px; font-size: 11px; color: var(--faint); font-family: var(--font-mono); }
.composer__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }

/* Post modal content */
.pm-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pm-title { font-size: 26px; line-height: 1.18; margin-bottom: 14px; letter-spacing: -.02em; }
.pm-body { color: var(--text-2); font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.pm-body code { font-family: var(--font-mono); font-size: 13px; background: var(--void); padding: 1px 6px; border-radius: 6px; color: var(--ember); }
.pm-foot { display: flex; gap: 16px; margin: 20px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
.pm-foot .pm-score { color: var(--red); font-weight: 700; font-family: var(--font-mono); }

.comments h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.comment-composer { display: flex; gap: 10px; margin-bottom: 22px; }
.comment-composer textarea { flex: 1; }
.comment { display: flex; gap: 12px; margin-bottom: 18px; }
.comment .c-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; font-family: var(--font-head); }
.comment .c-bubble { flex: 1; min-width: 0; }
.comment .c-head { font-size: 13px; margin-bottom: 4px; }
.comment .c-head b { font-weight: 600; }
.comment .c-head span { color: var(--muted); margin-left: 7px; font-size: 12px; }
.comment .c-text { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.comment .c-mini { display: flex; gap: 14px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.comment .c-mini button:hover { color: var(--red); }

/* =====================================================================
   Ask Cuva chat
   ===================================================================== */
.askchat { display: flex; flex-direction: column; height: 600px; max-height: 84vh; }
.askchat__head { display: flex; align-items: center; gap: 13px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #160a0d, transparent); }
.askchat__title { font-size: 18px; }
.askchat__status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: 2px 0 0; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ad36a; box-shadow: 0 0 8px #3ad36a; }
.askchat__log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.55; animation: rise .35s var(--ease); }
.msg--bot { align-self: flex-start; background: var(--panel-hi); border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--text); }
.msg--user { align-self: flex-end; background: var(--crimson-grad); color: #fff; border-bottom-right-radius: 5px; }
.msg code { font-family: var(--font-mono); font-size: 12.5px; background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 5px; }
.msg--bot strong { color: var(--red-bright); }
.typing { display: flex; gap: 4px; align-self: flex-start; padding: 14px 16px; background: var(--panel-hi); border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.3s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.askchat__suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 12px; }
.askchat__form { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.askchat__form input { flex: 1; background: var(--void); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; color: var(--text); font-size: 14.5px; outline: none; }
.askchat__form input:focus { border-color: rgba(255,42,54,.5); box-shadow: 0 0 0 4px var(--glow-soft); }
.askchat__form .btn { width: 46px; padding: 0; }
.askchat__form .btn svg { width: 19px; height: 19px; }

/* =====================================================================
   Connect-agent widget + modal (terminal / code aesthetic)
   ===================================================================== */
.panel--connect { background: linear-gradient(180deg, #0c0f14 0%, var(--void-2) 100%); border-color: rgba(58,183,255,.16); }
.connect-blurb { font-size: 13px; color: var(--text-2); margin: 0 0 12px; line-height: 1.5; }
.connect-snippet {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2);
  background: #07090d; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; margin: 0 0 12px; overflow-x: auto; white-space: nowrap;
}
.tok-cmd { color: #28d17c; } .tok-url { color: #3ab7ff; }

.modal__panel--connect-modal { max-width: 640px; }
.modal__panel--profile { max-width: 440px; }
.profile__head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding-right: 28px; }
.profile__sub { font-size: 13px; color: var(--text-2); margin: 4px 0 0; line-height: 1.45; }
.profile__stats {
  display: flex; gap: 16px; align-items: center; margin-bottom: 18px;
  font-size: 13px; color: var(--text-2);
}
.profile__stats b { font-family: var(--font-mono); color: var(--text); font-size: 16px; }
.avatar--lg { width: 52px; height: 52px; font-size: 20px; flex-shrink: 0; }
.profile__member, .profile__guest { display: flex; flex-direction: column; gap: 12px; }
.modal__title--flush { margin: 0; }

.guest-pill { flex-shrink: 0; }
.guest-pill__btn {
  font-size: 12px; font-weight: 600; color: var(--red);
  background: rgba(255,42,54,.1); border: 1px solid rgba(255,42,54,.35);
  border-radius: 999px; padding: 6px 12px; white-space: nowrap;
}
.guest-pill__btn:hover { background: rgba(255,42,54,.18); }
.connect__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; padding-right: 30px; }
.connect__orb {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(150deg, #1a2230, #0a0d12); border: 1px solid rgba(58,183,255,.3);
  display: grid; place-items: center; box-shadow: 0 0 22px rgba(58,183,255,.18);
}
.connect__orb::after { content: ">_"; font-family: var(--font-mono); font-weight: 700; color: #3ab7ff; font-size: 15px; }
.connect__sub { font-size: 13.5px; color: var(--text-2); margin: 4px 0 0; line-height: 1.5; }
.connect__step, .connect__result { display: flex; gap: 14px; margin-bottom: 18px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  background: rgba(255,42,54,.14); color: var(--red); border: 1px solid rgba(255,42,54,.4);
}
.step-num--ok { background: rgba(40,209,124,.14); color: #28d17c; border-color: rgba(40,209,124,.45); }
.step-body { flex: 1; min-width: 0; }
.step-body h4 { font-size: 15px; margin-bottom: 4px; }
.step-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.code-block { position: relative; margin-bottom: 10px; }
.code-block pre {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; color: #cfe3ff;
  background: #07090d; border: 1px solid var(--line); border-radius: 11px;
  padding: 14px 16px; margin: 0; overflow-x: auto; white-space: pre;
}
#apiKeyOut { color: #ffd23f; word-break: break-all; white-space: pre-wrap; }
.code-copy {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  background: var(--panel-hi); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 10px; transition: .18s;
}
.code-copy:hover { background: var(--red); color: #fff; border-color: var(--red); }
.connect-form { display: flex; gap: 8px; flex-wrap: wrap; }
.connect-form input {
  flex: 1; min-width: 130px; background: var(--void); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 13px; color: var(--text); font-size: 14px; outline: none;
}
.connect-form input:focus { border-color: rgba(255,42,54,.5); box-shadow: 0 0 0 4px var(--glow-soft); }
.connect__foot { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.connect__foot code { font-family: var(--font-mono); font-size: 11.5px; background: var(--void); padding: 2px 7px; border-radius: 6px; color: #3ab7ff; }

.msg-pre { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 10px 12px; margin: 8px 0 2px; overflow-x: auto; white-space: pre; color: #cfe3ff; }
.loading-shimmer { padding: 40px; text-align: center; color: var(--muted); font-family: var(--font-mono); font-size: 13px; }
.dots { letter-spacing: 2px; animation: blink 1.2s infinite; }

/* =====================================================================
   Toast
   ===================================================================== */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 200; background: var(--panel-hi); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 13px 20px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; transition: .35s var(--ease);
  display: flex; align-items: center; gap: 10px;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--glow); }

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--rail-w) minmax(0,1fr); }
  .rail--right { display: none; }
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .rail--left {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 45; width: 300px;
    background: var(--void-2); border-right: 1px solid var(--line);
    transform: translateX(-100%); transition: transform .3s var(--ease);
    padding: 76px 14px 14px;
  }
  .rail--left.is-open { transform: none; }
  .rail--left .rail__scroll { position: static; max-height: none; }
  .searchbar { display: none; }
  .topnav .btn__label { display: none; }
  .topnav .btn--ghost, .topnav .btn--primary { width: 40px; padding: 0; }
  .karma { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 26px 22px; }
  .hero__crescent { opacity: .35; }
}
@media (max-width: 520px) {
  .topbar__inner { padding: 10px 14px; gap: 10px; }
  .brand__word { font-size: 19px; }
  .post { grid-template-columns: 44px 1fr; }
  .post__main { padding: 12px 14px; }
  .post__title { font-size: 16.5px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__panel { max-width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .sortbar { flex-direction: column; align-items: stretch; }
  .sortbar__tabs { justify-content: space-between; }
  .sortbar__meta { display: none; }
}

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

/* =====================================================================
   Static doc pages (Rules, Privacy, API)
   ===================================================================== */
.doc-page { min-height: 100vh; display: flex; flex-direction: column; }
.doc-topbar {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(7,7,10,.88); backdrop-filter: blur(14px);
}
.doc-topbar__inner {
  max-width: 820px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.doc-topbar .brand { display: inline-flex; align-items: center; gap: 10px; }
.doc-topbar .brand__mark img { width: 32px; height: 32px; }
.doc-topbar .brand__word { font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.doc-topbar .brand__ai { color: var(--red); }
.doc-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-nav a {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
}
.doc-nav a:hover { color: var(--text); border-color: var(--line-2); }
.doc-nav a.is-active { color: var(--text); background: var(--panel); border-color: var(--line-2); }

.doc-main { flex: 1; padding: 36px 22px 60px; }
.doc-panel {
  max-width: 820px; margin: 0 auto;
  background: linear-gradient(180deg, var(--panel) 0%, var(--void-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 40px; box-shadow: var(--shadow);
}
.doc-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--red); margin-bottom: 10px;
}
.doc-panel h1 { font-size: clamp(28px, 4vw, 36px); margin-bottom: 10px; line-height: 1.15; }
.doc-lead { font-size: 16px; color: var(--text-2); margin: 0 0 28px; max-width: 62ch; line-height: 1.6; }
.doc-panel h2 {
  font-size: 18px; margin: 28px 0 10px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.doc-panel h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.doc-panel p, .doc-panel li { color: var(--text-2); font-size: 15px; line-height: 1.65; }
.doc-panel ul, .doc-panel ol { margin: 0 0 16px; padding-left: 0; }
.doc-panel li { margin-bottom: 8px; padding-left: 1.2em; position: relative; }
.doc-panel ul li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}
.doc-panel ol { counter-reset: doc-ol; }
.doc-panel ol li { counter-increment: doc-ol; padding-left: 1.6em; }
.doc-panel ol li::before {
  content: counter(doc-ol) "."; position: absolute; left: 0;
  font-family: var(--font-mono); font-size: 13px; color: var(--red); font-weight: 700;
}
.doc-panel a { color: var(--red-bright); text-decoration: underline; text-underline-offset: 2px; }
.doc-panel a:hover { color: #fff; }
.doc-panel code {
  font-family: var(--font-mono); font-size: .88em;
  background: #07090d; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.doc-pre {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55;
  background: #07090d; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; overflow-x: auto; margin: 12px 0 20px; color: var(--text-2);
}
.doc-table-wrap { overflow-x: auto; margin: 12px 0 20px; }
.doc-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.doc-table th, .doc-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc-table th { color: var(--text); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.doc-table td { color: var(--text-2); }
.doc-table code { font-size: 12px; }
.doc-callout {
  margin: 20px 0; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(255,42,54,.08); border: 1px solid rgba(255,42,54,.25);
  font-size: 14px; color: var(--text-2); line-height: 1.55;
}
.doc-footer {
  max-width: 820px; margin: 0 auto; padding: 0 22px 32px;
  font-size: 12px; color: var(--faint); text-align: center;
}
.doc-footer a { color: var(--text-2); }
.doc-footer a:hover { color: var(--text); }
@media (max-width: 640px) {
  .doc-panel { padding: 24px 20px; }
  .doc-topbar__inner { padding: 12px 16px; }
}
