/* ==========================================================================
   Masar Restaurant Suite — screen components (one component language)
   Tokens come from theme.css (brand layer); this file only composes them.
   Performance first: no backdrop blur, no animated backdrops, no sheen,
   no scroll-reveal fades. Logical properties everywhere (RTL + LTR).
   ========================================================================== */

/* ── 0. performance + accessibility baseline ─────────────────────────── */
.aurora, .grain { display: none !important; }
.glass, .card, .topbar, .toast, .sheet, .modal, .scrim, .demo-pop, .tabbar, .catrail-wrap, .stationbar, .colhead {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
.glass::before { content: none !important; }
.btn-gold::after, .btn-clay::after { content: none !important; animation: none !important; }
.reveal, .reveal.in { opacity: 1; transform: none; animation: none; }
.urgent { animation: none; }
html { scroll-behavior: auto; }
body { font-size: 15px; }
:where(button, a, [tabindex], input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ── 1. surfaces ─────────────────────────────────────────────────────── */
.glass, .card {
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-interactive { transition: border-color var(--t-fast), background var(--t-fast); }
.card-interactive:hover { transform: none; box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--gold-500) 45%, var(--hairline)); }
.card-interactive:active { transform: scale(.99); }
.box-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--hairline); min-height: 56px;
}
.box-head h3 { display: flex; align-items: center; gap: var(--s2); font-size: .98rem; }
.box-head h3 svg { width: 18px; height: 18px; color: var(--gold-400); }
.box-tools { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.box-body { padding: var(--s4); }
.is-journey { outline: 2px solid var(--gold-500); outline-offset: 2px; }

/* ── 2. buttons, chips, fields (refinements on the theme components) ── */
.btn { transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.btn:hover { transform: none; box-shadow: none; border-color: var(--hairline-2); }
.btn:active { transform: scale(.97); }
.btn-gold { box-shadow: none; }
.btn-gold:hover { box-shadow: none; filter: brightness(1.04); }
.btn-sm { min-height: 36px; }
.btn-xl { min-height: 60px; font-size: 1.05rem; padding: 0 var(--s6); border-radius: var(--r-lg); }
.btn-lang { min-width: 44px; padding: 0 10px; font-family: var(--font-display); font-weight: 700; }
.btn .badge { margin-inline-start: 2px; }
.chip { line-height: 1; }
.chip svg { width: 14px; height: 14px; }
.field { min-height: 46px; }
.label { display: flex; align-items: center; gap: 6px; }
.label svg { width: 15px; height: 15px; }
.kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
  font: 600 .7rem/1 var(--font-num); border: 1px solid var(--hairline-2); background: var(--surface); color: var(--fg-soft);
  direction: ltr;
}
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; flex: none;
  background: var(--clay-500); color: var(--rs-cream); font: 800 .68rem/1 var(--font-num);
}
.badge.gold { background: var(--gold-500); color: var(--rs-on-gold); }

@media (pointer: coarse), (max-width: 700px) {
  .btn-sm, .segment button, .catrail button { min-height: 44px; }
  .stepper button { width: 44px; height: 44px; }
  /* حقول 16px على اللمس: آيفون يكبّر الصفحة عند لمس حقل أصغر */
  input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea { font-size: 16px; }
}

/* ── 3. shell + topbar ───────────────────────────────────────────────── */
:root { --tb-h: 64px; }
@media (max-width: 700px) { :root { --tb-h: 56px; } }
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 60; height: var(--tb-h);
  display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4);
  background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-line);
}
.topbar.scrolled { box-shadow: var(--sh-2); }
.tb-brand { display: flex; align-items: center; gap: var(--s3); min-width: 0; flex: 0 1 auto; border-radius: var(--r-md); }
.tb-home { flex: none; display: flex; align-items: center; min-height: 44px; min-width: 44px; border-radius: var(--r-md); }
/* the screen name doubles as the screen switcher (opens «الشاشات») */
.tb-switch { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 44px; padding: 0 var(--s3);
  border-radius: var(--r-md); text-align: start; color: var(--fg); border-inline-start: 1px solid var(--hairline-2); border-start-start-radius: 0; border-end-start-radius: 0; }
.tb-switch:hover { background: var(--rs-cream-a06); }
.tb-switch > svg { width: 16px; height: 16px; flex: none; color: var(--gold-400); }
.tb-switch .tb-title { padding: 0; border: 0; }
.tb-title { display: flex; flex-direction: column; min-width: 0; }
.tb-title b { font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--fg-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { display: flex; align-items: center; gap: var(--s2); flex: none; }
/* logo variants: the dark-background file on the charcoal scheme, -on-light on light */
.on-light { display: none !important; }
[data-theme='day'] .on-dark, [data-scheme='light'] .on-dark { display: none !important; }
[data-theme='day'] .on-light, [data-scheme='light'] .on-light { display: block !important; }
.tb-lockup { height: var(--rs-logo-h); }
.tb-markonly { height: 36px; display: none; }
.topbar.is-guest .tb-brand .tb-title { padding-inline-start: var(--s3); }
.tb-liwan { height: 42px; }
.topbar.is-guest .tb-title { border: 0; gap: 4px; align-items: flex-start; }
.hero-mark { height: 72px; }
.cover-logo .rs-logo { height: clamp(40px, 7vw, 64px); margin: 0 auto var(--s3); }
.cover-liwan { height: 44px; }
.qc-logo { height: 40px; }
.avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--grad-gold); color: var(--rs-on-gold); font: 800 1rem/1 var(--font-display); }
/* the lockup on wide screens, the mark alone on phones (each in its scheme's variant) */
[data-theme='day'] .tb-markonly.on-light, [data-scheme='light'] .tb-markonly.on-light { display: none !important; }
@media (max-width: 700px) {
  .tb-lockup.on-dark, .tb-lockup.on-light, [data-theme='day'] .tb-lockup.on-light, [data-scheme='light'] .tb-lockup.on-light { display: none !important; }
  .tb-markonly.on-dark { display: block; }
  [data-theme='day'] .tb-markonly.on-dark, [data-scheme='light'] .tb-markonly.on-dark { display: none !important; }
  [data-theme='day'] .tb-markonly.on-light, [data-scheme='light'] .tb-markonly.on-light { display: block !important; }
  .tb-markonly { height: 30px; }
  .topbar.is-guest .tb-brand .tb-title { padding-inline-start: var(--s2); }
  .tb-liwan { height: 34px; }
  .topbar { padding: 0 var(--s3); gap: 6px; }
  .tb-clock { display: none; }
  .tb-who span:not(.tb-av) { display: none; }
  .tb-who { width: 44px; padding: 0; }
  .tb-title b { font-size: .95rem; }
  .tb-switch { padding: 0 var(--s2); flex: 0 1 auto; }
  .tb-switch .tb-sub { display: none; }
  .topbar:not(.is-guest) .tb-screens { display: none; }
}
@media (max-width: 380px) { .tb-sub { display: none; } .tb-liwan { height: 30px; } }
/* signed-in staff: an initial instead of the generic person icon */
.tb-av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--grad-gold); color: var(--rs-on-gold); font: 800 .78rem/1 var(--font-display); }
.tb-who.is-in { border-color: color-mix(in srgb, var(--gold-500) 45%, var(--hairline)); }

.page { flex: 1; padding: var(--s5) 0 var(--s12); }
.wrap { width: min(1440px, 100% - 2 * var(--s4)); margin-inline: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.page-head h2 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.page-tools { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* ── 4. demo banner, journey strip, coach-marks ─────────────────────── */
.demo-banner {
  display: flex; align-items: center; gap: var(--s3); min-height: 46px; padding: 0 var(--s4);
  font-size: .8rem; line-height: 1.45; color: var(--fg-soft);
  background: color-mix(in srgb, var(--gold-500) 8%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--gold-500) 24%, transparent);
}
.demo-banner .demo-tour-btn { min-height: 34px; border-color: color-mix(in srgb, var(--gold-500) 35%, var(--hairline)); background: var(--surface-3); }
.demo-txt { flex: 1; min-width: 0; }
.demo-txt b { color: var(--gold-400); margin-inline-end: 6px; }
.demo-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-400); }
.journey {
  position: relative; z-index: 55; display: flex; align-items: center; gap: var(--s3);
  padding: 8px var(--s4); background: var(--surface-3); border-bottom: 1px solid color-mix(in srgb, var(--gold-500) 40%, transparent);
  box-shadow: inset 3px 0 0 var(--gold-500);
}
[dir='rtl'] .journey { box-shadow: inset -3px 0 0 var(--gold-500); }
.journey .btn-gold { flex: none; }
.journey-step {
  flex: none; min-width: 42px; height: 30px; display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--grad-gold); color: var(--rs-on-gold); font-weight: 800; font-size: .8rem;
}
.journey-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .8rem; line-height: 1.4; }
.journey-txt b { font-size: .86rem; }
.journey-txt span { color: var(--fg-soft); }
/* phones: step + text on one row (full width), the next-step button on its own row */
@media (max-width: 700px) {
  .journey { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'step txt end' 'go go go';
    align-items: center; gap: 6px 10px; padding: 8px var(--s3) 10px; }
  .journey-step { grid-area: step; align-self: start; margin-top: 2px; }
  .journey-txt { grid-area: txt; }
  .journey [data-end] { grid-area: end; align-self: start; width: 40px; min-height: 40px; margin: -4px -6px 0 0; }
  .journey .btn-gold { grid-area: go; width: 100%; min-height: 44px; white-space: normal; line-height: 1.3; }
  .demo-banner { min-height: 44px; padding: 0 var(--s3); font-size: .76rem; gap: var(--s2); }
  .demo-banner .demo-txt span { display: none; }
  .demo-banner .demo-tour-btn { min-height: 44px; width: auto; padding: 0 var(--s3); border: 0; background: none; color: var(--gold-400); }
  .demo-banner .demo-tour-btn > span { display: inline !important; }
}
.demo-overlay { position: fixed; inset: 0; z-index: 9100; }
.demo-spot { position: fixed; border-radius: var(--r-md); pointer-events: none;
  box-shadow: 0 0 0 9999px color-mix(in srgb, var(--rs-char) 68%, transparent), 0 0 0 2px var(--gold-400); transition: all .2s var(--e-out); }
[data-theme='day'] .demo-spot, [data-scheme='light'] .demo-spot { box-shadow: 0 0 0 9999px color-mix(in srgb, var(--rs-char) 45%, transparent), 0 0 0 2px var(--gold-500); }
.demo-pop { position: fixed; z-index: 9101; width: min(340px, calc(100vw - 24px)); padding: var(--s4);
  background: var(--surface-3); border: 1px solid var(--hairline-2); border-radius: var(--r-lg); box-shadow: var(--sh-4); }
.demo-pop__eyebrow { font-size: .7rem; font-weight: 700; color: var(--gold-400); }
.demo-pop__title { font-family: var(--font-display); font-size: 1.05rem; margin: 4px 0 6px; }
.demo-pop__body { font-size: .86rem; line-height: 1.6; color: var(--fg-soft); }
.demo-pop__nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s4); }
.demo-pop__btns { display: flex; gap: 6px; }
.demo-skip { font-size: .8rem; color: var(--fg-mute); padding: 10px 6px; min-height: 44px; }
.demo-dots { display: flex; gap: 5px; }
.demo-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--hairline-2); }
.demo-dots i.on { background: var(--gold-400); width: 16px; border-radius: 3px; }

/* ── 5. tabs (segment) and chip rails ───────────────────────────────── */
.segment {
  display: inline-flex; gap: 2px; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-pill);
}
.segment::-webkit-scrollbar { display: none; }
.segment button {
  min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-pill); font-size: .84rem; font-weight: 600; color: var(--fg-mute); white-space: nowrap;
}
.segment button[aria-selected='true'] { background: var(--grad-gold); color: var(--rs-on-gold); }
.segment button:not([aria-selected='true']):hover { color: var(--fg); background: var(--rs-cream-a06); }
.segment button[disabled] { opacity: .45; cursor: not-allowed; }
.segment button svg { width: 16px; height: 16px; }
.segment button[aria-selected='true'] { box-shadow: none; }
.tabs-row { position: sticky; top: var(--tb-h); z-index: 50; background: var(--bg); padding-block: 10px; border-bottom: 1px solid var(--hairline); }
.tabs-row .segment { width: auto; max-width: 100%; justify-content: flex-start; background: var(--surface-3); box-shadow: var(--sh-1); }
@media (max-width: 700px) { .tabs-row { padding-block: 8px; } .tabs-row .segment { width: 100%; } }
.catrail { padding: var(--s2) var(--s4); gap: var(--s2); }
.catrail button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 var(--s4); flex: none;
  border-radius: var(--r-pill); font-size: .84rem; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--fg-soft);
}
.catrail button svg { width: 17px; height: 17px; }
.catrail button[aria-selected='true'] { background: var(--grad-gold); color: var(--rs-on-gold); border-color: transparent; box-shadow: none; }

/* ── 6. KPI tiles ───────────────────────────────────────────────────── */
.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); margin-bottom: var(--s5); }
.stat { padding: var(--s4); display: flex; flex-direction: column; gap: 4px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--hairline); min-width: 0; }
.stat .k { display: flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; color: var(--fg-mute); }
.stat .k svg { width: 15px; height: 15px; }
/* المبلغ لا يُقصّ («JOD 502.…» كان يظهر بالإنجليزية بين 1280 و1366): خط أصغر قليلاً على الشاشات المتوسطة بدل الحذف */
.stat .v { font-family: var(--font-num); font-size: clamp(1.05rem, 1.42vw, 1.6rem); font-weight: 700; line-height: 1.15; white-space: nowrap; }
.stat .v small { font-size: .55em; font-weight: 600; color: var(--fg-mute); }
.stat .d { font-size: .72rem; color: var(--fg-mute); }
.stat.is-gold .v { color: var(--gold-400); }
.stat.is-ok .v { color: var(--ok-400); } .stat.is-warn .v { color: var(--warn-400); } .stat.is-bad .v { color: var(--bad-400); }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .stat { padding: var(--s3); } .stat .v { font-size: 1.15rem; }
}
.delta { font-size: .72rem; font-weight: 700; }

/* ── 7. empty, loading, lists, tables ───────────────────────────────── */
.empty { padding: var(--s10) var(--s5); text-align: center; color: var(--fg-mute); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-bottom: var(--s2);
  background: var(--surface); border: 1px solid var(--hairline); color: var(--fg-faint); }
.empty .ic svg { width: 26px; height: 26px; }
.empty h3 { color: var(--fg-soft); }
.empty p { font-size: .86rem; max-width: 42ch; }
.empty .btn { margin-top: var(--s3); }
.lrow { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--hairline); min-height: 56px; }
.lrow:last-child { border-bottom: 0; }
.lrow .av { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface); font-weight: 700; }
.lrow .av svg { width: 18px; height: 18px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: start; font-weight: 600; font-size: .74rem; color: var(--fg-mute); padding: 10px var(--s3); border-bottom: 1px solid var(--hairline-2); white-space: nowrap; }
.tbl td { padding: 11px var(--s3); border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: end; }

/* ── 8. sheets, dialogs, toasts ─────────────────────────────────────── */
.scrim { background: color-mix(in srgb, var(--rs-char) 64%, transparent); animation: fade-in .16s ease-out both; }
.scrim-top, .scrim-top + .modal { z-index: 8500; }
.sheet { background: var(--bg); animation: sheet-up .24s var(--e-out) both; }
.sheet .scroll-y { overscroll-behavior: contain; }
.sheet-x { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; z-index: 3; background: var(--surface-2); }
.sheet-title { font-size: 1.25rem; padding-inline-end: 48px; }
.sheet-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4) calc(var(--s3) + var(--safe-b));
  background: var(--bg); border-top: 1px solid var(--hairline); }
@media (min-width: 720px) {
  .sheet { animation: modal-in .2s var(--e-out) both; }
  .sheet.is-wide { width: min(820px, calc(100vw - 40px)); }
}
.modal { background: var(--bg); animation: modal-in .18s var(--e-out) both; }
.modal-ic { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--surface); }
.modal-ic svg { width: 24px; height: 24px; }
.tone-gold { color: var(--gold-400); } .tone-ok { color: var(--ok-400); } .tone-bad { color: var(--bad-400); }
.tone-warn { color: var(--warn-400); } .tone-info { color: var(--info-400); }
/* toasts sit at the bottom (end corner on wide screens), above the guest/waiter bottom bars, so they never
   cover the topbar, the journey strip or a sheet's close button; while a sheet is open they move above it */
.toast-wrap { inset-block-start: auto; inset-block-end: calc(var(--toast-b, 16px) + var(--safe-b)); flex-direction: column-reverse; }
body[data-screen='customer'] { --toast-b: 140px; }
@media (max-width: 1023px) { body[data-screen='waiter'] { --toast-b: 140px; } }
:root:has(.sheet, .modal) .toast-wrap { inset-block-start: 8px; inset-block-end: auto; flex-direction: column; }
@media (min-width: 720px) { :root:has(.sheet, .modal) .toast-wrap { inset-block-start: auto; inset-block-end: 12px; flex-direction: column-reverse; } }
.toast { background: var(--surface-3); box-shadow: var(--sh-3); animation: toast-up .2s var(--e-out) both; padding: 10px 10px 10px var(--s4); }
@keyframes toast-up { from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.97); } }
.sheet { max-height: calc(100dvh - 84px); }
.modal { overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 720px) { .sheet, .modal { max-height: calc(100dvh - 168px); } }
.toast::after { content: none; }
.toast.out { animation: toast-out .18s ease-in forwards; }
.toast.is-action { cursor: pointer; }
.toast-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); }
.toast.tone-ok .toast-ic { color: var(--ok-400); } .toast.tone-bad .toast-ic { color: var(--bad-400); }
.toast.tone-warn .toast-ic { color: var(--warn-400); } .toast.tone-gold .toast-ic { color: var(--gold-400); } .toast.tone-info .toast-ic { color: var(--info-400); }
.toast-x { width: 36px; min-height: 36px; }
@media (max-width: 560px) { .toast-wrap { inset-inline: 8px; width: auto; } }

.screen-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
.screen-link { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s3); border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline); font-weight: 600; font-size: .9rem; }
.screen-link .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--gold-400); flex: none; }
.screen-link .ic svg { width: 18px; height: 18px; }
.screen-link.is-current { border-color: var(--gold-500); }
.pref-list { display: flex; flex-direction: column; border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.pref { display: flex; align-items: center; gap: var(--s3); min-height: 54px; padding: 0 var(--s4); text-align: start; border-bottom: 1px solid var(--hairline); }
.pref:last-child { border-bottom: 0; }
.pref svg { width: 18px; height: 18px; color: var(--fg-mute); }
.pref b { font-size: .84rem; color: var(--gold-400); }

/* ── 9. steppers, options, tickets, bills ───────────────────────────── */
.stepper {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--hairline);
}
.stepper button { border-radius: 50%; display: grid; place-items: center; color: var(--fg-soft); }
.stepper button:hover { background: var(--rs-cream-a10); color: var(--fg); }
.stepper button svg { width: 16px; height: 16px; }
.stepper .n { text-align: center; font-family: var(--font-num); font-weight: 700; }
.stepper button { width: 40px; height: 40px; }
.stepper.sm button { width: 36px; height: 36px; }
@media (pointer: coarse) { .stepper.sm button { width: 44px; height: 44px; } }
.stepper .n { min-width: 28px; }
.optgroup { border: 0; display: flex; flex-direction: column; gap: 8px; }
.optgroup legend { width: 100%; margin-bottom: 8px; font-size: .9rem; }
.opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px var(--s3); border-radius: var(--r-md);
  border: 1px solid var(--hairline); background: var(--surface); text-align: start; font-size: .9rem; }
.opt[aria-checked='true'] { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-500) 12%, var(--surface)); }
.opt .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--hairline-2); flex: none; display: grid; place-items: center; }
.opt[role='checkbox'] .tick { border-radius: 6px; }
.opt[aria-checked='true'] .tick { border-color: var(--gold-500); background: var(--gold-500); color: var(--rs-on-gold); }
.opt .tick svg { width: 12px; height: 12px; opacity: 0; }
.opt[aria-checked='true'] .tick svg { opacity: 1; }
.ticket { display: flex; flex-direction: column; }
.ticket-line { display: flex; gap: var(--s3); align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.ticket-line:last-child { border-bottom: 0; }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.line-opts { display: block; }
.line-note { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; min-height: 30px; padding: 2px 8px; border-radius: var(--r-pill);
  font-size: .72rem; color: var(--fg-mute); border: 1px dashed var(--hairline-2); max-width: 100%; }
.line-note svg { width: 13px; height: 13px; flex: none; }
.line-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-note.has-note { color: var(--warn-400); border-style: solid; border-color: color-mix(in srgb, var(--warn-400) 40%, transparent); }
.ticket-empty { padding: var(--s4) 0; }
.bill { font-family: var(--font-num); }
.bill .r { display: flex; justify-content: space-between; gap: var(--s3); padding: 4px 0; font-size: .88rem; }
.bill .r.total { border-top: 1px dashed var(--hairline-2); margin-top: 6px; padding-top: 10px; font-size: 1.08rem; font-weight: 800; }
.bill .r.total .v { color: var(--gold-400); }

/* ── 10. guest menu ─────────────────────────────────────────────────── */
.topbar.is-guest .mark-lg { border-radius: 50%; }
.g-hero { padding: var(--s5) var(--s4) var(--s4); display: flex; gap: var(--s4); align-items: center; }
.g-hero h1 { font-size: clamp(1.3rem, 4.4vw, 2rem); line-height: 1.25; }
.g-hero .mark { width: 72px; height: 72px; border-radius: 50%; }
.g-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.searchbox { position: relative; }
.searchbox > svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--fg-faint); pointer-events: none; }
.searchbox .field { padding-inline-start: 44px; }
.catrail-wrap { position: sticky; top: var(--tb-h); z-index: 40; background: var(--bg); border-bottom: 1px solid var(--hairline); }
.sec-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s5) var(--s4) var(--s3); }
.sec-head h2 { font-size: 1.15rem; }
.sec-head .line { flex: 1; height: 1px; background: var(--hairline); }
.feat { display: flex; gap: var(--s3); overflow-x: auto; padding: 2px var(--s4) var(--s3); scrollbar-width: none; scroll-snap-type: x proximity; }
.feat::-webkit-scrollbar { display: none; }
.feat > * { flex: none; width: 210px; scroll-snap-align: start; }
.feat > .mcard { width: 210px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 600px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .menu-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .menu-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.page-pad { padding-inline: var(--s4); }
.g-main { width: min(1440px, 100%); margin-inline: auto; }
.mcard { display: flex; flex-direction: column; text-align: start; width: 100%; padding: 0; overflow: hidden; color: inherit; font: inherit; }
.mcard .shot { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--media-bg); width: 100%; display: block; }
.mcard .shot img { width: 100%; height: 100%; object-fit: cover; }
.mcard .marks { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 2; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.mcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; width: 100%; }
.mcard .nm { font-size: .92rem; font-weight: 600; line-height: 1.35; display: block; }
.mcard .en { font-size: .7rem; color: var(--fg-faint); display: block; }
.mcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.mcard .price { font-family: var(--font-num); font-weight: 700; color: var(--gold-400); }
.mcard .add { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-gold); color: var(--rs-on-gold); flex: none; }
.mcard .add svg { width: 18px; height: 18px; }
.mcard.out { opacity: .55; }
.mcard.out .shot img { filter: grayscale(1); }
@media (max-width: 599px) { .mcard .nm { font-size: .84rem; } .mcard .body { padding: 8px 10px 10px; } }
.detail-shot { aspect-ratio: 16 / 9; overflow: hidden; position: relative; background: var(--media-bg); }
.detail-shot img { width: 100%; height: 100%; object-fit: cover; }
.cartbar { position: fixed; z-index: 70; inset-inline: var(--s3); inset-block-end: calc(72px + var(--safe-b)); max-width: 560px; margin-inline: auto;
  display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 8px 8px 8px var(--s4); border-radius: var(--r-pill);
  background: var(--grad-gold); color: var(--rs-on-gold); box-shadow: var(--sh-3); animation: none; text-align: start; }
.cartbar .count { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--rs-on-gold) 14%, transparent); font: 800 .9rem/1 var(--font-num); }
.tabbar { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 60; display: flex; gap: 2px; padding: 6px 8px calc(6px + var(--safe-b));
  background: var(--bg); border-top: 1px solid var(--hairline); }
.tabbar button { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--r-md); font-size: .7rem; font-weight: 600; color: var(--fg-mute); position: relative; }
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button[aria-selected='true'] { color: var(--gold-400); background: color-mix(in srgb, var(--gold-500) 12%, transparent); }
.tabbar .badge { position: absolute; inset-block-start: 3px; inset-inline-end: calc(50% - 22px); }
body[data-screen='customer'] .page, body[data-screen='waiter'] .page { padding-bottom: calc(150px + var(--safe-b)); }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.svc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: var(--s3) var(--s2);
  border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--surface); font-size: .78rem; font-weight: 600; text-align: center; }
.svc svg { width: 22px; height: 22px; color: var(--gold-400); }
.svc[data-sent='1'] { border-color: color-mix(in srgb, var(--ok-400) 50%, transparent); }
.svc[data-sent='1'] svg { color: var(--ok-400); }
.track { display: flex; align-items: flex-start; }
.track .node { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; width: 56px; text-align: center; }
.track .bulb { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--hairline); color: var(--fg-faint); }
.track .bulb svg { width: 16px; height: 16px; }
.track .node.on .bulb { background: var(--grad-gold); color: var(--rs-on-gold); border-color: transparent; box-shadow: none; animation: none; }
.track .node span { font-size: .66rem; color: var(--fg-mute); line-height: 1.2; }
.track .node.on span { color: var(--fg); }
.track .link { flex: 1; height: 2px; margin-top: 16px; background: var(--hairline-2); position: relative; }
.track .link.on { background: var(--gold-500); }
.track .link i { display: none; }
.g-foot { text-align: center; font-size: .74rem; color: var(--fg-mute); padding: var(--s6) var(--s4); }

/* ── 11. menu plates (items without a photo) and thumbs ─────────────── */
.plate { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 110% at 78% -6%, color-mix(in srgb, var(--plate) 34%, transparent), transparent 64%), linear-gradient(165deg, var(--plate-from), var(--plate-to)); }
.plate .plate-ring { position: absolute; top: 50%; left: 50%; width: 58%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--plate) 46%, transparent); }
.plate .plate-mono { position: relative; z-index: 1; font: 700 clamp(1.6rem, 24cqw, 3.2rem)/1 var(--font-display); color: color-mix(in srgb, var(--plate) 58%, var(--fg)); padding-block-end: .12em; }
.plate .plate-ic { position: absolute; z-index: 1; inset-block-end: 10%; inset-inline: 0; display: grid; place-items: center; }
.plate .plate-ic svg { width: 18%; min-width: 14px; max-width: 28px; height: auto; color: color-mix(in srgb, var(--plate) 74%, var(--fg)); opacity: .6; }
.shot, .detail-shot, .thumb { container-type: inline-size; }
[data-theme='day'] .plate { background: radial-gradient(120% 110% at 78% -6%, color-mix(in srgb, var(--plate) 22%, transparent), transparent 64%), linear-gradient(165deg, var(--plate-from), var(--plate-to)); }
[data-theme='day'] .plate .plate-mono { color: color-mix(in srgb, var(--plate) 82%, var(--fg)); }
.thumb { position: relative; display: block; flex: none; overflow: hidden; border-radius: 11px; background: var(--media-bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .plate .plate-ic { display: none; }
.thumb .plate .plate-mono { font-size: clamp(.9rem, 42cqw, 1.4rem); }

/* ── 12. kitchen display ────────────────────────────────────────────── */
body[data-screen='kds'] { font-size: 16px; }
.stationbar { position: sticky; top: var(--tb-h); z-index: 40; background: var(--bg); border-bottom: 1px solid var(--hairline); padding: 8px var(--s4); }
.stationbar .catrail { padding: 0; }
.metrics { display: grid; gap: var(--s2); padding: var(--s3) var(--s4) 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.metrics .stat { padding: 10px 14px; flex-direction: row; align-items: center; justify-content: space-between; }
.metrics .stat .v { font-size: 1.35rem; }
.kds-cols { display: grid; gap: var(--s4); padding: var(--s4); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.kds-grid { display: grid; gap: var(--s4); padding: var(--s4); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
@media (max-width: 1023px) { .kds-cols { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 768px) and (max-width: 1023px) { .kds-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kds-cols > [data-k='ready'] { grid-column: 1 / -1; } }
.colhead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: var(--s3); border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--hairline); }
.colhead svg { width: 18px; height: 18px; color: var(--gold-400); }
.kcard { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); border: 2px solid var(--hairline); box-shadow: none; }
.kcard .head { display: flex; align-items: center; gap: var(--s2); padding: 10px var(--s4); border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.kcard .code { font: 800 1.1rem/1 var(--font-num); }
.kcard .timer { font: 800 1.35rem/1 var(--font-num); margin-inline-start: auto; }
.kcard .lines { padding: var(--s2); display: flex; flex-direction: column; gap: 2px; }
.kcard .foot { padding: var(--s3); border-top: 1px solid var(--hairline); display: flex; gap: var(--s2); }
.kcard .foot .btn { min-height: 52px; font-size: 1rem; }
.kcard.is-new { border-color: color-mix(in srgb, var(--info-400) 60%, transparent); }
.kcard.late { border-color: color-mix(in srgb, var(--warn-400) 70%, transparent); }
.kcard.late .head { background: color-mix(in srgb, var(--warn-500) 12%, transparent); }
.kcard.over { border-color: var(--bad-400); }
.kcard.over .head { background: color-mix(in srgb, var(--bad-500) 16%, transparent); }
.kcard.is-ready { border-color: color-mix(in srgb, var(--ok-400) 60%, transparent); }
.kcard .note { padding: 8px var(--s4) 0; font-size: .9rem; color: var(--warn-400); display: flex; gap: 6px; align-items: flex-start; }
.kline { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 52px; padding: 8px var(--s3); border-radius: var(--r-sm); text-align: start; }
.kline:hover { background: var(--surface); }
.kline .q { min-width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); font: 800 1.05rem/1 var(--font-num); }
.kline .name { font-size: 1.06rem; font-weight: 600; line-height: 1.35; display: block; }
.kline .opts { font-size: .82rem; color: var(--fg-soft); display: block; }
.kline .lnote { font-size: .82rem; color: var(--warn-400); display: block; }
.kline .stn { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kline.done { opacity: .5; }
.kline.done .name { text-decoration: line-through; }
.kline.done .q { color: var(--ok-400); }
.kds-keys { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; padding: 0 var(--s4); font-size: .76rem; color: var(--fg-mute); }
@media (min-width: 1600px) {
  body[data-screen='kds'] { font-size: 18px; }
  .kcard .code { font-size: 1.3rem; } .kcard .timer { font-size: 1.6rem; }
  .kline .name { font-size: 1.22rem; } .kline .opts, .kline .lnote { font-size: .95rem; }
  .kline .q { min-width: 42px; height: 42px; font-size: 1.2rem; }
  .kds-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
}

/* ── 13. floor and waiter ───────────────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: var(--s5); align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
.zonehead { display: flex; align-items: center; gap: 10px; margin: var(--s5) 0 var(--s3); }
.zonehead:first-child { margin-top: 0; }
.zonehead .line { flex: 1; height: 1px; background: var(--hairline); }
.legend { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: .76rem; color: var(--fg-mute); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-end: 5px; vertical-align: -1px; }
.tmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--s3); }
@media (max-width: 430px) { .tmap { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); } }
.tcell { position: relative; min-height: 112px; border-radius: var(--r-lg); padding: var(--s3); display: flex; flex-direction: column; justify-content: space-between;
  gap: 6px; text-align: start; background: var(--surface-2); border: 1px solid var(--hairline); overflow: hidden; }
.tcell::before { content: ''; position: absolute; inset-block-start: 0; inset-inline: 0; height: 4px; background: var(--table-free); }
.tcell[data-st='seated']::before { background: var(--ok-500); }
.tcell[data-st='reserved']::before { background: var(--info-500); }
.tcell[data-st='dirty']::before { background: var(--warn-500); }
.tcell[data-st='seated'] { border-color: color-mix(in srgb, var(--ok-500) 40%, var(--hairline)); }
.tcell .no { font: 700 1.6rem/1 var(--font-display); }
.tcell .meta { font-size: .72rem; color: var(--fg-mute); display: block; }
.tcell .meta .nw { white-space: nowrap; }
.tcell .due { font: 700 .86rem/1.2 var(--font-num); color: var(--gold-400); }
.tcell .flags { display: flex; gap: 4px; }
.tcell .flag { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; }
.tcell .flag svg { width: 13px; height: 13px; }
.flag-call { background: color-mix(in srgb, var(--bad-500) 22%, transparent); color: var(--bad-400); }
.flag-ready { background: color-mix(in srgb, var(--ok-500) 22%, transparent); color: var(--ok-400); }
.flag-cook { background: color-mix(in srgb, var(--warn-500) 22%, transparent); color: var(--warn-400); }
.callcard { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--surface); }
.callcard.hot { border-color: color-mix(in srgb, var(--bad-400) 55%, transparent); }
.callcard.is-ready { border-color: color-mix(in srgb, var(--ok-400) 50%, transparent); }
.callcard .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--gold-400); }
.callcard.is-ready .ic { color: var(--ok-400); }
.callcard .ic svg { width: 19px; height: 19px; }
.callcard .btn { flex: none; }
@media (max-width: 430px) { .callcard { flex-wrap: wrap; } .callcard .btn { flex: 1 1 100%; } }

.w-compose { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s4); align-items: start; }
@media (max-width: 1023px) { .w-compose { grid-template-columns: minmax(0, 1fr); } }
.w-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
@media (max-width: 430px) { .w-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.w-ticket { position: sticky; top: 120px; }
@media (max-width: 1023px) { .w-ticket { position: static; } }
.positem { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 76px; padding: 10px 12px; text-align: start;
  border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--surface-2); }
.positem:hover { border-color: color-mix(in srgb, var(--gold-500) 50%, var(--hairline)); }
.positem:active { transform: scale(.98); }
.positem b { font-size: .86rem; font-weight: 600; line-height: 1.3; }
.positem .pi-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .78rem; }
.positem .pi-foot svg { width: 14px; height: 14px; color: var(--fg-mute); }
.positem[disabled] { opacity: .4; }
.send-bar { position: fixed; z-index: 65; inset-inline: var(--s3); inset-block-end: calc(72px + var(--safe-b)); max-width: 560px; margin-inline: auto; }
@media (min-width: 1024px) { .send-bar { display: none; } }

/* ── 14. cashier ────────────────────────────────────────────────────── */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s5); align-items: start; }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr); } }
.pos-side { position: sticky; top: 130px; }
@media (max-width: 1100px) { .pos-side { position: static; } }
.paykeys { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.paykey { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 72px; justify-content: center; padding: 10px 8px;
  border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--surface); font-size: .84rem; font-weight: 600; }
.paykey svg { width: 22px; height: 22px; color: var(--gold-400); }
.paykey[aria-pressed='true'] { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-500) 12%, var(--surface)); }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-chips button { min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--surface); font-size: .8rem; }
.reason-chips button[aria-pressed='true'] { border-color: var(--gold-500); color: var(--gold-400); }
@media (pointer: coarse) { .reason-chips button { min-height: 44px; } }
.pick-line { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 8px var(--s3); width: 100%; text-align: start;
  border-radius: var(--r-md); border: 1px solid var(--hairline); background: var(--surface); }
.pick-line[aria-pressed='true'] { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-500) 10%, var(--surface)); }
.pick-line .tick { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--hairline-2); display: grid; place-items: center; flex: none; }
.pick-line[aria-pressed='true'] .tick { background: var(--gold-500); border-color: var(--gold-500); color: var(--rs-on-gold); }
.pick-line .tick svg { width: 13px; height: 13px; opacity: 0; }
.pick-line[aria-pressed='true'] .tick svg { opacity: 1; }
.order-card .lines { border: 1px dashed var(--hairline-2); border-radius: var(--r-md); padding: 8px 12px; }
.order-card .lines .between { padding: 2px 0; }
.shortcuts { display: flex; gap: var(--s4); flex-wrap: wrap; align-items: center; font-size: .76rem; color: var(--fg-mute); }
.shortcuts span { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 700px) { .shortcuts { display: none; } }

/* ── 15. owner / admin ──────────────────────────────────────────────── */
.g-main-side { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s4); }
@media (max-width: 1023px) { .g-main-side { grid-template-columns: minmax(0, 1fr); } }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.bars { display: flex; align-items: flex-end; gap: 4px; }
.bars .bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bars .bar i { width: 100%; border-radius: 5px 5px 2px 2px; background: var(--bar-fill); opacity: .9; }
.bars .bar-v, .bars .bar-l { font-size: .62rem; color: var(--fg-mute); white-space: nowrap; }
@media (max-width: 560px) { .bars .bar-v { display: none; } }
.rail { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.rail > i { display: block; height: 100%; border-radius: 99px; background: var(--gold-500); box-shadow: none; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: var(--s3); align-items: center; padding: 8px var(--s3); border-bottom: 1px solid var(--hairline); }
.mrow:last-child { border-bottom: 0; }
@media (max-width: 480px) { .mrow { grid-template-columns: minmax(0, 1fr) auto auto; } .mrow .feat-col { display: none; } }
.switch { width: 48px; height: 28px; border-radius: 99px; background: var(--hairline-2); position: relative; flex: none; cursor: pointer; display: inline-block; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--rs-cream); transition: inset-inline-start var(--t-fast); }
.switch[aria-checked='true'] { background: var(--gold-500); }
.switch[aria-checked='true']::after { inset-inline-start: 23px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 44px; }

/* ── 16. launcher ───────────────────────────────────────────────────── */
.cover { padding: var(--s8) var(--s4) var(--s6); text-align: center; }
.cover .mark { width: 68px; height: 68px; border-radius: 20px; margin: 0 auto var(--s4); }
.cover h1 { font-size: clamp(1.7rem, 5vw, 2.8rem); line-height: 1.15; margin-bottom: var(--s2); }
.cover .lead { max-width: 60ch; margin: 0 auto; color: var(--fg-soft); line-height: 1.7; }
.cover .eyebrow { justify-content: center; margin-bottom: var(--s3); }
.roles { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.role-card { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); min-height: 104px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--hairline); text-align: start; }
.role-card:hover { border-color: color-mix(in srgb, var(--gold-500) 50%, var(--hairline)); }
.role-card .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--gold-400); }
.role-card .ic svg { width: 24px; height: 24px; }
.role-card h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-card p { font-size: .84rem; color: var(--fg-mute); line-height: 1.5; margin-top: 2px; }
.role-card .go { margin-inline-start: auto; align-self: center; color: var(--gold-400); flex: none; }
/* «جرّبه على أكثر من جهاز» / الديمو السحابي (launcher.js cloudBox) */
.cloud-box h2 { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.cloud-box h2 svg { color: var(--gold-500); }
.cloud-box.is-on { border-color: color-mix(in srgb, var(--gold-500) 45%, transparent); }
.cloud-box .qrsheet { margin-top: var(--s2); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cloud-box .qrcard .no { font-size: 1.2rem; line-height: 1.35; }
@media (max-width: 560px) {
  .cloud-box .qrsheet { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .cloud-box .qrcard { padding: 12px 8px; }
  .cloud-box .qrcard .qr { width: 100%; height: auto; aspect-ratio: 1; }
  .cloud-box .qrcard .qr svg { width: 100%; height: 100%; }
}
.path { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s2); counter-reset: step; }
.path li { position: relative; padding: var(--s3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--hairline); font-size: .82rem; }
.path li b { display: block; font-size: .9rem; margin-bottom: 2px; }
.path li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  margin-bottom: 6px; background: var(--grad-gold); color: var(--rs-on-gold); font: 800 .8rem/1 var(--font-num); }
@media (max-width: 900px) { .path { grid-template-columns: minmax(0, 1fr); } .path li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 2px 10px; } .path li::before { grid-row: span 2; margin: 0; } }
.qrsheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.qrcard { background: var(--rs-print-paper); color: var(--rs-char); border-radius: 16px; padding: 18px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1px solid var(--rs-cream-2); break-inside: avoid; }
.qrcard .qc-brand { display: flex; align-items: center; gap: 8px; font: 700 .9rem/1.2 var(--font-display); }
.qrcard .qc-brand .mark { width: 28px; height: 28px; }
.qrcard .qr { width: 180px; height: 180px; }
.qrcard .no { font: 800 1.9rem/1 var(--font-display); }
.qrcard .hint { font-size: .74rem; color: var(--ink-500); }
.qrcard .qc-note { font-size: .62rem; color: var(--ink-500); border: 1px dashed var(--rs-cream-2); border-radius: 99px; padding: 2px 8px; }
.netbox { font-family: var(--font-num); direction: ltr; text-align: left; overflow-wrap: anywhere; }
.signature { text-decoration: underline; text-underline-offset: 3px; }

/* ── 17. PIN pad ────────────────────────────────────────────────────── */
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 264px; margin-inline: auto; }
.pinpad button { height: 58px; border-radius: var(--r-md); font: 700 1.3rem/1 var(--font-num); background: var(--surface); border: 1px solid var(--hairline); display: grid; place-items: center; }
.pinpad button svg { width: 20px; height: 20px; }
.pinpad button:active { transform: scale(.95); }
.pindots { display: flex; gap: 10px; justify-content: center; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; background: var(--hairline-2); }
.pindots i.on { background: var(--gold-500); box-shadow: none; transform: none; }

/* ── 18. utilities ──────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--hairline); margin-block: var(--s4); }
.dashed { border: 1px dashed var(--hairline-2); border-radius: var(--r-md); }
.nowrap { white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad { padding: var(--s4); } .pad-lg { padding: var(--s6); }
.mt2 { margin-top: var(--s2); } .mt4 { margin-top: var(--s4); } .mt6 { margin-top: var(--s6); }
.mb2 { margin-bottom: var(--s2); } .mb4 { margin-bottom: var(--s4); } .mb6 { margin-bottom: var(--s6); }
.txt-ok { color: var(--ok-400); } .txt-warn { color: var(--warn-400); } .txt-bad { color: var(--bad-400); }
.txt-info { color: var(--info-400); } .txt-gold { color: var(--gold-400); }
.flash { animation: flash .7s var(--e-out); }

@media print {
  .topbar, .demo-banner, .journey, .tabbar, .cartbar, .toast-wrap, .noprint { display: none !important; }
  body > .shell > *:not(#printzone) { display: none !important; }
  #printzone { display: block !important; }
  .qrsheet { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
.ic-box { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--gold-400); }
.ic-box svg { width: 18px; height: 18px; }
.kcard .kbd { display: none; }
@media (min-width: 1024px) and (pointer: fine) { .kcard .kbd { display: inline-grid; } }
@media (max-width: 1023px), (pointer: coarse) { .kds-keys { display: none; } }
.tabbar.is-adaptive { z-index: 61; }
@media (min-width: 1024px) {
  .tabbar.is-adaptive { position: sticky; top: var(--tb-h); inset-block-end: auto; justify-content: center; border-top: 0; border-bottom: 1px solid var(--hairline); padding: 6px var(--s4); }
  .tabbar.is-adaptive button { flex: 0 0 auto; flex-direction: row; gap: 8px; min-height: 44px; padding: 0 var(--s5); font-size: .86rem; }
  .tabbar.is-adaptive .badge { position: static; }
  body[data-screen='waiter'] .page { padding-bottom: var(--s12); }
}
@media (max-width: 1100px) { .split > aside[data-actions] { order: -1; } }
/* phones: topbar text buttons become icon-only so the screen title keeps its room */
@media (max-width: 700px) {
  .tb-actions .btn-sm { width: 44px; padding: 0; }
  .tb-actions .btn-sm > span:not(.tb-av) { display: none; }
  .tb-fs { display: none; }
  .tb-brand { flex: 1 1 auto; }
}

/* ── 19. phone layouts and polish (2026-11-30 review) ───────────────── */
/* guest topbar: the brand block shrinks instead of sliding under the buttons (long English names) */
.topbar.is-guest .tb-brand { flex: 1 1 auto; min-width: 0; }
.topbar.is-guest .tb-title { min-width: 0; overflow: hidden; }
.topbar.is-guest .rs-demo-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 20px; }
@media (max-width: 420px) { .topbar.is-guest .tb-actions { gap: 2px; } .topbar.is-guest .tb-actions .btn-icon, .topbar.is-guest .btn-lang { width: 42px; min-width: 42px; } }

/* filter row: search grows, the select keeps a sensible width; both full width on phones */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filters .f-search { flex: 1 1 260px; max-width: 420px; }
.filters .f-select { flex: 0 1 240px; }
@media (max-width: 600px) { .filters .f-search, .filters .f-select { flex: 1 1 100%; max-width: none; } }

/* phone tables: each row becomes a compact card (labels from data-l) */
.ph-only { display: none; }
@media (max-width: 600px) {
  .ph-only { display: inline; }
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody { display: block; width: 100%; }
  .tbl-cards tr { display: grid; gap: 6px 12px; padding: 12px var(--s4); border-bottom: 1px solid var(--hairline); align-items: center; }
  .tbl-cards tr:last-child { border-bottom: 0; }
  .tbl-cards td { display: block; padding: 0; border: 0; min-width: 0; text-align: start; }
  .tbl-cards td.num { text-align: start; }
  .tbl-cards td[data-l]::before { content: attr(data-l); display: block; font: 600 .66rem/1.3 var(--font-body); color: var(--fg-mute); margin-bottom: 2px; }
  .tbl-cards td[colspan] { grid-column: 1 / -1; }
  .tbl-live tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'code status' 'items items' 'where total'; }
  .tbl-live .c-code { grid-area: code; font-size: 1rem; }
  .tbl-live .c-status { grid-area: status; justify-self: end; }
  .tbl-live .c-items { grid-area: items; font-size: .82rem; line-height: 1.5; }
  .tbl-live .c-where { grid-area: where; font-size: .8rem; }
  .tbl-live .c-total { grid-area: total; justify-self: end; font-weight: 700; }
  .tbl-live .c-since { display: none; }
  .tbl-stock tr { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; grid-template-areas: 'name name name btn' 'qty min cost status'; }
  .tbl-stock .c-name { grid-area: name; }
  .tbl-stock .c-btn { grid-area: btn; justify-self: end; }
  .tbl-stock .c-qty { grid-area: qty; }
  .tbl-stock .c-min { grid-area: min; }
  .tbl-stock .c-cost { grid-area: cost; }
  .tbl-stock .c-status { grid-area: status; justify-self: end; align-self: end; }
}

/* floor map cell: seats right under the number, guests and time never split mid-phrase */
.tcell .tc-seats { margin-block: -4px auto; }

/* journey path on the start screen: finished steps get a check */
.path li.is-done::before { content: '✓'; }
.path li.is-done { border-color: color-mix(in srgb, var(--ok-400) 35%, var(--hairline)); }

/* payment sheet head: one figure when nothing is paid yet */
.pay-head .r.total.is-only { border-top: 0; margin-top: 0; padding-top: 0; }
.pay-head p { margin-top: 4px; }

/* PIN pad: the demo's sample PINs, one tap fills and signs in */
.pin-hint { text-align: start; }
.pin-hint p { display: flex; align-items: center; gap: 6px; justify-content: center; }
.pin-demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 6px; margin-top: 8px; }
.pin-demo button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md);
  border: 1px dashed color-mix(in srgb, var(--gold-500) 45%, var(--hairline)); background: var(--surface); font-size: .82rem; text-align: start; }
.pin-demo button b { color: var(--gold-400); letter-spacing: .12em; }
.pin-demo button:hover { border-style: solid; }
@media (max-width: 560px), (max-height: 760px) {
  .pin-modal .modal-ic { display: none; }
  .pin-modal .pad-lg { padding: var(--s4); }
  .pin-modal .pinpad button { height: 52px; }
}

/* the boot watchdog (each page's inline script) when a module could not load */
.boot-fail .btn { margin-top: var(--s4); }

/* day scheme: the premium cream-and-gold finish */
[data-theme='day'] .glass, [data-theme='day'] .card, [data-theme='day'] .stat, [data-theme='day'] .role-card,
[data-theme='day'] .kcard, [data-theme='day'] .tcell, [data-theme='day'] .colhead { box-shadow: var(--sh-1); }
[data-theme='day'] .stat.is-gold { background: linear-gradient(160deg, color-mix(in srgb, var(--rs-gold) 9%, var(--surface-2)), var(--surface-2)); border-color: color-mix(in srgb, var(--gold-500) 26%, var(--hairline)); }
[data-theme='day'] .role-card .ic, [data-theme='day'] .screen-link .ic, [data-theme='day'] .ic-box, [data-theme='day'] .callcard .ic {
  background: color-mix(in srgb, var(--rs-gold) 12%, var(--surface-3)); }
[data-theme='day'] .demo-banner { background: linear-gradient(90deg, color-mix(in srgb, var(--rs-gold) 10%, var(--bg)), color-mix(in srgb, var(--rs-gold) 4%, var(--bg))); }
[data-theme='day'] .segment button[aria-selected='true'], [data-theme='day'] .catrail button[aria-selected='true'] { box-shadow: 0 1px 2px var(--hairline-2); }
[data-theme='day'] .tabbar { box-shadow: var(--sh-up); }
[data-theme='day'] .kline:hover { background: color-mix(in srgb, var(--rs-gold) 6%, var(--surface)); }
.delta { white-space: nowrap; }
select.field { padding-inline-end: 40px; }
[dir='ltr'] select.field { background-position: right 13px top 50%, right 18px top 50%; }
@media (max-width: 600px) {
  .filters .f-select { flex: 1 1 0; }
  .filters .f-count { flex: none; }
  .tbl-cmp tr { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: 'k k d' 'a b c'; }
  .tbl-cmp .c-k { grid-area: k; } .tbl-cmp .c-d { grid-area: d; justify-self: end; }
  .tbl-cmp .c-a { grid-area: a; } .tbl-cmp .c-b { grid-area: b; } .tbl-cmp .c-c { grid-area: c; }
}
.t-short { display: none; }
@media (max-width: 700px) { .tb-title .t-long { display: none; } .tb-title .t-short { display: inline; } }
/* guest topbar on small phones: a slimmer wordmark so «Table 7» and the demo tag keep their room */
@media (max-width: 420px) {
  .topbar.is-guest .tb-liwan { height: 28px; }
  [lang='en'] .topbar.is-guest .tb-liwan { height: 24px; }
  .topbar.is-guest .tb-sub { display: flex; }
  .topbar.is-guest .rs-demo-tag { padding: 0 7px; }
}
.metrics .stat .k { min-width: 0; }
.metrics .stat .v { flex: none; overflow: visible; }
.tcell .due { white-space: nowrap; }
@media (max-width: 430px) { .tcell .due { font-size: .8rem; } }
/* kitchen KPIs on phones: three compact tiles per row (two rows instead of three) */
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: var(--s2) var(--s3) 0; }
  .metrics .stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; }
  .metrics .stat .k { font-size: .7rem; }
  .metrics .stat .v { font-size: 1.15rem; }
  .cover { padding: var(--s5) var(--s3) var(--s4); }
  .g-hero { padding: var(--s4) var(--s4) var(--s3); }
  .g-hero .hero-mark { height: 56px; }
}
/* the wide English «LIWAN» wordmark gives way to the arch mark on the smallest phones */
.topbar.is-guest .tb-liwan-mark { display: none !important; height: 34px; }
@media (max-width: 380px) {
  [lang='en'] .topbar.is-guest .tb-liwan { display: none !important; }
  [lang='en'] .topbar.is-guest .tb-liwan-mark.on-dark { display: block !important; }
  [lang='en'][data-theme='day'] .topbar.is-guest .tb-liwan-mark.on-dark { display: none !important; }
  [lang='en'][data-theme='day'] .topbar.is-guest .tb-liwan-mark.on-light { display: block !important; }
}
/* badges over menu photos sit on a solid pill so they read on any photo, in both schemes */
.mcard .marks .chip { background: var(--surface-3); box-shadow: var(--sh-1); }
/* icon() SVGs sit inline in running text (theme.css makes svg a block by default) */
svg[style*='vertical-align'] { display: inline-block; }
