/* GRAYMARKET — app.css (shell). Tokens from mockup/v1/DESIGN.md §0–§5 + §9 USER FIXES, motion from §10.
   PAGE SCALE (LAW 50): every length is N × var(--u), N = css px at 1920 (mockup px × 1.148). --u = viewport / 1920
   (set in index.html from clientWidth), 0.75px below 1024. Type = USER FIX TYPE sizes at 1920, never below 12 px.
   BORDERS (LAW 56): the ONLY place border/outline is written. Route bodies use the .rule-* classes below and write
   ZERO border/outline declarations. Every hairline is max(1px, …) so it never vanishes at 1280–2560.
   ONE PAGE FRAME (USER FIX 1): main.frame owns the ground #23272D and the 34 / 32 gutters @1920 — route bodies never
   set max-width, side padding or a page background. */

:root {
  --u: calc(100vw / 1920);

  /* colour tokens (DESIGN §3) */
  --paper: #23272D;
  --nav: #25292E;
  --surface: #2C3036;
  --surface-raised: #373B41;
  --well: #22252A;
  --selected: #2F3244;
  --rule: #464C53;
  --rule-row-c: #434A52;   /* re-sampled 27/09: mockup row rules read #3E4650–#424A53 at 1920 (board y 409/470) */
  --rule-nav-c: #54585E;
  --ink: #F4F2EF;
  --muted: #A3A7AD;
  --accent-a: #6F6DEE;        /* ours / pinned: index pin, slip numbers, Print slip, our funding, liquidation line */
  --accent-fill: #8181FC;     /* filled buttons / selected segment */
  --accent-b: #ACB4F9;        /* from the street / just arrived: venue marks, poll flash, source links */
  --accent-band: #393D5B;     /* ±5 % band tint */
  --slip-paper: #DBDADA;
  --slip-paper-own: #D3DDF7;
  --slip-ink: #23272D;
  --spread: linear-gradient(90deg, #6F6DEE 0%, #ACB4F9 100%);   /* ONLY on the spread band between pin and farthest mark */

  /* chrome (verbatim from mockup/v1/chrome/*.html) */
  --chrome-ink: #ECEAE4;
  --chrome-link: #D3D2CE;
  --chrome-foot: #D0CFCA;
  --chrome-tab: #8B8AF4;
  --on-fill: #171820;

  /* fonts (DESIGN §2) */
  --f-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --f-sans: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --f-num: 'Archivo', 'Source Sans 3', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* type (USER FIX TYPE, css px @1920) */
  --fs-hero: calc(56 * var(--u));
  --fs-title: calc(56 * var(--u));
  --fs-section: calc(32 * var(--u));
  --fs-panel: max(12px, calc(18 * var(--u)));
  --fs-number: calc(72 * var(--u));
  --fs-number-md: calc(40 * var(--u));
  --fs-lede: max(12px, calc(18 * var(--u)));
  --fs-body: max(12px, calc(16 * var(--u)));
  --fs-mono: max(12px, calc(15 * var(--u)));
  --fs-ui: max(12px, calc(15 * var(--u)));
  --fs-label: max(12px, calc(13 * var(--u)));
  --fs-small: max(12px, calc(12 * var(--u)));
  --fs-nav: max(12px, calc(15 * var(--u)));
  --fs-foot: max(12px, calc(13 * var(--u)));

  /* spacing */
  --gutter-l: calc(34 * var(--u));
  --gutter-r: calc(32 * var(--u));
  --page-top: calc(28 * var(--u));
  --page-bottom: calc(56 * var(--u));
  --gap-section: calc(56 * var(--u));
  --gap-col: calc(14 * var(--u));
  --pad-panel: calc(20 * var(--u));
  --radius: calc(6 * var(--u));
  --radius-seg: calc(4 * var(--u));
  --radius-chip: calc(3 * var(--u));
  --notch: calc(8 * var(--u));

  /* rule tokens: width + colour per kind (DESIGN §4b / BORDER_TABLE.md) */
  --rule-frame-w: max(1px, calc(2 * var(--u)));
  --rule-frame-c: var(--rule);
  --rule-thin-w: max(1px, calc(1 * var(--u)));
  --rule-thin-c: var(--rule);
  --rule-row-w: max(1px, calc(1 * var(--u)));
  --rule-row-c2: var(--rule-row-c);
  --rule-open-w: max(1px, calc(2 * var(--u)));
  --rule-open-c: color-mix(in srgb, var(--accent-b) 45%, transparent);
  --rule-open-soft-c: color-mix(in srgb, var(--accent-b) 30%, transparent);
  --rule-accent-c: color-mix(in srgb, var(--accent-a) 40%, transparent);
  --rule-cta-w: max(1px, calc(2 * var(--u)));
  --rule-cta-c: color-mix(in srgb, var(--accent-a) 60%, #8B8AF4);
  --rule-outline-c: color-mix(in srgb, var(--accent-b) 60%, transparent);
  --rule-tab-w: max(2px, calc(3 * var(--u)));
  --rule-tab-c: var(--chrome-tab);
  --rule-mid-w: max(1px, calc(2 * var(--u)));
  --rule-mid-c: color-mix(in srgb, var(--accent-b) 70%, transparent);
  --rule-section-w: max(1px, calc(2 * var(--u)));
  --rule-ticket-c: #656E78;
  --rule-nav-w: max(1px, calc(1 * var(--u)));
  --rule-footer-w: max(1px, calc(2 * var(--u)));
  --rule-slip-btn-c: color-mix(in srgb, var(--slip-ink) 55%, transparent);
  --rule-slip-c: color-mix(in srgb, var(--slip-ink) 45%, transparent);
  --rule-selected-left: max(2px, calc(4 * var(--u)));

  /* motion (DESIGN §10): one easing family */
  --ease: cubic-bezier(.22, .7, .18, 1);
  --t-flash: 600ms;
  --t-pin: 160ms;
  --t-print: 350ms;
  --t-tear: 500ms;
  --t-feed: 120ms;
  --t-shutter: 260ms;
  --t-fast: 160ms;
}

/* ───────── base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font-family: var(--f-sans); font-size: var(--fs-body); line-height: 1.45; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
/* page grain (~3 %), the only texture on the ground */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:where(button, input, select, textarea) { border: 0; }   /* browser default borders off: every frame comes from a .rule-* class */
button { cursor: pointer; background: none; padding: 0; }
input, select, textarea { background: none; }
:focus-visible { outline: max(2px, calc(2 * var(--u))) solid var(--accent-b); outline-offset: 2px; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; border-spacing: 0; width: 100%; }
th { font-weight: 500; text-align: left; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── NAV (chrome/nav.html, fonts per DESIGN §9 #1, sizes × --u) ───────── */
.gm-nav {
  position: relative; z-index: 20; width: 100%; height: calc(138 * var(--u));
  padding: 0 calc(37 * var(--u));
  display: grid; grid-template-columns: calc(360 * var(--u)) 1fr auto; align-items: center; gap: calc(32 * var(--u));
  background: var(--nav); font-family: var(--f-sans); font-size: var(--fs-nav); color: var(--chrome-ink);
}
.gm-nav .brand {
  height: 100%; display: flex; align-items: center; gap: calc(15 * var(--u)); padding-right: calc(34 * var(--u));
  color: var(--chrome-ink); font-weight: 600; font-size: calc(24 * var(--u)); letter-spacing: .13em; white-space: nowrap;
}
.gm-nav .brand img { width: calc(56 * var(--u)); height: calc(56 * var(--u)); object-fit: contain; flex: none; }
.gm-nav .routes { display: flex; align-items: center; gap: calc(60 * var(--u)); white-space: nowrap; }
.gm-nav .routes a, .gm-nav .actions a { color: var(--chrome-link); transition: color var(--t-fast) var(--ease); }
.gm-nav .routes a { position: relative; display: inline-flex; flex-direction: column; font-weight: 500; }
.gm-nav .routes a:hover { color: var(--chrome-ink); }
.gm-nav .routes a.is-active { color: var(--chrome-ink); font-weight: 600; }
.gm-nav .routes a.is-active::after {   /* active tab underline (chrome: 58 × 3, 14 below the word) — grows from the left */
  content: ""; display: block; width: calc(58 * var(--u)); height: var(--rule-tab-w); margin-top: calc(14 * var(--u));
  background: var(--rule-tab-c); border-radius: 3px; transform-origin: left center; animation: gm-grow var(--t-pin) var(--ease) backwards;
}
.gm-nav .actions { display: flex; align-items: center; gap: calc(20 * var(--u)); white-space: nowrap; }
.gm-nav .actions .icon { font-size: calc(25 * var(--u)); line-height: 1; padding: calc(6 * var(--u)); }
[data-launch-link][aria-disabled="true"] { opacity: .5; cursor: default; }
.nav-menu { display: none; }
.nav-drawer { display: none; }

/* ───────── FOOTER (chrome/footer.html + brand mark, 13 px per DESIGN §9 #1) ───────── */
.gm-footer {
  position: relative; z-index: 1; width: 100%;
  padding: calc(14 * var(--u)) calc(43 * var(--u));
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: calc(22 * var(--u));
  background: var(--nav); font-family: var(--f-sans); font-size: var(--fs-foot); line-height: 1.35; color: var(--chrome-foot);
}
.gm-footer .foot-mark { width: auto; height: calc(44 * var(--u)); min-height: 36px; }
.gm-footer .copy { display: grid; gap: calc(2 * var(--u)); }
.gm-footer .boundary { color: var(--chrome-ink); }
.gm-footer .links { display: flex; align-items: center; gap: calc(18 * var(--u)); white-space: nowrap; font-size: var(--fs-ui); }
.gm-footer .links a[data-launch-link] { color: var(--chrome-foot); }
.gm-footer .links a[data-launch-link]:not([aria-disabled="true"]):hover { color: var(--accent-b); }
.gm-footer .ca { padding: calc(7 * var(--u)) calc(13 * var(--u)); color: var(--chrome-ink); }
.gm-footer .ca-val { font-family: var(--f-mono); font-size: var(--fs-mono); }
.gm-footer .copy-ca { padding: calc(7 * var(--u)) calc(13 * var(--u)); color: var(--chrome-ink); }
.gm-footer .buy { padding: calc(8 * var(--u)) calc(14 * var(--u)); }

/* ───────── ONE PAGE FRAME (USER FIX 1) ───────── */
main.frame {
  position: relative; z-index: 1; display: block; width: 100%;
  padding: var(--page-top) var(--gutter-r) var(--page-bottom) var(--gutter-l);
  background: transparent; min-height: calc(100vh - 138 * var(--u));
}
main.frame:focus { outline: none; }
.page-section + .page-section { margin-top: var(--gap-section); }
.page-grid { display: grid; gap: var(--gap-col); }

/* ───────── type roles ───────── */
.t-hero { font-family: var(--f-serif); font-weight: 700; font-size: var(--fs-hero); line-height: 1.1; letter-spacing: .009em; color: var(--ink); }
.t-title { font-family: var(--f-serif); font-weight: 700; font-size: var(--fs-title); line-height: 1.05; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.t-section { font-family: var(--f-serif); font-weight: 700; font-size: var(--fs-section); line-height: 1.1; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.t-panel { font-family: var(--f-serif); font-weight: 700; font-size: var(--fs-panel); line-height: 1.2; letter-spacing: .07em; text-transform: uppercase; color: var(--ink); }
.t-number { font-family: var(--f-num); font-weight: 700; font-size: var(--fs-number); line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.t-number-md { font-family: var(--f-num); font-weight: 600; font-size: var(--fs-number-md); line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.t-lede { font-size: var(--fs-lede); font-weight: 500; line-height: 1.45; color: var(--muted); }
.t-body { font-size: var(--fs-body); font-weight: 500; line-height: 1.45; color: var(--muted); }
.t-label { font-size: var(--fs-label); font-weight: 400; line-height: 1.3; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.t-small { font-size: var(--fs-small); line-height: 1.35; color: var(--muted); }
.t-ui { font-size: var(--fs-ui); font-weight: 500; line-height: 1.3; }
.t-mono { font-family: var(--f-mono); font-weight: 500; font-size: var(--fs-mono); line-height: 1.35; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.t-slip-no { font-family: var(--f-serif); font-weight: 700; letter-spacing: .02em; }
.t-ink { color: var(--ink); } .t-muted { color: var(--muted); } .t-ours { color: var(--accent-a); } .t-street { color: var(--accent-b); }
.num { font-variant-numeric: tabular-nums; }
.up::before { content: "▲ "; } .down::before { content: "▼ "; }
.neg { color: var(--muted); }   /* no red/green (DESIGN §9 #3): sign + muted ink */

/* ───────── surfaces & components ───────── */
.panel { background: var(--surface); padding: var(--pad-panel); }
.panel-flat { background: transparent; }
.well { background: var(--well); }
.raised { background: var(--surface-raised); }
.selected { background: var(--selected); }
.band { background: var(--accent-band); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--u));
  min-height: calc(48 * var(--u)); padding: 0 calc(20 * var(--u)); border-radius: var(--radius);
  font-family: var(--f-sans); font-weight: 600; font-size: var(--fs-ui); color: var(--ink);
  transition: transform 90ms var(--ease), background-color var(--t-fast) var(--ease);
}
.btn:active, .btn-fill:active { transform: translateY(1px); }   /* ticket punch */
.btn-fill {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--u));
  background: var(--accent-fill); color: var(--on-fill); border-radius: var(--radius); font-family: var(--f-mono); font-weight: 600;
}
.btn-fill[disabled], .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.link-street { color: var(--accent-b); }
.link-street:hover { text-decoration: underline; text-underline-offset: 3px; }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: var(--radius-seg); overflow: hidden; }
.seg > button, .seg > a { min-height: calc(48 * var(--u)); padding: 0 calc(18 * var(--u)); font-weight: 600; font-size: var(--fs-ui); color: var(--muted); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.seg > .is-on, .seg > [aria-pressed="true"], .seg > [aria-selected="true"] { background: var(--accent-fill); color: var(--on-fill); }

.chip { display: inline-flex; align-items: center; gap: calc(6 * var(--u)); padding: calc(2 * var(--u)) calc(8 * var(--u)); border-radius: var(--radius-chip); font-size: var(--fs-label); line-height: 1.3; }

.field { display: flex; align-items: center; gap: calc(10 * var(--u)); min-height: calc(51 * var(--u)); padding: 0 calc(14 * var(--u)); background: var(--well); }
.field input, .field select { flex: 1 1 auto; min-width: 0; padding: 0; background: transparent; font-family: var(--f-mono); font-size: var(--fs-mono); color: var(--ink); }
.field input:focus { outline: none; }
.field:focus-within { box-shadow: 0 0 0 max(1px, calc(1 * var(--u))) var(--accent-b); }
.field .unit { font-family: var(--f-mono); font-size: var(--fs-mono); color: var(--muted); }

.gm-table { width: 100%; font-family: var(--f-mono); font-size: var(--fs-mono); font-variant-numeric: tabular-nums; }
.gm-table th { font-family: var(--f-sans); font-size: var(--fs-label); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); padding: calc(8 * var(--u)) calc(10 * var(--u)); }
.gm-table td { padding: calc(11 * var(--u)) calc(10 * var(--u)); color: var(--ink); white-space: nowrap; }
.gm-table .r, .gm-table th.r { text-align: right; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* THE GRAY SLIP + margin ticket: round side notches r = 8 @1920 (CSS mask, no border) */
.notched {
  -webkit-mask: radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000 100%) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000 100%) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000 100%) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000 100%) right / 51% 100% no-repeat;
}
.gm-slip { position: relative; background: var(--slip-paper); color: var(--slip-ink); border-radius: var(--radius); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); padding: calc(22 * var(--u)); }
.gm-slip.is-own { background: var(--slip-paper-own); }
.gm-slip .slip-no { color: var(--accent-a); }
.gm-ticket { position: relative; background: var(--surface); border-radius: var(--radius); padding: calc(22 * var(--u)); }

/* THE SPREAD BAR */
.spread-track { position: relative; height: calc(6 * var(--u)); min-height: 3px; background: var(--surface-raised); border-radius: 3px; }
.spread-band { position: absolute; top: 0; bottom: 0; background: var(--accent-band); }
.spread-run { position: absolute; top: 0; bottom: 0; background: var(--spread); transform-origin: left center; }
.street-mark { position: absolute; top: 50%; width: calc(12 * var(--u)); height: calc(12 * var(--u)); min-width: 7px; min-height: 7px; margin: calc(-6 * var(--u)) 0 0 calc(-6 * var(--u)); border-radius: 50%; background: var(--accent-b); }
.street-mark.is-out { background: transparent; box-shadow: inset 0 0 0 max(1px, calc(2 * var(--u))) var(--accent-b); }
.index-pin { position: absolute; top: 50%; left: 0; width: calc(16 * var(--u)); height: calc(16 * var(--u)); min-width: 9px; min-height: 9px; margin: calc(-8 * var(--u)) 0 0 calc(-8 * var(--u)); border-radius: 50%; background: var(--accent-a); box-shadow: 0 0 0 max(2px, calc(3 * var(--u))) var(--paper); }

/* THE CHALK COLUMN */
.chalk { background: var(--well); }
.chalk .chalk-price { font-family: var(--f-num); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

.art { position: relative; overflow: hidden; }
.art > img, .art > video { width: 100%; height: 100%; object-fit: cover; }

.hover-row { position: relative; transition: background-color var(--t-fast) var(--ease); }
.hover-row::before {   /* the clip: a lavender notch marker pinned on the row edge */
  content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: max(2px, calc(3 * var(--u)));
  background: var(--accent-b); transform: scaleY(0); transition: transform var(--t-fast) var(--ease); pointer-events: none;
}
.hover-row:hover { background: color-mix(in srgb, var(--selected) 60%, transparent); }
.hover-row:hover::before, .hover-row.is-open::before { transform: scaleY(1); }

/* ═════════ RULES — one class per framed component (DESIGN §4b · BORDER_TABLE.md). Routes use these, never their own. ═════════ */
/* frames: 2 px */
.rule-panel        { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: var(--radius); }
.rule-card         { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: var(--radius); }
.rule-flow-node    { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: var(--radius); }
.rule-drawer-head  { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: var(--radius); }
.rule-drawer-full  { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: var(--radius); }
.rule-verdict      { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: var(--radius-seg); }
.rule-input        { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: var(--radius); }   /* on the .field wrapper: the frame wraps input + unit */
.rule-input-search { border: var(--rule-frame-w) solid color-mix(in srgb, var(--rule) 80%, var(--muted)); border-radius: var(--radius); }
.rule-card-accent  { border: var(--rule-frame-w) solid var(--rule-accent-c); border-radius: var(--radius); }
.rule-row-open     { border: var(--rule-open-w) solid var(--rule-open-c); border-radius: var(--radius); }
.rule-row-open.has-drawer { border-radius: var(--radius) var(--radius) 0 0; }
.rule-drawer       { border: var(--rule-frame-w) solid var(--rule-frame-c); border-top-width: 0; border-radius: 0 0 var(--radius) var(--radius); }   /* shares the top edge with .rule-row-open */
.rule-button       { border: var(--rule-frame-w) solid var(--rule-outline-c); border-radius: var(--radius); }
.rule-button-outline { border: var(--rule-frame-w) solid var(--rule-outline-c); border-radius: var(--radius); }
.rule-matrix-row   { border: var(--rule-frame-w) solid var(--rule-frame-c); border-radius: 0; }
.rule-matrix-row + .rule-matrix-row { border-top-width: 0; border-width: 0 var(--rule-row-w) var(--rule-row-w); border-color: var(--rule-row-c2); }
.rule-row-selected { border: var(--rule-frame-w) solid var(--accent-a); border-left-width: var(--rule-selected-left); border-radius: 0; }
.rule-slip-button  { border: var(--rule-frame-w) solid var(--rule-slip-btn-c); border-radius: var(--radius); }
.rule-cta          { border: var(--rule-cta-w) solid var(--rule-cta-c); border-radius: var(--radius); }
.rule-segment      { border: var(--rule-thin-w) solid var(--rule-frame-c); border-radius: var(--radius-seg); }
.rule-chip         { border: var(--rule-thin-w) solid var(--rule-cta-c); border-radius: var(--radius-chip); }
.rule-chip-street  { border: var(--rule-thin-w) solid var(--rule-outline-c); border-radius: var(--radius-chip); }
.rule-chip-slip    { border: var(--rule-thin-w) solid var(--rule-slip-btn-c); border-radius: var(--radius-chip); }
/* frames: 1 px */
.rule-panel-thin   { border: var(--rule-thin-w) solid var(--rule-thin-c); border-radius: var(--radius); }
.rule-card-thin    { border: var(--rule-thin-w) solid var(--rule-thin-c); border-radius: var(--radius); }
.rule-flow-node-thin { border: var(--rule-thin-w) solid var(--rule-thin-c); border-radius: var(--radius); }
.rule-table-frame  { border: var(--rule-thin-w) solid var(--rule-row-c2); border-radius: var(--radius); }
.rule-row-open-soft { border: var(--rule-thin-w) solid var(--rule-open-soft-c); border-radius: 0; }
/* rules (single sides) */
.rule-row          { border-bottom: var(--rule-row-w) solid var(--rule-row-c2); }
.rule-rows > *     { border-bottom: var(--rule-row-w) solid var(--rule-row-c2); }
.rule-rows > .rule-row:last-child { border-bottom-width: 0; }
.rule-grid tr > * { border-bottom: var(--rule-row-w) solid var(--rule-row-c2); }
.rule-grid tbody tr:last-child > * { border-bottom-width: 0; }
.rule-grid.rule-grid-closed tbody tr:last-child > * { border-bottom-width: var(--rule-row-w); }   /* table whose last row keeps its rule (home slip ledger) */
.rule-head        { border-bottom: var(--rule-row-w) solid var(--rule-frame-c); }
.rule-col         { border-left: var(--rule-row-w) solid var(--rule-row-c2); }
.rule-col-r       { border-right: var(--rule-row-w) solid var(--rule-row-c2); }
.rule-cols > * + * { border-left: var(--rule-row-w) solid var(--rule-row-c2); }
.rule-section     { border-bottom: var(--rule-section-w) solid var(--rule-frame-c); }
.rule-section-top { border-top: var(--rule-section-w) solid var(--rule-frame-c); }
.rule-tab-active  { border-bottom: var(--rule-tab-w) solid var(--rule-tab-c); }
.rule-book-mid    { border-bottom: var(--rule-mid-w) solid var(--rule-mid-c); }
.rule-ticket-divider { border-bottom: var(--rule-row-w) solid var(--rule-ticket-c); }
.rule-slip-rule   { border-bottom: var(--rule-row-w) solid var(--rule-slip-c); }
.rule-dashed      { border-bottom: var(--rule-row-w) dashed var(--rule-frame-c); }
.rule-perforation { border-bottom: var(--rule-row-w) dashed var(--rule-slip-c); }
/* shared-edge helpers: an adjacent box never draws the edge its neighbour already draws */
.rule-join-top    { border-top-width: 0 !important; }
.rule-join-left   { border-left-width: 0 !important; }
.rule-join-right  { border-right-width: 0 !important; }
.rule-join-bottom { border-bottom-width: 0 !important; }
/* chrome */
.rule-nav         { border-top: var(--rule-nav-w) solid var(--rule-nav-c); border-bottom: var(--rule-nav-w) solid var(--rule-nav-c); }
.rule-nav-divider { border-right: var(--rule-nav-w) solid var(--rule-nav-c); }
.rule-footer      { border-top: var(--rule-footer-w) solid var(--rule-nav-c); }
.rule-drawer-menu { border-top: var(--rule-nav-w) solid var(--rule-nav-c); border-bottom: var(--rule-nav-w) solid var(--rule-nav-c); }

/* ═════════ MOTION (DESIGN §10 — "the kiosk takes a quote, pins it, prints the stub") ═════════ */
/* route change: the kiosk shutter rolls up (transform only) */
.gm-shutter {
  position: fixed; left: 0; right: 0; top: 0; height: 100vh; z-index: 15; pointer-events: none;
  background: var(--nav) repeating-linear-gradient(180deg, transparent 0, transparent calc(10 * var(--u)), rgba(255, 255, 255, .035) calc(10 * var(--u)), rgba(255, 255, 255, .035) calc(11 * var(--u)));
  transform: scaleY(0); transform-origin: top center;
}
html.is-shuttering .gm-shutter { animation: gm-shutter var(--t-shutter) var(--ease) both; }
@keyframes gm-shutter { 0% { transform: scaleY(1); } 100% { transform: scaleY(0); } }

/* live tick: a street price lands → lavender flash on its cell (600 ms) */
[data-tick], .fx-tick { position: relative; }
.is-struck::after {
  content: ""; position: absolute; inset: calc(-2 * var(--u)) calc(-4 * var(--u)); border-radius: var(--radius-chip);
  background: var(--accent-b); opacity: 0; pointer-events: none; animation: gm-flash var(--t-flash) var(--ease);
}
@keyframes gm-flash { 0% { opacity: .32; } 100% { opacity: 0; } }

/* index pin slides to the new median (GRAY_FX.pin) */
.fx-pin { transition: transform var(--t-pin) var(--ease); will-change: transform; }

/* reveal on scroll: rows feed in from the left like stubs pushed along the wire (content never hidden before it enters) */
.is-fed { animation: gm-feed var(--t-feed) var(--ease) backwards; animation-delay: var(--feed-delay, 0ms); }
@keyframes gm-feed { 0% { opacity: 0; transform: translateX(calc(-14 * var(--u))); } 100% { opacity: 1; transform: none; } }

/* grow-in: bars grow out of the pin (origin set per bar: data-grow="left|right|center") */
.is-grown { animation: gm-grow var(--t-pin) var(--ease) backwards; }
[data-grow="right"].is-grown { transform-origin: right center; }
[data-grow="left"].is-grown, [data-grow=""].is-grown { transform-origin: left center; }
[data-grow="center"].is-grown { transform-origin: center center; }
[data-grow="y"].is-grown { transform-origin: center bottom; animation-name: gm-grow-y; }
@keyframes gm-grow { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
@keyframes gm-grow-y { 0% { transform: scaleY(0); } 100% { transform: scaleY(1); } }

/* print: a new slip slides out of the ticket slot (the tray clips it) */
.is-printing { animation: gm-print var(--t-print) var(--ease) backwards; }
@keyframes gm-print { 0% { transform: translateY(-100%); } 100% { transform: none; } }

/* tear: the top half rotates 4° and drops 20 px along the notch line */
.is-tearing [data-tear-top], .is-tearing.fx-tear-top { animation: gm-tear var(--t-tear) var(--ease) forwards; transform-origin: 0% 100%; }
@keyframes gm-tear { 0% { transform: none; opacity: 1; } 100% { transform: translateY(calc(20 * var(--u))) rotate(4deg); opacity: .55; } }

/* number stamp (count-up keeps width: tabular numbers) */
[data-countup] { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gm-shutter { display: none; }
}

/* ═════════ below 1024: mobile layout (--u = 0.75px, gutters 16 px) ═════════ */
@media (max-width: 1023.98px) {
  :root {
    --gutter-l: 16px; --gutter-r: 16px; --page-top: 16px; --page-bottom: 40px; --gap-section: 40px;
    --fs-hero: 30px; --fs-title: 30px; --fs-section: 22px; --fs-number: 44px; --fs-number-md: 28px;
    --fs-body: 15px; --fs-lede: 15px; --fs-mono: 13px; --fs-ui: 14px; --fs-label: 12px; --fs-nav: 16px; --fs-foot: 12px;
  }
  .gm-nav { height: 60px; padding: 0 16px; grid-template-columns: 1fr auto; gap: 12px; }
  .gm-nav .brand { font-size: 18px; padding-right: 0; gap: 10px; }
  .gm-nav .brand img { width: 40px; height: 40px; }
  .gm-nav .brand.rule-nav-divider { border-right-width: 0; }
  .gm-nav .routes, .gm-nav .actions { display: none; }
  .nav-menu { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; font-weight: 600; font-size: 15px; color: var(--chrome-ink); }
  .nav-menu .bars { position: relative; width: 16px; height: 2px; background: currentColor; }
  .nav-menu .bars::before, .nav-menu .bars::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; }
  .nav-menu .bars::before { top: -5px; } .nav-menu .bars::after { top: 5px; }
  .nav-drawer:not([hidden]) {
    display: grid; position: absolute; left: 0; right: 0; top: 100%; z-index: 30; padding: 8px 16px 16px; background: var(--nav);
  }
  .nav-drawer a { display: block; padding: 12px 0; font-size: 17px; color: var(--chrome-link); }
  .nav-drawer a.is-active { color: var(--chrome-ink); font-weight: 600; }
  .nav-drawer .drawer-tools { display: flex; gap: 24px; padding-top: 8px; }
  main.frame { min-height: calc(100vh - 60px); }
  .gm-footer { grid-template-columns: 1fr; gap: 12px; padding: 20px 16px; }
  .gm-footer .foot-mark { height: 40px; }
  .gm-footer .links { flex-wrap: wrap; white-space: normal; }
  .gm-footer .ca-val { word-break: break-all; }
  .gm-shutter { display: none; }
}
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 600; font-display: swap; src: url('./assets/fonts/archivo-600.ttf') format('truetype'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700; font-display: swap; src: url('./assets/fonts/archivo-700.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('./assets/fonts/ibm-plex-mono-400.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('./assets/fonts/ibm-plex-mono-500.ttf') format('truetype'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url('./assets/fonts/source-sans-3-400.ttf') format('truetype'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 500; font-display: swap; src: url('./assets/fonts/source-sans-3-500.ttf') format('truetype'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap; src: url('./assets/fonts/source-sans-3-600.ttf') format('truetype'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url('./assets/fonts/source-serif-4-600.ttf') format('truetype'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 700; font-display: swap; src: url('./assets/fonts/source-serif-4-700.ttf') format('truetype'); }
