/* Otherworld tokens (mirrors apps/web/src/tokens.css and docs/design/design-system/brand-bible.md). */
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"); }
@font-face { font-family: "Rationale"; font-style: normal; font-display: swap; font-weight: 400; src: url("/assets/fonts/rationale-latin-400-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg-0: #050611; --bg-1: #080a17; --bg-2: #0c0f20; --bg-3: #121629; --bg-4: #1a2035;
  --app-sky: radial-gradient(ellipse 88% 72% at 52% 38%, rgb(111 158 234 / 0.028) 0%, rgb(111 158 234 / 0.012) 44%, transparent 72%), #04050f;
  --text-1: #e8eaf0; --text-2: #a6adbd; --text-3: #6e7585;
  --accent: #6f9eea; --accent-strong: #87aff0; --accent-press: #5886d2; --accent-tint: rgba(111,158,234,.11); --accent-tint-weak: rgba(111,158,234,.06); --accent-ring: rgba(111,158,234,.46); --on-accent: #09111b;
  --good: #5fc98e; --good-tint: rgba(95,201,142,.12); --danger: #f06e7c; --danger-tint: rgba(240,110,124,.12); --warning: #f5c451; --warning-tint: rgba(245,196,81,.12);
  --romance: #f472b6; --xp: #a78bfa; --xp-tint: rgba(167,139,250,.14);
  --system-accent: #93c5fd; --system-surface: #11151c; --system-border: #273142;
  --hairline: rgba(255,255,255,.09); --hairline-soft: rgba(255,255,255,.055);
  --font-ui: "Inter Variable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --font-display: "Rationale", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --type-12: 13px; --type-14: 15px; --type-16: 17px; --type-20: 20px; --type-24: 24px; --type-32: 32px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-s: 6px; --radius-m: 12px;
  --shadow-1: 0 10px 28px rgba(0,0,0,.38);
  --glass-bg: rgba(8,10,23,.86); --glass-border: rgba(255,255,255,.07);
  --dur-fast: 120ms; --dur-med: 240ms; --ease: cubic-bezier(.4,0,.2,1);
  --tabbar-h: 64px;
}
@media (prefers-reduced-motion: reduce) { :root { --dur-fast: 0ms; --dur-med: 0ms; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--app-sky); color: var(--text-1); font-family: var(--font-ui); font-size: var(--type-14); line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
svg.icon { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
h3 svg.icon { margin-right: 4px; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-3); padding: calc(env(safe-area-inset-top) + 10px) var(--space-4) 10px; background: var(--glass-bg); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid var(--glass-border); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand img.mascot { width: 34px; height: 34px; flex: none; margin-block: -4px; }
.brand img.word { height: 15px; width: auto; opacity: .95; }
.brand .product { font-family: var(--font-display); color: var(--text-2); font-size: var(--type-16); letter-spacing: .02em; white-space: nowrap; }
.topbar .spacer { flex: 1; }
@media (max-width: 440px) { .brand .product { display: none; } .user-chip { display: none; } }
.brand img.word { flex: none; }
.user-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--hairline-soft); color: var(--text-2); font-size: var(--type-12); white-space: nowrap; }
.user-chip b { color: var(--text-1); font-weight: 600; }
.main { padding: var(--space-4) var(--space-4) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--space-5)); max-width: 1320px; width: 100%; margin: 0 auto; min-width: 0; }
.sidebar { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--glass-bg); backdrop-filter: blur(26px) saturate(190%); -webkit-backdrop-filter: blur(26px) saturate(190%); border-top: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 500; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--accent); }
.demo-banner svg { width: 16px; height: 16px; flex: 0 0 16px; }
.demo-banner { display: flex; gap: 8px; align-items: center; padding: 8px var(--space-4); background: var(--warning-tint); color: var(--warning); font-size: var(--type-12); border-bottom: 1px solid rgba(245,196,81,.18); }

@media (min-width: 1024px) {
  .shell { grid-template-columns: 248px 1fr; }
  .shell > .topbar { grid-column: 1 / -1; }
  .sidebar { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 57px; align-self: start; height: calc(100dvh - 57px); padding: var(--space-4) var(--space-3); border-right: 1px solid var(--hairline-soft); background: var(--bg-1); overflow: auto; }
  .sidebar .group { margin: var(--space-4) var(--space-2) var(--space-1); color: var(--text-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .sidebar a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
  .sidebar a svg { width: 20px; height: 20px; }
  .sidebar a .txt { display: grid; min-width: 0; }
  .sidebar a .l { color: inherit; font-size: 14.5px; }
  .sidebar a .h { color: var(--text-3); font-size: 12px; font-weight: 400; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar a:hover { background: var(--bg-2); color: var(--text-1); }
  .sidebar a.active { background: var(--accent-tint); color: var(--text-1); }
  .sidebar a.active svg { color: var(--accent); }
  .tabbar { display: none; }
  .main { padding: var(--space-5) var(--space-6) var(--space-7); }
}

/* ---------- typography ---------- */
.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-2) 0 var(--space-5); }
.page-head .titles { min-width: 0; max-width: 780px; }
.page-head h1 { font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 1.05; margin: 0; letter-spacing: .01em; }
.page-head .sub { color: var(--text-2); font-size: var(--type-14); margin: 8px 0 0; line-height: 1.5; }
@media (max-width: 600px) { .page-head h1 { font-size: 30px; } .page-head { margin-bottom: var(--space-4); } }
.page-head .actions { margin-left: auto; display: flex; gap: var(--space-2); flex-wrap: wrap; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--type-24); margin: var(--space-5) 0 var(--space-3); }
h3 { font-size: var(--type-14); font-weight: 600; margin: 0 0 var(--space-2); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--type-12); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }

/* ---------- surfaces ---------- */
.card { background: var(--bg-1); border: 1px solid var(--hairline-soft); border-radius: var(--radius-m); padding: var(--space-4); min-width: 0; }
.card + .card { margin-top: var(--space-3); }
.card.tight { padding: var(--space-3); }
.card.inset { background: var(--bg-2); }
.stack > * + * { margin-top: var(--space-3); }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; min-width: 0; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.split { display: grid; gap: var(--space-4); }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; } .split.studio { grid-template-columns: 280px minmax(0, 1fr); } }
.divider { height: 1px; background: var(--hairline-soft); margin: var(--space-3) 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--bg-2); color: var(--text-1); font-weight: 550; cursor: pointer; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--bg-3); color: var(--text-1); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.primary:active { background: var(--accent-press); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-2); color: var(--text-1); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: var(--type-12); border-radius: 8px; }
.btn.block { width: 100%; }
.btn.big { min-height: 48px; font-size: var(--type-16); }
.btn svg { width: 16px; height: 16px; }
label.field { display: grid; gap: 6px; font-size: var(--type-12); color: var(--text-2); min-width: 0; }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--bg-2); color: var(--text-1); font-size: 16px; }
textarea.input { min-height: 88px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.form-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: var(--type-12); color: var(--text-2); }
.search { position: relative; flex: 1; min-width: 180px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.search .input { padding-left: 36px; }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--hairline-soft); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.segmented::-webkit-scrollbar { display: none; }
.segmented a, .segmented button { flex: 0 0 auto; padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-size: var(--type-12); font-weight: 550; border: 0; background: transparent; cursor: pointer; white-space: nowrap; }
.segmented .active { background: var(--bg-3); color: var(--text-1); }
.segmented .count { margin-left: 6px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg-3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.chip.accent { background: var(--accent-tint); color: var(--accent-strong); }
.chip.good { background: var(--good-tint); color: var(--good); }
.chip.warn { background: var(--warning-tint); color: var(--warning); }
.chip.bad { background: var(--danger-tint); color: var(--danger); }
.chip.xp { background: var(--xp-tint); color: var(--xp); }
.chip.demo { background: var(--warning-tint); color: var(--warning); letter-spacing: .04em; }
.chip.outline { background: transparent; border-color: var(--hairline); }
.chip.muted { background: var(--bg-3); color: var(--text-2); }
.chip.verdict { font-size: 12px; padding: 3px 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 8px; }
.platform-icon { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }

/* ---------- queue cards ---------- */
.qcard { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: var(--space-3); background: var(--bg-1); border: 1px solid var(--hairline-soft); border-radius: var(--radius-m); color: var(--text-1); transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.qcard:hover { background: var(--bg-2); border-color: var(--hairline); color: var(--text-1); }
.thumb { position: relative; width: 84px; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; background: var(--bg-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .fmt { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; background: rgba(5,6,17,.82); color: var(--text-1); }
.qcard .body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qcard .hook { font-weight: 600; font-size: 15.5px; line-height: 1.3; margin-top: 2px; }
.qcard .meta { color: var(--text-2); font-size: var(--type-12); }
.qcard .foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qstate { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.qstate svg { width: 14px; height: 14px; }
.qstate.accent { color: var(--accent-strong); } .qstate.good { color: var(--good); } .qstate.warn { color: var(--warning); } .qstate.xp { color: var(--xp); }
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.toolbar .grow { flex: 1; min-width: min(100%, 320px); flex-wrap: nowrap; }
.qgroup + .qgroup { margin-top: var(--space-5); }
.group-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 var(--space-3); font-family: var(--font-ui); font-size: 15px; font-weight: 650; color: var(--text-1); }
.group-h .count { color: var(--text-3); font-weight: 500; font-size: 13px; }
.group-sub { margin: -6px 0 var(--space-3); color: var(--text-3); font-size: var(--type-12); }
.empty { text-align: center; padding: var(--space-7) var(--space-4); color: var(--text-2); }
.empty img { width: 96px; margin: 0 auto var(--space-3); opacity: .9; }

/* ---------- item detail ---------- */
.carousel { display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-2); scrollbar-width: thin; }
.carousel figure { position: relative; margin: 0; flex: 0 0 min(58%, 250px); scroll-snap-align: start; border-radius: 12px; overflow: hidden; background: var(--bg-3); }
.carousel figure img { width: 100%; height: auto; }
.carousel figcaption { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(5,6,17,.85); font-size: 12px; font-weight: 700; }
.player { width: 100%; max-height: 72dvh; border-radius: 12px; background: #000; aspect-ratio: 9 / 16; object-fit: contain; }
@media (min-width: 1024px) { .player { max-width: 420px; } }
.caption-box { white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--hairline-soft); border-radius: 10px; padding: 12px; font-size: var(--type-14); overflow-wrap: anywhere; }
.steps { counter-reset: step; display: grid; gap: var(--space-3); }
.step { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); align-items: start; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-3); color: var(--text-2); font-weight: 700; font-size: 13px; }
.step.done::before { content: "✓"; background: var(--good-tint); color: var(--good); }
.step.current::before { background: var(--accent); color: var(--on-accent); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: var(--type-12); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text-1); overflow-wrap: anywhere; }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--system-surface); border: 1px solid var(--system-border); color: var(--text-2); font-size: var(--type-12); }
.notice.warn { background: var(--warning-tint); border-color: rgba(245,196,81,.2); color: var(--warning); }
.notice.bad { background: var(--danger-tint); border-color: rgba(240,110,124,.2); color: var(--danger); }
.notice.good { background: var(--good-tint); border-color: rgba(95,201,142,.2); color: var(--good); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- metrics ---------- */
.snapgrid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.metric-table { width: 100%; border-collapse: collapse; font-size: var(--type-12); font-variant-numeric: tabular-nums; }
.metric-table td, .metric-table th { padding: 5px 4px; border-bottom: 1px solid var(--hairline-soft); text-align: left; vertical-align: top; }
.metric-table th { color: var(--text-3); font-weight: 600; }
.metric-table td.num { text-align: right; }
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline-soft); border-radius: var(--radius-m); background: var(--bg-1); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--type-12); font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--hairline-soft); text-align: left; vertical-align: top; }
table.data th { color: var(--text-3); font-weight: 600; position: sticky; top: 0; background: var(--bg-1); }
table.data td.num { text-align: right; }
table.data tr:last-child td { border-bottom: 0; }
.stat { display: grid; gap: 2px; }
.stat .v { font-size: var(--type-24); font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--text-3); font-size: 11.5px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.bars span { flex: 1; min-width: 3px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.bars span.bot { background: var(--text-3); opacity: .5; }

/* ---------- decisions ---------- */
.lanes { display: grid; gap: var(--space-4); }
@media (min-width: 1100px) { .lanes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lane h2 { margin-top: 0; display: flex; align-items: center; gap: 8px; font-size: var(--type-20); }
.lane .count { color: var(--text-3); font-family: var(--font-ui); font-size: var(--type-12); }
.decision .reason { color: var(--text-2); font-size: var(--type-12); }
.evidence { display: grid; gap: 4px; font-size: 12px; }
.evidence a { overflow-wrap: anywhere; }

/* ---------- studio ---------- */
.thread-list a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text-2); }
.thread-list a.active, .thread-list a:hover { background: var(--bg-2); color: var(--text-1); }
.msg { display: grid; gap: 6px; }
.msg.user .bubble { justify-self: end; background: var(--accent-tint); border: 1px solid rgba(111,158,234,.18); }
.msg .bubble { padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--hairline-soft); max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.provider { display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--text-3); }
.draft { border: 1px solid var(--hairline); }
.draft.demo { border-color: rgba(245,196,81,.3); }
.phone { background: #000; border-radius: 26px; padding: 14px 12px 16px; border: 1px solid var(--hairline); max-width: 340px; }
.phone .who { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 10px; font-weight: 600; font-size: 13px; }
.phone .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-4); display: grid; place-items: center; font-size: 11px; color: var(--text-2); overflow: hidden; }
.phone .avatar img { width: 100%; height: 100%; object-fit: cover; }
.phone .line { display: flex; margin: 4px 0; }
.phone .line span { max-width: 78%; padding: 7px 11px; border-radius: 17px; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.phone .line.you { justify-content: flex-end; }
.phone .line.you span { background: #2f6fea; color: #fff; }
.phone .line.them span { background: #26262b; color: #f1f1f4; }
.phone .call { margin-top: 12px; padding: 14px; border-radius: 18px; background: linear-gradient(180deg, #121629, #080a17); text-align: center; border: 1px solid rgba(255,255,255,.08); }
.phone .call .label { font-size: 10.5px; letter-spacing: .14em; color: var(--text-3); font-weight: 600; }
.phone .call .name { font-family: var(--font-display); font-size: 20px; margin: 2px 0 6px; }
.phone .call .spoken { font-size: 13.5px; color: var(--text-1); }
.phone .call .wave { display: flex; justify-content: center; gap: 3px; margin: 8px 0; }
.phone .call .wave i { width: 3px; border-radius: 2px; background: var(--accent); opacity: .8; }
.lint { display: flex; flex-wrap: wrap; gap: 4px; }
.composer { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 14px; padding: var(--space-3); box-shadow: var(--shadow-1); }
@media (min-width: 1024px) { .composer { bottom: 12px; } }
/* studio, chat-first layout: compact history rail · single scope control · composer */
.st { display: grid; gap: var(--space-4); }
.st-rail { display: none; }
.st-main { min-width: 0; width: 100%; max-width: 920px; margin: 0 auto; }
@media (min-width: 1024px) {
  .st { grid-template-columns: 216px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
  .st-rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 81px; max-height: calc(100dvh - 105px); overflow: auto; padding-top: var(--space-2); min-width: 0; }
  .st-only-mobile { display: none !important; }
}
.st-rail-label { margin: var(--space-4) 10px var(--space-1); color: var(--text-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.st-history { display: grid; gap: 2px; }
.st-history a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--text-2); min-width: 0; }
.st-history a:hover, .st-history a.active { background: var(--bg-2); color: var(--text-1); }
.st-history a.active { box-shadow: inset 2px 0 0 var(--accent); }
.st-history .t { font-size: var(--type-12); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-history .m { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-none { margin: 6px 10px; }
.st-head { align-items: center; flex-wrap: nowrap; margin-bottom: var(--space-2); gap: var(--space-2) var(--space-3); min-width: 0; }
.st-head .actions { gap: 0; flex-wrap: nowrap; flex: none; }
@media (max-width: 600px) { .st-head h1 { font-size: 28px; } .st-head { gap: var(--space-2); } .st-hide-narrow { display: none; } }
.st-scope { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; min-width: 0; padding: 0 10px 0 12px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--bg-2); color: var(--text-1); font-size: var(--type-12); font-weight: 600; cursor: pointer; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.st-scope:hover { background: var(--bg-3); border-color: var(--accent-ring); }
.st-scope .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-scope svg { color: var(--accent); }
.st-scope svg:last-child { color: var(--text-3); }
.st-icon-btn { position: relative; min-width: 36px; padding: 0 8px; }
@media (max-width: 600px) { .st-icon-btn { min-width: 34px; padding: 0 7px; } }
.st-icon-btn .badge { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.st-sub { margin: 0 0 var(--space-3); color: var(--text-3); font-size: var(--type-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-thread { display: grid; gap: var(--space-4); padding-bottom: var(--space-4); min-width: 0; }
.st-thread > .msg { scroll-margin-top: 76px; min-width: 0; }
.st-thread .msg.user .bubble { max-width: min(600px, 88%); }
.st-thread .msg.pending { opacity: .75; }
.st-meta-line { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 11.5px; color: var(--text-3); }
.st-evidence summary { color: var(--text-3); }
.st-dest { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--warning-tint); color: var(--warning); font-size: var(--type-12); }
.st-dest.set { background: var(--accent-tint-weak); color: var(--text-2); }
.st-dest svg { margin-top: 1px; }
.st-empty { text-align: center; padding: var(--space-6) var(--space-2) var(--space-5); }
.st-empty img { width: 76px; height: 76px; margin: 0 auto var(--space-3); border-radius: 50%; }
.st-empty h2 { margin: 0 0 var(--space-2); }
.st-empty p { max-width: 520px; margin: 0 auto; }
.st-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: var(--space-4); }
.st-suggest button { max-width: 100%; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--bg-1); color: var(--text-2); font-size: var(--type-12); text-align: left; cursor: pointer; }
.st-suggest button:hover { background: var(--bg-2); color: var(--text-1); border-color: var(--accent-ring); }
.st-composer { padding: 6px; }
.st-composer:focus-within { border-color: var(--accent-ring); }
.st-compose-row { display: flex; gap: 6px; align-items: flex-end; }
.st-composer textarea.input { min-height: 44px; max-height: 200px; resize: none; border-color: transparent; background: transparent; padding: 10px; }
.st-composer textarea.input:focus { border-color: transparent; box-shadow: none; }
.st-send { flex: none; width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
.st-send svg { width: 18px; height: 18px; }
.st-compose-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 2px 10px 4px; font-size: 11.5px; color: var(--text-3); }
.st-typing { display: inline-flex; gap: 5px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--hairline-soft); justify-self: start; }
.st-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: st-blink 1.2s infinite var(--ease); }
.st-typing i:nth-child(2) { animation-delay: .15s; } .st-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes st-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .st-typing i { animation: none; opacity: .6; } }
.sheet.st-wide { max-width: 900px; }
.st-picker-list { display: grid; align-content: start; gap: 2px; margin-top: var(--space-3); max-height: min(56dvh, 520px); overflow: auto; }
.st-group { margin: var(--space-3) 12px var(--space-1); color: var(--text-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.st-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text-1); text-align: left; cursor: pointer; }
.st-opt:hover, .st-opt:focus-visible { background: var(--bg-2); }
.st-opt.current { background: var(--accent-tint); }
.st-opt .st-txt { flex: 1; min-width: 0; }
.st-opt .st-txt b { font-weight: 600; }
.st-opt .st-txt small { display: block; color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-opt > svg:last-child { color: var(--text-3); }
.st-back { min-height: 40px; color: var(--text-2); }
.st-choices { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.st-choices legend { padding: 0; margin-bottom: 6px; }
.st-choice { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 8px 12px; border: 1px solid var(--hairline-soft); border-radius: 10px; cursor: pointer; }
.st-choice:hover { background: var(--bg-2); }
.st-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint-weak); }
.st-choice input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.st-choice .st-txt { flex: 1; min-width: 0; }
.st-choice .st-txt small { display: block; color: var(--text-3); font-size: 11.5px; }
.frames { display: flex; gap: 6px; overflow-x: auto; }
.frames figure { margin: 0; flex: 0 0 96px; }
.frames img { width: 96px; border-radius: 8px; aspect-ratio: 9 / 16; object-fit: cover; background: var(--bg-3); }
.frames figcaption { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- sheets, toast ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(2,3,10,.62); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: 88dvh; overflow: auto; background: var(--bg-1); border: 1px solid var(--hairline); border-radius: 18px 18px 0 0; padding: var(--space-4) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom)); box-shadow: var(--shadow-1); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--bg-4); margin: 0 auto var(--space-3); }
@media (min-width: 720px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 18px; } }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 60; padding: 10px 16px; border-radius: 12px; background: var(--bg-4); border: 1px solid var(--hairline); color: var(--text-1); font-weight: 550; transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { color: var(--danger); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-5); }
.login .panel { width: 100%; max-width: 380px; }
.login .hero { display: grid; justify-items: center; gap: var(--space-3); margin-bottom: var(--space-5); text-align: center; }
.login .hero img.mascot { width: 112px; height: 112px; }
.login .hero img.word { height: 22px; }
.login .hero p { font-family: var(--font-display); font-size: var(--type-20); color: var(--text-2); margin: 0; }
details summary { cursor: pointer; color: var(--text-2); font-size: var(--type-12); }
details[open] summary { margin-bottom: var(--space-2); }

/* ================= redesign: plain-language overview and shared pieces ================= */
.mobile-only { display: inline-flex; }
@media (min-width: 1024px) { .mobile-only { display: none !important; } .subnav { display: none !important; } }
.btn.icon-only { min-width: 36px; padding: 0 8px; }
.btn.icon-only svg { width: 18px; height: 18px; }
.subnav { margin-bottom: var(--space-3); }
.up { color: var(--good); font-weight: 600; } .down { color: var(--danger); font-weight: 600; }

/* sections */
.section { padding: var(--space-5); }
.card.section + .card.section { margin-top: var(--space-4); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.section-head h2 { margin: 0; font-size: 22px; line-height: 1.1; }
.section-head .sub { margin: 4px 0 0; color: var(--text-3); font-size: var(--type-12); }
.section-head .more { display: inline-flex; align-items: center; gap: 2px; font-size: var(--type-12); font-weight: 600; white-space: nowrap; margin-top: 4px; }
.section-head .more svg { width: 14px; height: 14px; }
@media (max-width: 600px) { .section { padding: var(--space-4); } }

/* how it works */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: var(--space-5); border: 1px solid var(--hairline-soft); border-radius: var(--radius-m); background: var(--bg-1); overflow: hidden; }
.flow-step { display: flex; gap: 12px; padding: 14px 16px; color: var(--text-1); border-right: 1px solid var(--hairline-soft); position: relative; }
.flow-step:last-child { border-right: 0; }
.flow-step:hover { background: var(--bg-2); color: var(--text-1); }
.flow-step .n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-strong); font-size: 12px; font-weight: 700; margin-top: 1px; }
.flow-step b { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.flow-step b svg { color: var(--text-3); width: 15px; height: 15px; }
.flow-step .d { display: block; margin-top: 3px; color: var(--text-2); font-size: var(--type-12); line-height: 1.4; }
@media (max-width: 1100px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .flow-step:nth-child(2) { border-right: 0; } .flow-step:nth-child(-n+2) { border-bottom: 1px solid var(--hairline-soft); } }
@media (max-width: 560px) { .flow { grid-template-columns: 1fr; } .flow-step { border-right: 0; border-bottom: 1px solid var(--hairline-soft); padding: 12px 14px; } .flow-step:last-child { border-bottom: 0; } }

/* headline numbers */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; align-content: start; gap: 4px; padding: 16px 18px; border-radius: var(--radius-m); background: var(--bg-1); border: 1px solid var(--hairline-soft); color: var(--text-1); min-width: 0; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.kpi:hover { background: var(--bg-2); border-color: var(--hairline); color: var(--text-1); }
.kpi .l { color: var(--text-2); font-size: var(--type-12); font-weight: 550; }
.kpi .v { font-size: 34px; line-height: 1.1; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .f { color: var(--text-3); font-size: 12px; line-height: 1.4; }
@media (max-width: 600px) { .kpi { padding: 12px 14px; } .kpi .v { font-size: 26px; } }

.home-grid { display: grid; gap: var(--space-4); }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.home-grid .col { display: grid; gap: var(--space-4); min-width: 0; }
.home-grid .col > .card + .card { margin-top: 0; }

/* to-do rows */
.todos { display: grid; gap: 6px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid transparent; color: var(--text-1); min-width: 0; }
.todo:hover { border-color: var(--hairline); color: var(--text-1); background: var(--bg-3); }
.todo .ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--bg-3); color: var(--text-2); }
.todo.accent .ic { background: var(--accent-tint); color: var(--accent-strong); }
.todo.warn .ic { background: var(--warning-tint); color: var(--warning); }
.todo.muted { background: transparent; }
.todo.muted b { font-weight: 550; color: var(--text-2); }
.todo .t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.todo .t span { color: var(--text-3); font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.todo .count { flex: none; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.todo .chev { flex: none; color: var(--text-3); }

/* verdict rows */
.vlist { display: grid; gap: 8px; }
.vrow { display: grid; gap: 6px; padding: 14px; border-radius: 12px; background: var(--bg-2); color: var(--text-1); border: 1px solid transparent; }
.vrow:hover { border-color: var(--hairline); color: var(--text-1); }
.vrow .title { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.vrow .sentence { color: var(--text-2); }
.vrow .sentence b { color: var(--text-1); }

/* confidence meter */
.meter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.meter .pips { display: inline-flex; gap: 3px; }
.meter .pips i { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-4); }
.meter .pips i.on { background: var(--accent); }

/* best posts */
.best { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.best a { display: grid; grid-template-columns: 18px 40px minmax(0, 1fr) 96px; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; color: var(--text-1); }
.best a:hover { background: var(--bg-2); color: var(--text-1); }
.best .rank { color: var(--text-3); font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.mini-thumb { width: 40px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: var(--bg-3); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.best .t { display: grid; gap: 2px; min-width: 0; }
.best .t b { font-weight: 600; font-size: 14px; line-height: 1.3; }
.best .v { display: grid; gap: 5px; justify-items: end; font-variant-numeric: tabular-nums; }
.best .v b { font-size: 16px; }
.track { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* horizontal bars */
.hbars { display: grid; gap: 2px; }
.hbar { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.2fr) 72px; gap: 12px; align-items: center; padding: 7px 8px; border-radius: 10px; color: var(--text-1); }
.hbar:hover { background: var(--bg-2); color: var(--text-1); }
.hbar .lbl { display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 8px; align-items: center; min-width: 0; }
.hbar .lbl .h { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .lbl .faint { grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.hbar .track { height: 10px; border-radius: 5px; }
.hbar .track i { border-radius: 5px; opacity: .9; }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .hbar { grid-template-columns: minmax(0, 1fr) 76px; row-gap: 6px; } .hbar .track { grid-column: 1 / -1; grid-row: 2; } }

/* results */
.kpi.static:hover { background: var(--bg-1); border-color: var(--hairline-soft); }
.kpi .f a { color: var(--text-2); }
.kpi .f.clamp1 { display: block; }
.due-list { display: grid; gap: 4px; }
.due-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; background: var(--bg-2); color: var(--text-1); min-width: 0; }
.due-row:hover { background: var(--bg-3); color: var(--text-1); }
.due-row .age { flex: none; width: 52px; font-weight: 650; font-size: 13px; color: var(--accent-strong); }
.due-row .t { flex: 1; min-width: 0; display: grid; gap: 1px; }
.due-row .t b { font-weight: 550; display: block; }
.filters { margin-bottom: 12px; }
.filters select { flex: 1; min-width: 150px; width: auto; }
table.data.results td { vertical-align: middle; }
table.data.results th.num { text-align: right; }
.post-cell { min-width: 240px; }
.post-cell > a { color: var(--text-1); font-weight: 550; }
.bar-cell { position: relative; min-width: 96px; }
.bar-cell .bar { position: absolute; right: 8px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--accent); opacity: .55; max-width: calc(100% - 16px); }
.bar-cell .v { position: relative; font-weight: 600; }

/* what's working */
.explain { margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5); }
.explain p { margin: 0 0 8px; color: var(--text-2); line-height: 1.6; }
.explain p b { color: var(--text-1); }
.explain .meter { margin: 0 6px 0 2px; vertical-align: -1px; }
.bucket { --mark: var(--text-3); margin-top: var(--space-5); }
.bucket.good { --mark: var(--good); } .bucket.accent { --mark: var(--accent); } .bucket.warn { --mark: var(--warning); }
.bucket h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 24px; }
.bucket h2 .mark { width: 10px; height: 10px; border-radius: 3px; background: var(--mark); }
.bucket h2 .count { color: var(--text-3); font-family: var(--font-ui); font-size: 14px; }
.bucket > .sub { margin: 6px 0 var(--space-3); color: var(--text-2); font-size: var(--type-12); max-width: 760px; }
.empty-bucket { padding: 12px 16px; border: 1px dashed var(--hairline); border-radius: var(--radius-m); }
.empty-bucket h2 { font-size: 18px; }
.empty-bucket > .sub { margin-bottom: 0; }
.verdict-card { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--mark); }
.verdict-card h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.3; }
.verdict-card .kind { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.verdict-card .kind svg { width: 14px; height: 14px; }
.lift-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lift { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.lift.up { color: var(--good); } .lift.down { color: var(--danger); }
.lift-line .sentence { color: var(--text-2); flex: 1; min-width: 180px; }
.lift-line .sentence b { color: var(--text-1); font-weight: 600; }
.card-actions { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--hairline-soft); display: grid; gap: 6px; }

/* tests */
.test-card { display: flex; flex-direction: column; gap: 10px; color: inherit; }
.test-card:hover { background: var(--bg-2); color: inherit; }
.test-card h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.arms { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.arm { display: inline-grid; padding: 6px 10px; border-radius: 10px; background: var(--xp-tint); color: var(--text-1); font-weight: 600; font-size: 13px; }
.arm.base { background: var(--bg-3); }
.arm small { color: var(--text-3); font-weight: 500; font-size: 11px; }
.arms .vs { color: var(--text-3); font-size: 12px; }
.hbar.static:hover { background: transparent; }
.hbar.static .lbl > span:first-child { display: none; }
.hbar.static .lbl { grid-template-columns: minmax(0, 1fr); }
.hbar.static .lbl .faint { grid-column: 1; }

.flow-wrap { margin-bottom: var(--space-5); }
.flow-wrap > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.flow-wrap > summary::-webkit-details-marker { display: none; }
.flow-wrap > summary::before { content: "▸"; transition: transform var(--dur-fast) var(--ease); }
.flow-wrap[open] > summary::before { transform: rotate(90deg); }
.flow-wrap:not([open]) { margin-bottom: var(--space-3); }
.flow-wrap:not([open]) > summary { margin-bottom: 0; padding: 10px 14px; border: 1px solid var(--hairline-soft); border-radius: var(--radius-m); background: var(--bg-1); color: var(--text-2); text-transform: none; letter-spacing: 0; font-size: 14px; width: 100%; }
.flow-wrap .flow { margin-bottom: 0; }

@media (max-width: 440px) { .topbar .user-chip { display: none; } }
.due-row .t .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .due-row { flex-wrap: wrap; row-gap: 4px; }
  .due-row .age { width: 44px; }
  .due-row .t { flex-basis: calc(100% - 60px); }
  .due-row .t b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .due-row > .chip { margin-left: 56px; }
}
.kpi .f a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* setup → connections */
.auto-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 700px) { .auto-status { grid-template-columns: 1fr; } }
.auto-status .kpi { background: var(--bg-2); }
.kpi .v.small-v { font-size: 24px; }
.kpi .v.small-v .faint { font-size: 16px; font-weight: 500; }
.conn-h { display: flex; align-items: center; gap: 8px; margin: var(--space-4) 0 var(--space-2); font-size: 15px; }
.conn-h .faint { font-weight: 500; font-size: 13px; }
.section .conn-h:first-of-type { margin-top: 0; }
.conn-list { display: grid; gap: 4px; }
.conn-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); min-width: 0; }
.conn-row.no_handle { background: transparent; opacity: .7; }
.conn-row .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conn-row .who > span:last-child { display: grid; min-width: 0; }
.conn-row .who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-row small { color: var(--text-3); font-size: 12px; line-height: 1.35; }
.conn-row .st { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.conn-row .st small { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.conn-row .act { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 760px) { .conn-row { grid-template-columns: minmax(0, 1fr) auto; } .conn-row .st { grid-column: 1 / -1; grid-row: 2; } }
.setup-guide > summary { font-size: 15px; color: var(--text-1); }
.guide-cols { display: grid; gap: var(--space-5); margin-top: var(--space-3); }
@media (min-width: 1000px) { .guide-cols { grid-template-columns: 1fr 1fr; } }
.guide-cols h3 { display: flex; align-items: center; gap: 6px; font-size: 15px; }
ol.guide { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); line-height: 1.5; }
ol.guide b { color: var(--text-1); }
.mono-btn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; margin-top: 6px; max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; height: auto; padding: 6px 10px; }

/* TikTok posts found automatically: questions for assistants, identity line in Setup */
.tq-list { display: grid; gap: var(--space-3); }
.tq-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-4); padding: var(--space-3); background: var(--bg-2); border: 1px solid var(--hairline-soft); border-radius: var(--radius-m); }
@media (max-width: 800px) { .tq-item { grid-template-columns: 1fr; } }
.tq-found, .tq-cand { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; }
.tq-cand { grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; padding: 8px 0; border-top: 1px solid var(--hairline-soft); }
.tq-cands { display: flex; flex-direction: column; gap: 4px; }
.tq-cands > [data-tq-dismiss] { align-self: flex-start; margin-top: 6px; }
.tq-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tq-body .hook { font-weight: 600; }
.thumb.small-thumb { width: 56px; }
.tt-line { display: block; margin-top: 4px; line-height: 1.6; }

/* Instagram through Facebook Login for Business: heading action, account chooser, two connect buttons per row */
.conn-row .act.conn-act-wrap { flex-wrap: wrap; }
@media (max-width: 760px) { .conn-row .act.conn-act-wrap { grid-column: 1 / -1; justify-content: flex-start; } }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; }
.meta-line .small { min-width: 0; flex: 1 1 240px; overflow-wrap: anywhere; }
.meta-picks { display: grid; gap: 4px; }
.meta-pick { display: grid; grid-template-columns: auto minmax(180px, 1fr) minmax(0, 1.6fr); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); min-width: 0; cursor: pointer; }
.meta-pick.off { opacity: .65; cursor: default; }
.meta-pick .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.meta-pick .who > span:last-child { display: grid; min-width: 0; }
.meta-pick .who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-pick small { color: var(--text-3); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 760px) { .meta-pick { grid-template-columns: auto minmax(0, 1fr); } .meta-pick > small { grid-column: 2; } }
