/* Vaakam Dine. Builds on the Vaakam tokens (assets/brand/vaakam-tokens.css), same language as Vaakam Class and Clinic.
   The restaurant colour arrives as --accent / --on-accent from dine.config.json (theme), set by src/ui/app.js.
   The accent has one job: what a customer or the kitchen should press or read first (primary button, selected choice, the total,
   focus ring, a new order). Everything else is ink, paper and hairlines. Numbers are set in the mono face. */
:root {
  --accent: var(--signal);
  --on-accent: var(--on-signal);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
  --font-ui: 'Anek Latin', 'Noto Sans Devanagari', 'Nirmala UI', 'Anek Devanagari', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Noto Sans Devanagari', 'Nirmala UI', system-ui, sans-serif;
  --surface: var(--surface-raised);
  --tint: color-mix(in srgb, var(--accent) 8%, var(--surface));
  --ok: #2F6B3F; --warn: #8A5A00; --bad: #A3341C;
  --page-max: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--p-ink-900); --fg: var(--p-paper-100); --muted: var(--p-stone-400); --line: var(--p-ink-700);
    --card: var(--p-ink-800); --surface: var(--p-ink-800); --surface-raised: var(--p-ink-800);
    --accent: var(--accent-dark, var(--accent)); --on-accent: var(--on-accent-dark, var(--on-accent));
    --ok: #8FC79B; --warn: #E2B45C; --bad: #F0937C;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--fs-sm)/var(--lh-body) var(--font-ui); -webkit-font-smoothing: antialiased; }
:lang(hi) body, body:lang(hi) { line-height: 1.7; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.1; margin: 0; font-weight: 650; }
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3 { letter-spacing: 0; line-height: 1.3; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.skip { position: absolute; left: var(--s-4); top: -60px; background: var(--fg); color: var(--bg); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: var(--s-2); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.demo-bar { background: var(--fg); color: var(--bg); font-size: var(--fs-xs); line-height: 1.4; padding: 8px var(--s-4); text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), transform 120ms var(--ease); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-ghost { border-color: var(--fg); }
.btn-ghost:hover, .btn-quiet:hover, .btn:not(.btn-primary):hover { background: var(--card); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-xs); gap: 6px; }
.btn-sm svg.i { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; display: inline-flex; align-items: center; gap: 4px; }
.lang { min-height: 40px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; font-size: var(--fs-xs); font-weight: 500; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: inline-grid; place-items: center; flex: none; color: inherit; }
.icon-btn:hover { background: var(--card); }
.icon-btn.sm { width: 36px; height: 36px; border: var(--hairline); }
.icon-btn.sm svg.i { width: 16px; height: 16px; }

.tag { border: var(--hairline); border-radius: var(--r-pill); padding: 0 8px; font-size: 12px; line-height: 20px; white-space: nowrap; color: var(--muted); }
.monogram { width: 40px; height: 40px; border-radius: 12px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font: 700 18px/1 var(--font-display); flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.empty { padding: var(--s-5); border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-xs); }
.help { font-size: var(--fs-xs); color: var(--muted); }
.err { font-size: var(--fs-xs); color: var(--bad); font-weight: 500; }
.alert { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); margin-bottom: var(--s-4); font-size: var(--fs-xs); font-weight: 500; }

/* Chips and choices */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); font-weight: 500; display: inline-flex; align-items: center; gap: var(--s-2); }
.chip-sm { min-height: 38px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip:disabled { opacity: .5; cursor: not-allowed; text-decoration: line-through; }
.chip .cnt { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .7; }
.choices { display: grid; gap: var(--s-2); }
.choice { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: grid; gap: 2px; min-height: 60px; }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice .t { font-weight: 600; }
.choice .s { color: var(--muted); font-size: var(--fs-xs); }

/* Fields */
.field { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.field > label, .field > legend { font-weight: 500; font-size: var(--fs-xs); margin-bottom: 6px; }
fieldset.field > legend + * { margin-top: 0; }
.input { min-height: 52px; width: 100%; padding: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: 18px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.prefix { display: flex; align-items: stretch; }
.prefix span { display: grid; place-items: center; padding: 0 var(--s-3); border: 1px solid var(--line); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); color: var(--muted); background: var(--card); }
.prefix .input { border-radius: 0 var(--r-md) var(--r-md) 0; }

.small { font-size: var(--fs-xs); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
textarea.input { min-height: 76px; padding: var(--s-3) var(--s-4); line-height: 1.4; resize: vertical; font-size: 17px; }

/* Food marks: the FSSAI symbols. Veg = green square with a dot, non-veg = brown square with a triangle. */
.vm { width: 16px; height: 16px; border: 1.5px solid #2E7D32; border-radius: 3px; display: inline-grid; place-items: center; flex: none; background: #FFFFFF; }
.vm::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2E7D32; }
.vm.nv { border-color: #7A3E1D; }
.vm.nv::after { border-radius: 0; width: 9px; height: 8px; background: #7A3E1D; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* Stepper and Add */
.stepper { display: inline-flex; align-items: center; height: 40px; border-radius: 10px; background: var(--accent); color: var(--on-accent); overflow: hidden; flex: none; }
.stepper button { width: 38px; height: 40px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; }
.stepper button:hover { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.stepper svg.i { width: 16px; height: 16px; stroke-width: 2.4; }
.stepper .num { min-width: 22px; text-align: center; font-weight: 600; font-size: 15px; }
.add { height: 40px; min-width: 96px; padding: 0 var(--s-4); border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--surface);
  color: var(--accent); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 15px; position: relative; box-shadow: 0 2px 8px -4px color-mix(in srgb, var(--fg) 40%, transparent); }
:lang(hi) .add { text-transform: none; letter-spacing: 0; }
.add:hover { background: var(--tint); }
.add .plus { position: absolute; top: 1px; right: 6px; font-size: 13px; font-weight: 600; }
.sold { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); height: 40px; display: grid; place-items: center; min-width: 96px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); }

/* ---------- Customer page ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--s-4); }
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) 0 var(--s-3); }
.brand { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.r-name { font-size: 26px; letter-spacing: -0.03em; line-height: 1.1; }
.status { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 500; flex-wrap: wrap; margin-top: 2px; line-height: 1.35; }
.status .muted { font-weight: 400; }
.status.is-closed { color: var(--bad); }
.status.is-closed .dot { background: var(--bad); }
.intro { padding-bottom: var(--s-4); }
.tagline { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; max-width: 46ch; }
.banner { display: flex; gap: var(--s-2); align-items: flex-start; margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--fg); font-size: var(--fs-xs); font-weight: 500; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.banner svg.i { color: var(--warn); margin-top: 1px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-top: var(--s-4); }
.mode { display: flex; align-items: center; gap: var(--s-3); text-align: left; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); min-height: 64px; }
.mode b { display: block; font-weight: 600; }
.mode small { display: block; font-size: 13px; color: var(--muted); line-height: 1.3; }
.mode svg.i { width: 22px; height: 22px; color: var(--muted); }
.mode[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--tint); }
.mode[aria-checked="true"] svg.i { color: var(--accent); }
.modes-sm .mode { min-height: 52px; }
.direct { display: flex; gap: 6px; align-items: flex-start; margin-top: var(--s-3); font-size: 13px; color: var(--muted); line-height: 1.4; }
.direct svg.i { width: 16px; height: 16px; color: var(--ok); margin-top: 1px; }

.cats { position: sticky; top: 0; z-index: 10; display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; background: var(--bg);
  margin: 0 calc(-1 * var(--s-4)); padding: var(--s-2) var(--s-4); border-bottom: var(--hairline); }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-pill); text-decoration: none; font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.cat[aria-current] { background: var(--fg); color: var(--bg); }
.veg-toggle { flex: none; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); font-size: 15px; font-weight: 500; margin-right: var(--s-2); }
.veg-toggle[aria-pressed="true"] { border-color: #2E7D32; background: color-mix(in srgb, #2E7D32 10%, var(--surface)); }

.cat-sec { padding-top: var(--s-6); scroll-margin-top: 64px; }
.cat-sec > h2 { font-size: var(--fs-md); display: flex; align-items: baseline; gap: var(--s-2); padding-bottom: var(--s-2); border-bottom: 2px solid var(--fg); }
.cat-sec > h2 .cnt { font: 500 13px/1 var(--font-mono); color: var(--muted); }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 124px; gap: var(--s-4); padding: var(--s-5) 0; border-bottom: var(--hairline); }
.item:last-child { border-bottom: 0; }
.item-marks { display: flex; align-items: center; gap: var(--s-2); margin-bottom: 6px; flex-wrap: wrap; }
.pick { font-size: 12px; font-weight: 600; color: var(--warn); }
.egg { font-size: 12px; color: var(--muted); }
.item-name { font-family: var(--font-ui); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.item-price { margin-top: 2px; font-size: 15px; font-weight: 500; }
.item-desc { margin-top: var(--s-2); color: var(--muted); font-size: 14px; line-height: 1.45; }
.item-custom { margin-top: 6px; font-size: 12px; color: var(--muted); }
.item-side { display: flex; flex-direction: column; align-items: center; position: relative; }
.ph { width: 124px; height: 112px; border-radius: 14px; object-fit: cover; display: block; }
.ph-empty { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--card) 0 8px, color-mix(in srgb, var(--card) 60%, var(--bg)) 8px 16px); border: 1px dashed var(--line); }
.ph-empty span { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
:lang(hi) .ph-empty span { text-transform: none; letter-spacing: 0; }
.item-side > .add, .item-side > .stepper, .item-side > .sold { margin-top: -20px; }
.item.is-out .item-name, .item.is-out .item-price { color: var(--muted); }
.item.is-out .ph { opacity: .5; filter: grayscale(1); }

.more { padding: var(--s-7) 0 calc(var(--s-10) + env(safe-area-inset-bottom)); display: grid; gap: var(--s-6); }
.table-cta { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-5); border: var(--hairline); border-radius: var(--r-lg); background: var(--surface); }
.table-cta h2, .info h2 { font-size: var(--fs-md); }
.table-cta p { font-size: var(--fs-xs); margin-top: 2px; }
.info { display: grid; gap: var(--s-3); }
.addr { font-size: var(--fs-sm); line-height: 1.45; max-width: 36ch; }
.quick { display: flex; gap: var(--s-2); }
.quick .btn { flex: 1; max-width: 220px; }
.hours { margin: var(--s-2) 0 0; border-top: var(--hairline); font-size: var(--fs-xs); }
.hours div { display: flex; justify-content: space-between; gap: var(--s-3); padding: 6px 0; border-bottom: var(--hairline); }
.hours dt { color: var(--muted); }
.hours dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.hours .is-today { font-weight: 600; }
.hours .is-today dt { color: var(--fg); }
.zones h3 { font-size: var(--fs-sm); margin: var(--s-3) 0 var(--s-2); }
.zones ul { list-style: none; margin: 0; padding: 0; font-size: var(--fs-xs); display: grid; gap: var(--s-2); }
.zones li { display: grid; gap: 0; }
.foot { color: var(--muted); font-size: var(--fs-xs); display: flex; align-items: center; gap: var(--s-2); }
.foot img { height: 14px; width: auto; display: block; }
.dark-only { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dark-only { display: block; } :root:not([data-theme="light"]) .light-only { display: none; } }

.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.cart-bar .btn { width: 100%; max-width: 688px; margin: 0 auto; display: flex; justify-content: space-between; min-height: 56px; border-radius: 14px; padding: 0 var(--s-5); font-size: 17px;
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.cb-go { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }

.col-cart { display: none; }
.cart-card { border: var(--hairline); border-radius: var(--r-lg); background: var(--surface); padding: var(--s-5); }
.cart-card h2 { font-size: var(--fs-md); margin-bottom: var(--s-3); }
.mini { list-style: none; margin: 0; padding: 0; font-size: var(--fs-xs); }
.mini li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 6px 0; border-bottom: var(--hairline); }
.mini li > span:first-child { display: flex; gap: var(--s-2); align-items: flex-start; min-width: 0; }
.mini .vm { margin-top: 3px; width: 13px; height: 13px; } .mini .vm::after { width: 6px; height: 6px; }
.mini-total { display: flex; justify-content: space-between; padding: var(--s-3) 0 var(--s-2); font-weight: 600; }
.cart-card .btn { margin-top: var(--s-3); }

/* Customise sheet */
.opt { margin-top: var(--s-5); }
.opt legend { display: flex; width: 100%; justify-content: space-between; align-items: baseline; font-weight: 600; margin-bottom: var(--s-2); }
.opt-rule { font-size: 12px; font-weight: 500; color: var(--muted); }
.opt-list { display: grid; border: var(--hairline); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.opt-c { display: grid; grid-template-columns: 22px 1fr auto; gap: var(--s-3); align-items: center; min-height: 52px; padding: 0 var(--s-4); border: 0; border-bottom: var(--hairline); background: none; text-align: left; }
.opt-c:last-child { border-bottom: 0; }
.opt-c:disabled { opacity: .45; cursor: not-allowed; }
.opt-p { font-size: var(--fs-xs); color: var(--muted); }
.tick { width: 20px; height: 20px; border: 1.5px solid var(--muted); border-radius: 5px; display: grid; place-items: center; }
.tick.round { border-radius: 50%; }
.opt-c[aria-checked="true"] .tick { border-color: var(--accent); background: var(--accent); }
.opt-c[aria-checked="true"] .tick::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.opt-c[aria-checked="true"] .tick.round::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--on-accent); transform: none; }
.sheet-cta .stepper { height: 52px; } .sheet-cta .stepper button { height: 52px; width: 44px; }
.sheet-cta .btn-primary { min-height: 52px; max-width: none; }

/* Checkout */
.flow { min-height: 100dvh; display: flex; flex-direction: column; }
.flow-top { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) 0; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.flow-top .icon-btn { margin-left: -10px; }
.flow-top .step { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }
.flow-h { font-size: var(--fs-lg); margin: var(--s-2) 0; }
.flow-body { flex: 1; padding-bottom: var(--s-6); }
.flow-cta { position: sticky; bottom: 0; padding: var(--s-3) 0 calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--bg); }
.flow-cta .btn { width: 100%; min-height: 56px; font-size: var(--fs-md); }
.co-sec { padding: var(--s-5) 0; border-bottom: var(--hairline); }
.co-sec > h2 { font-size: var(--fs-md); margin-bottom: var(--s-3); }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto 76px; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: var(--hairline); }
.line-t { display: flex; gap: var(--s-2); align-items: flex-start; min-width: 0; }
.line-t .vm { margin-top: 4px; }
.line-n { font-weight: 500; line-height: 1.3; }
.line-p { text-align: right; font-weight: 500; }
.line .stepper { height: 34px; border-radius: 8px; } .line .stepper button { height: 34px; width: 32px; }
.line.is-bad .line-n { color: var(--muted); text-decoration: line-through; }
.add-more { margin-top: var(--s-3); min-height: 40px; font-size: var(--fs-xs); font-weight: 500; }
.add-more svg.i, .link svg.i { width: 16px; height: 16px; }
.pin-row { display: flex; gap: var(--s-2); align-items: center; }
.pin-row .input { max-width: 180px; }
.zone-ok { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-xs); color: var(--ok); font-weight: 500; }
.zone-ok svg.i { width: 16px; height: 16px; margin-top: 2px; }
.note-box { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card); font-size: var(--fs-xs); margin: var(--s-3) 0; }
.slot-pick { margin-top: var(--s-3); display: grid; gap: var(--s-3); }
.slot-pick select { max-width: 240px; }
.cp-form { display: flex; gap: var(--s-2); }
.cp-form .input { text-transform: uppercase; }
.cp-form .btn { min-height: 52px; }
.cp-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.cp { width: 100%; text-align: left; display: grid; gap: 2px; padding: var(--s-3) var(--s-4); border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface); }
.cp:hover { border-color: var(--accent); }
.cp-code { font: 600 14px/1.3 var(--font-mono); letter-spacing: .04em; color: var(--accent); }
.cp-on { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.cp-on svg.i { color: var(--ok); }
.cp-on b { font-family: var(--font-mono); letter-spacing: .04em; }
.bill-rows { margin: 0; font-size: var(--fs-xs); }
.bill-rows > div { display: flex; justify-content: space-between; gap: var(--s-3); padding: 5px 0; }
.bill-rows dt { color: var(--muted); }
.bill-rows dd { margin: 0; }
.bill-rows .save dd { color: var(--ok); font-weight: 600; }
.bill-rows > .bill-total { border-top: 2px solid var(--fg); margin-top: var(--s-2); padding-top: var(--s-3); font-size: var(--fs-md); font-weight: 600; align-items: baseline; }
.bill-total dt { color: var(--fg); }
.bill-total dd { color: var(--accent); font-size: 26px; letter-spacing: -0.03em; }
.bill .help, .bill .muted.small { margin-top: var(--s-2); }
.place { position: sticky; bottom: 0; padding: var(--s-3) 0 calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--bg); z-index: 4; border-top: var(--hairline); margin-top: var(--s-4); }
.place .btn { min-height: 56px; font-size: var(--fs-md); border-radius: 14px; }
.place .muted { margin-top: var(--s-2); font-size: 12px; text-align: center; }

/* Placed / sent slip */
.booked-title { display: flex; align-items: center; gap: var(--s-2); color: var(--ok); font-weight: 600; margin-top: var(--s-4); }
.slip { margin: var(--s-5) 0; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.slip-top { padding: var(--s-5); display: grid; gap: 2px; }
.slip .k { color: var(--muted); font-size: var(--fs-xs); }
.slip-name { font: 650 clamp(32px, 9vw, 44px)/1.1 var(--font-display); letter-spacing: -0.03em; margin: var(--s-1) 0; }
.slip-name.num { font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.04em; font-size: clamp(30px, 8.5vw, 40px); }
.slip-cut { height: 0; border-top: 2px dashed var(--line); margin: 0 var(--s-4); position: relative; }
.slip-cut::before, .slip-cut::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.slip-cut::before { left: -27px; } .slip-cut::after { right: -27px; }
.slip-body { padding: var(--s-4) var(--s-5); }
.slip-foot { padding: var(--s-4) var(--s-5) var(--s-5); font-weight: 500; }
.next-step { font-weight: 500; }
.note { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-1); }
.after { display: grid; gap: var(--s-2); margin-top: var(--s-5); }
.pay-note { font-size: var(--fs-xs); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card); margin: var(--s-2) 0; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 2px var(--s-4); }
.chips-scroll > .chip { flex: none; }
.times .chip { min-width: 92px; justify-content: center; }
.party { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.party .stepper { height: 48px; } .party .stepper button { height: 48px; width: 44px; } .party .stepper .num { min-width: 30px; font-size: 18px; }

/* Sheets: bottom sheet on a phone, centred dialog on a laptop */
body.has-sheet { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; background: color-mix(in srgb, var(--p-ink-950) 45%, transparent); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap > .sheet { width: 100%; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 0 var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom)); }
.sheet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); position: sticky; top: 0; background: var(--bg); padding: var(--s-4) 0 var(--s-3); z-index: 2; }
.sheet-top h2 { font-size: var(--fs-md); }
.sheet-cta { display: flex; gap: var(--s-3); justify-content: flex-end; align-items: center; position: sticky; bottom: calc(-1 * var(--s-4) - env(safe-area-inset-bottom)); background: var(--bg); padding: var(--s-3) 0; margin-top: var(--s-5); border-top: var(--hairline); }
.sheet-cta .btn-primary { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(var(--s-5) + env(safe-area-inset-bottom)); transform: translate(-50%, 200%); background: var(--fg); color: var(--bg);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-md); max-width: calc(100vw - 32px); font-size: var(--fs-xs); font-weight: 500;
  transition: transform var(--t-base) var(--ease), visibility 0s linear var(--t-base); z-index: 60; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

/* ---------- Kitchen board ---------- */
.b-wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--s-4) var(--s-8); }
.b-top { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; }
.b-id { display: flex; align-items: center; gap: var(--s-3); margin-right: auto; min-width: 0; }
.b-name { font: 600 var(--fs-sm)/1.2 var(--font-display); }
.b-sub { font-size: var(--fs-xs); color: var(--muted); line-height: 1.3; }
.b-tools { display: flex; gap: var(--s-2); align-items: center; }
.b-tools .btn-sm { min-height: 40px; }
.switches { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); padding-bottom: var(--s-3); }
.switch { display: inline-flex; align-items: center; gap: var(--s-2); border: 0; background: none; padding: 0; text-align: left; min-height: 44px; }
.knob { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background var(--t-fast) var(--ease); }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t-fast) var(--ease); }
.switch[aria-checked="true"] .knob { background: var(--ok); }
.switch[aria-checked="true"] .knob::after { transform: translateX(18px); }
#sw-busy[aria-checked="true"] .knob { background: var(--warn); }
.switch-lg { padding: var(--s-2) var(--s-3); border: var(--hairline); border-radius: var(--r-md); background: var(--surface); align-items: center; }
.sw-t b { display: block; font-weight: 600; font-size: 15px; line-height: 1.2; }
.sw-t small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
#sw-open[aria-checked="false"] { border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
#sw-busy[aria-checked="true"] { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.sw-l { font-size: 13px; font-weight: 500; min-width: 64px; }
.tabs { display: flex; gap: var(--s-1); border-bottom: var(--hairline); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 0 var(--s-4); }
.tab { position: relative; min-height: 48px; padding: 0 var(--s-3); border: 0; background: none; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab[aria-current="page"] { color: var(--fg); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 2px; background: var(--fg); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.badge-hot { background: var(--accent); color: var(--on-accent); }
.b-main { padding-top: var(--s-4); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-content: start; }
.lead { max-width: 70ch; }
.bar { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bar .chips { flex: 1 1 320px; }

.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.order { background: var(--surface); border: var(--hairline); border-left: 4px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: grid; gap: var(--s-2); min-width: 0; }
.order.st-new { border-left-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.order.st-accepted, .order.st-preparing { border-left-color: var(--warn); }
.order.st-ready, .order.st-out { border-left-color: var(--ok); }
.order.st-rejected { opacity: .75; }
.o-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; }
.o-code { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.o-id { display: grid; min-width: 0; }
.o-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-sub { font-size: 12px; color: var(--muted); }
.o-st { font-size: 12px; font-weight: 600; padding: 0 8px; line-height: 22px; border-radius: var(--r-pill); border: 1px solid currentColor; white-space: nowrap; }
.st-new .o-st { color: var(--accent); background: var(--tint); }
.st-accepted .o-st, .st-preparing .o-st { color: var(--warn); }
.st-ready .o-st, .st-out .o-st, .st-done .o-st { color: var(--ok); }
.st-rejected .o-st { color: var(--bad); }
.o-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.o-tags .tag { display: inline-flex; align-items: center; gap: 4px; line-height: 24px; }
.o-tags .tag svg.i { width: 14px; height: 14px; }
.tag-when { color: var(--fg); border-color: var(--fg); font-weight: 600; }
.tag-pay { color: var(--warn); border-color: currentColor; font-weight: 600; }
.o-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.o-lines li { display: flex; gap: var(--s-2); align-items: flex-start; line-height: 1.35; }
.o-lines .vm { margin-top: 3px; width: 13px; height: 13px; } .o-lines .vm::after { width: 6px; height: 6px; }
.o-lines b { font-weight: 600; }
.o-note { font-size: var(--fs-xs); font-style: italic; padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 10%, transparent); justify-self: start; }
.o-addr { font-size: 13px; color: var(--muted); display: flex; gap: 4px; align-items: flex-start; }
.o-addr svg.i { width: 14px; height: 14px; margin-top: 3px; }
.o-reason { font-size: 13px; color: var(--bad); font-weight: 500; }
.o-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; border-top: var(--hairline); padding-top: var(--s-2); }
.o-total { font-weight: 600; font-size: 17px; }
.o-acts { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.o-acts .btn-sm { min-height: 40px; }
.compact .order { gap: 4px; }
.kanban { display: none; }
.finished { margin-top: var(--s-4); }
.finished summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.finished .orders { margin-top: var(--s-2); }

.sum { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border-top: var(--hairline); border-left: var(--hairline); }
.sum > div { padding: var(--s-3) var(--s-4); border-right: var(--hairline); border-bottom: var(--hairline); min-width: 0; }
.sum dt { font-size: 13px; color: var(--muted); }
.sum dd { margin: 0; font: 500 28px/1.15 var(--font-mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.sum p { font-size: 12px; }
.sum .sum-money { grid-column: 1 / -1; background: var(--tint); }
.sum .sum-money dd { font-size: 34px; color: var(--accent); }
.two { display: grid; gap: var(--s-6); }
.panel-head { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-3); }
.panel-head h2 { font-size: var(--fs-md); }
.panel-head .cnt { color: var(--muted); font-variant-numeric: tabular-nums; }
.topi { list-style: none; margin: 0; padding: 0; }
.topi li { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: var(--hairline); }
.panel .small + .small { margin-top: var(--s-2); }

.stock-cat h2 { font-size: var(--fs-sm); padding-bottom: var(--s-2); border-bottom: 2px solid var(--fg); }
.stock { list-style: none; margin: 0 0 var(--s-5); padding: 0; }
.stock li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; min-height: 56px; border-bottom: var(--hairline); }
.stock li.is-out .s-n { color: var(--muted); text-decoration: line-through; }
.stock .num { font-size: var(--fs-xs); }

.custs, .ress { list-style: none; margin: 0; padding: 0; }
.cust, .res { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; min-height: 64px; padding: var(--s-2) 0; border-bottom: var(--hairline); }
.res { grid-template-columns: 96px minmax(0, 1fr) auto; }
.res-when .num { white-space: nowrap; }
.who { display: grid; min-width: 0; }
.nm { font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); }
.c-n { display: grid; justify-items: end; font-size: var(--fs-xs); }
.res-when { display: grid; }
.res-when .num { font-weight: 600; }
.rs-declined .nm { color: var(--muted); font-weight: 500; }
.icon-btn.wa { color: #1E8E4E; }

@media (min-width: 720px) {
  .choices { grid-template-columns: repeat(2, 1fr); }
  .sheet-wrap { align-items: center; padding: var(--s-6); }
  .sheet-wrap > .sheet { max-width: 520px; border-radius: var(--r-lg); max-height: 86dvh; padding: 0 var(--s-6) var(--s-4); }
  .sheet-cta { bottom: calc(-1 * var(--s-4)); }
  .switches { display: flex; flex-wrap: wrap; }
  .sum { grid-template-columns: repeat(5, 1fr); }
  .sum .sum-money { grid-column: auto; }
  .list-view { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
}
@media (min-width: 1100px) {
  .wrap { max-width: 1280px; padding: 0 var(--s-6); }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-8); align-items: start; }
  .col-cart { display: block; position: sticky; top: var(--s-5); padding-top: var(--s-4); }
  .cart-bar { display: none; }
  .top { padding-top: var(--s-6); }
  .r-name { font-size: 40px; }
  .cats { margin: 0; padding: var(--s-2) 0; flex-wrap: wrap; row-gap: var(--s-1); }
  .items { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s-6); }
  .item:last-child { border-bottom: var(--hairline); }
  .item { grid-template-columns: minmax(0, 1fr) 140px; }
  .ph { width: 140px; height: 120px; }
  .more { grid-template-columns: 1fr 1fr; align-items: start; padding-bottom: var(--s-8); }
  .table-cta, .more .foot { grid-column: 1 / -1; }
  .wrap.flow { max-width: 1080px; }
  .co-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-8); align-items: start; }
  .co-b { position: sticky; top: 72px; }
  .place { position: static; border-top: 0; }
  .wrap.flow .flow-body { max-width: 640px; }

  .b-wrap { padding: 0 var(--s-6) var(--s-8); }
  .b-top { padding-top: var(--s-4); }
  .tabs { margin: 0; padding: 0; }
  .two { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-8); align-items: start; }
  .is-live .bar > .chips { display: none; }
  .is-live .list-view { display: none; }
  .is-live .bar { justify-content: flex-end; }
  .kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); align-items: start; }
  .lane { background: var(--card); border-radius: var(--r-md); padding: var(--s-2); min-height: 240px; min-width: 0; }
  .lane-h { font-size: var(--fs-xs); font-family: var(--font-ui); font-weight: 600; display: flex; gap: var(--s-2); align-items: baseline; padding: var(--s-1) var(--s-2) var(--s-2); }
  .lane-h .cnt { color: var(--muted); font-family: var(--font-mono); }
  .lane .orders { gap: var(--s-2); }
  .lane .order { padding: var(--s-3); }
  .lane .o-code { font-size: 22px; }
  .lane .o-st { display: none; }
  .compact.orders { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (max-width: 719px) {
  .hide-sm { display: none; }
  .tabs { gap: 0; }
  .tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .tabs.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
  .tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
  .bar > .chips { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 2px var(--s-4); }
  .bar > .chips::-webkit-scrollbar { display: none; }
  .bar > .chips > .chip { flex: none; }
  .tab { padding: 0 8px; font-size: 15px; flex: 1 0 auto; justify-content: center; }
  .tab[aria-current="page"]::after { left: 8px; right: 8px; }
  .copy-all { width: 100%; }
  .res { grid-template-columns: 88px minmax(0, 1fr); row-gap: var(--s-2); padding: var(--s-3) 0; }
  .res .o-acts { grid-column: 1 / -1; }
  .line { grid-template-columns: minmax(0, 1fr) auto; }
  .line-t { grid-row: 1 / 3; }
  .line-p { grid-column: 2; grid-row: 1; }
  .line .stepper { grid-column: 2; grid-row: 2; justify-self: end; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
