/* ==========================================================================
   Querij — application stylesheet
   Palette: sand #FAF8F6 · ink #0F172A · terracotta gradient #E8956A → #D97252
   ========================================================================== */

:root {
  --sand: #FAF8F6;
  --sand-2: #F3EEE9;
  --card: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #7A8699;
  --line: rgba(15, 23, 42, .10);
  --line-strong: rgba(15, 23, 42, .18);

  --terra-1: #E8956A;
  --terra-2: #D97252;
  --terra-3: #C85A3A;
  --terra-soft: rgba(217, 114, 82, .10);
  --grad: linear-gradient(135deg, #E8956A 0%, #D97252 100%);

  --ok: #2F7D5B;
  --warn: #C98A16;
  --err: #C4453C;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 6px 20px -6px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .05);
  --shadow-lg: 0 22px 50px -18px rgba(15, 23, 42, .22);
  --shadow-terra: 0 10px 24px -10px rgba(217, 114, 82, .55);

  --shell: 80rem;
  --shell-pad: 1.25rem;
  --header-h: 4.25rem;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* ------------------------------ reset ------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

h1, h2, h3, h4 { margin: 0; line-height: 1.22; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 .75rem; padding-left: 1.15rem; }
img, svg, video { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

a { color: var(--terra-3); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible {
  outline: 2px solid var(--terra-2);
  outline-offset: 2px;
  border-radius: 4px;
}

code, pre, kbd { font-family: var(--mono); font-size: .875em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

[hidden] { display: none !important; }

/* ------------------------------ layout ------------------------------ */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
}
.shell.narrow { max-width: 52rem; }

.site-main { min-height: 60vh; padding-bottom: 4rem; }

.layout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  padding-top: 1.75rem;
}
@media (min-width: 1024px) {
  .layout-2col { grid-template-columns: minmax(0, 1fr) 20.5rem; gap: 2rem; }
  .col-side { position: sticky; top: calc(var(--header-h) + 1.25rem); }
}
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.col-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

.page-head { padding-top: 2rem; }
.page-head h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
.page-head p { margin-top: .4rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.feed-page { padding-top: 2rem; }
.feed-page .section-title { font-size: clamp(1.45rem, 3vw, 1.85rem); letter-spacing: -.02em; }
.section-title { font-size: 1.3rem; }
.section-sub { color: var(--ink-2); font-size: .9rem; margin: 0; }

.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--terra-3); margin-bottom: .6rem;
}
.muted { color: var(--ink-2); }
.hint { color: var(--ink-3); font-size: .82rem; margin: .4rem 0 0; }
.dot { color: var(--ink-3); }

/* ------------------------------ header ------------------------------ */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 248, 246, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 1rem;
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 2.15rem; height: 2.15rem; border-radius: 11px;
  background: var(--grad); color: #fff;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -.03em;
  box-shadow: var(--shadow-terra);
}
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; }
.brand-lg .brand-mark { width: 2.75rem; height: 2.75rem; font-size: 1.4rem; border-radius: 14px; }
.brand-lg .brand-name { font-size: 1.5rem; }

.search { position: relative; flex: 1 1 auto; max-width: 26rem; display: none; }
.search-icon {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  width: 1.05rem; height: 1.05rem; color: var(--ink-3); pointer-events: none;
}
.search input {
  width: 100%; padding: .58rem .9rem .58rem 2.4rem;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-pill); font-size: .9rem; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--terra-2); box-shadow: 0 0 0 3px var(--terra-soft); }
@media (min-width: 768px) { .search { display: block; } }

.site-nav { display: none; gap: .25rem; margin-left: auto; }
.site-nav a {
  padding: .45rem .8rem; border-radius: var(--r-pill);
  color: var(--ink-2); font-size: .9rem; font-weight: 600;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--sand-2); color: var(--ink); text-decoration: none; }
.site-nav a.is-active { background: var(--terra-soft); color: var(--terra-3); }
@media (min-width: 1024px) { .site-nav { display: flex; } }

.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
@media (min-width: 1024px) { .header-actions { margin-left: 0; } }
.header-actions .btn svg { width: 1rem; height: 1rem; }
@media (max-width: 640px) { .header-actions .btn span { display: none; } }

.nav-toggle {
  display: grid; gap: 4px; padding: .55rem;
  background: none; border: 1px solid var(--line); border-radius: var(--r-sm);
}
.nav-toggle span { display: block; width: 1.1rem; height: 2px; background: var(--ink); border-radius: 2px; }
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.mobile-nav {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line); background: var(--card);
  padding: .5rem var(--shell-pad) 1rem;
}
.mobile-nav a, .mobile-nav button {
  padding: .7rem .25rem; text-align: left;
  color: var(--ink); font-weight: 600; font-size: .95rem;
  background: none; border: 0; border-bottom: 1px solid var(--line);
}
.mobile-nav a:hover { text-decoration: none; color: var(--terra-3); }

.user-menu { position: relative; }
.avatar-btn { background: none; border: 0; padding: 0; border-radius: var(--r-pill); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 120;
  min-width: 13rem; padding: .4rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.user-dropdown-head {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .6rem .7rem; margin-bottom: .25rem; border-bottom: 1px solid var(--line);
}
.user-dropdown-head span { font-size: .8rem; color: var(--ink-2); }
.user-dropdown a, .user-dropdown button {
  padding: .5rem .7rem; border-radius: var(--r-sm); text-align: left;
  background: none; border: 0; color: var(--ink); font-size: .9rem; font-weight: 500;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--sand-2); text-decoration: none; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 2.15rem; height: 2.15rem; border-radius: var(--r-pill);
  background: var(--grad); color: #fff; font-weight: 700; font-size: .9rem;
  text-transform: uppercase; line-height: 1;
}
.avatar-xs { width: 1.4rem; height: 1.4rem; font-size: .65rem; }
.avatar-sm { width: 1.9rem; height: 1.9rem; font-size: .8rem; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1.15rem; }
.avatar-xl { width: 5.5rem; height: 5.5rem; font-size: 2rem; border: 4px solid var(--card); }

/* ------------------------------ buttons ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.15rem;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: .92rem; font-weight: 600; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.05rem; height: 1.05rem; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }

.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-terra); }
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 14px 28px -10px rgba(217, 114, 82, .6); }

.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); background: rgba(15, 23, 42, .03); }

.btn-secondary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-secondary:hover { background: #1e293b; border-color: #1e293b; }

.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-strong); }
.btn-ghost.is-active { color: var(--terra-3); border-color: var(--terra-2); background: var(--terra-soft); }

.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }

.btn-sm { padding: .45rem .85rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn-block + .btn-block { margin-top: .5rem; }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--terra-3); font-size: .85rem; font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

/* ------------------------------ cards ------------------------------ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}
.card-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1rem; font-weight: 700; margin-bottom: .85rem;
}
.card-title svg { width: 1.05rem; height: 1.05rem; color: var(--terra-2); }
.sub-title { font-size: .9rem; font-weight: 700; margin: 1rem 0 .5rem; }

.card-cta {
  background: linear-gradient(160deg, #fff 0%, #FDF4EF 100%);
  border-color: rgba(217, 114, 82, .22);
}
.card-cta h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.card-cta p { color: var(--ink-2); font-size: .9rem; margin-bottom: .9rem; }

.big-number { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 .75rem; }

/* ------------------------------ hero ------------------------------ */

.hero {
  background:
    radial-gradient(1000px 420px at 88% -12%, rgba(232, 149, 106, .22), transparent 62%),
    radial-gradient(760px 340px at 4% 4%, rgba(217, 114, 82, .10), transparent 60%);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem;
  padding-top: 3rem; padding-bottom: 3rem; align-items: center;
}
@media (min-width: 1024px) {
  .hero-inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); padding-top: 4.25rem; padding-bottom: 4.25rem; }
}
.hero-copy h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); letter-spacing: -.035em; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-copy > p { margin-top: 1rem; max-width: 34rem; font-size: 1.06rem; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin: 2.25rem 0 0; }
.hero-stats dt { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.hero-stats dd { margin: .15rem 0 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }

.hero-art { position: relative; display: none; min-height: 17rem; }
@media (min-width: 1024px) { .hero-art { display: block; } }
.hero-orb {
  position: absolute; inset: 8% 6% 8% 12%;
  background: var(--grad); border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%;
  filter: blur(2px); opacity: .22;
  animation: orb 14s ease-in-out infinite;
}
@keyframes orb {
  0%, 100% { border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%; transform: rotate(0deg); }
  50%      { border-radius: 58% 42% 38% 62% / 42% 58% 42% 58%; transform: rotate(8deg); }
}
.hero-card {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: .8rem;
  margin: 2.5rem 1.5rem; padding: 1.4rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
}
.hero-card-row { display: flex; align-items: center; gap: .7rem; }
.hero-pill { width: 2.1rem; height: 2.1rem; border-radius: var(--r-pill); background: var(--grad); flex: none; }
.hero-bar { display: block; height: .7rem; border-radius: var(--r-pill); background: var(--sand-2); }
.hero-bar.w-90 { width: 90%; } .hero-bar.w-70 { width: 70%; } .hero-bar.w-60 { width: 60%; }
.hero-card-foot { display: flex; gap: .45rem; margin-top: .25rem; }
.hero-chip { width: 3.4rem; height: 1.3rem; border-radius: var(--r-pill); background: var(--terra-soft); }

/* ------------------------------ feed tabs ------------------------------ */

.feed-tabs {
  display: inline-flex; gap: .25rem; padding: .28rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-pill); box-shadow: var(--shadow-xs);
  overflow-x: auto; max-width: 100%;
}
.feed-tab {
  padding: .45rem 1rem; border-radius: var(--r-pill);
  color: var(--ink-2); font-size: .88rem; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s;
}
.feed-tab:hover { background: var(--sand-2); color: var(--ink); text-decoration: none; }
.feed-tab.is-active { background: var(--grad); color: #fff; box-shadow: var(--shadow-terra); }
.feed-tab.is-active:hover { color: #fff; }

/* ------------------------------ thread cards ------------------------------ */

.thread-list { display: flex; flex-direction: column; gap: .9rem; }

.thread-card {
  display: flex; gap: 1rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.thread-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.thread-body { min-width: 0; flex: 1; }

.vote-rail {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  flex: none; padding-top: .1rem;
}
.vote-btn {
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; padding: 0;
  background: var(--sand); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-3);
  transition: color .15s, background .15s, border-color .15s;
}
.vote-btn svg { width: 1rem; height: 1rem; }
.vote-btn:hover { color: var(--terra-3); border-color: var(--terra-2); background: var(--terra-soft); }
.vote-btn.is-active { color: #fff; background: var(--grad); border-color: transparent; }
.vote-down.is-active { background: var(--ink); }
.vote-score { font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.vote-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem; background: var(--sand); border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.vote-pill .vote-score { padding: 0 .3rem; }
.vote-pill .vote-btn { border-radius: var(--r-pill); }

.thread-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  font-size: .82rem; color: var(--ink-2); margin-bottom: .5rem;
}
.thread-author { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); font-weight: 600; }
.thread-author:hover { color: var(--terra-3); text-decoration: none; }

.thread-title { font-size: 1.12rem; letter-spacing: -.015em; }
.thread-title a { color: var(--ink); }
.thread-title a:hover { color: var(--terra-3); text-decoration: none; }
.thread-excerpt { margin: .5rem 0 0; color: var(--ink-2); font-size: .93rem; }

.thread-stats { display: flex; align-items: center; gap: 1rem; margin-top: .85rem; }
.stat {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .82rem; font-weight: 600; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.stat svg { width: .95rem; height: .95rem; }
.stat-btn { background: none; border: 0; padding: .15rem; border-radius: var(--r-sm); transition: color .15s; }
.stat-btn:hover, a.stat:hover { color: var(--terra-3); text-decoration: none; }
.stat-btn.is-active { color: var(--terra-3); }
.stat-btn.is-active svg { fill: currentColor; }

.chip {
  display: inline-flex; align-items: center;
  padding: .12rem .5rem; border-radius: var(--r-pill);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid transparent;
}
.chip-ai { background: var(--terra-soft); color: var(--terra-3); border-color: rgba(217, 114, 82, .22); }
.chip-summary { background: rgba(47, 125, 91, .10); color: var(--ok); border-color: rgba(47, 125, 91, .2); }
.chip-admin { background: var(--ink); color: #fff; }

/* ------------------------------ tags ------------------------------ */

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem;
  background: var(--sand); border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink-2); font-size: .78rem; font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.tag:hover { background: var(--terra-soft); color: var(--terra-3); border-color: rgba(217, 114, 82, .3); text-decoration: none; }
.tag.is-active { background: var(--grad); color: #fff; border-color: transparent; }
.tag-static { pointer-events: none; }
.tag-count { color: var(--ink-3); font-weight: 500; font-size: .72rem; }
.tag.is-active .tag-count { color: rgba(255, 255, 255, .8); }
.tag-btn.is-following { background: var(--grad); color: #fff; border-color: transparent; }
.tag-picker { margin-top: .6rem; }

/* ------------------------------ empty / error ------------------------------ */

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  padding: 3rem 1.5rem; text-align: center;
  background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--r-xl);
}
.empty-state h3 { font-size: 1.1rem; }
.empty-state p { color: var(--ink-2); max-width: 26rem; }
.empty-state .btn { margin-top: .5rem; }
.empty-sm { padding: 2rem 1rem; }

.error-card { text-align: center; padding: 3rem 1.5rem; margin-top: 2.5rem; }
.error-code {
  display: block; font-size: 4.5rem; font-weight: 800; letter-spacing: -.05em; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.error-card h1 { margin: .5rem 0; font-size: 1.6rem; }
.error-card .btn-row { justify-content: center; margin-top: 1.25rem; }
.error-tags { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.error-tags .tag-row { justify-content: center; }

.auth-gate { text-align: center; padding: 2.75rem 1.5rem; margin-top: 1.5rem; }
.auth-gate h1, .auth-gate h2 { font-size: 1.45rem; margin-bottom: .5rem; }
.auth-gate p { color: var(--ink-2); }
.auth-gate .btn-row { justify-content: center; margin-top: 1.25rem; }

/* ------------------------------ pagination ------------------------------ */

.pagination { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.page-numbers { display: flex; align-items: center; gap: .3rem; }
.page-link {
  display: grid; place-items: center; min-width: 2.3rem; height: 2.3rem; padding: 0 .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-2); font-size: .87rem; font-weight: 600;
}
.page-link:hover { border-color: var(--terra-2); color: var(--terra-3); text-decoration: none; }
.page-link.is-current { background: var(--grad); color: #fff; border-color: transparent; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }
.page-gap { color: var(--ink-3); padding: 0 .2rem; }

/* ------------------------------ breadcrumb ------------------------------ */

.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  padding: 1.35rem 0 .35rem; font-size: .84rem; color: var(--ink-3);
}
.breadcrumb a { color: var(--ink-2); font-weight: 500; }
.breadcrumb a:hover { color: var(--terra-3); }
.crumb-current { color: var(--ink); font-weight: 600; }

/* ------------------------------ prose ------------------------------ */

.prose { color: var(--ink); font-size: 1.02rem; line-height: 1.75; overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.75rem 0 .7rem; }
.prose h1 { font-size: 1.6rem; } .prose h2 { font-size: 1.3rem; } .prose h3 { font-size: 1.1rem; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .35rem; }
.prose a { color: var(--terra-3); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
  margin: 1.25rem 0; padding: .6rem 0 .6rem 1.1rem;
  border-left: 3px solid var(--terra-2); color: var(--ink-2); font-style: italic;
}
.prose code { background: var(--sand-2); padding: .15rem .4rem; border-radius: 5px; }
.prose pre {
  margin: 1.25rem 0; padding: 1rem 1.1rem; overflow-x: auto;
  background: #14213A; color: #E6EAF2; border-radius: var(--r-md);
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose img { border-radius: var(--r-md); margin: 1rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .93rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; }
.prose th { background: var(--sand); font-weight: 700; }
.prose hr { margin: 2rem 0; }

/* ------------------------------ thread detail ------------------------------ */

.thread-detail { padding: 1.75rem; }
.thread-headline { font-size: clamp(1.55rem, 3.4vw, 2.15rem); margin: .4rem 0 .1rem; }
.thread-content { margin-top: 1.35rem; }

.thread-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .65rem;
  margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.toolbar-stat {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-left: auto; color: var(--ink-3); font-size: .84rem; font-weight: 600;
}
.toolbar-stat svg { width: 1rem; height: 1rem; }

.summary-card {
  background: linear-gradient(160deg, #FFF9F5 0%, #FFFFFF 62%);
  border-color: rgba(217, 114, 82, .22);
}
.summary-text { font-size: 1.02rem; color: var(--ink); }
.insight-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.insight-list li { position: relative; padding-left: 1.5rem; color: var(--ink-2); font-size: .94rem; }
.insight-list li::before {
  content: ''; position: absolute; left: .35rem; top: .58rem;
  width: .45rem; height: .45rem; border-radius: 50%; background: var(--grad);
}

.pros-cons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .pros-cons { grid-template-columns: 1fr 1fr; } }
.pc-col { padding: .9rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line); }
.pc-col h3 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }
.pc-col ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; color: var(--ink-2); }
.pc-col li { margin-bottom: .3rem; }
.pc-pros { background: rgba(47, 125, 91, .06); border-color: rgba(47, 125, 91, .2); }
.pc-pros h3 { color: var(--ok); }
.pc-cons { background: rgba(196, 69, 60, .05); border-color: rgba(196, 69, 60, .18); }
.pc-cons h3 { color: var(--err); }

.stat-list { display: flex; flex-direction: column; gap: .55rem; margin: 0; }
.stat-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.stat-list dt { color: var(--ink-2); font-size: .88rem; }
.stat-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.author-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.author-row:hover { text-decoration: none; }
.author-row > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.author-row strong { color: var(--ink); }
.author-row .muted { font-size: .82rem; }

.link-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .85rem; }
.link-list li { display: flex; flex-direction: column; gap: .15rem; }
.link-list a { color: var(--ink); font-weight: 600; font-size: .92rem; line-height: 1.4; }
.link-list a:hover { color: var(--terra-3); text-decoration: none; }
.link-list .muted { font-size: .78rem; }

.how-list { margin: 0; padding-left: 1.2rem; color: var(--ink-2); font-size: .9rem; }
.how-list li { margin-bottom: .5rem; }
.how-list strong { color: var(--ink); }
.tips-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.tips-list li { padding-left: 1.1rem; position: relative; color: var(--ink-2); font-size: .93rem; }
.tips-list li::before { content: '→'; position: absolute; left: 0; color: var(--terra-2); font-weight: 700; }
.tips-card { margin-top: 1.25rem; }

/* ------------------------------ poll ------------------------------ */

.poll-question { font-weight: 600; margin-bottom: .9rem; }
.poll-options { display: flex; flex-direction: column; gap: .5rem; }
.poll-option {
  position: relative; display: flex; align-items: center; gap: .75rem;
  padding: .65rem .9rem; overflow: hidden; text-align: left;
  background: var(--sand); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: .92rem; font-weight: 500;
  transition: border-color .15s;
}
.poll-option:hover { border-color: var(--terra-2); }
.poll-option.is-selected { border-color: var(--terra-2); background: var(--terra-soft); font-weight: 600; }
.poll-fill { position: absolute; inset: 0 auto 0 0; background: rgba(217, 114, 82, .14); z-index: 0; transition: width .3s; }
.poll-label, .poll-pct { position: relative; z-index: 1; }
.poll-label { flex: 1; min-width: 0; }
.poll-pct { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.poll-total { margin-top: .75rem; font-size: .82rem; }

/* ------------------------------ comments ------------------------------ */

.comments-section { display: flex; flex-direction: column; gap: 1rem; }
.comment-list { display: flex; flex-direction: column; gap: .85rem; }

.comment {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.1rem;
  box-shadow: var(--shadow-xs);
}
.comment.is-best { border-color: rgba(47, 125, 91, .35); background: linear-gradient(170deg, rgba(47, 125, 91, .05), #fff 45%); }
.comment.is-reply { box-shadow: none; }
.best-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-bottom: .6rem; padding: .18rem .6rem; border-radius: var(--r-pill);
  background: rgba(47, 125, 91, .12); color: var(--ok);
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.best-badge svg { width: .85rem; height: .85rem; stroke-width: 2.6; }

.comment-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  font-size: .82rem; color: var(--ink-2); margin-bottom: .5rem;
}
.comment-author { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); font-weight: 600; }
.comment-author:hover { color: var(--terra-3); text-decoration: none; }
.comment-body { font-size: .96rem; line-height: 1.68; }
.comment-body p { margin-bottom: .6rem; }

.comment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: .75rem; }
.vote-inline {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .5rem; border-radius: var(--r-pill);
  background: var(--sand); border: 1px solid var(--line);
  color: var(--ink-3); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: color .15s, border-color .15s, background .15s;
}
.vote-inline svg { width: .9rem; height: .9rem; }
.vote-inline:hover { color: var(--terra-3); border-color: var(--terra-2); }
.vote-inline.is-active { color: #fff; background: var(--grad); border-color: transparent; }

.comment-replies {
  display: flex; flex-direction: column; gap: .65rem;
  margin: .9rem 0 0 .5rem; padding-left: 1rem;
  border-left: 2px solid var(--line);
}

.comment-form { display: flex; flex-direction: column; gap: .7rem; }
.comment-form-head { display: flex; align-items: center; gap: .55rem; font-size: .86rem; color: var(--ink-2); }
.comment-form textarea { min-height: 6.5rem; }
.reply-context {
  display: flex; align-items: center; gap: .5rem; margin: 0;
  padding: .45rem .7rem; border-radius: var(--r-sm);
  background: var(--terra-soft); color: var(--terra-3); font-size: .84rem;
}
.signin-prompt { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* ------------------------------ forms ------------------------------ */

.field { display: flex; flex-direction: column; margin-bottom: 1.1rem; }
.field > label { font-size: .87rem; font-weight: 600; margin-bottom: .4rem; }

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=url], select, textarea {
  width: 100%; padding: .68rem .85rem;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--terra-2); box-shadow: 0 0 0 3px var(--terra-soft);
}
textarea { resize: vertical; min-height: 5rem; line-height: 1.6; font-family: inherit; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .87rem; font-weight: 500; }
.check input { width: auto; }

.form-card { margin-top: 1.25rem; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.form-row-end { justify-content: flex-end; }
.form-error {
  margin: .85rem 0 0; padding: .6rem .8rem; border-radius: var(--r-sm);
  background: rgba(196, 69, 60, .08); border: 1px solid rgba(196, 69, 60, .25);
  color: var(--err); font-size: .87rem; font-weight: 500;
}
.dupe-warning {
  margin-top: .7rem; padding: .7rem .9rem; border-radius: var(--r-md);
  background: rgba(201, 138, 22, .08); border: 1px solid rgba(201, 138, 22, .28);
  font-size: .87rem;
}
.dupe-warning ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* ------------------------------ auth page ------------------------------ */

.auth-split { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
@media (min-width: 1024px) { .auth-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.auth-pane { display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.auth-box { width: 100%; max-width: 25rem; }
.auth-box > .brand { margin-bottom: 2rem; }
.auth-box h1 { font-size: 1.7rem; margin-bottom: .4rem; }
.auth-box .muted { margin-bottom: 1.5rem; }

.auth-tabs {
  display: flex; gap: .25rem; padding: .28rem; margin-bottom: 1.75rem;
  background: var(--sand-2); border-radius: var(--r-pill);
}
.auth-tab {
  flex: 1; padding: .5rem; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--ink-2); font-size: .88rem; font-weight: 600;
  transition: background .15s, color .15s;
}
.auth-tab.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-xs); }
.auth-form .btn-block { margin-top: .5rem; }
.auth-switch { margin-top: 1.25rem; font-size: .88rem; color: var(--ink-2); text-align: center; }
.auth-legal { margin-top: 2rem; font-size: .78rem; color: var(--ink-3); text-align: center; }

.auth-aside {
  display: none; position: relative; overflow: hidden;
  background:
    radial-gradient(600px 400px at 80% 20%, rgba(255, 255, 255, .22), transparent 60%),
    var(--grad);
  color: #fff;
}
@media (min-width: 1024px) { .auth-aside { display: flex; align-items: center; } }
.auth-aside-inner { padding: 4rem; max-width: 30rem; }
.auth-aside blockquote { margin: 0 0 2.5rem; font-size: 1.4rem; line-height: 1.5; font-weight: 600; letter-spacing: -.02em; }
.auth-perks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .8rem; }
.auth-perks li { position: relative; padding-left: 1.7rem; font-size: 1rem; opacity: .95; }
.auth-perks li::before {
  content: '✓'; position: absolute; left: 0; top: -.05rem;
  display: grid; place-items: center; width: 1.2rem; height: 1.2rem;
  border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: .7rem; font-weight: 700;
}

/* ------------------------------ profile ------------------------------ */

.profile-banner { height: 9rem; background: var(--grad); }
@media (min-width: 768px) { .profile-banner { height: 12rem; } }
.profile-head-wrap { margin-top: -3.25rem; }
.profile-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.25rem; }
.profile-identity { flex: 1; min-width: 12rem; }
.profile-identity h1 { font-size: 1.6rem; }
.profile-identity .muted { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .87rem; margin: .3rem 0 0; }
.profile-bio { margin-top: .75rem; color: var(--ink-2); max-width: 44rem; }
.profile-actions { display: flex; gap: .5rem; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .6rem; }
.badge {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .7rem; border-radius: var(--r-md);
  background: var(--sand); border: 1px solid var(--line);
  font-size: .78rem; text-align: center;
}
.badge strong { font-size: .8rem; }
.badge.is-earned { background: var(--terra-soft); border-color: rgba(217, 114, 82, .28); color: var(--terra-3); }
.badge.is-locked { opacity: .5; }

.people-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.people-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.people-list a { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 600; font-size: .9rem; }
.people-list a:hover { color: var(--terra-3); text-decoration: none; }
.people-list .muted { font-size: .78rem; white-space: nowrap; }

/* ------------------------------ tag page ------------------------------ */

.tag-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem; margin-top: .5rem; }
.tag-header h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.tag-header p { margin-top: .35rem; }
.tag-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------ legal ------------------------------ */

.legal-doc { margin: 1rem 0 3rem; padding: 2.25rem; }
.legal-doc header { padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.legal-doc h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.legal-doc h2 { font-size: 1.15rem; margin-top: 2rem; }

/* ------------------------------ admin ------------------------------ */

.admin-wrap { padding-bottom: 3rem; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

.admin-tabs {
  display: flex; gap: .3rem; overflow-x: auto; margin: 1.5rem 0 1.25rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.admin-tab {
  padding: .5rem .95rem; border: 1px solid transparent; border-radius: var(--r-pill);
  background: none; color: var(--ink-2); font-size: .87rem; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s;
}
.admin-tab:hover { background: var(--sand-2); color: var(--ink); }
.admin-tab.is-active { background: var(--grad); color: #fff; box-shadow: var(--shadow-terra); }

.admin-panel { display: none; flex-direction: column; gap: 1.25rem; }
.admin-panel.is-active { display: flex; }

.admin-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 900px) { .admin-grid-2 { grid-template-columns: 1fr 1fr; } }
.admin-grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 768px) { .admin-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .85rem; }
.stat-card {
  padding: 1.1rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.stat-card .stat-label {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
}
.stat-card .stat-value {
  display: block; margin-top: .35rem;
  font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.stat-card.is-accent { background: linear-gradient(150deg, #FFF7F2, #fff); border-color: rgba(217, 114, 82, .25); }
.stat-card.is-accent .stat-value { color: var(--terra-3); }
.stat-card.is-loading { opacity: .6; }

.toolbar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.toolbar-wrap { flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 0; }
.toolbar select { width: auto; min-width: 11rem; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.data-table th, .data-table td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
}
.data-table tbody tr:hover { background: var(--sand); }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td.actions { white-space: nowrap; text-align: right; }
.data-table .cell-title { font-weight: 600; color: var(--ink); }
.data-table .cell-sub { display: block; color: var(--ink-3); font-size: .78rem; margin-top: .15rem; }
.data-table code { font-size: .78rem; word-break: break-all; }
.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-top: .9rem; font-size: .85rem; color: var(--ink-2);
}

.pill {
  display: inline-flex; align-items: center; padding: .1rem .5rem; border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.pill-ok { background: rgba(47, 125, 91, .12); color: var(--ok); }
.pill-warn { background: rgba(201, 138, 22, .14); color: var(--warn); }
.pill-err { background: rgba(196, 69, 60, .12); color: var(--err); }
.pill-muted { background: var(--sand-2); color: var(--ink-2); }

.reason-list { display: flex; flex-wrap: wrap; gap: .25rem; }
.seed-status { margin-top: 1rem; padding: .9rem 1rem; background: var(--sand); border: 1px solid var(--line); border-radius: var(--r-md); font-size: .88rem; }
.progress-track { height: .5rem; background: var(--sand-2); border-radius: var(--r-pill); overflow: hidden; margin: .6rem 0; }
.progress-bar { height: 100%; background: var(--grad); border-radius: var(--r-pill); transition: width .4s; }

.admin-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.muted.tight { margin-top: -.35rem; margin-bottom: .85rem; }
.field-hint { margin: .4rem 0 0; font-size: .75rem; color: var(--ink-3); font-family: var(--font-mono, ui-monospace, monospace); }

.seed-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.seed-mode {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: .85rem .5rem; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--card); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.seed-mode:hover { border-color: var(--ink-3); background: var(--sand); }
.seed-mode.is-active {
  border-color: var(--terra-2); background: rgba(217, 114, 82, .08);
  box-shadow: 0 0 0 2px rgba(217, 114, 82, .15);
}
.seed-mode-label { font-size: .9rem; font-weight: 700; color: var(--ink); }
.seed-mode.is-active .seed-mode-label { color: var(--terra-3); }
.seed-mode-desc { font-size: .68rem; color: var(--ink-3); margin-top: .2rem; }

.callout {
  border-radius: var(--r-md); padding: .85rem 1rem; margin-bottom: 1rem; font-size: .88rem; line-height: 1.45;
}
.callout strong { display: block; margin-bottom: .25rem; }
.callout p { margin: 0; }
.callout-warn { border: 1px solid #f0d4a0; background: #fff8eb; color: #5c3d0a; }
.callout-error {
  border: 1px solid #f0c4c0; background: #fff1f0; color: #7a1f1a;
  font-family: var(--font-mono, ui-monospace, monospace); font-size: .78rem;
  white-space: pre-wrap; word-break: break-word;
}

.active-model {
  background: linear-gradient(90deg, rgba(15, 23, 42, .04), rgba(30, 41, 59, .04));
  border: 1px solid rgba(15, 23, 42, .1); border-radius: var(--r-md);
  padding: .85rem 1rem; margin-bottom: 1rem;
}
.active-model-id { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .2rem 0 0; word-break: break-all; }

.model-list {
  max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: .45rem;
  margin-bottom: 1rem; padding-right: .15rem;
}
.model-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card);
}
.model-row.is-active { border-color: var(--ink); background: rgba(15, 23, 42, .04); }
.model-name { margin: 0; font-size: .88rem; font-weight: 700; }
.model-sub { margin: .15rem 0 0; font-size: .72rem; color: var(--ink-3); }
.model-sub code { font-size: .68rem; }
.model-actions { display: flex; gap: .35rem; flex-shrink: 0; }
.custom-model-field { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .25rem; }
.inline-fields { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-fields input { flex: 1 1 12rem; min-width: 0; }

.seed-progress-head {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.seed-counts { display: flex; gap: 1.25rem; margin-top: .55rem; font-size: .78rem; font-weight: 600; }
.seed-tokens { margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.dot-ok { background: var(--ok); }
.dot-err { background: #f87171; }
.text-accent { color: var(--terra-2); }
.text-ok { color: var(--ok); }
.seed-help { background: linear-gradient(135deg, rgba(232, 160, 136, .12), rgba(217, 114, 82, .08)); border-color: #f0c4b0; }
.help-list { margin: 0; padding-left: 1.1rem; color: var(--ink-2); font-size: .88rem; line-height: 1.55; }
.help-list li + li { margin-top: .35rem; }
.help-list strong { color: var(--ink); }
.kv-list { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: .4rem 1rem; margin: 0; font-size: .88rem; }
.kv-list dt { color: var(--ink-2); }
.kv-list dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ------------------------------ footer ------------------------------ */

.site-footer { border-top: 1px solid var(--line); background: var(--card); }
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem;
  padding-top: 3rem; padding-bottom: 2.5rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-brand p { margin-top: .9rem; color: var(--ink-2); font-size: .9rem; max-width: 24rem; }
.footer-col { display: flex; flex-direction: column; gap: .5rem; }
.footer-col h3 {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: .25rem;
}
.footer-col a { color: var(--ink-2); font-size: .9rem; }
.footer-col a:hover { color: var(--terra-3); text-decoration: none; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.25rem; padding-bottom: 1.75rem;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: .82rem;
}

/* ------------------------------ toasts ------------------------------ */

.toast-stack {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 300;
  display: flex; flex-direction: column-reverse; gap: .5rem;
  max-width: calc(100vw - 2rem); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: .6rem;
  min-width: 15rem; max-width: 24rem; padding: .7rem .9rem;
  background: var(--ink); color: #fff;
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-size: .88rem; font-weight: 500;
  pointer-events: auto;
  animation: toast-in .22s ease-out;
}
.toast.is-out { animation: toast-out .2s ease-in forwards; }
.toast-success { background: #1E6B4E; }
.toast-error { background: #A93A32; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.5rem) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(.4rem) scale(.97); } }

/* ------------------------------ misc ------------------------------ */

.is-loading-shimmer {
  background: linear-gradient(90deg, var(--sand-2) 25%, #fff 50%, var(--sand-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .site-footer, .col-side, .thread-toolbar, .comment-form, .toast-stack { display: none !important; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; padding: 0; }
}
