/* The live page's own additions (tools/build_province_live.js). The board's tokens only. */

/* ── Brands: Mainstreet (gold SVG, links home) and Y Media, left of the title; gold rule ── */
:root{--brand-gold:#C9A24B}
:root.light{--brand-gold:#A9853A}
header{border-bottom:2px solid var(--brand-gold)}
.hd-brands{display:flex;align-items:center;gap:12px;flex-shrink:0;padding-right:14px;border-right:1px solid var(--border);line-height:0}
.hd-brand{display:flex;align-items:center;line-height:0}
.hd-logo{height:30px;width:auto;display:block}
.hd-ym{display:flex;align-items:center;line-height:0}
.hd-ym img{height:28px;width:auto;display:block}
.hd-ym .ym-light{display:none}
:root.light .hd-ym .ym-dark{display:none}
:root.light .hd-ym .ym-light{display:block}
@media (max-width:900px){ .hd-logo{height:24px} .hd-ym img{height:22px} .hd-brands{gap:9px;padding-right:10px} }
/* A phone: each brand's mark alone, clipped from the same picture. */
@media (max-width:620px){
  .hd-brand{width:26px;overflow:hidden} .hd-logo{height:25px;max-width:none;flex-shrink:0}
  .hd-ym img{width:24px;height:24px;object-fit:cover;object-position:right center}
  .hd-brands{border-right:0;padding-right:0}
  body.in-detail .hd-brands{display:none}
}

/* ── The needle panel's third column: how the vote is being counted ── */
.nd-types{flex:0 1 380px;min-width:250px;display:flex;flex-direction:column;gap:4px}
/* ONE LINE PER ROW (Robert, 22 Oct: "a massive gap between the projected outcome band and the map").
   The ballots-out note used to drop under the row, so for part of the night each row was two lines,
   and the panel held that height all night. It now sits at the end of the row. */
.nt-r{display:grid;grid-template-columns:104px minmax(28px,1fr) auto auto;column-gap:7px;align-items:center;font-size:12.5px;color:var(--text)}
.nt-t{font-weight:700;white-space:nowrap}
.nt-m{display:block;height:6px;border-radius:3px;background:var(--blank);overflow:hidden}
.nt-m i{display:block;height:100%;background:var(--muted);transition:width .6s}
.nt-in{font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}
.nt-n{font-size:10.5px;color:var(--faint);white-space:nowrap;text-align:right}
.nt-gap{font-size:11.5px;color:var(--muted);margin-top:2px;line-height:1.35}
.nt-gap b{font-weight:700}
.nt-gap span{color:var(--faint)}
/* The outcome list (NDP Majority 96% · Conservative Majority 2% ...) fits on one line at 440px. */
@media (min-width:1101px){ .nd-out{flex-basis:440px} }
@media (max-width:1100px){ .nd{flex-wrap:wrap;row-gap:10px} .nd-types{flex-basis:100%;max-width:520px} }
@media (max-width:760px){ .nd-types{display:none !important} }
/* THE PANEL NEVER CHANGES HEIGHT (Robert, 21 Oct: "the tiles are still growing and
   shrinking in size, they shouldn't be changing at all"). Its lines come and go with the
   count (a second line under each type, the advance gap, the outcome list wrapping), and
   every change moved the tile panel below it, 437-485px at 1536 wide. Fixed at a few px
   over the tallest state seen across the 2024 replay night: 175px from 1101px wide up,
   287px from 761 to 1100 (the third column wraps under). Phones: see below. */
/* 22 Oct: with every counting row on one line the tallest state is 142px from 1101px up and 250px
   from 761 to 1100 (measured every 4 minutes of the 2024 replay at 1280/1536/1920 and 1000 wide).
   The panel was 180 / 292; the map gets the difference. */
@media (min-width:1101px){ #replay-bar{box-sizing:border-box;height:146px;overflow:hidden} }
@media (min-width:761px) and (max-width:1100px){ #replay-bar{box-sizing:border-box;height:254px;overflow:hidden} }
/* The rest of the tiles' stillness (22 Oct): on a phone the panel ran 224-246px over the 2024
   replay night and moved the tiles with it, and the seat tracker grows 98 -> 100px when results
   arrive. Each is held at its tallest from the start. A minimum, not a height, so nothing is
   ever cut off; the tiles also ignore any change under 24px (app.js, LIVE PAGE). */
@media (max-width:760px){ #replay-bar{box-sizing:border-box;min-height:250px} }
@media (min-width:761px){ #tracker{box-sizing:border-box;min-height:100px} }

/* The packed overview runs edge to edge, so the board's hover zoom (scale 1.05) pushed
   the tiles at the edges out of the panel and the overview grew scrollbars (Robert,
   20 Oct). The border alone marks the hovered tile here, and the panel never scrolls on
   a desktop. #map-view #overview outranks the board's own #overview rule. */
#geo-grid .region-tile:hover{transform:none}
@media (min-width:761px){ #map-view #overview{overflow:hidden auto} }
/* THE REGION'S NAME SITS ON TOP OF ITS TILE (Robert, 22 Oct: "the bottom labels are still too
   low"). Under the map, the bottom row's names were the first thing a short window or the
   taskbar cut off. On top they are always in view. A window too short for the panel's 380px
   minimum now scrolls the panel (overflow-y above) instead of hiding the bottom row. */
#geo-grid .tile-label{order:-1;padding:4px 2px 2px}

/* PROJECTED SEATS / POPULAR VOTE (22 Oct). The column turns between the two (live.js, VOTE_VIEW);
   the two labels in its header say which is showing and switch it by hand. */
/* A boxed two-way switch (Robert, 24 Oct: "more obvious, put a box around it"). Kept to the header's
   line height plus its border, so the panel's fixed height still holds (measured). */
.nd-tab{all:unset;cursor:pointer;color:var(--muted);padding:1px 9px;line-height:13px;border:1px solid var(--border);transition:color .2s,background .2s}
.nd-tab:first-of-type{border-radius:4px 0 0 4px}
.nd-tab:last-of-type{border-radius:0 4px 4px 0;border-left:0;margin-right:10px}
.nd-tab.on{color:var(--text);background:var(--blank)}
.nd-tab:hover{color:var(--text)}
.nd-tab:focus-visible{outline:1px solid var(--accent);outline-offset:2px}
.nd-vrows,.nd-sub-v{display:none}
.nd-seats.vote .nd-vrows{display:block}
.nd-seats.vote .nd-rows,.nd-seats.vote .nd-sub-s{display:none}
@media (min-width:761px){ .nd-seats.vote .nd-sub-v{display:inline} }
.nd-seats .nd-rows,.nd-seats .nd-vrows{animation:nd-in .45s ease}
@keyframes nd-in{from{opacity:0}to{opacity:1}}
/* Four rows (Other too) in the seat view's 85px: no majority label to leave room for. */
.nd-vrows .nd-plot{--vw:118px;padding-top:0}
.nd-vrows .nd-lines{top:0}
.nd-vrows .nd-row{height:17.75px}
@media (max-width:760px){ .nd-vrows .nd-plot{--vw:100px} }

/* The lead in HOW IT WAS CAST is the party's colour and the margin (22 Oct): a bigger swatch,
   the number at full weight. */
.pb-cast-lead i{width:11px !important;height:11px !important}
.pb-cast-lead span{font-variant-numeric:tabular-nums}

/* THE RIDING CARD ON A WIDE SCREEN (22 Oct): two columns, full size (app.js, WIDE_CARD_JS). The lead
   column is a swatch and a margin now, so HOW IT WAS CAST fits the right-hand column. */
/* 24 Oct: type and boxes only. */
.pb-cast-g{grid-template-columns:minmax(0,1fr) 120px !important}
/* .wide is set by app.js when the map area is at least 1100px wide; #detail-map-area outranks the
   board's own #party-box rule, which comes later in the page. */
/* One column (24 Oct). app.js wideCardOn() sets its zoom: as large as the tallest card allows (CARD_TALL). */
#detail-map-area #party-box.wide{width:531px}
.pb-split{display:grid;grid-template-columns:minmax(0,1fr) 300px;column-gap:18px;align-items:start}
.pb-side > :first-child{margin-top:0}
.pb-side .pb-cast:first-child{padding-top:0;border-top:0}

/* SIX VOTE CELLS ON ONE LINE (24 Oct: CentreBC, OneBC and Other have their own). When the row
   overflows, app.js's fitOneLine sets .tight: the name sits small over the share and the count
   goes to the tooltip. Two lines either way, so the panel never changes height. */
#vote-row.tight{gap:10px}
#vote-row.tight .vnum-top{flex-direction:column;align-items:flex-start;gap:0}
#vote-row.tight .vnum-lbl{font-size:11px;line-height:1.25}
#vote-row.tight .vnum-pct{line-height:1.25}
#vote-row.tight .vnum-cnt{display:none}

/* THE NEEDLE WAITS FOR THE ELECTION-DAY COUNT (24 Oct 2026, needle_types.js E_GATE): a tag, then why. */
.nd-big .nd-eday{display:inline-block;background:#C8102E;color:#fff;font-size:12px;font-weight:800;letter-spacing:.12em;padding:4px 8px;border-radius:3px;margin:0 0 4px}
.nd-big .nd-eday + .nd-wait{display:block;font-size:12px;line-height:1.35}

/* THE BALLOT BEFORE A RIDING REPORTS (24 Oct 2026, app.js ballotCard): party, name, MLA tag, 0 votes. */
.pb-ballot{margin-top:8px}
.pb-ballot-h{display:flex;justify-content:space-between;font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--faint);padding:0 0 4px;border-bottom:1px solid var(--line)}
.pb-ballot-r{display:grid;grid-template-columns:4px auto minmax(0,1fr) auto;align-items:center;column-gap:8px;padding:7px 0;border-bottom:1px solid var(--line);font-size:14px}
.pb-ballot-r i{width:4px;height:18px;border-radius:2px}
.pb-ballot-p{font-weight:800;white-space:nowrap}
.pb-ballot-n{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.pb-ballot-v{font-variant-numeric:tabular-nums;color:var(--muted)}
.pb-ballot-mla{display:inline-block;margin-left:7px;font-size:10px;font-weight:800;letter-spacing:.08em;padding:1px 5px;border-radius:3px;border:1px solid var(--muted);color:var(--muted);vertical-align:1px}

/* HOW IT WAS CAST ON ONE LINE in the wide card (24 Oct 2026): three cells, type and boxes, the meter
   under the count. It was the card's tallest block (97px of a 517px card); one line lets the card zoom
   larger (app.js CARD_TALL). */
#detail-map-area #party-box.wide .pb-cast{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:16px;align-items:start}
#detail-map-area #party-box.wide .pb-cast-h{grid-column:1/-1;display:block}
#detail-map-area #party-box.wide .pb-cast-h span:last-child{display:none}
#detail-map-area #party-box.wide .pb-cast-r{grid-template-columns:auto auto !important;justify-content:space-between;column-gap:6px}
