/* The Margin — Design direction 04, "The Bear Pit".
   Heavy condensed Archivo + JetBrains Mono numerals, amber accent,
   light by default with a dark theme. Every colour is a token below. */

:root,
:root[data-theme="light"] {
  --bg: #F4F5F7; --panel: #FFFFFF; --line: #D6DBE2; --line2: #9AA4B2;
  --text: #0B0F14; --body: #3A4350; --muted: #5B6573;
  --accent: #F5B544; --accent-ink: #0B0F14; --accent-text: #9A5800;
  --track: #E6E9EE; --gauge-mid: #CDD3DB; --needle: #0B0F14; --live: #1D9A4B;
  --btn-on-bg: #0B0F14; --btn-on-ink: #F4F5F7;
  --banner-bg: #FFF3D6; --banner-ink: #5A3A00;
  /* Party colours (fills) and their text-safe variants. */
  --alp: #D8332A;  --alp-text: #B42318;
  --coa: #1F4E9C;  --coa-text: #1F4E9C;
  --lib: #1F4E9C;  --lib-text: #1F4E9C;
  --nat: #0F7A71;  --nat-text: #0B6158;
  --grn: #1D9A4B;  --grn-text: #157A3B;
  --on:  #F07C1B;  --on-text: #A84D0B;
  --ind: #7A4FB0;  --ind-text: #6A3FA0;
  --oth: #6B7280;  --oth-text: #4B5260;
  --maj: #3A4350;  --maj-text: #3A4350;
  --toss: #E9D9A6; --toss-line: #C9A24A; --toss-text: #8A6414;
  --cell-alpha: 0.5;
  --wz-bg: #FFF3D6; --wz-ink: #4A3000; --wz-line: #E3BE6E;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0B0F14; --panel: #0E131A; --line: #263040; --line2: #3A4556;
  --text: #F3F4F6; --body: #C7CED8; --muted: #9AA4B2;
  --accent: #F5B544; --accent-ink: #0B0F14; --accent-text: #F5B544;
  --track: #1A2230; --gauge-mid: #3A4556; --needle: #F5B544; --live: #2ECC71;
  --btn-on-bg: #F3F4F6; --btn-on-ink: #0B0F14;
  --banner-bg: #3A2A08; --banner-ink: #FFE2A8;
  --alp: #FF5A4E;  --alp-text: #FF7A70;
  --coa: #4F86F7;  --coa-text: #7EA6FA;
  --lib: #4F86F7;  --lib-text: #7EA6FA;
  --nat: #2BD4C4;  --nat-text: #2BD4C4;
  --grn: #2ECC71;  --grn-text: #2ECC71;
  --on:  #FF9A2E;  --on-text: #FF9A2E;
  --ind: #B794F6;  --ind-text: #C4A8F8;
  --oth: #9AA4B2;  --oth-text: #B4BCC8;
  --maj: #C7CED8;  --maj-text: #E1E5EB;
  --toss: #5A4A1E; --toss-line: #B8923A; --toss-text: #F0C66A;
  --cell-alpha: 0.42;
  --wz-bg: #2E2209; --wz-ink: #FFE2A8; --wz-line: #7A5A1A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Archivo, system-ui, sans-serif; font-size: 16px; line-height: 1.5;
  transition: background .2s, color .2s;
}
a { color: inherit; }
a:hover { opacity: .75; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.wrap { max-width: 1400px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { font-stretch: 75%; font-weight: 900; text-transform: uppercase; margin: 0; }
h2 { font-size: 44px; line-height: .95; letter-spacing: -.01em; }
h3 { font-size: 22px; line-height: 1.1; letter-spacing: .01em; }
p { margin: 0; }
.accent-text { color: var(--accent-text); }

/* Header: The Margin and its three elections, then the open election's sections */
.site-header { position: sticky; top: 0; z-index: 6; height: 56px; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-row { height: 100%; display: flex; align-items: center; gap: 32px; }
.logo { font-stretch: 75%; font-weight: 900; font-size: 22px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.logo span { color: var(--accent-text); }
.elections { display: flex; align-self: stretch; gap: 4px; font-stretch: 75%; font-weight: 800; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; }
.elections a {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; text-decoration: none; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.elections a:hover { color: var(--text); opacity: 1; }
.elections a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.elections .el-method { margin-left: 10px; padding-left: 24px; position: relative; }
.elections .el-method::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; border-left: 1px solid var(--line2); }
.el-date { font-stretch: 100%; font-size: 11px; font-weight: 400; letter-spacing: .02em; color: var(--muted); }
.header-tools { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.subnav { position: sticky; top: 56px; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); }
.subnav-row { min-height: 44px; display: flex; align-items: center; gap: 24px; }
.subnav-label {
  flex: none; font-stretch: 75%; font-weight: 900; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  padding: 3px 8px; background: var(--accent); color: var(--accent-ink);
}
.nav { display: flex; gap: 22px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 8px 0; }
.subnav .live { margin-left: auto; }
.live { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; }
.theme-toggle {
  height: 40px; min-width: 40px; padding: 0 12px; border: 1px solid var(--line2); background: transparent; color: var(--text);
  font: inherit; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
:root[data-theme="light"] .icon-sun, :root[data-theme="dark"] .icon-moon { display: none; }

.demo-banner { background: var(--banner-bg); color: var(--banner-ink); border-bottom: 1px solid var(--line); font-size: 14px; }
.demo-banner .wrap { padding-top: 10px; padding-bottom: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 22px;
  font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn-outline { border: 1px solid var(--text); color: var(--text); background: transparent; }
.link-caps { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* Hero */
.hero { padding-top: 48px; padding-bottom: 32px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.kicker { font-size: 12px; letter-spacing: .14em; color: var(--accent-text); text-transform: uppercase; }
.hero h1 { font-size: clamp(56px, 9vw, 112px); line-height: .9; letter-spacing: -.02em; }
.hero h1 .muted { color: var(--muted); }
.lede { font-size: 20px; line-height: 1.45; color: var(--body); max-width: 600px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-gauge { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; }
#gauge { width: 100%; max-width: 600px; display: block; }
.model-toggle { display: inline-flex; border: 1px solid var(--line2); }
.model-toggle button {
  padding: 12px 18px; min-height: 44px; border: 0; background: transparent; color: var(--text); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.model-toggle button + button { border-left: 1px solid var(--line2); }
.model-toggle button[aria-checked="true"] { background: var(--btn-on-bg); color: var(--btn-on-ink); }

/* Bands and sections */
.band { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section { padding-top: 48px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 22px; }
.band > .wrap.two-col { padding-top: 40px; padding-bottom: 40px; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.section-head.row { flex-direction: row; justify-content: space-between; align-items: flex-end; max-width: none; flex-wrap: wrap; gap: 16px; }
.section-head p, .col-intro p { color: var(--body); font-size: 15px; }
.two-col { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.col-intro { flex: 0 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* Seat-total bars */
.seat-bars { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 92px; align-items: center; gap: 14px; font-size: 14px; }
.bar-name { font-weight: 700; }
.bar-track { position: relative; height: 26px; background: var(--track); }
.bar-range { position: absolute; top: 9px; height: 8px; opacity: .45; }
.bar-median { position: absolute; top: 0; height: 26px; width: 4px; margin-left: -2px; }
.bar-fill { position: absolute; top: 0; left: 0; height: 26px; opacity: .9; }
.bar-majority { position: absolute; top: -6px; bottom: -6px; border-left: 2px dashed var(--text); }
.bar-val { font-family: "JetBrains Mono", monospace; font-weight: 800; text-align: right; }
.bar-val small { font-weight: 400; color: var(--muted); font-size: 11px; display: block; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; display: inline-block; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 24px; }
.tile-region h3 { font-size: 13px; letter-spacing: .1em; color: var(--muted); font-stretch: 100%; font-weight: 700; margin-bottom: 8px; }
.tile-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.tile {
  width: 44px; height: 44px; border: 0; padding: 0; cursor: pointer; position: relative;
  font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 800; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.tile::before { content: ""; position: absolute; inset: 0; background: var(--c); opacity: var(--a); }
.tile span { position: relative; }
.tile.strong { color: #fff; }
.tile.dim { opacity: .14; }

/* Seat overview: Squares / Map tabs, the legend as a party filter, the map */
.overview-tools { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.view-tabs { display: inline-flex; border: 1px solid var(--line2); }
.view-tabs button {
  padding: 10px 18px; min-height: 44px; border: 0; background: transparent; color: var(--text); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.view-tabs button + button { border-left: 1px solid var(--line2); }
.view-tabs button[aria-selected="true"] { background: var(--btn-on-bg); color: var(--btn-on-ink); }
.filter-note { font-size: 13px; color: var(--muted); }
.party-filter button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px 4px 6px; margin-left: -6px;
  border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.party-filter button:hover { border-color: var(--line2); }
.party-filter button[aria-pressed="true"] { border-color: var(--text); }
.party-filter.filtering button[aria-pressed="false"] { opacity: .45; }
[role="tabpanel"][hidden] { display: none; }
.map-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.map-box { position: relative; border: 1px solid var(--line); background: var(--panel); }
#seat-map { display: block; width: 100%; height: auto; max-height: 78vh; }
#seat-map path.seat {
  fill: var(--c); fill-opacity: var(--a); fill-rule: evenodd; stroke: var(--panel); stroke-width: .75; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; cursor: pointer; transition: fill-opacity .2s;
}
#seat-map path.seat.dim { fill-opacity: .07; }
#seat-map path.seat:hover { stroke: var(--text); stroke-width: 1.5; }
#seat-map .map-frame { cursor: zoom-in; }
#seat-map .map-frame rect { fill: transparent; stroke: var(--text); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
#seat-map .map-frame text { font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 600; fill: var(--text); }
#seat-map .map-frame:hover rect { stroke-width: 2; }
.map-tip {
  position: absolute; pointer-events: none; z-index: 2; white-space: pre; font-size: 12px; padding: 6px 8px;
  background: var(--text); color: var(--bg);
}

/* Edge cards */
.edge-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.edge-card {
  text-decoration: none; border: 1px solid var(--line); border-top: 4px solid var(--c); padding: 16px;
  display: flex; flex-direction: column; gap: 8px; background: var(--bg);
}
.edge-card.tipping { border: 2px solid var(--accent); border-top: 4px solid var(--c); padding: 15px; }
.edge-card .cap { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.edge-card.tipping .cap { color: var(--accent-text); font-weight: 700; }
.edge-card .name { font-stretch: 75%; font-weight: 900; font-size: 26px; text-transform: uppercase; line-height: 1; }
.edge-card .pct { font-family: "JetBrains Mono", monospace; font-size: 30px; font-weight: 800; line-height: 1; color: var(--ct); }
.edge-card .sub { font-size: 12px; color: var(--body); }

/* Seat table */
.table-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line2); padding: 0 12px; min-height: 44px; background: var(--panel); flex: 0 1 340px; }
.search input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; flex: 1; min-width: 0; height: 42px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.sort-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sort-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip {
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--line2); background: transparent; color: var(--text); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.party-chip { border-left: 6px solid var(--c); }
.chip[aria-pressed="true"] { background: var(--btn-on-bg); color: var(--btn-on-ink); border-color: var(--btn-on-bg); }
.party-chip[aria-pressed="true"] { border-left-color: var(--c); }
.table-box { overflow: auto; max-height: 78vh; border: 1px solid var(--line); background: var(--panel); }
.seat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.seat-table thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; border-bottom: 2px solid var(--text); text-align: left; padding: 0; white-space: nowrap; }
.seat-table th button {
  width: 100%; border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 12px 10px; text-align: inherit;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; gap: 6px; align-items: center;
}
.seat-table th.num button { justify-content: flex-end; }
.seat-table th[aria-sort] button::after { content: "↑"; color: var(--accent-text); }
.seat-table th[aria-sort="descending"] button::after { content: "↓"; }
.seat-table td { padding: 0 10px; height: 40px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.seat-table tbody tr:hover td { background-image: linear-gradient(var(--track), var(--track)); }
.seat-table td.seat-name { font-weight: 700; }
.seat-table td.region { color: var(--muted); font-size: 13px; }
.seat-table td.num { text-align: right; font-family: "JetBrains Mono", monospace; font-weight: 600; position: relative; min-width: 72px; }
.seat-table td.num .fill { position: absolute; inset: 3px 2px; background: var(--c); opacity: calc(var(--cell-alpha) * var(--s)); }
.seat-table td.num span { position: relative; }
.seat-table td.num.lead span { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.seat-table td.blank { color: var(--muted); }
.seat-table td.tcp-lose { text-align: left; }
.seat-table td.tcp-win span:last-child { font-weight: 800; }
.tcp-party { font-family: "Archivo", system-ui, sans-serif; font-size: 12px; letter-spacing: .06em; }
.view-toggle button { padding: 8px 14px; min-height: 40px; font-size: 12px; }
.fav { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.fav i { width: 10px; height: 10px; display: inline-block; background: var(--c); }
.fav b { font-family: "JetBrains Mono", monospace; }
.seat-table tr.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent); } to { background: transparent; } }
.table-foot { font-size: 12px; color: var(--muted); }
/* Seat name stays visible while the party columns scroll sideways. */
.seat-table th:first-child, .seat-table td.seat-name { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.seat-table thead th:first-child { z-index: 2; }

/* Context */
.context-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.context-copy p, .context-copy li { color: var(--body); font-size: 16px; max-width: 640px; }
.context-copy h3 { margin-top: 14px; }
.ticks { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ticks li { padding-left: 26px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 7px; width: 12px; height: 12px; background: var(--accent); }
.fine { font-size: 13px !important; color: var(--muted) !important; }
.context-figures { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 80px; }
.compare-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare-card { border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.compare-card.is-accent { border: 2px solid var(--accent); padding: 19px; }
.compare-card .cap { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.compare-card.is-accent .cap { color: var(--accent-text); font-weight: 700; }
.compare-card .big { font-size: 56px; font-weight: 800; line-height: 1; }
.compare-card.is-accent .big { color: var(--accent-text); }
.compare-card .big small { font-size: 24px; color: var(--muted); }
.compare-card .sub { font-size: 13px; color: var(--body); }
.mini-head { font-size: 16px; letter-spacing: .08em; }
.delta-rows { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.delta-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 92px; align-items: center; gap: 12px; }
.delta-row .lbl { color: var(--body); }
.delta-track { height: 10px; background: var(--track); position: relative; }
.delta-track::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 1px solid var(--line2); }
.delta-bar { position: absolute; top: 0; height: 10px; background: var(--c); }
.delta-row .val { white-space: nowrap; font-family: "JetBrains Mono", monospace; font-weight: 800; text-align: right; }
.context-summary { font-size: 15px; color: var(--body); border-top: 1px solid var(--line); padding-top: 14px; }

/* Council */
.council-figure { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.council-dots { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); gap: 6px; }
.council-dots span { aspect-ratio: 1; border-radius: 50%; background: var(--c); }
.council-dots span.faded { opacity: .35; }
.small { font-size: 12px; color: var(--muted); }

/* Polls */
.chart-box { border: 1px solid var(--line); background: var(--bg); padding: 12px; position: relative; }
#trend circle[data-poll] { pointer-events: all; }
#trend { width: 100%; display: block; }
#trend text { font-family: "JetBrains Mono", monospace; font-size: 12px; fill: var(--muted); }
.poll-list-title { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 24px 0 8px; }
.plain-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plain-table th, .plain-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.plain-table td.num, .plain-table th.num { text-align: right; font-family: "JetBrains Mono", monospace; }
.plain-table tr.excluded td { color: var(--muted); }
.flag { font-size: 11px; padding: 2px 6px; border: 1px solid var(--line2); text-transform: uppercase; letter-spacing: .06em; }

/* Downloads */
.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.download-card { border: 1px solid var(--line); background: var(--panel); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.download-card p { color: var(--body); font-size: 15px; flex: 1; }
.dl-buttons { display: flex; gap: 10px; }

/* Method */
.method-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; max-width: 820px; color: var(--body); }
.method-steps strong { color: var(--text); }
.blend-lede { max-width: 820px; color: var(--body); margin: 0 0 18px; }
.blend-table { max-width: 820px; }
.blend-table .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: baseline; }
.blend-method { margin-top: 36px; }
.blend-method h3 { margin: 28px 0 10px; }
.blend-method > p { max-width: 820px; color: var(--body); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-row { padding-top: 20px; padding-bottom: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* Wazza, the waratah guide. Bubbles are rounded and warm so he reads as a
   guest in the data, not part of it. Hidden with <html class="wz-off">. */
.wazza { display: block; width: 100%; height: auto; overflow: visible; }
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo .logo-text { color: var(--text); }
.logo .logo-text span { color: var(--accent-text); }
.logo-face { width: 38px; flex: none; display: inline-block; cursor: pointer; }
.wz-toggle { gap: 6px; }
.wz-toggle-face { width: 26px; display: inline-block; }
.wz-toggle[aria-pressed="false"] .wz-toggle-face { filter: grayscale(1); opacity: .55; }
.wz-state { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }
.wz-note { display: flex; align-items: flex-end; gap: 14px; max-width: 640px; }
.wz-note:empty, .wz-off .wz-note:not(.wz-keep) { display: none; }
.wz-face { flex: none; width: 76px; cursor: pointer; transform-origin: 50% 100%; }
.wz-note--big .wz-face { width: 118px; }
.col-intro .wz-face { width: 56px; }
.wz-bubble {
  position: relative; background: var(--wz-bg); color: var(--wz-ink); border: 1.5px solid var(--wz-line); border-radius: 16px;
  padding: 12px 16px; font-size: 15px; line-height: 1.45; flex: 1; min-width: 0; margin-bottom: 14px;
}
.wz-bubble::before, .wz-bubble::after { content: ""; position: absolute; bottom: 16px; border: 8px solid transparent; }
.wz-bubble::before { left: -17px; border-right-color: var(--wz-line); }
.wz-bubble::after { left: -14px; border-right-color: var(--wz-bg); }
.wz-bubble strong { color: inherit; }
.wz-name { display: block; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-bottom: 2px; }
.wz-poked { animation: wz-hop .6s ease-out; }
.wz-wave .wz-arm, .wz-ask:hover .wz-arm { transform-box: fill-box; transform-origin: 0% 100%; animation: wz-wave 1.6s ease-in-out infinite; }
.wz-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: wz-blink 5.5s infinite; }
@keyframes wz-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-16deg); } }
@keyframes wz-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }
@keyframes wz-hop { 0% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-10px) rotate(-6deg); } 60% { transform: translateY(0) rotate(5deg); } 100% { transform: none; } }
@keyframes wz-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

/* "Ask Wazza": a button that opens an explanation in place. */
.wz-asks { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.wz-ask-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 640px; width: 100%; }
.wz-ask {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 16px 4px 8px; cursor: pointer;
  background: var(--wz-bg); color: var(--wz-ink); border: 1.5px solid var(--wz-line); border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 700; text-align: left;
}
.wz-ask:hover { border-color: var(--accent-text); }
.wz-ask[aria-expanded="true"] { background: var(--wz-ink); color: var(--wz-bg); border-color: var(--wz-ink); }
.wz-ask-face { width: 32px; flex: none; }
.wz-pop {
  position: relative; display: flex; gap: 14px; align-items: flex-start; width: 100%;
  background: var(--wz-bg); color: var(--wz-ink); border: 1.5px solid var(--wz-line); border-radius: 16px; padding: 14px 18px;
  font-size: 15px; line-height: 1.5; animation: wz-pop .18s ease-out;
}
.wz-pop[hidden] { display: none; }
.wz-pop p, .wz-bubble p { color: inherit; font-size: inherit; }
.wz-pop p + p { margin-top: 8px; }
.wz-pop-face { width: 52px; flex: none; }
.wz-pop strong { color: inherit; }
.wz-pop .mono { font-size: .92em; }
.wz-empty { white-space: normal; padding: 18px 10px; }
.wz-empty .wz-note { margin: 0 auto; }
.empty-row { white-space: normal; padding: 18px 10px; color: var(--muted); }
.site-footer .wz-note { padding-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  .wz-wave .wz-arm, .wz-ask:hover .wz-arm, .wz-eyes, .wz-poked, .wz-pop { animation: none; }
}

/* Phone widths */
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  h2 { font-size: 34px; }
  html { scroll-padding-top: 56px; }
  /* Only the section bar stays pinned on a phone; the election tabs wrap under the logo. */
  .site-header { position: static; height: auto; }
  .header-row { flex-wrap: wrap; gap: 0 16px; padding-top: 8px; }
  .logo { min-height: 44px; display: inline-flex; align-items: center; }
  .elections { order: 3; width: calc(100% + 20px); height: 44px; margin: 0 -10px; }
  .elections { overflow-x: auto; scrollbar-width: none; font-size: 15px; }
  .elections a { padding: 0 10px; white-space: nowrap; }
  .elections .el-method { margin-left: 4px; padding-left: 14px; }
  .el-date { display: none; }
  .header-tools { gap: 8px; }
  .header-tools .theme-label { display: none; }
  .subnav { top: 0; }
  .subnav-row { gap: 14px; }
  .nav { gap: 16px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .live { display: none; }
  .bar-row { grid-template-columns: 84px 1fr 70px; gap: 10px; }
  .compare-card .big { font-size: 42px; }
  .context-figures { position: static; }
  .delta-row { grid-template-columns: 120px 1fr 84px; }
  .council-dots { gap: 3px; }
  .lede { font-size: 17px; }
  .wz-face { width: 56px; }
  .wz-note--big .wz-face { width: 84px; }
  .wz-state { display: none; }
  .wz-pop-face { width: 40px; }
  .seat-table th[data-sort="region"], .seat-table td.region { display: none; }
  .seat-table td.seat-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
}
.council-regions { margin-top: 18px; }

/* Bloc match-ups. The picker follows shadcn/ui's ToggleGroup (outline
   variant) and the odds row its Card, drawn with the site's tokens. */
.bloc-chart { display: flex; flex-direction: column; gap: 20px; margin-top: 12px; padding-top: 28px; border-top: 1px solid var(--line); }
.bloc-chart[hidden] { display: none; }
.bloc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.toggle-group { display: inline-flex; flex-wrap: wrap; align-items: center; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / .05); overflow: hidden; }
.toggle-group-item {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 12px;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500;
  white-space: nowrap; cursor: pointer; transition: color .15s, background .15s;
}
.toggle-group-item + .toggle-group-item { border-left: 1px solid var(--line); }
.toggle-group-item:hover { background: var(--track); color: var(--text); }
.toggle-group-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; position: relative; z-index: 1; }
.toggle-group-item[data-state="on"] { background: var(--track); color: var(--text); font-weight: 700; }
.bloc-odds { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.bloc-stat {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; box-shadow: 0 1px 2px rgb(0 0 0 / .05);
}
.bloc-stat-name { font-size: 13px; font-weight: 600; color: var(--body); }
.bloc-stat b { font-size: 28px; line-height: 1.1; }
.bloc-viz { display: flex; flex-direction: column; }
.bloc-counts { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 600; margin-bottom: 8px; flex-wrap: wrap; }
.bloc-toss-ink { color: var(--toss-text); }
.bloc-squares { position: relative; display: flex; gap: 3px; }
.bloc-sq { flex: 1 1 0; min-width: 0; height: 28px; border-radius: 3px; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 30%, var(--panel)); }
.bloc-sq.safe { background: var(--c); }
.bloc-sq.toss { --c: var(--toss-line); background: var(--toss); }
.bloc-funnel { display: block; width: 100%; height: 40px; }
.bloc-funnel polygon { fill: var(--track); }
.bloc-funnel line { stroke: var(--text); stroke-width: 2; }
.bloc-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--text); }
.bloc-squares .bloc-mark { top: 50%; bottom: 0; }
.bloc-bar { position: relative; display: flex; height: 28px; }
.bloc-bar > span { display: block; }
.bloc-zoom { display: flex !important; outline: 2.5px solid var(--text); outline-offset: -1px; position: relative; }
.bloc-zoom > span { min-width: 0; }
.bloc-zoom .toss { background: var(--toss); }
.bloc-foot { position: relative; display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.bloc-foot span:last-child { text-align: right; }
.bloc-foot strong { position: absolute; top: 0; transform: translateX(-50%); font-size: 15px; color: var(--text); white-space: nowrap; }
@media (max-width: 720px) {
  .toggle-group { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .toggle-group-item { white-space: normal; height: auto; min-height: 40px; padding: 6px 10px; }
  .toggle-group-item + .toggle-group-item { border-left: 0; }
  .toggle-group-item:nth-child(even) { border-left: 1px solid var(--line); }
  .toggle-group-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .bloc-sq { height: 20px; border-width: 1px; border-radius: 2px; }
  .bloc-squares { gap: 2px; }
  .bloc-foot { flex-direction: column; gap: 4px; padding-top: 26px; }
  .bloc-foot span:last-child { text-align: left; }
}
.council-regions[hidden] { display: none; }
.bloc-foot > span { max-width: 38%; }
@media (max-width: 720px) { .bloc-foot > span { max-width: none; } }
