/* ============================================================
   ALCHEMI · PRODUCT DEMO APP (app/)
   Load order: tokens.css → site.css → app.css. tokens.css and site.css are the website's own files
   (symlinked from site/css), so the demo page and the app share one set of components: .panel,
   .stats/.stat, .table/.table--stack, .wait/.wait-cell, .t-warn/.t-err, .tag--level, .msg, .legend,
   .chart, .forecast, .kv, .btn.is-preview. This file only adds the app shell and the few
   interactive parts the static demo does not have. Breakpoints: 1200 (list + detail side by side),
   960 (sidebar → bottom bar), 720 (site's stacked tables).
   v2 (11 October): the intro, the Overnight briefing, the crew's avatars, Your rules, and the MOTION block below.
   ============================================================ */

:root {
  --chrome-h: 44px;
  --strip-h: 34px;
  --top-h: calc(var(--chrome-h) + var(--strip-h));
  --side-w: 224px;
  --nav-h: 0px;

  /* MOTION (v2). Sources: Material motion (duration and easing): enter 225 ms, leave 195 ms, desktop 150–200 ms,
     full-screen 375 ms, nothing past 400 ms; enter on deceleration cubic-bezier(0,0,.2,1), leave on acceleration
     cubic-bezier(.4,0,1,1). Emil Kowalski ("great animations"): under 300 ms for UI, ease-out to enter, only
     transform and opacity, 60 fps, interruptible CSS transitions, never animate frequent keyboard actions
     (screen keys cross-fade, rows do not). Vercel Web Interface Guidelines: honour prefers-reduced-motion,
     compositor-only properties, never `transition: all`, animate only to show cause and effect. Apple HIG:
     motion that supports and never overshadows; with Reduce Motion, fades instead of movement.
     Linear's redesign: reduce visual noise, a calm neutral surface. No bounce, no parallax. */
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --m-state: 180ms;      /* hover, press, toggles, colour changes */
  --m-enter: 280ms;      /* a row or card arriving */
  --m-screen: 300ms;     /* the new screen arriving */
  --m-leave: 150ms;      /* anything leaving */
  --m-count: 600ms;      /* count-ups on money and counts (js) */
  --m-stagger: 35ms;     /* per row, capped at 10 rows (js) */
}
html { scroll-behavior: auto; scroll-padding-top: calc(var(--top-h) + 16px); }
body.app { background: var(--bg-base); font-size: var(--text-sm); }
.app h1:focus { outline: none; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 60; padding: 8px 12px; background: var(--color-obsidian); color: var(--text-inverse); font-family: var(--font-mono); font-size: var(--text-xs); text-decoration: none; }
.skip:focus { top: 8px; color: var(--text-inverse); }
kbd { font-family: var(--font-mono); font-size: 10px; line-height: 1; padding: 2px 4px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); color: var(--text-tertiary); background: var(--bg-base); }

/* ---------- Top: obsidian chrome bar + the persistent demo strip ---------- */
.app-top { position: sticky; top: 0; z-index: 40; }
.chrome { height: var(--chrome-h); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); background: var(--color-obsidian); color: var(--text-inverse); border-bottom: 1px solid var(--ink-700); }
.chrome__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-inverse); text-decoration: none; flex: none; }
.chrome__brand:hover { color: var(--text-inverse); }
.chrome__glyph { width: 22px; height: 19px; }
.chrome__word { font-weight: var(--weight-semibold); font-size: 16px; letter-spacing: -0.01em; }
.chrome__sep { width: 1px; height: 20px; background: var(--ink-700); flex: none; }
.chrome__agency { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-inverse); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chrome__meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-300); white-space: nowrap; }
.chrome__dot { width: 6px; height: 6px; background: var(--status-success); box-shadow: 0 0 0 2px rgba(46, 125, 84, 0.35); }

.app .demo-strip { position: static; height: var(--strip-h); border-bottom: 1px solid var(--ink-700); }
.app .demo-strip__inner { height: 100%; min-height: 0; padding: 0 var(--space-4); }
.demo-strip__text { min-width: 0; overflow: hidden; white-space: nowrap; }
.strip-long, .strip-short { overflow: hidden; text-overflow: ellipsis; }
.strip-short { display: none; }
.demo-strip__actions { display: inline-flex; gap: var(--space-2); flex: none; }
.app .demo-strip .btn--sm { height: 24px; padding: 0 10px; }
.btn--inv { background: transparent; border-color: var(--ink-600); color: var(--text-inverse); }
.btn--inv:hover { background: var(--text-inverse); border-color: var(--text-inverse); color: var(--text-primary); }
.btn--inv:focus-visible { outline-color: var(--text-inverse); }

/* ---------- Shell: sidebar + screen ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.side { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); display: flex; flex-direction: column; justify-content: space-between; background: var(--bg-subtle); border-right: 1px solid var(--border-default); padding: var(--space-3) 0; overflow-y: auto; }
.side__list { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--space-2); }
.side__link { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: var(--weight-medium); transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.side__link:hover { background: var(--ink-150); color: var(--text-primary); }
.side__link[aria-current="page"] { background: var(--bg-base); color: var(--text-primary); box-shadow: var(--shadow-card); }
.side__link[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); }
.side__n { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.04em; }
.side__l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__s { display: none; }
.side__c { font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--text-secondary); min-width: 16px; text-align: right; }
.side__c:empty { display: none; }
.side__c.is-hot { color: var(--status-error); font-weight: var(--weight-semibold); }
.side__foot { padding: var(--space-3) var(--space-4) 0; border-top: 1px solid var(--border-default); margin: var(--space-3) var(--space-2) 0; display: flex; flex-direction: column; gap: 4px; }
.side__foot .label { font-size: 11px; color: var(--text-primary); }
.side__meta { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.45; }
.side__keys { margin-top: 6px; }

.main { min-width: 0; padding: 16px var(--space-4) var(--space-7); outline: none; }
.view { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.view__screen { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Screen head ---------- */
.screen-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); }
.screen-head .label { font-size: 11px; }
.screen-head__title { font-size: 24px; letter-spacing: var(--tracking-tight); line-height: 1.15; margin-top: 4px; }
.screen-head__desc { color: var(--text-secondary); font-size: var(--text-sm); margin-top: 4px; max-width: 680px; }
.screen-head__meta { display: flex; gap: var(--space-2); align-items: center; flex: none; }

/* ---------- Density: the app runs tighter than the marketing page ---------- */
.app .panel { border-radius: var(--radius-md); }
.app .panel__bar { padding: 10px var(--space-3); }
.app .stat { padding: var(--space-3) var(--space-4); gap: 6px; }
.app .stat__value { font-size: 26px; }
.app .stat__value small { font-size: 13px; }
.app .table th { padding: 10px 12px; }
.app .table td { padding: 8px 12px; vertical-align: middle; }
.app .table th:first-child, .app .table td:first-child { padding-left: var(--space-3); }
.app .table th:last-child, .app .table td:last-child { padding-right: var(--space-3); }
.app .table tfoot td { padding-top: 12px; padding-bottom: 12px; }
.app .panel__legend { padding: 10px var(--space-3); }
.app .legend { font-size: 11px; }

/* The leak: fee at risk, large */
.stats--leak { grid-template-columns: minmax(0, 3fr) repeat(3, minmax(0, 1fr)); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.app .stat--hero { padding: 14px var(--space-4); gap: 4px; }
.hero-line { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.hero-line .stat__note { max-width: 250px; }
.facts3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.facts3 > div { display: flex; flex-direction: column; gap: 4px; padding: 10px var(--space-3); background: var(--bg-base); font-size: var(--text-xs); }
.facts3 .label { font-size: 10px; }
.msg .facts3 { border-bottom: 1px solid var(--border-subtle); }
.app .stat__value--hero { font-size: 48px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__value--hero.is-leak { color: var(--status-error); }
.stat__value--hero.is-clear { color: var(--status-success); }
.stat__note { font-size: var(--text-xs); color: var(--text-secondary); }
.stats--plain { border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.stat__value .is-leak { color: var(--status-error); }

/* ---------- Filters that work (the site's .filters bar, real controls inside) ---------- */
.filters--live { gap: 8px 10px; padding: 8px var(--space-3); }
.ctl { position: relative; display: inline-flex; align-items: center; }
.ctl select { appearance: none; -webkit-appearance: none; height: 30px; padding: 0 28px 0 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-primary); background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-sm); cursor: pointer; max-width: 210px; text-overflow: ellipsis; }
.ctl select:hover { border-color: var(--ink-400); }
.ctl select.is-on { border-color: var(--border-strong); }
.ctl::after { content: ""; position: absolute; right: 11px; top: 11px; width: 5px; height: 5px; border-right: 1px solid var(--text-secondary); border-bottom: 1px solid var(--text-secondary); transform: rotate(45deg); pointer-events: none; }
.seg { display: inline-flex; border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.seg button { height: 28px; padding: 0 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-secondary); background: var(--bg-base); border: 0; border-right: 1px solid var(--border-default); cursor: pointer; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text-primary); background: var(--ink-050); }
.seg button[aria-pressed="true"] { background: var(--color-obsidian); color: var(--text-inverse); }
.seg button .n { opacity: 0.7; margin-left: 4px; }
.seg__s { display: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--text-primary); }
.filters__count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); white-space: nowrap; }

/* ---------- List + detail ---------- */
.ld { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.ld--wide { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1359px) { .ld--wide { grid-template-columns: minmax(0, 1fr) 328px; } }
.detail { position: sticky; top: calc(var(--top-h) + 16px); }
.detail .msg { max-width: none; border: 0; border-top: 1px solid var(--border-subtle); }
.detail__facts { padding: 4px var(--space-3); }
.detail__facts .kv__row { padding: 8px 0; font-size: var(--text-xs); }
.detail__facts .kv__row span:first-child { color: var(--text-secondary); }
.detail__facts .kv__row span:last-child { text-align: right; }
.msg__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.detail .msg__actions { padding: 0 var(--space-3) var(--space-3); }
.msg-row .msg { max-width: 760px; }
.msg-row .msg__actions { padding: 0 var(--space-3) var(--space-3); }
.msg__body .sig { color: var(--text-secondary); }
.t-err-text { color: var(--status-error); font-weight: var(--weight-semibold); }
.t-warn-text { color: var(--ink-900); font-weight: var(--weight-semibold); }

/* Clickable rows: the first cell holds a real button; the whole row forwards its click */
.table tr[data-open] { cursor: pointer; }
.rowbtn { display: block; width: 100%; padding: 0; margin: 0; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rowbtn:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 4px; }
.table tr.is-sel td { background: var(--ink-050); }
.table tr.is-sel td:first-child { box-shadow: inset 3px 0 0 var(--aero-blue); }
.table tr.is-sel td.t-warn { background: var(--tint-warning); }
.table tr.is-sel td.t-err { background: var(--tint-error); }
.table .sub { line-height: 1.35; }
.table td .tag { vertical-align: middle; }
.cell-state { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.tag--done { color: var(--text-primary); background: var(--tint-success); border-color: var(--status-success); }
.tag--done svg { width: 10px; height: 10px; }
.draft-ready { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); white-space: nowrap; }

/* Number cells animate their colour, never their size */
.table td, .tag, .wait__bar span { transition: background-color var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard), color var(--duration-base) var(--ease-standard); }

/* ---------- Forecast extras ---------- */
.chart__bar { padding: 0; cursor: pointer; font: inherit; }
.chart__bar:not(.chart__bar--forecast) { border: 0; }
.placed .kv__row { align-items: flex-start; }
.placed .kv__row span.sub { display: block; color: var(--text-secondary); font-size: var(--text-xs); font-family: var(--font-sans); }
.chart__bar:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }
.chart__bar.is-on { box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 3px var(--border-strong); }
.chart__readout { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; min-height: 40px; padding: 8px 12px; background: var(--bg-subtle); font-size: var(--text-xs); }
.chart__readout b { font-family: var(--font-mono); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.chart__target { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.money-pos { color: var(--status-success); font-weight: var(--weight-semibold); }
.risk-detail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-4); max-width: 1040px; }
.risk-detail h3 { font-size: var(--text-sm); margin-bottom: 6px; }
.risk-detail p { font-size: var(--text-sm); }
.risk-detail .kv { margin-top: var(--space-2); }
.risk-detail .msg { max-width: none; margin-top: var(--space-2); }
.risk-detail__links { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }
.arrow-link { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-primary); text-underline-offset: 4px; }
.risks-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-2); }

/* ---------- One job order traced ---------- */
.trace-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trace { padding: var(--space-4) var(--space-4) var(--space-3); }
.trace__parts { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 14px; }
.trace__part { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); padding-top: 8px; border-top: 1px solid var(--border-strong); margin-right: 12px; }
.trace__part--jf { grid-column: 1 / span 3; }
.trace__part--cs { grid-column: 4 / span 3; }
.trace__part--vi { grid-column: 7 / span 1; margin-right: 0; }
.trace__steps { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.trace__rail { position: absolute; left: 7px; right: calc(100% / 7 - 7px); top: 6px; height: 2px; background: var(--ink-150); }
.trace__fill { position: absolute; inset: 0; background: var(--border-strong); transform-origin: left; transition: transform var(--m-screen) var(--ease-out); }
.step { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 8px 0 0; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.step__dot { width: 14px; height: 14px; background: var(--bg-base); border: 2px solid var(--ink-300); margin-bottom: 8px; transition: background var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard); position: relative; z-index: 1; }
.step.is-past .step__dot { background: var(--ink-900); border-color: var(--ink-900); }
.step.is-stall .step__dot { background: var(--status-warning); border-color: var(--status-warning); }
.step[aria-selected="true"] .step__dot { background: var(--aero-blue); border-color: var(--ink-900); box-shadow: 0 0 0 4px var(--aero-tint); }
.step__label { font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-medium); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-primary); }
.step__date { font-size: var(--text-xs); color: var(--text-secondary); }
.step:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 4px; }
.step:hover .step__label { text-decoration: underline; text-underline-offset: 3px; }
.fee { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 2px 6px; font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; border: 1px solid var(--border-default); border-radius: var(--radius-sm); white-space: nowrap; color: var(--text-secondary); }
.fee b { font-weight: var(--weight-semibold); color: var(--text-primary); }
.fee--potential { border-style: dashed; border-color: var(--ink-300); }
.fee--play { border-color: var(--border-strong); color: var(--text-primary); }
.fee--risk { background: var(--tint-error); border-color: var(--status-error); color: var(--text-primary); }
.fee--secured { background: var(--tint-success); border-color: var(--status-success); color: var(--text-primary); }
.fee--secured b { color: var(--status-success); }
.trace__ctl { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: 10px var(--space-3); border-top: 1px solid var(--border-subtle); }
.trace__ctl .filters__count { margin-left: auto; }
.trace__pane { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-4); padding: var(--space-4); border-top: 1px solid var(--border-default); min-height: 268px; }
.trace__pane h2 { font-size: 20px; letter-spacing: var(--tracking-tight); line-height: 1.25; margin-top: 8px; }
.trace__pane p.trace__text { color: var(--text-secondary); margin-top: 8px; max-width: 460px; }
.trace__pane .msg { max-width: none; }
.trace__art .kv { border: 1px solid var(--border-default); padding: 0 var(--space-3); }
.pane-in { animation: pane-in var(--m-enter) var(--ease-out) both; }
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.trace-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border-default); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.trace-links a { display: flex; flex-direction: column; gap: 6px; padding: var(--space-3) var(--space-4); background: var(--bg-base); text-decoration: none; transition: background var(--duration-fast) var(--ease-standard); }
.trace-links a:hover { background: var(--bg-subtle); color: var(--text-primary); }
.trace-links strong { font-weight: var(--weight-semibold); }
.trace-links span:last-child { color: var(--text-secondary); font-size: var(--text-xs); }

/* ---------- Settings ---------- */
.set { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-3); align-items: start; }
.set__col { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.set__side { position: sticky; top: calc(var(--top-h) + 16px); }
.conn { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.conn .msg__actions { padding: 0; }
.conn__head { display: flex; align-items: center; gap: var(--space-3); }
.conn__logo { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--color-obsidian); color: var(--text-inverse); font-family: var(--font-mono); font-weight: var(--weight-semibold); font-size: 16px; flex: none; }
.conn__name { font-weight: var(--weight-semibold); font-size: var(--text-body); }
.conn__sub { color: var(--text-secondary); font-size: var(--text-xs); }
.conn .kv__row span:first-child { color: var(--text-secondary); }
.conn .kv__row span:last-child { text-align: right; font-family: var(--font-sans); }
.rule { display: flex; gap: 12px; align-items: flex-start; padding: 12px var(--space-3); background: var(--bg-subtle); border-left: 2px solid var(--border-strong); font-size: var(--text-sm); }
.rule svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.thr { display: flex; flex-direction: column; }
.thr__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: 12px var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.thr__row:last-child { border-bottom: 0; }
.thr__name { font-weight: var(--weight-semibold); font-size: var(--text-sm); display: flex; align-items: center; gap: 8px; }
.thr__help { color: var(--text-secondary); font-size: var(--text-xs); margin-top: 2px; }
.sw { width: 10px; height: 10px; flex: none; }
.sw--warn { background: var(--tint-warning); box-shadow: inset 2px 0 0 var(--status-warning); outline: 1px solid var(--status-warning); outline-offset: -1px; }
.sw--err { background: var(--tint-error); box-shadow: inset 2px 0 0 var(--status-error); outline: 1px solid var(--status-error); outline-offset: -1px; }
.sw--ink { background: var(--ink-400); }
.stepper { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.stepper button { width: 30px; background: var(--bg-base); border: 0; font-family: var(--font-mono); font-size: 14px; color: var(--text-primary); cursor: pointer; }
.stepper button:hover { background: var(--ink-100); }
.stepper button:first-child { border-right: 1px solid var(--border-default); }
.stepper button:last-child { border-left: 1px solid var(--border-default); }
.stepper input { width: 64px; border: 0; text-align: right; padding: 0 4px; font-family: var(--font-mono); font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--text-primary); background: var(--bg-base); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }
.stepper:focus-within { border-color: var(--border-strong); }
.stepper__unit { display: inline-flex; align-items: center; padding: 0 8px 0 2px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); background: var(--bg-base); }
.stepper__pre { display: inline-flex; align-items: center; padding-left: 8px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-secondary); background: var(--bg-base); }
.stepper--fee input { width: 72px; text-align: left; }
.pv { padding: 4px var(--space-3) var(--space-3); }
.pv__title { margin: 12px 0 6px; font-size: 11px; }
.pv__row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 84px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-xs); }
.pv__row > span { padding: 4px 6px; }
.pv__row .wait { justify-content: flex-start; }
.pv__row .num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.pv__row.is-out { color: var(--text-tertiary); }
.pv__row.is-out .wait__bar span { background: var(--ink-200); }
.pv .t-warn { background: var(--tint-warning); box-shadow: inset 2px 0 0 var(--status-warning); }
.pv .t-err { background: var(--tint-error); box-shadow: inset 2px 0 0 var(--status-error); }
.pv .wait-cell.t-warn .wait__bar span { background: var(--status-warning); }
.pv .wait-cell.t-err .wait__bar span { background: var(--status-error); }
.pv__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pv span, .pv .tag { transition: background-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard); }
.code { margin: 0; padding: var(--space-3); font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--text-primary); background: var(--bg-subtle); overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.code .k { color: var(--text-secondary); }
.code .v { padding: 0 2px; transition: background-color var(--duration-slow) var(--ease-standard); }
.code .v.is-changed { background: var(--aero-tint); box-shadow: inset 0 -1px 0 var(--aero-blue); }
.set__note { padding: 10px var(--space-3); border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-secondary); }

/* ---------- Toast + dialog ---------- */
.toast { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 70; max-width: 360px; padding: 10px 14px; background: var(--color-obsidian); color: var(--text-inverse); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity var(--m-leave) var(--ease-in), transform var(--m-leave) var(--ease-in); }
.toast.is-on { opacity: 1; transform: none; transition-duration: 220ms; transition-timing-function: var(--ease-out); }
.dlg { width: min(520px, calc(100vw - 32px)); max-width: none; padding: 0; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md); color: var(--text-primary); background: var(--bg-base); box-shadow: 0 24px 64px rgba(17, 17, 17, 0.18); }
.dlg::backdrop { background: rgba(17, 17, 17, 0.45); }
.dlg__inner { padding: var(--space-4); display: flex; flex-direction: column; gap: 10px; }
.dlg__title { font-size: 20px; letter-spacing: var(--tracking-tight); }
.dlg__body { display: flex; flex-direction: column; gap: 10px; font-size: var(--text-sm); color: var(--text-secondary); }
.dlg__body .kv { border: 1px solid var(--border-default); padding: 0 12px; }
.dlg__body .kv__row span:first-child { color: var(--text-secondary); }
.dlg__body .kv__row span:last-child { color: var(--text-primary); font-family: var(--font-sans); text-align: right; }
.dlg__actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .dlg[open] { animation: pane-in 220ms var(--ease-out) both; }
  .dlg[open]::backdrop { animation: fade-in 220ms var(--ease-out) both; }
}
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .pane-in, .dlg[open] { animation: none; }
  .trace__fill, .toast, .table td, .tag, .code .v { transition: none; }
}

/* ============================================================ RESPONSIVE */
@media (max-width: 1280px) {
  .strip-long { display: none; }
  .strip-short { display: inline; }
}
@media (max-width: 1199px) {
  .set { grid-template-columns: 1fr; }
  .set__side { position: static; }
}
@media (max-width: 960px) {
  :root { --side-w: 0px; --nav-h: 60px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .chrome__meta { display: none; }
  .side { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); background: var(--bg-base); border-right: 0; border-top: 1px solid var(--border-default); overflow: hidden; }
  .side__list { flex-direction: row; gap: 0; padding: 0; height: 100%; }
  .side__list li { flex: 1 1 0; min-width: 0; }
  .side__link { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 2px; border-radius: 0; font-size: 11px; }
  .side__link[aria-current="page"] { box-shadow: none; background: var(--bg-subtle); }
  .side__link[aria-current="page"]::before { left: 12px; right: 12px; top: 0; bottom: auto; width: auto; height: 2px; }
  .side__l, .side__foot { display: none; }
  .side__s { display: block; white-space: nowrap; order: 2; }
  .side__c { order: 1; min-width: 0; text-align: center; font-size: 11px; }
  .side__link:has(.side__c:not(:empty)) .side__n { display: none; }
  .main { padding: var(--space-3) var(--space-4) calc(var(--nav-h) + var(--space-6)); }
  .toast { left: var(--space-3); right: var(--space-3); bottom: calc(var(--nav-h) + 12px); max-width: none; }
  .trace__pane { grid-template-columns: 1fr; }
  .risk-detail { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --chrome-h: 44px; --strip-h: 36px; }
  .chrome { padding: 0 var(--space-3); gap: 12px; }
  .chrome__word { font-size: 15px; }
  .app .demo-strip__inner { padding: 0 var(--space-3); }
  .main { padding-left: var(--space-3); padding-right: var(--space-3); }
  .screen-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .screen-head__title { font-size: 22px; }
  .stats--leak { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat--hero { grid-column: 1 / -1; }
  .app .stat__value--hero { font-size: 40px; }
  .stats--plain, .trace-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app .stat { padding: 12px var(--space-3); }
  .app .stat__value { font-size: 22px; }
  .filters--live .filters__count { margin-left: 0; width: 100%; }
  .ctl, .ctl select { max-width: none; }
  .filters--live .ctl { flex: 1 1 140px; }
  .filters--live .ctl select { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 0; padding: 0 4px; }
  .seg__l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .seg button { position: relative; }
  .seg__s { display: inline; }
  .stats--plain .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pv .wait__bar { width: 36px; }
  .app .table--stack tr { padding: 12px var(--space-3); }
  .app .table--stack td { padding: 0 !important; }
  .app .table--stack td.t-warn, .app .table--stack td.t-err { padding: 4px 8px !important; }
  .table--stack .cell-state { display: flex; width: 100%; justify-content: flex-start; }
  .table--stack .cell-state .btn { flex: 1 1 auto; }
  .table--stack td.stack-full { grid-column: 1 / -1; }
  .table--stack tr.msg-row td { padding: 0 !important; }
  .table--stack tr.msg-row .msg { border: 0; }
  .app .table tr.is-sel td:first-child { box-shadow: none; }
  .table--stack tr.is-open { background: var(--ink-050); box-shadow: inset 3px 0 0 var(--aero-blue); }
  .trace { padding: var(--space-3); }
  .trace__parts { display: none; }
  .trace__steps { grid-template-columns: 1fr; gap: 0; }
  .trace__rail { left: 6px; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; }
  .trace__fill { transform-origin: top; }
  .step { display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 7px 0; }
  .step__dot { margin: 0; }
  .step__part { display: none; }
  .step .fee { margin: 0; justify-self: end; }
  .trace__pane { padding: var(--space-3); min-height: 0; }
  .trace-links { grid-template-columns: 1fr; }
  .pv__row { grid-template-columns: minmax(0, 1fr) 84px 76px; }
  .demo-strip__cta { display: none; }
  .msg__actions .btn { flex: 1 1 auto; }
}

/* ============================================================ v2: INTRO
   Obsidian, the site hero's blueprint grid, the mark assembling from shards (js/intro.js), then
   "Welcome to Transmute" -> "Transmute open". Hidden unless html.intro-on; a 6 s safety net hides it if the
   script never runs. The mark's box is fixed by CSS so the shards (fitted to it) and the img always agree. */
.intro { display: none; position: fixed; inset: 0; z-index: 100; overflow: hidden; background: var(--color-obsidian); color: var(--text-inverse); cursor: default;
  --mark-h: clamp(84px, 15vh, 140px); --mark-y: calc(50% - 32px);
  transition: opacity 300ms var(--ease-in); }
.intro::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--ink-800) 1px, transparent 1px), linear-gradient(90deg, var(--ink-800) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 75%); }
.intro-on .intro { display: block; animation: intro-safety 1ms linear 6s forwards; }
@keyframes intro-safety { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.intro__gl { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 400ms var(--ease-out); }
.intro.is-gl .intro__gl { opacity: 1; }
/* The flat mark is a canvas drawn from the SVG path (js/intro.js), so it never becomes the page's LCP image. */
.intro__mark { position: absolute; left: 50%; top: var(--mark-y); height: var(--mark-h); width: calc(var(--mark-h) * 129 / 112); transform: translate(-50%, -50%); opacity: 0; }
.intro__text { position: absolute; left: 0; right: 0; top: calc(var(--mark-y) + var(--mark-h) / 2 + 40px); height: 20px; margin: 0;
  font-family: var(--font-mono); font-size: 13px; font-weight: var(--weight-medium); letter-spacing: var(--tracking-wide); text-transform: uppercase; text-align: center; }
.intro__t1, .intro__t2 { position: absolute; left: 0; right: 0; opacity: 0; transform: translateY(8px); transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
.intro__t1 { color: var(--ink-300); }
.intro__t2 { color: var(--text-inverse); }
.intro__t2 i { display: inline-block; width: 6px; height: 6px; margin-right: 12px; vertical-align: 2px; background: var(--aero-blue); }
.intro.is-welcome .intro__t1 { opacity: 1; transform: none; }
.intro.is-open .intro__t1 { opacity: 0; transform: translateY(-6px); transition: opacity var(--m-leave) var(--ease-in), transform var(--m-leave) var(--ease-in); }
.intro.is-open .intro__t2 { opacity: 1; transform: none; transition-delay: 90ms; }
.intro__skip { position: absolute; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0; text-align: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--ink-500);
  opacity: 0; animation: intro-show 400ms var(--ease-out) 700ms forwards; }
@keyframes intro-show { to { opacity: 1; } }
.intro.is-leaving { opacity: 0; }
.intro.is-fast { transition-duration: 200ms; }
.intro.is-reduced { transition: opacity 600ms linear; }
.intro.is-reduced .intro__t1, .intro.is-reduced .intro__skip { display: none; }
.intro.is-reduced .intro__t2 { opacity: 1; transform: none; transition: none; }

.linkbtn--inv { color: var(--ink-300); white-space: nowrap; }
@media (max-width: 720px) { .strip-long-i { display: none; } }
.linkbtn--inv:hover { color: var(--text-inverse); }
.linkbtn--inv:focus-visible { outline: 2px solid var(--text-inverse); outline-offset: 2px; }
.demo-strip__actions { align-items: center; }

/* ============================================================ v2: THE CREW'S AVATARS
   The design-system mark on obsidian, one aero detail per agent; no icons, no faces. */
.av { position: relative; flex: none; display: inline-block; width: 32px; height: 32px; background: var(--color-obsidian); border-radius: var(--radius-sm); overflow: hidden; }
.av::before { content: ""; position: absolute; inset: 0; background: var(--text-inverse);
  -webkit-mask: url("../assets/alchemi-glyph-white.svg") center / 64% no-repeat; mask: url("../assets/alchemi-glyph-white.svg") center / 64% no-repeat; }
.av::after { content: ""; position: absolute; background: var(--aero-blue); }
.av--scout::after { left: 0; right: 0; top: 0; height: 2px; }                 /* the horizon it scans */
.av--scribe::after { left: 22%; right: 22%; bottom: 3px; height: 2px; }       /* the line it writes */
.av--chaser::after { top: 0; bottom: 0; right: 0; width: 2px; }               /* the nudge forward */
.av--sentinel::after { inset: 0; background: transparent; box-shadow: inset 0 0 0 2px var(--aero-blue); } /* the watch */
.av--forecaster::after { top: 3px; right: 3px; width: 5px; height: 5px; }     /* the week ahead */
.av--you { background: var(--bg-base); box-shadow: inset 0 0 0 1.5px var(--ink-900); }
.av--you::before { background: var(--ink-900); }
.av--you::after { display: none; }
.av--sm { width: 22px; height: 22px; }
.av--sm.av--sentinel::after { box-shadow: inset 0 0 0 1.5px var(--aero-blue); }
.av--sm.av--forecaster::after { top: 2px; right: 2px; width: 4px; height: 4px; }
.av--sm.av--scribe::after { bottom: 2px; }

/* ============================================================ v2: OVERNIGHT */
.ov { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-3); align-items: start; }
.ov-recs__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); padding: 4px 2px 0; min-height: 22px; }
.ov-recs__head .label { font-size: 11px; color: var(--text-primary); }
.ov-recs { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* The log: what each agent did, on the design-system timeline (2 px ink-150 rail) */
.log { position: relative; list-style: none; margin: 0; padding: 6px 0; }
.log::before { content: ""; position: absolute; left: calc(var(--space-3) + 40px + 10px + 10px); top: 18px; bottom: 18px; width: 2px; background: var(--ink-150); }
.log__item { position: relative; display: grid; grid-template-columns: 40px 22px minmax(0, 1fr) auto; gap: 0 10px; align-items: start; padding: 8px var(--space-3); overflow: hidden; }
.log__item > .av { margin-top: 1px; }
.log__t { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; padding-top: 4px; }
.log__what { font-size: 13px; line-height: 1.4; color: var(--text-primary); }
.log__what b { font-weight: var(--weight-semibold); }
.log__sub { font-size: var(--text-xs); line-height: 1.4; color: var(--text-secondary); margin-top: 2px; }
.log__n { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-primary); padding-top: 2px; white-space: nowrap; text-align: right; }
.log__div { position: relative; padding: 12px var(--space-3) 2px calc(var(--space-3) + 40px + 10px + 32px); }
.log__div .label { font-size: 10px; color: var(--text-primary); }
.tag--auto { padding: 1px 6px; font-size: 10px; vertical-align: 1px; background: var(--aero-tint); border-color: var(--aero-blue); color: var(--aero-on); }
/* Sync now: a shimmer over the same rows (no layout change; the highlight moves on transform only) */
.ov-log.is-syncing .log__item > * { visibility: hidden; }
.ov-log.is-syncing .log__item::before, .ov-log.is-syncing .log__item::after { content: ""; position: absolute; top: 9px; bottom: 9px; left: var(--space-3); right: var(--space-3); background: var(--ink-100); }
.ov-log.is-syncing .log__item::after { right: auto; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent); transform: translateX(-100%); animation: shimmer 900ms var(--ease-standard) infinite; }
@keyframes shimmer { to { transform: translateX(260%); } }

/* Recommendation cards: agent, summary, the money, one button */
.rec { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px var(--space-3) 12px; background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  transition: transform var(--m-state) var(--ease-out), border-color var(--m-state) var(--ease-out); }
.rec::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; box-shadow: 0 8px 24px rgba(17, 17, 17, 0.09), 0 0 0 1px var(--ink-300); opacity: 0; transition: opacity var(--m-state) var(--ease-out); }
@media (hover: hover) {
  .rec.is-open:hover { transform: translateY(-2px); }
  .rec.is-open:hover::after { opacity: 1; }
}
.rec__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rec__agent { font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-primary); }
.rec__mod { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec__title { font-size: 16px; font-weight: var(--weight-semibold); letter-spacing: -0.01em; line-height: 1.3; }
.rec__why { font-size: 13px; line-height: 1.45; color: var(--text-secondary); max-width: 62ch; }
.rec__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 4px; }
.rec__money { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rec__amt { font-family: var(--font-mono); font-size: 22px; font-weight: var(--weight-medium); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.rec__ml { font-size: var(--text-xs); color: var(--text-secondary); }
.rec__act { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rec__deploy { min-width: 124px; }
.rec__left { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; flex: 1 1 260px; }
.rec__left > * { grid-area: 1 / 1; }
.rec__money { transition: opacity var(--m-state) var(--ease-out); }
.rec__run { display: flex; flex-direction: column; justify-content: center; gap: 8px; opacity: 0; pointer-events: none; transition: opacity var(--m-state) var(--ease-out); }
.rec.is-running .rec__run { opacity: 1; }
.rec.is-running .rec__money { opacity: 0; transition: opacity var(--m-leave) var(--ease-in); }
.prog { position: relative; width: min(100%, 260px); height: 3px; background: var(--ink-150); overflow: hidden; }
.prog i { position: absolute; inset: 0; background: var(--ink-900); transform-origin: left; transition: transform 220ms var(--ease-out); }
.rec__tick { min-width: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec.is-done { background: var(--bg-subtle); }
.rec.is-done .rec__amt { color: var(--status-success); }
.rec--empty { padding: var(--space-4) var(--space-3); }
.cu { display: inline-block; font-variant-numeric: tabular-nums; }

/* The crew: five agents, one job each, and the rule each one runs under */
.ov-crew { display: flex; flex-direction: column; gap: 10px; }
.crew { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--border-default); border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; }
.crew__card { display: flex; flex-direction: column; gap: 8px; padding: 14px var(--space-3); background: var(--bg-base); min-width: 0; }
.crew__top { display: flex; align-items: center; gap: 10px; }
.crew__name { font-size: 15px; font-weight: var(--weight-semibold); letter-spacing: -0.01em; line-height: 1.2; }
.crew__mod { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); margin-top: 2px; }
.crew__job { font-size: 13px; font-weight: var(--weight-medium); line-height: 1.4; }
.crew__how { flex: 1 1 auto; font-size: var(--text-xs); line-height: 1.5; color: var(--text-secondary); }
.crew__rule { display: flex; gap: 8px; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-secondary); }
.crew__rule .label { font-size: 10px; color: var(--text-tertiary); flex: none; }
.crew__rule.is-auto { color: var(--text-primary); }
.crew__rule.is-auto .label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; vertical-align: 1px; background: var(--aero-blue); }

/* ============================================================ v2: YOUR RULES */
.pf__line { padding: var(--space-3) var(--space-3) 6px; font-size: 20px; font-weight: var(--weight-medium); line-height: 1.55; letter-spacing: -0.01em; color: var(--text-secondary); }
.pf__name { color: var(--text-primary); font-weight: var(--weight-semibold); }
.pf__v { color: var(--text-primary); font-weight: var(--weight-semibold); padding: 0 2px; box-shadow: inset 0 -1px 0 var(--ink-300); transition: background-color var(--m-state) var(--ease-out), box-shadow var(--m-state) var(--ease-out); }
.pf__v.is-changed { background: var(--aero-tint); box-shadow: inset 0 -1px 0 var(--aero-blue); }
.pf__note { display: flex; align-items: center; gap: var(--space-3); padding: 6px var(--space-3) var(--space-3); font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-medium); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-primary); }
.pf__dash { flex: none; width: 44px; height: 2px; background: var(--ink-900); }
.rules { display: flex; flex-direction: column; }
.rule-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.rule-row:last-child { border-bottom: 0; }
.rule-row > .av { align-self: start; margin-top: 2px; }
.rule-row__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.6; }
.rule-row__who { display: block; font-family: var(--font-mono); font-size: 10px; font-weight: var(--weight-medium); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); line-height: 1.4; }
.rule-row__fx { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.rule-row.is-on .rule-row__fx { color: var(--text-primary); }
.stepper--inline { display: inline-flex; vertical-align: middle; height: 28px; margin: 0 2px; font-weight: var(--weight-regular); }
.stepper--inline button { width: 26px; }
.stepper--inline input { width: 60px; }
.switch { position: relative; flex: none; width: 36px; height: 20px; padding: 0; background: var(--ink-150); border: 1.5px solid var(--ink-300); border-radius: var(--radius-sm); cursor: pointer;
  transition: background-color var(--m-state) var(--ease-out), border-color var(--m-state) var(--ease-out); }
.switch__thumb { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; background: var(--bg-base); box-shadow: 0 0 0 1px var(--ink-300); transition: transform var(--m-state) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--aero-blue); border-color: var(--ink-900); }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(16px); background: var(--ink-900); box-shadow: none; }
.switch:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }

/* ============================================================ v2: MOTION
   Screen switch: cross-fade with an 8 px rise (View Transitions; old leaves 150 ms ease-in, new enters
   300 ms ease-out; composited snapshots). Rows: staggered 35 ms each, capped at 10, 280 ms ease-out. Groups
   with hairline gaps (.stats, .crew, .trace-links) enter as one block so the hairline grey never flashes. */
@media (prefers-reduced-motion: no-preference) {
  #view { view-transition-name: screen; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  ::view-transition-group(screen) { animation: none; }
  ::view-transition-old(screen) { animation: vt-out var(--m-leave) var(--ease-in) both; }
  ::view-transition-new(screen) { animation: vt-in var(--m-screen) var(--ease-out) both; }
  .is-entering .stats, .is-entering .rv, .is-entering tbody > tr:not(.msg-row), .is-entering .thr__row, .is-entering .rule-row,
  .is-entering .step, .is-entering .trace-links, .is-entering .crew, .is-entering .set > .set__col > .panel {
    animation: rv-in var(--m-enter) var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--m-stagger)); }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes rv-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .rec, .rec::after, .rec__run, .prog i, .switch, .switch__thumb, .pf__v, .intro__gl { transition: none; }
  .ov-log.is-syncing .log__item::after { animation: none; }
}

/* ============================================================ v2: RESPONSIVE */
@media (max-width: 1199px) {
  .ov { grid-template-columns: minmax(0, 1fr); }
  .crew { grid-template-columns: minmax(0, 1fr); }
  .crew__card { display: grid; grid-template-columns: 200px minmax(0, 1fr) 240px; gap: 4px var(--space-3); align-items: start; }
  .crew__top { grid-row: 1 / span 2; }
  .crew__job { grid-column: 2; }
  .crew__how { grid-column: 2; }
  .crew__rule { grid-column: 3; grid-row: 1 / span 2; border-top: 0; padding-top: 0; flex-direction: column; gap: 2px; }
}
@media (max-width: 960px) {
  .side__s { font-size: 10px; }
}
@media (max-width: 720px) {
  .ov-crew { order: 3; }
  .crew__card { display: flex; }
  .crew__rule { flex-direction: row; border-top: 1px solid var(--border-subtle); padding-top: 8px; }
  .log__item { grid-template-columns: 36px 22px minmax(0, 1fr) auto; gap: 0 8px; }
  .log::before { left: calc(var(--space-3) + 36px + 8px + 10px); }
  .log__div { padding-left: calc(var(--space-3) + 36px + 8px + 30px); }
  .rec__title { font-size: 15px; }
  .rec__foot { flex-direction: column; align-items: stretch; }
  .rec__act { justify-content: space-between; }
  .rec__act .btn { flex: 1 1 auto; }
  .rec__act .tag { flex: none; }
  .rec__left { flex: none; }
  .pf__line { font-size: 16px; }
  .pf__note { gap: 12px; letter-spacing: var(--tracking-label); }
  .pf__dash { width: 24px; }
  .rule-row { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; }
  .app .demo-strip__actions { gap: 12px; }
}

/* ============================================================ v2: DIGEST, OWNERS, HEALTH, FILES, REPORT
   (from Arfan's agentic-harness reference: counts first, a named owner and an age on every line, a client
   health score with its reason, a next step in one line, what the crew cannot see, files you can open) */
.ov-stats { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 2.6fr); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.ov-stats .stat__value small { white-space: nowrap; }
.ov-fee .hero-line { gap: 4px var(--space-3); }
.ov-fee .stat__note { max-width: 260px; }
.rec__meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--text-secondary); }
.rec__meta b { font-weight: var(--weight-semibold); color: var(--text-primary); }
.hl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: var(--text-xs); color: var(--text-secondary); }
.hl .label { font-size: 10px; }
.hl__n { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.hl__n small { font-size: 10px; font-weight: var(--weight-regular); color: var(--text-tertiary); }
.hl__why { min-width: 0; }
.rec__next { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; margin-top: 2px; background: var(--bg-subtle); border-left: 2px solid var(--border-strong); font-size: 13px; line-height: 1.4; color: var(--text-primary); }
.rec__next .label { font-size: 10px; color: var(--text-primary); flex: none; }
.log__meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.02em; color: var(--text-tertiary); margin-top: 3px; }
.log__item .hl { margin-top: 3px; }
.log__links { display: flex; gap: 14px; margin-top: 4px; }
.linkbtn.is-preview { color: var(--text-tertiary); text-decoration-style: dotted; cursor: not-allowed; }
.log__limit b { color: var(--text-primary); font-weight: var(--weight-semibold); }
.crew__kv { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.crew__kv div { display: flex; flex-direction: column; gap: 1px; }
.crew__kv dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); }
.crew__kv dd { margin: 0; font-size: var(--text-xs); line-height: 1.45; color: var(--text-primary); }
.crew__demo { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--text-tertiary); white-space: nowrap; }
.crew__link { align-self: flex-start; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.files { display: flex; flex-direction: column; }
.file { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.file:last-child { border-bottom: 0; }
.file__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-semibold); color: var(--text-primary); background: var(--bg-base); }
.file__name { font-family: var(--font-mono); font-size: 12px; font-weight: var(--weight-semibold); word-break: break-all; }
.file__what { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.file__readers { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.file__readers .label { font-size: 10px; margin-right: 4px; }
.dlg--file { width: min(640px, calc(100vw - 32px)); }
.dlg--file .dlg__title { font-size: 15px; word-break: break-all; }
.dlg--file .code { max-height: min(60vh, 520px); overflow: auto; border: 1px solid var(--border-subtle); }
.report-mast { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: 14px var(--space-3); border-bottom: 1.5px solid var(--border-strong); }
.report-mast__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.report-mast__brand img { width: 22px; height: 19px; flex: none; }
.report-mast__t { font-size: 15px; font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.report-mast__s { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
@media (max-width: 1199px) {
  .ov-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ov-stats .ov-fee { grid-column: 1 / -1; }
  .crew__kv { grid-column: 2; }
  .crew__link { grid-column: 2; }
}
@media (max-width: 720px) {
  .ov-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-stats .stat:nth-child(5) { grid-column: span 2; }
  .rec__next { flex-direction: column; gap: 2px; }
  .file { grid-template-columns: 32px minmax(0, 1fr); }
  .file__icon { width: 32px; height: 32px; font-size: 10px; }
  .file .btn { grid-column: 1 / -1; }
}

/* ============================================================ v3: ASK THE CREW, CREW AT WORK, YOUR CLIENTS
   Nine screens. Ask the crew is a section (not a floating chat): input, suggested questions, then the thread,
   newest first. Crew at work replays the overnight run (classes only: transform and opacity). Your clients is
   the site's table with three insight lines from the crew above it. Phones: the bottom bar scrolls sideways
   with the active screen centred (js centreNav). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The Overnight entry: one line that opens Ask the crew with the cursor in the box */
.askline { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px var(--space-3); background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); text-decoration: none;
  transition: border-color var(--m-state) var(--ease-out); }
.askline:hover { border-color: var(--border-strong); color: var(--text-primary); }
.askline:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }
.qa__crew { display: inline-flex; flex: none; }
.qa__crew .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg-base); }
.askline__l { flex: none; font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.askline__q { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); font-size: 13px; }
.askline__go { flex: none; text-decoration: underline; }

/* The ask bar */
.ask__form { display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-3) 10px; }
.ask__in { flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text-primary); background: var(--bg-base); border: 1.5px solid var(--border-default); border-radius: var(--radius-sm);
  transition: border-color var(--m-state) var(--ease-out); }
.ask__in::placeholder { color: var(--text-tertiary); }
.ask__in:hover { border-color: var(--ink-400); }
.ask__in:focus { outline: none; border-color: var(--border-strong); }
.app .ask__go { height: 40px; min-width: 88px; }
.ask-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 0 var(--space-3) var(--space-3); }
.ask-chips .label { font-size: 10px; margin-right: 2px; }
.ask-chip { height: 30px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--text-primary); background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  transition: border-color var(--m-state) var(--ease-out), background-color var(--m-state) var(--ease-out); }
.ask-chip:hover { border-color: var(--border-strong); background: var(--ink-050); }
.ask-chip:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }

/* The thread */
.ask__thread { display: flex; flex-direction: column; gap: 10px; }
.qa { background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; }
.qa__q { display: flex; align-items: center; gap: 10px; padding: 10px var(--space-3); background: var(--bg-subtle); border-bottom: 1px solid var(--border-subtle); font-size: 15px; font-weight: var(--weight-medium); }
.qa__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.qa__at { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.qa__a { display: flex; flex-direction: column; gap: 8px; padding: 12px var(--space-3) 14px; }
.qa__who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qa__p { font-size: 15px; line-height: 1.55; color: var(--text-primary); max-width: 68ch; }
.qa__p + .qa__p { color: var(--text-secondary); }
.qa__checking { display: flex; align-items: center; gap: 10px; min-height: 24px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: var(--text-secondary); }
.qa__dot { width: 6px; height: 6px; background: var(--aero-blue); flex: none; }
.qa__rows { max-width: 640px; border-top: 1px solid var(--border-subtle); }
.qa__rows .kv__row { padding: 7px 0; font-size: 13px; }
.qa__rows .kv__row span:first-child { min-width: 0; overflow-wrap: anywhere; }
.qa__rows .kv__row span:last-child { flex: none; text-align: right; font-size: 12px; max-width: 55%; }
.qa__act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.qa__what { font-size: 13px; color: var(--text-secondary); min-width: 0; }
.qa__what b { font-family: var(--font-mono); font-weight: var(--weight-semibold); color: var(--text-primary); }
.qa__deploy { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.qa__deploy .btn { min-width: 96px; }
.qa__deploy .rec__left { flex: 1 1 240px; }
.qa__deploy .qa__what { transition: opacity var(--m-state) var(--ease-out); }
.qa__deploy .rec__run { opacity: 0; }
.qa__deploy.is-running .rec__run { opacity: 1; }
.qa__deploy.is-running .qa__what { opacity: 0; }
.qa__chips { padding: 6px 0 0; border-top: 1px solid var(--border-subtle); margin-top: 4px; padding-top: 10px; }
.ask-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: var(--space-4) var(--space-3); }
.ask-empty .qa__crew { margin-bottom: 4px; }
.ask-empty__t { font-size: 16px; font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.ask-empty__s { font-size: 13px; color: var(--text-secondary); max-width: 60ch; }

/* Crew at work */
.cw-bar__r { display: inline-flex; align-items: center; gap: 12px; }
.cw-clock { font-variant-numeric: tabular-nums; min-width: 72px; justify-content: center; }
.cw-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border-top: 1px solid var(--border-subtle); }
.cw-flow__s { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px var(--space-4); background: var(--bg-base); }
.cw-flow__s + .cw-flow__s::before { content: "\2192"; position: absolute; left: -8px; top: 50%; width: 15px; margin-top: -9px; text-align: center; font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: var(--ink-400); background: var(--bg-base); }
.cw-flow__s .label { font-size: 10px; }
.cw-flow__n { font-family: var(--font-mono); font-size: 26px; font-weight: var(--weight-medium); letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink-300); transition: color var(--m-state) var(--ease-out); }
.cw-flow__s.is-on .cw-flow__n { color: var(--text-primary); }
.cw-flow__sub { font-size: var(--text-xs); color: var(--text-secondary); }
.cw-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--border-default); border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; }
.cw-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px var(--space-3); background: var(--bg-base); }
.cw-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--aero-blue); transform: scaleX(0); transform-origin: left; transition: transform var(--m-enter) var(--ease-out); }
.cw-card.is-working::before { transform: scaleX(1); }
.cw-status { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 2px 8px; align-items: center; min-height: 40px; padding: 8px 10px; background: var(--bg-subtle); font-size: 13px; }
.cw-dot { width: 8px; height: 8px; background: var(--ink-300); }
.cw-status__t { font-weight: var(--weight-semibold); }
.cw-status__s { grid-column: 2; font-size: var(--text-xs); color: var(--text-secondary); min-height: 0; }
.cw-status__s:empty { display: none; }
.cw-status.is-queued { color: var(--text-secondary); }
.cw-status.is-queued .cw-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-300); }
.cw-status.is-work .cw-dot { background: var(--aero-blue); }
.cw-status.is-done .cw-dot { background: var(--status-success); }
.cw-status.is-watch .cw-dot { background: var(--ink-900); }
.cw-stream { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cw-step { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 12.5px; line-height: 1.4; opacity: 0; transform: translateY(4px);
  transition: opacity var(--m-enter) var(--ease-out), transform var(--m-enter) var(--ease-out); }
.cw-step.is-on { opacity: 1; transform: none; }
.cw-step.is-pre { color: var(--text-secondary); }
.cw-step:not(.is-pre) .cw-step__t { font-weight: var(--weight-medium); color: var(--text-primary); }
.cw-step__m { position: relative; width: 14px; height: 14px; margin-top: 1px; border: 1px solid var(--ink-300); background: var(--bg-base); }
.cw-step__m svg { position: absolute; inset: 1px; width: 10px; height: 10px; opacity: 0; transition: opacity var(--m-state) var(--ease-out); }
.cw-step.is-done .cw-step__m { border-color: var(--ink-900); }
.cw-step.is-done .cw-step__m svg { opacity: 1; }
.cw-step.is-pre.is-on:not(.is-done) .cw-step__m { border-color: var(--ink-900); background: var(--aero-tint); }
.cw-step.is-pre.is-on:not(.is-done) .cw-step__m::after { content: ""; position: absolute; inset: 3px; background: var(--aero-blue); }
.cw-step__n { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; padding-top: 1px; }
.cw-step .tag--auto { margin-left: 2px; }
.cw-tick { margin-top: auto; min-height: 36px; padding-top: 8px; border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); line-height: 1.45; color: var(--text-secondary); opacity: 0; transition: opacity var(--m-enter) var(--ease-out); }
.cw-tick b { color: var(--text-primary); font-weight: var(--weight-semibold); }
.cw-tick.is-on { opacity: 1; }
.cw-note { font-size: var(--text-xs); color: var(--text-secondary); padding: 0 2px; max-width: 80ch; }
@media (prefers-reduced-motion: no-preference) {
  .cw-status.is-work .cw-dot, .cw-step.is-pre.is-on:not(.is-done) .cw-step__m::after, .qa__dot { animation: cw-pulse 1100ms var(--ease-standard) infinite alternate; }
  .qa.is-new { animation: rv-in var(--m-enter) var(--ease-out) both; }
}
@keyframes cw-pulse { from { opacity: 1; } to { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .cw-step, .cw-step__m svg, .cw-tick, .cw-card::before, .cw-flow__n, .askline, .ask-chip, .ask__in, .qa__deploy .qa__what { transition: none; }
}

/* Your clients */
.ins__list { list-style: none; margin: 0; padding: 0; }
.ins__item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.ins__item:last-child { border-bottom: 0; }
.ins__item p { font-size: 15px; line-height: 1.5; color: var(--text-primary); max-width: 90ch; }
.ins__item b { font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-label); text-transform: uppercase; margin-right: 6px; }
.cl-table td small { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }
.cl-table td.num { white-space: nowrap; }
.cl-table td:first-child { min-width: 190px; }
.cl-health { min-width: 180px; }
.hl__n.t-err-text { color: var(--status-error); }   /* .hl__n's own colour came later in the file and won */
.cl-health .hl__n { display: block; }
.cl-health .sub { display: block; font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.35; margin-top: 2px; }
.panel__legend a { color: inherit; }

@media (max-width: 1199px) {
  .cw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cw-grid .cw-card:nth-child(4) { grid-column: span 1; }
}
@media (max-width: 960px) {
  .side__list { position: relative; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .side__list::-webkit-scrollbar { display: none; }
  .side__list li { flex: 1 0 auto; min-width: 76px; scroll-snap-align: center; }
  .side__link { padding: 0 6px; }
}
@media (max-width: 690px) {
  .side__list { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); }
}
@media (max-width: 720px) {
  .askline__q { display: none; }
  .askline__l { flex: 1 1 auto; }
  .ask__form { padding: 12px var(--space-3) 8px; }
  .ask__note { display: none; }
  .ask .ask-chips .ask-chip:nth-of-type(n+5) { display: none; }  /* phones: four suggestions, wrapped (no sideways scroll) */
  .ask-chip { height: 32px; }
  .qa__p { font-size: 14px; }
  .qa__deploy .btn { flex: 1 1 auto; }
  .cw-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cw-flow__s { padding: 10px var(--space-3); }
  .cw-flow__s:nth-child(3)::before { display: none; }
  .cw-flow__n { font-size: 22px; }
  .cw-grid { grid-template-columns: minmax(0, 1fr); }
  .cw-tick { min-height: 0; }
  .cw-tick:empty { display: none; }
  .ins__item p { font-size: 14px; }
  .cl-health { min-width: 0; }
  .cl-table td:first-child { min-width: 0; }
  .cl-table td small { font-size: 10px; }
}

/* Rules: usage this billing month (design-system meters: a 4 px ink bar on ink-150, a hairline tick for the day of the month) */
.use__rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px var(--space-4); padding: 14px var(--space-3) 12px; }
.use__row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.use__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.use__l { font-size: 13px; font-weight: var(--weight-semibold); min-width: 0; }
.use__n { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.use__n b { font-weight: var(--weight-semibold); color: var(--text-primary); }
.use__bar { position: relative; display: block; height: 4px; background: var(--ink-150); }
.use__bar i { position: absolute; inset: 0; background: var(--ink-900); transform-origin: left; }
.use__bar s { position: absolute; top: -3px; bottom: -3px; width: 1px; margin-left: -0.5px; background: var(--ink-500); text-decoration: none; }
.use__sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.02em; color: var(--text-tertiary); }
.use__pace { display: flex; gap: 10px; align-items: flex-start; padding: 10px var(--space-3); border-top: 1px solid var(--border-subtle); font-size: 13px; line-height: 1.45; }
.use__pace b { font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-label); text-transform: uppercase; margin-right: 6px; }
@media (max-width: 720px) { .use__rows { grid-template-columns: minmax(0, 1fr); } }
/* Your clients between phone and wide desktop: nine columns must fit without a sideways scroll */
@media (min-width: 721px) and (max-width: 1359px) {
  .cl-table td:first-child, .cl-health { min-width: 0; }
  .app .cl-table th, .app .cl-table td { padding-left: 8px; padding-right: 8px; }
  .cl-table th { white-space: normal; }
  .cl-table td small { display: none; }
}
