/* =========================================================================
   Morocco 2026 — visual system v2  ·  "Soft Structuralism"
   Silver-light canvas · massive grotesk type · pillowy diffused shadows ·
   nested double-bezel surfaces · one restrained indigo accent.
   Vanilla CSS. Every selector the app's JS/markup uses is preserved.
   ========================================================================= */

/* ---------------- Tokens (TLDR broadcast — dark default) ---------------- */
:root {
  --bg:        #0b0f19;   /* ultra-deep matte broadcast black-blue */
  --bg-2:      #070a12;   /* deeper inset (matrix bg) */
  --surface:   #172033;   /* premium slate info surface */
  --surface-2: #0f1626;   /* recessed panel */
  --shell:     #0b0f19;

  --ink:       #ffffff;   /* pure broadcast white */
  --muted:     #94a3b8;   /* sub text slate */
  --faint:     #64748b;
  --hair:      #24324f;   /* tight geometric grid borders */
  --hair-2:    #2e3f63;

  --accent:      #ef4444;  /* TLDR signature red — used for live pill + CTA */
  --accent-deep: #dc2626;
  --accent-soft: rgba(239, 68, 68, 0.10);

  --gov-blue:    #3b82f6;
  --gov-deep:    #1e3a8a;
  --opp-red:     #ef4444;
  --opp-deep:    #3f1515;
  --good:      #2f9e6b;
  --danger:    #d4493f;
  --warn:      #c98a1e;

  /* Soft, diffused, slightly-cool ambient shadows — the signature */
  --sh-1:   0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2:   0 2px 6px rgba(0, 0, 0, 0.5);
  --sh-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --ring:    0 0 0 1px var(--hair);
  --inset-hi: none;

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);   /* iOS-like, heavy settle */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --r-xl: 30px;
  --r-lg: 22px;
  --r-md: 15px;
  --r-sm: 11px;
  --maxw: 760px;
}

/* ---------------- Dark = deep charcoal ---------------- */
:root[data-theme="dark"] {
  --bg:        #0e0f13;
  --bg-2:      #15161b;
  --surface:   #191b21;
  --surface-2: #14151a;
  --shell:     #101115;

  --ink:       #f1f2f6;
  --muted:     #a6abb8;
  --faint:     #6c7180;
  --hair:      rgba(255, 255, 255, 0.08);
  --hair-2:    rgba(255, 255, 255, 0.13);

  --accent:      #22d3ee;
  --accent-deep: #0891b2;
  --accent-soft: rgba(34, 211, 238, 0.16);
  --good:      #4cc78c;
  --danger:    #ff6a5e;
  --warn:      #e0a93a;

  --sh-1:   0 1px 2px rgba(0, 0, 0, 0.5);
  --sh-2:   0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 20px -8px rgba(0, 0, 0, 0.7);
  --sh-card: 0 1px 1px rgba(0, 0, 0, 0.4), 0 8px 20px -8px rgba(0, 0, 0, 0.55),
             0 28px 56px -24px rgba(0, 0, 0, 0.7);
  --ring:    0 0 0 1px var(--hair);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -20%, #f6f7fa 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 52px 20px 120px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] body {
  background: radial-gradient(120% 80% at 50% -20%, #1a1c22 0%, transparent 60%), var(--bg);
}

/* Fixed grain overlay (very subtle film texture) */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.025; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: 0.04; }

.app { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); }

.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 0 0 14px 14px;
  z-index: 100; font-weight: 600; transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------------- Card = floating double-bezel plate ---------------- */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 56px 48px;
  box-shadow: var(--ring), var(--inset-hi), var(--sh-card);
}
/* Outer bezel "tray" — a faint larger frame behind the plate */
.card::before {
  content: ""; position: absolute; inset: -9px; z-index: -1;
  background: var(--shell);
  border-radius: calc(var(--r-xl) + 9px);
  box-shadow: var(--ring);
}
@media (max-width: 600px) { .card { padding: 32px 22px; } .card::before { inset: -6px; } }

.screen { animation: rise .56s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.hidden { display: none !important; }

/* ---------------- Typography ---------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); font-weight: 400;
  background: var(--surface-2); border-radius: 999px; padding: 7px 14px; margin-bottom: 26px;
  box-shadow: var(--ring), var(--inset-hi);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

h1 {
  font-family: var(--font); font-weight: 800;
  font-size: clamp(40px, 8.5vw, 68px); line-height: 0.96; letter-spacing: -0.04em;
  text-wrap: balance;
}
h1 .grad, .grad { color: var(--accent); }
.lead { color: var(--muted); font-size: 18px; line-height: 1.62; margin-top: 22px; max-width: 56ch; text-wrap: pretty; font-weight: 450; }

.section-title {
  font-family: var(--font); font-weight: 800;
  font-size: clamp(28px, 6vw, 42px); line-height: 1.0; letter-spacing: -0.03em; text-wrap: balance;
}
.section-hint { color: var(--muted); font-size: 15px; margin: 14px 0 34px; line-height: 1.62; max-width: 58ch; text-wrap: pretty; }

/* ---------------- Buttons (pill + magnetic press) ---------------- */
.btn {
  appearance: none; cursor: pointer; font-family: var(--font); font-weight: 650; font-size: 15px;
  color: #fff; background: var(--ink); border: 0; border-radius: 999px;
  padding: 15px 26px; letter-spacing: -0.01em;
  box-shadow: var(--sh-2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(24,28,48,.2), 0 14px 28px -8px rgba(24,28,48,.32); background: #000; }
  :root[data-theme="dark"] .btn:hover { background: #fff; color: #000; }
}
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: var(--sh-1); }
.btn.ghost {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: var(--ring), var(--inset-hi), var(--sh-1);
}
@media (hover: hover) and (pointer: fine) {
  .btn.ghost:hover { background: var(--surface); color: var(--accent-deep); box-shadow: 0 0 0 1px var(--accent-soft), var(--inset-hi), var(--sh-2); transform: translateY(-2px); }
  :root[data-theme="dark"] .btn.ghost:hover { color: var(--accent); background: var(--surface); }
}
.btn.small { padding: 12px 20px; font-size: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
/* Headings/sections receive programmatic focus for screen-reader flow — no visible ring */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 38px; }

.disclaimer { margin-top: 26px; font-size: 12px; color: var(--faint); line-height: 1.6; font-family: var(--font-mono); max-width: 60ch; }
footer { text-align: center; color: var(--faint); font-size: 11px; margin-top: 28px; font-family: var(--font-mono); letter-spacing: .05em; }

/* ---------------- Mode / choice cards (hub · compass · prediction) ---------------- */
.modes { display: grid; gap: 14px; margin-top: 32px; counter-reset: mode; }
.mode-card {
  position: relative; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 0; border-radius: var(--r-lg);
  padding: 26px 26px 26px 88px;
  box-shadow: var(--ring), var(--inset-hi);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), background-color .3s var(--ease);
}
.mode-card::before {
  counter-increment: mode; content: counter(mode, decimal-leading-zero);
  position: absolute; left: 26px; top: 50%; transform: translateY(-50%);
  font-family: var(--font); font-weight: 700; font-size: 30px; color: var(--accent);
  letter-spacing: -0.04em; opacity: .9;
}
@media (hover: hover) and (pointer: fine) {
  .mode-card:hover { transform: translateY(-3px); box-shadow: var(--ring), var(--inset-hi), var(--sh-card); background: var(--surface); }
}
.mode-card:active { transform: translateY(0) scale(.99); }
.mode-card .mc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mode-card .mc-name, .mode-card b { font-family: var(--font); font-size: 21px; font-weight: 750; letter-spacing: -0.02em; display: block; }
.mode-card .mc-tag, .mode-card .mode-tag { font-family: var(--font-mono); font-size: 10px; color: var(--faint); letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.mode-card .mc-desc, .mode-card small { color: var(--muted); font-size: 14px; margin-top: 7px; line-height: 1.55; display: block; max-width: 48ch; }

/* ---------------- Progress ---------------- */
.progress { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-family: var(--font-mono); }
.progress .step { font-size: 11px; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }
.bar { height: 4px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-bottom: 30px; box-shadow: inset 0 1px 1px rgba(0,0,0,.04); }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); border-radius: 999px; transition: width .5s var(--ease); }

/* ---------------- Seat total meter (sticky, beveled) ---------------- */
.total-meter {
  position: sticky; top: 12px; z-index: 5;
  background: var(--surface); border-radius: var(--r-md);
  padding: 16px 18px; margin-bottom: 22px;
  box-shadow: var(--ring), var(--inset-hi), var(--sh-2);
}
.total-meter .tm-row { display: flex; justify-content: space-between; align-items: baseline; }
.total-meter .tm-count { font-family: var(--font-mono); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }
.total-meter .tm-count.ok { color: var(--good); }
.total-meter .tm-count.over { color: var(--danger); }
.total-meter .tm-rem { color: var(--faint); font-size: 12px; font-family: var(--font-mono); }
.total-meter .tm-bar { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-top: 12px; box-shadow: inset 0 1px 1px rgba(0,0,0,.05); }
.total-meter .tm-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s var(--ease), background .3s; }
.total-meter .tm-bar > i.ok { background: var(--good); }
.total-meter .tm-bar > i.over { background: var(--danger); }

/* ---------------- Tools / search (inset) ---------------- */
.tools { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search {
  flex: 1 1 180px; background: var(--surface-2); border: 0; border-radius: var(--r-md);
  color: var(--ink); font-family: var(--font); font-size: 15px; padding: 14px 16px;
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 2px 4px rgba(0,0,0,.04);
  transition: box-shadow .3s var(--ease), background .3s;
}
.search::placeholder { color: var(--faint); }
.search:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent), inset 0 2px 4px rgba(0,0,0,.04); background: var(--surface); }

/* ---------------- Party rows ---------------- */
.party-list { display: grid; gap: 4px; }
.party-row {
  display: flex; align-items: center; gap: 14px;
  background: transparent; border-radius: var(--r-md); padding: 14px 14px;
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .party-row:hover { background: var(--surface-2); box-shadow: var(--ring); }
}
.party-row .p-main { flex: 1 1 auto; min-width: 0; }
.party-row .p-abbr { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.party-row .p-name { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-row .p-ref { color: var(--faint); font-family: var(--font-mono); font-size: 11px; }
.p-stance, .rr-stance { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .02em; color: var(--accent-deep); margin-top: 4px; }
.rr-stance { margin: 8px 0 0; }
.seat-input {
  width: 72px; text-align: center; background: var(--surface-2); border: 0; border-radius: var(--r-sm);
  color: var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 16px; padding: 11px 6px;
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 2px 4px rgba(0,0,0,.05);
  transition: box-shadow .25s var(--ease);
}
.seat-input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent), inset 0 2px 4px rgba(0,0,0,.05); }
.stepper { display: flex; align-items: center; gap: 7px; }
.stepper button {
  width: 36px; height: 40px; border-radius: var(--r-sm); border: 0;
  background: var(--surface); color: var(--ink); font-size: 19px; cursor: pointer; line-height: 1;
  box-shadow: var(--ring), var(--inset-hi), var(--sh-1);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), color .2s;
}
@media (hover: hover) and (pointer: fine) { .stepper button:hover { color: var(--accent-deep); box-shadow: 0 0 0 1px var(--accent-soft), var(--inset-hi), var(--sh-2); } }
.stepper button:active { transform: scale(.9); }
.collapse-toggle { margin: 18px 0 4px; }

/* ---------------- Quick mode (rank + band) ---------------- */
.rank-list { display: grid; gap: 14px; }
.rank-row { background: var(--surface-2); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--ring), var(--inset-hi); }
.rank-row .rr-head { display: flex; align-items: center; gap: 12px; }
.rank-row .rr-rank {
  width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--ink); color: #fff;
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 14px;
  box-shadow: var(--sh-1);
}
.rank-row .rr-name { font-weight: 700; flex: 1; }
.rank-row .rr-move { display: flex; gap: 6px; }
.rank-row .rr-move button {
  width: 34px; height: 32px; border-radius: var(--r-sm); border: 0; background: var(--surface);
  color: var(--ink); cursor: pointer; font-size: 13px; box-shadow: var(--ring), var(--inset-hi), var(--sh-1);
  transition: transform .2s var(--ease), color .2s;
}
.rank-row .rr-move button:active:not(:disabled) { transform: scale(.9); }
.rank-row .rr-move button:disabled { opacity: .3; cursor: not-allowed; }
.bands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.band {
  border: 0; background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: 9px 16px; font-family: var(--font-mono); font-size: 12.5px; cursor: pointer;
  box-shadow: var(--ring), var(--inset-hi);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), color .2s, background .2s;
}
.band:active { transform: scale(.95); }
.band.selected { background: var(--accent); color: #fff; font-weight: 700; box-shadow: var(--sh-2); }

/* ---------------- Option cards (scale / turnout / chief) ---------------- */
.options { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-2); border: 0; border-radius: var(--r-md);
  padding: 18px 20px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; font-size: 16px;
  box-shadow: var(--ring), var(--inset-hi);
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .25s var(--ease);
  animation: optIn .5s var(--ease) both;
}
@keyframes optIn { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: blur(0); } }
.options .opt:nth-child(1) { animation-delay: .03s; }
.options .opt:nth-child(2) { animation-delay: .08s; }
.options .opt:nth-child(3) { animation-delay: .13s; }
.options .opt:nth-child(4) { animation-delay: .18s; }
.options .opt:nth-child(5) { animation-delay: .23s; }
@media (hover: hover) and (pointer: fine) {
  .opt:hover { transform: translateY(-2px); box-shadow: var(--ring), var(--inset-hi), var(--sh-2); background: var(--surface); }
}
.opt:active { transform: scale(.99); }
.opt .tick {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--hair-2); transition: all .25s var(--ease);
}
.opt.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.opt.selected .tick { background: var(--accent); box-shadow: 0 2px 6px rgba(14,116,144,.4); }
.opt.selected .tick::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt .o-main { flex: 1; }
.opt .o-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.opt.suggested { box-shadow: inset 0 0 0 1.5px var(--accent), var(--inset-hi); }
.opt .o-badge { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-deep); font-weight: 700; }

/* ---------------- Coalition builder ---------------- */
.coalition-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 10px; }
.coal-chip {
  border: 0; background: var(--surface-2); border-radius: var(--r-md); padding: 13px 15px;
  cursor: pointer; font: inherit; color: var(--ink); text-align: left;
  box-shadow: var(--ring), var(--inset-hi);
  transition: transform .22s var(--ease), box-shadow .25s var(--ease), background .2s;
}
.coal-chip:active { transform: scale(.97); }
.coal-chip.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent), var(--inset-hi); }
.coal-chip .cc-abbr { font-weight: 700; font-size: 14px; }
.coal-chip .cc-seats { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.majority-meter { margin-top: 22px; background: var(--surface-2); border-radius: var(--r-md); padding: 18px; box-shadow: var(--ring), var(--inset-hi); }
.majority-meter .mm-row { display: flex; justify-content: space-between; align-items: baseline; }
.majority-meter .mm-total { font-family: var(--font-mono); font-weight: 700; font-size: 23px; letter-spacing: -0.02em; }
.majority-meter .mm-status { font-weight: 650; font-size: 14px; }
.majority-meter .mm-status.ok { color: var(--good); }
.majority-meter .mm-status.short { color: var(--warn); }
.majority-meter .mm-bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-top: 14px; position: relative; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); }
.majority-meter .mm-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s var(--ease); }
.majority-meter .mm-bar > .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .45; }

/* ---------------- Results: seat composition strip ---------------- */
.seat-strip { display: flex; height: 32px; border-radius: 10px; overflow: hidden; margin: 8px 0 12px; box-shadow: var(--ring), inset 0 1px 2px rgba(0,0,0,.05); background: var(--surface-2); }
.seat-seg { height: 100%; width: 0; transition: width .9s var(--ease); }
.seat-seg.coal { background: var(--accent); }
.seat-seg + .seat-seg { box-shadow: -1px 0 0 var(--surface); }
.seat-strip-cap { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin: 0 0 26px; letter-spacing: .03em; }
.seat-strip-cap b { color: var(--accent); font-weight: 700; }

/* ---------------- Results chart ---------------- */
.chart { display: grid; gap: 9px; margin: 12px 0 28px; }
.chart-row { display: grid; grid-template-columns: 58px 1fr 48px; align-items: center; gap: 14px; font-size: 13px; }
.chart-row .cr-abbr { font-weight: 700; color: var(--muted); }
.chart-row .cr-track { height: 18px; background: var(--surface-2); border-radius: 7px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.05); }
.chart-row .cr-track > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); border-radius: 7px; transition: width .8s var(--ease); }
.chart-row .cr-val { font-family: var(--font-mono); font-weight: 700; text-align: right; }

.result-q { padding: 20px 0; border-bottom: 1px solid var(--hair); }
.result-q:last-child { border-bottom: 0; }
.result-q .q { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 8px; }
.result-q .pick { font-family: var(--font); font-size: 21px; font-weight: 750; letter-spacing: -0.02em; }
.result-q .cmp { font-size: 13px; color: var(--muted); margin-top: 8px; }
.result-q .cmp b { color: var(--ink); }
.cmp-note { font-style: italic; color: var(--faint); font-size: 11px; }
.agree-bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 10px; box-shadow: inset 0 1px 1px rgba(0,0,0,.05); }
.agree-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .8s var(--ease); }

.score-banner { margin: 6px 0 24px; padding: 16px 18px; border-radius: var(--r-md); font-weight: 650; font-size: 14px; background: var(--accent-soft); color: var(--accent-deep); box-shadow: inset 0 0 0 1px var(--accent-soft); }

/* ---------------- Share card (receipt plate) ---------------- */
.share { margin-top: 34px; }
.share-card {
  border-radius: var(--r-lg); padding: 28px 26px; color: var(--ink);
  background: var(--surface-2); box-shadow: var(--ring), var(--inset-hi), var(--sh-1);
  font-family: var(--font-mono);
}
.share-card .sc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; gap: 12px; }
.share-card .sc-title { font-family: var(--font); font-weight: 750; font-size: 18px; letter-spacing: -0.02em; }
.share-card .sc-tag { font-size: 10px; color: var(--accent-deep); letter-spacing: .14em; text-transform: uppercase; }
.share-card ul { list-style: none; display: grid; gap: 11px; }
.share-card li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; border-bottom: 1px dashed var(--hair-2); padding-bottom: 10px; }
.share-card li:last-child { border-bottom: 0; }
.share-card li span:first-child { color: var(--muted); }
.share-card li span:last-child { font-weight: 700; text-align: right; }
.share-card .sc-foot { margin-top: 18px; font-size: 11px; color: var(--faint); }

/* ---------------- Group block ---------------- */
.group-block { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--hair); }
.group-title { font-family: var(--font); font-weight: 750; font-size: 18px; margin-bottom: 16px; letter-spacing: -0.01em; }
.group-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.group-row .search { flex: 1 1 160px; }
.group-note { margin-top: 14px; font-size: 13px; color: var(--danger); line-height: 1.55; }
.group-note:empty { display: none; }
.group-note code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; }

/* ---------------- QR invite ---------------- */
.qr-invite { display: flex; gap: 18px; align-items: center; margin-top: 20px; padding: 18px; background: var(--surface-2); border-radius: var(--r-md); box-shadow: var(--ring), var(--inset-hi); }
.qr-invite.hidden { display: none; }
.qr-box { width: 108px; height: 108px; border-radius: var(--r-sm); background: #fff; padding: 8px; flex: 0 0 auto; display: grid; place-items: center; box-shadow: var(--ring), var(--sh-1); }
.qr-box img { width: 100%; height: 100%; display: block; }
.qr-cap { font-size: 13px; color: var(--muted); line-height: 1.5; min-width: 0; }
.qr-cap b { display: block; font-family: var(--font); font-weight: 700; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.qr-cap span { display: block; word-break: break-all; font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

/* ---------------- Group board ---------------- */
.consensus { background: var(--surface-2); border-radius: var(--r-md); padding: 20px; margin: 6px 0 22px; box-shadow: var(--ring), var(--inset-hi); }
.consensus h3 { font-family: var(--font-mono); font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 16px; font-weight: 400; }
.consensus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.cons-item .ci-label { font-size: 12px; color: var(--muted); }
.cons-item .ci-value { font-family: var(--font); font-size: 20px; font-weight: 750; letter-spacing: -0.02em; margin-top: 4px; }
.cons-item .ci-sub { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.board-row { display: flex; align-items: center; gap: 14px; padding: 16px 6px; border-bottom: 1px solid var(--hair); }
.board-row .br-rank { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px; flex: 0 0 auto; box-shadow: var(--sh-1); }
.board-row .br-main { flex: 1; min-width: 0; }
.board-row .br-nick { font-weight: 700; font-size: 15px; }
.board-row .br-nick .br-mode { font-family: var(--font-mono); font-size: 10px; color: var(--accent-deep); text-transform: uppercase; letter-spacing: .08em; margin-left: 8px; }
.board-row .br-picks { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.board-row .br-score { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--faint); flex: 0 0 auto; }
.board-row .br-score b { display: block; font-size: 16px; color: var(--ink); }
.board-empty { color: var(--muted); font-size: 14px; line-height: 1.65; }
.board-empty code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; }

/* ---------------- Political compass ---------------- */
.compass-readouts { display: grid; gap: 8px; margin: 8px 0 24px; }
.cr-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.cr-line .crl-label { color: var(--muted); }
.cr-line b { color: var(--ink); font-family: var(--font-mono); }
.compass-wrap { display: flex; justify-content: center; margin: 12px 0 26px; }
.compass-square {
  position: relative; width: 100%; max-width: 380px; aspect-ratio: 1 / 1;
  border-radius: 16px; overflow: hidden;
  background:
    repeating-linear-gradient(0deg, transparent 0 35px, var(--hair) 35px 36px),
    repeating-linear-gradient(90deg, transparent 0 35px, var(--hair) 35px 36px),
    var(--surface-2);
  box-shadow: var(--ring), inset 0 2px 8px rgba(0,0,0,.05);
}
.cs-mid-v { position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: var(--hair-2); }
.cs-mid-h { position: absolute; top: 50%; left: 0; right: 0; height: 1.5px; background: var(--hair-2); }
.cs-axis { position: absolute; font-family: var(--font-mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .12em; }
.cs-top { top: 8px; left: 50%; transform: translateX(-50%); }
.cs-bottom { bottom: 8px; left: 50%; transform: translateX(-50%); }
.cs-left { left: 8px; top: 50%; transform: translateY(-50%); }
.cs-right { right: 8px; top: 50%; transform: translateY(-50%); }
.cs-dot { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); }
.cs-dot.party { width: 10px; height: 10px; background: var(--faint); opacity: .7; cursor: default; transition: opacity .15s, transform .15s; box-shadow: var(--sh-1); }
.cs-dot.party:hover { opacity: 1; transform: translate(-50%, -50%) scale(1.5); z-index: 4; }
.cs-dot.party .cs-lbl { position: absolute; left: 11px; top: -4px; font-family: var(--font-mono); font-size: 9px; color: var(--ink); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.cs-dot.party:hover .cs-lbl { opacity: 1; }
.cs-dot.you { width: 20px; height: 20px; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(14,116,144,.5); z-index: 3; }
.cs-dot.you .cs-lbl { position: absolute; left: 16px; top: -4px; font-family: var(--font); font-size: 12px; font-weight: 750; color: var(--ink); white-space: nowrap; }
.culture-bar-wrap { margin: 0 0 26px; }
.cb-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 9px; text-transform: uppercase; letter-spacing: .06em; }
.culture-bar { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--good), var(--accent)); box-shadow: inset 0 1px 2px rgba(0,0,0,.1); }
.cb-marker { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 3px 8px rgba(0,0,0,.25); transform: translate(-50%, -50%); }
.compass-h3 { font-family: var(--font); font-size: 19px; margin: 24px 0 16px; font-weight: 750; letter-spacing: -0.01em; }
.match-card { display: flex; align-items: center; gap: 16px; background: var(--surface-2); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--ring), var(--inset-hi); transition: transform .25s var(--ease), box-shadow .3s var(--ease); }
@media (hover: hover) and (pointer: fine) { .match-card:hover { transform: translateY(-2px); box-shadow: var(--ring), var(--inset-hi), var(--sh-2); } }
.match-card .mc-rank { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px; flex: 0 0 auto; box-shadow: var(--sh-1); }
.match-card .mc-body { flex: 1; min-width: 0; }
.match-card .mc-name { font-weight: 700; font-size: 15px; }
.match-card .mc-why { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.match-card .mc-pct { font-family: var(--font-mono); font-weight: 700; font-size: 22px; color: var(--accent-deep); flex: 0 0 auto; }
.rank-item { display: flex; justify-content: space-between; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--hair); font-size: 14px; }
.rank-item:last-child { border-bottom: 0; }
.rank-item .ri-name { color: var(--ink); }
.rank-item .ri-name .ri-full { color: var(--faint); font-size: 12px; }
.rank-item .ri-pct { color: var(--muted); font-family: var(--font-mono); font-weight: 700; }
#compassOptions .opt { padding: 16px 18px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(24px);
  background: var(--ink); color: var(--surface); font-weight: 650; padding: 13px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .45s var(--ease); font-size: 14px; z-index: 80;
  box-shadow: var(--sh-card);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Corner buttons (theme · menu) ---------------- */
.theme-toggle, .corner-btn {
  position: fixed; top: 22px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--surface); color: var(--ink);
  font-size: 17px; line-height: 1; display: grid; place-items: center;
  box-shadow: var(--ring), var(--inset-hi), var(--sh-2);
  transition: transform .35s var(--ease), box-shadow .3s var(--ease), opacity .3s var(--ease);
}
.theme-toggle { right: 22px; }
.corner-btn { left: 22px; }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { transform: translateY(-2px) rotate(-12deg); box-shadow: var(--ring), var(--inset-hi), var(--sh-card); }
  .corner-btn:hover { transform: translateY(-2px); box-shadow: var(--ring), var(--inset-hi), var(--sh-card); }
}
.theme-toggle:active, .corner-btn:active { transform: scale(.9); }
.corner-btn.hidden { opacity: 0; pointer-events: none; }

/* ---------------- Room lobby ---------------- */
.room-actions { display: grid; gap: 16px; margin-top: 32px; }
.room-action {
  display: flex; align-items: center; gap: 18px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 0; border-radius: var(--r-lg); padding: 22px 24px;
  box-shadow: var(--ring), var(--inset-hi);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .25s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .room-action:hover { transform: translateY(-3px); box-shadow: var(--ring), var(--inset-hi), var(--sh-card); background: var(--surface); } }
.room-action:active { transform: scale(.99); }
.room-action .ra-icon { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 22px; font-weight: 700; box-shadow: 0 4px 12px rgba(14,116,144,.4); }
.room-action .ra-text b { display: block; font-family: var(--font); font-size: 19px; font-weight: 750; letter-spacing: -0.01em; }
.room-action .ra-text small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.room-join { display: flex; gap: 10px; align-items: stretch; }
.room-join .search { flex: 1; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-mono); }
.room-join .search::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font); }

/* ---------------- Room chip (hub) ---------------- */
.room-chip { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; background: var(--surface-2); border-radius: 999px; padding: 7px 8px 7px 16px; box-shadow: var(--ring), var(--inset-hi); }
.room-chip.hidden { display: none; }
.room-chip .rc-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.room-chip .rc-code { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--accent-deep); letter-spacing: .04em; }
.room-chip .rc-btn { font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; border: 0; background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 13px; box-shadow: var(--ring), var(--inset-hi), var(--sh-1); transition: transform .2s var(--ease), color .2s; }
.room-chip .rc-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .room-chip .rc-btn:hover { color: var(--accent-deep); } }

/* ---------------- Decorative staggered entrance (render-once lists) ---------------- */
#modeCards .mode-card, #matchTop .match-card { animation: optIn .5s var(--ease) both; }
#modeCards .mode-card:nth-child(1) { animation-delay: .05s; }
#modeCards .mode-card:nth-child(2) { animation-delay: .12s; }
#modeCards .mode-card:nth-child(3) { animation-delay: .19s; }
#matchTop .match-card:nth-child(1) { animation-delay: .06s; }
#matchTop .match-card:nth-child(2) { animation-delay: .13s; }
#matchTop .match-card:nth-child(3) { animation-delay: .20s; }

/* ---------------- Floating, always-reachable nav on multi-step screens ---------------- */
#seats .nav, #coalition .nav, #chief .nav, #turnout .nav, #compassQuiz .nav {
  position: sticky; bottom: 14px; z-index: 6;
  margin-top: 32px; padding: 12px 14px;
  background: var(--surface); border-radius: 999px;
  box-shadow: var(--ring), var(--inset-hi), var(--sh-card);
}
#seats .nav .btn, #coalition .nav .btn, #chief .nav .btn, #turnout .nav .btn, #compassQuiz .nav .btn { padding: 13px 22px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 600px) {
  body { padding: 30px 14px 110px; }
  .theme-toggle, .corner-btn { width: 42px; height: 42px; top: 14px; }
  .theme-toggle { right: 14px; }
  .corner-btn { left: 14px; }
  .total-meter { top: 64px; }
}
@media (max-width: 460px) {
  .party-row .p-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .screen, .opt, #modeCards .mode-card, #matchTop .match-card { filter: none !important; }
}

/* ---------------- Print → Save as PDF of the visible result ---------------- */
@media print {
  body { background: #fff !important; padding: 0; display: block; }
  .grain, .theme-toggle, .corner-btn, .topbar, .skip-link, .toast, footer, .nav,
  .btn-row, .group-block, .qr-invite, #matchToggle, #matchAll, .seat-strip-cap { display: none !important; }
  .app { max-width: 100%; }
  .card { box-shadow: none !important; padding: 0 !important; }
  .card::before { display: none !important; }
  .screen { animation: none !important; }
}

/* =========================================================================
   APP SHELL — persistent top bar · brand · context · segmented control
   ========================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px 14px 2px; margin-bottom: 22px;
  background: var(--bg);
}
.topbar::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 0; height: 1px; background: var(--hair); }

.brand { display: inline-flex; align-items: center; gap: 11px; background: transparent; border: 0; cursor: pointer; font: inherit; color: var(--ink); padding: 4px; border-radius: 14px; transition: transform .25s var(--ease); }
.brand:active { transform: scale(.95); }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 17px; box-shadow: var(--sh-1); transition: background .25s var(--ease); }
.brand-text { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-text b { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .brand:hover .brand-mark { background: var(--accent); } }

.topbar-context { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink); font-size: 16px; display: grid; place-items: center;
  box-shadow: var(--ring), var(--inset-hi), var(--sh-1);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.icon-btn:active { transform: scale(.9); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { transform: translateY(-2px); box-shadow: var(--ring), var(--inset-hi), var(--sh-2); } }

/* Segmented control (mode / detail level) */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; margin-bottom: 28px; border-radius: 999px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 2px 4px rgba(0,0,0,.04);
}
.segmented button {
  border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted);
  background: transparent; padding: 12px 10px; border-radius: 999px;
  transition: color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease);
}
.segmented button:active { transform: scale(.97); }
.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: var(--ring), var(--inset-hi), var(--sh-1); }

/* Sticky seat meter now sits below the sticky top bar */
.total-meter { top: 74px; }
@media (max-width: 600px) { .total-meter { top: 70px; } }

/* =========================================================================
   SNAPPY MOTION — fast, GPU-only, no blur (fixes slow/janky feel)
   ========================================================================= */
/* Entrance keyframes without expensive blur filter */
@keyframes rise  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes optIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

body { background-attachment: scroll; }   /* fixed attachment causes mobile scroll jank */
html { scroll-behavior: auto; }

.screen { animation-duration: .18s; animation-timing-function: var(--ease-out); }

/* Tighten staggered entrances */
.options .opt { animation-duration: .18s; }
.options .opt:nth-child(1) { animation-delay: 0s; }
.options .opt:nth-child(2) { animation-delay: .03s; }
.options .opt:nth-child(3) { animation-delay: .06s; }
.options .opt:nth-child(4) { animation-delay: .09s; }
.options .opt:nth-child(5) { animation-delay: .12s; }
#modeCards .mode-card, #matchTop .match-card { animation-duration: .2s; }
#modeCards .mode-card:nth-child(1), #matchTop .match-card:nth-child(1) { animation-delay: 0s; }
#modeCards .mode-card:nth-child(2), #matchTop .match-card:nth-child(2) { animation-delay: .04s; }
#modeCards .mode-card:nth-child(3), #matchTop .match-card:nth-child(3) { animation-delay: .08s; }

/* Fast, responsive interaction transitions everywhere */
.btn, .btn.ghost, .mode-card, .opt, .coal-chip, .room-action, .band, .icon-btn, .brand,
.brand-mark, .stepper button, .match-card, .party-row, .segmented button, .total-meter,
.search, .seat-input, .rank-row .rr-move button, .rc-btn, .cs-dot.party, .skip-link {
  transition-duration: .15s !important;
  transition-timing-function: var(--ease-out) !important;
}

/* Quicker data-bar fills */
.bar > i, .total-meter .tm-bar > i, .agree-bar > i, .chart-row .cr-track > i,
.majority-meter .mm-bar > i, .seat-seg { transition-duration: .35s !important; }

.toast { transition-duration: .2s !important; }

@media (prefers-reduced-motion: reduce) {
  .screen, .opt, #modeCards .mode-card, #matchTop .match-card { animation: none !important; }
}

/* =========================================================================
   TLDR BROADCAST OVERRIDES — applies the reference look without touching JS
   ========================================================================= */

/* DARK theme (default) — TLDR broadcast */
:root, :root[data-theme="dark"] {
  --bg: #0b0f19; --bg-2: #070a12; --surface: #172033; --surface-2: #0f1626; --shell: #0b0f19;
  --ink: #ffffff; --muted: #94a3b8; --faint: #64748b;
  --hair: #24324f; --hair-2: #2e3f63;
  --accent: #ef4444; --accent-deep: #dc2626; --accent-soft: rgba(239,68,68,0.10);
  --gov-blue: #3b82f6; --gov-deep: #1e3a8a;
  --opp-red: #ef4444;  --opp-deep: #3f1515;
  --track: #1e293b;
  --slider-track: #24324f;
}

/* LIGHT theme — same broadcast language, white canvas */
:root[data-theme="light"] {
  --bg: #f1f5f9; --bg-2: #e2e8f0; --surface: #ffffff; --surface-2: #f8fafc; --shell: #e2e8f0;
  --ink: #0f172a; --muted: #475569; --faint: #94a3b8;
  --hair: #cbd5e1; --hair-2: #94a3b8;
  --accent: #dc2626; --accent-deep: #b91c1c; --accent-soft: rgba(220,38,38,0.08);
  --gov-blue: #2563eb; --gov-deep: #1d4ed8;
  --opp-red: #dc2626;  --opp-deep: #b91c1c;
  --track: #cbd5e1;
  --slider-track: #cbd5e1;
}

body { background: var(--bg); color: var(--ink); padding: 0 0 96px; display: block; }
.app {
  margin: 0 auto; padding: 0 clamp(14px, 3.5vw, 28px);
  max-width: 1280px; width: 100%;
}
.grain { display: none; }

/* Cards = visible surfaces, properly proportioned to the viewport.
   Width caps keep content comfortable to read at large widths; the seats
   screen gets a wider cap because it lays out as a 2-column grid >=900px. */
.card::before { display: none; }
.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: clamp(20px, 3vw, 32px) clamp(18px, 3vw, 34px);
  margin: clamp(16px, 2.5vw, 28px) auto 0;
  max-width: 880px;
  box-shadow: none;
}
#seats.card { max-width: 1140px; }
#results.card, #board.card, #compassResult.card { max-width: 980px; }
@media (max-width: 600px) {
  .card { border-radius: 12px; padding: 18px 16px; }
}

/* Light-mode override of arch bloc inset shadows (the dark variants are too strong) */
:root[data-theme="light"] .arch-gov {
  background: rgba(59, 130, 246, 0.10);
  color: var(--gov-deep);
  box-shadow: inset 0 0 30px rgba(59, 130, 246, 0.18), 0 0 28px rgba(59, 130, 246, 0.10);
}
:root[data-theme="light"] .arch-opp {
  background: rgba(220, 38, 38, 0.10);
  color: var(--opp-deep);
  box-shadow: inset 0 0 30px rgba(220, 38, 38, 0.18), 0 0 28px rgba(220, 38, 38, 0.10);
}
:root[data-theme="light"] .matrix-container { background: var(--surface-2); }
:root[data-theme="light"] .chart { background: var(--surface-2); }
:root[data-theme="light"] .bar-track-area { background: var(--bg-2); }
:root[data-theme="light"] .swing-indicator-label { color: var(--ink); text-shadow: none; }
:root[data-theme="light"] .swing-indicator-label .swing-delta { background: rgba(15, 23, 42, 0.08); }
:root[data-theme="light"] .topbar { background: rgba(241, 245, 249, 0.92); border-color: var(--hair); }
:root[data-theme="light"] .dock-action-bar { background: rgba(255, 255, 255, 0.92); border-color: var(--hair); }
:root[data-theme="light"] .center-crest { background: var(--surface); border-color: var(--ink); }

/* Sticky broadcast header */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 20px; margin: 0 -20px 0;
  background: rgba(11, 15, 25, 0.92); backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--hair);
}
.topbar::after { display: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; background: transparent; border: 0; cursor: pointer; padding: 4px; }
.brand-mark { display: none; }
.brand-text { color: var(--ink); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-tldr {
  background: var(--accent); color: white;
  padding: 4px 8px; font-weight: 900; border-radius: 4px; font-size: 12px;
  letter-spacing: 0.02em;
}
.live-pill {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.40);
  color: var(--accent);
  font-family: var(--font);
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px;
}
.topbar-context { position: static; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 6px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--hair); font-size: 14px;
  box-shadow: none;
}
.icon-btn:hover { color: var(--ink); border-color: var(--hair-2); }

/* Typography — TLDR feel */
h1 {
  font-size: clamp(24px, 5vw, 30px) !important;
  font-weight: 800 !important; letter-spacing: -0.02em !important;
  line-height: 1.15 !important; text-align: left;
}
h1 .grad, .grad { color: var(--ink); }
.lead { color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 60ch; margin-top: 8px; }
.section-title { font-size: clamp(22px, 4.5vw, 28px) !important; font-weight: 800 !important; letter-spacing: -0.02em !important; }
.section-hint { color: var(--muted); font-size: 13px; margin: 8px 0 18px; }

/* Eyebrow → meta strip */
.eyebrow {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 0 0 12px 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  display: flex; gap: 10px;
  text-transform: uppercase; font-weight: 700;
  font-family: var(--font);
  width: 100%;
}
.eyebrow .dot { background: var(--accent); box-shadow: none; width: 6px; height: 6px; }

/* Card meta header (Step X · COUNTER pill) */
.progress {
  border-bottom: 1px solid var(--hair); padding-bottom: 12px; margin-bottom: 20px;
  font-family: var(--font);
}
.progress .step {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--muted); text-transform: uppercase;
}
.progress .step + .step {
  background: rgba(255,255,255,0.05);
  padding: 4px 10px; border-radius: 6px; color: var(--ink);
}
.bar { display: none; }

/* Segmented control */
.segmented {
  background: rgba(11, 15, 25, 0.4);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 4px; gap: 2px;
  margin-bottom: 20px;
  box-shadow: none;
}
.segmented button {
  color: var(--muted); font-size: 13px; font-weight: 700; padding: 9px 8px;
  border-radius: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.segmented button.active {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-1);
}

/* Total meter — minimal */
.total-meter {
  background: var(--bg-2); border: 1px solid var(--hair);
  border-radius: 8px; padding: 14px 16px; box-shadow: none;
  top: 76px;
}
.total-meter .tm-count { color: var(--ink); }
.total-meter .tm-count.ok { color: #22c55e; }
.total-meter .tm-count.over { color: var(--accent); }
.total-meter .tm-rem { color: var(--muted); }
.total-meter .tm-bar { background: rgba(255,255,255,0.05); box-shadow: none; }
.total-meter .tm-bar > i { background: var(--ink); }
.total-meter .tm-bar > i.ok { background: #22c55e; }
.total-meter .tm-bar > i.over { background: var(--accent); }

/* Search / inputs */
.search, .seat-input {
  background: rgba(11, 15, 25, 0.6); border: 1px solid var(--hair);
  color: var(--ink); box-shadow: none; border-radius: 6px;
}
.search::placeholder { color: var(--faint); }
.search:focus, .seat-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
  background: var(--bg-2);
}

/* Party rows */
.party-list { gap: 0; }
.party-row {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hair);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
}
.party-row:hover { background: rgba(255,255,255,0.05); box-shadow: none; }
.party-row .p-abbr { color: var(--ink); font-size: 14px; }
.party-row .p-name { color: var(--muted); font-size: 12px; }
.party-row .p-ref { color: var(--faint); }
.p-stance, .rr-stance { color: var(--accent); font-size: 10px; }

/* Stepper buttons */
.stepper button {
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--hair);
  border-radius: 6px; box-shadow: none;
}
.stepper button:hover { color: var(--accent); border-color: var(--hair-2); }

/* Buttons */
.btn {
  background: var(--accent); color: white; font-weight: 700;
  border-radius: 6px; padding: 12px 22px; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.02em;
  box-shadow: none;
}
.btn:hover { background: var(--accent-deep); transform: none; box-shadow: none; }
.btn.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--hair); box-shadow: none; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.btn.ghost:hover { color: var(--ink); border-color: var(--hair-2); background: transparent; box-shadow: none; transform: none; }
.btn.small { padding: 10px 16px; font-size: 12px; }

/* Mode / choice cards */
.mode-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hair); border-radius: 8px;
  padding: 18px 22px 18px 80px;
  box-shadow: none;
}
.mode-card::before { color: var(--accent); opacity: 1; }
.mode-card:hover { background: rgba(255,255,255,0.05); border-color: var(--hair-2); }
.mode-card .mc-name, .mode-card b { color: var(--ink); font-size: 17px; }
.mode-card .mc-desc, .mode-card small { color: var(--muted); font-size: 13px; }
.mode-card .mc-tag, .mode-card .mode-tag { color: var(--accent); }

/* Coalition chips */
.coal-chip {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hair); border-radius: 6px;
  box-shadow: none;
}
.coal-chip.selected {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--gov-blue);
  box-shadow: inset 0 0 0 1px var(--gov-blue);
}
.coal-chip .cc-abbr { color: var(--ink); }
.coal-chip .cc-seats { color: var(--muted); }

.majority-meter {
  background: rgba(11, 15, 25, 0.4);
  border: 1px solid var(--hair); border-radius: 8px;
  box-shadow: none;
}
.majority-meter .mm-total { color: var(--ink); }
.majority-meter .mm-bar { background: rgba(255,255,255,0.05); box-shadow: none; }
.majority-meter .mm-bar > i { background: var(--gov-blue); }
.majority-meter .mm-status.ok { color: var(--gov-blue); }
.majority-meter .mm-status.short { color: #eab308; }

/* Option cards (chief / turnout / compass scale) */
.opt {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hair); border-radius: 8px;
  box-shadow: none; padding: 14px 16px;
}
.opt:hover { background: rgba(255,255,255,0.05); box-shadow: none; }
.opt .tick { background: transparent; box-shadow: inset 0 0 0 2px var(--hair-2); }
.opt.selected {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}
.opt.selected .tick { background: var(--accent); box-shadow: none; }
.opt .o-sub { color: var(--muted); }
.opt .o-badge { color: var(--accent); }

/* Hemispherical parliament dot matrix */
.matrix-container {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 30px 10px 15px;
  margin: 0 0 24px;
  display: flex; align-items: flex-end; justify-content: center;
}
.parliament-matrix { width: 100%; max-width: 440px; height: auto; display: block; }
.parliament-matrix circle { transition: fill .25s ease; }
.center-crest {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: 72px; height: 72px;
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: var(--ink);
  letter-spacing: -0.02em;
}

/* Seat strip = flat */
.seat-strip {
  background: rgba(255,255,255,0.05);
  box-shadow: none; border-radius: 4px; height: 24px;
}
.seat-strip-cap { color: var(--muted); }
.seat-strip-cap b { color: var(--ink); font-weight: 700; }

/* Results: per-party bars (kept structure, restyled) */
.chart-row .cr-abbr { color: var(--ink); font-weight: 800; font-family: var(--font); }
.chart-row .cr-track { background: #1e293b; box-shadow: none; border-radius: 2px; height: 36px; position: relative; }
.chart-row .cr-track > i { border-radius: 2px 0 0 2px; }
.chart-row .cr-val { color: var(--ink); font-weight: 800; }
.chart-row { grid-template-columns: 48px 1fr 56px; }

/* Result rows */
.result-q { border-color: var(--hair); padding: 18px 0; }
.result-q .q { color: var(--muted); font-family: var(--font); font-size: 11px; letter-spacing: 0.08em; }
.result-q .pick { color: var(--ink); font-size: 18px; }
.result-q .cmp { color: var(--muted); }
.result-q .cmp b { color: var(--ink); }
.agree-bar { background: rgba(255,255,255,0.05); box-shadow: none; }
.agree-bar > i { background: var(--accent); }
.cmp-note { color: var(--faint); }

.score-banner {
  background: rgba(34, 197, 94, 0.10); color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.30);
  box-shadow: none; border-radius: 8px;
}

/* Share card (receipt) */
.share-card {
  background: var(--bg-2); border: 1px solid var(--hair);
  box-shadow: none; border-radius: 8px;
}
.share-card .sc-title { color: var(--ink); }
.share-card .sc-tag { color: var(--accent); }
.share-card li { border-color: var(--hair); }
.share-card li span:first-child { color: var(--muted); }
.share-card li span:last-child { color: var(--ink); }

/* Group block & board */
.group-block { border-color: var(--hair); }
.group-row .search { flex: 1 1 160px; }
.group-note { color: #fbbf24; }
.qr-invite { background: var(--bg-2); border: 1px solid var(--hair); box-shadow: none; }
.qr-box { background: #fff; box-shadow: none; }
.qr-cap b { color: var(--ink); }
.qr-cap span { color: var(--muted); }
.consensus { background: var(--bg-2); border: 1px solid var(--hair); box-shadow: none; }
.consensus h3 { color: var(--muted); }
.cons-item .ci-label { color: var(--muted); }
.cons-item .ci-value { color: var(--ink); }
.cons-item .ci-sub { color: var(--faint); }
.board-row { border-color: var(--hair); }
.board-row .br-rank { background: var(--accent); color: white; box-shadow: none; }
.board-row .br-nick { color: var(--ink); }
.board-row .br-nick .br-mode { color: var(--accent); }
.board-row .br-picks { color: var(--muted); }
.board-row .br-score { color: var(--muted); }
.board-row .br-score b { color: var(--ink); }
.board-empty { color: var(--muted); }
.board-empty code { background: var(--bg-2); color: var(--accent); }

/* Compass — same broadcast logic */
.cr-line { border-color: var(--hair); }
.cr-line .crl-label { color: var(--muted); }
.cr-line b { color: var(--ink); }
.compass-square { background: var(--bg-2); box-shadow: none; }
.cs-mid-v, .cs-mid-h { background: var(--hair-2); }
.cs-axis { color: var(--muted); }
.cs-dot.party { background: var(--muted); opacity: 0.6; box-shadow: none; }
.cs-dot.party:hover { opacity: 1; }
.cs-dot.party .cs-lbl { color: var(--ink); }
.cs-dot.you { background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.cs-dot.you .cs-lbl { color: var(--ink); }
.culture-bar { background: var(--hair-2); }
.cb-marker { background: var(--surface); border-color: var(--accent); }
.match-card { background: rgba(255,255,255,0.02); border: 1px solid var(--hair); box-shadow: none; }
.match-card:hover { background: rgba(255,255,255,0.05); box-shadow: none; }
.match-card .mc-rank { background: var(--accent); color: white; box-shadow: none; }
.match-card .mc-name { color: var(--ink); }
.match-card .mc-why { color: var(--muted); }
.match-card .mc-pct { color: var(--accent); }
.rank-item { border-color: var(--hair); }
.rank-item .ri-name { color: var(--ink); }
.rank-item .ri-name .ri-full { color: var(--faint); }
.rank-item .ri-pct { color: var(--muted); }
.compass-h3 { color: var(--ink); }

/* Room lobby */
.room-action { background: rgba(255,255,255,0.02); border: 1px solid var(--hair); box-shadow: none; }
.room-action:hover { background: rgba(255,255,255,0.05); box-shadow: none; }
.room-action .ra-icon { background: var(--accent); color: white; box-shadow: none; }
.room-action .ra-text b { color: var(--ink); }
.room-action .ra-text small { color: var(--muted); }

/* Room chip */
.room-chip { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.30); box-shadow: none; }
.room-chip .rc-label { color: var(--accent); }
.room-chip .rc-code { color: var(--ink); }
.room-chip .rc-btn { background: transparent; border: 1px solid var(--hair); color: var(--muted); box-shadow: none; }
.room-chip .rc-btn:hover { color: var(--ink); border-color: var(--accent); }

/* Disclaimer / footer */
.disclaimer { color: var(--faint); font-family: var(--font); }
footer { color: var(--faint); }

/* Floating nav pill (multi-step) */
#seats .nav, #coalition .nav, #chief .nav, #turnout .nav, #compassQuiz .nav {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 8px;
  box-shadow: var(--sh-2); padding: 10px 12px; bottom: 84px;
}

/* Bottom action dock — TLDR signature */
.dock-action-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: rgba(23, 32, 51, 0.92); backdrop-filter: blur(16px);
  border-top: 2px solid var(--hair); padding: 14px 0;
}
.dock-action-bar.hidden { display: none; }
.dock-inner-layout {
  width: 100%; max-width: 680px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.dock-status-readout { display: flex; flex-direction: column; min-width: 0; }
.dock-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.dock-val { font-size: 17px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-advance {
  background: var(--accent); color: white; border: 0; padding: 12px 22px;
  border-radius: 6px; font-size: 13px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: 0.04em;
  transition: background .15s ease;
}
.btn-advance:hover { background: var(--accent-deep); }
.btn-advance:disabled { opacity: 0.4; cursor: not-allowed; }

/* Theme toggle (header) tiny tweak */
.icon-btn { width: 36px; height: 36px; border-radius: 6px; }

/* Reset card top margin (it sits below the sticky header now) */
.card:first-of-type { margin-top: 24px; }

/* Compass scale uses option styling already covered; nothing extra */

/* Mobile */
@media (max-width: 600px) {
  .app { padding: 0 14px; }
  .topbar { padding: 0 14px; margin: 0 -14px; height: 60px; }
  .total-meter { top: 70px; }
  .dock-inner-layout { padding: 0 14px; }
}

/* =========================================================================
   STRUCTURAL ADDITIONS — faithful to the TLDR reference HTML
   ========================================================================= */

/* Theme toggle restored — visible in the top bar */
#themeToggle { display: grid; }

/* Hide the floating in-screen nav (Back/Continue) — the fixed bottom dock handles both */
#seats .nav, #coalition .nav, #chief .nav, #turnout .nav, #compassQuiz .nav { display: none !important; }

/* Dock back button (small icon-style left of the readout) */
.dock-back {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 6px; border: 1px solid var(--hair);
  background: transparent; color: var(--ink);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.dock-back:hover { border-color: var(--hair-2); }

/* Wide screens: seats becomes a 2-column grid — matrix sticky on left, sliders on right */
@media (min-width: 900px) {
  #seats #seatsBody { display: contents; }
  #seats {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 28px;
    align-items: start;
  }
  #seats .progress { grid-column: 1 / -1; }
  #seats .segmented { grid-column: 1 / -1; }
  #seats .section-title { grid-column: 1 / -1; }
  #seats .section-hint { grid-column: 1 / -1; }
  #seats .matrix-container { grid-column: 1; position: sticky; top: 88px; margin-bottom: 0; }
  /* The party list / total meter sit in the right column.
     #seatsBody uses display:contents so its children participate in the parent grid. */
  #seats .total-meter,
  #seats .tools,
  #seats #partyList,
  #seats .collapse-toggle { grid-column: 2; }
  #seats .total-meter { position: sticky; top: 88px; }
}

/* Wider results screen on desktop: matrix and chart side by side */
@media (min-width: 900px) {
  #results .matrix-container { max-width: 520px; margin-left: auto; margin-right: auto; }
}

/* Centered screen intros (title + subtitle, like the reference) */
#seats .section-title, #coalition .section-title, #chief .section-title,
#turnout .section-title, #results .section-title, #compassResult .section-title,
#compassIntro .section-title, #compassQuiz .section-title {
  text-align: center; margin: 26px 0 6px;
}
#seats .section-hint, #coalition .section-hint, #chief .section-hint,
#turnout .section-hint, #compassIntro .section-hint, #compassQuiz .section-hint {
  text-align: center; margin: 0 auto 24px; color: var(--muted);
}

/* Card meta header — already inside each card via .progress.
   Treat it as the uppercase label + counter pill the reference uses. */
.progress {
  border-bottom: 1px solid var(--hair);
  padding-bottom: 12px;
  margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Flag crest in the parliament hemisphere */
.center-crest .crest-flag { font-size: 32px; line-height: 1; }
.center-crest { width: 80px; height: 80px; padding: 0; }

/* ===========================
   Coalition: archway architecture (Gov vs Opp)
   =========================== */
.bloc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin: 0 0 22px;
}
.bloc-column { display: flex; flex-direction: column; min-width: 0; }

.bloc-arch {
  position: relative;
  height: 180px;
  border-radius: 100px 100px 8px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 26px 14px 18px;
  text-align: center;
  font-weight: 900;
  font-size: clamp(36px, 7vw, 50px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  transition: box-shadow .3s ease, transform .3s ease;
}
.bloc-arch .bloc-arch-tag {
  font-size: 10px; font-weight: 700; opacity: 0.85;
  margin-top: 10px; letter-spacing: 0.06em; text-transform: uppercase;
}
.arch-gov {
  background: var(--gov-deep, #1e3a8a);
  border: 2px solid var(--gov-blue, #3b82f6);
  box-shadow:
    inset 0 0 30px rgba(59, 130, 246, 0.40),
    0 0 28px rgba(59, 130, 246, 0.20);
}
.arch-opp {
  background: var(--opp-deep, #3f1515);
  border: 2px solid var(--opp-red, #ef4444);
  box-shadow:
    inset 0 0 30px rgba(239, 68, 68, 0.40),
    0 0 28px rgba(239, 68, 68, 0.20);
}

.bloc-strip {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 3px;
  margin-bottom: 10px;
  align-self: flex-start;
}
.bloc-badges {
  display: flex; flex-wrap: wrap; gap: 5px;
  min-height: 30px;
}

/* Party badge — used in bloc badge rows and selector tiles */
.party-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 28px; padding: 0 8px;
  border-radius: 5px;
  font-family: var(--font);
  font-weight: 800; font-size: 11px; color: #ffffff;
  letter-spacing: -0.01em;
}
.party-badge.sm { min-width: 36px; height: 32px; font-size: 12px; }

/* Selector tile list */
.selector-tiles {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 4px;
}
.selector-tile {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  font: inherit; color: var(--ink); text-align: left;
}
.selector-tile:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--hair-2);
}
.selector-tile.selected-gov {
  border-color: var(--gov-blue, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: inset 0 0 0 1px var(--gov-blue, #3b82f6);
}
.selector-tile .party-tag {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 1;
}
.selector-tile .party-name {
  font-weight: 700; font-size: 14px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.selector-tile .party-seats {
  color: var(--muted); font-weight: 500; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.checkbox-indicator {
  width: 20px; height: 20px; flex: 0 0 auto;
  border: 2px solid var(--hair-2); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.selector-tile.selected-gov .checkbox-indicator {
  background: var(--gov-blue, #3b82f6);
  border-color: var(--gov-blue, #3b82f6);
}
.selector-tile.selected-gov .checkbox-indicator::after {
  content: "✓"; color: #fff; font-size: 12px; font-weight: 900; line-height: 1;
}

/* Majority strip: keep but make it a thin status bar (the archways are primary) */
.majority-meter {
  margin: 0 0 20px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.majority-meter .mm-row {
  display: flex; align-items: center; justify-content: space-between;
}
.majority-meter .mm-total { font-size: 15px; }
.majority-meter .mm-bar { height: 6px; margin-top: 8px; }

/* Mobile: archways stack */
@media (max-width: 540px) {
  .bloc-grid { grid-template-columns: 1fr; gap: 16px; }
  .bloc-arch { height: 150px; font-size: 42px; }
}

/* ===========================
   Results: bar-badge + colored track + swing label
   =========================== */
.chart {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  margin: 14px 0 24px;
}
.chart-row.results-bar-row {
  display: flex; align-items: center; gap: 12px;
  height: 44px;
  width: 100%;
  grid-template-columns: unset;
}
.bar-badge {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff;
  letter-spacing: -0.01em;
}
.bar-track-area {
  flex: 1; position: relative;
  background: #1e293b;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  display: flex; align-items: center;
}
.bar-fill-data {
  height: 100%; width: 0;
  border-radius: 4px 0 0 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.swing-indicator-label {
  position: absolute; right: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: #fff;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.swing-indicator-label .swing-seats { font-variant-numeric: tabular-nums; }
.swing-indicator-label .swing-delta {
  font-size: 11px; opacity: 0.85; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
}

/* ===========================
   Seats screen: slider rows (replaces stepper)
   =========================== */
.slider-row {
  background: rgba(11, 15, 25, 0.4);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.slider-row .row-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.slider-row .party-tag {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
}
.slider-row .party-box-icon {
  width: 36px; height: 28px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-weight: 800; font-size: 11px; color: #fff;
  letter-spacing: -0.01em;
}
.slider-row .party-meta {
  display: flex; flex-direction: column; min-width: 0; line-height: 1.25;
}
.slider-row .party-name {
  font-weight: 700; font-size: 14px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slider-row .party-ref {
  font-family: var(--font-mono); font-size: 10px; color: var(--faint);
  margin-top: 2px; letter-spacing: 0.02em;
}
.slider-row .party-stance {
  font-family: var(--font-mono); font-size: 10px; color: var(--accent);
  margin-top: 2px; letter-spacing: 0.02em;
}
.slider-row .seats-num {
  font-family: var(--font-mono);
  font-size: 16px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 28px; text-align: right;
}
.slider-input-box { display: flex; align-items: center; gap: 12px; }

/* Range slider — colored track up to thumb, dark beyond */
input[type="range"].seat-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--party-color, var(--ink)) 0%,
    var(--party-color, var(--ink)) var(--fill, 0%),
    #24324f var(--fill, 0%),
    #24324f 100%
  );
  outline: none;
  margin: 0;
  cursor: pointer;
}
input[type="range"].seat-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  transition: transform .12s ease;
}
input[type="range"].seat-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #ffffff; border: 0; cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
input[type="range"].seat-slider:active::-webkit-slider-thumb { transform: scale(1.1); }

/* Hide the legacy stepper styling if any older row uses .party-row */
.party-list { gap: 0; }
