/* =====================================================================
 * THE ROCK — TILL UI
 * =====================================================================
 * iPad landscape, 1024×768. Banner takes the top 60px; screens fill
 * the remaining 708px. Single-page app — only one section is visible
 * at a time, banner persists across all of them.
 *
 * Themes: this file paints using --bg, --surface, --fg, --accent etc.
 * from /assets/tokens.css. The theme is set on <html data-theme="dark">
 * (bar) or <html data-theme="light"> (cafe) by the till JS at boot,
 * based on the till_type in the till record.
 * ===================================================================== */

* {
  box-sizing: border-box;
  /* Kill double-tap-to-zoom on every interactive element. Modern
   * Safari ignores user-scalable=no in the viewport, so this is the
   * effective fix. `manipulation` allows pan + pinch-zoom-with-two-
   * fingers everywhere else but NOT double-tap-zoom. */
  touch-action: manipulation;
  /* Tasteful themed scrollbars (Firefox). Always visible when a
   * region overflows, so it's obvious there's more below — e.g. the
   * syrup list on a coffee modifier. Adapts to light/dark via tokens. */
  scrollbar-width: thin;
  scrollbar-color: var(--border2, #3a3a3a) transparent;
}
/* Chromium/WebKit (the kiosk + iPads). A 12px inset rounded thumb in a
 * token colour — clearly present, not shouty. The horizontal category
 * strip opts out separately (.dash-categories below) since it has its
 * own edge-fade hint, so this never fights that. */
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border2, #3a3a3a);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
  min-height: 40px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--fg-dim, #a8998a);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  overflow: hidden;
  position: fixed;            /* prevents any rubber-band on iOS */
  inset: 0;
  /* Block elastic overscroll so the page can't be dragged / bounced. */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* no long-press menu */
  font-size: 16px;
  line-height: 1.4;
}

/* On iPad in fullscreen / kiosk PWA mode, the home-indicator-pull
 * gesture can still trigger zoom. This belt-and-braces it. */
html { touch-action: pan-x pan-y; }

/* Global [hidden] override.
 *
 * Browsers default `[hidden] { display: none }` in their UA stylesheet,
 * but author rules with `display: flex` / `display: grid` (or anything
 * that isn't an attribute selector) silently win on specificity ties —
 * which means an element with `hidden` set still renders. This caused
 * a visible "Remaining £0.00" row to appear on a fresh till even
 * though the markup had `hidden` on it. The !important here is the
 * one place we deliberately want the attribute to dominate. */
[hidden] { display: none !important; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* =====================================================================
 * BANNER — 60px fixed, full width. Three columns: left identity,
 * middle status/parked, right staff + clock.
 *
 * iPad/iPhone safe-area: with viewport-fit=cover the page extends
 * UNDER the iOS status bar. Without this padding, the banner's right-
 * column tap targets (staff chips, +) get partially eaten by the
 * status bar and don't register taps. env(safe-area-inset-top) is 0
 * on desktop browsers, ~20-44px on iOS depending on device. The
 * banner's intrinsic 60px content height stays the same; it just
 * grows total height by however much padding iOS demands.
 * ===================================================================== */
/* iOS 27 status-bar shim — see index.html. Solid, fixed, at the very
 * top, full width, covering the status bar (min 6px where there's no
 * inset). Above everything, including sheets, so the strip stays solid
 * whatever's open; it never takes taps. */
.ios-statusbar-shim {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: max(6px, env(safe-area-inset-top));
  background: var(--surface);
  z-index: 10000;
  pointer-events: none;
}

#banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* 68px (v1.5.103, was 60): taken from the grid and the basket so the
     notification, staff chips and till name can be bigger. Everything
     under the bar starts at --bar-h, so this one number moves it all. */
  height: calc(var(--bar-h, 68px) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: grid;
  /* Till name and staff chips take what they need; the notification
     gets the middle that's left and shrinks (ellipsis) rather than
     ever sliding under the chips (v1.5.101). */
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  /* Side padding picks up any safe-area inset (iPhone landscape
   * notch, iPad camera bump in some orientations) on top of the
   * 16px content padding, so banner content is never under the
   * camera/notch zone. */
  padding-left:  calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  gap: 16px;
  z-index: 100;
}

.banner-left, .banner-middle, .banner-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.banner-middle { justify-content: center; }
.banner-right { justify-content: flex-end; }

.banner-logo {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
/* The till-name / connection chip was removed in v1.5.88: the till's
   name is the .banner-logo, and losing the server is a notification. */

/* Top-left LAYOUT SWITCHER — lives in the tab strip (#dash-categories)
 * as the first child, before the page pills. Tappable to cycle. The
 * background is painted with the active layout's tile_color via the
 * --switcher-bg CSS variable set by JS (renderLayoutSwitcher).
 *
 * Distinct from the page pills: bigger padding, bolder type, coloured
 * background, chevron when there are multiple layouts. Single-layout
 * mode hides the chevron and disables the click. */
.layout-switcher {
  flex-shrink: 0;
  min-width: 72px;
  height: calc(100% - 12px);
  padding: 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--switcher-bg, var(--muted));
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
  transition: filter 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
  user-select: none;
}
.layout-switcher.multi:hover { filter: brightness(1.08); }
.layout-switcher.multi:active { transform: scale(0.97); }
/* v1.5.104: the switcher sits top-left in the banner, before the
   till name — same height as the staff chips. */
#banner .layout-switcher {
  height: 46px;
  min-width: 0;
  padding: 0 14px;
  font-size: 16px;
}
.layout-switcher[disabled] {
  cursor: default;
  opacity: 0.85;
}

.banner-parked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.banner-parked:active { transform: scale(0.97); }
.parked-icon { font-size: 17px; }
.parked-count {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  font-size: 15px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
:root[data-theme="light"] .parked-count { color: #fff; }

/* Banner notification slot — surfaces transient process messages
 * (card payment in flight, kitchen order acknowledged, etc.) so the
 * user gets feedback without a panel taking up basket-area pixels.
 * Optional spinner on the left, optional action button on the right. */
.banner-notif {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  /* 44px tall, 16px text (v1.5.101, John: readable from across the
     bar). The top bar is 68px; 56px is the most it can take. Wider to
     match the bigger text, but never more than half the screen so the
     till name and staff chips keep their room. */
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--fg);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  max-width: min(560px, 100%);
  min-width: 0;
  box-sizing: border-box;
}
/* Solid traffic-light fills, readable from across the bar (v1.5.89,
 * John): yellow = waiting, red = failed / needs action, green = done.
 * Info (tab saved, etc.) is plain — no neon blue. Same in both themes. */
.banner-notif[data-severity="warning"], .banner-notif-pill[data-severity="warning"] { background: #e8a020; border-color: #e8a020; color: #1a1200; }
.banner-notif[data-severity="error"],   .banner-notif-pill[data-severity="error"]   { background: #c62828; border-color: #c62828; color: #fff; }
.banner-notif[data-severity="success"], .banner-notif-pill[data-severity="success"] { background: #2ecc71; border-color: #2ecc71; color: #062b14; }
.banner-notif[data-severity="info"],    .banner-notif-pill[data-severity="info"]    { background: var(--surface); border-color: var(--border); color: var(--fg); }
/* On a coloured fill the spinner and the staff name need their own
 * backing: the name sits on a dark chip so it keeps its staff colour. */
:is(.banner-notif, .banner-notif-pill):is([data-severity="warning"], [data-severity="error"], [data-severity="success"]) .banner-notif-spinner {
  border-color: rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
}
:is(.banner-notif, .banner-notif-pill):is([data-severity="warning"], [data-severity="error"], [data-severity="success"]) .banner-notif-who {
  background: rgba(0, 0, 0, 0.72);
  padding: 1px 8px;
  border-radius: 999px;
}

/* Multi-pill mode — when more than one alert is present at the top
   priority (e.g. several food-ready tabs), the wrap strips its own
   pill chrome and becomes a flex container holding individual
   .banner-notif-pill children. Each pill carries its own colour and
   long-press handler so holding the T2 pill marks just T2 sent, not
   T2 + T5 together. */
.banner-notif[data-multi="true"] {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  max-width: none;
  /* Outer severity colour is irrelevant in multi mode — each pill
     paints its own border. Reset to default to avoid bleeding through
     on hover or pressing states. */
  color: var(--fg);
}
.banner-notif-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--fg);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}
/* Pressing feedback matches the wrap version — same 800ms timing as
   LONG_PRESS_MS so the visual completes exactly as the action fires. */
.banner-notif-pill[data-pressing="true"] {
  transform: scale(0.97);
  opacity: 0.7;
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}
.banner-notif-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}
/* Whose card payment it is, in their staff colour (v1.5.87). */
.banner-notif-who {
  flex-shrink: 0;
  font-weight: 800;
}
.banner-notif-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-notif-action {
  /* A real tap target on the bigger pill (Cancel, Dismiss, Undo). */
  min-height: 38px;
  padding: 0 16px;
  margin-left: 4px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: inherit;
  background: transparent;
}
.banner-notif-action:active { transform: scale(0.95); }

/* When a banner has a long-press dismissal wired (food-ready, etc.)
   we set data-pressing="true" during the hold. CSS scales it slightly
   + fades it to give the cashier visible confirmation the gesture is
   being captured. 800ms feels long when you don't see anything happen.
   The transition timing mirrors the 800ms LONG_PRESS_MS so the visual
   completes right as the action fires. */
.banner-notif[data-pressing="true"] {
  transform: scale(0.97);
  opacity: 0.7;
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

.banner-staff {
  display: inline-flex;
  gap: 10px;
}
.staff-chip {
  position: relative;             /* for the progress overlay */
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  /* Bigger on the taller bar (v1.5.103): 46px tall, 16px names. */
  min-height: 46px;
  box-sizing: border-box;
  padding: 0 18px;
  border-radius: 8px;
  background: transparent;
  /* Personal colour — set per-chip via inline style; falls back to
   * the system accent gold if no colour is assigned to this staff. */
  --staff-color: var(--accent);
  border: 2px solid var(--staff-color);
  color: var(--staff-color);
  font-size: 16px;
  font-weight: 700;
  max-width: 170px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
  /* Disable iOS's blue tap highlight + text selection during long-press */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.staff-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;             /* sits above the progress overlay */
  z-index: 1;
}
/* Active chip: filled with the personal colour. The text flips to a
 * high-contrast colour (white in dark theme; the accent-fg token
 * does the right thing in light theme too). The outer ring lifts the
 * active chip a fraction proud of the inactive ones, reinforcing
 * "this is the one you're using" at a glance. */
.staff-chip[data-active="true"] {
  background: var(--staff-color);
  color: #fff;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--staff-color);
}
:root[data-theme="light"] .staff-chip[data-active="true"] { color: #fff; }

/* Long-press progress overlay.
 *
 * On pointerdown we set data-pressing="true" — the overlay slides in
 * from left to right over LONG_PRESS_MS, signalling "keep holding to
 * sign out". Releasing early flips data-pressing to "false" which
 * snaps the overlay back to 0 width (instant, signals the abort).
 *
 * The overlay is red so the destructive action is visually obvious
 * — staff who accidentally hold the chip see a clear "you're about
 * to do something serious" cue and can release. Sits ABOVE the
 * personal colour so it doesn't matter what colour the chip is. */
.staff-chip-progress {
  position: absolute;
  inset: 0;
  background: var(--danger, #c44);
  opacity: 0.92;
  width: 0%;
  pointer-events: none;
  z-index: 0;
  transition: width 0.05s linear;
}
.staff-chip[data-pressing="true"] .staff-chip-progress {
  width: 100%;
  /* Match LONG_PRESS_MS in till.js. The progress visually fills as
   * the timer counts down, so the user sees how close they are. */
  transition: width 0.8s linear;
}
.staff-chip[data-pressing="true"] .staff-chip-name {
  /* Force readable contrast on the red overlay */
  color: #fff;
}

#staff-chips[data-many="true"] { gap: 6px; }
#staff-chips[data-many="true"] .staff-chip {
  padding: 0 10px;
  font-size: 14px;
  max-width: 110px;
}

.banner-add-staff {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  color: var(--fg-dim);
  font-size: 24px;
  line-height: 1;
}
.banner-add-staff:hover { border-style: solid; color: var(--accent); border-color: var(--accent); }

/* =====================================================================
 * STAGE — area below the banner. Each <section.screen> fills it.
 * ===================================================================== */
#stage {
  position: fixed;
  /* Top: clear iOS status bar via env(safe-area-inset-top) — 32px in
   * iPad PWA, 0 in regular Safari with URL bar visible.
   * Bottom: innerHeight. On iPad PWA, iOS reserves a permanent 32px
   * gesture band BELOW innerHeight which we cannot draw into and
   * cannot use for tap targets. iOS colour-matches that band to the
   * page background sitting at innerHeight, so as long as the content
   * immediately above 778 is the right colour for both columns, the
   * band is visually invisible. We do NOT extend stage past
   * innerHeight — earlier attempts via 100lvh / position:fixed height
   * pushed the methods buttons into the gesture zone where they got
   * partially clipped and were untappable.
   * Side insets: zero on iPad, non-zero on iPhone landscape notch. */
  top:    calc(var(--bar-h, 68px) + env(safe-area-inset-top));
  bottom: 0;
  left:   env(safe-area-inset-left);
  right:  env(safe-area-inset-right);
  background: var(--bg);
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}
.screen[data-active="true"] {
  display: block;
}

/* =====================================================================
 * PAIRING SCREEN
 * ===================================================================== */
.pair-card {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}
.pair-eyebrow {
  font-family: var(--display);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pair-title {
  font-family: var(--display);
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--fg);
}
.pair-msg {
  color: var(--fg-dim);
  margin: 0 0 24px;
}
/* Pair code entry — 6 dots above a numeric keypad. Same look as the
 * staff PIN keypad to keep muscle memory consistent. */
.pair-code-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.pair-code-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: all 0.12s;
}
.pair-code-dot[data-filled="true"] {
  background: var(--accent);
  border-color: var(--accent);
}
.pair-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 320px;
  margin: 0 auto 16px;
}
.pair-key {
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.08s;
}
.pair-key:active {
  transform: scale(0.95);
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}
.pair-key-aux {
  background: var(--surface);
  font-size: 18px;
  color: var(--fg-dim);
}
.pair-error {
  color: var(--danger, #c44);
  font-size: 13px;
  margin: 0 0 16px;
}
.pair-hint {
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0;
}

/* =====================================================================
 * LOGIN SCREEN — staff list left, PIN keypad right
 * ===================================================================== */

/* Close button — top-right corner of the login screen, sat over the
 * staff list panel. Only rendered visible when at least one other
 * staff member is already logged in (otherwise there's nowhere to
 * close to). Sits above the rest with a high z-index so the staff
 * tile grid can't obscure it on small viewports. */
.login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 24px;
  line-height: 1;
  color: var(--fg-dim);
  z-index: 10;
  transition: all 0.12s;
}
.login-close:hover { color: var(--fg); border-color: var(--fg-dim); }
.login-close:active { transform: scale(0.94); }

.login-grid {
  /* Flex item filling whatever vertical space the screen has minus
     the bottom-row's natural height. Was position:absolute pre-Ship-1,
     which covered the whole screen and hid the new bottom-row's
     Cash up + Float buttons behind it. min-height:0 lets the inner
     scroll containers (staff list) actually scroll instead of
     blowing out the layout. */
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 0;
}
.login-staff {
  padding: 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  align-content: start;
}
.staff-tile {
  position: relative;
  /* Personal colour — falls back to the system accent gold. */
  --staff-color: var(--accent);
  padding: 24px 16px;
  border: 2px solid var(--staff-color);
  border-radius: 8px;
  background: transparent;
  color: var(--staff-color);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.staff-tile:active { transform: scale(0.97); }
.staff-tile[data-selected="true"] {
  background: var(--staff-color);
  color: #fff;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--staff-color);
}
:root[data-theme="light"] .staff-tile[data-selected="true"] { color: #fff; }
.staff-tile-name {
  font-size: 18px;
  font-weight: 700;
}

.login-pin {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-pin-prompt {
  font-size: 16px;
  color: var(--fg-dim);
  margin-bottom: 16px;
}
.login-pin-display {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}
.pin-dot[data-filled="true"] {
  background: var(--accent);
  border-color: var(--accent);
}
.login-pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 320px;
  margin-bottom: 16px;
}
.pin-key {
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  color: var(--fg);
  transition: all 0.1s;
}
.pin-key:active:not(:disabled) {
  transform: scale(0.96);
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}
:root[data-theme="light"] .pin-key:active:not(:disabled) { color: #fff; }
:root[data-theme="light"] :is(.pin-key, .pay-key, .pair-key, .set-qty-step).is-pressed { color: #fff; }
.pin-key-aux {
  font-family: inherit;
  font-size: 20px;
  color: var(--fg-dim);
}
.login-error {
  color: var(--danger, #c44);
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
  min-height: 20px;
}

/* =====================================================================
 * DASHBOARD — product grid (left) + basket-with-integrated-payment (right)
 *
 * The right column is now wider (440px) to fit the basket + the
 * integrated payment panel (number pad, note shortcuts, method buttons).
 * The number pad is the pivotal control: it captures a number that's
 * EITHER a quantity prefix for the next product/measure tap (3 → Half
 * → Lager = 3 half-pints) OR a payment amount for the next method tap
 * (500 → Cash = take £5.00 cash). Tapping a button consumes the input
 * and clears it.
 * ===================================================================== */
.dash-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 500px;
  /* Critical: 1fr row so the grid row fills the full container
   * height. Without this, `grid-template-rows` defaults to auto and
   * the row sizes to its tallest column's natural content, leaving
   * empty space at the bottom of .dash-grid. iPad Safari surfaced
   * this; Edge/Chrome on Windows tolerated it because viewport
   * heights happened to closely match content. */
  grid-template-rows: 1fr;
  gap: 0;
}

.dash-products {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  /* Extend the column's background through any iOS PWA safe-area
   * gesture zone at the bottom of the viewport. Without this, the
   * page body bg shows through under here as a contrasting strip
   * in cafe (cream) vs basket (white) themes. */
  padding-bottom: env(safe-area-inset-bottom);
}

.dash-categories {
  display: flex;
  gap: 4px;
  /* No black band between the top bar and the tabs (v1.5.103, John):
     the tabs sit straight under the bar. */
  padding: 0 12px;
  overflow-x: auto;
  flex-shrink: 0;
  /* Subtle scroll hint without a visible scrollbar. The pseudo-
   * elements on .dash-categories-wrap (below) fade the edges to
   * suggest "more content this way". Native scrollbars are hidden
   * across all engines. */
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.dash-categories::-webkit-scrollbar {
  display: none;
}
/* The category strip lives in a relatively-positioned wrap so the
 * fade gradients on both edges can pin to it without altering layout
 * flow. Wrap is added by markup; if absent, the fades just don't
 * appear and the strip falls back to the legacy look. */
.dash-categories-wrap {
  position: relative;
  /* Don't clip the gradient — but DO clip the strip's own overflow
   * so a long category list doesn't widen the till. */
  overflow: hidden;
  flex-shrink: 0;
}
.dash-categories-wrap::before,
.dash-categories-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease;
}
.dash-categories-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg, #0a0a0a) 10%, rgba(0,0,0,0));
}
.dash-categories-wrap::after {
  right: 0;
  background: linear-gradient(to left,  var(--bg, #0a0a0a) 10%, rgba(0,0,0,0));
}
/* JS toggles data-scroll-{start,end} on the wrap to hide each fade
 * when the strip is at that edge — keeps the visual hint honest. */
.dash-categories-wrap[data-scroll-start="true"]::before { opacity: 0; }
.dash-categories-wrap[data-scroll-end="true"]::after   { opacity: 0; }

/* Scroll arrows — sit on top of the fade gradients. Tappable
 * affordance for non-trackpad users (most iPad use). Hidden when
 * the strip is already at that scroll edge so they're never lying
 * about whether a scroll is possible. */
.dash-categories-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 36px;
  border-radius: 6px;
  background: var(--surface, rgba(255,255,255,0.06));
  border: 1px solid var(--border, #2a2a2a);
  color: var(--fg, #e8e8e8);
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;            /* above fade gradients (z-index:2) */
  padding: 0;
  transition: opacity 0.2s ease, transform 0.1s ease;
}
.dash-categories-arrow:active {
  transform: translateY(-50%) scale(0.9);
}
.dash-categories-arrow-left  { left:  4px; }
.dash-categories-arrow-right { right: 4px; }
/* Hide each arrow when the strip is already at that edge.
 * data-scroll-start = "you can't scroll further left"
 * data-scroll-end   = "you can't scroll further right" */
.dash-categories-wrap[data-scroll-start="true"] .dash-categories-arrow-left,
.dash-categories-wrap[data-scroll-end="true"]   .dash-categories-arrow-right {
  opacity: 0;
  pointer-events: none;
}
.cat-pill {
  /* Fill the strip (v1.5.102, John). Each tab starts at its own text
     width and the slack after the last one is shared out equally
     (flex-grow 1 on an auto basis), so long and short names both get
     the same extra — whatever the pages are called and however many
     there are. When they don't all fit there is no slack: nothing
     grows and the strip scrolls as before. */
  flex: 1 0 auto;
  text-align: center;
  padding: 13px 14px;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--fg-dim);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cat-pill[data-active="true"] {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}
:root[data-theme="light"] .cat-pill[data-active="true"] { color: #fff; }

.dash-buttons {
  flex: 1;
  display: grid;
  /* Set by JS: layout mode → State.layout.layout.grid_columns (default 8);
     legacy mode → 5. Keeps the till's existing density when no layout
     is configured but unlocks "8 cask in a row" when layouts drive
     the grid.

     minmax(0, 1fr) — not just 1fr — because grid 1fr is actually
     minmax(auto, 1fr): if a button's content (a long product name
     like "Hillbilly Engineering (Eclipse)") has a wider min-content
     width than its 1/8 share, it forces the column wider and the
     whole grid horizontal-scrolls. minmax(0, 1fr) lets columns
     shrink as needed; the button itself wraps text. */
  grid-template-columns: repeat(var(--till-grid-cols, 5), minmax(0, 1fr));
  /* Row height bounded to roughly square shape regardless of how
     many products fit on a page. With pure 1fr, a page with only 6
     products in 8 columns produces one row that stretches to fill
     all vertical space — tall ugly pillars. minmax(80px, 110px)
     keeps buttons tappable but proportional. align-content: start
     parks any spare space at the bottom rather than stretching the
     rows that exist. */
  /* Rows are sized so that exactly --till-grid-rows (7) fill the
     height: a 7-row page never scrolls. A page with more rows keeps
     the same tile height and scrolls for the rest — nothing hidden.
     The Packaged page has its own stacked layout and opts out below. */
  --till-grid-rows: 7;
  --till-grid-gap: 6px;
  /* Tile height is set per render in JS (--till-tile-h, a seventh of
     the grid's height) so banners/row-breaks keep their own slim
     height instead of being stretched to a full row. */
  grid-auto-rows: auto;
  align-content: start;
  gap: var(--till-grid-gap);
  padding: 6px 12px 8px;
  overflow-y: auto;
  min-height: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.dash-buttons > .product-btn:not(.section-header-btn) {
  height: var(--till-tile-h, auto);
}
#dash-buttons.packaged-page > * { height: auto; }

/* Section header button — non-tappable visual divider in the layout
   grid. Spans the full row by default; manager can shrink via
   spanW if they want a narrow label. */
.section-header-btn {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  border-bottom: 2px solid var(--accent, #d4a017) !important;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent, #d4a017);
  font-weight: 700;
  cursor: default;
  padding: 2px 8px 0 !important;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

/* System button — slightly distinct from product buttons so the
   cashier registers them as actions, not items. Accent border on
   the left edge. */
.system-btn {
  border-left: 4px solid var(--accent, #d4a017) !important;
  font-weight: 600;
}
.product-btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  /* v1.5.105: text is as big as each tile allows. fitTileText() in
     till.js sets --tile-font per tile (22px down to 13px) so a short
     name gets big type and a long one shrinks only as far as it must.
     16px is the fallback for tiles it doesn't size (packaged page). */
  font-size: var(--tile-font, 16px);
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  min-height: 0;             /* row height comes from the 7-row grid */
  /* Not "all": font-size must never animate, or fitTileText() measures
     a tile mid-transition and leaves text too big for it. */
  transition: transform 0.1s, background-color 0.1s, border-color 0.1s, color 0.1s;
  position: relative;
  /* Clip overflow rather than pushing button taller. The label
     div inside has its own line-clamp; this is the safety net. */
  overflow: hidden;
}

/* Layout-mode product label — line-clamps to 3 lines so long
   product names like "Hillbilly Engineering (Eclipse)" fade with
   ellipsis instead of forcing the button taller. Width-constrained
   too so a single long word doesn't push horizontally. */
.product-btn-label {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.1;
  width: 100%;
  /* Auto margins split the free space above and below the name, so it
     sits centred in the room above the price line, which stays pinned
     to the bottom of the tile. */
  margin: auto 0;
}
/* Bottom line: [badges] price [badges]. The two side columns are equal
   so the price is always dead centre. */
.product-btn-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  /* v1.5.107: badges sit 2px in from the tile's edges (the foot runs
     4px into the tile's 6px side padding) with 8px clear of the price. */
  column-gap: 8px;
  width: calc(100% + 8px);
  margin: 0 -4px;
  flex-shrink: 0;
}
/* While fitTileText() measures, whole words must not break, so a word
   too wide for the tile shows up as overflow and the font steps down.
   Only a tile already at the floor size falls back to breaking. */
.product-btn[data-fit="measure"] .product-btn-label { word-break: normal; overflow-wrap: normal; }
/* v1.5.224: while measuring, the name is its natural size (no clamp, no
   shrinking) so its real height can be read on every browser. */
.product-btn[data-fit="measure"] .product-btn-label {
  display: block; -webkit-line-clamp: unset; overflow: visible; flex: none; margin: 0;
}
.product-btn[data-tight] .product-btn-label { line-height: 1; }
.product-btn[data-tight] { gap: 0; padding-top: 2px; padding-bottom: 2px; }
/* v1.5.110 NEON EDGE — any tile with a colour (category, button
   override, tap bank, brewery) is dark glass with a glowing outline in
   that colour, a white name and the price in the neon. --neon is set
   per tile by applyTileColor() in till.js. */
:root[data-skin="neon"] .product-btn.tile-neon {
  background: color-mix(in srgb, var(--neon) 10%, #0e0c16);
  border: 2px solid var(--neon);
  border-radius: 8px;
  box-shadow:
    0 0 10px color-mix(in srgb, var(--neon) 55%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--neon) 22%, transparent);
  color: #fff;
  text-shadow: none;
}
:root[data-skin="neon"] .product-btn.tile-neon .product-btn-price { color: var(--neon); opacity: 1; }
:root[data-skin="neon"] .product-btn.tile-neon:active:not(:disabled) {
  background: color-mix(in srgb, var(--neon) 38%, #0e0c16);
  border-color: var(--neon);
  color: #fff;
  box-shadow: 0 0 18px color-mix(in srgb, var(--neon) 80%, transparent);
}
.product-btn.tap-slot-empty,
.product-btn.tile-neon.tap-slot-empty {
  /* v1.5.112: empty taps are invisible (still tappable — opens the
     put-a-beer-on wizard). */
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  opacity: 1;
}
.product-btn.tile-neon.tap-slot-cleaning { border-left: 4px solid var(--warn, #f5a623); }
.product-btn:active:not(:disabled) {
  transform: scale(0.96);
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}
:root[data-theme="light"] .product-btn:active:not(:disabled) { color: #fff; }
.product-btn[data-sold-out="true"] {
  opacity: 0.3;
  text-decoration: line-through;
}
/* Stock countdown badge — "N left" on any tile carrying a tracked
   count (data-stock set by the render code). Rendered from the
   attribute so the JS only sets one dataset value per tile. Hidden
   when the tile is sold out (count's gone, tile already struck out). */
[data-stock] { position: relative; }
[data-stock]::after {
  content: attr(data-stock) " left";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  pointer-events: none;
  z-index: 2;
}
[data-sold-out="true"][data-stock]::after { display: none; }

/* Loyalty strip under the basket — shows when a member is attached. */
.basket-member {
  margin: 6px 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(90, 130, 230, 0.10);
  border: 1px solid rgba(90, 130, 230, 0.30);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.basket-member-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.basket-member-icon { font-size: 18px; line-height: 1; flex: none; }
.basket-member-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.basket-member-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.basket-member-sub { font-size: 12px; color: var(--fg-dim); }
.basket-member-remove {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-dim);
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.basket-member-remove:active {
  background: var(--danger, #c0392b);
  color: #fff;
  border-color: var(--danger, #c0392b);
}

/* Loyalty rows nested inside the member block — separated from the
   identity row by a hairline so it reads as one "member card" with a
   progress section, not two stacked widgets. */
.basket-member-loyalty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(90, 130, 230, 0.22);
}
.loyalty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.loyalty-name { flex: 1; color: var(--fg, #f5f5f5); }
.loyalty-progress { font-weight: 700; color: var(--accent, #d4a017); white-space: nowrap; }
.loyalty-row-reward .loyalty-progress { color: #1a7f37; }
.loyalty-redeem {
  font-size: 15px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  border: none;
  background: #1a7f37;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.loyalty-redeem:active { transform: scale(0.97); }
.product-btn-price {
  /* v1.5.106: fixed size on every tile; only the name is fitted. */
  font-size: 16px;
  line-height: 1.1;
  white-space: nowrap;
  font-weight: 600;
  /* Inherit the contrast-aware tile colour (set inline by
   * applyTileColor), then drop opacity so the price reads as
   * secondary to the product name without ever falling into low-
   * contrast var(--fg-dim) territory on coloured backgrounds. */
  color: inherit;
  opacity: 0.92;
}

/* ----- Tap slot tile (Cask / Keg / Box cider pages) -----
 *
 * A fixed-position tile bound to an epos_taps row by id. The tile is
 * always present in its slot's grid position even when empty — the
 * bartender's muscle memory works because slot 4 is always where
 * slot 4 lives, regardless of what's currently on it.
 *
 * Three states layered on top of the base .product-btn styling:
 *   .tap-slot-empty   — greyed-out, inert, "— empty —"
 *   .tap-slot-cleaning — warn-coloured, inert, "line cleaning"
 *   neither           — a normal product tile with a slot-label header
 *
 * Tile body is the bank/category colour applied inline (see
 * applyTileColor in till.js). Three states layered on top:
 *   .tap-slot-empty   — heavily faded so the slot reads as placeholder
 *   .tap-slot-cleaning — amber stripe + faded body
 *   neither           — full-strength bank colour with product label */
/* Draught bank label (v1.5.101): sits in the spare square at the
   start of each bank. The bank's own colour as a solid edge and tint,
   so it reads as a sign, not a button; never takes a tap. */
.tap-bank-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--till-tile-h, auto);
  /* v1.5.104: plain text on the page background — no outline or fill,
     so it doesn't look like a button you're meant to press. */
  border: 0;
  background: transparent;
  /* v1.5.114: same neon as the buttons it heads, with a soft glow. */
  color: var(--fg);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

.tap-slot-btn {
  /* No extra padding needed — without the slot label header, the
   * tile uses .product-btn's normal centred layout. */
}
.tap-slot-status-text {
  font-size: 16px;
  font-style: italic;
  /* Inherit the tile's text colour so the contrast logic in
   * applyTileColor still works for empty/cleaning states (which now
   * also carry the bank colour). Fallback to a neutral dim if no
   * colour applied. */
  color: inherit;
  opacity: 0.75;
  margin-top: 4px;
}
.tap-slot-empty {
  /* Empty slot still shows its bank colour (set inline by JS) but
   * heavily faded — clear placeholder signal without losing the
   * "this is a cask/keg/box-cider slot" identity. Border stays so
   * the slot outline is preserved on the grid. */
  opacity: 0.32;
  cursor: default;
}
.tap-slot-empty:active {
  /* Suppress the active-scale + accent flash inherited from
   * .product-btn — disabled buttons shouldn't react to taps. */
  transform: none;
  color: inherit;
  border-color: var(--border);
}
.tap-slot-cleaning {
  /* Line-cleaning is a real warning — keep the bank colour underneath
   * (so bartender can still place the slot at a glance) but draw an
   * amber stripe down the left and fade the body. */
  border-left: 4px solid var(--warn, #f5a623);
  opacity: 0.7;
  cursor: default;
}
.tap-slot-cleaning .tap-slot-status-text {
  color: var(--warn, #f5a623);
  opacity: 1;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0,0,0,0.7);
}
.tap-slot-cleaning:active {
  transform: none;
  color: inherit;
}

/* ----- Tap-slot dietary badges -----
 *
 * Small uppercase chips in the top-right corner of cask + keg tiles
 * when the product is flagged Gluten Free or Vegan. Box cider tiles
 * never show these (apple cider is implicitly both — the badges would
 * appear on every tile and stop being scannable). Two-character labels
 * keep them compact at iPad scale; colour follows the relevant chip
 * palette (gluten-free = warning amber, vegan = green). */
.tap-slot-badges {
  /* A strip across the very top of the tile, edge to edge, so GF / VG /
     AF sit side by side and never overlap each other or the name
     (which is padded down to clear them — see .product-btn.has-badges). */
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  display: flex;
  justify-content: space-between;
  gap: 2px;
  z-index: 1;          /* keeps badges above the product label clip */
  pointer-events: none; /* don't intercept taps meant for the tile */
}
.tap-slot-badges:has(:only-child) { justify-content: flex-end; }
.tap-slot-badge {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  padding: 1px 3px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
  border: 1px solid currentColor;
  background: var(--surface);
  white-space: nowrap;
}
.product-btn.has-badges { padding-top: 19px; }
.tap-slot-badge-gf {
  color: var(--warn, #f5a623);
}
.tap-slot-badge-vg {
  color: var(--ok, #4caf50);
}
.tap-slot-badge-af {
  color: var(--accent, #4a9eff);
}

/* Dietary badges on the general product tile (GF / VG / AF). A compact
 * row at the bottom of the tile; colours mirror the draught tap-slot
 * badges so the same flag reads the same everywhere. */
.product-btn-badges {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  line-height: 1;
}
.product-btn-badges-l { justify-content: flex-start; }
.product-btn-badges-r { justify-content: flex-end; }
.product-btn-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 2px 3px;
  white-space: nowrap;
  border-radius: 3px;
  border: 1px solid currentColor;
  /* Dark chip so the flag reads on any tile colour (amber GF on a
     yellow cask tile would vanish without it). */
  background: var(--surface);
}
.product-btn-badge-gf { color: var(--warn, #f5a623); }
.product-btn-badge-vg { color: var(--ok, #4caf50); }
.product-btn-badge-af { color: var(--accent, #4a9eff); }

/* ----- Section header banner -----
 *
 * Full-width row banner that introduces a group of tiles on a layout
 * page. On the bar till's Draught page these label each tap-bank
 * group ("Cask", "Keg", "Box cider"). The seed gives them span_w 8,
 * but in case a manager-edited row drops back to span_w 1 we also
 * force grid-column: 1 / -1 via the JS render path. */
.section-header-btn {
  display: flex;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  text-align: left;
  padding: 2px 12px;
  min-height: 22px !important;      /* override .product-btn's 80px */
  height: auto !important;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-dim);
  cursor: default;
  opacity: 1;                       /* override .product-btn:disabled */
}

/* =====================================================================
 * Packaged page — search + brewery-grouped tiles + quick picks
 * =====================================================================
 *
 * The Packaged page (bottled + canned drinks, dozens to hundreds of
 * products from many breweries) renders DIFFERENTLY from a normal
 * product grid. Instead of CSS Grid columns, we use a vertical
 * stack of (section-label, sub-grid) pairs, with a search bar at
 * the top.
 *
 * When the `.packaged-page` class is on #dash-buttons, the normal
 * grid CSS is overridden by these rules. */
#dash-buttons.packaged-page {
  display: block;
  grid-template: none;
  overflow-y: auto;
  padding: 8px;
}

.packaged-search-row {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 4px 0 8px;
  margin-bottom: 4px;
}
.packaged-search-input {
  width: 100%;
  height: 44px;
  font-size: 18px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--fg);
  outline: none;
}
.packaged-search-input:focus {
  border-color: var(--accent, #c87030);
  box-shadow: 0 0 0 2px rgba(200, 112, 48, 0.25);
}

.packaged-section-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 12px 4px 6px;
}
.packaged-sub-label {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}

.packaged-grid {
  display: grid;
  grid-template-columns: repeat(var(--till-grid-cols, 8), 1fr);
  gap: 4px;
}

.packaged-empty {
  padding: 24px 8px;
  font-size: 16px;
  color: var(--fg-dim);
  text-align: center;
}

/* ----- Bar till bottom-bar — draught measure quick-select ----- */
.draught-measure-group {
  display: flex;
  gap: 4px;
  height: 100%;
  padding: 6px 0;
}
.draught-measure-tile {
  /* v1.5.104: fixed width so Pt ⅔ ½ ⅓ are four identical chips. */
  width: 80px;
  flex: 0 0 80px;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: all 0.08s;
}
.draught-measure-tile[data-active="true"] {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}
:root[data-theme="light"] .draught-measure-tile[data-active="true"] { color: #fff; }
.draught-measure-tile:active:not([data-active="true"]) {
  transform: scale(0.96);
  border-color: var(--accent);
  color: var(--accent);
}
.dash-bottom-bar-spacer {
  flex: 1;                          /* pushes any future items right */
}

/* Slim utility bar pinned to the bottom of the products panel.
 *
 * Sized to match .pay-key (60px) so the measure picker on the left
 * and the payment keypad row on the right read as one continuous
 * bottom strip across the till — no awkward height step at the
 * column boundary.
 *
 * Empty by default. JS can append children to #dash-bottom-bar to
 * populate. Styling for child buttons can be added when needed. */
.dash-bottom-bar {
  height: 60px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

/* Bottom-bar action buttons. Restrained appearance — these are
 * day-to-day controls, not primary till actions. The cash-up button
 * is the first occupant; future siblings (training mode, misc item,
 * repeat round) share the same look. */
.dash-bottom-action {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-soft, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.dash-bottom-action:hover {
  background: var(--accent-soft, rgba(255,255,255,0.05));
  border-color: var(--accent, var(--border));
}
.dash-bottom-action:active {
  transform: translateY(1px);
}

/* ----- Till cashed-up banner -----
 *
 * Appears in the basket column above the totals when this till has
 * been cashed up for the day. Drives home that the drawer is closed
 * for the night — staff should take card or member balance only.
 * Amber palette: warning, not error (the till still works, just not
 * for cash). Compact two-line layout fits the basket column width
 * without pushing the pay panel off-screen. */
.till-cashed-up-banner {
  background: #fff3cd;                 /* soft amber */
  border: 1px solid #ffc107;
  color: #664d03;
  padding: 8px 10px;
  margin: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
}
.till-cashed-up-banner strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
  color: #594100;
}
.till-cashed-up-banner span {
  opacity: 0.85;
}
/* Cash method/chip in locked state — visual cue beyond just disabled.
 * disabled buttons get a strikethrough so the lock is obvious even
 * when the user briefly tries to tap one. */
.pay-method[data-locked="true"] {
  text-decoration: line-through;
  opacity: 0.45;
}

/* ----- Basket panel -----
 *
 * Flex column. The lines area gets flex: 1 1 0 to absorb all
 * vertical slack between the fixed-height children. min-height: 0
 * on the flex child is required to defeat Safari's implicit
 * min-height: auto, which would otherwise refuse to shrink a
 * scrollable child below its content size — leaving the pay-panel
 * floating mid-column. */
.dash-basket {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  /* Same as .dash-products: extend the column's bg through any iOS
   * PWA safe-area gesture zone, so MEMBER/CASH/CARD aren't followed
   * by a contrasting strip of body bg. */
  padding-bottom: env(safe-area-inset-bottom);
}

/* =====================================================================
 * Basket header — single row, touch-targets ≥ 44px.
 * ---------------------------------------------------------------------
 * Layout:
 *   ┌─────────────────────────────────────────────────────────────┐
 *   │ [Tables/Table]  [Park/Save]    [Clear]  [⋯]              │
 *   └─────────────────────────────────────────────────────────────┘
 *
 * Mode-aware visibility: .dash-basket[data-mode="sale"] shows Park
 * and hides Save; "tab" mode does the opposite. CSS handles this so
 * JS only sets one attribute on mode change. The popover is anchored
 * absolutely to the header (which is position:relative) so it drops
 * below the ⋯ button cleanly.
 * ===================================================================== */

.basket-header {
  position: relative;        /* anchor for the ⋯ popover */
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.basket-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.basket-header-spacer {
  flex: 1;
}

/* Generic button used for Tables / Park / Save / Clear. Touch-sized
 * (min-height 44 / min-width 44) and meaty enough to read across the
 * room. Variants tweak colour without changing structure. */
.basket-action {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
  cursor: pointer;
  /* Uniform sizing across the header row — same height, same min width, so
   * Tables / Save / Clear read as one set. The ⋯ icon overrides min-width
   * back to a square below. */
  min-height: 48px;
  min-width: 76px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.basket-action:not(:disabled):hover  { background: var(--surface3, var(--surface2)); border-color: var(--fg-dim); }
.basket-action:not(:disabled):active { transform: translateY(1px); }
.basket-action:disabled               { opacity: 0.35; cursor: not-allowed; }

/* Variants. */
.basket-action-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.basket-action-primary:not(:disabled):hover {
  filter: brightness(1.08);
  background: var(--accent);
  border-color: var(--accent);
}
/* Save is the primary action — it stands out by colour and weight, not by
 * size, so it stays the same dimensions as the rest of the row. */
.basket-action-primary {
  font-weight: 700;
}
/* …and pulses a gold ring whenever the tab has unsaved items, so a
 * cashier who adds a round and turns away gets a clear nudge. The ring
 * is drawn with box-shadow (no layout shift) and the class is only on
 * the button while hasLines && tab-mode (see toggleBasketActions), so
 * once saved it stops — it never becomes wallpaper. */
@keyframes save-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); filter: brightness(1); }
  70%  { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); filter: brightness(1.12); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); filter: brightness(1); }
}
.basket-action-primary.needs-save {
  animation: save-pulse 1.5s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  /* Keep a static ring instead of motion for anyone who's set the OS
   * reduce-motion preference — still obvious, just not animated. */
  .basket-action-primary.needs-save {
    animation: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent);
  }
}

.basket-action-danger {
  color: var(--danger, #ff7676);
  border-color: rgba(255, 118, 118, 0.35);
  background: rgba(255, 118, 118, 0.06);
}
.basket-action-danger:not(:disabled):hover {
  background: rgba(255, 118, 118, 0.14);
  border-color: rgba(255, 118, 118, 0.7);
}

/* Compact icon-only button — used for the ⋯ trigger. Square so it
 * doesn't read as a label. */
.basket-action-icon {
  min-width: 48px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.basket-action-icon[aria-expanded="true"] {
  background: var(--surface3, rgba(255,255,255,0.08));
}

.basket-action-label {
  font-family: var(--display, inherit);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.basket-action-icon-span,
.basket-action .basket-action-icon {        /* icon glyph inside a basket-action button */
  font-size: 19px;
  line-height: 1;
}

/* Active-tabs count pill next to the Tables button in sale mode. */
.basket-tabs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 13px;
  background: var(--accent);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  margin-left: 2px;
}
.basket-tabs-count[hidden] { display: none; }

/* Mode-aware visibility for buttons. data-show-mode says when this
 * button should appear; CSS hides anything that doesn't match the
 * current mode attribute on the basket root. */
.dash-basket[data-mode="sale"] [data-show-mode="tab"],
.dash-basket[data-mode="tab"]  [data-show-mode="sale"] {
  display: none !important;
}

/* =====================================================================
 * ⋯ More popover.
 * ---------------------------------------------------------------------
 * Anchored absolutely to the header. Drops below the ⋯ button,
 * right-aligned so the chevron-style menu opens away from the table
 * (toward the basket). Tap-outside-to-close in JS.
 * ===================================================================== */
.basket-menu-pop {
  position: absolute;
  top: calc(100% - 2px);            /* sit just below the header bottom border */
  right: 8px;
  z-index: 50;
  min-width: 280px;
  max-width: min(320px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45),
              0 2px 4px rgba(0, 0, 0, 0.25);
  padding: 6px;
  /* Slight reveal animation so the popover feels like it's opening
   * from the trigger, not just appearing. */
  animation: basketMenuOpen 0.14s ease-out;
}
.basket-menu-pop[hidden] { display: none; }

@keyframes basketMenuOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.basket-menu-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  width: 100%;
  min-height: 56px;             /* big touch target on tablets */
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.basket-menu-item:not(:disabled):hover  { background: var(--surface2); }
.basket-menu-item:not(:disabled):active { background: var(--surface3, var(--surface2)); }
/* Dim disabled items by COLOUR, not opacity. An opacity < 1 forces the
   button onto its own compositing layer, and on the till tablet's GPU that
   layer renders the text with subpixel ghosting (the label looks doubled,
   worst on the longer labels). Colour-dimming avoids the layer entirely. */
.basket-menu-item:disabled { cursor: not-allowed; }
.basket-menu-item:disabled .basket-menu-icon,
.basket-menu-item:disabled .basket-menu-label,
.basket-menu-item:disabled .basket-menu-sub { color: var(--fg-dim, #a8998a); }

.basket-menu-item .basket-menu-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.9;
}
.basket-menu-item .basket-menu-label {
  grid-row: 1;
  grid-column: 2;
  font-weight: 600;
  font-size: 15px;
}
.basket-menu-item .basket-menu-sub {
  grid-row: 2;
  grid-column: 2;
  font-size: 12px;
  color: var(--fg-dim);
  opacity: 0.85;
}

.basket-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

.basket-lines {
  /* flex: 1 1 0 — grow to fill remaining column space, shrink to 0
   * if needed. The 0 basis (instead of auto) means flex: 1 actually
   * computes from 0 rather than from content size.
   *
   * min-height: 0 defeats Safari's implicit min-height: auto on
   * flex items, which would otherwise refuse to shrink this below
   * content size and push the pay-panel out of the column. This is
   * the key fix for the iPad "gap below CARD button" bug. */
  flex: 1 1 0;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
}

/* Same min-height: 0 fix on the products grid for symmetry — when
 * the products list is taller than the column it will scroll
 * properly instead of pushing the bottom-bar off-screen. */
.dash-buttons { min-height: 0; }
.basket-line {
  padding: 0;                  /* padding moves to .basket-line-fg below */
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  position: relative;          /* anchor for the swipe action drawer */
  overflow: hidden;
  background: var(--surface);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  /* Tap = toggle line selection. Swipe LEFT past 80px = void. */
  transition: background 0.12s;
  z-index: 1;
}
.basket-line:hover { background: var(--bg); }

/* Foreground wrapper: holds the name + price. THIS is what gets
 * translated during a swipe — not the <li> — so the action drawer
 * (a sibling absolutely-positioned underneath) stays fixed in place
 * and is progressively revealed as the foreground slides off.
 *
 * Padding lives here, not on the <li>, so the surface background
 * follows the foreground during the slide. Background is opaque so
 * the drawer never bleeds through except where the foreground has
 * moved away. */
.basket-line-fg {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 6px 16px;
  background: var(--surface);
  position: relative;
  z-index: 1;
  transform: translateX(0);
  /* JS sets transform inline during a swipe (no transition for 1:1
   * tracking). On release JS adds a 180ms transition before the
   * snap-back or slide-off. */
}
.basket-line:hover .basket-line-fg { background: var(--bg); }
.basket-line[data-selected="true"] .basket-line-fg { background: var(--bg); }

/* Selected line: coloured left-edge accent (4px). Sits in the
 * foreground (so it slides with the line) — that's intentional, the
 * selection state shouldn't persist visually if the user starts a
 * void swipe. */
.basket-line[data-selected="true"] .basket-line-fg::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
  z-index: 2;
}

/* Swipe-left void action drawer. Sat absolutely-positioned BEHIND
 * the foreground (z-index 0). At rest, the foreground covers it
 * completely. As the foreground slides left, the drawer is revealed.
 *
 * The drawer doesn't itself animate — only the foreground slides.
 * This is the iOS Mail / Gmail pattern. */
.basket-line-void-action {
  position: absolute;
  inset: 0;
  background: var(--danger, #c44);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 0;
  /* Slightly faded until the user swipes far enough to commit, then
   * snap to full to signal "you'll void if you let go". */
  opacity: 0.6;
  transition: opacity 0.12s;
}
.basket-line[data-swipe-ready="true"] .basket-line-void-action {
  opacity: 1;
}
/* While swiping, allow horizontal pan but block the vertical scroll
 * collision. */
.basket-line[data-swiping="true"] {
  touch-action: pan-x;
}

.basket-line-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.basket-line-price {
  font-family: var(--mono);
  font-weight: 600;
  text-align: right;
}
.basket-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.basket-empty span {
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

.basket-totals {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.basket-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 2px;
}
.basket-row-total {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--display);
  color: var(--accent);
}
/* The left label on the total row carries the item count ("6 items"); keep
   it subordinate to the big accent amount on the right. */
#bt-total-label {
  font-family: var(--body, inherit);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--fg-dim, #8a8a8a);
  align-self: center;
}
.basket-row-due {
  font-size: 14px;
  font-weight: 600;
  color: var(--warn, #f5a623);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.basket-tendered {
  padding: 6px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.basket-tendered-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.basket-tendered-item {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-dim);
}
.basket-tendered-item[data-method="cash"]   { border-color: var(--tip-green, #4caf50); color: var(--tip-green, #4caf50); }
.basket-tendered-item[data-method="card"]   { border-color: var(--accent); color: var(--accent); }
.basket-tendered-item[data-method="member"] { border-color: var(--warn, #f5a623); color: var(--warn, #f5a623); }

/* ----- Integrated payment panel ----- */
.pay-panel {
  border-top: 1px solid var(--border);
  background: var(--bg);
  /* Bottom padding is 0 so .pay-methods sits flush with the bottom of
   * the basket panel — without this, the panel's --bg (cream in cafe
   * theme) shows as a 10px strip below the MEMBER/CASH/CARD row,
   * because .pay-methods is the last child and nothing else lives
   * inside .pay-panel to consume the bottom padding.
   * Home-indicator clearance on PWA iPads with a gesture bar is
   * handled separately by .dash-basket's padding-bottom (line ~753). */
  padding: 10px 12px 0;
  /* Content-sized flex item; sits at the bottom of the flex column
   * because .basket-lines (flex: 1 1 0) absorbs all the slack
   * above it. */
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-pad-grid {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
}

/* The display: shows the current input value, with a subtle hint
   that tells the user what the next button tap will do. When the
   input is empty, the hint reads "Exact" (cash will exact-match)
   or "Qty 1" (product will add one). When non-empty, it reads
   "Pay this" or "Qty {n}" depending on basket state. */
.pay-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}
.pay-display-hint {
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.pay-display-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-left: auto;
}
/* Subtle different colour when in qty-prefix mode vs amount mode */
.pay-display[data-mode="qty"] .pay-display-value {
  color: var(--fg);
}

/* Number pad: 3-column grid, 4 rows of fixed-height keys. */
.pay-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.pay-key {
  height: 60px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--display);
  /* As big as the 60px key allows (v1.5.102, John; was 22px). */
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: var(--fg);
  transition: all 0.08s;
}
.pay-key:active {
  transform: scale(0.95);
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
}
:root[data-theme="light"] .pay-key:active { color: #fff; }
.pay-key-aux {
  font-family: inherit;
  font-size: 26px;
  color: var(--fg-dim);
}

.pay-notes {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  /* Explicit width on the wrapper too — Safari was sometimes computing
   * this as min-content (~30px) when only the children had widths,
   * collapsing the column. */
  width: 72px;
}
.pay-note {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-dim);
  transition: all 0.08s;
}

/* UK polymer note colours — match what staff see in the till drawer
 * so muscle memory works ("the green button = fivers"). Each
 * data-note value gets its own rule directly referencing the staff
 * palette token. We avoid CSS custom-property chains here — Safari
 * has shipped variants where `var(--x, var(--y))` patterns inside
 * other vars resolve as the fallback even when --x is set, leaving
 * the buttons grey on iPad. Plain `border-color: var(--token)` is
 * universally reliable. */
.pay-note[data-note="500"] {
  border-color: var(--staff-teal);
  color: var(--staff-teal);
}
.pay-note[data-note="500"]:active {
  background: var(--staff-teal);
  border-color: var(--staff-teal);
  color: #fff;
  transform: scale(0.95);
}
.pay-note[data-note="1000"] {
  border-color: var(--staff-orange);
  color: var(--staff-orange);
}
.pay-note[data-note="1000"]:active {
  background: var(--staff-orange);
  border-color: var(--staff-orange);
  color: #fff;
  transform: scale(0.95);
}
.pay-note[data-note="2000"] {
  border-color: var(--staff-purple);
  color: var(--staff-purple);
}
.pay-note[data-note="2000"]:active {
  background: var(--staff-purple);
  border-color: var(--staff-purple);
  color: #fff;
  transform: scale(0.95);
}

/* Disabled — used when the keypad is in qty mode (no items in
 * basket, or a measure is pending). The note shortcuts only mean
 * something as payment amounts, so they fade out and stop responding
 * to taps. Visible-but-inert teaches the user what they're for
 * better than removing them entirely. */
.pay-note:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.pay-note:disabled:active {
  transform: none;
  background: var(--surface);
}

/* Method buttons: Member · Cash · Card */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
/* Members off: the Member button is removed, so Cash and Card share the
   row rather than leaving a gap where it used to be. Driven off the
   root attribute set by applyMembers() so there is one source of truth
   for the mode. */
html[data-members="off"] .pay-methods {
  grid-template-columns: repeat(2, 1fr);
}
html[data-members="off"] .pay-method-member {
  display: none;
}
.pay-method {
  position: relative;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--display);
  transition: all 0.1s;
  min-height: 60px;
}
.pay-method-label {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}
/* "Solo busy" / "Solo not available" are longer than CARD; they drop
   back to the old size so they never overflow a narrow button. */
.pay-method-label[data-long="true"] { font-size: 15px; }

/* ---- Member ----
 * Gold (the existing accent) — reinforces "this is the house tender
 * / loyalty programme". */
.pay-method-member:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.pay-method-member:not(:disabled):active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(0.96);
}

/* ---- Cash ----
 * Neutral colour, but as bright as the Card button's green when it's
 * available (v1.5.95, John): the old dim outline read as disabled. */
.pay-method-cash:not(:disabled) {
  border-color: var(--fg);
  border-color: color-mix(in srgb, var(--fg) 78%, var(--surface));
  color: var(--fg);
}
.pay-method-cash:not(:disabled):active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  transform: scale(0.96);
}

/* ---- Card reader status ----
 *
 * The Card button doubles as a live reader-status indicator so staff
 * don't have to tap it to find out the SumUp dongle is offline.
 *
 *   ready   = green border + green dot. Reader paired and online.
 *   offline = red   border + red   dot. Paired but not responding.
 *   unknown = amber border + amber dot. No reader configured.
 *
 * Per-state rules use direct var() references (no chains) for
 * Safari reliability. The button stays tappable in all states; the
 * JS handler shows a toast explaining what's up if not ready. */
.pay-method-card:not(:disabled) {
  /* Default = unknown (amber) until JS sets an explicit state */
  border-color: var(--warn);
  color: var(--warn);
}
.pay-method-card[data-reader-state="ready"]:not(:disabled) {
  border-color: var(--tip-green);
  color: var(--tip-green);
}
.pay-method-card[data-reader-state="ready"]:not(:disabled):active {
  background: var(--tip-green);
  color: #fff;
  border-color: var(--tip-green);
  transform: scale(0.96);
}
.pay-method-card[data-reader-state="offline"]:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
}
.pay-method-card[data-reader-state="offline"]:not(:disabled):active {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  transform: scale(0.96);
}
.pay-method-card[data-reader-state="unknown"]:not(:disabled),
.pay-method-card:not([data-reader-state]):not(:disabled) {
  border-color: var(--warn);
  color: var(--warn);
}
.pay-method-card[data-reader-state="unknown"]:not(:disabled):active,
.pay-method-card:not([data-reader-state]):not(:disabled):active {
  background: var(--warn);
  color: #fff;
  border-color: var(--warn);
  transform: scale(0.96);
}

/* Solo offline: no battery on the button — we can't know it (v1.5.95). */
.pay-method-card[data-reader-state="offline"] .pay-method-card-battery { display: none; }

/* Another operator's card payment is on the only Solo: Card is locked
   and reads "Solo busy" until it succeeds or fails (v1.5.92). */
body[data-solo-busy="true"] .pay-method-card {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(1);
}

/* The status dot was removed in v1.5.93: the button's own colour
   (green ready, red offline, amber not set up) already says it. */

/* Battery indicator next to the dot. 4 small horizontal segments,
 * filled left-to-right based on level. Bars rather than a percent
 * acknowledge that the underlying number is approximate (SumUp's
 * reading lags the Solo's own display by a few percent, our cache
 * is 60s old at worst, so the displayed value can be 3–10% off — a
 * bar that maps a range to the same visual handles that gracefully).
 *
 * Empty span (no segments inside) = no telemetry to show. The :empty
 * selector hides it so we don't leave a hover-target floating where
 * nothing's rendered.
 *
 * The ↻ icon used for firmware-updating is the only text content;
 * .has-text catches it via :has() in browsers that support it.
 *
 * Tooltip with the exact percent is on the span's title attribute,
 * set from JS — staff who want the number can hover.
 */
/* Card-button low-battery / firmware-update indicator.
 *
 * The element is empty unless there's something to warn about (per
 * setCardReaderTelemetry). Showing a permanent percentage or bars
 * was misleading because SumUp's cached value lags reality in the
 * optimistic direction — we'd be telling staff "all good" while the
 * Solo was actually flat. Instead the element only shows up at
 * ≤ 20% (warn) or ≤ 10% (bad), and the 🪫 glyph carries the meaning.
 * Tooltip on the span's title attribute has the percent for anyone
 * who wants to check.
 */
.pay-method-card-battery {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
}
.pay-method-card-battery:empty { display: none; }
.pay-method-card-battery[data-level="warn"] { color: var(--warn); }
.pay-method-card-battery[data-level="bad"]  {
  color: var(--danger);
  animation: card-battery-pulse 1.6s ease-in-out infinite;
}
@keyframes card-battery-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* Card-in-flight visual on the method tile itself: pulse the Card
 * border so staff can see the till's still working on it without us
 * needing a separate panel taking up screen space. The actual status
 * text + spinner + cancel button live in the banner notification.
 * This OVERRIDES the reader-state colour because in-flight is the
 * more important signal in that moment. */
.pay-method-card[data-state="processing"] {
  background: var(--surface);
  border-color: var(--accent);
  animation: card-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
 * MEMBER PICKER (overlay screen)
 *
 * Slides up when "Member" is tapped. Picks who's paying. Tap a member,
 * the payment is applied with the amount in the basket display.
 * ===================================================================== */
[data-screen="member-picker"] {
  background: rgba(0, 0, 0, 0.55);
}
.member-card {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  max-height: 85vh;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.member-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.member-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.member-subtitle {
  margin: 4px 0 0;
  color: var(--fg-dim);
  font-size: 13px;
}
.member-close {
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--fg-dim);
  flex-shrink: 0;
}
.member-close:hover { color: var(--fg); background: var(--bg); }

.member-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.member-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
}
.member-tile:active { transform: scale(0.99); }
.member-tile:hover { border-color: var(--accent); }
.member-tile-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.member-tile-status[data-status="green"] { background: var(--tip-green, #4caf50); }
.member-tile-status[data-status="amber"] { background: var(--warn, #f5a623); }
.member-tile-status[data-status="red"]   { background: var(--danger, #c44); }
.member-tile-name {
  font-size: 16px;
  font-weight: 600;
}
.member-tile-meta {
  font-size: 11px;
  color: var(--fg-dim);
  margin-top: 2px;
}
.member-tile-balance {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}
.member-tile[data-insufficient="true"] .member-tile-balance {
  color: var(--danger, #c44);
}
.member-list-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  list-style: none;
}
.member-hint {
  padding: 12px 24px;
  margin: 0;
  font-size: 11px;
  color: var(--fg-dim);
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* =====================================================================
 * COMPLETE SCREEN — quick celebration after sale completion
 * ===================================================================== */
/* =====================================================================
 * COMPLETE BANNER — non-blocking overlay shown after a sale completes
 * ===================================================================== */
.complete-banner {
  /* Positioned by JS over the basket's lines area (see
     placeCompleteBannerInBasket) — it lives in the basket space, so
     every product tile and the pay pad stay exposed for the next sale.
     No dim: nothing is being blocked. */
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
  padding: 8px;
  box-sizing: border-box;
  animation: complete-banner-in 200ms ease-out;
}
.complete-banner[hidden] { display: none; }

@keyframes complete-banner-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.complete-banner-card {
  /* Re-enable pointer events ONLY on the card. Outside-click then
     means "tap outside the card" which passes through to the
     dashboard AND a body-level handler dismisses the banner. */
  pointer-events: auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  animation: complete-card-in 220ms cubic-bezier(.2,.9,.3,1.2);
}
@keyframes complete-card-in {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1);     opacity: 1; }
}

.complete-banner-total-line {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  margin-top: 2px;
}
.complete-banner-eyebrow {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.complete-banner-receipt {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 4px;
}
.complete-banner-meta {
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 8px;
}

/* CHANGE — the biggest number on the card. Cashier needs to give
   that to the customer; their eye should hit it first. Always shown,
   even when £0.00 (clear signal: "no change to give"). */
.complete-banner-change {
  margin: 4px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px dashed var(--accent);
}
.complete-banner-change-label {
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}
.complete-banner-change-amt {
  font-family: var(--display);
  font-size: clamp(30px, 6vw, 44px);   /* fits the basket column */
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

/* Total — secondary. The basket already showed it; this is just
   confirmation. Inline label to keep vertical compact. */
.complete-banner-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 4px;
  margin-bottom: 14px;
  font-family: var(--mono);
  color: var(--fg-dim);
  font-size: 14px;
}
.complete-banner-total-amt {
  color: var(--fg);
  font-weight: 600;
}

.complete-banner-print {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 8px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
}
:root[data-theme="light"] .complete-banner-print { color: #fff; }
.complete-banner-print:active { transform: scale(0.98); }
.complete-banner-print:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================================
 * PARKED LIST OVERLAY
 * ===================================================================== */
[data-screen="parked-list"] {
  background: rgba(0, 0, 0, 0.5);
}
.parked-card {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 90vw);
  max-height: 80vh;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.parked-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.parked-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.parked-close {
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--fg-dim);
}
.parked-close:hover { color: var(--fg); background: var(--bg); }

.parked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.parked-item {
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.parked-item:hover { background: var(--bg); }
.parked-item:active { transform: scale(0.99); }
.parked-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.parked-item-staff {
  font-weight: 600;
  font-size: 15px;
}
.parked-item-detail {
  font-size: 12px;
  color: var(--fg-dim);
}
.parked-item-total {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.parked-item-recall {
  padding: 8px 16px;
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
:root[data-theme="light"] .parked-item-recall { color: #fff; }
.parked-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  list-style: none;
}
.parked-hint {
  padding: 12px 24px;
  font-size: 12px;
  color: var(--fg-dim);
  border-top: 1px solid var(--border);
  margin: 0;
  font-style: italic;
}

/* =====================================================================
 * BANNER notif — single pill in the top bar (replaces the old
 * top-right toast stack which covered basket UI). Three priority
 * layers driven by the Notif object in till.js:
 *   - data-layer="spinner"   → spinner glyph + text, persistent
 *   - data-layer="transient" → 4-5s auto-dismiss for action feedback
 *   - data-layer="last-sale" → 60s dispute-defence reminder
 * Severity handled via data-severity (info/success/warning/error/
 * last-sale).
 * ===================================================================== */
.banner-notif[data-severity="last-sale"] {
  border-color: var(--accent, #d4a017);
  background: var(--surface);
  cursor: pointer;
  /* Slightly more horizontal room since this is the longest layer. */
  max-width: 560px;
}
.banner-notif[data-severity="last-sale"]:hover {
  background: var(--bg);
}

/* Last-sale row: a single horizontal line of segments separated by
   middots. "LAST" pill on the left, then staff, receipt, total,
   tender breakdown. The change segment is highlighted in accent
   colour so the cashier's eye lands there first during a dispute. */
.last-sale-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
}
.last-sale-print {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent, #d4a017);
  background: transparent;
  color: var(--accent, #d4a017);
  cursor: pointer;
  pointer-events: auto;
}
.last-sale-print:active { background: var(--accent, #d4a017); color: var(--accent-fg, #1a1a1a); }
.last-sale-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #d4a017);
  padding: 2px 6px;
  border: 1px solid var(--accent, #d4a017);
  border-radius: 4px;
  flex-shrink: 0;
}
.last-sale-sep {
  color: var(--fg-dim);
  font-weight: 400;
  flex-shrink: 0;
}
.last-sale-staff {
  font-weight: 700;
  color: var(--fg);
}
.last-sale-receipt {
  font-family: var(--mono);
  color: var(--fg-dim);
  font-size: 11px;
}
.last-sale-total {
  font-weight: 700;
}
.last-sale-tender {
  color: var(--fg);
}
.last-sale-change {
  color: var(--accent, #d4a017);
  font-weight: 800;
}

@keyframes banner-notif-in {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.banner-notif:not([hidden]) {
  animation: banner-notif-in 180ms ease-out;
}

/* =====================================================================
 * TILL JOURNAL — today's sales screen + detail modal
 * =====================================================================
 * Reached by tapping the basket "Sale" title. Full-screen overlay (sits
 * inside the screen stack), back button returns to dashboard. Detail
 * modal sits on top of EVERYTHING via journal-detail-host (separate
 * from the screen stack so it can layer over journal or dashboard).
 */

/* Journal screen — laid out like parked-list but wider for the 3-col
 * sale rows. Centred with a max-width so it doesn't sprawl on the iPad. */
.journal-card {
  max-width: 720px;
  margin: 16px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: calc(100% - 32px);
  overflow: hidden;
}
.journal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.journal-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}
.journal-subtitle {
  font-size: 13px;
  color: var(--text-dim, #888);
  margin-left: auto;
}
.journal-back {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.journal-back:hover { background: var(--accent-soft, rgba(255,255,255,0.05)); }

/* Summary band — 4 stat cells across the top of the list */
.journal-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.journal-summary-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.journal-summary-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim, #888);
}
.journal-summary-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Scrollable list */
.journal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
.journal-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-dim, #888);
  font-size: 14px;
}
.journal-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 80ms;
  gap: 12px;
}
.journal-row:hover { background: var(--accent-soft, rgba(255,255,255,0.03)); }
.journal-row:active { background: var(--accent-soft, rgba(255,255,255,0.06)); }
.journal-row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.journal-row-receipt {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.journal-row-meta {
  font-size: 12px;
  color: var(--text-dim, #888);
  margin-top: 2px;
}
.journal-row-right {
  text-align: right;
  flex: 0 0 auto;
}
.journal-row-total {
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.journal-row-total-refund {
  color: var(--c-warn, #d29);
}
.journal-row-methods {
  font-size: 13px;
  margin-top: 2px;
  letter-spacing: 0.1em;
}
.journal-row-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.06em;
}
.journal-row-badge-refund {
  background: var(--c-warn, #d29);
  color: white;
}
.journal-row-badge-voided {
  background: var(--text-dim, #888);
  color: white;
}

/* Detail modal overlay */
.journal-detail-host {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.journal-detail-host[hidden] { display: none; }
.journal-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.journal-detail-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-dim, #888);
}
.journal-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.journal-detail-receipt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.journal-detail-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.08em;
}
.journal-detail-pill-refund {
  background: var(--c-warn, #d29);
  color: white;
}
.journal-detail-pill-voided {
  background: var(--text-dim, #888);
  color: white;
}
.journal-detail-meta {
  font-size: 12px;
  color: var(--text-dim, #888);
  margin-top: 4px;
}
.journal-detail-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  flex: 0 0 auto;
}
.journal-detail-close:hover { background: var(--accent-soft, rgba(255,255,255,0.05)); }

.journal-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}
.journal-detail-section {
  margin-bottom: 16px;
}
.journal-detail-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim, #888);
  margin-bottom: 6px;
}
.journal-detail-empty {
  font-size: 13px;
  color: var(--text-dim, #888);
  padding: 8px 0;
}
.journal-detail-line {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.journal-detail-line:last-child { border-bottom: none; }
.journal-detail-line-voided {
  text-decoration: line-through;
  opacity: 0.5;
}
.journal-detail-line-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  font-size: 14px;
}
.journal-detail-qty { font-weight: 600; }
.journal-detail-name { min-width: 0; word-wrap: break-word; }
.journal-detail-measure { color: var(--text-dim, #888); font-size: 12px; }
.journal-detail-line-total {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.journal-detail-mod {
  font-size: 12px;
  color: var(--text-dim, #888);
  padding-left: 24px;
  margin-top: 2px;
}
.journal-detail-allergy {
  font-size: 12px;
  color: var(--c-warn, #d29);
  padding-left: 24px;
  margin-top: 2px;
}

/* Totals block */
.journal-detail-totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.journal-detail-totals > div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.journal-detail-grand {
  font-size: 16px !important;
  font-weight: 700;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.journal-detail-grand span {
  font-variant-numeric: tabular-nums;
}

.journal-detail-payment {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.journal-detail-payment:last-child { border-bottom: none; }
.journal-detail-payment-main {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.journal-detail-payment-main span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.journal-detail-payment-sub {
  font-size: 11px;
  color: var(--text-dim, #888);
  margin-top: 2px;
}

/* Action footer */
.journal-detail-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.journal-detail-action {
  appearance: none;
  background: var(--accent, #2a8);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}
.journal-detail-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.journal-detail-action-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: inherit;
}
.journal-detail-action:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* =====================================================================
 * REFUND FLOW — modal in journal-detail-host
 * =====================================================================
 * Same modal frame as the sale-detail card, but with a few refund-specific
 * affordances: line/qty pickers, payment-method tiles, big tick/cross
 * for the result step. */

.refund-card { width: 100%; max-width: 600px; }
.refund-receipt-ref {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim, #888);
  margin-left: 8px;
}

.refund-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.refund-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.refund-line:last-child { border-bottom: none; }
.refund-line-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.refund-line-pick input[type=checkbox] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.refund-line-name { min-width: 0; word-wrap: break-word; }
.refund-line-measure {
  font-size: 12px;
  color: var(--text-dim, #888);
}
.refund-line-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.refund-qty-step {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  color: inherit;
}
.refund-qty-step:hover { background: var(--accent-soft, rgba(255,255,255,0.05)); }
.refund-qty-input {
  width: 50px;
  height: 30px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.refund-qty-of {
  font-size: 12px;
  color: var(--text-dim, #888);
  margin: 0 4px;
}
.refund-line-total {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
  min-width: 60px;
}

.refund-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.refund-total {
  flex: 1;
  font-size: 14px;
  margin-right: 8px;
}
.refund-total strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--c-warn, #d29);
}

.refund-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dim, #888);
}
.refund-reason-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 6px 0 10px;
}
.refund-reason-btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 16px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft, transparent);
  color: inherit;
  cursor: pointer;
  min-height: 60px;
}
.refund-reason-btn.is-picked {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
}
.refund-reason-other { opacity: 0.85; }
.refund-reason {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft, transparent);
  color: inherit;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
}
.refund-hint {
  font-size: 12px;
  color: var(--text-dim, #888);
  margin: 8px 0 0;
}

.refund-pin-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.refund-pin-staff,
.refund-pin-input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft, transparent);
  color: inherit;
  font: inherit;
  font-size: 16px;
  box-sizing: border-box;
}
.refund-pin-staff { flex: 1; }
.refund-pin-input {
  width: 120px;
  text-align: center;
  letter-spacing: 0.3em;
  font-family: monospace;
}
.refund-pin-error {
  margin-top: 8px;
  color: var(--c-warn, #d29);
  font-size: 13px;
  min-height: 18px;
}

/* Step 3 — staff-tile + keypad authoriser. Same affordances as the
 * main login (coloured tiles, 3×4 numeric pad, dot row, auto-advance
 * on 4-digit PIN), packed into the journal-detail modal. The card
 * widens to fit comfortably; on narrow viewports the two columns
 * stack vertically. */
.refund-auth-card { max-width: 760px; }
.refund-auth-body { padding: 16px; }
.refund-auth-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-top: 12px;
  align-items: start;
}
.refund-auth-staff {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  align-content: start;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.refund-auth-staff-loading {
  grid-column: 1 / -1;
  padding: 20px;
  text-align: center;
  color: var(--fg-dim, #888);
  font-size: 14px;
}
.refund-auth-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}
.refund-auth-prompt {
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 12px;
  text-align: center;
  min-height: 20px;
}
.refund-auth-dots {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}
.refund-auth-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 280px;
}
/* Inside the modal the keypad needs slightly smaller keys than the
 * full-screen login, otherwise the card grows past where it fits
 * without scrolling. Same visual language, just compressed. */
.refund-auth-keypad .pin-key {
  height: 64px;
  font-size: 24px;
}
.refund-auth-error {
  margin-top: 12px;
  color: var(--c-warn, #d29);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}
/* Stack columns on narrower viewports — keeps everything reachable
 * on iPad portrait and phone landscape inside the modal. */
@media (max-width: 720px) {
  .refund-auth-grid {
    grid-template-columns: 1fr;
  }
  .refund-auth-pin {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 16px;
  }
  .refund-auth-staff {
    max-height: 200px;
  }
}

.refund-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.refund-method-btn {
  appearance: none;
  background: var(--bg-soft, transparent);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 100ms, background 100ms;
  min-height: 110px;
  text-align: center;
}
.refund-method-btn:hover:not(:disabled) {
  border-color: var(--accent, #d4a017);
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 8%, transparent));
}
.refund-method-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.refund-method-icon { font-size: 28px; }
.refund-method-label { font-weight: 600; font-size: 14px; }
.refund-method-sub { font-size: 11px; color: var(--text-dim, #888); }

.refund-result-ok,
.refund-result-err {
  text-align: center;
  padding: 32px 16px;
}
.refund-result-tick {
  font-size: 64px;
  color: #2a8;
  line-height: 1;
}
.refund-result-x {
  font-size: 64px;
  color: var(--c-warn, #d29);
  line-height: 1;
}
.refund-result-title {
  font-size: 22px;
  font-weight: 700;
  margin: 12px 0 8px;
}
.refund-result-detail {
  font-size: 16px;
  color: var(--text, inherit);
  margin-bottom: 8px;
}
.refund-result-receipt {
  font-size: 13px;
  color: var(--text-dim, #888);
}

/* =====================================================================
 * LOGIN BOTTOM ROW — Cash up + Declare float
 * =====================================================================
 * Two large action buttons that sit below the staff picker / PIN keypad.
 * Both gate on the active session's permissions; the hint text inside
 * the button surfaces who's signed in (or what's missing).
 */
.login-bottom-row {
  display: grid;
  /* Two lines (v1.5.175): the four cash declarations, then Dashboard /
     Add product / Back office. Two columns on a narrow screen. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.login-bottom-btn {
  appearance: none;
  background: var(--surface, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  transition: background 120ms, border-color 120ms, transform 60ms;
}
.login-bottom-btn:hover:not(:disabled),
.login-bottom-btn:focus-visible:not(:disabled) {
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 8%, transparent));
  border-color: var(--accent, #d4a017);
  outline: none;
}
.login-bottom-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.login-bottom-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.login-bottom-icon {
  font-size: 28px;
  flex: 0 0 auto;
}
.login-bottom-label {
  font-family: var(--display, inherit);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 1 1 auto;
}
.login-bottom-hint { display: none; }
.login-bottom-btn:disabled { opacity: 0.35; }
.login-bottom-hint-legacy {
  font-size: 11px;
  color: var(--text-dim, #888);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 0 0 auto;
  text-align: right;
  max-width: 40%;
}

/* Login screen needs to stack: grid (staff/PIN) at top, bottom-row at bottom.
   Critical: this MUST be qualified with [data-active="true"] — otherwise
   the more-specific selector beats the base .screen{display:none} rule
   and the login layout shows on top of every other screen. Spent an
   embarrassing amount of time on that bug; don't repeat it. */
.screen[data-screen="login"][data-active="true"] {
  display: flex;
  flex-direction: column;
}

/* =====================================================================
 * ALLERGEN UI (Phase A — sale-level + per-line)
 * =====================================================================
 * - Sale-level banner above the basket lines (shown when allergy_flag).
 * - Per-line chip row showing each allergen the product contains.
 * - Per-line note ribbon when a SPECIFIC line has its own concern.
 * - "⚠ Allergy alert" button styled as a warning action.
 */

/* Compact tab chip — sits inline in the basket header between Tables and
   Save, carrying this tab's identity (table id + customer). Brand gold so
   it reads as "this is the open tab" at a glance. Tap → tab-actions sheet.
   Visibility is handled by the data-show-mode="tab" rule above. Replaces
   the old full-width yellow banner that used to sit below the header. */
.basket-tab-chip {
  appearance: none;
  border: 1px solid var(--accent, #d4a017);
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  font: inherit;
  cursor: pointer;
  min-height: 48px;
  max-width: 230px;
  /* Content-sized, but allowed to shrink (customer name ellipsises) so the
   * header row never overflows the basket column on a narrow till. */
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: filter 0.12s, transform 0.06s;
  overflow: hidden;
}
.basket-tab-chip:hover  { filter: brightness(1.06); }
.basket-tab-chip:active { transform: translateY(1px); }
/* Two lines stacked: table id / name on top, the other below. Both stay
   readable in a narrow chip — far more robust than cramming onto one line,
   where a named table could squeeze the number out entirely. */
.basket-tab-chip-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 0 1 auto;
  line-height: 1.05;
}
.basket-tab-chip-table {
  font-family: var(--display, sans-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.basket-tab-chip-cust {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.basket-tab-chip-cust:empty { display: none; }
.basket-tab-chip-chevron {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Hold-to-clear affordance. Clear now sits next to Save, so a quick tap is
   inert (shows a hint) — you press and hold ~600ms and a red fill sweeps
   the button to confirm. The fill is an ::after so it never shifts layout. */
.basket-action[data-tool="clear"] { position: relative; overflow: hidden; }
.basket-action[data-tool="clear"]::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(192, 57, 43, 0.35);
  pointer-events: none;
}
.basket-action[data-tool="clear"].holding::after {
  animation: clear-hold 600ms linear forwards;
}
@keyframes clear-hold { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .basket-action[data-tool="clear"].holding::after {
    animation: none;
    width: 100%;
    background: rgba(192, 57, 43, 0.18);
  }
}

.basket-allergy-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 12px;
  padding: 10px 14px;
  background: #c0392b;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.4);
  /* Pulse so it's hard to miss when first shown. Single iteration —
     after that it's prominent enough on its own without strobing. */
  animation: allergy-banner-pulse 0.6s ease-out 2;
}
@keyframes allergy-banner-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0.6); }
}
.basket-allergy-banner[hidden] { display: none; }
.basket-allergy-banner-icon {
  font-size: 28px;
  line-height: 1;
}
.basket-allergy-banner-body {
  flex: 1;
  min-width: 0;
}
.basket-allergy-banner-title {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.basket-allergy-banner-note {
  font-size: 13px;
  font-weight: 400;
  margin-top: 2px;
  opacity: 0.95;
  word-break: break-word;
}
.basket-allergy-banner-edit {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.basket-allergy-banner-edit:active {
  background: rgba(255, 255, 255, 0.3);
}

/* Per-line allergy concern ribbon — shown when l.allergy_flag is set
 * (separate from the chip row above; this is a SPECIFIC concern flagged
 * by staff for THIS line, e.g. "no olives"). */
.basket-line-line-allergy {
  margin-top: 4px;
  padding: 4px 8px;
  background: rgba(192, 57, 43, 0.15);
  border-left: 3px solid #c0392b;
  border-radius: 3px;
  font-size: 12px;
  color: #c0392b;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.basket-line-allergy-clear {
  border: 1px solid transparent;
  background: transparent;
  color: #c0392b;
  font-size: 16px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}
.basket-line-allergy-clear:hover {
  background: rgba(192, 57, 43, 0.25);
  border-color: rgba(192, 57, 43, 0.5);
}
.basket-line-allergy-clear:active {
  background: rgba(192, 57, 43, 0.4);
}

/* "⚠ Allergy alert" button — distinct from the other basket actions
 * because it has compliance teeth. Orange-warning when off; full-red
 * with active state via the .is-on class (paintAllergyBanner sets it). */
.basket-action[data-tool="allergy"] {
  background: #f39c12;
  color: #fff;
  font-weight: 600;
}
.basket-action[data-tool="allergy"]:disabled {
  opacity: 0.4;
}
.basket-action[data-tool="allergy"]:active {
  background: #e67e22;
}

/* =====================================================================
 * TABS — list overlay + tab detail screen
 * ===================================================================== */

/* Tabs counter badge on the basket-header Tabs button */
.basket-tabs-count {
  display: inline-block;
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  min-width: 18px;
  padding: 1px 5px;
  text-align: center;
  margin-left: 4px;
  vertical-align: top;
}
.basket-tabs-count[hidden] { display: none; }

/* Header action row in the tabs-list overlay */
.tabs-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Per-row tab status badges */
.tab-status-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.tab-status-bill { background: #d97706; color: #fff; }
.tab-status-part { background: #c0392b; color: #fff; }

/* Tab detail screen */
.tab-detail-card {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.tab-detail-meta {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--fg-dim, #999);
  background: var(--surface, rgba(255,255,255,0.03));
}
.tab-detail-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: 50vh;
}
.tab-detail-empty {
  padding: 24px;
  text-align: center;
  color: var(--fg-dim);
}
.tab-detail-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #333);
}
.tab-detail-qty {
  min-width: 32px;
  font-weight: 600;
  color: var(--accent);
}
.tab-detail-name {
  flex: 1;
}
.tab-detail-price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tab-detail-totals {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 18px;
  background: var(--surface);
}
.tab-detail-totals > div {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.tab-detail-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.tab-detail-actions .parked-action {
  flex: 1;
}
.parked-action-primary {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  font-weight: 700;
}
.parked-action-danger {
  background: #c0392b;
  color: #fff;
}

/* When the basket is in tab mode, the title gets a distinct accent
   so the cashier knows their next product tap goes to a tab not a
   sale. Tap the title to open the tab's detail (Print bill, Void). */
.basket-title-tab-mode {
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 15%, transparent));
}
.basket-title-tab-mode .basket-title {
  color: var(--accent, #d4a017);
  font-weight: 700;
}

/* Seen Today tiles in the member picker.
   Three states beyond the existing active/idle dots: 'gift' for blank
   cards / unclaimed gift balances, 'warn' for lockout cases (id
   check, deactivated, suspended), 'muted' for everything else read-only. */
.member-tile-status[data-status="gift"]  { background: var(--accent, #d4a017); }
.member-tile-status[data-status="warn"]  { background: #d97706; }
.member-tile-status[data-status="muted"] { background: var(--fg-dim, #777); }

/* Dim read-only tiles so the cashier sees at a glance they're not
   the primary action. They still render so the cashier knows the
   card has been seen. */
.seen-tile[data-dim="true"] {
  opacity: 0.55;
}
.seen-tile[data-dim="true"]:hover {
  opacity: 0.7;
}

/* Right-column label uses tabular-nums for balances, but for the
   "+ Gift" call-to-action it should pop in the accent colour. */
.seen-tile[data-category="unregistered"] .member-tile-balance {
  color: var(--accent, #d4a017);
  font-weight: 700;
}

/* Member tile structural row — body in middle, balance + secondary
   action stack on the right. Old layout had a single right column;
   adding a "+ Top up" mini-button alongside the balance. */
.member-tile-body { flex: 1; min-width: 0; overflow: hidden; }
.member-tile-secondary {
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  white-space: nowrap;
  /* Tap target: the tile itself is the primary action; this button
     stops propagation in JS so the cashier can hit either without
     ambiguity. */
}
.member-tile-secondary:hover {
  background: var(--accent-strong, #b88c14);
}
.member-tile-secondary:active {
  transform: scale(0.97);
}

/* ---------------------------------------------------------------------
 * Tools tray — basket header "⋯" button + tile list overlay.
 * --------------------------------------------------------------------- */
.basket-tools-btn {
  /* Same shape as the other basket-title-btn buttons but icon-only,
     narrower. Plays the role of "more / overflow" indicator without
     drawing attention during normal service. */
  padding-left: 12px;
  padding-right: 12px;
  min-width: 0;
}

.tools-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

/* Tab-actions sheet: cap to the stage (80vh can exceed the space below the
   app bar) and let the tool list scroll inside, so the bottom action
   (Void) is always reachable — on the iPad it was falling off the screen. */
.tab-actions-card {
  max-height: calc(100% - 16px);
}
.tab-actions-card .tools-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
/* Compact tiles for this sheet only (7 actions): smaller icon + tighter
   padding so the whole list fits the iPad without scrolling. Other tools
   menus keep the roomier default. overflow-y:auto above stays as a safety
   net for very short screens. */
.tab-actions-card .tools-tile {
  padding: 10px 18px;
  gap: 12px;
}
.tab-actions-card .tools-tile-icon {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  border-radius: 10px;
}
.tab-actions-card .tools-tile-title {
  font-size: 16px;
  margin-bottom: 1px;
}
.tab-actions-card .tools-tile-meta {
  font-size: 12.5px;
}

.tools-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.tools-tile:hover { background: var(--surface, rgba(255,255,255,0.03)); }
.tools-tile:active { transform: scale(0.99); }

.tools-tile-icon {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 15%, transparent));
  color: var(--accent, #d4a017);
  border-radius: 12px;
  font-size: 22px;
  font-weight: 700;
}

.tools-tile-body { flex: 1; min-width: 0; }
.tools-tile-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}
.tools-tile-meta {
  font-size: 13px;
  color: var(--fg-dim, #999);
}

/* ---------------------------------------------------------------------
 * Misc item modal
 * --------------------------------------------------------------------- */
.misc-modal-card {
  max-width: 560px;
}
/* ─── Member top-up keypad ─────────────────────────────────────────
   Reuses .pay-pad / .pay-key for visual parity with the payment
   numpad; only the modal-specific layout + the big amount display
   are defined here. */
.topup-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto;
}
.topup-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  padding: 14px 0 6px;
  font-family: var(--display);
  color: var(--fg);
}
.topup-display-currency { font-size: 28px; color: var(--fg-dim); }
.topup-display-value    { font-size: 44px; font-weight: 700; letter-spacing: 0.5px; }
.topup-hint { text-align: center; margin: 0; }
.topup-hint.danger { color: var(--danger, #c0392b); }
/* Notes as a horizontal row under the pad (the pay-pad version is a
   vertical side strip; here they sit full-width). */
.topup-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: none;
  gap: 4px;
}
.topup-notes .pay-note {
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}
.topup-notes .pay-note:active {
  transform: scale(0.95);
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
}
.misc-form {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.misc-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--fg-dim, #999);
}
.misc-label > span:first-child {
  font-weight: 600;
  color: var(--fg, #ddd);
}
.misc-label input,
.misc-label select {
  font-size: 17px;
  padding: 12px 14px;
  background: var(--surface, rgba(255,255,255,0.04));
  color: var(--fg, #ddd);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  outline: none;
}
.misc-label input:focus,
.misc-label select:focus {
  border-color: var(--accent, #d4a017);
}
.misc-hint {
  font-size: 12px;
  color: var(--fg-dim, #999);
}
.misc-error {
  background: rgba(192, 57, 43, 0.18);
  border-left: 4px solid #c0392b;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  color: #f3a89e;
}
.misc-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------
 * Visual table plan
 * --------------------------------------------------------------------- */
.table-plan-card {
  max-width: 920px;
  width: 95vw;
  display: flex;
  flex-direction: column;
  /* Pin to the stage top & bottom (8px inset) instead of centring with a
     max-height. This gives the card a DEFINITE height for its flex children
     to share — the canvas holds only absolutely-positioned tiles (no
     intrinsic height), so without a definite parent height it collapses to
     nothing. left:50% + translateX keeps it horizontally centred. */
  top: 8px;
  bottom: 8px;
  transform: translateX(-50%);
  max-height: none;
}
.table-plan-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px 16px 8px;
}

.table-plan-area + .table-plan-area {
  margin-top: 24px;
}
.table-plan-area-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim, #999);
  margin: 0 0 10px 4px;
}

/* Area tab strip — only rendered when there's >1 area. Sits at the
   top of #table-plan-body, lets cashier switch areas with a tap
   instead of scrolling through a long stack. */
.table-plan-area-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.table-plan-area-tab {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--border, #2a2a2a);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.table-plan-area-tab:hover {
  background: var(--surface, rgba(255, 255, 255, 0.04));
}
.table-plan-area-tab.active {
  border-color: var(--accent, #d4a017);
  background: var(--accent, #d4a017);
  color: var(--bg, #1a1a1a);
}
.table-plan-area-tab-count {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.7;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.15);
}
.table-plan-area-tab.active .table-plan-area-tab-count {
  background: rgba(0, 0, 0, 0.2);
  opacity: 1;
}

/* Floor-plan canvas: positioned-tile parent for the new layout mode.
   Fills the card body (no fixed aspect) so it uses the whole screen.
   Tables are positioned/sized as a % of the canvas, so the same layout
   shows on admin and till in identical relative positions regardless of
   each screen's shape. Themed --fp-* defaults work in dark/light. */
.table-plan-canvas {
  position: relative;
  width: 100%;
  /* Flex to fill the body — header + legend take their natural height and
     the canvas gets the rest, so the whole card fits its container with no
     scroll and no clipped header, on any device. Tables are %-positioned
     with no min pixel size, so any resulting height renders overlap-free. */
  flex: 1 1 auto;
  min-height: 0;
  background:
    linear-gradient(to right,  var(--border, #2a2a2a) 1px, transparent 1px) 0 0 / 2% 3.2% repeat,
    var(--surface, rgba(255, 255, 255, 0.02));
  background-blend-mode: overlay;
  border-radius: 12px;
  border: 1px solid var(--border, #2a2a2a);
  overflow: hidden;
}

.table-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.table-plan-tile {
  /* Touch target: ~110px tall, large enough that a thumb hit on a
     busy tablet is reliable. Padding tuned so a long table_name
     doesn't push the tile awkwardly. */
  min-height: 110px;
  padding: 14px 12px 10px;
  border-radius: 12px;
  border: 2px solid var(--border, #2a2a2a);
  background: var(--surface, rgba(255, 255, 255, 0.04));
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.05s, background 0.1s;
}
/* Positioned mode: absolute placement on the canvas, centre-anchored.
   Width/height are smaller than the grid version because there's
   typically less room when tables are spread over a canvas. */
.table-plan-tile.positioned {
  position: absolute;
  /* Size comes from inline width/height (% of canvas) set per table in
     renderTableTile; these are fallbacks for any tile rendered without
     a size. */
  width: 110px;
  min-height: 0;
  transform: translate(-50%, -50%);
  margin: 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.table-plan-tile.shape-circle {
  border-radius: 50%;
}
.table-plan-tile.shape-circle.positioned {
  width: 100px;
  height: 100px;
  min-height: 0;
}
.table-plan-tile:hover {
  background: var(--surface, rgba(255,255,255,0.07));
}
.table-plan-tile:active {
  transform: scale(0.97);
}
.table-plan-tile.positioned:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.table-plan-tile-code {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.table-plan-tile-name {
  font-size: 12px;
  color: var(--fg-dim, #999);
}
.table-plan-tile-meta {
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
  text-align: center;
}

/* Status colours — coordinated with the legend dots below.
   Available: neutral border, transparent fill (default).
   Open: accent gold — drinks-only tab, normal in-progress.
   Food ordered: orange — kitchen is working, attention soon.
   Food sent: green — food delivered, tab settling.
   Part paid: purple — partial payment recorded.
   Status priorities are visual: food ordered reads as the most
   urgent because that's where time-sensitive action lives. */
.table-plan-tile[data-status="open"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent, #d4a017);
}
.table-plan-tile[data-status="open"] .table-plan-tile-code,
.table-plan-tile[data-status="open"] .table-plan-tile-meta {
  color: var(--accent, #d4a017);
}

/* Empty open tab (v1.5.235): dashed, so it reads as "taken but nothing
   on it" — not free, and not a real order either. */
.table-plan-tile[data-status="empty"] {
  border-style: dashed;
  border-color: var(--accent, #d4a017);
}
.table-plan-tile[data-status="empty"] .table-plan-tile-meta { color: var(--accent, #d4a017); }

/* PAID badge — café pay-at-order indicator. Sits top-left so it
   doesn't clash with the "✓ Sent" pill in top-right. Teal-leaning blue
   is distinct from any food-state colour (orange, cyan, green, gold).
   Compact pill so it sits comfortably alongside the table code. */
.table-plan-tile-paid-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;          /* informational only — no tap target */
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
  background: rgba(217, 119, 6, 0.22);
  border-color: #d97706;
}
.table-plan-tile[data-status="food_ordered"] .table-plan-tile-code,
.table-plan-tile[data-status="food_ordered"] .table-plan-tile-meta {
  color: #f59e0b;
}

/* Food ready — kitchen called Away on the KDS. Cyan, pulsing
   gently. Most-urgent visual on the floor plan; FOH should glance
   over and see "table 4 needs collection NOW". */
.table-plan-tile[data-status="food_ready"] {
  background: rgba(6, 182, 212, 0.25);
  border-color: #06b6d4;
  animation: tile-ready-pulse 1.6s ease-in-out infinite;
}
.table-plan-tile[data-status="food_ready"] .table-plan-tile-code,
.table-plan-tile[data-status="food_ready"] .table-plan-tile-meta {
  color: #67e8f9;
}
@keyframes tile-ready-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(6, 182, 212, 0); }
}

.table-plan-tile[data-status="food_sent"] {
  background: rgba(34, 197, 94, 0.18);
  border-color: #22c55e;
}
.table-plan-tile[data-status="food_sent"] .table-plan-tile-code,
.table-plan-tile[data-status="food_sent"] .table-plan-tile-meta {
  color: #4ade80;
}

.table-plan-tile[data-status="part_paid"] {
  background: rgba(168, 85, 247, 0.22);
  border-color: #a855f7;
}
.table-plan-tile[data-status="part_paid"] .table-plan-tile-code,
.table-plan-tile[data-status="part_paid"] .table-plan-tile-meta {
  color: #c084fc;
}

/* Timer-band colours on the meta line. .timer-ok inherits the
 * status colour (food_ordered amber). .timer-warn deepens. .timer-bad
 * pulls red so a 25-minute wait can't be missed. The colour wins over
 * the per-status meta colour above because of specificity (.meta + class). */
.table-plan-tile-meta.timer-warn { color: #fb923c !important; font-weight: 700; }
.table-plan-tile-meta.timer-bad  { color: #f87171 !important; font-weight: 700; }

/* Mark-sent pill — appears on Food-ordered tiles. Top-right corner,
 * touch-sized, tap stops propagation so the tile-tap (enter tab)
 * doesn't also fire. The .busy class fades + locks during the
 * server round-trip. */
.table-plan-tile {
  position: relative;        /* anchor for the pill */
}
.table-plan-tile-mark-sent {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  background: #22c55e;
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.06s, filter 0.12s;
  z-index: 2;                /* over the tile content */
}
.table-plan-tile-mark-sent:hover  { filter: brightness(1.1); }
.table-plan-tile-mark-sent:active { transform: scale(0.95); }
.table-plan-tile-mark-sent.busy   { opacity: 0.5; }

/* Legend strip at the bottom of the plan card. */
.table-plan-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border, #2a2a2a);
  font-size: 12px;
  color: var(--fg-dim, #999);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 2px solid;
}
.legend-available    { background: transparent;             border-color: var(--border, #2a2a2a); }
.legend-open         { background: var(--accent, #d4a017);  border-color: var(--accent, #d4a017); }
.legend-food-ordered { background: #d97706;                 border-color: #d97706; }
.legend-food-ready   { background: #06b6d4;                 border-color: #06b6d4; }
.legend-food-sent    { background: #22c55e;                 border-color: #22c55e; }
.legend-part         { background: #a855f7;                 border-color: #a855f7; }

/* ---------------------------------------------------------------------
 * Tab actions sheet — danger tile colour for Void.
 * --------------------------------------------------------------------- */
.tools-tile-danger .tools-tile-icon {
  background: rgba(192, 57, 43, 0.18);
  color: #f3a89e;
}
.tools-tile-danger .tools-tile-title {
  color: #f3a89e;
}

/* ---------------------------------------------------------------------
 * Generic overlay used by the merge target picker (and any future
 * inline pickers that need a modal-y card without a full screen swap).
 * --------------------------------------------------------------------- */
.till-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.till-overlay-card {
  background: var(--bg, #1a1a1a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.till-overlay-card .parked-list {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* Multi-tab table tiles (Bar/Ledge/Takeaway) — give them a subtle
   double-border cue so cashiers can tell at a glance these hold
   many concurrent tabs versus a single-tab dining table. */
.table-plan-tile.multi-tab {
  border-style: double;
  border-width: 4px;
}

/* "+ New tab on this table" button injected at the top of the
   tabs-list when entering from the floor-plan tab picker. Sized
   to read as a CTA (taller, accent border) so it stands apart
   from the existing-tab rows. */
.tabs-list-new {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.tabs-list-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 2px dashed var(--accent, #d4a017);
  background: transparent;
  color: var(--accent, #d4a017);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.tabs-list-new-btn:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tabs-list-new-plus {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────
   Discount modal — type buttons + value input
   ───────────────────────────────────────────────────────────────── */

.discount-type-row {
  display: grid;
  /* Three buttons: percentage, fixed, staff. Equal widths. */
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.discount-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.discount-type-btn:hover {
  border-color: var(--accent);
}
.discount-type-btn.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.discount-type-icon {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--display, sans-serif);
  line-height: 1;
}
.discount-type-label {
  font-size: 13px;
}

/* Current-discount banner — appears at the top of the discount modal
 * when a discount is already on the sale. Lets staff fix a wrong
 * button press without rewriting the whole sale. Visually distinct
 * (warning tone) so it doesn't get tab-bypassed when applying a
 * second discount on top — currently the backend overwrites, which
 * is fine, but the banner makes the existing state visible first. */
.discount-current-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 0 14px 0;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.discount-current-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;          /* lets long reason text ellipsise */
}
.discount-current-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.discount-current-value {
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────
   Allergen popup — list of allergens for a product
   ───────────────────────────────────────────────────────────────── */

/* ─── Allergy alert modal ──────────────────────────────────────────
   Modal-driven sale/tab-level allergy alert. 14 statutory allergens
   as toggle chips + Other free-text. Replaces the legacy native
   prompt() flow. */

.allergy-alert-card {
  max-width: 640px;
  width: 100%;
}
.allergy-alert-body {
  padding: 14px 20px 4px;
}
.allergy-alert-help {
  margin: 0 0 14px;
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.5;
}
.allergy-alert-help strong { color: var(--fg, #f5f5f5); font-weight: 700; }

.allergy-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.allergy-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 14px;
  min-height: 52px;
  border: 2px solid var(--border, #334155);
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.allergy-chip:hover  { border-color: var(--fg-dim); }
.allergy-chip:active { transform: scale(0.97); }
.allergy-chip[data-active="true"] {
  /* Use the per-allergen colour from the catalogue as a tinted
     background + bold border so the cashier can see at a glance
     which allergens are flagged. */
  border-color: var(--chip-color, var(--accent, #d4a017));
  background: color-mix(in srgb, var(--chip-color, #d4a017) 22%, transparent);
}
.allergy-chip-icon {
  font-size: 20px;
  line-height: 1;
}
.allergy-chip-label {
  flex: 1;
}

.allergy-other-label {
  display: block;
  margin: 8px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.allergy-other-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border, #334155);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  font-family: inherit;
  font-size: 16px;
}
.allergy-other-input:focus {
  outline: none;
  border-color: var(--accent, #d4a017);
}

.allergy-alert-foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px 20px;
  align-items: center;
}
.allergy-alert-foot button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
}
.allergy-alert-clear {
  background: transparent;
  color: var(--danger, #cf5c5c);
  border-color: var(--danger, #cf5c5c);
  margin-right: auto;
}
.allergy-alert-clear:hover { background: color-mix(in srgb, var(--danger, #cf5c5c) 12%, transparent); }
.allergy-alert-cancel {
  background: transparent;
  color: var(--fg, #f5f5f5);
  border-color: var(--border, #334155);
}
.allergy-alert-cancel:hover { background: var(--bg-2, #1a2438); }
.allergy-alert-save {
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent, #d4a017);
  font-weight: 700;
}
.allergy-alert-save:hover { filter: brightness(1.08); }
.allergy-alert-save:active { transform: scale(0.98); }

/* Allergen popup — used by product-tile long-press to show what
   allergens a product contains BEFORE adding to basket. Same modal
   pattern, narrower card. */
.allergen-popup-card {
  max-width: 560px;
}


/* ─── Line note editor ────────────────────────────────────────────
   Single tap on a basket line opens this. Edits prep-station note
   that prints under the item on the kitchen ticket + appears under
   the item on the KDS card. */

.line-note-card {
  max-width: 540px;
  width: 100%;
}
.line-note-body {
  padding: 16px 20px;
}
.line-note-help {
  margin: 0 0 12px;
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.4;
}
.line-note-input {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 2px solid var(--border, #334155);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  font-family: inherit;
  font-size: 17px;          /* large enough to read from the till's typical viewing distance */
  line-height: 1.4;
  resize: vertical;
}
.line-note-input:focus {
  outline: none;
  border-color: var(--accent, #d4a017);
}
.line-note-counter {
  margin-top: 6px;
  text-align: right;
  font-size: 12px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}

.line-note-foot {
  display: flex;
  gap: 10px;
  padding: 12px 20px 20px;
  align-items: center;
}
.line-note-foot button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
}
.line-note-clear {
  background: transparent;
  color: var(--fg-dim);
  border-color: var(--border, #334155);
  margin-right: auto;       /* pushes Cancel/Save to the right */
}
.line-note-clear:hover { color: var(--danger, #cf5c5c); border-color: var(--danger, #cf5c5c); }
.line-note-cancel {
  background: transparent;
  color: var(--fg, #f5f5f5);
  border-color: var(--border, #334155);
}
.line-note-cancel:hover { background: var(--bg-2, #1a2438); }
.line-note-save {
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent, #d4a017);
  font-weight: 700;
}
.line-note-save:hover { filter: brightness(1.08); }
.line-note-save:active { transform: scale(0.98); }

/* ============== LINE DISCOUNT EDITOR ============== */
/* Mirrors the line-note-editor visual language — same parked-card
   chrome, same footer button family — so the cashier doesn't have
   to learn two screens. */
.line-discount-card {
  /* Inherits .parked-card; nothing override-worthy. The card is
     comfortably wide enough for the type toggle + value field at the
     iPad-Mini-portrait viewport, our tightest till target. */
}
.line-discount-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.line-discount-current {
  margin: 0;
  font-size: 13px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.line-discount-type {
  display: flex;
  gap: 8px;
}
.line-discount-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--fg);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.line-discount-type-btn:hover  { border-color: var(--accent); }
.line-discount-type-btn:active { transform: scale(0.97); }
.line-discount-type-btn[data-active="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.line-discount-type-icon {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--display, sans-serif);
  line-height: 1;
}
.line-discount-type-label {
  font-size: 13px;
  font-weight: 600;
}
.line-discount-value-label,
.line-discount-reason-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: -4px;     /* tight to its input */
}
.line-discount-value,
.line-discount-reason-note {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--fg);
  font-family: inherit;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.line-discount-reason-note { font-size: 16px; font-variant-numeric: normal; }
.line-discount-value:focus,
.line-discount-reason-note:focus {
  outline: none;
  border-color: var(--accent);
}

/* Reason chips — text-only chips, 2-3 columns depending on width.
   Selection toggles data-active="true" via JS; styling matches the
   allergy-chip pattern so the cashier reads it as the same UI idiom. */
.line-discount-reason-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.line-discount-chip {
  appearance: none;
  padding: 10px 12px;
  min-height: 44px;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--fg);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.line-discount-chip:active { transform: scale(0.97); }
.line-discount-chip[data-active="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.line-discount-hint {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  min-height: 1.4em;          /* reserves space so layout doesn't jump */
  color: var(--fg-dim);
}
.line-discount-hint[data-state="ok"]    { color: var(--tip-green, #2ecc71); }
.line-discount-hint[data-state="warn"]  { color: var(--warn, #e8a020); }
.line-discount-hint[data-state="error"] { color: var(--danger, #cf5c5c); }

.line-discount-foot {
  display: flex;
  gap: 10px;
  padding: 12px 20px 20px;
  align-items: center;
}
.line-discount-foot button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
}
.line-discount-clear {
  background: transparent;
  color: var(--danger, #cf5c5c);
  border-color: var(--danger, #cf5c5c);
  margin-right: auto;
}
.line-discount-clear:hover:not([disabled]) {
  background: color-mix(in srgb, var(--danger, #cf5c5c) 12%, transparent);
}
.line-discount-clear[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.line-discount-cancel {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.line-discount-apply {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
  font-weight: 700;
}
.line-discount-apply:hover  { filter: brightness(1.08); }
.line-discount-apply:active { transform: scale(0.98); }

/* ============== BASKET LINE DISCOUNT BADGE ==============
   When a line carries a manual discount, the original price gets
   a strikethrough and a small "−£X.XX" pill appears beneath. The
   pill is muted (gold) rather than red so it reads as an applied
   benefit, not an error. */
.basket-line[data-line-discounted="true"] .basket-line-price {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: var(--fg-dim);
  opacity: 0.7;
}
.basket-line-noteline .basket-line-name { color: var(--fg-dim); font-style: italic; }
.basket-line-salediscount .basket-line-name { color: var(--accent); }
.basket-line-salediscount .basket-line-price { color: var(--accent); font-weight: 700; }
.basket-line-discount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.basket-line-discount-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.basket-line-discount-net {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}
.basket-line-discount-reason {
  font-size: 12px;
  color: var(--fg-dim);
  font-style: italic;
}

/* ============== LINE ACTIONS DRAWER ==============
   Long-press on a basket line opens this — a bottom-sheet with a
   stacked list of action tiles. Each tile is finger-sized (~60px) and
   has icon + label + dynamic meta showing the line's current state
   ("Current: −£2.00" on the discount tile when one's applied, etc).

   Visually anchored to the bottom of the screen with rounded top
   corners — the bottom-sheet idiom that mobile users recognise. The
   screen itself dims via rgba backdrop so it reads as an overlay
   even though the screen model swaps it in over the dashboard
   wholesale. */
[data-screen="line-actions"] {
  background: rgba(0, 0, 0, 0.5);
}
.line-actions-card {
  /* Centered modal, consistent with the other parked-card dialogs
     (inherits parked-card's top/left:50% + translate(-50%,-50%)).
     On very narrow screens it drops to a thumb-reachable bottom sheet —
     see the media query below. */
  width: min(560px, 92vw);
  max-height: 88vh;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
/* Rise + fade in from just below centre. Ties to data-active="true" so
   it re-fires on every open (each show() flips the attribute fresh). */
[data-screen="line-actions"][data-active="true"] .line-actions-card {
  animation: line-actions-rise 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes line-actions-rise {
  from { transform: translate(-50%, calc(-50% + 16px)); opacity: 0; }
  to   { transform: translate(-50%, -50%);              opacity: 1; }
}
@keyframes line-actions-slide-up {
  from { transform: translate(-50%, 100%); opacity: 0.4; }
  to   { transform: translate(-50%, 0);    opacity: 1;   }
}
/* Narrow screens (phones): revert to a bottom sheet within thumb reach. */
@media (max-width: 600px) {
  .line-actions-card {
    top: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: min(560px, 100vw);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  }
  [data-screen="line-actions"][data-active="true"] .line-actions-card {
    animation: line-actions-slide-up 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .line-actions-grabber { display: block; }
}

/* Pull-tab grabber at the top edge — pure visual affordance. The
   sheet still closes via the × button or Cancel; no actual drag-to-
   dismiss gesture wired (would require its own pointer handling). */
.line-actions-grabber {
  display: none;   /* centred modal: no bottom-sheet drag affordance */
  width: 40px;
  height: 4px;
  background: var(--border2, #b8b3a8);
  border-radius: 999px;
  margin: 8px auto 0;
  opacity: 0.7;
}
.line-actions-list {
  list-style: none;
  margin: 0;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.line-actions-list li[hidden] { display: none; }
.line-actions-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--fg);
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.line-actions-tile:hover  { border-color: var(--accent); }
.line-actions-tile:active { transform: scale(0.98); }
.line-actions-tile-danger {
  /* "Clear" actions — non-destructive but distinct from primary
     tiles. Outlined in danger colour but not filled. */
  border-color: var(--danger, #cf5c5c);
  color: var(--danger, #cf5c5c);
}
.line-actions-tile-danger:hover {
  background: color-mix(in srgb, var(--danger, #cf5c5c) 8%, transparent);
}
.line-actions-tile-destructive {
  /* Void — fully destructive (line disappears from basket). Filled
     red bg so the cashier can't claim they didn't see it coming. */
  background: color-mix(in srgb, var(--danger, #cf5c5c) 14%, transparent);
  border-color: var(--danger, #cf5c5c);
  color: var(--danger, #cf5c5c);
}
.line-actions-tile-destructive:hover {
  background: color-mix(in srgb, var(--danger, #cf5c5c) 22%, transparent);
}
.line-actions-icon {
  font-size: 22px;
  font-weight: 700;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.line-actions-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.line-actions-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.line-actions-meta {
  font-size: 12px;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-actions-tile-danger      .line-actions-meta,
.line-actions-tile-destructive .line-actions-meta {
  color: inherit;
  opacity: 0.85;
}
.line-actions-foot {
  display: flex;
  gap: 10px;
  padding: 12px 20px 20px;
  align-items: center;
  justify-content: flex-end;
}
.line-actions-cancel {
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--fg);
}
.line-actions-cancel:hover { border-color: var(--fg-dim); }

/* ============== KITCHEN HISTORY (cafe till) ==============
   "What just went out the kitchen?" lookup, accessible from the
   table-plan header. Centered modal — same parked-card chrome as
   the other on-till modals. Rows scan top-to-bottom newest-first;
   each row shows table label, customer, sent time, then the line
   summary as inline chips so a quick eye-scan over the modal answers
   "did T3 get their food?" without expanding anything. */
.kitchen-history-card {
  width: min(720px, 95vw);
  max-height: 85vh;
}
.kitchen-history-body {
  padding: 8px 14px 14px;
  overflow-y: auto;
}
.kitchen-history-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.kitchen-history-row:last-child { border-bottom: none; }
.kitchen-history-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.kitchen-history-row-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
}
.kitchen-history-row-table {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.kitchen-history-row-time {
  font-size: 13px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kitchen-history-row-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--fg);
}
.kitchen-history-row-line {
  white-space: nowrap;
}
.kitchen-history-row-line-qty {
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}

.allergen-popup-body {
  padding: 14px 18px;
}
.allergen-popup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.allergen-popup-chip {
  padding: 8px 14px;
  border: 2px solid var(--danger);
  border-radius: 99px;
  background: rgba(207, 92, 92, 0.16);
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.allergen-popup-chip-icon {
  font-size: 16px;
}
.allergen-popup-empty {
  color: var(--fg-dim);
  font-style: italic;
  margin: 8px 0;
}
.allergen-popup-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  margin: 12px 0 6px;
}

/* ─────────────────────────────────────────────────────────────────
   Move line picker — checkboxes on tab lines
   ───────────────────────────────────────────────────────────────── */

.move-line-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.move-line-row:hover { background: var(--surface2); }
.move-line-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.move-line-row-name {
  flex: 1;
  font-weight: 500;
}
.move-line-row-qty {
  color: var(--fg-dim);
  font-size: 13px;
  margin-right: 8px;
}
.move-line-row-price {
  font-weight: 600;
  color: var(--accent);
  min-width: 80px;
  text-align: right;
}

/* ─────────────────────────────────────────────────────────────────
   Long-press hint on basket lines (visual cue)
   ───────────────────────────────────────────────────────────────── */

.basket-line.long-pressing {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  transition: background 0.15s ease-in;
}

/* ─────────────────────────────────────────────────────────────────
   Training mode banner — vivid red strip across the dashboard top
   ───────────────────────────────────────────────────────────────── */

.training-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  background: repeating-linear-gradient(
    -45deg,
    #c0392b,
    #c0392b 12px,
    #a93226 12px,
    #a93226 24px
  );
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  /* Subtle pulse so eye keeps registering it */
  animation: training-pulse 2s ease-in-out infinite;
}
.training-banner[hidden] { display: none; }
@keyframes training-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.15); }
}
.training-banner-icon {
  font-size: 20px;
  line-height: 1;
}
.training-banner-text {
  flex: 1;
  text-align: center;
}
.training-banner-exit {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 5px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-transform: uppercase;
}
.training-banner-exit:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =========================================================================
 * Modifier sheet — for products with option groups (chips/mash, fillings,
 * extras, milk + strength for coffee, single/double for spirits).
 * Slides over the dashboard. Sticky header + footer; body scrolls.
 * ========================================================================= */

.modifier-sheet-card {
  background: var(--bg, #161616);
  color: var(--fg, #e8e8e8);
  width: 100%;
  max-width: 640px;
  height: min(100%, 760px);
  margin: auto;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border, #2a2a2a);
}

.modifier-sheet-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.modifier-sheet-titles { flex: 1; min-width: 0; }
.modifier-sheet-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modifier-sheet-subtitle {
  font-size: 13px;
  color: var(--fg-dim, #999);
  margin-top: 2px;
}
.modifier-sheet-price {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent, #d4a017);
  font-variant-numeric: tabular-nums;
}
.modifier-sheet-close {
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  color: var(--fg-dim, #999);
  font-size: 28px;
  cursor: pointer;
  border-radius: 8px;
}
.modifier-sheet-close:hover { background: var(--surface, rgba(255,255,255,0.06)); color: var(--fg, #fff); }

.modifier-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.modsheet-group {
  margin-bottom: 24px;
}
.modsheet-group:last-child { margin-bottom: 8px; }
.modsheet-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.modsheet-group-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg, #fff);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modsheet-group-rule {
  font-size: 12px;
  color: var(--fg-dim, #888);
}
.modsheet-group-rule.required {
  color: var(--accent, #d4a017);
}

.modsheet-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.modsheet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px;
  border: 2px solid var(--border, #2a2a2a);
  border-radius: 10px;
  background: var(--surface, rgba(255, 255, 255, 0.03));
  color: var(--fg, #e8e8e8);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
  transition: border-color 60ms ease, background 60ms ease;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
}
.modsheet-option:hover { border-color: var(--fg-dim, #555); }
.modsheet-option[data-selected="true"] {
  border-color: var(--accent, #d4a017);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--fg, #fff);
}
.modsheet-option-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modsheet-option-price {
  font-size: 13px;
  color: var(--fg-dim, #999);
  font-variant-numeric: tabular-nums;
}
.modsheet-option[data-selected="true"] .modsheet-option-price {
  color: var(--accent, #d4a017);
}

/* Quantity stepper rows (allow_quantity groups, e.g. Breakfast extras).
 * A non-button row carrying the option name, optional price, and a
 * − [qty] + control on the right. The row itself isn't tappable; only
 * the step buttons are. */
.modsheet-option-stepper { cursor: default; }
.modsheet-option-stepper:hover { border-color: var(--border, #2a2a2a); }
.modsheet-option-stepper[data-selected="true"]:hover { border-color: var(--accent, #d4a017); }
.modsheet-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.modsheet-step-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border, #2a2a2a);
  border-radius: 8px;
  background: var(--surface, rgba(255, 255, 255, 0.05));
  color: var(--fg, #e8e8e8);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.modsheet-step-btn:hover { border-color: var(--accent, #d4a017); }
.modsheet-step-btn:active { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.modsheet-step-qty {
  min-width: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Stepper groups STACK their tiles: full-width label on top (wraps,
 * never truncated), price, then the − [qty] + centred at the bottom.
 * The old single-row layout sat a ~122px control beside the name in a
 * 150px tile, crushing long extras ("Chopped Tomatoes", "Toast or
 * Fried Bread") to an ellipsis. Slightly wider tiles give the control
 * room to breathe. Toggle (single/multi-select) groups are untouched
 * and keep their compact one-line layout. */
.modsheet-options-stepper {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.modsheet-option-stepper {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 12px 10px;
  min-height: 104px;
}
.modsheet-option-stepper .modsheet-option-name {
  flex: 0 0 auto;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  text-align: center;
  line-height: 1.2;
  font-weight: 600;
}
.modsheet-option-stepper .modsheet-option-price {
  text-align: center;
}
.modsheet-option-stepper .modsheet-stepper {
  margin-top: auto;
  justify-content: center;
  gap: 10px;
}
.modsheet-option-stepper .modsheet-step-btn {
  width: 44px;
  height: 40px;
}
.modsheet-option-stepper .modsheet-step-qty {
  min-width: 30px;
}

.modifier-sheet-foot {
  padding: 14px 20px 18px;
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border-top: 1px solid var(--border, #2a2a2a);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============== SPIRIT + WINE PICKERS ==============
   Big, finger-friendly tile grids for the bar's spirit and wine
   pickers. Same look as the modifier sheet (which they share the
   card chrome with) but with simpler bodies — no option groups,
   just tappable choices.

   Sizes:
     - Spirit step 1 (Single/Double): two large tiles, 50/50 split.
     - Spirit step 2 (Mixers): 2-col × 5-row grid (8 mixers + Can + None).
     - Wine: up to 4 tiles in one row, equal width.

   Sizing math: tiles are >= 80px tall so a finger lands cleanly.
   The size and price stack vertically so the price is always
   readable at a glance — bartenders should never have to peer at
   small text mid-shift. */
.picker-grid {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}
.picker-grid.two-col { grid-template-columns: 1fr 1fr; }
.picker-grid.four-col { grid-template-columns: repeat(4, 1fr); }

.picker-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 90px;
  padding: 14px 12px;
  background: var(--surface, rgba(255, 255, 255, 0.05));
  color: var(--fg, #e8e8e8);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 12px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.06s ease, background 0.12s ease;
}
.picker-tile:hover { background: var(--surface-hi, rgba(255, 255, 255, 0.09)); }
.picker-tile:active { transform: scale(0.97); }
.picker-tile.large { min-height: 130px; font-size: 22px; }
.picker-tile .picker-tile-price {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-dim, #b0b0b0);
}
.picker-tile.large .picker-tile-price { font-size: 18px; }
/* "None / Neat" — clearly distinct, not a mistake. Tinted, never
   confused with a real mixer mid-rush. */
.picker-tile.tile-none {
  background: transparent;
  border-style: dashed;
  color: var(--fg-dim, #b0b0b0);
}
.picker-tile.tile-none:hover {
  background: var(--surface, rgba(255, 255, 255, 0.04));
}
/* Step indicator + back link in the picker header subtitle area. */
.picker-step-back {
  background: none;
  border: none;
  color: var(--accent, #7aa2ff);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.picker-step-back:hover { color: var(--fg, #fff); }

.modsheet-empty-note {
  padding: 18px 4px 6px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-dim, #999);
}
.modsheet-note-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--fg-dim, #999);
}
.modsheet-note-label > span { font-weight: 600; color: var(--fg, #ccc); }
.modsheet-note-label input,
.modsheet-note-label textarea {
  font-size: 16px;
  padding: 10px 14px;
  background: var(--bg, #0e0e0e);
  color: var(--fg, #e8e8e8);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  resize: vertical;
}
.modsheet-note-label input:focus,
.modsheet-note-label textarea:focus { border-color: var(--accent, #d4a017); }
.modifier-sheet-actions {
  display: flex;
  gap: 10px;
}
.modifier-sheet-actions .parked-action { flex: 1; min-height: 50px; }

/* ===== Draught product wizard — inline cask/keg/box-cider create =====
 *
 * Long form opened from a Draught slot long-press. Reuses the
 * modifier-sheet-card chrome (header, body, foot) so the visual
 * grammar matches the rest of the till. Body content is a vertical
 * stack of form sections with comfortable touch targets — these
 * fields are filled in by a bartender on a tablet, not a typist on
 * a desktop, so inputs are 48px tall and labels are explicit. */

.drwiz-body {
  /* Override the centred flow of modifier-sheet-body — we want a
   * top-aligned scrollable form, not centred option chips. */
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  align-items: stretch;
  justify-content: flex-start;
}
.drwiz-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drwiz-section-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #d4a017);
}
.drwiz-section-hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  margin: -4px 0 0;
}
.drwiz-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--fg, #e8e8e8);
}
.drwiz-field > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}
.drwiz-field em {
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  color: var(--fg-dim, rgba(255,255,255,0.55));
}
.drwiz-field input,
.drwiz-field textarea {
  font: inherit;
  background: var(--surface, rgba(255,255,255,0.04));
  color: var(--fg, #fff);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  min-height: 48px;
  outline: none;
}
.drwiz-field textarea { min-height: 64px; resize: vertical; }
.drwiz-field input:focus,
.drwiz-field textarea:focus {
  border-color: var(--accent, #d4a017);
}

.drwiz-row-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}

.drwiz-checkbox-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.drwiz-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  background: var(--surface, rgba(255,255,255,0.04));
  cursor: pointer;
  font-size: 14px;
  min-height: 48px;
  flex: 1 1 0;
  user-select: none;
}
.drwiz-checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent, #d4a017);
  flex-shrink: 0;
}
.drwiz-checkbox:has(input:checked) {
  border-color: var(--accent, #d4a017);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.drwiz-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 540px) {
  .drwiz-prices { grid-template-columns: 1fr; }
  .drwiz-row-2  { grid-template-columns: 1fr; }
}
.drwiz-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
}
.drwiz-price-row > span:first-child {
  /* Measure label — fixed width so the input columns line up */
  width: 80px;
  flex-shrink: 0;
}
.drwiz-price-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.drwiz-price-prefix {
  position: absolute;
  left: 12px;
  font-weight: 400;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  pointer-events: none;
}
.drwiz-price-wrap input {
  width: 100%;
  padding: 12px 14px 12px 24px;
  font-size: 15px;
  background: var(--surface, rgba(255,255,255,0.04));
  color: var(--fg, #fff);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  min-height: 48px;
  outline: none;
}
.drwiz-price-wrap input:focus {
  border-color: var(--accent, #d4a017);
}
.drwiz-price-row[data-manual="true"] .drwiz-price-prefix {
  /* Manager has typed in this measure explicitly — show prefix in
   * accent so it's clear this row is "anchored" and won't auto-fill
   * when other rows are typed. */
  color: var(--accent, #d4a017);
}

.drwiz-error {
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 100, 100, 0.5);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #ffaaaa;
}

/* ===== BYO builder — quantity-tile grid ===== */

.byo-builder-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  align-content: start;
}
.byo-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 14px 12px;
  min-height: 90px;
  border: 2px solid var(--border, #2a2a2a);
  border-radius: 12px;
  background: var(--surface, rgba(255,255,255,0.03));
  color: var(--fg, #e8e8e8);
  cursor: pointer;
  text-align: left;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 60ms ease, background 60ms ease;
}
.byo-tile:hover { border-color: var(--fg-dim, #555); }
.byo-tile[data-quantity]:not([data-quantity="0"]) {
  border-color: var(--accent, #d4a017);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.byo-tile-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}
.byo-tile-price {
  font-size: 12px;
  color: var(--fg-dim, #999);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.byo-tile-qty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--accent, #d4a017);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.byo-tile[data-quantity="0"] .byo-tile-qty-badge,
.byo-tile:not([data-quantity]) .byo-tile-qty-badge { display: none; }

/* ===== Per-line note display in the basket ===== */
.basket-line-note {
  font-size: 12px;
  color: var(--fg-dim, #aaa);
  font-style: italic;
  margin-top: 2px;
}

/* ===== Per-tab note pill in the basket ===== */
.basket-tab-note {
  margin: 6px 0;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left: 3px solid var(--accent, #d4a017);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--fg, #e8e8e8);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.basket-tab-note-prefix {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #d4a017);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

/* Per-line modifier rows in the basket — indented under the dish */
.basket-line-modifier {
  font-size: 12px;
  color: var(--accent, #d4a017);
  margin-top: 1px;
  font-weight: 500;
}

/* "No" removals under a basket line — loud + red so a struck ingredient
 * is obvious before the kitchen ticket fires. Matches the red treatment
 * the removal gets on the kitchen printer. */
.basket-line-removal {
  font-size: 12px;
  color: #e23b3b;
  margin-top: 1px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* "No" picker (removals) — multi-select chips for a line's category list. */
.no-picker-card { max-width: 560px; }
.no-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 4px 4px;
  max-height: 52vh;
  overflow-y: auto;
}
.no-chip {
  appearance: none;
  border: 2px solid var(--line, #3a3a3a);
  background: var(--surface-2, #1f1f1f);
  color: var(--text, #eee);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;            /* finger-friendly */
  transition: background 0.08s, border-color 0.08s, color 0.08s;
}
.no-chip.selected {
  background: #e23b3b;
  border-color: #e23b3b;
  color: #fff;
}
.no-chip.selected::before { content: "✓ "; font-weight: 800; }
.no-picker-foot { display: flex; gap: 12px; }
.no-picker-foot .big-btn { flex: 1; }

/* ===== Draught wizard — Untappd lookup row =====
 * Sits at the top of the form so a bartender who knows the beer
 * name can populate every field in two taps. Sized for tablet. */
/* ===== Draught wizard — Untappd lookup, inline =====
 *
 * Block at the very top of the draught-product form. Search input
 * always visible; results render directly below as a max-height
 * scroll region so a long result list doesn't displace the rest
 * of the form below. Tap a row → form populates → results clear.
 * No popup overlay anymore — the search IS the first field. */
.drwiz-utfb-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  margin-bottom: 12px;
}
.drwiz-utfb-hint {
  font-size: 13px;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  min-height: 1em;
}
.drwiz-utfb-hint.success {
  color: var(--accent, #d4a017);
  font-weight: 600;
}
/* Inline results container — capped height so 10+ matches don't
 * push the rest of the form (Name, Brewery, prices) below the fold.
 * Internal scroll keeps it tidy. */
.utfb-search-results-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.utfb-search-results-inline:empty { display: none; }

/* ===== Generic till overlay — used by the Untappd search popup ===== */
.till-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.till-overlay[hidden] { display: none; }
.till-overlay-card {
  width: min(640px, 100%);
  max-height: 90vh;
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}
.till-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.till-overlay-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg, #fff);
}
.till-overlay-close {
  background: transparent;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  border: none;
  font-size: 28px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
}
.till-overlay-close:hover { background: var(--surface, rgba(255,255,255,0.06)); color: var(--fg, #fff); }
.till-overlay-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.till-overlay-hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  margin: 0;
}
.till-overlay-input {
  font: inherit;
  background: var(--surface, rgba(255,255,255,0.04));
  color: var(--fg, #fff);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
  min-height: 48px;
  outline: none;
  width: 100%;
}
.till-overlay-input:focus { border-color: var(--accent, #d4a017); }

/* Untappd search results — tablet-sized rows. */
.utfb-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.utfb-tier-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  padding: 12px 4px 4px;
}
.utfb-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface, rgba(255,255,255,0.04));
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 10px;
  min-height: 64px;
}
.utfb-search-row img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  flex-shrink: 0;
}
.utfb-search-row-noimg {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  font-size: 9px;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.utfb-search-row-meta { flex: 1; min-width: 0; }
.utfb-search-row-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.utfb-search-row-sub {
  font-size: 12px;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  margin-top: 2px;
}
.utfb-search-row-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent, #d4a017);
  font-size: 11px;
  font-weight: 600;
}
.utfb-search-pick-btn {
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  cursor: pointer;
  flex-shrink: 0;
}
.utfb-search-pick-btn:active { transform: scale(0.97); }
.utfb-search-empty {
  font-size: 13px;
  color: var(--fg-dim, rgba(255,255,255,0.55));
  text-align: center;
  padding: 24px 16px;
}
.utfb-search-error {
  font-size: 13px;
  color: #ff8888;
  padding: 12px 16px;
  background: rgba(255, 80, 80, 0.08);
  border-radius: 8px;
}

/* =====================================================================
 * Card payment in-flight lock.
 * ---------------------------------------------------------------------
 * When body[data-payment-in-flight="true"] is set (by JS during the
 * window between "card payment started" and "card payment
 * settled/failed/cancelled"), dim and disable the basket-mutating
 * areas of the till. The banner with the Cancel button is rendered
 * outside these selectors so it stays interactive — that's the only
 * way out.
 *
 * Defence-in-depth: JS guards on each entry point (addProductToBasket,
 * basket-actions, pay-methods, swipe-to-void, tables) toast a hint
 * if anything bypasses the CSS.
 *
 * Why not just disable the buttons? Disabling each element is fragile
 * (the product grid is rebuilt on every render, the modifier sheet
 * has its own buttons, etc.). One body-level toggle catches every
 * affordance currently in the locked containers AND anything we add
 * inside them later.
 * ===================================================================== */
body[data-payment-in-flight="true"] .dash-products,
body[data-payment-in-flight="true"] .basket-header-row [data-tool],
body[data-payment-in-flight="true"] #basket-tables-btn,
body[data-payment-in-flight="true"] #basket-menu-btn,
body[data-payment-in-flight="true"] #basket-tab-chip,
body[data-payment-in-flight="true"] #basket-lines,
body[data-payment-in-flight="true"] .pay-pad,
body[data-payment-in-flight="true"] .pay-notes,
body[data-payment-in-flight="true"] .pay-methods {
  pointer-events: none;
  opacity: 0.45;
  filter: saturate(0.55);
  transition: opacity 0.15s ease, filter 0.15s ease;
}

/* Pay methods row gets slightly more legible opacity since the Card
 * button itself is the system status hint — staff need to read the
 * pulse/state without it being too dim. */
body[data-payment-in-flight="true"] .pay-methods {
  opacity: 0.6;
}

/* ─── Manager edit mode (Phase D) ─────────────────────────────────
   Subtle ambient indicator: amber dashed outline around the
   product grid so the cashier always knows edit mode is on. The
   long-press behaviour change is invisible without a visual cue
   and could surprise a manager who forgot they toggled it on. */
body.till-edit-mode .category-grid,
body.till-edit-mode .product-grid {
  outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 4px;
  border-radius: 6px;
}
body.till-edit-mode .category-grid::before {
  content: "MANAGER EDIT MODE — long-press a tile to edit";
  display: block;
  position: absolute;
  top: -22px;
  left: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #d4a017;
}

/* ─── Quick-edit popover (Phase D) ────────────────────────────────
   Inline name + price + active + sold-out + "Open full editor"
   deep-link. Triggered by long-press on a product tile when
   manager edit mode is on. */
.quick-edit-card {
  max-width: 480px;
  width: 100%;
}
.quick-edit-body {
  padding: 14px 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quick-edit-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-edit-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quick-edit-row input {
  padding: 12px 14px;
  border: 2px solid var(--border, #334155);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  font-family: inherit;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.quick-edit-row input:focus {
  outline: none;
  border-color: var(--accent, #d4a017);
}
.quick-edit-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-edit-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  padding: 6px 0;
  cursor: pointer;
}
.quick-edit-toggle input { width: 22px; height: 22px; cursor: pointer; }
.quick-edit-hint {
  margin: 0;
  font-size: 12px;
  color: var(--fg-dim);
  font-style: italic;
}
.quick-edit-foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px 20px;
  align-items: center;
  flex-wrap: wrap;
}
.quick-edit-foot button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
}
/* v1.5.170: measure boxes spaced like the other rows. */
#quick-edit-measures { display: flex; flex-direction: column; gap: 14px; }
#quick-edit-measures:empty { display: none; }
#quick-edit-price-row[hidden] { display: none; }
/* v1.5.170: Delete replaces "Open full editor" — bottom left, red. */
.quick-edit-delete {
  background: transparent;
  color: var(--danger, #e05252);
  border-color: color-mix(in srgb, var(--danger, #e05252) 55%, transparent);
  margin-right: auto;
}
.quick-edit-delete:hover { background: color-mix(in srgb, var(--danger, #e05252) 12%, transparent); }
.quick-edit-cancel {
  background: transparent;
  color: var(--fg, #f5f5f5);
  border-color: var(--border, #334155);
}
.quick-edit-cancel:hover { background: var(--bg-2, #1a2438); }
.quick-edit-save {
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent, #d4a017);
  font-weight: 700;
}
.quick-edit-save:hover { filter: brightness(1.08); }
.quick-edit-save:active { transform: scale(0.98); }

/* ─── Sub-category section headers in product grid ─────────────────
   When the cashier opens a PARENT category (e.g. Spirits) that has
   sub-categories (Vodka, Gin, ...), the product grid renders each
   group with a full-width header tile between them. The header
   spans the entire grid width and is non-interactive — it's a
   visual divider, not a button. */
.product-section-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #d4a017);
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--accent, #d4a017) 18%, transparent),
    color-mix(in srgb, var(--accent, #d4a017) 4%, transparent) 60%,
    transparent
  );
  border-left: 3px solid var(--accent, #d4a017);
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}
/* First header in the grid doesn't need the top margin */
.product-section-header:first-child {
  margin-top: 0;
}

/* =====================================================================
   REFUSAL MODAL — log a refused sale (UK licensing compliance)
   Same modal pattern as allergy-alert: parked-card overlay, header,
   body of chips + inputs, footer with cancel/save.
   ===================================================================== */
.refusal-card {
  max-width: 640px;
  width: 100%;
}
.refusal-body {
  padding: 14px 20px 4px;
}
.refusal-help {
  margin: 0 0 14px;
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.5;
}

.refusal-section { margin-bottom: 14px; }
.refusal-section-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim);
  margin-bottom: 8px;
}

.refusal-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.refusal-reason {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 14px;
  min-height: 52px;
  border: 2px solid var(--border, #334155);
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.refusal-reason:hover  { border-color: var(--fg-dim); }
.refusal-reason:active { transform: scale(0.97); }
.refusal-reason[data-active="true"] {
  /* Refusals are negative actions — picked reason gets a red tint
     (matches the danger colour used elsewhere) so it's instantly
     clear which one's selected, even with peripheral vision. */
  border-color: var(--danger, #cf5c5c);
  background: color-mix(in srgb, var(--danger, #cf5c5c) 18%, var(--surface2));
}

/* No-sale reason chips — same shape as refusal chips, but a no-sale is
   a neutral/operational action, so the selected tint uses the accent
   colour rather than danger red. Separate class so the refusal JS
   (which binds every .refusal-reason) never picks these up. */
.nosale-reason {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 14px;
  min-height: 52px;
  border: 2px solid var(--border, #334155);
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.nosale-reason:hover  { border-color: var(--fg-dim); }
.nosale-reason:active { transform: scale(0.97); }
.nosale-reason[data-active="true"] {
  border-color: var(--accent, #4a9eff);
  background: color-mix(in srgb, var(--accent, #4a9eff) 18%, var(--surface2));
}

.refusal-text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border, #334155);
  background: var(--bg, #0f1419);
  color: var(--fg, #f5f5f5);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
.refusal-text-input:focus {
  outline: none;
  border-color: var(--accent, #d4a017);
}

.refusal-foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px 20px;
  align-items: center;
}
.refusal-foot button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
}
.refusal-cancel {
  background: transparent;
  color: var(--fg, #f5f5f5);
  border-color: var(--border, #334155);
  margin-right: auto;
}
.refusal-cancel:hover { background: var(--bg-2, #1a2438); }
.refusal-save {
  background: var(--danger, #cf5c5c);
  color: #fff;
  border-color: var(--danger, #cf5c5c);
  font-weight: 700;
}
.refusal-save:hover:not(:disabled) { filter: brightness(1.08); }
.refusal-save:active:not(:disabled) { transform: scale(0.98); }
.refusal-save:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =====================================================================
   ID CHECK MODAL — Challenge 25 age verification
   ===================================================================== */
.idcheck-card {
  max-width: 640px;
  width: 100%;
}
.idcheck-body {
  padding: 14px 20px 4px;
  flex: 1 1 auto;
  overflow-y: auto;
}
.idcheck-help {
  margin: 0 0 14px;
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.5;
}

.idcheck-section { margin-bottom: 10px; }
.idcheck-section-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-dim);
  margin-bottom: 8px;
}

.idcheck-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.idcheck-type {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 14px;
  min-height: 52px;
  border: 2px solid var(--border, #334155);
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.idcheck-type:hover  { border-color: var(--fg-dim); }
.idcheck-type:active { transform: scale(0.97); }
.idcheck-type[data-active="true"] {
  border-color: var(--accent, #d4a017);
  background: color-mix(in srgb, var(--accent, #d4a017) 18%, var(--surface2));
}

/* Outcome tiles — same shape as the ID-type tiles. The Valid tile reads
   green; refusal reasons read red when chosen. */
.idcheck-outcomes {
  display: grid;
  /* Five across on an iPad: the panel has to fit the wheel underneath,
     and it was falling off the bottom at 170px tiles. */
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 6px;
}
.idcheck-outcome {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 10px;
  min-height: 40px;
  border: 2px solid var(--border, #334155);
  background: var(--surface2);
  color: var(--fg, #f5f5f5);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, transform 0.06s;
}
.idcheck-outcome:hover  { border-color: var(--fg-dim); }
.idcheck-outcome:active { transform: scale(0.97); }
.idcheck-outcome[data-active="true"] {
  border-color: var(--danger, #cf5c5c);
  background: color-mix(in srgb, var(--danger, #cf5c5c) 18%, var(--surface2));
}
/* No default tint: the serve button looks like every other outcome until
   it's actually picked, then it goes green (refusals go red). The old
   permanent green border made it look pre-selected. */
.idcheck-outcome-ok[data-active="true"] {
  border-color: #34d399;
  background: color-mix(in srgb, #34d399 18%, var(--surface2));
}

.idcheck-optional { color: var(--fg-dim, #a8998a); font-weight: 500; }
.idcheck-wheel-hint {
  margin: 2px 0 10px;
  font-size: 13px;
  color: var(--fg-dim, #a8998a);
}

/* Scroll-snap date wheels. Three columns (day / month / year), each a
   native vertical scroll container that snaps each row to centre. The
   centred row is the selection; a leading "—" row means "not set". The
   highlight band + top/bottom fade mask sell the "wheel" feel without
   any momentum JS — the platform's touch scrolling does the work. */
.idcheck-wheels {
  position: relative;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
  margin-top: 4px;
  user-select: none;
}
.idcheck-wheel {
  flex: 1;
  max-width: 96px;
  height: 200px;                 /* 5 rows × 40px */
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  text-align: center;
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;
  /* fade rows away from the centre */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 32%, #000 68%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 32%, #000 68%, transparent 100%);
}
.idcheck-wheel::-webkit-scrollbar { width: 0; height: 0; display: none; }
.idcheck-wheel-year { max-width: 118px; }
.idcheck-wheel-pad { height: 80px; }   /* 2 rows so first/last item can centre */
.idcheck-wheel-item {
  height: 40px;
  line-height: 40px;
  scroll-snap-align: center;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-dim, #a8998a);
  transition: color .12s ease, transform .12s ease;
}
.idcheck-wheel-item[data-selected="true"] {
  color: var(--fg, #f5f5f5);
  transform: scale(1.14);
}
.idcheck-wheel-item[data-blank="true"] { color: var(--border, #334155); }
/* Centre highlight band, sitting over the middle row (top:80 = 2 rows). */
.idcheck-wheels-band {
  position: absolute;
  left: 0; right: 0;
  top: 80px; height: 40px;
  pointer-events: none;
  border-top: 1px solid var(--border, #334155);
  border-bottom: 1px solid var(--border, #334155);
  background: color-mix(in srgb, var(--accent, #d4a017) 8%, transparent);
  border-radius: 6px;
}
.idcheck-dob-clear {
  margin-top: 10px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  color: var(--fg-dim, #a8998a);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.idcheck-dob-clear:hover { color: var(--fg, #f5f5f5); border-color: var(--fg-dim, #a8998a); }

/* Live verdict box — shows after DOB is fully entered.
   data-outcome flips between served (green) and refused (red). */
.idcheck-verdict {
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--border, #334155);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}
.idcheck-verdict[data-outcome="served"] {
  background: color-mix(in srgb, #34d399 14%, var(--surface2));
  border-color: #34d399;
}
.idcheck-verdict[data-outcome="refused"] {
  background: color-mix(in srgb, var(--danger, #cf5c5c) 16%, var(--surface2));
  border-color: var(--danger, #cf5c5c);
}
.idcheck-verdict[data-outcome="neutral"] {
  background: var(--surface2, #1a2438);
  border-color: var(--border, #334155);
}
.idcheck-verdict-age:empty { min-width: 0; }
.idcheck-verdict-age {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg, #f5f5f5);
  min-width: 90px;
}
.idcheck-verdict-msg {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg, #f5f5f5);
  flex: 1;
}

.idcheck-foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px 20px;
  align-items: center;
}
.idcheck-foot button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
}
.idcheck-cancel {
  background: transparent;
  color: var(--fg, #f5f5f5);
  border-color: var(--border, #334155);
  margin-right: auto;
}
.idcheck-cancel:hover { background: var(--bg-2, #1a2438); }
.idcheck-save {
  background: var(--accent, #d4a017);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent, #d4a017);
  font-weight: 700;
}
.idcheck-save:hover:not(:disabled)  { filter: brightness(1.08); }
.idcheck-save:active:not(:disabled) { transform: scale(0.98); }
.idcheck-save:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Save button flips red when DOB indicates under-18 — the action is
   now also creating a refusal, so the button should feel destructive. */
.idcheck-save.idcheck-save-refuse {
  background: var(--danger, #cf5c5c);
  border-color: var(--danger, #cf5c5c);
  color: #fff;
}

/* =====================================================================
   SOLD-OUT BUTTON in the allergen popup footer
   ===================================================================== */
.allergen-popup-foot {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border, #334155);
  margin-top: 8px;
}
.allergen-popup-soldout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-height: 48px;
  padding: 0 18px;
  background: transparent;
  color: var(--danger, #cf5c5c);
  border: 2px solid var(--danger, #cf5c5c);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, transform 0.06s;
}
.allergen-popup-soldout:hover {
  background: color-mix(in srgb, var(--danger, #cf5c5c) 12%, transparent);
}
.allergen-popup-soldout:active { transform: scale(0.98); }
/* When the product is already sold out, button reads "Mark available"
   and turns green — different action, different colour. */
.allergen-popup-soldout[data-sold-out="true"] {
  color: #34d399;
  border-color: #34d399;
}
.allergen-popup-soldout[data-sold-out="true"]:hover {
  background: rgba(52, 211, 153, 0.12);
}
.allergen-popup-soldout-icon {
  font-size: 18px;
}

/* The product tile already supports data-sold-out — make sure the
   visual treatment is unmissable: greyed out with a diagonal red
   strike, plus the existing disabled state. */
.product-btn[data-sold-out="true"] {
  opacity: 0.45;
  position: relative;
  filter: grayscale(0.7);
}
.product-btn[data-sold-out="true"]::after {
  content: 'SOLD OUT';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  background: rgba(207, 92, 92, 0.92);
  color: #fff;
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
}

/* =====================================================================
   MEMBER REGISTRATION (Till Companion card tap)
   ===================================================================== */
[data-screen="member-register"] {
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
}
.reg-card {
  background: var(--surface, #1a2438);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  padding: 22px 24px 26px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
}
.reg-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.reg-header h2 { margin: 0; font-size: 22px; }
.reg-subtitle { margin: 4px 0 0; font-size: 14px; color: var(--fg-dim, #9fb0c8); }

.reg-legacy-note {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: #e8c97a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  margin: 8px 0 4px;
}

.reg-id-warning {
  background: rgba(207, 92, 92, 0.13);
  border: 1px solid rgba(207, 92, 92, 0.45);
  color: #f0b4b4;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0 18px;
}
.reg-id-warning strong { color: #ff8f8f; }

.reg-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reg-field { display: block; margin-bottom: 4px; }
.reg-label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-dim, #9fb0c8); margin-bottom: 5px; }
.reg-optional { font-weight: 400; opacity: 0.7; }
.reg-field input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg, #0f1419);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  color: var(--fg, #f5f5f5);
  font-size: 17px;
  padding: 12px 13px;
}
.reg-field input:focus { outline: none; border-color: var(--accent, #d4a017); }
.reg-field-hint { font-size: 12px; color: var(--fg-dim, #8295ad); margin: 4px 0 14px; }
.reg-field-hint[data-state="warn"] { color: #e8c97a; }

.reg-age { font-size: 15px; font-weight: 600; min-height: 22px; margin: 2px 0 14px; }
.reg-age[data-state="ok"]    { color: #34d399; }
.reg-age[data-state="c25"]   { color: #e8c97a; }
.reg-age[data-state="under"] { color: #ff6b6b; }

.reg-attest {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--bg, #0f1419);
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 13px 14px;
  font-size: 14px; line-height: 1.5;
  cursor: pointer;
  margin: 6px 0 4px;
}
.reg-attest input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; cursor: pointer; }
.reg-attest strong { color: #ff8f8f; }

.reg-actions { display: flex; gap: 12px; margin-top: 20px; }
.reg-actions button {
  flex: 1; padding: 15px; border-radius: 9px; font-size: 16px; font-weight: 600;
  border: none; cursor: pointer;
}
.reg-btn-cancel { background: var(--bg, #0f1419); color: var(--fg-dim, #9fb0c8); border: 1px solid var(--border, #334155) !important; }
.reg-btn-next, .reg-btn-confirm { background: var(--accent, #d4a017); color: #1a1206; }
.reg-btn-next:disabled { opacity: 0.4; cursor: not-allowed; }

/* Confirm step */
.reg-confirm { text-align: center; padding: 10px 0; }
.reg-confirm-lead { font-size: 15px; color: var(--fg-dim, #9fb0c8); margin-bottom: 18px; }
.reg-confirm-name  { font-size: 28px; font-weight: 700; color: var(--fg, #fff); margin-bottom: 8px; }
.reg-confirm-dob   { font-size: 19px; color: #e8c97a; margin-bottom: 6px; }
.reg-confirm-email { font-size: 17px; color: var(--fg, #d8e2f0); word-break: break-all; margin-bottom: 6px; }

/* ── Set-quantity modal (line-action drawer → numeric keypad) ──────────
   Reuses .pin-key for the buttons and .allergy-alert-{save,cancel} for the
   footer; this lays out the keypad grid and the running quantity display. */
.set-qty-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 20px 12px;
}
.set-qty-stepper {
  display: flex;
  align-items: center;
  gap: 22px;
}
.set-qty-stepper .set-qty-step {
  width: 76px;
  height: 76px;
  font-size: 34px;
  line-height: 1;
  border-radius: 14px;
}
.set-qty-stepper .set-qty-display {
  min-width: 96px;
  text-align: center;
  font-family: var(--display);
  font-size: 52px;
  line-height: 1;
}
.set-qty-foot {
  display: flex;
  gap: 10px;
  padding: 8px 20px 20px;
  justify-content: flex-end;
  align-items: center;
}

/* Modifier-sheet footer quantity stepper (edit mode). Reuses .modsheet-step-btn
   / .modsheet-step-qty; this lays out the labelled row. */
.modsheet-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.modsheet-qty-label { font-weight: 600; font-size: 15px; }
.modsheet-qty-stepper { display: flex; align-items: center; gap: 14px; }
.modsheet-qty-stepper .modsheet-step-btn { width: 48px; height: 48px; font-size: 24px; }
.modsheet-qty-stepper .modsheet-step-qty { min-width: 44px; text-align: center; font-size: 22px; font-family: var(--display); }

/* askText: the focusing text prompt. Sits low so the iPad keyboard
   does not cover it; card is wide enough for a party name. */
.ask-text {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.ask-text-card {
  background: #fff; color: #111; border-radius: 14px;
  padding: 18px 18px 14px; width: min(92vw, 440px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; gap: 12px;
}
.ask-text-label { font-weight: 700; font-size: 1.05rem; }
.ask-text-input {
  font-size: 1.25rem; padding: 12px 14px;
  border: 2px solid #9db6c4; border-radius: 10px; width: 100%;
}
.ask-text-input:focus { outline: none; border-color: #014a80; }
.tell-user-figure {
  font-family: var(--display, inherit);
  font-size: 44px;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  margin: 12px 0 8px;
}
.ask-text-row { display: flex; gap: 10px; justify-content: flex-end; }
.ask-text-row button {
  font-size: 1rem; font-weight: 700; padding: 10px 18px;
  border-radius: 10px; border: 0; cursor: pointer;
}
.ask-text-cancel { background: #e6e6e6; color: #222; }
.ask-text-ok { background: #014a80; color: #fff; }

/* Void-reason chips: the usual reasons, one tap to fill the box. */
.void-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.void-chip {
  font-size: 0.95rem; font-weight: 600; padding: 9px 14px;
  border-radius: 2rem; border: 2px solid #9db6c4; background: #fff; color: #14343f;
  cursor: pointer;
}
.void-chip.is-on { background: #014a80; border-color: #014a80; color: #fff; }

/* ID check: serve buttons go green only once PICKED. The old permanent
   green border made the whole row look already selected (v1.5.65) —
   the green/red section labels now say serve / refuse instead. */
.idcheck-serve-row .idcheck-outcome-ok[data-active="true"] { background: #2f7d4f; color: #fff; border-color: #2f7d4f; }
.idcheck-outcome[data-reason="under_age"][data-active="true"] { background: #b3261e; color: #fff; border-color: #b3261e; }


/* =====================================================================
   SHEETS (v1.5.65) — every pop-up over the till fills the stage.
   One rule for all five card types, so no pop-up floats in the middle
   of a dark screen with wasted space round it. Pairing, login and the
   dashboard are full screens already and are not cards.
   ===================================================================== */
#stage > .screen > .parked-card,
#stage > .screen > .modifier-sheet-card,
#stage > .screen > .member-card,
#stage > .screen > .journal-card,
#stage > .screen > .reg-card {
  position: absolute;
  inset: 10px;
  transform: none;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
}
#stage > .screen > .reg-card { overflow-y: auto; }

/* ---- ID check: two columns, no scroll on an iPad -------------------
   Left: the decision (serve with which ID / refuse why), big targets.
   Right: the date checker and its verdict. Refusal detail appears under
   the refusal buttons, so nothing below the fold. */
.idcheck-body.idcheck-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  padding: 18px 24px 8px;
  overflow-y: auto;
}
.idcheck-col { min-width: 0; }
.idcheck-col-date {
  border-left: 1px solid var(--border, #334155);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
}
.idcheck-label-serve  { color: #4fbf7f; }
.idcheck-label-refuse { color: var(--danger, #cf5c5c); margin-top: 16px; }
.idcheck-grid .idcheck-outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.idcheck-grid #idcheck-outcomes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.idcheck-grid .idcheck-outcome {
  min-height: 60px;
  font-size: 17px;
  padding: 10px 14px;
  border-color: var(--border, #334155);
}
.idcheck-grid .idcheck-serve-row .idcheck-outcome { min-height: 68px; font-size: 18px; }
/* Refusal detail: description and notes side by side, one line each,
   so choosing a refusal never pushes the sheet into a scroll. */
.idcheck-grid #idcheck-refusal-extra:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.idcheck-grid #idcheck-refusal-extra .idcheck-section { margin-bottom: 0; }
.idcheck-grid #idcheck-refusal-extra .refusal-text-input {
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  min-height: 46px;
  resize: none;
}

/* Date checker: a framed drum with ▲/▼ buttons so it reads as something
   that moves. Button widths match the wheel columns below them. */
.idcheck-col-date .idcheck-wheel-hint { font-size: 15px; }
.idcheck-steps {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.idcheck-step {
  flex: 1;
  max-width: 96px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--border, #334155);
  background: var(--surface2, #1a2438);
  color: var(--fg, #f5f5f5);
  font-size: 18px;
  cursor: pointer;
}
.idcheck-step:active { transform: scale(0.95); background: var(--border, #334155); }
.idcheck-step-year { max-width: 118px; }
.idcheck-col-date .idcheck-wheels {
  margin: 8px 0;
  padding: 0;
}
/* Frame the drum as one object (the columns themselves fade at the
   edges, so a border on them disappears). */
.idcheck-col-date .idcheck-wheels {
  border: 2px solid var(--border, #334155);
  border-radius: 12px;
  background: var(--surface2, #1a2438);
  padding: 6px 8px;
  align-self: center;
}
.idcheck-col-date .idcheck-wheels-band { top: 86px; }   /* 80 + 6px padding */
.idcheck-col-date .idcheck-steps { align-self: center; padding: 0 10px; }
.idcheck-col-date .idcheck-step { width: 96px; flex: none; }
.idcheck-col-date .idcheck-step-year { width: 118px; }
.idcheck-col-date .idcheck-wheel { flex: none; width: 96px; }
.idcheck-col-date .idcheck-wheel-year { width: 118px; }
.idcheck-col-date .idcheck-dob-clear { align-self: center; }
.idcheck-col-date .idcheck-verdict { margin-top: 12px; }

/* Spirit + wine sheets (v1.5.65): ONE tile size for every choice —
   sizes, mixers, bottle — four across, 150px tall, partial rows centred.
   Same size on every step, so the bartender's eye and thumb land in the
   same places whatever is being poured. */
#spirpick-body > .picker-grid,
#winepick-body > .picker-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 14px;
  padding: 24px 24px 20px;
}
#spirpick-body .picker-tile,
#winepick-body .picker-tile {
  flex: 0 0 calc((100% - 3 * 14px) / 4);
  height: 150px;
  min-height: 0;
  padding: 12px;
  border-radius: 14px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
#spirpick-body .picker-tile .picker-tile-price,
#winepick-body .picker-tile .picker-tile-price {
  font-size: 17px;
  font-weight: 500;
}

/* ID check, compacted for the real iPad stage (~1000×665 CSS px with the
   status bar): tighter header/footer, shorter buttons, Reset beside the
   hint. Fits with ~70px to spare incl. a refusal's detail boxes. */
.idcheck-card .parked-header { padding: 10px 20px; }
.idcheck-card .idcheck-foot  { padding: 8px 20px 12px; }
.idcheck-body.idcheck-grid   { padding: 12px 20px 4px; gap: 20px; }
.idcheck-col-date            { padding-left: 20px; }
.idcheck-grid .idcheck-section-label { margin-bottom: 6px; }
.idcheck-grid .idcheck-outcomes { gap: 8px; }
.idcheck-grid .idcheck-serve-row .idcheck-outcome { min-height: 56px; }
.idcheck-grid .idcheck-outcome { min-height: 52px; padding: 6px 12px; font-size: 16px; }
.idcheck-label-refuse { margin-top: 12px; }
.idcheck-grid #idcheck-refusal-extra:not([hidden]) { margin-top: 10px; }
.idcheck-hint-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.idcheck-hint-row .idcheck-wheel-hint { margin: 0; }
.idcheck-hint-row .idcheck-dob-clear { margin: 0; padding: 6px 12px; }
.idcheck-col-date .idcheck-step { height: 40px; }
.idcheck-col-date .idcheck-wheels { margin: 6px 0; }
.idcheck-col-date .idcheck-verdict { margin-top: 10px; padding: 10px 14px; }

/* Journal → Compliance log link (v1.5.65). Sits after the till name. */
.journal-compliance-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}
.journal-compliance-btn:hover { background: var(--accent-soft, rgba(255,255,255,0.05)); }

/* =====================================================================
   SHEET HEADERS (v1.5.65) — one look for every sheet: title left in the
   accent display face, anything else to its right, and the same × close
   in the top-right corner. Covers all five header families.
   ===================================================================== */
#stage > .screen .parked-header,
#stage > .screen .modifier-sheet-header,
#stage > .screen .member-header,
#stage > .screen .journal-header,
#stage > .screen .reg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px 10px 24px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-sizing: border-box;
}
/* The title block takes the free space, so buttons sit right. */
#stage > .screen :is(.parked-header, .modifier-sheet-header, .member-header, .journal-header, .reg-header) > :first-child {
  flex: 1;
  min-width: 0;
}
#stage > .screen :is(.parked-header, .member-header, .journal-header, .reg-header) h2,
#stage > .screen .modifier-sheet-title {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
#stage > .screen .journal-subtitle { margin-left: 0; }
/* reg-card is a padded card: pull its header out to the edges. */
#stage > .screen > .reg-card > .reg-header { margin: -22px -24px 16px; }
/* The close button — identical everywhere. */
#stage > .screen :is(.parked-close, .modifier-sheet-close, .member-close, .journal-close) {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-dim);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
#stage > .screen :is(.parked-close, .modifier-sheet-close, .member-close, .journal-close):hover {
  color: var(--fg);
  background: var(--bg);
}

/* askText / tellUser prompts on the till's dark theme (v1.5.65) —
   were white with navy buttons. Same surface, border, accent and
   button shapes as the sheets. */
.ask-text { background: rgba(0,0,0,0.6); }
.ask-text-card {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 16px;
  width: min(92vw, 520px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.ask-text-label {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.ask-text-input {
  box-sizing: border-box;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--border);
  font-size: 20px;
  padding: 12px 14px;
}
.ask-text-input::placeholder { color: var(--fg-dim); }
.ask-text-input:focus { border-color: var(--accent); }
.ask-text-row button { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 10px; }
.ask-text-cancel {
  background: transparent;
  color: var(--fg);
  border: 2px solid var(--border) !important;
}
.ask-text-ok {
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
}

/* Still open at cash-up (v1.5.65) */
.openitems-card .parked-list { flex: 1; overflow-y: auto; }
.openitems-item { grid-template-columns: 1fr auto auto; cursor: default; }
.openitems-actions { display: flex; gap: 8px; }
.openitems-btn {
  appearance: none; min-height: 44px; width: 90px; padding: 0; border-radius: 8px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--fg); border: 2px solid var(--border);
}
.openitems-void { color: var(--danger, #cf5c5c); border-color: color-mix(in srgb, var(--danger, #cf5c5c) 50%, var(--border)); }
.openitems-foot { display: flex; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.openitems-foot button { min-height: 48px; padding: 0 20px; border-radius: 8px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.openitems-cancel { background: transparent; color: var(--fg); border: 2px solid var(--border); margin-right: auto; }
.openitems-continue { background: var(--accent); color: var(--accent-fg, #1a1a1a); border: 2px solid var(--accent); }

/* Parked → tab picker (v1.5.65) */
.p2t-item { grid-template-columns: 1fr auto; min-height: 64px; }
.p2t-new .parked-item-staff { color: var(--accent); font-weight: 700; }

/* =====================================================================
   STRAGGLER SHEETS (v1.5.66) — the sheets that still had white chips,
   white text boxes and tiny unstyled footer buttons. One footer look
   everywhere, matching the ID check: Cancel (or the secondary action)
   on the left, the action on the right, 48px tall, pinned to the
   bottom of the sheet so short sheets aren't top-heavy.
   ===================================================================== */
/* The body of a form sheet takes the room; the footer sits at the bottom. */
#stage > .screen > .parked-card > form.misc-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 24px 0;
}
#stage > .screen .misc-actions,
#stage > .screen .set-qty-foot,
#stage > .screen .tab-detail-actions,
#stage > .screen .line-actions-foot,
#stage > .screen .refusal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  padding: 14px 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
/* Inside a scrolling form the footer spans the full width and sticks. */
#stage > .screen form.misc-form > .misc-actions {
  position: sticky;
  bottom: 0;
  margin: auto -24px 0;
}
/* Every footer button: one shape. */
#stage > .screen :is(.misc-actions, .set-qty-foot, .tab-detail-actions, .line-actions-foot, .refusal-foot) > button {
  appearance: none;
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 120px;
  padding: 0 24px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transform: none;
}
/* The first plain button goes left: Cancel, Clear, Print bill. */
#stage > .screen :is(.misc-actions, .set-qty-foot, .tab-detail-actions, .line-actions-foot, .refusal-foot) > button:first-child:not(.parked-action-primary, .allergy-alert-save, .big-btn.primary, .refusal-save, .line-discount-apply, .line-note-save, .quick-edit-save, .idcheck-save) {
  margin-right: auto;
}
#stage > .screen :is(.misc-actions, .set-qty-foot, .tab-detail-actions, .line-actions-foot, .refusal-foot)
  > :is(.parked-action-primary, .allergy-alert-save, .big-btn.primary) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg, #1a1a1a);
}
#stage > .screen :is(.misc-actions, .tab-detail-actions, .refusal-foot) > :is(.parked-action-danger, .refusal-save) {
  background: var(--danger, #cf5c5c);
  border-color: var(--danger, #cf5c5c);
  color: #fff;
}
#stage > .screen :is(.misc-actions, .set-qty-foot, .tab-detail-actions, .line-actions-foot, .refusal-foot) > button:disabled {
  opacity: 0.4;
  cursor: default;
}
#stage > .screen :is(.misc-actions, .set-qty-foot, .tab-detail-actions, .line-actions-foot, .refusal-foot) > button:not(:disabled):active {
  transform: scale(0.98);
}
/* Tab detail: Print bill left, Void and Take payment right. */
#stage > .screen .tab-detail-actions .parked-action { flex: 0 0 auto; }
#stage > .screen .tab-detail-actions #tab-checkout-btn { min-width: 200px; }
/* The "No…" picker's footer was two full-width halves. */
#stage > .screen .no-picker-foot .big-btn { flex: 0 0 auto; }
/* Discount "Remove" sits in the body, not the footer — give it a shape. */
#discount-remove-btn {
  align-self: flex-start;
  min-height: 44px; padding: 0 18px; margin: 12px 24px 0;
  border-radius: 8px; border: 2px solid var(--danger, #cf5c5c);
  background: transparent; color: var(--danger, #cf5c5c);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}

/* Text boxes inside any sheet: the theme's field, not a white box. */
#stage > .screen :where(textarea, input[type="text"], input[type="email"], input[type="tel"],
                         input[type="number"], input[type="date"], input:not([type]), select) {
  box-sizing: border-box;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;
  outline: none;
}
#stage > .screen :where(textarea) { min-height: 96px; resize: none; line-height: 1.4; }
#stage > .screen :where(textarea, input, select)::placeholder { color: var(--fg-dim); opacity: 1; }
#stage > .screen :where(textarea, input, select):focus { border-color: var(--accent); }
#stage > .screen .misc-label { font-size: 13px; gap: 6px; }
#stage > .screen .misc-label > span:first-child { font-size: 15px; }
#stage > .screen form.misc-form .parked-hint {
  border: 0; padding: 0; font-size: 14px; font-style: normal; line-height: 1.45;
}
#stage > .screen .misc-hint { font-size: 13px; line-height: 1.4; }

/* Void-reason chips: the theme's chip, accent when picked. */
.void-chips { gap: 10px; margin: 4px 0 8px; }
.void-chip {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}
.void-chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg, #1a1a1a);
}

/* Move-items rows: bigger tick, whole row the target. */
#stage > .screen .move-line-row { min-height: 60px; padding: 10px 24px; }
#stage > .screen .move-line-row input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); }

/* Top-up: the keypad centred in the room, quick notes on one row. */
#stage > .screen .topup-body { flex: 1; justify-content: center; max-width: 380px; width: 100%; }
#stage > .screen .topup-notes .pay-note { display: flex; align-items: center; justify-content: center; white-space: nowrap; }

/* Line actions: filled sheet, so the old centre-and-rise animation
   (translate -50%) made it jump in from the left. Fade + rise only. */
#stage > [data-screen="line-actions"][data-active="true"] .line-actions-card,
#stage > [data-screen="no-picker"][data-active="true"] .parked-card {
  animation: sheet-rise 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheet-rise {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: none;             opacity: 1; }
}
#stage > .screen > .line-actions-card { box-shadow: none; }
#stage > .screen .line-actions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 24px;
  overflow-y: auto;
  align-content: start;
}
#stage > .screen .line-actions-list .line-actions-tile { width: 100%; min-height: 76px; }

/* Tab picker (v1.5.66): merge into / move items to. One row per tab,
   tap to choose (accent ring), then the action button confirms. */
.tabpick-item { grid-template-columns: 28px 1fr auto; min-height: 64px; }
.tabpick-radio {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); box-sizing: border-box;
}
.tabpick-item.is-on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tabpick-item.is-on .tabpick-radio { border: 7px solid var(--accent); }
.tabpick-new { grid-template-columns: 28px 1fr; }
.tabpick-new .parked-item-staff { color: var(--accent); font-weight: 700; }
#stage > .screen .tabpick-hint {
  border-top: 0; border-bottom: 1px solid var(--border);
  font-size: 14px; font-style: normal; color: var(--fg);
}
[data-screen="tab-picker"] .parked-list { flex: 1; }

/* askConfirm: the question in the prompt card, with a plain-words line. */
.ask-text-detail { margin: 0; font-size: 16px; line-height: 1.45; color: var(--fg); }
.ask-text-ok.is-danger { background: var(--danger, #cf5c5c); color: #fff; }
.tabpick-plus { font-size: 24px; font-weight: 700; color: var(--accent); text-align: center; line-height: 1; }
#stage > .screen #move-line-hint { font-size: 14px; font-style: normal; color: var(--fg); border-top: 0; border-bottom: 1px solid var(--border); }

/* Top-up: footer out of the keypad column, notes full width. */
#stage > .screen .topup-notes { width: 100%; }
#stage > .screen .topup-notes .pay-note { width: 100%; height: 52px; }

/* The older editor footers (quick edit, allergy, line note, line
   discount, ID check): same bar, same button shape. A "Clear …"
   button is an outlined red on the left; Cancel is outlined. */
#stage > .screen :is(.quick-edit-foot, .allergy-alert-foot, .line-note-foot, .line-discount-foot, .idcheck-foot) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  padding: 14px 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
#stage > .screen :is(.quick-edit-foot, .allergy-alert-foot, .line-note-foot, .line-discount-foot, .idcheck-foot) > button {
  min-height: 48px;
  min-width: 120px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
}
#stage > .screen :is(.quick-edit-cancel, .allergy-alert-cancel, .line-note-cancel, .line-discount-cancel, .idcheck-cancel, .refusal-cancel) {
  background: transparent;
  color: var(--fg);
  border: 2px solid var(--border);
}
#stage > .screen .idcheck-cancel { margin-right: auto; }
#stage > .screen :is(.allergy-alert-clear, .line-note-clear, .line-discount-clear) {
  background: transparent;
  color: var(--danger, #cf5c5c);
  border: 2px solid color-mix(in srgb, var(--danger, #cf5c5c) 55%, var(--border));
  margin-right: auto;
}
#stage > .screen .quick-edit-full { margin-right: auto; min-width: 0; padding: 0 8px; }

/* Parked list: To tab beside Recall (v1.5.67). */
[data-screen="parked-list"] .parked-item { grid-template-columns: 1fr auto auto auto; }
.parked-item-totab {
  appearance: none; min-height: 40px; padding: 0 16px; border-radius: 6px;
  border: 2px solid var(--border); background: transparent; color: var(--fg);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}

/* Compliance log sheet (v1.5.67) */
.comp-daynav { display: flex; align-items: center; gap: 6px; flex: 0 0 auto !important; }
.comp-day { min-width: 120px; text-align: center; font-weight: 700; font-size: 16px; }
.comp-day-btn {
  appearance: none; width: 44px; height: 44px; border-radius: 8px;
  border: 2px solid var(--border); background: transparent; color: var(--fg);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.comp-day-btn:disabled { opacity: 0.3; cursor: default; }
.comp-tabs { display: flex; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.comp-tab {
  appearance: none; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 2px solid var(--border); background: transparent; color: var(--fg);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.comp-tab span { opacity: 0.7; margin-left: 4px; }
.comp-tab.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #1a1a1a); }
.comp-list { flex: 1; }
.comp-item { grid-template-columns: 56px 1fr auto; cursor: default; }
.comp-time { font-family: var(--display); font-weight: 700; color: var(--fg-dim); }
.comp-badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 2px solid currentColor; }
.comp-badge-served  { color: #4fbf7f; }
.comp-badge-refused { color: var(--danger, #cf5c5c); }

/* Office sheet: the admin in an iframe filling the sheet (v1.5.67). */
.office-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* Journal: day ‹ › and receipt search (v1.5.67). */
.journal-toolbar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; border-bottom: 1px solid var(--border); }
.journal-search-form { display: flex; gap: 8px; margin-left: auto; }
#stage > .screen .journal-search-form input { width: 220px; min-height: 44px; padding: 8px 12px; font-size: 16px; }
.journal-search-go {
  appearance: none; min-height: 44px; padding: 0 18px; border-radius: 8px;
  border: 2px solid var(--border); background: transparent; color: var(--fg);
  font: inherit; font-weight: 700; cursor: pointer;
}

/* Journal detail + refund steps as a sheet (v1.5.67): they were a small
   centred box. Same size, header, × and footer as every other sheet. */
.journal-detail-host {
  padding: calc(var(--stage-top, 0px) + 10px) 10px 10px;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(0, 0, 0, 0.6);
}
.journal-detail-host > .journal-detail-card {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
}
.journal-detail-host .journal-detail-head {
  align-items: center;
  min-height: 64px;
  padding: 10px 12px 10px 24px;
  background: var(--surface);
}
.journal-detail-host .journal-detail-receipt {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.journal-detail-host .journal-detail-meta { font-size: 14px; }
.journal-detail-host .journal-detail-close {
  width: 44px; height: 44px; border: none; border-radius: 8px;
  font-size: 30px; line-height: 1; color: var(--fg-dim); background: transparent;
}
.journal-detail-host .journal-detail-close:hover { color: var(--fg); background: var(--bg); }
.journal-detail-host .journal-detail-body { padding: 18px 24px; }
.journal-detail-host :is(.refund-footer, .journal-detail-actions, .journal-detail-foot) {
  margin-top: auto;
  gap: 12px;
  padding: 14px 24px 16px;
  border-top: 1px solid var(--border);
}
.journal-detail-host .journal-detail-action {
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 140px;
  padding: 0 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border: 2px solid var(--accent);
}
.journal-detail-host .journal-detail-action-secondary {
  background: transparent;
  color: var(--fg);
  border: 2px solid var(--border);
}
.journal-detail-host .refund-total { font-size: 16px; }
.journal-detail-host .refund-total strong { font-size: 20px; }

/* Card button: battery icon with bars, no percentage (v1.5.80). */
.pay-method-card-battery { color: var(--fg-dim); line-height: 0; }
.pay-method-card-battery[data-level="ok"] { color: var(--tip-green, #4caf50); }
.card-battery-svg { display: block; }

/* Keypads react on touch-down (v1.5.79); this is the press flash, since
   :active doesn't show once the touch's default is prevented. */
.pin-key.is-pressed:not(:disabled),
.pay-key.is-pressed:not(:disabled),
.pair-key.is-pressed,
.set-qty-step.is-pressed:not(:disabled) {
  transform: scale(0.96);
  background: var(--accent);
  color: var(--accent-fg, #1a1a1a);
  border-color: var(--accent);
  transition: none;
}

/* =====================================================================
   v1.5.117 NEON CHROME (John): the till name, the page tabs and the
   draught size chips join the neon-edge look. Dark theme only — the
   light theme keeps its own styling.
   ===================================================================== */
:root[data-skin="neon"] .banner-logo {
  color: #fff;
  text-shadow: 0 0 4px #ff2bd6, 0 0 12px #ff2bd6, 0 0 24px rgba(255, 43, 214, .55);
  letter-spacing: .1em;
}
/* Tabs: dark glass; the live page is lit up cyan. */
:root[data-skin="neon"] .cat-pill {
  background: #120f1a;
  border: 1px solid rgba(255, 255, 255, .10);
  color: #a9a3bb;
}
:root[data-skin="neon"] .cat-pill[data-active="true"] {
  background: color-mix(in srgb, #00e5ff 16%, #0e0c16);
  border: 2px solid #00e5ff;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 229, 255, .8);
  box-shadow: 0 0 12px rgba(0, 229, 255, .45), inset 0 0 10px rgba(0, 229, 255, .2);
}
/* Size chips: dark glass; the chosen measure glows lime. */
:root[data-skin="neon"] .draught-measure-tile {
  background: #120f1a;
  border: 2px solid rgba(255, 255, 255, .14);
  color: #cfc9dd;
}
:root[data-skin="neon"] .draught-measure-tile[data-active="true"] {
  background: color-mix(in srgb, #b6ff00 22%, #0e0c16);
  border-color: #b6ff00;
  color: #fff;
  text-shadow: 0 0 10px rgba(182, 255, 0, .9);
  box-shadow: 0 0 14px rgba(182, 255, 0, .55), inset 0 0 10px rgba(182, 255, 0, .25);
}
:root[data-skin="neon"] .draught-measure-tile:active:not([data-active="true"]) {
  border-color: #b6ff00;
  color: #b6ff00;
}


/* =====================================================================
   THEMES (v1.5.118, John) — picked per till from ⋯ → Theme.
   <html data-theme="dark|light" data-skin="neon|vapor|midnight|classic|daylight|miami">
   data-theme picks the base palette (tokens.css + the light overrides
   throughout this file); data-skin dresses the product buttons, labels,
   tabs, size chips and till name. Every coloured button carries:
     --neon      its colour pushed to neon  (Neon, Vapor, Midnight, Daylight, Miami)
     --tile-raw  its colour as set          (Classic)
     --tile-ink  black or white for --tile-raw
   ===================================================================== */

/* Shared: empty taps stay invisible in every theme; labels in each
   group's colour. */
:root[data-skin] .product-btn.tile-neon.tap-slot-empty {
  background: transparent; border-color: transparent; box-shadow: none;
}
:root[data-skin="neon"] .tap-bank-label {
  color: var(--label-neon, var(--fg));
  text-shadow: 0 0 10px color-mix(in srgb, var(--label-neon, transparent) 60%, transparent);
}
:root[data-skin]:not([data-skin="neon"]) .product-btn.tile-neon:active:not(:disabled) {
  filter: brightness(1.18);
}

/* ---- VAPOR: sunset gradients ------------------------------------- */
:root[data-skin="vapor"] { --bg: #0d0716; --surface: #140a22; --surface2: #1a1028; --border: #2c1c44; --accent: #ff2bd6; --accent-fg: #fff; }
:root[data-skin="vapor"] .dash-buttons { background: linear-gradient(180deg, #140a22, #0a0612); }
:root[data-skin="vapor"] .product-btn.tile-neon {
  background: linear-gradient(135deg, color-mix(in srgb, var(--neon) 72%, #3a0a5a), color-mix(in srgb, var(--neon) 48%, #08040f));
  border: 0; border-radius: 10px; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 8px rgba(0,0,0,.45);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
:root[data-skin="vapor"] .product-btn.tile-neon .product-btn-price { color: #fff; opacity: .9; }
:root[data-skin="vapor"] .tap-bank-label { color: var(--label-neon, var(--fg)); }
:root[data-skin="vapor"] .banner-logo { background: linear-gradient(90deg, #ff2bd6, #9b5cff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
:root[data-skin="vapor"] .cat-pill { background: #1a1028; border: 0; color: #b9a8d6; }
:root[data-skin="vapor"] .cat-pill[data-active="true"] { background: linear-gradient(135deg, #ff2bd6, #7b2ff7); color: #fff; }
:root[data-skin="vapor"] .draught-measure-tile { background: #1a1028; border: 0; color: #d6c8ee; }
:root[data-skin="vapor"] .draught-measure-tile[data-active="true"] { background: linear-gradient(135deg, #ff2bd6, #7b2ff7); color: #fff; }

/* ---- MIDNIGHT: calm, flat, a colour bar per button ---------------- */
:root[data-skin="midnight"] { --bg: #0e121b; --surface: #161b27; --surface2: #1b2130; --border: #262e40; --accent: #7aa7ff; --accent-fg: #0b1020; }
:root[data-skin="midnight"] .dash-buttons { background: #11151f; }
:root[data-skin="midnight"] .product-btn.tile-neon {
  background: #1b2130; border: 0; border-left: 7px solid color-mix(in srgb, var(--neon) 80%, #888);
  border-radius: 6px; box-shadow: none; color: #fff; text-shadow: none;
}
:root[data-skin="midnight"] .product-btn.tile-neon .product-btn-price { color: #c7cfdf; }
:root[data-skin="midnight"] .tap-bank-label { color: #e8ecf5; }
:root[data-skin="midnight"] .banner-logo { color: #e8ecf5; }
:root[data-skin="midnight"] .cat-pill { background: #161b27; border: 0; color: #8d97ad; }
:root[data-skin="midnight"] .cat-pill[data-active="true"] { background: #1b2130; color: #fff; box-shadow: inset 0 0 0 2px #7aa7ff; }
:root[data-skin="midnight"] .draught-measure-tile { background: #1b2130; border: 0; color: #c7cfdf; }
:root[data-skin="midnight"] .draught-measure-tile[data-active="true"] { background: #7aa7ff; color: #0b1020; }

/* ---- CLASSIC: the original — solid colours, gold tabs ------------- */
:root[data-skin="classic"] .product-btn.tile-neon {
  background: var(--tile-classic, var(--tile-raw)); color: var(--tile-ink);
  border: 1px solid rgba(0,0,0,.25); border-radius: 6px; box-shadow: none;
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
:root[data-skin="classic"] .product-btn.tile-neon .product-btn-price { color: inherit; opacity: .92; }
/* tabs, size chips and till name: the base (gold) styling — nothing to add */

/* ---- DAYLIGHT: white buttons, neon outlines (light) --------------- */
:root[data-skin="daylight"] { --bg: #f3f1f8; --surface: #ffffff; --surface2: #eeebf5; --border: #dcd6ea; --accent: #c2108f; --accent-hover: #a10d77; --accent-fg: #fff; }
:root[data-skin="daylight"] .dash-buttons { background: #f3f1f8; }
:root[data-skin="daylight"] .product-btn.tile-neon {
  background: #fff; border: 2.5px solid color-mix(in srgb, var(--neon) 78%, #000); border-radius: 10px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--neon) 35%, transparent); color: #1d1530; text-shadow: none;
}
:root[data-skin="daylight"] .product-btn.tile-neon .product-btn-price { color: color-mix(in srgb, var(--neon) 60%, #000); }
:root[data-skin="daylight"] .product-btn-badge { background: #fff; }
:root[data-skin="daylight"] .tap-bank-label { color: color-mix(in srgb, var(--label-neon, #1d1530) 65%, #000); }
:root[data-skin="daylight"] .banner-logo { color: #c2108f; }
:root[data-skin="daylight"] .cat-pill { background: #fff; border: 2px solid #dcd6ea; color: #5b5470; }
:root[data-skin="daylight"] .cat-pill[data-active="true"] { background: #fff; border: 2.5px solid #00a8c2; color: #1d1530; box-shadow: 0 2px 6px rgba(0, 168, 194, .3); }
:root[data-skin="daylight"] .draught-measure-tile { background: #fff; border: 2px solid #d8d2e6; color: #3a3350; }
:root[data-skin="daylight"] .draught-measure-tile[data-active="true"] { background: #6fa800; border-color: #6fa800; color: #fff; }

/* ---- MIAMI: soft pastel buttons (light) --------------------------- */
:root[data-skin="miami"] { --bg: #fff7fb; --surface: #ffffff; --surface2: #ffeef6; --border: #f4d3e6; --accent: #ff4fa8; --accent-hover: #e63d93; --accent-fg: #fff; }
:root[data-skin="miami"] .dash-buttons { background: #fff7fb; }
:root[data-skin="miami"] .product-btn.tile-neon {
  background: color-mix(in srgb, var(--neon) 30%, #fff); border: 0; border-radius: 14px; color: #2a1d3d; text-shadow: none;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--neon) 55%, #fff), 0 4px 10px rgba(60,30,90,.12);
}
:root[data-skin="miami"] .product-btn.tile-neon .product-btn-price { color: #4a3a62; }
:root[data-skin="miami"] .product-btn-badge { background: #fff; }
:root[data-skin="miami"] .tap-bank-label { color: color-mix(in srgb, var(--label-neon, #2a1d3d) 55%, #3a2050); }
:root[data-skin="miami"] .banner-logo { color: #ff4fa8; }
:root[data-skin="miami"] .cat-pill { background: #ffe9f4; border: 0; color: #8a5b78; border-radius: 12px; }
:root[data-skin="miami"] .cat-pill[data-active="true"] { background: #ff6eb9; color: #fff; }
:root[data-skin="miami"] .draught-measure-tile { background: #fff; border: 2px solid #f4d3e6; color: #6b4a63; border-radius: 12px; }
:root[data-skin="miami"] .draught-measure-tile[data-active="true"] { background: #4fbf88; border-color: #4fbf88; color: #fff; }


/* =====================================================================
   THEMES ACROSS EVERY SCREEN (v1.5.119, John) — sheets, modifier pages,
   keypads, menus, journal, tabs, sign-in. Two layers:
     1. Each skin sets the shared colour tokens (--bg, --surface,
        --surface2, --border, --accent, --accent-fg …). Every sheet in
        this file already paints with those, and the hard-coded golds
        were converted to var(--accent) in v1.5.119, so most of the
        till follows the theme from this alone.
     2. A light "component" layer gives each skin its character on the
        shared building blocks: cards, buttons, primary/danger buttons,
        selected options, keys and inputs.
   Classic sets nothing: it is the original look.
   Functional colours are NOT themed: Cash/Card states, staff colours,
   red danger, green/yellow/red notifications keep their meaning.
   ===================================================================== */

/* ---- Layer 1: tokens (Vapor, Midnight, Daylight, Miami set theirs above) */
:root[data-skin="neon"] {
  --bg: #0c0a12; --surface: #14111c; --surface2: #1b1726; --border: #2b2638; --border2: #3a3450;
  --accent: #00e5ff; --accent-hover: #5ff0ff; --accent-fg: #04161c;
}
:root[data-skin="vapor"]    { --border2: #3d2a5c; --accent-hover: #ff5ee1; }
:root[data-skin="midnight"] { --border2: #34405a; --accent-hover: #9dbdff; }

/* ---- Layer 2: shared building blocks ------------------------------ */
/* Cards and sheets */
:root[data-skin]:not([data-skin="classic"]) :is(.parked-card, .modifier-sheet-card, .journal-card, .journal-detail-card,
  .complete-banner-card, .pair-card, .reg-card, .basket-menu-pop) {
  background: var(--surface); color: var(--fg); border: 1px solid var(--border);
}
/* Selected options anywhere: modifier choices, discount type, refund reason, day pickers */
:root[data-skin]:not([data-skin="classic"]) :is(.modsheet-option[data-selected="true"], .refund-reason-btn.is-picked,
  .discount-type-btn[data-active="true"], .line-discount-type-btn[data-active="true"], .comp-day-btn[data-active="true"]) {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--fg);
}
/* Primary buttons read on the accent */
:root[data-skin]:not([data-skin="classic"]) :is(.parked-action-primary, .reg-btn-next, .reg-btn-confirm) {
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
}

/* ---- NEON: dark glass, glowing edges ------------------------------ */
:root[data-skin="neon"] :is(.parked-card, .modifier-sheet-card, .journal-card, .journal-detail-card, .complete-banner-card,
  .pair-card, .reg-card, .basket-menu-pop) {
  border: 1px solid rgba(0, 229, 255, .35);
  box-shadow: 0 0 0 1px rgba(255, 43, 214, .12), 0 0 28px rgba(0, 229, 255, .16), 0 16px 48px rgba(0, 0, 0, .6);
}
:root[data-skin="neon"] :is(.parked-header h2, .parked-title, .modifier-sheet-title, .journal-title) {
  color: #fff; text-shadow: 0 0 10px rgba(0, 229, 255, .55);
}
:root[data-skin="neon"]:not([data-skin="classic"]) :is(.parked-action-primary, .reg-btn-next, .reg-btn-confirm, .openitems-continue, .ask-text-ok:not(.is-danger),
  .allergy-alert-save, .line-note-save, .quick-edit-save, .idcheck-save, .utfb-search-pick-btn) {
  background: color-mix(in srgb, #00e5ff 20%, #0e0c16); color: #fff; border: 2px solid #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, .5), inset 0 0 10px rgba(0, 229, 255, .2); text-shadow: 0 0 8px rgba(0, 229, 255, .7);
}
:root[data-skin="neon"] :is(.parked-action-danger, .ask-text-ok.is-danger) {
  background: color-mix(in srgb, #ff3b6b 18%, #0e0c16); color: #fff; border: 2px solid #ff3b6b;
  box-shadow: 0 0 12px rgba(255, 59, 107, .5);
}
:root[data-skin="neon"] :is(.modsheet-option[data-selected="true"], .refund-reason-btn.is-picked) {
  box-shadow: 0 0 12px rgba(0, 229, 255, .45), inset 0 0 10px rgba(0, 229, 255, .18);
}
:root[data-skin="neon"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn) {
  background: #14111c; border-color: #2b2638; color: #fff;
}
:root[data-skin="neon"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn):active:not(:disabled),
:root[data-skin="neon"] :is(.pin-key, .pay-key, .pair-key, .set-qty-step).is-pressed {
  background: color-mix(in srgb, #00e5ff 30%, #0e0c16); border-color: #00e5ff; color: #fff;
  box-shadow: 0 0 14px rgba(0, 229, 255, .6);
}
:root[data-skin="neon"] :is(input[type="text"], input[type="search"], input[type="number"], input[type="tel"], input[type="email"], textarea, select):focus {
  border-color: #00e5ff; box-shadow: 0 0 0 2px rgba(0, 229, 255, .3), 0 0 12px rgba(0, 229, 255, .3); outline: none;
}

/* ---- VAPOR: gradients ---------------------------------------------- */
:root[data-skin="vapor"] :is(.parked-card, .modifier-sheet-card, .journal-card, .journal-detail-card, .complete-banner-card,
  .pair-card, .reg-card, .basket-menu-pop) {
  background: linear-gradient(180deg, #1c0f30, #120a20); border: 1px solid #3d2a5c; border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .6);
}
:root[data-skin="vapor"]:not([data-skin="classic"]) :is(.parked-action-primary, .reg-btn-next, .reg-btn-confirm, .openitems-continue, .ask-text-ok:not(.is-danger),
  .allergy-alert-save, .line-note-save, .quick-edit-save, .idcheck-save, .utfb-search-pick-btn) {
  background: linear-gradient(135deg, #ff2bd6, #7b2ff7); color: #fff; border: 0;
}
:root[data-skin="vapor"]:not([data-skin="classic"]) :is(.modsheet-option[data-selected="true"], .refund-reason-btn.is-picked) {
  background: linear-gradient(135deg, color-mix(in srgb, #ff2bd6 30%, #1a1028), color-mix(in srgb, #7b2ff7 30%, #1a1028));
  border-color: #ff2bd6;
}
:root[data-skin="vapor"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn) { background: #1a1028; border-color: #2c1c44; color: #f2e9ff; }
:root[data-skin="vapor"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn):active:not(:disabled),
:root[data-skin="vapor"] :is(.pin-key, .pay-key, .pair-key, .set-qty-step).is-pressed { background: linear-gradient(135deg, #ff2bd6, #7b2ff7); color: #fff; }

/* ---- MIDNIGHT: flat and quiet (the tokens do most of it) ----------- */
:root[data-skin="midnight"] :is(.parked-card, .modifier-sheet-card, .journal-card, .journal-detail-card, .complete-banner-card,
  .pair-card, .reg-card, .basket-menu-pop) { box-shadow: 0 12px 36px rgba(0, 0, 0, .55); }
:root[data-skin="midnight"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn) { background: #1b2130; border-color: #262e40; color: #e8ecf5; }
:root[data-skin="midnight"] .modsheet-option[data-selected="true"] { box-shadow: inset 4px 0 0 #7aa7ff; }

/* ---- DAYLIGHT: white, crisp outlines ------------------------------ */
:root[data-skin="daylight"] :is(.parked-card, .modifier-sheet-card, .journal-card, .journal-detail-card, .complete-banner-card,
  .pair-card, .reg-card, .basket-menu-pop) {
  background: #fff; border: 1px solid #dcd6ea; box-shadow: 0 12px 40px rgba(40, 20, 80, .18);
}
:root[data-skin="daylight"] :is(.parked-header h2, .parked-title, .modifier-sheet-title, .journal-title) { color: #1d1530; }
:root[data-skin="daylight"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn) { background: #fff; border: 2px solid #dcd6ea; color: #1d1530; }
:root[data-skin="daylight"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn):active:not(:disabled),
:root[data-skin="daylight"] :is(.pin-key, .pay-key, .pair-key, .set-qty-step).is-pressed { background: #c2108f; border-color: #c2108f; color: #fff; }
:root[data-skin="daylight"] .modsheet-option { background: #fff; }

/* ---- MIAMI: soft and rounded -------------------------------------- */
:root[data-skin="miami"] :is(.parked-card, .modifier-sheet-card, .journal-card, .journal-detail-card, .complete-banner-card,
  .pair-card, .reg-card, .basket-menu-pop) {
  background: #fff; border: 0; border-radius: 22px; box-shadow: 0 14px 44px rgba(255, 79, 168, .22);
}
:root[data-skin="miami"] :is(.parked-action, .parked-action-primary, .parked-action-danger, .modsheet-option, .pay-key, .pin-key,
  .pair-key, .modsheet-step-btn, .basket-action) { border-radius: 14px; }
:root[data-skin="miami"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn) { background: #fff; border: 2px solid #f4d3e6; color: #4a2f45; }
:root[data-skin="miami"] :is(.pay-key, .pin-key, .pair-key, .modsheet-step-btn):active:not(:disabled),
:root[data-skin="miami"] :is(.pin-key, .pay-key, .pair-key, .set-qty-step).is-pressed { background: #ff6eb9; border-color: #ff6eb9; color: #fff; }
:root[data-skin="miami"] .modsheet-option { background: #fff7fb; border-color: #f4d3e6; }
:root[data-skin="miami"]:not([data-skin="classic"]) .modsheet-option[data-selected="true"] { background: #ffe1f0; border-color: #ff6eb9; }

/* v1.5.119: a few older sheets paint with colour names the token set
   never defined (--text, --line, --surface-2 …), so they always fell
   back to hard-coded dark greys — black chips on the light themes.
   Map them onto the real tokens for every theme except Classic (which
   keeps those fallbacks, i.e. exactly the original look). */
:root[data-skin]:not([data-skin="classic"]) {
  --text: var(--fg); --text-dim: var(--fg-dim); --line: var(--border);
  --surface-2: var(--surface2); --surface3: var(--surface2); --bg-2: var(--surface2);
  --bg-soft: var(--surface); --surface-hi: color-mix(in srgb, var(--fg) 9%, transparent);
  --accent-strong: var(--accent-hover);
}


/* v1.5.122 (John): page tabs are buttons, not folder tabs — rounded on
   all four corners with an edge all the way round, like the product
   buttons, and a little gap between them and the grid. Every theme. */
.cat-pill { border-radius: 8px; border-bottom: 1px solid var(--border); }
:root[data-skin="neon"] .cat-pill { border-bottom: 1px solid rgba(255, 255, 255, .10); }
:root[data-skin="neon"] .cat-pill[data-active="true"] { border-bottom: 2px solid #00e5ff; }
:root[data-skin="daylight"] .cat-pill { border-bottom: 2px solid #dcd6ea; }
:root[data-skin="daylight"] .cat-pill[data-active="true"] { border-bottom: 2.5px solid #00a8c2; }
:root[data-skin="vapor"] .cat-pill, :root[data-skin="midnight"] .cat-pill { border-bottom: 0; }
:root[data-skin="miami"] .cat-pill { border-bottom: 0; border-radius: 12px; }
.dash-categories { padding-top: 0; padding-bottom: 6px; }   /* still no gap above (v1.5.103) */

/* =====================================================================
   v1.5.123 BASKET (John): bigger lines and a − n + on each one.
   ===================================================================== */
.basket-line { font-size: 17px; }
.basket-line-fg {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 8px 14px 8px 10px;
}
.basket-line-fg > .basket-line-qty   { grid-column: 1; grid-row: 1; }
.basket-line-fg > .basket-line-name  { grid-column: 2; grid-row: 1; font-size: 17px; font-weight: 700; }
.basket-line-fg > .basket-line-price { grid-column: 3; grid-row: 1; font-size: 17px; font-weight: 700; }
/* modifiers, notes, discounts sit under the name, not under the stepper */
.basket-line-fg > :not(.basket-line-qty):not(.basket-line-name):not(.basket-line-price) { grid-column: 2 / -1; }
.basket-line-modifier, .basket-line-removal { font-size: 14px; }
.basket-line-note { font-size: 14px; }
.basket-line-qty { display: inline-flex; align-items: center; gap: 2px; }
.basket-qty-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--fg); font-size: 22px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  touch-action: manipulation;
}
.basket-qty-btn:active:not(:disabled) { background: var(--accent); color: var(--accent-fg, #1a1a1a); border-color: var(--accent); }
.basket-qty-btn:disabled { opacity: .3; cursor: default; }
.basket-qty-n { min-width: 30px; text-align: center; font-family: var(--mono); font-weight: 800; font-size: 18px; }
:root[data-skin="neon"] .basket-qty-btn { background: #14111c; border-color: #2b2638; }
:root[data-skin="neon"] .basket-qty-btn:active:not(:disabled) { background: color-mix(in srgb, #00e5ff 30%, #0e0c16); border-color: #00e5ff; color: #fff; box-shadow: 0 0 12px rgba(0,229,255,.55); }
:root[data-skin="miami"] .basket-qty-btn { border-radius: 12px; }

/* v1.5.123: the basket is outlined in the active person's colour.
   v1.5.124: a real border (the contents sit inside it), not an overlay
   — the overlay covered the edges of Cash / Card. */
.dash-basket { box-sizing: border-box; }
.dash-basket[data-owner="true"] {
  border: 3px solid var(--basket-owner, var(--accent));
  border-radius: 6px;
}
:root[data-skin="neon"] .dash-basket[data-owner="true"] {
  box-shadow: 0 0 12px color-mix(in srgb, var(--basket-owner, var(--accent)) 45%, transparent);
}

/* v1.5.123: the draught labels can be held (put a beer on the next empty
   tap). They still look like plain text — no button styling. */
.tap-bank-label.tap-bank-label-hold { pointer-events: auto; cursor: default; -webkit-touch-callout: none; touch-action: manipulation; transition: opacity .2s; }
.tap-bank-label.tap-bank-label-hold[data-pressing="true"] { opacity: .55; }

/* =====================================================================
   v1.5.125 BASKET ROOM (John: "we need every pixel") — tighter lines,
   header, totals and keypad so more lines fit; no padding round EXACT
   REMAINING; and markers for lines out of sight above / below.
   ===================================================================== */
.basket-header-row { padding: 6px 10px; }
.basket-header-row .basket-action { min-height: 42px; }
.basket-line-fg { padding: 3px 12px 3px 8px; gap: 2px 10px; }
.basket-qty-btn { width: 34px; height: 34px; font-size: 20px; }
.basket-totals { padding: 4px 14px; }
.pay-panel { padding-top: 0; gap: 4px; }
.pay-display { min-height: 40px; padding: 4px 14px; border-radius: 0 0 8px 8px; border-top: 0; }
.pay-key { height: 52px; }
.pay-method { min-height: 54px; padding: 8px; }

/* Out-of-sight markers: zero-height shelves either side of the list, so
   they take no room; the pill hangs into the list. */
.basket-more-shelf { position: relative; height: 0; z-index: 6; }
.basket-more-shelf[data-show="false"] { display: none; }
.basket-more { position: absolute; left: 50%; transform: translateX(-50%);
  padding: 4px 14px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--surface2); color: var(--fg); font-size: 13px; font-weight: 800; letter-spacing: .04em;
  box-shadow: 0 2px 10px rgba(0,0,0,.45); cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.basket-more-up .basket-more   { top: 4px; }
.basket-more-down .basket-more { bottom: 4px; }
/* a soft fade on the edge where lines continue */
.basket-more-shelf::before { content: ''; position: absolute; left: 0; right: 0; height: 26px; pointer-events: none; }
.basket-more-up::before   { top: 0;    background: linear-gradient(var(--surface), transparent); }
.basket-more-down::before { bottom: 0; background: linear-gradient(transparent, var(--surface)); }
.basket-more { min-width: 64px; padding: 3px 18px; font-size: 15px; line-height: 1.2; }
:root[data-skin="neon"] .basket-more { border: 2px solid var(--sys); color: var(--sys); text-shadow: 0 0 8px var(--sys-glow);
  box-shadow: 0 0 10px var(--sys-glow); background: #14111c; }
/* A little clearance between Cash / Card and the basket's coloured
   border (John: they mustn't touch). */
.pay-panel { padding-bottom: 4px; }

/* =====================================================================
   v1.5.127 NEON SYSTEM COLOUR (John): one theme-wide colour for the
   till's own controls — till name, page tabs, draught size chips and
   sheet titles — so they read as "the till", apart from the product
   colours. Lemon yellow (white wine and shots are near it, but they sit on tiles, not in the chrome).
   ===================================================================== */
:root[data-skin="neon"] { --sys: #fff44f; --sys-glow: rgba(255, 244, 79, .55); }
:root[data-skin="neon"] .banner-logo {
  color: #fff;
  text-shadow: 0 0 4px var(--sys), 0 0 12px var(--sys), 0 0 24px var(--sys-glow);
}
:root[data-skin="neon"] .cat-pill[data-active="true"],
:root[data-skin="neon"] .draught-measure-tile[data-active="true"] {
  background: color-mix(in srgb, var(--sys) 16%, #0e0c16);
  border: 2px solid var(--sys);
  color: #fff;
  text-shadow: 0 0 8px var(--sys-glow);
  box-shadow: 0 0 12px var(--sys-glow), inset 0 0 10px rgba(255, 244, 79, .2);
}
:root[data-skin="neon"] .cat-pill:active:not([data-active="true"]),
:root[data-skin="neon"] .draught-measure-tile:active:not([data-active="true"]) {
  border-color: var(--sys);
  color: var(--sys);
}
:root[data-skin="neon"] :is(.parked-header h2, .parked-title, .modifier-sheet-title, .journal-title) {
  color: #fff; text-shadow: 0 0 10px var(--sys-glow);
}
/* Sheet confirmation buttons wear the system colour too (Add to order,
   Apply, Save, OK, Take payment…). Danger buttons stay red. :is(#stage, body)
   lifts this over the #stage footer rules that paint them accent. */
:root[data-skin="neon"] :is(#stage, body) :is(.parked-action-primary, .reg-btn-next, .reg-btn-confirm, .openitems-continue,
  .ask-text-ok:not(.is-danger), .allergy-alert-save, .line-note-save, .quick-edit-save, .idcheck-save, .utfb-search-pick-btn,
  .line-discount-apply, .big-btn.primary, .journal-search-go, .refusal-save) {
  background: color-mix(in srgb, var(--sys) 16%, #0e0c16);
  border: 2px solid var(--sys);
  color: #fff;
  text-shadow: 0 0 8px var(--sys-glow);
  box-shadow: 0 0 12px var(--sys-glow), inset 0 0 10px rgba(255, 244, 79, .2);
}
:root[data-skin="neon"] :is(#stage, body) :is(.parked-action-primary, .reg-btn-next, .reg-btn-confirm, .openitems-continue,
  .ask-text-ok:not(.is-danger), .allergy-alert-save, .line-note-save, .quick-edit-save, .idcheck-save, .utfb-search-pick-btn,
  .line-discount-apply, .big-btn.primary, .journal-search-go, .refusal-save):disabled {
  opacity: .4; box-shadow: none; text-shadow: none;
}

/* Line tools in the long-press edit sheet (v1.5.127): discount, allergy,
   void — one row of plain buttons above the quantity. */
.modsheet-line-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.modsheet-line-tools[hidden] { display: none; }
.modsheet-tool { flex: 1 1 0; min-width: 120px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 12px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface2); color: var(--fg);
  font-size: 15px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.modsheet-tool-icon { font-size: 17px; opacity: .85; }
.modsheet-tool.is-warn   { border-color: #e0a23a; color: #e0a23a; }
.modsheet-tool.is-danger { border-color: var(--danger, #cf5c5c); color: var(--danger, #cf5c5c); }
.modsheet-tool:active { transform: scale(.98); }
:root[data-skin="neon"] .modsheet-tool { background: #14111c; border-color: #2b2638; color: #fff; }
:root[data-skin="neon"] .modsheet-tool.is-warn   { border-color: #ffb000; color: #ffb000; }
:root[data-skin="neon"] .modsheet-tool.is-danger { border-color: #ff3b6b; color: #ff3b6b; box-shadow: 0 0 8px rgba(255, 59, 107, .35); }

/* Spirit picker on one screen (v1.5.127): sizes on top, mixers below,
   sized to fit the iPad stage without scrolling. */
.spirpick-head { padding: 12px 24px 0; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-dim, #b0b0b0); }
#spirpick-body > .picker-grid.spirpick-sizes,
#spirpick-body > .picker-grid.spirpick-mixers { padding: 8px 24px 6px; gap: 12px; justify-content: flex-start; }
#spirpick-body .spirpick-sizes .picker-tile { flex: 0 0 calc((100% - 2 * 12px) / 3); height: 118px; font-size: 28px; }
#spirpick-body .spirpick-mixers .picker-tile { flex: 0 0 calc((100% - 4 * 12px) / 5); height: 106px; font-size: 22px; }
#spirpick-body .picker-tile[data-picked="true"] { border: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
:root[data-skin="neon"] #spirpick-body .picker-tile[data-picked="true"] {
  border-color: var(--sys); background: color-mix(in srgb, var(--sys) 16%, #0e0c16);
  box-shadow: 0 0 12px var(--sys-glow), inset 0 0 10px rgba(255, 244, 79, .2);
}

/* Neon sheet titles in the system colour, over the #stage title rule. */
:root[data-skin="neon"] :is(#stage, body) :is(.parked-header h2, .parked-title, .modifier-sheet-title, .journal-title) {
  color: var(--sys); text-shadow: 0 0 10px var(--sys-glow);
}

/* =====================================================================
   v1.5.128 (John): no glowing TEXT anywhere. It smears on the iPad's
   screen. Outlines and button glows stay; letters are drawn crisp.
   With the glow gone the till name carries the system colour itself.
   ===================================================================== */
:root[data-skin] *, :root[data-skin] *::before, :root[data-skin] *::after { text-shadow: none !important; }
:root[data-skin="neon"] .banner-logo { color: var(--sys); }

/* v1.5.129: a line with no options and no ticket is a short sheet along
   the bottom — quantity, discount, void, save — not a screen of nothing. */
#stage > .screen > .modifier-sheet-card.is-compact { top: auto; }
.modifier-sheet-card.is-compact .modifier-sheet-body[hidden],
.modsheet-note-label[hidden] { display: none; }
.modifier-sheet-card.is-compact .modifier-sheet-foot { border-top: 0; }
.modsheet-waste-head { flex: 1 1 100%; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-dim, #b0b0b0); }
:root[data-skin="neon"] .modsheet-waste-head { color: #ffb000; }

/* Basket refund → card: the sales it could have come from (v1.5.147). */
.refund-match-list { display: flex; flex-direction: column; gap: 8px; }
.refund-match {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2, rgba(255,255,255,0.04)); color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.refund-match-card { font-size: 22px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.refund-match-when { opacity: 0.75; font-size: 14px; }
.refund-match-amt { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.refund-match-note, .refund-match-none { margin-top: 12px; opacity: 0.8; font-size: 14px; line-height: 1.4; }

/* Staff pills stay tappable over a question dialog (v1.5.157): a pill tap
   is a handover, and the handover cancels the outgoing operator's
   question rather than the dialog swallowing the tap. */
body:has(.ask-text) #banner { z-index: 9001; pointer-events: none; }   /* above the dialog's backdrop… */
body:has(.ask-text) #staff-chips { pointer-events: auto; }            /* …but only the pills take taps */

/* ===== Power cut pill (v1.5.158; Solo-style battery v1.5.160) =====
   AC LOST + the Solo's three-bar battery. No words, no percentage.
   full 3 green · fair 2 yellow · low 1 amber · critical 1 red pulsing ·
   shutting down 0 red pulsing. */
.ups-pill {
  display: inline-flex; align-items: center; gap: 10px;
  margin-left: 12px; padding: 6px 12px; border-radius: 999px;
  border: 2px solid #c62828; background: rgba(198, 40, 40, 0.18);
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 0.06em; white-space: nowrap;
}
.ups-pill[hidden] { display: none; }
.ups-batt { line-height: 0; display: inline-flex; }
.ups-batt svg { width: 34px; height: 18px; }
.ups-pill[data-band="full"]     .ups-batt { color: #3fb950; }
.ups-pill[data-band="fair"]     .ups-batt { color: #e8c020; }
.ups-pill[data-band="low"]      .ups-batt { color: #e8801a; }
.ups-pill[data-band="critical"] .ups-batt,
.ups-pill[data-band="shutdown"] .ups-batt { color: #ff3b30; }
.ups-pill[data-band="critical"], .ups-pill[data-band="shutdown"] { animation: ups-pulse 1s ease-in-out infinite; background: rgba(198, 40, 40, 0.45); }
@keyframes ups-pulse { 50% { background: rgba(198, 40, 40, 0.9); } }
@media (prefers-reduced-motion: reduce) { .ups-pill[data-band] { animation: none; } }

/* Add product (v1.5.167, John): the wizard is the only window. The
   office sheet's own card, title and ✕ go; the embedded wizard brings
   its own ✕ / Cancel. If the wizard hasn't shown within 8s the sheet's
   ✕ comes back (till.js), so there's always a way out. */
.screen[data-screen="office-frame"].bare .parked-card {
  top: 0; left: 0; right: 0; bottom: 0; transform: none;
  width: auto; max-height: none; height: 100%;
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
}
#stage > .screen[data-screen="office-frame"].bare .parked-header { display: none; }
#stage > .screen[data-screen="office-frame"].bare.stuck .parked-header { display: flex; border-bottom: 0; }
.screen[data-screen="office-frame"].bare .office-frame { background: transparent; }

/* Add cask → Mark tap empty (v1.5.172): red outline, left of Save. */
.drwiz-empty-btn {
  background: transparent !important;
  color: var(--danger, #e05252) !important;
  border: 2px solid color-mix(in srgb, var(--danger, #e05252) 60%, transparent) !important;
}
.drwiz-empty-btn[hidden] { display: none !important; }

@media (max-width: 760px) { .login-bottom-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Move buttons mode (v1.5.219): hold a product tile, then drag tiles
   about or tap one to edit it. Yellow = instruction (message colours). */
.arrange-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 16px;
  background: var(--warn, #f5c400); color: #111;
  font-weight: 600; font-size: 15px; line-height: 1.3;
}
.arrange-bar[hidden] { display: none; }
.arrange-bar .arrange-done {
  margin-left: auto; flex-shrink: 0;
  min-height: 44px; padding: 0 26px; border: 0; border-radius: 10px;
  background: #111; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
body.arranging #dash-buttons .layout-btn[data-kind="product"] {
  touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  outline: 2px dashed var(--warn, #f5c400); outline-offset: -4px;
  animation: arrange-wobble .3s ease-in-out infinite alternate;
}
body.arranging #dash-buttons .layout-btn:not([data-kind="product"]),
body.arranging #dash-buttons .tap-bank-label:not([data-cat-id]) { opacity: .35; }
/* A group's name on Spirits / Wine: drag it to move the whole group. */
body.arranging #dash-buttons .tap-bank-label[data-cat-id] {
  pointer-events: auto;
  touch-action: none; -webkit-user-select: none; user-select: none;
  outline: 2px dashed var(--warn, #f5c400); outline-offset: -4px; cursor: grab;
}
body.arranging #dash-buttons .tap-bank-label.arrange-source { opacity: .3; }
body.arranging #dash-buttons .arrange-group-target {
  outline: 4px solid var(--warn, #f5c400) !important; outline-offset: -4px; animation: none;
}
body.arranging #dash-buttons .layout-btn.arrange-source { opacity: .25; animation: none; outline-style: solid; }
.arrange-ghost {
  position: fixed; z-index: 9999; margin: 0; pointer-events: none;
  opacity: .92; transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
}
@keyframes arrange-wobble { from { transform: rotate(-1deg); } to { transform: rotate(1deg); } }
@media (prefers-reduced-motion: reduce) {
  body.arranging #dash-buttons .layout-btn[data-kind="product"] { animation: none; }
}

/* Open tabs list: Add (basket → this tab) beside View (v1.5.223). */
[data-screen="tabs-list"] .tab-item { grid-template-columns: 1fr auto auto auto auto; }
/* Print the bill from the list (v1.5.254), between Add and View. */
.tab-row-print {
  appearance: none; min-height: 40px; padding: 0 22px; border-radius: 6px;
  border: 2px solid var(--border); background: transparent; color: var(--fg);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.tab-row-print:disabled { opacity: .4; cursor: default; }
.tab-row-add {
  appearance: none; min-height: 40px; padding: 0 22px; border-radius: 6px;
  border: 0; background: var(--tip-green, #2e9e5b); color: #fff;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.tab-row-add:disabled { background: transparent; border: 2px solid var(--border); color: var(--muted); opacity: .5; cursor: default; }
[data-screen="tabs-list"] .parked-item-recall { min-height: 40px; display: flex; align-items: center; padding: 0 22px; font-size: 15px; }

/* No table service (the Boar): the big "+ New tab" banner at the top of
   the list replaces the small header button (v1.5.227). */
:root[data-table-service="off"] #tab-new-tableplan-btn { display: none; }


/* ---- Kitchen now (v1.5.234) ---------------------------------------- */
.kitchen-live-ready {
  background: #06b6d4; color: #001b20;
  font-size: 15px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
}
.kitchen-live-station {
  margin: 14px 0 6px; font-size: 13px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim, #888);
}
.kitchen-live-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
  padding: 12px 14px; margin-bottom: 8px; border-radius: 12px;
  border: 1px solid var(--border, #2a2a2a); border-left: 8px solid #22c55e;
  background: var(--surface, #151515);
}
.kitchen-live-row[data-band="warn"]  { border-left-color: #f59e0b; }
.kitchen-live-row[data-band="alarm"] { border-left-color: #ef4444; }
.kitchen-live-row[data-state="away"] { border-left-color: #06b6d4; }
.kitchen-live-title { font-size: 20px; font-weight: 800; }
.kitchen-live-title small { font-size: 14px; font-weight: 600; color: var(--fg-dim, #888); margin-left: 6px; }
.kitchen-live-state { font-size: 16px; font-weight: 800; }   /* not uppercase: "23M" reads as millions */
.kitchen-live-row[data-state="away"] .kitchen-live-state { color: #06b6d4; }
.kitchen-live-row[data-band="warn"]  .kitchen-live-state { color: #f59e0b; }
.kitchen-live-row[data-band="alarm"] .kitchen-live-state { color: #ef4444; }
.kitchen-live-items { grid-column: 1 / -1; font-size: 15px; color: var(--fg-dim, #aaa); line-height: 1.4; }
.kitchen-live-allergy { grid-column: 1 / -1; font-size: 14px; font-weight: 800; color: #b45309; }
.kitchen-live-sent {
  grid-row: 1 / span 2; grid-column: 2;
  min-height: 48px; padding: 0 18px; border-radius: 10px;
  border: 2px solid #06b6d4; background: transparent; color: inherit;
  font-size: 17px; font-weight: 800;
}
.kitchen-live-row[data-state="away"] .kitchen-live-sent { background: #06b6d4; color: #001b20; }


/* ---- Bookings diary (v1.5.250) ------------------------------------- */
[data-screen="bookings"] { background: rgba(0, 0, 0, 0.5); }
.bookings-next { font-size: 13px; font-weight: 700; opacity: .8; margin-left: 2px; }
.bookings-card { width: min(980px, 96vw); max-height: 90vh; }
.bookings-header { gap: 12px; flex-wrap: wrap; }
.bookings-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.bookings-step, .bookings-today, .bookings-add {
  min-height: 48px; min-width: 48px; padding: 0 14px; border-radius: 10px;
  border: 2px solid var(--border); background: transparent; color: var(--fg);
  font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
}
.bookings-step { font-size: 26px; line-height: 1; }
.bookings-add { border-color: var(--accent); color: var(--accent); }
.bookings-day { position: relative; min-height: 48px; display: flex; align-items: center; padding: 0 14px;
  border: 2px solid var(--border); border-radius: 10px; font-weight: 800; font-size: 17px; cursor: pointer; white-space: nowrap; }
/* The native date picker sits invisibly over the label: tap the day to pick one. */
#stage > .screen .bookings-day input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.bookings-totals { padding: 10px 24px 0; font-size: 15px; font-weight: 700; color: var(--fg-dim); min-height: 1em; }
.bookings-body { padding: 8px 16px 16px; overflow-y: auto; }
.bookings-row {
  display: grid; grid-template-columns: 74px 1fr 70px auto; gap: 4px 14px; align-items: center;
  padding: 12px 14px; margin-bottom: 8px; border-radius: 12px;
  border: 1px solid var(--border); border-left: 8px solid var(--accent); background: var(--surface);
}
.bookings-row[data-status="arrived"] { border-left-color: #22c55e; }
.bookings-row[data-status="cancelled"], .bookings-row[data-status="no_show"] { border-left-color: var(--border); opacity: .55; }
.bookings-row[data-status="cancelled"] .bookings-name, .bookings-row[data-status="no_show"] .bookings-name { text-decoration: line-through; }
.bookings-time { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bookings-name { font-size: 19px; font-weight: 800; }
.bookings-status { margin-left: 10px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-dim); text-decoration: none; display: inline-block; }
.bookings-row[data-status="arrived"] .bookings-status { color: #22c55e; }
.bookings-meta { font-size: 14px; color: var(--fg-dim); }
.bookings-note { font-size: 15px; margin-top: 2px; }
.bookings-staffnote { font-size: 14px; margin-top: 2px; color: var(--accent); }
.bookings-party { text-align: center; line-height: 1.05; }
.bookings-party b { display: block; font-size: 28px; font-weight: 800; }
.bookings-party span { font-size: 12px; color: var(--fg-dim); }
.bookings-actions { display: flex; gap: 8px; align-items: center; }
.bookings-actions button, .bookings-sheet-actions button {
  min-height: 48px; padding: 0 16px; border-radius: 10px; border: 2px solid var(--border);
  background: transparent; color: var(--fg); font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.bookings-table { border-style: dashed !important; color: var(--fg-dim) !important; }
.bookings-table.has { border-style: solid !important; border-color: var(--accent) !important; color: var(--fg) !important; }
.bookings-table:disabled { visibility: hidden; }
.bookings-arrived { border-color: #22c55e !important; }
.bookings-sheet { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); z-index: 5; }
.bookings-sheet[hidden] { display: none; }
.bookings-sheet-card { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(640px, 94vw); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 12px; overflow: hidden; }
.bookings-sheet-body { padding: 14px 20px 18px; overflow-y: auto; }
.bookings-sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.bookings-primary { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--bg) !important; }
.bookings-danger { border-color: #ef4444 !important; color: #ef4444 !important; }
.bookings-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.bookings-table-chip { min-height: 64px; border-radius: 10px; border: 2px solid var(--border); background: transparent; color: var(--fg);
  font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.bookings-table-chip b { font-size: 20px; }
.bookings-table-chip small { font-size: 11px; color: var(--fg-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.bookings-table-chip[data-on="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 700px) {
  .bookings-row { grid-template-columns: 60px 1fr 54px; }
  .bookings-actions { grid-column: 1 / -1; flex-wrap: wrap; }
}
/* Specials board (v1.5.250) reuses the diary's rows and sheet. */
.specials-row { grid-template-columns: 96px 1fr 0 auto; }
.specials-row .bookings-time { font-size: 20px; }
.specials-allergens { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); margin-bottom: 8px; }
.specials-allergens .bookings-table-chip { min-height: 48px; }
.specials-allergens .bookings-table-chip b { font-size: 14px; }
#specials-sheet .specials-allergens .bookings-table-chip[data-on="true"] { border-color: #ef4444; background: color-mix(in srgb, #ef4444 18%, transparent); }
