:root {
  --surface: #ffffff; --bg: #f4f6f5; --text: #191919; --text-2: #666666; --line: #e3e7e5; --grid: #eef1ef;
  --green: #0b3d2e; --accent: #13664c; --track: #eef1ef;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-2); }
.top { background: var(--green); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 0 12px; position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.title { font-weight: 800; font-size: 18px; }
.sub { font-size: 13px; opacity: .9; margin-top: 2px; }
.badge { background: #f2a600; color: #191919; font-weight: 800; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.crumbs { font-size: 14px; }
.crumbs a { color: #fff; opacity: .9; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { opacity: .6; margin: 0 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }

/* headline figures */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.fig .k { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.fig .v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.fig .s { font-size: 13px; color: var(--text-2); }
.progress { height: 8px; background: var(--track); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.lead { font-size: 16px; margin: 0 0 12px; }
.lead b { font-weight: 800; }

/* candidate bars: one labelled row each, colour is never the only cue */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 220px) 1fr 120px; align-items: center; gap: 12px; }
.bar-row .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .key { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.bar-row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .pt { font-size: 12px; color: var(--text-2); }
.bar-row .track { height: 16px; background: var(--grid); border-radius: 0 4px 4px 0; position: relative; }
.bar-row .fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-row .num b { font-size: 16px; }
.bar-row .num span { color: var(--text-2); font-size: 13px; margin-left: 6px; }
@media (max-width: 600px) {
  .bar-row { grid-template-columns: 1fr 96px; }
  .bar-row .track { grid-column: 1 / -1; order: 3; }
}

/* region cards with a segmented bar (2px gaps) + leader named in text */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.region { all: unset; display: block; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.region:hover, .region:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px #cfe7dd; }
.region .rn { font-weight: 800; }
.region .rl { font-size: 14px; margin: 6px 0; }
.region .rs { font-size: 12px; color: var(--text-2); }
.seg { display: flex; gap: 2px; height: 12px; margin: 8px 0; background: var(--surface); }
.seg i { display: block; height: 100%; }
.seg i:first-child { border-radius: 4px 0 0 4px; }
.seg i:last-child { border-radius: 0 4px 4px 0; }
.seg.empty { background: var(--grid); border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text); margin: 6px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 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: 12px; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
th .key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6faf8; }
td.lead-cell b { font-weight: 800; }
.evbtn { border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 8px; padding: 5px 9px; font-weight: 700; cursor: pointer; font-size: 13px; }

/* station dialog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(96vw, 860px); max-height: 92vh; }
dialog::backdrop { background: rgba(0,0,0,.55); }
.dlg-head { position: sticky; top: 0; background: #fff; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; }
.x { border: 0; background: transparent; font-size: 20px; cursor: pointer; }
#stBody { padding: 16px; }
.ev { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 12px 0; }
.ev img, .ev video { width: 100%; max-height: 520px; object-fit: contain; background: #000; border-radius: 8px; display: block; }
.ev .show { width: 100%; padding: 30px; border: 1px dashed #b9c6c0; border-radius: 8px; background: #f6faf8; font-weight: 700; color: var(--accent); cursor: pointer; font-size: 15px; }
.meta { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 13px; margin-top: 10px; }
.meta dt { color: var(--text-2); }
.meta dd { margin: 0; word-break: break-all; }
.meta code { font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions a { border: 1px solid var(--accent); border-radius: 8px; padding: 7px 10px; text-decoration: none; font-weight: 700; font-size: 13px; }
.ok-badge { display: inline-block; background: #e7f6ed; color: #12663a; border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 13px; }

.verify input { margin: 6px 0; }
.verify-out { font-weight: 700; margin-top: 6px; }
.verify-out.good { color: #12663a; }
.verify-out.bad { color: #b42318; }
.note { color: var(--text-2); font-size: 13px; margin: 6px 0 40px; }

.tip { position: fixed; z-index: 50; pointer-events: none; background: #191919; color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 13px; max-width: 260px; line-height: 1.35; }
.tip b { font-variant-numeric: tabular-nums; }

td.over b { color: #b42318; }
