/* ==========================================================================
   FRISCO — BASE + COMPONENT LIBRARY
   Every rule reads from tokens.css. No raw colour values below this line.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-sunken);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" 1;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--accent-text); text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1,h2,h3,h4 { margin: 0; line-height: var(--lh-snug); font-weight: 700; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- Type primitives ---------------------------------------------- */
.t-hero {
  font-family: var(--font-display);
  font-size: var(--t-hero);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 800;
  text-wrap: balance;
}
.t-display {
  font-family: var(--font-display);
  font-size: var(--t-display);
  line-height: 1.05;
  letter-spacing: var(--ls-tight);
  font-weight: 800;
  text-wrap: balance;
}
.t-h1 { font-family: var(--font-display); font-size: var(--t-h1); letter-spacing: -.02em; font-weight: 800; }
.t-h2 { font-family: var(--font-display); font-size: var(--t-h2); letter-spacing: -.015em; font-weight: 700; }
.t-h3 { font-size: var(--t-h3); font-weight: 700; letter-spacing: -.01em; }
.t-body { font-size: var(--t-body); }
.t-sm { font-size: var(--t-sm); }
.t-xs { font-size: var(--t-xs); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.t-label {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.money {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.code { font-family: var(--font-mono); letter-spacing: .04em; }

/* ---------- App shell ----------------------------------------------------- */
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg-sunken);
}

/* The demo control strip — honest framing, not part of the product chrome */
.demobar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  background: var(--surface-ink);
  color: var(--text-on-ink);
  position: sticky; top: 0; z-index: var(--z-nav);
  flex-wrap: wrap;
}
.demobar .brandmark { display: flex; align-items: center; gap: 7px; margin-right: auto; }
.demobar .bm-text {
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: -.03em; font-size: 1.05rem; color: var(--text-on-ink);
}
.demobar .bm-tag {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; opacity: .62; padding-left: 6px;
  border-left: 1px solid var(--line-ink); margin-left: 2px;
}
.roleswitch { display: flex; gap: 2px; background: rgba(255,255,255,.09); padding: 3px; border-radius: var(--r-chip); }
.roleswitch button {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-chip);
  color: var(--text-on-ink); opacity: .66; white-space: nowrap;
  transition: background var(--d-fast), opacity var(--d-fast);
}
.roleswitch button[aria-pressed="true"] { background: var(--accent); color: var(--text-on-rose); opacity: 1; }
.iconbtn-dark {
  width: 30px; height: 30px; border-radius: var(--r-chip);
  display: grid; place-items: center; background: rgba(255,255,255,.09); color: var(--text-on-ink);
}

/* The stage: phone canvas centred, campus grid behind it on desktop */
.stage {
  display: grid; place-items: start center;
  padding: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
}
.device {
  width: 100%; max-width: var(--app-max);
  background: var(--bg);
  min-height: calc(100dvh - 46px);
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
}
@media (min-width: 900px) {
  .stage { padding: var(--s-6) 0 var(--s-8); }
  .device {
    border-radius: 30px;
    box-shadow: var(--shadow-3);
    border: 1px solid var(--line);
    min-height: min(880px, calc(100dvh - 110px));
    max-height: min(880px, calc(100dvh - 110px));
  }
}

.screen {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: calc(var(--nav-h) + var(--s-6));
  scrollbar-width: thin;
}
.screen.no-nav { padding-bottom: var(--s-6); }
.pad { padding-inline: var(--s-4); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.g1{gap:var(--s-1)}.g2{gap:var(--s-2)}.g3{gap:var(--s-3)}.g4{gap:var(--s-4)}
.g5{gap:var(--s-5)}.g6{gap:var(--s-6)}.g7{gap:var(--s-7)}
.mt-auto { margin-top: auto; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Top bar (in-product) ------------------------------------------ */
.topbar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-3);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.topbar.bordered { border-bottom: 1px solid var(--line); }
.backbtn {
  width: 38px; height: 38px; border-radius: var(--r-chip); flex: none;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); color: var(--text);
  transition: transform var(--d-fast) var(--e-out);
}
.backbtn:active { transform: scale(.92); }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font-weight: 700; font-size: var(--t-body);
  padding: 13px var(--s-5); border-radius: var(--r-btn);
  transition: transform var(--d-fast) var(--e-out), background var(--d-fast), box-shadow var(--d-fast), opacity var(--d-fast);
  text-align: center; line-height: 1.2; letter-spacing: -.01em;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--text-on-rose); box-shadow: var(--shadow-2); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ink { background: var(--surface-ink); color: var(--text-on-ink); box-shadow: var(--shadow-2); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--line-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-sunken); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px var(--s-6); font-size: 1.02rem; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: var(--t-sm); border-radius: 10px; }
.btn-pill { border-radius: var(--r-chip); }

/* ---------- Inputs -------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.input {
  width: 100%; padding: 14px var(--s-4);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-input); color: var(--text);
  transition: border-color var(--d-fast), box-shadow var(--d-fast);
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.otp { display: flex; gap: var(--s-2); }
.otp input {
  width: 46px; height: 54px; text-align: center;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-input);
  color: var(--text);
}
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.switch {
  width: 46px; height: 27px; border-radius: var(--r-chip); flex: none;
  background: var(--line-strong); position: relative;
  transition: background var(--d-base) var(--e-out);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--d-base) var(--e-spring);
}
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }

/* ---------- Cards --------------------------------------------------------- */
.card {
  background: var(--surface); border-radius: var(--r-card);
  border: 1px solid var(--line);
}
.card-pad { padding: var(--s-4); }
.card-raise { box-shadow: var(--shadow-2); border-color: transparent; }
.tile {
  background: var(--surface); border-radius: var(--r-tile);
  border: 1px solid var(--line); padding: var(--s-3) var(--s-4);
}
.sunken { background: var(--bg-sunken); border-radius: var(--r-tile); }

/* Ticket edge — used only for the order receipt, where it means something */
.ticket { position: relative; }
.ticket::before, .ticket::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); top: var(--notch, 50%); margin-top: -10px;
}
.ticket::before { left: -11px; }
.ticket::after { right: -11px; }
.dashline { border: 0; border-top: 2px dashed var(--line-strong); margin: 0; }

/* ---------- Badges, chips, status ---------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: .09em; text-transform: uppercase; font-weight: 500;
  padding: 4px 9px; border-radius: var(--r-chip); white-space: nowrap;
}
.badge-open   { background: var(--ok-bg); color: var(--ok); }
.badge-closed { background: var(--bg-sunken); color: var(--text-faint); }
.badge-warn   { background: var(--warn-bg); color: var(--warn); }
.badge-rose   { background: var(--accent-soft); color: var(--accent-text); }
.badge-ink    { background: var(--surface-ink); color: var(--text-on-ink); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { animation: pulse 2.2s var(--e-in-out) infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.32} }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-chip);
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--t-sm); font-weight: 600; white-space: nowrap;
  transition: all var(--d-fast) var(--e-out);
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--surface-ink); color: var(--text-on-ink); border-color: transparent; }
.chip-soft { background: var(--accent-faint); border-color: var(--accent-soft); color: var(--accent-text); }
.chiprow { display: flex; gap: var(--s-2); overflow-x: auto; padding-inline: var(--s-4); scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chiprow > * { flex: none; }

/* The Indian veg / non-veg mark — a real convention, not decoration */
.vmark {
  width: 13px; height: 13px; flex: none; border-radius: 3px;
  border: 1.5px solid var(--veg-500); display: grid; place-items: center;
}
.vmark::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--veg-500); }
.vmark.nonveg { border-color: var(--nonveg-500); }
.vmark.nonveg::after { background: var(--nonveg-500); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* Sticker — rotated badge, used sparingly on poster surfaces */
.sticker {
  display: inline-block; font-family: var(--font-mono); font-size: var(--t-label);
  letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
  padding: 6px 12px; border-radius: var(--r-chip);
  background: var(--coral-400); color: var(--ink-900);
  transform: rotate(-3deg); box-shadow: var(--shadow-1);
}

/* ---------- Poster surfaces ----------------------------------------------- */
.poster {
  position: relative; overflow: hidden;
  background: var(--surface-blush);
  border-radius: var(--r-sheet);
  padding: var(--s-6) var(--s-5);
}
.poster-grid::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 16px 16px; pointer-events: none;
}
.poster > * { position: relative; }
.poster-arc {
  position: absolute; border-radius: 50%;
  background: var(--accent-soft); pointer-events: none;
}

/* ---------- Avatars ------------------------------------------------------- */
.avatar {
  width: 42px; height: 42px; border-radius: var(--r-chip); flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: .95rem;
  background: var(--accent-soft); color: var(--accent-text);
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .78rem; }

/* Cafeteria glyph — each outlet gets its own mark, so cards aren't identical */
.cafmark {
  width: 52px; height: 52px; border-radius: 15px; flex: none;
  display: grid; place-items: center; color: var(--text-on-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  letter-spacing: -.04em;
}

/* ---------- Cafeteria card ------------------------------------------------ */
.cafcard {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-4);
  transition: transform var(--d-base) var(--e-out), box-shadow var(--d-base), border-color var(--d-base);
  position: relative; overflow: hidden;
}
.cafcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: transparent; }
.cafcard:active { transform: scale(.99); }
.cafcard.closed { opacity: .68; }
.cafcard-hero {
  height: 88px; margin: calc(var(--s-4) * -1) calc(var(--s-4) * -1) var(--s-3);
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: var(--s-3);
}
.cafcard-hero .wm {
  position: absolute; right: -6px; bottom: -18px;
  font-family: var(--font-display); font-weight: 800; font-size: 4rem;
  letter-spacing: -.05em; opacity: .16; color: var(--ink-900); line-height: 1;
}
.addcaf {
  width: 100%; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4); border-radius: var(--r-card);
  border: 1.5px dashed var(--line-strong); background: transparent;
  text-align: left; transition: border-color var(--d-fast), background var(--d-fast);
}
.addcaf:hover { border-color: var(--accent); background: var(--accent-faint); }

/* ---------- Menu item row ------------------------------------------------- */
.item {
  display: flex; gap: var(--s-3); padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line); align-items: flex-start;
}
.item:last-child { border-bottom: 0; }
.item-thumb {
  width: 74px; height: 74px; border-radius: var(--r-tile); flex: none;
  display: grid; place-items: center; font-size: 1.9rem;
  background: var(--bg-sunken); position: relative; overflow: hidden;
}
.item.unavailable .item-thumb, .item.unavailable .item-main { opacity: .45; filter: grayscale(1); }
.item-add {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  padding: 5px 14px; border-radius: var(--r-chip);
  background: var(--surface); border: 1.5px solid var(--accent);
  color: var(--accent-text); font-size: var(--t-xs); font-weight: 800;
  box-shadow: var(--shadow-1); white-space: nowrap;
  transition: transform var(--d-fast) var(--e-spring);
}
.item-add:active { transform: translateX(-50%) scale(.9); }
.item-thumbwrap { position: relative; flex: none; padding-bottom: 6px; }
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--accent); border-radius: var(--r-chip); }
.qty button { width: 26px; height: 26px; color: var(--text-on-rose); font-weight: 800; display: grid; place-items: center; }
.qty span { color: var(--text-on-rose); font-weight: 800; font-size: var(--t-sm); min-width: 14px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Location picker ----------------------------------------------- */
.locgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.loccard {
  display: flex; flex-direction: column; gap: var(--s-1);
  padding: var(--s-4); border-radius: var(--r-tile); text-align: left;
  background: var(--surface); border: 1.5px solid var(--line);
  transition: all var(--d-fast) var(--e-out);
}
.loccard:hover { border-color: var(--accent); }
/* A campus that is not open yet. Rendered as a plain element rather than a
   button, so there is nothing to focus, press or activate; this only has to
   make that visible. No hover, no pointer, no selected state. */
.loccard.is-disabled {
  opacity: .55; cursor: default; pointer-events: none;
  background: var(--surface-2, var(--surface)); border-style: dashed;
}
.loccard.is-disabled:hover { border-color: var(--line); }
.loccard[aria-pressed="true"] { background: var(--surface-ink); border-color: transparent; color: var(--text-on-ink); }
.loccard[aria-pressed="true"] .muted { color: var(--text-on-ink); opacity: .66; }
.loccard .glyph { font-size: 1.5rem; line-height: 1; }
.campusnote {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-tile);
  background: var(--accent-faint); border: 1px dashed var(--accent-soft);
}

/* ---------- Bottom nav ---------------------------------------------------- */
.bottomnav {
  position: absolute; bottom: 0; left: 0; right: 0; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); z-index: var(--z-nav);
  padding-bottom: env(safe-area-inset-bottom);
}
.navbtn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-faint); padding: 6px 12px; flex: 1;
  transition: color var(--d-fast);
}
.navbtn span { font-size: 10px; font-weight: 700; letter-spacing: .01em; }
.navbtn[aria-current="page"] { color: var(--accent-text); }
.navbtn svg { width: 21px; height: 21px; }
.nav-ai {
  width: 52px; height: 52px; border-radius: 17px; margin-top: -22px;
  background: var(--surface-ink); color: var(--text-on-ink);
  display: grid; place-items: center; box-shadow: var(--shadow-3);
  border: 3px solid var(--surface);
  transition: transform var(--d-base) var(--e-spring);
}
.nav-ai:active { transform: scale(.9); }
.nav-ai[aria-current="page"] { background: var(--accent); color: var(--text-on-rose); }

/* ---------- Order timeline ------------------------------------------------ */
.timeline { display: flex; flex-direction: column; }
.tl-step { display: grid; grid-template-columns: 26px 1fr; gap: var(--s-3); }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-node {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; color: var(--text-faint);
  transition: all var(--d-base) var(--e-out);
}
.tl-line { width: 2px; flex: 1; background: var(--line-strong); min-height: 24px; }
.tl-step.done .tl-node { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.tl-step.done .tl-line { background: var(--ok); }
.tl-step.active .tl-node { border-color: var(--accent); background: var(--accent); color: var(--text-on-rose); box-shadow: 0 0 0 5px var(--accent-ring); }
.tl-step.active .tl-title { color: var(--accent-text); }
.tl-body { padding-bottom: var(--s-5); }
.tl-title { font-weight: 700; font-size: var(--t-body); }
.tl-step.pending .tl-title { color: var(--text-faint); }

/* ---------- AI agent ------------------------------------------------------ */
.ai-mark {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  background: var(--surface-ink); color: var(--text-on-ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: .82rem;
  letter-spacing: -.05em;
}
.bubble-user {
  align-self: flex-end; max-width: 82%;
  background: var(--surface-ink); color: var(--text-on-ink);
  padding: 11px var(--s-4); border-radius: 18px 18px 5px 18px;
  font-size: var(--t-body); box-shadow: var(--shadow-1);
}
.bubble-ai {
  align-self: flex-start; max-width: 88%;
  color: var(--text); font-size: var(--t-body);
  padding: 2px 0;
}
.msg-in { animation: msgin var(--d-slow) var(--e-out) both; }
@keyframes msgin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.thinking { display: inline-flex; gap: 4px; align-items: center; padding: 6px 0; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: bob 1.1s var(--e-in-out) infinite; }
.thinking i:nth-child(2){animation-delay:.15s} .thinking i:nth-child(3){animation-delay:.3s}
@keyframes bob { 0%,100%{transform:translateY(0);opacity:.4} 50%{transform:translateY(-4px);opacity:1} }

.composer {
  position: sticky; bottom: 0;
  padding: var(--s-3) var(--s-4) var(--s-4);
  background: linear-gradient(to top, var(--bg) 72%, transparent);
}
.composer-inner {
  display: flex; align-items: flex-end; gap: var(--s-2);
  background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: 20px; padding: 6px 6px 6px var(--s-4);
  box-shadow: var(--shadow-2);
}
.composer-inner:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.composer textarea {
  flex: 1; border: 0; background: none; resize: none; outline: none;
  padding: 9px 0; max-height: 90px; font-size: var(--t-body);
}
.composer textarea::placeholder { color: var(--text-faint); }
.sendbtn {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  background: var(--accent); color: var(--text-on-rose);
  display: grid; place-items: center;
  transition: transform var(--d-fast) var(--e-spring), opacity var(--d-fast);
}
.sendbtn:active { transform: scale(.9); }
.sendbtn:disabled { opacity: .35; }

/* ---------- Sheets, modals, toasts ---------------------------------------- */
.scrim {
  position: absolute; inset: 0; background: rgba(26,20,22,.5);
  z-index: var(--z-sheet); animation: fade var(--d-base) var(--e-out) both;
  backdrop-filter: blur(2px);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
  background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--shadow-sheet); max-height: 88%;
  display: flex; flex-direction: column;
  animation: sheetup var(--d-base) var(--e-out) both;
}
@keyframes sheetup { from { transform: translateY(100%) } to { transform: none } }
.sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: var(--s-3) auto var(--s-1); flex: none; }
.sheet-body { overflow-y: auto; padding: var(--s-4); }
.sheet-foot { padding: var(--s-4); border-top: 1px solid var(--line); background: var(--surface); }

.toast {
  position: absolute; left: 50%; bottom: calc(var(--nav-h) + 14px);
  transform: translateX(-50%); z-index: var(--z-toast);
  background: var(--surface-ink); color: var(--text-on-ink);
  padding: 11px var(--s-5); border-radius: var(--r-chip);
  box-shadow: var(--shadow-3); font-size: var(--t-sm); font-weight: 600;
  display: flex; align-items: center; gap: var(--s-2); white-space: nowrap;
  animation: toastin var(--d-base) var(--e-spring) both;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* ---------- Sticky action bar --------------------------------------------- */
.actionbar {
  position: sticky; bottom: 0; z-index: 30;
  padding: var(--s-3) var(--s-4) var(--s-4);
  background: linear-gradient(to top, var(--bg) 68%, transparent);
}
.cartbar {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--surface-ink); color: var(--text-on-ink);
  border-radius: 16px; padding: 11px 12px 11px var(--s-4);
  box-shadow: var(--shadow-3);
  animation: msgin var(--d-base) var(--e-out) both;
}

/* ---------- Empty states -------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  padding: var(--s-8) var(--s-5); text-align: center;
}
.empty-art {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--surface-blush); display: grid; place-items: center;
  font-size: 2.4rem; margin-bottom: var(--s-1);
}

/* ---------- Partner surfaces (deliberately a different world) ------------- */
.partner-hero {
  background: var(--surface-ink); color: var(--text-on-ink);
  border-radius: 0 0 var(--r-sheet) var(--r-sheet);
  padding: var(--s-5) var(--s-4) var(--s-6);
  position: relative; overflow: hidden;
}
.gobtn {
  width: 172px; height: 172px; border-radius: 50%; margin: 0 auto;
  display: grid; place-items: center; gap: 2px;
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em;
  background: var(--accent); color: var(--text-on-rose);
  box-shadow: 0 0 0 10px var(--accent-ring);
  transition: transform var(--d-base) var(--e-spring), background var(--d-base), box-shadow var(--d-base);
}
.gobtn:active { transform: scale(.95); }
.gobtn.online { background: var(--ok); color: var(--surface); box-shadow: 0 0 0 10px var(--ok-bg); }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); }
.statgrid > div { padding: var(--s-3) var(--s-2); text-align: center; }
.statgrid > div + div { border-left: 1px solid var(--line-ink); }
.statval { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.countdown { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.countdown i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 1s linear; }

.codebox {
  display: flex; gap: var(--s-2); justify-content: center;
}
.codebox b {
  width: 44px; height: 54px; border-radius: var(--r-tile);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500;
  background: var(--surface-blush); color: var(--accent-text);
  border: 1px dashed var(--accent-soft);
}

/* ---------- Staff console (dense, high-contrast, one-handed) -------------- */
.staff { background: var(--bg-sunken); }
.stafftabs { display: flex; gap: var(--s-1); padding: var(--s-3) var(--s-4); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.stafftab {
  flex: 1; padding: 9px 4px; border-radius: 10px; text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500; background: var(--bg-sunken);
}
.stafftab b { display: block; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -.02em; }
.stafftab[aria-pressed="true"] { background: var(--surface-ink); color: var(--text-on-ink); }
.kot {
  background: var(--surface); border-radius: var(--r-tile);
  border-left: 5px solid var(--line-strong); box-shadow: var(--shadow-1);
  padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3);
}
.kot.new { border-left-color: var(--accent); }
.kot.prep { border-left-color: var(--warn); }
.kot.ready { border-left-color: var(--ok); }
.kot-line { display: flex; gap: var(--s-3); align-items: baseline; font-size: 1.02rem; }
.kot-line b { font-family: var(--font-display); font-size: 1.15rem; min-width: 28px; }

/* ---------- Admin --------------------------------------------------------- */
.adminrow {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.adminrow:first-of-type { border-radius: var(--r-tile) var(--r-tile) 0 0; }
.adminrow:last-of-type { border-bottom: 0; border-radius: 0 0 var(--r-tile) var(--r-tile); }
.kpi { padding: var(--s-4); border-radius: var(--r-tile); background: var(--surface); border: 1px solid var(--line); }
.kpi .v { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 4px; background: var(--bg-sunken); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- Skeletons ----------------------------------------------------- */
.skel { background: var(--bg-sunken); border-radius: var(--r-sm); position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%) } to { transform: translateX(100%) } }

/* ---------- Entrance stagger (ends visible; never parked hidden) ---------- */
.enter > * { animation: rise var(--d-slow) var(--e-out) both; }
.enter > *:nth-child(1){animation-delay:0ms}   .enter > *:nth-child(2){animation-delay:40ms}
.enter > *:nth-child(3){animation-delay:80ms}  .enter > *:nth-child(4){animation-delay:120ms}
.enter > *:nth-child(5){animation-delay:160ms} .enter > *:nth-child(6){animation-delay:200ms}
.enter > *:nth-child(n+7){animation-delay:240ms}
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.pop { animation: pop var(--d-base) var(--e-spring) both; }
@keyframes pop { from { transform: scale(.9); opacity: 0 } to { transform: none; opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Desktop: the phone keeps its scale, context sits beside it ---- */
.deskside { display: none; }
@media (min-width: 1080px) {
  .stage { grid-template-columns: 1fr auto 1fr; align-items: start; gap: var(--s-7); justify-items: center; }
  .stage > .spacer { display: block; }
  .deskside {
    display: flex; flex-direction: column; gap: var(--s-4);
    max-width: 300px; padding-top: var(--s-6); align-self: start;
  }
}
