/* Mandate. The interface wears the player's party colour: a flood of it carries the chamber of
   voters and the headline number; everything else stays quiet so that colour means something. */
:root {
  --party: #1F5FD6;
  --bg: #EEF0F3;
  --surface: #FFFFFF;
  --ink: #14171C;
  --muted: #5C6470;
  --rule: #D6DBE1;
  --well: #E4E8EC;
  --up: #0A8259;
  --down: #C93426;
  --display: "Avenir Next Condensed", "Bahnschrift", "Roboto Condensed", "DIN Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar: 58px;
  --mark: var(--party);        /* the party colour as a chart mark */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  /* On the dark surface the party hue is lightened so every party colour clears 3:1 as a mark. */
  :root { --mark: color-mix(in srgb, var(--party) 62%, white); --bg: #111418; --surface: #1A1E24; --ink: #ECEEF1; --muted: #98A1AD; --rule: #2B323B; --well: #242A32; --up: #3CC592; --down: #FF7566; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.band :focus-visible { outline-color: #fff; }
.num { font-variant-numeric: tabular-nums; }
.boot { padding: 40vh 24px 0; text-align: center; color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }
.display { font-family: var(--display); font-weight: 700; font-stretch: condensed; letter-spacing: 0; line-height: 0.95; }

/* ---------- buttons and fields ---------- */
.btn { min-height: 48px; padding: 0 20px; border-radius: 6px; border: 2px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.quiet { border-color: transparent; background: var(--well); color: var(--ink); }
.btn.danger { border-color: var(--down); background: transparent; color: var(--down); }
.btn.party { border-color: var(--party); background: var(--party); color: #fff; }
.btn.onband { border-color: #fff; background: #fff; color: #14171C; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; min-height: 48px; padding: 0 14px; border: 2px solid var(--rule); border-radius: 6px; background: var(--surface); }
.field input:focus { border-color: var(--ink); outline: none; }
.error { color: var(--down); font-weight: 600; min-height: 1.45em; margin-bottom: 8px; }

/* ---------- sign in ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.auth .poster { background: var(--party); color: #fff; padding: calc(40px + var(--safe-t)) 24px 28px; position: relative; overflow: hidden; }
.auth .poster h1 { font-size: min(17vw, 150px); text-transform: uppercase; position: relative; }
.auth .poster p { font-size: 19px; max-width: 26ch; margin-top: 10px; position: relative; }
.auth .poster svg { width: min(64vw, 300px); margin: 0 0 14px; }
.auth .panel { padding: 28px 24px 40px; max-width: 460px; width: 100%; }
.auth .panel h2 { font-size: 30px; margin-bottom: 18px; }
.auth .switch { margin-top: 18px; color: var(--muted); }
@media (min-width: 860px) {
  .auth { grid-template-rows: none; grid-template-columns: 1.15fr 1fr; }
  .auth .poster { padding: 64px 56px; display: flex; flex-direction: column; justify-content: flex-end; }
  .auth .poster svg { position: absolute; right: -60px; top: 40px; width: 620px; max-width: none; margin: 0; }
  .auth .panel { align-self: center; padding: 56px; }
}

/* ---------- lobby and new game ---------- */
.page { max-width: 880px; margin: 0 auto; padding: calc(20px + var(--safe-t)) 16px calc(48px + var(--safe-b)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 12px 0 20px; border-bottom: 3px solid var(--ink); margin-bottom: 8px; }
.page-head h1 { font-size: clamp(44px, 11vw, 72px); text-transform: uppercase; }
.page-head .who { text-align: right; font-size: 15px; color: var(--muted); white-space: nowrap; }
.saves { list-style: none; margin: 0; padding: 0; }
.save { display: grid; grid-template-columns: 10px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: stretch; }
.save .chip { border-radius: 2px; background: var(--c); }
.save h3 { font-size: 19px; font-weight: 650; overflow-wrap: anywhere; }
.save .meta { color: var(--muted); font-size: 15px; }
.save .vote { font-size: 34px; text-align: right; }
.save .vote small { display: block; font: 13px/1.2 var(--body); color: var(--muted); font-weight: 400; }
.save .acts { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.empty { padding: 48px 0; color: var(--muted); font-size: 18px; max-width: 40ch; }
.lobby-foot { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; color: var(--muted); font-size: 15px; }

.form-section { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.form-section > h2 { font-size: 26px; margin-bottom: 12px; text-transform: uppercase; }
.choices { display: grid; gap: 10px; }
.choice { display: block; text-align: left; width: 100%; padding: 14px 16px; border: 2px solid var(--rule); border-radius: 6px; background: var(--surface); }
.choice[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 6px 0 0 var(--party); }
.choice b { font-size: 18px; }
.choice .tagline { color: var(--muted); font-size: 15px; }
.choice p { margin-top: 6px; font-size: 15px; }
.seg { display: flex; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; min-height: 46px; border: 0; background: var(--surface); padding: 0 8px; font-weight: 600; font-size: 15px; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.hint { color: var(--muted); font-size: 15px; margin-top: 8px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--c); position: relative; }
.swatch[aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border: 3px solid var(--ink); border-radius: 50%; }
.two { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } .choices.cols { grid-template-columns: 1fr 1fr; } }

.group-label { font-weight: 650; margin: 14px 0 8px; }
.choice-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.choice-wrap .choice { flex: 1; }
.choice .traits { font-size: 14px; font-weight: 600; }
.trait { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.trait b { font-size: 17px; }
.trait p { margin-top: 4px; font-size: 15px; }
.trait .ingame { padding-left: 10px; border-left: 3px solid var(--party); }
.src, .src a { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.facts { margin: 8px 0 0; }
.facts dt { font-weight: 600; margin-top: 10px; font-size: 15px; }
.facts dd { margin: 0; font-size: 15px; }
.facts .src { display: block; }
ul.plain { margin: 8px 0 0; padding-left: 18px; font-size: 15px; }
ul.plain li { margin-bottom: 6px; }

/* ---------- game shell ---------- */
.game { min-height: 100dvh; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 76px); }
.band { background: var(--party); color: #fff; padding: calc(10px + var(--safe-t)) 16px 14px; }
.band-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.band-top h1 { font-size: 26px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-top .date { font-size: 15px; opacity: 0.9; white-space: nowrap; }
.iconbtn { width: 44px; height: 44px; border-radius: 6px; border: 0; background: rgba(0, 0, 0, 0.18); color: #fff; display: grid; place-items: center; flex: none; }
.chamber { display: block; width: 100%; max-width: 440px; margin: 6px auto 0; }
.chamber circle { transition: fill 0.5s; }
.headline { display: flex; align-items: flex-end; gap: 12px; margin-top: -4px; }
.headline .big { font-size: 84px; }
.headline .big sup { font-size: 0.42em; vertical-align: top; position: relative; top: 0.12em; margin-left: 2px; }
.headline p { font-size: 15px; line-height: 1.3; padding-bottom: 10px; }
.headline p b { display: block; font-size: 17px; }
.band.compact .chamber, .band.compact .headline p .long { display: none; }
.band.compact .headline { margin-top: 2px; align-items: center; }
.band.compact .headline .big { font-size: 40px; }
.band.compact .headline p { padding: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-bottom: 1px solid var(--rule); }
.stats button { border: 0; background: none; text-align: left; padding: 10px 12px 10px 16px; min-height: 58px; min-width: 0; }
.stats button + button { border-left: 1px solid var(--rule); }
.stats small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; }
.stats b { font-family: var(--display); font-size: clamp(16px, 5vw, 24px); font-stretch: condensed; line-height: 1.1; white-space: nowrap; display: block; }

.main { padding: 4px 16px 24px; max-width: 760px; margin: 0 auto; }
.section { padding-top: 22px; }
.section > h2 { font-family: var(--display); font-stretch: condensed; font-size: 24px; text-transform: uppercase; padding-bottom: 6px; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section > h2 small { font: 400 14px var(--body); color: var(--muted); text-transform: none; white-space: nowrap; }
.section > .lede { color: var(--muted); font-size: 15px; padding-top: 8px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--rule); padding-bottom: var(--safe-b); }
.tabbar button { border: 0; background: none; height: var(--tabbar); display: grid; place-items: center; align-content: center; gap: 2px; font-size: 12px; color: var(--muted); position: relative; }
.tabbar button[aria-current="page"] { color: var(--ink); font-weight: 650; }
.tabbar button[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; background: var(--party); }
.tabbar svg { width: 22px; height: 22px; }
.advance { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + var(--safe-b)); z-index: 19; padding: 10px 16px; background: linear-gradient(to top, var(--bg) 70%, transparent); display: flex; gap: 10px; align-items: center; }
.advance .btn { flex: 1; min-height: 52px; font-size: 17px; }
.advance .save-state { font-size: 13px; color: var(--muted); width: 74px; flex: none; line-height: 1.2; }

/* ---------- rows, meters, bars ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; width: 100%; min-height: 56px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; }
.row .name { font-weight: 600; }
.row .sub { grid-column: 1; color: var(--muted); font-size: 14px; }
.row .val { font-family: var(--display); font-stretch: condensed; font-size: 22px; font-weight: 700; text-align: right; white-space: nowrap; }
.row .val small { font: 400 13px var(--body); margin-left: 4px; }
.row .meter, .row .signed { grid-column: 1 / -1; }
.meter { height: 6px; background: var(--well); border-radius: 3px; overflow: hidden; position: relative; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 3px; }
.meter i.pending { background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 6px); }
.meter.good i { background: var(--up); } .meter.bad i { background: var(--down); }
.signed { height: 8px; background: var(--well); border-radius: 4px; position: relative; }
.signed::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--muted); margin-left: -1px; }
.signed i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.signed i.pos { left: 50%; background: var(--up); } .signed i.neg { right: 50%; background: var(--down); }
.signed i.neutral { background: var(--muted); }
.spark { width: 72px; height: 24px; display: block; }
.spark path { fill: none; stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart { width: 100%; height: 120px; display: block; margin-top: 8px; }
.chart path { fill: none; stroke: var(--party); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart line { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart line.mid { stroke-dasharray: 3 4; stroke: var(--muted); }
.chart-cap { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

.notice { display: grid; grid-template-columns: 6px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); width: 100%; background: none; border-top: 0; border-left: 0; border-right: 0; text-align: left; }
.notice::before { content: ""; border-radius: 2px; background: var(--muted); }
.notice.good::before { background: var(--up); } .notice.bad::before { background: var(--down); } .notice.desk::before { background: var(--party); }
.notice b { display: block; } .notice span { color: var(--muted); font-size: 15px; }
.desk-card { margin-top: 18px; padding: 16px; background: var(--surface); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--party); }
.desk-card h3 { font-family: var(--display); font-stretch: condensed; font-size: 26px; text-transform: uppercase; line-height: 1; margin-bottom: 6px; }
.desk-card p { margin-bottom: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 14px; padding: 4px 10px; border-radius: 99px; background: var(--well); white-space: nowrap; border: 0; }
.pill.good { background: color-mix(in srgb, var(--up) 16%, var(--surface)); } .pill.bad { background: color-mix(in srgb, var(--down) 16%, var(--surface)); }
.dept-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 6px; margin: 0 -16px; scrollbar-width: none; }
.dept-tabs::-webkit-scrollbar { display: none; }
.dept-tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
@media (min-width: 900px) { .dept-tabs { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.dept-tabs button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--rule); background: var(--surface); font-size: 15px; font-weight: 600; }
.dept-tabs button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.doorstep .row { grid-template-columns: 14px 1fr auto; align-items: start; }
.doorstep .row > .dot { margin-top: 6px; }
.doorstep .row > .sub:last-child { grid-column: auto; white-space: nowrap; padding-top: 2px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.dot.yes { background: var(--party); } .dot.no { background: var(--ink); } .dot.maybe { background: transparent; border: 2px solid var(--muted); }
.totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin-top: 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
.totals div { padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.totals div:nth-child(odd) { border-right: 1px solid var(--rule); }
.totals div:nth-last-child(-n+2) { border-bottom: 0; }
.totals small { display: block; color: var(--muted); font-size: 13px; }
.totals b { font-family: var(--display); font-stretch: condensed; font-size: 28px; line-height: 1.1; }

/* ---------- parties, turnout and the political map ----------
   Emphasis form: one hue (the player's party) against ink. Identity never rests on colour alone:
   every bar is labelled, non-voters are hollow, blocs are a different shape with their name beside. */
.tally { list-style: none; margin: 10px 0 14px; padding: 0; }
.tally li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 6px 0; }
.tally .who { font-weight: 600; }
.tally .num { font-family: var(--display); font-stretch: condensed; font-weight: 700; font-size: 20px; }
.tally .bar { grid-column: 1 / -1; height: 8px; }
.tally .bar i { display: block; height: 8px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--ink); }
.tally .bar i.gov { background: var(--mark); }
.totals.four { grid-template-columns: repeat(2, 1fr); }
.totals button { border: 0; background: none; text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.totals button:nth-child(odd) { border-right: 1px solid var(--rule); }
.totals button:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 640px) { .totals.four { grid-template-columns: repeat(4, 1fr); } .totals.four button { border-bottom: 0; border-right: 1px solid var(--rule); } .totals.four button:last-child { border-right: 0; } }
.map { display: block; width: 100%; max-width: 520px; margin: 10px auto 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; touch-action: manipulation; }
.map circle { stroke: var(--surface); stroke-width: 0.8; }
.map .gov { fill: var(--mark); } .map .opp { fill: var(--ink); } .map .out { fill: var(--surface); stroke: var(--muted); stroke-width: 1.2; }
.map .axis { stroke: var(--rule); stroke-width: 1; }
.map .end { font: 9px var(--body); fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.map .bloc { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.map .you { fill: var(--surface); stroke: var(--mark); stroke-width: 3.5; }
.map .lab { font: 600 10px var(--body); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.map .lab.strong { font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.key.gov { background: var(--mark); } .key.opp { background: var(--ink); } .key.out { border: 1.5px solid var(--muted); }
.key.bloc { border-radius: 0; width: 8px; height: 8px; border: 2px solid var(--ink); transform: rotate(45deg); }
.doorstep li > .row { grid-template-columns: 14px 1fr auto; align-items: start; }
.doorstep li > .row > .dot { margin-top: 6px; }
.doorstep li > .row > .sub:last-child { grid-column: auto; white-space: nowrap; padding-top: 2px; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10, 12, 16, 0.55); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
.sheet { background: var(--bg); width: 100%; max-height: 94dvh; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 16px 12px; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { font-family: var(--display); font-stretch: condensed; font-size: 32px; text-transform: uppercase; line-height: 1; }
.sheet-head .kicker { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.sheet-head .close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--well); flex: none; font-size: 22px; line-height: 1; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(24px + var(--safe-b)); }
.sheet-body > p { margin-bottom: 12px; }
.sheet-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--rule); display: flex; gap: 10px; background: var(--bg); }
.sheet-foot .btn { flex: 1; }
.sheet.modal { border-radius: 14px; }
.sheet h3 { font-family: var(--display); font-stretch: condensed; font-size: 20px; text-transform: uppercase; margin: 20px 0 2px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 760px) {
  .scrim { align-items: stretch; justify-content: flex-end; }
  .sheet { width: 480px; max-height: none; border-radius: 0; animation-name: slide; }
  .scrim.center { align-items: center; justify-content: center; }
  .scrim.center .sheet { width: 560px; max-height: 88dvh; border-radius: 10px; animation-name: rise; }
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

.dial { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 14px; margin-bottom: 14px; }
.dial .setting { display: flex; justify-content: space-between; align-items: baseline; }
.dial .setting b { font-family: var(--display); font-stretch: condensed; font-size: 44px; line-height: 1; }
.dial .ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 4px 0 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--party) var(--fill, 50%), var(--well) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: var(--well); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--party); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); }
.ledger { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 15px; margin-top: 10px; }
.ledger dt { color: var(--muted); } .ledger dd { margin: 0; text-align: right; font-weight: 600; }
.options { display: grid; gap: 12px; }
.option { text-align: left; padding: 14px; border: 2px solid var(--ink); border-radius: 6px; background: var(--surface); width: 100%; }
.option b { font-size: 18px; display: block; margin-bottom: 2px; }
.option .note { color: var(--muted); font-size: 14px; margin-bottom: 8px; display: block; }
.result { text-align: center; padding: 8px 0 4px; }
.result .big { font-size: 110px; }
.result .big sup { font-size: 0.4em; vertical-align: top; position: relative; top: 0.15em; }
.versus { display: flex; height: 18px; border-radius: 3px; overflow: hidden; margin: 14px 0 6px; background: var(--well); }
.versus i:first-child { background: var(--party); } .versus i:last-child { background: var(--ink); margin-left: auto; }
.versus-cap { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 84px); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- wide screens: the band becomes a standing column ---------- */
@media (min-width: 1000px) {
  .game { display: grid; grid-template-columns: 380px 1fr; padding-bottom: 0; }
  .side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--party); color: #fff; overflow-y: auto; }
  .band { padding: 28px 28px 8px; }
  .band.compact .chamber { display: block; } .band.compact .headline p .long { display: inline; }
  .band.compact .headline { align-items: flex-end; margin-top: -4px; } .band.compact .headline .big { font-size: 84px; } .band.compact .headline p { padding-bottom: 10px; }
  .band-top h1 { font-size: 34px; }
  .stats { grid-template-columns: 1fr; background: none; border: 0; padding: 4px 12px; }
  .stats button { color: #fff; display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid rgba(255, 255, 255, 0.28); min-height: 48px; }
  .stats button + button { border-left: 0; }
  .stats small { color: rgba(255, 255, 255, 0.85); font-size: 15px; }
  .tabbar { position: static; grid-template-columns: 1fr; background: none; border: 0; padding: 8px 12px; order: 3; }
  .tabbar button { height: 46px; display: flex; gap: 12px; justify-content: flex-start; padding: 0 16px; font-size: 16px; color: rgba(255, 255, 255, 0.85); border-radius: 6px; }
  .tabbar button[aria-current="page"] { background: rgba(0, 0, 0, 0.22); color: #fff; }
  .tabbar button[aria-current="page"]::before { display: none; }
  .advance { position: static; background: none; padding: 12px 28px 28px; margin-top: auto; flex-direction: column; align-items: stretch; order: 4; }
  .advance .save-state { color: rgba(255, 255, 255, 0.85); width: auto; text-align: center; order: 2; }
  .advance .btn { border-color: #fff; background: #fff; color: #14171C; flex: none; }
  .main { padding: 12px 40px 60px; max-width: 900px; margin: 0; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
  #toast { bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- connections ---------- */
@media (min-width: 760px) { .sheet.wide { width: min(1180px, 100vw); } }
.connect-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.connect-links.top { margin: 4px 0 4px; }
.seg { display: flex; gap: 4px; background: var(--well); border-radius: 8px; padding: 4px; margin-bottom: 12px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 6px; background: transparent; font-weight: 600; font-size: 15px; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.trail { margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; margin: 4px 0 8px; }
.check input { width: 20px; height: 20px; }
.connect-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 6px; margin: 8px 0 4px; }
svg.connect { width: 100%; max-width: 760px; margin: 0 auto; height: auto; display: block; overflow: visible; }
.cn rect { fill: var(--surface); stroke: var(--rule); stroke-width: 1.2; }
.cn text { fill: var(--ink); font: 600 10px/1 var(--body); text-anchor: middle; }
.cn.policy rect { stroke: var(--mark); }
.cn.group rect { stroke: var(--ink); stroke-dasharray: 3 2; }
.cn.situation rect { stroke: var(--down); }
.cn.habit rect { stroke: var(--muted); }
.cn.other rect { fill: var(--well); stroke: transparent; }
.cn.other text { fill: var(--muted); }
.cn.focus rect { fill: var(--ink); stroke: var(--ink); }
.cn.focus text { fill: var(--bg); font-size: 10.5px; }
.cn.focus text.cv { font-weight: 500; font-size: 10px; opacity: 0.85; }
.cn[data-act] { cursor: pointer; }
.cn[data-act]:hover rect, .cn[data-act]:focus rect { stroke-width: 2.4; }
.cn[data-act]:focus { outline: none; }
.cl { fill: none; stroke-linecap: round; opacity: 0.8; stroke-dasharray: 6 5; animation: flow 1.4s linear infinite; }
.cl.good { stroke: var(--up); } .cl.bad { stroke: var(--down); } .cl.flat { stroke: var(--muted); }
.cl.dormant { opacity: 0.28; stroke-dasharray: 2 4; animation: none; }
@keyframes flow { to { stroke-dashoffset: -22; } }
@media (prefers-reduced-motion: reduce) { .cl { animation: none; stroke-dasharray: none; } .cl.dormant { stroke-dasharray: 2 4; } }
.ripple-vote { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: end; margin: 6px 0; }
.ripple-vote small { grid-column: 1 / -1; color: var(--muted); }
.ripple-vote b { font-size: 52px; }
.ripple-vote span { color: var(--muted); padding-bottom: 6px; }
.mx-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin-bottom: 8px; }
.field.inline { margin: 0; }
.field.inline select { min-height: 44px; padding: 0 10px; border: 2px solid var(--rule); border-radius: 6px; background: var(--surface); max-width: 100%; }
.mx-wrap { overflow: auto; max-height: 70dvh; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
table.mx { border-collapse: collapse; font-size: 13px; }
table.mx th, table.mx td { border-bottom: 1px solid var(--rule); padding: 0; }
table.mx td { min-width: 44px; height: 30px; text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; }
table.mx thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; vertical-align: bottom; }
table.mx thead th button { writing-mode: vertical-rl; transform: rotate(180deg); border: 0; background: none; padding: 8px 4px; font-weight: 600; font-size: 12px; white-space: nowrap; max-height: 150px; }
table.mx thead th button.on { color: var(--party); text-decoration: underline; }
table.mx tbody th { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; }
table.mx tbody th button { border: 0; background: none; padding: 4px 10px; text-align: left; font-weight: 500; font-size: 13px; white-space: nowrap; }
table.mx tbody th button:hover { text-decoration: underline; }

.version { color: var(--muted); font-size: 13px; margin-top: 18px; font-variant-numeric: tabular-nums; }
