/* Whereabouts — where your government's decisions land.
   A newspaper front page (Newsreader headlines, Archivo UI) + paper/ink document pane + hand-drawn map. No UI libraries. */
:root {
  --paper: #f6f1e8;
  --paper-2: #EDE4D4;
  --paper-3: #E3D7C2;
  --ink: #1f1d1a;
  --ink-2: #5A4A3C;
  --ink-3: #8B7A66;
  --rule: rgba(31, 29, 26, 0.14);
  --accent: #E89548;      /* the map's orange */
  --official: #c8102e;    /* the pin / stamp red */
  --step: #E85D75;
  --map-paper: #f6f1e8;   /* the map is ink on paper: greys only, colour is the notice's */
  --sea: #e3ded6;
  --shadow: 0 10px 30px rgba(31, 29, 26, 0.18), 0 1px 2px rgba(31, 29, 26, 0.12);
  --radius: 10px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo Black", "Archivo", system-ui, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --top-h: 56px;
  --strip-h: 60px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .ico { width: 14px; height: 14px; }

/* ---------- view switching ---------- */
body[data-view="front"] .top, body[data-view="front"] .app, body[data-view="front"] .caption, body[data-view="front"] .drawer { display: none !important; }
body[data-view="story"] .front { display: none !important; }

/* ---------- brand ---------- */
.lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.lockup .mark { width: 40px; height: 48px; color: var(--ink); }
.wordmark { font-family: var(--display); font-weight: 400; font-size: 44px; letter-spacing: -0.03em; line-height: 0.9; }
.lockup-sm .mark { width: 20px; height: 24px; }
.lockup-sm .wordmark { font-size: 20px; letter-spacing: -0.02em; }

/* ---------- the global mode switch: Read | Listen (a segmented pill; remembered) ---------- */
.mode { display: inline-flex; gap: 4px; padding: 4px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); }
.mode-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  font-weight: 700; font-size: 15px; line-height: 1; white-space: nowrap;
  transition: background 0.15s, color 0.15s; -webkit-tap-highlight-color: transparent;
}
.mode-btn .ico { width: 18px; height: 18px; }
.mode-btn:hover { background: var(--paper-2); }
.mode-btn[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.mode-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mode-sm { padding: 3px; gap: 3px; border-width: 1.5px; }
.mode-sm .mode-btn { padding: 6px 12px; font-size: 12.5px; gap: 6px; }
.mode-sm .mode-btn .ico { width: 14px; height: 14px; }

/* =========================================================== FRONT PAGE — a broadsheet (1440 wide, 64 px margins) */
.front { height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.front-body, .masthead-inner, .masthead-strip-inner, .colophon-inner { max-width: 1440px; margin: 0 auto; padding-left: 64px; padding-right: 64px; }

/* masthead: dateline · [empty | lockup + strapline | mode switch + Play all] · double rule · section line */
.masthead { background: var(--paper); }
.masthead-inner { padding-top: 14px; padding-bottom: 0; }
.dateline {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 0 10px; border-bottom: 1px solid var(--ink);
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.edition-menu { flex: 1; position: relative; text-align: center; }
.dateline-edition { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); cursor: pointer; list-style: none; user-select: none; }
.dateline-edition::-webkit-details-marker { display: none; }
.dateline-edition::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.edition-menu[open] .dateline-edition { color: var(--ink); }
.edition-list { position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); z-index: 40; min-width: 240px; background: var(--paper); border: 1px solid var(--ink); box-shadow: var(--shadow); padding: 6px 0; text-align: left; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; }
.edition-list::before { content: ""; position: absolute; left: 50%; top: -6px; width: 10px; height: 10px; background: var(--paper); border-left: 1px solid var(--ink); border-top: 1px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.edition-item { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 8px 14px; color: var(--ink); text-decoration: none; }
.edition-item small { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.edition-item.is-current { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.edition-item.is-current small { color: var(--official); }
.edition-item.is-soon { color: var(--ink-3); }
.edition-item.is-suggest { border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 10px; }
.edition-item.is-suggest:hover { color: var(--official); }
.dateline-model { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.dateline-model::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
#dateline-date .short { display: none; }
.mast-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; padding: 26px 0 22px; }
.mast-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.mast-spacer { min-width: 0; } /* the empty left cell keeps the wordmark centred */
.mast-centre { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lockup-mast { gap: 18px; }
.lockup-mast .mark { width: 64px; height: 76px; }
.lockup-mast .wordmark { font-size: 78px; }
.strapline { margin: 0; font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--ink-2); }
.mast-mode { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
/* Play all with the switch: under it on the broadsheet (the wordmark needs the width), beside it on a phone */
.mast-mode-row { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mast-help { font-size: 12px; color: var(--ink-3); }
/* Play all: Listen, every unread notice in turn, chained by Up next */
.playall {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 13px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink);
  font-weight: 700; font-size: 13.5px; line-height: 1; white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.playall .ico { width: 12px; height: 12px; }
.playall:hover { background: var(--ink); color: var(--paper); }
.playall:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.masthead-strip { border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); }
.masthead-strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.sections { display: flex; gap: 22px; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.sections a { color: inherit; text-decoration: none; }
.sections a:hover { color: var(--official); }
.sections a.latest { color: var(--official); }
.front-summary { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* kickers: section in the official red, gazette · id · date in grey */
.kicker { display: flex; align-items: center; gap: 10px; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.kicker-section { color: var(--official); }
.kicker-gz { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
/* read tracking: a tick + Read, or "Step 3 of 12 · continue"; read stories sit a little quieter */
.kicker-mark:empty { display: none; }
.kicker-read { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.kicker-read .ico { width: 12px; height: 12px; stroke-width: 3; }
.kicker-progress { color: var(--ink-2); font-weight: 600; }
.is-read .gitem-thumb, .lead.is-read .overview-wrap { opacity: 0.6; }
.is-read .gitem-title button, .lead.is-read .lead-title button { color: var(--ink-2); }
.is-read .gitem-sum, .lead.is-read .standfirst { color: var(--ink-3); }

/* lead story */
.front-body { padding-top: 30px; padding-bottom: 0; }
.lead {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 48px; align-items: stretch;
  padding-bottom: 34px; border-bottom: 3px double var(--ink);
}
.lead-text { display: flex; flex-direction: column; gap: 14px; padding-right: 40px; border-right: 1px solid var(--rule); }
.lead-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 54px; line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.lead-title button { all: unset; cursor: pointer; }
.lead-title button:hover, .lead.hover .lead-title button { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--lead, var(--official)); }
.standfirst { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.42; color: var(--ink-2); }
.bignums { display: flex; gap: 22px; margin-top: 6px; }
.bignum { display: flex; flex-direction: column; min-width: 0; }
.bignum b { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bignum b small { font-size: 18px; font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.bignum span { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.byline { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 4px; }
.byline b { color: var(--ink); font-weight: 600; }
.lead-actions { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 14px; }
.btn-open { padding: 15px 26px; font-size: 16px; font-weight: 700; border-radius: 6px; gap: 10px; }
.open-hint { font-size: 12.5px; color: var(--ink-3); }
.lead-figure { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.overview-wrap { position: relative; flex: 1; min-height: 420px; border: 1px solid rgba(31,29,26,0.2); background: var(--map-paper); overflow: hidden; }
.overview { position: absolute; inset: 0; }
.overview .maplibregl-canvas { cursor: default; }
.overview .maplibregl-ctrl-bottom-right, .overview .maplibregl-ctrl-bottom-left { display: none; }
.overview-badge { position: absolute; left: 14px; top: 12px; z-index: 2; pointer-events: none; background: rgba(246,241,232,0.94); border: 1px solid rgba(31,29,26,0.2); padding: 6px 10px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.lead-figure figcaption { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

/* the lower page: three columns of cards with hairline rules, a sidebar; then a full-width row of the rest */
.front-lower { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 40px; padding: 28px 0 40px; align-items: start; }
.grid { grid-column: 1 / 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.gitem { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 0 20px 24px 0; border-right: 1px solid var(--rule); }
.gitem:nth-child(n + 4) { border-top: 1px solid var(--rule); padding-top: 22px; }
.gitem-body { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.gitem-thumb { position: relative; height: 150px; background: var(--map-paper); border: 1px solid rgba(31,29,26,0.18); cursor: pointer; overflow: hidden; }
.gitem-thumb svg, .gitem-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.gitem-thumb .tn, .upnext-thumb .tn { position: absolute; left: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 1px 3px rgba(31,29,26,0.3); font-family: var(--font); }
.gitem .kicker { font-size: 11px; }
.gitem-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 25px; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
.gitem-title button { all: unset; cursor: pointer; }
.gitem-title button:hover, .gitem.hover .gitem-title button { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--c); }
.gitem-sum { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.gitem-sum.pending { color: var(--ink-3); font-style: italic; }
.gitem-where { margin-top: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.gitem .btn-open { align-self: flex-start; padding: 10px 16px; font-size: 13.5px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); gap: 8px; }
.gitem .btn-open:hover { background: var(--ink); color: var(--paper); }
.front-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; padding: 26px 0 44px; border-top: 1px solid var(--ink); }
.front-more .gitem { gap: 8px; padding-bottom: 0; }
.front-more .gitem-thumb { display: none; }
.front-more .gitem:nth-child(3n) { border-right: 0; padding-right: 0; }
.front-more .gitem:nth-child(n + 4) { border-top: 1px solid var(--rule); padding-top: 22px; margin-top: 22px; }
.front-more .gitem-title { font-size: 22px; line-height: 1.15; }
.front-more .gitem-sum { font-size: 13.5px; -webkit-line-clamp: 3; }
.front-more .btn-open { margin-top: 4px; padding: 8px 14px; font-size: 13px; }
/* already read: a thin labelled rule, then the read stories in the compact form, at the end of the grid */
.front-read { padding-top: 8px; }
.read-rule { display: flex; align-items: center; gap: 14px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.read-rule span { display: inline-flex; align-items: center; gap: 6px; }
.read-rule .ico { width: 12px; height: 12px; stroke-width: 3; }
.read-rule::after { content: ""; flex: 1; height: 1px; background: var(--ink-3); opacity: 0.5; }
.front-read-grid { border-top: 0; padding-top: 20px; }

/* sidebar: "Watching the gazettes" · "How to read this paper" · "Coming up" */
.side { grid-column: 4; min-width: 0; }
.side-sticky { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; }
.watchbox { border-top: 3px solid var(--official); padding: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.watchbox-head { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.watch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--official); animation: blink 1.6s ease-in-out infinite; }
.watch-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.watch-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.watch-list b { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.2; }
.watch-list span { color: var(--ink-3); white-space: nowrap; }
.watch-foot { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.watch-foot b { color: var(--ink); font-weight: 700; }
.sidebox { border-top: 1px solid var(--ink); padding: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.sidebox-head { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.sidebox p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.coming-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.coming-list li { font-family: var(--serif); font-size: 16px; line-height: 1.35; font-weight: 500; color: var(--ink); }
.coming-list a { color: inherit; text-decoration: none; }
.coming-list a:hover { text-decoration: underline; text-decoration-color: var(--official); text-underline-offset: 3px; }
.coming-list small { display: block; font-family: var(--font); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }
.coming-foot { font-size: 12px !important; color: var(--ink-3) !important; }
.side-foot { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.side-foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.side-foot a:hover { color: var(--official); }

/* colophon */
.colophon { border-top: 3px double var(--ink); background: var(--paper); }
.colophon-inner { padding-top: 18px; padding-bottom: 40px; display: flex; justify-content: space-between; gap: 40px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.colophon p { margin: 0; max-width: 720px; }
.colophon-right { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.colophon-right .mark { width: 12px; height: 14px; color: var(--ink); }
#colophon-sources { display: block; margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px; }
/* Licence credit for the narration voice: CC BY 4.0 requires attribution wherever the audio is published. */
.colophon-credit { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-3); opacity: 0.85; }
.colophon-credit cite { font-style: italic; }
.colophon-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.colophon-credit a:hover { color: var(--ink); }

/* =========================================================== STORY VIEW */
/* ---------- header ---------- */
.top {
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 3px double var(--ink);
  position: relative; z-index: 30;
}
.home { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 6px 9px 6px 6px; border-radius: 8px; border: 1px solid transparent; white-space: nowrap; }
.home:hover { background: var(--paper-2); border-color: var(--rule); }
.top .lockup { flex: none; }
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; border-left: 1px solid var(--rule); padding-left: 14px; }
.brand-title { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#drawer-btn .short { display: none; }
/* Play-all run: "Playing all · 2 of 6 · Stop" in the notice colour; the chip ends the run */
.queue-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 0;
  background: var(--notice, var(--accent)); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.queue-chip .ico { width: 10px; height: 10px; }
.queue-chip b { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.queue-chip:hover { background: var(--ink); }
.notice-nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.notice-nav .btn { padding: 4px 9px; font-size: 15px; line-height: 1; }
.notice-pos { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); white-space: nowrap; padding: 0 4px; }
.notice-pos::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--notice, var(--accent)); margin-right: 7px; vertical-align: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--rule); text-decoration: none; white-space: nowrap;
}
.pill-src { color: var(--ink-2); background: var(--paper-2); }
.pill-src:hover { background: var(--paper-3); }
.pill-model { color: #fff; background: var(--ink); border-color: var(--ink); }
.pill-model::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(232, 149, 72, 0.28); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border-radius: 8px; border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink); font-weight: 500; font-size: 13px;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ink:hover { background: #3a3631; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-ghost { background: transparent; }
.btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- caption bar (Listening · Auto — tap anywhere to pause) ---------- */
.caption {
  position: fixed; left: 71%; top: calc(var(--top-h) + 12px); transform: translateX(-50%);
  z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; border-radius: 999px;
  background: var(--ink); color: var(--paper); border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow); font-size: 13px;
  animation: rise 0.5s ease-out both;
  max-width: calc(100vw - 24px); white-space: nowrap;
}
.caption-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.4s ease-in-out infinite; flex: none; }
.caption.paused .caption-dot { animation: none; background: var(--ink-3); }
.caption-label { overflow: hidden; text-overflow: ellipsis; }
.caption-cta { padding: 5px 11px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 600; flex: none; }
.caption:hover .caption-cta { background: #fff; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- app: stage (+ slim "More notices" drawer) ---------- */
.app { height: calc(100% - var(--top-h)); position: relative; }
.rail {
  position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 25; width: min(340px, 92vw);
  display: flex; flex-direction: column;
  background: var(--paper); border-right: 1px solid var(--rule);
  transform: translateX(-102%); transition: transform 0.25s ease; box-shadow: 20px 0 50px rgba(31,29,26,0.18);
  overflow: hidden;
}
.rail.open { transform: none; }
.rail-head { padding: 12px 10px 8px 14px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; }
.rail-kicker { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.notice-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; }
.ncard {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 9px 10px 9px 9px; border-radius: 9px; border: 1px solid var(--rule); background: var(--paper);
  transition: background 0.15s, border-color 0.15s;
}
.ncard:hover, .ncard.hover { background: var(--paper-2); }
.ncard.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ncard-n {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c); color: #fff; font-size: 11px; font-weight: 700;
}
.ncard.active .ncard-n { box-shadow: 0 0 0 2px var(--paper); }
.ncard-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ncard-meta { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.ncard-meta b { color: var(--c); }
.ncard.active .ncard-meta, .ncard.active .ncard-where, .ncard.active .ncard-stats { color: rgba(246,241,232,0.72); }
.ncard.active .ncard-meta b { color: #fff; }
.ncard-title { font-size: 13px; font-weight: 600; line-height: 1.25; }
.ncard-where { font-size: 11.5px; color: var(--ink-2); }
.ncard-stats { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rail-foot { display: flex; align-items: center; gap: 6px; margin: 0; padding: 12px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-top: 1px solid var(--rule); text-decoration: none; }
.rail-foot:hover { background: var(--paper-2); }
.rail-scrim { position: fixed; inset: var(--top-h) 0 0 0; background: rgba(31,29,26,0.35); z-index: 24; }

/* ---------- stage layout ---------- */
.stage {
  position: relative;
  height: 100%; min-width: 0;
  display: grid;
  grid-template-columns: minmax(360px, 42%) 1fr;
  grid-template-rows: 1fr var(--strip-h);
  grid-template-areas: "doc map" "strip strip";
}
.pane { position: relative; min-width: 0; min-height: 0; }
.pane-doc { grid-area: doc; background: var(--paper-2); border-right: 1px solid var(--rule); display: flex; flex-direction: column; }
.pane-map { grid-area: map; background: var(--map-paper); }
#map { position: absolute; inset: 0; }
.strip { grid-area: strip; }

/* ---------- document pane ---------- */
.doc-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; font-size: 12px; color: var(--ink-3);
  border-bottom: 1px solid var(--rule); background: var(--paper);
}
.doc-toolbar-title { font-weight: 600; color: var(--ink-2); }
.doc-toolbar-hint { flex: 1; text-align: right; }
.doc-toolbar-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink-2); }
.doc-toolbar-link .ico { width: 11px; height: 11px; }
.doc-toolbar-link:hover { background: var(--paper-2); }
.doc-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 18px 18px 120px;
  scroll-behavior: smooth;
  background:
    radial-gradient(ellipse at top, rgba(255,255,255,0.35), transparent 60%),
    var(--paper-2);
}
.doc-scroll:focus { outline: none; }
.page {
  position: relative;
  margin: 0 auto 18px; max-width: 760px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31,29,26,0.12), 0 8px 24px rgba(31,29,26,0.10);
  border-radius: 3px; overflow: hidden;
}
.page img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; filter: sepia(0.08) contrast(1.02); }
/* a page nothing was cited from is never rendered to a JPG: show quiet paper, not a broken image */
.page-blank { background: #fcfbf8; box-shadow: 0 1px 2px rgba(31,29,26,0.07); display: grid; place-items: center; }
.page-blank-note {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); opacity: 0.5;
}
.page-num {
  position: absolute; top: 8px; right: 10px;
  font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-3); background: rgba(255,255,255,0.8);
  padding: 2px 6px; border-radius: 4px;
}
.hl {
  position: absolute; cursor: pointer;
  background: var(--c);
  opacity: 0.22; border-radius: 2px;
  transition: opacity 0.2s, box-shadow 0.2s;
  mix-blend-mode: multiply;
}
.hl:hover { opacity: 0.45; }
.hl.active { opacity: 0.42; box-shadow: 0 0 0 2px var(--c); animation: hlpulse 2.2s ease-in-out infinite; z-index: 2; }
.hl-label {
  position: absolute; z-index: 3; transform: translateY(-100%); margin-top: -3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: var(--c); padding: 2px 6px; border-radius: 3px; white-space: nowrap;
  pointer-events: none; box-shadow: 0 1px 3px rgba(31,29,26,0.25);
}
@keyframes hlpulse { 0%, 100% { box-shadow: 0 0 0 2px var(--c); } 50% { box-shadow: 0 0 0 5px var(--c); } }

/* ---------- map extras ---------- */
.map-legend {
  position: absolute; right: 12px; top: 12px; z-index: 5; max-width: 220px;
  padding: 6px 10px 8px; border-radius: 8px;
  background: rgba(246, 241, 232, 0.94); border: 1px solid rgba(31, 29, 26, 0.2);
  font-size: 11px; color: var(--ink-2); backdrop-filter: blur(4px);
}
.map-legend summary { list-style: none; cursor: pointer; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.map-legend summary::-webkit-details-marker { display: none; }
.map-legend summary::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--step); flex: none; }
.map-legend summary::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.15s; }
.map-legend[open] summary::after { transform: rotate(-135deg); }
.legend-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.legend-list span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-list img { width: 24px; height: 14px; object-fit: contain; flex: none; }
.legend-states { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; padding-top: 6px; border-top: 1px solid rgba(31, 29, 26, 0.14); color: var(--ink-3); }
.legend-states span { display: flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--step); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--step); }
.lg-derived { opacity: 0.6; }
.lg-unverified { background: var(--map-paper); }

/* number callouts: leader lines from the step's main feature to the figures in its text */
.callouts { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.co-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.co-lines line { stroke: var(--step); stroke-width: 1.5; }
.co-lines circle { fill: var(--step); stroke: #fff; stroke-width: 1.5; }
.co {
  position: absolute; transform: translate(0, -50%);
  padding: 4px 9px 4px 8px; border-radius: 6px;
  background: rgba(246, 241, 232, 0.97); border: 1px solid var(--step); border-left-width: 3px;
  box-shadow: 0 2px 8px rgba(31, 29, 26, 0.15);
  font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.05; color: var(--ink); white-space: nowrap;
  animation: rise-co 0.5s ease-out both;
}
.co small { display: block; margin-top: 2px; font-family: var(--font); font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.co.left { transform: translate(-100%, -50%); border-left-width: 1px; border-right-width: 3px; }
@keyframes rise-co { from { opacity: 0; transform: translate(0, -40%); } to { opacity: 1; transform: translate(0, -50%); } }
.co.left { animation-name: rise-co-l; }
@keyframes rise-co-l { from { opacity: 0; transform: translate(-100%, -40%); } to { opacity: 1; transform: translate(-100%, -50%); } }
.map-hint {
  position: absolute; right: 14px; bottom: 30px; z-index: 5;
  font-size: 12px; color: var(--ink-2); background: rgba(246,241,232,0.92); padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(31,29,26,0.2); pointer-events: none;
}
.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 10px; background: rgba(246,241,232,0.75) !important; }
.maplibregl-ctrl-group { border-radius: 8px !important; box-shadow: 0 1px 4px rgba(31,29,26,0.2) !important; }
.maplibregl-popup-content { font-family: var(--font); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 12.5px; }
.maplibregl-popup-tip { border-top-color: var(--paper) !important; }
.maplibregl-canvas:focus { outline: none; }

/* ---------- step card ---------- */
.card {
  position: absolute; z-index: 20; min-width: 0;
  left: calc(42% + 18px); bottom: calc(var(--strip-h) + 16px);
  width: min(440px, calc(58% - 36px));
  padding: 14px 16px 14px;
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow);
  border-top: 4px solid var(--step);
  transition: border-color 0.4s;
}
.card-kicker {
  display: inline-flex; align-items: center; gap: 5px;
  margin: -4px 0 8px; padding: 6px 9px; border-radius: 6px;
  background: var(--notice, var(--accent)); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 1.3;
  animation: rise 0.5s ease-out both;
}
.card-kicker .ico { width: 9px; height: 9px; opacity: 0.8; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.card-page { color: var(--step); }
.card-title { margin: 4px 0 6px; font-family: var(--serif); font-size: 24px; line-height: 1.12; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
.card-text { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.card-quote {
  position: relative; margin: 2px 0 12px; padding: 4px 8px 4px 34px;
  border-left: 3px solid var(--step);
  font-family: var(--serif); font-style: italic; font-size: 14.5px; line-height: 1.38; color: var(--ink-2);
  cursor: pointer; border-radius: 0 6px 6px 0;
}
.card-quote::before {
  content: "\201C"; position: absolute; left: 8px; top: -6px;
  font-family: var(--serif); font-style: normal; font-weight: 600; font-size: 44px; line-height: 1; color: var(--step);
}
.card-quote > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-quote:hover { background: var(--paper-2); }

/* stat tiles: the figures in this step's text, echoed large (only numbers that appear in the text) */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin: 8px 0 2px; }
.stat-tile { min-width: 0; padding: 7px 9px 6px; border: 1px solid var(--rule); border-top: 3px solid var(--step); border-radius: 6px; background: var(--paper-2); }
.stat-tile b { display: block; font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile b small { font-size: 14px; font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.stat-tile span { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.25; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* before/after: only when a step has both an existing and a planned feature */
.ba { display: flex; align-items: center; gap: 4px; margin: -4px 0 10px; font-size: 12px; }
.ba-btn { border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2); padding: 5px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.ba-btn:first-child { border-radius: 999px 0 0 999px; }
.ba-btn + .ba-btn { border-radius: 0 999px 999px 0; margin-left: -1px; }
.ba-btn[aria-pressed="true"] { background: var(--step); border-color: var(--step); color: #fff; }
.ba-note { margin-left: 6px; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* narration line: under the step text, a subtle progress bar + which voice is in use */
.narration { margin: 0 0 10px; }
.narr-bar { height: 3px; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.narr-bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--step); transition: width 0.25s linear; }
.narration.tts .narr-bar i { background: repeating-linear-gradient(90deg, var(--step) 0 6px, transparent 6px 9px); }
.narr-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.narr-meta #narr-src { display: inline-flex; align-items: center; gap: 5px; }
.narr-meta #narr-src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--step); }
.narration.paused #narr-src::before { background: var(--ink-3); }
.narration.none #narr-src::before { background: var(--paper-3); box-shadow: inset 0 0 0 1px var(--ink-3); }

/* controls: big Continue, big Auto, small Listen + pace */
.card-controls { display: flex; flex-direction: column; gap: 8px; }
.ctl-row { display: flex; gap: 8px; align-items: center; }
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 15px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.ctl:active { transform: translateY(1px); }
.ctl .ico { width: 18px; height: 18px; }
.ctl-primary { flex: 1; background: var(--ink); color: var(--paper); border-color: var(--ink); font-size: 16px; }
.ctl-primary:hover { background: #3a3631; }
.ctl-primary.resume { background: var(--official); border-color: var(--official); color: #fff; }
.ctl-ghost { width: 46px; padding: 0; flex: none; background: transparent; }
.ctl-ghost:hover { background: var(--paper-2); }
.ctl-toggle { min-width: 104px; }
.ctl-toggle:hover { background: var(--paper-2); }
.ctl-toggle[aria-pressed="true"] { background: var(--step); border-color: var(--step); color: #fff; }
.ctl-sm { min-height: 34px; padding: 0 12px; font-size: 13px; min-width: 0; }
.ctl-sm .ico { width: 15px; height: 15px; }
.ctl-row-2 { justify-content: space-between; flex-wrap: wrap; row-gap: 6px; }
.pace { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--rule); border-radius: 8px; padding: 2px; font-size: 12px; }
.pace-btn { border: 0; background: transparent; padding: 5px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pace-btn:hover { background: var(--paper-2); }
.pace-btn:disabled { opacity: 0.35; cursor: default; }
.pace-label { min-width: 52px; text-align: center; font-weight: 700; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.ctl-link { border: 0; background: transparent; padding: 6px 4px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; }
.ctl-link:hover { color: var(--ink); background: var(--paper-2); }
.ctl-link .ico { width: 13px; height: 13px; }

/* ---------- step strip ---------- */
.strip {
  position: relative; z-index: 21; min-width: 0; overflow: hidden;
  background: var(--paper); border-top: 1px solid var(--rule);
  display: flex; align-items: stretch;
}
.strip-progress { position: absolute; left: 0; top: -1px; height: 3px; background: var(--step); width: var(--pct, 0%); transition: width 0.5s ease, background 0.4s; }
.strip-scroll {
  display: flex; gap: 6px; align-items: center;
  overflow-x: auto; overflow-y: hidden; padding: 0 14px; width: 100%;
  scrollbar-width: none;
}
.strip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { background: var(--paper-2); }
.chip .n {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--c); color: #fff; font-size: 11px; font-weight: 700;
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.active .n { box-shadow: 0 0 0 2px var(--paper); }

/* ---------- "Up next" card (end of a notice) ---------- */
.upnext { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: 16px; }
.upnext-scrim { position: absolute; inset: 0; background: rgba(31, 29, 26, 0.55); backdrop-filter: blur(2px); animation: fadein 0.3s ease-out both; }
.upnext-card {
  position: relative; width: min(440px, 100%); max-height: 100%; overflow: auto;
  background: var(--paper); color: var(--ink); border-top: 4px solid var(--c, var(--accent));
  box-shadow: 0 30px 80px rgba(31,29,26,0.4), 0 2px 6px rgba(31,29,26,0.2);
  padding: 14px 20px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px;
  animation: pop 0.35s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.upnext-kicker { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.upnext-k { color: var(--official); }
.upnext-thumb { position: relative; aspect-ratio: 9 / 5; background: var(--map-paper); border: 1px solid var(--rule); overflow: hidden; margin: 2px 0 0; }
.upnext-thumb svg, .upnext-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.upnext-meta { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.upnext-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
.upnext-where { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.upnext-stats { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.upnext-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.upnext-play {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 22px 8px 8px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 17px;
  transition: background 0.15s, transform 0.1s;
}
.upnext-play:hover { background: #3a3631; }
.upnext-play:active { transform: translateY(1px); }
.upnext-play:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ring { position: relative; width: 56px; height: 56px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.ring > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: rgba(246,241,232,0.16); stroke: rgba(246,241,232,0.25); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 175.93; stroke-dashoffset: 0; opacity: 0; }
.upnext.counting .ring-fg { opacity: 1; }
.play-ico { position: relative; width: 24px; height: 24px; margin-left: 3px; }
.upnext-play-label { font-variant-numeric: tabular-nums; min-width: 4.5ch; text-align: left; }
.upnext-stay { padding: 12px 18px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-weight: 600; font-size: 14px; }
.upnext-stay:hover { background: var(--paper-2); }
.upnext-count { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.upnext-count b { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); vertical-align: -2px; }

/* ---------- drawer ---------- */
.drawer {
  position: fixed; top: var(--top-h); right: 0; bottom: 0; z-index: 35;
  width: min(560px, 100%);
  background: var(--paper); border-left: 1px solid var(--rule);
  box-shadow: -20px 0 50px rgba(31,29,26,0.18);
  display: flex; flex-direction: column;
  animation: slidein 0.28s ease-out both;
}
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 12px; border-bottom: 1px solid var(--rule); }
.drawer-kicker { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.drawer-title { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
.drawer-body { overflow-y: auto; padding: 6px 18px 40px; font-size: 13.5px; }
.dsec { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.dsec:last-child { border-bottom: 0; }
.dsec h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.dsec h4 { margin: 14px 0 6px; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.dsec p { margin: 0 0 8px; color: var(--ink-2); }
.muted { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.pipeline { margin: 8px 0; padding: 0 0 0 18px; color: var(--ink-2); font-size: 12.5px; }
.pipeline li { margin: 3px 0; }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.stat { padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2); }
.stat b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.stat span { font-size: 11px; color: var(--ink-3); }
.evidence { margin: 0; padding: 0 0 0 18px; }
.evidence li { margin: 0 0 8px; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.evidence li q { font-style: italic; }
.evidence li button { display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; padding: 0; color: var(--step); font-weight: 600; font-size: 12px; margin-left: 4px; }
.evidence li button .ico { width: 11px; height: 11px; }
.evidence li button:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; }
.vtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.vtable th, .vtable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.vtable th { background: var(--paper-2); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; position: sticky; top: 0; }
.vtable tr:last-child td { border-bottom: 0; }
.vtable td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vtable .src { color: var(--ink-3); font-size: 11px; display: block; margin-top: 2px; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-verified { background: #DDEFE4; color: #1E6B44; }
.badge-derived { background: #F5E6C8; color: #8A5A12; }
.badge-unverified { background: #F3DADA; color: #8B2E2E; }
.callout { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #FBEFE9; border: 1px solid #F0CDBF; color: #6B3A2A; font-size: 12.5px; }
.callout b { color: #8B2E2E; }
.code {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: var(--ink); color: #EFE6D8; font-size: 11.5px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
details summary { cursor: pointer; color: var(--ink-2); font-weight: 500; margin-bottom: 8px; }

/* ---------- narrow desktop ---------- */
@media (max-width: 1560px) {
  .pill-model { font-size: 0; gap: 0; padding: 7px; }
  .pill-model::before { width: 9px; height: 9px; }
  .home span { display: none; }
}
@media (max-width: 1300px) { .pill-src { display: none; } }
@media (max-width: 1100px) {
  .notice-nav { display: none; }
  #drawer-btn .long { display: none; }
  #drawer-btn .short { display: inline; }
  .rail-toggle span { display: none; }
}
@media (max-width: 1240px) {
  .front-body, .masthead-inner, .masthead-strip-inner, .colophon-inner { padding-left: 32px; padding-right: 32px; }
  .lockup-mast .wordmark { font-size: 60px; }
  .lockup-mast .mark { width: 50px; height: 60px; }
  .mode-btn { padding: 10px 16px; font-size: 14px; }
  .lead-title { font-size: 44px; }
  .front-lower { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
  .grid { grid-column: 1 / 3; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
  .gitem:nth-child(n + 3) { border-top: 1px solid var(--rule); padding-top: 22px; }
  .side { grid-column: 3; }
  .front-more { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
  .front-more .gitem:nth-child(3n) { border-right: 1px solid var(--rule); padding-right: 20px; }
  .front-more .gitem:nth-child(2n) { border-right: 0; padding-right: 0; }
  .front-more .gitem:nth-child(n + 3) { border-top: 1px solid var(--rule); padding-top: 22px; margin-top: 22px; }
}
@media (max-width: 900px) and (min-width: 701px) {
  .mast-grid { grid-template-columns: 1fr; gap: 14px; }
  .mast-spacer { display: none; }
  .mast-mode { align-items: center; }
  .mast-mode-row { flex-direction: row; align-items: center; gap: 10px; }
  .front-lower { grid-template-columns: 1fr; }
  .grid, .side { grid-column: 1; }
  .side-sticky { position: static; }
  .lead { grid-template-columns: 1fr; gap: 18px; }
  .lead-text { padding-right: 0; border-right: 0; }
  .overview-wrap { min-height: 320px; }
}

/* ---------- mobile: front page stacks; story is stacked (map on top, card + controls, strip, PDF) ---------- */
@media (max-width: 900px) {
  :root { --top-h: 52px; --strip-h: 48px; }
  body { overflow: auto; }
  .top { padding: 0 10px; gap: 8px; }
  .home span { display: none; }
  .top .lockup { display: none; }
  .brand { border-left: 0; padding-left: 0; }
  .brand-title { font-size: 13.5px; }
  .pill-model { font-size: 0; gap: 0; padding: 6px; }
  .pill-model::before { width: 9px; height: 9px; }
  .pill-src { display: none; }
  #drawer-btn { padding: 6px 9px; font-size: 12px; }
  .caption { left: 50%; top: calc(var(--top-h) + 48vh - 54px); font-size: 12px; }

  .app { height: auto; min-height: calc(100% - var(--top-h)); }
  .stage {
    height: auto; min-height: calc(100% - var(--top-h));
    grid-template-columns: 1fr;
    grid-template-rows: 48vh auto var(--strip-h) auto;
    grid-template-areas: "map" "card" "strip" "doc";
  }
  .pane-map { height: 48vh; }
  .pane-doc { height: 80vh; border-right: 0; border-top: 1px solid var(--rule); }
  .card {
    position: static; grid-area: card; width: auto; left: auto; bottom: auto;
    border-radius: 0; box-shadow: none; border-top-width: 4px; padding: 12px 14px 14px;
  }
  .card-title { font-size: 20px; }
  .card-text { font-size: 13.5px; }
  .card-quote { font-size: 13.5px; }
  .card-quote > span { -webkit-line-clamp: 2; }
  .stat-tile b { font-size: 19px; }
  .stat-tile span { font-size: 9.5px; }
  .ctl { min-height: 50px; }
  .ctl-toggle { min-width: 96px; }
  .strip { position: sticky; top: var(--top-h); }
  .map-legend { font-size: 10px; padding: 5px 8px 6px; max-width: 180px; }
  .legend-states { display: none; }
  .co { font-size: 14px; padding: 3px 7px 3px 6px; }
  .co small { font-size: 8.5px; }
  .doc-scroll { padding: 12px 10px 80px; }
  .drawer { top: 0; width: 100%; }
}
/* ---------- phone front page (per Mobile.dc.html): one column, thumb-sized switch, list rows ---------- */
@media (max-width: 700px) {
  .front { height: auto; overflow: visible; }
  .front-body, .masthead-inner, .masthead-strip-inner, .colophon-inner { padding-left: 18px; padding-right: 18px; }
  .masthead-inner { padding-top: 14px; }
  .dateline { font-size: 10.5px; letter-spacing: 0.12em; gap: 8px; padding-bottom: 8px; }
  .dateline-model { display: none; }
  .dateline-edition { white-space: nowrap; }
  .edition-menu { text-align: right; }
  .edition-list { left: auto; right: 0; transform: none; }
  .edition-list::before { left: auto; right: 18px; transform: rotate(45deg); }
  #dateline-date .long { display: none; }
  #dateline-date .short { display: inline; }
  .mast-grid { grid-template-columns: 1fr; gap: 14px; padding: 18px 0 0; }
  .mast-spacer { display: none; }
  .mast-centre { gap: 8px; }
  .lockup-mast { gap: 12px; }
  .lockup-mast .mark { width: 40px; height: 48px; }
  .lockup-mast .wordmark { font-size: 44px; }
  .strapline { font-size: 16px; }
  .mast-mode { align-items: stretch; gap: 6px; }
  .mast-mode .mast-label { display: none; }
  .mast-mode-row { flex-direction: row; align-items: stretch; gap: 8px; }
  .mast-mode .mode { display: flex; flex: 1 1 0; min-width: 0; }
  .mast-mode .mode-btn { flex: 1 1 0; height: 46px; padding: 0 12px; font-size: 16px; }
  .playall { border-width: 2px; padding: 0 16px 0 14px; font-size: 14px; }
  .playall .ico { width: 14px; height: 14px; }
  .mast-help { text-align: center; font-size: 11.5px; }
  .masthead-strip { margin-top: 14px; }
  .masthead-strip-inner { flex-direction: column; align-items: stretch; gap: 6px; }
  .sections { gap: 16px; font-size: 11px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .sections::-webkit-scrollbar { display: none; }
  .front-summary { white-space: normal; font-size: 11.5px; }
  .front-body { padding-top: 18px; }
  .lead { grid-template-columns: 1fr; gap: 10px; padding-bottom: 20px; }
  .lead-text { padding-right: 0; border-right: 0; gap: 10px; }
  .lead-figure { order: -1; gap: 8px; }
  .overview-wrap { flex: none; min-height: 0; height: 240px; }
  .overview-badge { display: none; }
  .lead-figure figcaption { display: none; }
  .lead .kicker { font-size: 10.5px; }
  .lead-title { font-size: 32px; line-height: 1.06; }
  .standfirst { font-size: 17px; }
  .bignums { gap: 20px; margin-top: 0; }
  .bignum b { font-size: 26px; }
  .bignum b small { font-size: 15px; }
  .bignum span { font-size: 11px; margin-top: 3px; }
  .byline { display: none; }
  .lead-actions { padding-top: 4px; }
  .lead-actions .btn-open { flex: 1; height: 52px; padding: 0 16px; }
  .open-hint { display: none; }
  .front-body { display: flex; flex-direction: column; }
  .front-lower { display: contents; }
  .lead { order: 0; }
  .grid { order: 1; display: flex; flex-direction: column; padding-top: 6px; }
  .front-more { order: 2; }
  .front-read { order: 2; padding-top: 18px; }
  .front-read-grid { padding-top: 0; }
  .side { order: 3; }
  .gitem, .front-more .gitem { flex-direction: row; gap: 14px; padding: 16px 0 !important; margin: 0 !important; border-right: 0; border-top: 0 !important; border-bottom: 1px solid var(--rule); }
  .gitem-thumb, .front-more .gitem-thumb { display: block; width: 96px; height: 96px; flex: none; }
  .gitem-thumb .tn { left: 6px; top: 6px; width: 20px; height: 20px; font-size: 11px; }
  .gitem-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
  .gitem .kicker { font-size: 10.5px; }
  .gitem-title, .front-more .gitem-title { font-size: 19px; line-height: 1.15; letter-spacing: -0.01em; }
  .gitem-sum { display: none; }
  .gitem-where { margin-top: 0; }
  .gitem .btn-open { display: none; }
  .front-more { display: flex; flex-direction: column; border-top: 0; padding: 0; }
  .side { margin-top: 22px; }
  .side-sticky { position: static; gap: 16px; }
  .watchbox { padding-top: 12px; gap: 8px; }
  .watch-list { display: none; }
  .watch-foot { font-size: 13px; }
  .sidebox p { font-size: 13px; }
  .colophon-inner { flex-direction: column; gap: 10px; padding-top: 14px; padding-bottom: 32px; font-size: 11.5px; }
  .colophon-right { white-space: normal; }
  .queue-chip { padding: 5px 8px; font-size: 11.5px; }
  .queue-chip .long { display: none; }
  .top .mode-sm { padding: 2px; }
  .top .mode-sm .mode-btn { padding: 7px 9px; }
  .top .mode-sm .mode-btn span { display: none; }
  .top .mode-sm .mode-btn .ico { width: 16px; height: 16px; }
  .upnext { padding: 12px; align-items: center; }
  .upnext-card { padding: 12px 16px 16px; }
  .upnext-title { font-size: 22px; }
}
@media (max-width: 480px) {
  .chip .t { display: none; }
  .chip.active .t { display: inline; }
  .chip { padding: 5px 8px 5px 6px; }
  .ctl-toggle span { display: inline; }
  .ctl-link span { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .doc-scroll { scroll-behavior: auto; }
}
