/* PAPERROUTE — app.css (shell). Tokens from mockup/v1/DESIGN.md §0–§5, motion from §10.
   SCALE (LUAT 50): every size is authored at the 1920 design width as calc(N * var(--u)); --u = 100vw/1920 from 1280 up,
   so 1280–2560 keep the mockup's proportions. Below 1280: ONE phone layout (LUAT 71) — content column capped at 720 px,
   centred, ground fills the screen, --u fixed so authored gaps shrink to a phone rhythm; type uses the --fs-* tokens below.
   BORDERS (LUAT 56): every border/outline in the site lives in THIS file. Routes use the .rule-* classes only.
   Per-element animation indexes use --i / --sdk — never --u. */

/* ---------- 1. tokens ---------- */
:root {
  --u: calc(100vw / 1920);

  /* colour (DESIGN.md §3) */
  --paper: #F9F5F1;
  --surface: #FFFFFF;
  --ink: #1C1A17;
  --muted: #6B655C;
  --muted-ink: #655C50;
  --hairline: #E6E0D6;
  --rule-soft-c: #EDE8E3;
  --tint: #F5EFEA;
  --action: #D120A9;
  --action-text: #A8178A;
  --action-tint: #FBE7F4;
  --action-pill: #F8BFEF;
  --disabled: #E4E1DE;
  --term: #262522;
  --term-ink: #FAF7F2;
  --term-action: #F04BC4;
  --term-rule-c: #5A5752;
  --axis: #C4B8B1;
  --waiting: #8F8A84;

  /* fonts (DESIGN.md §2) */
  --f-display: 'Source Serif 4', 'Newsreader', Georgia, serif;
  --f-ui: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* type scale @1920 (DESIGN.md §2 role table) — routes use these, never their own px */
  --fs-hero: calc(81 * var(--u));
  --fs-section: calc(69 * var(--u));
  --fs-kit: calc(53 * var(--u));
  --fs-route: calc(48 * var(--u));
  --fs-result: calc(55 * var(--u));
  --fs-panel: calc(40 * var(--u));
  --fs-panel-sm: calc(37 * var(--u));
  --fs-lede: calc(31 * var(--u));
  --fs-eyebrow: calc(25.6 * var(--u));
  --fs-eyebrow-sm: calc(21 * var(--u));
  --fs-term: calc(25 * var(--u));
  --fs-num: calc(20.8 * var(--u));
  --fs-body: calc(20 * var(--u));
  --fs-th: calc(20 * var(--u));
  --fs-ui: max(12px, calc(17 * var(--u)));
  --fs-nav: max(12px, calc(15 * var(--u)));
  --fs-small: max(12px, calc(14 * var(--u)));
  --fs-tiny: max(12px, calc(12.6 * var(--u)));

  /* frame (DESIGN.md §0 page frame: gutters 45 / 45 @1920, container 1830) */
  --gutter: calc(45 * var(--u));
  --section-gap: calc(64 * var(--u));
  --panel-pad: calc(24 * var(--u));
  --r-panel: calc(10 * var(--u));
  --r-card: calc(8 * var(--u));
  --r-ctl: calc(6 * var(--u));

  /* rules (DESIGN.md §4b / BORDER_TABLE.md): a 1 px mockup line ×1.148, never below 1 px */
  --rule-hair-w: max(1px, calc(1.15 * var(--u)));
  --rule-hair: var(--rule-hair-w) solid var(--hairline);
  --rule-soft: var(--rule-hair-w) solid var(--rule-soft-c);
  --rule-term: var(--rule-hair-w) solid var(--term-rule-c);
  --rule-action: var(--rule-hair-w) solid var(--action);
  --rule-axis: var(--rule-hair-w) solid var(--axis);
  --rule-strip-w: max(1px, calc(1.5 * var(--u)));

  /* motion (DESIGN.md §10) */
  --ease-route: cubic-bezier(.2, .7, .2, 1);
  --t-ctl: 160ms;
  --t-reveal: 420ms;
  --t-stop: 90ms;
  --rt-dur: 260ms;
  --rt-nudge: calc(18 * var(--u));

  color-scheme: light;
  accent-color: var(--action);
  scrollbar-color: #CFC6BB var(--paper);
}

@media (max-width: 1279.98px) {
  :root {
    --u: 0.56px;
    --gutter: 16px;
    --section-gap: 40px;
    --panel-pad: 16px;
    --r-panel: 10px;
    --r-card: 8px;
    --r-ctl: 6px;
    --fs-hero: clamp(34px, 9.4vw, 52px);
    --fs-section: clamp(30px, 8vw, 44px);
    --fs-kit: clamp(28px, 7.4vw, 38px);
    --fs-route: clamp(28px, 7.4vw, 36px);
    --fs-result: clamp(28px, 7.6vw, 38px);
    --fs-panel: clamp(22px, 5.8vw, 28px);
    --fs-panel-sm: clamp(20px, 5.4vw, 26px);
    --fs-lede: clamp(17px, 4.4vw, 20px);
    --fs-eyebrow: 14px;
    --fs-eyebrow-sm: 13px;
    --fs-term: 14px;
    --fs-num: 14px;
    --fs-body: 15px;
    --fs-th: 12px;
    --fs-ui: 15px;
    --fs-nav: 16px;
    --fs-small: 13px;
    --fs-tiny: 12px;
    --rule-hair-w: 1px;
    --rule-strip-w: 1.5px;
    --rt-nudge: 14px;
  }
}

/* ---------- 2. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
:where(button, input, select, textarea) { border: 0; font: inherit; color: inherit; }
:where(button) { background: none; padding: 0; cursor: pointer; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; min-height: 100vh; overflow-x: clip;
  background: var(--paper);            /* page atmosphere (DESIGN.md §3b): ONE flat ground, no gradient/glow/grid/noise/art */
  color: var(--ink); font-family: var(--f-ui); font-size: var(--fs-body); line-height: 1.4;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--action-text); text-underline-offset: .18em; text-decoration-thickness: max(1px, .06em); }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; font-weight: inherit; padding: 0; }
p { text-wrap: pretty; }
::selection { background: var(--action-tint); color: var(--ink); }
:focus-visible { outline: max(2px, calc(2 * var(--u))) solid var(--action); outline-offset: max(2px, calc(2 * var(--u))); border-radius: var(--r-ctl); }
[hidden] { display: none !important; }
.mono, code, kbd, samp, pre { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 50; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: var(--r-ctl); }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- 3. ONE PAGE FRAME (USER FIX U1) ----------
   <main class="page"> and the footer share it: gutters 45 / 45 @1920, no max-width cap ≥1280, flat ground.
   Route bodies never set max-width, side padding or a background of their own. */
.page { padding-inline: var(--gutter); width: 100%; }
main.page { display: block; min-height: 60vh; outline: none; }
main.page > :first-child { margin-top: 0; }
@media (max-width: 1279.98px) {
  .page { max-width: calc(720px + 2 * var(--gutter)); margin-inline: auto; }
}
.swipe { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* ---------- 4. BORDER CLASSES (BORDER_TABLE.md → DESIGN.md §4b) ----------
   One class per framed component, widths from the table only. Generic classes first, then the named components. */
/* panels — TRBL hairline, radius 10, white surface */
.rule-panel,
.rule-board-panel, .rule-stops-strip, .rule-step-card, .rule-keep-panel, .rule-rivals-panel, .rule-sources-panel,
.rule-delivery-panel, .rule-strip-panel, .rule-changed-panel, .rule-history-panel, .rule-boundary-panel, .rule-read-card,
.rule-source-strip, .rule-inputs-panel, .rule-gross-panel, .rule-scenarios-panel, .rule-breakeven-panel,
.rule-selfdispatch-panel, .rule-wage-note-strip, .rule-config-panel, .rule-client-strip, .rule-tools-panel,
.rule-mcp-config-panel, .rule-eventlog-panel, .rule-wallet-panel, .rule-soon-modal, .rule-carrierlog-panel,
.rule-token-panel, .rule-howtobuy-panel, .rule-walletstates-panel, .rule-route-detail-panel, .rule-token-boundary-panel {
  border: var(--rule-hair); border-radius: var(--r-panel); background: var(--surface);
}
/* cards inside a panel — radius 8 */
.rule-card, .rule-changed-card, .rule-computed-box { border: var(--rule-hair); border-radius: var(--r-card); background: var(--surface); }
/* controls — radius 6; the frame wraps the whole control (padding sits inside the frame) */
.rule-control, .rule-input, .rule-nav-rail, .rule-nav-wallet-btn, .rule-filter-select, .rule-ca-input, .rule-segmented,
.rule-kit-tabs, .rule-wallet-list, .rule-copy-btn-light {
  border: var(--rule-hair); border-radius: var(--r-ctl); background: var(--surface);
}
.rule-code-box { border: var(--rule-hair); border-radius: var(--r-ctl); background: var(--tint); }
.rule-error-box { border: var(--rule-action); border-radius: var(--r-ctl); background: var(--surface); }
.rule-copy-btn { border: var(--rule-term); border-radius: var(--r-ctl); background: transparent; color: var(--term-ink); }
/* the dark code / terminal panel: filled, NO border (BORDER_TABLE kit #7/#9/#10 = fill edge) */
.rule-code-panel, .rule-terminal { border: 0; border-radius: var(--r-panel); background: var(--term); color: var(--term-ink); }
/* rows and lines */
.rule-row, .rule-board-row-rule, .rule-kv-row-rule, .rule-sources-row-rule { border-bottom: var(--rule-soft); }
.rule-row-strong { border-bottom: var(--rule-hair); }
.rule-header-rule { border-bottom: var(--rule-hair); }
.rule-top { border-top: var(--rule-hair); }
.rule-terminal-title-rule { border-bottom: var(--rule-term); }
.rule-chart-axis { border-left: var(--rule-axis); }
/* inner dividers: ONE line between siblings, never on the outer edge (no doubled lines with the frame) */
.rule-split > * + *, .rule-divider-l { border-left: var(--rule-hair); }
.rule-split-y > * + *, .rule-divider-t { border-top: var(--rule-hair); }
.rule-rows > * + * { border-top: var(--rule-soft); }
/* last row of a table inside a framed panel drops its rule when the panel edge is right under it */
.rule-last-open > :last-child { border-bottom: 0; }
/* hollow route stop ring (THE ROUTE STRIP, waiting) — for HTML dots; SVG dots use stroke */
.rule-stop { border: var(--rule-strip-w) solid var(--waiting); border-radius: 50%; background: var(--surface); }
.rule-stop.is-done, .rule-stop[data-done] { border-color: var(--action); background: var(--action); }

/* ---------- 5. shared type + primitives (DESIGN.md §2, §5) ---------- */
.eyebrow { font: 700 var(--fs-eyebrow)/1.2 var(--f-ui); letter-spacing: .054em; text-transform: uppercase; color: var(--muted-ink); }
.eyebrow-sm { font: 700 var(--fs-eyebrow-sm)/1.2 var(--f-ui); letter-spacing: .054em; text-transform: uppercase; color: var(--muted-ink); }
.t-hero { font: 400 var(--fs-hero)/1.05 var(--f-display); letter-spacing: -.035em; color: var(--ink); }
.t-section { font: 600 var(--fs-section)/1.05 var(--f-display); letter-spacing: -.03em; }
.t-route { font: 500 var(--fs-route)/1.1 var(--f-display); letter-spacing: -.02em; }
.t-kit { font: 500 var(--fs-kit)/1.1 var(--f-display); letter-spacing: -.02em; }
.t-panel { font: 500 var(--fs-panel)/1.15 var(--f-display); letter-spacing: -.01em; }
.t-panel-sm { font: 500 var(--fs-panel-sm)/1.15 var(--f-display); letter-spacing: -.01em; }
.t-result { font: 600 var(--fs-result)/1 var(--f-display); }
.lede { font: 400 var(--fs-lede)/1.3 var(--f-ui); color: var(--muted); }
.t-num { font: 500 var(--fs-num)/1.4 var(--f-mono); letter-spacing: -.03em; }
.t-th { font: 600 var(--fs-th)/1.2 var(--f-ui); letter-spacing: .03em; text-transform: uppercase; color: var(--muted-ink); }
.t-small { font-size: var(--fs-small); }
.muted { color: var(--muted); }
.is-action, .t-action { color: var(--action); }
.t-action-text { color: var(--action-text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(10 * var(--u));
  min-height: max(40px, calc(58 * var(--u))); padding: 0 calc(32 * var(--u));
  border-radius: var(--r-ctl); background: var(--action); color: #fff;
  font: 600 var(--fs-lede)/1 var(--f-ui); text-decoration: none; white-space: nowrap;
  transition: transform var(--t-ctl) var(--ease-route), background-color var(--t-ctl) var(--ease-route);
}
.btn:hover { background: #BC1C98; }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: max(32px, calc(40 * var(--u))); padding: 0 calc(16 * var(--u)); font-size: var(--fs-ui); font-weight: 600; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--u));
  min-height: max(32px, calc(44 * var(--u))); padding: 0 calc(18 * var(--u));
  color: var(--ink); font: 500 var(--fs-ui)/1 var(--f-ui); text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-ctl) var(--ease-route);
}
.btn-ghost:hover { background: var(--tint); }
.btn[disabled], .btn[aria-disabled="true"]:not([data-launch-done]), .btn.is-disabled { background: var(--disabled); color: var(--muted); cursor: not-allowed; transform: none; }
/* launched state (launch.js sets data-launch-done): bright action, never looks disabled */
.btn-buy[data-launch-done] { background: var(--action); color: #fff; cursor: pointer; }
.btn-ghost[disabled] { color: var(--muted); cursor: not-allowed; background: var(--surface); }
.link-action { color: var(--action-text); font: 500 var(--fs-lede)/1.2 var(--f-ui); text-decoration: underline; text-underline-offset: .2em; }
.pill { display: inline-flex; align-items: center; min-height: 1.6em; padding: 0 .7em; border-radius: 999px; font: 600 var(--fs-small)/1 var(--f-ui); white-space: nowrap; }
.pill-delivered { background: var(--action-pill); color: var(--action-text); }
.pill-waiting { background: var(--tint); color: var(--muted); }
.pill-rival { background: var(--tint); color: var(--muted); }
.chip { display: inline-flex; align-items: center; min-height: max(32px, calc(44 * var(--u))); padding: 0 calc(16 * var(--u)); font: 500 var(--fs-ui)/1 var(--f-ui); color: var(--ink); white-space: nowrap; transition: background-color var(--t-ctl) var(--ease-route), color var(--t-ctl) var(--ease-route); }
.chip[aria-pressed="true"], .chip.is-on, [aria-selected="true"].chip { background: var(--action); color: #fff; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: calc(16 * var(--u)); padding: calc(10 * var(--u)) 0; min-width: 0; }
.kv > :first-child { font-weight: 600; min-width: 0; }
.kv > :last-child { font-family: var(--f-mono); text-align: right; }

/* THE TERMINAL (DESIGN.md §5) */
.term { font: 400 var(--fs-term)/1.75 var(--f-mono); color: var(--term-ink); }
.term .is-hl, .term [data-hl] { color: var(--term-action); }
.term-cursor { display: inline-block; width: .55em; height: 1.05em; vertical-align: -.15em; background: var(--term-ink); animation: pr-blink 1.06s steps(1) infinite; }
@keyframes pr-blink { 50% { opacity: 0; } }

/* THE ROUTE STRIP (SVG): line + stop dots; waiting = hollow ring, delivered = filled action */
.route-svg { overflow: visible; }
.route-svg [data-route-line] { stroke: var(--waiting); stroke-width: var(--rule-strip-w); fill: none; }
.route-svg [data-route-line].is-done { stroke: var(--action); }
.route-svg [data-stop] { fill: var(--surface); stroke: var(--waiting); stroke-width: var(--rule-strip-w); }
.route-svg [data-stop].is-done, .route-svg [data-stop][data-done] { fill: var(--action); stroke: var(--action); }

/* ---------- 6. NAV N5 (mockup chrome/nav.html, measured @1920: height 109 · rail 427–1562 × 57 · wallet 1713–1870 × 46) ---------- */
.site-header {
  position: relative; z-index: 20; background: var(--paper);
  height: calc(109 * var(--u)); padding: 0 var(--gutter);
  display: grid; grid-template-columns: calc(354 * var(--u)) calc(1135 * var(--u)) 1fr; align-items: center; column-gap: calc(28 * var(--u));
}
.brand { display: inline-flex; align-items: center; gap: calc(11 * var(--u)); color: var(--ink); text-decoration: none; min-width: 0; justify-self: start; }
.brand-mark { height: max(36px, calc(40 * var(--u))); width: auto; flex: none; }
.brand-word { font: 600 max(16px, calc(23 * var(--u)))/1 var(--f-display); letter-spacing: .02em; white-space: nowrap; }
.nav-menu { display: contents; }
.nav-rail { display: flex; align-items: stretch; height: calc(57 * var(--u)); overflow: hidden; }
.nav-rail a {
  display: flex; align-items: center; padding: 0 calc(37 * var(--u));
  color: var(--ink); text-decoration: none; font: 500 var(--fs-nav)/1 var(--f-ui); white-space: nowrap;
  transition: background-color var(--t-ctl) var(--ease-route), color var(--t-ctl) var(--ease-route);
}
.nav-rail a:last-child { box-shadow: none; }
.nav-rail a:hover { background: var(--tint); }
.nav-rail a.is-active, .nav-rail a[aria-current="page"] { color: var(--action-text); background: #FBF0F7; font-weight: 600; }
.nav-actions { justify-self: end; display: flex; align-items: center; gap: calc(22 * var(--u)); font-size: var(--fs-nav); }
.nav-social { color: var(--ink); text-decoration: none; white-space: nowrap; font-weight: 500; }
a.nav-social[href]:hover { color: var(--action-text); }
.is-soon[aria-disabled="true"] { cursor: default; }
.nav-wallet { height: calc(46 * var(--u)); min-width: calc(157 * var(--u)); padding: 0 calc(20 * var(--u)); display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--u)); font: 500 var(--fs-nav)/1 var(--f-ui); white-space: nowrap; transition: background-color var(--t-ctl) var(--ease-route); }
.nav-wallet:hover { background: var(--tint); }
.nav-wallet.is-connected { font-family: var(--f-mono); }
.nav-wallet .wallet-dot { width: .5em; height: .5em; border-radius: 50%; background: var(--action); }
.nav-toggle { display: none; }

/* phone nav (360–1279): brand + Menu button; the same rail + actions open as a drawer under the header */
@media (max-width: 1279.98px) {
  .site-header { height: auto; min-height: 64px; grid-template-columns: 1fr auto; column-gap: 12px; padding-block: 10px; }
  .brand-mark { height: 36px; }
  .brand-word { font-size: 19px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; font: 600 15px/1 var(--f-ui); }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform var(--t-ctl) var(--ease-route), opacity var(--t-ctl); }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; } .nav-toggle-bars::after { top: 6px; }
  .site-header[data-open] .nav-toggle-bars { background: transparent; }
  .site-header[data-open] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .site-header[data-open] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .nav-menu {
    display: none; grid-column: 1 / -1; flex-direction: column; gap: 14px; padding: 12px 0 6px;
  }
  .site-header[data-open] .nav-menu { display: flex; }
  .nav-rail { flex-direction: column; height: auto; }
  .nav-rail a { min-height: 48px; padding: 0 16px; font-size: 16px; }
  .rule-split.nav-rail > * + * { border-left: 0; border-top: var(--rule-hair); }
  .nav-actions { justify-self: stretch; flex-wrap: wrap; gap: 12px 20px; font-size: 16px; }
  .nav-wallet { height: 44px; min-width: 0; flex: 1 1 100%; font-size: 16px; }
  .nav-social { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 1279.98px) and (prefers-reduced-motion: no-preference) {
  .site-header[data-open] .nav-menu { animation: pr-drop 180ms var(--ease-route); }
}
@keyframes pr-drop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- 7. FOOTER F5 = sources ledger (measured @1920: panel 49–1870 · title 32 · rows 34 · bottom 28) ---------- */
.site-footer { padding-top: calc(20 * var(--u)); padding-bottom: calc(28 * var(--u)); margin-top: var(--section-gap); }
.sources { padding: calc(14 * var(--u)) calc(23 * var(--u)) calc(16 * var(--u)); }
.sources-title { font: 500 max(20px, calc(32 * var(--u)))/1.1 var(--f-display); letter-spacing: -.01em; margin: 0 0 calc(14 * var(--u)); }
.sources-table { font-size: var(--fs-tiny); table-layout: fixed; }
.sources-table th, .sources-table td { padding: calc(9 * var(--u)) calc(16 * var(--u)); vertical-align: middle; }
.sources-table th { font: 500 var(--fs-tiny)/1.2 var(--f-ui); letter-spacing: .08em; color: var(--muted); }
.sources-table td { line-height: 1.4; }
.sources-table td.mono { font-size: var(--fs-tiny); }
.sources-table a { color: var(--action-text); text-decoration: none; }
.sources-table a:hover { text-decoration: underline; }
.footer-token { display: flex; flex-wrap: wrap; align-items: center; gap: calc(10 * var(--u)) calc(18 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)) 0; font-size: var(--fs-small); }
.footer-token-label { font-weight: 600; }
.footer-ca { color: var(--muted); white-space: nowrap; }
.footer-ca .mono { color: var(--ink); }
.footer-token .btn-sm, .footer-token .btn-ghost { min-height: max(28px, calc(34 * var(--u))); font-size: var(--fs-small); }
.footer-boundary { display: flex; justify-content: space-between; align-items: center; gap: calc(24 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)) 0; color: var(--muted); font-size: var(--fs-small); }
.footer-brand { display: inline-flex; align-items: center; gap: calc(10 * var(--u)); min-width: 0; }
.footer-mark { height: max(20px, calc(24 * var(--u))); width: auto; flex: none; }
.footer-social { display: flex; gap: calc(18 * var(--u)); white-space: nowrap; }
.footer-social a { color: var(--ink); text-decoration: none; }
.footer-social a[href]:hover { color: var(--action-text); }
@media (max-width: 1279.98px) {
  .site-footer { padding-bottom: 24px; }
  .sources { padding: 14px 14px 16px; }
  .sources-table { min-width: 560px; }
  .sources-table th, .sources-table td { padding: 8px 10px; }
  .footer-token { padding: 12px 4px 0; }
  .footer-boundary { flex-direction: column; align-items: flex-start; padding: 12px 4px 0; }
  .footer-brand { align-items: flex-start; }
}

/* ---------- 8. dialogs (wallet + coming soon) ---------- */
dialog.rule-soon-modal { padding: calc(24 * var(--u)); width: min(92vw, max(320px, calc(460 * var(--u)))); color: var(--ink); }
dialog::backdrop { background: rgb(28 26 23 / .28); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: calc(10 * var(--u)); }
.dialog-title { font: 500 max(20px, calc(30 * var(--u)))/1.15 var(--f-display); }
.dialog-note { color: var(--muted); font-size: var(--fs-ui); margin: calc(8 * var(--u)) 0 calc(16 * var(--u)); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: calc(14 * var(--u)); }
.wallet-list { overflow: hidden; }
.wallet-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 calc(14 * var(--u)); min-height: max(48px, calc(56 * var(--u))); font-size: var(--fs-ui); }
.wallet-list .wallet-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.wallet-list .wallet-glyph { width: 22px; height: 22px; border-radius: 6px; background: var(--tint); display: inline-grid; place-items: center; font: 600 12px/1 var(--f-mono); color: var(--muted); }
.wallet-list img.wallet-glyph { object-fit: contain; background: transparent; }
.wallet-list .wallet-go { color: var(--action-text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.wallet-list button.wallet-go:hover { text-decoration: underline; }
.wallet-connected p { font-size: var(--fs-ui); }

/* ---------- 9. MOTION (DESIGN.md §10 "the morning route") ---------- */
/* reveal: a panel is "delivered" — it slides in along the route direction (left → right), never a fade-up.
   Default = final state; the hidden start only exists while html.pr-motion is set and the panel is not yet in. */
html.pr-motion [data-reveal]:not(.is-in) { opacity: 0; transform: translateX(calc(-14 * var(--u))); }
html.pr-motion [data-reveal] { transition: opacity var(--t-reveal) var(--ease-route), transform var(--t-reveal) var(--ease-route); transition-delay: calc(var(--i, 0) * var(--t-stop)); }
/* route draw: the strip line draws, then each stop lands in order (signature 1) */
@keyframes pr-line { from { stroke-dashoffset: var(--len, 1000); } to { stroke-dashoffset: 0; } }
@keyframes pr-stop { 0% { transform: scale(.2); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
html.pr-motion .route-svg.is-drawing [data-route-line] { stroke-dasharray: var(--len, 1000); animation: pr-line 900ms var(--ease-route) both; }
html.pr-motion .route-svg.is-drawing [data-stop] { transform-box: fill-box; transform-origin: center; animation: pr-stop 360ms var(--ease-route) both; animation-delay: calc(var(--i, 0) * var(--t-stop)); }
/* delivered stamp: a stop that turns delivered pops once in the action colour */
@keyframes pr-deliver { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
html.pr-motion .is-delivering { transform-box: fill-box; transform-origin: center; animation: pr-deliver 420ms var(--ease-spring) both; }
/* live tick: a changed value flashes the action tint for 400 ms */
@keyframes pr-flash { from { background-color: rgb(209 32 169 / .08); } to { background-color: transparent; } }
[data-flash].is-flashing { animation: pr-flash 400ms var(--ease-route); border-radius: 3px; }
/* hover on a board row: a tint sweeps along the row like the route passing it */
.row-sweep { background-image: linear-gradient(90deg, var(--action-tint), var(--action-tint)); background-repeat: no-repeat; background-size: 0% 100%; transition: background-size 260ms var(--ease-route); }
.row-sweep:hover, .row-sweep.is-open { background-size: 100% 100%; }
/* grow-in: bars and fills grow from the left, the way a route advances */
html.pr-motion .grow-x.is-growing { animation: pr-grow 700ms var(--ease-route) both; transform-origin: left center; }
@keyframes pr-grow { from { transform: scaleX(0); } }
/* scroll-driven: ONLY the decorative strip line advances a little with the scroll (never text, numbers or content) */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .sd-route-line { animation: pr-sd-line linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    @keyframes pr-sd-line { from { transform: translateX(calc(-10 * var(--u))); } to { transform: none; } }
  }
}
/* route change = kit router v3 View Transition, tuned: a short forward nudge along the route */
::view-transition-old(root), ::view-transition-new(root) { animation-timing-function: var(--ease-route); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  html.pr-motion [data-reveal]:not(.is-in) { opacity: 1; transform: none; }
  .term-cursor { animation: none; }
}

/* ---------- 10. route head (eyebrow + h1 + lede) — shared rhythm of every route's first block ---------- */
.route-head { display: grid; gap: calc(12 * var(--u)); padding-block: calc(16 * var(--u)) calc(40 * var(--u)); }
.route-head .lede { margin-top: calc(2 * var(--u)); }
/* display serif: the mockup draws the sturdier text cut, not the hairline display cut that opsz=auto picks at 81 px */
.t-hero, .t-section, .t-route, .t-kit, .t-panel, .t-panel-sm, .t-result, .sources-title, .dialog-title, .brand-word { font-variation-settings: 'opsz' 24; }
