/* reStoq AI: one stylesheet for every page.
   Direction (redesign of 26 Nov 2026): Mercury's calm with Shopify admin's structure. Cards with a hairline edge
   on a quiet canvas, Host Grotesk for words and figures, Geist Mono for codes, tabular figures everywhere.
   Ink-black main actions, one green accent (focus ring, the answer of a why). Colour is used only when it means
   something (ok, warn, bad, info) and always carries words. No gradients, glass or glow.
   Tokens and contrast ratios are worked out in the design notes. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --font: "Host Grotesk", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #F1F1EF;          /* canvas behind the cards and the menu */
  --surface: #FFFFFF;     /* cards, inputs, dialogs */
  --raised: #F7F7F5;      /* table heads, row hover, an open why */
  --sunk: #E8E8E5;        /* the chosen tab, menu hover, quiet fills */
  --ink: #1A1A1A;
  --ink-2: #5C5C59;
  --ink-3: #686865;
  --rule: #EAEAEA;        /* hairlines between rows */
  --rule-ink: #D3D3D0;    /* the edge of a secondary button, the line over a total */
  --line: #878784;        /* borders of inputs, selects, tick boxes: 3:1 or better on card and canvas */
  --card-line: rgba(26, 26, 26, .1);   /* the 1px edge of a card */
  --mark: #D4E4DF;        /* the step you are on */
  --mark-ink: #1A1A1A;
  --mark-soft: #ECF3F1;   /* ticked rows */
  --accent: #0F6B4E;      /* the answer of a why, focus ring, chart line */
  --focus: #0F6B4E;

  --ok: #0C5132;   --ok-bg: #D9F2E4;
  --warn: #6B4100; --warn-bg: #FFEBBF;
  --bad: #8E1F0B;  --bad-bg: #FDDDD6;
  --info: #00527C; --info-bg: #DCEEFB;
  --muted: #5C5C59; --muted-bg: #E8E8E5;

  --shadow-card: 0 1px 2px rgba(26, 26, 26, .05);
  --btn: #1A1A1A;         /* the main button (the mock-up's --btn and --btn-ink) */
  --btn-ink: #FFFFFF;
  --btn-edge: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .5);
  --btn-lift: 0 1px 0 rgba(26, 26, 26, .05);   /* under a secondary button */
  /* the frame (redesign phase 2): the top bar is dark in both themes */
  --bar: #1A1A1A; --bar-ink: #E8E8E5; --bar-ink-2: #A9A9A5; --bar-field: #2C2C2B; --bar-line: rgba(255, 255, 255, .1);
  --hair: rgba(26, 26, 26, .09); --hair-2: rgba(26, 26, 26, .2);   /* the mock-up's --line and --line-2 */
  --nav-here: #FFFFFF;    /* the current page in the menu: a white tile (a lifted grey one in dark) */
  --shadow-tile: 0 1px 0 rgba(26, 26, 26, .04), 0 1px 2px rgba(26, 26, 26, .05);
  --by-mark: #0F6B4E;     /* the bar in the small square of the made-by line */
  --bad-see: #FDDDD6;     /* the red count in the menu: the mock-up's see-through tint on the canvas in dark */
  --shadow-pop: 0 0 0 1px rgba(26, 26, 26, .07), 0 16px 36px -10px rgba(26, 26, 26, .28);

  --t-xs: 12px; --t-sm: 13px; --t-base: 14px; --t-md: 16px; --t-lg: 26px; --t-xl: 30px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r: 8px;
  --r-card: 12px;
  --rail-w: 240px;
  --bar-h: 56px;
  --gutter: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E0F; --surface: #171718; --raised: #1D1D1F; --sunk: #222224;
    --ink: #EDEDEB; --ink-2: #A9A9A5; --ink-3: #8F8F8B;
    --rule: #2A2A2A; --rule-ink: #3A3A3B; --line: #6C6C69; --card-line: rgba(255, 255, 255, .08);
    --mark: #263F35; --mark-ink: #EDEDEB; --mark-soft: #1E2925; --accent: #5CCB9C; --focus: #5CCB9C;
    --ok: #7EDCAE;   --ok-bg: #21302A;
    --warn: #F0C36A; --warn-bg: #352F23;
    --bad: #FF9A8B;  --bad-bg: #3A2624;
    --info: #8CC8F2; --info-bg: #273037;
    --muted: #A9A9A5; --muted-bg: #222224;
    --shadow-card: none;
    --btn: #EDEDEB; --btn-ink: #121212;
    --btn-lift: inset 0 0 0 1px rgba(255, 255, 255, .2);   /* the secondary button's edge (the designer's) */
    --btn-edge: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .18);
    --shadow-pop: 0 0 0 1px rgba(255, 255, 255, .1), 0 18px 40px -10px rgba(0, 0, 0, .8);
    --bar: #0A0A0B; --bar-field: #1D1D1F;
    --hair: rgba(255, 255, 255, .08); --hair-2: rgba(255, 255, 255, .2);
    --nav-here: #222224; --shadow-tile: none; --bad-see: rgba(255, 122, 105, .15);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0E0E0F; --surface: #171718; --raised: #1D1D1F; --sunk: #222224;
    --ink: #EDEDEB; --ink-2: #A9A9A5; --ink-3: #8F8F8B;
    --rule: #2A2A2A; --rule-ink: #3A3A3B; --line: #6C6C69; --card-line: rgba(255, 255, 255, .08);
    --mark: #263F35; --mark-ink: #EDEDEB; --mark-soft: #1E2925; --accent: #5CCB9C; --focus: #5CCB9C;
    --ok: #7EDCAE;   --ok-bg: #21302A;
    --warn: #F0C36A; --warn-bg: #352F23;
    --bad: #FF9A8B;  --bad-bg: #3A2624;
    --info: #8CC8F2; --info-bg: #273037;
    --muted: #A9A9A5; --muted-bg: #222224;
    --shadow-card: none;
    --btn: #EDEDEB; --btn-ink: #121212;
    --btn-lift: inset 0 0 0 1px rgba(255, 255, 255, .2);   /* the secondary button's edge (the designer's) */
    --btn-edge: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .18);
    --shadow-pop: 0 0 0 1px rgba(255, 255, 255, .1), 0 18px 40px -10px rgba(0, 0, 0, .8);
    --bar: #0A0A0B; --bar-field: #1D1D1F;
    --hair: rgba(255, 255, 255, .08); --hair-2: rgba(255, 255, 255, .2);
    --nav-here: #222224; --shadow-tile: none; --bad-see: rgba(255, 122, 105, .15);
    color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-base)/1.45 var(--font);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--mark); color: var(--mark-ink); }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
svg { overflow: visible; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, .code, kbd, samp { font-family: var(--mono); }
code, .code { font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s5) 0; }
[hidden] { display: none !important; }

.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s3); top: -48px; z-index: 50; background: var(--ink); color: var(--bg); padding: var(--s2) var(--s3); text-decoration: none; }
.skip:focus { top: var(--s3); }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.unk { color: var(--ink-3); font-style: italic; }
.n { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.unit { color: var(--ink-2); font-size: .82em; margin-left: 3px; font-weight: 400; }
.small { font-size: var(--t-xs); }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; }

/* ---------- shell ----------
   The signed-in frame (redesign phase 2), from the approved mock-up's app.css ("top bar", "popovers", "sidebar"):
   a top bar that is dark in both themes, the menu on the canvas at the left, the page area beside it. Every menu,
   list and group is a details element, so all of it opens without app.js. */
/* the product's own mark (also on the signed-out frame) */
.brandmark { display: flex; align-items: flex-start; gap: 10px; padding: 2px 8px 0; text-decoration: none; }
.brandmark-sq { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.brandmark-sq .sq-o { fill: var(--ink); }
.brandmark-sq .sq-i { fill: var(--accent); }
.brandmark-name { display: block; font-size: var(--t-base); font-weight: 600; line-height: 1.3; letter-spacing: -.005em; color: var(--ink); }
.brandmark-prod { display: block; font-size: var(--t-xs); color: var(--ink-3); line-height: 1.4; }

.side-toggle { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--bar-h);
  display: grid; grid-template-columns: calc(var(--rail-w) - 12px) minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 0 16px 0 12px;
  background: var(--bar); color: var(--bar-ink);
  border-bottom: 1px solid var(--bar-line);
  font-size: 14px; line-height: 1.45;
}
.topbar .ico, .side .ico { width: 20px; height: 20px; }
.topbar .ico.s, .side .ico.s, .pop .ico.s { width: 16px; height: 16px; }
.topbar summary { list-style: none; cursor: pointer; }
.topbar summary::-webkit-details-marker, .side summary::-webkit-details-marker { display: none; }
.bar-brand { display: flex; align-items: center; gap: 4px; min-width: 0; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: var(--r);
  border: 0; padding: 0; background: none; color: var(--bar-ink-2); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--bar-field); color: var(--bar-ink); }
.topbar .bar-menu, .topbar .search-link { display: none; }
/* the agency's logo (or its name set in type), then the brand's name */
.topbar .agencymark { display: flex; flex: none; align-items: center; padding: 0; max-width: 180px; text-decoration: none; color: var(--bar-ink); border-radius: 9px; }
.topbar .agencymark-logo { width: 34px; height: 34px; max-width: none; border-radius: 9px; object-fit: contain; background: #000; }
.topbar .agencymark-name { padding: 0 6px; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--bar-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .agencymark:hover .agencymark-name { color: #FFFFFF; }
.brand-switch { min-width: 0; }
.switch {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  height: 36px; padding: 0 8px 0 10px; border-radius: var(--r);
  font-weight: 550; font-size: 14px; color: var(--bar-ink);
  transition: background-color .15s;
}
.switch:hover, .brand-switch[open] > .switch { background: var(--bar-field); }
.switch.is-plain:hover { background: none; }
.switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch .ico { color: var(--bar-ink-2); }
/* no agency: the product's own mark and the brand's name */
.bar-brand > .brandmark { align-items: center; min-width: 0; height: 36px; padding: 0 10px 0 6px; border-radius: var(--r); color: var(--bar-ink); }
.bar-brand > .brandmark:hover { background: var(--bar-field); }
.bar-brand > .brandmark > span { min-width: 0; }
.bar-brand > .brandmark .brandmark-sq { width: 24px; height: 24px; margin: 0; }
.bar-brand > .brandmark .brandmark-sq .sq-o { fill: var(--bar-ink); }
.bar-brand > .brandmark .brandmark-sq .sq-i { fill: var(--by-mark); }
.bar-brand > .brandmark .brandmark-name { font-size: 14px; font-weight: 550; line-height: 1.2; color: var(--bar-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-brand > .brandmark .brandmark-prod { font-size: 11.5px; line-height: 1.3; color: var(--bar-ink-2); }

/* the search box: a plain GET form to Products (its q filter) */
.search {
  justify-self: center; width: min(100%, 460px);
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 8px 0 12px; border-radius: 9px;
  background: var(--bar-field); color: var(--bar-ink-2);
  box-shadow: inset 0 0 0 1px var(--bar-line);
  font-size: 13.5px; text-align: left;
  transition: box-shadow .15s, color .15s;
}
.search:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); color: var(--bar-ink); }
.search:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); color: var(--bar-ink); }
.search input {
  flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; outline: 0; background: none;
  font: inherit; color: var(--bar-ink); -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--bar-ink-2); opacity: 1; }
.search input::-webkit-search-cancel-button { filter: invert(1) brightness(.8); }
.search kbd {
  font: 500 11px/1 var(--font); padding: 4px 6px; border: 0; border-radius: 5px;
  background: rgba(255, 255, 255, .08); color: var(--bar-ink-2);
}

.bar-right { display: flex; align-items: center; gap: 6px; }
/* the data status: one pill that opens the list of what was read and when */
.pill {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; color: var(--bar-ink); white-space: nowrap;
  transition: background-color .15s;
}
.pill:hover, .data-status[open] > .pill { background: var(--bar-field); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot-ok { color: #4CC38A; } .dot-warn { color: #E9B44C; } .dot-bad { color: #F0705C; } .dot-muted { color: var(--bar-ink-2); }
/* the theme switch: drawn hidden, shown by app.js; it shows the theme you are in (the sun in light, the moon in dark) */
.theme-btn .t-moon { display: none; }
:root[data-theme="dark"] .theme-btn .t-moon { display: block; }
:root[data-theme="dark"] .theme-btn .t-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .t-moon { display: block; }
  :root:not([data-theme="light"]) .theme-btn .t-sun { display: none; }
}
/* the person's menu: a round button with their initials */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-left: 4px;
  background: #D8F2E3; color: #0C5132; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; line-height: 1.45;
}
.me[open] > .avatar { box-shadow: 0 0 0 2px var(--bar), 0 0 0 4px var(--bar-ink-2); }

/* popovers (the brand list, the data list, the person's menu) */
.pop-anchor { position: relative; min-width: 0; }
.pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 264px; max-width: calc(100vw - 16px);
  background: var(--surface); color: var(--ink); border-radius: var(--r-card); box-shadow: var(--shadow-pop);
  padding: 6px; font-size: 14px; line-height: 1.45; white-space: normal; text-align: left;
}
.pop-left { left: 0; right: auto; }
.pop-title { font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 8px 10px 6px; }
.pop-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: none; font-size: 13.5px; text-align: left; color: var(--ink); text-decoration: none; cursor: pointer;
}
a.pop-row:hover, button.pop-row:hover { background: var(--raised); }
.pop-row small { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.pop .ico { color: var(--ink-3); }
.pop hr { border: 0; border-top: 1px solid var(--hair); margin: 6px 0; }
.pop-note { padding: 6px 10px 8px; font-size: 12.5px; color: var(--ink-3); }
.pop-note kbd { font-size: 11px; }
.pop-form { margin: 0; }
.pop-who { display: grid; gap: 1px; padding: 8px 10px; }
.pop-who b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.pop-who small { font-size: 12.5px; color: var(--ink-3); }
.pop .brandmark { align-items: center; padding: 8px 10px; border-radius: 7px; }
.pop .brandmark:hover { background: var(--raised); }
.pop .brandmark-sq { width: 22px; height: 22px; margin: 0; }
.pop .brandmark-name { font-size: 13.5px; font-weight: 550; }
.pop .pop-check { margin-left: auto; color: var(--accent); }
.data-status .pop { width: 340px; }
.fresh { display: grid; }
.fresh-item { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; font-size: 13.5px; }
.fresh-item b { font-weight: 500; color: var(--ink); white-space: nowrap; }
.fresh-item > span { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--ink-3); }
.fresh-item .sq { align-self: center; }
.sq { display: inline-block; width: 7px; height: 7px; flex: none; background: var(--ink-3); border-radius: 50%; }
.tone-ok .sq, .sq.tone-ok { background: var(--ok); }
.tone-warn .sq, .sq.tone-warn { background: var(--warn); }
.tone-bad .sq, .sq.tone-bad { background: var(--bad); }
.tone-info .sq, .sq.tone-info { background: var(--info); }
.tone-muted .sq, .sq.tone-muted { background: var(--ink-3); }
.fresh-item.tone-warn > span { color: var(--warn); font-weight: 500; }
.fresh-item.tone-bad > span { color: var(--bad); font-weight: 500; }

/* layout: the menu column and the page area */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.side {
  position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); height: calc(100dvh - var(--bar-h));
  display: flex; flex-direction: column; padding: 14px 12px 12px; overflow-y: auto;
  font-size: 14px; line-height: 1.45;
}
.side-scrim { display: none; }
.side > .nav { flex: 1 0 auto; display: flex; flex-direction: column; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 8px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--ink-2); text-align: left; text-decoration: none;
  transition: background-color .12s, color .12s;
}
.nav a > span:not(.nav-count), .nav-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover, .nav-item:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--nav-here); color: var(--ink); box-shadow: var(--shadow-tile); font-weight: 600; }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.nav-count.is-bad { color: var(--bad); background: var(--bad-see); padding: 1px 7px; border-radius: 7px; font-weight: 600; }
summary.nav-item { list-style: none; cursor: pointer; user-select: none; }
.nav-item .chev { margin-left: auto; color: var(--ink-3); transition: transform .2s var(--ease); }
.nav-group[open] > .nav-item .chev { transform: rotate(90deg); }
.nav-sub { position: relative; }
.nav-sub::before { content: ""; position: absolute; left: 17.5px; top: 4px; bottom: 6px; width: 1px; background: var(--hair-2); opacity: .7; }
.nav-sub li:last-child { padding-bottom: 4px; }
.nav .nav-sub a { height: 31px; padding-left: 38px; font-weight: 450; }
.nav .nav-sub a[aria-current="page"] { font-weight: 600; }
.nav-gap { height: 14px; }
.side-foot { margin-top: auto; padding-top: 12px; }
.by { display: flex; align-items: center; gap: 8px; padding: 12px 8px 2px; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.by i { width: 14px; height: 14px; border-radius: 4px; background: var(--ink); position: relative; flex: none; }
.by i::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 3px; height: 3px; background: var(--by-mark); border-radius: 1px; }

.page-area { min-width: 0; padding: 26px 32px 72px; }
/* the content column: the page's parts stacked 16px apart (the mock-up's .wrap.stack) */
.page-area > main { width: auto; max-width: 1120px; margin: 0 auto; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.page-area > #main > * { margin-top: 0; margin-bottom: 0; }
.page-area > #main > .page-head { margin-bottom: 4px; }
/* a jump to a row or a section lands below the top bar; a table's head sticks under it */
html:has(> body > .topbar) { scroll-padding-top: var(--bar-h); }
.page-area .tbl > thead > tr > th { top: var(--bar-h); }
.page-area :is(.bf-wrap, .trk-form .tbl-wrap, .fv-card .tbl-wrap, .ads-block .tbl-wrap) .tbl > thead > tr > th { top: 0; }

main { padding: var(--s5) var(--gutter) var(--s8); width: 100%; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head > div { min-width: 0; max-width: 100%; }
.page-head h1 { font-size: var(--t-lg); line-height: 1.15; font-weight: 500; letter-spacing: -.025em; }
.page-head .lede { margin-top: 6px; color: var(--ink-2); max-width: 76ch; font-size: 13.5px; }
.page-head .code { font-size: var(--t-sm); color: var(--ink-2); }
.head-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
/* the page head in the frame: the title, one line under it, the actions on the right */
.page-area .page-head { gap: 16px; flex-wrap: nowrap; }
.page-area .page-head .sub {
  position: relative; margin-top: 5px; max-width: none; color: var(--ink-2); font-size: 13.5px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
}
.page-area .head-actions { flex: none; }
.page-area .page-head .sub:has(> .is-cut) { flex-wrap: nowrap; }
.lede-text.is-cut { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* a lede longer than one line: behind a small "?" that opens in place */
.lede-more > summary {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; list-style: none; cursor: pointer;
  font-size: 12px; font-weight: 600; line-height: 1; color: var(--ink-2); background: var(--sunk);
}
.lede-more > summary::-webkit-details-marker { display: none; }
.lede-more > summary:hover, .lede-more[open] > summary { background: var(--ink); color: var(--surface); }
.lede-more-in {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; width: min(560px, calc(100vw - 32px));
  padding: 12px 14px; border-radius: var(--r-card); background: var(--surface); color: var(--ink-2);
  box-shadow: var(--shadow-pop); font-size: 13.5px;
}

/* signed-out layout (login, first set-up) */
.bare { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.bare { --bare-w: 960px; }
.bare-top { padding: var(--s4) max(var(--gutter), calc((100% - var(--bare-w)) / 2)); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--rule); }
.bare main { max-width: calc(var(--bare-w) + 2 * var(--gutter)); margin: 0 auto; padding-top: clamp(var(--s6), 10vh, 120px); }
.bare-top { background: var(--bg); }
/* a sign-in or set-up form on the signed-out frame sits in a card */
.bare main > .form, .bare main > .split > .form {
  max-width: 460px; padding: var(--s5); background: var(--surface); border: 1px solid var(--card-line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
.bare main > .form .btn-primary { height: 38px; padding: 0 18px; }
.split.login { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: var(--s8); }
.login > .prose { border-left: 1px solid var(--rule); padding-left: var(--s6); padding-top: 2px; }

/* ---------- sections ----------
   A section is a card: white on the canvas, a 1px edge, 12px corners. Tables, to-do rows and steps inside it run
   edge to edge; everything else keeps 18px from the edge. A section inside a section (a provider's own facts)
   is not a second card, nor is a list of cards (founder view, the provider gallery). */
.sec {
  margin-top: var(--s4); min-width: 0;
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.sec:first-child { margin-top: 0; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px var(--s4); flex-wrap: wrap;
  border-top: 0; padding: 14px 18px 0; margin-bottom: var(--s3);
}
/* polish (REVIEW rule 5): the card head is 48px tall, padding 14 16 0 18, its parts centred */
.sec-head { min-height: 48px; padding: 14px 16px 0 18px; align-items: center; gap: 12px; }
/* the 48px head already holds the title's room below it: a table, to-do rows or steps start right under it */
.sec-head:has(+ .sec-body > :first-child:is(.tbl-wrap, .todo, .steps)) { margin-bottom: 0; }
.sec-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; line-height: 1.45; }
.sec-aside { font-size: var(--t-sm); color: var(--ink-2); display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; min-width: 0; }
.sec-body > * + * { margin-top: var(--s3); }
.sec-body > :where(:not(.tbl-wrap, .todo, .steps)) { margin-left: 18px; margin-right: 18px; }
.sec-body > :where(:last-child:not(.tbl-wrap, .todo, .steps)) { margin-bottom: 16px; }.sec-body > .tbl-wrap:last-child .tbl > tbody:last-child > tr:last-child > td:first-child { border-bottom-left-radius: calc(var(--r-card) - 1px); }
.sec-body > .tbl-wrap:last-child .tbl > tbody:last-child > tr:last-child > td:last-child { border-bottom-right-radius: calc(var(--r-card) - 1px); }
.sec .sec, .sec .stats, .sec .tbl-wrap, .sec .todo, .sec .steps, .sec .empty {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.sec .sec { margin-top: var(--s4); }
.sec .sec > .sec-head { padding: 0; min-height: 0; }
.sec .sec .sec-body > *, .sec .split .sec-body > * { margin-left: 0; margin-right: 0; }
.prose { max-width: 72ch; color: var(--ink-2); }
.prose p + p { margin-top: var(--s2); }

/* two columns where a page needs a side note; drops to one column below 1100px */
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.split > * { min-width: 0; }
.split > .sec { margin-top: 0; }

/* ---------- stats ---------- */
/* the strip of headline figures is one card cut into parts */
.stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-bottom: var(--s4);
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
.stat { padding: 16px 18px 15px; border-left: 0; min-width: 0; position: relative; }
.stat:first-child { border-left: 0; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--rule); }
.stat-label { font-size: var(--t-sm); color: var(--ink-2); font-weight: 500; }
.stat-value { font-size: var(--t-xl); line-height: 1.15; font-weight: 500; letter-spacing: -.03em; margin-top: 4px; white-space: nowrap; overflow-wrap: anywhere; }
/* polish (REVIEW rules 1, 2, 4): the unit after a figure is 14px / 450; "not known" is upright, 26px / 400 in ink-3;
   the foot is 13px in ink-2 on a 22px line. Label, figure and foot are 3px apart, as in the mock-up's figure. */
.stat-value .unit { font-size: var(--t-base); font-weight: 450; letter-spacing: 0; margin-left: 5px; }
.stat-value .unk { font-size: var(--t-lg); font-style: normal; font-weight: 400; letter-spacing: -.02em; color: var(--ink-3); }
.stat-note { font-size: var(--t-sm); color: var(--ink-2); margin-top: 3px; overflow-wrap: anywhere; min-height: 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.stat-value { margin-top: 3px; }
.stat-note.tone-ok { color: var(--ok); } .stat-note.tone-warn { color: var(--warn); } .stat-note.tone-bad { color: var(--bad); } .stat-note.tone-info { color: var(--info); }
.stat .why { margin-top: 6px; }

/* ---------- badges and status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 8px; border-radius: 7px;
  font-size: var(--t-xs); font-weight: 550; line-height: 22px; white-space: nowrap;
  color: var(--muted); background: var(--muted-bg);
}
.badge.tone-ok { color: var(--ok); background: var(--ok-bg); }
.badge.tone-warn { color: var(--warn); background: var(--warn-bg); }
.badge.tone-bad { color: var(--bad); background: var(--bad-bg); }
.badge.tone-info { color: var(--info); background: var(--info-bg); }
/* a status is a tone badge with a dot; the words stay. Muted stays plain words. */
.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.st.tone-ok { color: var(--ok); } .st.tone-warn { color: var(--warn); } .st.tone-bad { color: var(--bad); } .st.tone-info { color: var(--info); } .st.tone-muted { color: var(--ink-2); }
.st.tone-bad, .st.tone-warn { font-weight: 500; }
/* polish (REVIEW rule 11): a status tag is 22px tall, padding 0 8, its dot 5px from the words. The words keep the
   mock-up's 17.4px leading (12px x 1.45) and the 22px comes from the tag's own height, so a tag that wraps in a
   narrow cell stays tight */
.st.tone-ok, .st.tone-warn, .st.tone-bad, .st.tone-info { padding: 0 8px; border-radius: 7px; font-weight: 550; font-size: var(--t-xs); line-height: 1.45; min-height: 22px; gap: 5px; }
.st.tone-ok { background: var(--ok-bg); } .st.tone-warn { background: var(--warn-bg); } .st.tone-bad { background: var(--bad-bg); } .st.tone-info { background: var(--info-bg); }
.st .sq { width: 6px; height: 6px; border-radius: 50%; }
/* a long status wraps inside its cell or tile instead of running into the next one */
.tbl .st, .dl .st, .cx-state .st { white-space: normal; max-width: 100%; }
.tbl .st > .sq, .dl .st > .sq, .cx-state .st > .sq { align-self: flex-start; margin-top: 7px; }
/* polish (rule 11): on a tag's 22px line the dot is centred at 8px */
:is(.tbl, .dl) .st:is(.tone-ok, .tone-warn, .tone-bad, .tone-info) > .sq { margin-top: 8px; }   /* (Connections' tiles set their own) */

/* ---------- tables ----------
   Selectors go through > so tables nested inside a cell (the why arithmetic) keep their own look. */
/* a table on its own is a card; inside a section it runs edge to edge. Heads wrap rather than widen the page. */
.tbl-wrap { width: 100%; max-width: 100%; min-width: 0; }
main > .tbl-wrap, main > form > .tbl-wrap, main > div > .tbl-wrap {
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
main > * + .tbl-wrap { margin-top: var(--s4); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; line-height: 1.45; }   /* polish (rule 6): 13.5px cells */
.tbl > caption { text-align: left; font-size: var(--t-xs); color: var(--ink-3); padding: 0 16px 6px; caption-side: top; }
.tbl > thead > tr > th {
  text-align: left; vertical-align: bottom; font-weight: 500; font-size: var(--t-xs); color: var(--ink-3);
  padding: 9px 12px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); white-space: normal;
  background: var(--raised); position: sticky; top: 0; z-index: 2;
}
main > .tbl-wrap .tbl > thead > tr > th, main > form > .tbl-wrap .tbl > thead > tr > th, main > div > .tbl-wrap .tbl > thead > tr > th { border-top: 0; }
main > .tbl-wrap .tbl > thead > tr > th:first-child, main > form > .tbl-wrap .tbl > thead > tr > th:first-child, main > div > .tbl-wrap .tbl > thead > tr > th:first-child { border-top-left-radius: calc(var(--r-card) - 1px); }
main > .tbl-wrap .tbl > thead > tr > th:last-child, main > form > .tbl-wrap .tbl > thead > tr > th:last-child, main > div > .tbl-wrap .tbl > thead > tr > th:last-child { border-top-right-radius: calc(var(--r-card) - 1px); }
.tbl > tbody > tr > td, .tbl > tfoot > tr > td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl > * > tr > :first-child { padding-left: 18px; }
.tbl > * > tr > :last-child { padding-right: 18px; }
.tbl > * > tr > .n { text-align: right; }
.tbl > tbody:last-child > tr:last-child > td { border-bottom: 0; }

.tbl > tbody > tr:hover > td { background: var(--raised); }
.tbl > tbody > tr { scroll-margin-top: 48px; }   /* a #row- or #why- jump lands below the sticky head */
.tbl .cell-main { font-weight: 550; color: var(--ink); }
.tbl a:not(.btn):not(.whylink) { text-decoration: none; }
.tbl a:not(.btn):not(.whylink):hover { text-decoration: underline; text-decoration-color: var(--ink-3); }
/* a cover bar in a narrow cell puts its words under the bar instead of over the next column */
.tbl .bar { flex-wrap: wrap; row-gap: 2px; max-width: 100%; }
.tbl .bar svg { flex: 0 1 132px; min-width: 64px; }
.tbl .sub { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; color: var(--ink-3); margin-top: 1px; font-weight: 400; }   /* polish (rule 6) */
.tbl > tbody > tr > td.k-code { font-family: var(--mono); font-size: 12px; }
.tbl .sub-line { display: block; font-size: var(--t-xs); margin-top: 2px; font-weight: 400; color: var(--ink-2); }
/* polish (REVIEW rule 3): a status on a second line is quiet coloured words with its dot, not a tag. It runs as text
   (inline), so in a right-aligned figure cell the dot stays beside its words when they wrap, on the line's own leading */
.tbl .sub-line .st { padding: 0; background: none; border-radius: 0; font-weight: 500; white-space: normal; line-height: inherit; display: inline; }
.tbl .sub-line .st > .sq { display: inline-block; vertical-align: 1px; margin: 0 5px 0 0; }
/* the small lines under a figure wrap (the figure itself stays whole), so a wide table still fits the page */
.tbl > tbody > tr > td.n .sub-line { white-space: normal; min-width: 7em; }
.tbl > * > tr > .sel { width: 28px; padding-right: 4px; }
/* polish (REVIEW rule 8): the tick box is the mock-up's 18px box with a 5px corner, ink when ticked, a dash when some
   are ticked. Still the real checkbox: it takes focus (ring below), Space ticks it, and it posts without JavaScript. */
.tbl { --tick-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.3 2.6 2.6L11 4.4'/%3E%3C/svg%3E");
  --tick-mixed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 7h7'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .tbl { --tick-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.3 2.6 2.6L11 4.4'/%3E%3C/svg%3E");
  --tick-mixed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 7h7'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tbl { --tick-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.3 2.6 2.6L11 4.4'/%3E%3C/svg%3E");
    --tick-mixed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 7h7'/%3E%3C/svg%3E"); }
}
.tbl > * > tr > .sel input { appearance: none; -webkit-appearance: none; display: block; width: 18px; height: 18px; margin: 0; border-radius: 5px; cursor: pointer;
  background: var(--surface) center / 14px no-repeat; box-shadow: inset 0 0 0 1.5px var(--ink-3); transition: background-color .12s ease, box-shadow .12s ease; }
.tbl > * > tr > .sel input:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.tbl > * > tr > .sel input:checked, .tbl > * > tr > .sel input:indeterminate { background-color: var(--ink); box-shadow: none; }
.tbl > * > tr > .sel input:checked { background-image: var(--tick-mark); }
.tbl > * > tr > .sel input:indeterminate { background-image: var(--tick-mixed); }
.tbl > * > tr > .sel input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (forced-colors: active) { .tbl > * > tr > .sel input { appearance: auto; -webkit-appearance: auto; } }
/* the tick box sits in a label: on touch screens the label grows to 44 x 44 around it (negative margins, so the
   row does not grow); with a mouse it is just the box */
.tick { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; vertical-align: top; }
.tick-all { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tbl-fixed { table-layout: fixed; }
.tbl > colgroup > col.c-sel { width: 40px; }   /* polish (rule 8): 18 + the 18px box + 4, so the box never reaches the next column */
.tbl > colgroup > col.c-why { width: 72px; }
.tbl-fixed > tbody > tr > td { overflow-wrap: anywhere; }
.tbl > tbody > tr:has(> td.sel input:checked) > td { background: var(--mark-soft); }
.tbl > tbody > tr.is-current > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl > tbody > tr.is-current > td.sel { box-shadow: none; }
.tbl > tbody > tr.is-current > td.sel input { outline: 2px solid var(--focus); outline-offset: 2px; }
.tbl > tfoot > tr > td { border-bottom: 0; border-top: 1px solid var(--rule-ink); font-weight: 600; padding-top: 10px; }
.tbl > tbody > tr.grp-head > th {
  text-align: left; font-weight: 400; background: var(--surface); padding: 13px 18px; font-size: var(--t-sm); color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.tbl > tbody.grp + tbody.grp > tr.grp-head > th { border-top: 1px solid var(--rule); }
.tbl > tbody.grp:first-of-type > tr.grp-head > th { padding-top: 13px; }
/* polish (REVIEW rule 10): a group head is padded 13 18, its title 14.5px, its facts 14px apart */
.grp-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); flex-wrap: wrap; }
.grp-title { font-weight: 600; font-size: 14.5px; }
.grp-meta { font-weight: 400; color: var(--ink-2); font-size: var(--t-sm); display: flex; gap: 14px; flex-wrap: wrap; }
.grp-meta b { font-weight: 600; color: var(--ink); }
/* the open why: a quiet raised band under its line */
.tbl > tbody > tr.detail > td { padding: 0; background: var(--raised); border-bottom: 1px solid var(--rule); }
.tbl > tbody > tr.detail:hover > td { background: var(--raised); }
.tbl > tbody > tr.detail[hidden]:target { display: table-row !important; }
.tbl > tbody > tr.has-detail.is-open > td { border-bottom-color: transparent; background: var(--raised); }
.tbl > tbody > tr.has-detail.is-open:has(> td.sel input:checked) > td { background: var(--mark-soft); }
.tbl > tbody > tr:has(+ tr.detail[hidden]:target) > td { background: var(--raised); border-bottom-color: transparent; }
/* polish (REVIEW rule 12): the why link is a 28px key, 13px words, padding 0 6 0 9 */
.whylink {
  display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-sm); font-weight: 550; color: var(--ink-2);
  text-decoration: none; white-space: nowrap; height: 28px; padding: 0 6px 0 9px; border-radius: 7px;
}
.whylink:hover { color: var(--ink); background: var(--sunk); }
.whylink[aria-expanded="true"] { color: var(--ink); background: var(--sunk); }
.whylink .ico { transition: transform .15s ease; }
.whylink[aria-expanded="true"] .ico { transform: rotate(90deg); }
.tbl.is-stuck > thead > tr > th { box-shadow: 0 7px 8px -8px rgba(0, 0, 0, .35); border-top-color: var(--rule); border-radius: 0; }

/* ---------- why ---------- */
details.why > summary {
  display: inline-flex; align-items: center; gap: 3px; cursor: pointer; list-style: none;
  font-size: var(--t-xs); font-weight: 550; color: var(--ink-2);
  padding: 3px 6px 3px 8px; margin-left: -8px; border-radius: 7px;
}
details.why > summary::-webkit-details-marker { display: none; }
details.why > summary .ico { transition: transform .15s ease; }
details.why[open] > summary .ico { transform: rotate(90deg); }
details.why > summary:hover { color: var(--ink); background: var(--sunk); }
details.why[open] > .why-body { margin-top: var(--s2); background: var(--raised); border: 1px solid var(--card-line); border-radius: 10px; }
/* one why on a page of its own (/move/why/<id>), drawn like an open why */
.why-alone { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.why-body { padding: var(--s4) var(--s5) var(--s5); display: grid; gap: var(--s4); font-size: var(--t-sm); min-width: 0; }
.detail-in > .why-body { padding: 18px 18px 22px; }
/* source order is the phone order: answer, warnings, sum, the rest. Wide screens put the sum on the left. */
.why-cols {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: var(--s6); align-items: start;
  grid-template-areas: "main lead" "main alerts" "main side"; grid-template-rows: auto auto 1fr;
}
.why-main { grid-area: main; min-width: 0; }
.why-lead { grid-area: lead; margin-bottom: var(--s4); }
.why-alerts { grid-area: alerts; margin-bottom: var(--s4); }
.why-side { grid-area: side; min-width: 0; }
.why-cols > * > * + * { margin-top: var(--s4); }
.why-lead p { color: var(--ink); font-size: var(--t-base); font-weight: 500; line-height: 1.45; max-width: 70ch; }
.why-lead p + p { margin-top: var(--s2); }
.why-alerts .checks li { font-weight: 500; }
/* a section that folds away behind its title (ui.fold) */
details.fold > summary {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none;
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); min-height: 24px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary:hover { color: var(--ink); }
details.fold > summary .ico { transition: transform .15s ease; }
details.fold[open] > summary .ico { transform: rotate(90deg); }
details.fold > .fold-body { margin-top: 6px; }
details.fold > .fold-body > * + * { margin-top: var(--s3); }
.why-h { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.why-p { color: var(--ink-2); max-width: 70ch; }
.sum { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
.sum td { padding: 5px 0; vertical-align: baseline; border-bottom: 1px solid var(--rule); }
.sum td.op { width: 20px; font-family: var(--mono); color: var(--ink-2); text-align: center; padding-right: 6px; }
.sum td.lab { padding-right: var(--s3); }
.sum td.note { color: var(--ink-3); font-size: var(--t-xs); padding-right: var(--s3); }
.sum td.v { text-align: right; white-space: nowrap; font-weight: 500; min-width: 72px; }
.sum tr.total td { border-top: 1px solid var(--rule-ink); padding-top: 6px; font-weight: 600; }
.sum tr.total td.note { font-weight: 400; }
/* the answer: the last total, large and in the accent colour */
.sum tr.final td { border-bottom: 0; }
.sum tr.final td.v { border-bottom: 0; color: var(--accent); font-size: 22px; font-weight: 500; letter-spacing: -.03em; line-height: 1.2; }
.sum tr.minor td { color: var(--ink-2); }
.checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 3px 0; }
.checks li .ico { margin-top: 2px; }
.checks .tone-ok .ico { color: var(--ok); }
.checks .tone-warn .ico { color: var(--warn); }
.checks .tone-bad .ico { color: var(--bad); }
.checks .tone-info .ico, .checks .tone-muted .ico { color: var(--ink-3); }
.fixes { display: flex; gap: var(--s2); flex-wrap: wrap; }
/* plain points: a small ink-3 square, like .sq, hung in the margin */
.bullets li { position: relative; padding: 2px 0 2px 16px; max-width: 72ch; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: calc(.75em - 1px); width: 5px; height: 5px; background: var(--ink-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; color: var(--ink);
  font-size: 13.5px; font-weight: 550; line-height: 1.45; white-space: nowrap;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); }
/* ink for the main action, a white key with a hairline for the rest */
.btn-primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); box-shadow: var(--btn-edge); }
.btn-primary:hover { background: color-mix(in srgb, var(--btn) 86%, var(--btn-ink)); border-color: color-mix(in srgb, var(--btn) 86%, var(--btn-ink)); }
.btn-secondary { background: var(--surface); border-color: var(--rule-ink); box-shadow: var(--btn-lift); }
.btn-secondary:hover { background: var(--raised); border-color: var(--line); }
.btn-quiet { padding: 0 8px; color: var(--ink-2); text-decoration: none; }
.btn-quiet:hover { color: var(--ink); background: var(--sunk); }
.btn-danger { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn kbd { font-size: 10.5px; padding: 1px 4px; border-color: currentColor; opacity: .7; background: transparent; color: inherit; border-bottom-width: 1px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: var(--t-sm); }
.btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
@media (pointer: coarse) { .btn { height: 40px; } .btn-sm { height: 34px; } }
/* finger-sized targets (44 x 44) without moving anything: the hit area reaches past the drawn control */
@media (pointer: coarse), (max-width: 640px) {
  .tick { padding: 14px; margin: -14px; }
  .whylink { padding: 13px 0 13px 12px; margin: -13px 0 -13px -12px; }   /* not past the right edge: no sideways scroll */
  .whylink { height: auto; }   /* polish: the 28px key of rule 12 must not cut the finger-sized target */
}

kbd { display: inline-block; font: 500 11px/1.2 var(--mono); padding: 1px 5px; border: 1px solid var(--rule-ink); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink-2); }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; max-width: 560px; }
.form-wide { max-width: none; }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > label, .fld > .fld-label { font-size: var(--t-sm); font-weight: 500; }
.fld input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .fld select, .fld textarea {
  width: 100%; height: 38px; padding: 0 11px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .12s ease;
}
.fld input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, .fld select:hover, .fld textarea:hover { border-color: var(--ink-3); }
.fld textarea { height: auto; min-height: 96px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
.fld select { padding-right: 30px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-2) 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.fld input:focus-visible, .fld select:focus-visible, .fld textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.fld input::placeholder, .fld textarea::placeholder { color: var(--ink-3); }
.fld input[type="file"] { font-size: var(--t-sm); color: var(--ink-2); max-width: 100%; }
.fld input[type="file"]::file-selector-button { font: inherit; font-weight: 550; height: 34px; padding: 0 13px; margin-right: 12px; border: 1px solid var(--rule-ink); border-radius: var(--r); background: var(--surface); color: var(--ink); cursor: pointer; }
.fld input[type="file"]::file-selector-button:hover { background: var(--raised); }
.fld-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 10px; align-items: start; }
.fld-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ink); }
.fld-check label { font-weight: 400; font-size: var(--t-base); }
.fld-check .help, .fld-check .err { grid-column: 2; }
.help { font-size: var(--t-xs); color: var(--ink-3); max-width: 64ch; }
.err { font-size: var(--t-xs); color: var(--bad); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.fld.has-err input, .fld.has-err select, .fld.has-err textarea { border-color: var(--bad); }
.form-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; padding-top: 4px; }
.form-inline { display: flex; gap: var(--s2); align-items: flex-end; flex-wrap: wrap; min-width: 0; }
.form-inline .fld { min-width: min(160px, 100%); }
/* polish (REVIEW rule 14): the boxes of a filter line are 32px tall with 13px words; the select's arrow and the
   form's own button follow that height */
.form-inline .fld input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form-inline .fld select { height: 32px; font-size: var(--t-sm); }
.form-inline .fld select { background-position: calc(100% - 16px) 13px, calc(100% - 11px) 13px; }
.form-inline:has(> .fld) > .form-actions .btn { height: 32px; }   /* a filter line's button, not a lone button form */
@media (pointer: coarse) {
  .form-inline .fld input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form-inline .fld select { height: 38px; }
  .form-inline .fld select { background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; }
  .form-inline:has(> .fld) > .form-actions .btn { height: 40px; }
}
.tbl td .form-inline .fld { min-width: min(7rem, 100%); flex: 1 1 7rem; }

/* ---------- callouts, flash, empty, loading ---------- */
/* a callout is a tinted note with rounded corners; its title carries the tone colour */
.callout { border: 0; border-radius: 10px; background: var(--info-bg); padding: 12px 16px; font-size: var(--t-sm); color: var(--ink); display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
main > .callout, main > div > .callout { margin-bottom: var(--s4); }
.callout + .callout { margin-top: var(--s2); }
.callout-title { font-weight: 600; color: var(--info); }
.callout.tone-ok { background: var(--ok-bg); } .callout.tone-ok .callout-title { color: var(--ok); }
.callout.tone-warn { background: var(--warn-bg); } .callout.tone-warn .callout-title { color: var(--warn); }
.callout.tone-bad { background: var(--bad-bg); } .callout.tone-bad .callout-title { color: var(--bad); }
.callout.tone-muted { background: var(--muted-bg); } .callout.tone-muted .callout-title { color: var(--ink); }
.callout a:not(.btn) { color: inherit; text-decoration-color: currentColor; }
.callout ul { display: grid; gap: 2px; }
.callout .btn-row { margin-top: 6px; }
.flashes { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.way-back { margin-top: var(--s4); }
.notice { margin-bottom: var(--s5); }

/* an empty state on the canvas is a card; inside a section it is the section's own quiet line, never a card in a card */
.empty {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px var(--s4); align-items: start; padding: var(--s5) 18px;
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
.sec .empty { padding: 4px 0 var(--s2); }
.empty-ico { width: 32px; height: 32px; color: var(--ink-3); stroke-width: 1.25; padding: 6px; border-radius: 9px; background: var(--sunk); box-sizing: border-box; }
.empty-msg { color: var(--ink-2); max-width: 64ch; padding-top: 5px; }
.empty .btn-row { grid-column: 2; margin-top: var(--s2); }

.loading { display: grid; gap: var(--s3); padding: var(--s4) 0; }
.loading-msg { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: var(--t-sm); }
.loading-msg::before { content: ""; width: 8px; height: 8px; background: var(--ink); animation: blink 1.1s steps(2, start) infinite; }
.skel { display: grid; gap: 10px; }
.skel i { display: block; height: 12px; background: var(--sunk); border-radius: 6px; animation: pulse 1.6s ease-in-out infinite; }
.skel i:nth-child(3n+1) { width: 92%; } .skel i:nth-child(3n+2) { width: 74%; } .skel i:nth-child(3n) { width: 83%; }
progress.meter { appearance: none; -webkit-appearance: none; width: 100%; max-width: 420px; height: 6px; border: 0; background: var(--sunk); border-radius: 3px; overflow: hidden; }
progress.meter::-webkit-progress-bar { background: var(--sunk); border-radius: 3px; }
progress.meter::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress.meter::-moz-progress-bar { background: var(--accent); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes blink { to { visibility: hidden; } }

/* ---------- lists: to-do rows, steps, tabs, definition lists ---------- */
/* to-do rows: a card of rows, each number on a small tone chip */
.todo {
  counter-reset: todo; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.sec .todo { border-top: 1px solid var(--rule); }
.todo > li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px var(--s4); align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--rule); counter-increment: todo; }
.todo > li:last-child { border-bottom: 0; }
.todo > li::before { content: counter(todo); font: 600 12px/26px var(--mono); color: var(--ink-2); background: var(--sunk); border-radius: 8px; width: 26px; height: 26px; text-align: center; margin-top: -2px; }
.todo > li.tone-bad::before { background: var(--bad-bg); }
.todo > li.tone-warn::before { background: var(--warn-bg); }
.todo-title { font-size: var(--t-base); font-weight: 600; line-height: 22px; }
.todo-title a { text-decoration: none; }
.todo-title a:hover { text-decoration: underline; }
/* the whole row is the link: it reaches over the row's padding, so the target is the row's full height */
.todo-link { display: block; min-width: 0; margin: -14px 0; padding: 14px 0; text-decoration: none; color: inherit; }
.todo-link:hover .todo-title { text-decoration: underline; text-decoration-color: var(--ink); }
.todo > li { min-height: 48px; }
.todo-meta { color: var(--ink-2); font-size: var(--t-sm); margin-top: 2px; }
.todo-meta .st { margin-right: 6px; }
.todo-act { align-self: center; }
.todo > li.tone-bad::before { color: var(--bad); }
.todo > li.tone-warn::before { color: var(--warn); }

/* the set-up steps sit in a card of their own */
.steps {
  counter-reset: step; padding: 20px 18px 0; min-width: 0;
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-card); box-shadow: var(--shadow-card);
}
.sec .steps { padding: 4px 18px 0; }
.steps > li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px var(--s4); padding: 0 0 var(--s5); counter-increment: step; }
.steps > li::after { content: ""; position: absolute; left: 12px; top: 30px; bottom: 4px; width: 1px; background: var(--rule-ink); }
.steps > li:last-child::after { display: none; }
.steps > li.st-done::after { background: var(--accent); }
.step-mk { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font: 500 12px/1 var(--mono); color: var(--ink-2); background: var(--surface); }
.step-mk::before { content: counter(step); }
.st-done .step-mk { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.st-done .step-mk::before { content: none; }
.st-done .step-mk .ico { width: 14px; height: 14px; stroke-width: 2; }
.st-now .step-mk { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.st-now .step-title { font-weight: 600; }
.st-blocked .step-mk { border-color: var(--bad); color: var(--bad); }
.step-title { font-weight: 500; line-height: 26px; }
.st-todo .step-title { color: var(--ink-2); }
.step-note { color: var(--ink-2); font-size: var(--t-sm); max-width: 68ch; }
.step-meta { color: var(--ink-3); font-size: var(--t-xs); margin-top: 4px; }
.step-act { padding-top: 0; }
.st-now .step-body { padding-bottom: 2px; }

/* tabs as keys: the chosen one is a grey tile */
.tabs { display: flex; gap: 2px; border-bottom: 0; margin-bottom: var(--s4); overflow-x: auto; scrollbar-width: none; max-width: 100%; min-width: 0; }
/* polish (REVIEW rule 9): a tab is a 28px key with no vertical padding; the chosen one has no edge */
.tabs a { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; margin-bottom: 0; color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500; white-space: nowrap; border-bottom: 0; border-radius: 7px; transition: background-color .12s ease, color .12s ease; }
.tabs a:hover { color: var(--ink); background: var(--sunk); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--sunk); font-weight: 600; box-shadow: none; }
.tabs .tab-n { color: var(--ink-3); font-weight: 400; margin-left: 6px; }

.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px var(--s5); font-size: var(--t-sm); }
.dl dt { color: var(--ink-2); }
.dl dd { color: var(--ink); }

.meta-line { display: flex; flex-wrap: wrap; gap: 4px var(--s4); color: var(--ink-2); font-size: var(--t-sm); }
.meta-line > * { white-space: nowrap; }

/* ---------- charts: cover bar and sparkline ---------- */
.bar { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }
.bar svg { width: 132px; height: 12px; }
.bar-track { fill: var(--rule); }
.bar-fill { fill: var(--ink); }
.bar-fill.tone-ok { fill: var(--ok); } .bar-fill.tone-warn { fill: var(--warn); } .bar-fill.tone-bad { fill: var(--bad); }
.bar-target { stroke: var(--ink); stroke-width: 2; }
.bar-lead { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 2; }
.bar-text { font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; }

.spark { display: grid; gap: 8px; max-width: 100%; }
.spark svg { height: auto; }
.spark .b { fill: var(--ink-3); }
.spark .b-zero { fill: var(--ink-3); }
.spark .b-unk { fill: var(--ink-3); opacity: .7; }
.spark .base { stroke: var(--rule-ink); stroke-width: 1; }
.spark .rule { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 3; }
.spark .rule-lab { font: 500 10px var(--mono); fill: var(--ink); }
.spark .m-soldout-bg { fill: var(--bad-bg); }
.spark .hatch-line { stroke: var(--bad); stroke-width: 1.2; opacity: .55; }
.spark .m-promo-bg { fill: var(--info-bg); }
.spark .m-unknown-bg { fill: var(--muted-bg); }
.spark .m-line { stroke-width: 2; }
.spark .m-soldout-line { stroke: var(--bad); } .spark .m-promo-line { stroke: var(--info); } .spark .m-unknown-line { stroke: var(--ink-3); stroke-dasharray: 2 2; }
.spark .today { stroke: var(--ink); stroke-width: 1; }
.spark-axis { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--ink-3); }
.spark-legend { display: flex; flex-wrap: wrap; gap: 4px var(--s4); font-size: var(--t-xs); color: var(--ink-2); }
.spark-legend span { display: inline-flex; align-items: center; gap: 6px; }
.spark-legend svg { width: 14px; height: 10px; }
.sw-b { fill: var(--ink-3); }
.sw-soldout { fill: var(--bad-bg); stroke: var(--bad); stroke-width: 1; }
.sw-promo { fill: var(--info-bg); stroke: var(--info); stroke-width: 1; }
.sw-unknown { fill: var(--muted-bg); stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 1; }
.sw-rule { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 2; }

/* ---------- bottom action bar (Buy, Move, Orders) ---------- */
/* an ink bar that floats under a ticked list; its buttons are drawn for the dark bar in both themes */
.actionbar {
  position: sticky; bottom: 16px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;   /* polish (rule 13) */
  margin-top: var(--s4); padding: 10px 10px 10px 18px;
  background: var(--ink); color: var(--bg); border-top: 0; border-radius: 14px; box-shadow: var(--shadow-pop);
}
.actionbar-text { font-size: var(--t-sm); color: color-mix(in srgb, var(--bg) 74%, var(--ink)); min-width: 0; }
.actionbar-text b { color: var(--bg); font-weight: 600; }
.actionbar a:not(.btn) { color: var(--bg); text-decoration-color: color-mix(in srgb, var(--bg) 50%, var(--ink)); }
.actionbar .btn-primary { background: var(--bg); color: var(--ink); border-color: var(--bg); box-shadow: none; }
.actionbar .btn-primary:hover { background: color-mix(in srgb, var(--bg) 86%, var(--ink)); border-color: color-mix(in srgb, var(--bg) 86%, var(--ink)); }
.actionbar .btn-secondary { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 34%, var(--ink)); box-shadow: none; }
.actionbar .btn-secondary:hover { background: color-mix(in srgb, var(--bg) 12%, var(--ink)); border-color: color-mix(in srgb, var(--bg) 50%, var(--ink)); }
.actionbar .btn-quiet { color: color-mix(in srgb, var(--bg) 80%, var(--ink)); }
.actionbar .btn-quiet:hover { color: var(--bg); background: color-mix(in srgb, var(--bg) 12%, var(--ink)); }
.actionbar .btn-danger { background: transparent; color: var(--bad-bg); border-color: color-mix(in srgb, var(--bad-bg) 60%, var(--ink)); }
.actionbar :focus-visible { outline-color: var(--bg); }

.toolbar { display: flex; gap: var(--s2) var(--s3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s3); font-size: var(--t-sm); }
.toolbar .grow { flex: 1; }

/* ---------- dialog (app.js confirm and shortcuts) ---------- */
dialog.dlg { border: 1px solid var(--card-line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: var(--s5); width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
dialog.dlg::backdrop { background: rgba(10, 10, 10, .42); }
.dlg h2 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; margin-bottom: var(--s2); }
.dlg p { color: var(--ink-2); }
.dlg .btn-row { justify-content: flex-end; margin-top: var(--s5); }
.keys { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px var(--s4); font-size: var(--t-sm); margin-top: var(--s3); }
.keys dt { white-space: nowrap; }
.keys dd { color: var(--ink-2); }
.js-only { display: none; }
@media (max-width: 899px), (pointer: coarse) { .hint, .has-js .hint, .has-js .js-only.hint { display: none; } }
.has-js .js-only { display: revert; }

/* ---------- responsive ---------- */
@media (max-width: 1099px) {
  .split, .split.login { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .why-cols { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "alerts" "main" "side"; grid-template-rows: none; }
  .why-main:not(:last-child) { margin-bottom: var(--s3); }
  /* the why's sum never hides a note and never scrolls sideways: each line is the figure, then its reason */
  .sum, .sum > tbody { display: block; width: 100%; }
  .sum tr { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--rule); }
  .sum td { display: block; padding: 0; border: 0; }
  .sum td.op { grid-column: 1; grid-row: 1; padding: 0; }
  .sum td.lab { grid-column: 2; grid-row: 1; padding: 0; }
  .sum td.v { grid-column: 3; grid-row: 1; align-self: end; }
  .sum td.note { grid-column: 2 / -1; grid-row: 2; padding: 1px 0 0; white-space: normal; font-size: var(--t-xs); color: var(--ink-3); }
  .sum td.note:empty { display: none; }
  .sum tr.total { border-top: 1px solid var(--rule-ink); padding-top: 6px; }
  .sum tr.total td { border-top: 0; padding-top: 0; }
  .sum tr.final { border-bottom: 0; }
  .sum tr.final td.v { border-bottom: 0; }
}
@media (min-width: 641px) and (max-width: 1099px) {
  /* relative: the screen-reader-only words in a head cell stay inside the scroller instead of widening the page */
  .tbl-wrap { overflow-x: auto; container-type: inline-size; position: relative; }
  .tbl > thead > tr > th { position: static; }
  /* a why under a line of a table that scrolls sideways stays as wide as what is on screen, and stays put */
  .tbl > tbody > tr.detail > td > .detail-in { position: sticky; left: 0; width: 100cqi; }
}
@media (max-width: 899px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  /* the frame on a phone: the bar keeps the menu button, the marks, the data dot, the switch and the person; the
     menu slides in from the left when its button (a label for a check box) is pressed, without JavaScript */
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 8px; }
  .topbar .bar-menu { display: grid; }
  .side-toggle { display: block; position: fixed; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
  .side-toggle:focus-visible ~ .topbar .bar-menu { outline: 2px solid var(--focus); outline-offset: -2px; }
  .side-toggle:checked ~ .topbar .bar-menu { background: var(--bar-field); color: var(--bar-ink); }
  .search { display: none; }
  .topbar .search-link { display: grid; }
  .pill { padding: 0 11px; }
  .pill > span { display: none; }
  .bar-brand > .brandmark .brandmark-prod { display: none; }
  .switch { padding: 0 6px 0 8px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: var(--bar-h); bottom: 0; height: auto; z-index: 25; width: 272px; max-width: 86vw;
    background: var(--bg); box-shadow: var(--shadow-pop);
    transform: translateX(-105%); visibility: hidden; transition: transform .26s var(--ease), visibility .26s;
  }
  .side-toggle:checked ~ .shell > .side { transform: none; visibility: visible; }
  /* the top bar's lists span the screen under the bar, so none is cut at the left edge */
  .topbar .pop { position: fixed; top: calc(var(--bar-h) + 6px); left: 8px; right: 8px; width: auto; min-width: 0; max-width: none; max-height: calc(100dvh - var(--bar-h) - 16px); overflow-y: auto; }
  .side-toggle:checked ~ .shell > .side-scrim { display: block; position: fixed; inset: var(--bar-h) 0 0 0; z-index: 24; background: rgba(10, 10, 10, .32); }
  .nav a, .nav-item { height: 40px; font-size: var(--t-base); }
  .nav .nav-sub a { height: 38px; }
  .page-area { padding: 20px 16px 64px; }
  .page-area .page-head { flex-direction: column; align-items: stretch; }
  .page-area .head-actions { flex: 0 1 auto; }
  main { padding: var(--s4) var(--gutter) var(--s7); }
  .page-head h1 { font-size: 22px; }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 14px 13px; border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
  .stat + .stat::before { display: none; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat-value { font-size: 24px; }
  .bare-top { padding: var(--s3) var(--gutter); }
  .login > .prose { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: var(--s4); }
  .bare main { padding-top: var(--s5); }
  .actionbar { bottom: 8px; padding: 10px 10px 10px 14px; }
  .actionbar .btn-row { width: 100%; flex-wrap: nowrap; }
  .actionbar .btn { flex: 1; padding: 0 10px; }
}

/* phone: table rows become stacked blocks, label above value */
@media (max-width: 640px) {
  .tbl, .tbl > tbody, .tbl > tfoot, .tbl > tbody > tr, .tbl > tfoot > tr, .tbl > tbody > tr > td, .tbl > tfoot > tr > td { display: block; }
  .tbl { border-top: 1px solid var(--rule); }
  .tbl > thead { display: none; }
  .has-js .tbl > thead:has(th.sel) { display: block; }
  .has-js .tbl:has(> thead th.sel) { border-top: 0; }
  .tbl > thead > tr { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--rule); padding: 0 16px; background: var(--raised); }
  .tbl > thead > tr > th { display: none; position: static; }
  .tbl > colgroup { display: none; }
  .tbl > thead > tr > th.sel { display: flex; align-items: center; width: auto; padding: 0; border: 0; }
  /* "Tick all": the box and its words are one 44 px tall target */
  .tbl > thead > tr > th.sel .tick { margin: 0 0 0 -14px; padding: 0 12px 0 14px; min-height: 44px; gap: 10px; }
  .tbl > thead > tr > th.sel .tick-all { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: var(--t-xs); color: var(--ink-2); font-weight: 500; }
  .tbl > tbody > tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px var(--s4); padding: 12px 16px; border-bottom: 1px solid var(--rule); }
  .tbl > tbody:last-child > tr:last-child { border-bottom: 0; }
  .tbl > tbody > tr.has-sel { padding-left: 46px; }
  .tbl > tbody > tr > td { padding: 0; border: 0; text-align: left !important; }
  .tbl > * > tr > :first-child, .tbl > * > tr > :last-child { padding-left: 0; padding-right: 0; }
  .tbl > tbody > tr > td:first-child, .tbl > tbody > tr > td.sel + td { grid-column: 1 / -1; }
  /* the tick box at the row's left edge, its 44 x 44 label reaching into the card's edge */
  .tbl > tbody > tr > td.sel { position: absolute; left: 16px; top: 13px; width: auto; grid-column: auto; }
  /* the line's name link: a 44 px tall target without making the line taller */
  .tbl > tbody > tr > td.primary .cell-main > a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  /* "Why 600?" is a control of its own on a phone, the full width of the line */
  .tbl > tbody > tr > td.k-why { grid-column: 1 / -1; }
  .tbl > tbody > tr > td.k-why .whylink {
    display: flex; justify-content: center; gap: 6px; min-height: 44px; margin: 2px 0 0; padding: 0 12px;
    border: 1px solid var(--rule-ink); border-radius: var(--r); font-size: var(--t-sm); font-weight: 550; color: var(--ink);
    text-decoration: none; background: var(--surface);
  }
  .tbl > tbody > tr > td.k-why .whylink .ico { transform: rotate(90deg); }
  .tbl > tbody > tr > td.k-why .whylink[aria-expanded="true"] .ico { transform: rotate(-90deg); }
  .tbl > tbody > tr > td.k-why .whylink[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .tbl > tbody > tr > td[data-label]:not(.sel):not(.primary)::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-bottom: 1px; }
  .tbl > tbody > tr > td.primary { font-size: var(--t-base); }
  .tbl > tbody > tr > td:empty { display: none; }
  /* half a phone is narrow: let statuses and the lines under figures wrap (the figures themselves stay whole) */
  .tbl > tbody > tr > td.n .sub-line, .tbl > tbody > tr > td.n .sub { white-space: normal; }
  .tbl .st { white-space: normal; align-items: flex-start; max-width: 100%; }
  .tbl .st > .sq { margin-top: .5em; }
  .tbl > tbody > tr { scroll-margin-top: var(--s4); }
  .tbl > tbody > tr:hover > td { background: transparent; }
  .tbl > tbody > tr:has(> td.sel input:checked) > td { background: transparent; }
  .tbl > tbody > tr:has(> td.sel input:checked) { background: var(--mark-soft); box-shadow: none; }
  .tbl > tbody > tr.grp-head { display: block; padding: 0; }
  .tbl > tbody > tr.grp-head > th { display: block; padding: 18px 16px 10px; }
  /* a group head on a phone: the title on its own line, then the facts joined by dots. Each fact is a block of
     its own (it moves to the next line whole, its dot with it) and wraps inside only if longer than the line. */
  .grp-line { display: block; }
  .grp-title { display: block; }
  .grp-meta { display: block; margin-top: 2px; }
  .grp-meta > span { display: inline-block; max-width: 100%; }
  .grp-meta > span:not(:last-child)::after { content: "·"; margin: 0 6px; color: var(--ink-3); }
  .tbl > tbody > tr.detail { display: block; padding: 0; border-bottom: 1px solid var(--rule); background: var(--raised); }
  .tbl > tbody > tr.detail[hidden]:target { display: block !important; }
  .tbl > tbody > tr.has-detail.is-open { border-bottom-color: transparent; background: var(--raised); }
  .tbl > tbody > tr.has-detail.is-open > td { background: transparent; }
  .tbl > tfoot > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--s4); padding: 12px 16px; border-top: 1px solid var(--rule-ink); }
  .tbl > tfoot > tr > td { border: 0; padding: 0; }
  .tbl > tfoot > tr > td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
  .why-body { padding: var(--s3) var(--s3) var(--s4); }
  .bar { flex-wrap: wrap; gap: 4px 10px; max-width: 100%; }
  .bar svg { width: 112px; }
  .bar-text { white-space: normal; }
  .todo > li { grid-template-columns: 26px minmax(0, 1fr); padding: 14px 16px; }
  .sec-body > :where(:not(.tbl-wrap, .todo, .steps)) { margin-left: 16px; margin-right: 16px; }
  .sec-head { padding: 14px 16px 0; }
  .steps { padding: 16px 16px 0; }
  .todo-act { grid-column: 2; align-self: start; margin-top: 6px; }
  .todo-act .btn, .way-back .btn { height: 44px; min-width: 44px; }
  .todo-link { padding-bottom: 8px; margin-bottom: -8px; }
  details.fold > summary { min-height: 44px; }
  .steps > li { grid-template-columns: 26px minmax(0, 1fr); }
  .step-act { grid-column: 2; margin-top: 6px; }
  .empty { grid-template-columns: minmax(0, 1fr); }
  .empty .btn-row { grid-column: 1; }
  .dl { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 6px 12px; }

  .page-head { margin-bottom: var(--s4); }
  .tabs { flex-wrap: wrap; overflow: visible; gap: 2px; }
  .tabs a { margin-bottom: 0; }
  /* a long fact ("Last loaded: a_long_file_name.xlsx, …") wraps on a phone instead of widening the page */
  .meta-line > * { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
}

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

@media print {
  .topbar, .side, .side-scrim, .side-toggle, .actionbar, .btn, .whylink, .skip, .tbl .sel, .lede-more { display: none !important; }
  .shell { display: block; }
  .page-area { padding: 0; }
  .page-area > main { display: block; }
  .page-area > #main > * + * { margin-top: 16px; }
  body { background: #fff; color: #000; font-size: 11px; }
  /* cards print as plain blocks: no fill, no shadow */
  .sec, .stats, .tbl-wrap, .todo, .steps, .empty, .why-alone, .callout { box-shadow: none !important; background: transparent !important; }
  main { padding: 0; max-width: none; }
  .tbl > thead > tr > th { position: static; }
  .tbl > tbody > tr.detail[hidden] { display: none !important; }
}

/* --- lane A: onboarding form --- */
.sheet-ways { display: grid; gap: var(--s2); justify-items: start; }
.sheet-ways > details.sheet-alt > summary { font-size: var(--t-xs); }
.sheet-ways > details.sheet-alt[open] > .form { margin-top: var(--s3); }
.bf-lead { margin-bottom: var(--s5); }
.bf-lead > p + p { margin-top: var(--s2); }
.bf-form.form { gap: 0; }
.bf-form.form > * { min-width: 0; }   /* lead: a wide table scrolls inside its section, never the page */
.bf-intro { margin-bottom: var(--s3); max-width: 80ch; }
.bf-brand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px var(--s5); max-width: 880px; }
.bf-wrap { width: auto; max-width: 100%; overflow-x: auto; }
.sec-body > .bf-wrap { margin-left: 0; margin-right: 0; }
.bf-tbl { min-width: 640px; }
.bf-tbl > thead > tr > th { vertical-align: bottom; text-align: left; padding: 6px 8px; min-width: 120px; }
.bf-tbl > thead > tr > th.bf-n { min-width: 0; width: 28px; }
.bf-tbl .bf-h { display: block; font-weight: 600; color: var(--ink); }
.bf-tbl .bf-help { display: block; font-size: var(--t-xs); font-weight: 400; color: var(--ink-3); line-height: 1.35;
  margin-top: 2px; max-width: 32ch; white-space: normal; }
.bf-tbl > tbody > tr > td { padding: 6px 8px; vertical-align: middle; }
.bf-tbl > tbody > tr:hover > td { background: transparent; }
.bf-tbl > tbody > tr > td.bf-n { width: 28px; font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-3); }
.bf-tbl .fld input:not([type="checkbox"]), .bf-tbl .fld select { width: 100%; min-width: 96px; }
.bf-tbl th.bf-num, .bf-tbl td.bf-num { min-width: 88px; }
.bf-tbl td.bf-num .fld input { min-width: 72px; }
.bf-tbl > tbody > tr.bf-bad > td { background: var(--bad-bg); }
.bf-tbl > tbody > tr.bf-bad > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.bf-tbl > tbody > tr.bf-bad .fld input, .bf-tbl > tbody > tr.bf-bad .fld select { border-color: var(--bad); }
.bf-add { margin-top: var(--s2); }
.bf-actions { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--rule-ink); }
@media (max-width: 720px) {
  .bf-brand { grid-template-columns: minmax(0, 1fr); }
  .bf-actions .btn { height: 44px; }
}
/* --- lane B: connections gallery --- */
/* The Connections page opens with provider tiles in groups. Live tiles are cards on the canvas and link to their
   section; coming-soon tiles are dashed, with no fill, in grey, with no link: never connected-looking. The
   gallery itself is not a card (no card in a card). Tokens only, no shadows. */
.cx-page .sec { scroll-margin-top: var(--s5); }
.cx-gallery.sec { background: transparent; border: 0; border-radius: 0; --shadow-card: none; }
.cx-gallery.sec > .sec-head { padding: 0; min-height: 0; }
.cx-gallery .sec-body { display: grid; gap: var(--s5); }
.cx-gallery .sec-body > .cx-group { margin: 0; }
.cx-group { min-width: 0; }
.cx-group-title { font-size: var(--t-sm); font-weight: 600; color: var(--ink); margin: 0 0 var(--s2); }
.cx-group-note { color: var(--ink-2); margin: 0 0 var(--s2); max-width: 72ch; }
.cx-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
           grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.cx-tile { min-width: 0; border: 1px solid var(--card-line); border-radius: var(--r-card); background: var(--surface);
           overflow-wrap: anywhere; }
.cx-link, .cx-tile.is-soon { display: grid; gap: 4px; align-content: start; padding: 14px; height: 100%;
                             box-sizing: border-box; min-width: 0; border-radius: var(--r); }
.cx-link { color: var(--ink); text-decoration: none; border-radius: calc(var(--r-card) - 1px); }
.cx-link:hover { background: var(--raised); }
.cx-link:hover .cx-name { text-decoration: underline; text-underline-offset: 2px; }
.cx-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cx-name { font-size: var(--t-base); font-weight: 600; line-height: 1.3; }
.cx-line { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.4; }
.cx-state { font-size: var(--t-xs); margin-top: 4px; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.cx-tile.is-soon { border: 1px dashed var(--rule-ink); background: transparent; color: var(--ink-3); }
.cx-tile.is-soon .cx-name { font-weight: 500; color: var(--ink-2); }
.cx-soon-words { font-size: var(--t-xs); color: var(--ink-3); }
.cx-group.is-quiet .cx-group-title { color: var(--ink-2); font-weight: 500; }
.cx-group.is-quiet .cx-tile { border-color: var(--rule); }
.cx-group.is-quiet .cx-name { font-weight: 500; }
.cx-move { margin-top: var(--s7); padding-top: var(--s3); border-top: 1px solid var(--rule-ink); color: var(--ink-2); }
.cx-move-title { margin: 0; font-size: var(--t-sm); }
.cx-move-note { margin: 4px 0 0; max-width: 72ch; }
.cx-move > .sec { margin-top: var(--s4); }
.cx-move > .sec > .sec-head { border-top-color: var(--rule); }
/* designer's finishing rules, 26 Nov (design/redesign-2026-11-26/screens/rebased/lane-B-connections-gallery.css) */
.cx-group-title { font-size: var(--t-xs); font-weight: 500; color: var(--ink-3); }
.cx-grid { gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 156px), 1fr)); }
/* a live tile: mark and name, one line of what it reads, its state at the foot */
.cx-tile { overflow: hidden; }
.cx-link { gap: 6px; padding: 14px 14px 12px; grid-template-rows: auto 1fr auto; }
.cx-link:hover .cx-name { text-decoration: none; }
.cx-name { display: flex; align-items: center; gap: 10px; }
.cx-tile .cx-mark { width: 20px; height: 20px; padding: 5px; margin-right: 0; vertical-align: 0; border-color: var(--rule); border-radius: var(--r); flex: none; }
.cx-line { font-size: var(--t-sm); }
.cx-state { margin-top: var(--s2); }
/* the state is one tag; a long error wraps inside the tile and never leaves it */
.cx-state .st { display: inline-flex; align-items: flex-start; max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; padding-top: 3px; padding-bottom: 3px; }
.cx-state .st .sq { margin-top: 5px; }
.cx-state .st.tone-muted { padding: 3px 8px; border-radius: 7px; background: var(--sunk); font-weight: 550; font-size: var(--t-xs); }
.cx-tile[data-state="error"] .cx-state .st { display: flex; border-radius: var(--r); padding: 7px 9px; font-weight: 500; }
/* the tile's edge says the same thing as the tag */
.cx-tile[data-state="connected"], .cx-tile[data-state="keys-working"] { border-color: color-mix(in srgb, var(--ok) 38%, var(--rule)); }
.cx-tile[data-state="error"] { border-color: color-mix(in srgb, var(--bad) 55%, var(--rule)); }
.cx-tile[data-state="error"]:has(.tone-warn) { border-color: color-mix(in srgb, var(--warn) 55%, var(--rule)); }
/* a coming-soon tile is small and plainly not live */
.cx-tile.is-soon { gap: 8px; padding: 12px 14px; align-content: center; }
.cx-tile.is-soon .cx-name { font-size: var(--t-sm); }
.cx-soon-words { padding-left: 42px; margin-top: -12px; }
/* wide screens: a live tile takes two columns and two rows, so the coming-soon tiles stack beside it in pairs */
@media (min-width: 900px) {
  .cx-grid { grid-auto-rows: minmax(62px, auto); }
  .cx-tile:not(.is-soon) { grid-column: span 2; grid-row: span 2; }
}
/* each connection's own section: the keys form sits on a quiet panel */
.cx-page .split { gap: var(--s6); }
.cx-page .split > div > .form { padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--raised); }
@media (max-width: 640px), (pointer: coarse) {
  .cx-link { min-height: 44px; }
}
@media (max-width: 640px) {
  .cx-grid { grid-template-columns: minmax(0, 1fr); }
}
/* --- lane C: agency page, agency name and logo --- */
/* the brand header with the agency beside it (ui._agency_head); --agency-accent recolours only its rule */
.brandhead { display: grid; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--agency-accent, var(--rule)); }
.agencymark { display: block; padding: 0 8px; text-decoration: none; color: var(--ink-2); max-width: 100%; }
.agencymark:hover .agencymark-name { color: var(--ink); }
.agencymark-logo { display: block; height: 28px; width: auto; max-width: 180px; object-fit: contain; object-position: left center; }
.agencymark-name { display: block; font-size: var(--t-xs); font-weight: 600; line-height: 1.3; color: var(--ink-2); overflow-wrap: anywhere; }
.brandmark-by { color: var(--ink-3); }
.bare-top .brandhead { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; padding-bottom: 0; border-bottom: 0; }
.bare-top[style] { border-bottom: 2px solid var(--agency-accent, var(--rule)); }
.bare-top .agencymark { padding: 0; }
/* the agency page (restoq/web/agency_app.py): no menu, the agency on top, one row per brand */
.agency-who { display: flex; align-items: center; gap: var(--s3); min-width: 0; margin-bottom: var(--s5); }
.agency-who .agencymark-logo { height: 32px; }
.agency-who-name { font-size: var(--t-md); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.agency-who-prod { display: block; font-size: var(--t-xs); color: var(--ink-3); }
.health-why { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
@media (max-width: 899px) {
  .brandhead { margin-right: 96px; padding-bottom: 8px; gap: 6px; }
  .brandhead .brandmark { margin-right: 0; }
  .agencymark { padding: 0; }
  .agencymark-logo { height: 24px; }
}
/* --- redesign: today --- */
/* Today's page area as design/redesign-2026-11-26/today-nochart.html (pixel-spec.md, "Today without the chart";
   spec/today-nochart.txt): the line under the greeting, the figures card with an icon by each label, "Sort out
   first" in two columns, "Order first" with its tabs, table and foot. Every rule is written against classes only
   Today's markup carries (td-*), so the frame and the other pages are untouched. The mock-up's --card, --line,
   --line-2 and card shadow are the app's --surface, --hair, --hair-2 and --shadow-tile. Its tone fills are the app's
   --*-bg in light; in dark the mock-up's are see-through, held here as --td-*-bg (the red one is the app's
   --bad-see). Buy's tags (by-badge, drawn by buy.when_badge) take their fills from --by-*-bg, set here to the same. */
.td-figs, .td-card {
  --td-warn-bg: var(--warn-bg); --td-bad-bg: var(--bad-bg); --td-info-bg: var(--info-bg);
  --by-warn-bg: var(--td-warn-bg); --by-bad-bg: var(--td-bad-bg); --by-info-bg: var(--td-info-bg);
}
:root[data-theme="dark"] :is(.td-figs, .td-card) {
  --td-warn-bg: rgba(240, 195, 106, .14); --td-bad-bg: var(--bad-see);
  --td-info-bg: rgba(140, 200, 242, .14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.td-figs, .td-card) {
    --td-warn-bg: rgba(240, 195, 106, .14); --td-bad-bg: var(--bad-see);
    --td-info-bg: rgba(140, 200, 242, .14);
  }
}

/* the line under the greeting: the date, the plan, the next run, a small dot between them */
.td-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.td-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); opacity: .7; }
.td-sublink { color: inherit; text-decoration: none; }
.td-sublink:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-3); }
.td-run { display: flex; margin: 0; }

/* the figures card: four figures, a hairline between them; each is a link to its page */
.td-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; background: var(--surface); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--hair), var(--shadow-tile); }
.td-fig { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 16px 18px 15px; color: var(--ink); text-decoration: none; transition: background-color .14s ease; }
.td-fig + .td-fig::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--hair); }
.td-fig:hover { background: var(--raised); }
.td-flabel { display: flex; align-items: center; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.45; color: var(--ink-2); }
.td-flabel-t { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.td-flabel .ico.td-fico { width: 16px; height: 16px; margin-right: 7px; color: var(--ink-3); }
.td-flabel .ico.td-go { width: 15px; height: 15px; margin-left: auto; color: var(--ink-3); opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .2s var(--ease); }
.td-fig:hover .td-go, .td-fig:focus-visible .td-go { opacity: 1; transform: none; }
.td-fvalue { font-size: 30px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-fvalue small { margin-left: 5px; font-size: 14px; font-weight: 450; letter-spacing: 0; color: var(--ink-2); }
.td-ffoot { display: flex; align-items: center; gap: 8px; min-height: 22px; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.td-split { display: block; flex: 1; min-width: 0; max-width: 132px; height: 6px; border-radius: 3px; overflow: hidden; color: var(--ink); }
.td-seg { fill: currentColor; }
.td-seg2 { fill-opacity: .72; } .td-seg3 { fill-opacity: .5; } .td-seg4 { fill-opacity: .32; } .td-seg5 { fill-opacity: .2; }

/* a card, its head (title on the left, a count or tabs on the right) */
.td-card { min-width: 0; background: var(--surface); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--hair), var(--shadow-tile); }
.td-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 14px 16px 0 18px; }
.td-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; line-height: 1.45; }
.td-count { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 550; line-height: 1.45; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }

/* Sort out first: one row per thing, in two equal columns (one at 860px and under) */
.td-todo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 12px; padding: 4px 6px 6px; }
.td-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; transition: background-color .12s ease; }
.td-row:hover { background: var(--raised); }
.td-chip { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-size: 13px; line-height: 1.45; background: var(--sunk); color: var(--ink-2); }
.td-chip .ico { width: 17px; height: 17px; }
.td-chip.td-bad { background: var(--td-bad-bg); color: var(--bad); }
.td-chip.td-warn { background: var(--td-warn-bg); color: var(--warn); }
.td-chip.td-info { background: var(--td-info-bg); color: var(--info); }
.td-txt { min-width: 0; }
.td-txt b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.td-txt span { display: block; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.td-row .btn.td-sm { height: 30px; padding: 0 11px; border: 0; font-size: 13px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 1px var(--hair-2), 0 1px 0 rgba(26, 26, 26, .05); }
.td-row .btn.td-sm:hover { background: var(--raised); }

/* Order first: tabs as plain links, the table, the foot */
.td-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.td-tab { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 500; line-height: 1.45; color: var(--ink-2); white-space: nowrap; text-decoration: none; transition: background-color .12s ease, color .12s ease; }
.td-tab:hover { background: var(--raised); color: var(--ink); }
.td-tab[aria-current] { background: var(--sunk); color: var(--ink); font-weight: 600; }
.td-tab b { margin-left: 5px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.td-wrap { overflow-x: auto; margin-top: 10px; }
.td-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.td-tbl th { padding: 9px 12px; font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; color: var(--ink-3); background: var(--raised); border-block: 1px solid var(--hair); }
.td-tbl td { padding: 10px 12px; vertical-align: middle; border-bottom: 1px solid var(--hair); }
.td-tbl :is(th, td):first-child { padding-left: 18px; }
.td-tbl :is(th, td):last-child { padding-right: 18px; }
.td-tbl tbody tr { transition: background-color .1s ease; }
.td-tbl tbody tr:hover { background: var(--raised); }
.td-tbl tbody tr:last-child td { border-bottom: 0; }
.td-tbl .td-r { text-align: right; font-variant-numeric: tabular-nums; }
.td-prod { display: flex; align-items: center; min-width: 0; }   /* no tile, so no gap (spec/README) */
.td-prod > div { min-width: 0; }
.td-name { display: block; font-weight: 550; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-name:hover { text-decoration: underline; text-decoration-color: var(--ink-3); }
.td-code { font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; color: var(--ink-3); }
.td-route { display: flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.td-route .ico { width: 14px; height: 14px; color: var(--ink-3); }
.td-when { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-none { padding: 14px 18px 16px; font-size: 13.5px; color: var(--ink-2); }
.td-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px; border-top: 1px solid var(--hair); font-size: 13px; color: var(--ink-2); }
.td-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 550; color: var(--ink); white-space: nowrap; text-decoration: none; }
.td-link .ico { width: 15px; height: 15px; transition: transform .18s var(--ease); }
.td-link:hover .ico { transform: translateX(3px); }

/* 860px and under (the mock-up's own break): figures two by two, Sort out first in one column, the foot wraps */
@media (max-width: 860px) {
  .td-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-fig:nth-child(3)::before { display: none; }
  .td-fig:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .td-todo { grid-template-columns: minmax(0, 1fr); }
  .td-head:has(> .td-tabs) { flex-wrap: wrap; row-gap: 8px; }
  .td-foot { flex-wrap: wrap; gap: 6px 16px; }
}
/* --- redesign: buy --- */
/* Buy's page area as approved on 26 Nov (design/redesign-2026-11-26/buy.html; pixel-spec.md, "Buy"). Every rule is
   written against classes only Buy's markup carries (by-*), or reaches today's table, why and bar parts through
   them, so the frame and the other pages are untouched. The why opens as a panel on the right at 1100px and wider
   (stylesheet only: today's tr.detail, fixed to the right edge), in place below that and whenever two are open. */
.by-toolbar, .by-lines, .by-approve, .by-drafted, .by-stats {
  --by-line: rgba(26, 26, 26, .09);
  --by-line-2: rgba(26, 26, 26, .2);
  --by-tint: rgba(15, 107, 78, .08);
  --by-card-shadow: 0 1px 0 rgba(26, 26, 26, .04), 0 1px 2px rgba(26, 26, 26, .05);
  --by-ok-bg: #D9F2E4; --by-warn-bg: #FFEBBF; --by-bad-bg: #FDDDD6; --by-info-bg: #DCEEFB;
  --by-dot-ok: #0C5132; --by-dot-warn: #6B4100; --by-dot-bad: #8E1F0B;
  --by-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.3 2.6 2.6L11 4.4'/%3E%3C/svg%3E");
  --by-mixed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 7h7'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] :is(.by-toolbar, .by-lines, .by-approve, .by-drafted, .by-stats) {
  --by-line: rgba(255, 255, 255, .08); --by-line-2: rgba(255, 255, 255, .2); --by-tint: rgba(92, 203, 156, .1);
  --by-card-shadow: none;
  --by-ok-bg: rgba(92, 203, 156, .14); --by-warn-bg: rgba(240, 195, 106, .14); --by-bad-bg: rgba(255, 122, 105, .15);
  --by-info-bg: rgba(140, 200, 242, .14);
  --by-dot-ok: #7EDCAE; --by-dot-warn: #F0C36A; --by-dot-bad: #FF9A8B;
  --by-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.3 2.6 2.6L11 4.4'/%3E%3C/svg%3E");
  --by-mixed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 7h7'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.by-toolbar, .by-lines, .by-approve, .by-drafted, .by-stats) {
    --by-line: rgba(255, 255, 255, .08); --by-line-2: rgba(255, 255, 255, .2); --by-tint: rgba(92, 203, 156, .1);
    --by-card-shadow: none;
    --by-ok-bg: rgba(92, 203, 156, .14); --by-warn-bg: rgba(240, 195, 106, .14); --by-bad-bg: rgba(255, 122, 105, .15);
    --by-info-bg: rgba(140, 200, 242, .14);
    --by-dot-ok: #7EDCAE; --by-dot-warn: #F0C36A; --by-dot-bad: #FF9A8B;
    --by-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7.3 2.6 2.6L11 4.4'/%3E%3C/svg%3E");
    --by-mixed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23121212' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 7h7'/%3E%3C/svg%3E");
  }
}

/* the filter bar: the tabs on the left, supplier, warehouse and the find box on the right, on one line */
.by-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.by-toolbar > .tabs { margin: 0; gap: 2px; flex-wrap: wrap; overflow: visible; }
.by-toolbar > .tabs a { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); box-shadow: none; }
.by-toolbar > .tabs a:hover { background: var(--raised); color: var(--ink); }
.by-toolbar > .tabs a[aria-current="page"] { background: var(--sunk); color: var(--ink); font-weight: 600; box-shadow: none; }
.by-toolbar > .tabs .tab-n { margin-left: 5px; font-weight: 500; color: var(--ink-3); }
.by-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.by-select { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 11px; border-radius: var(--r); font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; min-width: 0; max-width: 100%; transition: background-color .12s ease, color .12s ease; }
.by-select:hover { background: var(--raised); color: var(--ink); }
.by-select:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.by-select select { appearance: none; -webkit-appearance: none; border: 0; outline: 0; margin: 0; padding: 0; height: 30px; min-width: 0; max-width: 220px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-overflow: ellipsis; }
.by-select .ico { width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.by-find { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); cursor: text; min-width: 0; }
.by-find:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.by-find input { appearance: none; -webkit-appearance: none; border: 0; outline: 0; margin: 0; padding: 0; height: 30px; width: 150px; min-width: 0; background: none; font-size: 13px; color: var(--ink); }
.by-find input::placeholder { color: var(--ink-3); }
.by-find input::-webkit-search-decoration { -webkit-appearance: none; }
.by-show.btn { height: 32px; }
/* with JavaScript (buy.js) a select or Enter in the find box sends the filters, so "Show" goes */
.by-filters.by-auto .by-show { display: none; }

/* the line above the figures sits 12px over them; a warning under a figure is a tag with its dot (a by-badge in the
   figure's foot, which is the mock-up's 22px flex line; .by-stats carries the tag's fills) */
.meta-line.by-meta { margin-bottom: 12px; }

/* the lines: one card per supplier-to-warehouse group (a tbody), its banded head, its own column names */
.tbl-wrap.by-lines { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.tbl.by-tbl { font-size: 13.5px; line-height: 1.45; }
.tbl.by-tbl > tbody.by-grp { font-size: 14px; background: var(--surface); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--by-line), var(--by-card-shadow); overflow: hidden; }
.tbl.by-tbl > tbody.by-grp + tbody.by-grp { margin-top: 16px; }
.tbl.by-tbl > tbody > tr.by-grow > th { padding: 0; background: transparent; border: 0; text-align: left; font-weight: 400; font-size: 14px; color: var(--ink); position: static; }
.by-ghead { display: flex; align-items: center; gap: 12px; padding: 13px 18px; }
.by-gtitle { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600; min-width: 0; }
.by-gtitle .ico { width: 15px; height: 15px; color: var(--ink-3); }
.by-gmeta { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.by-gmeta b { color: var(--ink); font-weight: 600; }
/* groups that fold (the approved Buy design): the arrow ends the head, 16px, pointing right
   when the group is shut and a quarter turn when open, 14px after the money as in buy.html (the head's gap and 2px).
   A click on the head (not its box, a link or a button) folds or opens it; the arrow is the head's real button.
   buy.js folds with the class by-shut, and a folded group shows only its head, with "N ticked" (the plain tag) at
   the start of its facts while any of its lines is ticked. Without JavaScript the arrow stays hidden and every
   group is open. */
.has-js .by-ghead:has(> .by-fold:not([hidden])) { cursor: pointer; user-select: none; }
.by-fold { flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin: 0 0 0 2px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--ink-3); cursor: pointer; }
.by-fold .ico.by-chev { display: block; width: 16px; height: 16px; transition: transform .2s var(--ease); }
.by-fold[aria-expanded="true"] .ico.by-chev { transform: rotate(90deg); }
.by-fold:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.tbl.by-tbl > tbody.by-grp.by-shut > tr:not(.by-grow) { display: none !important; }
/* the first paint is already the one buy.js makes, so nothing jumps (walk fault 5): theme.js marks <html> rq-js in the
   head, before this sheet paints, when scripts run. Until buy.js takes a table over (by-folds), a group the server
   marks as starting shut (data-fold="shut", and no line of it the address points to) shows only its head, with its
   arrow pointing right; every head has its arrow and its tick box, and the tick-all row is out of view, as buy.js
   leaves them. Without JavaScript there is no rq-js: every group open, no arrow, as before. */
:root.rq-js .tbl.by-tbl:not(.by-folds) > tbody.by-grp:has(> tr.by-grow .by-fold[data-fold="shut"]):not(:has(:target)) > tr:not(.by-grow) { display: none !important; }
:root.rq-js .tbl.by-tbl:not(.by-folds) > tbody.by-grp > tr.by-grow .by-fold[hidden] { display: grid !important; }
:root.rq-js .tbl.by-tbl:not(.by-folds) > tbody.by-grp > tr.by-grow .by-fold[data-fold="shut"] .ico.by-chev { transform: none; }
:root.rq-js .tbl.by-tbl:not(.by-folds) > tbody.by-grp > tr.by-grow .by-gsel[hidden] { display: inline-flex !important; }
:root.rq-js .tbl.by-tbl:not(.by-folds):has(input[data-group-tick]) > thead { display: none; }
.tbl.by-tbl > tbody > tr.by-cols > td { padding: 9px 12px; font-size: 12px; font-weight: 500; color: var(--ink-3); background: var(--raised); border-top: 1px solid var(--by-line); border-bottom: 1px solid var(--by-line); white-space: nowrap; text-align: left; vertical-align: middle; }
.tbl.by-tbl > tbody > tr.by-cols > td.n { text-align: right; }
.tbl.by-tbl > tbody > tr > td { font-size: 13.5px; padding: 9px 12px; border-bottom: 1px solid var(--by-line); vertical-align: middle; background: transparent; }
.tbl.by-tbl > tbody > tr > td:first-child { padding-left: 18px; }
.tbl.by-tbl > tbody > tr > td:last-child { padding-right: 18px; }
.tbl.by-tbl > tbody > tr > td.sel, .tbl.by-tbl > tbody > tr.by-cols > td.by-c-sel { width: 46px; padding-right: 0; }
.tbl.by-tbl > tbody > tr.has-sel:last-child > td, .tbl.by-tbl > tbody > tr:has(+ tr.detail[hidden]:last-child) > td { border-bottom: 0; }
.tbl.by-tbl > tbody > tr[data-key]:hover > td, .tbl.by-tbl > tbody > tr:has(> td.sel input:checked) > td,
.tbl.by-tbl > tbody > tr.has-detail.is-open > td, .tbl.by-tbl > tbody > tr.has-detail.is-open:has(> td.sel input:checked) > td,
.tbl.by-tbl > tbody > tr:has(+ tr.detail[hidden]:target) > td { background: transparent; }
.tbl.by-tbl > tbody > tr[data-key] { font-size: 13.5px; transition: background-color .1s ease; }
.tbl.by-tbl > tbody > tr[data-key]:hover { background: var(--raised); }
.tbl.by-tbl > tbody > tr[data-key]:has(> td.sel input:checked) { background: var(--by-tint); }
.tbl.by-tbl > tbody > tr.has-detail.is-open > td { border-bottom-color: var(--by-line); }
.tbl.by-tbl > tbody > tr.is-current > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* the tick box, drawn as the mock-up's (the lines', the tick-all's and each group head's) */
.tbl.by-tbl .sel input.by-tick, .tbl.by-tbl th.sel input.by-tick, .tbl.by-tbl .by-gsel input.by-tick { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 5px; display: block; cursor: pointer; background: var(--surface) center / 14px no-repeat; box-shadow: inset 0 0 0 1.5px var(--ink-3); transition: background-color .12s ease, box-shadow .12s ease; }
.tbl.by-tbl .sel input.by-tick:hover, .tbl.by-tbl .by-gsel input.by-tick:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.tbl.by-tbl .sel input.by-tick:checked, .tbl.by-tbl .sel input.by-tick:indeterminate,
.tbl.by-tbl .by-gsel input.by-tick:checked, .tbl.by-tbl .by-gsel input.by-tick:indeterminate { background-color: var(--ink); box-shadow: none; }
.tbl.by-tbl .sel input.by-tick:checked, .tbl.by-tbl .by-gsel input.by-tick:checked { background-image: var(--by-mark); }
.tbl.by-tbl .sel input.by-tick:indeterminate, .tbl.by-tbl .by-gsel input.by-tick:indeterminate { background-image: var(--by-mixed); }
.tbl.by-tbl > tbody > tr.is-current > td.sel input.by-tick { outline: 2px solid var(--focus); outline-offset: 2px; }
.tbl.by-tbl .by-gsel { flex: none; }
@media (forced-colors: active) { .tbl.by-tbl input.by-tick { appearance: auto; -webkit-appearance: auto; } }

/* with the group boxes shown (buy.js), the "Tick all lines" row is hidden from view; it stays in the page for the
   keyboard and screen readers, and shows again while it has the focus. A mouse press that takes the focus from it
   (on a group's box below) would hide it at once and move the box from under the pointer before the release, so
   the click was lost (walk fault 15): buy.js holds the row (by-hold) until that press is over. */
.has-js .tbl.by-tbl.by-gticks:not(.by-hold) > thead:not(:focus-within) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* the one tick-all box: app.js wires one per table, for every line, so it sits above the cards (with JS only) */
.tbl.by-tbl > thead { display: none; }
.has-js .tbl.by-tbl > thead { display: block; margin-bottom: 10px; }
.tbl.by-tbl > thead > tr { display: flex; align-items: center; }
.tbl.by-tbl > thead > tr > th { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tbl.by-tbl > thead > tr > th.sel { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; padding: 0 0 0 19px; background: transparent; border: 0; }
.tbl.by-tbl > thead > tr > th.sel .tick { gap: 10px; }
.tbl.by-tbl > thead > tr > th.sel .tick-all { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 13px; font-weight: 500; color: var(--ink-2); }

/* what a line says */
.by-tbl .cell-main { display: block; }
.by-name { display: block; font-weight: 550; color: var(--ink); text-decoration: none; }
.by-tbl a.by-name:hover { text-decoration: underline; text-decoration-color: var(--ink-3); }
.by-code { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; color: var(--ink-3); line-height: 19.575px; }
.by-note { display: block; font-size: 12px; margin-top: 1px; color: var(--ink-2); font-weight: 400; }
.by-note-bad { color: var(--warn); }
.by-when { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.by-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 550; line-height: 1.45; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.by-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.by-badge.by-plain::before { display: none; }
.by-badge.by-ok { background: var(--by-ok-bg); color: var(--ok); }
.by-badge.by-warn { background: var(--by-warn-bg); color: var(--warn); }
.by-badge.by-bad { background: var(--by-bad-bg); color: var(--bad); }
.by-badge.by-info { background: var(--by-info-bg); color: var(--info); }
.by-two { display: block; line-height: 1.3; white-space: nowrap; }
.by-two small { display: block; font-size: 12px; color: var(--ink-3); }
@media (min-width: 641px) {
.tbl.by-tbl .whylink.by-why { display: inline-flex; align-items: center; gap: 3px; height: 28px; padding: 0 6px 0 9px; border-radius: 7px; font-size: 13px; font-weight: 550; line-height: 1.45; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.tbl.by-tbl .whylink.by-why:hover { background: var(--sunk); color: var(--ink); }   /* an open why keeps the plain link, as the spec */
/* closed from the panel's own close link, the line's link keeps aria-expanded (app.js sets it on the link clicked):
   draw it from the why row's state instead */
.tbl.by-tbl > tbody > tr:has(+ tr.detail[hidden]) .whylink.by-why[aria-expanded="true"]:not(:hover) { background: transparent; color: var(--ink-2); }
.tbl.by-tbl > tbody > tr:has(+ tr.detail[hidden]) .whylink.by-why[aria-expanded="true"] .ico { transform: none; }
}
.tbl.by-tbl > tbody > tr > td.k-why { text-align: right; }

/* the drafted lines, under their own heading */
.by-drafted { margin-top: 24px; }
.by-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.by-subhead h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.by-subhead a { font-size: 13px; color: var(--ink-2); }

/* the approve bar: ink, under the list, with the count, units and money */
.actionbar.by-approve { gap: 16px; margin-top: 16px; padding: 10px 10px 10px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-pop); font-size: 14px; }
.by-approve .actionbar-text { font-size: 14px; color: var(--bg); }
.by-approve .actionbar-text b, .by-approve .actionbar-text [data-selected-noun] { font-weight: 600; color: var(--bg); }
.by-approve .actionbar-text [data-selected-facts] { color: color-mix(in srgb, var(--bg) 65%, var(--ink)); }
.by-approve .actionbar-text [data-selected-facts] > span { color: var(--bg); }
.by-approve .btn-primary { gap: 7px; height: 34px; padding: 0 13px; border: 0; border-radius: var(--r); line-height: 1.45; background: var(--bg); color: var(--ink); box-shadow: none; }
.by-approve .btn-primary:hover { background: var(--surface); }
.by-approve .btn-primary[disabled] { opacity: .45; }

/* the why: today's why (buy_detail), inside the mock-up's head, sum box, check lines and foot */
.by-scrim { display: none; }
.by-panel { position: relative; background: var(--surface); color: var(--ink); font-size: 14px; }
.by-why-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 16px 22px; border-bottom: 1px solid var(--by-line); }
.by-why-t { min-width: 0; flex: 1; }
.by-why-head h2 { font-size: 20px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.by-why-head p { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.by-why-x { margin-left: auto; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--by-line); text-decoration: none; }
.by-why-x:hover { background: var(--raised); color: var(--ink); }
.by-why-body { padding: 18px 22px 22px; min-width: 0; }
.by-why-foot { display: flex; align-items: center; gap: 6px; min-height: 59px; padding: 14px 16px; border-top: 1px solid var(--by-line); }
.by-why-foot .btn, .by-panel [data-copy-why] { height: 30px; padding: 0 11px; gap: 7px; border: 0; border-radius: var(--r); font-size: 13px; font-weight: 550; line-height: 1.45; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--by-line-2), 0 1px 0 rgba(26, 26, 26, .05); text-decoration: none; }
.by-why-foot .btn:hover, .by-panel [data-copy-why]:hover { background: var(--raised); }
.by-panel .why-body > .js-only { position: absolute; right: 22px; bottom: 14px; }
/* "Copy the math" (JS only) sits at the foot's right, over the foot: a hidden copy of its words, in its type and
   padding, is the foot's last item and keeps its room in any font; the foot's own keys wrap to a second row rather
   than run under it when the three do not fit on one line */
.has-js .by-why-foot { flex-wrap: wrap; row-gap: 6px; }
.has-js .by-why-foot::after { content: "Copy the math"; visibility: hidden; flex: none; margin-left: auto; height: 30px; padding: 0 11px; font-size: 13px; font-weight: 550; line-height: 30px; white-space: nowrap; }
.by-panel .why-body { display: block; padding: 0; font-size: 14px; }
.by-panel .why-cols { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; grid-template-rows: none; gap: 22px; }
.by-panel .why-cols > * { grid-area: auto; margin: 0; }
.by-panel .why-cols > * > * + * { margin-top: 0; }
.by-panel .why-lead p { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.45; }
.by-panel .why-lead p + p { margin-top: 8px; }
.by-panel .why-h { font-size: 12px; font-weight: 500; color: var(--ink-3); margin: 0 0 8px; }
.by-panel .sum + .why-h, .by-panel .why-p + .why-h, .by-panel .fold + .why-h { margin-top: 18px; }
.by-panel .why-side > .fold { margin-bottom: 18px; }
.by-panel .why-p { color: var(--ink-2); font-size: 13.5px; }
.by-panel .sum, .by-panel .sum > tbody { display: block; width: 100%; }
.by-panel .sum { font-size: 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--by-line); background: var(--raised); padding: 6px 16px; border-collapse: separate; }
.by-panel .sum tr { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 0; font-size: 13.5px; border: 0; }
.by-panel .sum tr + tr { border-top: 1px solid var(--by-line); }
.by-panel .sum td, .by-panel .sum tr.total > td, .by-panel .sum tr.final > td { display: block; padding: 0; border: 0; font-weight: 400; }
.by-panel .sum td.op { grid-column: 1; grid-row: 1; width: auto; text-align: left; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.by-panel .sum td.lab { grid-column: 2; grid-row: 1; }
.by-panel .sum td.note { grid-column: 2 / -1; grid-row: 2; margin-top: -10px; font-size: 12px; color: var(--ink-3); white-space: normal; }
.by-panel .sum td.note:empty { display: none; }
.by-panel .sum td.v { grid-column: 3; grid-row: 1; min-width: 0; font-size: 15px; font-weight: 500; text-align: right; white-space: nowrap; }
.by-panel .sum tr.total td, .by-panel .sum tr.total td.note { font-weight: 400; }
.by-panel .sum tr.final { border-top: 1px solid var(--by-line-2); padding: 12px 0 10px; }
.by-panel .sum tr.final td.lab { font-weight: 600; }
.by-panel .sum tr.final td.v { font-size: 26px; font-weight: 500; letter-spacing: -.03em; line-height: 1.45; color: var(--accent); }
.by-panel .sum tr.minor td { color: var(--ink-2); }
.by-panel .checks li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 13.5px; color: var(--ink-2); }
.by-panel .checks li > .ico { display: none; }
.by-panel .checks li::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--ink-3); }
.by-panel .checks li.tone-ok::before { background: var(--by-dot-ok); }
.by-panel .checks li.tone-warn::before { background: var(--by-dot-warn); }
.by-panel .checks li.tone-bad::before { background: var(--by-dot-bad); }
.by-panel .why-alerts .checks li { color: var(--ink); font-weight: 500; }
.tbl.by-tbl > tbody > tr.detail > td { padding: 0; background: var(--surface); border-bottom: 1px solid var(--by-line); }
/* with JavaScript a why reached by its #why- address is opened by app.js (hidden taken off); a :target rule would
   then hold it open after it is closed, so :target opens a why only without JavaScript */
.has-js .tbl.by-tbl > tbody > tr.detail[hidden]:target { display: none !important; }

/* 1100px and wider: the open why is a panel fixed to the right edge, 448px wide, full height, over a scrim that
   closes it. Two or more open at once (JS) fall back to in place, so no panel hides another. */
@media (min-width: 1100px) {
  .tbl.by-tbl > tbody > tr.detail:not([hidden]), :root:not(.has-js) .tbl.by-tbl > tbody > tr.detail[hidden]:target { display: block !important; position: fixed; inset: 0; z-index: 60; background: transparent; }
  .tbl.by-tbl > tbody > tr.detail > td { display: block; height: 100%; padding: 0; border: 0; background: transparent; }
  .tbl.by-tbl > tbody > tr.detail > td > .detail-in { height: 100%; }
  .tbl.by-tbl > tbody > tr.detail .by-scrim { display: block; position: absolute; inset: 0; background: rgba(10, 10, 10, .32); }
  .tbl.by-tbl > tbody > tr.detail .by-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(100vw, 448px); display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
  .tbl.by-tbl > tbody > tr.detail .by-why-body { flex: 1; overflow-y: auto; }
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden]) ~ tr.detail:not([hidden])) > tr.detail:not([hidden]),
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])):has(~ tbody > tr.detail:not([hidden])) > tr.detail:not([hidden]),
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])) ~ tbody > tr.detail:not([hidden]) { display: table-row !important; position: static; }
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden]) ~ tr.detail:not([hidden])) > tr.detail > td,
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])):has(~ tbody > tr.detail:not([hidden])) > tr.detail > td,
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])) ~ tbody > tr.detail > td { display: table-cell; height: auto; background: var(--surface); border-bottom: 1px solid var(--by-line); }
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden]) ~ tr.detail:not([hidden])) > tr.detail .by-scrim,
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])):has(~ tbody > tr.detail:not([hidden])) > tr.detail .by-scrim,
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])) ~ tbody > tr.detail .by-scrim { display: none; }
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden]) ~ tr.detail:not([hidden])) > tr.detail .by-panel,
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])):has(~ tbody > tr.detail:not([hidden])) > tr.detail .by-panel,
  .tbl.by-tbl > tbody:has(> tr.detail:not([hidden])) ~ tbody > tr.detail .by-panel { position: relative; inset: auto; width: auto; display: block; box-shadow: none; }
}

/* 641px and wider: each card lays out as a table of its own, as the mock-up's do */
@media (min-width: 641px) {
  .tbl.by-tbl { display: block; }
  .tbl.by-tbl > tbody.by-grp { display: table; width: 100%; border-collapse: separate; border-spacing: 0; }
}
/* a card wider than the column (long names between 641px and about 1220px) scrolls inside its wrapper, never the
   page; the padding keeps the cards' 1px edge inside the scroller, the margin keeps them on the column's edges */
@media (min-width: 641px) {
  .tbl-wrap.by-lines { overflow-x: auto; padding: 1px 1px 3px; margin: -1px -1px -3px; width: auto; max-width: none; }
}

/* phone: today's stacked rows inside the cards; the filters wrap; the why opens in place */
@media (max-width: 640px) {
  .by-filters { width: 100%; }
  .by-select { flex: 1 1 auto; }
  .by-select select { max-width: none; width: 100%; }
  .by-find { flex: 1 1 100%; }
  .by-find input { width: 100%; }
  .tbl.by-tbl { border-top: 0; }
  .tbl.by-tbl > tbody.by-grp { display: block; }
  .tbl.by-tbl > tbody > tr.by-cols { display: none; }
  .tbl.by-tbl > tbody > tr.by-grow { display: block; padding: 0; }
  .tbl.by-tbl > tbody > tr.by-grow > th { display: block; }
  .by-ghead { flex-wrap: wrap; gap: 4px 12px; padding: 13px 16px; }
  .by-gmeta { margin-left: 0; flex-wrap: wrap; gap: 2px 14px; white-space: normal; }
  /* the arrow ends the title's row, at the right, and the facts take the row under it */
  .by-fold:not([hidden]), :root.rq-js .tbl.by-tbl:not(.by-folds) .by-fold { order: 1; margin-left: auto; }
  .by-ghead:has(> .by-fold:not([hidden])) > .by-gmeta, :root.rq-js .tbl.by-tbl:not(.by-folds) .by-ghead:has(> .by-fold) > .by-gmeta { order: 2; flex: 1 1 100%; }
  .tbl.by-tbl > tbody > tr[data-key] { padding: 12px 16px 12px 46px; }
  .tbl.by-tbl > tbody > tr > td, .tbl.by-tbl > tbody > tr > td:first-child, .tbl.by-tbl > tbody > tr > td:last-child { padding: 0; border: 0; }
  .tbl.by-tbl > tbody > tr > td.sel { width: auto; }
  .by-name { white-space: normal; }
  .by-when { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .tbl.by-tbl > thead > tr { background: transparent; border: 0; padding: 0; }
  .tbl.by-tbl > thead > tr > th.sel { padding-left: 16px; }
  .actionbar.by-approve { padding: 10px 10px 10px 14px; }
  /* a figure's tag in half a phone's width wraps inside its figure instead of running into the next one */
  .by-stats .stat-note .by-badge { max-width: 100%; height: auto; min-height: 22px; padding-block: 2px; white-space: normal; }
}
@media print {
  .by-scrim { display: none !important; }
  .tbl.by-tbl > tbody > tr.detail { position: static !important; }
}
/* --- redesign: sign-in --- */
/* The split sign-in page and the other signed-out brand pages (ui.auth_page), as design/redesign-2026-11-26/
   login.html and its numbers in pixel-spec.md "Sign-in". Every rule is under an auth-* class that only that markup
   uses. Values the app's tokens do not hold (the mock-up's hairline, the main button's ink and edge, the panel's
   fixed darks) are --auth-* properties on .auth, light first, then their dark values under the same two selectors
   the token block uses. When the token block stops following the computer, drop the @media copy here with it. */
.auth {
  --auth-line: rgba(26, 26, 26, .09);
  --auth-line-2: rgba(26, 26, 26, .2);
  --auth-btn-ink: #FFFFFF;
  --auth-btn-edge: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .5);
  --auth-mark-bar: var(--accent);
  --auth-input-bg: var(--surface);
  --auth-side-bg: #161616;
  --auth-side-edge: none;
  color-scheme: light;      /* form controls and autofill follow the page, not the computer */
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  background: var(--surface); color: var(--ink);
  font: 400 14px/1.45 var(--font);
  font-variant-numeric: normal; font-feature-settings: normal;
  text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] .auth {
  --auth-line: rgba(255, 255, 255, .08);
  --auth-line-2: rgba(255, 255, 255, .2);
  --auth-btn-ink: #121212;
  --auth-btn-edge: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .18);
  --auth-mark-bar: #0F6B4E;
  --auth-input-bg: var(--raised);
  --auth-side-bg: #0E0E0F;
  --auth-side-edge: inset 0 0 0 1px rgba(255, 255, 255, .08);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth {
    --auth-line: rgba(255, 255, 255, .08);
    --auth-line-2: rgba(255, 255, 255, .2);
    --auth-btn-ink: #121212;
    --auth-btn-edge: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .18);
    --auth-mark-bar: #0F6B4E;
    --auth-input-bg: var(--raised);
    --auth-side-bg: #0E0E0F;
    --auth-side-edge: inset 0 0 0 1px rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}
:where(.auth) a { color: inherit; text-decoration: none; }
:where(.auth) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
:where(.auth) input { font: inherit; color: inherit; margin: 0; }
.auth-ico { display: block; width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: hidden; }
.auth-ico.auth-ico-s { width: 16px; height: 16px; }
:root[data-theme="dark"] .auth-t-sun, :root:not([data-theme="dark"]) .auth-t-moon { display: none; }

/* the form side */
.auth-form { display: flex; flex-direction: column; padding: 28px 40px 28px; min-width: 0; }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; min-width: 0; }
.auth-brand small { display: block; font-weight: 450; font-size: 12.5px; color: var(--ink-3); }
.auth-brand .agencymark { display: block; padding: 0; flex: none; color: inherit; }
.auth-logo { display: block; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: #000; }
.auth-mark { position: relative; background: var(--ink); }
.auth-mark i { position: absolute; left: 9px; right: 9px; bottom: 9px; height: 9px; border-radius: 2px; background: var(--auth-mark-bar); }
.auth-ghost { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--auth-line); transition: background .12s; }
.auth-ghost:hover { background: var(--raised); color: var(--ink); }
.auth-box { margin: auto 0; width: 100%; max-width: 372px; align-self: center; padding: 28px 0; }
.auth-box:focus { outline: 0; }
.auth-box h1 { font-size: 30px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.auth-sub { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; }
.auth-msgs { margin-top: 20px; display: grid; gap: 8px; }
.auth-msgs .flashes, .auth-msgs .notice { margin: 0; }
.auth-box > .callout { margin-top: 28px; }
.auth-fields { display: flow-root; margin-top: 10px; }   /* flow-root: the first field's 18px adds to these 10, as in the mock-up's 28 */
.auth-field { margin-top: 18px; display: grid; gap: 7px; }
.auth-field label { font-size: 13px; font-weight: 550; display: flex; justify-content: space-between; }
.auth-field label a { font-weight: 450; color: var(--ink-2); }
.auth-field label a:hover { color: var(--ink); text-decoration: underline; }
.auth-input { position: relative; }
.auth-input input {
  display: block; width: 100%; height: 44px; padding: 0 13px; border-radius: 10px; border: 0; outline: 0;
  background: var(--auth-input-bg); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 rgba(26, 26, 26, .04);
  font-size: 15px; transition: box-shadow .14s;
}
.auth-input input::placeholder { color: var(--ink-3); }
.auth-input input:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.auth-input input:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.auth-field.has-err .auth-input input { box-shadow: inset 0 0 0 1px var(--bad), 0 1px 0 rgba(26, 26, 26, .04); }
.auth-field.has-err .auth-input input:focus { box-shadow: inset 0 0 0 2px var(--bad); }
.auth-eye { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; color: var(--ink-3); }
.auth-eye:hover { background: var(--raised); color: var(--ink); }
.auth-eye[aria-pressed="true"] { color: var(--ink); }
.auth-hint { font-size: 12.5px; color: var(--ink-3); }
.auth-err { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--bad); }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; height: 42px; padding: 0 18px;
  margin-top: 22px; margin-bottom: 14px; border-radius: 10px;
  font-size: 14.5px; font-weight: 550; white-space: nowrap;
  background: var(--ink); color: var(--auth-btn-ink); box-shadow: var(--auth-btn-edge);
  transition: background .12s, transform .08s, box-shadow .12s;
}
.auth-btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--auth-btn-ink)); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn-quiet { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--auth-line-2), 0 1px 0 rgba(26, 26, 26, .05); }
.auth-btn-quiet:hover { background: var(--raised); }
.auth-btn + .auth-btn { margin-top: 0; }
.auth-btn .auth-ico { width: 16px; height: 16px; }
.auth-help { font-size: 13px; color: var(--ink-2); }
.auth-help .help { max-width: none; font-size: 13px; color: var(--ink-2); padding: 12px 14px; background: var(--raised); border-radius: 10px; }
.auth-help .help + .help { margin-top: 8px; }
.auth-help a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.auth-help code { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }
.auth-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
/* walk fault 22: "by reStoq AI" stays on one line beside a longer foot sentence on a phone; the sentence wraps */
.auth-foot { gap: 4px 16px; }
.auth-foot > :first-child { flex: none; white-space: nowrap; }

/* the panel: dark in both themes, made-up figures only */
.auth-side { margin: 12px; border-radius: 18px; background: var(--auth-side-bg); box-shadow: var(--auth-side-edge); color: #EDEDEB; padding: 36px 44px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.auth-side h2 { font-size: 34px; font-weight: 400; letter-spacing: -.035em; line-height: 1.1; max-width: 17ch; text-wrap: balance; }
.auth-side h2 em { font-style: normal; color: #8A8A86; }
.auth-maths { margin: 26px 0; background: #1F1F1F; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); padding: 16px 20px 14px; max-width: 460px; width: 100%; }
.auth-maths-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #A9A9A5; margin-bottom: 14px; }
.auth-maths-head b { color: #EDEDEB; font-weight: 550; font-size: 14px; }
.auth-maths ol { display: grid; gap: 0; }
.auth-maths li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 7px 0; font-size: 13.5px; color: #A9A9A5; border-top: 1px solid rgba(255, 255, 255, .07); opacity: 0; animation: auth-fadein .4s ease forwards; animation-delay: .35s; }
.auth-maths li:nth-child(2) { animation-delay: .51s; }
.auth-maths li:nth-child(3) { animation-delay: .67s; }
.auth-maths li:nth-child(4) { animation-delay: .83s; }
.auth-maths li:nth-child(5) { animation-delay: .99s; }
.auth-maths li:nth-child(6) { animation-delay: 1.31s; }
.auth-maths li i { font-style: normal; color: #6E6E6A; font-family: var(--mono); font-size: 12px; }
.auth-maths li b { color: #EDEDEB; font-weight: 500; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.auth-maths li.auth-total { color: #EDEDEB; border-top-color: rgba(255, 255, 255, .22); padding-top: 11px; margin-top: 3px; }
.auth-maths li.auth-total b { font-size: 24px; letter-spacing: -.03em; color: #5CCB9C; }
.auth-points { display: grid; gap: 12px; font-size: 14px; color: #BDBDB9; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points .auth-ico { color: #5CCB9C; width: 18px; height: 18px; }
@keyframes auth-fadein { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .auth-maths li { opacity: 1; animation: none; } }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-form { padding: 20px; }
}
/* --- questions for you --- */
/* The question after signing in and /questions (restoq/web/pages/questions.py, ASK_REPORT.md). Every rule is written
   against ask-* classes, which only that markup carries. The card sits at the top of the page without JavaScript;
   static/ask.js moves it into dialog.ask-dlg. Colours, edges and sizes come from the tokens. */
.ask-card, .ask-item { background: var(--surface); color: var(--ink); border: 1px solid var(--card-line); border-radius: var(--r-card); padding: var(--s5); }
.ask-card { max-width: 640px; margin: 0 0 var(--s5); }
dialog.ask-dlg { border: 0; padding: 0; margin: max(16px, 10vh) auto auto; background: transparent; color: var(--ink); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
/* the frame's ".page-area > #main > * { margin-top: 0 }" would pin the dialog to the top edge */
.page-area > #main > dialog.ask-dlg { margin: max(16px, 10vh) auto auto; }
dialog.ask-dlg::backdrop { background: color-mix(in srgb, var(--bar) 45%, transparent); }
.ask-dlg .ask-card { max-width: none; margin: 0; box-shadow: var(--shadow-pop); }
.ask-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.ask-kicker { margin: 0; font-size: var(--t-sm); font-weight: 600; letter-spacing: 0; color: var(--ink-2); }
.ask-count { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ask-bar { display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 4px; margin: var(--s2) 0 0; border: 0; border-radius: 2px; background: var(--sunk); color: var(--accent); overflow: hidden; }
.ask-bar::-webkit-progress-bar { background: var(--sunk); border-radius: 2px; }
.ask-bar::-webkit-progress-value { background: var(--accent); border-radius: 2px; }
.ask-bar::-moz-progress-bar { background: var(--accent); border-radius: 2px; }
.ask-line { margin: var(--s2) 0 0; font-size: var(--t-sm); color: var(--ink-2); }
.ask-streak { display: inline-flex; align-items: center; height: 22px; margin: var(--s2) 0 0; padding: 0 8px; border-radius: 7px; font-size: var(--t-xs); font-weight: 550; background: var(--ok-bg); color: var(--ok); }
.ask-form { margin: 0; }
.ask-q { border: 0; margin: var(--s4) 0 0; padding: 0; min-width: 0; }
.ask-text { padding: 0; margin: 0 0 var(--s3); font-size: var(--t-md); font-weight: 600; line-height: 1.35; letter-spacing: -.01em; color: var(--ink); }
.ask-card .ask-text { font-size: 18px; }
.ask-opts { display: grid; gap: var(--s2); }
.ask-opt { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 10px 14px; border: 1px solid var(--hair-2); border-radius: var(--r); background: var(--surface); color: var(--ink); font-size: var(--t-base); line-height: 1.35; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.ask-opt:hover { background: var(--raised); }
.ask-opt:has(input:checked) { border-color: var(--ink); background: var(--mark-soft); }
.ask-opt:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.ask-opt input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.ask-opt input:focus-visible { outline: 0; }
.ask-note { display: block; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-base); }
.ask-opts:has(.ask-other-pick:not(:checked)) .ask-note { display: none; }
.ask-why { margin: var(--s3) 0 0; font-size: var(--t-sm); color: var(--ink-2); }
.ask-why b { font-weight: 600; color: var(--ink); }
.ask-btns { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }
.ask-done .ask-kicker { font-size: var(--t-md); color: var(--ink); }
/* ask.js: Next is being sent (it cannot be pressed again), or the server refused it (its sentence and a Reload link) */
.ask-form[aria-busy="true"] .ask-btns .btn-primary { cursor: progress; }
.ask-err { margin: var(--s3) 0 0; padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--bad-bg); color: var(--bad); font-size: var(--t-sm); }
.ask-err a { margin-left: var(--s1); color: inherit; font-weight: 600; text-decoration: underline; }
.ask-list { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; gap: var(--s4); }
.ask-item .ask-q { margin-top: 0; }
.ask-item .ask-btns { justify-content: flex-start; }
.ask-item .ask-btns a { font-size: var(--t-sm); color: var(--ink-2); }
.ask-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: var(--t-xs); font-weight: 550; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.ask-tag.tone-info { background: var(--info-bg); color: var(--info); }
.ask-src { margin-left: var(--s2); font-size: var(--t-sm); color: var(--ink-3); }
.ask-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.ask-switch p { margin: 0; color: var(--ink-2); }
.ask-switch-form { margin: 0; }
@media (max-width: 640px) {
  .ask-card, .ask-item { padding: var(--s4); }
  .ask-btns .btn { flex: 1 1 auto; }
  .ask-card .ask-text { font-size: var(--t-md); }
}
/* --- lane D: monthly report --- */
/* /report (restoq/web/pages/report.py): the document an agency sends its brand. On screen it sits in the page like
   any other; printed, the menu, picker and buttons go and the masthead heads the paper. */
.rpt-tools { display: flex; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; }
.rpt-tools .form-inline { margin: 0; }
.rpt-mast { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s4) var(--s6);
  padding-bottom: var(--s3); margin-bottom: var(--s5); border-bottom: 2px solid var(--agency-accent, var(--rule-ink)); }
.rpt-who { display: flex; align-items: center; gap: var(--s3); min-width: 0; flex-wrap: wrap; }
.rpt-who .agencymark-logo { height: 32px; }
.rpt-agency { font-size: var(--t-md); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.rpt-for { font-size: var(--t-sm); color: var(--ink-2); }
.rpt-what { min-width: 0; text-align: right; }
.rpt-title { font-size: var(--t-md); font-weight: 600; line-height: 1.3; }
.rpt-sub { font-size: var(--t-xs); color: var(--ink-2); }
.rpt-figures .stats { margin-bottom: 0; }
.rpt-figures .stats + .stats { margin-top: var(--s3); }
.rpt-figures { margin-bottom: var(--s4); }
.rpt-wh + .rpt-wh, .rpt-wh + .sec { margin-top: var(--s4); }
.rpt .tbl tfoot td { font-weight: 500; border-top: 1px solid var(--rule-ink); }
@media (max-width: 640px) {
  .rpt-mast { grid-template-columns: minmax(0, 1fr); }
  .rpt-what { text-align: left; }
  .rpt-figures .stats { grid-auto-flow: row; }
  /* walk fault 9: a figure's words wrap inside its own box ("cost not known" ran into the next one), and a figure
     alone on the last row takes the whole row, so the edge above it runs the card's width */
  .rpt-figures .stat-value { white-space: normal; }
  .rpt-figures .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media print {
  /* a dark screen still prints black on white */
  .rpt, .rpt * { --bg: #FFFFFF; --surface: #FFFFFF; --raised: #FFFFFF; --sunk: #F2F1EC; --ink: #000000; --ink-2: #333331; --ink-3: #555550;
    --rule: #BDBAB1; --rule-ink: #000000; --line: #555550; --card-line: #BDBAB1; --shadow-card: none; --accent: #000000;
    --mark-soft: #FFFFFF; --ok: #1D6A39; --warn: #8A5200; --bad: #AE2317; --info: #1C5A7E; --muted: #5C5B55;
    --ok-bg: #FFFFFF; --warn-bg: #FFFFFF; --bad-bg: #FFFFFF; --info-bg: #FFFFFF; --muted-bg: #FFFFFF; }
  .rpt .sec, .rpt .stats, .rpt .tbl-wrap { border: 0; border-radius: 0; background: transparent; }
  .rpt .sec-head, .rpt .tbl > * > tr > :first-child { padding-left: 0; }
  .rpt .sec-body > * { margin-left: 0; margin-right: 0; }
  .rpt .stat + .stat::before { display: none; }
  .rpt .st { padding: 0; background: transparent; }
  main:has(> .rpt) > .page-head, .rpt-tools, main:has(> .rpt) .way-back { display: none !important; }
  .rpt { color: #000; }
  .rpt-mast { break-after: avoid; margin-bottom: 12px; }
  .rpt-what { text-align: right; }
  .rpt-figures { margin-bottom: 16px; }
  .rpt-figures, .rpt .stats, .rpt .stat { break-inside: avoid; }
  .rpt .stats { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); }
  .rpt .stat { padding: 8px 10px 9px; border-top: 0; border-left: 1px solid var(--rule); }
  .rpt .stat:first-child { border-left: 0; padding-left: 0; }
  .rpt .stat-value { font-size: 20px; }
  .rpt .tbl-wrap { overflow: visible !important; }
  .rpt .tbl { width: 100%; font-size: 9.5px; line-height: 1.35; }
  .rpt .tbl > thead { display: table-header-group; }
  .rpt .tbl > tfoot { display: table-row-group; }
  .rpt .tbl > thead > tr > th { white-space: normal; font-size: 9px; padding: 4px 5px; }
  .rpt .tbl > tbody > tr > td, .rpt .tbl > tfoot > tr > td { padding: 4px 5px; }
  .rpt .tbl > * > tr > :first-child { padding-left: 0; }
  .rpt .tbl > * > tr > :last-child { padding-right: 0; }
  .rpt .tbl .sub, .rpt .tbl .sub-line { font-size: 8.5px; }
  .rpt .tbl tr { break-inside: avoid; }
  .rpt .tbl > tfoot > tr { break-before: avoid; }
  .rpt .sec { margin-top: 16px; }
  .rpt .sec-head { break-after: avoid; min-height: 0; }
  .rpt-long { break-before: page; }
  .rpt .unk { color: #555550; }
  #rpt-not-shown { break-inside: avoid; }
}

/* lead fix on lane D: column headings wrap on screen too, so none is cut short */
.rpt .tbl > thead > tr > th { white-space: normal; vertical-align: bottom; overflow: visible; text-overflow: clip; }

/* lead fix on lane C: the header logo may be taller than it is wide (a square mark), so give it room */
.agencymark-logo { height: 44px; }
.agency-who .agencymark-logo, .rpt-who .agencymark-logo { height: 48px; }

/* --- polish: agency page --- */
/* the agency page (restoq/web/agency_app.py): the full content width, not the narrow signed-out column; one table,
   the brands that need a look first. Tokens only; no new colours. */
.bare:has(.agency-home) { --bare-w: 1240px; }
.bare:has(.agency-home) main { padding-top: var(--s6); }
.agency-home .stats { margin-bottom: var(--s4); }
.agency-home .tbl > tbody > tr > td.primary .cell-main { font-size: var(--t-base); }
.agency-home .tbl .sub-line .st { margin-top: 2px; }
/* the columns are fixed widths: a status wraps inside its cell rather than run into the next one */
.agency-home .tbl .st { white-space: normal; align-items: flex-start; max-width: 100%; }
.agency-home .tbl .st > .sq { margin-top: .5em; }
.agency-home .health-why { max-width: 48ch; }
.agency-home .ag-start { display: block; margin-top: 2px; color: var(--ink-3); }
.agency-home .ag-start code { color: var(--ink-2); overflow-wrap: anywhere; }
.agency-home .ag-quiet { color: var(--ink-3); }
.agency-home .ag-ticks { display: flex; gap: 2px; margin: 4px 0 5px; }
.agency-home .ag-ticks i { display: block; width: 8px; height: 8px; border: 1px solid var(--line); border-radius: var(--r); }
.agency-home .ag-ticks i.on { background: var(--ink); border-color: var(--ink); }
.agency-home .ag-ticks.is-done i.on { background: var(--ok); border-color: var(--ok); }
.agency-home .ag-steps { white-space: nowrap; }
.agency-home .tbl > tbody > tr > td.ag-open { text-align: right; vertical-align: middle; }
.agency-home .meta-line { margin-top: var(--s4); }
.agency-home .empty code { display: inline-block; margin-top: 4px; color: var(--ink); overflow-wrap: anywhere; }
.agency-home .ag-folder { display: block; margin-top: var(--s2); font-size: var(--t-xs); color: var(--ink-3); overflow-wrap: anywhere; }
/* redesign phase 5: the agency page under the frame's dark top bar (restoq/web/agency_app.py _frame). The bar is
   drawn by the frame's own rules; it has no search, so its two parts are the agency on the left and the theme
   switch and the person on the right. The page column under it is the signed-out frame's, as wide as before. */
.topbar.ag-bar { grid-template-columns: minmax(0, 1fr) auto; }
.ag-bar .bar-brand { gap: 6px; }
.ag-bar .switch.is-plain { padding-left: 6px; }
body > .topbar + .bare { min-height: calc(100vh - var(--bar-h)); min-height: calc(100dvh - var(--bar-h)); }
body > .topbar + .bare main { padding-top: 26px; }
/* spaced as the brand pages' head and cards: the line under the title 5px down, the first card 20px under the head,
   cards 16px apart, every group head padded alike */
body > .topbar + .bare .page-head { margin-bottom: 20px; }
body > .topbar + .bare .page-head .lede { margin-top: 5px; }
.agency-home .tbl > thead > tr > th { top: var(--bar-h); }
/* between phone and desk the table keeps its columns and scrolls sideways inside its own block (DESIGN_UI 4) */
@media (min-width: 641px) and (max-width: 1099px) { .agency-home .tbl { min-width: 960px; } }
@media (max-width: 640px) {
  .agency-home .tbl > tbody > tr > td.ag-health,
  .agency-home .tbl > tbody > tr > td.ag-open { grid-column: 1 / -1; }
  .agency-home .tbl > tbody > tr > td.ag-open { text-align: left !important; }
  .agency-home .tbl > tbody > tr > td.ag-open[data-label]::before { content: none; }
  .agency-home .tbl > tbody > tr > td.ag-open .btn { width: 100%; justify-content: center; min-height: 44px; }
  .agency-home .health-why { max-width: none; }
  .agency-home .meta-line > * { white-space: normal; }
}

/* --- tracker import --- */
.trk-form .tbl .sub { font-family: var(--font); font-size: 12px; }
.trk-form .tbl .sub .trk-lane { font-family: var(--mono); font-size: 11.5px; }
.trk-form .tbl .trk-note { display: block; color: var(--ink-3); font-size: 12px; white-space: normal; }
.trk-form .tbl .trk-name { font-weight: 500; }
.trk-form .tbl .fld { margin: 0; }
.trk-form .tbl select { min-width: 11rem; max-width: 16rem; }
@media (max-width: 640px) { .trk-form .tbl select { min-width: 0; max-width: none; width: 100%; } }
/* polish: on a phone the bar's two long keys ("Work out the dates again", "Load these orders") take a row each
   rather than push the page sideways */
@media (max-width: 640px) { .trk-form .actionbar .btn-row { flex-wrap: wrap; } .trk-form .actionbar .btn { flex: 1 1 auto; } }
/* polish (REVIEW, tracker wide preview): the column that names the order or product never narrows below 14rem, so a
   name reads on one or two lines; a table wider than that scrolls inside its own block (.trk-form .tbl-wrap), never
   the page. The first cell after the tick box, or the first cell when there is none. */
@media (min-width: 641px) {
  .trk-form .tbl > tbody > tr > td.primary, .trk-form .tbl > tbody > tr > td:first-child:not(.sel) { min-width: 14rem; }
}

/* --- attention groups --- */
/* Needs attention: one row per thing to do, its products inside a details element (no script) */
.att-g-title { display: block; font-weight: 600; color: var(--ink); }
.att-in { margin-top: var(--s2, 8px); }
.att-in > summary { cursor: pointer; color: var(--ink-2); font-size: var(--t-sm); }
.att-in > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.att-members { list-style: none; margin: var(--s2, 8px) 0 0; padding: 0; border-top: 1px solid var(--rule); }
.att-members > li { padding: 6px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.att-members > li > .sub { margin-left: 6px; }
.att-members .att-m-fact { float: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.att-codes > li { padding: 3px 0; }
@media (max-width: 640px) { .att-members .att-m-fact { float: none; display: block; } }
.att-shared { margin: var(--s2, 8px) 0 0; }
.att-more { margin-top: 2px; }
.att-more > summary { cursor: pointer; color: var(--ink-3); font-size: var(--t-xs); }
.att-more > p { margin: 4px 0 0; color: var(--ink-2); font-size: var(--t-sm); }

/* lead fix on the tracker import: the orders table stays inside the page at laptop width (its last column wraps,
   the selects are narrower, and anything wider scrolls inside its own block, never the page) */
.trk-form { min-width: 0; }
.trk-form > * { min-width: 0; }
.trk-form .tbl-wrap { overflow-x: auto; max-width: 100%; }
.trk-form .tbl select { min-width: 9rem; max-width: 12rem; }
.trk-form .tbl td .sub, .trk-form .tbl td .trk-note { white-space: normal; overflow-wrap: anywhere; }
.trk-form .tbl td:last-child { white-space: normal; min-width: 11rem; max-width: 16rem; }

/* provider marks on the Connections tiles: small, beside the name, on a light chip so each reads on a dark screen */
.cx-mark { width: 20px; height: 20px; vertical-align: -6px; margin-right: 9px; padding: 3px; box-sizing: content-box;
           background: #FFFFFF; border: 1px solid var(--card-line); border-radius: 7px; object-fit: contain; display: inline-block; }
.cx-tile.is-soon .cx-mark { opacity: .6; filter: grayscale(1); }
@media print { .cx-mark { display: none; } }

/* designer's finishing rules, 26 Nov (design/redesign-2026-11-26/screens/rebased/attention-groups-and-tracker.css) */

/* --- Needs attention --- */
/* each kind of job is a band inside its section's card: the name and its row count, then the table edge to edge */
.sec > .sec-body > .att-block { margin-left: 0; margin-right: 0; }
.att-block + .att-block { border-top: 1px solid var(--rule); }
.att-block > .grp-line { padding: 12px 18px 10px; }
.att-block .grp-meta { padding: 1px 8px; border-radius: 7px; background: var(--sunk); color: var(--ink-2); font-size: var(--t-xs); font-weight: 550; line-height: 20px; }
.att-block .tbl > tbody > tr > td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.att-g-title { line-height: 1.4; }
/* "8 products" opens the list in place: a small key, then the products on a quiet panel that scrolls when long */
.att-in { margin-top: 6px; }
.att-in > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; padding: 3px 9px 3px 7px; margin-left: -7px; border-radius: 7px; font-weight: 550; }
.att-in > summary::-webkit-details-marker { display: none; }
.att-in > summary::before { content: "›"; color: var(--ink-3); font-size: var(--t-md); line-height: 1; transition: transform .15s ease; }
.att-in[open] > summary::before { transform: rotate(90deg); }
.att-in > summary:hover { background: var(--sunk); color: var(--ink); }
.att-members { padding: 2px 12px; border-top: 0; border-radius: var(--r); background: var(--raised); max-height: 340px; overflow-y: auto; }
.att-members > li { padding: 8px 0; }
.att-members > li:last-child { border-bottom: 0; }
.att-members > li > a { font-weight: 500; text-decoration: none; }
.att-members > li > a:hover { text-decoration: underline; }
/* a long list of unknown codes reads as tags, not as a column 1,290 lines tall */
.att-codes { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 10px 12px; }
.att-codes > li { padding: 1px 7px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
.att-codes > li > .sub { margin: 0; display: inline; }
.att-more > summary { padding: 2px 0; }

/* --- Orders from a tracking sheet: the preview with the orders table --- */
/* choosing the tab: the button lines up with the select, not with the help line under it */
form.form-inline[action="/uploads/tracker"] { align-items: flex-start; margin: var(--s3) 0 var(--s4); }
form.form-inline[action="/uploads/tracker"] .form-actions { padding-top: 0; margin-top: 25px; }
/* inside the orders card: the three figures are a flat strip, the table runs to the card's edges */
#orders .stats { --shadow-card: none; border-color: var(--rule); margin-bottom: var(--s4); }
.sec > .sec-body > .trk-form { margin-left: 0; margin-right: 0; }
.trk-form .actionbar { margin-left: 18px; margin-right: 18px; }
/* the table fits a laptop: tighter cells, narrower selects, and the date's note wraps under the date */
.trk-form .tbl > thead > tr > th, .trk-form .tbl > tbody > tr > td { padding-left: 8px; padding-right: 8px; }
.trk-form .tbl > * > tr > :first-child { padding-left: 18px; }
.trk-form .tbl > * > tr > :last-child { padding-right: 18px; }
.trk-form .tbl select { min-width: 8.5rem; max-width: 10rem; height: 34px; }
.trk-form .tbl .trk-name { font-weight: 600; }
.trk-form .tbl td:last-child { min-width: 10.5rem; max-width: 12rem; }
.trk-form .tbl td:last-child .sub-line { margin-top: 4px; }
.trk-form .tbl .st { white-space: normal; align-items: flex-start; text-align: left; line-height: 1.35; padding-top: 3px; padding-bottom: 3px; }
.trk-form .tbl .st .sq { margin-top: 5px; }
.trk-form .tbl .trk-note { margin-top: 3px; text-align: right; }
/* polish: the date's status sits on the second line of its cell, so it is quiet words with its dot (REVIEW rule 3),
   without the tag's padding the rules above give a status on this table */
.trk-form .tbl .sub-line .st { padding: 0; line-height: inherit; }
.trk-form .tbl .sub-line .st .sq { margin-top: 0; }

/* --- founder view and ads guide --- */
/* /founder: a grid of cards on the canvas, each holding one figure (its stats strip is not a second card). The
   Watch list section holds a second grid, so it is not a card itself; "Not connected yet" is a quiet dashed strip.
   Card edges here are borders from the tokens (no shadows below the lane D marker). */
.fv { min-width: 0; }
.fv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: var(--s4); margin-top: var(--s4); align-items: start; }
.fv-card { min-width: 0; padding: 0 18px 16px; margin: 0; background: var(--surface); border: 1px solid var(--card-line);
  border-radius: var(--r-card); --shadow-card: none; }
.fv-card .stats { margin: 0 0 var(--s2); grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); background: transparent; border: 0; border-radius: 0; }
.fv-card .stat { padding: 16px 0 0; border-left: 0; border-top: 0; }
.fv-card .stat-value { white-space: normal; overflow-wrap: anywhere; }
.fv-card .stat-note { font-size: var(--t-sm); color: var(--ink-2); }
.fv-why { margin: 0 0 var(--s2); color: var(--ink-3); font-size: var(--t-sm); font-style: italic; }
.fv-small { margin: var(--s2) 0 0; color: var(--ink-3); font-size: var(--t-xs); }
.fv-go { margin: var(--s3) 0 0; font-size: var(--t-sm); font-weight: 550; }
.fv-go a { text-decoration: none; }
.fv-go a::after { content: " →"; color: var(--ink-3); }
.fv-go a:hover { text-decoration: underline; }
.fv-list { margin: var(--s2) 0 0; padding-left: 1.4em; font-size: var(--t-sm); list-style: decimal; color: var(--ink-3); }
.fv-list > li { padding: 4px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; color: var(--ink); }
.fv-list > li:last-child { border-bottom: 0; }
.fv-list a { text-decoration: none; }
.fv-list a:hover { text-decoration: underline; }
.fv-list .fv-fig { float: right; margin-left: var(--s2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fv-card .fold { margin-top: var(--s2); }
.fv-card .tbl-wrap { overflow-x: auto; max-width: 100%; }
.fv-card .tbl > * > tr > :first-child { padding-left: 0; }
.fv-card .tbl > * > tr > :last-child { padding-right: 0; }
#fv-watch.sec { background: transparent; border: 0; border-radius: 0; --shadow-card: none; margin-top: var(--s6); }
#fv-watch > .sec-head { padding: 0; margin-bottom: 0; min-height: 0; }
#fv-watch > .sec-body > .fv-grid { margin-left: 0; margin-right: 0; margin-bottom: 0; }
/* the third section, "More detail" (eight cards, 26 Nov): flat on the page like the Watch list, no card inside a card */
#fv-more.sec { background: transparent; border: 0; border-radius: 0; --shadow-card: none; margin-top: var(--s6); }
#fv-more > .sec-head { padding: 0; margin-bottom: 0; min-height: 0; }
#fv-more > .sec-body > .fv-grid { margin-left: 0; margin-right: 0; margin-bottom: 0; }
#fv-not-connected.sec { background: transparent; border: 1px dashed var(--rule-ink); --shadow-card: none; margin-top: var(--s6); }
#fv-not-connected .bullets { color: var(--ink-2); font-size: var(--t-sm); }
#fv-not-connected .sec-head h2 { color: var(--ink-2); }
/* /ads: one section per list, one block per market; a wide table scrolls inside its own block */
.ads-words { margin: 0 0 var(--s3); color: var(--ink-2); }
.sec-body > .ads-words { margin-left: 18px; margin-right: 18px; }
.ads-block { margin-top: var(--s4); min-width: 0; }
.ads-block .tbl-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--rule); border-radius: 10px; }
.ads-block .tbl > thead > tr > th { border-top: 0; }
.ads-market { font-size: var(--t-base); font-weight: 600; margin: 0 0 var(--s2); }
.ads-wh { font-weight: 400; color: var(--ink-3); font-size: var(--t-sm); margin-left: var(--s2); }
.ads-foot { margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--rule-ink); color: var(--ink-3); font-size: var(--t-sm); }
@media (max-width: 640px) { .fv-list .fv-fig { float: none; display: block; margin-left: 0; } }
/* walk fault 10: on a phone each market's lines are cards in the page; the 420px scroller inside the page (the
   finishing rules below) cut the last one in half just above the next market's heading. There the list scrolls with
   the page instead (.ads first, so this wins over the finishing rule that comes later) */
@media (max-width: 640px) {
  .ads .ads-block .tbl-wrap { max-height: none; overflow-y: visible; }
}

/* designer's finishing rules, 26 Nov (design/redesign-2026-11-26/screens/rebased/founder-view-and-ads-guide.css) */

/* --- Founder view --- */
/* cards in a row are the same height, so each card's link sits on one line across the row */
.fv-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s3); align-items: stretch; }
.fv-card { display: flex; flex-direction: column; padding: 16px 18px 12px; }
.fv-card .stat { padding: 0; }
.fv-card .stat-label { font-size: var(--t-sm); }
.fv-card .stat-value { margin-top: 6px; font-size: 34px; line-height: 1.1; }
.fv-card .stat-value .unit { font-size: var(--t-base); letter-spacing: 0; margin-left: 6px; }
.fv-card .stat-value .unk { font-size: var(--t-lg); font-style: normal; font-weight: 400; letter-spacing: -.02em; color: var(--ink-3); }
.fv-card .stat-note { margin-top: 6px; line-height: 1.4; }
.fv-card .stat-note.tone-warn { color: var(--warn); font-weight: 500; }
/* why a figure is not known: a quiet note, upright */
.fv-why { margin: var(--s1) 0 0; padding: 9px 11px; background: var(--raised); border-radius: var(--r); color: var(--ink-2); font-style: normal; line-height: 1.45; }
.fv-small { line-height: 1.45; }
/* the way on: pinned to the foot of the card, full width, with an arrow at the right */
.fv-go { margin: auto -18px 0; padding: 0 18px; }
.fv-go::before { content: ""; display: block; height: var(--s3); border-bottom: 1px solid var(--rule); margin: 0 -18px 10px; }
.fv-go a { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.fv-go a::after { content: "→"; transition: transform .18s ease; }
.fv-go a:hover { text-decoration: none; }
.fv-go a:hover::after { transform: translateX(3px); color: var(--ink); }
/* lists inside a card: name left, figure right, a second line when there is one */
.fv-list { padding-left: 0; list-style: none; color: var(--ink); }
.fv-list > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px var(--s3); padding: 7px 0; }
.fv-list > li > a, .fv-list > li > span:first-child { font-weight: 500; min-width: 0; }
.fv-list .fv-fig { float: none; margin-left: 0; white-space: nowrap; }
.fv-list .fv-small { flex-basis: 100%; margin: 0; }
/* best sellers carry their rank */
#card-best-sellers .fv-list { counter-reset: rank; }
#card-best-sellers .fv-list > li { flex-wrap: nowrap; }
#card-best-sellers .fv-list > li::before { counter-increment: rank; content: counter(rank); flex: none; width: 18px; font: 500 12px/1.6 var(--mono); color: var(--ink-3); }
#card-best-sellers .fv-list > li > a { flex: 1; }
/* a fold inside a card opens a list or a table; a long one scrolls inside the card; a table runs to the card's edges */
.fv-card .fold { margin-top: var(--s3); }
.fv-card details.fold > summary { font-size: var(--t-sm); padding: 5px 9px; margin-left: -9px; border-radius: 7px; }
.fv-card details.fold > summary:hover { background: var(--sunk); }
.fv-card details.fold[open] > .fold-body { max-height: 320px; overflow-y: auto; }
.fv-card .tbl-wrap { margin: var(--s2) -18px 0; max-width: none; width: auto; }
.fv-card .fold-body > .tbl-wrap { margin-top: 0; }
.fv-card .tbl > * > tr > :first-child { padding-left: 18px; }
.fv-card .tbl > * > tr > :last-child { padding-right: 18px; }
/* wide screens: the cards that hold a list or a table take the room they need */
@media (min-width: 1180px) {
  #card-best-sellers, #watch-running-out { grid-row: span 2; }
  #watch-by-market { grid-column: span 2; }
}

/* --- Ads guide --- */
/* each list's count sits in the head as a quiet tag */
.ads .sec-aside { padding: 1px 8px; border-radius: 7px; background: var(--sunk); color: var(--ink-2); font-size: var(--t-xs); font-weight: 550; line-height: 20px; }
.ads-words { margin-top: -4px; font-size: var(--t-sm); }
.ads .sec-body > .callout { margin-bottom: 16px; }
/* one band per market: the market on the left, the warehouse that serves it on the right, then its table edge to edge */
.ads .sec-body > .ads-block { margin: 0; }
.ads-market { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin: 0; padding: 11px 18px 10px; border-top: 1px solid var(--rule); }
.ads-wh { margin-left: 0; }
/* long lists stay inside the card: the table scrolls, its head stays put */
.ads-block .tbl-wrap { border: 0; border-radius: 0; max-height: 420px; overflow-y: auto; }
.ads-block .tbl > thead > tr > th { border-top: 1px solid var(--rule); position: sticky; top: 0; }
.ads-block .tbl > tbody > tr:last-child > td { border-bottom: 0; }
.ads-foot { margin-top: var(--s5); padding-top: 0; border-top: 0; text-align: center; }

/* --- On the way --- */
/* /onway (restoq/web/pages/onway.py): its two lists, known by their own columns. Walk fault 11: on a phone a long
   product code (#P2_RD47BlackSD_RD49WhiteSD) and its line under it ran under the next column ("Kind"); in these
   lists a cell's words now wrap inside the cell. */
@media (max-width: 640px) {
  .tbl > tbody > tr:is(:has(> td[data-label="Kind"]):has(> td[data-label="Counts"]),
                       :has(> td[data-label="Checked against the list"])) > td { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .tbl > tbody > tr:is(:has(> td[data-label="Kind"]):has(> td[data-label="Counts"]),
                       :has(> td[data-label="Checked against the list"])) > td :is(.sub, .sub-line, .cell-main) { white-space: normal; overflow-wrap: anywhere; }
}

/* --- founder segments (26 Nov) --- */
/* /founder: the 25 cards in five groups. A row of flat keys jumps to each group; each group's header stays just
   under the top bar while its cards scroll (the page itself scrolls), on the canvas so the cards pass under it, and
   below the top bar, its popovers and the phone menu. */
.fv-jump { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
.fv-jump a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px;
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .12s ease, color .12s ease; }
.fv-jump a:hover { color: var(--ink); background: var(--sunk); }
.fv-jump a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.fv-jump .ico { color: var(--ink-3); }
.fv-jump a:hover .ico { color: var(--ink); }
.fv-seg { margin-top: var(--s6); min-width: 0; }
.fv-jump + .fv-seg { margin-top: var(--s3); }
.fv-seg-head { position: sticky; top: var(--bar-h); z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: var(--s3) 0; background: var(--bg); }
.fv-seg-ico { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 1px solid var(--card-line);
  border-radius: 7px; background: var(--surface); color: var(--ink-2); }
.fv-seg-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; line-height: 1.45; }
.fv-seg > .fv-grid { margin-top: var(--s1); }

/* /founder, the card look (26 Nov, second pass; restoq/web/pages/founder.py). Rows of three at 1366, two at about
   900, one on a phone; the cards of a row share its height and their links sit level at the foot. A head of an icon
   chip (the mock-up's .chip) beside the label, the figure under it, a small chart drawn from the card's own numbers.
   Colour by meaning only (founder.py, COLOUR): one ink card; a red, amber or green tint with its state in words. */
.fv-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); flex-wrap: wrap; min-width: 0; }
.fv-top > .fv-jump { margin-left: -10px; }
.fv-top + .fv-seg { margin-top: var(--s1); }
.fv-when { color: var(--ink-3); font-size: var(--t-xs); white-space: nowrap; }
.fv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); align-items: stretch; }
.fv-card[data-wide] { grid-column: span 2; }
/* the finishing rules' two-row cards would break a row's shared height: every card is one row tall now */
@media (min-width: 1180px) { #card-best-sellers, #watch-running-out { grid-row: auto; } }
@media (max-width: 1099px) { .fv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .fv-grid { grid-template-columns: minmax(0, 1fr); }
  .fv-card[data-wide] { grid-column: auto; }
}
.fv-card { position: relative; padding: 14px 18px 12px; }
.fv-chip { position: absolute; top: 14px; left: 18px; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--sunk); color: var(--ink-2); }
.fv-chip .ico { width: 17px; height: 17px; }
.fv-card .stat-label { display: flex; align-items: center; min-height: 32px; padding-left: 44px; color: var(--ink-2);
  font-weight: 500; line-height: 1.3; }
.fv-card .stat-value { margin-top: 10px; font-size: 30px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.fv-card .stat-value .unit { font-size: var(--t-base); font-weight: 450; letter-spacing: 0; color: var(--ink-2); margin-left: 5px; }
/* a figure that is not known: the words, quiet, not a headline */
.fv-card .stat-value .unk { font-size: var(--t-md); font-weight: 500; font-style: normal; letter-spacing: -.005em; color: var(--ink-3); }
.fv-card .stat-note { margin-top: 4px; color: var(--ink-2); }
.fv-why { margin-top: var(--s2); }

/* the state tag, top right, on the card's own white so it reads on its tint */
.fv-tag { position: absolute; top: 19px; right: 16px; display: inline-flex; align-items: center; gap: 5px; height: 22px;
  padding: 0 8px; border-radius: 7px; background: var(--surface); font-size: var(--t-xs); font-weight: 550; white-space: nowrap; }
.fv-tag .sq { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fv-tag.is-act { color: var(--bad); } .fv-tag.is-watch { color: var(--warn); } .fv-tag.is-fine { color: var(--ok); }
.fv-card[data-state] .stat-label { padding-right: 84px; }

/* the tints: the state's soft colour half-way to the card's white; the faint words step up to the second ink so every
   word keeps 4.5:1 on the tint, in both themes */
.fv-card[data-state] { --ink-3: var(--ink-2); }
.fv-card[data-state="act"] { background: color-mix(in srgb, var(--bad-bg) 60%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.fv-card[data-state="watch"] { background: color-mix(in srgb, var(--warn-bg) 60%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.fv-card[data-state="fine"] { background: color-mix(in srgb, var(--ok-bg) 60%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 20%, transparent); }
.fv-card[data-state] .fv-chip { background: var(--surface); }
.fv-chip.is-act { color: var(--bad); } .fv-chip.is-watch { color: var(--warn); } .fv-chip.is-fine { color: var(--ok); }
.fv-card[data-state] .fv-why, .fv-card[data-state] details.fold > summary:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }

/* the ink card: the dark surface of the top bar and the sign-in panel, light words, the figure in the panel's green */
.fv-card[data-look="ink"] { --ink: var(--bar-ink); --ink-2: var(--bar-ink-2); --ink-3: var(--bar-ink-2); --rule: var(--bar-line);
  --raised: rgba(255, 255, 255, .06); --sunk: rgba(255, 255, 255, .09); --line: rgba(255, 255, 255, .3);
  --focus: #5CCB9C; --accent: #5CCB9C; --ok: #7EDCAE; --warn: #F0C36A; --bad: #FF9A8B;
  background: var(--bar); border-color: var(--bar-line); color: var(--ink); color-scheme: dark; }
.fv-card[data-look="ink"] .stat-value { color: #5CCB9C; }
.fv-card[data-look="ink"] .stat-value .unk { color: var(--ink-2); }
.fv-chip.is-ink { background: rgba(255, 255, 255, .08); color: #5CCB9C; }

/* charts: bars are rects in a stretched viewBox; the words and figures beside them are plain text */
.fv-split, .fv-part, .fv-cmp, .fv-trend, .fv-markets { margin-top: var(--s3); min-width: 0; }
.fv-bar { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
.fv-bar.fv-slim { height: 6px; border-radius: 3px; }
.fv-track { fill: var(--sunk); }
.fv-k1 { fill: var(--accent); } .fv-k2 { fill: var(--ink); fill-opacity: .62; } .fv-k3 { fill: var(--ink); fill-opacity: .32; }
.fv-k4 { fill: var(--ink); fill-opacity: .14; } .fv-kw { fill: var(--warn); } .fv-kb { fill: var(--bad); }
.fv-legend { display: flex; flex-wrap: wrap; gap: 4px var(--s4); margin-top: 8px; font-size: var(--t-xs); color: var(--ink-2); }
.fv-legend li { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.fv-legend b { font-weight: 550; color: var(--ink); }
.fv-sw { width: 8px; height: 8px; border-radius: 2px; flex: none; align-self: center; background: var(--ink); }
.fv-sw.fv-k1 { background: var(--accent); } .fv-sw.fv-k2 { opacity: .62; } .fv-sw.fv-k3 { opacity: .32; } .fv-sw.fv-k4 { opacity: .16; }
.fv-sw.fv-kw { background: var(--warn); } .fv-sw.fv-kb { background: var(--bad); }
.fv-cap { margin-top: 6px; font-size: var(--t-xs); color: var(--ink-3); }
.fv-cmp { display: grid; gap: 8px; }
.fv-cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px var(--s3); font-size: var(--t-xs); color: var(--ink-2); }
.fv-cmp-row b { font-weight: 550; color: var(--ink); }
.fv-cmp-row .fv-bar { grid-column: 1 / -1; }
/* best sellers: a ranked bar under each name, its length the share of the top one */
.fv-ranked > li { flex-wrap: wrap; padding: 7px 0 8px; }
#card-best-sellers .fv-ranked > li { flex-wrap: wrap; }
#card-best-sellers .fv-ranked > li > a { flex: 1 1 0; }
.fv-rank { display: block; flex: 0 0 calc(100% - 18px); margin-left: 18px; height: 4px; border-radius: 2px; overflow: hidden; }
/* the 12-week trend: the columns full width, the last week in the accent, the first and last week's units at the ends */
.fv-trend .spark svg { width: 100%; height: auto; }
.fv-trend .spark rect.b, .fv-trend .spark rect.b-zero { fill: var(--ink); fill-opacity: .2; transform-box: fill-box; transform-origin: center; transform: scaleX(.58); }
.fv-trend .spark svg > rect.b:first-of-type { fill-opacity: .55; }
.fv-trend .spark rect.b:last-of-type { fill: var(--accent); fill-opacity: 1; }
.fv-ends { display: flex; justify-content: space-between; gap: var(--s2); margin-top: 6px; font-size: var(--t-xs); color: var(--ink-3); }
.fv-ends span { display: inline-flex; align-items: baseline; gap: 6px; }
.fv-ends b { font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
/* sales by market: a row per market, the figures beside the name, two bars under it on one scale */
.fv-key { margin-top: 0; }
.fv-mkt { margin-top: 6px; }
.fv-m { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) 64px 64px 52px; gap: 4px var(--s3);
  align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.fv-m:last-child { border-bottom: 0; }
.fv-m-name { grid-column: 1; grid-row: 1; font-weight: 500; overflow-wrap: anywhere; }
.fv-mbar { grid-column: 2; grid-row: 1; display: block; width: 100%; height: 13px; }
.fv-m-n { grid-column: 3; } .fv-m-b { grid-column: 4; } .fv-m-c { grid-column: 5; }
.fv-m-n, .fv-m-b, .fv-m-c { grid-row: 1; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fv-m-b { color: var(--ink-3); }
.fv-m-c { font-size: var(--t-xs); font-weight: 550; color: var(--ink-2); }
.fv-m-c.is-up { color: var(--ok); } .fv-m-c.is-down { color: var(--bad); }
@media (max-width: 640px) {
  .fv-m { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .fv-m-n { grid-column: 2; } .fv-m-b { grid-column: 3; } .fv-m-c { grid-column: 4; }
  .fv-mbar { grid-column: 1 / -1; grid-row: 2; }
}
/* /founder, the compact cards (26 Nov, third pass; founder.py card()). At rest a card shows its head, figure, one line,
   chart and link; a tap anywhere on it (the summary of a details element: no script, Enter and Space work) opens the
   rest in place under a dashed rule; a chevron chip at the right of the head turns when it is open. The link is a row
   of its own under the details, so a click on it goes to its page and never folds the card. Small icons are masks
   drawn here from the frame's own paths (no element, no image file). */
.fv-card { --fv-mask-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  --fv-mask-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 13V3M4 7l4-4 4 4'/%3E%3C/svg%3E");
  --fv-mask-note: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='5.8'/%3E%3Cpath d='M8 7.2v4M8 4.9v.2'/%3E%3C/svg%3E");
  --fv-mask-why: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.2l6.3 11.3H1.7z'/%3E%3Cpath d='M8 6.6v3.1M8 11.6v.2'/%3E%3C/svg%3E");
  --fv-mask-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 4.5h7.5M6 8h7.5M6 11.5h7.5M2.6 4.5h.2M2.6 8h.2M2.6 11.5h.2'/%3E%3C/svg%3E");
  --fv-mask-table: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3.5h10a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5zM2.5 7h11M6.5 7v5.5'/%3E%3C/svg%3E");
  --fv-mask-key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M3 3h4v4H3zM9 3h4v4H9zM3 9h4v4H3z'/%3E%3C/svg%3E");
  padding-bottom: 0; }
.fv-more { min-width: 0; }
.fv-sum { display: block; margin: -14px -18px 0; padding: 14px 18px 0; list-style: none; cursor: pointer;
  border-radius: var(--r-card) var(--r-card) 0 0; -webkit-tap-highlight-color: transparent; }
.fv-sum::-webkit-details-marker { display: none; }
.fv-sum::marker { content: ""; }
.fv-sum:focus { outline: none; }
.fv-sum:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.fv-more[open] > .fv-sum { border-radius: var(--r-card) var(--r-card) 0 0; }
/* the chevron chip, level with the icon chip at the right of the head: the summary's ::after is the chip, ::before
   the chevron on it; a screen reader hears "More" or "Less" (two hidden words, one shown at a time) */
.fv-sum::after { content: ""; position: absolute; top: 16px; right: 14px; width: 28px; height: 28px;
  border-radius: 8px; background: var(--sunk); transition: background-color .12s ease; }
.fv-more:not([open]) .fv-sr-less, .fv-more[open] .fv-sr-more { display: none; }
.fv-sum::before { content: ""; position: absolute; z-index: 1; top: 23px; right: 21px; width: 14px; height: 14px;
  background: var(--ink-2); -webkit-mask: var(--fv-mask-chev) center / 14px no-repeat; mask: var(--fv-mask-chev) center / 14px no-repeat;
  transition: transform .18s ease; }
.fv-more[open] > .fv-sum::before { transform: rotate(180deg); background: var(--ink); }
.fv-sum:hover::before { background: var(--ink); }
.fv-sum:hover::after, .fv-more[open] > .fv-sum::after { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.fv-card[data-state] .fv-sum::after { background: var(--surface); }
.fv-card[data-look="ink"] .fv-sum::after { background: rgba(255, 255, 255, .08); }
.fv-card[data-look="ink"] .fv-sum:hover::after, .fv-card[data-look="ink"] .fv-more[open] > .fv-sum::after { background: rgba(255, 255, 255, .16); }
/* the head keeps room for the chevron, and the state tag sits just left of it */
.fv-sum .stat-label { padding-right: 36px; }
.fv-sum .fv-tag { right: 50px; }
.fv-card[data-state] .fv-sum .stat-label { padding-right: 126px; }
/* what the card folds away: groups under a dashed rule, a small icon before each */
.fv-more[open] > .fv-sum { padding-bottom: var(--s3); border-bottom: 1px dashed var(--rule); margin-bottom: var(--s3); }
.fv-more > .fv-sum ~ * { margin: 10px 0 0; }
.fv-more > .fv-sum + * { margin-top: 0; }
.fv-g { position: relative; min-width: 0; margin: 0; padding-left: 22px; }
.fv-g::before { content: ""; position: absolute; left: 0; top: 1px; width: 14px; height: 14px; background: var(--ink-3);
  -webkit-mask: var(--fv-mask-note) center / 14px no-repeat; mask: var(--fv-mask-note) center / 14px no-repeat; }
.fv-g.g-why::before { -webkit-mask-image: var(--fv-mask-why); mask-image: var(--fv-mask-why); }
.fv-g.g-list::before { -webkit-mask-image: var(--fv-mask-list); mask-image: var(--fv-mask-list); top: 2px; }
.fv-g.g-table::before { -webkit-mask-image: var(--fv-mask-table); mask-image: var(--fv-mask-table); top: 2px; }
.fv-g.g-key::before { -webkit-mask-image: var(--fv-mask-key); mask-image: var(--fv-mask-key); top: 0; }
.fv-more > .fv-sum ~ .fv-small { color: var(--ink-2); font-size: var(--t-xs); line-height: 1.5; }
.fv-more > .fv-sum ~ .fv-g.fv-small { line-height: 16px; }
.fv-gh { margin: 0; font-size: var(--t-xs); font-weight: 600; line-height: 16px; color: var(--ink-2); }
.fv-more .fv-g > .fv-list { margin-top: 2px; }
.fv-more .fv-g > .fv-list > li:first-child { padding-top: 4px; }
.fv-more .fv-g > .fv-list.is-long { max-height: 300px; overflow-y: auto; }
.fv-more .g-table .tbl-wrap { margin: 4px -18px 0 -40px; max-height: 320px; overflow-y: auto; }
.fv-more > .fv-mkt-more > .fv-m:first-child { padding-top: 0; }
/* the link: the whole foot row is its hit area */
.fv-go { margin: auto -18px 0; padding: 0; }
.fv-go::before { margin: 0; }
.fv-go a { padding: 10px 18px 12px; border-radius: 0 0 var(--r-card) var(--r-card); }
.fv-go a:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.fv-go a:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
/* a change against the period before: an arrow beside its words, green up, red down */
.fv-card[data-change] .stat-note::before, .fv-m-c.is-up::before, .fv-m-c.is-down::before { content: ""; display: inline-block;
  width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; background: var(--ok);
  -webkit-mask: var(--fv-mask-arrow) center / 12px no-repeat; mask: var(--fv-mask-arrow) center / 12px no-repeat; }
.fv-card[data-change="down"] .stat-note::before, .fv-m-c.is-down::before { background: var(--bad); transform: rotate(180deg); }
.fv-card[data-change] .stat-note { display: block; }
.fv-m-c.is-up::before, .fv-m-c.is-down::before { width: 10px; height: 10px; margin-right: 2px; -webkit-mask-size: 10px; mask-size: 10px; }
/* figures line up */
.fv-card .stat-value, .fv-card .stat-note, .fv-legend b, .fv-cmp-row b, .fv-ends b, .fv-more > .fv-sum ~ .fv-small, .fv-cap { font-variant-numeric: tabular-nums; }
