/* CHOCKERS design system. Spec: SPEC/design-system.md. Specimen: /design-system.html.
   Layer 1 = tokens (:root). Layer 2 = components, which read only tokens.
   Venue theme.css files override the LEGACY tokens (--bg --surface --fg --muted
   --accent --accent-fg --border --radius ...); every component reads those, so a
   venue re-skins the whole page by setting a few variables.
   Primary is cocoa red #9B271E: the wordmark colour (SPEC/style.md), warm like
   chocolate, 7.8:1 on white with white text. */

@font-face {
  font-family: 'Geologica';
  src: url('/shared/fonts/geologica-latin.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;

  /* ---- Colour: primitives ---- */
  --cocoa-700: #9b271e;   /* brand: wordmark, primary on light */
  --cocoa-300: #ff8a78;   /* primary on dark */
  --warm-50: #f7f2ef;
  --warm-100: #efe7e2;
  --warm-900: #1f1512;

  /* ---- Colour: roles (light) ---- */
  --bg: #ffffff;
  --surface: var(--warm-50);
  --surface-2: var(--warm-100);
  --fg: var(--warm-900);
  --muted: #6b5d57;
  --accent: var(--cocoa-700);
  --accent-fg: #ffffff;
  --border: #e4dad4;      /* decorative dividers only */
  --edge: #8a7b74;        /* control edges: 3:1 or more (WCAG 1.4.11) */
  --focus: var(--fg);
  --danger: #b3261e;
  --warning: #8a5a00;
  --success: #1b6e35;
  --status-new: #8a5a00;
  --status-claimed: #8f4a00;
  --status-ready: var(--success);
  --status-error: var(--danger);

  /* States, derived so a venue accent gets them for free */
  --accent-hover: color-mix(in srgb, var(--accent) 85%, #000);
  --accent-press: color-mix(in srgb, var(--accent) 70%, #000);
  --accent-wash: color-mix(in srgb, var(--accent) 12%, transparent);
  --disabled-bg: var(--surface-2);
  --disabled-fg: var(--muted);
  --hover-wash: color-mix(in srgb, var(--fg) 6%, transparent);

  /* ---- Type ---- */
  --font-display: 'Geologica', 'Segoe UI', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --fs-label: 0.75rem;   /* caps eyebrow only */
  --fs-meta: 0.875rem;
  --fs-body: 1rem;
  --fs-lead: 1.125rem;
  --fs-h3: 1.375rem;
  --fs-h2: 1.75rem;
  --fs-h1: 2.25rem;
  --fs-display: 3.25rem;
  --lh-tight: 1.1;
  --lh-body: 1.5;
  --track-tight: -0.03em;
  --track-label: 0.08em;

  /* ---- Space (4px base) ---- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --gutter: var(--sp-4);
  --page-max: 560px;

  /* ---- Shape and depth ---- */
  --radius: 0;         /* cards, buttons, fields, sheets */
  --radius-pill: 999px;  /* chips, tabs, bars */
  --control-h: 52px;     /* one touch target height */
  --bar-h: calc(2 * var(--sp-3) + var(--control-h) + env(safe-area-inset-bottom)); /* the floating cart bar: page ends clear of it */
  --chip-h: 40px;        /* not --control-h-s: that is the design system's name, and this unlayered :root outranks its layer on staff pages */
  --shadow-bar: none;
  --sheet-shadow: 0 -8px 30px rgba(31, 21, 18, 0.14);
  --card-shadow: none;
  --scrim: rgba(31, 21, 18, 0.5);
  /* Customer footer (item 46, F10): black, quiet, the same in light and dark. */
  --footer-bg: #000000;
  --footer-fg: #f5efeb;
  --footer-muted: #b3a59e;
  --focus-ring: 3px solid var(--focus);
  --focus-offset: 2px;
  --ease: cubic-bezier(.32, .72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #151110;
    --surface-2: #221c1a;
    --fg: #faf4f0;
    --muted: #b3a59e;
    --accent: var(--cocoa-300);
    --accent-fg: #000000;
    --border: #2e2623;
    --edge: #91827b;
    --danger: #ff8a80;
    --warning: #f0b252;
    --success: #6fd38c;
    --status-new: #f0b252;
    --status-claimed: #ffa25c;
    --sheet-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
    --shadow-bar: none;
    --scrim: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
/* LA-40: html needs its own background; iOS Safari paints the rubber-band
   area with html's background, not body's. */
html, body { min-height: 100dvh; background: var(--bg); }
/* A tap is a tap: no double-tap zoom, no gesture lag. Pinch zoom stays. */
html { touch-action: manipulation; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--fg);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}
/* Weight falls as size falls: 900 display, 800, 700, 600. */
h1, h2, h3, .display {
  font-family: var(--font-display);
  letter-spacing: var(--track-tight);
  line-height: var(--lh-tight);
  margin-block: 0;
}
h1 { font-size: var(--fs-h1); font-weight: 900; }
h2 { font-size: var(--fs-h2); font-weight: 800; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
.display { font-size: var(--fs-display); font-weight: 900; }
.eyebrow {
  font-size: var(--fs-label); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--track-label); color: var(--muted);
}
a:where(:not(.ck-btn)) { color: inherit; text-underline-offset: 0.2em; }
button:where(:not(.ck-btn)) { font-family: inherit; }
/* iOS zooms the page into a focused field whose text is under 16px (item 79).
   Browsers default a field to about 13px, so every field gets a 16px floor. */
input, select, textarea { font-size: max(16px, 1em); }
::selection { background: var(--accent); color: var(--accent-fg); }
/* One ring: a ck- control draws chockers.css's ring. This unlayered rule would beat it (unlayered wins over layer ck), so it leaves ck- controls out. */
:focus-visible:where(:not([class^="ck-"], [class*=" ck-"])) { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

/* LA-44: bottom padding clears the floating cart bar. Item 47 (F43): the
   content takes at least the full viewport, so the footer is always below
   the fold, on any screen. Not inside the cart sheet's iframe. */
.page { max-width: var(--page-max); margin: 0 auto; padding: 0 0 calc(var(--bar-h) + var(--sp-4)); min-height: 100vh; min-height: 100dvh; }
.page-pad { padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---- Hero ---- */
.hero {
  background: var(--bg);
  color: var(--fg);
  /* One row on every width (item 56, F24): logo left; search and the
     cards/list switch side by side on the right. */
  display: flex; align-items: center; gap: var(--sp-3);
  padding: calc(var(--sp-2) + env(safe-area-inset-top)) var(--gutter) var(--sp-2);
  /* LA-40: sticky-but-never-stuck so iOS 26 tints the status strip with the
     header colour. Do not remove. */
  position: sticky; top: -100%;
}
.hero { flex-wrap: wrap; row-gap: var(--sp-2); }
.hero .hero-book:where(:not(.ck-btn)) { order: 2; margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--accent); border-radius: var(--radius-pill); color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.hero .hero-book[hidden] { display: none; }
@media (min-width: 720px) { .hero .hero-book { margin-left: 0; } }
.hero .brand { min-height: 44px; display: flex; align-items: center; gap: var(--sp-2); flex: 0 0 auto; }
.hero .brand-mark { height: 34px; width: auto; }
/* Thai Baan's wordmark is white on transparent: black in light mode. */
.hero .brand-word { height: 26px; width: auto; filter: brightness(0); }
@media (prefers-color-scheme: dark) { .hero .brand-word { filter: none; } }
.hero h1 { font-size: var(--fs-h2); margin: 0; color: var(--fg); display: flex; }
/* Order-type chip: cart page, above the fulfilment fieldset. */
.order-type-chip {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  margin: var(--sp-3) var(--gutter); background: var(--accent-wash);
  color: var(--fg); padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4);
  border-radius: var(--radius-pill); font-size: var(--fs-meta); font-weight: 700;
}
.hero .order-type-chip { margin: var(--sp-3) 0 0; }
.order-type-chip button:where(:not(.ck-btn)) {
  background: var(--accent); color: var(--accent-fg); border: none; border-radius: var(--radius-pill);
  padding: 0 var(--sp-4); font-size: var(--fs-meta); font-weight: 700; cursor: pointer;
  min-height: var(--chip-h);
}
.order-type-chip button:where(:not(.ck-btn)):hover { background: var(--accent-hover); }
.order-type-chip button:where(:not(.ck-btn)):active { background: var(--accent-press); }

/* The closed note: one calm line under the header. */
.prep-note { text-align: center; color: var(--muted); font-size: var(--fs-meta); margin: var(--sp-2) var(--gutter) 0; }

/* ---- Menu search ----
   Item 59 (F28): on a phone the search is a magnifier that opens to a
   field when tapped (and stays open while it holds a query); the logo's
   wordmark steps aside to make room. Wide screens show the field. */
.search-bar { padding: var(--sp-2) var(--gutter) 0; position: relative; }
.hero .search-bar { order: 3; flex: 1 1 200px; min-width: 0; max-width: 420px; padding: 0; margin-left: auto; }
.search-bar::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 44px; height: 20px; margin-top: -10px; pointer-events: none;
  background: var(--muted);
  --glass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E");
  -webkit-mask: var(--glass) center / 20px 20px no-repeat; mask: var(--glass) center / 20px 20px no-repeat;
}
.menu-search {
  width: 100%; padding: 0 var(--sp-3) 0 44px; font-size: var(--fs-body); min-height: 44px;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--fg);
  -webkit-appearance: none; appearance: none;
}
@media (max-width: 719px) {
  .hero { flex-wrap: nowrap; }
  .hero .search-bar { flex: 0 0 44px; transition: flex-basis 0.2s var(--ease); }
  .hero .menu-search { padding-right: 0; cursor: pointer; }
  .hero .menu-search::placeholder { color: transparent; }
  .hero .search-bar:focus-within, .hero .search-bar:has(.menu-search:not(:placeholder-shown)) { flex: 1 1 auto; }
  .hero .search-bar:focus-within .menu-search, .hero .search-bar:has(.menu-search:not(:placeholder-shown)) .menu-search { padding-right: var(--sp-3); cursor: text; }
  .hero .search-bar:focus-within .menu-search::placeholder { color: var(--muted); }
  /* Booking shares the compact row. Let the active search use that room;
     the booking link returns when the query is cleared and focus leaves. */
  .hero:has(.search-bar:focus-within) .hero-book,
  .hero:has(.menu-search:not(:placeholder-shown)) .hero-book { display: none; }
  .hero:has(.search-bar:focus-within) .brand-word, .hero:has(.menu-search:not(:placeholder-shown)) .brand-word,
  .hero:has(.hero-book:not([hidden])) .brand-word { display: none; }
}
.menu-search:hover { border-color: var(--edge); }
.menu-search:focus-visible { border-color: var(--fg); }
.menu-search::placeholder { color: var(--muted); }
/* Keep all header controls reachable on the narrowest phones. */
@media (max-width: 360px) {
  .hero { flex-wrap: wrap; }
  .hero .hero-book { order: 5; flex-basis: 100%; margin-left: 0; justify-content: center; }
}
.search-empty { color: var(--muted); padding: var(--sp-2) var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-meta); }
.menu-grid .search-empty { grid-column: 1 / -1; }
.food-card .opt-badge {
  align-self: flex-start; padding: 0 var(--sp-2); border-radius: var(--radius-pill);
  background: var(--accent-wash); color: var(--fg); font-size: var(--fs-meta); font-weight: 700; white-space: nowrap;
}
.search-empty[hidden], .food-card[hidden], .category-heading[hidden] { display: none; }
.search-empty button:where(:not(.ck-btn)) { min-height: 44px; min-width: 44px; padding: 0 var(--sp-4); border-radius: var(--radius-pill); border: 1px solid var(--edge); background: transparent; color: var(--fg); font: inherit; cursor: pointer; }

/* ---- Category tabs ---- */
.tabs-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--sp-2);
  /* LA-40: stuck at top:0 it paints under the status bar. */
  padding: env(safe-area-inset-top) var(--gutter) 0 0;
  background: var(--bg);
}
.tabs-bar[hidden] { display: none; }
.tabs {
  flex: 1 1 auto; min-width: 0; display: flex; gap: var(--sp-2); overflow-x: auto;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--gutter);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs[hidden] { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  padding: 0 var(--sp-4); border-radius: var(--radius-pill);
  border: none; background: var(--surface-2);
  color: var(--fg); font-size: var(--fs-meta); font-weight: 600;
  white-space: nowrap; cursor: pointer; min-height: 44px;
}
.tab:hover { background: color-mix(in srgb, var(--fg) 14%, var(--surface-2)); }
.tab.active { background: var(--accent); color: var(--accent-fg); }
.tab.active:hover { background: var(--accent-hover); }

/* ---- Menu list ---- */
.category-heading {
  font-size: var(--fs-lead); font-weight: 800;
  margin: var(--sp-4) var(--gutter) var(--sp-2); scroll-margin-top: 56px;
}
/* LA-69: the photo is the card's full height, flush to its left edge. */
.food-card {
  position: relative;
  display: flex; gap: var(--sp-3); align-items: stretch;
  margin: 0 var(--gutter) var(--sp-2); padding: 0 var(--sp-3) 0 0; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--card-shadow);
  border: none; cursor: pointer; text-align: left;
  width: calc(100% - 2 * var(--gutter)); color: inherit; font: inherit;
}
.food-card:hover { background: var(--surface-2); }
.food-card:active { background: var(--accent-wash); }
.food-card img, .ph {
  width: 96px; height: auto; aspect-ratio: 1; object-fit: cover;
  flex: 0 0 auto; align-self: stretch; background: var(--surface-2);
  border-radius: var(--radius) 0 0 var(--radius);
}
.food-card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3) 0; }
/* No photo block (item without a photo, or one that failed to load): the text takes the photo's place. */
.food-card > .info:first-child { padding-left: var(--sp-3); }
.faves { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); padding: var(--sp-2) var(--gutter) 0; }
.faves[hidden] { display: none; }
/* Items 57, 58: a category's best sellers open its section, tagged. */
.food-card.featured .name::before,
.food-card.popular .name::before { content: "Popular"; display: block; font-size: var(--fs-meta); font-weight: 700; color: var(--accent); }
.food-card.featured .name::before { content: "Featured"; }
.faves-label { grid-column: 1 / -1; margin: 0; font-size: var(--fs-meta); color: var(--muted); }
.faves-label a { margin-left: var(--sp-2); color: var(--muted); }
.faves .food-card { min-width: 0; flex-direction: column; gap: 0; margin: 0; padding: 0 0 var(--sp-3); width: auto; }
.faves .food-card img, .faves .ph { width: 100%; align-self: auto; aspect-ratio: 4 / 3; border-radius: var(--radius) var(--radius) 0 0; }
.faves .food-card .info { padding: var(--sp-2) var(--sp-3) 0; }
.faves .food-card .desc { display: none; }
/* Two lines before a name is cut, so it stays readable (F42). */
.faves .food-card .name { font-size: var(--fs-meta); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 900px) {
  .faves { display: none; }
  .menu-grid {
    max-width: none; padding-left: var(--gutter); padding-right: var(--gutter);
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4);
  }
  .menu-grid .category-heading { grid-column: 1 / -1; margin: var(--sp-5) 0 0; }
  .menu-grid .food-card { flex-direction: column; gap: 0; margin: 0; padding: 0 0 var(--sp-3); width: auto; }
  .menu-grid .food-card img, .menu-grid .ph { width: 100%; align-self: auto; aspect-ratio: 4 / 3; border-radius: var(--radius) var(--radius) 0 0; }
  .menu-grid .food-card .info { flex: 1; padding: var(--sp-3) var(--sp-3) 0; }
}
.food-card .name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lead); letter-spacing: -0.015em; line-height: 1.2; }
/* The Thai name (item.nameTh, lang="th") under an English name: menu card, item sheet, cart, kitchen, Take screen. */
.name-th { display: block; margin: 0; font-weight: 400; font-size: var(--fs-body); /* Thai glyphs draw small: 16px floor */ line-height: var(--lh-body); color: var(--muted); }
.name-th-run { display: inline; }
/* Item-name language ไทย: the Thai name leads (the card .info is already a column; the sheet and cart lines become one). */
html[data-lang="th"] :is(.product-details, .cart-line .info) { display: flex; flex-direction: column; }
html[data-lang="th"] .name-th:not(.name-th-run) { order: -1; }
.lang-select { order: 3; } /* in an order line, after a <br> */
.food-card .desc {
  color: var(--muted); font-size: var(--fs-meta); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.food-card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--sp-1); }
.food-card .price { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.food-card.sold-out { cursor: not-allowed; }
.food-card.sold-out img, .food-card.sold-out .name, .food-card.sold-out .price { filter: grayscale(1); }
.food-card.sold-out .name, .food-card.sold-out .price { color: var(--muted); }
.food-card .sold-out-badge {
  background: var(--surface-2); color: var(--fg); font-size: var(--fs-label); font-weight: 700;
  text-transform: uppercase; letter-spacing: var(--track-label);
  padding: var(--sp-1) var(--sp-2); border-radius: var(--radius-pill);
}

/* Placeholder tile for an item with no photo (or one that fails to load):
   a quiet tinted tile with a plate-and-cutlery mark, themed by the venue
   tokens, never a broken or blank image. */
.ph {
  display: block; position: relative; flex: 0 0 auto; background: var(--surface-2);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--fg) 6%, transparent), transparent 60%);
  border-radius: var(--radius) 0 0 var(--radius);
}
.ph::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 38%; height: 38%; max-width: 64px; max-height: 64px;
  background: var(--muted); opacity: 0.7;
  --plate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='6.5'/%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Cpath d='M2.5 4v6M5 4v6M3.75 10v10M21.5 4c-1.5 1-2.2 3-2.2 5.5h2.2V20'/%3E%3C/svg%3E");
  -webkit-mask: var(--plate) center / contain no-repeat; mask: var(--plate) center / contain no-repeat;
}

.ph[hidden], .sheet img[hidden] { display: none; }

/* ---- List view: short rows, one line each, no description ---- */
.menu-grid.list-view { display: block; max-width: var(--page-max); padding-left: 0; padding-right: 0; }
.list-view .category-heading { margin: var(--sp-3) var(--gutter) 0; }
.list-view > .food-card {
  flex-direction: row; align-items: center; gap: var(--sp-3);
  margin: 0 var(--gutter); width: calc(100% - 2 * var(--gutter)); padding: 0;
  background: transparent; border-radius: 0; border-bottom: 1px solid var(--border);
}
/* Item 55 (F23): the hover runs past the row's side margin, out to the
   screen edge on a phone; the price keeps the margin as its breathing room. */
.list-view > .food-card:hover { background: var(--hover-wash); box-shadow: calc(-1 * var(--gutter)) 0 0 var(--hover-wash), var(--gutter) 0 0 var(--hover-wash); }
.list-view > .food-card img, .list-view > .food-card .ph {
  width: 44px; height: 44px; aspect-ratio: 1; align-self: center; flex: 0 0 auto; border-radius: var(--radius);
}
/* Name over its Thai line (Thai first in ไทย), price at the right; a long name wraps, never cut. */
.list-view > .food-card .info { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--sp-3); padding: var(--sp-2) 0; }
.list-view > .food-card .info > * { grid-column: 1; }
.list-view > .food-card .name { min-width: 0; font-size: var(--fs-body); overflow-wrap: anywhere; }
.list-view > .food-card .name-th { margin: 0; }
.list-view > .food-card .row { grid-column: 2; grid-row: 1 / span 4; }
.list-view > .food-card .desc { display: none; }
.list-view > .food-card .row { margin: 0; padding: 0; gap: var(--sp-2); }
/* Item 54 (F22): anchored to the photo's top-right corner, inside the
   photo, so it never covers the name whatever its length. */
.list-view > .food-card .qty-pill { top: 50%; right: auto; left: 24px; margin-top: -28px; }

/* ---- Bottom sheet ---- */
.sheet-backdrop {
  position: fixed; inset: 0; background: var(--scrim);
  z-index: 20; opacity: 0; pointer-events: none;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
/* No drop shadow: the scrim already sets the sheet apart, and a closed
   sheet's shadow drew over the bottom bar (items 50; F11, F12). Closed,
   it is hidden once it has slid away, so nothing of it leaks or takes focus. */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  background: var(--bg); border-radius: 0;
  box-shadow: none; max-width: var(--page-max); margin: 0 auto;
  transform: translateY(100%); visibility: hidden;
  /* LA-21: grows to fit its content, scrolls inside past this cap (F32: 95%). */
  max-height: 95vh; max-height: 95dvh; overflow-y: auto;
}
.sheet.open { transform: translateY(0); visibility: visible; }
.sheet.dragging { transition: none; }
.sheet .grabber { position: relative; width: 100%; height: 48px; margin: 0; touch-action: none; cursor: grab; }
/* The visible bar sits in a 48px-tall drag strip. */
.sheet .grabber::after { content: ''; position: absolute; left: 50%; top: 12px; width: 40px; height: 4px; margin-left: -20px; background: var(--edge); border-radius: var(--radius-pill); }
/* Item sheet: the photo runs to the top edge and the handle sits on it. */
.sheet-top { position: relative; height: 220px; overflow: hidden; border-radius: inherit; background: var(--surface-2); }
.sheet .sheet-top img, .sheet .sheet-top .ph { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-position: center; border-radius: 0; }
.sheet-top .grabber { position: absolute; top: 0; left: 0; right: 0; z-index: 1; }
.sheet-top .grabber::after { background: rgba(255, 255, 255, 0.92); }
/* LA-42: the cart page in an iframe. Item 60 (F32): as tall as the
   order, up to 95% of the screen (the menu page sets the height from
   the cart's own); short orders stay short. */
.cart-sheet { height: 60dvh; max-height: 95dvh; padding: 0; overflow: hidden; }
.cart-sheet iframe { width: 100%; height: calc(100% - var(--sheet-head)); border: 0; display: block; }   /* under the handle row (shared/dialog.css) */
/* The close control of every sheet: shared/dialog.css (ck-dialog-close). */
/* Order-type sheet: public/shared/order-type.css (the cart's rows in this shell). */
.sheet img { width: 100%; height: 200px; object-fit: cover; display: block; }
/* LA-62: one shell for every sheet. */
.sheet .sheet-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.sheet h2 { font-size: var(--fs-h2); margin: 0 0 var(--sp-2); }
.sheet .desc { color: var(--muted); font-size: var(--fs-body); white-space: pre-line; }
.sheet .price { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h3); margin: var(--sp-3) 0; font-variant-numeric: tabular-nums; }
/* Item 53 (F21): no tint behind an option group (it ran flush with no padding). */
.option-group { border: none; padding: 0; margin: 0 0 var(--sp-5); background: none; }
.option-group legend { float: left; width: 100%; font-weight: 700; font-size: var(--fs-body); padding: var(--sp-2) 0; } /* floated so it sits inside the card, not on its top edge */
.option-group legend + * { clear: both; }
.option-group .req { color: var(--muted); font-weight: 600; font-size: var(--fs-meta); }
.option-row {
  /* LA-20: full-width tappable row, 48px minimum hit area. */
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0;
  min-height: 48px; border-bottom: 1px solid var(--border); font-size: var(--fs-body); cursor: pointer;
}
.option-row:last-of-type { border-bottom: none; }
.option-row input { flex: 0 0 auto; }
.option-row span:first-of-type { flex: 1; }

/* ---- Checkboxes and radios (LA-20): hand-styled so a venue accent themes them. */
input[type="radio"]:where(:not(.ck-radio)), input[type="checkbox"]:where(:not(.ck-check)) {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 24px; height: 24px; flex: 0 0 auto;
  border: 1px solid var(--edge); background: var(--bg); cursor: pointer;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:where(:not(.ck-check)) { border-radius: var(--radius); }
input[type="radio"]:where(:not(.ck-radio)):hover, input[type="checkbox"]:where(:not(.ck-check)):hover { border-color: var(--fg); }
input[type="radio"]:where(:not(.ck-radio)):checked, input[type="checkbox"]:where(:not(.ck-check)):checked {
  border-color: var(--accent);
  background: radial-gradient(var(--accent) 0 42%, transparent 46%) center/100% 100% no-repeat, var(--bg);
}
input[type="checkbox"]:where(:not(.ck-check)):checked {
  background: linear-gradient(var(--accent), var(--accent)) center/60% 60% no-repeat, var(--bg);
}
input:disabled { cursor: not-allowed; border-color: var(--border); background: var(--disabled-bg); }
.opt-price { color: var(--muted); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
/* The item sheet's footer: quantity and Add to order stay in view while the options scroll above them. */
.sheet-foot {
  position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; gap: var(--sp-4);
  margin: var(--sp-4) calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5)); background: var(--bg);
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-3) + env(safe-area-inset-bottom));
}
.sheet-foot .qty { margin: 0; gap: var(--sp-2); flex: 0 0 auto; }
.sheet-foot button.primary { flex: 1 1 0; width: auto; min-width: 0; }

/* Product photos retain their full frame, beside the name and price. */
.product-sheet .sheet-body { padding-top: 0; }
.product-summary { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-3); }
.product-summary .sheet-top {
  flex: 0 0 min(34%, 180px); height: auto; min-width: 0;
  background: var(--surface-2); overflow: visible;
}
.product-summary .sheet-top[hidden] { display: none; }
.product-sheet .sheet-top img {
  position: static; width: 100%; height: auto; max-height: 180px;
  object-fit: contain; object-position: center; aspect-ratio: 1;
}
.product-details { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.product-details .price { margin: var(--sp-2) 0 0; }
.product-sheet .desc:empty { display: none; }
.option-summary {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; min-height: var(--control-h); padding: var(--sp-3) 0;
  border: 0; background: none; color: var(--fg);
  font: inherit; text-align: left; cursor: pointer;
}
.option-summary .option-picked { flex: 1; }
.option-summary::after {
  content: ''; width: 8px; height: 8px; flex: 0 0 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin: 0 var(--sp-2);
}
.option-summary:hover { background: var(--surface-2); }
.product-sheet .option-group.is-folded { margin-bottom: var(--sp-2); }
.product-sheet .photo-credit {
  position: static; max-width: none; border-radius: 0;
  background: var(--surface-2); color: var(--fg);
}
@media (max-width: 360px) {
  .product-summary { gap: var(--sp-3); }
  .product-summary .sheet-top { flex-basis: 30%; }
  .product-sheet .sheet-top img { max-height: 128px; }
}

/* ---- Buttons ---- */
button.primary {
  background: var(--accent); color: var(--accent-fg); border: none;
  width: 100%; padding: 0 var(--sp-4); border-radius: var(--radius);
  font-weight: 700; font-size: var(--fs-lead); min-height: var(--control-h); cursor: pointer;
}
button.primary:hover { background: var(--accent-hover); }
/* Pressed stays vivid (accent, inset ring, tiny shrink): the darkened mix read as disabled. */
button.primary:active { background: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-fg); transform: scale(0.98); text-decoration: none; }
button.primary:disabled, button.primary[aria-disabled="true"] {
  background: var(--disabled-bg); color: var(--disabled-fg); cursor: not-allowed; text-decoration: line-through;
}
:is(button, a).secondary {
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
  width: 100%; padding: 0 var(--sp-4); border-radius: var(--radius); font-weight: 700; font-size: var(--fs-body);
  min-height: var(--control-h); cursor: pointer;
}
:is(button, a).secondary:hover { background: var(--accent-wash); }
:is(button, a).secondary:active { background: var(--accent); color: var(--accent-fg); }
:is(button, a).secondary:disabled { color: var(--disabled-fg); border-color: var(--border); background: var(--disabled-bg); cursor: not-allowed; }

a.secondary { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }

/* ---- Choice chips (booking day and time): a pill you press, pressed = accent ---- */
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; padding: 2px 0 var(--sp-2); scroll-snap-type: x proximity; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips.days, .chips.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); overflow: visible; }  /* days and times: equal cells in order, 3 or 4 a row on a phone */
.chips.days .chip, .chips.times .chip { padding-inline: var(--sp-1); }
.chips.times .none { grid-column: 1 / -1; }
.chip { flex: 0 0 auto; min-height: var(--control-h); padding: 6px 14px; border-radius: var(--radius-pill); border: var(--line-1, 1px) solid var(--edge); background: var(--surface); color: var(--fg); font-size: 1rem; cursor: pointer; scroll-snap-align: start; line-height: 1.15; text-align: center; }
.chip small { display: block; font-size: .72rem; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chip[aria-pressed="true"] small { color: inherit; }
.chip:disabled { opacity: .45; cursor: not-allowed; text-decoration: none; }

/* ---- Floating bottom bar (LA-22): order-type pill and cart button,
   both always shown. ---- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + env(safe-area-inset-bottom));
  /* Design system: no blur, no opacity. A solid ground. */
  background: var(--bg);
}
/* The ground runs on below the bar: a browser toolbar that floats over the page edge shows no content behind it. */
.cart-bar::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 160px; background: var(--bg); }
.cart-bar-row {
  max-width: calc(var(--page-max) - 2 * var(--gutter)); margin: 0 auto;
  display: flex; align-items: center; gap: var(--sp-3);
}
.order-type-pill {
  flex: 1 1 0; min-width: 0; /* Tamm 7 Nov: same size as View cart */
  background: var(--surface-2); color: var(--fg); border: none;
  border-radius: var(--radius-pill); padding: 0 var(--sp-3); min-height: var(--control-h);
  font-size: var(--fs-body); font-weight: 700; cursor: pointer;
  line-height: 1.15; overflow-wrap: anywhere; /* "Choose order type" wraps to two lines, never cut */
}
.order-type-pill:hover { background: color-mix(in srgb, var(--fg) 14%, var(--surface-2)); }
.cart-bar-inner {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  background: var(--accent); color: var(--accent-fg); border-radius: var(--radius-pill);
  min-height: var(--control-h); padding: 0 var(--sp-3);
  border: none; font: inherit; cursor: pointer;
  box-shadow: var(--shadow-bar);
}
/* Item 49: always shown, empty or not. */
.cart-bar-inner:hover { background: var(--accent-hover); }
.cart-bar-inner:active { background: var(--accent-press); }
.cart-bar-inner [hidden] { display: none; }
/* Venue closed (open.js). */
.cart-bar-inner.disabled { background: var(--disabled-bg); color: var(--disabled-fg); box-shadow: none; pointer-events: none; }
/* The cart pill's corner badge and a card's selected-qty badge share one
   round chip (LA-45/46/58). */
/* Item 54 (F22): one smaller badge; the number fills more of it. */
.count-badge, .food-card .qty-pill {
  background: var(--accent); color: var(--accent-fg); border-radius: 50%;
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: var(--fs-meta); font-weight: 800; line-height: 1; flex: 0 0 auto;
}
.food-card .qty-pill[hidden] { display: none; }
.cart-bar-inner .count-badge, .food-card .qty-pill {
  position: absolute; top: -10px; right: -10px; outline: 3px solid var(--bg);
}
/* On the accent pill the badge flips to the ink colours so it still reads. */
.cart-bar-inner .count-badge { background: var(--fg); color: var(--bg); }
.food-card .qty-pill { top: -8px; right: -8px; z-index: 1; outline: 3px solid var(--bg); }
.cart-bar-inner .count-badge { top: -8px; right: -12px; }
.cart-bar-inner .go { font-weight: 700; font-size: var(--fs-body); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: var(--sp-1); line-height: var(--lh-tight); white-space: nowrap; /* narrow phone: the total drops to a second line */ font-variant-numeric: tabular-nums; }

/* LA-48/LA-60: the one stepper, 40px so the target is comfortable. */
/* Item 61 (F34): a 32px drawn square (design system: radius 0), the 44px hit area and the sign stay. */
.qty button {
  width: 44px; height: 44px; border-radius: 0; border: none; padding: 6px;
  background: var(--accent); color: var(--accent-fg);
  font-size: 1.6rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; min-height: unset; min-width: unset; position: relative; font-size: 0; /* the sign is drawn below: a font glyph never centres exactly */
}
.qty button::before, .qty button::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; margin: -1px 0 0 -8px; background: currentColor; border-radius: 0; }
.qty button:first-of-type::after { display: none; }
.qty button:last-of-type::after { transform: rotate(90deg); }
.qty button:hover { background: var(--accent-hover); }
.qty button:active { background: var(--accent-press); }
.qty button:disabled { background: var(--disabled-bg); color: var(--disabled-fg); cursor: not-allowed; }
.qty button, .qty button:hover, .qty button:active, .qty button:disabled { background-clip: content-box; }
.qty output { min-width: 1.5em; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lead); font-variant-numeric: tabular-nums; }
/* ---- Cart page (the cart sheet's iframe) ----
   Two parts: .page scrolls the order, .cart-foot (total, time, pay) never scrolls, so Pay is always in view.
   The menu page sizes the sheet to .cart-content plus .cart-foot (chockers:cart-height); neither depends on the
   frame's height, so the two never feed each other.
   The order is one ck-rows stack: the items, then a few quiet rows, one line between neighbours and none at
   either end. Every row sits on one inset, --cart-inset (24px, the other sheets' inset): item text, row labels,
   row signs, fields and the foot all start and end on it. A row that opens or changes something is one
   ck-row--action button with one sign at its end; the label is the button.
   Type is three system sizes and nothing else: --text-h4 (title, total, Pay), --text-body, --text-min.
   Weights: 900 title, total and buttons; 600 every label and row; 300 every muted line.
   Controls are ck- classes from chockers.css; this block is layout and those sizes. */
html.cart-page { --cart-inset: var(--sp-5); height: 100%; }
/* The ring in a sheet: one 2px line in the ink of the control edges (not :root's --fg cream), 2px off its control (inside a row). The 16px double ring does not fit rows this tight: it lands on the next row, the price below a stepper, the sheet's edge. Same rule, resized by its own tokens (chockers.css). */
html.cart-page, .cart-sheet, .order-type-sheet { --focus: var(--ink); --focus-ring-style: solid; --focus-ring-w: var(--line-2); --focus-ring-gap: var(--line-2); }
html.cart-page, html.cart-page body { min-height: 0; background: var(--bg); }
html.cart-page body {
  height: 100%; display: flex; flex-direction: column; overflow: hidden;
  color: var(--ink); font-size: var(--text-body); font-weight: var(--weight-body); line-height: var(--lh-small);
}
html.cart-page .page { flex: 1 1 auto; min-height: 0; max-width: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; }
html.cart-page p { max-width: none; margin: 0; }
html.cart-page p:empty { display: none; }
.cart-content { --row-pad-x: var(--cart-inset); display: flow-root; }
html.cart-page .cart-title { margin: 0; font: var(--weight-loud) var(--text-h4)/var(--lh-h4) var(--font-sans); letter-spacing: var(--track-body); }   /* the pay-choice sheet's title */
html.cart-page .ck-row { font-weight: var(--weight-strong); }
html.cart-page .ck-meta { font-weight: var(--weight-body); }
html.cart-page .ck-btn--s { font-size: var(--text-min); }
.cart-note, .prep-note { padding: var(--sp-1) var(--cart-inset); text-align: start; }
.prep-note { color: var(--ink-muted); font-size: var(--text-min); }
html.cart-page .offer-list { margin: 0; padding: var(--sp-1) var(--cart-inset); }
#cart-discounts { padding: var(--sp-1) var(--cart-inset); }
html.cart-page .ck-empty { margin: var(--sp-2) var(--cart-inset); }

/* An item spends width, not height (Tamm, 15 Nov 2026): its text beside its stepper, both centred, the same 8px above
   and below. The text is the name, the options (one muted line each, a price at the end), then "$x each" with the
   line's note action at the end of that row. The stepper column holds the stepper only. The note field opens under. */
html.cart-page .cart-line {
  display: grid; grid-template-columns: var(--cart-inset) minmax(0, 1fr) auto var(--cart-inset);
  align-items: center; padding-block: var(--space-1);
}
.cart-line > .cart-text { grid-column: 2; min-inline-size: 0; margin-inline-end: var(--space-2); }   /* 16px of air between the note action and the stepper */
.cart-line .name { font-weight: var(--weight-strong); line-height: var(--lh-h5); }
.cart-line .name-th { font-size: var(--text-min); font-weight: var(--weight-body); }
.cart-line .ck-meta { line-height: var(--lh-h5); }
html[data-lang="th"] .cart-line .ck-meta { line-height: var(--lh-small); }   /* Thai marks above and below need the room */
.cart-line > .ck-stepper { grid-column: 3; }
.cart-line .ck-stepper > output { font-size: var(--text-body); }
.cart-opt { display: flex; justify-content: space-between; gap: var(--sp-2); }
.cart-opt .ck-num { flex: none; }
.cart-each { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--space-1); }   /* a note too long for the row's end takes the next row */
.cart-each > .ck-num { flex: none; }
/* The note action: a ck-link one text line high, so its focus ring stays clear of the lines around it; ::after makes
   its touch target 44px each way. It shows "Add note", or the note itself, cut to the room it has. */
.add-line-note { position: relative; display: flex; min-inline-size: 0; font-size: var(--text-min); line-height: var(--lh-h5); }
.add-line-note > span { min-inline-size: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-block-end: var(--space-half); margin-block-end: calc(var(--space-half) * -1); }   /* room for the underline */
.add-line-note::after { content: ""; position: absolute; inset: calc((100% - var(--target)) / 2) min(calc(var(--space-1) * -1), calc((100% - var(--target)) / 2)); }
.add-line-note:focus-visible { outline-color: var(--focus); outline-offset: var(--focus-ring-gap); }
.cart-line > .cart-line-note { grid-column: 2 / 4; padding-block-start: var(--space-1); }
.cart-line > .cart-line-note textarea { margin-top: 0; }

/* A field that opens under its row. */
.cart-fields { padding: 0 var(--cart-inset) var(--sp-4); }
.cart-fields--inline { display: flex; gap: var(--sp-2); }
.cart-fields--inline .ck-input { flex: 1 1 auto; }
#delivery-requote { margin: 0 var(--cart-inset) var(--sp-2); }
.delivery-fields { display: grid; gap: var(--sp-2); padding: var(--sp-2) var(--cart-inset) var(--sp-4); }
.delivery-fields[hidden] { display: none; }
html.cart-page .cart-block > .ck-row { padding-block: var(--sp-1); }
#cutlery-row, .cart-extra { align-items: center; }
#cutlery-row[hidden] ~ .cart-extra { display: none; }   /* the extras show and hide as one */

/* The foot: total, time and pay, always in view. */
.cart-foot {
  flex: none; display: grid; gap: var(--sp-2);
  padding: var(--sp-4) var(--cart-inset) calc(var(--sp-4) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule); background: var(--bg);
}
.cart-foot--no-rule { border-top-color: transparent; }   /* a scrolled row's rule is just above: one line, not two */
/* An empty cart has no foot: its content carries the spacing the foot would. */
html.cart-page:has(#cart-foot[hidden]) .cart-content { padding-block-end: calc(var(--sp-4) + env(safe-area-inset-bottom)); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); }
.cart-total-label { font-weight: var(--weight-strong); }
.cart-total-amount { font: var(--weight-loud) var(--text-h4)/var(--lh-h4) var(--font-sans); letter-spacing: var(--track-num); font-variant-numeric: tabular-nums; }
.cart-pay { display: grid; gap: var(--sp-2); }
.cart-pay .ck-btn, .cart-pay-list .ck-btn, .cart-pay .apple-pay-btn, .cart-pay-list .apple-pay-btn { inline-size: 100%; }
.cart-pay-list { display: grid; gap: var(--sp-2); padding-block: var(--sp-2) var(--sp-1); }
#pay-choice { background: var(--bg); color: var(--ink); }
#pay-choice .ck-sheet-head { padding-block-start: var(--sp-2); }
#pay-choice .ck-btn--icon { margin-inline-end: calc(-1 * var(--sp-2)); }

fieldset { border: none; border-radius: var(--radius); margin: var(--sp-4) var(--gutter); padding: var(--sp-2) var(--sp-4) var(--sp-4); background: var(--surface); }
legend { padding: 0 var(--sp-2); font-weight: 700; font-size: var(--fs-body); }
.fulfil-option {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0;
  min-height: 48px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.fulfil-option:last-of-type { border-bottom: none; }
input[type="text"]:where(:not(.ck-input)), textarea:where(:not(.ck-input)) {
  width: 100%; padding: 0 var(--sp-3); font-size: var(--fs-body); min-height: var(--control-h);
  border: 1px solid var(--edge); border-radius: var(--radius); background: var(--bg); color: var(--fg);
  margin-top: var(--sp-2);
}
textarea:where(:not(.ck-input)) { padding: var(--sp-3); min-height: calc(3 * var(--lh-body) * 1em + 2 * var(--sp-3)); font-family: inherit; line-height: var(--lh-body); resize: none; field-sizing: content; }
input[type="text"]:where(:not(.ck-input)):hover, textarea:where(:not(.ck-input)):hover { border-color: var(--fg); }
input[type="text"]:where(:not(.ck-input)):focus-visible, textarea:where(:not(.ck-input)):focus-visible { border-color: var(--fg); }
input[aria-invalid="true"] { border-color: var(--danger); }
input[type="text"]:where(:not(.ck-input)):read-only { background: var(--surface-2); border-color: transparent; }
input[type="text"]:where(:not(.ck-input)):disabled, textarea:where(:not(.ck-input)):disabled { background: var(--disabled-bg); color: var(--disabled-fg); border-color: var(--border); }
.error { color: var(--status-error); margin: var(--sp-2) var(--gutter); font-size: var(--fs-meta); font-weight: 600; }
.gateway-line { text-align: center; color: var(--muted); font-size: var(--fs-meta); margin: var(--sp-1) 0 var(--sp-3); }
/* Busy button (cart pay buttons): the design system's loading look, three square blocks and no motion
   (chockers.css .ck-btn[aria-busy]). It stays disabled but keeps its live colours, so it never reads as dead. */
button[aria-busy="true"] { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); cursor: progress; text-decoration: none; }
button[aria-busy="true"]::before { content: ""; flex: none; box-sizing: content-box; width: var(--sp-2); height: var(--sp-2); padding: 0 var(--sp-2); border: 0 solid currentColor; border-inline-width: var(--sp-2); background: currentColor; background-clip: content-box; }
button.primary[aria-busy="true"] { background: var(--accent); color: var(--accent-fg); }
:is(button, a).secondary[aria-busy="true"] { background: transparent; color: var(--accent); border-color: var(--accent); }
/* Demo mode only (cart page): banner and the test-card step. */
.demo-banner { background: var(--surface-2); color: var(--fg); text-align: center; font-weight: 700; font-size: 0.85rem; padding: 8px 16px; margin-top: 0; }
.pay-buttons[hidden], .test-card[hidden] { display: none; }
.test-card { padding: 0 16px 16px; }
.test-card h2 { font-size: 1.1rem; margin: 0 0 4px; }
.test-card .hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 8px; }
.test-card label { display: block; font-size: 0.85rem; margin-top: 10px; }
.test-card input { width: 100%; box-sizing: border-box; padding: 11px 12px; font-size: 1rem; min-height: 44px; margin-top: 4px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--bg); color: var(--fg); }
.test-card .row { display: flex; gap: 10px; }
.test-card .row > div { flex: 1; }
.test-card .primary { margin-top: 16px; width: 100%; min-height: 56px; }
.test-card .back { background: none; border: 0; color: var(--muted); text-decoration: underline; margin-top: 8px; padding: 12px; width: 100%; min-height: 44px; }
.test-card [role="alert"] { color: var(--status-error); margin: 10px 0 0; font-size: 0.9rem; }
.gateway-line button {
  background: none; border: none; color: inherit; text-decoration: underline;
  text-decoration-color: var(--edge); cursor: pointer; font: inherit; padding: 0;
}
.gateway-line svg { height: 1.1em; width: auto; vertical-align: middle; fill: currentColor; }
.gateway-line svg[hidden] { display: none; }

/* ---- Order status page ---- */
.status-page { text-align: center; padding: calc(var(--sp-7) + env(safe-area-inset-top)) var(--sp-5) var(--sp-8); }
.order-number { font-family: var(--font-display); font-size: var(--fs-display); font-weight: 900; letter-spacing: var(--track-tight); color: var(--accent); margin: 0 0 var(--sp-2); line-height: 1; }
.status-page .venue { color: var(--muted); margin: 0 0 var(--sp-6); }
/* Order progress: one thin line, three points, labels under. Done points and the
   line up to the current one take the accent; later points stay quiet. */
.progress { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 auto var(--sp-5); max-width: 420px; padding: 0; list-style: none; }
.progress .step { position: relative; text-align: center; }
.progress .dot { display: block; width: 12px; height: 12px; margin: 0 auto var(--sp-2); border-radius: 50%; position: relative; z-index: 1;
  background: var(--bg); border: 1px solid var(--edge); transition: background .3s, border-color .3s; }
.progress .step::before { content: ''; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.progress .step:first-child::before { display: none; }
.progress .step.done .dot { background: var(--accent); border-color: var(--accent); }
.progress .step.active .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.progress .step.done::before, .progress .step.active::before { background: var(--accent); }
.progress .label { font-size: var(--fs-meta); color: var(--muted); }
.progress .step.active .label { color: var(--fg); font-weight: 700; }
.status-headline { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.status-sub { color: var(--muted); margin-top: var(--sp-2); }
.status-ready-banner { color: var(--status-ready); }
.suggestions { text-align: left; margin-top: var(--sp-6); }
.suggestions h2 { font-size: var(--fs-lead); font-weight: 700; margin: 0 0 var(--sp-3); }
/* The way back to an open order (shared/ready-watch.js): the system row in the venue's gold, above the bar's buttons. */
.order-back { color: var(--primary-ink); }
.cart-bar > .order-back { max-inline-size: var(--sheet-max); margin: calc(var(--space-1) * -1) auto var(--space-1); border-bottom: 0; }   /* the bar's own line is above it: no second line */

/* ---- Customer footer (items 46, 47; /shared/venue-footer.js) ----
   Columns of venue facts and links on black, one spacing step (--sp-5)
   between every block, the bottom clear of the floating bar. */
.mega-footer {
  background: var(--footer-bg); color: var(--footer-fg);
  padding: var(--sp-6) var(--gutter) calc(var(--bar-h) + var(--sp-4));
  font-size: var(--text-min, var(--fs-body)); line-height: var(--lh-small, 1.5);   /* 16px for every line but the label */
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;   /* a phone never grows one column's text and not another's */
}
.mega-footer:empty { min-height: 50vh; }
/* The mosaic: every tile has a name and a place; no tile is boxed, the shared edges are the design.
   Phone: logo beside address and phone, then hours, menu, links, one column. */
.mf-grid {
  max-width: 1200px; margin: 0 auto; display: grid; gap: var(--sp-5); align-items: start; justify-items: start;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "brand find" "hours hours" "menu menu" "links links";
}
.mf-grid > * { min-inline-size: 0; }
.mf-grid > .mf-brand { grid-area: brand; }
.mf-grid > .mf-find { grid-area: find; }
.mf-find li + li { margin-top: var(--sp-5); }   /* one line space between the phone and the address */
.mf-grid > .mf-open { grid-area: hours; }
.mf-grid > .mf-menu { grid-area: menu; justify-self: stretch; }
.mf-grid > .mf-links { grid-area: links; }
.mf-grid > .venue-qr { grid-area: qr; }
.mf-grid:not(:has(.mf-menu)) > .mf-links { grid-area: menu; }   /* a page with no menu list (privacy): the links take its place, no hole */
.mf-grid > .mf-open { justify-self: stretch; }
.mf-links ul { display: flex; flex-wrap: wrap; column-gap: var(--sp-5); }
@media (min-width: 700px) {   /* logo over address | hours | code, the menu and the links under them */
  .mf-grid { column-gap: var(--sp-6); grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand hours qr" "find hours qr" "menu menu menu" "links links links"; }
  .mf-grid > .mf-open { justify-self: start; }
  .mf-grid > .mf-find { inline-size: 0; min-inline-size: 100%; }   /* as wide as the logo above it, never wider: the address wraps under the wordmark */
}
@media (min-width: 1100px) {   /* one band: the address sits under the logo on the row of the links, the code closes the right edge */
  .mf-grid { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-rows: auto 1fr; grid-template-areas: "brand hours menu qr" "find hours links qr"; }
}
.mf-brand { display: flex; flex-direction: column; gap: var(--sp-2); }
.mf-logo { display: inline-flex; min-height: 44px; }
.mf-logo img { width: auto; height: 56px; }   /* the mark's own shape (392 x 634): in a 56px square it sat 11px in from the left edge the wordmark, the code and the links share */
.mf-name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lead); }
.mf-wordmark { display: block; width: 160px; height: auto; }
.mf-col h2 { font-size: var(--text-label, var(--fs-meta)); line-height: var(--lh-label, 1.4); font-weight: var(--weight-strong, 600); text-transform: uppercase; letter-spacing: var(--track-label); color: var(--footer-muted); margin: 0 0 var(--sp-2); }
.mf-col ul { list-style: none; margin: 0; padding: 0; }
.mega-footer a, .mega-footer .help-btn {
  display: inline-flex; align-items: flex-start; justify-content: flex-start; min-height: 44px; block-size: auto; padding: 0;
  color: var(--footer-fg); font: inherit; text-decoration: underline; text-decoration-color: var(--footer-muted);
  text-decoration-thickness: var(--link-line-w, 2px); text-underline-offset: var(--link-offset, 4px);
  background: none; border: none; cursor: pointer; text-align: left;
}
.mf-hours { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-3); margin: 0; font-variant-numeric: tabular-nums; }
.mf-hours dt, .mf-hours dd { margin: 0; color: var(--footer-muted); white-space: nowrap; }
.mf-hours .today { color: var(--footer-fg); font-weight: var(--weight-strong, 600); }
.mf-hours dt, .mf-hours dd { font-size: inherit; line-height: inherit; }
.mf-hours dd { text-align: right; }
.mf-hours-range { display: grid; grid-template-columns: 2.8em .6em 2.8em; justify-content: end; font-variant-numeric: tabular-nums; }
.mf-hours-range > :nth-child(2) { text-align: center; }
.mega-footer .mf-name, .mega-footer .mf-logo { align-items: center; }
.mf-today { font-weight: 400; }
.mf-menu ul { columns: calc(var(--sp-8) * 2); column-gap: var(--sp-5); }   /* as many columns as fit, none narrower than 128px: a category name never wraps */
.mf-menu li { break-inside: avoid; }
.mega-footer .venue-qr { margin: var(--sp-2) 0 0; padding: 0; text-align: left; color: var(--footer-muted); }
.mega-footer .venue-qr .qr-thumb { margin: 0 0 var(--sp-1); }
/* The code is cropped to its modules (venue-footer.js): no padding inside the box, 8px a module, flush on its tile's left and top edge.
   The ground around the box is the quiet zone: the 32px column gap and the footer's 32px top padding are 4 modules each. For a desktop screen only: a phone cannot scan itself. */
.mega-footer .mf-grid .venue-qr { margin: 0; }
.mega-footer .mf-grid .venue-qr .qr-thumb { --qr-px: 8px; inline-size: calc(var(--qr-modules, 25) * var(--qr-px)); block-size: calc(var(--qr-modules, 25) * var(--qr-px)); margin: 0 0 var(--sp-4); }
@media (max-width: 699px) {
  .mega-footer .venue-qr { display: none; }
}
.mf-base {
  max-width: 1200px; margin: var(--sp-5) auto 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-5);
  color: var(--footer-muted);
}
.mf-base p { margin: 0; }
@media (max-width: 699px) { .mf-base { column-gap: var(--sp-3); } }   /* the copyright and the CHOCKERS line share one row at 390 */
.mega-footer .chockers-foot { padding: 0; gap: var(--sp-2); align-items: center; }
.mega-footer a.chockers-logo { --logo-c: #ff5045; }

/* ---- Order summary (order page) ---- */
.order-summary { border: none; border-radius: var(--radius); padding: var(--sp-1) var(--sp-4); margin-bottom: var(--sp-4); background: var(--surface); }
.summary-line { display: flex; justify-content: space-between; padding: var(--sp-2) 0; font-size: var(--fs-meta); color: var(--muted); border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.summary-line:last-child { border-bottom: none; }

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

/* The CHOCKERS logo: /shared/chockers-logo.svg (the word in outlines, Geologica 900,
   tracking -.09em, brand red #9B271E; SPEC/style.md). Drawn as a mask so the colour
   follows the theme (brand-dark #ff5045 on dark pages). One class on every page:
   <a class="chockers-logo" href="https://chocke.rs/" aria-label="CHOCKERS">CHOCKERS</a>.
   The text is the fallback name only; it never shows. */
.chockers-foot a.chockers-logo, a.chockers-logo { --logo-h: 18px; --logo-c: #9b271e; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0; font-size: 0; color: transparent; text-decoration: none; }
.chockers-logo::before { content: ""; display: block; height: var(--logo-h); width: calc(var(--logo-h) * 6.96); background: var(--logo-c); -webkit-mask: url(/shared/chockers-logo.svg) center / contain no-repeat; mask: url(/shared/chockers-logo.svg) center / contain no-repeat; }
@media (prefers-color-scheme: dark) { a.chockers-logo { --logo-c: #ff5045; } }
a.chockers-logo.chockers-logo-head { --logo-h: 24px; }
.chockers-foot { display: flex; justify-content: center; padding: var(--sp-5) var(--sp-4) var(--sp-4); }
.chockers-foot a { opacity: .9; }
.chockers-foot a:hover, .chockers-foot a:focus-visible { opacity: 1; }

/* Nothing looks broken: a text block with no text never renders (SPEC/order-mode.md). */
.page-footer p:empty, .demo-note:empty, .photo-credit:empty, .prep-note:empty { display: none; }

/* A note on one order line (kitchen board, waiter, order detail, and the customer status page): heavy bar and heavy type, the screen twin of the docket's note. */
.item-note { display: inline-block; margin-top: 2px; padding-left: 8px; border-left: 6px solid currentColor; font-weight: 900; white-space: pre-line; overflow-wrap: anywhere; }
/* Express (SPEC/express.md): the venue's ready-now portions, first on the menu, on the
   venue's own accent wash so it reads as the venue's, under the venue's own name. */
.express-section { grid-column: 1 / -1; margin: var(--sp-3) var(--gutter) 0; padding: 0 0 var(--sp-3); background: var(--accent-wash); border-radius: var(--radius); }
.express-section .category-heading { margin-top: 0; padding-top: var(--sp-3); }
.express-section .faves { padding-left: var(--sp-3); padding-right: var(--sp-3); }
.express-ready { margin: 0; padding: 0 var(--gutter); font-size: var(--fs-meta); font-weight: 700; color: var(--accent); }
.express-meta { margin: 0; font-size: var(--fs-meta); color: var(--muted); }
.express-meta span { display: block; }
.express-left { font-weight: 700; color: var(--fg); }
.express-notice { margin: var(--sp-2) var(--gutter) 0; font-size: var(--fs-meta); color: var(--muted); }
.hold-note { font-weight: 700; color: var(--fg); }
.price-was { margin-left: var(--sp-1); font-weight: 400; color: var(--muted); }
@media (min-width: 900px) {
  .express-section { margin: var(--sp-5) 0 0; padding: 0 var(--sp-3) var(--sp-3); }
  .menu-grid .express-section .category-heading { margin: 0; }
  .express-section .express-ready { padding: 0; }
  .express-section .faves.lunch-row { padding: var(--sp-2) 0 0; }
}
/* Lunch specials and express: small cards on every width, more per row than the big cards. */
@media (min-width: 900px) {
  .faves.lunch-row { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 0; }
}

/* Order page: each item's own status under its name (SPEC/gidday.md §4.3). A ck-status: shape and word. */
.summary-line .line-status { display: flex; width: fit-content; margin-top: var(--sp-1); font-size: var(--fs-meta); color: inherit; }
.summary-line .line-status[hidden] { display: none; }

/* ---- Allergens (SPEC/allergens.md; /shared/allergen-menu.js). Shown only when the venue turns
   allergen display on. Layout and type only: the buttons, chips and sheet are ck- controls. */
.allergen-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); max-width: var(--page-max); margin: var(--sp-2) auto; box-sizing: border-box; background: transparent; }
.allergen-bar[hidden], .allergen-lines[hidden] { display: none; }
.allergen-status { margin: 0; color: var(--muted); font-size: var(--fs-meta); }
.allergen-status:empty { display: none; }
.allergen-lines { margin: var(--sp-3) 0 var(--sp-4); padding: var(--sp-2) 0; border-block: 1px solid var(--border); }
.allergen-lines p { margin: 0 0 var(--sp-1); font-size: var(--fs-body); color: var(--fg); }
.allergen-lines .allergen-heading { font-weight: 700; }
.allergen-lines .allergen-advice { margin: var(--sp-2) 0 0; color: var(--muted); font-size: var(--fs-meta); }
.food-card .allergen-flag { margin: var(--sp-1) 0 0; color: var(--fg); font-size: var(--fs-meta); font-weight: 600; }
.allergen-sheet-note { margin: 0 0 var(--sp-3); color: var(--muted); font-size: var(--fs-meta); }
.allergen-sheet-btns { display: flex; gap: var(--sp-2); margin-block-start: var(--sp-4); }
.allergen-sheet-btns .ck-btn { flex: 1 1 0; }
