/* ==========================================================================
   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: var(--w-bold); }

: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: var(--w-bold);
  text-wrap: balance;
}
.t-display {
  font-family: var(--font-display);
  font-size: var(--t-display);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: var(--w-bold);
  text-wrap: balance;
}
.t-h1 { font-family: var(--font-display); font-size: var(--t-h1); line-height: 1.2; letter-spacing: -.016em; font-weight: var(--w-bold); }
.t-h2 { font-family: var(--font-display); font-size: var(--t-h2); line-height: 1.3; letter-spacing: var(--ls-head); font-weight: var(--w-semibold); }
.t-h3 { font-size: var(--t-h3); font-weight: var(--w-semibold); line-height: 1.35; letter-spacing: -.006em; }
.t-body { font-size: var(--t-body); }
.t-sm { font-size: var(--t-sm); }
.t-xs { font-size: var(--t-xs); line-height: var(--lh-meta); }
.muted { color: var(--text-muted); }
/* The faint grey measures 3.7:1 on the page, short of the 4.5:1 small text
   needs, so text set in it reads at the muted grey. The token stays for
   rules, icons and placeholders. */
.faint { color: var(--text-muted); }
/* The title of a row in a list (an order, a saved place, a notice). */
.t-strong { font-weight: var(--w-semibold); }
.t-label {
  font-family: var(--font-ui);
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  color: var(--text-muted);
  font-weight: var(--w-semibold);
}
/* Prices are set in the reading face with figures that line up, so a menu
   scans like a menu rather than a dashboard. */
.money {
  font-family: var(--font-ui);
  font-weight: var(--w-semibold);
  font-variant-numeric: tabular-nums;
}
.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-brand); font-weight: var(--w-bold);
  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: var(--w-semibold); 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: 0;
}
.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: var(--t-h3); 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: var(--w-bold);
  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-ui); font-size: var(--t-2xs);
  font-weight: var(--w-semibold); line-height: 1.3;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.badge-open   { background: var(--ok-bg); color: var(--ok); }
.badge-closed { background: var(--bg-sunken); color: var(--text-muted); }
.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: 7px 12px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--t-sm); font-weight: var(--w-semibold); 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-ui); font-size: var(--t-2xs);
  font-weight: var(--w-semibold); padding: 4px 10px; border-radius: 6px;
  background: var(--coral-400); color: var(--ink-900);
}

/* ---------- Poster surfaces ----------------------------------------------- */
.poster {
  position: relative; overflow: hidden;
  background: var(--surface-blush);
  border-radius: var(--r-card);
  padding: var(--s-5) var(--s-5);
}
/* The dotted grid and the decorative blobs added nothing a student needed;
   the blush surface alone carries the brand. The classes stay so older
   markup degrades to a plain surface. */
.poster-grid::before { content: none; }
.poster > * { position: relative; }
.poster-arc { display: 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: var(--w-bold); 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: var(--t-2xs); }

/* 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: var(--w-bold); font-size: 1.25rem;
  letter-spacing: -.02em;
}

/* ---------- 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 { border-color: var(--line-strong); }
.caf-status { color: var(--text-muted); font-weight: var(--w-semibold); margin-top: 2px; }
.caf-status.is-open { color: var(--ok); }
.cafcard:active { transform: scale(.99); }
.cafcard.closed { opacity: .68; }
.cafcard-hero {
  height: 64px; 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);
}
/* The giant watermark name was decoration; the card already says the name. */
.cafcard-hero .wm { display: none; }
.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: var(--w-semibold);
  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: var(--w-bold); display: grid; place-items: center; }
.qty span { color: var(--text-on-rose); font-weight: var(--w-bold); 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 solid 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-muted); padding: 6px 12px; flex: 1;
  transition: color var(--d-fast);
}
.navbtn span { font-size: 11px; font-weight: var(--w-semibold); letter-spacing: 0; }
.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: var(--w-semibold); font-size: var(--t-body); }
.tl-step.pending .tl-title { color: var(--text-muted); }

/* ---------- AI agent ------------------------------------------------------ */
.ai-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--surface-ink); color: var(--text-on-ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: var(--w-bold); font-size: var(--t-2xs);
  letter-spacing: -.01em;
}
.bubble-user {
  align-self: flex-end; max-width: 78%;
  background: var(--surface-ink); color: var(--text-on-ink);
  padding: 9px 14px; border-radius: 14px 14px 4px 14px;
  font-size: var(--t-body); line-height: 1.5; white-space: pre-wrap;
}
.bubble-ai {
  align-self: flex-start; max-width: 86%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: var(--t-body); line-height: 1.55;
  padding: 10px 14px; border-radius: 14px 14px 14px 4px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
/* The order an answer proposes, set as a small bill. */
.bill { display: grid; gap: 3px; margin-top: 2px; }
.bill-row { display: flex; justify-content: space-between; gap: var(--s-4); font-variant-numeric: tabular-nums; }
.bill-row.total { font-weight: var(--w-bold); border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.bill-row .muted { font-weight: var(--w-regular); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button {
  font-size: var(--t-sm); font-weight: var(--w-semibold); padding: 6px 11px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
}
.quick button:hover { border-color: var(--accent); color: var(--accent-text); }
.quick button.primary { background: var(--accent); color: var(--text-on-rose); border-color: transparent; }
.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: 1px solid var(--line-strong);
  border-radius: 14px; padding: 6px 6px 6px var(--s-4);
}
.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: 10px; 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: var(--w-semibold);
  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: var(--w-bold); 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: var(--w-bold); letter-spacing: -.02em; 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: var(--w-medium);
  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-ui); font-size: var(--t-2xs); letter-spacing: 0;
  color: var(--text-muted); font-weight: var(--w-semibold); 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: var(--w-bold); letter-spacing: -.02em; 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;
  }
}

/* ---------- THE ONE OTP FIELD (packages/ui/otp-field.js) -----------------
   Port of input-otp-10: a dark security panel with a particle sphere,
   rotating rings and six spring-animated slots. Its own palette, so it looks
   the same on every surface and in both themes. */
.otp10{
  --otp10-bg-1:#17111a; --otp10-bg-2:#0e0b10; --otp10-border:rgba(255,255,255,.09);
  --otp10-fg:#f6eef1; --otp10-muted:rgba(246,238,241,.58); --otp10-faint:rgba(246,238,241,.38);
  --otp10-accent:#E0567A; --otp10-accent-rgb:224,86,122;
  --otp10-ok:#34d399; --otp10-ok-rgb:52,211,153; --otp10-bad:#f87171; --otp10-bad-rgb:248,113,113;
  --otp10-spring:cubic-bezier(.34,1.56,.64,1);
  position:relative; overflow:hidden; isolation:isolate; width:100%; box-sizing:border-box;
  display:flex; flex-direction:column; align-items:center; gap:18px;
  padding:24px 16px 18px; border-radius:18px; border:1px solid var(--otp10-border);
  background:linear-gradient(180deg,var(--otp10-bg-1),var(--otp10-bg-2)); color:var(--otp10-fg);
  box-shadow:0 18px 40px -22px rgba(0,0,0,.55);
}
.otp10-glow{position:absolute;width:128px;height:128px;border-radius:50%;filter:blur(32px);pointer-events:none;z-index:-1;transition:background .5s}
.otp10-glow-a{top:-48px;right:-48px;background:rgba(var(--otp10-accent-rgb),.16)}
.otp10-glow-b{bottom:-48px;left:-48px;background:rgba(var(--otp10-accent-rgb),.08)}
.otp10:hover .otp10-glow-a{background:rgba(var(--otp10-accent-rgb),.24)}
.otp10-orb{position:relative;width:148px;height:148px;display:flex;align-items:center;justify-content:center;flex:none}
.otp10-ring{position:absolute;border-radius:50%;pointer-events:none}
.otp10-ring-1{inset:0;border:1px dashed rgba(var(--otp10-accent-rgb),.32);animation:otp10-spin 60s linear infinite}
.otp10-ring-2{inset:8px;border:1px solid rgba(var(--otp10-accent-rgb),.16);animation:otp10-spin 30s linear infinite reverse}
.otp10-ring-3{inset:16px;border:1px dashed rgba(var(--otp10-accent-rgb),.07)}
.otp10-halo{position:absolute;inset:-6px;border-radius:50%;
  background:linear-gradient(0deg,rgba(var(--otp10-accent-rgb),0),rgba(var(--otp10-accent-rgb),.07),rgba(var(--otp10-accent-rgb),0));
  animation:otp10-breathe 3s ease-in-out infinite}
.otp10-sphere{width:120px;height:120px;border-radius:50%;overflow:hidden;transform:scale(.95);transition:transform .5s;opacity:.9}
.otp10:hover .otp10-sphere{transform:scale(1);opacity:1}
.otp10-sphere canvas{width:100%;height:100%;display:block;transform:scale(1.35)}
.otp10-shield{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:50%;
  background:rgba(14,11,16,.45);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  opacity:0;transform:scale(.6);pointer-events:none;transition:opacity .35s,transform .45s var(--otp10-spring);color:var(--otp10-ok)}
.otp10-shield svg{padding:12px;border-radius:50%;background:rgba(var(--otp10-ok-rgb),.18);border:1px solid rgba(var(--otp10-ok-rgb),.45);box-sizing:content-box}
.otp10-head{text-align:center;display:flex;flex-direction:column;gap:6px;max-width:300px}
.otp10-title{margin:0;font-size:.8rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.otp10-help{margin:0;font-size:.75rem;line-height:1.5;color:var(--otp10-muted)}
.otp10-label{font-size:.72rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--otp10-muted)}
.otp10-slots{position:relative;display:flex;gap:8px;justify-content:center}
.otp10-input{position:absolute;inset:0;width:100%;height:100%;z-index:2;opacity:0;border:0;padding:0;margin:0;
  font-size:16px;/* stops iOS zooming */ letter-spacing:2.6em;color:transparent;background:transparent;caret-color:transparent;cursor:text}
.otp10-slot{position:relative;width:44px;height:56px;display:flex;align-items:center;justify-content:center;flex:none;
  border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.03);
  font:700 1.25rem/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--otp10-fg);
  transition:border-color .3s,background .3s,box-shadow .3s}
.otp10-slots:hover .otp10-slot{border-color:rgba(255,255,255,.2)}
.otp10-slot.is-active{border-color:var(--otp10-accent);background:rgba(var(--otp10-accent-rgb),.07);
  box-shadow:0 0 0 3px rgba(var(--otp10-accent-rgb),.18),0 0 18px rgba(var(--otp10-accent-rgb),.28)}
.otp10-char{position:absolute;animation:otp10-in .42s var(--otp10-spring) both}
.otp10-char.is-leaving{animation:otp10-out .2s ease-in both}
.otp10-pulse{position:absolute;inset:0;border-radius:12px;border:1px solid var(--otp10-accent);pointer-events:none;animation:otp10-pulse .4s ease-out both}
.otp10-caret{display:none;width:2px;height:24px;background:var(--otp10-accent);animation:otp10-blink 1s ease-in-out infinite}
.otp10-slot.has-caret .otp10-caret{display:block}
.otp10-status{margin:0;min-height:1em;font:500 .68rem/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.14em;text-transform:uppercase;color:var(--otp10-faint);text-align:center}
/* states */
.otp10[data-state=loading] .otp10-slot{opacity:.7}
.otp10[data-state=loading] .otp10-status{color:var(--otp10-accent);animation:otp10-breathe 1.2s ease-in-out infinite}
.otp10[data-state=loading] .otp10-ring-1{animation-duration:6s}
.otp10[data-state=loading] .otp10-ring-2{animation-duration:4s}
.otp10[data-state=success]{--otp10-accent:var(--otp10-ok);--otp10-accent-rgb:var(--otp10-ok-rgb)}
.otp10[data-state=success] .otp10-slot{border-color:var(--otp10-ok);background:rgba(var(--otp10-ok-rgb),.1);color:var(--otp10-ok);box-shadow:none}
.otp10[data-state=success] .otp10-shield{opacity:1;transform:scale(1)}
.otp10[data-state=success] .otp10-sphere{transform:scale(1.05)}
.otp10[data-state=success] .otp10-status{color:var(--otp10-ok)}
.otp10[data-state=error]{--otp10-accent:var(--otp10-bad);--otp10-accent-rgb:var(--otp10-bad-rgb)}
.otp10[data-state=error] .otp10-slot{border-color:rgba(var(--otp10-bad-rgb),.7)}
.otp10[data-state=error] .otp10-slots{animation:otp10-shake .4s ease-in-out}
.otp10[data-state=error] .otp10-status{color:var(--otp10-bad)}
.otp10:focus-within .otp10-slots{outline:none}
@keyframes otp10-spin{to{transform:rotate(360deg)}}
@keyframes otp10-breathe{0%,100%{opacity:.55}50%{opacity:1}}
@keyframes otp10-in{from{opacity:0;transform:translateY(6px) scale(.5)}to{opacity:1;transform:none}}
@keyframes otp10-out{to{opacity:0;transform:translateY(-6px) scale(.7)}}
@keyframes otp10-pulse{from{opacity:.8;transform:scale(.9);filter:blur(0)}to{opacity:0;transform:scale(1.5);filter:blur(2px)}}
@keyframes otp10-blink{0%,100%{opacity:1}50%{opacity:0}}
@keyframes otp10-shake{20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
@media (max-width:380px){
  .otp10{padding:20px 12px 16px;gap:14px}
  .otp10-slots{gap:6px}
  .otp10-slot{width:40px;height:52px}
  .otp10-orb{width:124px;height:124px}
  .otp10-sphere{width:100px;height:100px}
}
@media (prefers-reduced-motion:reduce){
  .otp10 *,.otp10 *::before{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* ==========================================================================
   SWITCH (packages/ui/switch.js) — the owner's material-design-3-switch.tsx
   Tailwind classes translated one for one; colours from this design system.
   ========================================================================== */
.m3s {
  --m3s-ease: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --m3s-on: var(--accent);
  --m3s-on-fg: #fff;
  --m3s-muted: var(--surface-2);
  --m3s-border: var(--line-strong);
  --m3s-fg: var(--text);
  --m3s-muted-fg: var(--text-muted);
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 48px; flex-shrink: 0; cursor: pointer; vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}
.m3s-destructive { --m3s-on: var(--danger); }
.m3s-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.m3s-track {
  display: inline-flex; flex-shrink: 0; align-items: center; box-sizing: border-box;
  height: 32px; width: 52px; border-radius: 9999px; border: 2px solid var(--m3s-border);
  background: var(--m3s-muted); cursor: pointer;
  transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1), border-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.m3s-input:checked + .m3s-track { background: var(--m3s-on); border-color: var(--m3s-on); }
.m3s-input:focus-visible + .m3s-track { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring, var(--accent)); }
.m3s-slide {
  pointer-events: none; display: block; position: relative; height: 100%; width: 100%;
  transform: translateX(0); transition: all 300ms var(--m3s-ease);
}
.m3s-input:checked + .m3s-track .m3s-slide { transform: translateX(20px); }
.m3s-handle {
  position: absolute; top: 50%; left: 2px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; border-radius: 9999px;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
  width: 16px; height: 16px; margin-left: 2px;
  background: var(--m3s-fg); color: var(--m3s-muted);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.m3s-icons .m3s-handle,
.m3s-input:checked + .m3s-track .m3s-handle { width: 24px; height: 24px; margin-left: 0; }
.m3s-input:checked + .m3s-track .m3s-handle { background: var(--m3s-on-fg); color: var(--m3s-on); }
.m3s:not(.is-disabled):active .m3s-handle { width: 28px; height: 28px; margin-left: -2px; }
.m3s-icon-box { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.m3s-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); }
.m3s-icon svg { width: 14px; height: 14px; }
.m3s-icon-on { opacity: 0; transform: scale(.5) rotate(-45deg); }
.m3s-icon-off { opacity: 1; transform: scale(1) rotate(0); color: var(--m3s-muted-fg); }
.m3s-input:checked + .m3s-track .m3s-icon-on { opacity: 1; transform: scale(1) rotate(0); }
.m3s-input:checked + .m3s-track .m3s-icon-off { opacity: 0; transform: scale(.5) rotate(45deg); }
.m3s-halo {
  position: absolute; top: 50%; left: 10px; width: 40px; height: 40px; border-radius: 9999px; pointer-events: none;
  background: var(--m3s-fg); opacity: 0; transform: translate(-50%, -50%) scale(.5);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.m3s-icons .m3s-halo, .m3s-input:checked + .m3s-track .m3s-halo { left: 14px; }
.m3s-input:checked + .m3s-track .m3s-halo { background: var(--m3s-on); }
label:hover > .m3s:not(.is-disabled) .m3s-halo, .m3s:not(.is-disabled):hover .m3s-halo { opacity: .05; transform: translate(-50%, -50%) scale(1); }
.m3s:not(.is-disabled):active .m3s-halo { opacity: .10; transform: translate(-50%, -50%) scale(1); }
/* small */
.m3s-sm .m3s-track { height: 24px; width: 40px; }
.m3s-sm .m3s-input:checked + .m3s-track .m3s-slide { transform: translateX(16px); }
.m3s-sm .m3s-handle, .m3s-sm.m3s-icons .m3s-handle { width: 12px; height: 12px; margin-left: 2px; }
.m3s-sm .m3s-input:checked + .m3s-track .m3s-handle { width: 16px; height: 16px; margin-left: 0; }
.m3s-sm:not(.is-disabled):active .m3s-handle { width: 20px; height: 20px; margin-left: -2px; }
.m3s-sm .m3s-icon svg { width: 10px; height: 10px; }
.m3s-sm .m3s-halo, .m3s-sm.m3s-icons .m3s-halo { width: 32px; height: 32px; left: 8px; }
.m3s-sm .m3s-input:checked + .m3s-track .m3s-halo { left: 10px; }
/* disabled: the whole switch at half opacity, as supplied */
.m3s.is-disabled, .m3s-field.is-disabled { cursor: not-allowed; }
.m3s.is-disabled { opacity: .5; }
.m3s.is-disabled .m3s-track { cursor: not-allowed; }
/* a switch with its words beside it */
.m3s-field { display: flex; align-items: center; gap: 4px; cursor: pointer; margin-left: -8px; }
.m3s-field .m3s-text { font-size: var(--t-sm); line-height: 1.35; }
.m3s-solo { display: inline-flex; }
@media (prefers-reduced-motion: reduce) {
  .m3s-track, .m3s-slide, .m3s-handle, .m3s-icon, .m3s-halo { transition: none; }
}

/* ==========================================================================
   LIGHT / DARK SWITCH (packages/ui/theme-switch.js) — the owner's
   cinematic-theme-switcher.tsx; every value below is from that file.
   ========================================================================== */
.cts { position: relative; display: inline-block; zoom: var(--cts-scale, 1); flex-shrink: 0; line-height: 0; }
.cts-track {
  position: relative; display: flex; align-items: center; box-sizing: border-box;
  height: 64px; width: 104px; border-radius: 9999px; padding: 6px; margin: 0; cursor: pointer;
  font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms ease-out;
  background: radial-gradient(ellipse at top left, #ffffff 0%, #f1f5f9 40%, #cbd5e1 100%);
  box-shadow:
    inset 5px 5px 12px rgba(148, 163, 184, 0.5),
    inset -5px -5px 12px rgba(255, 255, 255, 1),
    inset 8px 8px 16px rgba(100, 116, 139, 0.3),
    inset -8px -8px 16px rgba(255, 255, 255, 0.9),
    inset 0 2px 4px rgba(148, 163, 184, 0.4),
    inset 0 -2px 4px rgba(255, 255, 255, 1),
    inset 0 0 20px rgba(203, 213, 225, 0.3),
    0 1px 2px rgba(255, 255, 255, 1),
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.08),
    0 16px 32px rgba(0, 0, 0, 0.06),
    0 24px 48px rgba(0, 0, 0, 0.04);
  border: 2px solid rgba(203, 213, 225, 0.6);
}
.cts-track[aria-checked="true"] {
  background: radial-gradient(ellipse at top left, #1e293b 0%, #0f172a 40%, #020617 100%);
  box-shadow:
    inset 5px 5px 12px rgba(0, 0, 0, 0.9),
    inset -5px -5px 12px rgba(71, 85, 105, 0.4),
    inset 8px 8px 16px rgba(0, 0, 0, 0.7),
    inset -8px -8px 16px rgba(100, 116, 139, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 1),
    inset 0 -2px 4px rgba(71, 85, 105, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.6),
    0 1px 1px rgba(255, 255, 255, 0.05),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.4),
    0 16px 32px rgba(0, 0, 0, 0.3),
    0 24px 48px rgba(0, 0, 0, 0.2);
  border-color: rgba(51, 65, 85, 0.6);
}
.cts-track:focus { outline: none; }
.cts-track:focus-visible { outline: 3px solid var(--accent, #3b82f6); outline-offset: 3px; }
.cts-track:active { transform: scale(.98); }
.cts-groove, .cts-gloss, .cts-ao { position: absolute; border-radius: 9999px; pointer-events: none; }
.cts-groove { inset: 3px; box-shadow: inset 0 2px 6px rgba(100, 116, 139, 0.4), inset 0 -1px 3px rgba(255, 255, 255, 0.8); }
.cts-track[aria-checked="true"] .cts-groove { box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9), inset 0 -1px 3px rgba(71, 85, 105, 0.3); }
.cts-gloss { inset: 0; mix-blend-mode: overlay;
  background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.8) 0%, transparent 50%),
              linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0%, transparent 30%, transparent 70%, rgba(148, 163, 184, 0.15) 100%); }
.cts-track[aria-checked="true"] .cts-gloss {
  background: radial-gradient(ellipse at top, rgba(71, 85, 105, 0.15) 0%, transparent 50%),
              linear-gradient(to bottom, rgba(71, 85, 105, 0.2) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.3) 100%); }
.cts-ao { inset: 0; box-shadow: inset 0 0 15px rgba(148, 163, 184, 0.2); }
.cts-track[aria-checked="true"] .cts-ao { box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5); }
.cts-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.cts-bg svg, .cts-icon svg { display: block; }
.cts-bg-sun { color: #d97706; }   /* amber-600 */
.cts-bg-moon { color: #334155; }  /* slate-700 */
.cts-track[aria-checked="true"] .cts-bg-sun, .cts-track[aria-checked="true"] .cts-bg-moon { color: #fef9c3; } /* yellow-100 */
.cts-thumb {
  position: relative; z-index: 10; display: flex; align-items: center; justify-content: center;
  height: 44px; width: 44px; border-radius: 9999px; overflow: hidden; box-sizing: border-box;
  will-change: transform;
  background: linear-gradient(145deg, #ffffff 0%, #fefefe 50%, #f8fafc 100%);
  box-shadow:
    inset 2px 2px 4px rgba(203, 213, 225, 0.3),
    inset -2px -2px 4px rgba(255, 255, 255, 1),
    inset 0 1px 2px rgba(255, 255, 255, 1),
    0 1px 2px rgba(255, 255, 255, 1),
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.9);
}
.cts-track[aria-checked="true"] .cts-thumb {
  background: linear-gradient(145deg, #64748b 0%, #475569 50%, #334155 100%);
  box-shadow:
    inset 2px 2px 4px rgba(100, 116, 139, 0.4),
    inset -2px -2px 4px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    0 1px 2px rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.4);
  border-color: rgba(148, 163, 184, 0.3);
}
.cts-shine { position: absolute; inset: 0; border-radius: 9999px; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 0%, transparent 40%, rgba(0, 0, 0, 0.1) 100%); }
.cts-particles { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cts-particle {
  position: absolute; width: 10px; height: 10px; border-radius: 9999px; opacity: 0; transform: scale(0);
  background: radial-gradient(circle, rgba(251, 191, 36, 0.7) 0%, rgba(251, 191, 36, 0) 70%);
  animation-name: cts-burst; animation-timing-function: ease-out; animation-fill-mode: both;
}
.cts-track[aria-checked="true"] .cts-particle {
  background: radial-gradient(circle, rgba(147, 197, 253, 0.5) 0%, rgba(147, 197, 253, 0) 70%); }
.cts-grain { position: absolute; inset: 0; border-radius: 9999px; opacity: .4; mix-blend-mode: overlay; }
@keyframes cts-burst {
  0% { transform: scale(0); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(var(--cts-scale-to, 8)); opacity: 0; }
}
.cts-icon { position: relative; z-index: 10; }
.cts-icon-sun { color: #f59e0b; }   /* amber-500 */
.cts-icon-moon { color: #fef08a; display: none; }  /* yellow-200 */
.cts-track[aria-checked="true"] .cts-icon-sun { display: none; }
.cts-track[aria-checked="true"] .cts-icon-moon { display: block; }
@media (prefers-reduced-motion: reduce) {
  .cts-track { transition: none; }
  .cts-track:active { transform: none; }
  .cts-particle { animation: none; }
}
