/* SeatSide shared styles. --brand and --accent are overridden per venue (branding).
   Theme: follows the device by default; html[data-theme=light|dark] forces one (js/theme.js). */
:root {
  --brand: #0f766e;
  --accent: #f59e0b;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #111418;
  --muted: #5b6472;
  --border: #e3e6ec;
  --danger: #d92d20;
  --ok: #138a43;
  --warn: #b54708;
  --brand-ink: var(--brand);                                   /* brand color used as text */
  --brand-soft: color-mix(in srgb, var(--brand) 10%, var(--surface));
  --ring: color-mix(in srgb, var(--brand) 28%, transparent);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -8px rgba(16, 24, 40, .10);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .06), 0 24px 48px -12px rgba(16, 24, 40, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d11; --surface: #15181e; --surface-2: #1d2128; --text: #eceff4; --muted: #9aa3b2;
    --border: #272c35; --danger: #f97066; --ok: #47cd89; --warn: #fdb022;
    --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
    --brand-soft: color-mix(in srgb, var(--brand) 18%, var(--surface));
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d11; --surface: #15181e; --surface-2: #1d2128; --text: #eceff4; --muted: #9aa3b2;
  --border: #272c35; --danger: #f97066; --ok: #47cd89; --warn: #fdb022;
  --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
  --brand-soft: color-mix(in srgb, var(--brand) 18%, var(--surface));
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01"; text-rendering: optimizeLegibility;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; font-weight: 800; } h2 { font-size: 1.2rem; font-weight: 750; } h3 { font-size: 1rem; font-weight: 700; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
p { margin: .25rem 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: .85rem; }
.grid { display: grid; gap: .85rem; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
::selection { background: var(--ring); }

/* Top bar (all portals): translucent brand glass */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1rem; padding-top: calc(.65rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--brand) 88%, transparent); color: #fff;
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.topbar .title { font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; }
.topbar .sub { font-size: .78rem; opacity: .85; }
.topbar .spacer { flex: 1; }
.topbar .btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .18); border-radius: 999px; box-shadow: none; }
.topbar .btn:hover { background: rgba(255, 255, 255, .24); filter: none; }
.theme-btn { width: 34px; min-width: 34px; padding: 0 !important; font-size: 1rem; line-height: 1; }
.logo-img { display: block; max-width: 140px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.logo-emoji { line-height: 1; }

main { max-width: 1100px; margin: 0 auto; padding: 1.1rem 1rem 1.5rem; }
main.narrow { max-width: 640px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
button.card { transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s; }
button.card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); box-shadow: var(--shadow-lg); transform: translateY(-1px); }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px;
  padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; letter-spacing: -.005em;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s var(--ease), filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand));
  border-color: transparent; color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent);
}
.btn.primary:hover, .btn.accent:hover, .btn.danger:hover { filter: brightness(1.06); }
.btn.accent { background: var(--accent); border-color: transparent; color: #111; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-ink); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.small { min-height: 34px; padding: .3rem .75rem; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.btn.round { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; font-size: 1.2rem; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .7rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .65rem .8rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 18px; height: 18px; margin: 0 .5rem 0 0; accent-color: var(--brand); }
input[type=color] { padding: 3px; height: 42px; }
label.check { display: flex; align-items: center; color: var(--text); font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.btn:focus-visible, .tabs button:focus-visible, .seg button:focus-visible, .tip-row button:focus-visible, button.card:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

.error { color: var(--danger); font-weight: 600; min-height: 1em; }
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .01em; background: var(--surface-2); color: var(--muted); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge.accent { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--text); }
.badge.danger { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }

/* Segmented control / tabs */
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: .6rem; border-radius: 10px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .15rem .1rem .35rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .45rem .95rem; font: inherit; font-size: .92rem; font-weight: 650; cursor: pointer; color: var(--muted); transition: background-color .15s, color .15s, border-color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--text); border-color: var(--text); color: var(--bg); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table-wrap { overflow-x: auto; }

/* Login */
.login-wrap { min-height: 85vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(60rem 30rem at 50% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent); }
.login-card { width: 100%; max-width: 400px; padding: 1.5rem; box-shadow: var(--shadow-lg); }
.banner-notice { font-size: .75rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: .75rem; margin-top: 1rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px) scale(.98); opacity: 0; pointer-events: none; z-index: 100;
  background: color-mix(in srgb, #111418 92%, transparent); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .92rem;
  max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); transition: opacity .2s var(--ease), transform .25s var(--ease);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.error { background: var(--danger); }
.toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: .9rem; padding-right: .45rem; }
.toast-action { border: 0; border-radius: 999px; padding: .35rem .85rem; font: inherit; font-weight: 750; cursor: pointer; background: rgba(255, 255, 255, .18); color: #fff; }
.toast-action:hover { background: rgba(255, 255, 255, .3); }
.toast.ok { background: #138a43; }

/* Modal / sheet */
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } }
.sheet-bg { position: fixed; inset: 0; background: rgba(8, 10, 14, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade-in .2s var(--ease); }
.sheet { background: var(--surface); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 1.4rem 1.1rem calc(1.5rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheet-up .28s var(--ease); position: relative; }
.sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--border); }
@media (min-width: 720px) { .sheet-bg { align-items: center; } .sheet { border-radius: 24px; } .sheet::before { display: none; } }

/* ---------- Guest app ---------- */
.hero {
  color: #fff; padding: .35rem 1rem 1.6rem; border-radius: 0 0 28px 28px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 55%),
    linear-gradient(160deg, var(--brand), color-mix(in srgb, var(--brand) 62%, #000));
}
.hero h1 { font-size: 1.75rem; }
.hero .seat-pill { display: inline-flex; gap: .4rem; align-items: center; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22) !important; border-radius: 999px; padding: .35rem .85rem; font-weight: 600; font-size: .9rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.stand-bar { display: flex; gap: .5rem; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .95rem; margin: -1.1rem 0 .85rem; position: relative; box-shadow: var(--shadow-lg); }
.wait { font-weight: 750; color: var(--ok); }
.wait.busy { color: var(--warn); }
.menu-cat { scroll-margin-top: 120px; }
.menu-cat h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.item { display: flex; gap: .85rem; align-items: center; padding: .75rem 0; }
.item + .item { border-top: 1px solid var(--border); }
.item .emoji { font-size: 1.9rem; width: 56px; height: 56px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 16px; flex: none; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 680; }
.item .desc { color: var(--muted); font-size: .85rem; }
.item .price { font-weight: 750; font-variant-numeric: tabular-nums; }
.item.soldout { opacity: .45; }
.qty { display: flex; align-items: center; gap: .4rem; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.qty .btn.round { width: 32px; height: 32px; min-height: 32px; font-size: 1.1rem; border: 0; box-shadow: var(--shadow); }
.qty span { min-width: 1.3rem; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 1rem 1rem calc(.85rem + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 40%); z-index: 30; }
.cart-bar .btn { max-width: 640px; margin: 0 auto; display: flex; width: 100%; justify-content: space-between; border-radius: 999px; padding: .5rem 1.4rem; box-shadow: var(--shadow-lg); }
.totals div { display: flex; justify-content: space-between; padding: .2rem 0; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 800; font-size: 1.15rem; border-top: 1px dashed var(--border); padding-top: .5rem; margin-top: .35rem; }
.tip-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: .45rem; }
.tip-row button { padding: .6rem 0; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; color: var(--text); transition: background-color .15s, border-color .15s, transform .1s; }
.tip-row button:active { transform: scale(.96); }
.tip-row button.on { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 16px -8px var(--brand); }
.steps { display: flex; justify-content: space-between; margin: 1.1rem 0; position: relative; }
.steps::before { content: ''; position: absolute; top: 13px; left: 14px; right: 14px; height: 3px; border-radius: 3px; background: var(--border); }
.step { position: relative; text-align: center; flex: 1; font-size: .75rem; color: var(--muted); }
.step .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); margin: 0 auto .35rem; display: grid; place-items: center; color: #fff; font-weight: 700; transition: background-color .3s, border-color .3s; }
.step.done .dot { background: var(--brand); border-color: var(--brand); }
.step.now .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 28%, transparent); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 10%, transparent); } }
.step.now { color: var(--text); font-weight: 700; }
.pickup-code { font-size: 3.2rem; font-weight: 900; letter-spacing: .12em; text-align: center; color: var(--brand-ink); font-variant-numeric: tabular-nums; }

/* ---------- Staff screens ---------- */
.board { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(4, 1fr); } }
.col { background: color-mix(in srgb, var(--surface-2) 60%, transparent); border-radius: var(--radius); padding: .75rem; }
.col h2 { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ticket { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--brand); border-radius: 14px; padding: .8rem; margin-bottom: .65rem; box-shadow: var(--shadow); animation: sheet-up .25s var(--ease); }
.ticket.delivery { border-left-color: var(--accent); }
.ticket.late { box-shadow: 0 0 0 2px var(--danger), var(--shadow); }
.ticket .code { font-size: 1.45rem; font-weight: 900; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.ticket ul { margin: .4rem 0; padding-left: 1.1rem; }
.ticket li { margin: .1rem 0; }
.ticket .note { color: var(--warn); font-style: italic; font-size: .85rem; }

/* Admin */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .95rem 1.1rem; box-shadow: var(--shadow); }
.kpi .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: .5rem; }
.bars .b { flex: 1; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 75%, #fff), var(--brand)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bars-labels { display: flex; gap: 4px; font-size: .65rem; color: var(--muted); }
.bars-labels span { flex: 1; text-align: center; overflow: hidden; }
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.qr-card { border: 1px dashed #c9ced6; border-radius: 14px; padding: .6rem; text-align: center; background: #fff; color: #111; break-inside: avoid; }
.qr-card img { width: 120px; height: 120px; }
.qr-card .lbl { font-weight: 700; font-size: .85rem; }
.preview-phone { border: 8px solid #1b1e24; border-radius: 34px; overflow: hidden; max-width: 300px; background: var(--bg); box-shadow: var(--shadow-lg); }

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

@media print {
  .no-print, .topbar, .tabs { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .qr-sheet { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Platform portal & landing page ---------- */
.platform-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
.facts { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)) !important; gap: .5rem; }
.facts .fact-v { font-weight: 700; }
.csv-sample { background: var(--surface-2); border-radius: 8px; padding: .5rem .7rem; overflow-x: auto; margin: 0; }
.otp-box { border: 2px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-radius: 12px; padding: .8rem; display: grid; gap: .5rem; }
.otp-value { font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; word-break: break-all; user-select: all; }
.nowrap { white-space: nowrap; }
.audit-detail { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; max-width: 420px; }
.home-link { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--text); background: var(--surface); transition: border-color .15s, transform .15s, box-shadow .15s; }
.home-link:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.home-link > span:first-child { display: flex; flex-direction: column; }
.home-venue h3 { margin: 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.home-venue .stack > * + * { margin-top: .4rem; }

/* ---------- Venue admin portal (admin.html / admin.js) ---------- */
.topbar.admin-top { flex-wrap: wrap; row-gap: .4rem; }
.admin-top .top-names { min-width: 0; }
.admin-top .top-links { display: flex; flex-wrap: wrap; gap: .3rem; }
@media (max-width: 719px) { .admin-top .spacer { display: none; } .admin-top .top-links { width: 100%; } }
main > .tabs { margin-bottom: .75rem; }
.hint { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: .25rem; }
p.hint { margin: -.3rem 0 .6rem 1.6rem; }
.check-field label.check { margin-bottom: .4rem; }
.stack-form > * + * { margin-top: .25rem; }
.row.nowrap { flex-wrap: nowrap; }
.row.align-end { align-items: flex-end; }
.row.align-start { align-items: flex-start; }
.w-sort { width: 90px; }
.inline-field { margin: 0; }
.inline-field input { min-width: 150px; }
.grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bars-labels.sparse span { overflow: visible; white-space: nowrap; text-align: left; }
.menu-group h3 { margin-top: 1rem; }
.item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.item-actions label.check { margin: 0; }
@media (max-width: 519px) {
  .menu-group .item { flex-wrap: wrap; }
  .menu-group .item-actions { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
}
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.csv-sample { background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; font-size: .8rem; overflow-x: auto; margin: 0; }
.qr-thumb { width: 120px; height: 120px; background: #fff; border-radius: 8px; flex: none; }
.qr-card .qr-venue { color: #444; }
.logo-now { min-height: 40px; display: flex; align-items: center; }
.preview-phone .pv-hero { padding-top: 1rem; }
.preview-phone .pv-hero .logo-emoji { font-size: 1.8rem; }
.preview-phone .pv-body { padding: .5rem 1rem 1rem; }
.preview-phone .pv-body > * + * { margin-top: .6rem; }
@media print { .sheet-bg, .toast { display: none !important; } .qr-card { border-color: #bbb; } }

/* ---------- Guest app: modern mobile layout (guest.js) ---------- */
.ico { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.ico svg { width: 100%; height: 100%; }

.guest-top {
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); gap: .4rem; padding-inline: .75rem;
}
.guest-top .venue-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; background: var(--brand-soft); overflow: hidden; }
.guest-top .venue-mark .logo-img { max-width: 36px; padding: 0; background: transparent; }
.guest-top .top-names { flex: 1; min-width: 0; }
.guest-top .title { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guest-top .where {
  display: flex; align-items: center; gap: .25rem; max-width: 100%; margin-top: 1px; padding: 0; border: 0; background: none;
  font: inherit; font-size: .8rem; font-weight: 600; color: var(--brand-ink); cursor: pointer;
}
.guest-top .where span:not(.ico) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guest-top .where .ico:last-child { width: .9em; height: .9em; opacity: .8; }
.guest-top .btn, .icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; flex: none;
  border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); box-shadow: none; cursor: pointer; font-size: 1.05rem;
  transition: background-color .15s, transform .1s var(--ease);
}
.guest-top .btn:hover, .icon-btn:hover { background: color-mix(in srgb, var(--text) 10%, var(--surface-2)); filter: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.icon-btn .ico { width: 19px; height: 19px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 750; font-size: .9rem; }

.guest-main { padding-top: .9rem; }
.guest-menu { padding-bottom: 120px; }
.notice { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border)); border-radius: 16px; padding: .8rem 1rem; font-weight: 600; margin-bottom: .75rem; }

/* Welcome */
.welcome-hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 26px; padding: 1.4rem 1.3rem 1.5rem;
  background:
    radial-gradient(110% 120% at 100% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--brand) 92%, #fff), color-mix(in srgb, var(--brand) 70%, #000));
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--brand) 80%, transparent);
}
.welcome-hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.welcome-logo { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: rgba(255, 255, 255, .18); margin-bottom: .9rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.welcome-logo .logo-img { max-width: 52px; }
.welcome-hero h1 { font-size: 1.65rem; margin: 0 0 .3rem; }
.welcome-hero p { margin: 0; opacity: .92; }
.how-grid { display: grid; gap: .6rem; }
@media (min-width: 560px) { .how-grid { grid-template-columns: 1fr 1fr; } }
.how { display: flex; gap: .85rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: .9rem 1rem; }
.how > .ico { width: 42px; height: 42px; padding: 10px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-ink); }
.how strong { display: block; font-size: .95rem; }
.how p { margin: .1rem 0 0; font-size: .84rem; color: var(--muted); }
.or-line { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.guest-main form.card { border-radius: 22px; padding: 1.2rem; }
.guest-main form.card h2 { font-size: 1.15rem; }
.pickup-link {
  display: flex; align-items: center; gap: .85rem; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--border)); border-radius: 18px; padding: .9rem 1rem;
  transition: border-color .15s, background-color .15s;
}
.pickup-link:hover { background: var(--brand-soft); }
.pickup-link > .ico:first-child { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); }
.pickup-link > .ico:last-child { color: var(--brand-ink); }
.pickup-link strong { display: block; }
.pickup-link .grow span { font-size: .85rem; color: var(--muted); }

/* Menu */
.menu-hello { margin: 0 0 .7rem; color: var(--muted); font-size: .95rem; }
.stand-card {
  display: flex; align-items: center; gap: .8rem; color: #fff; border-radius: 22px; padding: .95rem 1rem;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 55%),
    linear-gradient(145deg, color-mix(in srgb, var(--brand) 92%, #fff), color-mix(in srgb, var(--brand) 72%, #000));
  box-shadow: 0 14px 32px -16px color-mix(in srgb, var(--brand) 85%, transparent);
}
.stand-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, .18); }
.stand-ico .ico { width: 22px; height: 22px; }
.stand-text { flex: 1; min-width: 0; }
.stand-text .eyebrow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.stand-text strong { display: block; font-size: 1.05rem; line-height: 1.25; }
.stand-text .loc { font-size: .8rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand-side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; flex: none; }
.wait-chip { display: inline-flex; align-items: center; gap: .3rem; background: #fff; color: var(--ok); border-radius: 999px; padding: .25rem .6rem; font-size: .8rem; font-weight: 750; }
:root[data-theme="dark"] .wait-chip { background: rgba(0, 0, 0, .35); color: #86efac; }
.wait-chip.busy { color: var(--warn); }
.wait-chip .ico { width: 14px; height: 14px; }
.change-btn { display: inline-flex; align-items: center; gap: .2rem; border: 0; background: rgba(255, 255, 255, .2); color: #fff; font: inherit; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .25rem .75rem; cursor: pointer; }
.change-btn:hover { background: rgba(255, 255, 255, .3); }
.track-banner {
  display: flex; align-items: center; gap: .7rem; width: 100%; margin-top: .75rem; padding: .8rem 1rem; cursor: pointer; text-align: left;
  font: inherit; font-weight: 700; color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-radius: 16px;
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); animation: pulse 1.8s ease-in-out infinite; }
.cat-nav {
  position: sticky; top: var(--top-h, 64px); z-index: 15; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none;
  margin: .9rem -1rem 0; padding: .6rem 1rem; background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav button {
  white-space: nowrap; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: .45rem .95rem; font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer;
}
.cat-nav button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-nav button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.menu-cat { scroll-margin-top: calc(var(--top-h, 64px) + 60px); }
.menu-cat .cat-title { display: flex; align-items: baseline; gap: .5rem; margin: 1.3rem 0 .7rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); text-transform: none; }
.menu-cat .cat-title span { font-size: .8rem; font-weight: 650; color: var(--muted); }
.item-list { display: grid; gap: .65rem; }
.menu-item {
  display: flex; gap: .9rem; align-items: stretch; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: .85rem .85rem .85rem 1rem; transition: border-color .2s, box-shadow .2s;
}
.menu-item.in-cart { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: 0 0 0 3px var(--brand-soft); }
.menu-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-item .name { font-weight: 700; font-size: 1rem; line-height: 1.3; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.menu-item .desc { color: var(--muted); font-size: .85rem; line-height: 1.4; margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-item .price { margin-top: auto; padding-top: .45rem; font-weight: 750; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.menu-item.soldout .thumb, .menu-item.soldout .name, .menu-item.soldout .desc { opacity: .45; }
.thumb {
  position: relative; flex: none; width: 92px; height: 92px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 8px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 8%, var(--surface)), color-mix(in srgb, var(--accent) 16%, var(--surface)));
}
.thumb .emoji { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .12)); }
.add-btn {
  position: absolute; right: -6px; bottom: -8px; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface);
  background: var(--brand); color: #fff; font: inherit; font-size: 1.35rem; font-weight: 600; line-height: 1; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--brand) 80%, transparent);
  transition: transform .12s var(--ease), filter .15s;
}
.add-btn:hover { filter: brightness(1.08); }
.add-btn:active { transform: scale(.9); }
.stepper {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: flex; align-items: center; gap: .15rem;
  background: var(--brand); color: #fff; border-radius: 999px; padding: 3px; border: 3px solid var(--surface);
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--brand) 80%, transparent);
}
.stepper button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .2); color: #fff; font: inherit; font-size: 1.1rem; font-weight: 700; line-height: 1; cursor: pointer; }
.stepper button:active { transform: scale(.9); }
.stepper span { min-width: 1.4rem; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.add-btn:focus-visible, .stepper button:focus-visible, .cart-pill:focus-visible, .pickup-link:focus-visible, .track-banner:focus-visible, .change-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

/* Floating cart */
@keyframes cart-in { from { transform: translateY(30px); opacity: 0; } }
.cart-pill {
  display: flex; align-items: center; gap: .8rem; width: 100%; max-width: 640px; margin: 0 auto; min-height: 58px; padding: .5rem 1.2rem .5rem .55rem;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; color: #fff; background: var(--text);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .45);
}
.cart-pill.enter { animation: cart-in .3s var(--ease); }
:root[data-theme="dark"] .cart-pill { background: var(--brand); }
.cart-count { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .4rem; border-radius: 999px; background: var(--brand); font-weight: 800; }
:root[data-theme="dark"] .cart-count { background: rgba(255, 255, 255, .2); }
.cart-label { flex: 1; text-align: left; font-weight: 700; font-size: 1.02rem; }
.cart-total { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Sheets, order page */
.sheet-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer; }
.sheet-close .ico { width: 18px; height: 18px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.success-banner { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-radius: 18px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #000)); }
.success-banner .ico { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.guest-main .card { border-radius: 22px; }
.guest-main .pickup-code { font-size: 3.4rem; letter-spacing: .14em; }

/* Restaurant / stand chooser */
.stand-card.tappable { width: 100%; text-align: left; font: inherit; border: 0; cursor: pointer; transition: transform .12s var(--ease), filter .15s; }
.stand-card.tappable:active { transform: scale(.985); }
.stand-card.tappable:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.stand-list { display: grid; gap: .6rem; margin-top: .6rem; }
.stand-opt {
  display: flex; align-items: center; gap: .85rem; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: .8rem .9rem; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.stand-opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.stand-opt.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.stand-opt:disabled { opacity: .5; cursor: not-allowed; }
.stand-opt:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.so-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); }
.so-ico .ico { width: 22px; height: 22px; }
.so-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.so-text strong { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: 1rem; }
.so-loc { color: var(--muted); font-size: .82rem; }
.so-note { color: var(--muted); font-size: .78rem; font-weight: 650; }
.so-note.ok { color: var(--ok); }
.so-side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; flex: none; }
.stand-opt .wait-chip { background: var(--surface-2); }
:root[data-theme="dark"] .stand-opt .wait-chip { background: var(--surface-2); }
.so-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; }
.so-check .ico { width: 14px; height: 14px; }

.change-btn .ico { width: 12px; height: 12px; }

/* Live demo notice (manager portal) */
.demo-banner { padding: .55rem 1rem; text-align: center; font-size: .88rem; color: var(--text); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* Food photos */
.thumb .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.photo-thumb { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 16px; background: var(--surface-2); }
.photo-field { display: flex; gap: 1rem; align-items: center; margin: .25rem 0 .9rem; padding: .8rem; border: 1px dashed var(--border); border-radius: 16px; background: var(--surface-2); }
.photo-field strong { font-size: .9rem; }
.photo-preview { display: grid; place-items: center; width: 84px; height: 84px; flex: none; overflow: hidden; border-radius: 16px; background: var(--brand-soft); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .emoji { font-size: 2.4rem; line-height: 1; }

/* Restaurant list (first screen after QR / seat / pickup) */
.resto-head { margin-bottom: 1rem; }
.resto-head h1 { font-size: 1.55rem; margin: .2rem 0 .35rem; }
.resto-head p { margin: 0; color: var(--muted); font-size: .95rem; }
.resto-list { display: grid; gap: .8rem; }
.resto {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 1rem;
  box-shadow: var(--shadow); transition: transform .12s var(--ease), border-color .15s, box-shadow .15s;
}
.resto:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow-lg); }
.resto:active:not(:disabled) { transform: scale(.985); }
.resto:disabled { opacity: .55; cursor: not-allowed; }
.resto:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.resto-top { display: flex; align-items: center; gap: .85rem; }
.resto-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.resto-name strong { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: 1.1rem; letter-spacing: -.01em; }
.resto-go { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); flex: none; }
.resto-go .ico { width: 16px; height: 16px; }
.resto-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .75rem; }
.resto-meta .wait-chip { background: var(--surface-2); }
.resto-preview { display: flex; align-items: center; gap: .4rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; font-weight: 650; }
.resto-preview .emoji { display: grid; place-items: center; width: 34px; height: 34px; font-size: 1.3rem; line-height: 1; border-radius: 10px; background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 8%, var(--surface)), color-mix(in srgb, var(--accent) 16%, var(--surface))); }
.resto-preview .photo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.resto-preview > span:last-child { margin-left: auto; }

/* Cart grouped by restaurant */
.cart-group { margin-top: .9rem; }
.cart-group-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-size: .92rem; }
.cart-group-head .ico { width: 18px; height: 18px; }
.cart-group-head span:last-child { margin-left: auto; font-weight: 750; font-variant-numeric: tabular-nums; }

.back-link { display: inline-flex; align-items: center; gap: .35rem; margin: 0 0 .7rem -.2rem; padding: .35rem .7rem .35rem .5rem; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--brand-ink); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.back-link:hover { background: var(--brand-soft); }
.back-link:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.back-link .ico { width: 16px; height: 16px; }

.topbar.has-note { flex-wrap: wrap; row-gap: .35rem; }
.topbar .top-note { flex: 0 0 100%; margin: 0 -1rem -.65rem; padding: .35rem 1rem; text-align: center; font-size: .8rem; background: rgba(0, 0, 0, .18); }
