/* Dry Run Democracy: a friendly, civic look. Warm paper, teal for action, sunshine for progress. */
/* Poppins is bundled (SIL Open Font License, see assets/fonts). No requests to Google. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/poppins-400.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/poppins-500.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/poppins-700.woff') format('woff'); }
:root {
  --bg: #fff8ec;
  --bg-2: #ffefd0;
  --card: #ffffff;
  --soft: #fdf3e0;
  --ink: #1d2b4f;
  --muted: #56607f;
  --line: #e8dcc0;
  --primary: #0e7a68;
  --primary-dark: #0a5f51;
  --on-primary: #ffffff;
  --sun: #ffc93c;
  --sun-soft: #fff0bf;
  --sky: #e3f2ff;
  --berry: #c93a5f;
  --leaf: #2e9e5b;
  --link: #0b5fb3;
  --ui: 'Poppins', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --radius: 16px;
  --shadow: 0 2px 0 rgba(29, 43, 79, .06), 0 8px 22px rgba(29, 43, 79, .08);
  --shell-max: 1180px;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.55;
  background: radial-gradient(900px 420px at 100% -10%, var(--sun-soft), transparent 60%), radial-gradient(800px 420px at -10% 0%, var(--sky), transparent 55%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #1b6fd1; outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; }
a { color: var(--link); text-underline-offset: 3px; }
.dim, .fine { color: var(--muted); }
.fine { font-size: 13.5px; line-height: 1.5; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shared pieces ---------- */
.panel { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn { border: 0; padding: 0; background: none; font-weight: 700; }
.btn > span { display: block; padding: 11px 22px; font-size: 16px; line-height: 1.3; border-radius: 999px; background: var(--card); color: var(--ink); border: 2px solid var(--line); transition: background .12s, transform .08s, border-color .12s; }
.btn:hover > span { border-color: var(--primary); }
.btn:active > span { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary > span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover > span { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost > span { background: transparent; }
.btn-danger > span { background: transparent; color: var(--berry); border-color: var(--berry); }
.btn-big > span { padding: 14px 36px; font-size: 19px; }
.btn-small > span { padding: 6px 14px; font-size: 14px; }

.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 50%; color: var(--ink); }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.save-dot { display: none; position: absolute; top: 3px; right: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px var(--card); }
.icon-btn.dirty .save-dot { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--line); background: var(--card); color: var(--ink); padding: 6px 16px; border-radius: 999px; font-weight: 500; font-size: 15px; text-decoration: none; display: inline-block; }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

.tag { display: inline-block; padding: 2px 12px; border-radius: 999px; font-weight: 700; font-size: 12.5px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.kind-senate { background: #e3f0ff; color: #164c8a; border-color: #bcd8f7; }
.tag.kind-house { background: #efe8ff; color: #4b2f94; border-color: #d5c7f7; }
.tag.kind-governor { background: #fff0c9; color: #7a5200; border-color: #f0d68a; }
.tag.kind-office { background: #e2f6e8; color: #19633a; border-color: #b8e3c6; }
.tag.kind-measure { background: #ffe5ee; color: #8a2346; border-color: #f6bdd0; }
.tag.kind-judge { background: #eae7f7; color: #433a86; border-color: #cfc9ee; }
.box { padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 3px 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea, .codebox { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-height: 44px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); outline: none; }
.err { color: var(--berry); font-size: 15px; min-height: 1.3em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 20px; margin-bottom: 6px; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }
.big-num { font-weight: 700; font-size: 64px; color: var(--primary); line-height: 1.1; }
.status.live { color: var(--primary); font-weight: 700; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; overflow-y: auto; background: radial-gradient(700px 420px at 50% 20%, var(--sun-soft), transparent 70%), var(--bg); }
.boot.gone { display: none; }
.boot-inner { width: min(560px, 100%); text-align: center; }
.boot-mark { width: 84px; height: 84px; margin: 0 auto 10px; display: block; }
.boot-logo { font-weight: 700; font-size: clamp(34px, 9vw, 52px); line-height: 1.05; color: var(--ink); }
.boot-logo span { display: block; }
.boot-logo span:last-child { color: var(--primary); }
.boot-sub { margin: 10px 0 24px; font-weight: 500; color: var(--muted); }
.boot-bar { height: 10px; background: #fff; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 4%; background: linear-gradient(90deg, var(--sun), var(--primary)); border-radius: 999px; transition: width .5s ease-out; }
.boot-tip { margin: 16px 0 22px; min-height: 3em; color: var(--muted); font-size: 15px; }

/* ---------- top bar ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.hud { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 10px 20px; padding-top: calc(10px + env(safe-area-inset-top)); background: rgba(255, 248, 236, .96); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; line-height: 1.1; color: var(--ink); }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { display: block; font-weight: 700; }
.season { font-size: 13px; color: var(--muted); max-width: 200px; line-height: 1.3; }
.season b { display: block; color: var(--ink); font-weight: 700; font-size: 14px; }
.ready { min-width: 0; max-width: 520px; width: 100%; }
.ready-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ready-stage { font-weight: 700; font-size: 17px; }
.ready-pct { font-weight: 700; font-size: 17px; color: var(--primary); }
.meter { height: 14px; margin: 4px 0 3px; background: #fff; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--sun), var(--primary)); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.ready-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xpbar { height: 10px; margin: 6px 0 4px; background: #fff; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sun), var(--primary)); border-radius: 999px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.hud-actions { display: flex; gap: 8px; align-items: center; }
.warn { background: var(--sun-soft); color: var(--ink); border-bottom: 2px solid var(--sun); padding: 8px 14px; font-weight: 500; text-align: center; font-size: 15px; }

/* ---------- shell and nav ---------- */
.shell { flex: 1; display: grid; grid-template-columns: 200px minmax(0, 1fr); width: 100%; max-width: var(--shell-max); margin: 0 auto; }
.nav { padding: 20px 12px 20px 20px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 90px; align-self: start; }
.nav button { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 14px; background: transparent; border: 2px solid transparent; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 16px; white-space: nowrap; }
.nav button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav button:hover { color: var(--ink); background: var(--soft); }
.nav button.on { color: var(--on-primary); background: var(--primary); }
.nav .more-btn, .more-sheet { display: none; }
.view { padding: 20px 20px 80px 8px; min-width: 0; }
.view-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.view-head h1 { font-weight: 700; font-size: 32px; line-height: 1.15; }
.view-head h1::after { content: ""; display: block; width: 64px; height: 6px; margin-top: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--sun), var(--primary)); }
.view-head p { color: var(--muted); max-width: 60ch; margin-top: 8px; }

/* ---------- real voting cards (plain on purpose) ---------- */
.real-vote, .real-vote * { box-sizing: border-box; }
.real-vote { position: relative; margin: 0 0 22px; padding: 18px 20px 16px; background: #fff; color: #1b1b1b; border: 2px solid #1d3c6e; border-radius: 14px; }
.real-vote h2 { margin: 10px 0 6px; font-size: 21px; font-weight: 700; line-height: 1.3; color: #14264a; }
.real-vote p { margin: 0 0 12px; font-size: 16px; line-height: 1.55; color: #222; max-width: 70ch; }
.real-vote .rv-note { margin: 12px 0 0; font-size: 13.5px; color: #4a4a4a; }
.rv-badge { display: inline-flex; flex-wrap: wrap; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 6px; overflow: hidden; }
.rv-badge span:first-child { background: #1d3c6e; color: #fff; padding: 5px 9px; }
.rv-badge span:last-child { background: #e8ecf4; color: #1d3c6e; padding: 5px 9px; }
.rv-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rv-row label { font-size: 15px; font-weight: 600; color: #14264a; }
.rv-row select { min-height: 44px; min-width: 210px; padding: 8px 10px; font: 16px var(--ui); color: #111; background: #fff; border: 2px solid #5d6b82; border-radius: 10px; }
.rv-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 10px 18px; background: #1d3c6e; color: #fff !important; font: 700 16px var(--ui); text-decoration: none; border: 2px solid #1d3c6e; border-radius: 999px; }
.rv-btn:hover { background: #14284c; }
.rv-alt { background: #fff; color: #1d3c6e !important; }
.rv-alt:hover { background: #e8ecf4; }
.rv-small { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.rv-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; padding: 6px 8px; font: 600 14px var(--ui); color: #4a4a4a; text-decoration: underline; cursor: pointer; }
.rv-dl { margin: 12px 0 14px; }
.rv-dl dt { margin: 12px 0 2px; font-weight: 700; font-size: 15px; color: #14264a; }
.rv-dl dd { margin: 0; font-size: 16px; line-height: 1.55; color: #222; max-width: 72ch; }
.rv-dl dd a { color: #1d3c6e; font-weight: 600; }
.rv-dl ul { margin: 4px 0 0; padding-left: 20px; }
.rv-rules { margin-bottom: 26px; }
.rv-rules .rv-row { margin-top: 6px; }
#r-vote { margin-top: 18px; }
.real-foot { margin: 28px 0 0; padding-top: 14px; border-top: 2px solid var(--line); font-size: 14px; }

/* ---------- ballot ---------- */
.state-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.state-pick label { font-weight: 700; font-size: 15px; }
.state-pick select { min-height: 46px; min-width: 230px; padding: 8px 12px; font: 16px var(--ui); color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.b-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0 4px; }
.b-head h2 { font-size: 26px; }
.b-prog { min-width: 220px; font-size: 14px; color: var(--muted); }
.b-note { margin: 4px 0 14px; max-width: 80ch; }
.b-tools { margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fc-toggle { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.fc-toggle input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.contests { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); align-items: start; }
.contest { padding: 18px; }
.contest.researched { border-color: var(--leaf); }
.contest h3 { margin: 8px 0 4px; font-size: 21px; }
.contest .blurb { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.c-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.read-ok { font-size: 12.5px; font-weight: 700; color: var(--leaf); }
.opts { display: grid; gap: 8px; margin: 10px 0 12px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 14px; text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 14px; cursor: pointer; font: inherit; }
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt i { flex: none; width: 20px; height: 20px; border: 2px solid var(--muted); border-radius: 50%; }
.opt.on { border-color: var(--primary); background: #e7f6f2; }
.opt.on i { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 45%, transparent 50%); }
.opt span { display: flex; flex-direction: column; min-width: 0; }
.opt b { font-weight: 700; font-size: 16.5px; overflow-wrap: anywhere; }
.opt em { font-style: normal; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.opt.skip b { font-weight: 500; color: var(--muted); }
.opt.right { border-color: var(--leaf); background: #e5f6ec; }
.opt.right i { border-color: var(--leaf); background: var(--leaf); }
.opt.wrong { border-color: var(--berry); background: #fde9ee; }
.opt.wrong i { border-color: var(--berry); }
.opt:disabled { cursor: default; opacity: 1; color: var(--ink); }
.explainer { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); font-size: 16px; line-height: 1.55; }
.explainer h4 { margin: 14px 0 6px; font-size: 15px; }
.explainer ul { margin: 6px 0; padding-left: 20px; }
.explainer li { margin-bottom: 4px; }
.ex-sides { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.ex-side { padding: 10px 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.ex-side h4 { margin-top: 0; }
.thresh { padding: 8px 12px; border-left: 4px solid var(--sun); background: var(--sun-soft); border-radius: 0 10px 10px 0; }
.b-done { margin-top: 16px; padding: 18px; background: linear-gradient(135deg, #e7f6f2, var(--sun-soft)); }
.b-done h3 { margin: 0 0 6px; }
.b-done .actions { justify-content: flex-start; margin-top: 10px; }
.quest-teaser { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 22px; padding: 12px 16px; border: 2px dashed var(--line); border-radius: 14px; font-size: 14px; color: var(--muted); }
.scout-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.scout-links .chip { font-size: 14px; }

/* ---------- candidates inside each ballot contest ---------- */
.look-h { margin: 12px 0 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.cands { display: grid; gap: 8px; margin: 0 0 12px; }
.cand { background: var(--soft); border: 2px solid var(--line); border-radius: 14px; }
.cand.open { border-color: var(--primary); background: #fff; }
.cand-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 52px; padding: 10px 14px; text-align: left; background: none; border: 0; color: var(--ink); font: inherit; border-radius: 14px; }
.cand-btn > span:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.cand-btn b { font-size: 16.5px; overflow-wrap: anywhere; }
.cand-btn em { font-style: normal; font-size: 14px; color: var(--muted); }
.cand-btn i { font-style: normal; font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.cand-btn i.fine { color: var(--muted); font-weight: 500; }
.cand-btn i.read-ok { color: var(--leaf); }
.cand-btn .odds { flex: 0 0 auto; margin-left: auto; padding-left: 6px; font-weight: 500; color: var(--muted); }
.cand-btn .odds b { display: inline; font-size: 17px; color: var(--ink); }
.cand-body { padding: 0 14px 14px; font-size: 16px; line-height: 1.55; }
.cand-body h4 { margin: 12px 0 6px; font-size: 14.5px; color: var(--muted); }
.cand-body a { overflow-wrap: anywhere; }
.odds-note { margin: 0 0 8px; }
.forecast { margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--line); }
.fc-body { margin-top: 8px; font-size: 15px; line-height: 1.55; }
.fc-body .fine { margin-bottom: 8px; }
.ex-facts { margin: 6px 0; padding-left: 20px; }
.ex-facts li { margin-bottom: 6px; }

/* ---------- civics, checklist, badges ---------- */
.civ-stat { margin: 0 0 14px; color: var(--muted); }
.civ-stat b { color: var(--primary); font-size: 28px; }
.daily-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; margin-bottom: 16px; background: linear-gradient(135deg, var(--sun-soft), #fff); }
.daily-q h2 { margin: 0 0 4px; }
.daily-q p { color: var(--muted); }
.tracks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.track { padding: 16px; }
.track h3 { margin: 0 0 4px; font-size: 19px; }
.track p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.track .btn { margin-top: 10px; }
.quiz-q { padding: 20px; max-width: 760px; }
.quiz-q h2 { margin: 12px 0 8px; font-size: 24px; line-height: 1.25; }
.q-fb { margin: 6px 0 12px; padding: 10px 14px; font-size: 16px; line-height: 1.55; border-left: 5px solid var(--muted); background: var(--soft); border-radius: 0 12px 12px 0; }
.q-fb.ok { border-left-color: var(--leaf); background: #e5f6ec; }
.q-fb.no { border-left-color: var(--berry); background: #fde9ee; }
.quiz-end { max-width: 560px; text-align: center; padding: 26px; }
.quiz-end .actions { justify-content: center; margin-top: 12px; }
.quests { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.quest { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 14px 16px; background: #fff; border: 2px solid var(--line); border-radius: 14px; }
.quest.done { border-color: var(--leaf); background: #f1fbf4; }
.quest h3 { margin: 0 0 2px; font-size: 18px; }
.quest p { color: var(--muted); font-size: 14.5px; max-width: 60ch; }
.q-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.trophy { padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.trophy.locked { opacity: .55; }
.trophy .ic { width: 50px; height: 50px; flex: none; display: grid; place-items: center; background: var(--sun); color: #5a3c00; border-radius: 50%; }
.trophy.locked .ic { background: var(--line); color: var(--muted); }
.trophy svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trophy h3 { font-size: 17px; }
.trophy p { font-size: 14px; color: var(--muted); }
.trophy .by { font-size: 12px; color: var(--leaf); font-weight: 500; margin-top: 4px; }
.lvl-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px; margin-bottom: 16px; }
.lvl-card .lvl { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: #5a3c00; font-weight: 700; font-size: 26px; flex: none; }
.lvl-card .lvl-body { flex: 1 1 240px; min-width: 0; }
.lvl-card h2 { font-size: 20px; }

/* ---------- checklist of what is left ---------- */
.steps-left { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.steps-left li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.steps-left i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; color: #fff; }
.steps-left li.done i { background: var(--leaf); border-color: var(--leaf); }
.steps-left li.done span { color: var(--muted); }
.steps-left b { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* ---------- rules ---------- */
.jumps { margin-bottom: 16px; }
.rules { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.rule { padding: 20px 22px; scroll-margin-top: 110px; display: flex; flex-direction: column; gap: 12px; }
.rule h2 { font-size: 24px; }
.rule h2::after { content: ""; display: block; width: 48px; height: 5px; margin-top: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--sun), var(--primary)); }
.rule .box { margin: 2px 0; }
.rule .kv span:last-child { font-size: 15px; }
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: st; position: relative; padding-left: 44px; min-height: 32px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; background: var(--primary); border-radius: 50%; }
.faq { border-top: 2px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin-top: 8px; color: var(--muted); }
.disclaimer { padding: 4px 2px 20px; }

/* ---------- modals, toasts, tour, profiles, backup ---------- */
#layer-modal .modal-scrim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(29, 43, 79, .55); backdrop-filter: blur(4px); }
.modal { width: min(520px, 100%); max-height: 92vh; overflow-y: auto; padding: 26px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; animation: pop .26s cubic-bezier(.2, 1.3, .4, 1); overscroll-behavior: contain; }
.modal.left, .modal.tour { text-align: left; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { font-size: 26px; }
.modal .sub { color: var(--muted); }
.modal .trophy { justify-content: center; }
.toasts { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { padding: 10px 18px; background: var(--ink); color: #fff; font-weight: 500; border-radius: 999px; animation: toastin .25s ease-out; max-width: 340px; box-shadow: var(--shadow); }
.toast.good { background: var(--primary); }
.toast.bad { background: var(--berry); }
@keyframes toastin { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 2px solid var(--line); text-align: left; }
.toggle input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--primary); }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { height: 6px; flex: 1; background: var(--line); border-radius: 999px; }
.tour-dots i.done { background: var(--sun); }
.tour-dots i.on { background: var(--primary); }
.tour-demo { text-align: center; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.set-grid .btn > span { width: 100%; text-align: center; }
.prof { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: end; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--soft); }
.prof.on { border-color: var(--primary); }
.prof .s { grid-column: 1; font-size: 13px; color: var(--muted); }
.prof .status, .prof .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.codebox { font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.3; word-break: break-all; resize: vertical; padding: 8px; }
.card-canvas { width: 100%; height: auto; display: block; border: 2px solid var(--line); border-radius: 12px; }

/* ---------- password page ---------- */
.landing { position: static; min-height: 100vh; }
.login { padding: 20px; text-align: left; display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.login .btn { align-self: stretch; }
.login .btn > span { text-align: center; }

/* ---------- print sheet ---------- */
#print-sheet { display: none; }
@page { margin: 0.5in; }
@media print {
  body > *:not(#print-sheet) { display: none !important; }
  html, body { background: #fff !important; }
  #print-sheet { display: block !important; color: #000; background: #fff; font: 10.5pt/1.3 system-ui, Arial, sans-serif; padding: 0; }
  #print-sheet h1 { font-size: 16pt; margin: 0 0 3pt; }
  #print-sheet h2 { font-size: 10.5pt; margin: 0 0 2pt; }
  #print-sheet .ps-sub { font-size: 8.5pt; margin: 0 0 8pt; color: #333; }
  #print-sheet .ps-top { margin: 0 0 8pt; padding: 5pt 7pt; border: 1.5px solid #000; font-size: 9.5pt; }
  #print-sheet .ps-top b { font-size: 10pt; }
  #print-sheet .ps-cols { column-count: 2; column-gap: 0.3in; column-rule: 1px solid #bbb; }
  #print-sheet .ps-c { break-inside: avoid; page-break-inside: avoid; margin: 0 0 6pt; padding-bottom: 4pt; border-bottom: 1px solid #aaa; }
  #print-sheet ul { list-style: none; margin: 0; padding: 0; }
  #print-sheet li { margin: 1pt 0; font-size: 10pt; overflow-wrap: anywhere; }
  #print-sheet p { font-size: 8.5pt; overflow-wrap: anywhere; margin: 3pt 0; }
  #print-sheet .ps-foot { margin-top: 8pt; padding-top: 4pt; border-top: 1px solid #000; }
}

/* ---------- responsive ---------- */
@media (min-width: 961px) {
  .hud { padding-left: max(20px, calc((100% - var(--shell-max)) / 2 + 20px)); padding-right: max(20px, calc((100% - var(--shell-max)) / 2 + 20px)); }
}
@media (min-width: 1700px) { :root { --shell-max: 1480px; } }
@media (max-width: 960px) {
  .hud { grid-template-columns: 1fr auto; gap: 10px; padding: 10px 14px; position: static; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .season { display: none; }
  .ready { grid-column: 1 / -1; order: 5; max-width: none; }
  .ready-sub { white-space: normal; }
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; top: auto; z-index: 30; flex-direction: row; gap: 0; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: rgba(255, 252, 244, .98); border-top: 2px solid var(--line); }
  .nav button { min-width: 0; flex: 1; flex-direction: column; gap: 2px; justify-content: center; padding: 8px 2px; font-size: 12px; border-radius: 0; text-align: center; }
  .nav button.on { background: transparent; color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }
  .nav button.sec { display: none; }
  .nav .more-btn { display: flex; }
  .nav .more-btn.on { color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }
  .more-sheet { position: fixed; left: 8px; right: 8px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 31; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; background: #fff; border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 -8px 24px rgba(29, 43, 79, .18); }
  .more-sheet[hidden] { display: none; }
  .more-sheet button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; padding: 8px 4px; font: 700 13px var(--ui); color: var(--ink); background: var(--soft); border: 2px solid var(--line); border-radius: 12px; }
  .more-sheet button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
  .more-sheet svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .view { padding: 14px max(14px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .contests { grid-template-columns: 1fr; }
  .quiz-q h2 { font-size: 21px; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .rule { padding: 16px 14px; }
  .rule h2 { font-size: 21px; }
  .real-vote { padding: 16px 14px 14px; }
  .rv-row select, .rv-btn { width: 100%; }
  .rv-close { position: static; display: block; margin: 10px 0 0; }
  .set-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px 16px; }
  .modal h2 { font-size: 22px; }
  .view-head h1 { font-size: 26px; }
  .cand-btn { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .nav button { font-size: 10.5px; }
  .nav button svg { width: 18px; height: 18px; }
  .brand { font-size: 16px; }
}
@media (pointer: coarse) {
  .icon-btn { width: 46px; height: 46px; }
  .btn-small > span { padding: 10px 16px; }
  .chip { padding: 10px 18px; }
  .field input, .field select, .field textarea, .state-pick select { min-height: 48px; font-size: 16px; }
  .linkish { padding: 12px 4px; margin: -12px -4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; transition-delay: 0s !important; }
}

/* ---------- top bar meter (a button, so it opens the checklist) ---------- */
button.ready { display: block; background: none; border: 0; padding: 4px 0; margin: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; border-radius: 12px; }
button.ready:hover .ready-stage { color: var(--primary); }
.ready-top { display: flex; }
.ready .meter { display: block; }
.ready-sub { display: block; }

/* research tucked under each candidate */
.opt-wrap { display: grid; }
.opt-wrap > .opt { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.opt-wrap > .cand.inl { border-top: 0; border-radius: 0 0 14px 14px; background: var(--soft); }
.opt-wrap > .cand.inl.open { background: #fff; }
.cand-btn.strip { min-height: 44px; padding: 6px 14px; border-radius: 0 0 14px 14px; }
.cand-btn.strip > span:first-child { flex-direction: row; }
.cand-btn.strip b { font-size: 14.5px; color: var(--primary); }
.cand-btn.strip .chev { margin-left: auto; font-size: 16px; }
.cand-btn.strip .odds { margin-left: 0; }
.rc-count { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 6px; }

.pos-topic h5 { margin: 10px 0 4px; font-size: 15px; color: var(--ink); }
.pos-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pos-list li { padding: 8px 10px; background: var(--soft); border-radius: 10px; overflow-wrap: anywhere; }
.st { display: inline-block; margin-right: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.st-supports { border-color: var(--leaf); color: #1d6b3f; }
.st-opposes { border-color: var(--berry); color: #9b1f45; }
.st-both { border-color: var(--sun); color: #7a5a00; }
.st-record { border-color: var(--primary); color: var(--primary); }

.cust { margin-top: 14px; }
.cust summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cust .field { margin: 10px 0; }
.cust input, .cust select, .cust textarea { width: 100%; font: inherit; padding: 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.tag.kind-custom { background: var(--sun); color: var(--ink); }

.opt-wrap.wi { display: block; }
.wi-box { margin-top: 6px; padding: 10px 12px; background: var(--soft); border: 2px solid var(--primary); border-radius: 12px; }
.wi-box label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.wi-box input { width: 100%; font: inherit; padding: 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }

.dist-pick { margin: 12px 0; }
.dist-pick > h3 { margin: 0 0 2px; }
.dist-find { margin: 10px 0 0; }
.dist-find label, .dist-grid .field label { display: block; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.dist-row.sug-wrap { display: flex; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
.dist-row input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.dist-row input:focus, .dist-pick select:focus { outline: 3px solid var(--sun); outline-offset: 1px; border-color: var(--primary); }
.dist-row .btn { flex: 0 0 auto; min-width: 84px; border-radius: 12px; }
.dist-hint { margin: 6px 2px 0; font-size: 12.5px; color: var(--muted); }
.dist-msg { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--sun-soft); font-weight: 600; font-size: 14px; line-height: 1.35; }
.dist-msg.ok { background: rgba(14,122,104,.12); color: var(--primary-dark); }
.dist-msg.ok::before { content: "\2713  "; font-weight: 800; }
.dist-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 14px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--soft); }
.dist-grid .field { margin: 0; }
.dist-pick select { width: 100%; font: inherit; font-size: 16px; font-weight: 600; padding: 11px 38px 11px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%231d2b4f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; -webkit-appearance: none; appearance: none; color: var(--ink); }
.dist-pick .poll { margin-top: 14px; }
.thin-note { margin: 8px 0 0; }

/* voting day */
.gl{list-style:none;margin:.6rem 0 0;padding:0;display:grid;gap:.7rem}
ol.gl{counter-reset:s}
ol.gl li{counter-increment:s}
ol.gl li b::before{content:counter(s) ". "}
.gl li{display:grid;gap:.15rem;padding-bottom:.65rem;border-bottom:1px solid var(--line,#e3e0d6)}
.gl li:last-child{border-bottom:0;padding-bottom:0}
.gl li span{line-height:1.45}
.gl li a{font-size:.85rem}
.hot{margin-top:.8rem;padding:.7rem .85rem;border-radius:10px;background:rgba(14,122,104,.1)}
.off-note{margin:.35rem 0}
.off-note summary{cursor:pointer;font-weight:600}
.off-note p{margin:.35rem 0 .5rem;line-height:1.45}
.c-report{text-align:right;margin-top:.4rem}
.report{font-size:.8rem;opacity:.8}
.rights h2{margin-top:0}

/* address combobox + polling place */
.sug-wrap{position:relative;flex-wrap:wrap}
.sug{position:absolute;left:0;right:0;top:100%;z-index:20;margin:4px 0 0;padding:4px;list-style:none;background:#fff;border:2px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.14);max-height:260px;overflow:auto}
.sug[hidden]{display:none}
.sug li{padding:10px;border-radius:8px;cursor:pointer;line-height:1.3}
.sug li.on,.sug li:hover{background:rgba(14,122,104,.14)}
.poll{margin-top:10px;padding:12px;border-radius:12px;background:rgba(14,122,104,.08)}
.poll h4{margin:0 0 4px}.poll h5{margin:10px 0 2px}
.pl{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.pl li{display:grid;gap:1px}

.ps-take{break-inside:avoid;border:1.5pt solid #000;padding:6pt 8pt;margin:0 0 8pt;column-span:all}
.ps-take h2{font-size:12pt;margin:0 0 4pt}.ps-take small{font-weight:400;font-size:8pt}
.ps-take dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:2pt 8pt;font-size:9.5pt}
.ps-take dt{font-weight:700}.ps-take dd{margin:0}

/* large text */
html.big body{zoom:1.2;width:calc(100% / 1.2);min-width:0}
@supports not (zoom:1){html.big{font-size:120%}}
@media print{html.big body{zoom:1}}
.drill-o{display:grid;gap:8px;margin:10px 0}
.drill-o .ok{border-color:#0e7a68;background:rgba(14,122,104,.15)}
.drill-o .bad{border-color:#b3261e;background:rgba(179,38,30,.1)}
.drill h2 small{font-weight:400;opacity:.7}
.view-head + .panel,#day-body>.panel,#day-body>section{margin-bottom:12px}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}

.vtag{font-size:.8rem;font-weight:600;color:#0e7a68;text-decoration:none}
.after-banner{background:rgba(255,201,60,.18)}
/* touch targets: at least 24px tall (WCAG 2.2) */
.report,.linkish,a.rv-small,.vtag,.gl li a{display:inline-block;min-height:24px;line-height:24px}
.linkish{padding:0}
@media (max-width:520px){html.big .hud{grid-template-columns:minmax(0,1fr) auto;gap:8px 10px}html.big .season{display:none}html.big .ready{grid-column:1/-1;max-width:none}html.big .brand{font-size:16px}}
.gl li{grid-template-columns:minmax(0,1fr);overflow-wrap:anywhere}.gl{min-width:0}

.skip-link{position:absolute;left:8px;top:-60px;z-index:100;background:#0e7a68;color:#fff;padding:10px 14px;border-radius:8px;font-weight:600}
.skip-link:focus{top:8px}
:focus-visible{outline:3px solid #0e7a68;outline-offset:2px}
main:focus{outline:none}

.rv-btn[hidden]{display:none}
.rv-check{margin-left:8px}

.en-orig{margin:.1rem 0}.en-orig summary{cursor:pointer;font-size:.85rem;min-height:24px;color:var(--muted,#555)}.en-orig p{margin:.2rem 0 0;font-size:.9rem}

.gballot{margin-top:.6rem}.gballot summary{cursor:pointer;min-height:24px}.gb{list-style:none;padding:0;margin:.2rem 0 .6rem}.gb>li{padding:.35rem 0;border-bottom:1px solid var(--line,#e3e0d6)}.gb>li:last-child{border-bottom:0}.gb ul{margin:.2rem 0 0 1rem;padding:0}.gb p{margin:.2rem 0}.gballot{overflow-wrap:anywhere}

.rv-showrow { margin: 0 0 14px; }
.rv-rules { padding-right: 20px; }

.dist-done { padding: 12px 14px; }
.dist-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.dist-sum-k { font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dist-sum-v { font-weight: 700; flex: 1 1 auto; }
.dist-donebtn { margin-top: 12px; }

/* the address area slides in: from the right when you move forward, from the left when you go back */
@keyframes bbInR { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes bbInL { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
.dist-pick.anim-r { animation: bbInR .25s ease-out both; }
.dist-pick.anim-l { animation: bbInL .25s ease-out both; }
#learn-body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { .dist-pick.anim-r, .dist-pick.anim-l { animation: none; } }

/* first-visit wizard: one thing per screen */
.wizing .hud, .wizing .nav, .wizing .warn { display: none !important; }
.wizing .shell { display: block; }
.wz { min-height: 78vh; display: flex; align-items: center; justify-content: center; overflow-x: clip; padding: 12px 0; }
.wz-card { width: 100%; max-width: 520px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 26px 22px; box-shadow: 0 10px 30px rgba(29,43,79,.10); animation: wzInFwd .38s cubic-bezier(.22,.8,.3,1) both; }
.wz-card.in-back { animation-name: wzInBack; }
.wz-card.out-fwd { animation: wzOutFwd .34s ease-in both; }
.wz-card.out-back { animation: wzOutBack .34s ease-in both; }
@keyframes wzInFwd { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }
@keyframes wzInBack { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: none; } }
@keyframes wzOutFwd { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-100%); } }
@keyframes wzOutBack { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(100%); } }
.wz-card h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; outline: none; }
.wz-sub { margin: 0 0 20px; color: var(--muted); font-size: 17px; }
.wz-actions { display: grid; gap: 10px; margin-top: 16px; }
.wz-actions.wz-row { grid-template-columns: 1fr 1fr; }
.wz-actions [hidden] { display: none; }
.wz-btn { width: 100%; justify-content: center; min-height: 52px; font-size: 17px; border-radius: 14px; }
.wz-lab { display: block; margin: 14px 0 6px; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wz-input { width: 100%; font: inherit; font-size: 17px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.wz-input:focus { outline: 3px solid var(--sun); outline-offset: 1px; border-color: var(--primary); }
.wz-links { margin-top: 14px; display: flex; gap: 18px; }
.wz .poll { margin-top: 10px; }
@keyframes wzViewIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }
#view.wz-view-in { animation: wzViewIn .38s cubic-bezier(.22,.8,.3,1) both; }
body:has(#view.wz-view-in) { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { .wz-card, .wz-card.in-back, .wz-card.out-fwd, .wz-card.out-back, #view.wz-view-in { animation: none !important; } }

/* ---------- motion ---------- */
@keyframes bbRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bbTabFwd { from { opacity: 0; transform: translateX(56px); } to { opacity: 1; transform: none; } }
@keyframes bbTabBack { from { opacity: 0; transform: translateX(-56px); } to { opacity: 1; transform: none; } }
@keyframes bbDeckInFwd { from { opacity: 0; transform: translateX(84px); } to { opacity: 1; transform: none; } }
@keyframes bbDeckInBack { from { opacity: 0; transform: translateX(-84px); } to { opacity: 1; transform: none; } }
@keyframes bbDeckOutFwd { to { opacity: 0; transform: translateX(-84px); } }
@keyframes bbDeckOutBack { to { opacity: 0; transform: translateX(84px); } }
@keyframes bbPop { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes bbShake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); } 90% { transform: translateX(2px); } }
@keyframes bbGlow { 0% { box-shadow: 0 0 0 0 rgba(14,122,104,.45); } 100% { box-shadow: 0 0 0 14px rgba(14,122,104,0); } }

#view.tab-fwd { animation: bbTabFwd .36s cubic-bezier(.22,.8,.3,1) both; }
#view.tab-back { animation: bbTabBack .36s cubic-bezier(.22,.8,.3,1) both; }
body:has(#view.tab-fwd), body:has(#view.tab-back) { overflow-x: clip; }
.rise { animation: bbRise .55s cubic-bezier(.22,.8,.3,1) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* race cards */
.deck-stage { overflow-x: clip; }
.deck-card.in-fwd, .sdeck-s.in-fwd { animation: bbDeckInFwd .36s cubic-bezier(.22,.8,.3,1) both; }
.deck-card.in-back, .sdeck-s.in-back { animation: bbDeckInBack .36s cubic-bezier(.22,.8,.3,1) both; }
.deck-card.out-fwd, .sdeck-s.out-fwd { animation: bbDeckOutFwd .23s ease-in both; }
.deck-card.out-back, .sdeck-s.out-back { animation: bbDeckOutBack .23s ease-in both; }
.deck-hide { display: none !important; }
.deck-top { scroll-margin-top: 76px; height: 0; }
.deck-prog { margin: 10px 0 6px; }
.deck-prog-t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.deck-prog-t b { font-size: 15px; }
.deck-prog-t span { color: var(--muted); }
.deck-nav { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0 6px; }
.deck-nav .btn { flex: 1 1 0; min-height: 52px; font-size: 17px; border-radius: 14px; justify-content: center; }
.deck-switch { margin: 0 0 6px; text-align: right; }
.b-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sdeck-top { margin: 4px 0 10px; position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 6px 0 2px; }
.sdeck-top .deck-prog-t b { overflow-wrap: anywhere; }
.deck-review h3 { margin-top: 0; }
.rv-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.rv-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; padding: 11px 14px; background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 12px; font: inherit; cursor: pointer; transition: transform .15s, border-color .2s, background-color .2s; }
.rv-item:hover { border-color: var(--primary); transform: translateX(3px); }
.rv-t { font-weight: 700; overflow-wrap: anywhere; }
.rv-m { flex: none; max-width: 48%; font-size: 14px; text-align: right; overflow-wrap: anywhere; }
.rv-m.ok { color: var(--primary-dark); font-weight: 700; }
.rv-m.no { color: var(--muted); }

/* touch and hover feel */
.btn, .opt, .chip, .cand-btn, .nav button, .icon-btn { transition: transform .16s cubic-bezier(.3,1.4,.5,1), box-shadow .2s, background-color .2s, border-color .2s, color .2s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(29,43,79,.14); }
.btn:active:not(:disabled), .opt:active:not(:disabled), .chip:active, .rv-item:active { transform: scale(.97); box-shadow: none; }
.opt:hover:not(:disabled) { transform: translateX(3px); }
.opt.pop { animation: bbGlow .6s ease-out; }
.opt.pop i { animation: bbPop .4s cubic-bezier(.3,1.5,.5,1); }
.opt.wrong { animation: bbShake .45s ease-in-out; }
.opt.right i { animation: bbPop .4s cubic-bezier(.3,1.5,.5,1); }
.q-fb { animation: bbRise .45s cubic-bezier(.22,.8,.3,1) both; }
.quiz-q.in-fwd, .quiz-end.in-fwd { animation: bbDeckInFwd .36s cubic-bezier(.22,.8,.3,1) both; }
.panel { transition: box-shadow .25s; }
.nav button.on svg { animation: bbPop .4s cubic-bezier(.3,1.5,.5,1); }

@media (prefers-reduced-motion: reduce) {
  #view.tab-fwd, #view.tab-back, .rise, .deck-card.in-fwd, .deck-card.in-back, .deck-card.out-fwd, .deck-card.out-back,
  .sdeck-s.in-fwd, .sdeck-s.in-back, .sdeck-s.out-fwd, .sdeck-s.out-back, .opt.pop, .opt.pop i, .opt.wrong, .opt.right i,
  .q-fb, .quiz-q.in-fwd, .quiz-end.in-fwd, .nav button.on svg { animation: none !important; }
  .btn, .opt, .chip, .rv-item, .xpbar i { transition: none !important; }
  .btn:hover:not(:disabled), .opt:hover:not(:disabled), .rv-item:hover { transform: none; }
}
.deck-nav { position: sticky; bottom: 10px; z-index: 4; padding: 10px 0 6px; background: linear-gradient(to bottom, rgba(255,248,236,0), var(--bg) 38%); }
@media (max-width: 960px) { .deck-nav { bottom: calc(72px + env(safe-area-inset-bottom)); } }

.gl .cl { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 6px; list-style: disc; }
.gl .cl li { display: list-item; border: 0; padding: 0; }

/* one-minute drill */
@keyframes bbBar { from { width: var(--from, 0%); } }
@keyframes bbScore { 0% { opacity: 0; transform: scale(.7); } 60% { transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
.drill-bar i { animation: bbBar .6s cubic-bezier(.22,.8,.3,1) both; }
.drill.in-fwd { animation: bbDeckInFwd .36s cubic-bezier(.22,.8,.3,1) both; }
.drill-end.in-pop .drill-score { animation: bbScore .6s cubic-bezier(.3,1.4,.5,1) both; }
.drill-score { font-size: 22px; margin: 10px 0; }
.drill-o .btn.ok { animation: bbGlow .6s ease-out; }
.drill-o .btn.bad { animation: bbShake .45s ease-in-out; }
.drill [role=status] { animation: bbRise .45s cubic-bezier(.22,.8,.3,1) both; }
@media (prefers-reduced-motion: reduce) { .drill-bar i, .drill.in-fwd, .drill-end.in-pop .drill-score, .drill-o .btn.ok, .drill-o .btn.bad, .drill [role=status] { animation: none !important; } }

/* Voting day rework */
.vd > h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.2; }
.vd > h3 { margin: 22px 0 10px; font-size: 17px; }
.acc { display: grid; gap: 8px; }
.acc-row { border: 2px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .25s; }
.acc-row:hover { border-color: var(--primary); }
.acc-row[open] { border-color: var(--primary); box-shadow: 0 6px 16px rgba(14,122,104,.12); }
.acc-row summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 16.5px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.acc-row summary::-webkit-details-marker { display: none; }
.acc-row summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2.5px solid var(--primary); border-bottom: 2.5px solid var(--primary); transform: rotate(45deg); margin-top: -4px; transition: transform .25s, margin .25s; }
.acc-row[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.acc-b { padding: 0 16px 14px; animation: bbRise .38s cubic-bezier(.22,.8,.3,1) both; }
.acc-b p { margin: 0 0 8px; line-height: 1.55; }
.acc-b .src { font-size: 14px; }
.tl { list-style: none; counter-reset: tl; margin: 0; padding: 0; display: grid; gap: 14px; }
.tl li { counter-increment: tl; position: relative; padding: 2px 0 2px 54px; min-height: 40px; display: grid; gap: 2px; }
.tl li::before { content: counter(tl); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 17px; }
.tl li::after { content: ""; position: absolute; left: 18px; top: 42px; bottom: -12px; width: 2px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl li b { font-size: 17px; }
.tl li span { line-height: 1.5; color: var(--ink); }
.hot { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(14,122,104,.1); }
.hot-a { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 10px; }
.sd-dots { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding: 2px 1px 4px; }
.sd-dot { flex: 1 0 28px; min-width: 28px; height: 30px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--muted); font: 700 13px var(--ui); cursor: pointer; transition: transform .2s cubic-bezier(.3,1.4,.5,1), background-color .2s, border-color .2s, color .2s; }
.sd-dot:hover { border-color: var(--primary); }
.sd-dot.done { background: #e7f6f2; border-color: var(--primary); color: var(--primary-dark); }
.sd-dot.on { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.12); }
.view-head + .panel .chips .chip { padding: 6px 12px; font-size: 14px; }
@media (max-width: 560px) { .view-head + .panel .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .view-head + .panel .chips .chip { flex: none; } }
@media (prefers-reduced-motion: reduce) { .acc-b, .sd-dot { animation: none !important; transition: none !important; } .acc-row summary::after { transition: none; } }
.vd, .drill, .drill-end, #drill-slot > .panel { padding: 20px; }
#day-top > .panel { padding: 16px; }
#day-top .rv-row { margin-top: 12px; }
#day-top .actions { margin-top: 12px; }
.sd-dot { flex: 0 0 34px; }
.sd-dots { justify-content: flex-start; }
@media (max-width: 560px) { .vd, .drill, .drill-end, #drill-slot > .panel { padding: 16px; } .sd-dot { flex: 1 0 28px; } }
#drill-slot [data-act=drill-start] { min-height: 52px; font-size: 17px; padding: 0 30px; margin-top: 6px; }
.drill-o { display: grid; gap: 10px; margin: 12px 0; }
.drill-o .btn { min-height: 50px; justify-content: flex-start; text-align: left; font-size: 16.5px; border-radius: 14px; }
.shell { overflow-x: clip; }

/* Measure details from Google */
.gx { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line, rgba(128,128,128,.25)); }
.gx-n { margin: 0 0 8px; }
.gx-l { margin: 0 0 10px; padding-left: 18px; }
.gx-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 10px; }
.gx-s { padding: 10px 12px; border: 1px solid var(--line, rgba(128,128,128,.25)); border-radius: 10px; }
.gx-s h5 { margin: 0 0 4px; font-size: .85rem; }
.gx-s p { margin: 0; white-space: pre-line; }
.gx-tx { margin: 0 0 10px; }
.gx-tx p { white-space: pre-line; max-height: 320px; overflow: auto; }
@media (max-width: 600px) { .gx-pc { grid-template-columns: 1fr; } }
