/* Coffee Tavern Till — three-theme stylesheet
   Themes are scoped to a [data-till-theme] container so multiple
   directions can live side-by-side on the design canvas. */

/* -------- Shared base / reset for the till frame -------- */
.till-root {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--t-text);
  background: var(--t-canvas);
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: var(--t-sidebar-w, 196px) 1fr var(--t-orderpanel-w, 332px);
  overflow: hidden;
  /* Base font: dropped from 13px → 12px so the right order panel doesn't
     overflow on the 1024-wide POS tablets. Explicit px sizes elsewhere in
     this file are untouched; only inherited text shrinks 1px. */
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: -0.005em;
  position: relative;
  isolation: isolate;
}
.till-root *,
.till-root *::before,
.till-root *::after { box-sizing: border-box; }

.till-mono { font-family: 'Geist Mono', ui-monospace, monospace; font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }

/* -------- Stylish scrollbars (teal accent, narrow, no track/arrows) --------
   Scoped to the till + its modals so the rest of the host page isn't affected.
   WebKit: ::-webkit-scrollbar buttons are hidden via display:none, the track
   is transparent, the thumb is a soft pill in the brand teal that brightens
   on hover. Firefox: matches via scrollbar-width + scrollbar-color.           */
.till-root,
.till-modal,
.till-modal__body {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 123, 149, 0.55) transparent;
}
.till-root *,
.till-modal * {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 123, 149, 0.55) transparent;
}
.till-root ::-webkit-scrollbar,
.till-modal ::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: transparent;
}
.till-root ::-webkit-scrollbar-track,
.till-modal ::-webkit-scrollbar-track {
  background: transparent;
  border: 0;
}
.till-root ::-webkit-scrollbar-thumb,
.till-modal ::-webkit-scrollbar-thumb {
  background: rgba(15, 123, 149, 0.55);
  border-radius: 999px;
  border: 0;
}
.till-root ::-webkit-scrollbar-thumb:hover,
.till-modal ::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 123, 149, 0.85);
}
.till-root ::-webkit-scrollbar-thumb:active,
.till-modal ::-webkit-scrollbar-thumb:active {
  background: #0F7B95;
}
.till-root ::-webkit-scrollbar-corner,
.till-modal ::-webkit-scrollbar-corner {
  background: transparent;
}
/* Kill the top/bottom arrow buttons that some platforms still render. */
.till-root ::-webkit-scrollbar-button,
.till-modal ::-webkit-scrollbar-button {
  display: none;
  width: 0; height: 0;
}
/* Onyx (dark) theme reads the same teal nicely — slightly lift opacity at
   rest so the thumb stays visible against the dark canvas. */
.till-root[data-till-theme="onyx"],
.till-root[data-till-theme="onyx"] * {
  scrollbar-color: rgba(15, 123, 149, 0.7) transparent;
}
.till-root[data-till-theme="onyx"] ::-webkit-scrollbar-thumb {
  background: rgba(15, 123, 149, 0.7);
}
.till-root[data-till-theme="onyx"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 165, 195, 0.9);
}

:where(.till-root button) {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  letter-spacing: inherit;
}
:where(.till-root input) { font: inherit; color: inherit; }

.till-notify {
  position: fixed;
  inset: 0;
  z-index: 3700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(11, 12, 14, 0.64);
  backdrop-filter: blur(8px);
}

.till-notify__dialog {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--t-border, rgba(0,0,0,0.12));
  border-radius: 16px;
  background: var(--t-surface, #fff);
  color: var(--t-text, #1A1A1A);
  box-shadow: 0 28px 80px rgba(0,0,0,0.34);
}

.till-notify__eyebrow {
  color: var(--t-accent-text, #0F5A6F);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.till-notify__dialog h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0;
}

.till-notify__message {
  color: var(--t-muted, #5b6268);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.till-notify__button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--t-accent, #0F7B95);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.till-notify__button:disabled {
  opacity: 0.68;
  cursor: progress;
}

/* -------- Layout primitives --------
   min-width: 0 stops a flex/grid item from inflating to its min-content
   width — without it, a single wide button row or a long money figure
   inside the order panel can push the 332px grid track out past the
   viewport edge ("right sidebar overflows on the device"). overflow-x
   on the order panel is the safety net for the same condition. */
.till-sidebar  { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--t-border); background: var(--t-chrome); color: var(--t-chrome-text); }
.till-main     { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--t-canvas); }
.till-order    { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow-x: hidden; border-left: 1px solid var(--t-border); background: var(--t-chrome); color: var(--t-chrome-text); }

.till-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--t-chrome-border);
}
.till-brand__logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--t-brand-bg);
  display: grid; place-items: center;
  color: var(--t-brand-fg);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.till-brand__logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
/* Keep the logo fixed and let the text column take the remaining width so long
   company / location / device names truncate with an ellipsis instead of overflowing. */
.till-brand { min-width: 0; }
.till-brand__logo { flex-shrink: 0; }
.till-brand__text { min-width: 0; flex: 1; }
.till-brand__name { font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.till-brand__site { font-size: 10.5px; color: var(--t-chrome-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.till-cats { padding: 6px 8px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.till-cats__group-label {
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--t-chrome-muted);
  padding: 14px 8px 6px;
  font-weight: 600;
}
.till-cat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px;
  border-radius: 10px;
  color: var(--t-chrome-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  position: relative;
  min-height: 44px;
  transition: background 120ms ease, color 120ms ease;
  gap: 8px;
}
.till-cat:hover { background: var(--t-chrome-hover); }
.till-cat--active { background: var(--t-accent-soft); color: var(--t-accent-text); font-weight: 600; }
.till-cat--active::before {
  content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--t-accent);
}
.till-cat__main { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.till-cat__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.till-cat__count {
  font: 500 10.5px/1 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--t-chrome-muted);
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--t-chip);
  flex-shrink: 0;
}
.till-cat--active .till-cat__count { color: var(--t-accent-text); background: var(--t-accent-chip); }
.till-cat__sub-indicator {
  color: var(--t-chrome-muted);
  flex-shrink: 0;
  opacity: 0.6;
}
.till-cat--active .till-cat__sub-indicator { color: var(--t-accent-text); opacity: 0.9; }

/* sub-cats horizontal strip above products */
.till-subcats {
  display: flex; gap: 6px; align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--t-border);
  background: var(--t-canvas);
  overflow-x: auto;
  flex-wrap: wrap;
}
.till-subcats__label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-muted);
  font-weight: 600;
  margin-right: 6px;
}
.till-subcat {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  font-size: 12px;
  font-weight: 500;
  color: var(--t-text);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.005em;
  min-height: 32px;
  display: inline-flex; align-items: center; gap: 4px;
}
.till-subcat:hover { border-color: var(--t-border-strong); }
.till-subcat--active {
  background: var(--t-accent-soft);
  color: var(--t-accent-text);
  border-color: var(--t-accent-border);
  font-weight: 600;
}
.till-subcat__count {
  font: 500 9.5px 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

/* Sub-category tiles — half-height of product tiles, rendered ABOVE the
   product grid using the same column count so they align nicely. Clicking
   a tile filters the products below to that subcategory; the All tile
   resets the filter. */
.till-subcat-tiles {
  display: grid;
  gap: 10px;
  padding: 12px 18px 0;
  align-content: start;
}
.till-subcat-tile {
  position: relative;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px;
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
  color: var(--t-text);
  font: 600 13px/1.2 inherit;
  letter-spacing: -0.01em;
  text-align: left;
}
.till-subcat-tile:hover { border-color: var(--t-border-strong); background: var(--t-surface-hi); box-shadow: var(--t-shadow); }
.till-subcat-tile:active { transform: translateY(1px); }
.till-subcat-tile--active {
  background: var(--t-accent-soft);
  color: var(--t-accent-text);
  border-color: var(--t-accent-border);
}
.till-subcat-tile__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.till-subcat-tile__count {
  font: 500 10px 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--t-chip);
  flex-shrink: 0;
}
.till-subcat-tile--active .till-subcat-tile__count {
  background: rgba(255,255,255,0.18);
  color: inherit;
  opacity: 0.9;
}

/* Sidebar foot: view mode toggle + notes/customer row */
.till-sidebar__foot {
  padding: 8px 10px 12px;
  border-top: 1px solid var(--t-chrome-border);
  display: flex; flex-direction: column;
  gap: 6px;
}
.till-view-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 3px;
  background: var(--t-chip);
  border-radius: 10px;
}
.till-view-toggle button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--t-chrome-muted);
  letter-spacing: -0.005em;
}
.till-view-toggle button[aria-pressed="true"] {
  background: var(--t-surface);
  color: var(--t-text);
  box-shadow: var(--t-shadow);
}
.till-sidebar__foot-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}

/* Promotion meta on cart line (e.g. "1 of 2 discounted") */
.till-line__promo-meta {
  grid-column: 1 / -1;
  margin-top: -2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--t-danger-text);
  text-align: right;
  padding-right: 2px;
}

/* Discount summary row above Subtotal: dashed separator + emphasis */
.till-totals__row--discount-total {
  border-top: 1px dashed var(--t-border);
  padding-top: 4px;
  margin-top: 2px;
}

.till-sidebar__txnlink {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--t-chrome-muted);
  letter-spacing: -0.005em;
  text-decoration: none;
}
.till-sidebar__txnlink:hover {
  background: var(--t-surface);
  color: var(--t-text);
  box-shadow: var(--t-shadow);
}

/* Column count selector (replaces pagination) */
.till-cols-toggle {
  display: inline-flex; align-items: center;
  padding: 3px;
  border-radius: 8px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  gap: 1px;
}
.till-cols-toggle button {
  width: 32px; height: 28px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: var(--t-muted);
  position: relative;
}
.till-cols-toggle button:hover { background: var(--t-chip); color: var(--t-text); }
.till-cols-toggle button[aria-pressed="true"] {
  background: var(--t-accent);
  color: var(--t-accent-on);
}
.till-cols-toggle__icon {
  display: grid; gap: 1.5px; padding: 4px;
}
.till-cols-toggle__icon span {
  background: currentColor;
  width: 2.5px;
  border-radius: 0.5px;
  display: block;
}

/* In-place tile view of categories (when toggle is on) */
.till-cattiles {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px 24px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.till-cattile {
  position: relative;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 14px;
  padding: 22px 22px 20px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  text-align: left;
  transition: border-color 120ms, background 120ms, transform 80ms;
  cursor: pointer;
}
.till-cattile:hover { border-color: var(--t-border-strong); background: var(--t-surface-hi); box-shadow: var(--t-shadow); }
.till-cattile:active { transform: translateY(1px); }
.till-cattile__name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--t-text);
  margin-bottom: 6px;
}
.till-cattile__meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
  color: var(--t-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.till-cattile__count {
  font: 600 11px 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}
.till-cattile__chev {
  color: var(--t-muted);
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--t-chip);
}
.till-root .till-cat.till-category-colour,
.till-root .till-cattile.till-category-colour,
.till-root .till-subcat-tile.till-category-colour {
  border: 1px solid var(--category-border);
  background: var(--category-fill);
  color: var(--category-text);
}
.till-root .till-cat.till-category-colour:hover,
.till-root .till-cattile.till-category-colour:hover,
.till-root .till-subcat-tile.till-category-colour:hover {
  border-color: var(--category-border);
  background: var(--category-hover);
  color: var(--category-text);
}
.till-root .till-cat.till-category-colour.till-cat--active,
.till-root .till-subcat-tile.till-category-colour.till-subcat-tile--active {
  border-color: var(--category-selected-border);
  background: linear-gradient(90deg, var(--category-selected-from) 0%, var(--category-selected-to) 100%);
  color: var(--category-selected-border);
}
.till-root .till-cat.till-category-colour.till-cat--active:hover,
.till-root .till-subcat-tile.till-category-colour.till-subcat-tile--active:hover {
  background: linear-gradient(90deg, var(--category-hover) 0%, var(--category-selected-to) 100%);
}
.till-cat.till-category-colour.till-cat--active::before { background: var(--category-selected-border); }
.till-category-colour .till-cat__name,
.till-category-colour .till-cat__sub-indicator,
.till-category-colour .till-cattile__name,
.till-category-colour .till-cattile__meta,
.till-category-colour .till-cattile__chev {
  color: inherit;
}
.till-category-colour .till-cat__count,
.till-category-colour .till-cattile__chev,
.till-category-colour .till-subcat-tile__count,
.till-category-colour.till-cat--active .till-cat__count,
.till-category-colour.till-subcat-tile--active .till-subcat-tile__count {
  background: var(--category-chip);
  color: inherit;
  opacity: 0.9;
}
.till-icon-btn {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px;
  border-radius: 8px;
  background: var(--t-chip);
  color: var(--t-chrome-text);
  font-size: 11px; font-weight: 500;
}
.till-icon-btn:hover { background: var(--t-chrome-hover); }

/* -------- Main column -------- */
.till-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--t-border);
  background: var(--t-canvas);
}
.till-cat-title {
  display: flex; align-items: baseline; gap: 10px;
}
.till-cat-title h1 {
  font-size: 17px; font-weight: 600; margin: 0;
  letter-spacing: -0.015em;
}
.till-cat-title__meta {
  font-size: 11px; color: var(--t-muted); letter-spacing: 0.04em; text-transform: uppercase;
}
.till-topbar__spacer { flex: 1; }
.till-search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: 8px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  color: var(--t-muted);
  font-size: 12px;
  min-width: 220px;
}
.till-search-btn:hover { border-color: var(--t-border-strong); }
.till-search-btn kbd {
  font: 500 10px/1 'Geist Mono', monospace;
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--t-chip);
  margin-left: auto;
  color: var(--t-muted);
}

.till-pager {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
}
.till-pager button {
  width: 26px; height: 26px;
  border-radius: 5px;
  display: grid; place-items: center;
  font: 500 12px 'Geist Mono', monospace;
  color: var(--t-muted);
}
.till-pager button:hover { background: var(--t-chip); color: var(--t-text); }
.till-pager button[aria-current="true"] { background: var(--t-accent); color: var(--t-accent-on); }

/* Wraps subcategory tiles + product grid so they share one scrollbar — the
   subcategory tiles scroll out of view with the products instead of being
   pinned to the top of the column. */
.till-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.till-grid {
  padding: 14px 18px 18px;
  display: grid;
  /* columns set inline via style for runtime column-count toggle */
  gap: 10px;
  align-content: start;
}

.till-card {
  position: relative;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 12px;
  padding: 14px 16px 14px;
  display: flex; flex-direction: column;
  min-height: 112px;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
}
.till-card:hover { border-color: var(--t-border-strong); background: var(--t-surface-hi); box-shadow: var(--t-shadow); }
.till-card:active { transform: translateY(1px); }
.till-card__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.till-card__name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t-text);
}
.till-card__menu {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--t-muted);
  background: transparent;
  flex-shrink: 0;
}
.till-card__menu:hover { background: var(--t-chip); color: var(--t-text); }
.till-card__rows { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.till-card__row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px;
  color: var(--t-muted);
}
.till-card__row-label { font-weight: 500; color: var(--t-text-2); letter-spacing: -0.005em; }
.till-card__row-price { color: var(--t-text); font-weight: 500; }
.till-card__single-price { font-size: 14px; color: var(--t-text); font-weight: 600; }
.till-card__single-prefix { font-size: 11px; color: var(--t-muted); margin-right: 4px; letter-spacing: 0.02em; }
.till-card__badge {
  position: absolute; top: 10px; right: 10px;
  font: 500 9px/1 'Geist Mono', monospace;
  color: var(--t-muted);
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--t-chip);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.till-card--mods .till-card__menu { color: var(--t-accent); }

/* -------- Order panel (right) -------- */
.till-order__tabs {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  padding: 12px 12px 0;
}
.till-tab {
  display: block;
  padding: 8px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-chrome-muted);
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.till-tab:hover { background: var(--t-chrome-hover); color: var(--t-chrome-text); }
.till-tab--active {
  background: var(--t-accent-soft);
  color: var(--t-accent-text);
  border-color: var(--t-accent-border);
}
.till-tab__count {
  display: inline-block;
  margin-left: 6px;
  font: 500 10px 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: inherit;
  opacity: 0.7;
}

.till-order__meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--t-chrome-border);
}
.till-pill {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--t-chip);
  color: var(--t-chrome-text);
  font-size: 11px;
  border: 1px solid transparent;
}
.till-pill__label { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-chrome-muted); }
.till-pill__value { font-weight: 600; font-size: 12px; letter-spacing: -0.005em; }
.till-pill--active { background: var(--t-accent-soft); border-color: var(--t-accent-border); }
.till-pill--active .till-pill__label,
.till-pill--active .till-pill__value { color: var(--t-accent-text); }

.till-order__staff {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--t-chrome-border);
}
.till-staff-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px 5px 5px;
  border-radius: 999px;
  background: var(--t-chip);
  font-size: 11px;
  font-weight: 500;
  color: var(--t-chrome-text);
  border: 1px solid transparent;
}
.till-staff-chip__avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 600 9px 'Geist', sans-serif;
  background: var(--t-accent-soft);
  color: var(--t-accent-text);
  letter-spacing: 0.02em;
}
.till-staff-chip--active { background: var(--t-accent-soft); border-color: var(--t-accent-border); color: var(--t-accent-text); }
.till-staff-chip--active .till-staff-chip__avatar { background: var(--t-accent); color: var(--t-accent-on); }
.till-order__staff-spacer { flex: 1; }
.till-order__staff-add { width: 24px; height: 24px; border-radius: 999px; background: var(--t-chip); color: var(--t-chrome-text); display: grid; place-items: center; font-size: 14px; }

.till-lines {
  flex: 1; overflow-y: auto;
  padding: 8px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.till-lines__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 8px 4px;
}
.till-lines__title { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-chrome-muted); font-weight: 600; }
.till-lines__count { font: 500 10px 'Geist Mono', monospace; color: var(--t-chrome-muted); }

.till-line {
  padding: 9px 10px 9px;
  border-radius: 8px;
  background: var(--t-chip);
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 8px;
  cursor: pointer;
}
.till-line:hover { border-color: var(--t-chrome-border); }
.till-line--selected { background: var(--t-surface-hi); border-color: var(--t-border); box-shadow: 0 1px 0 var(--t-chrome-border); }
.till-line--split-on { background: var(--t-accent-soft); border-color: var(--t-accent-border); }
.till-line--selected.till-line--split-on { background: var(--t-accent-soft); border-color: var(--t-accent-border); }
.till-line__check {
  grid-row: 1 / 3;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--t-chrome-border);
  background: var(--t-chrome-bg-2);
  display: grid; place-items: center;
  align-self: flex-start;
  margin-top: 1px;
  color: var(--t-accent-on);
  flex-shrink: 0;
}
.till-line__check[aria-pressed="true"] {
  background: var(--t-accent);
  border-color: var(--t-accent);
}
.till-line__name { font-size: 13px; font-weight: 600; color: var(--t-chrome-text); letter-spacing: -0.005em; }
.till-line__price { font: 600 13px 'Geist Mono', monospace; font-variant-numeric: tabular-nums; color: var(--t-chrome-text); text-align: right; align-self: start; }
.till-line__mods {
  grid-column: 2 / 4;
  display: flex; flex-wrap: wrap; gap: 3px 5px;
  font-size: 10.5px;
  color: var(--t-chrome-muted);
  margin-top: 2px;
}
.till-line__mod {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--t-chrome-hover);
  letter-spacing: 0.005em;
}
.till-line__mod--btn {
  background: var(--t-chrome-bg-2);
  border: 1px solid var(--t-chrome-border);
  color: var(--t-chrome-text);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 6px 3px 8px;
  font-weight: 500;
  transition: all 100ms ease;
}
.till-line__mod--btn:hover {
  background: var(--t-accent-soft);
  border-color: var(--t-accent-border);
  color: var(--t-accent-text);
}
.till-line__mod--btn svg { opacity: 0.45; }
.till-line__mod--btn:hover svg { opacity: 0.9; }
.till-line__edit {
  width: 29px; height: 29px;
  border-radius: 7px;
  background: var(--t-accent);
  color: var(--t-accent-on);
  border: 1px solid var(--t-accent);
  display: grid; place-items: center;
  margin-left: 4px;
  flex-shrink: 0;
}
.till-line__edit:hover { filter: brightness(1.08); }

.till-line__note-readonly {
  grid-column: 2 / 4;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--t-chrome-bg-2);
  border-left: 2px solid var(--t-accent);
  font-size: 11.5px;
  color: var(--t-chrome-text);
  font-style: italic;
  display: flex; align-items: center; gap: 6px;
  line-height: 1.4;
}
.till-line__note-readonly svg { color: var(--t-accent); flex-shrink: 0; }

.till-line__discount {
  grid-column: 2 / 4;
  margin-top: 6px;
  padding: 5px 8px 5px 10px;
  border-radius: 6px;
  background: var(--t-accent-soft);
  border: 1px solid var(--t-accent-border);
  color: var(--t-accent-text);
  font-size: 11px;
  display: flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.till-line__discount svg { flex-shrink: 0; }
.till-line__discount-clear {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: transparent;
  color: var(--t-accent-text);
  display: grid; place-items: center;
  opacity: 0.6;
}
.till-line__discount-clear:hover { background: var(--t-accent-chip); opacity: 1; }

.till-line__disc-btn {
  width: 29px; height: 29px;
  border-radius: 7px;
  background: var(--t-chrome-bg-2);
  color: var(--t-accent-text);
  border: 1px solid var(--t-chrome-border);
  display: grid; place-items: center;
  margin-left: 4px;
  flex-shrink: 0;
}
.till-line__disc-btn:hover { background: var(--t-accent-soft); border-color: var(--t-accent-border); color: var(--t-accent); }
.till-line__note {
  grid-column: 2 / 4;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--t-chrome-bg-2);
  border: 1px dashed var(--t-chrome-border);
  font-size: 11.5px;
  color: var(--t-chrome-text);
  width: 100%;
  outline: 0;
  resize: none;
  font-family: inherit;
}
.till-line__note:focus { border-style: solid; border-color: var(--t-accent); background: var(--t-chrome-hover); }
.till-line__note::placeholder { color: var(--t-chrome-muted); }
.till-line__note-btn {
  grid-column: 2 / 4;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--t-chrome-bg-2);
  border: 1px dashed var(--t-chrome-border);
  font-size: 11.5px;
  color: var(--t-chrome-muted);
  text-align: left;
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  font-family: inherit;
}
.till-line__note-btn:hover { border-style: solid; border-color: var(--t-accent-border); background: var(--t-accent-soft); color: var(--t-accent-text); }
.till-line__note-btn svg { flex-shrink: 0; opacity: 0.7; }

/* Virtual keyboard inside NoteModal */
.till-keyboard {
  display: flex; flex-direction: column; gap: 5px;
  background: var(--t-chrome-bg-2);
  border: 1px solid var(--t-border);
  border-radius: 10px;
  padding: 8px;
}
.till-keyboard__row {
  display: flex; gap: 4px;
  justify-content: center;
}
.till-keyboard__key {
  flex: 1 1 0;
  min-width: 0;
  height: 38px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  color: var(--t-text);
  font: 600 14px 'Geist', sans-serif;
  display: grid; place-items: center;
  letter-spacing: 0;
}
.till-keyboard__key:hover { background: var(--t-chip); }
.till-keyboard__key:active { transform: translateY(1px); background: var(--t-chip-hover); }
.till-keyboard__key--mod {
  flex: 0 0 56px;
  background: var(--t-chip);
  font-size: 12px;
  color: var(--t-text-2);
  font-weight: 600;
}
.till-keyboard__key--on {
  background: var(--t-accent);
  color: var(--t-accent-on);
  border-color: var(--t-accent);
}
.till-keyboard__key--space {
  flex: 1 1 0;
  font-size: 11px;
  color: var(--t-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.till-line__qty {
  grid-column: 2 / 4;
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px;
}
.till-line__qty button {
  width: 29px; height: 29px;
  border-radius: 7px;
  background: var(--t-chrome-bg-2);
  display: grid; place-items: center;
  color: var(--t-chrome-text);
  font-size: 16px;
  border: 1px solid var(--t-chrome-border);
}
.till-line__qty button:hover { background: var(--t-chrome-hover); }
.till-line__qty .till-line__qty-num {
  min-width: 32px; text-align: center;
  font: 600 14px 'Geist Mono', monospace;
}
.till-line__qty-spacer { flex: 1; }
.till-line__remove {
  width: 29px; height: 29px;
  border-radius: 7px;
  background: var(--t-danger-soft);
  color: var(--t-danger-text);
  display: grid; place-items: center;
  font-size: 15px;
  border: 1px solid var(--t-danger-border);
}

/* Order-panel collapse bar — desktop. Sits between the items list and the
   totals block; split into two halves. Left toggles .till-totals (collapsed
   by default), right toggles .till-actions's secondary rows (auto-collapses
   when the cart has 5+ lines). Checkout sits below and is always visible. */
.till-order__collapse-toggle {
  display: flex;
  width: 100%;
  background: var(--t-chrome-bg-2);
  border-top: 1px solid var(--t-chrome-border);
  border-bottom: 1px solid var(--t-chrome-border);
}
.till-order__collapse-half {
  flex: 1 1 50%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--t-chrome-muted);
  font: 600 10px 'Geist', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 0;
}
.till-order__collapse-half + .till-order__collapse-half {
  border-left: 1px solid var(--t-chrome-border);
}
.till-order__collapse-half:hover {
  background: var(--t-chrome-hover);
  color: var(--t-chrome-text);
}
.till-order__collapse-half[aria-expanded="true"] {
  color: var(--t-chrome-text);
}
.till-order__collapse-half svg { opacity: 0.7; }
.till-order__collapse-half[aria-expanded="true"] svg { opacity: 1; }

.till-lines__empty {
  flex: 1;
  display: grid; place-items: center;
  text-align: center;
  color: var(--t-chrome-muted);
  font-size: 12px;
  padding: 30px;
}
.till-lines__empty-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--t-chip);
  display: grid; place-items: center;
  margin: 0 auto 10px;
  color: var(--t-chrome-muted);
}

.till-totals { border-top: 1px solid var(--t-chrome-border); padding: 10px 14px 8px; }
.till-totals__row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 11.5px; color: var(--t-chrome-muted); }
.till-totals__row-val { font: 500 12px 'Geist Mono', monospace; font-variant-numeric: tabular-nums; color: var(--t-chrome-text); }
.till-totals__row--total { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--t-chrome-border); }
.till-totals__row--total .till-totals__row-label { font-size: 12px; color: var(--t-chrome-text); font-weight: 600; letter-spacing: -0.005em; }
.till-totals__row--total .till-totals__row-val { font-size: 22px; font-weight: 700; color: var(--t-chrome-text); letter-spacing: -0.02em; }

.till-actions { padding: 8px 12px 12px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.till-actions__row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.till-btn {
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  background: var(--t-chip);
  color: var(--t-chrome-text);
  border: 1px solid var(--t-chrome-border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.till-btn:hover { background: var(--t-chrome-hover); }
.till-btn--ghost { background: transparent; }
.till-btn--staff {
  background: var(--t-accent-soft);
  color: var(--t-accent-text);
  border-color: var(--t-accent-border);
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
  font-size: 12px;
}
.till-btn--staff .till-staff-chip__avatar { background: var(--t-accent); color: var(--t-accent-on); }
.till-btn--staff:hover { filter: brightness(0.98); background: var(--t-accent-soft); }
.till-btn--danger { background: var(--t-danger-soft); color: var(--t-danger-text); border-color: var(--t-danger-border); }
.till-btn--accent { background: var(--t-accent); color: var(--t-accent-on); border-color: var(--t-accent); }
.till-btn--accent:hover { filter: brightness(1.05); background: var(--t-accent); }
.till-btn--checkout {
  grid-column: 1 / -1;
  padding: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--t-accent);
  color: var(--t-accent-on);
  border-color: var(--t-accent);
  display: flex; align-items: center; justify-content: space-between;
}
.till-btn--checkout .till-mono { font-size: 15px; letter-spacing: -0.01em; }
.till-btn--checkout:hover { filter: brightness(1.04); background: var(--t-accent); }
.till-btn--checkout[disabled] { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); }

/* -------- Fly-to-cart animation -------- */
.till-fly {
  position: absolute;
  pointer-events: none;
  z-index: 60;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--t-accent);
  color: var(--t-accent-on);
  font: 600 11px 'Geist', sans-serif;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  white-space: nowrap;
  transition: transform 460ms cubic-bezier(0.5, 0, 0.3, 1), opacity 460ms ease;
}

.till-line--just-added {
  animation: lineFlash 600ms ease-out;
}
@keyframes lineFlash {
  0%   { transform: translateY(-4px); background: var(--t-accent-soft); }
  100% { transform: translateY(0);    background: var(--t-chip); }
}

/* -------- Modal shell -------- */
.till-modal-overlay {
  /* fixed (not absolute) so it covers the entire viewport even when the till-root
     content is shorter (e.g. mobile padding-bottom for the bottom bar) and so it
     sits above the position:fixed order drawer on mobile (which is z-index 90 in
     the root stacking context). */
  position: fixed; inset: 0;
  background: var(--t-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 1000;
  animation: overlayIn 180ms ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.till-modal {
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 14px;
  box-shadow: var(--t-shadow-lg);
  max-width: 92%;
  max-height: 92%;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn 220ms cubic-bezier(0.3, 1.2, 0.4, 1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: none; } }
.till-modal__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--t-border);
  gap: 16px;
}
.till-modal__title-block { display: flex; flex-direction: column; gap: 2px; }
.till-modal__eyebrow { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-muted); font-weight: 600; }
.till-modal__title { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.015em; }
.till-modal__close {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--t-muted);
  background: var(--t-chip);
}
.till-modal__close:hover { background: var(--t-chip-hover); color: var(--t-text); }
.till-modal__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.till-modal__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--t-border);
  background: var(--t-canvas);
}

/* -------- Modifier modal -------- */
/* Responsive CTA label: full text on desktop, short ("Add"/"Save") on mobile.
   The mobile media query flips these (see @media max-width: 1000px). */
.till-mod-cta-full  { display: inline; }
.till-mod-cta-short { display: none; }
.till-mod-group { margin-bottom: 18px; }
.till-mod-group:last-child { margin-bottom: 4px; }
.till-mod-group__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.till-mod-group__name { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }
.till-mod-group__hint { font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--t-muted); }
.till-mod-note {
  margin: -2px 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--t-accent-border);
  border-radius: 8px;
  background: var(--t-accent-soft);
  color: var(--t-accent-text);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}
.till-mod-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.till-mod-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--t-surface-hi);
  border: 1px solid var(--t-border);
  font-size: 12px;
  font-weight: 500;
  color: var(--t-text);
  transition: all 100ms ease;
}
.till-mod-option:hover { border-color: var(--t-border-strong); }
.till-mod-option__main { min-width: 0; display: grid; gap: 3px; }
.till-mod-option__note { color: var(--t-muted); font-size: 10.5px; line-height: 1.25; font-weight: 500; }
.till-mod-option__price { font: 500 11px 'Geist Mono', monospace; color: var(--t-muted); }
.till-mod-option--active {
  background: var(--t-accent-soft);
  border-color: var(--t-accent);
  color: var(--t-accent-text);
}
.till-mod-option--active .till-mod-option__price { color: var(--t-accent-text); }
.till-mod-option--active .till-mod-option__note { color: var(--t-accent-text); opacity: 0.82; }

.till-mod-summary { display: flex; gap: 12px; align-items: center; }
.till-mod-summary__name { font-size: 14px; font-weight: 600; }
.till-mod-summary__price { font: 600 17px 'Geist Mono', monospace; font-variant-numeric: tabular-nums; }

/* -------- Search overlay -------- */
.till-search { width: 640px; max-width: 92%; }
.till-search__input {
  width: 100%;
  padding: 18px 18px;
  border: 0;
  background: transparent;
  font-size: 18px;
  outline: 0;
  letter-spacing: -0.015em;
  font-weight: 500;
}
.till-search__input::placeholder { color: var(--t-muted); }
.till-search__hits { max-height: 360px; overflow-y: auto; padding: 6px; }
.till-search__hit {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.till-search__hit:hover, .till-search__hit--active { background: var(--t-chip); }
.till-search__hit-name { display: flex; flex-direction: column; gap: 1px; }
.till-search__hit-cat { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--t-muted); }
.till-search__hit-price { font: 500 12px 'Geist Mono', monospace; color: var(--t-text); }
.till-search__hint { padding: 8px 16px; font-size: 10.5px; color: var(--t-muted); border-top: 1px solid var(--t-border); display: flex; gap: 18px; }
.till-search__hint kbd {
  font: 500 10px 'Geist Mono', monospace;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--t-chip);
  margin-right: 4px;
}

/* -------- Checkout -------- */
.till-checkout { width: 720px; max-width: 96%; }
.till-checkout__split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 420px; }
.till-checkout__left { padding: 18px 22px; border-right: 1px solid var(--t-border); }
.till-checkout__right { padding: 18px 22px; background: var(--t-canvas); display: flex; flex-direction: column; gap: 14px; }
.till-checkout__total {
  font: 700 44px 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--t-text);
  line-height: 1;
  margin: 8px 0 14px;
}
.till-checkout__sub { display: flex; flex-direction: column; gap: 4px; }
.till-checkout__sub-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--t-muted); }
.till-checkout__sub-row .till-mono { color: var(--t-text-2); }
.till-checkout__tenders { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 14px 0; }
.till-tender {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 12px;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  background: var(--t-surface);
  font-size: 12px;
  font-weight: 600;
}
.till-tender:hover { border-color: var(--t-border-strong); }
.till-tender--active { border-color: var(--t-accent); background: var(--t-accent-soft); color: var(--t-accent-text); }
.till-tender__icon { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: var(--t-chip); color: var(--t-text-2); }
.till-tender--active .till-tender__icon { background: var(--t-accent); color: var(--t-accent-on); }

.till-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.till-keypad button {
  padding: 14px; border-radius: 8px;
  background: var(--t-surface); border: 1px solid var(--t-border);
  text-align: center;
  font: 600 17px 'Geist Mono', monospace;
  color: var(--t-text);
}
.till-keypad button:hover { background: var(--t-surface-hi); }
.till-keypad__display {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  display: flex; align-items: baseline; justify-content: space-between;
  font: 600 22px 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
}
.till-keypad__display-label { font: 500 11px 'Geist'; letter-spacing: 0.04em; text-transform: uppercase; color: var(--t-muted); }
.till-quick-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.till-quick-amount {
  padding: 8px 6px; border-radius: 6px;
  background: var(--t-chip); color: var(--t-text);
  font: 500 11px 'Geist Mono', monospace;
  text-align: center;
}
.till-quick-amount:hover { background: var(--t-chip-hover); }
.till-checkout__change {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--t-accent-soft);
  color: var(--t-accent-text);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--t-accent-border);
}
.till-checkout__change-amt { font: 700 22px 'Geist Mono', monospace; }

/* -------- Receipt -------- */
.till-receipt { width: 380px; max-width: 96%; }
.till-receipt__paper {
  padding: 22px 26px;
  background: var(--t-receipt-bg);
  color: var(--t-receipt-text);
  font: 12px 'Geist Mono', monospace;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
}
.till-receipt__brand { text-align: center; font: 700 16px 'Geist', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 2px; }
.till-receipt__addr { text-align: center; font-size: 10.5px; opacity: 0.7; margin-bottom: 12px; line-height: 1.5; }
.till-receipt__rule { border: 0; border-top: 1px dashed var(--t-receipt-rule); margin: 8px 0; }
.till-receipt__row { display: flex; justify-content: space-between; gap: 8px; }
.till-receipt__row--mod { font-size: 10.5px; opacity: 0.7; padding-left: 12px; }
.till-receipt__row--total { font-weight: 700; font-size: 14px; }
.till-receipt__foot { text-align: center; font-size: 10.5px; opacity: 0.7; margin-top: 14px; }
.till-receipt__success {
  background: var(--t-success-soft);
  color: var(--t-success-text);
  border: 1px solid var(--t-success-border);
  padding: 12px 14px;
  border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600;
  margin: 0 20px 0 20px;
}

/* -------- Discount modal -------- */
.till-disc { width: 520px; }
.till-disc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.till-disc__tile { position: relative; min-width: 0; }
.till-disc__btn {
  width: 100%;
  min-height: 84px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 42px 14px 14px;
  border-radius: 10px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
}
.till-disc__btn:hover { border-color: var(--t-border-strong); background: var(--t-surface-hi); }
.till-disc__btn-amount { font: 700 18px 'Geist Mono', monospace; color: var(--t-accent-text); }
.till-disc__btn-name { font-size: 12px; font-weight: 500; color: var(--t-text-2); }
.till-disc__tile--selected .till-disc__btn {
  background: var(--t-accent-soft);
  border-color: var(--t-accent);
  box-shadow: inset 0 0 0 1px var(--t-accent-border);
}
.till-disc__tile--selected .till-disc__btn-name,
.till-disc__tile--selected .till-disc__btn-amount { color: var(--t-accent-text); }
.till-disc__selected-label {
  margin-top: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--t-surface);
  border: 1px solid var(--t-accent-border);
  color: var(--t-accent-text);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-transform: uppercase;
}
.till-disc__clear {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--t-surface);
  border: 1px solid var(--t-accent-border);
  color: var(--t-accent-text);
}
.till-disc__clear:hover { background: var(--t-chip-hover); }

/* ================================================================== */
/*  THEME 1 — LIGHT (default, cool premium white — NO beige)          */
/* ================================================================== */
/* ================================================================== */
/*  THEME 1 — LIGHT (glass)                                            */
/*                                                                    */
/*  Per design_handoff_glass_finish/glass-theme.css. The theme key in */
/*  the app stays 'light' (theme switcher + persistence untouched);   */
/*  the visual treatment is now glass. Surfaces are translucent rgba, */
/*  the root paints a colored gradient stage behind them, and a       */
/*  shared rules block lower down adds the backdrop blur + inner top  */
/*  highlight that sells "this is glass".                             */
/* ================================================================== */
.till-root[data-till-theme='light'] {
  /* Text + chrome — close to the flat light theme but slightly cooler
     so translucent panes don't muddy the gradient stage behind them. */
  --t-text:          #0A0B0D;
  --t-text-2:        #232529;
  --t-muted:         #5C6270;
  --t-chrome-text:   #0A0B0D;
  --t-chrome-muted:  #5C6270;

  --t-brand-bg:      rgba(255,255,255,0.7);
  --t-brand-fg:      #0A0B0D;

  --t-accent:        #0F7B95;
  --t-accent-on:     #FFFFFF;
  --t-accent-soft:   rgba(15, 123, 149, 0.12);
  --t-accent-chip:   rgba(15, 123, 149, 0.22);
  --t-accent-text:   #075A6F;
  --t-accent-border: rgba(15, 123, 149, 0.32);

  --t-danger-soft:   rgba(186, 73, 43, 0.12);
  --t-danger-text:   #98361F;
  --t-danger-border: rgba(186, 73, 43, 0.30);

  --t-success-soft:  rgba(30, 110, 72, 0.12);
  --t-success-text:  #1E6E48;
  --t-success-border:rgba(30, 110, 72, 0.30);

  /* Glass surfaces — translucent so the gradient stage refracts through. */
  --t-canvas:        transparent;
  --t-surface:       rgba(255, 255, 255, 0.62);
  --t-surface-hi:    rgba(255, 255, 255, 0.78);
  --t-chrome:        rgba(255, 255, 255, 0.42);
  --t-chrome-bg-2:   rgba(255, 255, 255, 0.48);
  --t-chip:          rgba(255, 255, 255, 0.55);
  --t-chip-hover:    rgba(255, 255, 255, 0.72);
  --t-chrome-hover:  rgba(255, 255, 255, 0.45);

  --t-border:        rgba(15, 23, 42, 0.08);
  --t-border-strong: rgba(15, 23, 42, 0.18);
  --t-chrome-border: rgba(15, 23, 42, 0.07);

  /* Shadows pair a diffuse outer drop with an inset top highlight —
     that highlight is the signature "lit edge of the glass" tell. */
  --t-shadow:        0 1px 0 rgba(255,255,255,0.6) inset,
                     0 6px 18px rgba(15, 23, 42, 0.06);
  --t-shadow-lg:     0 1px 0 rgba(255,255,255,0.7) inset,
                     0 28px 60px rgba(15, 23, 42, 0.18),
                     0 6px 16px rgba(15, 23, 42, 0.10);
  --t-overlay:       rgba(15, 23, 42, 0.30);

  --t-receipt-bg:    rgba(255, 255, 255, 0.88);
  --t-receipt-text:  #0A0B0D;
  --t-receipt-rule:  rgba(15, 23, 42, 0.18);

  /* THE STAGE — colored gradient that lives behind every translucent
     pane. Almost no chroma; the deep teal accent does all the colour
     work. The blur in front of this does the heavy lifting. */
  background:
    radial-gradient(680px 460px at 6% 0%,    rgba(232, 234, 236, 0.85), transparent 70%),
    radial-gradient(720px 520px at 100% 6%,  rgba(224, 226, 230, 0.80), transparent 65%),
    radial-gradient(560px 440px at 28% 100%, rgba(220, 224, 226, 0.65), transparent 70%),
    radial-gradient(700px 540px at 96% 100%, rgba(228, 230, 233, 0.65), transparent 70%),
    linear-gradient(180deg, #F2F3F5 0%, #E6E8EB 100%);
}

/* ================================================================== */
/*  THEME 2 — ONYX (glass)                                             */
/* ================================================================== */
.till-root[data-till-theme='onyx'] {
  --t-text:          #F2F0EA;
  --t-text-2:        #DDDAD2;
  --t-muted:         #8C8A83;
  --t-chrome-text:   #F2F0EA;
  --t-chrome-muted:  #94928B;

  --t-brand-bg:      rgba(241, 239, 233, 0.92);
  --t-brand-fg:      #0B0C0E;

  --t-accent:        #54CAE7;
  --t-accent-on:     #04141B;
  --t-accent-soft:   rgba(84, 202, 231, 0.16);
  --t-accent-chip:   rgba(84, 202, 231, 0.28);
  --t-accent-text:   #A6E2F1;
  --t-accent-border: rgba(84, 202, 231, 0.36);

  --t-danger-soft:   rgba(227, 104, 84, 0.18);
  --t-danger-text:   #E8907F;
  --t-danger-border: rgba(227, 104, 84, 0.36);

  --t-success-soft:  rgba(95, 192, 142, 0.18);
  --t-success-text:  #84D5AB;
  --t-success-border:rgba(95, 192, 142, 0.36);

  --t-canvas:        transparent;
  --t-surface:       rgba(28, 32, 38, 0.55);
  --t-surface-hi:    rgba(36, 41, 49, 0.70);
  --t-chrome:        rgba(18, 21, 26, 0.45);
  --t-chrome-bg-2:   rgba(32, 36, 43, 0.55);
  --t-chip:          rgba(255, 255, 255, 0.06);
  --t-chip-hover:    rgba(255, 255, 255, 0.10);
  --t-chrome-hover:  rgba(255, 255, 255, 0.05);

  --t-border:        rgba(255, 255, 255, 0.07);
  --t-border-strong: rgba(255, 255, 255, 0.14);
  --t-chrome-border: rgba(255, 255, 255, 0.06);

  --t-shadow:        0 1px 0 rgba(255,255,255,0.07) inset,
                     0 4px 16px rgba(0, 0, 0, 0.30);
  --t-shadow-lg:     0 1px 0 rgba(255,255,255,0.09) inset,
                     0 30px 60px rgba(0, 0, 0, 0.55),
                     0 6px 16px rgba(0, 0, 0, 0.35);
  --t-overlay:       rgba(4, 7, 12, 0.55);

  /* Receipt stays opaque cream paper — it represents a physical
     printout and shouldn't be glass. The .till-receipt__paper rule
     further down enforces this even when something else flips. */
  --t-receipt-bg:    #F8F3E6;
  --t-receipt-text:  #1C1A14;
  --t-receipt-rule:  #B8A98B;

  /* STAGE — deep teal/violet bloom on near-black. */
  background:
    radial-gradient(640px 480px at 6% 4%,    rgba(84, 202, 231, 0.22), transparent 65%),
    radial-gradient(700px 540px at 100% 0%,  rgba(126, 96, 215, 0.22), transparent 65%),
    radial-gradient(620px 500px at 20% 100%, rgba(40, 110, 130, 0.28), transparent 65%),
    radial-gradient(720px 560px at 100% 100%, rgba(214, 134, 96, 0.18), transparent 70%),
    linear-gradient(180deg, #0A0C10 0%, #0E1115 60%, #0B0D11 100%);
}

/* Keep the gradient stage stable while inner panels scroll. */
.till-root[data-till-theme='light'],
.till-root[data-till-theme='onyx'] {
  background-attachment: local;
}

/* ================================================================== */
/*  Shared glass behaviour — apply to BOTH light and onyx themes      */
/*                                                                    */
/*  Backdrop blur on every pane + inner-light shadows. Three tiers:   */
/*    sidebar / order panel → blur(28px) saturate(140%)  — thick      */
/*    cards / chips / lines → blur(14px) saturate(140%)  — per piece  */
/*    modal                 → blur(36px) saturate(160%)  — heaviest   */
/* ================================================================== */

/* Sidebar + order panel — thick frosted glass with a lit edge. */
.till-root[data-till-theme='light'] .till-sidebar,
.till-root[data-till-theme='light'] .till-order,
.till-root[data-till-theme='onyx']  .till-sidebar,
.till-root[data-till-theme='onyx']  .till-order {
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}
.till-root[data-till-theme='light'] .till-sidebar,
.till-root[data-till-theme='light'] .till-order {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(15,23,42,0.04);
}
.till-root[data-till-theme='onyx'] .till-sidebar,
.till-root[data-till-theme='onyx'] .till-order {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.30);
}

/* Strip solid backgrounds off the main column + sub-strips so the
   stage's gradient shows through everywhere it should. */
.till-root[data-till-theme='light'] .till-main,
.till-root[data-till-theme='light'] .till-subcats,
.till-root[data-till-theme='light'] .till-topbar,
.till-root[data-till-theme='onyx']  .till-main,
.till-root[data-till-theme='onyx']  .till-subcats,
.till-root[data-till-theme='onyx']  .till-topbar {
  background: transparent;
}

/* Each interactive surface (card / chip / button / line / pill / tender)
   gets its own backdrop blur — so each piece reads as a separate sheet
   of frosted glass rather than one flat translucent layer. */
.till-root[data-till-theme='light'] .till-card,
.till-root[data-till-theme='light'] .till-cattile,
.till-root[data-till-theme='light'] .till-subcat,
.till-root[data-till-theme='light'] .till-subcat-tile,
.till-root[data-till-theme='light'] .till-search-btn,
.till-root[data-till-theme='light'] .till-line,
.till-root[data-till-theme='light'] .till-pill,
.till-root[data-till-theme='light'] .till-btn,
.till-root[data-till-theme='light'] .till-tender,
.till-root[data-till-theme='onyx']  .till-card,
.till-root[data-till-theme='onyx']  .till-cattile,
.till-root[data-till-theme='onyx']  .till-subcat,
.till-root[data-till-theme='onyx']  .till-subcat-tile,
.till-root[data-till-theme='onyx']  .till-search-btn,
.till-root[data-till-theme='onyx']  .till-line,
.till-root[data-till-theme='onyx']  .till-pill,
.till-root[data-till-theme='onyx']  .till-btn,
.till-root[data-till-theme='onyx']  .till-tender {
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

/* Inner top highlight on product cards + category tiles = the "lit
   glass edge" tell. Hover boosts the highlight and the outer shadow. */
.till-root[data-till-theme='light'] .till-card,
.till-root[data-till-theme='light'] .till-cattile,
.till-root[data-till-theme='light'] .till-subcat-tile {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.75),
    0 1px 0 rgba(15,23,42,0.02),
    0 8px 24px rgba(15,23,42,0.06);
}
.till-root[data-till-theme='light'] .till-card:hover,
.till-root[data-till-theme='light'] .till-cattile:hover,
.till-root[data-till-theme='light'] .till-subcat-tile:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 10px 32px rgba(15,23,42,0.12);
}
.till-root[data-till-theme='onyx'] .till-card,
.till-root[data-till-theme='onyx'] .till-cattile,
.till-root[data-till-theme='onyx'] .till-subcat-tile {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.02),
    0 6px 20px rgba(0,0,0,0.30);
}
.till-root[data-till-theme='onyx'] .till-card:hover,
.till-root[data-till-theme='onyx'] .till-cattile:hover,
.till-root[data-till-theme='onyx'] .till-subcat-tile:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 10px 32px rgba(0,0,0,0.45);
}

/* Active category — a slightly more luminous accent tint. */
.till-root[data-till-theme='light'] .till-cat--active {
  background: linear-gradient(180deg, rgba(15,123,149,0.16), rgba(15,123,149,0.10));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.till-root[data-till-theme='onyx'] .till-cat--active {
  background: linear-gradient(180deg, rgba(84,202,231,0.20), rgba(84,202,231,0.10));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}

/* Checkout button stays OPAQUE — it's the focal anchor. Inner gloss +
   tinted outer glow = premium pop without breaking the glass language
   of everything around it. color-mix() falls back gracefully; if you
   ever target a browser without it, hard-code #33A0BB (light) /
   #7EDAF0 (onyx) as the gloss stop. */
.till-root[data-till-theme='light'] .till-btn--checkout,
.till-root[data-till-theme='onyx']  .till-btn--checkout {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--t-accent) 100%, white 12%) 0%,
    var(--t-accent) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.15),
    0 8px 24px rgba(15, 123, 149, 0.32);
}

/* Modal foot — slightly more opaque so the stage doesn't bleed through
   under the primary CTA row. */
.till-root[data-till-theme='light'] .till-modal__foot { background: rgba(255,255,255,0.55); }
.till-root[data-till-theme='onyx']  .till-modal__foot { background: rgba(18,21,26,0.55); }

/* Modal — the most blurred surface in the system (largest pane, most
   user focus). Heaviest blur + most luminous edge highlight. */
.till-root[data-till-theme='light'] .till-modal,
.till-root[data-till-theme='onyx']  .till-modal {
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);
}
.till-root[data-till-theme='light'] .till-modal {
  background: rgba(255,255,255,0.78);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 30px 80px rgba(15,23,42,0.22),
    0 8px 20px rgba(15,23,42,0.12);
}
.till-root[data-till-theme='onyx'] .till-modal {
  background: rgba(22,26,32,0.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 30px 80px rgba(0,0,0,0.65),
    0 8px 20px rgba(0,0,0,0.4);
}

/* Receipt is a physical printout — never glass. Overrides any inherited
   surface translucency so the paper looks like paper in both themes. */
.till-root[data-till-theme='onyx'] .till-receipt__paper { background: #F8F3E6; color: #1C1A14; --t-receipt-rule: #B8A98B; }

/* Reduced-transparency users: fall back to opaque variants of the same
   palette so the till is still usable when the OS prefers it. */
@media (prefers-reduced-transparency: reduce) {
  .till-root[data-till-theme='light'] {
    --t-canvas:      #F2F3F5;
    --t-surface:     #FFFFFF;
    --t-surface-hi:  #FFFFFF;
    --t-chrome:      #FBFBFC;
    --t-chrome-bg-2: #F2F3F5;
    --t-chip:        #EFF1F4;
    background: linear-gradient(180deg, #F2F3F5 0%, #E6E8EB 100%);
  }
  .till-root[data-till-theme='onyx'] {
    --t-canvas:      #0B0C0E;
    --t-surface:     #14161A;
    --t-surface-hi:  #1B1E23;
    --t-chrome:      #0E1013;
    --t-chrome-bg-2: #181B20;
    --t-chip:        #1D2026;
    background: linear-gradient(180deg, #0A0C10 0%, #0E1115 60%, #0B0D11 100%);
  }
  .till-root[data-till-theme='light'] *,
  .till-root[data-till-theme='onyx']  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Mobile-only widgets — hidden by default on desktop. The media query below
   re-enables them on ≤1000px (and on desktop the data attribute is ignored). */
.till-order__mobile-bar     { display: none; }
.till-totals__mobile-toggle { display: none; }
/* Default desktop: long label, short label hidden. Media query inverts on mobile. */
.till-staff__home-label-full    { display: inline; }
.till-staff__home-label-short   { display: none; }
.till-staff__signin-label-full  { display: inline; }
.till-staff__signin-label-short { display: none; }

/* =================================================================== */
/*  Mobile / narrow-screen layout (≤1000px)                            */
/*  Desktop layout (>1000px) is left completely untouched.             */
/*  Sidebar → horizontal scroll at the top                              */
/*  Order panel → collapsed bottom bar that expands to a full drawer    */
/* =================================================================== */
@media (max-width: 1000px) {
  /* Stack vertically: sidebar (auto) → main (fills) → bottom bar (fixed via JS class) */
  .till-root {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
    /* The bottom bar is position:fixed so it doesn't need its own grid row */
    padding-bottom: 64px; /* room for the always-visible collapsed bar */
  }

  /* Sidebar transforms into a horizontal scroll at the top */
  .till-sidebar {
    flex-direction: column;
    border-right: 0;
    border-bottom: 1px solid var(--t-border);
    max-height: none;
  }
  /* Hide brand, view-toggle, and customer button on mobile to save space.
     Customer + theme are still reachable via the bottom-drawer order panel. */
  .till-sidebar .till-brand,
  .till-sidebar .till-sidebar__foot { display: none; }

  /* The category list becomes a horizontal scroll. Group labels become inline pills.
     min-width:0 and width:100% are critical — without them flex children expand to fit
     content width and the overflow-x scroll never activates (items just push off-screen). */
  .till-cats {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 8px;
    align-items: center;
    scrollbar-width: thin;
    min-width: 0;
    width: 100%;
    flex: 0 0 auto;
    -webkit-overflow-scrolling: touch;
  }
  .till-sidebar { min-width: 0; width: 100%; }
  .till-cats__group-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    margin: 0;
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--t-chrome-muted);
    background: var(--t-chip);
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .till-cats .till-cat {
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    width: auto;
    gap: 6px;
    font-size: 13px;
  }
  .till-cats .till-cat__name { white-space: nowrap; }
  .till-cats .till-cat__count { margin-left: 2px; }

  /* Secondary (sub-category) chips: keep them at the top of the main panel,
     they're already there in markup — just make sure they scroll horizontally too. */
  .till-subcats {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }
  .till-subcat { flex-shrink: 0; white-space: nowrap; }

  /* Order panel — collapsed by default, anchored to the bottom of the viewport */
  .till-order {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    z-index: 90; /* below modals (100) but above main */
    border-left: 0;
    border-top: 1px solid var(--t-border);
    background: var(--t-chrome);
    box-shadow: 0 -10px 32px rgba(0,0,0,0.25);
    /* By default just enough for the summary bar; expanded grows to most of the viewport */
    height: 64px;
    transition: height 220ms cubic-bezier(0.3, 1.0, 0.4, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .till-order.till-order--mobile-expanded {
    height: 92vh;
    overflow: auto;
  }

  /* The summary bar that's always visible — injected by React inside the panel header */
  .till-order__mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    height: 64px;
    flex-shrink: 0;
    background: var(--t-chrome);
    border-bottom: 1px solid transparent;
    cursor: pointer;
  }
  .till-order--mobile-expanded .till-order__mobile-bar {
    border-bottom-color: var(--t-border);
  }
  .till-order__mobile-bar-count {
    font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
    color: var(--t-chrome-muted);
  }
  .till-order__mobile-bar-total {
    font: 700 18px 'Geist Mono', monospace;
    color: var(--t-chrome-text);
    margin-left: auto;
  }
  /* chevR rotated −90° = upward (tap to open); rotated 90° = downward (tap to close) */
  .till-order__mobile-bar-chev { color: var(--t-chrome-muted); display: inline-flex; transform: rotate(-90deg); transition: transform 220ms ease; }
  .till-order--mobile-expanded .till-order__mobile-bar-chev { transform: rotate(90deg); }
  /* Desktop hides the bar entirely (display:none from default). */
  .till-order__mobile-bar { display: flex; }

  /* When collapsed, hide everything inside the panel except the mobile bar.
     When expanded, show everything. */
  .till-order:not(.till-order--mobile-expanded) > :not(.till-order__mobile-bar) {
    display: none !important;
  }

  /* Checkout layout — 3 columns side-by-side don't fit on a phone */
  .till-checkout .till-co { grid-template-columns: 1fr !important; min-height: 0 !important; }
  .till-checkout .till-co > div { border-right: 0 !important; border-bottom: 1px solid var(--t-border); }
  .till-checkout .till-co > div:last-child { border-bottom: 0; }

  /* Modal sizing — use dynamic viewport units (dvh) so we account for the mobile
     browser address bar. Without this, 92vh overflows past the visible area and the
     footer (which holds Confirm / Save / Take payment) is unreachable. min-height:0
     on the body lets the flex column actually shrink and scroll instead of overflowing. */
  .till-modal {
    width: 96% !important;
    max-height: 90dvh !important;
    max-height: 90vh; /* fallback */
  }
  /* Flex layout: head and foot stay put, body scrolls when content overflows the modal.
     min-height:0 is critical — without it the body refuses to shrink below content height. */
  .till-modal__body  { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .till-modal__head  { flex: 0 0 auto; }
  .till-modal__foot  { flex: 0 0 auto; }

  /* StaffPinModal — two-stage flow on mobile is now driven by React conditional rendering
     (matchMedia). These rules just keep widths sane within the modal body. */
  .till-staff-grid { max-width: 100% !important; }
  .till-staff-grid .till-keypad { width: 100%; }
  .till-staff-grid .till-keypad button { width: 100%; min-width: 0; }
  /* Short labels on mobile to keep the footer compact */
  .till-staff__home-label-full    { display: none; }
  .till-staff__home-label-short   { display: inline; }
  .till-staff__signin-label-full  { display: none; }
  .till-staff__signin-label-short { display: inline; }

  /* ── Order panel (mobile drawer) — hide non-essentials and tighten totals ── */

  /* Make sure the sticky bar's tap target is generous and the chevron isn't tiny */
  .till-order__mobile-bar { padding: 0 14px; min-height: 64px; }
  .till-order__mobile-bar-chev { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--t-chip); }

  /* Cash drawer + Receipt are operator-station gestures — don't apply on a phone */
  .till-actions__row:has(> .till-btn .till-icon-drawer),
  .till-actions__row[data-mobile-hide],
  .till-actions__row--device { display: none !important; }
  /* The two-button row holding Cash drawer + Receipt is the 2nd row in till-actions. */
  .till-order .till-actions > .till-actions__row:nth-of-type(2) { display: none !important; }

  /* Collapsible totals breakdown — show only Total by default, an [+] reveals the rest */
  .till-totals[data-mobile-collapsed="1"] .till-totals__row:not(.till-totals__row--total) { display: none; }
  .till-totals__mobile-toggle {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 8px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--t-chrome-muted); background: var(--t-chip);
    border: 1px solid var(--t-border); border-radius: 6px; cursor: pointer;
  }

  /* ── Overflow containment ──────────────────────────────────────────────────
     The root collapses to a single 1fr column on mobile, but .till-main is a grid
     item with the default min-width:auto, so its track refuses to shrink below the
     main column's min-content (~440px — driven by the topbar's fixed-width search
     button). That floored the whole column wider than the phone, and the body's
     overflow:hidden then clipped the right half of the product grid with no way to
     scroll. min-width:0 lets these tracks/flex items actually shrink to fit. */
  .till-main,
  .till-scroll,
  .till-topbar { min-width: 0; }
  /* The search trigger has a hard min-width:220px for desktop; let it shrink and
     fill the remaining topbar space on a phone instead of forcing overflow. */
  .till-search-btn { min-width: 0; flex: 1 1 auto; }
  .till-search-btn kbd { display: none; } /* ⌘K hint is irrelevant on touch */

  /* ── Product grid — 2 columns on phones, 3 on small tablets, never overflows ── */
  /* Override the runtime inline grid-template-columns so the grid always fits */
  .till-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; padding: 10px 12px; }
  .till-card { min-height: 88px; padding: 10px 12px; min-width: 0; }
  .till-card__head { gap: 6px; }

  /* ── Subcategory tiles — same containment as the product grid ──
     The runtime sets an inline repeat(cols, 1fr); 1fr == minmax(auto, 1fr), so each
     column was floored at its label's min-content and the 3-column row overran the
     viewport. Force 2 equal minmax(0,1fr) columns so they shrink + ellipsize, and
     make the tiles shorter on a phone. */
  .till-subcat-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    padding: 10px 12px 0;
  }
  .till-subcat-tile {
    min-height: 0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12.5px;
  }

  /* ── Modifier modal — keep the step tabs and footer CTA inside the modal ──
     The breadcrumb tab buttons are flex:1 but min-width:auto, so their labels
     refuse to ellipsize and the row overran the modal. The footer "Add to order"
     CTA is also too long for a narrow modal — swap to the short label below. */
  .till-mod-steps__tab { min-width: 0; }
  .till-modal__foot { flex-wrap: wrap; row-gap: 8px; }
  .till-mod-cta-full  { display: none; }
  .till-mod-cta-short { display: inline; }
  @media (min-width: 560px) {
    .till-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  }

  /* Order panel — same dvh treatment so the expanded drawer doesn't run off screen */
  .till-order.till-order--mobile-expanded {
    height: 90dvh;
    height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Keep the bar sticky at the top of the expanded drawer so the user can always
     find the chevron to collapse it again. */
  .till-order__mobile-bar {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}

/* Native date/time pickers: keep inside the viewport on mobile. */
input[type="date"],
input[type="time"],
input[type="datetime-local"] { box-sizing: border-box; max-width: 100%; min-width: 0; }
@media (hover: none) and (pointer: coarse) {
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"] { -webkit-appearance: none; appearance: none; width: 100%; font-size: 16px; }
  input[type="date"]::-webkit-date-and-time-value,
  input[type="time"]::-webkit-date-and-time-value,
  input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
}

/* ── Food Courses add-on ─────────────────────────────────────────────────────
   Cart course-group headers + the per-line course picker (shown when a line is
   selected). Off entirely when the add-on is disabled (the till never renders
   these). */
.till-course-group { display: contents; }
.till-course-group__header {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 0 2px;
  padding: 4px 6px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t-accent-text);
  background: var(--t-accent-soft);
  border-radius: 6px;
}
.till-course-group__name { display: inline-flex; align-items: center; gap: 6px; }
.till-course-group__count {
  min-width: 18px; text-align: center;
  padding: 1px 6px; border-radius: 999px;
  background: var(--t-accent-chip); color: var(--t-accent-text);
}

.till-line__course {
  grid-column: 2 / 4;
  margin-top: 6px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600;
  color: var(--t-chrome-muted);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.till-line__course-label { flex: none; }
.till-line__course-select {
  flex: 1 1 auto;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--t-chrome-bg-2);
  border: 1px solid var(--t-chrome-border);
  color: var(--t-chrome-text, inherit);
  font: inherit; font-size: 11.5px; text-transform: none; letter-spacing: 0;
}
.till-primary-device-note {
  padding: 10px 12px;
  border: 1px solid var(--t-border);
  border-radius: 6px;
  background: var(--t-surface-2);
  color: var(--t-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

/* ── Till Settings ───────────────────────────────────────────────────────────
   Per-till preferences (client/till/android/TILL_SETTINGS_SPEC.md §1). Three
   parts: the tile-size preference, which re-sizes the product grid; the greyed
   state for an item that cannot be sold right now; and the settings screen
   itself, which reuses the modifier modal's group/option furniture so it reads
   as part of the same till rather than a bolted-on admin page. */

/* Tile size — the product tiles only. Category and subcategory tiles keep their
   own proportions so the menu's structure stays recognisable at every size. */
.till-root[data-till-tile-size='compact'] .till-card { min-height: 84px; padding: 10px 12px; }
.till-root[data-till-tile-size='compact'] .till-card__head { margin-bottom: 5px; }
.till-root[data-till-tile-size='compact'] .till-card__name { font-size: 12.5px; }
.till-root[data-till-tile-size='compact'] .till-card__row { font-size: 11px; }
.till-root[data-till-tile-size='compact'] .till-card__single-price { font-size: 12.5px; }

.till-root[data-till-tile-size='large'] .till-card { min-height: 150px; padding: 18px 20px; }
.till-root[data-till-tile-size='large'] .till-card__head { margin-bottom: 12px; }
.till-root[data-till-tile-size='large'] .till-card__name { font-size: 16px; }
.till-root[data-till-tile-size='large'] .till-card__row { font-size: 13px; }
.till-root[data-till-tile-size='large'] .till-card__single-price { font-size: 16px; }

/* Unsellable / out-of-stock. Deliberately still legible: the point is to answer
   "why can't I sell this?", which a tile faded to nothing cannot do. */
.till-card--blocked {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--t-surface-2, var(--t-surface));
  border-style: dashed;
}
.till-card--blocked:hover { border-color: var(--t-border); background: var(--t-surface-2, var(--t-surface)); box-shadow: none; }
.till-card--blocked:active { transform: none; }
.till-card--blocked .till-card__name { text-decoration: line-through; text-decoration-thickness: 1px; }
.till-card__blocked {
  margin: -2px 0 6px;
  font: 600 9.5px/1.3 'Geist', system-ui, sans-serif;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--t-danger-text, #B23A2E);
}

/* Settings screen */
.till-settings { width: 720px; }
.till-set-empty, .till-set-error {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--t-surface-hi);
  border: 1px solid var(--t-border);
  color: var(--t-muted);
  font-size: 12px;
}
.till-set-error {
  border-color: var(--t-danger-border, rgba(178,58,46,0.3));
  background: var(--t-danger-soft, #FBE3DE);
  color: var(--t-danger-text, #B23A2E);
  font-weight: 500;
}

/* The Back Office device record this screen extends — read-only by design. */
.till-set-device {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  background: var(--t-surface-hi);
}
.till-set-device__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.till-set-device__name { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.till-set-device__badge {
  font: 600 9.5px/1 'Geist', system-ui, sans-serif;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t-muted);
  padding: 4px 7px; border-radius: 5px; background: var(--t-chip);
  flex: none;
}
.till-set-device__grid {
  margin: 0;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  font-size: 11.5px;
}
.till-set-device__grid dt { color: var(--t-muted); font-weight: 500; }
.till-set-device__grid dd { margin: 0; color: var(--t-text); font-weight: 500; }
.till-set-device__missing { font-size: 11.5px; line-height: 1.45; color: var(--t-muted); }

.till-set-field {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--t-border);
}
.till-set-field:last-child { border-bottom: 0; }
.till-set-field__text { min-width: 0; }
.till-set-field__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  color: var(--t-text);
}
.till-set-field__tag {
  font: 600 9px/1 'Geist', system-ui, sans-serif;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t-muted);
  padding: 3px 6px; border-radius: 4px; background: var(--t-chip);
}
.till-set-field__hint { margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--t-muted); }
.till-set-field__source {
  margin-top: 3px;
  font: 600 9.5px/1.3 'Geist', system-ui, sans-serif;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--t-accent-text);
}

.till-set-choices { display: flex; gap: 4px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.till-set-choice {
  min-width: 46px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--t-surface-hi);
  border: 1px solid var(--t-border);
  color: var(--t-text);
  font-size: 11.5px; font-weight: 600;
  cursor: pointer;
  transition: all 100ms ease;
}
.till-set-choice:hover:not(:disabled) { border-color: var(--t-border-strong); }
.till-set-choice--active {
  background: var(--t-accent-soft);
  border-color: var(--t-accent);
  color: var(--t-accent-text);
}
.till-set-choice:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 1000px) {
  .till-settings { width: 100%; }
  .till-set-field { flex-direction: column; align-items: stretch; gap: 8px; }
  .till-set-choices { justify-content: flex-start; }
  .till-set-choice { flex: 1; }
}
