/* map/map.css – the Election map's own styles (.build/map/app/page.css,
   copied by .build/map/assemble.mjs). The palette tokens live in the page's
   inline <style>, where site-shell.mjs scopes their dark copies; the shell
   brings the masthead, tab bar, menu and colophon. */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  /* pan and pinch only: no double-tap smart zoom when a view tap lands twice */
  touch-action: manipulation;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }

/* ------- the section anatomy (rd.css, ported) ------- */
.mp { flex: 1 0 auto; }
.mp-sec { padding-top: 30px; padding-bottom: 40px; }
.rd-eyebrow { display: flex; align-items: baseline; align-content: flex-start; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.rd-title { font-family: var(--sans); font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; color: var(--ink); }
.rd-meta { font-size: 13px; color: var(--ink-3); }
.rd-grow { flex: 1 1 auto; }
.rd-tabs { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.rd-tab {
  position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 12px;
  font-size: 15px; font-weight: 400; color: var(--ink-2); white-space: nowrap;
}
.rd-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transition: transform .18s ease; }
.rd-tab:hover { color: var(--ink); }
.rd-tab:hover::after { transform: scaleX(1); background: var(--line); }
.rd-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.rd-tab[aria-selected="true"]::after { transform: scaleX(1); background: var(--ink); }
/* a bold twin keeps every tab's width fixed when it gains weight */
.rd-tab .tw { display: inline-grid; }
.rd-tab .tw::after { content: attr(data-t); font-weight: 600; height: 0; visibility: hidden; overflow: hidden; }
.rd-tab .tw, .rd-tab .tw::after { grid-area: 1 / 1; }
.rd-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 6px; }

/* the view switch in the eyebrow: the same tabs, a size down */
.mp-views { display: inline-flex; gap: 2px; align-self: flex-end; margin-bottom: -6px; }
.mp-views .rd-tab { height: 34px; padding: 0 10px; font-size: 14px; }
.mp-views .rd-tab svg { margin-right: 7px; opacity: .8; }

.mp-lensrow { margin-top: 18px; position: relative; }
.mp-lensrow .mp-lenses { display: flex; flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.mp-lensrow .mp-lenses::-webkit-scrollbar { display: none; }
/* a scrollable lens row fades its far edge, so a chip cut mid-word reads as "swipe me" */
.mp-lensrow::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 30px; pointer-events: none; opacity: 0; transition: opacity .2s; background: linear-gradient(to left, var(--bg), transparent); }
.mp-lensrow.more::after { opacity: 1; }
.mp-lenses .rd-tab:first-child { padding-left: 0; }
.mp-lenses .rd-tab:first-child::after { left: 0; }

/* search: the All polls field */
.mp-search { position: relative; flex: none; align-self: center; width: 300px; margin-left: 16px; }
.mp-search label {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink-3);
}
.mp-search label:focus-within { border-color: var(--ink-faint); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent); }
.mp-search input { flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; background: none; font-size: 14px; color: var(--ink); }
.mp-search input::placeholder { color: var(--ink-3); }
.mp-search input::-webkit-search-cancel-button { display: none; }
.mp-search kbd { font: 500 11px var(--sans); color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.sugg {
  position: absolute; z-index: 60; top: 42px; left: 0; right: 0; max-height: min(460px, 70vh); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0;
  box-shadow: 0 1px 0 0 color-mix(in oklch, white 70%, transparent) inset, 0 12px 36px -10px oklch(0.3 0.02 60 / 0.28), 0 2px 6px -2px oklch(0.3 0.02 60 / 0.18);
}
.sugg .g { padding: 8px 14px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sugg button { display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; width: 100%; padding: 7px 14px; text-align: left; }
.sugg button .sw { width: 10px; height: 10px; border-radius: 2px; margin-top: 5px; grid-row: span 2; }
.sugg button .t { font-size: 14px; font-weight: 600; color: var(--ink); }
.sugg button .s { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg button[aria-selected="true"], .sugg button:hover { background: color-mix(in oklch, var(--ink) 5%, transparent); }
.sugg .none { padding: 10px 14px; font-size: 13px; color: var(--ink-3); }

/* ------- the figure: story column + view ------- */
.mp-fig { display: grid; grid-template-columns: 340px minmax(0, 1fr); column-gap: 40px; margin-top: 22px; align-items: start; }
.mp-view {
  position: sticky; top: var(--pin-top); height: calc(100vh - var(--pin-top) - 18px); height: calc(100dvh - var(--pin-top) - 18px);
  min-height: 560px; max-height: 1000px; display: flex; flex-direction: column; grid-column: 2; grid-row: 1;
}
.mp-story { grid-column: 1; grid-row: 1; min-width: 0; padding-bottom: 24px; }
.mp-stage { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 3px; }
.mp-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.mp-stage canvas.grab { cursor: grab; }
.mp-stage canvas.grabbing { cursor: grabbing; }
/* the wait for an election: a ring, centred on the map, in the chamber's aisle (app-6 places it);
   words only when the data fails */
.mp-loading {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; box-sizing: border-box;
  border-radius: 50%; border: 2px solid color-mix(in oklch, var(--ink-3) 26%, transparent); border-top-color: var(--ink-2);
  pointer-events: none; animation: mp-spin .9s linear infinite, mp-in .2s .15s both;
}
/* over the map's fills the ring sits on a disc of paper */
.mp-view:not(.v-chamber) .mp-loading:not(.err) { background: var(--bg); box-shadow: 0 0 0 8px var(--bg), 0 1px 10px 8px color-mix(in oklch, var(--ink) 14%, transparent); }
.mp-loading.err {
  inset: 0; width: auto; height: auto; margin: 0; border: 0; border-radius: 0; animation: none;
  display: grid; place-items: center; font-size: 13px; color: var(--ink-3);
}
@keyframes mp-spin { to { transform: rotate(1turn); } }
@keyframes mp-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mp-loading { animation-duration: 2.4s, .2s; } }
/* the stamp: the election just chosen, large in the stage's foot while the map turns to it
   (app-6 showStamp); its rule runs while the election loads, then fills */
.mp-stamp {
  position: absolute; left: 14px; bottom: 12px; z-index: 2; pointer-events: none;
  opacity: 0; transform: translateY(6px); transition: opacity .55s ease, transform .55s ease;
}
.mp-stamp.on { opacity: 1; transform: none; transition: opacity .16s ease, transform .3s cubic-bezier(.3,.7,.2,1); }
.mp-stamp-k { font: 500 12px/1.2 var(--sans); color: var(--ink-3); text-shadow: 0 0 3px var(--bg), 0 0 6px var(--bg), 0 0 10px var(--bg); }
.mp-stamp-y {
  display: flex; font: 600 52px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); letter-spacing: -.01em;
  text-shadow: 0 0 4px var(--bg), 0 0 10px var(--bg), 0 0 18px var(--bg); overflow: hidden; padding: 2px 6px 4px; margin: 0 -6px;
}
.mp-stamp-y .c { position: relative; display: inline-block; }
.mp-stamp-y .o { position: absolute; left: 0; top: 0; }
.mp-stamp-y .n { display: inline-block; }
.mp-stamp-r { position: relative; height: 2px; margin-top: 2px; overflow: hidden; background: color-mix(in oklch, var(--ink-3) 22%, transparent); }
.mp-stamp-r i { position: absolute; inset: 0; background: var(--ink-2); transform-origin: left; transition: transform .45s cubic-bezier(.3,.7,.2,1); }
.mp-stamp.wait .mp-stamp-r i { width: 38%; animation: mp-stamp-run 1.1s cubic-bezier(.45,0,.55,1) infinite; transition: none; }
@keyframes mp-stamp-run { from { transform: translateX(-100%); } to { transform: translateX(265%); } }
@media (max-width: 860px) { .mp-stamp { left: 10px; bottom: 8px; } .mp-stamp-y { font-size: 36px; } .mp-stamp-k { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .mp-stamp, .mp-stamp.on { transform: none; } .mp-stamp.wait .mp-stamp-r i { animation-duration: 2.4s; } }

/* overlays on the stage */
/* the cities run the width of the stage, clear of the zoom buttons */
.mp-tl { position: absolute; left: 0; top: 2px; max-width: calc(100% - 56px); z-index: 3; pointer-events: none; }
.mp-tl > * { pointer-events: auto; }
.mp-cities { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; }
.mp-cities button { padding: 4px 0; color: var(--ink-2); text-shadow: 0 0 3px var(--bg), 0 0 6px var(--bg); }
.mp-cities button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-faint); }
.mp-zoom { position: absolute; right: 0; top: 0; display: flex; flex-direction: column; z-index: 3;
  border-radius: 9px; background: var(--sh-sw-plate, var(--surface)); padding: 3px; gap: 3px;
  box-shadow: inset 0 1px 2px oklch(0.3 0.02 60 / 0.16); }
.mp-zoom button {
  width: 34px; height: 32px; display: grid; place-items: center; border-radius: 7px; color: var(--ink-2);
  background: var(--sh-sw-cap, var(--surface));
  box-shadow: inset 0 1px 0 var(--sh-btn-lit, white), 0 1px 1.5px var(--sh-btn-shade, oklch(0.4 0.02 60 / .16)), 0 3px 6px -3px var(--sh-btn-shade, oklch(0.4 0.02 60 / .16));
}
.mp-zoom button:hover { color: var(--ink); }
.mp-zoom button:active { transform: translateY(1px); box-shadow: inset 0 1px 2px var(--sh-btn-press, oklch(0.3 0.02 60 / .2)); }
.mp-filter {
  position: absolute; left: 50%; top: 4px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
  box-shadow: 0 6px 18px -8px oklch(0.3 0.02 60 / 0.3);
}
.mp-filter b { color: var(--ink); font-weight: 600; }
/* the way back from an island, top left, where the cities and the hint have
   stepped aside at an island's zoom (the street credit holds the foot) */
.mp-back { position: absolute; left: 8px; top: 8px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px 6px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-2); box-shadow: 0 6px 18px -8px oklch(0.3 0.02 60 / 0.3); }
.mp-back:hover { color: var(--ink); }
.mp-back[hidden] { display: none; }
.mp-filter button { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 3px 9px; border-radius: 12px; background: color-mix(in oklch, var(--ink) 6%, transparent); }

/* legend: the site's keys */
/* the key is a strip above the stage in every view, title on the left and scale on the
   right, so it never sits on the map; one height for every lens keeps the stage still */
.mp-legend {
  order: -1; flex: none; min-height: 108px; margin-bottom: 10px; padding: 0 0 12px; border-bottom: 1px solid var(--line-2);
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); grid-auto-flow: dense; column-gap: 32px; align-items: start; align-content: start;
}
.mp-legend > * { grid-column: 2; }
.mp-legend > .lg-t, .mp-legend > .lg-note, .mp-legend > .lg-shapes { grid-column: 1; }
.mp-legend > :nth-child(2) { margin-top: 4px; }
.mp-legend > .lg-cats { margin-top: 1px; }
.mp-legend > .lg-shapes { border-top: 0; padding-top: 0; }
.mp-legend > .lg-shapes { margin-top: 6px; }
@media (max-width: 1100px) { .mp-legend { column-gap: 22px; min-height: 124px; } }
.lg-t { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.lg-t select, .mp-lensctl select {
  appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0 14px 0 0; font-weight: 600; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1.4 1.3l3.6 3.4 3.6-3.4' stroke='%23857c74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1px center; cursor: pointer;
  border-bottom: 1px dotted var(--ink-faint);
}
.lg-t button.flip { font-weight: 600; color: var(--ink); border-bottom: 1px dotted var(--ink-faint); }
.lg-t button.flip span { color: var(--ink-3); margin-left: 4px; font-weight: 400; }
.lg-s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.lg-cats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.lg-cats span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-cats i { width: 11px; height: 11px; border-radius: 2px; flex: none; }
.lg-cats b { font-weight: 600; color: var(--ink); }
.lg-ramp { position: relative; height: 10px; border-radius: 2px; margin-top: 10px; }
.lg-ramp .mk { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; box-shadow: 0 0 0 1.5px var(--bg); }
.lg-ticks { position: relative; height: 15px; margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.lg-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.lg-ticks span:first-child { transform: none; }
.lg-ticks span:last-child { transform: translateX(-100%); }
.lg-ends { display: flex; justify-content: space-between; margin-top: 2px; font-size: 12px; font-weight: 600; }
.lg-shapes { display: flex; gap: 12px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); }
.lg-shapes i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); margin-right: 5px; vertical-align: -1px; }
.lg-shapes i.sq { border-radius: 2px; }
.lg-hatch { display: inline-block; width: 12px; height: 9px; margin-right: 5px; vertical-align: -1px; border-radius: 2px;
  background: repeating-linear-gradient(135deg, var(--line) 0 1.5px, var(--line-2) 1.5px 4px); }
.lg-note { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
/* the chamber's arrangement: as seated, or sorted by the lens */
.mp-legend > .lg-seat { grid-column: 1; }
.lg-seat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.lg-seat button { padding: 0 0 2px; color: var(--ink-2); border-bottom: 1.5px solid transparent; }
.lg-seat button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.lg-seat button:hover { color: var(--ink); }
.lg-seat span { font-size: 12px; }
/* the chamber view's chamber: the House or the Senate, a row of its own above the key */
.mp-legend > .lg-house { grid-column: 1 / -1; }
.lg-house { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 9px; font-size: 13px; }
.lg-house button { display: inline-grid; padding: 0 0 3px; color: var(--ink-3); border-bottom: 1.5px solid transparent; }
.lg-house button::after { content: attr(data-t); font-weight: 600; height: 0; visibility: hidden; overflow: hidden; }
.lg-house button, .lg-house button::after { grid-area: 1 / 1; }
.lg-house button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.lg-house button:hover { color: var(--ink); }
.mp-legend > .lg-house + .lg-t + * { margin-top: 0; }
/* the Senate's story: the 76 as one bar, the 39 marked; swatches in its tables and lists */
.sn-bar { position: relative; margin-top: 12px; padding-bottom: 20px; }
.sn-track { position: relative; height: 14px; border-radius: 2px; overflow: hidden; background: var(--line-2); }
.sn-track i { position: absolute; top: 0; bottom: 0; box-shadow: inset -1px 0 0 var(--bg); }
.sn-maj { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 0 1.5px var(--bg); }
.sn-majlab { position: absolute; top: 19px; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.st-p { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.tbl td .sw, .sn-list .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.changes.sn-list button { grid-template-columns: 18px 1fr; padding: 6px 0; }
.sn-list .dt { padding-top: 0; }

/* the street tiles' credit, shown while they are */
.mp-credit { position: absolute; right: 2px; bottom: 2px; z-index: 3; max-width: calc(100% - 8px); text-align: right;
  font-size: 10.5px; line-height: 1.3; color: var(--ink-3); text-shadow: 0 0 3px var(--bg), 0 0 6px var(--bg); }
.mp-credit[hidden] { display: none; }
@media (max-width: 560px) { .mp-credit { white-space: nowrap; } .mp-credit-long { display: none; } }
.mp-credit a { color: inherit; text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 2px; }
.mp-hint { margin-top: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; transition: opacity .3s; pointer-events: none; text-shadow: 0 0 4px var(--bg); }

/* the timeline: an election axis under the view (four rows — federal, NSW, Vic, SA) */
.mp-time { flex: none; position: relative; height: 169px; border-top: 1px solid var(--line); margin-top: 6px; }
.mp-time svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mp-time .yr { font: 400 12px var(--sans); fill: var(--ink-3); cursor: pointer; }
.mp-time .yr.on { font-weight: 600; fill: var(--ink); }
/* the state rows' names: captions, not stops */
.mp-time .yr.row { fill: var(--ink-faint); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; cursor: default; pointer-events: none; }
.mp-time .hit { fill: transparent; cursor: pointer; }
.mp-time .hit:hover + g .yr, .mp-time g.stop:hover .yr { fill: var(--ink); }

/* tooltip */
.mp-tip {
  position: absolute; z-index: 30; left: 0; top: 0; pointer-events: none; min-width: 150px; max-width: 280px;
  padding: 8px 11px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 10px 30px -10px oklch(0.3 0.02 60 / 0.35), 0 2px 6px -2px oklch(0.3 0.02 60 / 0.2);
  font-size: 12.5px; color: var(--ink-2);
}
.mp-tip .tn { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.mp-tip .tn span { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.mp-tip .tv { margin-top: 2px; font-weight: 600; }
.mp-tip .ts { margin-top: 1px; color: var(--ink-3); }

/* ------- the story column ------- */
.st-up { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 10px; }
.st-up:hover { color: var(--ink); }
.st-up svg { flex: none; }
.st-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.st-head h2 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
.st-head .rd-meta { flex-basis: 100%; margin-top: 3px; }
.st-hed { margin-top: 14px; font-family: var(--serif); font-weight: 700; font-size: 32px; line-height: 1.08; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.st-dek { margin-top: 10px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.st-dek b { color: var(--ink); font-weight: 600; }
.st-sec { margin-top: 26px; padding-top: 11px; border-top: 1px solid var(--line); }
.st-sec > h3 { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.st-sec > h3 small { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.st-note { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.st-note b { color: var(--ink-2); font-weight: 600; }
.t-alp { color: var(--alp-text); } .t-lnp { color: var(--lnp-text); } .t-grn { color: var(--grn-text); } .t-onp { color: var(--onp-text); } .t-oth { color: var(--oth-text); }
/* independents wear the map's mauve here; the shell's --ind-text slate reads
   blue against the map fills */
.t-ind { color: var(--m-ind); }

/* hero figures: the Now page's two-party read, a size down */
.hero { margin-top: 18px; }
.hero-read { display: grid; grid-template-columns: 1fr 2px 1fr; align-items: end; column-gap: 14px; }
.hero-side { display: flex; flex-direction: column; min-width: 0; }
.hero-side.b { align-items: flex-start; }
.hero-side.a { align-items: flex-end; }
.hero-name { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hero-name i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.hero-num { font-size: 54px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hero-rule { align-self: stretch; background: var(--ink-faint); margin: 6px 0 4px; }
.mbar { position: relative; height: 54px; margin-top: 12px; }
.mbar .side { position: absolute; top: 0; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.mbar .grid { position: absolute; top: 18px; width: 1px; height: 24px; background: var(--line); }
.mbar .tie { position: absolute; top: 15px; width: 2px; height: 30px; margin-left: -1px; background: var(--ink-faint); }
.mbar .dot { position: absolute; top: 22px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); }
.mbar .bar { position: absolute; top: 25px; height: 8px; border-radius: 2px; opacity: .22; }
.mbar .tick { position: absolute; top: 44px; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
/* the end labels ("20 pts") pin to the column's edges, never past them */
.mbar .tick.edge-l { transform: none; }
.mbar .tick.edge-r { transform: translateX(-100%); }
.mbar .tick.tied { color: var(--ink-2); font-weight: 600; }
.hero-verdict { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-2); text-align: center; }
.hero-verdict b { color: var(--ink); font-weight: 600; }

/* chamber, mini */
.st-chamber { margin-top: 16px; }
.st-chamber canvas { display: block; width: 100%; }
.counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.counts span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.counts i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.counts b { font-weight: 600; color: var(--ink); }

/* rows: the site's ledger rows, compact */
.rows { margin-top: 8px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 44px 42px; align-items: center; column-gap: 10px; min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row .nm { min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.row .nm small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nm .el { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.row .bar { position: relative; height: 8px; background: var(--line-2); border-radius: 2px; }
.row .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.row .bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.row .v { text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row .d { text-align: right; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.more { margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.more:hover { color: var(--ink); border-color: var(--ink-faint); }

/* clickable list rows (seats, booths, states) */
.links { margin-top: 6px; }
.links button { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; width: 100%; min-height: 38px; padding: 4px 0; text-align: left; border-bottom: 1px solid var(--line-2); }
.links button:last-child { border-bottom: 0; }
.links button i { width: 10px; height: 10px; border-radius: 2px; }
.links button .nm { font-size: 14px; font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links button .nm small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.links button b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.links button:hover .nm { text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }

/* states table */
.tbl { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: right; padding: 4px 0 6px; border-bottom: 1px solid var(--ink-faint); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { font-size: 13.5px; text-align: right; padding: 7px 0; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.tbl td:first-child { font-weight: 600; color: var(--ink); }
.tbl tr[data-go] { cursor: pointer; }
.tbl tr[data-go]:hover td:first-child { text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
.tbl .seatbar { display: inline-flex; width: 64px; height: 8px; border-radius: 2px; overflow: hidden; vertical-align: 0; margin-left: 8px; background: var(--line-2); }
.tbl .seatbar i { height: 100%; }

/* flows */
.flow { margin-top: 12px; }
.flow .fh { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink); }
.flow .fh span { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.flow .fb { display: flex; height: 10px; margin-top: 5px; border-radius: 2px; overflow: hidden; gap: 2px; }
.flow .fb i { height: 100%; }
.flow .fl { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.flow .fl b { font-weight: 600; }

/* stacked share bar */
.stack { display: flex; height: 10px; gap: 2px; margin-top: 8px; border-radius: 2px; overflow: hidden; }
.stack i { height: 100%; }
.stackl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.stackl span { display: flex; align-items: center; gap: 6px; }
.stackl i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.stackl b { margin-left: auto; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* SEIFA deciles */
.dec { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 9px 12px; margin-top: 10px; align-items: center; }
.dec .nm { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.dec .nm small { display: block; font-size: 11.5px; color: var(--ink-3); }
.dec .cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.dec .cells i { height: 12px; border-radius: 1.5px; background: var(--line-2); }
.facts { display: grid; grid-template-columns: 74px 1fr; gap: 6px 12px; margin-top: 8px; font-size: 13px; }
.facts dt { color: var(--ink-3); }
.facts dd { color: var(--ink-2); }
.big { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.big .v { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.big .l { font-size: 12.5px; color: var(--ink-3); }

/* history chart */
.hist svg { display: block; width: 100%; margin-top: 8px; overflow: visible; }
.holders { margin-top: 8px; }
.holders div { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.holders div:last-child { border-bottom: 0; }
.holders i { width: 10px; height: 10px; border-radius: 2px; }
.holders small { color: var(--ink-3); margin-left: 4px; }
.holders span { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* changes since the election */
.changes { margin-top: 8px; }
.changes button { display: grid; grid-template-columns: 58px 1fr; gap: 10px; width: 100%; padding: 8px 0; text-align: left; border-bottom: 1px solid var(--line-2); }
.changes button:last-child { border-bottom: 0; }
.changes .dt { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 1px; }
.changes .tx { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.changes .tx b { color: var(--ink); font-weight: 600; }
.changes button:hover .tx b { text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
.act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.act button {
  height: 32px; padding: 0 13px; border-radius: 16px; font-size: 13px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: inset 0 1px 0 var(--sh-btn-lit, white), 0 1px 1.5px var(--sh-btn-shade, oklch(0.4 0.02 60 / .16));
}
.act button:hover { color: var(--ink); }
.st-foot { margin-top: 28px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--ink-3); }

/* ------- the list view ------- */
.mp-list { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ls-bar { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding-bottom: 12px; }
.ls-unit { display: inline-flex; border-bottom: 1px solid var(--line); margin-right: 6px; }
.ls-unit .rd-tab { height: 34px; font-size: 14px; padding: 0 10px; }
.ls-unit .rd-tab:first-child { padding-left: 0; }
.ls-unit .rd-tab:first-child::after { left: 0; }
.ls-sel {
  appearance: none; -webkit-appearance: none; height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1.4 1.3l3.6 3.4 3.6-3.4' stroke='%23857c74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.ls-sel { flex: none; width: auto; max-width: 150px; text-overflow: ellipsis; }
.ls-sel[data-fsel="st"] { max-width: 136px; }
.ls-sel.on { border-color: var(--ink-faint); background-color: color-mix(in oklch, var(--ink) 4%, var(--bg)); }
.ls-chip { flex: none; height: 34px; padding: 0 12px; border: 1px solid var(--ink-faint); border-radius: 8px; background: color-mix(in oklch, var(--ink) 4%, var(--bg)); font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.ls-chip:hover { border-color: var(--ink-3); }
.ls-count { margin-left: auto; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.ls-count b { color: var(--ink); font-weight: 600; }
.ls-csv { height: 34px; padding: 0 13px; border-radius: 17px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface);
  box-shadow: inset 0 1px 0 var(--sh-btn-lit, white), 0 1px 1.5px var(--sh-btn-shade, oklch(0.4 0.02 60 / .16)), 0 3px 6px -3px var(--sh-btn-shade, oklch(0.4 0.02 60 / .16)); display: inline-flex; align-items: center; gap: 7px; }
.ls-csv:hover { color: var(--ink); }
.ls-grid { position: relative; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.ls-head { position: sticky; top: 0; z-index: 2; display: grid; align-items: end; padding: 10px 0 6px; background: var(--bg); border-bottom: 1px solid var(--ink-faint); }
.ls-head button { font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: left; white-space: nowrap; padding: 0 8px 0 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ls-head button.r { text-align: right; padding: 0 0 0 8px; }
.ls-head button:hover { color: var(--ink); }
.ls-head button[aria-sort] { color: var(--ink); }
.ls-head button .ar { font-size: 9px; margin-left: 3px; color: var(--ink-faint); }
.ls-head button[aria-sort] .ar { color: var(--ink); }
.ls-row { position: absolute; left: 0; right: 0; display: grid; align-items: center; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.ls-row:hover { background: color-mix(in oklch, var(--ink) 3.5%, transparent); }
.ls-row.on { background: color-mix(in oklch, var(--ink) 6%, transparent); }
.ls-row > div { min-width: 0; padding-right: 8px; }
.ls-row > div.r { text-align: right; padding: 0 0 0 8px; font-variant-numeric: tabular-nums; }
/* the cells are inline <span>s, so these need blockify to ever truncate */
.ls-row .c1 { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* polling-place names run to a second line rather than off the column;
   ROW_H("booths") in app-5-list.js pairs with this */
.ls-row.booths .c1 { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ls-row .c2 { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-row .fig { font-size: 14px; font-weight: 600; white-space: nowrap; }
.ls-row .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.ls-row .lv { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.ls-row .lv i { display: block; height: 8px; border-radius: 2px; }
.ls-row .lv span { width: 34px; text-align: right; font-weight: 600; font-size: 13.5px; }
.ls-empty { padding: 30px 0; text-align: center; font-size: 14px; color: var(--ink-3); }

/* ------- notes section ------- */
.mp-notes { padding-top: 0; padding-bottom: 30px; }
.mp-notes > h2 { padding-top: 14px; border-top: 2px solid var(--ink); }
.mp-notes h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.005em; }
.mp-notes .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 16px; }
.mp-notes h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.mp-notes p { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin-bottom: 10px; text-wrap: pretty; }
.mp-notes a { color: var(--ink-2); text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--ink-2) 40%, transparent); text-underline-offset: 2px; }

/* ------- tablet and phone ------- */
@media (max-width: 1100px) {
  .mp-fig { grid-template-columns: 300px minmax(0, 1fr); column-gap: 28px; }
  .mp-search { width: 240px; }
  .st-hed { font-size: 28px; }
  .hero-num { font-size: 46px; }
}
@media (max-width: 860px) {
  :root { --pin-top: 0px; }
  .mp-sec { padding-top: 14px; }
  .mp-lensrow { flex-wrap: wrap; }
  .mp-search { order: -1; width: 100%; margin: 0 0 10px; }
  /* under 16px iOS zooms the page to a focused field — keep the page at 1x */
  .mp-search input { font-size: 16px; }
  .mp-fig { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
  /* the stage keeps one height whatever the lens: the key below it grows the view, never
     shrinks the figure; tall enough for the chamber to fill the width (its 19.1 x 22.8 box,
     plus the bloc labels above and the majority label below) */
  .mp-view { position: relative; top: 0; grid-column: 1; grid-row: 1; height: auto; min-height: 0; max-height: none; container-type: inline-size; }
  .mp-stage { flex: none; height: min(68svh, 560px); height: clamp(320px, calc(1.194 * 100cqw + 76px), min(68svh, 620px)); }
  .mp-story { grid-column: 1; grid-row: 2; margin-top: 18px; }
  .mp-views { margin-bottom: 0; }
  .mp-notes .cols { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mp-cities { display: none; }
  .mp-legend { order: 0; display: block; min-height: 0; margin: 6px 0 0; padding: 8px 0 2px; border-bottom: 0; }
  .mp-hint { display: none; }
}
@media (max-width: 560px) {
  .rd-eyebrow { gap: 2px 8px; align-items: center; }
  .rd-eyebrow .rd-title { order: 1; }
  .rd-eyebrow .rd-grow { order: 2; }
  .mp-views { order: 3; margin: 0; }
  .mp-views .tw { display: none; }
  .mp-views .rd-tab { padding: 0 9px; height: 38px; }
  .mp-views .rd-tab svg { margin: 0; width: 18px; height: 18px; }
  .rd-eyebrow .rd-meta { order: 4; flex-basis: 100%; }
  .mp-lenses .rd-tab { padding: 0 10px; font-size: 14.5px; }
  .mp-time { height: 148px; }
  .st-hed { font-size: 27px; }
  .hero-num { font-size: 44px; }
  .mp-legend .lg-s, .mp-legend .lg-note { display: none; }
  .mp-legend .lg-cats { gap: 3px 10px; font-size: 12px; }
  .ls-csv span { display: none; }
  .ls-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
  .ls-bar::-webkit-scrollbar { display: none; }
  .ls-count { margin-left: 6px; }
}
@media (prefers-reduced-motion: reduce) { .rd-tab::after { transition: none; } }

/* ------- distributions: the column-head sparklines and the chart above the list ------- */
.dist { margin-top: 10px; cursor: crosshair; user-select: none; -webkit-user-select: none; touch-action: none; }
.dist.compact { margin-top: 12px; }
.dist rect[data-bin] { transition: opacity .15s; }
.ls-dist { flex: none; margin: 0 0 12px; padding: 10px 0 2px; border-top: 1px solid var(--line-2); }
.ls-dist-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink-3); }
.ls-dist-h b { color: var(--ink); font-weight: 600; }
.ls-dist-h button { margin-left: auto; width: 26px; height: 26px; border-radius: 13px; color: var(--ink-3); font-size: 12px; }
.ls-dist-h button:hover { color: var(--ink); background: color-mix(in oklch, var(--ink) 6%, transparent); }
.ls-hc { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.ls-hc.r { align-items: flex-end; }
.ls-spark { display: inline-flex; height: 15px; padding: 1px 2px; border-radius: 3px; cursor: pointer; opacity: .78; outline-offset: 2px; }
.ls-spark:hover, .ls-hc.dist-on .ls-spark { opacity: 1; background: color-mix(in oklch, var(--ink) 6%, transparent); }
.ls-hc.dist-on > button { color: var(--ink); }
.lg-hist { display: flex; align-items: flex-end; gap: 1px; height: 22px; margin-top: 9px; }
.lg-hist i { flex: 1; min-height: 1px; border-radius: 1px 1px 0 0; }
.lg-hist + .lg-ramp { margin-top: 3px; }
