/* Public live count. Five token groups (colour roles, 4 px spacing, four type sizes, radius, two shadows):
   every value below comes from them. Phones first; tables turn into cards below their own breakpoint. */
:root {
  /* Gambia MarbleCount brand: blue #123f87 (site colour), navy #010547 (logo circle), flag red/blue/green */
  --bg: #f4f5f8; --surface: #ffffff; --text: #0d1230; --muted: #5a6175; --line: #e2e5ec; --grid: #edf0f5;
  --primary: #123f87; --primary-2: #123f87; --primary-soft: #e8eef8; --navy: #010547; --danger: #b42318; --danger-soft: #fef3f2;
  --flag-red: #e00411; --flag-blue: #0025c1; --flag-green: #028419;
  --f1: 12px; --f2: 14px; --f3: 20px; --f4: 32px;
  --r-s: 4px; --r-m: 8px; --r-l: 16px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .06); --sh-2: 0 8px 24px rgba(16, 24, 40, .18);
  --pad: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--f2); line-height: 1.45;
}
@media (min-width: 640px) { :root { --pad: 24px; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--primary-2); }
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.muted { color: var(--muted); }
.red { color: var(--danger); }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: var(--f3); }
.num, .tab { font-variant-numeric: tabular-nums; }

/* ---------- header: logo, live status, flag stripe ---------- */
.top { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
.brand { display: block; flex: none; line-height: 0; border-radius: var(--r-s); }
.brand img { height: 40px; width: auto; }
@media (min-width: 640px) { .brand img { height: 52px; } }
.status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: var(--f1); min-width: 0; text-align: right; }
.live-row { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.flag { height: 8px; background: linear-gradient(to bottom, var(--flag-red) 0 2px, #fff 2px 3px, var(--flag-blue) 3px 5px, #fff 5px 6px, var(--flag-green) 6px 8px); }
.page-title { font-size: var(--f3); line-height: 1.2; margin: 8px 0 0; color: var(--navy); letter-spacing: -.01em; }
@media (min-width: 640px) { .page-title { font-size: var(--f4); } }
.live { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: live 2s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.badge { border: 1px solid rgba(255, 255, 255, .7); color: #fff; font-weight: 700; border-radius: var(--r-s); padding: 0 8px; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; line-height: 18px; }
/* phones: the logo is wide, so two rows: logo + sound + refresh, then live time + "Unofficial" (owner 2026-12-05 logo) */
@media (max-width: 559px) {
  .top-in { display: grid; grid-template-columns: 8px 1fr auto auto; grid-template-areas: "brand brand sound reload" "dot time badge badge"; column-gap: 8px; row-gap: 6px; align-items: center; }
  .status, .live-row { display: contents; }
  .brand { grid-area: brand; justify-self: start; }
  .brand img { height: 36px; }
  #soundBtn { grid-area: sound; } #reload { grid-area: reload; }
  .top-in .live { grid-area: dot; } #updated { grid-area: time; font-size: var(--f1); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-in .badge { grid-area: badge; justify-self: end; }
}
.crumbs { font-size: var(--f2); margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--muted); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--pad); margin: 16px 0; box-shadow: var(--sh-1); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h .ht { display: flex; align-items: center; gap: 8px; min-width: 0; }
.grid2 { display: grid; gap: 16px; margin: 16px 0; }
.grid2 > .card { margin: 0; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; margin: 0; }
.help { flex: none; position: relative; overflow: hidden; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: var(--f1); font-weight: 700; cursor: pointer; padding: 0; line-height: 1; }
.help:hover { border-color: var(--muted); color: var(--text); }
@media (pointer: coarse) { .help::after { content: ""; position: absolute; inset: -12px; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-m); font-size: var(--f2); font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: background-color .15s ease-out, border-color .15s ease-out; white-space: nowrap; }
@media (pointer: coarse) { .btn { min-height: 44px; } }
.btn.ghost { border-color: var(--primary-2); color: var(--primary-2); background: var(--surface); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: var(--f1); }

/* ---------- the race ---------- */
.eyebrow { font-size: var(--f1); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.leader { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; border-left: 4px solid var(--c); padding-left: 12px; margin: 12px 0; }
.leader .pill { display: inline-block; font-size: var(--f1); font-weight: 700; color: var(--primary-2); background: var(--primary-soft); border-radius: var(--r-s); padding: 0 8px; margin-bottom: 4px; }
.leader .nm { display: block; font-size: var(--f3); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.leader .pt { display: block; color: var(--muted); }
.leader .big { font-size: var(--f4); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; white-space: nowrap; }
.leader .vv { display: block; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; }
.ahead { margin: 0 0 12px; }
.ahead b { font-variant-numeric: tabular-nums; }
.racebar { display: flex; gap: 2px; height: 20px; margin: 8px 0 4px; }
.racebar i { display: block; height: 100%; min-width: 2px; }
.racebar i:first-child { border-radius: var(--r-s) 0 0 var(--r-s); }
.racebar i:last-child { border-radius: 0 var(--r-s) var(--r-s) 0; }
.racebar.empty { background: var(--grid); border-radius: var(--r-s); padding: 0; }
.rb-lab { display: flex; justify-content: space-between; gap: 8px; font-size: var(--f1); color: var(--muted); }
.cands { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.cand { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-areas: "k who pc" ". track num"; gap: 4px 12px; align-items: center; }
.cand .k { grid-area: k; width: 12px; height: 12px; border-radius: 2px; }
.cand .who { grid-area: who; min-width: 0; }
.cand .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand .who span { display: block; font-size: var(--f1); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand .track { grid-area: track; height: 12px; background: var(--grid); border-radius: 0 var(--r-s) var(--r-s) 0; }
.cand .fill { display: block; height: 100%; border-radius: 0 var(--r-s) var(--r-s) 0; min-width: 2px; transition: width .25s ease-out; }
.cand .num { grid-area: num; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cand .pc { grid-area: pc; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) {
  .cand { grid-template-columns: 12px minmax(160px, 240px) minmax(0, 1fr) 96px 56px; grid-template-areas: "k who track num pc"; }
}
.counted { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.progress { height: 8px; background: var(--grid); border-radius: var(--r-s); overflow: hidden; grid-column: 1 / -1; }
.progress i { display: block; height: 100%; background: var(--primary-2); border-radius: 0 var(--r-s) var(--r-s) 0; transition: width .25s ease-out; }
.progress i.red { background: var(--danger); }

/* ---------- headline figures ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; box-shadow: var(--sh-1); min-width: 0; }
.kpi .kh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k { font-size: var(--f1); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; min-width: 0; }
.kpi .v { font-size: var(--f3); font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; }
@media (min-width: 900px) { .kpi .v { font-size: var(--f4); } }
.kpi .s { font-size: var(--f1); color: var(--muted); }

/* ---------- red: more votes than voters ---------- */
.alarm { border-color: var(--danger); background: var(--danger-soft); }
.alarm h2 { color: var(--danger); font-size: var(--f2); }
.alarm ul { margin: 8px 0 0; padding-left: 20px; }
.alarm li { margin: 4px 0; }
.alarm b { color: var(--danger); font-variant-numeric: tabular-nums; }

/* ---------- charts ---------- */
.chart { min-height: 220px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .tick { fill: var(--muted); font-size: var(--f1); }
.chart .grid { stroke: var(--grid); }
.chart .axis { stroke: var(--line); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: #9aa3ad; stroke-dasharray: 3 3; }
.chart .endlab { fill: var(--text); font-size: var(--f1); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--f1); margin: 12px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.pale { background: var(--muted); opacity: .45; }
.legend i.nores { background: var(--grid); border: 1px dashed #b8c0c8; }
.legend.lt { margin: 0 0 12px; }

/* who leads where: schematic, west to east along the river */
.tmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.treg { border: 1px solid var(--line); border-radius: var(--r-m); padding: 8px; background: #fafbfb; min-width: 0; }
.trn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--f1); font-weight: 700; color: var(--text); text-decoration: none; margin-bottom: 8px; line-height: 1.3; }
.trn:hover { text-decoration: underline; }
.tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.tile { width: 28px; height: 28px; border-radius: var(--r-s); background: var(--c); transition: transform .15s ease-out; }
.tile.part { opacity: .55; }
.tile.none { background: var(--grid); border: 1px dashed #b8c0c8; }
.tile:hover { transform: scale(1.12); }
@media (pointer: coarse) { .tile { width: 40px; height: 40px; } }
.trs { font-size: var(--f1); color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.tmap.one { grid-template-columns: 1fr; }
.tmap.one .tile { width: 40px; height: 40px; }
@media (min-width: 900px) {
  .tmap:not(.one) { grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
    grid-template-areas: "ker ker ker ker jan bas" "ban kan bri man jan bas"; }
  .a-ban { grid-area: ban; } .a-kan { grid-area: kan; } .a-bri { grid-area: bri; } .a-ker { grid-area: ker; }
  .a-man { grid-area: man; } .a-jan { grid-area: jan; } .a-bas { grid-area: bas; }
  .a-ker { border-bottom: 2px solid #9cc3e6; } /* the river runs between North Bank and the south */
}

/* labelled bars */
.brows { display: grid; gap: 4px; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "bl bv" "bt bt"; gap: 4px 12px; align-items: center; color: var(--text); text-decoration: none; padding: 4px; border-radius: var(--r-s); }
a.brow[href]:hover { background: #f6f8f9; }
.brow .bl { grid-area: bl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) { .brow { grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) 64px; grid-template-areas: "bl bt bv"; } }
.brow .bt { grid-area: bt; height: 12px; background: var(--grid); border-radius: 0 var(--r-s) var(--r-s) 0; }
.brow .bt i { display: block; height: 100%; background: var(--primary-2); border-radius: 0 var(--r-s) var(--r-s) 0; min-width: 2px; }
.brow .bt i.red { background: var(--danger); }
.brow .bv { grid-area: bv; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- region rows ---------- */
.rlist { display: grid; gap: 8px; }
.rrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); color: var(--text); text-decoration: none; transition: border-color .15s ease-out, box-shadow .15s ease-out; }
.rrow:hover { border-color: var(--primary-2); box-shadow: 0 0 0 2px var(--primary-soft); }
.rrow .rn { font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .rl { text-align: right; white-space: nowrap; }
.rrow .seg { grid-column: 1 / -1; }
.rrow .rs { grid-column: 1 / -1; font-size: var(--f1); color: var(--muted); }
@media (min-width: 900px) {
  .rrow { grid-template-columns: 240px minmax(0, 1fr) 160px 240px; }
  .rrow .seg, .rrow .rs { grid-column: auto; }
  .rrow .seg { order: 2; } .rrow .rl { order: 3; text-align: left; } .rrow .rs { order: 4; text-align: right; }
}
.seg { display: flex; gap: 2px; height: 12px; }
.seg i { display: block; height: 100%; }
.seg i:first-child { border-radius: var(--r-s) 0 0 var(--r-s); }
.seg i:last-child { border-radius: 0 var(--r-s) var(--r-s) 0; }
.seg.empty { background: var(--grid); border-radius: var(--r-s); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- lists: table on wide screens, cards below ---------- */
.tools { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
@media (min-width: 640px) { .tools { width: auto; } }
.tools input, .tools select { min-height: 40px; border: 1px solid var(--line); border-radius: var(--r-m); padding: 0 12px; font: inherit; background: var(--surface); color: var(--text); }
.tools input { flex: 1 1 180px; min-width: 0; }
@media (pointer: coarse) { .tools input, .tools select { min-height: 44px; font-size: 16px; } }
.tbl-wrap { overflow-x: auto; }
.wide-only { display: none !important; }
@media (min-width: 1000px) { .wide-only { display: block !important; } .narrow-only { display: none !important; } }
.more { display: flex; justify-content: center; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
th { font-size: var(--f1); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; background: var(--surface); }
th i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
tbody tr { transition: background-color .15s ease-out; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6f8f9; }
td .sm { display: block; font-size: var(--f1); color: var(--muted); }
td.over, td.over b, .over-v { color: var(--danger); font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ccard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); color: var(--text); text-decoration: none; background: var(--surface); min-width: 0; }
a.ccard:hover { border-color: var(--primary-2); }
.ccard .cn { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .cn .sm { display: block; font-weight: 400; font-size: var(--f1); color: var(--muted); }
.ccard .seg, .ccard .cl { grid-column: 1 / -1; }
.ccard .cl { font-size: var(--f1); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.count-note { font-size: var(--f1); color: var(--muted); margin: 8px 0 0; }

/* stream turnout list */
.slist { display: grid; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.srow:last-child { border-bottom: 0; }
.srow .sn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.srow .sn .sm { display: block; font-weight: 400; font-size: var(--f1); color: var(--muted); }
.srow .sv { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.srow .sv .sm { display: block; font-size: var(--f1); color: var(--muted); }
.srow .progress { grid-column: 1 / -1; }

/* ---------- station dialog (bottom sheet on phones) ---------- */
dialog { border: 0; border-radius: var(--r-l); padding: 0; width: min(96vw, 860px); max-height: 92vh; box-shadow: var(--sh-2); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
@media (max-width: 639px) {
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-l) var(--r-l) 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
.dlg-head { position: sticky; top: 0; z-index: 1; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: var(--f2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x { border: 0; background: transparent; font-size: var(--f3); cursor: pointer; width: 40px; height: 40px; border-radius: var(--r-m); flex: none; color: var(--text); }
.x:hover { background: var(--grid); }
#stBody { padding: 16px; }
#stBody p { margin: 0 0 8px; }
#stBody h3 { font-size: var(--f1); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; }
.ev { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; margin: 12px 0; }
.ev img, .ev video { width: 100%; max-height: 520px; object-fit: contain; background: #000; border-radius: var(--r-s); display: block; margin-top: 8px; }
.ev .show { width: 100%; margin-top: 8px; padding: 24px; border: 1px dashed #b8c0c8; border-radius: var(--r-s); background: #f6f8f9; font: inherit; font-weight: 700; color: var(--primary-2); cursor: pointer; }
.meta { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 12px; font-size: var(--f1); margin: 12px 0 0; }
@media (min-width: 640px) { .meta { grid-template-columns: 150px minmax(0, 1fr); } }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ok-badge { display: inline-block; background: #e7f6ed; color: #12663a; border-radius: var(--r-s); padding: 0 8px; font-weight: 700; }

/* ---------- check a file, footnote ---------- */
.verify .btn { margin-top: 0; }
.verify-out { font-weight: 700; margin-top: 12px; }
.verify-out:empty { display: none; }
.verify-out.good { color: #12663a; }
.verify-out.bad { color: var(--danger); }
.note { color: var(--muted); font-size: var(--f1); margin: 0; }
.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 32px; }
.foot-in { display: grid; gap: 8px; padding-top: 24px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.foot img { height: 40px; width: auto; margin-bottom: 4px; }
.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ---------- opening: the logo, then a flag-coloured bar fills while the count loads ---------- */
.splash { position: fixed; inset: 0; z-index: 100; background: var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; transition: opacity .3s ease-out, visibility .3s; }
.splash img { width: min(300px, 72vw); height: auto; animation: rise .45s ease-out both; }
.splash-bar { width: min(200px, 48vw); height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--flag-red) 0 33.3%, var(--flag-blue) 33.3% 66.6%, var(--flag-green) 66.6%); animation: fill .9s .15s ease-in-out forwards; }
.splash.out { opacity: 0; visibility: hidden; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fill { to { width: 100%; } }

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: #fff; padding: 8px 12px; border-radius: var(--r-m); font-size: var(--f1); max-width: 300px; line-height: 1.4; box-shadow: var(--sh-2); }
.tip b { font-variant-numeric: tabular-nums; }
.tip .th { font-weight: 700; margin-bottom: 4px; }
.tip .tr { display: grid; grid-template-columns: 10px 48px 48px auto; gap: 8px; align-items: center; }
.tip .tr i, .tip .k { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.tip .k { margin-right: 4px; vertical-align: -1px; }
.tip .tr b { text-align: right; }
.tip .tv { color: #c3c9cf; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- loading ---------- */
.skel { background: linear-gradient(90deg, var(--grid) 25%, #f6f7f8 37%, var(--grid) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--r-l); height: 160px; margin: 16px 0; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .splash-bar i { width: 100%; }
}

/* station sheet: names wrap so every column fits a phone */
#stBody td:first-child { white-space: normal; }
#stBody th, #stBody td { padding: 8px 4px; }
.btn .ico { width: 16px; height: 16px; }
.alarm h2 { display: flex; align-items: center; gap: 8px; }
.alarm h2 .ico { width: 20px; height: 20px; }
.ok-badge { display: inline-flex; align-items: center; gap: 4px; }
.verify-out { display: flex; align-items: center; gap: 8px; }
.verify-out:empty { display: none; }

/* ---------- race card: Bars | Round, rows that move (race.js) ---------- */
.race-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg-ctl { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.seg-ctl button { min-height: 32px; padding: 0 16px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: var(--f1); font-weight: 700; color: var(--muted); cursor: pointer; }
.seg-ctl button[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: var(--sh-1); }
@media (pointer: coarse) { .seg-ctl button { min-height: 40px; } }
.race-body[data-view="bars"] .ring-wrap { display: none; }
.race-body[data-view="round"] .racebar-wrap, .race-body[data-view="round"] .cand .track { display: none; }
.race-body[data-view="round"] { display: grid; gap: 16px; margin-top: 8px; }
.race-body[data-view="round"] .cands { margin: 0; }
.race-body[data-view="round"] .cand { grid-template-columns: 12px minmax(0, 1fr) auto 56px; grid-template-areas: "k who num pc"; }
@media (min-width: 720px) { .race-body[data-view="round"] { grid-template-columns: 260px minmax(0, 1fr); align-items: center; gap: 32px; } }
.ring-wrap { position: relative; width: min(260px, 72vw); margin: 0 auto; }
.ring { display: block; width: 100%; height: auto; }
.ring circle { fill: none; }
.ring-bg { stroke: var(--grid); }
.ring-seg { transition: stroke-dasharray .7s cubic-bezier(.2, .8, .2, 1), stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1); }
.ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.ring-c b { font-size: var(--f4); line-height: 1; font-variant-numeric: tabular-nums; color: var(--navy); }
.ring-c span { margin-top: 4px; font-size: var(--f1); font-weight: 600; color: var(--muted); }
.cand { position: relative; background: var(--surface); }
.cand .who b { font-size: 16px; }
.cand.lead .pc { color: var(--navy); }
@media (min-width: 720px) { .cand .track { height: 16px; } }

/* ---------- find a polling station (finder.js) + every stream in a constituency ---------- */
.fq { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-m); padding: 0 12px; font: inherit; font-size: 16px; background: var(--surface); color: var(--text); }
.flist { display: grid; margin-top: 8px; }
.frow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--bg); }
.frow .fn { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.frow .fn .sm, .frow .fv .sm { display: block; font-weight: 400; font-size: var(--f1); color: var(--muted); }
.frow .fv b { font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .frow { grid-template-columns: minmax(0, 1fr) 120px 120px 112px; } .frow .fn { grid-column: auto; } }
.fmore { margin: 8px 0 0; font-size: var(--f1); }
.fs { justify-self: end; white-space: nowrap; font-size: var(--f1); font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-s); padding: 2px 8px; }
.fs.yes { color: #12663a; border-color: #b7e1c6; background: #e7f6ed; }
button.srow { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer;
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sn sn" "sv fs" "pg pg"; }
button.srow .sn { grid-area: sn; }
button.srow .sv { grid-area: sv; text-align: left; }
button.srow .sv .sm { display: inline; margin-left: 8px; }
button.srow .fs { grid-area: fs; }
button.srow .progress { grid-area: pg; }
@media (min-width: 720px) {
  button.srow { grid-template-columns: minmax(0, 1fr) auto 112px; grid-template-areas: "sn sv fs" "pg pg pg"; }
  button.srow .sv { text-align: right; }
  button.srow .sv .sm { display: block; margin-left: 0; }
}
button.srow:last-child { border-bottom: 0; }
button.srow:hover { background: var(--bg); }

/* ---------- one polling station ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto auto; column-gap: 8px; margin: 12px 0; }
.fact { min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-m); display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.fact .k { align-self: end; }
.fact .k { display: block; font-size: var(--f1); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fact b { display: block; font-size: var(--f3); font-variant-numeric: tabular-nums; }
.fact .sm { display: block; font-size: var(--f1); color: var(--muted); }
.seal-valid { color: #12663a; font-weight: 600; }
.seal-invalid { color: var(--danger); font-weight: 700; }

/* ---------- "not the election body" notice ---------- */
.notice { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--r-m); background: var(--surface); font-size: var(--f2); }
.notice b { color: var(--navy); }
.notice .nt { flex: 1 1 auto; min-width: 0; }

/* ---------- checked against the IEC (iec.js) ---------- */
.iec-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-s); font-size: var(--f1); font-weight: 700; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.iec-badge .ico { width: 14px; height: 14px; }
.iec-badge.ok { color: #12663a; border-color: #b7e1c6; background: #e7f6ed; }
.iec-badge.bad { color: var(--danger); border-color: #f5c2bd; background: var(--danger-soft); }
.iec-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.iec-sum { margin: 0 0 12px; }
.iec-one + .iec-list { margin-top: 16px; }
.iec-t td.iec-d { color: var(--danger); font-weight: 700; }
.iec-list { display: grid; }
.iec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "in ib" "iv iv"; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.iec-row:last-child { border-bottom: 0; }
.iec-row:hover { background: var(--bg); }
.iec-row .in { grid-area: in; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.iec-row .iv { grid-area: iv; font-variant-numeric: tabular-nums; }
.iec-row .iec-badge { grid-area: ib; justify-self: end; }
.iec-row .sm { display: block; font-weight: 400; font-size: var(--f1); color: var(--muted); }
.iec-row .iv .sm { display: inline; margin-right: 8px; }
@media (min-width: 720px) {
  .iec-row { grid-template-columns: minmax(0, 1fr) 200px 180px; grid-template-areas: "in iv ib"; }
  .iec-row .iv .sm { display: block; margin: 0; }
}

/* ---------- install the app (install.js) ---------- */
.btn.solid { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.solid:hover { background: var(--navy); }
.btn.big { width: 100%; min-height: 52px; font-size: 16px; font-weight: 700; }
dialog.install { width: min(92vw, 420px); padding: 32px 24px 24px; text-align: center; border-radius: var(--r-l); }
@media (max-width: 639px) { dialog.install { width: 100%; margin: auto 0 0; padding: 32px 24px calc(24px + env(safe-area-inset-bottom)); border-radius: var(--r-l) var(--r-l) 0 0; } }
dialog.install h2 { margin: 16px 0 4px; font-size: var(--f3); color: var(--navy); }
dialog.install p { margin: 0 0 24px; }
dialog.install .btn + .btn { margin-top: 8px; }
.install-ic { display: block; margin: 0 auto; border-radius: 20px; box-shadow: var(--sh-1); }
.install-steps { text-align: left; margin: 0 0 24px; padding: 16px 16px 16px 40px; background: var(--bg); border-radius: var(--r-m); display: grid; gap: 8px; font-size: 16px; }
.install-steps .ico { vertical-align: -3px; color: var(--primary); }

.iec-t .s { display: none; }
@media (max-width: 639px) {
  .iec-t .w { display: none; }
  .iec-t .s { display: inline; }
  .iec-t th, .iec-t td { padding-left: 6px; padding-right: 6px; }
}

/* ---------- race card: three charts that take turns (race.js) ---------- */
.race-ctl { display: flex; align-items: center; gap: 8px; }
.auto-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); font: inherit; font-size: var(--f1); font-weight: 700; color: var(--muted); cursor: pointer; }
.auto-btn[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); }
.auto-btn .ico { width: 14px; height: 14px; }
@media (pointer: coarse) { .auto-btn { min-height: 44px; } }
.race-body.enter > :not([hidden]) { animation: view-in .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateX(32px); } }
.race-body:not([data-view="cols"]) .cols-wrap { display: none; }
.race-body[data-view="cols"] .racebar-wrap, .race-body[data-view="cols"] .ring-wrap, .race-body[data-view="cols"] .cands { display: none; }
.cols-wrap { margin-top: 8px; padding: 40px 12px 12px; border-radius: var(--r-l); background: linear-gradient(160deg, #0b1150 0%, #1b1a63 60%, #2a1450 100%); }
.cols { display: flex; height: 300px; }
@media (min-width: 720px) { .cols-wrap { padding: 48px 24px 16px; } .cols { height: 340px; } }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--cols-bg, transparent); }
.cplot { flex: 1; position: relative; border-bottom: 1px solid rgba(255, 255, 255, .45);
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), rgba(255, 255, 255, .14) calc(25% - 1px), rgba(255, 255, 255, .14) 25%); }
.cbar { position: absolute; left: 18%; right: 18%; bottom: 0; min-height: 2px; border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--c), color-mix(in srgb, var(--c) 55%, #ffffff));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.cv { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; color: #fff; font-size: var(--f1); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .cv { font-size: var(--f2); } }
.cn { margin-top: 8px; text-align: center; color: rgba(255, 255, 255, .8); font-size: var(--f1); font-weight: 600; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 479px) { .race-h { align-items: flex-start; } .seg-ctl button { padding: 0 10px; } }
@media (max-width: 479px) { .cols-wrap { padding: 40px 4px 12px; } .cn { font-size: 10.5px; letter-spacing: 0; } .cbar { left: 14%; right: 14%; } }
@media (max-width: 379px) { .cn { font-size: 9.5px; } .cv { font-size: 11px; } }

/* Refresh (the installed app has no browser reload button) */
.reload { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 8px; padding: 0; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; vertical-align: middle; }
.reload:hover { background: rgba(255, 255, 255, .12); }
@media (pointer: coarse) { .reload { width: 40px; height: 40px; } }
.linkb-dark { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: var(--f2); cursor: pointer; }

/* no internet: keep the last numbers, say so */
.offline-bar { background: #fff4d6; color: #5c3d00; border-bottom: 1px solid #f0d58c; font-size: var(--f2); font-weight: 600; padding: 8px 0; }
.is-offline .live { background: #d97706 !important; box-shadow: none !important; animation: none !important; }
/* sound for new results */
.reload.sound[aria-pressed="true"] { background: #fff; color: var(--primary); border-color: #fff; }
/* "New result" banners */
.newres { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 50; display: grid; gap: 8px; width: min(94vw, 560px); }
.newres-item { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-radius: var(--r-m); background: var(--navy); color: #fff; text-decoration: none; box-shadow: var(--sh-2); font-size: var(--f2); animation: res-in .35s cubic-bezier(.2, .8, .2, 1); transition: opacity .35s, transform .35s; }
.newres-item.out { opacity: 0; transform: translateY(8px); }
.newres-item .ico { flex: none; color: #ffd166; }
@keyframes res-in { from { opacity: 0; transform: translateY(16px); } }
.verified { margin: 8px 0; padding: 8px 10px; background: #eef7f1; border-radius: 8px; color: #12663a; }
.verified .muted { color: #4b5b52; font-size: 12px; }

/* ---------- station evidence (evidence-view.js): who sent what, tiles, one item big with Details folded ---------- */
.senders { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.senders li { display: inline-flex; gap: 6px; align-items: baseline; }
.senders .ok { color: #12663a; font-weight: 600; }
.senders .none { color: var(--muted); }
.evgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.evt { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  overflow: hidden; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s ease-out, box-shadow .15s ease-out; }
.evt:hover, .evt:focus-visible { border-color: var(--primary); box-shadow: 0 2px 8px rgba(13, 18, 48, .12); }
.evt:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.evt-media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: #0d1230; }
.evt-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evt-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--navy); font-size: 18px; padding-left: 3px; }
.evt:not(.vid) .evt-icon { padding-left: 0; }
.evt-len { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 5px; font-variant-numeric: tabular-nums; }
.evt-cap { display: grid; gap: 1px; padding: 8px 10px 10px; font-size: 12px; color: var(--muted); }
.evt-cap b { font-size: 13px; color: var(--text); }
.evt-seal { font-weight: 700; min-height: 15px; }
.evt-seal.seal-valid, .ev-seal.seal-valid { color: #12663a; }
.evt-seal.seal-invalid, .ev-seal.seal-invalid { color: var(--danger); }
.back { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 700; color: var(--primary-2); cursor: pointer; }
.ev-title { margin: 8px 0; }
.ev-big img, .ev-big video { width: 100%; max-height: 62vh; object-fit: contain; background: #000; border-radius: var(--r-m); display: block; }
.ev-seal { margin: 8px 0; font-weight: 600; }
.ev-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.ev-more summary { cursor: pointer; font-weight: 700; color: var(--primary-2); padding: 6px 0; }
@media (prefers-reduced-motion: reduce) { .evt { transition: none; } }
.senders .snd { border-radius: 999px; padding: 3px 10px; }
.senders .snd.full { background: #e7f6ed; color: #12663a; }
.senders .snd.part { background: #fff4e0; color: #8a4b00; }
.senders .snd.none { background: #f0f2f5; color: var(--muted); }
.senders .snd b { color: inherit; }
.evt-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.evt-media .evt-icon { position: relative; z-index: 1; }

/* ---------- the 2-minute reminder: unofficial results (reminder.js) ---------- */
.reminder { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  width: min(440px, calc(100% - 24px)); box-sizing: border-box; padding: 16px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--r-m); box-shadow: var(--sh-2);
  animation: rm-in .25s ease-out; }
.reminder p { margin: 0 0 8px; }
.reminder .rm-t { font-weight: 700; font-size: 16px; }
.reminder .iec-badge { margin-top: 4px; }
.reminder .rm-ok { display: block; width: 100%; margin-top: 12px; padding: 10px 16px; min-height: 44px; border: 0; border-radius: var(--r-m);
  background: var(--primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.reminder .rm-ok:focus-visible { outline: 3px solid #f2c200; outline-offset: 2px; }
@keyframes rm-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .reminder { animation: none; } }

/* footer: install the app at any time (install.js) */
.install-btn { margin-top: 12px; }

/* where a constituency's numbers come from (results.js basisNote): IEC declared / whole-constituency total */
.note.basis { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: inherit; line-height: 1.5; }
.note.basis .iec-badge { margin-right: 4px; }

/* "Does the photo show these numbers?" (confirm.js) */
.pub-check { margin-top: 14px; }
.pub-check h3 { margin: 0 0 4px; font-size: var(--f3, 17px); }
.pub-check .pc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pub-check .btn.on { background: var(--primary, #123f87); color: #fff; border-color: transparent; }
.pub-check .pc-ts { margin: 8px 0; }
.pub-check .pc-count { margin: 6px 0 0; }

/* published results whose written total is not the candidates' votes added up (results.js mismatchNote) */
.mismatch { border-color: #e9c46a; background: #fff8e6; }
.mismatch h2 { color: #8a5a00; font-size: var(--f2); }
.mismatch ul { margin: 8px 0 0; padding-left: 20px; }
.mismatch li { margin: 6px 0; }
.mismatch li .sm { display: block; color: var(--muted); }
.mismatch b { font-variant-numeric: tabular-nums; }

/* Then and now: 2021 compared (compare.js) */
.cmp-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 12px; }
.cmp-tiles > div { border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; background: var(--surface); }
.cmp-tiles .k { display: block; font-size: var(--f1); color: var(--muted); }
.cmp-tiles b { display: block; font-variant-numeric: tabular-nums; }
.cmp-tiles .sm { display: block; font-size: var(--f1); color: var(--muted); }
@media (max-width: 760px) { .cmp-tiles { grid-template-columns: 1fr 1fr; } }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.cmp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.cmp-t td { vertical-align: top; }
.cmp-t td .sm { display: block; font-size: var(--f1); color: var(--muted); }
.cmp-t tr.cmp-flip td { background: #fff8e6; }
.cmp-bars { min-width: 140px; }
.cmp-bar { position: relative; display: block; height: 8px; margin: 3px 0 5px; background: linear-gradient(to right, transparent calc(50% - 1px), var(--line) calc(50% - 1px), var(--line) calc(50% + 1px), transparent calc(50% + 1px)); }
.cmp-bar i { position: absolute; top: 0; height: 8px; border-radius: 4px; }
.cmp-box p { margin: 6px 0; line-height: 1.6; }

/* several streams together (results.js groupsNote) */
.grp-list { margin: 6px 0 0; padding-left: 20px; }
.grp-list li { margin: 6px 0; }
.grp-list .sm { display: block; color: var(--muted); font-size: var(--f1); }

/* the IEC's official constituency result (results.js basisNote / race.js) */
.note.basis.official { border-color: #b7e1c6; background: #e7f6ed; }
.ok-tick { color: #12663a; }
.notice.official { border-left-color: #12663a; background: #e7f6ed; }

/* other counts: a party's or newsroom's own total, shown apart from ours (tallies.js) */
.tallies .tally + .tally { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.tally h3 { font-size: var(--f2); margin: 6px 0 2px; color: var(--navy); }
.tally .sm { font-size: var(--f1); }
.tally-flag { display: inline-block; margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #7a4b00; background: #fff4dc; border: 1px solid #f0d49a; border-radius: var(--r-s); padding: 2px 8px; }
.tally-rows { list-style: none; margin: 10px 0 0; padding: 0; }
.tally-rows li { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 92px; gap: 10px; align-items: center; padding: 4px 0; }
.tally-rows .tn b, .tally-rows .tv b { display: block; line-height: 1.2; }
.tally-rows .tn .sm, .tally-rows .tv .sm { display: block; color: var(--muted); }
.tally-rows .tn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally-rows .tv { text-align: right; font-variant-numeric: tabular-nums; }
.tally-rows .tb { height: 12px; border-left: 1px solid var(--line); }
.tally-rows .tb i { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; }
.tally-pic { margin: 12px 0 0; }
.tally-pic img { display: block; width: auto; height: auto; max-width: min(100%, 560px); max-height: 360px;
  border: 1px solid var(--line); border-radius: var(--r-m); }
.tally-pic figcaption { font-size: var(--f1); color: var(--muted); margin-top: 6px; }
@media (max-width: 480px) { .tally-rows li { grid-template-columns: minmax(90px, 1fr) 70px 84px; gap: 8px; } }
