/* GENERATED by build.mjs: the real demos' rules from assets/css/site.css (glass, scanner demo, result card, the scanner's surface, what it reads, diagrams, POS demo, where product info comes from, one sale, start to finish, Price Match Tracker, a working copy, responsive, page pieces, narrower screens), scoped to .skin,
   their old tokens re-pointed at the new ones: Paper, Ink, the two fonts, flat surfaces with Ink edges, no shadows.
   The build rewrites these in the new system; markup and behaviour stay as they are. Do not edit by hand. */
.skin {
  --font: var(--text); --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-btn: 12px; --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 20px; --r-panel: 20px; --max: 1200px;
  --bg: #FFFFFF; --ink2: var(--ink-2); --dot: rgba(20,20,20,.14); --line: rgba(20,20,20,.12); --hairline: rgba(20,20,20,.24);
  --well2: #E6E6E6; --g-top: #FFFFFF; --g-bot: #FFFFFF; --g-edge: #FFFFFF; --g-hi: #FFFFFF; --g-solid: #FFFFFF;
  --edge: inset 0 0 0 1.5px var(--ink); --g-shadow: 0 0 #0000; --g-shadow-hover: 0 0 #0000; --g-shadow-press: 0 0 #0000; --sheet-shadow: 0 0 #0000;
  --node-shadow: 0 0 #0000; --node-shadow-on: 0 0 #0000; --chip-shadow: none; --btn-edge: none; --btn-shadow: none; --soft-edge: none; --recess: none;
  --ring: 0 0 0 2px var(--lime); --dark-fill: var(--ink); --paper-fill: #FFFFFF; --press-dur: 120ms;
  --btn-bg: var(--ink); --btn-ink: #FFFFFF; --btn2: #F2F2F2; --btn2-hover: #E6E6E6;
  --lime-ink: #3F4F0A; --lime-well: rgba(196,240,51,.35); --warn-ink: #7A4B00; --warn-well: rgba(227,196,112,.35); --danger-ink: var(--red); --danger-well: rgba(155,28,18,.10);
  --fade-dur: 180ms; --fade: cubic-bezier(.2, 0, 0, 1);
  font-family: var(--text); color: var(--ink);
}
.skin .visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@scope (.skin) {
/* ───────────── glass ───────────── */
.glass { background: var(--paper-fill); border: 1px solid var(--g-edge); box-shadow: var(--edge), var(--g-shadow); }
/* A sheet: the larger surfaces (panels, the POS demo, the result card, the phone's panel). Not interactive. */
.surface-sheet { box-shadow: var(--edge), var(--sheet-shadow); }
.panel {
  margin-inline: max(var(--panel-inset), var(--safe-l)) max(var(--panel-inset), var(--safe-r)); border-radius: clamp(36px, 4vw, 48px);
  padding: clamp(28px, 5vw, 72px) max(20px, calc(var(--gutter) - var(--panel-inset)));
  position: relative;
}
.panel > .panel-in { max-width: var(--max); margin-inline: auto; display: flex; flex-direction: column; gap: clamp(28px, 3.4vw, 48px); }
@media (prefers-reduced-transparency: reduce) {
  .glass, .site-header::before, .menu-sheet { background: var(--g-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

/* ───────────── scanner demo (sample codes → result) ───────────── */
.scan-demo { display: flex; flex-direction: column; gap: 24px; }
.samples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sample {
  position: relative; border: 0; cursor: pointer; border-radius: 24px; padding: 16px 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-weight: 700; font-size: 15px; min-width: 0; color: var(--ink);
}
/* Selected: a lime ring, with no transition. */
.sample[aria-expanded="true"] { box-shadow: var(--ring), var(--edge), var(--g-shadow); transition: none; }
.sample .code-face { width: 100%; aspect-ratio: 1.2 / 1; background: #fff; border-radius: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; box-shadow: inset 0 0 0 1px rgba(12,11,8,.05); }
.sample .code-face svg { width: 62%; height: auto; max-height: 82%; }
.sample .lbl { display: inline-flex; align-items: center; gap: 8px; }
.sample .lbl svg { width: 16px; height: 16px; }
/* The result opens over the codes, in the space the grid already takes up: nothing below moves (CLS 0). */
.samples-stage { position: relative; }
/* Covered by an open card: the codes fade out, then are hidden. Hidden, not just transparent: when an opacity fade
   ends, the browser paints the codes again (their QR images included: 19 ms a frame on a low-end Android);
   hidden content isn't painted at all. Coming back, visibility returns at once and the fade runs. */
.samples { transition: opacity var(--fade-dur) var(--fade), visibility 0s linear 0s; }
.samples[data-covered="true"] { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--fade-dur) var(--fade), visibility 0s linear var(--fade-dur); }
/* Reduced motion stretches every transition to .01ms (the rule under "scroll reveal"), visibility's too: the codes
   would still be hidden in the instant a card closes, too hidden to take focus back. */
@media (prefers-reduced-motion: reduce) { .samples { transition: none !important; } }
/* No scroll box: the card's shadow is never clipped and the card never scrolls inside itself (scan-demo.js grows
   the stage when the card is taller than the codes). */
.result-slot { position: absolute; inset: 0; z-index: 2; }
/* Fast open (scan-demo.js): every card is built ahead, laid out and hidden, its layout and paint contained so
   revealing one touches nothing else. Placed with `translate` (no layout). Its shadow moves and fades with it
   (only opacity and transform animate). A card leaving (data-leaving) is closed but still drawn while it fades,
   and click-through: the codes, or the next card, under it answer the pointer at once. The open card is always
   the one on top ("Try another code": the new card fades in over the old one, which fades out under it). */
.result-slot[data-mode="prepared"] { pointer-events: none; }
.result-slot[data-mode="prepared"] > .result-card { position: absolute; top: 0; left: 0; right: 0; visibility: hidden; contain: layout paint; }
.result-slot[data-mode="prepared"] > .result-card[data-open="true"] { visibility: visible; pointer-events: auto; z-index: 1; }
.result-slot[data-mode="prepared"] > .result-card[data-leaving="true"] { visibility: visible; pointer-events: none; }
/* ...except its Close: a double click or tap on Close lands there and does nothing, instead of opening the code
   under it (scan-demo.js keeps the focus on the code). */
.result-slot[data-mode="prepared"] > .result-card[data-leaving="true"] .rc-close { pointer-events: auto; }
/* Reduced motion turns every change into a .01ms transition (the rule under "scroll reveal"), visibility's too: the
   card and its title would still count as hidden in the frame the title is focused, and the focus would be lost. */
@media (prefers-reduced-motion: reduce) {
  .result-slot[data-mode="prepared"] > .result-card, .result-slot[data-mode="prepared"] > .result-card * { transition: none !important; }
}
.result-slot .result-card { background: var(--g-solid); }
/* The demo's card groups its buttons into rows (scan-demo.js): the main button with the other actions, and
   the details button with "Try another code". On a phone the main button keeps its own full-width row. */
.result-slot .rc-acts, .result-slot .rc-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.result-slot .rc-acts { align-items: flex-end; }
.result-slot .rc-acts > .main-act { display: contents; } /* its note gets a row of its own; the button sits beside the other actions */
.result-slot .rc-acts > .main-act > .act-line { flex-basis: 100%; }
@media (min-width: 641px) { .result-slot .rc-acts > .rc-secondary { margin-bottom: 6px; } } /* centred on the 56px main button beside it */
.result-slot .rc-foot { align-items: center; }
.result-slot .rc-foot .rc-details-btn, .result-slot .rc-foot .rc-another { align-self: auto; }
@media (max-width: 640px) { .result-slot .rc-acts > .main-act > * { flex-basis: 100%; } }
/* Phones and tablets are already where the scanner runs: the same width as the scanner page's desktop-only QR. */
.details { border-top: 1px solid var(--line); }
.details dl { margin: 0; display: flex; flex-direction: column; }
.details .kv { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.details .kv dt { flex-shrink: 0; }
.details .kv dd { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.details dt { color: var(--ink2); }
.details dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

/* ───────────── result card: one layout for every device ─────────────
   type → title → safety line → one main button → Copy / Share → details. Spacing from 4/8/12/16/24 only. */
.result-card { border-radius: 32px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.result-card .rcard-type { font-size: 14px; gap: 8px; }
.rc-close { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 12px; background: var(--btn2); box-shadow: var(--soft-edge); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rc-close svg { width: 20px; height: 20px; }
/* The demo's "Try another code": the next sample's result, in place (assets/js/scan-demo.js). */
.result-card .rc-another { align-self: flex-start; }
.rc-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.result-card .rcard-title { font-size: clamp(28px, 3vw, 36px); outline: none; }
.result-card .main-action { align-self: flex-start; max-width: 100%; }
.main-act { display: flex; flex-direction: column; gap: 8px; }
.main-act .main-action { align-self: flex-start; }
.demo-note:empty { display: none; }
.rc-secondary { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-secondary:empty { display: none; }
.rc-details-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-btn); background: var(--btn2); box-shadow: var(--soft-edge); font-size: 15px; font-weight: 600; cursor: pointer; }
.rc-details-btn svg { width: 16px; height: 16px; transition: transform var(--spring-snappy-dur) var(--spring-snappy); }
.rc-details-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
/* Details: the button toggles `hidden`; the contents ease in (card.js). */
.rc-details-in { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* The result card's contents (tools/qr-scanner/lib/card.js): the scanner, the demo and the phone preview share them. */
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.results-head h2 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -0.015em; }
.num-badge { width: 32px; height: 32px; border-radius: 999px; background: var(--lime); color: #0C0B08; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.result-sub { color: var(--ink2); font-size: 15px; line-height: 1.45; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert strong { display: block; margin-bottom: 2px; }
.main-act:empty { display: none; }
.main-act .btn { height: 56px; font-size: 17px; }
/* A label can be long ("Open in OpenStreetMap"), or as long as what was scanned ("Email asha@example.com"): it wraps inside its
   button rather than running past the card. One line keeps the usual height (44px, the main button 56px);
   the text starts beside its icon. The smaller buttons have the details button's 16px sides, so a phone
   number ("Call +1 202-555-0143") stays on one line on a 320px phone instead of breaking at a hyphen. */
.result-card .btn { max-width: 100%; height: auto; min-height: 44px; padding-block: 10px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.result-card .btn-sm { padding-inline: 16px; }
.result-card .main-act .btn { min-height: 56px; }
.details-sec { border-top: 1px solid var(--line); padding-top: 12px; }
.details-h { font-size: 14px; font-weight: 700; color: var(--ink2); margin-bottom: 4px; }
.fields { margin: 0; display: flex; flex-direction: column; }
.fields .row { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.fields .row:last-child { border-bottom: 0; }
.fields dt { color: var(--ink2); font-size: 15px; }
.fields dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
.fields .val.em { font-weight: 700; }
.fields .val.mono { font-family: var(--mono); font-size: 15px; }
.fields .val.block { white-space: pre-wrap; display: block; width: 100%; }
.basis { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink2); flex-wrap: wrap; min-width: 0; }
.basis svg { width: 16px; height: 16px; color: var(--lime-ink); flex-shrink: 0; }
.basis strong { color: var(--ink); }
.basis-tag { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.fields .field-note { grid-column: 1 / -1; display: block; font-size: 14px; color: var(--ink2); }
.mini { position: relative; min-height: 36px; min-width: 44px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--btn2); box-shadow: var(--soft-edge); font-size: 14px; font-weight: 600; cursor: pointer; }
/* A 44px-tall hit area around the 36px button, so the field rows keep their height. */
.mini::after { content: ''; position: absolute; inset: -4px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.raw summary { cursor: pointer; font-size: 14px; color: var(--ink2); min-height: 44px; display: flex; align-items: center; }
.raw pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13px; background: var(--well); padding: 12px; border-radius: 12px; margin: 0 0 8px; max-height: 260px; overflow: auto; }
.raw dl { margin: 0; display: grid; gap: 4px; font-size: 14px; }
.raw dl div { display: flex; gap: 8px; } .raw dt { color: var(--ink2); } .raw dd { margin: 0; }
.lookup { display: flex; flex-direction: column; gap: 12px; }
.lookup-found:empty { display: none; }
.lookup-hint, .lookup-note { font-size: 14px; color: var(--ink2); display: flex; gap: 8px; align-items: flex-start; }
.lookup-note svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--lime-ink); margin-top: 2px; }
.ai-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.ai-label svg { width: 16px; height: 16px; }
.lookup-error { font-size: 15px; color: var(--danger-ink); }
.lookup-empty { font-size: 15px; color: var(--ink2); display: flex; flex-direction: column; gap: 8px; }
.lookup-empty .lookup-says { color: var(--ink); }
.lookup-name { font-family: var(--display); font-size: 22px; }
.source { border-radius: 18px; background: var(--well); box-shadow: inset 0 1px 2px rgba(12,11,8,.05); padding: 14px 16px; }
.source h4 { font-size: 14px; font-weight: 700; color: var(--ink2); }
.attribution { font-size: 13px; color: var(--ink2); margin-top: 6px; }
@media (max-width: 640px) {
  .result-card { padding: 20px; border-radius: 24px; }
  .result-card .main-action, .main-act .main-action { align-self: stretch; width: 100%; padding-inline: 8px; } /* full width, its label centred: a long one uses the sides before it wraps */
  .fields .row { grid-template-columns: minmax(0, 1fr); }
}

/* Layer 1: up to three facts, then the one button with its line (a warning only when a trigger fired). */
/* Each fact is as wide as its value and shares a line only when that fits, so an ID or a network name is never
   broken mid-word by a column too narrow for it; a value wider than the card still wraps, as a last resort. */
dl.facts { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 16px; }
dl.facts:empty { display: none; }
dl.facts .fact { flex: 1 1 auto; min-width: min(128px, 100%); display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 13px; color: var(--ink2); }
.facts dd { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.facts dd.mono { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.act-line { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 15px; line-height: 1.4; }
.act-line svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.act-warn { padding: 12px; border-radius: 12px; background: var(--warn-well); }
.act-warn svg { color: var(--warn-ink); }
.act-warn[data-level="danger"] { background: var(--danger-well); }
.act-warn[data-level="danger"] svg { color: var(--danger-ink); }
.act-note { color: var(--ink2); }
.act-note svg { color: var(--lime-ink); }
.lookup-main:empty { display: none; }

/* Payments: a specific app one tap further (Android), the three steps to pay from a saved image (iPhone),
   and one hint line. */
.apps-more summary { cursor: pointer; font-size: 15px; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.apps-more[open] summary { margin-bottom: 8px; }
.pay-apps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; }
.pay-apps .pay-app { width: 100%; }
.pay-steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.pay-hint { margin: 0; }

/* Layer 2: sections with short labels, score chips, nutrient levels, and the database source. */
.details-sec h4 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); margin-bottom: 4px; }
.lookup-panel-sections:empty, .lookup-sources:empty { display: none; }
.lookup-panel-sections, .lookup-sources { display: flex; flex-direction: column; gap: 16px; }
.fields .val.muted { color: var(--ink2); font-weight: 400; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.score { border-radius: 14px; padding: 10px 12px; background: var(--well); box-shadow: inset 0 1px 2px rgba(12,11,8,.05); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.score-name { font-size: 13px; color: var(--ink2); }
.score-grade { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.1; }
.score[data-grade="none"] .score-grade { font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink2); }
.score-meaning { font-size: 13px; color: var(--ink2); }
.levels .row[data-level="high"] .level { color: var(--danger-ink); font-weight: 700; }
.levels .row[data-level="medium"] .level { color: var(--warn-ink); font-weight: 700; }
.levels .row[data-level="low"] .level { color: var(--lime-ink); font-weight: 700; }
.additives { font-size: 15px; overflow-wrap: anywhere; }
.ingredients summary { cursor: pointer; font-size: 15px; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.ingredients p { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.source-links { margin-top: 6px; }
.source-links a { font-weight: 600; }
.ai-foot { font-size: 13px; color: var(--ink2); }

/* ───────────── the scanner's surface ─────────────
   The live scanner (tools/qr-scanner/) and the phone preview share these rules, so the preview is drawn by
   the scanner's own CSS. Sizes follow the width of .scan-ui itself (a container), not the page: the preview
   is a phone wherever it sits. */
.privacy-line { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 15px; }
.privacy-line svg { width: 18px; height: 18px; flex-shrink: 0; }
.scan-ui { container: scan-ui / inline-size; }
.scan-ui .scanner { display: flex; flex-direction: column; gap: 14px; outline: none; }
.scan-ui .viewport {
  position: relative; aspect-ratio: 4 / 3; background: #0C0B08; border-radius: 28px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(248,245,238,.08);
}
.scan-ui .idle { position: relative; text-align: center; color: #F8F5EE; padding: 24px; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scan-ui .idle-icon { width: 52px; height: 52px; color: var(--lime); }
.scan-ui .idle p { font-size: 16px; line-height: 1.45; color: rgba(248,245,238,.86); }
/* The viewfinder: lime corners and a scanline sweeping its height (84cqh: the frame is a size container). */
.scan-ui .frame { position: absolute; width: 62%; aspect-ratio: 1; max-height: 78%; pointer-events: none; container-type: size; }
.scan-ui .frame i { position: absolute; width: 32px; height: 32px; border: 0 solid var(--lime); }
.scan-ui .frame i:nth-child(1) { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 14px; }
.scan-ui .frame i:nth-child(2) { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 14px; }
.scan-ui .frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 14px; }
.scan-ui .frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 14px; }
.scan-ui .frame::after { content: ''; position: absolute; left: 6%; right: 6%; height: 2px; border-radius: 2px; background: var(--lime); top: 8%; animation: scanline 2.2s cubic-bezier(.45, 0, .2, 1) infinite alternate; }
@keyframes scanline { to { transform: translateY(84cqh); } }
@media (prefers-reduced-motion: reduce) { .scan-ui .frame::after { animation: none; top: 50%; } }
.scan-ui .status { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0 auto; width: max-content; max-width: calc(100% - 24px); text-align: center;
  font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 12px; background: rgba(248,245,238,.94); color: #0C0B08; }
.scan-ui .status:empty { display: none; }
.scan-ui .status.err { background: #FFE5E0; color: #7A1A10; }
.scan-ui .controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.scan-ui .results-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.scan-ui .empty-result { border-radius: 28px; padding: 24px; display: flex; gap: 14px; align-items: flex-start; color: var(--ink2); font-size: 16px; line-height: 1.45; }
.scan-ui .empty-result strong { color: var(--ink); display: block; }
.scan-ui .results-col:has(.results:not(:empty)) .empty-result { display: none; }
/* Scrolled to just under the header: html's scroll-padding-top leaves the header's room, this adds a little air. */
.scan-ui .results { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 16px; }
.scan-ui .results:empty { display: none; }
.scan-ui .result { animation: rise var(--spring-standard-dur) var(--spring-standard) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.scan-ui .result .rcard-title { font-size: clamp(26px, 3vw, 34px); }
@container scan-ui (max-width: 600px) {
  .scan-ui .viewport { aspect-ratio: 3 / 4; border-radius: 24px; }
  .scan-ui .controls .btn { flex: 1 1 auto; }
  .scan-ui .result { padding: 20px; border-radius: 24px; }
  .scan-ui .result .rcard-title { font-size: 26px; }
  .scan-ui .result .main-action, .scan-ui .main-act .main-action { align-self: stretch; width: 100%; padding-inline: 8px; }
  .scan-ui .fields .row { grid-template-columns: minmax(0, 1fr); }
}

/* ───────────── what it reads: a mind map (assets/js/reads-map.js) ─────────────
   The nested list reads as an indented tree with rails; from 1024px the script lays it out radially. */
.reads-map { position: relative; }
.rm-lines { display: none; }
.rm-root, .rm-groups, .rm-leaves { list-style: none; margin: 0; padding: 0; }
.rm-center { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 16px; background: var(--dark-fill); box-shadow: var(--btn-edge), 0 1px 2px rgba(12,11,8,.25), 0 12px 24px -12px rgba(12,11,8,.5); color: var(--btn-ink); font-family: var(--display); font-weight: 600; font-size: 20px; white-space: nowrap; }
.rm-groups { display: flex; flex-direction: column; gap: 16px; margin-left: 24px; padding: 16px 0 0 24px; border-left: 1px solid var(--hairline); }
.rm-branch { position: relative; }
.rm-branch::before { content: ''; position: absolute; left: -24px; top: 22px; width: 16px; height: 1px; background: var(--hairline); }
.rm-group { min-height: 44px; padding: 0 16px; border: 1px solid var(--g-edge); border-radius: 12px; background: var(--paper-fill); box-shadow: inset 0 1px 0 #fff, var(--chip-shadow); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap; color: var(--ink); transition: transform var(--press-dur) ease-out; }
.rm-group[aria-pressed="true"] { background: var(--dark-fill); color: var(--btn-ink); border-color: transparent; }
.rm-group:active { transform: scale(.96); }
.rm-leaves { display: flex; flex-direction: column; gap: 8px; margin-left: 24px; padding: 8px 0 0 24px; border-left: 1px solid var(--hairline); }
.rm-leaf { position: relative; display: flex; align-items: center; gap: 12px; max-width: 360px; min-width: 0; padding: 8px 12px; border-radius: 16px; border: 1px solid var(--g-edge); background: var(--paper-fill); box-shadow: inset 0 1px 0 #fff, var(--chip-shadow); }
.rm-leaf::before { content: ''; position: absolute; left: -24px; top: 50%; width: 16px; height: 1px; background: var(--hairline); }
.rm-leaf .icon-well { width: 36px; height: 36px; border-radius: 10px; }
.rm-leaf .icon-well svg { width: 18px; height: 18px; }
.rm-text { display: flex; flex-direction: column; min-width: 0; }
.rm-name { font-weight: 700; font-size: 15px; }
.rm-act { font-size: 14px; color: var(--ink2); overflow-wrap: anywhere; }
.rm-branch[data-on="true"] .rm-leaf, .rm-branch[data-on="true"] .rm-group { box-shadow: var(--ring), inset 0 1px 0 #fff, 0 1px 2px rgba(12,11,8,.06), 0 10px 20px -8px rgba(12,11,8,.14); }
.reads-map[data-layout="radial"] .rm-lines { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.reads-map[data-layout="radial"] .rm-node { position: absolute; margin: 0; }
.reads-map[data-layout="radial"] .rm-groups, .reads-map[data-layout="radial"] .rm-leaves { border: 0; margin: 0; padding: 0; }
/* Nodes are positioned against the map itself, so nothing in between may be a containing block. */
.reads-map[data-layout="radial"] .rm-branch, .reads-map[data-layout="radial"] .rm-root > li { position: static; }
.reads-map[data-layout="radial"] .rm-branch::before, .reads-map[data-layout="radial"] .rm-leaf::before { display: none; }
.reads-map[data-layout="radial"] .rm-leaf { width: 216px; }
.rm-lines path { fill: none; stroke: var(--hairline); stroke-width: 1.5; transition: opacity var(--spring-standard-dur) var(--spring-standard); }
.rm-lines path:not([data-drawn]) { opacity: 0; }
.rm-lines path[data-on="true"] { stroke: var(--lime-ink); stroke-width: 2.5; }

/* ───────────── diagrams ───────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .lbl { font-size: 14px; color: var(--ink2); margin-right: 8px; }
.chip-btn { height: 44px; min-width: 44px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer; background: var(--btn2); box-shadow: var(--soft-edge); font-size: 15px; font-weight: 500; transition: transform var(--press-dur) ease-out; }
/* The pressed state swaps with no transition. */
.chip-btn[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); font-weight: 700; box-shadow: var(--btn-edge), 0 4px 10px -6px rgba(12,11,8,.5); }
.chip-btn:active { transform: scale(.96); }
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; position: relative; }
.zone { position: relative; border-radius: 32px; padding: 24px; min-height: 460px; }
.zone-phone { background: var(--well); border: 1px solid var(--line); box-shadow: inset 0 1px 3px rgba(12,11,8,.06); }
.zone-out { border: 1px dashed var(--hairline); }
.zone-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.zone-title svg { width: 18px; height: 18px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 150px; position: relative; list-style: none; }
/* Diagram node: the same fill and light edge as a card, smaller shadows. Active: a lime ring (and, with a
   mouse, a 2px lift). Dimmed: faded, text still AA. A pickable node is a real <button> with aria-pressed. */
.node {
  position: relative; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; border: 0; color: var(--ink);
  background: var(--paper-fill); box-shadow: var(--edge), var(--node-shadow);
  transition: transform var(--spring-snappy-dur) var(--spring-snappy), opacity var(--fade-dur) var(--fade);
}
button.node { font: inherit; text-align: left; cursor: pointer; }
button.node:active, .sale-step:active { transform: translateY(1px) scale(.985); transition-duration: var(--press-dur); }
.node .icon-well { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 6px; box-shadow: inset 0 1px 2px rgba(12,11,8,.05); }
.node .icon-well svg { width: 18px; height: 18px; }
.node strong { font-size: 17px; }
.node span { font-size: 14px; color: var(--ink2); line-height: 1.35; }
.node[data-on="true"], .node[aria-pressed="true"] { box-shadow: var(--ring), var(--edge), var(--node-shadow-on); }
/* Dimmed text turns full ink, so at 65% it still reads at AA (about 6.4:1); an opened step is never dimmed. */
.node[data-on="false"]:not(:has([aria-expanded="true"])) { opacity: .65; }
.node[data-on="false"]:not(:has([aria-expanded="true"])) :is(strong, span) { color: var(--ink); }
/* Numbered steps (phones, and the loop on About). */
.step-n { width: 32px; height: 32px; border-radius: 999px; background: var(--lime); color: #0C0B08; font-family: var(--display); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 6px -2px rgba(74,92,14,.4); }
/* Connectors between cards that sit in a row (and, on phones, in a column). */
.arrow-h { display: flex; align-items: center; justify-content: center; color: var(--lime-ink); flex-shrink: 0; }
.arrow-h svg { width: 24px; height: 24px; }
.stays { position: absolute; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; }
.outs { display: flex; flex-direction: column; gap: 110px; margin-top: 24px; }
.flow-say { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; }
.flow-say svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--lime-ink); }
.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.edges path { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 5 6; }
.edges path[data-on="true"] { stroke: var(--lime-ink); stroke-width: 2.5; stroke-dasharray: none; }
.edges marker path { fill: var(--lime-ink); stroke: none; }
.sysmap .edges path[data-on="true"] { marker-end: url(#sys-arrow); }
.flow .edges path[data-on="true"] { marker-end: url(#flow-arrow); }
/* The dash that travels along an active line (assets/js/diagram.js flowAlong). */
.edges path.edge-flow { stroke: var(--lime); stroke-width: 5; stroke-linecap: round; marker-end: none; }
.edge-label { position: absolute; font-size: 12px; font-weight: 700; color: var(--ink2); background: var(--g-solid); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.list-alt summary { cursor: pointer; font-weight: 600; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 18px; border-radius: var(--r-btn); background: var(--btn2); box-shadow: var(--soft-edge); list-style: none; width: fit-content; }
.list-alt summary::-webkit-details-marker { display: none; }
.list-alt summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.list-alt[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.list-alt summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.list-alt ol, .list-alt ul { padding: 12px 0 0 1.2em; display: flex; flex-direction: column; gap: 6px; color: var(--ink2); }

/* System map (Motel POS) */
.sys-legend { max-width: 60ch; }
.sysmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 64px; position: relative; }
.sys-col { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.sys-col h3 { font-size: 13px; font-weight: 700; color: var(--ink2); margin-bottom: 8px; }
.sys-node {
  position: relative; text-align: left; border: 1px solid var(--g-edge); border-radius: 16px; padding: 12px 14px; min-height: 48px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--paper-fill); box-shadow: inset 0 1px 0 #fff, var(--chip-shadow); transition: transform var(--press-dur) ease-out, opacity var(--fade-dur) var(--fade);
}
.sys-node[aria-pressed="true"] { background: var(--dark-fill); color: var(--btn-ink); border-color: transparent; box-shadow: var(--btn-edge), 0 1px 2px rgba(12,11,8,.25), 0 12px 24px -12px rgba(12,11,8,.5); }
.sys-node[data-near="false"] { opacity: .65; }
.sys-node:active { transform: scale(.98); }
/* The lime ring a linked part pulses on a phone (assets/js/connect.js): only its opacity animates. A spread
   shadow, unlike a border or an outset box, adds no scrollable overflow. */
.sys-node::before { content: ''; position: absolute; inset: 0; border-radius: 15px; box-shadow: 0 0 0 4px var(--lime); opacity: 0; pointer-events: none; }
.sys-detail { border-radius: 24px; padding: 20px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; background: var(--g-solid); }
.sys-dirs { display: flex; flex-direction: column; gap: 6px; }
.sys-detail .lnks { font-size: 15px; }
.sys-detail .lnks .label { font-size: 12px; }
/* One column, no lines: the linked parts say which way the data goes. The tag is decoration (empty alt text,
   so screen readers keep the button's own name); the detail box says the same in words. */
@media (max-width: 960px) {
  .sys-node[data-rel="in"]::after, .sys-node[data-rel="out"]::after { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lime-ink); flex-shrink: 0; }
  .sys-node[data-rel="in"]::after { content: 'from'; content: 'from' / ''; }
  .sys-node[data-rel="out"]::after { content: 'to'; content: 'to' / ''; }
  .sys-node[aria-pressed="true"]::after { color: var(--lime); }
}

/* ───────────── POS demo ───────────── */
.pos { border-radius: 36px; overflow: hidden; }
.pos-top { display: flex; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pos-top .title { font-family: var(--display); font-weight: 600; font-size: 20px; }
.pos-top .right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--well); box-shadow: var(--recess); }
.seg button { height: 44px; min-width: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink2); font-size: 15px; font-weight: 500; cursor: pointer; transition: transform var(--press-dur) ease-out; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--paper); color: #0C0B08; font-weight: 700; box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(12,11,8,.12), 0 6px 16px -6px rgba(12,11,8,.25); }
.seg button:active { transform: scale(.96); }
.pos-body { display: grid; grid-template-columns: 184px minmax(0, 1fr) 272px; min-height: 560px; }
.pos-body.no-rail { grid-template-columns: 184px minmax(0, 1fr); }
/* Room for the longest label, bold "Weekly report", on one line in the 172px column; if a label ever wraps,
   the tab grows rather than pressing the text against its edges. */
.pos-tabs { padding: 16px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.pos-tabs button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; line-height: 1.25; border: 0; border-radius: 14px; background: transparent; cursor: pointer; font-size: 15px; text-align: left; }
.pos-tabs button svg { width: 18px; height: 18px; }
.pos-tabs button[aria-selected="true"] { background: var(--dark-fill); color: var(--btn-ink); font-weight: 700; box-shadow: var(--btn-edge), 0 6px 14px -8px rgba(12,11,8,.5); }
/* The screen's panel is a size container: its width depends on the tab column and the rail as much as on the
   screen, so the KPI row and the week chart fit the panel, not the viewport. */
.pos-main { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; container: pos-main / inline-size; }
.pos-main h3 { font-family: var(--display); font-weight: 600; font-size: 24px; }
.pos-rail { border-left: 1px solid var(--line); padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.pos-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pos-item { text-align: left; border: 1px solid var(--g-edge); background: var(--paper-fill); box-shadow: inset 0 1px 0 #fff, var(--chip-shadow); color: var(--ink); border-radius: 16px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 76px; position: relative; transition: transform var(--press-dur) ease-out; }
.pos-item:active { transform: scale(.98); }
.pos-item .nm { font-weight: 700; font-size: 15px; }
.pos-item .meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 14px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.pos-item::after, .pos-row::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--lime-well); opacity: 0; pointer-events: none; transition: opacity 400ms var(--fade); }
.pos-item[data-flash="true"]::after, .pos-row[data-flash="true"]::after { opacity: 1; transition-duration: 0ms; }
.pos-item[aria-disabled="true"] { opacity: .45; }
/* The cart is one grid and every line borrows its columns (subgrid), so the − 1 + steppers and the totals line
   up whatever the price. A browser without subgrid keeps each line's own columns. Lines sit 12px apart, so the
   steppers' 44px hit areas don't overlap. */
.cart { border-radius: 18px; background: var(--well); box-shadow: inset 0 1px 3px rgba(12,11,8,.06); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 10px; }
.cart > * { grid-column: 1 / -1; }
.cart-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink2); }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-columns: subgrid; align-items: center; gap: 10px; font-size: 15px; }
.cart-line > .num:last-child { text-align: right; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty > .num { flex: 1 0 auto; text-align: center; }
.qty button { position: relative; width: 32px; height: 32px; border-radius: 10px; border: 0; background: var(--btn2); box-shadow: var(--soft-edge); cursor: pointer; font-size: 16px; }
.qty button::after { content: ''; position: absolute; inset: -6px; } /* the 32px look, a 44px hit area */
.cart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; gap: 12px; }
.cart-foot .figure { font-size: 24px; }
.pos-rows { display: flex; flex-direction: column; }
.pos-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 10px; border-bottom: 1px solid var(--line); border-radius: 10px; position: relative; }
.pos-row .l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pos-row .l small { color: var(--ink2); font-size: 14px; }
.meter { height: 6px; border-radius: 6px; background: var(--well2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--ink2); transform-origin: 0 50%; transition: transform var(--spring-standard-dur) var(--spring-standard); }
.meter i.low { background: var(--lime); }
.low-tag { font-size: 12px; font-weight: 700; color: var(--lime-ink); }
.kpi { border-radius: 16px; background: var(--well); box-shadow: inset 0 1px 2px rgba(12,11,8,.05); padding: 12px 14px; display: flex; flex-direction: column; }
.kpi span { font-size: 13px; color: var(--ink2); }
.kpi b { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* Three 30px money figures don't fit a narrow panel: the first takes its own row, as the rail's Sales today
   does. A lone tile (On shift) keeps its half. */
@container pos-main (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > .kpi:first-child:not(:only-child) { grid-column: 1 / -1; }
}
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 99px; background: var(--lime); box-shadow: 0 0 0 3px var(--lime-well); }
.log { list-style: none; display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.log time { color: var(--ink2); font-variant-numeric: tabular-nums; }
/* Each bar's size is --h, 8 to 108 (pos-core.js, set by html.js): a height here, a length on its side. */
.week { display: flex; align-items: flex-end; gap: 10px; height: 150px; list-style: none; }
.week li { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); }
.week i { width: 100%; height: calc(var(--h, 8) * 1px); border-radius: 8px; background: var(--well2); }
.week i.on { background: var(--lime); }
/* A panel too narrow for seven labelled columns lays the week on its side: day, bar, amount on each row, so
   every day and its full amount stay readable. */
@container pos-main (max-width: 460px) {
  .week { flex-direction: column; align-items: stretch; height: auto; gap: 8px; }
  .week li { display: grid; grid-template-columns: 32px minmax(0, 1fr) 72px; align-items: center; gap: 10px; }
  .week li > span:last-child { order: -1; }
  .week .num { order: 1; text-align: right; }
  .week i { height: 12px; width: calc(var(--h, 8) / 108 * 100%); }
}
/* The toast sits in the demo's bottom edge on a wide screen, unless that edge is below the fold (pos-demo.js sets
   data-float). Narrower, the demo stacks and its bottom edge can be far below the button that was tapped, so
   the toast always keeps to the screen's edge: the bottom, or the top when the control used is down there
   (pos-demo.js). It stays under the header and the menu. */
.pos-toast { position: absolute; left: 50%; bottom: 20px; transform: translate(-50%, 16px); opacity: 0; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--r-btn); background: var(--btn-bg); color: var(--btn-ink); font-size: 14px; font-weight: 600; text-align: center; transition: opacity var(--fade-dur) var(--fade), transform var(--spring-snappy-dur) var(--spring-snappy); pointer-events: none; }
.pos-toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }
.pos-toast[data-float="true"] { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 28; }
.pos-wrap { position: relative; }

/* ───────────── where product info comes from (assets/js/lookup-chain.js) ─────────────
   A row of stages on a wide screen; a column with arrows pointing down below 1180px. */
.src-wrap { display: flex; flex-direction: column; gap: 24px; }
.src-chain { display: grid; grid-template-columns: 200px 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px 160px; align-items: stretch; }
.src-books { display: grid; grid-template-columns: 200px 24px minmax(0, 1fr) 24px minmax(0, 1fr); align-items: stretch; }
.src-node { min-height: 132px; }
.src-node small { font-size: 13px; color: var(--ink2); }
.src-node.src-end { cursor: default; }
.src-pair { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.src-pair .node { min-height: 0; flex: 1; }
.src-pair-lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
/* The book chain's label: a full-width row above it, so it never reads as a step after "Not found". */
.src-books > .src-pair-lbl { grid-column: 1 / -1; margin-bottom: 10px; }
.src-out { border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 12px; background: var(--g-solid); }
.src-out .h3 { font-size: 24px; }
.src-fields { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.src-fields li { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--well); box-shadow: inset 0 1px 2px rgba(12,11,8,.04); font-size: 13px; font-weight: 600; }

/* ───────────── one sale, start to finish (Motel POS, assets/js/sale-flow.js) ───────────── */
.sale-wrap { display: flex; flex-direction: column; gap: 24px; }
.sale-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.sale-top p { max-width: 60ch; }
.sale-flow { display: grid; grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr); align-items: stretch; }
.sale-step { min-height: 150px; gap: 8px; }
.sale-step .who { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lime-ink); }
.sale-detail { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.sale-detail[hidden] { display: none; }
.sale-step .sale-detail span { color: var(--ink); }
/* The step's toggle: its ::after covers the whole card, so the card is the target and shows the focus ring. */
.sale-toggle { font: inherit; color: inherit; text-align: left; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.sale-toggle::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.sale-toggle:focus-visible { outline: none; }
.sale-toggle:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 3px; }
.sale-say { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; }
.sale-say svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--lime-ink); }

@media (max-width: 1180px) {
  .src-chain, .src-books { display: flex; flex-direction: column; }
  .src-books { margin-top: 16px; }
  .src-chain .arrow-h, .src-books .arrow-h { height: 28px; }
  .src-chain .arrow-h svg, .src-books .arrow-h svg { transform: rotate(90deg); }
  .src-node { min-height: 0; }
}
@media (max-width: 960px) {
  .sale-flow { display: flex; flex-direction: column; }
  .sale-flow .arrow-h { height: 28px; }
  .sale-flow .arrow-h svg { transform: rotate(90deg); }
  .sale-step { min-height: 0; }
  /* Two across: an odd last card takes the whole row instead of standing alone in half of it. */
}
@media (max-width: 640px) {
}

/* ───────────── Price Match Tracker, a working copy of its 1.1.x popup (site-src/tracker.mjs, assets/js/tracker-demo.js) ───────────── */
.trk { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.trk-win { position: relative; border-radius: 24px; overflow: hidden; background: var(--g-solid); }
.trk-chrome { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); background: rgba(12,11,8,.025); }
.trk-dots { display: inline-flex; gap: 6px; flex-shrink: 0; }
.trk-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(12,11,8,.14); }
.trk-url { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--well); font-size: 13px; color: var(--ink2); }
.trk-url svg { width: 13px; height: 13px; flex-shrink: 0; }
.trk-ext { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--lime-well); color: var(--lime-ink); }
.trk-ext svg { width: 18px; height: 18px; }
.trk:not([data-state="idle"]) .trk-ext { background: var(--lime); color: var(--ink); }
.trk-body { position: relative; height: 600px; }
.trk-page { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 24px; padding: 28px; align-content: start; }
.trk-photo { aspect-ratio: 1; border-radius: 18px; background: linear-gradient(180deg, #F4F2EB, #E9E5DA); display: flex; align-items: center; justify-content: center; }
.trk-photo svg { width: 62%; height: auto; }
.trk-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trk-shop { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.trk-name { font-family: var(--display); font-weight: 600; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.2; letter-spacing: -0.01em; }
.trk-price-page { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trk-cart { align-self: flex-start; display: inline-flex; align-items: center; height: 38px; margin-top: 4px; padding: 0 16px; border-radius: 10px; background: var(--well2); color: var(--ink2); font-size: 14px; font-weight: 600; }
/* Track price: where the extension puts its button, at the page's bottom right. It calls three times, then rests; the
   ring is a shadow (a page-coloured gap, then lime), so it never widens the button's box. */
.trk-track { position: absolute; right: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; white-space: nowrap; min-width: max-content; border: 0; border-radius: 999px; background: var(--dark-fill); color: var(--btn-ink); font: 600 15px var(--font); box-shadow: var(--btn-edge), var(--btn-shadow); cursor: pointer; transition: transform var(--spring-snappy-dur) var(--spring-snappy), opacity var(--fade-dur) var(--fade); }
.trk-track svg { width: 18px; height: 18px; color: var(--lime); }
.trk-track::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 3px var(--g-solid), 0 0 0 6px var(--lime); opacity: 0; pointer-events: none; animation: trk-call 2.2s var(--fade) .9s 3; }
@keyframes trk-call { 0%, 55%, 100% { opacity: 0; transform: scale(.94); } 18% { opacity: 1; transform: none; } }
.trk-track:active { transform: scale(.97); transition-duration: var(--press-dur); }
.trk-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.trk:not([data-state="idle"]) .trk-track { opacity: .4; cursor: default; }
.trk:not([data-state="idle"]) .trk-track::after { animation: none; }
/* The popup, as 1.1.x draws it: its bar, the card, and its footnote. */
.trk-pop { position: absolute; z-index: 2; top: 10px; right: 10px; bottom: 10px; width: min(380px, calc(100% - 20px)); display: flex; flex-direction: column; border-radius: 18px; background: #F8F5EE; border: 1px solid var(--line); box-shadow: var(--sheet-shadow); overflow: hidden; transform-origin: 100% 0; }
.trk-pop:not([hidden]) { animation: trk-open var(--spring-snappy-dur) var(--spring-snappy); }
@keyframes trk-open { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.trk-pop-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FDFCF8; }
.trk-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 15px; }
.trk-brand svg { width: 20px; height: 20px; color: var(--lime-ink); }
.trk-gear { display: inline-flex; color: var(--ink2); }
.trk-gear svg { width: 20px; height: 20px; }
.trk-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.trk-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: #FDFCF8; border: 1px solid var(--line); container-type: inline-size; }
.trk-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.trk-here { font-size: 13.5px; color: var(--ink2); }
.trk-here strong { font-family: var(--display); font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.trk-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink2); }
.trk-spin { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--lime-well); animation: trk-wait .9s var(--fade) infinite alternate; }
@keyframes trk-wait { to { opacity: .35; } }
.trk-rows { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.trk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.trk-row.is-lowest { border: 2px solid var(--ink); padding: 7px 7px 7px 9px; }
.trk-who { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.trk-store { font-weight: 700; font-size: 14px; }
.trk-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.trk-badge[data-tone="same"] { background: var(--lime-well); color: var(--lime-ink); }
.trk-badge[data-tone="here"] { background: rgba(43,74,140,.1); color: #2B4A8C; }
.trk-badge[data-tone="market"] { background: var(--warn-well); color: var(--warn-ink); }
.trk-what { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.trk-price { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.trk-lowest { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--lime); font-size: 12px; font-weight: 700; } /* 12 px, not the add-on's 11: text is never under 12 px (Q-26) */
.trk-btn { position: relative; min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--btn2); color: var(--ink); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; }
.trk-btn.trk-ghost { background: transparent; }
/* The popup's own sizes stay (it mirrors the extension), the hit areas are 44 px tall (the audit's T2): Open, Add and the summary line */
.trk-btn::after, .trk-card summary::after { content: ''; position: absolute; inset: -5px 0; }
.trk-card summary { position: relative; }
.trk-card summary::after { inset: -6px 0; }
.trk-btn:focus-visible, .trk-link:focus-visible, .trk-card summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.trk-acts { display: flex; gap: 2px; }
/* A narrow popup (a small phone): a row with two buttons puts them on a line of their own, so the store keeps its room. */
@container (max-width: 300px) { .trk-row-acts { grid-template-columns: minmax(0, 1fr) auto; } .trk-row-acts > .trk-acts { grid-column: 1 / -1; justify-content: flex-end; } }
.trk-possible, .trk-miss, .trk-more { border-top: 1px solid var(--line); padding-top: 10px; }
.trk-card summary { padding: 6px 0; font-size: 13.5px; font-weight: 700; color: var(--ink2); cursor: pointer; }
.trk-possible > .trk-small, .trk-possible > .trk-rows { margin-top: 8px; }
.trk-small { font-size: 12.5px; line-height: 1.45; color: var(--ink2); }
ul.trk-small { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.trk-link { min-height: 24px; padding: 0; border: 0; background: none; color: var(--ink); font: 700 12.5px var(--font); text-decoration: underline; cursor: pointer; }
.trk-problem { margin-top: 6px; padding: 12px; border-radius: 12px; background: var(--warn-well); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.4; }
.trk-foot-note { padding: 0 4px 2px; font-size: 12px; line-height: 1.45; color: var(--ink2); }
/* Each step of the check shows when it's reached (data-at, data-on), coming in with a short rise. A step that has not come yet keeps its space
   (visibility, not display), so the popup is its full size from the first moment and nothing under it moves as the rows arrive (Q-20). The
   "Checking" line keeps its space when it is done, for the same reason. */
.trk [data-at]:not([data-on]) { visibility: hidden; }
.trk-status.is-done { visibility: hidden; }
.trk [data-at][data-on] { animation: trk-in var(--spring-standard-dur) var(--spring-standard) both; }
@keyframes trk-in { from { opacity: 0; transform: translateY(6px); } }
.trk-foot { display: flex; align-items: center; gap: 12px; min-height: 44px; flex-wrap: wrap; }
/* The line under the window and "Start again" keep the room they take when the check is done (Q-20): the ghost, the end line itself, is
   drawn invisible under the live text, so the line under the window is its full height from the first moment. */
.trk-say { flex: 1; min-width: 14em; display: grid; font-size: 14px; line-height: 1.4; color: var(--ink2); }
.trk-say > span { grid-area: 1 / 1; }
.trk-say::after { content: attr(data-reserve); grid-area: 1 / 1; visibility: hidden; }
.trk:is([data-state="idle"], [data-state="running"]) .trk-again { visibility: hidden; }
.trk-again { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--btn2); color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.trk-again svg { width: 16px; height: 16px; }
.trk-again:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .trk-track::after, .trk-spin { animation: none; } }

/* ───────────── responsive ───────────── */
@media (max-width: 1180px) {
  .flow { grid-template-columns: minmax(0, 1fr); }
  /* The zones stack, and the lines only fit zones side by side: the steps are numbered instead. */
  .flow .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; counter-reset: step; }
  .flow .steps .node { padding-left: 60px; }
  .flow .steps .node::before { counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; border-radius: 999px; background: var(--lime); color: #0C0B08; font-family: var(--display); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
  .flow .zone { min-height: 0; }
  .flow .stays { position: static; margin-top: 16px; flex-wrap: wrap; }
  .flow .outs { gap: 16px; }
  .flow .edges { display: none; }
  .pos-body, .pos-body.no-rail { grid-template-columns: 172px minmax(0, 1fr); }
  .pos-rail { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* Label across the top, Sales today beside the three tiles, the activity list across the bottom: the tiles
     never stretch to the list's height. */
  .pos-rail > .live, .pos-rail > div:last-child { grid-column: 1 / -1; }
  .pos-toast { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 28; }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; }
}
@media (max-width: 960px) {
  .site-header { top: 12px; left: max(12px, var(--safe-l)); right: max(12px, var(--safe-r)); height: 56px; padding: 0 6px 0 16px; border-radius: 16px; }
  .site-header[data-scrolled="true"]::before, .site-header[data-scrolled="true"]::after { transform: none; }
  .brand-word { font-size: 13px; } .brand svg { width: 10px; height: 18px; }
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  html { scroll-padding-top: 84px; }
  .foot-top { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(max-content, 1fr); }
  .foot-top > :first-child { grid-column: 1 / -1; }
  .sysmap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .flow .steps { grid-template-columns: minmax(0, 1fr); }
  .edges { display: none; }
}
@media (max-width: 640px) {
  .nf .row-btns, .nf .row-btns .btn { width: 100%; }
  .samples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-top > .foot-mail { grid-column: 1 / -1; } /* the address is wider than half a phone */
  .site-footer { border-radius: 28px; padding: 24px; margin: 0 max(12px, var(--safe-r)) 16px max(12px, var(--safe-l)); }
  .pos-top { padding: 14px 16px; }
  .pos-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pos-body.no-rail { grid-template-columns: minmax(0, 1fr); }
  .pos-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .pos-tabs button { flex-shrink: 0; }
  .pos-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-rail { grid-template-columns: minmax(0, 1fr); }
  .pos-main { padding: 16px; }
  .panel { border-radius: 36px; }
}

/* ───────────── page pieces ───────────── */
main:focus { outline: none; }
main > section.wrap:not(.hero):not(.nf):not(.contact):not(.cta-row) { display: flex; flex-direction: column; gap: clamp(24px, 3vw, 40px); }
.page-top { padding-top: clamp(120px, 12vw, 176px); }
.center-note { text-align: center; }
.prod-rows { display: flex; flex-direction: column; gap: 24px; }
.prow { border-radius: 40px; padding: clamp(24px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.prow-copy { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.prow-art { min-height: 320px; border-radius: 32px; background: var(--well); box-shadow: var(--recess); display: flex; align-items: center; justify-content: center; gap: 24px; padding: 24px; }

/* 15 characters (13 digits, 2 spaces) in 90% of the code face: the tracking gives way before the size does, so a
   narrow face (a phone's two-across grid, the first four-across width) keeps readable digits. */
.ean-digits { display: block; font-family: var(--mono); font-size: min(11px, 10cqi); letter-spacing: min(.1em, max(0px, (90cqi - 9em) / 15)); color: #0C0B08; text-align: center; white-space: nowrap; }
.sample .code-face { flex-direction: column; gap: 6px; container-type: inline-size; }
.sample .code-face svg.bar { width: 72%; height: 64px; max-height: none; }
.cta-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
/* A definite width: centred in the grid, the item would shrink to its content and the card's 100% with it. */
.sys-wrap, .flow-wrap { display: flex; flex-direction: column; gap: 24px; }
.foot-in { max-width: var(--max); }
.pos-rail .kpis .kpi b { font-size: 22px; }
.pos-rail .kpis .kpi span { font-size: 12px; white-space: nowrap; }
.pos-rail .kpis .kpi { padding: 10px; }
@media (max-width: 960px) {
  .prow { grid-template-columns: minmax(0, 1fr); gap: 24px; border-radius: 32px; }
  .prow-art { min-height: 260px; }
}
@media (max-width: 640px) {
  .prow-art { flex-direction: column; padding: 16px; min-height: 0; }
  .cta-row .btn { width: 100%; }
}

/* ───────────── narrower screens: the home page, the chapters, the try space and the working copy ───────────── */
@media (max-width: 960px) {
  .hp-panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  /* Phones: no frame around the tabs, so each video has the page's whole width. */
  .hp-box { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .hp-tabs { border-radius: 24px; padding: 4px; }
  .hp-ink { top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 20px; }
  .hp-tab { flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; padding: 8px 4px; text-align: center; border-radius: 20px; }
  .hp-draw { width: 48px; height: 48px; }
  .hp-tab-name { font-size: 13px; }
  .hp-tab small { display: none; }
  .hp-panel { padding: 20px 0 0; border-radius: 0; }
  .pch-draw { width: 52px; height: 52px; }
  .trk-body { height: 330px; }
  .trk:not([data-state="idle"]) .trk-body { height: 620px; } /* the window grows when Track price opens the popup */
  /* Full screen (/try/tracker/): the window fills the screen from the start, a phone's store page (the photo, then the
     product), so nothing moves when the popup opens. */
  .trk-full .trk-body, .trk-full:not([data-state="idle"]) .trk-body { height: max(500px, calc(100dvh - 250px)); }
  .try-tracker main.try-main { justify-content: flex-start; } /* (so the window stays put when the line under it grows) */
  .trk-full .trk-page { grid-template-columns: minmax(0, 1fr); }
  .trk-full .trk-photo { aspect-ratio: 4 / 3; }
  .trk-page { grid-template-columns: minmax(0, 36%) minmax(0, 1fr); gap: 14px; padding: 16px; }
  .trk-name { font-size: 15px; }
  .trk-price-page { font-size: 19px; }
  .trk-cart { height: 34px; padding: 0 12px; font-size: 13px; }
  .trk-track { right: 12px; bottom: 12px; height: 44px; padding: 0 16px; font-size: 14px; }
  .trk-pop { top: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); }
}


.icon-well { width: 40px; height: 40px; border-radius: 12px; background: var(--well); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink); }
.icon-well svg { width: 20px; height: 20px; }
.rcard-type { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); }
.rcard-type .icon-well { width: 28px; height: 28px; border-radius: 9px; }
.rcard-type .icon-well svg { width: 15px; height: 15px; }
.rcard-title { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.05; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.safe { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--well); font-size: 14px; line-height: 1.4; }
.safe svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--lime-ink); margin-top: 1px; }
.safe strong { display: block; font-size: 15px; }
.safe.warn { background: var(--warn-well); } .safe.warn svg { color: var(--warn-ink); }
.safe.danger { background: var(--danger-well); } .safe.danger svg { color: var(--danger-ink); }
.small { font-size: 14px; }
}
