/* MapMyNews. Type: Newsreader (headlines), IBM Plex Sans (interface),
   IBM Plex Mono (numbers and times). Ink on paper, one signal red.
   Hairline rules instead of shadows. */
:root {
  --paper: #fbfaf6;
  --paper-2: #f2efe7;
  --ink: #161513;
  --ink-2: #4b4943;
  --ink-3: #8a867c;
  --line: #e1dccf;
  --signal: #c42a1d;
  --signal-2: #f3e1dc;
  --high: #c42a1d;
  --medium: #d27f26;
  --low: #5a6d84;
  --float: 0 1px 2px rgba(22, 21, 19, .12);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --space: #0b0b0c;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 14px/1.45 var(--sans); color: var(--ink); background: var(--space); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ----------------------------------------------------------- space + map */
#stars {
  position: fixed; inset: 0; background-color: var(--space);
  background-image:
    radial-gradient(1px 1px at 12% 18%, #ffffff70 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #ffffff60 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 64%, #ffffff70 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 82%, #ffffff50 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 58%, #ffffff60 50%, transparent 51%);
  background-size: 260px 260px, 330px 330px, 410px 410px, 290px 290px, 370px 370px;
}
#map { position: fixed; inset: 0; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { display: none; }

/* ---------------------------------------------------------------- search */
.search-frame { position: fixed; top: 20px; left: 20px; z-index: 5; width: min(300px, calc(100vw - 32px)); }
.search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 12px;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 3px; color: var(--ink-2);
  box-shadow: var(--float);
}
.search:focus-within { outline: 2px solid var(--signal); outline-offset: 1px; }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 14.5px; color: var(--ink); background: none; }
.search input::placeholder { color: var(--ink-3); }
.search-scope { display: none; }
.suggest { list-style: none; margin: 4px 0 0; padding: 4px 0; background: var(--paper); border: 1px solid var(--ink); border-radius: 3px; max-height: 50vh; overflow: auto; }
.suggest li { padding: 7px 12px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--paper-2); }
.suggest li b { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest li small { color: var(--ink-3); white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.suggest .kind { display: none; }

/* ----------------------------------------------------------------- chips */
.toolbar { position: fixed; top: 20px; left: 340px; right: 340px; z-index: 4; display: flex; gap: 6px; align-items: flex-start; pointer-events: none; }
.toolbar > * { pointer-events: auto; }
.chips { display: flex; gap: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--ink); border-radius: 3px; background: var(--paper); box-shadow: var(--float); }
.chips:empty { display: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px;
  border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chips .chip:last-child { border-right: 0; }
.chip .dot { width: 8px; height: 8px; border-radius: 1px; background: var(--c); flex: none; }
.chip .dot svg { display: none; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip:hover:not([aria-pressed="true"]) { background: var(--paper-2); }
.chip .n { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .n { color: #ffffffaa; }
.chip-solid, .chip-war {
  height: 40px; border: 1px solid var(--ink); border-radius: 3px; box-shadow: var(--float); flex: none;
}
.chip-solid { background: var(--paper); }
.chip-solid svg { width: 15px; height: 15px; }

.layers-wrap { position: relative; flex: none; }
.menu { position: absolute; top: 44px; left: 0; width: 230px; padding: 10px 14px 14px; background: var(--paper); border: 1px solid var(--ink); border-radius: 3px; }
.menu-title { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.menu-title:first-child { margin-top: 2px; }
.menu label { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
.menu input { accent-color: var(--ink); width: 15px; height: 15px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: none; height: 28px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

/* -------------------------------------------------------------- controls */
.controls { position: fixed; top: 20px; right: 20px; z-index: 4; display: flex; gap: 6px; align-items: center; }
.btn-group { display: flex; background: var(--paper); border: 1px solid var(--ink); border-radius: 3px; overflow: hidden; box-shadow: var(--float); }
.btn-group button { width: 38px; height: 38px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); }
.btn-group button svg { width: 17px; height: 17px; }
.btn-group button + button { border-left: 1px solid var(--line); }
.btn-group button:hover { background: var(--paper-2); }
.btn-group button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.live {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 12px; white-space: nowrap; box-shadow: var(--float);
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.live.stale i { background: var(--ink-3); }

/* ----------------------------------------------------------------- panel */
.panel {
  position: fixed; top: 72px; right: 20px; z-index: 3; width: 320px; max-height: calc(100vh - 136px); height: fit-content;
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--ink); border-radius: 3px;
  box-shadow: var(--float); overflow: hidden;
}
.panel-head { display: flex; align-items: flex-start; gap: 4px; padding: 14px 10px 4px 16px; }
.panel-head h1 { flex: 1; margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; min-width: 0; }
.icon-btn { width: 30px; height: 30px; border-radius: 3px; border: 0; background: none; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
#backBtn { margin-left: -6px; }
.panel.collapsed .panel-body { display: none; }
.panel.collapsed #collapseBtn svg { transform: rotate(180deg); }
.panel-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.summary { padding: 0 16px; }
.big { margin: 2px 0 4px; font-size: 13px; color: var(--ink-2); }
.big strong { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.impact-counts { margin: 0 0 10px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.pip { display: inline-flex; align-items: center; gap: 5px; }
.pip::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: var(--c); }
.pip b { color: var(--ink); font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.place-meta { margin: 2px 0 10px; font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-family: var(--mono); }
.badge { font-family: var(--sans); font-size: 12px; color: var(--ink-2); text-transform: capitalize; }
.muted { color: var(--ink-3); }

.impact-filter { display: flex; align-items: center; gap: 12px; padding: 0 16px 10px; font-size: 12.5px; }
.impact-filter > span { color: var(--ink-3); margin-right: auto; }
.ck { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--ink-2); }
.ck input { position: absolute; opacity: 0; pointer-events: none; }
.ck i { width: 14px; height: 14px; border-radius: 2px; border: 1.5px solid var(--c); display: grid; place-items: center; }
.ck input:checked + i { background: var(--c); }
.ck input:checked + i::after { content: ""; width: 6px; height: 3px; border: solid #fff; border-width: 0 0 1.5px 1.5px; transform: translateY(-1px) rotate(-45deg); }
.ck input:focus-visible + i { outline: 2px solid var(--signal); outline-offset: 2px; }
.ck.high { --c: var(--high); } .ck.medium { --c: var(--medium); } .ck.low { --c: var(--low); }

.tabs, .wtabs { display: flex; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--ink); }
.tabs button, .wtabs button { border: 0; background: none; padding: 8px 0 7px; font-size: 13px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.tabs button[aria-selected="true"], .wtabs button[aria-selected="true"] { color: var(--ink); border-color: var(--signal); }
.wtabs { position: sticky; top: -10px; z-index: 1; margin: -10px -16px 2px; background: var(--paper); }

.list { overflow-y: auto; padding: 10px 16px 14px; display: flex; flex-direction: column; min-height: 0; flex: 1; overscroll-behavior: contain; }
.empty { color: var(--ink-3); padding: 24px 0; }

/* hotspot rows */
.zone { text-align: left; width: 100%; padding: 10px 0 11px 10px; border: 0; border-left: 3px solid var(--line); border-bottom: 1px solid var(--line); background: none; }
.zone:hover { background: var(--paper-2); }
.zone.critical { border-left-color: var(--high); }
.zone.elevated { border-left-color: var(--medium); }
.zone-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.zone-top b { font-family: var(--serif); font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sev { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.critical .sev { color: var(--high); } .elevated .sev { color: var(--medium); }
.zone-n { margin: 1px 0 4px; font-size: 12.5px; color: var(--ink-2); }
.zone-n strong { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.zone .impact-counts { margin: 0 0 4px; gap: 10px; font-size: 12px; }
.zone-head { margin: 0; font-family: var(--serif); font-size: 14px; line-height: 1.3; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* stories */
.story { display: grid; grid-template-columns: 1fr 68px; gap: 12px; padding: 11px 0 12px; border-bottom: 1px solid var(--line); }
.story:last-child { border-bottom: 0; }
.story.no-img { grid-template-columns: 1fr; }
.story-meta { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; flex-wrap: wrap; }
.story-meta .imp { width: 7px; height: 7px; border-radius: 1px; background: var(--c); flex: none; }
.cat { color: var(--c); font-weight: 500; }
.story a.title { display: block; font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.25; text-decoration: none; color: var(--ink); }
.story a.title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.story .src { margin-top: 4px; font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; }
.story .src button { border: 0; background: none; padding: 0; color: var(--ink); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line); }
.story img { width: 68px; height: 68px; object-fit: cover; border-radius: 2px; background: var(--paper-2); filter: saturate(.85); }
.more { margin-top: 10px; border: 1px solid var(--ink); background: none; border-radius: 3px; padding: 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
.more:hover { background: var(--ink); color: var(--paper); }
.lang { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 2px; padding: 0 4px; }
.alts { margin-top: 5px; font-size: 12px; }
.alts summary { cursor: pointer; color: var(--ink-2); list-style: none; }
.alts summary::-webkit-details-marker { display: none; }
.alts summary::before { content: "+ "; font-family: var(--mono); }
.alts[open] summary::before { content: "- "; }
.alts a { display: inline-block; margin: 4px 10px 0 0; color: var(--ink-2); }

/* map tooltip */
.tip { position: fixed; z-index: 6; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: #f4f2ec; padding: 5px 9px; border-radius: 2px; font-size: 12.5px; white-space: nowrap; }
.tip b { font-weight: 600; }
.tip span { color: #c9c5bb; margin-left: 6px; }

/* ----------------------------------------------------------------- brand */
.brand { position: fixed; right: 20px; bottom: 12px; z-index: 2; text-align: right; pointer-events: none; }
.brand a { pointer-events: auto; }
.wordmark { display: inline-flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: #f4f2ec; text-decoration: none; }
.wordmark i { width: 9px; height: 9px; background: var(--signal); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.attrib { margin: 2px 0 0; font-size: 10.5px; color: #9a968c; }
.attrib a { color: #c9c5bb; }
body.flat .attrib { color: var(--ink-2); }
body.flat .attrib a { color: var(--ink); }
.browse { margin: 3px 0 0; font-size: 12px; color: #9a968c; }
.browse a { color: #e6e3db; text-decoration: none; }
.browse a:hover { color: #fff; text-decoration: underline; }
body.flat .browse a { color: var(--ink); }
body.flat .wordmark { color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 20; background: var(--ink); color: #f4f2ec; padding: 9px 14px; border-radius: 3px; font-size: 13px; }

/* -------------------------------------------------------- narrow screens */
@media (max-width: 1080px) {
  .toolbar { left: 20px; right: 20px; top: 70px; }
  .panel { top: 122px; }
}
@media (max-width: 700px) {
  .search-frame { top: 10px; left: 10px; right: 10px; width: auto; }
  .controls { top: auto; bottom: calc(46vh + 12px); right: 10px; flex-direction: column; align-items: flex-end; }
  .btn-group { flex-direction: column; }
  .btn-group button + button { border-left: 0; border-top: 1px solid var(--line); }
  .live { position: fixed; top: 106px; right: 10px; height: 32px; padding: 0 9px; font-size: 11px; }
  .toolbar { top: 58px; left: 10px; right: 10px; }
  .layers-wrap { position: fixed; top: 106px; left: 10px; }
  .chip { height: 36px; }
  .chip-solid, .chip-war { height: 32px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 46vh; max-height: none; border-radius: 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .panel.collapsed { height: auto; }
  body:has(.panel.collapsed) .controls { bottom: 84px; }
  .brand { display: none; }
}

/* ================================================================ war map */
.chip-war { gap: 8px; padding: 0 12px; background: var(--paper); color: var(--ink); font-weight: 500; }
.chip-war .dot { width: 8px; height: 8px; background: var(--signal); }
.chip-war[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: #fff; }
.chip-war[aria-pressed="true"] .dot { background: #fff; }
.war-n { font-family: var(--mono); font-size: 11.5px; color: var(--signal); }
.chip-war[aria-pressed="true"] .war-n { color: #fff; }

body.war {
  --paper: #121212; --paper-2: #1c1c1b; --ink: #ebe8e1; --ink-2: #b5b1a7; --ink-3: #7d7a72; --line: #2c2b29;
  --signal: #e2462f; --signal-2: #2a1915; --low: #8d98a6; --float: none;
}
body.war .panel, body.war .search, body.war .chips, body.war .chip-solid, body.war .chip-war:not([aria-pressed="true"]),
body.war .btn-group, body.war .live, body.war .menu, body.war .suggest { border-color: #4a4843; }
body.war .tabs, body.war .wtabs { border-bottom-color: #4a4843; }
body.war .wordmark, body.war.flat .wordmark { color: #ebe8e1; }
body.war .attrib, body.war.flat .attrib { color: #8b877e; }
body.war .attrib a, body.war.flat .attrib a { color: #c2beb4; }
body.war .tip { background: #ebe8e1; color: #121212; }
body.war .tip span { color: #4b4943; }

.tier { font-size: 11.5px; white-space: nowrap; }
.tier.war { color: var(--signal); }
.tier.watch { color: var(--medium); }
.tier.auto { color: var(--ink-3); }
.trend { font-family: var(--mono); font-size: 11.5px; margin-left: 4px; }
.trend.up { color: var(--signal); } .trend.down { color: #6fae7c; } .trend.flat { color: var(--ink-3); }

.zone.theatre.war { border-left-color: var(--signal); }
.zone.theatre.watch { border-left-color: var(--medium); }
.parties { margin: 2px 0 4px; font-size: 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.party { display: inline-flex; align-items: center; gap: 5px; }
.party i { width: 7px; height: 7px; border-radius: 1px; }
.vs { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.theatre-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.theatre-row .zone-n { margin: 0 0 3px; }
.spark { width: 90px; height: 24px; flex: none; }
section .spark { width: 100%; height: 44px; }
.kpips { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--ink-2); }
.kpip { display: inline-flex; align-items: center; gap: 5px; }
.kpip::before { content: ""; width: 7px; height: 7px; border-radius: 1px; background: var(--c); }
.since { margin: 5px 0 0; font-size: 12px; color: var(--ink-3); }
.since b { color: var(--ink); font-family: var(--mono); font-weight: 500; }

.list section { padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.list h3 { margin: 10px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin: 2px 0 0; }
.kinds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kinds li { display: grid; grid-template-columns: 1fr 70px 38px; gap: 8px; align-items: center; font-size: 12.5px; }
.kl { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.kl i { width: 8px; height: 8px; border-radius: 1px; }
.kb { height: 4px; background: var(--line); overflow: hidden; }
.kb i { display: block; height: 100%; }
.kinds b { text-align: right; font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.places { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; }
.places span { font-size: 12.5px; color: var(--ink-2); }
.places b { color: var(--ink); margin-left: 4px; font-family: var(--mono); font-weight: 500; }
.links { margin: 0; padding-left: 16px; font-size: 13px; }
.links a { color: var(--ink); }

.terr-big { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.terr-big strong { font-family: var(--mono); font-size: 20px; font-weight: 500; color: var(--ink); }
.bar { display: flex; height: 8px; background: #2d3a4d; overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar-key { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; font-size: 11.5px; color: var(--ink-3); }
.bar-key span { display: inline-flex; align-items: center; gap: 5px; }
.bar-key i { width: 8px; height: 8px; border-radius: 1px; }
.changes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.changes li { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.changes li + li { border-left: 1px solid var(--line); }
.changes span { font-size: 11.5px; color: var(--ink-3); }
.changes b { font-family: var(--mono); font-size: 13.5px; font-weight: 500; }
.changes b.up { color: var(--signal); } .changes b.down { color: #6fae7c; }
.ds-update { margin: 10px 0 0; font-family: var(--serif); font-size: 14px; color: var(--ink-2); font-style: italic; }
.src-note { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.src-note a { color: var(--ink-2); }

/* 72-hour replay */
.replay {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(calc(-50% - 170px)); z-index: 4;
  display: flex; align-items: center; gap: 12px; width: min(440px, calc(100vw - 32px)); height: 44px; padding: 0 14px 0 4px;
  background: #121212; border: 1px solid #4a4843; border-radius: 3px; color: #ebe8e1;
}
.replay button { width: 34px; height: 34px; border-radius: 2px; border: 0; background: var(--signal); color: #fff; display: grid; place-items: center; flex: none; }
.replay button svg { width: 14px; height: 14px; fill: #fff; stroke: #fff; }
.replay .i-pause, .replay button.playing .i-play { display: none; }
.replay button.playing .i-pause { display: block; }
.replay input { flex: 1; accent-color: var(--signal); min-width: 0; }
#replayTime { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; color: #b5b1a7; min-width: 40px; }

.legend {
  position: fixed; left: 20px; bottom: 20px; z-index: 3; width: 210px; max-height: calc(100vh - 220px); overflow: auto;
  padding: 10px 14px 12px; background: #121212; border: 1px solid #4a4843; border-radius: 3px; color: #c2beb4; font-size: 12px;
}
.legend.closed .legend-body { display: none; }
.legend-toggle { border: 0; background: none; padding: 0; font-weight: 600; color: #ebe8e1; font-size: 12.5px; width: 100%; text-align: left; }
.legend-toggle::after { content: " ▾"; color: #7d7a72; }
.legend.closed .legend-toggle::after { content: " ▸"; }
.legend .menu-title { color: #7d7a72; margin: 10px 0 5px; font-weight: 500; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .mini { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid #fff; }
.legend .mini svg { width: 10px; height: 10px; stroke: #fff; }
.legend .mini.arrow { border: 0; border-radius: 0; background: #e8742a; clip-path: polygon(0 30%, 55% 30%, 55% 0, 100% 50%, 55% 100%, 55% 70%, 0 70%); }
.legend .sw { width: 16px; height: 11px; background: var(--c); opacity: .85; flex: none; }
.legend .sw.hatch { background: repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); border: 1px solid var(--c); }
.legend .ln { width: 16px; border-top: 2px dashed; flex: none; }
.legend .fire-sw { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(#fff1c2 25%, #f0a028 65%, transparent 72%); flex: none; margin: 0 3px; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 1px; margin-right: 4px; flex: none; }

@media (max-width: 1080px) {
  .replay { transform: translateX(-50%); }
  .legend { display: none; }
}
@media (max-width: 700px) {
  .replay { bottom: calc(46vh + 10px); width: calc(100vw - 72px); left: 10px; transform: none; }
}

/* feed */
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.feed-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font-size: 13px; line-height: 1.35; }
.feed-item .mini { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid #ffffffcc; margin-top: 1px; }
.feed-item .mini svg { width: 11px; height: 11px; stroke: #fff; }
.feed-item.inc:hover { background: var(--paper-2); }
.fi-body { min-width: 0; }
.fi-body small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.fi-body a { color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.25; }
.fi-body a:hover { text-decoration: underline; text-underline-offset: 2px; }
.news-mark { width: 2px; align-self: stretch; background: var(--c); flex: none; margin: 2px 9px 2px 9px; }

/* latest-headlines strip */
.ticker {
  position: fixed; top: 72px; left: 20px; right: 360px; z-index: 3; height: 34px;
  display: flex; align-items: center; overflow: hidden; background: #121212; border: 1px solid #4a4843; border-radius: 3px;
}
.tk-badge { flex: none; height: 100%; display: grid; place-items: center; padding: 0 10px; background: var(--signal); color: #fff; font-family: var(--mono); font-size: 11px; }
.tk-track { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent); }
.tk-inner { display: inline-flex; align-items: center; gap: 16px; white-space: nowrap; padding-left: 16px; animation: tk 120s linear infinite; }
.ticker:hover .tk-inner { animation-play-state: paused; }
.tk-inner a { color: #ebe8e1; text-decoration: none; font-family: var(--serif); font-size: 14px; }
.tk-inner a b { font-family: var(--sans); font-size: 12px; font-weight: 600; color: #e8a08f; margin-right: 6px; }
.tk-inner a:hover { text-decoration: underline; }
.tk-inner i { color: #4a4843; font-style: normal; }
@keyframes tk { to { transform: translateX(-50%); } }
@media (max-width: 1080px) { .ticker { top: 122px; right: 360px; } }
@media (max-width: 700px) { .ticker { top: 146px; left: 10px; right: 10px; height: 30px; } .tk-inner a { font-size: 13px; } }

/* Ukraine time-lapse */
.tl-cta { margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: none; color: var(--ink); text-align: left; }
.tl-cta:hover { border-color: var(--signal); }
.tl-cta b { display: block; font-size: 13.5px; font-weight: 600; }
.tl-cta small { color: var(--ink-3); font-size: 12px; }
.tl-play { width: 32px; height: 32px; border-radius: 2px; background: var(--signal); display: grid; place-items: center; flex: none; }
.tl-play svg { width: 13px; height: 13px; fill: #fff; stroke: #fff; }

.tl-bar { position: fixed; left: 20px; bottom: 20px; z-index: 5; width: 320px; padding: 14px 16px 12px; background: #121212; border: 1px solid #4a4843; border-radius: 3px; color: #ebe8e1; }
.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tl-date { margin: 0; font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; }
.tl-km { margin: 6px 0 0; font-family: var(--mono); font-size: 12.5px; color: #c2beb4; }
.tl-delta { margin: 2px 0 0; font-family: var(--mono); font-size: 12.5px; min-height: 18px; }
.tl-delta .up { color: #f08a5d; } .tl-delta .down { color: #79c08a; } .tl-delta .flat { color: #7d7a72; }
.tl-x { border: 1px solid #4a4843; background: none; color: #c2beb4; width: 28px; height: 28px; border-radius: 2px; flex: none; }
.tl-x:hover { border-color: #ebe8e1; color: #ebe8e1; }
.tl-caption { margin: 10px 0 0; padding: 6px 0 6px 10px; border-left: 2px solid var(--signal); font-family: var(--serif); font-size: 15px; line-height: 1.3; color: #ebe8e1; }
#tlChart { display: block; width: 100%; height: 64px; margin: 12px 0 8px; cursor: pointer; }
.tl-controls { display: flex; align-items: center; gap: 10px; }
.tl-btn { width: 34px; height: 34px; border-radius: 2px; border: 0; background: var(--signal); display: grid; place-items: center; flex: none; }
.tl-btn svg { width: 14px; height: 14px; fill: #fff; stroke: #fff; }
.tl-btn .i-pause, .tl-btn.playing .i-play { display: none; }
.tl-btn.playing .i-pause { display: block; }
#tlSlider { flex: 1; accent-color: var(--signal); min-width: 0; }
.tl-speed { border: 1px solid #4a4843; background: none; color: #c2beb4; border-radius: 2px; padding: 4px 8px; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.tl-speed[aria-pressed="true"] { background: #ebe8e1; border-color: #ebe8e1; color: #121212; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 0; font-size: 11.5px; color: #9a968c; }
.tl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tl-legend i { width: 9px; height: 9px; border-radius: 1px; }
.tl-bar .src-note { color: #7d7a72; }
.tl-err { margin: 0 34px 0 0; font-size: 13px; }
@media (max-width: 700px) {
  .tl-bar { left: 8px; right: 8px; width: auto; bottom: calc(46vh + 8px); padding: 10px 12px; }
  .tl-date { font-size: 24px; }
  #tlChart { height: 40px; margin: 8px 0 4px; }
  .tl-legend, .tl-bar .src-note { display: none; }
}

/* machine-written summaries: set like a standfirst, labelled plainly */
.brief { margin: 0 0 4px; padding: 2px 0 12px; border-bottom: 1px solid var(--line); }
.brief p { margin: 0; font-family: var(--serif); font-size: 15.5px; line-height: 1.4; color: var(--ink); }
.brief .brief-k { font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); margin-bottom: 4px; }
.brief-h { margin: 0 0 4px !important; font-family: var(--serif); font-size: 18px !important; font-weight: 600 !important; line-height: 1.2; color: var(--ink) !important; }
.brief-watch { margin-top: 8px !important; font-family: var(--sans) !important; font-size: 12.5px !important; color: var(--ink-2) !important; }
.brief .brief-note { margin-top: 8px; font-family: var(--sans); font-size: 11px; color: var(--ink-3); }
.brief-line { margin: 2px 0 4px; font-family: var(--serif); font-size: 14px; line-height: 1.3; color: var(--ink-2); }

/* ============================================================== elections */
.chip-el { height: 40px; border: 1px solid var(--ink); border-radius: 3px; box-shadow: var(--float); flex: none; gap: 8px; padding: 0 12px; background: var(--paper); font-weight: 500; }
.chip-el .dot { width: 8px; height: 8px; border-radius: 50%; background: #2f6b4f; }
.chip-el[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip-el[aria-pressed="true"] .dot { background: var(--paper); }
.el-n { font-family: var(--mono); font-size: 11.5px; color: #2f6b4f; }
.chip-el[aria-pressed="true"] .el-n { color: #b9dcc4; }
body.war .chip-el { background: #121212; color: #ebe8e1; border-color: #4a4843; }
@media (max-width: 700px) { .chip-el { height: 32px; } }

.el-group { display: flex; justify-content: space-between; margin: 14px 0 2px !important; padding-bottom: 4px; border-bottom: 1px solid var(--ink); font-size: 12.5px; }
.el-group:first-child { margin-top: 2px !important; }
.el-group span { font-family: var(--mono); font-weight: 400; color: var(--ink-3); }
.el-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; width: 100%; text-align: left; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); }
.el-row:hover { background: var(--paper-2); }
.el-when { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); padding-right: 8px; }
.el-when b { font-family: var(--mono); font-size: 19px; font-weight: 500; line-height: 1; }
.el-when small { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; text-align: center; }
.el-row.today .el-when b, .el-row.today .el-when small { color: var(--signal); }
.el-row.results .el-when small { color: #2f6b4f; font-weight: 600; }
.el-row.counting .el-when small { color: var(--medium); font-weight: 600; }
.el-what { min-width: 0; }
.el-what b { display: block; font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.2; }
.el-what small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.el-lead { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.el-lead i { width: 8px; height: 8px; border-radius: 1px; flex: none; }
.el-lead b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 12px; display: inline; }

.el-count { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); margin: 4px 0 6px; }
.el-count span { display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; font-size: 11px; color: var(--ink-3); }
.el-count span + span { border-left: 1px solid var(--line); }
.el-count b { font-family: var(--mono); font-size: 24px; font-weight: 500; color: var(--ink); line-height: 1.1; }
.el-q { font-family: var(--serif); font-size: 16px; margin: 0; }
.hemi { display: block; width: 100%; height: auto; margin: 4px 0 2px; }
.hemi-n { font-family: var(--mono); font-size: .13px; fill: var(--ink); }
.hemi-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.hemi-key span { display: inline-flex; align-items: center; gap: 5px; }
.hemi-key i { width: 8px; height: 8px; border-radius: 50%; }
.hemi-key b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.pollchart { display: block; width: 100%; height: auto; margin: 4px 0 0; }
.pollchart .grid { stroke: var(--line); stroke-width: .6; }
.pollchart .axis-t { font-family: var(--mono); font-size: 7px; fill: var(--ink-3); }
.el-people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.el-person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.el-person img, .el-ph { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--paper-2); filter: grayscale(.25); }
.el-person b { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.el-person small { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.el-person small i { width: 7px; height: 7px; border-radius: 1px; flex: none; }
.el-res { font-family: var(--mono); color: var(--ink) !important; }
.el-bundle .el-lead { color: var(--signal); font-weight: 500; }
.el-members { border-left: 2px solid var(--line); margin-left: 24px; }
.el-members .el-row { grid-template-columns: 44px 1fr; }
/* Charts draw their own strokes; the global icon stroke would swamp them. */
.hemi, .pollchart, .spark { stroke: none; }

.el-row.announced .el-when b { font-size: 13px; font-family: var(--sans); font-weight: 600; color: #5a6d84; }
.el-notices { list-style: none; margin: 0; padding: 0; }
.el-notices li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.el-notices a { font-family: var(--serif); font-size: 14.5px; font-weight: 600; line-height: 1.3; color: var(--ink); text-decoration: none; }
.el-notices a:hover { text-decoration: underline; }
.el-notices small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
