/* The Board — styles. V1's design system TRANSPLANTED (L11), not reinvented:
   tokens, Manrope, card language, kicker, rise-in and the desktop phone
   frame all come from retailiq/frontend/style.css. One new token only
   (--amber, for the partly_seen state). ALL colours live in the variables
   below — tune by editing one line, never by hunting through rules. */

/* Manrope — self-hosted, V1's exact @font-face pattern.
   Files served from /frontend/fonts (relative url resolves from this file).

   S60b (a): ONE FACE FOR EVERY WEIGHT THE SCALE NAMES. Until S60b only 400 and
   700 were here, so the browser SYNTHESISED the other two — the Support step
   (14/500) stretched out of the 400 face and the Name step (16/600) squeezed
   out of the 700 face, which is why every product name has really been Bold.
   A synthesised weight is not the weight. 500 and 600 are now real faces, from
   the same upstream build at the same version (4.504); a new step in the scale
   brings its face with it or it is not a step. Licence: frontend/fonts/OFL.txt. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Manrope-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/Manrope-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/Manrope-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Manrope-Bold.woff2") format("woff2");
}

:root {
  /* V1 tokens, verbatim */
  --bg: #F7F6F3;           /* warm off-white field */
  --card: #FFFFFF;         /* card surface */
  --ink: #1E2622;          /* near-black warm ink */
  --ink-soft: #5A615C;     /* muted labels — S59 (R37): 5.89:1 on --bg, 6.37:1 on --card (was #7A7F7A, 3.78:1) */
  --body-text: #4A524C;    /* body copy */
  --line: #E8E6E1;         /* hairlines / dividers */
  --accent: #2f6f4f;       /* calm brand green */
  --accent-lift: #5BAF87;  /* lighter green — dark-stage register only */
  --stage: #10201A;        /* deep green stage field */
  --accent-ink: #ffffff;   /* text on green */
  --temp: #c0392b;         /* V1's red — used here for the error line */
  --radius: 14px;
  --gap: 12px;
  --maxw: 430px;

  /* ONE TYPE SCALE, FIVE STEPS, NOTHING OUTSIDE IT (S59 (R37)). Every
     font-size in this file is one of these. Nudge a step here, in one line,
     after a walk. Nothing below Label, nothing above Title. */
  --fs-title: 17px;    --fw-title: 700;    /* the bar's screen name, "Your order" */
  --fs-name: 16px;     --fw-name: 600;     /* product and tile names, the control's number */
  --fs-price: 17px;    --fw-price: 700;    /* prices and the cart total */
  --fs-support: 14px;  --fw-support: 500;  /* size · pack, marks, counts, chips, the rung pill */
  --fs-label: 12px;    --fw-label: 700;    /* brand names, section labels — spaced caps */
  --ls-label: 1.2px;                       /* the Label step's spacing (S59 (R38)) */
  --fs-command: 26px;                      /* the ONE named size off the scale: the Ostindo view's command-strip number (S75b C1) */

  /* The one new token (agreed): muted amber for the partly_seen edge */
  --amber: #D97706;

  /* S60 (h) — THE STRIP'S BANDS: the same amber and red, as a ground and the
     dark shade of themselves for text on it. A band at full strength with dark
     text reads near 3:1; these read 7:1 and over, and stay the same hue. */
  --amber-band: #FDF0DC;   --amber-band-ink: #92400E;
  --red-band:   #FBE6E3;   --red-band-ink:   #8C2118;

  /* refused input — the floor, never a failure (S47). The keypad's "Minimum
     N" and its underline. NOT --amber: that is a tile's thin partly-seen
     edge, and as 13px text on the card's white it reads at about 3:1. This
     reads above 5:1, and is neither --temp's red nor the accent. */
  --warn: #B45309;

  /* "NEED IT?" — THE QUIET MARK'S GROUND (S66 (c)). A neutral warm wash, NOT
     a hue: the special's wording is the accent green and the rung pill is
     outlined in it, and this must never compete with either. It reads on both
     grounds a line ever sits on — the card's white and the board's --bg
     (#F7F6F3) — because the same class paints an Order again row and an aisle
     card. --need-it-done is the same wash after his tap: still there, fainter,
     nothing moved (S66 (j)). */
  --need-it: #EFEBDD;
  --need-it-done: #F5F2E8;

  /* The search dock's resting height (8 + 42 + 10), so the shop screens
     can keep their last card clear of it from one number, not a guess. */
  --search-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-name);
  -webkit-font-smoothing: antialiased;
}

/* ---- Shell + app column ----
   On a phone the shell is display:contents (no box at all) and the app is a
   centred 430px column. Above 550px the shell becomes the demo phone frame
   (bottom of this file). */

.shell { display: contents; }
.shell-notch { display: none; }   /* the notch exists only on the demo frame */

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;                    /* lets full-screen surfaces (recognition,
                                       video) fill the column below the header */
  flex-direction: column;
}

/* ---- Header — V1's calm app-bar register: --bg, sticky, editorial ---- */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 12px 20px 10px;          /* V1's 20px side gutters */
  border-bottom: 1px solid var(--line);
}

/* THE CLEVERREP HEADER IS THE BOARD'S ALONE (S59 (R33)). On Order again, the
   category screen and the delivery-problem screen it is gone and the screen's
   own bar is the top; mid-order there is deliberately no door to "Problem with
   a delivery?". Under the open cart it is hidden in place (visibility, not
   display), so the screen beneath the dim never jumps. The opening screens
   (recognition, video) keep it, as they were. */
.app:has(> #aisle:not(.hidden)) > .header,
.app:has(> #usuals:not(.hidden)) > .header,
.app:has(> #credit:not(.hidden)) > .header,
.app:has(> #display:not(.hidden)) > .header {
  display: none;
}
.app:has(> #order-sheet:not(.hidden)) > .header {
  visibility: hidden;
}

/* Brand lockup, V1 structure: "Clever" (400, ink) + "Rep" (700, accent)
   + the small resting light after it (hollow grey ring = line closed). */
.lockup {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-title);
  line-height: 1;
  letter-spacing: 0.2px;
}
.lockup-clever { font-weight: 400; color: var(--ink); }
.lockup-rep    { font-weight: 700; color: var(--accent); }
.lockup-light {
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1.5px solid var(--ink-soft);   /* hollow grey ring = resting */
  background: transparent;
  opacity: 0.6;
}

.visiting {
  margin-top: 3px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}

/* ---- The search dock (B2 slice 2b): the pill at the BOTTOM ----
   WhatsApp register, now in WhatsApp's place: the composer sits under the
   thumb, and the answer appears just above it. board.js sets the dock's
   `bottom` from the order strip's measured height, so the two stack
   without either guessing the other's size. position:fixed binds to the
   viewport on a phone and to the demo phone frame on desktop (the .shell
   transform trick). z 55: above the shop screens, below the sheet (60)
   and the strip (70). */

.search-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;                        /* board.js lifts it over the strip */
  z-index: 55;
  margin: 0 auto;
  max-width: var(--maxw);
  width: 100%;
  background: var(--bg);            /* opaque: content scrolls under it */
}

/* A short fade above the dock so cards dissolve into it instead of being
   cut off — the .aisle-bar's gradient trick, upside down. */
.search-dock::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 16px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.search-bar {
  padding: 8px 20px calc(10px + env(safe-area-inset-bottom));
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 6px 0 14px;            /* text breathes; the mic sits inset */
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-input {
  flex: 1;
  min-width: 0;                     /* a long ask shortens, the mic holds */
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;             /* inputs don't inherit Manrope alone */
  font-size: var(--fs-name);
}
.search-input::placeholder { color: var(--ink-soft); }
.search-input:focus { outline: none; }
/* Chrome/Safari hang their own clear + cancel buttons off search inputs */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button { display: none; }

/* The mic: PRESENT BUT INERT until the voice half lands — soft ink, no
   handler, out of the tab order, and unclickable so nothing can happen
   by accident. It is a promise on screen, not a control. */
.search-mic {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  pointer-events: none;
}

/* The answer line — immediately above the pill, inside the dock. It
   floats over the shop screen now, so it carries the card surface (the
   .aisle-card register) to stay readable over tiles and shelves. Quiet
   ink; no shadow, no animation. */
.search-note {
  margin: 0 20px 2px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.45;
  color: var(--ink-soft);
}

/* The note's entrance: rq-rise again — the app's one arrival movement,
   shared with the tiles and the shelf cards — just quicker, because a line
   appearing above the pill is a smaller event than a shelf loading.
   board.js puts this class on at the moment the note is SHOWN and takes it
   off when the note clears, so nothing else on screen can set it running. */
.search-note--in {
  animation: rq-rise 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .search-note--in { animation: none; }
}

/* THE OFFER SHAPE (B2 slice 6): the admission on one line, the way in as a
   pill beneath it. A MODE of the note — the plain "we don't carry that"
   line and the error line never take this class, so their layout is
   untouched. align-items keeps the pill hugging its own words instead of
   stretching across the note like a full-width bar. */
.search-note--offer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

/* The admission itself: its own line above the pill, whatever layout the
   note is wearing. */
.search-note-line {
  display: block;
}

/* The nearest-aisle offer (B2 slice 6). It wears .pill-accent — the app's
   SOLID pill, the same register as Place order, Confirm, Continue and Done
   — because it is the one thing on this note to act on. Fill, letters,
   radius, padding and press behaviour are ALL that class's; this rule
   states only the one thing it cannot know: that the pill is sitting in a
   narrow note and a long aisle name must wrap inside it rather than spill
   out. If the accent pill ever changes, this chip changes with it. */
.search-note-aisle {
  max-width: 100%;                  /* a long aisle name wraps, never spills */
}

/* The arrow rides a little clear of the name, and takes the pill's own
   white with the rest of the text. Decoration only — board.js marks it
   aria-hidden, so the pill announces the aisle name alone. */
.search-note-arrow {
  margin-left: 8px;
}

/* The same line in its failure voice — the .card-error register. Used
   ONLY for a failed or refused search; NEITHER "we don't carry that" nor
   the nearest-aisle offer can ever reach this state (board.js renders both
   from the backend's own NOTHING outcome and nothing else). */
.search-note--error {
  color: var(--temp);
}

/* The shop screens keep their last card clear of the dock — and of the
   order strip too when both are showing. */
.app.has-search-dock #board,
.app.has-search-dock .aisle {
  padding-bottom: calc(var(--search-h) + 28px);
}
.app.has-search-dock.has-order-bar #board,
.app.has-search-dock.has-order-bar .aisle {
  padding-bottom: calc(var(--search-h) + 110px);
}

/* THE DOCK AND THE STRIP FLOAT OVER THE SCROLLER, SO THE BROWSER THINKS THE
   SPACE BEHIND THEM IS VISIBLE.
   scrollIntoView({block:"nearest"}) leaves an element alone when it judges
   it already in view — and a stepper row sitting under the search dock is
   "in view" by that judgement and invisible to the customer. The padding
   rules above keep the last CARD clear of the furniture; these keep every
   SCROLL clear of it, using the same two measurements so the two can never
   disagree.
   It is a property of the SCROLL CONTAINER, so it is declared on both
   things that scroll: `.app` inside the desktop phone frame (which sets
   overflow-y: auto on .app), and the document elsewhere. Nothing here
   moves a pixel on screen — scroll-padding only shapes where a scroll
   comes to rest. */
.app.has-search-dock {
  scroll-padding-bottom: calc(var(--search-h) + 28px);
}
.app.has-search-dock.has-order-bar {
  scroll-padding-bottom: calc(var(--search-h) + 110px);
}
html {
  scroll-padding-bottom: calc(var(--search-h) + 110px);
}

/* ---- The board: tiles area ---- */

#board {
  padding: 16px 20px 40px;          /* 20px gutters, generous bottom */
}

/* 2 tiles per row, continuous scroll — no pages anywhere */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* THE ONE SECTION LABEL (S59 (R38)): the Label step — 12px bold spaced caps —
   with no dash, no underline, no decoration. The board's "YOUR CATEGORIES" /
   "MORE CATEGORIES" and the cart's category headings. */
.kicker {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- The narrowed board (B2 slice 4) ----
   The NARROW answer standing in the board's place: one header line built
   from the backend's own words, then the narrowed groups in the board's
   tile language. No new visual register — the tile, the kicker's ink and
   the quiet pill (.aisle-back) are all reused as they are. */

.narrow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;                  /* a long family name never squashes ✕ */
  margin: 0 0 14px;
}

.narrow-title {
  min-width: 0;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  letter-spacing: -0.1px;
  color: var(--ink);
}

/* The ✕ is the quiet pill at its smaller, secondary size */
.narrow-clear {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
}

/* A narrowed tile carries a brand line the category tiles never do, so it
   stands a little taller and gives its photo band slightly less room. */
.narrow-tile {
  height: 178px;
}
.narrow-tile .tile-img {
  height: 56%;
}

/* Brand + name pinned to the bottom together (the base tile pins the name
   alone with margin-top:auto — with two lines the pair has to move as one) */
.narrow-tile-foot {
  margin-top: auto;
}
.narrow-tile .card-brand {
  margin: 0;
  padding: 0 12px;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
}
.narrow-tile .tile-name {
  margin-top: 0;
  padding: 2px 12px 10px;
}

/* ---- One tile: V1 card language — white, hairline border, soft.
   Layout: photo fills the top of the card edge to edge, category name
   sits bottom-left (the grocery-app card shape). ---- */

.tile {
  position: relative;               /* anchors the state light */
  min-height: 156px;                /* grows for the tile mark (R25): never clips it */
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(30, 38, 34, 0.04);
  overflow: hidden;                 /* clips the photo to the rounded corners */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;                       /* the photo runs edge to edge */
  cursor: pointer;                  /* obviously tappable */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.12s ease;
}

/* Press-down feedback */
.tile:active {
  transform: scale(0.96);
}

/* Scroll-in life (V1's rq-rise feel): board.js marks each tile .tile-wait,
   then adds .tile-in the first time it scrolls into view — the tile rises
   in softly, once. Tiles are always in the DOM and tappable; this is paint. */
.tile-wait {
  opacity: 0;
}
.tile-wait.tile-in {
  opacity: 1;
  animation: rq-rise 0.5s ease;
}

@keyframes rq-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Reduced motion: board.js already skips the whole effect; this is the
   belt-and-braces so a .tile-wait tile can never sit invisible. */
@media (prefers-reduced-motion: reduce) {
  .tile-wait { opacity: 1; }
  .tile-wait.tile-in { animation: none; }
}

/* Category art: the hero product photo fills the TOP of the card, edge
   to edge (cover-fit, cropped never squashed), sitting on a very soft
   neutral wash so cut-out pack shots don't float on stark white. A
   category with no photo — or a photo that fails to load — keeps the
   wash and shows the faint shelf icon centred instead (:empty). */
.tile-img {
  width: 100%;
  height: 97px;                   /* the upper portion of the card */
  flex: none;
  background-color: var(--card);  /* pure white — white pack scans blend in */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;                  /* breathing room — packs never touch the edges */
}
.tile-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;            /* whole product visible — never cropped */
  object-position: right top;     /* photo sits top-right: the card reads on a
                                     diagonal — photo up here, name bottom-left */
  /* Some V1 scans carry a light-GREY studio backdrop baked into the JPEG
     (e.g. Filipino Sauces, Furikake) — the band is white, the grey is the
     photo's own pixels. This small lift clips near-white backdrops to pure
     white so every band reads the same; the real fix is cleaned scans, later. */
  filter: brightness(1.07);
}
.tile-img:empty {
  background-color: var(--bg);    /* the no-photo band keeps the soft wash */
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237A7F7A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.45"><path d="M4 10h16M4 10l1.5-4.5h13L20 10M4 10v9a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-9M9 20v-5h6v5"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px;
}

/* ---- THE CATEGORY TILE (S59 (R35), (R36)) ----
   The art fills the WHOLE tile, cover-fit and anchored top-right (R36's frame:
   subject on the right, bottom-left and the extreme top-right corner clear).
   The name sits over the clear bottom-left; "N of yours to add" directly under
   it on the same left edge, padded, never touching the border. The state is
   a bar along the tile's bottom edge (S83, below). A narrowed tile keeps its
   own photo band.
   SQUARE (S83): the art is composed square with its bottom 36% pure white,
   so the tile is square too — the whole frame shows, nothing is cropped. */
.cat-tile {
  aspect-ratio: 1 / 1;
  min-height: 0;                    /* the square decides the height */
  padding: 0 0 12px;                /* the mark's floor: clear of the border */
}
.cat-tile .tile-img {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  padding: 0;
  z-index: 0;
}
.cat-tile .tile-img img {
  object-fit: cover;
  object-position: right top;
}
.cat-tile .tile-name,
.cat-tile .tile-mark {
  position: relative;
  z-index: 1;
}
.cat-tile .tile-name {
  padding: 8px 12px 0;
}
.cat-tile .tile-mark {
  margin-top: 2px;
  padding: 0 12px;
  text-align: left;
}

/* Category name: bottom-left, Manrope 600, wraps to 2 lines max */
.tile-name {
  margin-top: auto;                 /* pins the name to the card's bottom */
  padding: 8px 12px 11px;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  line-height: 1.25;
  text-align: left;
  color: var(--ink);
  display: -webkit-box;             /* clamps the name to two lines */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Tile states (board.js just switches these classes).
   THE STATE BAR (S83, replacing S58 (R25)'s top-right light): a 3px bar
   flush along the tile's bottom edge, from the left, under the name and the
   "N of yours to add" line — the tile's 12px bottom padding keeps it clear
   of the mark. Amber half-width = partly seen; accent full-width = done;
   nothing = not looked. The widths are the three states, not a measured
   fraction: nothing records how much of an aisle was seen. (:not(.specials)
   — the hero banner never wears state marks.) ---- */

/* Not looked: the plain card above — nothing extra */

.tile.state-partly_seen:not(.specials)::after,
.tile.state-done:not(.specials)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  z-index: 3;
  pointer-events: none;
}
.tile.state-partly_seen:not(.specials)::after {
  width: 50%;
  background: var(--amber);
}

/* Done: the full accent bar... */
.tile.state-done:not(.specials)::after {
  width: 100%;
  background: var(--accent);
}

/* ...plus the faint accent wash over the whole card */
.tile.state-done:not(.specials)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  z-index: 2;
  pointer-events: none;
}

/* ---- Specials: hero card on the deep --stage green, calm, no gradient ---- */

/* BUILD MY ORDER (S52) wears the same banner as Specials: the same stage
   green, shape and name register, so the two read as one family of front
   doors. SIDE BY SIDE (S59 (R34)): one row, half width each, about 56px tall —
   Specials on the left, still the first tile. S73 (K3): THE SAME SHAPE, ONE
   LINE EACH — "Specials" with its count in a round badge, beside "Order
   again". The star is gone; the words never wrap. */
.specials,
.build-order {
  height: 56px;                     /* one short row, not the fixed square */
  min-height: 56px;
  flex-direction: row;              /* the badge beside the word */
  align-items: center;              /* the base tile no longer centres */
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--stage);
  border: none;
  border-radius: 18px;              /* V1's hero-card radius */
  box-shadow: 0 12px 30px rgba(16, 32, 26, 0.18);
}

/* Build My Order's mark: a ticked list, in the lift green */
.build-order::before {
  content: "";
  width: 20px;
  height: 20px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%235BAF87" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M3.5 6.5l1.8 1.8L8.5 5"/><path d="M3.5 13l1.8 1.8L8.5 11.5"/><path d="M12 7h8.5"/><path d="M12 13.5h8.5"/><path d="M3.5 19.5h17"/></svg>') no-repeat center / contain;
}

.specials .tile-name,
.build-order .tile-name {
  margin: 0;                        /* undo the bottom-left pinning */
  padding: 0;
  font-size: var(--fs-name);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
  white-space: nowrap;              /* one line each (S73 (K3)) */
  color: var(--accent-ink);
}

/* S73 (K3) — THE DEAL COUNT: a small round badge beside the word. */
.specials-badge {
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent-lift);
  color: var(--stage);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  text-align: center;
  line-height: 22px;
}

/* Keep the stage green in charge whatever state class the banner carries */
.specials.state-not_looked,
.specials.state-partly_seen,
.specials.state-done {
  background: var(--stage);
  box-shadow: 0 12px 30px rgba(16, 32, 26, 0.18);
}

/* ---- The aisle view: board hides, this shows (a placeholder in B1 —
   the real shelf transplants next session). V1's editorial register:
   quiet back line, kicker, big category title, one calm card. ---- */

.aisle {
  padding: 0 20px 40px;             /* same gutters as the board; the bar is
                                       the top (S59 (R30), (R32)) */
}

/* Sticky band: stays reachable while the shelf scrolls, parked just below
   the app header (top ~= the header's height; it tucks a px or two UNDER
   the header, never past it — the header is opaque and sits above at z 10).
   Negative margins bleed the --bg band across the aisle's 20px gutters so
   cards slide under it cleanly, with a soft fade at its bottom edge. */
.aisle-bar {
  position: sticky;
  top: 0;                           /* no header off the board (S59 (R33)) */
  z-index: 5;
  margin: 0 -20px;
  padding: 8px 20px;
  background: linear-gradient(var(--bg) 78%, transparent);
}
/* THE BAR IS SOLID (S57 (R16)) on the aisle and Order again: an opaque ground
   and THE SCREEN'S ONE FURNITURE HAIRLINE under it (S59 (R38)) — on Order
   again, under the chips. It is the whole head: back, the screen's name, and
   (Order again) the count and the chips (S59 (R30), (R32)). */
.aisle .aisle-bar {
  margin-bottom: 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* The bar's one line: back · the screen's name · (the count). The name takes
   what is left and is cut with an ellipsis rather than wrap the bar. */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bar-row .aisle-back {
  flex: none;
  padding: 6px 12px;
}
.bar-row .aisle-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-row .usuals-done {
  flex: none;
}

/* The back control — V1's quiet secondary pill (the .choice-skip /
   .verify-dismiss register): hairline border, card surface, soft ink,
   999px radius. Sizing from V1's .choice-btn family, thumb-comfortable.
   Only token names adapted (#fff -> var(--card)). */
.aisle-back {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* The screen's name, in the bar (S59 (R30), (R32)): the Title step. */
.aisle-title {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  letter-spacing: -0.3px;
  line-height: 1.15;
  color: var(--ink);
}

.aisle-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}

/* ---- The shelf inside a category (V1 card transplant, L11): .shelf,
   .product-card, .card-image (+ name-tile fallback), .card-name,
   .size-row/.size-btn, the card's price rows and the rq-rise arrival — V1's
   style.css verbatim, only token names adapted (--card-bg -> --card).
   LEFT BEHIND on purpose: snap/hero focus (is-focused, sheen), the
   verify float (.size-btn.added), reward-card styles, hint-slot. ---- */

/* THE AISLE IS CARDS, TWO ACROSS (S58 (R1)). Everything that is not a card —
   a brand label, the fold, the shelf's end, the sentinel — takes the whole
   width. */
.shelf {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* ONE COLUMN (S58 (R23)) */
  align-items: start;
  gap: 10px;
  padding: 0 0 10px;      /* V1 carried 12px side padding; here the
                             aisle's 20px gutters already provide it */
}
.shelf > :not(.product-card) {
  grid-column: 1 / -1;
}

/* Product card */
.product-card {
  background: var(--card);            /* V1: var(--card-bg) */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

/* Arrival: shelf cards rise in on open, staggered top-to-bottom (V1's
   rq-rise — the keyframes already live above, shared with the tiles).
   `backwards` holds the delayed cards invisible until their turn. */
.shelf .product-card {
  animation: rq-rise 0.5s ease backwards;
}
.shelf .product-card:nth-child(1) { animation-delay: 0.04s; }
.shelf .product-card:nth-child(2) { animation-delay: 0.11s; }
.shelf .product-card:nth-child(3) { animation-delay: 0.18s; }
.shelf .product-card:nth-child(4) { animation-delay: 0.25s; }
.shelf .product-card:nth-child(5) { animation-delay: 0.32s; }
.shelf .product-card:nth-child(6) { animation-delay: 0.39s; }

/* The arrival glow (B2 slice 5): the card a JUMP landed on — a search
   LAND, or a narrowed tile's tap — wears a soft wash of the app's own
   green that fades away over two seconds. board.js adds the class at the
   moment the card is put at the top and removes it when the glow ends,
   so it fires once and leaves nothing behind. Paint only: not a state,
   not a mark, nothing about the card's contents changes.

   rq-rise is NAMED AGAIN here on purpose. It keeps its place at the head
   of the list, so adding the class does not restart the shelf's rise and
   removing it two seconds later cannot set the rise running a second
   time — which is exactly what a lone glow rule would do. */
.shelf .product-card.product-card--arrived {
  animation: rq-rise 0.5s ease backwards, rq-arrive 2s ease-out;
}

@keyframes rq-arrive {
  from { background-color: color-mix(in srgb, var(--accent) 16%, var(--card)); }
  to   { background-color: var(--card); }
}

@media (prefers-reduced-motion: reduce) {
  .shelf .product-card,
  .shelf .product-card.product-card--arrived { animation: none; }
}

/* Image area */
.card-image {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;                /* whole product visible — never cropped */
}
/* THE VERTICAL CARD (S58 (R28), amending R23): one column, full width; the
   photo on top at the card's full width, contain-fit, its tap the photo sheet;
   the words under it. PROPORTIONS (S59 (R39)): the photo sits on the card's own
   white ground, about 220px tall, no grey band; 16px inside the card. The
   design is otherwise R28's, and THE CARD IS FROZEN until pilot feedback. */
.shelf .product-card {
  display: block;
  padding: 16px;
}
.shelf .card-image {
  width: 100%;
  height: 220px;
  background: var(--card);
  cursor: pointer;
}
.card-body {
  min-width: 0;
  margin-top: 8px;
}
.product-card--no-photo .card-body {
  margin-top: 0;                    /* no panel above it (S59 (R47)) */
}
/* THE CARD OWNS THE SCREEN (S59 (R45), completing R39). A card WITH a photo
   fills the space between the bar and the search dock less a peek of the next
   card's edge: board.js fitCard sets its photo panel's height ONCE — near-
   square, so a square pack photo fills its width, taking the spare height,
   capped about 360px — sized as if the order strip is always showing and with
   the pill counted out, so nothing moves under his finger (S57 (R3)): the pill
   grows the card downward. Until it is fitted the panel is square. Nothing is
   added to or removed from the card. A card with no photo is exempt (R47). */
.shelf .product-card:not(.product-card--no-photo) .card-image {
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: 360px;
}
/* THE PILL'S ROOM IS RESERVED AT THE FIT (S59 (R45)): on a fitted photo card
   the rung line always holds the pill's height — invisible until the pill (or
   a special's date) fills it — so the pill appearing or going moves nothing
   and the next card's top stays put. A card with no photo reserves nothing
   (R47). */
.shelf .product-card[data-fitted] .card-rung-line {
  min-height: 28px;
}
.shelf .product-card[data-fitted] .card-rung-line.hidden {
  display: flex;
  visibility: hidden;
}
.shelf .card-name {
  margin: 2px 0 4px;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  line-height: 1.3;
}
.shelf .card-brand {
  margin-top: 0;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: 0.8px;
}
/* ONE LINE (R28): "size · pack · $price" on the left, the control on the right
   edge. The words run as a sentence and wrap in their own column if they must;
   the control never leaves the right edge. */
.shelf .card-line {
  flex-wrap: nowrap;
  margin-top: 8px;
}
.shelf .card-line-words {
  flex: 1 1 auto;
  min-width: 0;
}
.shelf .card-line .card-size {
  display: inline;
}
.shelf .card-line .card-size::after {
  content: " · ";
}
.shelf .card-line .card-money {
  display: inline;
}
.shelf .card-line .line-control {
  min-width: 0;
  gap: 4px;
}
.shelf .card-line-words .price-now {
  font-size: var(--fs-price);
  font-weight: var(--fw-price);
}
.shelf .card-brand + .card-name {
  margin-top: 2px;
}
.product-card > .line-mark,
.card-body > .line-mark {
  margin: 0 0 6px;
}
/* A card with no photo has no photo panel (S59 (R47)): the name tile that stood
   in for one is gone. The body is the card. */

/* Brand line above the name — the board's kicker voice (small caps, soft
   ink), no dash. Rendered only when the group has one certain brand. */
.card-brand {
  margin: 10px 0 0;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-soft);
}

.card-name {
  margin: 10px 0 8px;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
}
/* Under a brand line the name closes up to it — one label, two voices */
.card-brand + .card-name {
  margin-top: 3px;
}

/* Size button row */
.size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.size-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  font-family: inherit;               /* buttons don't inherit Manrope on their own */
  cursor: pointer;
}
.size-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
/* Out of stock: greyed and non-selectable (also disabled in JS).
   Dormant today — all stock is NULL, so nothing renders this yet. */
.size-btn.out-of-stock {
  background: var(--bg);
  border-style: dashed;
  color: var(--ink-soft);
  cursor: default;
}

/* A SIZE ON THE ORDER IS A GREEN CHIP WEARING ITS NUMBER (S58 (R7)): "25G · 9",
   from API responses only. The picked chip stays solid; a picked chip on the
   order is solid and wears its number too. .hidden (later in this file) wins. */
.chip-qty {
  font-weight: 700;
  white-space: pre;
}
/* R48 — A CHIP NEVER CHANGES WIDTH (S59). The label and the count each stack an
   invisible copy of their widest form under the real text: the label at the
   on-chip's weight, the count as a two-digit " · 88". So a chip going on or off
   the order never re-wraps the row. The copies are pseudo-elements: not shown,
   not in the chip's text. */
.size-btn .chip-label,
.size-btn .chip-qty {
  display: inline-grid;
}
.size-btn .chip-label > span,
.size-btn .chip-qty > span,
.size-btn .chip-label::before,
.size-btn .chip-qty::before {
  grid-area: 1 / 1;
}
.size-btn .chip-label::before {
  content: attr(data-text);
  font-weight: 700;
  visibility: hidden;
}
.size-btn .chip-qty::before {
  content: " · 88";
  visibility: hidden;
}
.size-btn--on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.shelf .size-row {
  gap: 6px;
}
.shelf .size-btn {
  padding: 5px 9px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
}
/* ON A CARD, DARK GREEN MEANS ON THE ORDER AND NOTHING ELSE (S47, S58 (R7)).
   The picked chip is the one the control line speaks for: an ink ring, never
   a green fill, so a picked size that is not on the order never reads as on. */
.product-card .size-btn.selected {
  border: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}
.product-card .size-btn.selected.size-btn--on {
  border-color: var(--ink);
  background: var(--accent);
  color: var(--accent-ink);
}

/* The − qty + stepper: appears once the selected size has a line on the
   draft, hides when the line goes. The quiet pill register (.aisle-back's
   voice) at card scale. Single-class selector: .hidden must win. */
.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}
.stepper-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  font-size: var(--fs-title);
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
/* THE NUMBER IS A FIELD (S47, after the walk). Bare, it did not look like
   anything to tap; now it is a box between two buttons. The hairline and the
   fill are the buttons' own; the corners are a rounded rect, not their
   circle. Sized to FOUR digits, in figures of one width, so 1, 24 and 1440
   sit in the same box and nothing jumps as he types. The font size and
   weight are the number's own and did not change. */
.stepper-qty {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(4ch + 14px);   /* four figures + 6px padding + hairlines */
  height: 34px;                  /* the buttons' height */
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  font-variant-numeric: tabular-nums;
}

/* One quiet plain line when a write is refused — the .error register's
   voice at card scale. Never a popup, never raw API text. */
.card-error {
  margin: 8px 0 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--temp);
}

/* THE KEYPAD (S47). The number between − and + becomes this field, and the
   field IS the box it replaced: it wears .stepper-qty, so the border, fill,
   corners, padding, font size and weight all come from that one rule, and
   board.js sets its width and height to the number's own box. Opening it
   changes nothing but the caret and the selection. This rule only takes away
   what a browser adds to an input. */
span.stepper-qty {
  cursor: pointer;
}
.keypad-field {
  margin: 0;
  font-family: inherit;
  line-height: inherit;
  outline: none;
}
/* Refused: the box's border turns amber and one step heavier. The outer size
   is fixed, so the heavier border takes its pixel from the inside. */
.keypad-field--refused {
  border: 2px solid var(--warn);
}

/* The keypad's one line, in one of two voices.

   REFUSED INPUT WEARS AMBER (--warn). "Minimum 24" was first drawn in the
   accent, and on the walk it read as another offer — Kapil believed 21 had
   been taken. The accent means an offer, red means the app failed him, and
   amber means his number was refused: one colour, one meaning.

   A FAILED WRITE is the refused-write line, in that line's own red. */
.keypad-note {
  margin: 6px 0 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
}
.keypad-note--refused {
  font-weight: 700;
  color: var(--warn);
}
.keypad-note--failed {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--temp);
}

/* THE MONEY ROW ON A CARD — the selected size only.

   THE FAULT IT REPLACED: one line carrying the size words, the old price,
   the new price and a percentage as a single sentence. Four numbers in a
   row read as noise, and the sentence wrapped and left "off" orphaned on a
   line of its own. The wording was right; the hierarchy was not.

   IT EXISTS IN BOTH STATES — so what he pays never changes position when a
   rung fires.

   THE WORDS ROW ABOVE IT IS GONE (R21): the size is said on the foot row, on
   the line he actually taps, and this row carries the money alone. */
.card-money {
  display: inline-flex;
  flex-wrap: wrap;               /* the pill may drop; the prices may not */
  align-items: baseline;
  gap: 4px 6px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink);
}

/* THE CONTROL LINE (S58 (R6)): "size · pack · $price ……… N +". The words and
   the money on the left, the one control on the right; on a card half a phone
   wide the control drops under the words, still right-aligned. Off, the whole
   line is the tap (R4). */
.card-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
/* On a card half a phone wide "size · pack · $price" cannot hold one line, so
   the size words stand on theirs and the price under them — never a separator
   left hanging where the line broke. */
.card-line-words {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.5;
}
.card-size {
  display: block;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.card-line-words .card-money {
  display: inline;
}
.card-line-words .card-money > * {
  margin-right: 5px;
}
.card-line .line-control {
  margin-left: auto;
  margin-right: 0;
}
.card-line.line-row--out {
  cursor: default;
}

/* WHAT HE PAYS LEADS — the biggest, boldest number on the card. */
.price-now {
  font-size: var(--fs-price);
  font-weight: var(--fw-price);
  color: var(--ink);
  white-space: nowrap;
}

/* The price he would otherwise pay: struck, quiet, smaller. It is context
   for the number above, never a figure to be read on its own. */
.price-was {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  text-decoration: line-through;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* THE PERCENTAGE PILL — ONE STYLE, USED ON THE CARD AND ON THE SHEET, so
   the two can never come to look like different facts.
   THE WORD CARRIES THE MEANING, NOT THE TINT (RP5): `off` is printed
   inside it, because a coloured chip is not a record to a man in a shop
   with a cracked screen in daylight. */
.price-off {
  flex: none;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(47, 111, 79, 0.10);   /* --accent, softened */
}

/* THE CARD'S RUNG LINE (S58 (R27)) is the row's own: the pill and the date. */
.card-rung-line {
  max-width: 100%;
  margin-top: 8px;
}

/* Invisible end-of-shelf sentinel: when it nears the screen, board.js
   fetches the next chunk in the background. Never visible — no loader. */
.shelf-sentinel { height: 1px; }

/* The shelf's natural end (final chunk only): a quiet soft-ink line and
   the same quiet pill home (.aisle-back reused). Centred, with room to
   breathe so it reads as the shelf ending, not a footer. */
.shelf-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 0 10px;
}
.shelf-end-line {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}

/* ---- The order strip + the order sheet (tap-add pass 3) ----
   position:fixed binds to the viewport on a phone and to the demo phone
   frame on desktop (the .shell transform trick the video already uses). */

/* The strip: ONE persistent stage-green strip pinned to the bottom.
   Sheet closed it shows the items count; sheet open it is the sheet's
   FOOT (total + quiet GST sub-line). z 70 — above the sheet (60), below
   the video (90) and the frame ring (95). */
.order-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  margin: 0 auto;
  max-width: var(--maxw);
  width: 100%;
  display: flex;
  flex-direction: column;           /* main line + optional GST sub-line */
  align-items: center;
  gap: 2px;
  border: none;
  border-radius: 18px 18px 0 0;     /* the hero-card radius, floor edition */
  background: var(--stage);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: var(--fs-name);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 -8px 24px rgba(16, 32, 26, 0.18);
}

/* S58 (R16) — THE OPEN FOOT IS STACKED, FULL WIDTH: the truck strip, the
   total with the saving on its line, then the actions. Closed, the strip is
   one control and its count sits in the middle. Open, nothing in it closes
   the sheet, so it is not a pointer. */
.order-bar-main {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.order-bar--open {
  cursor: default;
  align-items: stretch;
  padding-top: 12px;
}
.order-bar-total {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 6px;
  min-width: 0;
}
/* S59 (R40) — LINE ONE of the open foot: "Total $X + GST $Y", one line, the
   Price step. The "+ GST $Y" is PLAIN INK (the strip's own), never green. */
.order-bar--open .order-bar-total {
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: var(--fs-price);
  font-weight: var(--fw-price);
}
.order-bar-gst {
  font-weight: var(--fw-support);
  color: inherit;
}
.order-bar-sub {
  align-self: center;
}
.order-bar-actions:empty {
  display: none;
}
.order-bar-actions {
  width: 100%;
}

/* The quiet GST sub-line — rendered ONLY when GST > 0. The soft small-
   text voice in its dark-stage colour (--accent-lift is the documented
   quiet register on --stage; grey soft-ink would vanish on the green). */
/* LINE TWO (S59 (R40)): "You saved $Z" — the green is the saving's own. */
.order-bar-sub {
  margin-top: 2px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  letter-spacing: 0.2px;
}

/* While the bar shows, the shop screens keep their last card clear of it */
.app.has-order-bar #board,
.app.has-order-bar .aisle {
  padding-bottom: 110px;
}

/* The sheet: dim above, panel below, over whichever screen is open.
   z 60 — above the bar, below the video surface. */
.order-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.order-sheet-dim {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 26, 0.45);   /* --stage's shadow voice */
  cursor: pointer;
}
.order-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: var(--maxw);
  max-height: 80%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 30px rgba(16, 32, 26, 0.25);
  animation: sheet-rise 0.25s ease;
}
@keyframes sheet-rise {
  from { transform: translateY(28px); opacity: 0.6; }
  to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .order-sheet-panel { animation: none; }
}

/* CLOSE AT THE TOP (S58 (R16)): the grab handle over the head, the title, and
   the ✕ at the right. */
.order-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
  border-bottom: 1px solid var(--line);   /* the cart's one furniture hairline (S59 (R38)) */
}
.order-sheet-title {
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  letter-spacing: -0.2px;
  color: var(--ink);
}

/* The lines, scrolling between the head and the strip (the sheet's foot
   is the order strip, z 70, not a child — the bottom padding keeps the
   last line clear of it, two-line state included). The category headers
   are the shared .kicker register, appended by board.js. */
.order-sheet-body {
  flex: 1;
  overflow-y: auto;
  /* THE LIST MUST NOT NARROW THE MOMENT IT SCROLLS. The scrollbar takes its
     width out of the CONTENT box, and .sheet-line-info is flex:1 min-width:0
     — so the name column silently lost ~15px as soon as a fifth line made
     the sheet overflow, and names that fitted at four lines wrapped at five.
     A stable gutter reserves the space whether it scrolls or not, so the
     column is one width always. */
  scrollbar-gutter: stable;
  /* Tighter side gutters than the shelf: this is a dense list of lines with
     fixed furniture on the right, and every pixel here is name column. */
  padding: 0 14px 92px;
}
.order-sheet-body .kicker {
  margin: 12px 0 2px;
}

.sheet-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.sheet-line-info {
  flex: 1;
  min-width: 0;                 /* long names shorten, steppers never move */
}
.sheet-line-name {
  font-size: var(--fs-name);
  line-height: 1.3;             /* one line is a known height, not a guess */
  font-weight: var(--fw-name);
  color: var(--ink);
}
.sheet-line-sub {
  margin-top: 2px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
/* RP6 — the unit price the sheet never carried. Same quiet register as
   the size words above it: the line total to its right is the figure that
   leads, and this is what it is made of. The pill sits BESIDE it, not
   after a separator — it is a mark on the line, not another clause. */
.sheet-line-unit {
  display: flex;
  /* WRAPS (Kapil, S50, ruling A). The pill drops under the price whenever
     the price and the pill do not both fit the column, and shares the line
     when they do. A discounted row gets taller; nothing on it is clipped or
     painted over (L2).

     AT 1536x832 THAT IS EVERY EVERYDAY DISCOUNT ROW, not only a squeezed
     one. Measured 2026-09-13 with the old nowrap, on the five-line sheet: a
     113px column holding 122-123px of price and pill, every pill already
     past the column, and on two of three rows 1.36px under the stepper. The
     layout had no slack. A four-digit quantity's box only made it plain:
     column 77px, content 116px, the pill about 30px over the stepper.

     IT WAS nowrap, AND THAT REASON IS GONE. A dropped pill made the sheet
     taller, a taller sheet scrolled, and the scrollbar took its width out
     of the name column — so one wrap narrowed every row and could drop the
     next. .order-sheet-body now reserves the gutter (scrollbar-gutter:
     stable), so the column is one width whether it scrolls or not, and a
     wrap costs its own row height and nothing else. What nowrap bought
     instead was the pill running out of the column and under the stepper
     (tests/frontend/test_sheet_wrap_screen.py).

     The price span stays nowrap, so "$2.93 each" never splits; the pill
     stays flex:none, so it moves as one piece. */
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.sheet-line-unit > span:first-child {
  white-space: nowrap;
}

/* RP6 — "You saved $X", at the foot of the lines and on the open bar.
   IT SITS APART FROM Total AND GST, AND QUIETER THAN BOTH. Those two are
   one thought — what this order costs. The saving is NOT a third charge
   and must not read as one, and three dollar amounts in one column read
   as things that add up. Hence the space above it and no rule, no box, no
   second weight. No explaining word is added either: RP5's four words are
   the whole vocabulary. */
.you-saved {
  margin: 14px 0 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
/* On the dark stage the soft grey would vanish, so it borrows the GST
   line's documented quiet register and stays a step below it. */
/* THE FOOT'S SECOND LINE (S59 (R40), replacing R20's clause on the total's
   line): "You saved $Z", the only green in the foot. THE LOUDEST SECONDARY LINE
   IN THE APP (S59 (R46), amending R37's table for this one line): the Name
   step and the bright green the Specials star wears on dark, at full strength.
   Text, not a filled badge — Place order beneath it must win. */
.order-bar .you-saved {
  margin: 0;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  letter-spacing: 0.2px;
  color: var(--accent-lift);
}
/* No separator: since S59 (R40) the saving is the foot's second line, not a
   clause on the total's. */
/* THE RIGHT-HAND FURNITURE IS FIXED. Both are `flex: none`, so they never
   grow into the name column and never shrink out of a usable tap target —
   whatever is left over belongs to the name, the size words and the unit
   price, and that is the only part of the row that flexes. */
.sheet-line .stepper {
  flex: none;
  margin-top: 0;
  gap: 6px;
}
.sheet-line .stepper-btn {
  width: 28px;
  height: 28px;
  font-size: var(--fs-name);
}
/* ON THE SHEET THE BOX SIZES TO ITS DIGITS (Kapil, S47 3d, ruling b). The
   card's box is fixed at four figures; here the name column is the scarce
   thing (S46 (m)). Measured at 1536x832, a four-figure box cost that column
   20px or more — S46's three-word name wrapped even with no padding (87px of
   its 107px). Fitting the digits keeps the column at 107px for everyday
   quantities, and the box widens only as the number does.

   A row carrying a 4-digit quantity still narrows the column, with or without
   the box (84px with the old bare number, 77px with the box at S50). Since
   S50 nothing is lost to it: .sheet-line-unit wraps, so the pill drops under
   the price instead of running under this stepper (TASKS.md S48 item 2). */
.sheet-line .stepper-qty {
  height: 28px;
  padding: 0 2px;
  min-width: 0;
}
.sheet-line-total {
  flex: none;
  min-width: 58px;              /* "$151.20" at this weight, and no wider */
  text-align: right;
  font-size: var(--fs-price);
  font-weight: var(--fw-price);
  color: var(--ink);
}
/* THE CART LINE IS THE ROW FAMILY (S58 (R15)): name · size on line one, the
   count times what he pays each on line two, the rung line when there is one;
   on the right the one control with the line total under it. */
.cart-line {
  align-items: flex-start;
}
.sheet-line-top {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.35;
  color: var(--ink-soft);
}
.sheet-line-top .sheet-line-name {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
}
.sheet-line-size {
  color: var(--ink-soft);
}
.order-sheet-head.sheet-head {
  justify-content: space-between;
}
.sheet-sep {
  color: var(--ink-soft);
}
.sheet-line-right {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.cart-line .line-control {
  min-width: 0;
  margin-right: 0;
  gap: 5px;
}
.cart-line .control-btn {
  width: 28px;
  height: 28px;
  font-size: var(--fs-name);
}
.cart-line .line-control .stepper-qty {
  height: 28px;
  min-width: 0;
  padding: 0 4px;
}
.cart-line .rung-line {
  margin-top: 2px;
}

/* The keypad's line on the sheet sits under the whole row, right-aligned
   under the stepper. The row wraps to carry it ONLY while it shows, so an
   everyday row is laid out exactly as before. Nothing here sets display, so
   .hidden still hides it. */
.sheet-line:has(> .keypad-note:not(.hidden)) {
  flex-wrap: wrap;
}
.sheet-line > .keypad-note {
  flex-basis: 100%;
  margin: 0;
  text-align: right;
}

/* ---- Early close (B1): the accent pill, the sheet's place/confirm
   blocks, the sealed confirmation, and the board's resume ask card.
   No new design language — the gate-btn voice generalised to a shared
   pill, the quiet pill (.aisle-back) as its counterpart, existing card
   and kicker registers throughout. ---- */

/* The accent pill — V1's choice-look button register (.gate-btn's voice)
   as a shared class: Place order, Confirm order, Continue order, Done. */
.pill-accent {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: var(--fs-name);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pill-accent:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Place order and Confirm order: ONE FULL-WIDTH GREEN BUTTON at the bottom of
   the foot (S58 (R16)), ringed in the stage's lighter green so the pill holds
   its edge on the dark ground. */
.sheet-place,
.sheet-seal {
  display: block;
  width: 100%;
  margin: 12px 0 2px;
  border-color: var(--accent-lift);
}
/* "Edit order" is plain text — it goes back to the lines and closes nothing. */
.sheet-edit {
  display: block;
  margin: 6px auto 0;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--accent-lift);
  font-family: inherit;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Order again (S52 as Build My Order, rebuilt S54, renamed S57c) — the
   usuals list ----
   No new design language: the aisle's chrome (.aisle, its solid sticky
   .aisle-bar, the title above it), the sheet's line (.sheet-line, its info
   column and keypad note), the card's size chip for the category chips. No
   new token: the green of a line on his order is the accent, washed. */

/* The order strip sits on the floor of this screen too (S53 (a)); the last
   line stays clear of it. .aisle.usuals outranks .aisle's padding shorthand. */
.aisle.usuals {
  padding-bottom: 110px;
}

/* The category chips ride in the sticky bar under ‹ Board, so a jump is
   always in reach. One row that scrolls sideways — never a taller bar. */
.usuals-chips {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.usuals-chips::-webkit-scrollbar {
  display: none;
}
.usuals-chip {
  flex: none;
  white-space: nowrap;
  padding: 6px 12px;                /* the condensed head (S59 (R30)) */
}
/* ONE BAR, THEN PRODUCT (S59 (R30)): the first row sits close under it. */
.usuals .aisle-bar {
  margin-bottom: 6px;
}

.usuals-cat {
  margin-top: 18px;
}
.usuals-cat:first-child {
  margin-top: 0;
}

/* A category's head is its name (S57b (R13)): no dash, no count, no button —
   THE ONE SECTION LABEL (S59 (R38)), the Label step, as the board's. */
.usuals-head {
  margin-bottom: 2px;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* The row is the sheet's line, given room for its green. */
.usuals-line.sheet-line {
  gap: 10px;
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: 10px;
}
/* On his order (S53 (c)): the number on the stepper is then the order's. */
.usuals-line--in {
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
}

/* The unit word beside the number — "2 inners". A fixed floor under its
   width, so the + does not move when the word turns plural. */
.usuals-unit {
  flex: none;
  min-width: 46px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.usuals-line .stepper-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* A line's one-word reason, under its price (S53 (g)). Grey for out of stock;
   amber when his quantity was refused, red when the app failed him (S47). */
.usuals-reason {
  margin-top: 2px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.usuals-reason--refused {
  font-weight: 700;
  color: var(--warn);
}
.usuals-reason--failed {
  font-weight: 400;
  color: var(--temp);
}
.usuals-line--out .sheet-line-name {
  color: var(--ink-soft);
}

/* ---- The aisle bands (S57 slice 2; simplified at S57b and S57c; the control
   at S58): the row and its control, the brand label, the fold, the not-yet
   card's foot row ----
   No new colour and no new design language: the row is the sheet's line (the
   same register Order again's rows wear), the fold is the quiet pill. Dark
   green = on the order; amber = refused; red = the app failed; grey = out of
   stock (S47). */

/* ORDER AGAIN ROWS (S59 (R31)): one ground, a hairline between rows (the
   sheet line's own), and ON IS A GREEN LEFT EDGE PLUS THE GREEN CONTROL — a row
   on the order is never tinted. The edge is drawn inside the row, so going on
   moves nothing. */
.line-row.sheet-line {
  gap: 10px;
  margin: 0 -8px;
  padding: 8px 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.line-row--on {
  box-shadow: inset 3px 0 0 var(--accent);
}
.line-row--out {
  cursor: default;
}
.line-row--out .sheet-line-name {
  color: var(--ink-soft);
}
/* DENSITY (S58 (R24)): the row's name on ONE line, cut with an ellipsis; the
   size and the pack in grey on a second. One type scale with the card and the
   cart: 14px names, 12px secondary words. */
/* R29 (amending R24): THE NAME WRAPS TO TWO LINES, shown in full — no ellipsis. */
.line-row .line-name {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  line-height: 21px;               /* S59 (R37): kept at ~1.3 of the Name step */
  white-space: normal;
  overflow-wrap: anywhere;
}
.line-size {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 18px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-row .line-mark,
.line-row .line-reason {
  margin-top: 1px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 18px;
}
/* THE THUMBNAIL (S58 (R5)): small, on the row's left, the card's own picture
   box at row scale — contain-fit, the placeholder icon when there is no
   picture (R43). Its tap is the photo sheet. */
.line-thumb.card-image {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
}
/* THE PICTURELESS THUMBNAIL CARRIES NO TEXT AT ALL (S59 (R43)): the tile's own
   quiet placeholder icon (.tile-img:empty), on the same soft wash — the name is
   already printed beside it. */
.line-thumb--none {
  background-color: var(--bg);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237A7F7A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.45"><path d="M4 10h16M4 10l1.5-4.5h13L20 10M4 10v9a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-9M9 20v-5h6v5"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
}

/* THE ONE CONTROL (S58 (R2)): "N +" before the tap — the number in grey, the
   + green — and "− N +" in dark green once the line is on. The number keeps
   its keypad box (.stepper-qty). THE COLUMN IS A FIXED RIGHT INSET: the control
   never grows into the words, and every row's number stands in one column
   (the S57d walk). */
/* COMPACT (S58 (R24)): 28px round buttons and a narrow number box. */
.line-control {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 96px;
  margin-right: 4px;
}
.control-btn {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent);
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.control-plus {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.control-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.line-control .stepper-qty {
  height: 28px;
  min-width: calc(2ch + 10px);
  padding: 0 4px;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
}
.line-control--off .line-number {
  color: var(--ink-soft);
  font-weight: 600;
}
.line-control--on .line-number {
  border-color: var(--accent);
  color: var(--accent);
}
.line-control--on .control-minus {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.line-row--out .control-plus {
  border-color: var(--line);
  background: var(--bg);
  color: var(--ink-soft);
}
/* THE RUNG LINE (S58 (R27), amending R9): THE RUNG IS A PILL — outlined dark
   green, 28px tall, "8 more → 10% off", tappable. THE DATE IS PLAIN GREY TEXT
   beside it, or alone; it does nothing on a tap. */
.rung-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 4px 0 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 18px;
  color: var(--ink-soft);
}
.rung-pill {
  box-sizing: border-box;
  height: 28px;
  padding: 0 12px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent);
  font-family: inherit;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rung-date {
  font-weight: 600;
}
/* A refused or failed write is said by the row's word, in its colour (S47). */
.line-row--refused .line-number {
  border-color: var(--warn);
}
.line-row--failed .line-number {
  border-color: var(--temp);
}
.line-mark {
  margin-top: 2px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.line-reason {
  margin-top: 2px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.line-reason--refused {
  font-weight: 700;
  color: var(--warn);
}
.line-reason--failed {
  font-weight: 400;
  color: var(--temp);
}

/* THE BRAND LABEL (R12): quiet, once per block, only where it tells one block
   from the next. No display property here, so .hidden always wins. */
.brand-label {
  margin-top: 8px;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);  /* the Label step: spaced caps (S59 (R37)) */
  text-transform: uppercase;
  color: var(--ink-soft);
}

.fold-line {
  display: block;
  padding: 8px 14px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
}
/* THE TRUCK STRIP (S58 (R14), REDESIGNED S60 (g)-(k)): A STATUS, NOT A CARD.
   Above 3 days it is one bare line — a truck, "Order by Tue 6 Oct", and the
   days at the right edge — with no box of any kind. At 1-3 days and on the
   cutoff day it becomes a filled band, which is the only weight it ever wears.
   It is NOT tappable (S60 (i)): no cursor, no hit affordance, no handler.
   On the board it sits under the header; in the cart foot, above the total.
   .hidden (later in this file) wins. */
.truck-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.3;
  color: var(--ink-soft);
  text-align: left;
  user-select: none;
}
.board-truck {
  margin-bottom: 14px;
}
.truck-icon {
  flex: none;
}
.truck-when {
  min-width: 0;
}
/* (g) THE DATE ALONE WEARS --ink; everything around it is --ink-soft. */
.truck-date {
  color: var(--ink);
}
/* The days ride at the right edge, and never wrap mid-count. */
.truck-days {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* (g) CALM IS BARE: no background, no border, no radius. Named, not implied,
   so a band's rules below are the only thing that can draw a box.
   (l) AND IT IS ONE PHRASE, WITH ONE BOLD WORD. Everything sits together at the
   LEFT — icon, "Order by", the date, "· 16 days" — with nothing at the right
   edge: pinned apart with no box to hold them, the two ends read as unrelated
   scraps. The date is the Name step so the line has one thing to look at, and
   the truck keeps R14's green as the single touch of colour. */
.truck--calm {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 2px 0;
  align-items: baseline;
}
.truck--calm .truck-icon {
  color: var(--accent);
  align-self: center;
}
.truck--calm .truck-date {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
}
/* The days are part of the phrase, not an opposite end of it. */
.truck--calm .truck-days {
  margin-left: 0;
}
/* (h) WEIGHT FOLLOWS URGENCY: a filled band, and the loud half in bold. */
.truck--amber,
.truck--red {
  padding: 8px 12px;
  border-radius: var(--radius);
}
.truck--amber {
  background: var(--amber-band);
  color: var(--amber-band-ink);
}
.truck--amber .truck-date { color: var(--amber-band-ink); }
.truck--amber .truck-days { font-weight: var(--fw-title); }
.truck--red {
  background: var(--red-band);
  color: var(--red-band-ink);
}
.truck--red .truck-when { font-weight: var(--fw-title); }
.truck--red .truck-date { color: var(--red-band-ink); }
.order-bar .truck-slot:not(:empty) {
  width: 100%;
  margin-bottom: 8px;
}
/* THE CLOSED STRIP STAYS COUNT ONLY (S58 (R17)): the truck rides in the foot
   only while the sheet is open. */
.order-bar:not(.order-bar--open) .truck-slot {
  display: none;
}
/* (j) THE CART'S SECOND LINE. The cart says both dates, and that line plus its
   days does not hold 360px — so in the cart, and only there, the days drop
   below the words. The cutoff day's shorter line is not stacked. */
.truck--stacked {
  flex-wrap: wrap;
}
.truck--stacked .truck-when {
  flex: 1 1 0;                     /* shrinks beside the truck; never wraps under it */
  min-width: 0;
}
.truck--stacked .truck-days {
  flex: 0 0 100%;
  text-align: right;
}
/* (l) THE CALM CART'S SECOND LINE IS LEFT-ALIGNED, under the phrase it belongs
   to. The amber band's stacked line keeps its right edge, unchanged. */
.truck--stacked.truck--calm .truck-days {
  text-align: left;
  flex: 0 0 calc(100% - 30px);     /* always its own line, indented to the words */
  margin-left: 30px;               /* the icon's width and the row's gap */
}
/* ON THE CART'S DARK GROUND the calm line keeps its shape and swaps its ink:
   --ink is unreadable there, so the date takes the stage's own white and the
   words around it a quieter white. The bands keep their own colours — a band
   is a band wherever it is. */
.order-bar .truck--calm {
  color: rgba(255, 255, 255, 0.70);
}
.order-bar .truck--calm .truck-date {
  color: var(--accent-ink);
}

/* THE TILE MARK (S58 (R13)): "3 of yours to add", small and green under the
   category's name. .hidden (later in this file) wins at zero. */
.tile-mark {
  margin-top: 3px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--accent);
  text-align: center;
}

/* ---- THE PHOTO SHEET (S58 (R11)) ----
   The order sheet's own frame — the dim, the panel rising from the floor — over
   the aisle or the list, above the order strip (z 80, under the video's 90). Its
   head is a grab handle and a ✕; its body is the card laid out as a sheet. */
.photo-sheet {
  z-index: 80;
}
.sheet-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  padding: 10px 14px 4px;
  touch-action: none;
  cursor: grab;
}
.sheet-grab {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 38px;
  height: 5px;
  margin-left: -19px;
  border-radius: 999px;
  background: var(--line);
}
.sheet-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: var(--fs-name);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-sheet-body {
  overflow-y: auto;
  padding: 0 20px calc(18px + env(safe-area-inset-bottom));
}
.photo-sheet-card.product-card {
  border: none;
  background: transparent;
  padding: 0;
}
/* The photo sheet is the card's component and inherits R39's proportions:
   the photo on white, about 220px (S59). */
.photo-sheet-card .card-image {
  height: 220px;
  background: var(--card);
}
.photo-sheet-card .card-name {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
}
.photo-sheet-price {
  margin-top: 12px;
}
.photo-sheet-price .card-size {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
}
/* THE FIXED FOOT (S58 (R26)): the panel is a column — head, the scrolling
   body, then this foot, which never scrolls away. */
.photo-sheet-body {
  flex: 1;
  min-height: 0;
}
.photo-sheet-footbar {
  flex: none;
  padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.photo-sheet-footbar:empty {
  display: none;
}
.photo-sheet-footbar .photo-sheet-foot {
  margin: 0;
}

/* THE FOLD OPENS AS CARDS, IN THE AISLE'S ONE COLUMN (S58 (R8), (R23)). */
.fold-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 10px;
}
.product-card--on {
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
}

/* ======================= "NEED IT?" — THE QUIET MARK (S66 (c), (j)) ========
   ONE CLASS, set by frontend/lines.js's paintNeedIt beside the mark's words,
   on the Order again ROW and on the aisle CARD — one mark, one flow, wherever
   his line shows (S66 (c)).

   QUIETER THAN A DEAL MARK, deliberately. A deal speaks in the accent green
   and speaks twice: the `.price-off` pill (green text on a green wash) and the
   `.rung-pill` (a 1.5px green outline, tappable). This is a neutral wash and
   nothing else — no border, no bold, no green, no pill, no badge. Ranked from
   loudest: the rung pill, the percentage pill, a refusal's amber word, then
   this. It is a question asked in the background of a line, not a fact about
   the price.

   THE ROW'S WASH SURVIVES ITS ON-STATE. A row on the order is marked by a
   green LEFT EDGE drawn inside it (`.line-row--on`, an inset box-shadow), so
   the two never fight: the edge says "on", the faded wash says "you were
   asked". NOTHING MOVES either way (S57 (R3), (R4)).

   THE CARD'S ON-GREEN WINS THE GROUND, and the words carry the mark there.
   `.product-card--on` fires when ANY size on the card is on, so leaving the
   wash in charge would paint a card green-free while one of its sizes sat on
   the order. The louder, more consequential fact keeps the card's ground; the
   "Need it?" words stay under the name, faded. */
.line-row.need-it,
.product-card.need-it {
  background: var(--need-it);
}
.line-row.need-it-done,
.product-card.need-it-done {
  background: var(--need-it-done);
}
/* The words fade with the ground — never removed, only quieter (S66 (j)). */
.need-it-done .line-mark {
  opacity: 0.6;
}
/* "CHECK STOCK, MAY BE LOW." — PLAIN WORDS (S73 (K1) as amended by S83; S74 G12). S73 (K2)'s chip, with its
   border, 44px target and "not this time" tap, is withdrawn: G12 keeps the
   words and the quiet row tint and takes the tap away. So nothing here says
   "tap me" — no border, no pointer, no hit area — only the mark's own soft
   ink at the support step, smaller than the line name, no bold and no green,
   so a deal stays the loud thing (S66). It sits after the other words, on
   their line, and fades with the mark (.need-it-done above). */
.due-words {
  display: inline;
  color: inherit;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  cursor: default;
}
.line-mark-words + .due-words::before {
  content: " · ";
}
/* On the order: the card's green mix is the louder fact and keeps the ground. */
.product-card--on.need-it,
.product-card--on.need-it-done {
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
}
/* The photo sheet IS the card's component (R11), but it is a full-height
   sheet, and a wash across a whole sheet is not quiet. There the words carry
   the mark alone. */
.photo-sheet-card.need-it,
.photo-sheet-card.need-it-done {
  background: transparent;
}

/* A list that could not load is the app failing him: red (S47). */
.usuals-note--failed {
  color: var(--temp);
  cursor: pointer;
}

/* THE CONFIRM STEP IS THE FOOT (S58 (R16)): the truck line, "Edit order", and
   Confirm order, stacked. */
.sheet-confirm {
  margin: 8px 0 0;
  text-align: center;
}
.sheet-confirm-truck {
  margin: 0;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
}
.sheet-confirm-sub {
  margin-top: 2px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
  text-align: center;
}
.sheet-confirm .card-error {
  text-align: center;
  color: #ffb4a8;                /* the red, lifted to read on the dark foot */
}

/* The sealed confirmation — the sheet become the receipt moment.
   Tick circle = the arrival-icon register (same wash, same accent). */
.sheet-sealed {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 26px 0 10px;
}
.sheet-sealed-tick {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #eaf3ee;              /* the arrival-icon wash */
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.sheet-sealed-title {
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  letter-spacing: -0.2px;
  color: var(--ink);
}
.sheet-sealed-line {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  color: var(--ink);
}
.sheet-sealed-when {
  margin-top: 4px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.sheet-sealed .pill-accent {
  width: 100%;
  margin-top: 20px;
}

/* Get your order copy (S42 slice 2) — the quiet register, under the
   placed line and above Done. Secondary on purpose: Done is what finishes
   the moment; his copy is there for whoever wants it. */
.sheet-sealed-doc {
  width: 100%;
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.sheet-sealed-doc:disabled {
  opacity: 0.6;
  cursor: default;
}
.sheet-sealed-doc + .pill-accent {
  margin-top: 10px;
}

/* The resume ask card — the board's card register (.aisle-card base),
   shown alone before the tiles; gone once answered. */
.resume-card {
  margin-top: 8px;
  padding: 20px 18px;
}
.resume-line {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  color: var(--ink);
  margin-bottom: 14px;
}
.resume-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resume-btns .pill-accent,
.resume-btns .aisle-back {
  width: 100%;
  text-align: center;
}
.resume-btns .aisle-back:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---- The front door (V1 transplant, L11): recognition, suppliers,
   video. Recognition + video reuse V1's #arrival-recognition /
   #arrival-video patterns with the CleverRep tokens. ---- */

/* Recognition: full-screen centred card on the clean white surface
   (V1's .finish register) */
.gate {
  flex: 1;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
}

.gate-card {
  width: 100%;
  max-width: 340px;
}

/* Shield badge — V1's .arrival-icon, verbatim (incl. its calm wash) */
.arrival-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #eaf3ee;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.gate-hero {
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  color: var(--ink);
  margin: 0 0 6px;
}

.gate-sub {
  font-size: var(--fs-name);
  color: var(--ink-soft);
  margin: 0 0 22px;
}

/* The secure trusted-device line — V1's .recognition-secure, verbatim */
.recognition-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 300px;
  margin: 0 auto 26px;
}
.recognition-lock {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--accent);
}

/* Continue — V1's choice-look button register */
.gate-btn {
  width: 100%;
  max-width: 300px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 12px;
  font-size: var(--fs-name);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* ---- Suppliers page: the board's card language, one tile today ---- */

.suppliers {
  padding: 16px 20px 40px;          /* same gutters as the board */
}

.suppliers .kicker {
  margin: 8px 0 12px;
}

.supplier-tile {
  position: relative;               /* anchors the future deal badge */
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(30, 38, 34, 0.04);
  padding: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.12s ease;
}
.supplier-tile:active {
  transform: scale(0.98);
}

.supplier-mono {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #eaf3ee;              /* the arrival-icon wash */
  color: var(--accent);
  font-size: var(--fs-title);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.supplier-name {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  color: var(--ink);
}

/* Deal-count badge — styled but NOT in the markup yet: it gets wired to
   the real Specials count later. Never shows a made-up number, so until
   real data exists the class simply isn't applied. */
.supplier-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--temp);
  color: var(--accent-ink);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  text-align: center;
  line-height: 20px;
  box-shadow: 0 1px 3px rgba(30, 38, 34, 0.25);
}

/* ---- Video screen: V1's #arrival-video treatment — dark surface,
   contain-fit clip, play overlay, Skip the only word ---- */

.intro-video {
  /* Full-cover surface (V1's treatment): sits over the ENTIRE app screen,
     header included. On a phone the containing block is the viewport; on
     the desktop demo the .shell carries a transform, making it the
     containing block — so this covers exactly the framed phone screen,
     never the browser page. Header reappears untouched when this closes. */
  position: fixed;
  inset: 0;
  z-index: 90;                      /* above the header (10); below the
                                       frame's ring (95) and notch (96) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.video-el {
  width: 100%;
  height: 100%;
  object-fit: contain;              /* whole frame visible, never cropped */
  background: #000;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;                /* optically centre the play triangle */
  cursor: pointer;
}

/* Quiet brand watermark, top-left — same layer as Skip. A whisper, not a
   header bar: the clip owns the screen. */
.video-brand {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  font-size: var(--fs-name);
  letter-spacing: 0.2px;
  color: #fff;
  opacity: 0.8;
  pointer-events: none;
}
.video-brand-clever { font-weight: 400; }
.video-brand-rep    { font-weight: 700; }

.video-skip {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;                       /* clearly above the clip */
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: var(--fs-support);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---- Error line ---- */

.error {
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
  padding: 32px 20px;
  color: var(--temp);
  font-size: var(--fs-support);
  cursor: pointer;
}

/* Utility: anything with .hidden is not shown */
.hidden {
  display: none;
}

/* ============================================================
   DEMO PHONE FRAME (>550px) — V1's desktop stage, transplanted.
   On a real phone (<=550px) none of this exists: the shell is
   display:contents and the app runs edge-to-edge.
   ============================================================ */

@media (min-width: 551px) {
  /* The stage field behind the phone — tinted deep green */
  html, body {
    background: radial-gradient(
      circle at 50% 30%,
      color-mix(in srgb, var(--stage) 82%, var(--accent-lift)),
      var(--stage) 70%
    );
  }
  body {
    display: flex;                  /* centre the phone */
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }

  /* The bezel: silver rim, phone ratio, deep shadow (V1's exact frame) */
  .shell {
    display: block;
    position: relative;
    transform: translateZ(0);       /* V1's trick: makes the frame the
                                       containing block for position:fixed
                                       children, so the full-cover video
                                       binds to the phone screen, not the
                                       browser viewport */
    overflow: hidden;               /* rounds the screen to the phone shape */
    height: min(88vh, 932px);
    aspect-ratio: 430 / 932;        /* true phone ratio — never squashed */
    width: auto;
    border: 12px solid #C9CED4;     /* V1's silver / titanium rim */
    border-radius: 48px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  }

  /* Thin black screen-surround ring just inside the rim (V1's two-layer look) */
  .shell::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 36px;
    box-shadow: inset 0 0 0 5px #050B08;
    pointer-events: none;
    z-index: 95;
  }

  /* The notch */
  .shell-notch {
    display: block;
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 22px;
    border-radius: 999px;
    background: #050B08;
    z-index: 96;
    pointer-events: none;
  }

  /* The screen: the app scrolls INSIDE the frame; scrollbar hidden */
  .app {
    height: 100%;
    max-width: none;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg);
    scrollbar-width: none;          /* Firefox */
  }
  .app::-webkit-scrollbar { display: none; }   /* WebKit/Blink */

  /* Clear the notch: push the header's content below it */
  .header { padding-top: 38px; }

  /* Off the board there is no header (S59 (R33)): the bar is the top, and
     its own content clears the notch. */
  .aisle-bar { top: 0; padding-top: 38px; }
}

/* ---- The Specials screen (S71 (h), S71g W-c, S72 R2-R4) ----
   THE APP'S OWN TYPE, COLOUR AND CONTROL — none of the mockup's. Three
   sideways rows of cards; the next card peeks at the right edge, so a row
   reads as one you can swipe. Words lead, the photo is the row thumbnail
   (makeThumb). The control is the one control (S58), styled where it lives. */

/* The screen's first line, "8 deals picked for you" — moved here from the
   button (S73 (K3)). The Name step, in ink: what the screen is. */
.offers-lead {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  color: var(--ink);
}

/* The quiet "N of M seen" — context, never a goal. */
.offers-seen {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}

/* R4 — THE BAND over the picked rows, once: the Specials tile's own stage
   green, so it reads as the same family as the door he came in by. */
.offer-band {
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--stage);
  color: var(--accent-ink);
  font-size: var(--fs-name);
  font-weight: 700;
}

.offer-row {
  min-width: 0;                     /* let the strip scroll inside the grid */
}
.offer-row-title {
  margin: 4px 0 8px;
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  color: var(--ink);
}
.offer-strip {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.offer-strip::-webkit-scrollbar {
  display: none;
}

/* A card: most of the row's width, so the next one peeks (R2). */
.offer-card {
  flex: 0 0 78%;
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.offer-card--on {
  border-color: var(--accent);
}
.offer-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* The name and, under it, the unit the price is for (S73 (K4)) — the Order
   again row's .line-size, so the two read the same. */
.offer-named {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.offer-name {
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
  color: var(--ink);
}
.offer-reason {
  font-size: var(--fs-support);
  font-weight: var(--fw-support);
  color: var(--ink-soft);
}
.offer-money {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.offer-deal {
  font-size: var(--fs-support);
  font-weight: 700;
  color: var(--accent);
}
.offer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}
.offer-foot .line-reason {
  margin: 0 auto 0 0;
}
.offer-foot .line-control {
  margin-right: 0;
}


/* ---- THE DISPLAY DEAL, THE SHOP'S SIDE (S78) ----
   The passed mockup (frontend/mockups/s76_shop.html) built on the app's own
   classes: the truck strip, the offer card, the sheet line, the order bar,
   the camera label. These lines are LAYOUT GLUE only — no new colour, no new
   size; every value a token or a step the app already uses. */

/* THE BAND: the amber truck strip's own band, and it IS a button. */
.display-band {
  margin-bottom: 14px;
  border: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.display-band .truck-when { font-weight: var(--fw-name); }

/* YOUR DISPLAY SPOTS (screen 3): full-width cards, the spot's photo a small
   thumbnail beside its name and word, the credit under a hairline. */
.display-body { padding-bottom: 40px; }
.display-stack { display: flex; flex-direction: column; gap: var(--gap); }
.display-stack .offer-card { flex: none; width: 100%; }
.display-row { display: flex; align-items: center; gap: 10px; }
.display-row .offer-named { flex: 1; min-width: 0; }
.display-row--tap { cursor: pointer; }
.display-chevron { flex: none; color: var(--ink-soft); font-size: var(--fs-title); }
.display-spot-photo {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--line);
  flex: none;
}
.display-credit { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.display-credit .sheet-line:last-of-type { border-bottom: 0; }
.display-credit .sheet-sealed-doc { margin-top: 8px; }
.display-wide { display: block; width: 100%; margin-top: 18px; }

/* The form: the kinds as pills, the app's own − n + for the number and the
   weeks, the claim flow's camera. */
.display-field { margin-top: 16px; }
.display-field .line-control { justify-content: flex-start; margin-top: 8px; }
.display-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.display-pills .pill-accent,
.display-pills .aisle-back { padding: 10px 16px; }
.display-other {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-name);
  font-weight: var(--fw-name);
}
.display-other.hidden { display: none; }
.display-preview { width: 100%; height: auto; max-height: 240px; margin-bottom: 8px; }
.display-preview.hidden { display: none; }
.display-field .credit-file-btn { display: block; margin-top: 8px; }

/* THE OFFER IN SPECIALS (screen 4): its own group, a full-width card holding
   the lines small, each with its thumbnail and his price. */
.display-offer .display-stack { margin-top: 8px; }
.display-small-lines { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.display-small-lines .offer-named { flex: 1; }          /* the name takes the row */
.display-offer-card .line-reason { margin-top: 8px; }

/* THE DISPLAY CART (screen 5): the sheet's own lines, and the order strip's
   open foot pinned at the bottom as the cart's foot is. Its truck is its own
   (not a .truck-slot, which board.js repaints with the normal order's). */
.display-body--cart { padding-bottom: 230px; }
.display-foot { cursor: default; }
.display-truck { width: 100%; }
.display-foot .line-reason { text-align: center; }

/* THE PHOTO PAGES (screens 6a-6c): the ask in a card, the camera under it. */
.display-photo-card .line-reason { margin-top: 6px; }
