/* Argus — night plotting-room chart.
   Palette is a legend, not decoration: every hue carries meaning. */

/* ---------- self-hosted fonts (vendored 2026-09-05; no Google Fonts at runtime).
   Both Newsreader files and the Big Shoulders file are variable-weight woff2s —
   one file serves the whole declared weight range. Latin subset only. ---------- */

@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(vendor/fonts/big-shoulders-display-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(vendor/fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(vendor/fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Sans (vendored 2026-10-17, OFL): the UI face. Small UI text was set in
   Plex Mono at 11px and readers called it too hard to read; a proportional face
   at 13px+ reads far better. Mono stays only where digits must line up. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(vendor/fonts/ibm-plex-sans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(vendor/fonts/ibm-plex-sans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(vendor/fonts/ibm-plex-sans-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(vendor/fonts/newsreader-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(vendor/fonts/newsreader-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* --- the token system (2026-09-05 overhaul). Legacy names below alias into
     these — 2000 lines keep their vars, the values move here. --- */

  /* background layers, darkest to most raised */
  --bg-0: #0B0F16;
  --bg-1: #0F141C;
  --bg-2: #151C28;
  --bg-3: #1B2432;

  /* text tiers */
  --tx-1: #EDE8DA;        /* primary — chart-paper cream */
  --tx-2: #B8B4A4;        /* secondary */
  --tx-3: #969BA8;        /* tertiary / metadata — lifted from #7E8391 2026-10-17 (6.7:1 on --bg-1) */

  /* two-weight divider system: --rule for section-grade lines, --hairline for
     item separators */
  --hairline: #1C2637;
  --rule: #2A3852;

  /* type stops — 13px is the metadata floor (exceptions: a cluster ring's count
     at 12px, uppercase micro-heads at 12px).
     Raised 2026-10-17 (11/13/16/22 → 13/15/18/24): reader feedback said the
     print was too small and hard to read; 85% of visible text sat at 11–13px. */
  --fs-meta: 13px;
  --fs-ui: 15px;
  --fs-body: 18px;
  --fs-h: 24px;
  --fs-display: 32px;

  /* spacing + shape */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 20px; --sp-5: 32px;
  --radius: 3px;
  --elev-1: 0 1px 2px rgb(0 0 0 / .4);
  --elev-2: 0 8px 28px rgb(0 0 0 / .55), 0 0 0 1px var(--rule);

  /* --- legacy names, aliased (semantics unchanged) --- */
  --ground: var(--bg-1);  /* chart ink */
  --paper:  var(--bg-2);  /* raised surfaces */
  --line:   var(--rule);  /* graticule / section rules */
  --line-soft: var(--hairline);
  --ink:    var(--tx-1);  /* chart-paper cream */
  --ink-dim: var(--tx-2);
  --lamp:   #FFB254;      /* unseen dispatches — this hue means "unseen", nothing else */
  --sea:    #5C8DB8;      /* world lane */
  --up:     #5FAE7E;      /* markets up */
  --down:   #D2685A;      /* markets down */
  --violet: #9C86C9;      /* tracks lane */
  --alert-red:   #E4574B; /* an alert that needs a hand today (brighter than --down: it must read at --fs-meta) */
  --alert-amber: #FFB254; /* an alert that is drift to watch — the lamp's hue, because the lamp already means "look" */

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Newsreader", Georgia, serif;
  /* --mono is kept as a NAME (130+ rules use it) but since 2026-10-17 it points at
     the proportional UI face. Real monospace lives in --figures: prices, changes,
     anything whose digits must line up. */
  --ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --figures: "IBM Plex Mono", ui-monospace, monospace;
  --mono: var(--ui);
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
}
/* one row of chrome only works if nothing in it wraps its own words: the
   destinations shrink (and scroll), the delta stamp gives way first, buttons never */
.top > .btn, .top > .guest-stamp { flex: none; white-space: nowrap; }
#btn-account { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
/* below ~1440px wordmark + seven destinations + a signed-in reader's buttons
   (since-you-left, mark all seen, settings, a long email) do not fit one row:
   there the nav drops back to a row of its own under the bar */
@media (min-width: 701px) and (max-width: 1440px) {
  .top { flex-wrap: wrap; row-gap: 0; }
  .top > .viewnav {   /* .top > — the base .viewnav rule sits later in the file */
    order: 10;
    flex: 1 0 100%;
    margin: .55rem calc(-1.1rem - env(safe-area-inset-right)) calc(-.65rem - 1px) calc(-1.1rem - env(safe-area-inset-left));
    padding-left: calc(.4rem + env(safe-area-inset-left));
    border-top: 1px solid var(--hairline);
  }
  .top .viewtab { padding: .5rem .7rem .42rem; }
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: .14em;
  display: flex;
  align-items: flex-start;
  gap: .18rem;
}

.wordmark-eye {
  width: .42rem; height: .42rem;
  margin-top: .28rem;
  border-radius: 50%;
  background: var(--lamp);
}

/* the delta stamp is the door to the brief */
.delta {
  font-family: var(--mono);
  font-size: .875rem;
  color: var(--ink-dim);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.delta:hover, .delta:focus-visible { color: var(--ink); }
.delta.has-unseen { color: var(--lamp); }
.delta.has-unseen:hover { color: var(--ink); }

/* ---------- honest refinery notice ---------- */

.notice {
  font-family: var(--mono);
  font-size: var(--fs-ui);
  color: var(--tx-3);   /* demoted: status, not an alarm — lamp-orange stays "unseen" */
  border-bottom: 1px solid var(--line);
  padding: .45rem 1.1rem;
}
.notice::before {
  content: '';
  display: inline-block;
  width: .4rem; height: .4rem;
  border-radius: 50%;
  background: var(--lamp);
  margin-right: .5rem;
  vertical-align: baseline;
}

/* ---------- console: search + lane chips ---------- */

.console {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .4rem 1.1rem;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono);
}

.console-search {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--fs-ui);
  padding: .3rem .85rem;
  width: min(260px, 40vw);
}
.console-search::placeholder { color: var(--tx-3); }
.console-search:focus-visible { outline: 1px solid var(--lamp); }

.console-chips { display: flex; gap: .25rem; flex-wrap: wrap; }

/* A lane filter is a toggle, and says which lane by its DOT — the same hue the
   lane's rings carry on the chart, so the filter doubles as the legend. Off = a
   hollow dot and dim text. (Until 2026-10-04 these were all-caps outlined pills,
   the same shout as every other label on the page.) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--mono);
  font-size: var(--fs-ui);
  letter-spacing: .02em;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--tx-3);
  padding: .2rem .65rem .2rem .55rem;
  cursor: pointer;
}
.chip[data-lane]::before, .chip-dormant::before {
  content: '';
  width: .5rem; height: .5rem;
  border-radius: 50%;
  border: 1.5px solid var(--lane, var(--ink-dim));
  flex: none;
}
.chip[data-lane="world"]   { --lane: var(--sea); }
.chip[data-lane="markets"] { --lane: var(--up); }
.chip[data-lane="track"]   { --lane: var(--violet); }
.chip.on { color: var(--ink); background: var(--bg-2); border-color: var(--hairline); }
.chip.on[data-lane]::before, .chip-dormant.on::before { background: var(--lane, var(--ink-dim)); }
.chip-dormant::before { border-style: dashed; }   /* the dormant ring on the chart is dashed too */
.chip-dormant.on::before { border-style: solid; }
/* the documented [hidden] trap, guarded the same way .chip-lens is */
.chip[hidden] { display: none; }
.chip:hover, .chip:focus-visible { color: var(--ink); }

/* Subjects (public/topics.js): one at a time, so no lane dot; a thin rule sets
   the group apart from the lanes, and the count says what a click would show. */
.topic-chips {
  display: flex; gap: 0 .1rem; flex-wrap: wrap; align-items: center;
  flex: 1 1 0; min-width: 0;
  padding-left: .8rem; border-left: 1px solid var(--hairline);
}
/* the lanes keep one line; when the row runs short it is the subjects that wrap */
.console-chips { flex: none; flex-wrap: nowrap; }
.chip-topic { padding-left: .55rem; padding-right: .55rem; }
/* a laptop: beside the search and lanes the subjects broke into three short
   lines; on a row of their own all ten fit on one (measured at 1280px) */
@media (min-width: 701px) and (max-width: 1500px) {
  .console { flex-wrap: wrap; row-gap: .15rem; }
  .topic-chips { flex: 1 1 100%; padding-left: 0; border-left: 0; margin-left: -.55rem; }
}
.chip-topic .topic-n {
  font-family: var(--figures); font-size: var(--fs-meta);
  color: var(--tx-3);
}
.chip-topic.on .topic-n { color: var(--lamp); }
.chip-topic.on { border-color: var(--lamp); }

/* ---------- board: chart + margin ---------- */

.board {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr clamp(280px, 19vw, 340px);
  min-height: 0;
  position: relative;
}

/* the graticule is drawn by Leaflet as real lat/lon geometry — see addGraticule() */
#map {
  /* the ocean: a subtle vignette, a step DARKER than the land (HEAT_FILLS[0]
     in app.js) so the continents stand out of it — before 2026-09-07 land and
     sea were within a few RGB points of each other and the world was a guess */
  background: radial-gradient(ellipse at 50% 40%, #0E1622, #080C13);
  outline: none;
}

/* countries drawn by Leaflet GeoJSON get stroke via JS options */
.leaflet-container { background: transparent; font: inherit; }
.leaflet-control-attribution { display: none; }
.leaflet-control-zoom a {
  background: var(--paper); color: var(--ink);
  border-color: var(--line);
}

.chart-legend {
  position: absolute;
  left: .9rem; bottom: .7rem;
  z-index: 500;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .08em;
  color: var(--ink-dim);
  pointer-events: none;
  text-shadow: 0 1px 3px var(--ground);
}
.legend-lamp {
  display: inline-block;
  width: .5rem; height: .5rem;
  border-radius: 50%;
  background: var(--lamp);
  vertical-align: baseline;
}

/* the chart margin — placeless storylines live here, part of the chart itself */
.margin {
  border-left: 1px solid var(--line);
  background: var(--ground);
  padding: 1rem .9rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.stamp {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--ink-dim);
  margin-bottom: .55rem;
}
.stamp-inline { margin-bottom: 0; }

.margin-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .3rem; }

/* always-on quiet cards, not bare rows — 2026-10-04: the outline went (a stack of
   identical boxed rows read as one grey wall); the fill alone holds the card. */
.margin-item {
  display: flex; align-items: baseline; gap: .5rem;
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg-2) 72%, var(--bg-1));
  border-radius: var(--radius);
}
.margin-item:hover, .margin-item:focus-visible { background: var(--bg-3); border-color: var(--rule); }

.margin-item .dot {
  flex: none;
  width: .55rem; height: .55rem;
  border-radius: 50%;
  border: 1.5px solid var(--sea);
  /* top-aligned: stays on the first line of a wrapping name */
  align-self: flex-start;
  margin-top: .3rem;
}
.margin-item[data-lane="track"] .dot { border-color: var(--violet); }
.margin-item[data-lane="markets"] .dot { border-color: var(--up); }
.margin-item.unseen .dot { background: var(--lamp); border-color: var(--lamp); animation: lamp 2.2s ease-in-out infinite; }
/* F-9: the lifecycle tier colours the dot — the same signal the chart/dossier draw.
   Colour and opacity only, never size or position, so the row never reflows. Every
   rule is guarded :not(.unseen) because the unread lamp always wins: a storyline
   that moved since you last looked reads as unseen first, cooling/dormant second.
   active is the default dot (lane colour), so it needs no rule. */
.margin-item[data-life="cooling"]:not(.unseen) .dot { background: color-mix(in srgb, var(--lamp) 60%, var(--line)); border-color: color-mix(in srgb, var(--lamp) 60%, var(--line)); }
.margin-item[data-life="dormant"]:not(.unseen) .dot { background: none; border-color: var(--ink-dim); opacity: .7; }
.margin-item[data-life="resolved"]:not(.unseen) .dot { background: none; border-color: var(--sea); opacity: .6; }

.margin-item .name { font-size: .95rem; line-height: 1.35; }
.margin-item.unseen .name { color: var(--ink); font-weight: 500; }
.margin-item:not(.unseen) .name { color: var(--ink-dim); }

.margin-item .when {
  margin-left: auto;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--tx-3);
  flex: none;
}
.margin-item.unseen .when { color: var(--lamp); }

.margin-empty { font-size: var(--fs-ui); font-style: italic; color: var(--ink-dim); }

/* Your attention (F-12): a ranked, display-only read-out — rank · title · reason · score.
   The title is a button that only navigates, so it is reset to read as a plain link. */
.set-attention-row { align-items: baseline; gap: .5rem; cursor: default; }
.set-attn-rank {
  flex: none; min-width: 1.4rem; text-align: right;
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim);
}
.set-attention-row .name {
  flex: none; margin: 0; padding: 0; border: 0; background: none;
  font: inherit; font-size: .95rem; color: var(--ink);
  text-align: left; cursor: pointer;
}
.set-attention-row .name:hover, .set-attention-row .name:focus-visible { text-decoration: underline; }
.set-attn-why { flex: 1 1 auto; color: var(--ink-dim); font-size: var(--fs-meta); }
.set-attn-score {
  flex: none; margin-left: auto;
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink);
}

/* ---------- storyline markers on the chart ---------- */

.marker { background: none; border: none; }

.marker .ring {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid var(--sea);
  background: color-mix(in srgb, var(--sea) 26%, transparent);
  display: block;
}
.marker[data-lane="track"] .ring { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 26%, transparent); }
.marker[data-lane="markets"] .ring { border-color: var(--up); background: color-mix(in srgb, var(--up) 26%, transparent); }

/* recency is drawn: a quiet storyline fades toward the paper */
.marker[data-age="warm"] .ring { opacity: .72; }
.marker[data-age="cold"] .ring { opacity: .45; }

/* LIFECYCLE is drawn on top of recency, on its own channel: recency fades the ring's
   opacity; lifecycle changes its SHAPE. So a story reads as alive, slowing, asleep or
   closed at a glance — the chart is a living model, not a directory. Hue still carries
   lane; unread (below) still overrides colour, and it should — a fresh diff on a
   dormant story has already woken it. active = the default, no extra weight.
   cooling: a thin gap opens in the ring — the mark is thinning out.
   dormant: hollow + dashed, the lane hue kept but quiet — asleep, still tappable.
   resolved: dotted and faint — closed; it lives on the dossier/history, rarely the map. */
.marker[data-life="cooling"] .ring { border-style: dashed; }
.marker[data-life="dormant"] .ring {
  border-style: dashed;
  background: transparent;
  opacity: .5;
}
.marker[data-life="resolved"] .ring {
  border-style: dotted;
  background: transparent;
  opacity: .38;
}
/* F-17: a reader-RESOLVED storyline (per-user mark 'done', distinct from the global
   lifecycle "resolved" above) stays on the map but dimmed — visible for context, not
   shouting. Mute removes the marker entirely; this keeps it, greyed. */
.marker[data-done="1"] .ring { opacity: .4; filter: grayscale(.65); }
.marker.cluster[data-done="1"] .ring { opacity: .4; filter: grayscale(.65); }
.marker[data-done="1"] .marker-label { opacity: .45; }

.marker.unseen .ring {
  border-color: var(--lamp);
  background: color-mix(in srgb, var(--lamp) 26%, transparent);
  opacity: 1;
  animation: lamp 2.2s ease-in-out infinite;
}

/* ---------- the read tier ----------
   A storyline you have read stays exactly where it happened and stops asking for
   you: the RING shrinks and fades, the icon box does not, so the tap target is the
   same size it always was. (Kunjie, on why read marks must not vanish: "quiet dots
   I think is good otherwise we cant click right".) Brightness carries read-state,
   hue still carries lane — the two never share a channel. */
.marker.read .ring {
  transform: scale(.62);
  opacity: .4;
  border-width: 1.5px;
}
.marker.read[data-age="warm"] .ring { opacity: .34; }
.marker.read[data-age="cold"] .ring { opacity: .26; }
.marker.read:hover .ring, .marker.read:focus-visible .ring { transform: scale(.85); opacity: .8; }
/* a cluster with nothing left keeps its landmark, at a whisper */
.marker.cluster.all-read .ring { opacity: .45; }
.marker.cluster.all-read .count { color: var(--ink-dim); }
/* …but its NAME still wins room like every other label. Without `.labelled` here
   a read cluster named itself unconditionally and sat across whatever the
   placement pass had just put down (three overlapping names on a 390px chart). */
.marker.cluster.all-read.labelled .marker-label { opacity: .45; }
@media (prefers-reduced-motion: no-preference) {
  .marker .ring { transition: transform .18s ease, opacity .18s ease; }
}

@keyframes lamp {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 178, 84, .0); }
  50%      { box-shadow: 0 0 14px 3px rgba(255, 178, 84, .45); }
}

@media (prefers-reduced-motion: reduce) {
  .marker.unseen .ring, .margin-item.unseen .dot, .state-card.unseen .dot { animation: none; box-shadow: 0 0 10px 2px rgba(255,178,84,.4); }
}

/* labels hang centred under the ring like chart annotations. 2026-10-04: a size up
   and onto a dark plate — at .62rem grey on the land fill they were half-legible and
   read as noise. The plate's padding is counted in app.js (LABEL_PAD_EM). */
.marker-label {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: .8125rem;   /* app.js placeLabels mirrors this (fontPx) */
  line-height: 1.3;
  letter-spacing: .02em;
  color: var(--tx-2);
  background: rgb(11 15 22 / .78);
  padding: 0 .32rem;
  border-radius: 2px;
  white-space: nowrap;
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity .12s ease-out;
  pointer-events: none;
}
/* Standing labels for the storylines that earn the space; the rest on hover. */
.marker.labelled .marker-label { opacity: 1; }
.marker:hover .marker-label,
.marker:focus-visible .marker-label { opacity: 1; color: var(--ink); max-width: none; }
/* A hovered marker's label must sit above its neighbours' rings, not under them. */
.marker:hover { z-index: 900 !important; }

@media (prefers-reduced-motion: reduce) { .marker-label { transition: none; } }

/* ---------- markets wire strip ---------- */

.wire-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .5rem 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--figures);
  font-variant-numeric: tabular-nums;
  font-size: .875rem;
  overflow-x: auto;
}

.tickers { display: flex; gap: 1.6rem; flex: 1; align-items: center; }

.tick { display: inline-flex; gap: .5rem; align-items: center; cursor: pointer; white-space: nowrap; background: none; border: none; color: var(--ink); font: inherit; padding: 0; }
.tick .sym { font-weight: 500; }
.tick .spark { flex: none; }
.spark { color: var(--ink-dim); }
.spark.up { color: var(--up); }
.spark.down { color: var(--down); }
.tick .px { color: var(--ink-dim); font-size: var(--fs-ui); }
.tick .mv.up { color: var(--up); }
.tick .mv.down { color: var(--down); }
.tick .why { color: var(--ink-dim); font-style: italic; font-family: var(--body); font-size: var(--fs-ui); max-width: 34ch; overflow: hidden; text-overflow: ellipsis; }
/* The honest footnote on a commodity: this close is the proxy fund's, not the
   barrel's. Quiet enough not to compete with the price, present enough to read. */
.tick .via { color: var(--ink-dim); font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .04em; }
.tick:hover .sym, .tick:focus-visible .sym { color: var(--lamp); }

.tickers-empty { color: var(--ink-dim); }

/* ---------- the brief ---------- */

.brief {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--ground) 62%, transparent);
  display: flex; justify-content: flex-start;
  z-index: 1000;
}
.brief[hidden] { display: none; }

.brief-inner {
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  box-shadow: var(--elev-2);
  padding: 1.4rem 1.6rem 3rem;
  animation: slide-in-left .22s ease-out;
}
@keyframes slide-in-left { from { transform: translateX(-24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .brief-inner { animation: none; } }

.brief-head { display: flex; align-items: center; justify-content: space-between; }

.brief-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.brief-since {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-dim);
  margin: .3rem 0 1.2rem;
}

.brief-list { list-style: none; padding: 0; }

.brief-rule {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lamp);
  border-top: 1px solid var(--line);
  padding-top: .8rem;
  margin: 1.1rem 0 .5rem;
}
.brief-rule-dim { color: var(--ink-dim); }

/* The held-back backlog: one quiet line, one click to unroll it. */
.brief-deeper { text-transform: none; letter-spacing: normal; border-top: none; padding-top: 0; }
.brief-deeper button {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .06em;
  color: var(--ink-dim);
  background: none;
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: .5rem .7rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.brief-deeper button:hover, .brief-deeper button:focus-visible { color: var(--lamp); border-color: var(--lamp); }

.brief-item button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid var(--hairline);
  color: var(--ink);
  font: inherit;
  padding: .45rem 0 .55rem .85rem;
  cursor: pointer;
}
.brief-item button:hover, .brief-item button:focus-visible { background: color-mix(in srgb, var(--ground) 55%, transparent); }
.brief-item.unseen button { border-left-color: var(--lamp); }

.brief-item .b-head { display: flex; align-items: baseline; gap: .5rem; }
.brief-item .dot {
  flex: none;
  width: .5rem; height: .5rem;
  border-radius: 50%;
  border: 1.5px solid var(--sea);
  /* keeps station on the FIRST line of a wrapping headline, like the front page's */
  align-self: flex-start; margin-top: .42rem;
}
.brief-item[data-lane="markets"] .dot { border-color: var(--up); }
.brief-item[data-lane="track"] .dot { border-color: var(--violet); }
.brief-item.unseen .dot { background: var(--lamp); border-color: var(--lamp); }

.brief-item .b-title { font-weight: 500; font-size: .95rem; }
.brief-item .b-ts { margin-left: auto; font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); flex: none; }

/* a storyline's older dispatches, under its newest one: same rail, the title not
   repeated, the stamp ABOVE each line so the eye walks back in time down the
   column (side by side, a phone squeezed the text into a 20-character strip) */
.brief-item button.b-earlier {
  padding: .3rem 0 .45rem 1.85rem;
  font-size: .9rem;
  color: var(--ink-dim);
}
.brief-item button.b-earlier .b-ts { display: block; margin-left: 0; }

/* ---------- since you left: a MODE of the chart, with a rail beside it ----------

   Not an overlay. While body[data-sinceleft="on"] the rail takes the margin's
   column and the map keeps the rest; only what moved is lit (app.js litOf), and
   the legend in the corner says so. Everything here is measured in rem / vw /
   ch / clamp — a 1024 laptop, a 4K wall and a phone all get the same layout at
   their own size, which is the whole brief. No fixed pixel widths. */

body[data-sinceleft="on"] .board { grid-template-columns: 1fr clamp(20rem, 26vw, 40rem); }
body[data-sinceleft="on"] .margin { display: none; }
body[data-sinceleft="on"] .chart-legend:not(.chart-legend-sinceleft) { display: none; }
.chart-legend-sinceleft { display: none; }
body[data-sinceleft="on"] .chart-legend-sinceleft { display: block; }

.sinceleft {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  min-height: 0;             /* let the inner scroller shrink instead of the board */
  overflow: hidden;          /* the RAIL is the fixed frame; only .sinceleft-scroll scrolls */
  border-left: 1px solid var(--line);
  background: var(--ground);
  padding: 1rem .9rem 2rem;
}
/* display:flex outranks the browser's [hidden] rule — the documented trap */
.sinceleft[hidden] { display: none; }
/* the phone sheet's grip — nothing to grab on a docked rail */
.sinceleft-grip { display: none; }
/* The rail's fixed parts (head, Verdict, actions) keep their height; the record
   (Yours + The World) lives in .sinceleft-scroll and is the only thing that
   scrolls. A column flex container that scrolled as a whole used to SHRINK its
   items to fit before scrolling — at 390px that squashed the title and left a
   sticky region head where the headline should be (the 390/1024 E2E screenshots). */
.sinceleft > * { flex: none; }
.sinceleft-scroll {
  flex: 1 1 auto;
  /* A floor, not just 0: without it a tall Verdict (long sentences, 5 rows) can
     starve this element down to nothing, which is what made the record
     unreachable — no scrollbar, no content, no way to see what's below the
     fold. 15% keeps a usable strip always in view; the Verdict's own cap above
     keeps the two from fighting over the same space in the first place. */
  min-height: 15%;
  overflow-y: auto;
  /* Keep a pull-down at the top from becoming the browser's own rubber-band /
     native pull-to-refresh — F-7 owns that gesture (spec §3). */
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

/* TIER 1 — THE VERDICT: the ten-second answer, pinned above the waterline. Its
   height is set by its rows (3–5, capped by count), not by how much moved, so it
   is the same size for 5 changes or 500 (brief §2). It never scrolls in the
   common case — but 5 rows of a real sentence + tag + timestamp can still run
   taller than a short rail (measured: 418px of a 619px-tall rail, leaving 0px
   for .sinceleft-scroll below — the reported "can't scroll" bug, since a
   flex:none sibling never yields space back and the one flexible item
   (.sinceleft-scroll) absorbed the entire deficit down to nothing). The cap
   below is the safety valve: normally invisible (nothing here scrolls), it
   only engages when the Verdict itself would otherwise starve the record. */
.sinceleft-verdict { display: flex; flex-direction: column; gap: .5rem; max-height: 48%; overflow-y: auto; }
.sinceleft-verdict[hidden] { display: none; }
/* THE CLOSURE LINE — a horizon, not a cut (brief §3). It replaces "+N more": the
   language of closure that gives permission to stop, set below a quiet waterline. */
.sinceleft-closure {
  margin: .2rem 0 0;
  padding-top: .6rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--body);
  font-style: italic;
  font-size: .9rem;
  color: var(--ink-dim);
}
.sinceleft-closure:empty { display: none; }

.sinceleft-head { display: flex; align-items: flex-start; gap: .6rem; }
.sinceleft-headings { min-width: 0; flex: 1; }
.sinceleft-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2.1rem);
  font-weight: 700;
  letter-spacing: .01em;
  margin: 0;
}
.sinceleft-meta {
  margin: .2rem 0 0;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-dim);
  letter-spacing: .04em;
}

/* F-13 — THE CHIP FILTER. Outlined pills, the active one filled. It sits in the
   pinned head region, so on the phone sheet it stays put while the record scrolls
   under it. flex-wrap keeps All / Yours / Markets inside a 375px sheet without a
   horizontal scrollbar. :empty collapses it before the first render. */
.sinceleft-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .1rem; }
.sinceleft-chips:empty { display: none; }
.sinceleft-chip {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .04em;
  padding: .28rem .72rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  line-height: 1.3;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.sinceleft-chip:hover { border-color: var(--ink-dim); color: var(--ink); }
.sinceleft-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg-1);
}

/* THE SHAPE OF IT — the assembled opening line. This element is the slot a
   model-written sentence would take over later; keep its box and its class. */
.sinceleft-shape {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--lamp);
  padding-left: .8rem;
}
.sinceleft-shape:empty { display: none; }

.sinceleft-sec { display: flex; flex-direction: column; }
.sinceleft-sec[hidden] { display: none; }
.sinceleft-stamp { margin-bottom: .35rem; }
.sinceleft-actions { margin-top: auto; padding-top: 1rem; }

/* a region owns the rail while you are inside it — the header stays put */
.sinceleft-region + .sinceleft-region { margin-top: 1rem; }
.sinceleft-region-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin: 0 0 .35rem;
  padding: .35rem 0;
  background: var(--ground);
  border-bottom: 1px solid var(--hairline);
}
.sinceleft-region-name {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink);
}
.sinceleft-region-n {
  margin-left: auto;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-dim);
  white-space: nowrap;
}
.sinceleft-country {
  margin: .5rem 0 .15rem;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--ink-dim);
}
.sinceleft-tag {
  flex: none;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .06em;
  color: var(--lamp);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0 .35rem;
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sinceleft-list { list-style: none; margin: 0; padding: 0; }
.sinceleft-row {
  display: flex;
  align-items: flex-start;     /* the dot sits on the label line, not mid-paragraph */
  gap: .6rem;
  width: 100%;
  min-height: 44px;            /* a whole row is one thumb — phone tap target floor */
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid var(--hairline);
  color: var(--ink);
  font: inherit;
  padding: .45rem .3rem .45rem .85rem;
  cursor: pointer;
}
.sinceleft-row:hover, .sinceleft-row:focus-visible { background: color-mix(in srgb, var(--ground) 55%, transparent); }
.sinceleft-item .dot {
  flex: none;
  width: .5rem; height: .5rem;
  border-radius: 50%;
  border: 1.5px solid var(--sea);
}
.sinceleft-item[data-lane="markets"] .dot { border-color: var(--up); }
.sinceleft-item[data-lane="track"] .dot { border-color: var(--violet); }
.sinceleft-item .dot { margin-top: .3rem; }
/* F-9: lifecycle tier on the rail dot — colour/opacity only, same tiers as the
   margin lists. resolved is filtered out of the rail upstream, so only cooling
   and dormant can appear here; active is the default dot. */
.sinceleft-item[data-life="cooling"] .dot { background: color-mix(in srgb, var(--lamp) 60%, var(--line)); border-color: color-mix(in srgb, var(--lamp) 60%, var(--line)); }
.sinceleft-item[data-life="dormant"] .dot { background: none; border-color: var(--ink-dim); opacity: .7; }
/* The row is the news (2026-09-07): the storyline's NAME is a small mono label on
   one line — a headline-length name ellipsizes, a state name ("Lebanon front") fits
   whole — and the newest change's sentence is the reading line in the body serif. */
.sinceleft-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.sinceleft-head { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.sinceleft-name {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sinceleft-when { margin-left: auto; font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); flex: none; white-space: nowrap; }
.sinceleft-latest { font-family: var(--body); font-size: .95rem; line-height: 1.35; color: var(--ink); }
.sinceleft-more { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); white-space: nowrap; }
.sinceleft-n { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); white-space: nowrap; }
/* "To the map" is the rail's one primary verb — lamp, like the dossier's probe */
#sinceleft-map { border-color: var(--lamp); color: var(--lamp); }
#sinceleft-map:hover, #sinceleft-map:focus-visible { color: var(--ink); }
.brief-item .b-summary { display: block; font-size: .95rem; color: var(--ink); margin-top: .15rem; }
.brief-item:not(.unseen) .b-summary { color: var(--ink-dim); }
.brief-item button.b-earlier .b-summary { margin-top: 0; font-size: .9rem; }
.brief-item .b-why { display: block; font-size: var(--fs-ui); font-style: italic; color: var(--ink-dim); margin-top: .1rem; }
/* F-17: "Reopened" — a storyline the reader had resolved is back because it moved
   again. Sits inline by the title in the brief; the lamp tone marks it as new. */
.brief-item .b-reopened {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lamp);
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 .28rem;
  margin-left: .4rem;
  flex: none;
  line-height: 1.4;
}

.brief-actions { margin-top: 1.6rem; }

/* ---------- dossier sheet ---------- */

.sheet {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--ground) 62%, transparent);
  display: flex; justify-content: flex-end;
  z-index: 1000;
}
/* app.js closes the dossier with the hidden attribute; the display above outranks the
   browser's [hidden] rule, so without this the empty sheet covers the margins forever. */
.sheet[hidden] { display: none; }

.sheet-inner {
  width: min(620px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  box-shadow: var(--elev-2);
  padding: 1.4rem 1.6rem 3rem;
  animation: slide-in .22s ease-out;
  /* the grip hangs off this box, and the columns below ask it how wide it is */
  position: relative;
  container-type: inline-size;
  container-name: sheet;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet-inner { animation: none; } }

/* ---------- the width grip ----------
   A slim column on the drawer's LEFT edge — the edge the reader is looking at.
   Invisible until it is wanted: a hairline that brightens under the pointer and
   lights the lamp while it has focus or is being dragged. Drawn only on desktop
   (the min-width:1100px block turns it on) and never on a coarse pointer, where
   the drawer is the whole screen and there is nothing to drag. */
.sheet-grip {
  display: none;
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 14px;
  cursor: col-resize;
  touch-action: none;      /* the pointer events are the drag, not a scroll */
  z-index: 2;
}
.sheet-grip::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 1px;
  /* at rest it is one more hairline, the app's own vocabulary for an edge; it
     only asks to be noticed under the pointer */
  background: var(--hairline);
  transition: background .12s ease-out;
}
.sheet-grip:hover::before { background: var(--rule); }
.sheet-grip:focus-visible { outline: none; }
.sheet-grip:focus-visible::before, .sheet-grip.dragging::before { background: var(--lamp); }
/* while a drag is live nothing under the pointer may select or re-cursor */
body.sheet-resizing { user-select: none; cursor: col-resize; }
body.sheet-resizing .sheet-inner { animation: none; }

.sheet-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }

.sheet-close {
  background: none; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 1rem;
  border-radius: 3px; padding: .1rem .6rem; cursor: pointer;
}
.sheet-close:hover { border-color: var(--ink-dim); }

.sheet-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: .02em;
  margin: .1rem 0 .35rem;
}

.sheet-meta { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); margin-bottom: 1.5rem; }
/* the born headline under a renamed storyline's name — the same serif as the
   reading, a step lighter than metadata, so it reads as a footnote to the name */
.born-as { font-family: var(--body); font-style: italic; font-size: .95rem; line-height: 1.3; color: var(--tx-3); margin: -.1rem 0 .5rem; }

/* badges row: lifecycle + breaking + topic sit together under the title */
.sheet-badges { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .1rem 0 .5rem; }
.sheet-badges:empty { display: none; }
.breaking-badge {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--alert-red);
}
.breaking-badge[hidden] { display: none; }
.topic-chip {
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .08em;
  color: var(--tx-3);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: .08rem .55rem;
}
.topic-chip[hidden] { display: none; }

/* the fact strip: mono labels over real values, empties never rendered */
.sheet-facts { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.sheet-facts .fact { display: flex; flex-direction: column; gap: .1rem; }
.sheet-facts .fact-k {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  letter-spacing: .14em; color: var(--tx-3);
}
.sheet-facts .fact-v { font-family: var(--mono); font-size: var(--fs-ui); color: var(--tx-2); }

/* importance gauge: a thin 0–100 bar with its calibration number */
.sheet-gauge { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; max-width: 24rem; }
.sheet-gauge[hidden] { display: none; }
.sheet-gauge .gauge-k {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  letter-spacing: .14em; color: var(--tx-3); flex: none;
}
.sheet-gauge .gauge-track {
  flex: 1; height: 3px; background: var(--hairline); border-radius: 2px; overflow: hidden;
}
.sheet-gauge .gauge-fill { display: block; height: 100%; background: var(--lamp); }
.sheet-gauge .gauge-n { font-family: var(--mono); font-size: var(--fs-ui); color: var(--tx-1); flex: none; }

.sheet h2.stamp { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: .9rem; }
/* the state section leads — its stamp reads brighter and rules heavier than the rest,
   so the dossier stops being one flat scroll of equal-weight sections */
.sheet h2.stamp.state-stamp {
  border-top: 2px solid var(--rule);
  color: var(--tx-1);
  letter-spacing: .22em;
}

/* the briefing document: bounded measure, serif at reading size, BLUF lede */
.state-body { font-size: 1.05rem; line-height: 1.62; max-width: 62ch; }
.state-body p { margin-bottom: .7rem; }
.state-body > p:first-of-type {
  font-size: 1.16rem;
  line-height: 1.55;
  color: var(--tx-1);
}
.state-body h3.state-h {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: 1.1rem 0 .4rem;
}
/* subheads sit ABOVE body text and below the title — never dimmer than a stamp */
.state-body h4.state-h {
  font-family: var(--mono);
  font-size: var(--fs-ui);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tx-1);
  margin: 1.1rem 0 .35rem;
}
.state-body .state-list { padding-left: 1.1rem; margin-bottom: .7rem; }
.state-body .state-list li { margin-bottom: .3rem; }
.state-body a { color: var(--sea); }

/* Open questions are doors now (the shared Q&A thread), so the list drops its
   bullets and each question reads as a row you can press. */
.questions { list-style: none; padding-left: 0; }
.questions li { margin-bottom: .35rem; font-style: italic; }

.q-row {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .4rem .5rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  cursor: pointer;
}
.q-row:hover, .q-row:focus-visible { background: var(--bg-3); border-color: var(--rule); }
.q-row .q-text { flex: 1; }
.q-row .q-badge {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-style: normal;
  letter-spacing: .04em;
  color: var(--ink-dim);
  white-space: nowrap;
}
/* a saved thread whose question left open_questions — the record outlives it */
.q-row.q-gone { opacity: .55; }

/* ---------- the shared Q&A thread (#qa) ----------
   Reuses the .panel drawer shell — same [hidden] guard, same slide-in. Only
   what differs is stated here.

   Redesigned 2026-09-13: it was reading like a chatbot — a boxed card per
   answer, a lamp-lit "asking…" line, a blinking caret, raw [2][3] markers in
   the prose. It reads like the rest of Argus now: one reading column, mono
   stamps, hairlines between entries, the citation markers lifted into
   superscript links, and the lamp kept for what is actually live. */

.qa { z-index: 1150; }   /* above the dossier AND the ask-Argus panel */
/* the width is the dossier's — see the 1100px media queries, where both drawers
   read the reader's own --sheet-w */
.qa .panel-inner { width: min(520px, 100%); }
/* ONE reading column per block — the question and sub-lines, the shared answers,
   the follow-ups — each capped at a measure; the head spans the drawer so the
   × sits on the drawer's own edge, as the dossier's ← and "Next dispatch" do. */
.qa .panel-inner > *:not(.panel-head):not(.qa-cols) { max-width: 70ch; }
.qa-main, .qa-chat { max-width: 70ch; }

/* Wide, the follow-ups become a rail beside the answers — the dossier's own
   main-and-rail shape, so a 1400px drawer is not a 70ch column and 700px of
   nothing. The threshold matches the dossier's three-column step. */
#qa-inner { container-type: inline-size; container-name: qa; }
@container qa (min-width: 1300px) {
  .qa-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 2.4rem;
    align-items: start;
  }
  .qa-chat {
    margin-top: 0;
    border-top: none;
    border-left: 1px solid var(--hairline);
    padding: 0 0 0 2.4rem;
  }
  .qa-chat h2.stamp { margin-top: 0; }
}

/* The answer shape's two section lines (server/qa.js systemPrompt asks for them
   by exactly these words) read as stamps, not as sentences. The match is by
   text, so a prompt edit there must be mirrored in qaSectionStamps here. */
.qa-body p.qa-section {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--tx-2);
  margin: 1rem 0 .35rem;
}

/* the question, set large in the display face — it is the headline of this page */
.qa-question {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.14;
  margin: .55rem 0 .2rem;
}

.qa-signin {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-dim);
  margin: .6rem 0;
}
.qa-signin[hidden] { display: none; }

.qa-answers { list-style: none; margin: 1rem 0 0; padding: 0; }

/* An answer is a stamped ENTRY, not a card: no border, no box, no background —
   a hairline is all that separates one ask from the next. */
.qa-entry { padding-bottom: 1.3rem; }
.qa-entry + .qa-entry { border-top: 1px solid var(--line); padding-top: 1.3rem; }

/* "ANSWER · asked 13 Sep 13:26 · perplexity · sonar-reasoning-pro" — the kind is
   stamped, the rest stays in its own case so a model name is still readable. */
.qa-stamp {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .05em;
  color: var(--ink-dim);
  margin-bottom: .55rem;
}
.qa-stamp .qa-stamp-k {
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--tx-2);
}

.qa-body { font-size: .98rem; line-height: 1.6; }
.qa-body p { margin-bottom: .6rem; }
.qa-body p:last-child { margin-bottom: 0; }
.qa-body a { color: var(--sea); }
.qa-body .state-h { margin: .9rem 0 .35rem; }

/* the citation markers Perplexity writes as [2] — lifted out of the prose into
   superscript links, so the sentence reads and the source is one tap away */
.qa-body sup { line-height: 0; }
.qa-body sup .cite {
  font-family: var(--mono);
  font-size: .95em;
  color: var(--sea);
  text-decoration: none;
  padding: 0 .08em;
}
.qa-body sup .cite:hover, .qa-body sup .cite:focus-visible { text-decoration: underline; color: var(--ink); }

/* the numbered source list, the outlet named in mono before the title */
.qa-cites-stamp { margin: .9rem 0 .35rem; }
.qa-cites {
  margin: 0;
  padding-left: 1.4rem;
  font-size: .9rem;
}
.qa-cites li { margin-bottom: .3rem; }
.qa-cites a { color: var(--tx-2); text-decoration: none; }
.qa-cites a:hover, .qa-cites a:focus-visible { color: var(--ink); text-decoration: underline; }
.qa-cite-host {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .04em;
  color: var(--sea);
  margin-right: .45rem;
}

/* the honest label: an agent's answer is not the record */
.qa-label {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .08em;
  color: var(--ink-dim);
  margin-top: .7rem;
}

.qa-failed { color: var(--ink-dim); font-style: italic; }

/* ---------- the live ask (.qa-stream-*) ----------
   The entry an ask draws while Perplexity works, in the same hand as the
   settled one: an ASKING stamp, the reasoning ticking in a dim mono box under a
   pulse that says what is happening ("reading 9 sources…" / "thinking…"), and
   the answer under THE ANSWER once the first token lands. No caret — a caret
   says a chatbot is typing; a stamp says a record is being written. The
   provider and model are named on the settled entry's stamp, not here. */

.qa-stream-stamp { margin-top: .2rem; }
.qa-stream-stamp[hidden] { display: none; }

.qa-stream-think-wrap { margin: .5rem 0; }
.qa-stream-think-wrap[hidden] { display: none; }   /* the always-display trap */

.qa-stream-think-label {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .06em;
  color: var(--ink-dim);
  margin-bottom: .3rem;
}

.qa-stream-pulse { color: var(--ink-dim); animation: qa-pulse 1.6s ease-in-out infinite; }
@keyframes qa-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .qa-stream-pulse { animation: none; opacity: .8; } }

/* reasoning: smaller, dimmer, mono — visibly NOT the answer */
.qa-stream-think {
  font-family: var(--mono);
  font-size: .875rem;
  line-height: 1.5;
  color: var(--ink-dim);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 10rem;
  overflow-y: auto;
  border-left: 2px solid var(--hairline);
  padding: .15rem 0 .15rem .6rem;
  margin: 0;
}

/* once the answer starts, the trace folds but stays openable */
.qa-stream-fold { margin: .5rem 0; }
.qa-stream-fold summary {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .06em;
  color: var(--ink-dim);
  cursor: pointer;
}
.qa-stream-fold .qa-stream-think { margin-top: .3rem; }

.qa-stream-answer { margin-top: .2rem; }
.qa-stream-cites:empty { display: none; }
.qa-stream-failed { margin-top: .4rem; }

/* the same live treatment inside a follow-up turn */
.qa-stream-turn .qa-stream-answer { font-size: .95rem; }

.qa-actions { margin: .2rem 0 .4rem; }

.qa-chat { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.qa-chat[hidden] { display: none; }
.qa-thread { flex: none; }
/* a reader's follow-up sits right and plain; the answer keeps the panel-turn
   "them" treatment */
.panel-turn.qa-me { text-align: right; }
.panel-turn.qa-me .panel-said { font-size: .92rem; }

.wire { list-style: none; padding: 0; }
.wire li {
  border-left: 2px solid var(--hairline);
  padding: .15rem 0 .8rem .9rem;
  position: relative;
}
.wire li.unseen { border-left-color: var(--lamp); }
.wire li.wire-day {
  border-left: none;
  padding: .7rem 0 .25rem 0;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.wire .ts { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); display: block; margin-bottom: .15rem; }
.wire .why { color: var(--ink-dim); font-style: italic; }
.wire li[hidden] { display: none; }

/* "read to here": the one rule that splits new from already-read */
.wire li.wire-readmark {
  text-transform: none;
  letter-spacing: .08em;
  color: var(--lamp);
  border-top: 1px dashed var(--rule);
  margin-top: .3rem;
  padding-top: .55rem;
}
/* a stretch of silence is part of the record, said quietly */
.wire li.wire-gap {
  text-transform: none;
  letter-spacing: .08em;
  font-style: normal;
  color: var(--tx-3);
  padding: .5rem 0 .1rem;
}

.wire-more { margin: .2rem 0 .4rem; padding-left: 0; }
.wire-trunc { font-family: var(--mono); font-size: var(--fs-meta); color: var(--tx-3); margin: .3rem 0 .2rem; }
.wire-trunc[hidden] { display: none; }

.evidence-wrap { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.evidence-wrap summary { cursor: pointer; }
.evidence { padding: .6rem 0 0 0; list-style: none; }
.evidence a { color: var(--sea); }
.evidence .src { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); }

/* evidence grouped by outlet: the source named once, its pieces beneath */
.evidence .ev-group { margin-bottom: .8rem; }
.evidence .ev-src {
  font-family: var(--mono); font-size: var(--fs-meta); font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--tx-2);
  margin-bottom: .25rem;
}
.evidence .ev-count { color: var(--tx-3); margin-left: .5rem; }
.evidence .ev-items { padding-left: .9rem; border-left: 1px solid var(--hairline); }
.evidence .ev-item { margin-bottom: .3rem; font-size: .9rem; }

/* a thread's standing state, one ellipsized serif line under its name */
#sheet-threads .margin-item { flex-wrap: wrap; }
.thread-preview {
  flex-basis: 100%;
  margin: .2rem 0 0;
  font-family: var(--body);
  font-size: .9375rem;
  line-height: 1.35;
  color: var(--tx-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-actions { margin-top: 2rem; display: flex; gap: .8rem; }

/* One primary action per row; the rest are ghosts. #btn-probe is the dossier's
   main verb — lamp here means "press me next", it still points at the unseen. */
.sheet-actions .btn { border-color: var(--hairline); color: var(--tx-3); background: none; }
.sheet-actions .btn:hover, .sheet-actions .btn:focus-visible { border-color: var(--rule); color: var(--ink); }
.sheet-actions #btn-probe { border-color: var(--lamp); color: var(--lamp); background: none; }
.sheet-actions #btn-probe:hover, .sheet-actions #btn-probe:focus-visible { border-color: var(--lamp); color: var(--ink); }
.sheet-actions .btn-danger:hover, .sheet-actions .btn-danger:focus-visible { border-color: var(--down); color: var(--down); }

/* ---------- controls ---------- */

.btn {
  font-family: var(--mono);
  font-size: var(--fs-ui);
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .35rem .8rem;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { border-color: var(--lamp); color: var(--lamp); }
/* keyboard focus must read as more than a hover: a real outline */
.btn:focus-visible { outline: 2px solid var(--lamp); outline-offset: 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); color: var(--ink); }
.btn-quiet { background: none; border-color: transparent; color: var(--ink-dim); }
.btn-quiet:hover, .btn-quiet:focus-visible { color: var(--lamp); border-color: transparent; }

/* ---------- language switcher (header popover; i18n.js builds the menu) ---------- */
.btn-lang { letter-spacing: .08em; }
.lang-menu {
  position: fixed;
  top: 3.1rem;
  right: .8rem;
  z-index: 2100;                     /* above everything — a popover the tap just opened */
  display: flex;
  flex-direction: column;
  min-width: 9rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.lang-item {
  background: none;
  border: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-ui);
  text-align: left;
  padding: .45rem .7rem;
  border-radius: 3px;
  cursor: pointer;
}
.lang-item:hover, .lang-item:focus-visible { color: var(--lamp); background: rgba(255, 255, 255, .05); }
.lang-item.on { color: var(--lamp); }
.lang-item.on::after { content: ' ·'; }
/* [hidden] alone loses to the display:flex above at equal specificity because
   author styles beat the UA default even on a tie — the exact trap this file's
   CLAUDE.md already names for .login-screen and .sheet. Without this line the
   (empty, until JS fills it) box sits fixed on screen from first paint, which is
   what read as "a floating language button that never goes away" on mobile. */
.lang-menu[hidden] { display: none; }
.btn-danger:hover, .btn-danger:focus-visible { border-color: var(--down); color: var(--down); }

/* ---------- account menu (header popover; app.js positions & wires it) ---------- */
.account-menu {
  position: fixed;
  z-index: 2100;                     /* above everything — a popover the tap just opened */
  display: flex;
  flex-direction: column;
  min-width: 10rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.account-menu[hidden] { display: none; }
.acct-item {
  background: none;
  border: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: .5rem .6rem;
  border-radius: 3px;
  cursor: pointer;
}
.acct-item:hover, .acct-item:focus-visible { color: var(--lamp); background: rgba(255, 255, 255, .05); }
.acct-item-danger:hover, .acct-item-danger:focus-visible { color: var(--down); }
/* the signed-in address heads the menu only where the header shows an initial
   instead (the phone block turns it on); a wide header already prints it */
.acct-who { display: none; }

dialog {
  background: var(--bg-3);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--elev-2);
  padding: 1.3rem 1.5rem;
  width: min(430px, 92vw);
  /* the global `* { margin: 0 }` reset wipes the UA's `dialog { margin: auto }` —
     the ONLY thing that centers a showModal() dialog. Without this line every
     dialog in the app pins to the top-left corner (found on phones, 2026-09-05). */
  margin: auto;
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
}
dialog::backdrop { background: color-mix(in srgb, var(--ground) 70%, transparent); }

.dlg-form { display: flex; flex-direction: column; gap: .9rem; }
.dlg-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.dlg-form label.check { flex-direction: row; align-items: center; gap: .5rem; }
.dlg-form input[type="text"], .dlg-form input[type="email"], .dlg-form input[type="password"],
.dlg-form input[type="search"], .dlg-form input:not([type]), .dlg-form textarea {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--fs-ui);
  padding: .45rem .6rem;
}
.dlg-form input:focus-visible, .dlg-form textarea:focus-visible { outline: 1px solid var(--lamp); }
.dlg-hint { font-size: var(--fs-ui); color: var(--ink-dim); font-style: italic; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: .3rem; }

/* ---------- the watchlist editor ---------- */
/* A held name is a card on the desk: the symbol in the chart hand, the company in
   reading type, and a dismissal that stays quiet until you reach for it. The ×
   was a bare <button>, so the browser painted it white — chrome loud enough to
   outrank the name it removes. */

.wl-search-wrap { position: relative; }
.dlg-form input[type="search"]::-webkit-search-decoration,
.dlg-form input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.wl-matches {
  list-style: none; margin: 0; padding: 0;
  max-height: 15rem; overflow-y: auto;
  background: var(--ground);
  border: 1px solid var(--line); border-radius: 3px;
}
.wl-matches[hidden] { display: none; }
.wl-match {
  display: flex; align-items: baseline; gap: .7rem; width: 100%;
  padding: .45rem .6rem; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-dim);
}
.wl-matches li:last-child .wl-match { border-bottom: 0; }
.wl-match b {
  flex: none; min-width: 3.4rem;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .06em; color: var(--ink);
}
.wl-match span {
  font-family: var(--body); font-size: var(--fs-ui);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wl-match:hover, .wl-match:focus-visible { background: var(--paper); color: var(--ink); }
.wl-match:focus-visible b { color: var(--lamp); }

/* The kind of answer, not an answer: same small-caps mono as a .stamp, and no
   hover of its own — a heading the finger can hit reads as a broken button. */
.wl-group {
  padding: .45rem .6rem .2rem;
  font-family: var(--mono); font-size: var(--fs-meta);
  text-transform: uppercase; letter-spacing: .18em; color: var(--ink-dim);
}
/* A commodity's name is the reading column here, so it needs the room a symbol
   never did — the fixed symbol gutter would cut "Agriculture basket" in half. */
/* A commodity's NAME is the reading column here, so it needs the room a four-letter
   symbol never did — the fixed symbol gutter cut "Agriculture basket" in half. */
.wl-match.commodity b { min-width: 0; flex: 1 1 auto; }

.wl-note {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  font-size: var(--fs-ui); font-style: italic; color: var(--ink-dim);
}
.wl-note[hidden] { display: none; }
.wl-free { font-style: normal; }

.wl-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.wl-chip {
  display: inline-flex; align-items: baseline; gap: .5rem; max-width: 100%;
  padding: .28rem .32rem .28rem .6rem;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 3px;
}
.wl-chip b {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .07em; color: var(--ink);
}
.wl-chip-name {
  font-family: var(--body); font-size: var(--fs-ui); color: var(--ink-dim);
  max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wl-chip-x {
  align-self: center; padding: 0 .25rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: .9rem; line-height: 1; color: var(--ink-dim);
}
.wl-chip-x:hover, .wl-chip-x:focus-visible { color: var(--lamp); }

.toast {
  position: fixed; bottom: 4rem; left: 50%; transform: translateX(-50%);
  background: var(--paper); border: 1px solid var(--lamp);
  color: var(--ink); font-family: var(--mono); font-size: var(--fs-ui);
  padding: .5rem 1rem; border-radius: 3px; z-index: 2000;
}

.statusline {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-dim);
  padding: .3rem 1.1rem;
  border-top: 1px solid var(--line-soft);
}

:focus-visible { outline: 2px solid var(--lamp); outline-offset: 1px; }

/* ============================================================
   Scroll surfaces — every panel that can scroll, in one place.

   The pages, the chart margin and the overlays are all near-black surfaces, and
   the browser's default scrollbar is a light chunky rail with arrow buttons: on
   this palette it reads as a rendering fault rather than a control. So each
   scroller carries the chart's own ink instead, and contains its scroll so
   reaching the end of a page doesn't chain into whatever sits behind it (or,
   on iOS, into pull-to-refresh).

   .viewnav and .console-chips are deliberately excluded — they hide their
   scrollbar entirely and are re-declared in the responsive section.
   ============================================================ */

:root {
  --rail:     color-mix(in srgb, var(--line) 82%, var(--ink));
  --rail-hot: color-mix(in srgb, var(--line) 55%, var(--ink));
}

.view, .margin, .sheet-inner, .brief-inner, .wire-strip, .leaflet-popup-scrolled {
  scrollbar-width: thin;
  scrollbar-color: var(--rail) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;   /* momentum on iOS */
}

/* Blink and WebKit ignore scrollbar-color, so the same thing again in their dialect.
   The thumb is inset by a transparent border rather than a narrower track, so it
   keeps clear of the panel edge without stealing width from the content. */
.view::-webkit-scrollbar, .margin::-webkit-scrollbar,
.sheet-inner::-webkit-scrollbar, .brief-inner::-webkit-scrollbar,
.wire-strip::-webkit-scrollbar, .leaflet-popup-scrolled::-webkit-scrollbar {
  width: 10px; height: 10px;
}
.view::-webkit-scrollbar-track, .margin::-webkit-scrollbar-track,
.sheet-inner::-webkit-scrollbar-track, .brief-inner::-webkit-scrollbar-track,
.wire-strip::-webkit-scrollbar-track, .leaflet-popup-scrolled::-webkit-scrollbar-track {
  background: transparent;
}
.view::-webkit-scrollbar-thumb, .margin::-webkit-scrollbar-thumb,
.sheet-inner::-webkit-scrollbar-thumb, .brief-inner::-webkit-scrollbar-thumb,
.wire-strip::-webkit-scrollbar-thumb, .leaflet-popup-scrolled::-webkit-scrollbar-thumb {
  background: var(--rail);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
.view::-webkit-scrollbar-thumb:hover, .margin::-webkit-scrollbar-thumb:hover,
.sheet-inner::-webkit-scrollbar-thumb:hover, .brief-inner::-webkit-scrollbar-thumb:hover,
.wire-strip::-webkit-scrollbar-thumb:hover, .leaflet-popup-scrolled::-webkit-scrollbar-thumb:hover {
  background: var(--rail-hot);
  background-clip: padding-box;
}
.view::-webkit-scrollbar-corner, .margin::-webkit-scrollbar-corner,
.sheet-inner::-webkit-scrollbar-corner, .brief-inner::-webkit-scrollbar-corner {
  background: transparent;
}

/* A page that scrolls should not end flush against the window edge — the last
   line reads as cut off rather than as the end of the page. */
.view, .margin { scroll-padding-bottom: 1.5rem; }

/* ---------- lake additions: clusters, umbrellas, threads ---------- */

/* a counted mark where several storylines share one place */
.marker.cluster .ring { border-width: 2px; display: grid; place-items: center; }
.marker.cluster .count {
  font: 500 12px/1 var(--figures);   /* inside a ring: the one place under the 13px floor */
  color: var(--ink);
  font-style: normal;
}
.marker.threaded .ring { border-style: dashed; }

.cluster-pop { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.cluster-pop-item {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--ink);
  font: 400 15px/1.5 var(--body); text-align: left; cursor: pointer; padding: 4px 6px;
}
.cluster-pop-item:hover { background: var(--line-soft); }
.cluster-pop-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sea); flex: none; }
.cluster-pop-item.unseen .dot { background: var(--lamp); }
.cluster-pop-item .when { margin-left: auto; font: 400 13px/1 var(--mono); color: var(--ink-dim); }
.cluster-pop-item.read { color: var(--ink-dim); }
.cluster-pop-item.read .dot { background: none; border: 1px solid var(--sea); width: 5px; height: 5px; }
.cluster-pop-head {
  font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim); padding: 2px 6px 6px;
}

/* ---------- the line between read and unread ----------
   The list keeps everything and says where your attention stops. A labelled rule,
   never colour alone: read is a state you can see with the styles off. */
.read-rule {
  display: flex; align-items: center; gap: .5rem;
  margin: .5rem 0 .35rem; padding: 0 .3rem;
  font: 500 .58rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-dim); list-style: none;
}
.read-rule::before, .read-rule::after {
  content: ''; flex: 1; height: 1px; background: var(--line-soft);
}
.read-fold-row { list-style: none; padding: 0 .3rem; }
.read-fold {
  background: none; border: 1px dashed var(--line); border-radius: 3px;
  color: var(--ink-dim); cursor: pointer;
  font: 400 .62rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .55rem;
}
.read-fold:hover, .read-fold:focus-visible { color: var(--ink); border-color: var(--ink-dim); }

/* a read row in any margin or place list: present, quiet, still one tap away */
.margin-item.read .name { color: var(--ink-dim); }
.margin-item.read .dot { background: none; opacity: .6; }
.leaflet-popup-content-wrapper {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px;
  position: relative; overflow: hidden;   /* holds the fade below to the rounded edge */
}
.leaflet-popup-tip { background: var(--paper); }

/* the cut row, made honest: a fade that says "the list goes on", set by
   markPopupOverflow() and retired the moment you reach the bottom */
.leaflet-popup-content-wrapper.has-more::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 2.2rem;
  background: linear-gradient(to top, var(--paper) 20%, transparent);
  pointer-events: none;
}
/* box-sizing is border-box app-wide, so this pads inside the height Leaflet sets
   rather than fighting it — the last line stops short of the edge either way */
.leaflet-popup-scrolled { padding-bottom: .5rem; touch-action: pan-y; }

/* umbrella group inside the brief: one entry, threads indented */
.brief-group { display: flex; flex-direction: column; }
.b-group-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 0 2px; }
.b-group-head .b-title { font-weight: 500; }
.brief-group .b-thread {
  background: none; border: none; border-left: 1px solid var(--line);
  margin-left: 10px; padding: 6px 0 6px 12px;
  color: inherit; text-align: left; cursor: pointer; display: block; width: calc(100% - 10px);
}
.brief-group .b-thread:hover { background: var(--line-soft); }

/* margin: an umbrella names how many threads it holds */
.margin-item .threads { font: 400 13px/1 var(--mono); color: var(--ink-dim); flex: none; }

/* dossier: breadcrumb up to the umbrella */
.sheet-parent { margin: 2px 0 6px; }

/* ============================================================
   LOGIN — the Lyra gate (2026-11-07). The look is vendor/lyra-gate/gate.css
   (synced from accounts/, never edited here); this block only places Argus's
   own controls in it. Three looks, no JS beyond app.js's own:
     orbs    Google · email (#login-door) · invite (#link-signup-toggle) · guest
     email   #login-door:checked — lines + back · create account · go
     signup  #login-invite-row shown (app.js setLoginMode) — invite line, consent,
             back (the toggle, "Sign in instead") · Google · go
   btn-login-go and the toggle get their words from app.js (textContent), so
   their icons are masks on ::before and their live words are the accessible
   name, shown as a caption on hover/focus.
   ============================================================ */
/* full login screen — the app waits behind it (above the phone station rail too) */
/* display below outranks the browser's [hidden] rule — same trap as .sheet[hidden] */
.login-screen[hidden] { display: none; }
.login-screen { position: fixed; inset: 0; z-index: 1300; overflow-y: auto; overscroll-behavior: contain; }
.login-screen [hidden] { display: none !important; }  /* .lg-line / .lg-check set display */
.lg-sr, .login-hint {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.login-stage { --ico-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5.5' width='18' height='13' rx='2'/%3E%3Cpath d='M3.5 7l8.5 6 8.5-6'/%3E%3C/svg%3E");
  --ico-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
  --ico-go: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
  --ico-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.1 6.9L21 12l-6.9 2.1L12 21l-2.1-6.9L3 12l6.9-2.1z'/%3E%3C/svg%3E");
  --ico-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='8' r='4'/%3E%3Cpath d='M2 21a8 8 0 0 1 16 0M19 8v6m-3-3h6'/%3E%3C/svg%3E"); }
.login-fields { display: none; }
.login-row { gap: 22px; margin-top: 0; animation: lg-rise .5s ease both; }
.login-row > * { flex: none; }
.login-ico::before {
  content: ''; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px;
  background: #efe9ff; pointer-events: none;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.login-door { -webkit-appearance: none; appearance: none; margin: 0; --ico: var(--ico-mail); }
#link-signup-toggle { --ico: var(--ico-star); }
#btn-login-go { --ico: var(--ico-go); display: none; }
/* the live words: hidden, then a quiet caption under the button on hover/focus */
.login-tip { display: block; font-size: 0; line-height: 0; color: transparent; white-space: nowrap;
  text-align: center; overflow: visible; }
.login-tip:focus-visible { font-size: 11px; line-height: 150px; letter-spacing: .08em;
  color: var(--lg-faint); }
@media (hover: hover) { .login-tip:hover { font-size: 11px; line-height: 150px; letter-spacing: .08em;
  color: var(--lg-faint); } }
.login-privacy { margin-top: -18px; font-size: 12px; letter-spacing: .12em; color: var(--lg-faint); }

/* email and signup: the row becomes glyphs under the lines */
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) .login-fields { display: grid; }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) .login-row { gap: 16px; margin-top: -6px; }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) .login-row > .lg-orb { width: 44px; height: 44px; color: var(--lg-mist); }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) .login-row svg { width: 19px; height: 19px; }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) .login-ico::before { width: 19px; height: 19px; background: var(--lg-mist); }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) #btn-login-go { display: block; }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) .login-tip:hover, .login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) .login-tip:focus-visible { line-height: 122px; }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) :is(#btn-login-cancel, .login-privacy) { display: none; }
.login-stage:is(:has(#login-door:checked), :has(#login-invite-row:not([hidden]))) #btn-login-go.login-ico::before { background: #fff; }
/* email: the door turns into "back", the toggle into "create an account", Google waits on the orbs */
#login-door:checked { --ico: var(--ico-back); }
.login-stage:has(#login-door:checked) #link-signup-toggle { --ico: var(--ico-plus); }
.login-stage:has(#login-door:checked):not(:has(#login-invite-row:not([hidden]))) #btn-login-google { display: none; }
/* signup: the toggle is the way back ("Sign in instead"); the hint says invite-only */
.login-stage:has(#login-invite-row:not([hidden])) #login-door { display: none; }
.login-stage:has(#login-invite-row:not([hidden])) #link-signup-toggle { --ico: var(--ico-back); order: -1; }
.login-stage:has(#login-invite-row:not([hidden])) .login-hint {
  position: static; width: auto; height: auto; margin: -14px 0 0; overflow: visible; clip-path: none;
  white-space: normal; }
.login-stage .lg-check { margin-top: 4px; }

/* ============================================================
   Responsive system — desktop chart-table, iPad chart-table,
   phone "pocket chart-table" with a bottom station rail.
   ============================================================ */

/* ---------- base: standalone-app plumbing (inert on desktop) ---------- */

@supports (height: 100dvh) { body { height: 100dvh; } }   /* iOS URL-bar honest height */

body { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }                    /* no double-tap zoom on controls */

/* notch / home-indicator: env() is 0 everywhere it doesn't apply */
.top {
  padding-top: calc(.65rem + env(safe-area-inset-top));
  padding-left: calc(1.1rem + env(safe-area-inset-left));
  padding-right: calc(1.1rem + env(safe-area-inset-right));
}
.console, .wire-strip, .statusline {
  padding-left: calc(1.1rem + env(safe-area-inset-left));
  padding-right: calc(1.1rem + env(safe-area-inset-right));
}

/* phone-only controls stay out of the way elsewhere */
.chip-search { display: none; }
.margin-markets { display: none; }
.tabbar { display: none; }

/* ---------- iPad / tablet: the chart-table, tightened ---------- */

@media (max-width: 1100px) {
  .board { grid-template-columns: 1fr 240px; }
  .top { column-gap: 1rem; }   /* column only: the tablet nav row (above) keeps row-gap 0 */
  .sheet-inner { width: min(560px, 100%); }
  /* the question thread is the same instrument at the same width */
  .qa .panel-inner { width: min(560px, 100%); }
}

/* ---------- desktop wide dossier: briefing left, chronology rail right ---------- */

@media (min-width: 1100px) {
  /* 940px was a fixed number for every screen; on a 2560px desktop it is 37% of
     the page and reads as a thin strip. The floor stays 940, the ceiling stays
     92vw, and between them the reader's own --sheet-w (public/sheet-size.js)
     decides — defaulting to 56vw, which is 940 on a 1680px screen and 1434 on a
     2560px one. */
  .sheet-inner { width: clamp(940px, var(--sheet-w, 56vw), 92vw); padding: 1.4rem 2rem 3rem; }
  /* the question thread rides the SAME variable, so the two drawers feel like
     one instrument however wide the dossier was pulled */
  .qa .panel-inner { width: clamp(940px, var(--sheet-w, 56vw), 92vw); }
  .sheet-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 2.4rem;
    align-items: start;
  }
  .sheet-col-rail { border-left: 1px solid var(--hairline); padding-left: 2.4rem; }
  .sheet-grip { display: block; }
}

/* ---------- the wide dossier: three columns ----------
   Not a screen-width rule — a CONTAINER rule. Past 1300px of drawer the rail's
   two blocks stop sharing a column: the wire keeps the middle, and the record
   ABOUT the storyline (its sources, its threads) takes a third. Below that the
   drawer is exactly what it has always been, evidence folded and all.
   --sheet-wide is how app.js learns which of the two it is looking at; the
   threshold is stated here, once. */
.sheet-cols { --sheet-wide: 0; }

@container sheet (min-width: 1300px) {
  .sheet-cols {
    --sheet-wide: 1;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  }
  /* the rail's wrapper steps aside so its two blocks can each take a column */
  .sheet-col-rail { display: contents; }
  #sheet-wire-block, .sheet-col-aside {
    border-left: 1px solid var(--hairline);
    padding-left: 2.4rem;
  }
  /* wider must never mean longer lines */
  .sheet-col-main, #sheet-wire-block, .sheet-col-aside { max-width: 70ch; }

  /* evidence is a column now, not a fold: app.js holds it open, so its summary
     is a heading and stops behaving like a switch */
  .sheet-col-aside .evidence-wrap { border-top: none; padding-top: 0; }
  .sheet-col-aside .evidence-wrap summary {
    pointer-events: none;
    cursor: default;
    list-style: none;
    border-top: 1px solid var(--line);
    padding-top: .9rem;
  }
  .sheet-col-aside .evidence-wrap summary::-webkit-details-marker { display: none; }
  .sheet-col-aside .evidence-wrap summary::marker { content: ''; }
}

/* ---------- touch instruments: bigger targets wherever fingers fly ---------- */

@media (pointer: coarse) {
  /* a finger cannot hold a 14px column, and a touch drawer is the whole screen */
  .sheet-grip { display: none; }
  .chip { font-size: var(--fs-meta); padding: .45rem .95rem; }
  .btn { padding: .55rem 1rem; }
  .sheet-close { min-width: 44px; min-height: 40px; }
  .margin-item { padding: .5rem .4rem; }
  .brief-item button { padding: .6rem 0 .65rem .85rem; }
  .console-search { padding: .5rem .6rem; }
  .leaflet-control-zoom a { width: 36px; height: 36px; line-height: 36px; font-size: 18px; }
  .evidence li, .wire li { padding-top: .25rem; }
}

/* ---------- phone: the pocket chart-table ---------- */

@media (max-width: 700px) {
  /* the fixed station rail reserves its own ground */
  body { padding-bottom: calc(3.6rem + env(safe-area-inset-bottom)); }

  /* ONE row, always (Kunjie's phone, 2026-10-23: the email ellipsis pushed "?"
     onto a stranded second line — 103px of header on every view). A signed-in
     reader is drawn as an initial; the menu it opens names the whole address. */
  .top { flex-wrap: nowrap; gap: .15rem; padding-top: calc(.45rem + env(safe-area-inset-top)); padding-bottom: .45rem; }
  .wordmark { font-size: 1.35rem; margin-right: auto; }
  .top > .btn { padding: .5rem .6rem; min-height: 40px; }
  #btn-seen-all { display: none; }            /* the brief carries this action */
  #btn-settings { display: none; }            /* the front page's more-row carries this one */
  #btn-account { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top > #btn-account:not([data-initial=""])[data-initial] {
    font-size: 0;                              /* the email stays the accessible name */
    width: 2.4rem; height: 2.4rem; min-height: 0; padding: 0; margin-right: .2rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 50%; background: var(--paper);
  }
  #btn-account[data-initial]::before { content: attr(data-initial); font-size: var(--fs-ui); font-weight: 600; color: var(--ink); }
  .top > #btn-account:not([data-initial=""])[data-initial][aria-expanded="true"] { border-color: var(--lamp); }
  .acct-who {
    display: block; margin: 0; padding: .45rem .6rem .5rem;
    font-size: var(--fs-meta); color: var(--ink-dim);
    border-bottom: 1px solid var(--line-soft); margin-bottom: .2rem;
    max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .acct-who[hidden] { display: none; }
  .account-menu { min-width: 12rem; }
  .acct-item { padding: .7rem .6rem; }
  /* Kunjie, 2026-09-07, from his phone: "the top two lines are not necessary".
     The delta stamp and the since-you-left button each cost a whole row on a
     390px header; the BRIEF station carries the brief, and History carries
     since-you-left (#hist-since). Neither line is drawn on a phone. */
  .delta { display: none; }
  #btn-sinceleft { display: none; }

  /* console: one thumb-rail of chips; search unfolds from the ⌕ */
  .console { flex-wrap: wrap; gap: .5rem; padding: .45rem .8rem .45rem calc(.8rem + env(safe-area-inset-left)); }
  .chip-search { display: inline-flex; align-items: center; justify-content: center; line-height: 1; border-color: var(--line); padding-left: .75rem; padding-right: .75rem; }
  .chip-search svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .chip-search[aria-expanded="true"] { color: var(--ink); border-color: var(--lamp); }
  .console-chips { flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .console-chips::-webkit-scrollbar { display: none; }
  /* subjects: their own thumb rail under the lanes, never a stack of pills */
  .topic-chips {
    flex: 1 1 100%; order: 6; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding-left: 0; border-left: 0;
  }
  .topic-chips::-webkit-scrollbar { display: none; }
  .chip-topic { flex: none; white-space: nowrap; }
  .console-search { display: none; }
  body.search-open .console-search { display: block; width: 100%; order: 5; font-size: 16px; }  /* 16px stops iOS auto-zoom */

  /* one view at a time: chart or desk; the brief overlays either */
  .board { display: block; }
  #map { height: 100%; }
  .chart-legend { display: none; }
  .margin { display: none; }
  .wire-strip { display: none; }
  .statusline { display: none; }

  body[data-view="desk"] #map { display: none; }
  body[data-view="desk"] .margin {
    display: flex; height: 100%;
    border-left: none;
    padding: 1rem calc(.9rem + env(safe-area-inset-right)) 1rem calc(.9rem + env(safe-area-inset-left));
  }
  body[data-view="desk"] .margin-markets { display: flex; flex-direction: column; }
  body[data-view="desk"] .statusline { display: block; border-top: 1px solid var(--line-soft); }

  /* since-you-left on a phone: the rail is a SHEET over a full-height map, the
     way a phone map app carries its list — a grip on top, three resting heights
     (tab / half / full), dragged or tapped between them. The first cut stacked
     the rail above a 45vh map: a phone's header stack plus the tab bar left it
     93px for 6,000px of list (measured at 390×664 — the whole rail was one
     headline and a scrollbar). The map keeps the whole board; the sheet takes
     whatever the reader pulls, and a strip of chart always shows above it. */
  body[data-sinceleft="on"] .board { display: block; }
  body[data-sinceleft="on"] #map { height: 100%; }
  body[data-sinceleft="on"] .sinceleft {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 1001;               /* above Leaflet's panes (≤700) and its controls (1000) */
    height: var(--sl-sheet, 50%);
    max-height: calc(100% - 3.5rem);   /* a strip of chart always shows */
    grid-column: auto;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .38);
    padding: 0 calc(.9rem + env(safe-area-inset-right)) 1.2rem calc(.9rem + env(safe-area-inset-left));
    touch-action: pan-y;
  }
  body[data-sinceleft="on"] .sinceleft[data-sheet="tab"]  { height: var(--sl-sheet, 4.6rem); overflow: hidden; }
  body[data-sinceleft="on"] .sinceleft[data-sheet="full"] { height: var(--sl-sheet, calc(100% - 3.5rem)); }
  @media (prefers-reduced-motion: no-preference) {
    body[data-sinceleft="on"] .sinceleft:not(.dragging) { transition: height .22s ease-out; }
  }
  .sinceleft-grip {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 3;                  /* over the sticky region heads inside the rail */
    width: 100%;
    min-height: 1.6rem;
    margin: 0 0 .2rem;
    padding: .55rem 0 .35rem;
    background: var(--ground);
    border: none;
    border-radius: 14px 14px 0 0;
    cursor: grab;
    touch-action: none;          /* the grip owns its drag; the list under it scrolls */
  }
  .sinceleft-grip::before {
    content: '';
    width: 2.6rem; height: .3rem;
    border-radius: 999px;
    background: var(--ink-dim);
    opacity: .7;
  }
  .sinceleft.dragging .sinceleft-grip { cursor: grabbing; }

  /* PULL-TO-REFRESH (F-7). The indicator sits just under the sticky grip, out of
     flow (position:absolute, pointer-events:none) so it never shifts the list at
     any sheet height. app.js writes the drag distance (0–96, unitless) into
     --sl-pull; opacity and travel scale off it, so the spinner grows/slides in as
     the finger pulls (Story 5). --sl-pull is unset except mid-gesture, so the
     element is invisible and inert the rest of the time. */
  .sinceleft-pull {
    position: absolute;
    top: 2.3rem;                 /* clears the grip's handle */
    left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;                  /* under the grip (3), over the list */
    opacity: clamp(0, calc(var(--sl-pull, 0) / 64), 1);
    transform: translateY(calc(var(--sl-pull, 0) * 1px - 8px));
  }
  @media (prefers-reduced-motion: no-preference) {
    .sinceleft:not(.pulling) .sinceleft-pull { transition: opacity .2s ease-out, transform .2s ease-out; }
  }
  .sinceleft-pull-spin {
    width: 1.4rem; height: 1.4rem;
    border-radius: 50%;
    border: 2px solid var(--ink-dim);
    border-top-color: transparent;
    /* before commit the ring turns with the pull; after commit it spins on its own */
    transform: rotate(calc(var(--sl-pull, 0) * 4deg));
  }
  /* committed: hold the indicator visible and spin the ring until refresh() settles */
  .sinceleft.refreshing .sinceleft-pull { opacity: 1; }
  .sinceleft.refreshing .sinceleft-pull-spin { animation: sinceleft-pull-spin .7s linear infinite; }
  @keyframes sinceleft-pull-spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) {
    .sinceleft.refreshing .sinceleft-pull-spin { animation: none; }
  }

  /* the strip of chart above a full sheet is thinner than the zoom control */
  body[data-sinceleft="on"] .board:has(.sinceleft[data-sheet="full"]) .leaflet-control-zoom { display: none; }
  /* the tab height shows the grip and the headline only — the × stays reachable */
  body[data-sinceleft="on"] .sinceleft[data-sheet="tab"] .sinceleft-meta { display: none; }
  /* the header button is redundant while the sheet is open, and it costs a whole row */
  body[data-sinceleft="on"] #btn-sinceleft { display: none; }
  /* the legend is hidden on a phone chart; the mode's line follows that rule */
  body[data-sinceleft="on"] .chart-legend-sinceleft { display: none; }
  /* Desk is the OTHER half of the phone board — the rail has no business there */
  body[data-view="desk"] .sinceleft { display: none; }

  /* desk markets: tickers read as rows, the why gets a full line */
  .tickers-desk { display: flex; flex-direction: column; gap: .15rem; }
  .tickers-desk .tick { display: flex; flex-wrap: wrap; width: 100%; align-items: center; gap: .5rem; padding: .45rem .3rem; border-radius: 3px; }
  .tickers-desk .tick .px { margin-left: auto; }
  .tickers-desk .tick .why { flex-basis: 100%; max-width: none; white-space: normal; margin-top: .1rem; }
  .tickers-desk .tickers-empty { font-family: var(--body); font-style: italic; font-size: .9rem; }

  /* overlays go full-bleed; the rail stays reachable above them */
  /* installed app, black-translucent status bar: the page runs under the clock
     and the Dynamic Island, so the top inset is real (59pt on a 16 Pro) — the
     header already carries it; these overlays did not (2026-09-05 screenshot:
     THE BRIEF and its × sat under the clock and the battery) */
  .sheet-inner, .brief-inner {
    width: 100%; border-left: none; border-right: none;
    padding: calc(1.2rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) calc(4.2rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
  }
  .sheet-inner, .brief-inner { animation: none; }

  /* the dossier reads tighter at arm's length: no dead half-screen between the
     masthead and The State */
  .sheet-title { font-size: 1.7rem; }
  .sheet-meta { margin-bottom: .9rem; }
  .sheet-facts { gap: 1rem; margin-bottom: .6rem; }
  .sheet-gauge { margin-bottom: .8rem; }
  .sheet h2.stamp { margin-top: 1.2rem; padding-top: .7rem; }

  dialog { width: min(430px, calc(100vw - 1.6rem)); }
  /* stops iOS auto-zoom — selector list mirrors the base rule exactly, or its
     [type=…] variants out-rank this override and the .85rem base wins the tie */
  .dlg-form input[type="text"], .dlg-form input[type="email"], .dlg-form input[type="password"],
  .dlg-form input[type="search"], .dlg-form input:not([type]), .dlg-form textarea { font-size: 16px; }

  /* thumb-sized targets: a result row and a chip's × are both things you tap once
     and must not miss, so they grow where the pointer is a finger */
  /* "read (12)" is a real tap target, not a caption */
  .read-fold { min-height: 44px; display: inline-flex; align-items: center; padding: .4rem .95rem; }
  .read-rule { margin: .7rem 0 .5rem; }

  .wl-match { padding: .85rem .7rem; }
  .wl-chip { padding: .5rem .4rem .5rem .68rem; }   /* past 40px: a thumb, not a cursor */
  .wl-chip-name { max-width: 9rem; }
  .wl-chip-x { padding: .2rem .45rem; font-size: 1.05rem; }
  .wl-matches { max-height: 12rem; }

  .toast { bottom: calc(4.4rem + env(safe-area-inset-bottom)); max-width: calc(100vw - 2rem); }

  /* ---------- the station rail ---------- */

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--ground) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  /* icon over a sentence-case label (2026-10-23): the tracked-out capitals made
     "BRIEF 99+" a squeeze and gave a thumb only words to aim at */
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .2rem;
    font-family: var(--ui);
    font-size: var(--fs-meta);
    letter-spacing: .01em;
    color: var(--ink-dim);
    background: none; border: none;
    padding: .55rem 0 .5rem;
    cursor: pointer;
    position: relative;
  }
  .tab-ico {
    width: 1.4rem; height: 1.4rem;
    fill: none; stroke: currentColor; stroke-width: 1.6;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .tab.on { color: var(--ink); }
  .tab.on .tab-ico { color: var(--lamp); }
  /* the lamp sits on the rail's top edge, over the station it lights */
  .tab.on::after {
    content: '';
    position: absolute; left: 50%; transform: translateX(-50%); top: -1px;
    width: 1.6rem; height: 2px; background: var(--lamp);
  }
  /* the owed count rides the brief icon's shoulder */
  .tab-lamp {
    position: absolute;
    top: .3rem; left: calc(50% + .45rem);
    min-width: 1.15rem;
    font-family: var(--figures);
    font-size: 12px; font-weight: 600; line-height: 1.15rem;
    text-align: center;
    color: var(--ground);
    background: var(--lamp);
    border-radius: 999px;
    padding: 0 .3rem;
    letter-spacing: 0;
  }
  .tab-lamp[hidden] { display: none; }
}

/* ---------- lenses: the reader's categories over the shared lake ---------- */

/* Two rows, two grammars. Row one is the lanes and subjects (round pills).
   Row two is YOUR lenses (squared): since 2026-10-28 a click shows only that
   lens on the chart, and the lit chip's ↗ is the way to its own page. They
   were one row of identical pills before, which read as debris. */
.lensbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}
.lens-stamp {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  flex: none;
}
.lens-chips { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; min-width: 0; }

/* the depth dropdown: dressed as a quiet chip, native menu underneath */
.lens-range {
  appearance: none; -webkit-appearance: none;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--paper); color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 3px;
  padding: .2rem 1.1rem .2rem .5rem;
  cursor: pointer; flex: none;
  /* a tiny chevron so it reads as a menu, not a label */
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),
                    linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: right .55rem center, right .38rem center;
  background-size: .28rem .28rem;
  background-repeat: no-repeat;
}
.lens-range:hover, .lens-range:focus-visible { color: var(--ink); border-color: var(--ink-dim); }
.lens-range option { background: var(--paper); color: var(--ink); text-transform: none; }
.stamp .lens-range { margin-left: .6rem; vertical-align: middle; }

/* a destination, not a filter: squared, filled, quiet until it has something */
.chip-lens {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: var(--fs-ui); letter-spacing: .01em;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink-dim);
  padding: .22rem .6rem;
  cursor: pointer;
}
/* display:inline-flex outranks the browser's [hidden] rule — the documented
   trap in CLAUDE.md, and the clear-filter chip walked into it. */
.chip-lens[hidden] { display: none; }
.chip-lens:hover, .chip-lens:focus-visible { color: var(--ink); border-color: var(--ink-dim); }
.chip-lens.on { color: var(--ink); border-color: var(--lamp); }
.chip-lens .lens-count {
  font-size: var(--fs-meta); font-style: normal; font-weight: 500;
  color: var(--ground); background: var(--lamp);
  border-radius: 999px; padding: 0 .34rem; line-height: 1.5;
}
.chip-lens .lens-eye { color: var(--lamp); font-size: var(--fs-meta); line-height: 1; }
/* the lit chip's door to the lens's own page; the chip itself toggles the filter */
.chip-lens .lens-open {
  color: var(--ink-dim); font-size: var(--fs-ui); line-height: 1;
  padding: 0 .15rem; margin-left: .1rem;
  border-left: 1px solid var(--line); padding-left: .45rem;
}
.chip-lens .lens-open:hover, .chip-lens .lens-open:focus-visible { color: var(--lamp); }
.chip-new-lens {
  border: 1px dashed var(--line); border-radius: 3px;
  color: var(--ink-dim); font-size: var(--fs-ui); padding: .22rem .55rem;
  flex: none; white-space: nowrap;
}
.chip-new-lens:hover { border-color: var(--ink-dim); color: var(--ink); }

/* dossier: which lenses this storyline sits under */
.sheet-cats { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .2rem; }
.cat-chip {
  font-family: var(--mono); font-size: var(--fs-meta);
  color: var(--ink-dim); background: var(--paper);
  border: 1px solid var(--line); border-radius: 3px;
  padding: .2rem .55rem; cursor: pointer;
}
.cat-chip:hover { color: var(--ink); border-color: var(--ink-dim); }

/* ---------- the theater ---------- */

.theater-bullets { font-style: italic; }

/* thread colours: one per member storyline, reused by the list and the braid,
   so the "moved lately" list doubles as the timeline's legend. */
.theater { --t0: #5C8DB8; --t1: #C98F5A; --t2: #7FAE8A; --t3: #9C86C9;
           --t4: #C97F86; --t5: #6FA8AE; --t6: #B9A05E; --t7: #8E93C4; }
[data-thread="0"] { --thread: var(--t0); } [data-thread="1"] { --thread: var(--t1); }
[data-thread="2"] { --thread: var(--t2); } [data-thread="3"] { --thread: var(--t3); }
[data-thread="4"] { --thread: var(--t4); } [data-thread="5"] { --thread: var(--t5); }
[data-thread="6"] { --thread: var(--t6); } [data-thread="7"] { --thread: var(--t7); }

/* the lens's facet facts: tickers as mono chips, sources as host-name chips,
   the unusual mode as a quiet italic label */
.theater-facets { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .1rem 0 .2rem; }
.theater-facets[hidden] { display: none; }   /* flex outranks [hidden] — the documented trap */
.facet-chip {
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 3px; padding: .15rem .5rem;
}
.facet-ticker { color: var(--ink); letter-spacing: .06em; }
.facet-mode { font-family: var(--mono); font-size: var(--fs-meta); font-style: italic; color: var(--ink-dim); }

/* "Just outside": near-miss rows — quiet by design, they are a tuning aid, not
   members. One line each: an open button (the title) and the match %. */
.theater-near { list-style: none; padding: 0; margin: .2rem 0 0; }
.theater-near[hidden] { display: none; }
.near-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
  padding: .3rem .45rem; border-top: 1px solid var(--line-soft);
}
.near-row:first-child { border-top: none; }
.near-open {
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
  font-family: inherit; font-size: var(--fs-ui); color: var(--ink-dim);
}
.near-open:hover { color: var(--ink); text-decoration: underline; }
.near-score { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); flex: none; }
.theater-near-hint { margin-top: .35rem; }

/* "Early signals" (Board row 14): single-source sparks over the lens's line. They DO
   match, so the title reads at full ink — unlike a near-miss — and each row names
   its outlet and age, because "one source" is the whole caveat. */
.theater-sparks-hint { margin: .1rem 0 .2rem; }
/* title on its own line, then outlet · age and the % — a long headline squeezed
   beside the outlet column read as a cramped block (checked at 1440px) */
.spark-row { flex-wrap: wrap; row-gap: .15rem; }
.spark-row .near-open { color: var(--ink); flex-basis: 100%; line-height: 1.35; }
.spark-src { font-family: var(--mono); font-size: var(--fs-meta); color: var(--tx-3); }
/* thin-lens hint (public/lensHint.js) — a nudge in the lamp colour, never an error */
/* Draft from plain words, at the top of a NEW lens dialog */
.lens-draft {
  display: flex; flex-direction: column; gap: .45rem;
  padding: .7rem .8rem; border: 1px dashed var(--line); border-radius: 3px;
}
.lens-draft[hidden] { display: none; }
/* tripwire line (public/tripwireUi.js) */
.lens-trip { border: 1px solid var(--line, #2a3242); border-radius: 8px; padding: .6rem .8rem; margin: .8rem 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lens-trip[hidden], #lens-trip-value[hidden] { display: none; }
.lens-trip legend { padding: 0 .3rem; }
.lens-trip-fires { width: 100%; margin: 0; padding-left: 1.1rem; font-size: var(--fs-meta, 13px); }
.lens-draft-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.lens-draft-status { font-size: var(--fs-ui); color: var(--ink-dim); }
.lens-draft-note { margin: 0; font-size: var(--fs-meta); color: var(--tx-3); }

.lens-thin-hint {
  margin: .3rem 0 .2rem; font-family: var(--ui); font-size: var(--fs-meta);
  color: var(--lamp); border-left: 2px solid var(--lamp); padding-left: .55rem;
}
.lens-thin-hint[hidden] { display: none; }

/* "Where this stands": member storylines as STATE cards — title, weight, standing
   snippet. The dot carries the thread colour, so the cards double as the braid's
   legend, exactly as the old flat list did. */
.theater-cards { list-style: none; padding: 0; margin: .2rem 0 0; }
.state-card { padding: .6rem .45rem .7rem; border-top: 1px solid var(--line-soft); cursor: pointer; }
.state-card:first-child { border-top: none; }
.state-card:hover, .state-card:focus-visible { background: var(--bg-3); }
.state-card .sc-head { display: flex; align-items: baseline; gap: .5rem; }
.state-card .dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  align-self: center; background: var(--thread, var(--sea));
}
.state-card.unseen .dot { animation: lamp 2.2s ease-in-out infinite; }
.state-card .sc-title { font-family: var(--mono); font-size: .92rem; color: var(--ink); min-width: 0; }
.state-card:not(.unseen) .sc-title { color: var(--ink-dim); }
.state-card .breaking-badge { flex: none; }
/* the fact row: lane loud-quiet, lifecycle badge, the dossier's gauge at pocket
   size; membership% demoted to the same quiet register as the age */
.state-card .sc-meta { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: .3rem; }
.state-card .sc-lane {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-dim);
}
.state-card .sc-gauge { display: inline-flex; align-items: center; gap: .4rem; width: 6.5rem; }
.state-card .sc-gauge .gauge-track { flex: 1; height: 3px; background: var(--hairline); border-radius: 2px; overflow: hidden; }
.state-card .sc-gauge .gauge-fill { display: block; height: 100%; background: var(--lamp); }
.state-card .sc-gauge .gauge-n { font-family: var(--mono); font-size: var(--fs-meta); color: var(--tx-2); flex: none; }
.state-card .sc-quiet { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); }
/* the standing state itself, in the reading serif — the point of the card */
.state-card .sc-preview {
  font-family: var(--body); font-size: .95rem; line-height: 1.55; color: var(--ink);
  margin: .4rem 0 0; max-width: 58ch;
}

/* The braid: [time] [thread rail] [what happened]. Every row lands on the same
   three axes, so the column edges read as lines even where the rail is empty. */
.braid {
  list-style: none; padding: 0; margin: .2rem 0 0;
  display: grid; grid-template-columns: 2.6rem 12px 1fr;
}
/* The LIST is the grid, so every row lands on the same three axes. Only ENTRY
   rows dissolve into it (display:contents) so their three cells become grid
   items; day and gap rules stay real items so they can span all columns.
   Dissolving those too collapses the whole braid into the time column. */
.braid li.b-entry { display: contents; }

.braid .b-day {
  grid-column: 1 / -1;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-dim);
  border-top: 1px solid var(--line);
  margin-top: .9rem; padding: .45rem 0 .4rem;
}
.braid .b-day:first-child { border-top: none; margin-top: 0; }

/* time you can see: an explicit rest where nothing happened */
.braid .b-gap {
  grid-column: 1 / -1;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .12em;
  color: var(--ink-dim); opacity: .8;
  padding: .5rem 0 .5rem 3rem;
}
.braid .b-gap::before {
  content: ""; display: inline-block; width: 10px; height: 1px;
  background: var(--line); vertical-align: middle; margin-right: .5rem;
}

.braid .b-time {
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim);
  padding-top: .3rem; text-align: right; padding-right: .55rem;
  white-space: nowrap;
}
/* the rail IS the thread — continuous down a run, with a node at each entry */
.braid .b-rail { position: relative; }
.braid .b-rail::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; transform: translateX(-50%);
  background: color-mix(in srgb, var(--thread, var(--sea)) 45%, transparent);
}
.braid li.run-start .b-rail::before { top: .55rem; }
.braid li.run-end .b-rail::before { bottom: calc(100% - .55rem); }
.braid .b-rail::after {
  content: ""; position: absolute; left: 50%; top: .42rem;
  width: 7px; height: 7px; border-radius: 50%;
  transform: translateX(-50%);
  background: var(--ground); border: 1.5px solid var(--thread, var(--sea));
}
.braid li.run-start .b-rail::after { background: var(--thread, var(--sea)); }

.braid .b-body { padding: 0 0 .85rem .75rem; min-width: 0; }
/* the thread's name: mono + its own colour separates it from the serif prose
   without shouting — long headlines in caps are unreadable. */
.braid .b-thread {
  display: block; background: none; border: none; padding: 0;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .01em;
  color: var(--thread, var(--sea));
  text-align: left; cursor: pointer; margin-bottom: .2rem;
}
.braid .b-thread:hover { text-decoration: underline; text-underline-offset: 3px; }
.braid .b-text { font-family: var(--body); font-size: .92rem; line-height: 1.55; color: var(--ink); }
/* the event's own day, when it isn't the day we wrote about it */
.braid .b-of { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); margin-left: .4rem; white-space: nowrap; }
.braid .b-opens {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 0 .3rem; margin-right: .4rem; vertical-align: .08em;
}
.braid .why { color: var(--ink-dim); font-style: italic; font-size: var(--fs-ui); margin-top: .15rem; }

@media (max-width: 720px) {
    .braid { grid-template-columns: 2.3rem 10px 1fr; }
  .braid .b-text { font-size: .9375rem; }
  .lensbar { padding: .3rem .8rem .4rem; }
}

/* ============================================================
   The news center (docs/VIEWS-PLAN.md): a nav row under the header and
   six views, one visible at a time. The chart is still the instrument;
   these are the other pages of the same plotting book.
   ============================================================ */

/* Since 2026-10-04 the nav lives INSIDE the top bar: wordmark · destinations ·
   the brief door · account. It was a second full-width row of its own, and the
   chart sat under four rows of chrome (~175px) before a single storyline. The
   tabs shrink and scroll sideways before they ever push the account off-screen. */
.viewnav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  flex: 0 1 auto;
  min-width: 0;
  margin: calc(-.65rem - env(safe-area-inset-top)) 0 -.65rem;   /* the tab underline sits ON the bar's bottom rule */
  overflow-x: auto;
  scrollbar-width: none;
}
.viewnav::-webkit-scrollbar { display: none; }

.viewtab {
  font-family: var(--mono);
  font-size: var(--fs-ui);
  letter-spacing: .02em;
  color: var(--tx-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .2rem .7rem 0;
  cursor: pointer;
  white-space: nowrap;
}
.viewtab:hover, .viewtab:focus-visible { color: var(--ink); }
.viewtab.on { color: var(--ink); border-bottom-color: var(--lamp); }

/* the class sets display, so the browser's [hidden] needs saying out loud
   (the documented trap — .sheet and .login-screen both walked into it) */
.view { display: none; }
.view[hidden] { display: none; }

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem clamp(1rem, 4vw, 2.4rem) 3rem;
}

/* Every routable view needs a line here or it stays display:none forever — the
   station rail will set body[data-view] happily for a view this list forgot, and
   the page goes blank with no error anywhere. For You was that view. */
body[data-view="foryou"]  #view-foryou,
body[data-view="front"]   #view-front,
body[data-view="topics"]  #view-topics,
body[data-view="ahead"]   #view-ahead,
body[data-view="history"] #view-history,
body[data-view="markets"] #view-markets,
body[data-view="settings"] #view-settings { display: block; }

/* ---------- FOR YOU ---------- */
/* Four sections on one sheet, each a standing heading with the reader's own rows
   under it. The page is a desk blotter, not a feed: sections are separated by a
   rule and named in the chart hand, so "my things" stays legible even when three
   of the four are empty. */

#view-foryou .stamp {
  margin-top: 2.1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line-soft);
}
#view-foryou .view-sub + .stamp { margin-top: 1.6rem; }

.fy-lens { margin-bottom: 1.3rem; }
.fy-lens:last-child { margin-bottom: 0; }

/* the lens names itself and opens its own theater — a destination, styled like
   the lens chips on the chart rather than as a browser button */
.fy-lens-name {
  display: inline-flex; align-items: center; gap: .45rem;
  margin-bottom: .45rem; padding: .2rem .55rem;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 3px;
  font-family: var(--mono); font-size: var(--fs-ui); letter-spacing: .01em;
  color: var(--ink-dim);
  cursor: pointer;
}
.fy-lens-name:hover, .fy-lens-name:focus-visible { color: var(--ink); border-color: var(--ink-dim); }
.fy-lens-name .lens-eye { color: var(--lamp); font-size: var(--fs-meta); line-height: 1; }

/* a row is a headline with its dispatch under it — one reading rhythm, not a
   paragraph with the title glued to the front of it */
.fy-lens .margin-item { align-items: flex-start; padding: .35rem .3rem; }
.fy-lens .margin-item .dot { margin-top: .38rem; align-self: flex-start; }
.fy-body { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.fy-body .name { font-weight: 500; line-height: 1.35; }
.fy-summary {
  font-size: var(--fs-ui); line-height: 1.45; color: var(--ink-dim);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.fy-lens .margin-item .when { margin-top: .2rem; }

.fy-actions { margin-top: .6rem; }

.fy-bookmarks { list-style: none; margin: 0; padding: 0; }

/* ---------- the panel agent (Panel Agents §6) ---------- */
/* A right-hand drawer, mirroring the brief's left one, so "what is owed to me"
   and "what do I want to ask" sit on opposite edges of the same console. */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.panel {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--ground) 62%, transparent);
  display: flex; justify-content: flex-end;
  z-index: 1100;   /* above the dossier it was opened from */
}
/* An always-`display` overlay needs this rule explicitly — the .login-screen and
   .sheet both hit the same trap (CLAUDE.md, UI gotchas). */
.panel[hidden] { display: none; }

.panel-inner {
  width: min(460px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--bg-3);
  border-left: 1px solid var(--line);
  box-shadow: var(--elev-2);
  padding: 1.4rem 1.5rem 2.4rem;
  display: flex;
  flex-direction: column;
  animation: slide-in-right .22s ease-out;
}
@keyframes slide-in-right { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .panel-inner { animation: none; } }

.panel-head { display: flex; align-items: center; justify-content: space-between; }

.panel-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.panel-sub {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .04em;
  color: var(--ink-dim);
  margin: .3rem 0 .9rem;
}

/* Quoted material, drawn as quoted material: the reader's highlight is text a
   feed wrote, and it is shown as a quote here for the same reason the agent is
   told to treat it as one. */
.panel-quote {
  border-left: 2px solid var(--lamp);
  padding: .4rem 0 .4rem .8rem;
  margin-bottom: 1rem;
  font-size: .9375rem;
  color: var(--ink-dim);
  max-height: 7.5rem;
  overflow-y: auto;
}

.panel-thread { list-style: none; margin: 0; padding: 0; flex: 1; }

.panel-turn { border-top: 1px solid var(--line-soft); padding: .8rem 0; }
.panel-turn:first-child { border-top: none; }

.panel-who {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: .35rem;
}
.panel-turn.them .panel-who { color: var(--lamp); }
.panel-turn.failed .panel-who { color: var(--down); }

.panel-said { font-size: .95rem; }
.panel-said p { margin-bottom: .5rem; }
.panel-said p:last-child { margin-bottom: 0; }
.panel-said ul { margin: .3rem 0 .5rem 1.1rem; }
.panel-said a { color: var(--sea); }

/* What the agent read, named. An answer whose sources are invisible is an answer
   the reader cannot check, which is the whole thing Argus is against. */
.panel-read {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .06em;
  color: var(--ink-dim);
  margin-top: .45rem;
}

.panel-form { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .9rem; }

.panel-form textarea {
  width: 100%;
  resize: vertical;
  background: var(--ground);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .5rem .6rem;
  font-family: var(--body);
  font-size: .95rem;
}
.panel-form textarea:focus-visible { outline: none; border-color: var(--lamp); }

.panel-row { display: flex; align-items: center; gap: .8rem; margin-top: .55rem; }

.panel-status {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-dim);
  min-height: 1em;
}

/* The highlight-to-ask affordance: it follows a selection, so it is positioned
   from script and lives outside every overlay's stacking context. */
.ask-selection {
  position: fixed;
  z-index: 1200;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .04em;
  color: var(--ground);
  background: var(--lamp);
  border: none;
  border-radius: 3px;
  padding: .3rem .6rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgb(0 0 0 / 45%);
}
.ask-selection[hidden] { display: none; }

/* A phone gets the whole width; the drawer is the page while it is open. The
   two controls that ARE the panel — ask and close — get a real thumb target,
   because a primary action you cannot hit is a primary action you do not have. */
@media (max-width: 520px) {
  .panel-inner { width: 100%; border-left: none; padding: 1.1rem 1rem 2rem; }
  .panel-title { font-size: 1.4rem; }
  .panel-form textarea { font-size: 16px; }   /* under 16px, iOS zooms the page */
  .panel-form .btn { min-height: 44px; padding-inline: 1.4rem; }
  .panel-head .sheet-close { min-width: 44px; min-height: 44px; }
  .ask-selection { min-height: 44px; padding-inline: 1rem; }
}

/* Operator-only in P1, gated on the same env grant the settings admin block uses
   (config.js#isAdmin, surfaced as account.admin). One rule, not a hidden-flag per
   control — a non-operator must not be able to win an argument with it. */
body:not([data-admin="yes"]) [data-needs-admin] { display: none; }

/* ---------- the guest lane ---------- */
/* A guest reads everything and keeps nothing, so it is never offered a control
   the server would refuse. Hiding is one rule over `data-needs-account` rather
   than a hidden-flag per button: the buttons have their own show/hide logic, and
   a guest must not be able to win an argument with it. */
body[data-account="guest"] [data-needs-account] { display: none; }

/* For You is the same page for a guest, filled with the operator's curation and
   stamped as a sample — the sections a guest cannot fill carry data-needs-account
   and disappear with everything else it cannot use. */
.fy-sample { display: none; }
body[data-account="guest"] .fy-sample { display: block; }

.fy-sample {
  margin: 0 0 1.6rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--lamp);
  border-radius: 3px;
  background: var(--paper);
}
.fy-sample p { margin: 0; font-size: .9rem; color: var(--ink-dim); }
.fy-sample b { color: var(--ink); font-weight: 500; }
.fy-sample .fy-actions { margin-top: .7rem; }

/* and settings are how Argus behaves for ONE account, so the same rule holds */
body[data-account="guest"][data-view="settings"] #view-settings { display: none; }
body[data-account="guest"][data-view="settings"] #view-settings-guest { display: block; }

.guest-stamp {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .04em;
  color: var(--tx-3);
  padding: .2rem .1rem; white-space: nowrap;
}
.guest-stamp[hidden] { display: none; }

/* one instrument at a time: on any non-chart view the chart's own console,
   lenses, board and wire strip step aside */
body:not([data-view="chart"]):not([data-view="desk"]) .board,
body:not([data-view="chart"]):not([data-view="desk"]) .console,
body:not([data-view="chart"]):not([data-view="desk"]) .lensbar,
body:not([data-view="chart"]):not([data-view="desk"]) .wire-strip { display: none; }

/* A 4K monitor is not an excuse for a line of text a metre long: every reading
   view keeps one newspaper measure — anchored top-left, like the rest of the
   instrument (Kunjie tried centred, chose left: "something about it feels
   elegant that way"). */
.view > * { max-width: 68rem; }

.view-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.view-sub {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-dim);
  /* margin-inline stays auto (the .view > * centring) — a 0 here would pin
     the subtitle to the far left of a wide screen while the title stands centred */
  margin-block: .3rem 1.4rem;
  max-width: 68rem;
}
.view h2.stamp { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: .9rem; }

/* a small caps mark used wherever a row needs a count or a date stamped on it */
.mini-stamp {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.topic-stamp {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lamp);
  border: 1px solid var(--lamp);
  border-radius: 2px;
  padding: 0 .3rem;
  flex: none;
  line-height: 1.5;
}

/* ---------- FRONT ---------- */

.front-list { list-style: none; padding: 0; }

.front-item button {
  display: flex;
  gap: .9rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  font: inherit;
  padding: .8rem .3rem .85rem;
  cursor: pointer;
}
.front-item:first-child button { border-top: none; }
.front-item button:hover, .front-item button:focus-visible { background: var(--paper); }

.f-rank {
  font-family: var(--mono); font-size: .875rem; color: var(--ink-dim);
  min-width: 1.9rem; text-align: right; flex: none; padding-top: .15rem;
}
.front-item.unseen .f-rank { color: var(--lamp); }
.f-body { display: block; flex: 1; min-width: 0; }
.f-head { display: flex; align-items: baseline; gap: .5rem; }
/* a wrapping headline must not drag its lamp down to the middle of the block:
   the dot keeps station on the FIRST line, like a margin mark */
.front-item .dot {
  flex: none; width: .55rem; height: .55rem; border-radius: 50%;
  border: 1.5px solid var(--sea); align-self: flex-start; margin-top: .48rem;
}
.front-item[data-lane="markets"] .dot { border-color: var(--up); }
.front-item[data-lane="track"] .dot { border-color: var(--violet); }
.front-item.unseen .dot { background: var(--lamp); border-color: var(--lamp); }
.f-title { font-weight: 500; font-size: 1.02rem; }
.f-ts { margin-left: auto; font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); flex: none; }
.f-summary { display: block; margin-top: .1rem; }
.front-item:not(.unseen) .f-summary { color: var(--ink-dim); }
.f-why { display: block; font-style: italic; font-size: .9375rem; color: var(--ink-dim); }
/* front near-twins folded into this card (server/frontDedupe.js#groupNearTwins) */
.f-also { display: block; font-size: .875rem; color: var(--ink-dim); }
.f-meta {
  display: block; margin-top: .28rem;
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}

/* The operator's Ears card (public/earsCard.js): a topic-card in a corner of the
   Front page — the f-* row vocabulary inside, kept small; nobody else ever sees it. */
.ears-card { max-width: 68rem; margin-block: 0 1.2rem; padding: .6rem .9rem .7rem; }
.ears-card[hidden] { display: none; }
.ears-list { list-style: none; padding: 0; margin: 0 0 .4rem; }
.ears-item { padding: .45rem 0; border-top: 1px solid var(--line-soft); }
.ears-item:first-child { border-top: none; padding-top: 0; }
.ears-item .f-title { display: block; font-size: var(--fs-ui); }
.ears-item .f-summary { font-size: var(--fs-ui); color: var(--ink-dim); }
.ears-card > .f-why { margin-top: .2rem; }
.ears-link { display: inline-block; margin-top: .35rem; font-family: var(--mono);
             font-size: var(--fs-meta); color: var(--sea); }

/* the phone's way to the views the station rail has no room for */
.more-row { display: none; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 2rem;
            border-top: 1px solid var(--line); padding-top: .9rem; }

/* ---------- TOPICS ---------- */

.topics-list { list-style: none; padding: 0; display: grid; gap: .9rem;
               grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }

.topic-card { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: .3rem .4rem .5rem; }
.topic-card.unseen { border-color: color-mix(in srgb, var(--lamp) 55%, var(--line)); }
/* A quiet or closed topic recedes: a left rule in its state's hue, the whole card
   dimmed so the live ones stand forward. active gets nothing — it IS the baseline. */
.topic-card[data-life="cooling"]  { border-left: 3px solid color-mix(in srgb, var(--lamp) 60%, var(--line)); }
.topic-card[data-life="dormant"]  { border-left: 3px solid var(--ink-dim); opacity: .74; }
.topic-card[data-life="resolved"] { border-left: 3px solid var(--sea); opacity: .6; }

/* The lifecycle badge — the categorical state, spelled out. Shares the .topic-stamp
   vocabulary (mono, boxed, uppercase) so it reads as a chart annotation, and hue
   carries the state: amber slowing, grey asleep, sea-blue closed, green alive. */
.life-badge {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .16em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 .3rem;
  flex: none;
  line-height: 1.5;
  color: var(--ink-dim);
}
.life-badge[hidden] { display: none; }
.life-badge[data-life="active"]   { color: var(--up); }
.life-badge[data-life="cooling"]  { color: var(--lamp); }
.life-badge[data-life="dormant"]  { color: var(--ink-dim); }
.life-badge[data-life="resolved"] { color: var(--sea); }
/* F-17: the per-reader "Resolved" chip beside a result's lifecycle — reuses the
   life-badge shape so a resolved result reads as one of the family, in the sea tone. */
.resolved-chip {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: .14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 .3rem;
  flex: none;
  line-height: 1.5;
  color: var(--sea);
}
/* in the dossier it sits on its own line under the title, a moment's breath above the meta */
#sheet-life { display: inline-block; margin: .1rem 0 .35rem; vertical-align: middle; }

.topic-open {
  display: block; width: 100%; text-align: left;
  background: none; border: none; color: var(--ink); font: inherit;
  padding: .55rem .6rem .6rem; cursor: pointer; border-radius: 3px;
}
.topic-open:hover, .topic-open:focus-visible { background: var(--ground); }
.t-head { display: flex; align-items: baseline; gap: .5rem; }
.topic-card .dot {
  flex: none; width: .55rem; height: .55rem; border-radius: 50%;
  border: 1.5px solid var(--sea); align-self: flex-start; margin-top: .5rem;
}
.topic-card.unseen .dot { background: var(--lamp); border-color: var(--lamp); }
.t-title { font-weight: 500; font-size: 1.05rem; }
.t-ts { margin-left: auto; font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); flex: none; }
.t-summary { display: block; margin-top: .2rem; font-size: .95rem; color: var(--ink-dim); }
.topic-card.unseen .t-summary { color: var(--ink); }
.t-stamps { display: flex; flex-wrap: wrap; gap: .1rem .9rem; margin-top: .5rem; }
.topic-threads { padding: 0 .6rem .3rem 1.4rem; border-left: 1px solid var(--hairline); margin-left: .9rem; }

/* ---------- AHEAD ---------- */

.ahead-list { list-style: none; padding: 0; }
.ahead-day { display: grid; grid-template-columns: 9rem 1fr; gap: .6rem;
             border-top: 1px solid var(--line-soft); padding: .7rem 0; }
.ahead-day:first-child { border-top: none; }
.ahead-date {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .14em;
  text-transform: uppercase; color: var(--lamp); padding-top: .35rem;
}
.ahead-entries { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.ahead-entry button {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-left: 2px solid var(--hairline);
  color: var(--ink); font: inherit; padding: .25rem 0 .35rem .8rem; cursor: pointer;
}
.ahead-entry button:hover, .ahead-entry button:focus-visible { border-left-color: var(--lamp); background: var(--paper); }
.a-what { display: block; font-family: var(--body); font-size: 1.06rem; line-height: 1.3; }
/* one row per EVENT (public/ahead.js): three or more storylines waiting on it = a heavier rule */
.ahead-many > button { border-left: 4px solid var(--ink-dim); padding-left: calc(.8rem - 2px); }
.a-more { margin: 0 0 .3rem .9rem; font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim); }
.a-more summary { cursor: pointer; color: var(--sea); padding: .15rem 0; width: max-content; max-width: 100%; }
.a-more summary:hover, .a-more summary:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.a-more-list { list-style: none; margin: .25rem 0 .2rem; padding: 0 0 0 .8rem; border-left: 1px solid var(--hairline);
               display: flex; flex-direction: column; gap: .1rem; }
.a-more-list a { color: var(--ink); text-decoration: none; display: inline-block; padding: .15rem 0; }
.a-more-list a:hover, .a-more-list a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.a-unlisted { padding: .15rem 0; }
.a-title { display: block; font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .06em; color: var(--ink-dim); margin-top: .1rem; }

.q-list { list-style: none; padding: 0; max-width: 60rem; }
.q-group { margin-bottom: .9rem; }
.q-title {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .04em; color: var(--sea); text-align: left;
}
.q-title:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- HISTORY + the day rewind ---------- */

.hist-controls { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-bottom: 1.3rem; }
.hist-field {
  display: flex; flex-direction: column; gap: .3rem;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-dim);
}
.hist-field select, .hist-field input[type="date"] {
  background: var(--ground); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: var(--mono); font-size: .875rem;
  letter-spacing: 0; text-transform: none; padding: .35rem .5rem;
}
.hist-field select:focus-visible, .hist-field input:focus-visible { outline: 1px solid var(--lamp); }

/* since-you-left, read in History: the rail's sections, laid on the page */
.hist-since { margin-bottom: 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.hist-since[hidden] { display: none; }
.hist-since-meta {
  margin: 0 0 .8rem;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .04em; color: var(--ink-dim);
}
.hist-since .sinceleft-shape { margin-bottom: 1rem; }
.hist-since-actions { margin: 0 0 1.2rem; }
.hist-since .sinceleft-sec + .sinceleft-sec { margin-top: 1.2rem; }
.hist-since .sinceleft-region-head { position: static; }   /* the page scrolls, not a rail */
#hist-since-map { border-color: var(--lamp); color: var(--lamp); }
#hist-since-map:hover, #hist-since-map:focus-visible { color: var(--ink); }

.hist-list { list-style: none; padding: 0; }
.hist-item {
  display: flex; align-items: baseline; gap: .6rem; cursor: pointer;
  border-top: 1px solid var(--line-soft); padding: .55rem .3rem;
}
.hist-item:first-child { border-top: none; }
.hist-item:hover, .hist-item:focus-visible { background: var(--paper); }
.hist-item .dot {
  flex: none; width: .5rem; height: .5rem; border-radius: 50%;
  border: 1.5px solid var(--ink-dim); align-self: flex-start; margin-top: .45rem;
}
.hist-item[data-lane="markets"] .dot { border-color: var(--up); }
.hist-item[data-lane="track"] .dot { border-color: var(--violet); }
.h-title { font-size: .98rem; color: var(--ink-dim); }
.h-meta { margin-left: auto; font-family: var(--mono); font-size: var(--fs-meta);
          letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); flex: none; }

.day-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
#day-log { max-width: 60rem; }
#day-log .day-story {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .04em;
  color: var(--sea); text-align: left; display: block; margin-bottom: .1rem;
}
#day-log .day-story:hover { text-decoration: underline; text-underline-offset: 3px; }
#day-log .day-text { font-size: .96rem; }

/* ---------- MARKETS as a full view ---------- */

/* the phone desk's row grammar, promoted to every width. The wire strip carries
   the mono context for its own tickers; standing alone, the desk sets its own. */
.tickers-rows {
  display: flex; flex-direction: column; gap: .15rem; max-width: 62rem;
  font-family: var(--mono); font-size: .875rem;
}
.tickers-rows .tick {
  display: flex; flex-wrap: wrap; width: 100%; align-items: center;
  text-align: left;   /* a <button> centres by default — the why-line floated mid-row */
  gap: .6rem; padding: .55rem .35rem; border-radius: 3px;
  border-top: 1px solid var(--line-soft);
}
.tickers-rows .tick:hover, .tickers-rows .tick:focus-visible { background: var(--paper); }
.tickers-rows .tick .px { margin-left: auto; }
.tickers-rows .tick .why { flex-basis: 100%; max-width: none; white-space: normal; margin-top: .1rem; }
.tickers-rows .tickers-empty { font-family: var(--body); font-style: italic; font-size: .95rem; }

/* ---------- the brief's fold ---------- */

.brief-fold .b-count {
  display: inline-block; margin-top: .2rem;
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .14em;
  text-transform: uppercase; color: var(--lamp);
  border: 1px solid var(--line); border-radius: 2px; padding: 0 .35rem;
}

/* ---------- SETTINGS ---------- */
/* A control panel read as a page, not a form: every switch stands under its own
   micro-label with one plain line saying what it actually does. The blocks below
   set no display of their own, so `hidden` still works on them (the documented
   trap) — VAULT and ADMIN are absent from the payload, not merely dimmed. */

.set-facts {
  display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.1rem;
  margin: .2rem 0 0;
}
.set-facts dt {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-dim); padding-top: .12rem;
}
.set-facts dd { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.set-facts dd .set-off { color: var(--ink-dim); }

.set-rows { display: flex; flex-direction: column; gap: 1.25rem; margin-top: .9rem; }
.set-row { display: flex; flex-direction: column; gap: .32rem; max-width: 34rem; }
.set-label {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-dim);
}
.set-toggle .set-label {
  display: flex; align-items: center; gap: .6rem;
  min-height: 44px; cursor: pointer;         /* the whole label is the target */
}
.set-toggle input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--lamp); flex: none; }
.set-row select, .set-row input[type="text"] {
  background: var(--ground); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: var(--mono); font-size: .875rem;
  letter-spacing: 0; text-transform: none; padding: .5rem .55rem; min-height: 44px;
  width: 100%;
}
.set-row select:focus-visible, .set-row input:focus-visible { outline: 1px solid var(--lamp); }
.set-note { font-size: var(--fs-ui); color: var(--ink-dim); margin: 0; }
.set-note.set-warn { color: var(--lamp); }

/* Settings v2 (docs/SETTINGS-V2-PLAN.md). Same .set-* idiom as everything above;
   these only add the shapes the six sections needed and nothing had yet. */
.set-row textarea {
  background: var(--ground); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: var(--mono); font-size: .875rem;
  padding: .5rem .55rem; width: 100%; resize: vertical;
}
.set-row textarea:focus-visible { outline: 1px solid var(--lamp); }
/* a radio/checkbox that carries its own sentence: the whole line is the target */
.set-check {
  display: flex; align-items: center; gap: .6rem;
  min-height: 44px; cursor: pointer; font-size: .9rem;
}
.set-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--lamp); flex: none; }
/* honest-disabled: a row that is rendered because it is coming, not because it works */
.set-soon, .set-soon .set-label, .set-soon .set-note { color: var(--ink-dim); opacity: .65; }
.set-soon input { cursor: not-allowed; }
.set-soon .set-check, .set-soon.set-check { cursor: not-allowed; }
.set-lens-row .set-lens-meta { font-family: var(--mono); font-size: var(--fs-meta); }
.set-places { margin: .5rem 0 .2rem; }
/* the lens dialog's second-line hints, in the label above the field */
.dlg-sub { font-size: var(--fs-ui); color: var(--ink-dim); font-style: italic; }
.dlg-form textarea#lens-sources { font-family: var(--mono); font-size: var(--fs-ui); }

/* ---- lens dialog: live preview + reach as three visible outcomes ---- */
/* reach is a segmented control, not a dropdown of adjectives; each button
   carries a live count once the preview has run, so choosing a reach means
   choosing between "3 situations" and "11 situations", not between words */
.seg { display: flex; gap: 0; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.seg button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .45rem .3rem; background: var(--bg-1); border: none; cursor: pointer;
  color: var(--ink-dim); font: inherit; font-size: var(--fs-ui);
}
.seg button + button { border-left: 1px solid var(--hairline); }
.seg button:hover, .seg button:focus-visible { color: var(--ink); background: var(--paper); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: inset 0 -2px 0 var(--lamp); }
.seg-label { display: inline-flex; align-items: baseline; gap: .35rem; }
.seg-word { display: inline-flex; align-items: baseline; gap: .35rem; }
.seg-n {
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--lamp);
  border: 1px solid var(--hairline); border-radius: 8px; padding: 0 .35rem;
}
.seg-sub { font-size: var(--fs-meta); color: var(--tx-3); }

/* the preview panel: what these phrases would collect from today's lake */
.lens-preview {
  border: 1px solid var(--hairline); border-radius: 6px;
  background: var(--bg-1); padding: .5rem .6rem; margin: .2rem 0 .1rem;
}
.lens-preview p { font-size: var(--fs-ui); color: var(--ink-dim); margin: 0 0 .3rem; }
.lens-preview ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.lens-preview li {
  display: flex; align-items: baseline; gap: .5rem;
  font-size: var(--fs-ui); color: var(--ink); min-width: 0;
}
.lens-preview li b { font-family: var(--mono); font-size: var(--fs-meta); color: var(--lamp); flex: none; }
.lens-preview li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lens-preview li i {
  font-style: normal; font-family: var(--mono); font-size: var(--fs-meta);
  color: var(--tx-3); flex: none; margin-left: auto;
}
/* a near-miss the current reach would NOT collect — visible, but plainly out */
.lens-preview li.lp-out { color: var(--ink-dim); }
.lens-preview li.lp-out b { color: var(--tx-3); }

/* advanced fields fold away; the essentials are the whole form for most readers */
.dlg-more { border-top: 1px solid var(--hairline); padding-top: .4rem; margin-top: .2rem; }
.dlg-more > summary {
  cursor: pointer; font-size: var(--fs-ui); color: var(--ink-dim);
  list-style: none; user-select: none;
}
.dlg-more > summary::-webkit-details-marker { display: none; }
.dlg-more > summary::before { content: '▸ '; color: var(--tx-3); }
.dlg-more[open] > summary::before { content: '▾ '; }
.dlg-more > summary:hover, .dlg-more > summary:focus-visible { color: var(--ink); }
.dlg-more[open] { padding-bottom: .2rem; }
/* pinned places jump the chart; a lane chip filters it — different row, dimmer ring */
.place-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-place { border-style: dashed; border-color: var(--line); }
.chip-place:hover, .chip-place:focus-visible { color: var(--ink); border-color: var(--ink-dim); }
.breaking-stamp { color: var(--lamp); border-color: var(--lamp); }
.starter-home-row { max-width: 26rem; margin: 0 auto .9rem; }

.set-sub {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-dim);
  margin: 1.3rem 0 .4rem;
}

/* a taste row is a title and the one button that undoes it */
#set-mutes .margin-item, #set-boosts .margin-item { cursor: default; }
#set-mutes .name, #set-boosts .name {
  background: none; border: none; padding: 0; text-align: left;
  color: var(--ink-dim); font: inherit; font-size: .95rem; cursor: pointer;
  min-width: 0; overflow-wrap: anywhere;
}
#set-mutes .name:hover, #set-boosts .name:hover,
#set-mutes .name:focus-visible, #set-boosts .name:focus-visible { color: var(--ink); }
.set-undo {
  flex: none;
  background: none; border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink-dim); font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .12em; text-transform: uppercase;
  padding: .35rem .6rem; min-height: 32px; cursor: pointer;
}
.set-undo:hover, .set-undo:focus-visible { color: var(--ink); border-color: var(--ink-dim); }

/* the cycle log: a ledger, so it scrolls inside itself rather than the page */
.set-runs-wrap { overflow-x: auto; }
.set-runs { border-collapse: collapse; font-family: var(--mono); font-size: var(--fs-meta); width: 100%; }
.set-runs td { border-top: 1px solid var(--line-soft); padding: .4rem .55rem .4rem 0; white-space: nowrap; }
.set-runs tr:first-child td { border-top: none; }
.set-runs .r-ts { color: var(--ink-dim); }
.set-runs .r-err { color: var(--down); white-space: normal; }

/* the operator's eyes: alerts first, then the facts, then the week (server/quality.js).
   An alert is one plain sentence under its code; the colour is the level and nothing
   else on the page uses these two tokens. */
.set-quality { margin-top: 1.1rem; }   /* no display of its own: `hidden` must keep working (the trap above) */
.set-alerts {
  list-style: none; padding: 0; margin: .4rem 0 .2rem;
  display: flex; flex-direction: column; gap: .35rem;
}
.set-alerts li {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .4rem .6rem; border-left: 3px solid var(--line); border-radius: 2px;
  background: var(--paper); font-size: .92rem;
}
.set-alerts .alert-code {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .14em; text-transform: uppercase;
}
.set-alerts .alert-text { overflow-wrap: anywhere; }
.set-alerts .alert-red { border-left-color: var(--alert-red); }
.set-alerts .alert-red .alert-code { color: var(--alert-red); }
.set-alerts .alert-amber { border-left-color: var(--alert-amber); }
.set-alerts .alert-amber .alert-code { color: var(--alert-amber); }
.set-alerts .alert-none {
  background: none; border-left-color: transparent; padding-left: 0;
  color: var(--ink-dim); font-style: italic;
}
.set-days th {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: normal; text-align: left;
  padding: 0 .55rem .3rem 0; white-space: nowrap;
}
.set-days tbody tr:first-child td { border-top: 1px solid var(--line-soft); }

/* ---------- touch instruments: the news center under a thumb ---------- */

@media (pointer: coarse) {
  .viewtab { padding: .7rem 1rem .62rem; }
  .front-item button { padding: .9rem .25rem 1rem; }
  .topic-open { padding: .85rem .7rem .9rem; }
  .ahead-entry button { padding: .55rem 0 .6rem .8rem; }
  .hist-item { padding: .8rem .3rem; }
  .tickers-rows .tick { padding: .85rem .35rem; }
  .q-title, #day-log .day-story { padding: .3rem 0; }
}

/* ---------- phone: the pocket news center at 390px ----------
   This is the primary reading surface, not a fallback. Every row here is a
   thumb target, nothing scrolls sideways, and the station rail carries the
   destinations that matter — the rest hang off the front page's more-row. */

@media (max-width: 700px) {
  .viewnav { display: none; }
  .more-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .more-row .stamp-inline { grid-column: 1 / -1; }
  .more-row .btn, .day-nav .btn {
    border-color: var(--line); color: var(--ink-dim);
    padding: .7rem .4rem; text-align: center; min-height: 44px;
  }

  .view {
    padding: 1.1rem calc(.9rem + env(safe-area-inset-right)) 1.8rem calc(.9rem + env(safe-area-inset-left));
  }
  .view-title { font-size: 1.5rem; }
  .view-sub { margin-bottom: 1.1rem; }
  .view h2.stamp { margin-top: 1.6rem; }

  /* FRONT: the rank column narrows, the row grows into a thumb target */
  .front-item button { padding: .85rem .2rem .95rem; gap: .6rem; }
  .f-rank { min-width: 1.3rem; font-size: var(--fs-meta); }
  .f-title { font-size: .98rem; }
  .f-summary { font-size: .95rem; }
  .f-ts { font-size: var(--fs-meta); }

  /* TOPICS: one card per row, its threads tucked but still tappable */
  .topics-list { grid-template-columns: 1fr; gap: .7rem; }
  .topic-open { padding: .8rem .65rem .85rem; }
  .t-stamps { gap: .1rem .7rem; }
  .topic-threads { margin-left: .5rem; padding: 0 .5rem .4rem 1rem; }
  .topic-threads .margin-item { padding: .5rem .3rem; }

  /* AHEAD: the date becomes a heading over its entries, never a squeezed column */
  .ahead-day { grid-template-columns: 1fr; gap: .25rem; padding: .8rem 0; }
  .ahead-date { padding-top: 0; }
  .ahead-entry button { padding: .5rem 0 .55rem .75rem; }
  .ahead-many > button { padding-left: calc(.75rem - 2px); }
  .a-more summary, .a-more-list a { padding: .55rem 0; }

  /* HISTORY: full-width fields (16px stops iOS auto-zoom), rows that wrap honestly */
  .hist-controls { gap: .7rem; }
  .hist-field { flex: 1 1 100%; }
  .hist-field select, .hist-field input[type="date"] { font-size: 16px; padding: .6rem .55rem; width: 100%; }
  .hist-item { flex-wrap: wrap; padding: .75rem .3rem; }
  .h-meta { margin-left: 0; flex-basis: 100%; margin-top: .15rem; }
  .day-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }

  /* MARKETS: the same desk rows the phone already knew, given room */
  .tickers-rows .tick { padding: .95rem .3rem; }

  /* the brief's fold has to read at arm's length too */
  .brief-fold .b-count { margin-top: .3rem; }

  /* every list row in an overlay (the country sheet included) is a thumb target */
  .margin-item { padding: .55rem .35rem; }

  .tabbar { grid-template-columns: repeat(5, 1fr); }
  /* min-width: 0 — a grid track grows to its content by default, so a wide
     "BRIEF 3023" lamp pushed the whole rail past the viewport edge (2026-09-05).
     The count itself is capped at 99+ in app.js. */
  .tab { min-width: 0; overflow: hidden; white-space: nowrap; }
  .tab > span:not(.tab-lamp) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

  /* long reads at arm's length: card summaries clamp — the full text is one tap
     away in the dossier. The wire clamps each dispatch to a glance; a tap unfolds it. */
  .t-summary, .f-summary {
    display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 6; overflow: hidden;
  }
  .wire li:not(.wire-day):not(.w-open) {
    display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 5; overflow: hidden;
    cursor: pointer;
  }
  .wire li.w-open { cursor: pointer; }

  /* the guest stamp steps aside on a phone, so the top row holds wordmark ·
     Sign in · EN · ? on ONE line. It used to yield to 30vw, but once the language
     button joined the row "READING AS …" was a clipped stub and EN + ? wrapped
     onto a stranded second line (2026-10-04). "Sign in" already says whose
     reading this is. (These live down here because the base .guest-stamp/.lensbar
     rules above would otherwise win the cascade over the earlier phone block.) */
  .guest-stamp { display: none; }
  .guest-stamp[hidden] { display: none; }
  #btn-tour, #btn-lang { flex: none; }

  /* lenses: one thumb rail that scrolls sideways, never a stack — wrapping
     chips buried the chart (the landing view) under half a screen of pills */
  .lensbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: .35rem .8rem .45rem calc(.8rem + env(safe-area-inset-left));
  }
  .lensbar::-webkit-scrollbar { display: none; }
  /* flex: none — with min-width:0 the chip box shrank to the row's leftover
     width, its chips spilled out of it, and "+ Lens" was painted on top of
     them (Kunjie's phone, 2026-10-23). The ROW scrolls; the box keeps its size. */
  .lens-chips { flex-wrap: nowrap; flex: none; }
  /* the range menu and the chips already say what this row is */
  .lens-stamp { display: none; }
  .chip-lens, .chip-new-lens { flex: none; white-space: nowrap; }
}

/* ---------- gated sign-up (2026-09-02): the pending banner, the create-account
   line under the login form, and the operator's approval queue ---------- */

/* one quiet line across the top: you are in, reading; the rest is coming */
.pending-banner {
  font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .06em;
  color: var(--lamp);
  background: color-mix(in srgb, var(--lamp) 10%, var(--ground));
  border-bottom: 1px solid color-mix(in srgb, var(--lamp) 35%, var(--line));
  padding: .45rem .9rem; text-align: center;
}
.pending-banner[hidden] { display: none; }


/* the approval queue: same margin rows as taste, plus a status stamp */
.signup-row { gap: .55rem; }
.signup-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.signup-status {
  flex: none; font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: .12em;
  text-transform: uppercase; border: 1px solid var(--line-soft); border-radius: 3px;
  padding: .18rem .45rem; color: var(--ink-dim);
}
.signup-status.is-pending { color: var(--lamp); border-color: color-mix(in srgb, var(--lamp) 40%, var(--line)); }
.signup-status.is-denied  { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, var(--line)); }

/* ---------- invite-only sign-up (2026-09-04): the code on the login panel,
   in the pending banner, and the operator's book of codes ---------- */

/* the banner is now a line AND a control, so it lays itself out */
.pending-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .5rem .9rem;
}
.pending-redeem { display: inline-flex; align-items: center; gap: .4rem; }
.pending-redeem[hidden] { display: none; }
.pending-redeem label { letter-spacing: .06em; }
.pending-redeem input, .set-invite-new input {
  background: var(--ground); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: var(--mono); font-size: var(--fs-ui);
  letter-spacing: .1em; text-transform: uppercase; padding: .3rem .45rem;
}
.pending-redeem input { width: 11rem; }
.pending-redeem input:focus-visible, .set-invite-new input:focus-visible { outline: 1px solid var(--lamp); }
/* the field keeps the login panel's own input styling; only the code shape is ours */
#login-invite { letter-spacing: .1em; text-transform: uppercase; min-height: 44px; }
/* `.dlg-form label` is display:flex always — the documented trap; hidden needs saying */
#login-invite-row[hidden] { display: none; }
.set-invite-new input { min-height: 36px; width: 14rem; text-transform: none; letter-spacing: 0; }

/* one code per row: the code itself, what it was for, where it stands */
.set-invite-new { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .2rem 0 .6rem; }
.invite-row { gap: .55rem; }
.invite-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-dim); }
.invite-code {
  flex: none; background: none; border: 1px dashed var(--line);
  border-radius: 3px; color: var(--ink); font-family: var(--mono);
  font-size: var(--fs-meta); letter-spacing: .08em; padding: .25rem .45rem;
  min-height: 32px; cursor: copy;
}
.invite-code:hover, .invite-code:focus-visible { border-color: var(--lamp); color: var(--lamp); }
.signup-status.is-used { color: var(--ink-dim); }

/* this account's own sign-in, under the account facts */
.set-account-security { margin-top: .8rem; }
.set-account-security[hidden] { display: none; }
.set-account-line { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.set-account-state { font-size: .9375rem; color: var(--ink-dim); }
.set-account-state.is-unverified { color: var(--lamp); }
#form-set-password { margin-top: .5rem; }
#form-set-password input[type="password"] {
  background: var(--ground); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: var(--mono); font-size: .875rem;
  padding: .5rem .55rem; min-height: 44px; width: 100%;
}
#form-set-password input:focus-visible { outline: 1px solid var(--lamp); }
#set-password-error:empty { display: none; }
.signup-approve:hover, .signup-approve:focus-visible { color: var(--up); border-color: var(--up); }
.signup-deny:hover, .signup-deny:focus-visible { color: var(--down); border-color: var(--down); }

/* ---------- first-visit tour (tour.js) ----------
   The ring is the spotlight: a fixed box over the real element whose giant
   box-shadow dims everything else. No cloned UI, no screenshots — the page
   underneath is the actual app. */
#tour-ring {
  position: fixed;
  z-index: 6000;
  border: 2px solid var(--accent, #e8b04b);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(6, 8, 12, 0.62);
  pointer-events: none;
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
#tour-ring.tour-dim { top: 0; left: 0; width: 100vw; height: 100vh; border: 0; border-radius: 0; box-shadow: none; background: rgba(6, 8, 12, 0.62); }
#tour-ring[hidden], #tour-card[hidden] { display: none; }
#tour-card {
  position: fixed;
  z-index: 6001;
  width: min(360px, calc(100vw - 24px));
  background: var(--paper, #14161c);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#tour-card.tour-centered { top: 50%; left: 50%; transform: translate(-50%, -50%); }
#tour-card:not(.tour-centered) { transform: none; }
#tour-card h3 { margin: 2px 0 6px; font-size: 1.05rem; }
#tour-card p { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.45; opacity: 0.9; }
.tour-head { display: flex; align-items: center; justify-content: space-between; }
.tour-count { font-size: var(--fs-ui); opacity: 0.6; letter-spacing: 0.06em; }
.tour-x { background: none; border: 0; color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0.7; padding: 2px 6px; }
.tour-x:hover { opacity: 1; }
.tour-nav { display: flex; align-items: center; gap: 8px; }
.tour-spacer { flex: 1; }
.tour-actions { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.tour-actions[hidden] { display: none; }
.tour-setup-btn { text-align: left; }
#tour-card .tour-nav [hidden] { display: none; }

/* ---- The landing: a guest's front door (tour.js#showLanding) ----
   One centered card over the dimmed live console. Same never-traps rules
   as the tour; the app underneath is real and visible, not a screenshot. */
#landing-dim {
  position: fixed; inset: 0; z-index: 6000;
  background: rgba(6, 8, 12, 0.72);
}
#landing-dim[hidden], #landing-card[hidden] { display: none; }
#landing-card {
  position: fixed; z-index: 6001;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px); overflow: auto;
  background: var(--paper, #14161c); color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}
#landing-card h2 { margin: 4px 0 8px; font-size: 1.5rem; letter-spacing: 0.02em; }
.landing-lede { margin: 0 0 10px; font-size: 0.92rem; line-height: 1.5; opacity: 0.92; }
.landing-points { margin: 0 0 14px; padding-left: 18px; }
.landing-points li { font-size: .9375rem; line-height: 1.5; opacity: 0.82; margin: 3px 0; }
.landing-actions { display: flex; flex-direction: column; gap: 8px; }
.landing-actions .btn { width: 100%; }

/* ===== map overhaul (2026-09-05) ===== */
/* Country heat, breaking marks, hover cards. Fill colours are set by JS
   (applyHeat, app.js); everything here is class-driven so it never fights the
   choropleth's setStyle. */

/* hover: a CSS class instead of setStyle, so the heat fill underneath survives.
   CSS beats SVG presentation attributes, so stroke/width land over Leaflet's. */
path.country-hover {
  stroke: #7F9AC8;
  stroke-width: 1.4;
  filter: brightness(1.25);
}

/* Antarctica is ice, not a country: a faint shelf that never competes with the
   inhabited land for attention. CSS fill beats the attribute the choropleth
   sets, so applyHeat cannot light it up either. Still clickable. */
path.country-polar {
  fill: #16202E;
  fill-opacity: .5;
  stroke: #26364C;
  stroke-width: .7;
}

/* a country holding a breaking storyline: a slow pulse on the stroke */
path.country-breaking { animation: country-breaking 3.4s ease-in-out infinite; }
@keyframes country-breaking {
  0%, 100% { stroke: #6E3A24; stroke-width: 1.1; }
  50%      { stroke: #FF8A54; stroke-width: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
  path.country-breaking { animation: none; stroke: #C0552F; stroke-width: 1.3; }
}

/* breaking marker: double ring, red-shifted amber, a faster lamp — and its own
   pane (breakingMarkers, z 620) so it never hides under a neighbour */
.marker[data-breaking] .ring {
  border-color: #FF8A54;
  background: color-mix(in srgb, #FF8A54 30%, transparent);
  opacity: 1;
  animation: lamp-breaking 1.1s ease-in-out infinite;
}
@keyframes lamp-breaking {
  0%, 100% { box-shadow: 0 0 0 2.5px #0B0F16, 0 0 0 4px #FF8A54, 0 0 6px 2px rgba(255, 110, 60, .25); }
  50%      { box-shadow: 0 0 0 2.5px #0B0F16, 0 0 0 4px #FF8A54, 0 0 18px 5px rgba(255, 110, 60, .6); }
}
@media (prefers-reduced-motion: reduce) {
  .marker[data-breaking] .ring {
    animation: none;
    box-shadow: 0 0 0 2.5px #0B0F16, 0 0 0 4px #FF8A54, 0 0 12px 3px rgba(255, 110, 60, .45);
  }
}
.legend-breaking {
  display: inline-block;
  width: .5rem; height: .5rem;
  border-radius: 50%;
  background: #FF8A54;
  box-shadow: 0 0 0 1.5px #0B0F16, 0 0 0 2.5px #FF8A54;
  vertical-align: baseline;
}

/* the country hover card (desktop only) — Leaflet's tooltip ships white */
.leaflet-tooltip.country-tip {
  background: #10161F;
  border: 1px solid #243349;
  border-radius: 4px;
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
  padding: .45rem .6rem;
  font: inherit;
}
.country-tip.leaflet-tooltip-top::before    { border-top-color: #243349; }
.country-tip.leaflet-tooltip-bottom::before { border-bottom-color: #243349; }
.country-tip.leaflet-tooltip-left::before   { border-left-color: #243349; }
.country-tip.leaflet-tooltip-right::before  { border-right-color: #243349; }
.country-tip-name {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
.country-tip-meta {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--ink-dim);
  margin-top: .15rem;
}
.country-tip-top {
  font-size: .875rem;
  color: var(--ink);
  margin-top: .3rem;
  max-width: 32ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the country sheet's enrichment (built by ensureWhereExtras, app.js) */
.where-breaking {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #FF8A54;
  margin: .2rem 0 .4rem;
}
.where-focus {
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .08em;
  padding: .25rem .6rem;
  margin: .2rem 0 .7rem;
  cursor: pointer;
}
.where-focus:hover, .where-focus:focus-visible { color: var(--ink); border-color: #3A5480; }

/* phones: standing labels are a smudge at fitWorld scale — only clusters and
   breaking marks keep theirs; everything else names itself on tap-focus */
@media (max-width: 768px) {
  .marker.labelled:not(.cluster):not([data-breaking]) .marker-label { opacity: 0; }
  .marker:focus-visible .marker-label { opacity: 1; }
}

/* ==================== THE STORY PAGE (#/story/:id) ====================
   The full-page reading of one storyline. Desktop: the page takes everything
   except a thin left strip where the LIVE map still shows through — you zoomed
   INTO the world, you did not leave it; the strip is a button back. Phone:
   100% takeover, the margin rail becomes sections after the spine, and below
   the waterline everything is collapsed behind a count. */

.story {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex;
}
.story[hidden] { display: none; }

/* the map strip: transparent, so whatever view is behind stays visible and live */
.story-mapback {
  flex: 0 0 84px;
  background: color-mix(in srgb, var(--ground) 35%, transparent);
  border: none; border-right: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
  padding: 0;
}
.story-mapback:hover { background: color-mix(in srgb, var(--ground) 15%, transparent); }
.story-mapback-label {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-dim); white-space: nowrap;
}
.story-mapback:hover .story-mapback-label { color: var(--ink); }

.story-inner {
  flex: 1 1 auto;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  box-shadow: var(--elev-2);
  padding: 1.1rem clamp(1.2rem, 4vw, 3.2rem) 4rem;
  animation: story-in .24s ease-out;
}
@keyframes story-in { from { transform: translateX(32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .story-inner { animation: none; } }

.story-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding-bottom: .8rem; margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--hairline);
}
.story-mast {
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .3em; color: var(--tx-3); text-transform: uppercase;
}

.story-head { max-width: 1100px; }
.story-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: .02em;
  margin: .15rem 0 .4rem;
  max-width: 26ch;
}

/* the fact strip: 3–5 labeled numbers, the state before the prose */
.story-facts {
  display: flex; flex-wrap: wrap; gap: 0 2rem;
  margin: .7rem 0 .4rem;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .55rem 0;
}
.story-facts:empty { display: none; }
.story-facts .fact { display: inline-flex; flex-direction: column; gap: .12rem; }
.story-facts .fact-k {
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .14em; color: var(--tx-3);
}
.story-facts .fact-v { font-family: var(--mono); font-size: var(--fs-ui); color: var(--ink); }

/* the two-column read: spine (~62%) + margin rail (~30%) */
.story-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 2.6rem;
  max-width: 1100px;
  margin-top: 1.4rem;
  align-items: start;
}
.story-spine { max-width: 62ch; }
.story-spine .state-body { font-size: var(--fs-body); }

.story-rail { position: sticky; top: 0; display: grid; gap: 1.4rem; }
.story-rail-sec .stamp { margin-bottom: .5rem; }

/* DELTA: the since-you-left band + the hard waterline */
.story-delta { margin: 1.4rem 0 1.6rem; }
.story-delta-head {
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--lamp);
  margin-bottom: .5rem;
}
.story-delta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.story-delta-list li {
  font-size: var(--fs-ui); line-height: 1.45; color: var(--ink);
  border-left: 2px solid var(--lamp);
  padding-left: .7rem;
}
.story-delta-list .ts { font-family: var(--mono); font-size: var(--fs-meta); color: var(--lamp); margin-right: .35rem; }
.story-delta-list .story-delta-more,
.story-delta-list .story-delta-quiet { border-left-color: var(--hairline); color: var(--tx-3); }
.story-waterline {
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .08em;
  color: var(--tx-3);
  margin-top: .9rem;
  overflow: hidden; white-space: nowrap; text-overflow: clip;
}

/* RECORD: body sections + the wire, foldable, each named with a count */
.story-sec { border-top: 1px solid var(--hairline); padding: .2rem 0 .4rem; }
.story-sec-h {
  font-family: var(--mono); font-size: var(--fs-meta);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-dim);
  padding: .6rem 0;
  cursor: pointer; list-style: none;
}
.story-sec-h::before { content: '▸ '; color: var(--tx-3); }
.story-sec[open] > .story-sec-h::before { content: '▾ '; }
.story-sec-h::-webkit-details-marker { display: none; }
.story-sec-h:hover { color: var(--ink); }
.story-sec .wire { margin-top: .3rem; }

/* the margin rail's source weights */
.story-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.story-src { display: grid; grid-template-columns: minmax(0, 9ch) 1fr 2.5ch; gap: .6rem; align-items: center; }
.story-src-name {
  font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-dim);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.story-src-track { height: 5px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.story-src-fill { display: block; height: 100%; background: var(--sea); }
.story-src-n { font-family: var(--mono); font-size: var(--fs-meta); color: var(--tx-3); text-align: right; }

.story-actions { display: grid; gap: .5rem; }
.story-actions .btn { width: 100%; }
.story-react { margin-top: 0; }

/* phone: 100% takeover, one column, rail after spine, sections stay folded */
@media (max-width: 899px) {
  .story-mapback { display: none; }
  .story-inner { border-left: none; padding: .9rem 1rem 5rem; }
  .story-cols { grid-template-columns: 1fr; gap: 1.6rem; }
  .story-rail { position: static; }
  .story-title { max-width: none; }
}

/* ---------- GDPR consent (2026-10-18): the 16+/privacy box on create-account
   and in the pending banner ---------- */
.consent-check { font-size: .875rem; line-height: 1.4; color: var(--ink-dim); }
.dlg-form label.consent-check { align-items: flex-start; }
.consent-check input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: .1rem 0 0; accent-color: var(--lamp); }
.consent-check a { color: var(--ink); }
/* `.dlg-form label` is display:flex always — hidden needs saying (same trap as the invite row) */
#login-consent-row[hidden] { display: none; }
.consent-inline { display: inline-flex; align-items: center; gap: .35rem; letter-spacing: 0; }

/* ---------- SETTINGS PANES (2026-10-28, settingsNav.js, docs/SETTINGS-PANES.md) ----------
   The page was one 4,700px column. Now: a title, a rail of panes on the left
   (a sticky chip row on a phone), and ONE pane at a time on the right. Inside a
   pane, groups sit on quiet cards and a setting reads as a list row — the name
   and its one-line note on the left, the control on the right — the shape every
   settings screen a reader already knows has.
   Colour rule kept: --lamp still means "unseen" and nothing else here, so the
   active rail item is marked in cream and a switch that is on reads in --sea. */

/* the documented [hidden] trap, closed once for the whole view: many settings
   blocks carry a display of their own (.set-rows, .set-row, .btn…), and author
   CSS beats the browser's [hidden] — the install row leaked through exactly so */
#view-settings [hidden] { display: none !important; }

#view-settings > .set-shell { max-width: 74rem; }
.set-shell {
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 50rem);
  grid-template-areas: "head head" "nav main";
  column-gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.set-head { grid-area: head; }
.set-head .view-sub { margin-bottom: 1.6rem; }
.set-nav { grid-area: nav; position: sticky; top: 0; align-self: start; }
.set-main { grid-area: main; min-width: 0; padding-bottom: 2rem; }

.set-nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.set-nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .55rem .8rem; min-height: 42px;
  border-radius: 6px; border-left: 2px solid transparent;
  font-family: var(--ui); font-size: var(--fs-ui); line-height: 1.25;
  color: var(--ink-dim); text-decoration: none;
}
.set-nav-item:hover { background: var(--bg-2); color: var(--ink); }
.set-nav-item:focus-visible { outline: 1px solid var(--sea); outline-offset: 1px; }
.set-nav-item.on { background: var(--bg-2); color: var(--ink); border-left-color: var(--ink); font-weight: 500; }
.set-nav-admin { margin-top: .6rem; }
.set-nav-count {
  flex: none; min-width: 1.5rem; padding: .05rem .45rem;
  border-radius: 999px; background: var(--bg-3);
  font-family: var(--figures); font-size: 12px; line-height: 1.5; text-align: center;
  color: var(--tx-3);
}
.set-nav-count[data-tone="red"] { background: var(--alert-red); color: var(--bg-0); }
.set-nav-count[data-tone="amber"] { background: var(--alert-amber); color: var(--bg-0); }

/* the pane's own heading: the old micro-stamp, grown into a title */
#view-settings .set-pane h2.stamp {
  margin: 0; padding: 0; border: 0;
  font-family: var(--display); font-weight: 700; font-size: 1.5rem;
  letter-spacing: .08em; color: var(--ink);
}
.set-pane-lede { font-size: var(--fs-ui); color: var(--ink-dim); margin: .25rem 0 1.1rem; max-width: 42rem; }

.set-card {
  background: color-mix(in srgb, var(--bg-2) 70%, var(--bg-1));
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 1.05rem 1.25rem;
  margin-top: .9rem;
}
.set-pane > .set-card:first-of-type, .set-pane-lede + .set-card { margin-top: 0; }
.set-card > .set-sub:first-child { margin-top: 0; }
.set-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.set-card-head .set-sub { margin: 0; }
.set-card .margin-list { margin-top: .75rem; }
.set-card .set-places { margin-top: .7rem; }
.set-card-soon { background: none; border-style: dashed; }
.set-group-head { margin-top: 1.7rem; }
.set-card-danger { border-color: color-mix(in srgb, var(--down) 45%, var(--hairline)); }
.set-danger-head { color: var(--down); }

/* rows inside a card: hairlines between, no extra gap */
.set-card .set-rows, .set-rows.set-card { gap: 0; }
.set-rows.set-card { margin-top: .9rem; }
.set-pane-lede + .set-rows.set-card { margin-top: 0; }
.set-card .set-row { max-width: none; position: relative; }
.set-card .set-rows > .set-row + .set-row,
.set-rows.set-card > .set-row + .set-row,
.set-card .set-rows + .set-rows { border-top: 1px solid var(--hairline); padding-top: 1rem; margin-top: 1rem; }
.set-card .set-facts + .set-rows { margin-top: 1rem; }

/* a setting reads as its name, in plain case, not a micro-label */
.set-card .set-row-inline > .set-label {
  font-family: var(--ui); font-size: var(--fs-ui); font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--ink);
}
.set-row input[type="password"] {
  background: var(--ground); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-family: var(--ui); font-size: .9rem;
  padding: .5rem .55rem; min-height: 44px; width: 100%;
}
.set-row textarea { width: 100%; }
.set-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

@media (min-width: 761px) {
  .set-row.set-row-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 2rem; row-gap: .25rem;
    align-items: center;
  }
  .set-row-inline > .set-label { grid-column: 1; grid-row: 1; }
  .set-row-inline > .set-note { grid-column: 1; grid-row: 2; }
  .set-row-inline > :not(.set-label):not(.set-note) { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
  .set-row-inline > select, .set-row-inline > input[type="text"] { width: 16rem; }
}

/* segmented choice: a radio group shown as two buttons, one lit */
.set-seg {
  display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  background: var(--bg-1); border: 1px solid var(--rule); border-radius: 8px;
  max-width: 100%;
}
.set-seg .set-check {
  position: relative; min-height: 40px; padding: .4rem .85rem; gap: 0;   /* 40px: the phone thumb floor (tests/e2e PHONE) */
  border-radius: 6px; font-family: var(--ui); font-size: .9rem; color: var(--ink-dim);
}
.set-seg .set-check input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.set-seg .set-check:hover { color: var(--ink); }
.set-seg .set-check:has(input:checked) { background: var(--bg-3); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.set-seg .set-check:has(input:focus-visible) { outline: 1px solid var(--sea); outline-offset: 1px; }

/* on/off switch (a real checkbox, restyled; keyboard and screen readers unchanged) */
.set-switch {
  appearance: none; -webkit-appearance: none;
  flex: none; position: relative; margin: 0;
  width: 2.75rem; height: 1.55rem; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--rule);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.set-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: calc(1.55rem - 6px); height: calc(1.55rem - 6px); border-radius: 50%;
  background: var(--tx-2); transition: transform .15s, background .15s;
}
.set-switch:checked { background: var(--sea); border-color: var(--sea); }
.set-switch:checked::after { transform: translateX(1.2rem); background: var(--tx-1); }
.set-switch:disabled { opacity: .45; cursor: not-allowed; }
.set-switch:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
.set-switch-label { cursor: pointer; }
.set-digest-ctrl { display: flex; align-items: center; gap: .75rem; }
.set-digest-ctrl select { width: 6.5rem; }

/* the row that just saved says so, quietly, under its own control */
.set-row.is-saved::after {
  content: '✓ ' attr(data-saved);
  position: absolute; right: 0; bottom: -1.05rem;
  font-family: var(--ui); font-size: 12px; color: var(--sea);
  animation: set-saved 2.2s ease forwards;
}
@keyframes set-saved { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* password: one line until asked for */
.set-disclose { margin-top: .9rem; border-top: 1px solid var(--hairline); padding-top: .75rem; }
.set-disclose > summary {
  display: flex; align-items: center; gap: .55rem; min-height: 36px;
  cursor: pointer; list-style: none;
  font-family: var(--ui); font-size: var(--fs-ui); color: var(--ink);
}
.set-disclose > summary::-webkit-details-marker { display: none; }
.set-disclose > summary::before { content: '▸'; color: var(--tx-3); transition: transform .15s; }
.set-disclose[open] > summary::before { transform: rotate(90deg); }
.set-disclose > form { margin-top: .4rem; }
.set-disclose .set-row { max-width: 26rem; }

.set-link { color: var(--sea); text-decoration: underline; text-underline-offset: 3px; }
.set-link:hover { color: var(--ink); }
.set-signout { margin-top: 1rem; }
.set-attn-more { margin-top: .8rem; }
.set-card .set-facts dd { font-size: var(--fs-ui); }

/* tablet and phone: the rail becomes a sticky row of chips over one column */
@media (max-width: 900px) {
  .set-shell { display: block; }
  .set-nav {
    position: sticky; top: -1.15rem; z-index: 20;
    margin: 0 calc(-.9rem - env(safe-area-inset-right)) .9rem calc(-.9rem - env(safe-area-inset-left));
    padding: .55rem calc(.9rem + env(safe-area-inset-right)) .55rem calc(.9rem + env(safe-area-inset-left));
    background: var(--ground);
    border-bottom: 1px solid var(--hairline);
  }
  .set-nav-list {
    flex-direction: row; gap: .4rem;
    overflow-x: auto; scrollbar-width: none;
  }
  .set-nav-list::-webkit-scrollbar { display: none; }
  .set-nav-item {
    white-space: nowrap; min-height: 40px; padding: .4rem .85rem;
    border: 1px solid var(--rule); border-radius: 999px;
  }
  .set-nav-item.on { border-color: var(--tx-3); background: var(--bg-3); }
  .set-nav-admin { margin-top: 0; }
  .set-head .view-sub { margin-bottom: .8rem; }
  .set-card { padding: .9rem 1rem; }
}
@media (max-width: 760px) {
  .set-row-inline > select, .set-row-inline > input[type="text"] { width: 100%; }
  .set-row.set-row-inline { gap: .45rem; }
  .set-seg { display: flex; }
  .set-seg .set-check { flex: 1 1 auto; justify-content: center; text-align: center; }
  .set-row.is-saved::after { position: static; display: block; }
}

/* ---------- SIMPLE VERSION (Settings → How it reads, 2026-11-01) ----------
   body[data-simple="on"]: three changes, nothing deleted.
   1. The view tabs: For You / Front / Chart stay; the other five wait in the
      front page's More row (shown on every width here, not only phones).
   2. The chart's filter rows: lane chips and subject chips hide (applySimple
      resets those filters first, so nothing is filtered out of sight). Search,
      place chips and the lens bar stay.
   3. The chart takes the full width: the margin column (Off the chart / Tracks)
      and the legend hide. Since-you-left mode keeps its own column. */
.more-simple-only { display: none; }
body[data-simple="on"] .viewnav .viewtab[data-goview="topics"],
body[data-simple="on"] .viewnav .viewtab[data-goview="ahead"],
body[data-simple="on"] .viewnav .viewtab[data-goview="history"],
body[data-simple="on"] .viewnav .viewtab[data-goview="time"],
body[data-simple="on"] .viewnav .viewtab[data-goview="markets"] { display: none; }
body[data-simple="on"] .more-row { display: flex; }
body[data-simple="on"] .more-simple-only { display: inline-flex; }
body[data-simple="on"] .console-chips,
body[data-simple="on"] .topic-chips,
body[data-simple="on"] .chart-legend:not(.chart-legend-sinceleft) { display: none; }
@media (min-width: 701px) {
  body[data-simple="on"]:not([data-sinceleft="on"]) .board { grid-template-columns: 1fr; }
  body[data-simple="on"]:not([data-sinceleft="on"]) .margin { display: none; }
}
@media (max-width: 700px) {
  body[data-simple="on"] .more-row { display: grid; }
  body[data-simple="on"] .more-simple-only { display: none; }   /* the station rail has Topics */
}

/* F-24: how current is this — lag line on the dossier, +N on front cards */
.state-lag { margin: 6px 0 0; font-size: var(--fs-ui); color: var(--tx-2); }
.state-lag[hidden] { display: none; }
.lag-reports { margin: 4px 0 0; padding: 0; list-style: none; font-family: var(--mono); }
.lag-reports a { color: inherit; }
.lag-when { opacity: .7; }
.f-behind { font-family: var(--mono); font-size: var(--fs-ui); color: var(--tx-2); margin-left: 8px; }
