/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface-1: #fcfcfb;
  --surface-2: #efeee9;
  --border: #dddcd5;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6d6c67;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e3eefb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: rgba(0, 0, 0, 0.07);
  --ok-bg: #e5f4ea; --ok-ink: #1d5e33;
  --warn-bg: #fdf3dc; --warn-ink: #6b4a00;
  --err-bg: #fbe7e5; --err-ink: #8a1f1b;
  --danger: #c63b37;
  --code-bg: #1e1e2a; --code-ink: #f0efec; --code-kw: #8fb9ff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface-1: #1a1a19;
    --surface-2: #242422;
    --border: #34342f;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #9a998f;
    --accent: #3987e5;
    --accent-ink: #ffffff;
    --accent-soft: #1d2c40;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: rgba(255, 255, 255, 0.08);
    --ok-bg: #16301f; --ok-ink: #9fdcb2;
    --warn-bg: #352a10; --warn-ink: #f2d48a;
    --err-bg: #3a1716; --err-ink: #f4aaa6;
    --danger: #e66767;
    --code-bg: #0c0c10;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface-1: #1a1a19; --surface-2: #242422; --border: #34342f;
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #9a998f;
  --accent: #3987e5; --accent-soft: #1d2c40; --series-1: #3987e5; --series-2: #d95926;
  --grid: rgba(255,255,255,.08);
  --ok-bg: #16301f; --ok-ink: #9fdcb2; --warn-bg: #352a10; --warn-ink: #f2d48a;
  --err-bg: #3a1716; --err-ink: #f4aaa6; --danger: #e66767; --code-bg: #0c0c10; --shadow: none;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 17px/1.55 var(--font);
  padding-bottom: calc(var(--dock-h, 90px) + 16px);
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; text-wrap: balance; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.topbar {
  display: flex; align-items: center; gap: .6rem;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.logo .icon { width: 20px; height: 20px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.screen-head { margin: 4px 0 16px; }
.screen-head p { color: var(--text-secondary); }

.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0;
}
.sub { color: var(--text-secondary); font-size: .95rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.big { min-height: 54px; font-size: 1.05rem; padding: 0 22px; }
.btn:active { transform: translateY(1px); }

/* ---------- Loading ---------- */
.loading { display: grid; place-items: center; gap: 12px; padding: 80px 16px; color: var(--text-secondary); text-align: center; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--border); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Icons ---------- */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }
.btn .icon { width: 1.1em; height: 1.1em; vertical-align: 0; }

/* ---------- Learn (slides) ---------- */
main.wide { max-width: 1100px; }
.deck { display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.deck:fullscreen { padding: 24px; justify-content: center; }
.deck-top { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .35s ease; }
.count { font-size: .85rem; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.icon-tool { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); color: var(--text-secondary); cursor: pointer; display: grid; place-items: center; }

.slide {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 48px); min-height: min(64vh, 620px);
  display: flex; flex-direction: column; justify-content: center; animation: slide-in .35s ease;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
.slide h2 { font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1.1; margin: 0; }
.kicker { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.lead { font-size: clamp(1.15rem, 2.5vw, 1.6rem); color: var(--text-secondary); margin-top: 14px; }

/* question first: big and centered, then it moves up when the answer shows */
.slide.q:not(.revealed) { align-items: center; text-align: center; }
.slide.q:not(.revealed) h2 { font-size: clamp(2.4rem, 8vw, 5.4rem); max-width: 18ch; }
.slide.q.revealed { justify-content: flex-start; }
.slide.q.revealed h2 { font-size: clamp(1.5rem, 3.4vw, 2.4rem); }
.a { margin-top: 18px; animation: pop .4s ease both; }
.answer-line { font-size: clamp(1.3rem, 3vw, 2rem); margin-bottom: 14px; }
.answer-line strong { color: var(--accent); }

.slide.intro { align-items: center; text-align: center; }
.slide.intro h2 { font-size: clamp(2.4rem, 7vw, 4.6rem); max-width: 14ch; }
.floaters { display: flex; gap: 18px; margin-bottom: 22px; }
.floaters span { width: 72px; height: 72px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; animation: bob 2.4s ease-in-out infinite; animation-delay: var(--d); }
.floaters .icon { width: 34px; height: 34px; }
@keyframes bob { 50% { transform: translateY(-12px); } }

/* 1 data */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.fact { background: var(--accent-soft); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 4px; animation: pop .5s ease both; animation-delay: calc(var(--i) * .45s + .3s); }
.fact .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px; }
.fact span { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); font-weight: 700; }
.fact strong { font-size: clamp(1.2rem, 2.6vw, 1.7rem); }
.tagline { margin: 20px 0 0; font-size: 1.2rem; color: var(--text-secondary); animation: pop .5s ease both; animation-delay: 2.3s; }

/* 2 database */
.mini-table-wrap { overflow-x: auto; }
.mini-table { border-collapse: collapse; width: 100%; font-size: clamp(.95rem, 2.2vw, 1.35rem); background: var(--surface-1); }
.mini-table caption { text-align: left; color: var(--text-secondary); font-size: .9rem; padding-bottom: 6px; }
.mini-table th, .mini-table td { border: 1px solid var(--border); padding: 8px 14px; text-align: left; }
.mini-table th { background: var(--surface-2); font-family: var(--mono); font-size: .8em; white-space: nowrap; }
.mini-table tbody tr { animation: pop .45s ease both; animation-delay: calc(var(--i) * .25s + .2s); }
.mini-table th button { width: 100%; text-align: left; border: 0; background: transparent; font: inherit; color: inherit; padding: 0; cursor: pointer; }
.mini-table th { padding: 0; }
.mini-table th button { padding: 8px 14px; }
.mini-table th button:hover, .mini-table tbody tr:hover td { background: var(--accent-soft); }
.mini-table tbody tr { cursor: pointer; }
.mini-table .hl-col, .mini-table tr.hl-row td { background: var(--accent-soft); }
.mini-table th.hl-col { background: var(--accent); color: var(--accent-ink); }
.mini-table th.hl-col button:hover { background: transparent; }
.table-note { margin-top: 14px; min-height: 3em; font-size: clamp(1.05rem, 2.4vw, 1.4rem); }
.table-note strong { color: var(--accent); }

/* 3 SQL */
.builder { display: grid; gap: 4px 20px; }
@media (min-width: 860px) { .builder { grid-template-columns: 1.1fr 1fr; align-items: start; } .builder pre { grid-row: 1 / span 2; } .builder .act-result { margin-top: 0; } }
.builder .table-scroll { max-height: 280px; }
.builder pre { background: var(--code-bg); color: var(--code-ink); padding: 18px 20px; border-radius: 16px; overflow-x: auto; margin: 0 0 12px; font: clamp(1rem, 2.4vw, 1.5rem)/2 var(--mono); }
.builder pre code { background: none; padding: 0; color: inherit; font: inherit; }
.builder .ln { display: inline-block; animation: pop .4s ease both; animation-delay: calc(var(--i) * .35s + .2s); }
.builder .kw { color: var(--code-kw); font-weight: 700; }
.builder select { font: inherit; color: var(--code-ink); background: #2d2d3d; border: 1px solid #4a4a60; border-radius: 8px; padding: 2px 6px; }
.act-result { margin: 0 0 12px; font-size: clamp(1rem, 2.2vw, 1.3rem); color: var(--text-secondary); }

/* 1b picker */
.picker { display: grid; gap: 20px; }
@media (min-width: 820px) { .picker { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; text-align: left; min-height: 64px; padding: 12px 40px 12px 14px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-1); font-weight: 700; font-size: clamp(.95rem, 2vw, 1.2rem); cursor: pointer; transition: transform .15s, background .2s, border-color .2s; }
.opt:hover { border-color: var(--accent); }
.opt:active { transform: scale(.97); }
.opt .icon { position: absolute; right: 12px; top: 50%; margin-top: -.6em; }
.opt.yes { border-color: var(--ok-ink); background: var(--ok-bg); color: var(--ok-ink); cursor: default; }
.opt.no { border-color: var(--err-ink); background: var(--err-bg); color: var(--err-ink); opacity: .8; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.profile { background: var(--surface-2); border-radius: 20px; padding: 16px; border: 2px solid transparent; transition: border-color .4s, box-shadow .4s; }
.profile h3 { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.profile ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.profile li { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; border: 2px dashed var(--border); color: var(--text-muted); font-size: clamp(.95rem, 2vw, 1.15rem); transition: all .3s; }
.profile li span { text-transform: uppercase; font-size: .75em; letter-spacing: .06em; font-weight: 700; }
.profile li.filled { border: 2px solid transparent; background: var(--surface-1); color: var(--text-primary); animation: pop .4s ease both; }
.profile.done { border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.picture { margin: 14px 0 0; font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--accent); animation: pop .5s ease both; }

/* 4 look back */
.askbar { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: clamp(1.05rem, 2.4vw, 1.5rem); margin: 0 0 12px; }
.askbar .icon { color: var(--accent); }
.timechips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.timechips button { min-height: 46px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface-1); font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.timechips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .compare { grid-template-columns: 1fr; } }
.side { background: var(--surface-2); border-radius: 18px; padding: 16px; }
.side h3 { display: flex; align-items: center; gap: 8px; font-size: clamp(1rem, 2.2vw, 1.3rem); }
.side.keep h3 { color: var(--accent); }
.bignum { font-size: clamp(2.6rem, 8vw, 4.6rem); font-weight: 800; line-height: 1.1; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.side.keep .bignum { color: var(--series-2); }
.bignum.gone { color: var(--text-muted); text-decoration: line-through; opacity: .6; }
.cap { margin: 0; color: var(--text-secondary); min-height: 1.5em; }

/* 5 predict */
.predict-box { background: var(--surface-2); border-radius: 20px; padding: clamp(16px, 3vw, 28px); }
.predict-box .slider { font-size: clamp(1rem, 2.2vw, 1.3rem); }
.predict-box .big-number span { font-size: clamp(3.5rem, 11vw, 7rem); color: var(--series-2); }
.meter { height: 18px; border-radius: 999px; background: var(--surface-1); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--series-2); border-radius: inherit; transition: width .15s linear; }

/* recap */
.slide .words { margin: 0 0 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.words > div { padding: 16px 18px; border-radius: 16px; background: var(--surface-2); animation: pop .45s ease both; animation-delay: calc(var(--i) * .25s); }
.words dt { font-weight: 800; color: var(--accent); font-size: clamp(1.2rem, 2.6vw, 1.6rem); }
.words dd { margin: 2px 0 0; color: var(--text-secondary); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.cta .btn.big { flex: 1 1 220px; }

.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deck-nav .btn { min-width: 120px; min-height: 54px; font-size: 1.05rem; }
.deck-nav .btn:disabled { opacity: .35; cursor: default; }
.dots { display: flex; gap: 2px; }
.dot { width: 22px; height: 30px; border: 0; background: transparent; cursor: pointer; position: relative; padding: 0; }
.dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--border); transition: all .2s; }
.dot.done::after { background: var(--accent); opacity: .5; }
.dot.on::after { background: var(--accent); width: 12px; height: 12px; margin: -6px; opacity: 1; }
@media (max-width: 420px) { .dots { display: none; } .deck-nav .btn { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .slide, .a, .fact, .profile li, .picture, .tagline, .words > div, .builder .ln, .mini-table tbody tr, .floaters span, .panel .card, .stat-row .stat, .answer, .answer-icon .icon, .scenario.active .sc-icon .icon { animation: none !important; } }

/* ---------- SQL Lab ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-1); font-family: var(--mono); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-explain { font-size: .95rem; color: var(--text-secondary); min-height: 1.5em; }
.editor-wrap { padding: 10px; }
#sql-editor {
  width: 100%; min-height: 130px; resize: vertical; border: 0; outline: none;
  background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 12px;
  font: 15px/1.5 var(--mono);
}
#sql-editor:focus-visible { outline: 3px solid var(--accent); }
.editor-actions { display: flex; gap: 8px; margin-top: 10px; }
.editor-actions .btn.primary { flex: 1; }

.result { margin-bottom: 16px; }
.result-meta { font-size: .85rem; color: var(--text-secondary); margin-bottom: 6px; }
.table-scroll { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--surface-2); font-family: var(--mono); font-size: .8rem; z-index: 1; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.null { color: var(--text-muted); font-style: italic; }

.msg { border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.msg > .icon { margin-top: 2px; }
.msg > div { min-width: 0; flex: 1; }
.msg p { margin: 6px 0 0; }
.tabs [role=tab] .icon { display: block; margin: 0 auto 2px; }
.schema summary .icon { margin-right: 4px; }
.msg.ok { background: var(--ok-bg); color: var(--ok-ink); }
.msg.warn { background: var(--warn-bg); color: var(--warn-ink); }
.msg.err { background: var(--err-bg); color: var(--err-ink); }
.msg details { margin-top: 8px; font-size: .85rem; opacity: .9; }
.msg details code { display: block; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

.schema summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.hint { font-size: .9rem; color: var(--text-secondary); margin: 8px 0; }
#schema-list { display: grid; gap: 10px; }
@media (min-width: 620px) { #schema-list { grid-template-columns: 1fr 1fr; } }
.schema-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.schema-name {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--surface-2); border: 0; cursor: pointer; text-align: left;
}
.schema-name code { background: none; padding: 0; font-weight: 700; }
.schema-name span { font-size: .8rem; color: var(--text-secondary); }
.schema-table ul { list-style: none; margin: 0; padding: 6px 12px 10px; }
.schema-table li { display: flex; justify-content: space-between; font-size: .88rem; padding: 2px 0; }
.schema-table li code { background: none; padding: 0; }
.schema-table li span { color: var(--text-muted); }

.danger-zone { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.danger-zone > div { flex: 1 1 220px; }
.danger-zone p { color: var(--text-secondary); margin: 0; font-size: .95rem; }
.danger-zone .btn { flex: 1 1 200px; }

/* ---------- Predictions ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 14px; margin-bottom: 16px; }
.tabs [role=tab] {
  min-height: 48px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: .88rem;
  cursor: pointer; padding: 4px 6px; line-height: 1.2; color: var(--text-secondary);
}
.tabs [role=tab][aria-selected=true] { background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow); }
.chart-box { position: relative; height: 300px; margin: 8px 0; }
@media (min-width: 620px) { .chart-box { height: 360px; } }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.stat .label { font-size: .78rem; color: var(--text-secondary); }
.stat .value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.explain-list { margin: 0; display: grid; gap: 12px; }
.explain-list dt { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.explain-list dd { margin: 2px 0 0; }
.data-peek { margin-top: 14px; }
.data-peek summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 32px; }
.data-peek .table-scroll { max-height: 320px; }

.scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
@media (min-width: 620px) { .scenarios { grid-template-columns: repeat(4, 1fr); } }
.scenario {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface-1); cursor: pointer;
  transition: transform .15s, border-color .2s, background .2s;
}
.scenario:hover { border-color: var(--accent); }
.scenario:active { transform: scale(.96); }
.scenario small { color: var(--text-secondary); font-size: .78rem; }
.sc-icon .icon { width: 26px; height: 26px; color: var(--accent); }
.scenario.active { border-color: var(--accent); background: var(--accent-soft); }
.scenario.active .sc-icon .icon { animation: pop .3s ease; }
.answer { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; }
.answer.yes { background: var(--err-bg); color: var(--err-ink); }
.answer.no { background: var(--ok-bg); color: var(--ok-ink); }
.answer strong { display: block; font-size: 1.2rem; }
.answer span { font-size: .95rem; }
.answer-icon .icon { width: 34px; height: 34px; }

.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.field select { min-height: 46px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 10px; font-weight: 500; max-width: 100%; }
.sliders { display: grid; gap: 12px; }
@media (min-width: 620px) { .sliders { grid-template-columns: 1fr 1fr; } }
.slider { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.slider span { display: flex; justify-content: space-between; }
.slider output { font-variant-numeric: tabular-nums; color: var(--accent); }
.slider input { width: 100%; accent-color: var(--accent); height: 32px; }
.big-number { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 4px; }
.big-number span { font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.big-number small { color: var(--text-secondary); font-size: 1rem; }

.edit-actions { margin: 8px 0 12px; }
.edit-actions .btn { width: 100%; }
.edit-table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--border); border-radius: 12px; }
.edit-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.edit-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 8px 6px; font-size: .78rem; z-index: 1; white-space: nowrap; }
.edit-table td { padding: 4px; border-bottom: 1px solid var(--border); }
.edit-table input {
  width: 100%; min-width: 52px; min-height: 40px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-1); padding: 0 6px; font-variant-numeric: tabular-nums; transition: background .3s;
}
.edit-table input.saved { background: var(--ok-bg); }
.icon-btn { min-width: 40px; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--err-bg); color: var(--err-ink); }

/* ---------- Predictions facelift ---------- */
.screen-head .kicker { color: var(--accent); margin-bottom: 4px; }

.model-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.model-head h3 { margin: 0; }
.model-head .kicker { margin: 0 0 2px; }
.model-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.model-icon .icon { width: 24px; height: 24px; }

h3.icon-title { display: flex; align-items: center; gap: 8px; }
h3.icon-title .icon { color: var(--accent); }

.panel .card { animation: pop .4s ease both; }
.panel .card:nth-of-type(2) { animation-delay: .08s; }
.panel .card:nth-of-type(3) { animation-delay: .16s; }

.stat-row .stat { animation: pop .4s ease both; animation-delay: calc(var(--i, 0) * .12s); }

.strength { margin-top: 12px; }
.meter-label { margin: 0 0 6px; font-size: .9rem; color: var(--text-secondary); }
.meter-label strong { color: var(--text-primary); }
.strength .meter, .answer .meter { height: 10px; }
.meter.ok span { background: var(--ok-ink); }
.meter.warn span { background: var(--warn-ink); }
.meter.err span { background: var(--danger); }

.answer { animation: pop .35s ease both; }
.answer .meter { margin-top: 10px; }
.answer-icon .icon { animation: pop .4s ease both; }

.tabs [role=tab] .icon { transition: transform .2s; }
.tabs [role=tab][aria-selected=true] .icon { transform: scale(1.15); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--surface-1); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--text-secondary); font-size: .8rem; font-weight: 600;
}
.bottom-nav a .icon { width: 24px; height: 24px; }
.bottom-nav a[aria-current=page] { color: var(--accent); }
.footnote { margin: 0; padding: 2px 12px 4px; font-size: .6rem; line-height: 1.3; color: var(--text-muted); text-align: center; }
