/*
 * bolt.ceo — the suite design system.
 *
 * Not invented. Every token below already existed across the six products; this
 * file is the extraction. The canvas (#050607), cream text (#f4efe1), monospace
 * numerals, 42px graph-paper grid, hairline borders instead of shadows, and
 * 999px pills are shared by all of them. Only the accent differs per product,
 * which is exactly what makes the grid read as one family with distinct members.
 *
 * Dark-only, deliberately. All six products are dark by doctrine — the
 * "cockpit" language originates in equity-screener — so a light mode here would
 * make the front door the odd one out. Contrast is held at WCAG AA against the
 * canvas.
 */

:root {
  --bg: #050607;
  --bg2: #090d10;
  --panel: #0d1317;
  --panel2: #111a20;
  --panel3: #17242c;
  --text: #f4efe1;
  --muted: #a9a294;
  --faint: #757b74;
  --line: rgba(244, 239, 225, 0.12);
  --line-strong: rgba(244, 239, 225, 0.22);

  --amber: #f0b83e;
  --teal: #2dd4bf;
  --cyan: #55d8ff;
  --emerald: #3fb950;
  --purple: #b79cff;
  --gold-bright: #ffd978;
  --up: #42d68c;
  --down: #ff6b6b;
  --blue: #7aa7ff;

  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --r-card: 14px;
  --r-inner: 10px;
  --maxw: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }

/* Browser surfaces belong to the palette too: selection, caret, scrollbars. */
::selection { background: rgba(240, 184, 62, 0.28); color: var(--text); }
html { caret-color: var(--amber); scrollbar-color: var(--line-strong) transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.65 var(--mono);
  font-variant-numeric: tabular-nums;
  /* The 42px graph-paper grid, plus the two ambient glows the products use. */
  background-image:
    radial-gradient(900px 480px at 12% -8%, rgba(240, 184, 62, 0.09), transparent 62%),
    radial-gradient(760px 420px at 88% 4%, rgba(85, 216, 255, 0.07), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
  background-attachment: fixed, fixed, scroll, scroll;
}

/* ── skeleton ───────────────────────────────────────────────────────────── */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

section { padding: 56px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: clamp(21px, 2.4vw, 27px); margin-bottom: 12px; }
h3 { font-size: 15px; }
p { margin: 0 0 14px; color: var(--muted); max-width: 74ch; }
p strong { color: var(--text); font-weight: 600; }
a { color: var(--cyan); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.lede { font-size: 15px; color: var(--muted); max-width: 72ch; }
.note { font-size: 12px; color: var(--faint); max-width: 72ch; }
.mono-cap { font-size: 12px; color: var(--faint); }
.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.panel-title + .note { margin: -6px 0 12px; }

/* ── hero ───────────────────────────────────────────────────────────────── */

header.hero { padding: 64px 0 40px; }

.lockup { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lockup .logo { width: 40px; height: 40px; flex: none; }
.lockup .mark { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.lockup .mark b { color: var(--amber); font-weight: 700; }

.hero h1 { margin: 26px 0 12px; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.18; max-width: 30ch; }
.hero h1 em { font-style: normal; color: var(--amber); }

/* Live status strip */
.status {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px;
  padding: 0; border: 0; border-radius: 0;
  background: none;
}
.status .item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--up); box-shadow: 0 0 0 3px rgba(66, 214, 140, 0.16); }
.dot.stale { background: var(--amber); box-shadow: 0 0 0 3px rgba(240, 184, 62, 0.16); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.16); }

/* ── product grid ───────────────────────────────────────────────────────── */

/* align-items: start — a card is as tall as its content. Stretching every
   card to the tallest in its row left the short ones four-fifths empty. */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }

.card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--panel);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.16s ease;
}
.card::before {
  /* The per-product accent, the only thing that differs between siblings. */
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: var(--accent, var(--amber));
}
.card:hover, .card:focus-within { border-color: var(--line-strong); }

.card .name { font-size: 18px; font-weight: 600; }
.card .role { font-size: 12.5px; color: color-mix(in srgb, var(--accent, var(--amber)) 70%, var(--muted)); margin-top: -6px; }
.card .host { font-size: 12px; color: var(--faint); word-break: break-all; }
.card .body { font-size: 13px; color: var(--muted); flex: 1; }
/* Chip rows wrap wherever they appear. This was scoped to `.card .feet`, which
 * left the answer's citation row (inside `.sec`) with no flex at all — combined
 * with `white-space: nowrap` on `.chip`, twelve citations became one 1730px
 * line that forced the document to 1777px and made phones render the whole page
 * zoomed out. The rule belongs on the class, not on one of its parents. */
.feet { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.card .feet { margin-top: 4px; }

.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── the verdict, and the levels ladder ─────────────────────────────────── */

/* The one thing a trade answer must communicate before anything is read. */
.verdict {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  margin: 4px 0 18px; padding: 14px 18px;
  border: 1px solid var(--line); border-left: 3px solid var(--tone, var(--amber));
  border-radius: var(--r-card); background: var(--bg2);
}
.verdict .stance {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--tone, var(--amber));
}
.verdict .stance .ic { width: 16px; height: 16px; stroke-width: 2; }
.verdict.long { --tone: var(--up); }
.verdict.short { --tone: var(--down); }
.verdict.wait { --tone: var(--amber); }
.verdict-detail { color: var(--muted); font-size: 13px; }

.ladder { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.rung {
  display: grid; grid-template-columns: 8.5ch minmax(0, auto) 1fr; align-items: baseline; gap: 8px 14px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); border-left: 3px solid var(--rung, var(--line-strong));
}
.rung.entry { --rung: var(--cyan); }
.rung.stop { --rung: var(--down); }
.rung.target { --rung: var(--up); }
.rung-label { font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--rung, var(--muted)); }
.rung-price { font-size: 17px; font-weight: 600; color: var(--text); }
.rung-basis { font-size: 12px; color: var(--faint); min-width: 0; }
.rung-note { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 560px) {
  .rung { grid-template-columns: 1fr auto; }
  .rung-basis { grid-column: 1 / -1; }
}

/* The wait, made legible. A minute of silence reads as a hung page. */
.progress { margin-top: 16px; }
.progress-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.progress-clock { flex: none; font-variant-numeric: tabular-nums; color: var(--faint); }
.progress-track {
  height: 3px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0; border-radius: 999px; background: var(--amber);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress.failed .progress-bar { background: var(--down); }
@media (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } }

.ask-failed { border-left: 3px solid var(--down); }
.ask-raw {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 8px;
  background: var(--bg2); border: 1px solid var(--line);
  font: 11px/1.5 var(--mono); color: var(--faint);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12em; overflow: auto;
}

.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: 12px var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg2); padding: 6px 14px; cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.share-btn:hover, .share-btn:focus-visible { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.share-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.chip.accent { color: var(--accent, var(--amber)); border-color: color-mix(in srgb, var(--accent, #f0b83e) 40%, transparent); }
.chip.adjacent { color: var(--purple); border-color: rgba(183, 156, 255, 0.4); }

.card .go {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 12px; color: var(--accent, var(--amber));
}
.card .go .ic { transition: transform 0.16s ease; }
.card .go:hover .ic, .card .go:focus-visible .ic { transform: translateX(3px); }

/* The inline icon system: 12px strokes that inherit currentColor. */
.ic {
  width: 12px; height: 12px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── figures / graphs ───────────────────────────────────────────────────── */

figure.viz {
  margin: 24px 0 0; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--panel);
}
.panel figure.viz { margin-top: 0; background: var(--bg2); }
figure.viz .scroll { overflow-x: auto; overflow-y: hidden; }
figure.viz svg { display: block; min-width: 640px; width: 100%; height: auto; }
figure.viz figcaption { margin-top: 12px; font-size: 12px; color: var(--faint); max-width: 84ch; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* SVG primitives */
.n-label { font: 11px var(--mono); fill: var(--muted); }
.n-label.strong { fill: var(--text); }
.n-sub { font: 10px var(--mono); fill: var(--faint); }
.axis { font: 10px var(--mono); fill: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; }
.edge { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.edge.data { stroke: var(--cyan); stroke-opacity: 0.5; }
.edge.fork { stroke: var(--amber); stroke-opacity: 0.6; stroke-dasharray: 4 3; }
.edge.doctrine { stroke: var(--purple); stroke-opacity: 0.75; stroke-dasharray: 2 4; }
.node-box { fill: var(--panel2); stroke: var(--line); }
.lane-label { font: 10px var(--mono); fill: var(--faint); letter-spacing: 0.12em; text-transform: uppercase; }

/* Reachability interaction: dim everything not connected to the focused node. */
svg.focusing .node, svg.focusing .edge { opacity: 0.14; transition: opacity 0.12s ease; }
svg.focusing .node.lit, svg.focusing .edge.lit { opacity: 1; }
.node { cursor: pointer; }
.node:hover .node-box { stroke: var(--line-strong); }

/* ── tables ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-inner); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: rgba(244, 239, 225, 0.03); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

/* ── launchpad ──────────────────────────────────────────────────────────── */

.panel {
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--panel);
  padding: 20px;
}
.panel + .panel { margin-top: 14px; }

.sections { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 4px; align-items: start; }
.sec { border: 1px solid var(--line); border-radius: var(--r-inner); background: var(--bg2); padding: 15px; }
.sec h3 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.sec p { font-size: 13px; margin: 0; color: var(--muted); max-width: none; }

/* Provenance is disclosed on every paragraph, never implied. */
.prov { display: inline-block; margin-top: 10px; font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); }
.prov[data-p="model"] { color: var(--cyan); border-color: rgba(85, 216, 255, 0.35); }
.prov[data-p="model-regenerated"] { color: var(--amber); border-color: rgba(240, 184, 62, 0.35); }
.prov[data-p="deterministic"] { color: var(--muted); }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
button {
  font: 500 12.5px var(--mono); color: var(--bg); background: var(--amber);
  border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  transition: background 150ms cubic-bezier(0.19, 1, 0.22, 1), transform 150ms cubic-bezier(0.19, 1, 0.22, 1);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:hover:not(:disabled) { background: var(--gold-bright); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.ghost:hover:not(:disabled) { background: var(--bg2); color: var(--text); }

input[type="password"], input[type="text"] {
  font: 12.5px var(--mono); color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; min-width: 260px;
  transition: border-color 150ms ease;
}
input[type="password"]:focus, input[type="text"]:focus {
  border-color: rgba(240, 184, 62, 0.55); outline: none;
}
input::placeholder { color: var(--faint); }

/* The ask panel is the product's front door — it reads like a command bar,
   not a footnote. */
.ask-panel { margin-top: 26px; max-width: 880px; }
.ask-row { margin-top: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ask-row input[type="text"] {
  flex: 1 1 340px;
  font-size: 16px;
  padding: 15px 22px;
  background: var(--panel);
  border-color: var(--line-strong);
}
.ask-row input[type="text"]:focus { border-color: var(--amber); }
.ask-row button { font-size: 15px; padding: 14px 28px; font-weight: 600; }
#ask-result:not(:empty) { margin-top: 18px; }

/* Equity cards inside ask results: the screeners' structured read, in the
   suite's own card language, sized to sit inside a panel. */
.cards-mini { margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.cards-mini .card { padding: 16px; gap: 8px; }
.card .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card .card-head .name { min-width: 0; }
.card .px { flex: none; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.card .scores { display: flex; flex-wrap: wrap; gap: 18px 20px; margin: 2px 0; }
.card .scores .v { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.card .scores .l {
  margin-top: 2px; font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--accent, var(--amber)) 55%, var(--muted));
}
.chip.up { color: var(--up); border-color: rgba(66, 214, 140, 0.35); }
.chip.down { color: var(--down); border-color: rgba(255, 107, 107, 0.35); }

.take { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.take li { font-size: 13px; color: var(--muted); line-height: 1.5; display: flex; gap: 9px; }
.take li + li { border-top: 1px solid var(--line); padding-top: 12px; }
.take { margin-top: 2px; }
.take .dir { flex: none; width: 1.2em; display: inline-flex; padding-top: 4px; }
.take-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.take-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.take .ent { color: var(--text); font-weight: 600; }
.take-horizon { font-size: 11px; color: var(--faint); }
.take-claim { color: var(--muted); }
.take-metrics { margin-top: 2px; }
.take-metrics .chip { font-size: 10.5px; padding: 2px 8px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--faint); }

/* Cockpit card internals: labelled analytics rows and the universe boxplot. */
.facts { display: flex; flex-direction: column; gap: 5px; margin: 2px 0; }
.fact { display: flex; gap: 10px; font-size: 12.5px; }
.fact .fl {
  flex: none; width: 8ch; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  padding-top: 2px; color: color-mix(in srgb, var(--accent, var(--amber)) 55%, var(--muted));
}
.fact .fv { color: var(--text); }
.boxwrap { margin: 2px 0; }
.scorebox { display: block; width: 100%; max-width: 320px; height: auto; }
.bx-whisker { stroke: var(--line-strong); stroke-width: 1; }
.bx-box { fill: var(--bg2); stroke: var(--line-strong); }
.bx-median { stroke: var(--muted); stroke-width: 1.5; }
.bx-t { font: 9px var(--mono); fill: var(--faint); }
.bx-cap { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }

/* Structured model answers. */
.md .md-h { font-size: 13.5px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
.md .md-p { font-size: 13px; margin: 0 0 8px; max-width: none; }
.md .md-ul { margin: 0 0 10px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.md .md-ul li { font-size: 13px; color: var(--muted); }
.md .md-tbl { margin: 4px 0 10px; }
.md table { min-width: 0; }
.md strong { color: var(--text); }
.derived-note { border-left: 2px solid var(--amber); padding-left: 10px; margin-top: 10px; }

/* Suggestions read as a line of prompts, not a second row of pills. */
.suggest { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; padding-left: 4px; }
.suggest:empty { display: none; }
.suggest-label { font-size: 12.5px; color: var(--faint); }
.suggest button.suggest-link {
  background: transparent; color: var(--muted); border: 0; border-radius: 0;
  font-size: 12.5px; padding: 0; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.suggest button.suggest-link:hover:not(:disabled), .suggest button.suggest-link:focus-visible { background: transparent; color: var(--text); text-decoration-color: var(--amber); }

.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sources a {
  font-size: 12px; color: var(--cyan); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; text-decoration: none;
  max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sources a:hover { border-color: var(--line-strong); text-decoration: none; }

.keybox { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-inner); background: var(--bg2); }
.keybox h3 { margin-bottom: 8px; }

.quality { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ── the rules, as a list ───────────────────────────────────────────────── */

.rules { margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.rule { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.rule dt { font-size: 16px; font-weight: 600; }
.rule dd { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 58ch; }
@media (max-width: 720px) { .rules { grid-template-columns: 1fr; } }

/* ── footer ─────────────────────────────────────────────────────────────── */

footer { padding: 48px 0 72px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
footer .cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
footer h3 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
footer ul { margin: 0; padding: 0; list-style: none; }
footer li { margin-bottom: 5px; }

.disclaim { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 84ch; }

/* ── motion and small screens ───────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .hero .lockup, .hero h1, .hero .lede, .hero .ask-panel {
    animation: settle 0.9s cubic-bezier(0.19, 1, 0.22, 1) both;
  }
  .hero h1 { animation-delay: 0.07s; }
  .hero .lede { animation-delay: 0.14s; }
  .hero .ask-panel { animation-delay: 0.21s; }
  @keyframes settle {
    from { opacity: 0; transform: translateY(14px); filter: blur(5px); }
    to { opacity: 1; transform: none; filter: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
}

/* A sideways-scrolling container fades at its trailing edge until the reader
   reaches the end — the cue that there is more, without a hint chip in the way. */
.is-scrollable:not(.at-end) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
}
figure.viz .scroll, .table-wrap { scrollbar-width: thin; }

@media (max-width: 640px) {
  body { font-size: 13.5px; }
  section { padding: 40px 0; }
  header.hero { padding: 52px 0 36px; }
  .wrap { padding: 0 16px; }
  .lockup .mark { font-size: 27px; }
  h2 { font-size: 19px; }
  .lede { font-size: 14px; }
  figure.viz { padding: 10px; }
  .panel { padding: 14px; }
  .grid, .sections { grid-template-columns: 1fr; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  table { min-width: 480px; font-size: 12px; }
  th, td { padding: 7px 9px; }
  input[type="password"], input[type="text"] { min-width: 0; width: 100%; }
  .controls button { flex: 1 1 auto; }
}

@media print {
  body { background: #fff; color: #000; }
  .controls, .keybox { display: none; }
}

/* ── the pulse line, and graphs as lists on a phone ─────────────────────── */

/* One line where six chips used to be. */
.pulse {
  display: inline-flex; align-items: flex-start; gap: 9px; margin-top: 18px;
  font-size: 12.5px; color: var(--faint);
}
.pulse .dot { margin-top: 7px; }


/*
 * A column diagram scaled to a 350px screen is either unreadable or scrolls
 * sideways. On a phone the same relationships render as this list, and the
 * diagram sits behind a toggle.
 */
.gsum { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.gsum li {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg2); border-left: 3px solid var(--accent, var(--line-strong));
  display: flex; flex-direction: column; gap: 7px;
}
.gsum-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gsum-name { font-weight: 600; color: var(--text); min-width: 0; }
.gsum-detail { flex: none; font-size: 11px; color: var(--faint); text-align: right; }
.gsum-toggle { margin-top: 12px; }

/* The desk heading on a takeaway card. */
/* Name and time share a line while they fit; when they do not, the time
   drops below rather than forcing the name to break mid-word. */
.take-desk { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.take-name { font-size: 15px; font-weight: 600; color: var(--text); flex: 1 0 auto; }
.take-when { flex: none; margin-left: auto; font-size: 11.5px; color: var(--faint); }

/* Cross-desk provenance on a takeaway — the part no other source carries. */
.take-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.take-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--faint);
}
.take-tag.cross { color: var(--cyan); border-color: rgba(85, 216, 255, 0.4); }
.take-tag.contested { color: var(--amber); border-color: rgba(240, 184, 62, 0.4); }
.take-tag.novel { color: var(--up); border-color: rgba(66, 214, 140, 0.35); }


@media (max-width: 640px) {
  header.hero { padding: 32px 0 20px; }
  .hero h1 { margin: 16px 0 10px; }
  .ask-panel { margin-top: 16px; }
  .ask-row button { width: 100%; }
  .pulse { margin-top: 16px; }
  section { padding: 40px 0; }
}

/* ── the synthesis, as a terminal ───────────────────────────────────────── */

#narrative .sec {
  border: 1px solid var(--line); border-radius: var(--r-inner);
  border-left: 3px solid var(--tone, var(--line-strong));
  background: var(--bg2); padding: 16px 18px; margin-top: 12px;
}
#narrative .sec-up { --tone: var(--up); }
#narrative .sec-down { --tone: var(--down); }
#narrative .sec-new { --tone: var(--cyan); }
#narrative .sec-warn { --tone: var(--amber); }
#narrative .sec-accent { --tone: var(--purple); }
#narrative .sec-neutral { --tone: var(--line-strong); }

.sec-head { display: flex; align-items: center; gap: 10px; }
.sec-head h3 { font-size: 15px; }
.sec-icon {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: var(--tone, var(--muted)); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* The explain-it-simply line: quieter than the finding, louder than a footnote. */
.sec-plain {
  margin: 8px 0 0; font-size: 12px; line-height: 1.55; color: var(--faint);
  max-width: 74ch; border-left: 2px solid var(--line); padding-left: 10px;
}
.sec-figures { margin-top: 12px; }
.sec-figures .chip { font-size: 12px; font-weight: 600; }
.sec-body { margin: 12px 0 0; color: var(--text); }
