:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --ink: #111418;
  --ink-2: #576070;
  --ink-3: #8a919e;
  --line: #e3e5ea;
  --accent: #facc15;       /* lemon: buttons, highlights */
  --accent-hover: #eab308;
  --accent-soft: #fef9c3;
  --accent-ink: #1f1a00;   /* text on lemon */
  --accent-text: #a16207;  /* golden text on white (lemon itself is unreadable as text) */
  --lemon: #facc15;
  --dark: #16191f;
  --dark-hover: #2a2f38;
  --dark-ink: #ffffff;
  --amber: #a85f00;
  --amber-soft: #fff1d6;
  --red: #c0392b;
  --red-soft: #fde7e4;
  --green: #11804f;
  --green-soft: #e1f4ea;
  --gold: #c98a00;
  --gold-soft: #fff6dc;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .28);
  --r: 18px;
  --r-sm: 12px;
  --tap: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --surface: #171a20;
    --surface-2: #1e2229;
    --ink: #f1f3f6;
    --ink-2: #a7aebb;
    --ink-3: #737b88;
    --line: #2a2f37;
    --accent: #fde047;
    --accent-hover: #fef08a;
    --accent-soft: #3a3208;
    --accent-ink: #1a1600;
    --accent-text: #fde047;
    --lemon: #fde047;
    --dark: #eef0f3;
    --dark-hover: #ffffff;
    --dark-ink: #111418;
    --amber: #f2aa45;
    --amber-soft: #382a12;
    --red: #ff7d6e;
    --red-soft: #3c1c19;
    --green: #4fd293;
    --green-soft: #142e20;
    --gold: #f5c04a;
    --gold-soft: #352b10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1014; --surface: #171a20; --surface-2: #1e2229; --ink: #f1f3f6; --ink-2: #a7aebb; --ink-3: #737b88;
  --line: #2a2f37; --accent: #fde047; --accent-hover: #fef08a; --accent-soft: #3a3208; --accent-ink: #1a1600; --accent-text: #fde047; --lemon: #fde047;
  --dark: #eef0f3; --dark-hover: #ffffff; --dark-ink: #111418; --amber: #f2aa45; --amber-soft: #382a12;
  --red: #ff7d6e; --red-soft: #3c1c19; --green: #4fd293; --green-soft: #142e20; --gold: #f5c04a; --gold-soft: #352b10;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.ic { width: 22px; height: 22px; flex: none; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
}
.logo svg { width: 26px; height: 26px; }
.brand-text { min-width: 0; }
.brand h1 { font-size: 20px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand p { font-size: 14px; color: var(--ink-2); }

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px;
}
.tab {
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; background: transparent;
  font-weight: 650; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.badge {
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 750;
}
.badge.zero { background: var(--line); color: var(--ink-2); }

@media (max-width: 640px) {
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 0 8px; }
}

/* ---------- Main ---------- */
.view {
  max-width: 1180px; margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(120px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.view.no-bar { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.row-head h2 { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  min-height: 48px; padding: 0 18px; border-radius: 24px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; color: var(--ink-2);
}
.chip.on { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }

/* ---------- Guest cards ---------- */
.list { display: grid; gap: 12px; }
@media (min-width: 960px) { .list.two { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.guest { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px; }
.guest .info { flex: 1 1 240px; }
.guest .g-actions { margin-left: auto; } /* drops below the details when the card is narrow */
.guest.is-priority { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.pos {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-size: 24px; font-weight: 800;
  background: var(--surface-2); color: var(--ink);
}
.guest:first-child .pos, .pos.first { background: var(--accent); color: var(--accent-ink); }
.info { flex: 1; min-width: 0; }
.name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--ink-2); font-size: 15px; font-weight: 600;
}
.pill .ic { width: 17px; height: 17px; }
.pill.size { background: var(--dark); color: var(--dark-ink); }
.pill.prio { background: var(--gold-soft); color: var(--gold); }
.w-green { background: var(--green-soft); color: var(--green); }
.w-amber { background: var(--amber-soft); color: var(--amber); }
.w-red { background: var(--red-soft); color: var(--red); }
.sub { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.sub.warn { color: var(--amber); font-weight: 600; }
.g-actions { display: flex; gap: 8px; flex: none; }

@media (max-width: 560px) {
  .guest { flex-wrap: wrap; gap: 12px; }
  .info { flex-basis: calc(100% - 72px); }
  .g-actions { width: 100%; }
  .g-actions .btn-primary { flex: 1; }
}

/* ---------- Buttons ---------- */
.btn {
  min-height: var(--tap); padding: 0 22px; border-radius: 14px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 17px; text-decoration: none; user-select: none; white-space: nowrap;
  transition: background-color .15s, transform .08s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--dark); color: var(--dark-ink); }
.btn-dark:hover { background: var(--dark-hover); }
.btn-soft { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { background: var(--line); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-icon { width: var(--tap); padding: 0; }
.btn-xl { min-height: 64px; font-size: 19px; border-radius: 18px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Action bar ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .actionbar { left: 50%; right: auto; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); bottom: 16px;
    border: 1px solid var(--line); border-radius: 24px; padding: 10px; box-shadow: var(--shadow-lg); }
}
.actionbar.hidden { display: none; }

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: 56px 24px; color: var(--ink-2);
  border: 2px dashed var(--line); border-radius: var(--r); background: var(--surface);
}
.empty .big-ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.empty .big-ic .ic { width: 32px; height: 32px; }
.empty h3 { font-size: 21px; color: var(--ink); margin-bottom: 6px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px 18px; }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--ink-2); font-size: 15px; font-weight: 600; }

.seated-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.seated-row .tbl {
  width: 56px; height: 56px; border-radius: 16px; flex: none; display: grid; place-items: center; text-align: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: 22px; line-height: 1;
}
.seated-row .tbl small { display: block; font-size: 11px; font-weight: 700; margin-top: 2px; }

/* ---------- Sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 85; display: none; } /* above the plan gate, so renewing works from it */
.sheet-wrap.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 14, .45); animation: fade .18s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
@media (min-width: 720px) {
  .sheet { left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%); width: min(640px, calc(100% - 48px));
    max-height: 88dvh; border-radius: 24px; padding: 20px 28px 28px; animation: pop .2s ease; }
  .sheet::before { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }

.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.sheet-head p { color: var(--ink-2); margin-top: 4px; }
.sheet-head .btn-icon { margin: -4px -8px 0 0; }

.field { display: block; margin-bottom: 20px; }
.label { display: block; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 8px; }
.input {
  width: 100%; min-height: 60px; padding: 0 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface-2); font-size: 20px;
  outline: none; transition: border-color .15s, background-color .15s;
}
.input:focus { border-color: var(--accent); background: var(--surface); }
.input::placeholder { color: var(--ink-3); }

.stepper { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; align-items: stretch; }
.step {
  min-height: 76px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center;
}
.step .ic { width: 30px; height: 30px; }
.step:active { background: var(--line); }
.step-val { display: flex; align-items: baseline; justify-content: center; gap: 8px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); align-items: center; }
.step-val b { font-size: 40px; font-weight: 800; line-height: 1; }
.step-val small { font-size: 17px; font-weight: 700; }
.quick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 10px; }
@media (max-width: 420px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.qbtn {
  min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 19px; font-weight: 700;
}
.qbtn.on { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.choice {
  min-height: 60px; padding: 8px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 17px;
}
.choice.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

.switch-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left;
  min-height: 72px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
}
.switch-row strong { display: block; font-size: 18px; }
.switch-row span.d { display: block; font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.switch { width: 58px; height: 34px; border-radius: 17px; background: var(--line); position: relative; flex: none; transition: background-color .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch-row[aria-pressed="true"] .switch { background: var(--accent); }
.switch-row[aria-pressed="true"] .switch::after { transform: translateX(24px); }

.note { font-size: 15px; margin-top: 10px; padding: 10px 14px; border-radius: 12px; }
.note.warn { background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.note.info { background: var(--surface-2); color: var(--ink-2); }

.sheet-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 8px -20px 0; padding: 12px 20px calc(4px + env(safe-area-inset-bottom)); background: var(--surface); }
@media (min-width: 720px) { .sheet-foot { bottom: -28px; margin: 8px -28px 0; padding: 12px 28px 8px; } }

/* Table free */
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.size-btn {
  min-height: 104px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.size-btn b { font-size: 40px; font-weight: 800; line-height: 1; }
.size-btn span { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.size-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.size-btn.on span { color: inherit; opacity: .85; }
.size-btn.dim { opacity: .5; }

.result { margin-top: 22px; }
.best {
  border-radius: 20px; padding: 20px; background: var(--accent-soft); border: 2px solid var(--accent);
}
.best .kicker { font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.best .bname { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 10px; word-break: break-word; }
.best .btn { margin-top: 16px; }
.best .pill { background: var(--surface); }
.best .pill.size { background: var(--dark); }
.result-empty { text-align: center; padding: 28px 16px; border-radius: 18px; background: var(--surface-2); color: var(--ink-2); }
.result-empty strong { display: block; color: var(--ink); font-size: 19px; margin-bottom: 4px; }
.alt-title { font-size: 14px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 10px; }
.alt { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px; border: 1px solid var(--line); margin-bottom: 8px; }
.alt .info .name { font-size: 18px; }
.alt .meta { margin-top: 4px; }

/* Menu */
.menu { display: grid; gap: 10px; }
.menu .btn { justify-content: flex-start; padding: 0 20px; min-height: 64px; }

/* Settings */
.settings { display: grid; gap: 16px; max-width: 760px; margin: 0 auto; }
.panel { padding: 20px; }
.panel h3 { font-size: 19px; font-weight: 750; margin-bottom: 4px; }
.panel > p.d { color: var(--ink-2); font-size: 15px; margin-bottom: 16px; }
.section-box { border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; margin-top: 12px; background: var(--surface-2); }
.section-top { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.section-top .input { background: var(--surface); }
.tsizes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tsize {
  display: inline-flex; align-items: center; gap: 4px; height: 52px; padding: 0 6px 0 16px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--line); font-weight: 750; font-size: 18px;
}
.tsize button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); display: grid; place-items: center; }
.tsize button:hover { background: var(--red-soft); color: var(--red); }
.tsize button .ic { width: 18px; height: 18px; }
.add-size { display: inline-flex; gap: 6px; }
.add-size .input { width: 96px; min-height: 52px; font-size: 18px; padding: 0 12px; text-align: center; background: var(--surface); }
.add-size .btn { min-height: 52px; padding: 0 16px; }
.rule-example { margin-top: 12px; }
.danger-zone { display: grid; gap: 10px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 32px);
  padding: 10px 10px 10px 20px; min-height: 60px; border-radius: 18px;
  background: var(--dark); color: var(--dark-ink); font-weight: 600; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.no-btn { padding-right: 20px; }
.toast-btn {
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0;
  background: color-mix(in srgb, var(--dark-ink) 16%, transparent); color: var(--dark-ink); font-weight: 750;
  display: inline-flex; align-items: center; gap: 6px;
}
.toast-btn .ic { width: 18px; height: 18px; }
@media (min-width: 900px) { .toast { bottom: 110px; } }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

/* ---------- Live sync, QR, login ---------- */
.brand { flex: 1; }
.title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 13px; font-weight: 700;
}
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn.on { background: var(--green-soft); color: var(--green); }
.conn.off { background: var(--amber-soft); color: var(--amber); }
.qr-btn { margin-left: auto; min-height: 52px; padding: 0 16px; }
@media (max-width: 380px) { .qr-btn span { display: none; } .qr-btn { width: 52px; padding: 0; } }
.pill.qr { background: var(--accent-soft); color: var(--accent-text); }

.qr-box { display: grid; place-items: center; padding: 20px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.qr-box img { width: min(280px, 70vw); height: auto; aspect-ratio: 1; display: block; }
.qr-url { text-align: center; margin-top: 12px; font-weight: 600; color: var(--ink-2); word-break: break-all; }
.link-btn { border: 0; background: none; padding: 0; color: inherit; font-weight: 800; text-decoration: underline; }

.login {
  position: fixed; inset: 0; z-index: 80; display: none; place-items: center; overflow-y: auto;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); background: var(--bg);
}
.login.open { display: grid; }
.login-box { width: min(360px, 100%); text-align: center; }
.login-box .logo { margin: 0 auto 16px; width: 60px; height: 60px; border-radius: 18px; }
.login-box .logo .ic { width: 30px; height: 30px; }
.login-box h2 { font-size: 26px; font-weight: 800; }
.login-box > p { color: var(--ink-2); margin-top: 4px; }
.pin-dots {
  margin: 24px 0 4px; height: 64px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line);
  display: grid; place-items: center; font-size: 36px; letter-spacing: 10px; font-weight: 800;
}
.pin-dots span { font-size: 17px; letter-spacing: 0; color: var(--ink-3); font-weight: 600; }
.pin-dots.shake { animation: shake .35s; border-color: var(--red); }
.pin-err { color: var(--red); font-weight: 600; min-height: 24px; margin-bottom: 8px; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.key {
  min-height: 72px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 28px; font-weight: 700; display: grid; place-items: center;
}
.key:active { background: var(--surface-2); }
.key.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.key.go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.key .ic { width: 28px; height: 28px; }

/* ---------- Guest join page ---------- */
.join-page .join { max-width: 480px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
.join-head { text-align: center; margin-bottom: 24px; }
.join-head .logo { margin: 0 auto 12px; width: 56px; height: 56px; }
.join-head .logo svg { width: 30px; height: 30px; }
.join-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.join-head p { color: var(--ink-2); margin-top: 4px; }
.join-card { padding: 20px; }
.join .err { margin: 0 0 16px; }
.status { text-align: center; padding: 28px 20px; }
.status .big {
  width: 120px; height: 120px; margin: 0 auto 16px; border-radius: 36px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 56px; font-weight: 800; letter-spacing: -.03em;
}
.status .big.ok { background: var(--green-soft); color: var(--green); }
.status .big.ok .ic, .status .big.gone .ic { width: 56px; height: 56px; }
.status .big.gone { background: var(--surface-2); color: var(--ink-2); }
.status h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.status .lead { font-size: 19px; color: var(--ink-2); margin-top: 6px; }
.status .who { margin: 20px 0; padding: 14px; border-radius: 14px; background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
.status .hint { font-size: 15px; color: var(--ink-3); margin-top: 16px; }

/* ---------- Cloud: plan, menu card, staff devices (manager app) ---------- */
.plan-banner { margin: 0 0 14px; }
.settings { grid-template-columns: minmax(0, 1fr); }
.note { overflow-wrap: anywhere; }
.danger-zone .btn { white-space: normal; text-align: center; padding-top: 8px; padding-bottom: 8px; }
.gate-box .menu .btn { justify-content: center; }
.toast { z-index: 90; }
.gate-box .note { margin-top: 16px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kv > div { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.kv b { font-size: 22px; font-weight: 800; letter-spacing: .02em; word-break: break-all; }
.kv .link-btn { margin-left: 8px; font-size: 15px; color: var(--accent-text); }
.add-size .pin-input { width: 140px; letter-spacing: .2em; }
.plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.price b { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.price span { color: var(--ink-2); font-weight: 600; margin-left: 4px; }
.pw-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .pw-grid { grid-template-columns: 1fr 1fr auto; } }

.menu-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.menu-thumb { position: relative; margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.menu-thumb img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.menu-thumb figcaption { padding: 6px 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.thumb-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 6px; }
.thumb-actions .btn { width: 40px; min-height: 40px; border-radius: 10px; box-shadow: var(--shadow); background: var(--surface); }
.menu-add {
  display: grid; place-items: center; align-content: center; gap: 6px; aspect-ratio: 3 / 4; border-radius: 14px; cursor: pointer;
  border: 2px dashed var(--line); color: var(--accent-text); font-weight: 750; text-align: center; padding: 8px;
}
.menu-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.menu-add.busy { color: var(--ink-2); cursor: default; }

/* ---------- Cloud: guest page menu ---------- */
.menu-cta { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 16px; }
.menu-cta-ic { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.menu-cta-text { flex: 1; min-width: 0; }
.menu-cta-text strong { display: block; font-size: 17px; }
.menu-cta-text span { display: block; font-size: 15px; color: var(--ink-2); }
.menu-cta .btn { flex: none; padding: 0 16px; }
.menu-viewer { position: fixed; inset: 0; z-index: 70; display: none; overflow-y: auto; background: var(--bg); }
.menu-viewer.open { display: block; }
.mv-bar {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.mv-pages { display: grid; gap: 12px; max-width: 900px; margin: 0 auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
.mv-pages img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--surface-2); }
.powered { text-align: center; margin-top: 28px; font-size: 14px; color: var(--ink-3); }
.powered a { color: inherit; font-weight: 700; }

/* ---------- Cloud: sign-in / sign-up ---------- */
.auth { max-width: 440px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--ink); text-decoration: none; }
.auth-brand .logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.auth-brand .logo svg { width: 22px; height: 22px; }
.auth > .auth-brand { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-card { padding: 24px 20px; }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-card > p.d { color: var(--ink-2); margin-bottom: 20px; }
.auth-card h1 + .field, .auth-card h1 + .err { margin-top: 18px; }
.auth-card .err { margin: 0 0 16px; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--ink-2); }
.auth-alt a { color: var(--accent-text); font-weight: 750; }
.auth-card .pin-dots { margin-top: 0; }
.input.bad { border-color: var(--red); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.seg-btn { min-height: 48px; border: 0; border-radius: 12px; background: transparent; font-weight: 750; color: var(--ink-2); }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Cloud: marketing site ---------- */
.site-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1100px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
}
.site-nav { display: flex; align-items: center; gap: 16px; font-weight: 700; }
.site-nav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.site-nav .btn { min-height: 44px; padding: 0 16px; }
.site main { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.hero { text-align: center; padding: 48px 0 40px; }
.kicker { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.05; letter-spacing: -.03em; font-weight: 850; margin: 12px 0 16px; }
.hero .lead { max-width: 640px; margin: 0 auto; font-size: 19px; color: var(--ink-2); }
.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-cta .btn { padding: 0 28px; }
.fine { margin-top: 14px; font-size: 15px; color: var(--ink-3); }
.steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 16px 0 48px; }
.step-card { padding: 22px; }
.step-card .n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.step-card h3 { margin: 12px 0 6px; font-size: 19px; }
.step-card p { color: var(--ink-2); }
.features h2 { font-size: 30px; letter-spacing: -.02em; text-align: center; margin-bottom: 24px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 28px; }
.feature { padding: 14px 0; border-top: 1px solid var(--line); }
.feature h3 { font-size: 17px; margin: 0 0 4px; }
.feature p { color: var(--ink-2); font-size: 16px; }
.pricing { padding: 56px 0 24px; display: grid; place-items: center; }
.price-card { width: min(440px, 100%); padding: 28px 24px; text-align: center; border: 2px solid var(--accent); }
.price-card .price { margin: 8px 0 16px; }
.price-card .price b { font-size: 52px; }
.price-card ul { text-align: left; margin: 0 0 24px; padding-left: 22px; color: var(--ink-2); line-height: 1.9; }
.site-foot { text-align: center; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); color: var(--ink-3); font-size: 15px; }
.site-foot a { color: inherit; }

/* ---------- Cloud: admin ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 8px 16px 48px; }
.admin-search { flex: 1; min-width: 220px; max-width: 420px; }
.admin-row { display: flex; align-items: center; gap: 16px; padding: 16px; }
.admin-row .slug { font-size: 15px; font-weight: 600; color: var(--accent-text); margin-left: 6px; }
.admin-row .name { white-space: normal; }
@media (max-width: 640px) { .admin-row { flex-direction: column; align-items: stretch; } }
.admin-page .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Pay by UPI */
.pay-qr img { width: min(220px, 60vw); }
.pay-status { display: grid; gap: 8px; justify-items: start; margin-bottom: 20px; }
.pay-status .d { color: var(--ink-2); }
.field .note { display: block; }
.utr-input { font-size: 20px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.claim-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.claim-row .g-actions { display: flex; gap: 8px; }.claims { margin-bottom: 28px; }
.claims h2 { font-size: 20px; font-weight: 800; }
.claims .d { color: var(--ink-2); margin: 4px 0 12px; }
/* Calling guests */
.tok { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 8px; background: var(--dark); color: var(--dark-ink); font-size: .8em; font-weight: 800; font-variant-numeric: tabular-nums; vertical-align: 2px; }
.pill.called { background: var(--amber-soft); color: var(--amber); }
.card.guest.is-called { box-shadow: inset 4px 0 0 var(--amber), var(--shadow); }

/* Guest phone: token and "your table is ready" */
.status .token-tag { display: inline-block; margin-bottom: 14px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.status .token-tag b { color: var(--ink); font-size: 1.15em; }
.status .big.call { background: var(--accent); color: var(--accent-ink); font-variant-numeric: tabular-nums; animation: pulse 1.6s ease-in-out infinite; }
.status.called { border: 2px solid var(--accent); }
@keyframes pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .status .big.call { animation: none; } }

/* Token display screen: follows the device's light/dark setting, like the rest of the app.
   Light: a big lemon "Now calling" card with a near-black number. Dark: a lemon number on dark. */
.display-page {
  --b-bg: #fffbeb; --b-panel: rgba(255, 255, 255, .88); --b-ink: #1c1a10; --b-ink-2: #6b6447; --b-line: #eee4bb;
  --b-now-bg: #facc15; --b-now-ink: #1a1600; --b-now-ink-2: #5b4b00; --b-token: #1a1600;
  --b-accent: #a16207; --b-lemon: #facc15; --b-warm: #fef08a; --b-glow: rgba(255, 255, 255, .8); --b-overlay: rgba(255, 251, 235, .95);
  --b-blob-1: #facc15; --b-blob-2: #a3e635; --b-blob-3: #fde68a;
  margin: 0; min-height: 100vh; background: var(--b-bg); color: var(--b-ink); overflow: hidden;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .display-page { --b-bg: #0b0f14; --b-panel: rgba(20, 26, 34, .82); --b-ink: #f4f6f8; --b-ink-2: #9aa4b2; --b-line: #232b36;
    --b-now-bg: rgba(20, 26, 34, .82); --b-now-ink: #f4f6f8; --b-now-ink-2: #9aa4b2; --b-token: #fde047;
    --b-accent: #fde047; --b-lemon: #fde047; --b-warm: #3a3208; --b-glow: rgba(253, 224, 71, .45); --b-overlay: rgba(5, 8, 12, .92);
    --b-blob-1: #facc15; --b-blob-2: #84cc16; --b-blob-3: #fde047; } }
:root[data-theme="dark"] .display-page { --b-bg: #0b0f14; --b-panel: rgba(20, 26, 34, .82); --b-ink: #f4f6f8; --b-ink-2: #9aa4b2; --b-line: #232b36;
    --b-now-bg: rgba(20, 26, 34, .82); --b-now-ink: #f4f6f8; --b-now-ink-2: #9aa4b2; --b-token: #fde047;
    --b-accent: #fde047; --b-lemon: #fde047; --b-warm: #3a3208; --b-glow: rgba(253, 224, 71, .45); --b-overlay: rgba(5, 8, 12, .92);
    --b-blob-1: #facc15; --b-blob-2: #84cc16; --b-blob-3: #fde047; }
.board {
  height: 100vh; height: 100dvh; box-sizing: border-box; padding: clamp(16px, 3vw, 40px);
  display: grid; gap: clamp(12px, 2vw, 28px);
  grid-template-columns: 1.6fr 1fr; grid-template-rows: auto 1fr auto;
  grid-template-areas: "top top" "now next" "foot foot";
}
.board-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.board-top h1 { font-size: clamp(22px, 3vw, 44px); font-weight: 800; letter-spacing: -.02em; }
.board-top-right { display: flex; align-items: center; gap: 16px; font-size: clamp(18px, 2.2vw, 32px); font-weight: 700; color: var(--b-ink-2); font-variant-numeric: tabular-nums; }
.board-sound { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--b-line); cursor: pointer; }
.board-sound.on { color: var(--b-accent); border-color: var(--b-accent); }
.board-label { font-size: clamp(14px, 1.6vw, 24px); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--b-ink-2); }
.board-now {
  grid-area: now; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: var(--b-now-bg); color: var(--b-now-ink); border-radius: 28px; padding: 24px; min-height: 0;
}
.board-now .board-label, .board-now .board-hint, .board-now .board-also, .board-now .board-idle { color: var(--b-now-ink-2); }
.board-now .board-also b { color: var(--b-now-ink); }
.board-token { font-size: clamp(90px, min(22vw, 30vh), 360px); font-weight: 900; line-height: 1; letter-spacing: -.04em; color: var(--b-token); font-variant-numeric: tabular-nums; margin: 8px 0; }
.board-idle { margin: 24px 0 8px; font-size: clamp(28px, 4vw, 64px); font-weight: 800; color: var(--b-ink-2); }
.board-name { font-size: clamp(28px, min(5vw, 8vh), 80px); font-weight: 800; }
.board-hint { margin-top: 8px; font-size: clamp(18px, 2.2vw, 32px); color: var(--b-ink-2); }
.board-also { margin-top: 20px; font-size: clamp(18px, 2vw, 28px); color: var(--b-ink-2); }
.board-also b { color: var(--b-ink); margin: 0 6px; }
.board-next { grid-area: next; background: var(--b-panel); border-radius: 28px; padding: clamp(16px, 2vw, 28px); min-height: 0; overflow: hidden; }
.board-next ol { list-style: none; margin: 12px 0 0; padding: 0; }
.board-next li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 16px; padding: clamp(8px, 1.2vh, 14px) 0; border-bottom: 1px solid var(--b-line); }
.board-next li b { font-size: clamp(28px, 3.4vw, 54px); font-weight: 900; font-variant-numeric: tabular-nums; min-width: 2.2ch; }
.board-next li span { font-size: clamp(18px, 2vw, 30px); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-next li em { font-style: normal; color: var(--b-ink-2); font-size: clamp(14px, 1.5vw, 22px); }
.board-more, .board-empty { margin-top: 16px; color: var(--b-ink-2); font-size: clamp(16px, 1.8vw, 26px); }
.board-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.board-join { display: flex; align-items: center; gap: 20px; text-align: left; }
.board-foot img { width: clamp(80px, 9vw, 140px); height: auto; background: #fff; border-radius: 12px; padding: 6px; }
.board-foot b { display: block; font-size: clamp(18px, 2vw, 30px); }
.board-foot span { color: var(--b-ink-2); font-size: clamp(14px, 1.4vw, 20px); }
.board-count { text-align: right; }
.board-count b { font-size: clamp(32px, 4vw, 64px); font-weight: 900; }
.board-msg { grid-column: 1 / -1; grid-row: 2; display: grid; place-items: center; text-align: center; font-size: clamp(24px, 3vw, 44px); color: var(--b-ink-2); }
.board-start { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: var(--b-overlay); }
.board-start-box { width: min(440px, 100%); text-align: center; }
.board-start-box h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.board-start-box p { color: var(--b-ink-2); margin-bottom: 20px; }
.board-start-box .btn { margin-top: 10px; }
.board-start-box .hint { margin-top: 16px; font-size: 14px; }
@media (max-aspect-ratio: 1/1) {
  .board { grid-template-columns: 1fr; grid-template-rows: auto 1.3fr 1fr auto; grid-template-areas: "top" "now" "next" "foot"; }
  .board-token { font-size: clamp(90px, min(34vw, 22vh), 300px); }
}
.display-btn + .qr-btn { margin-left: 8px; }

/* Loading feedback */
.spin { display: inline-block; width: 1em; height: 1em; margin-right: 8px; vertical-align: -2px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.spin.big { width: 36px; height: 36px; border-width: 4px; margin: 0 0 16px; color: var(--accent-text); }
.key.go .spin { margin: 0; width: 26px; height: 26px; }
.key:disabled { opacity: .55; }
.busy-line { margin-top: 16px; text-align: center; font-weight: 700; color: var(--ink-2); }
.loading-screen { position: fixed; inset: 0; z-index: 75; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); color: var(--ink-2); font-size: 18px; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
/* Header: name on its own line; live status + stats on one compact line below */
.stats-row { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; }
.stats-row #r-stats { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-row .conn { height: 22px; padding: 0 8px; font-size: 12px; }
@media (max-width: 640px) {
  .top { gap: 10px; padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 10px; }
  .brand { gap: 10px; }
  .top .logo { width: 40px; height: 40px; border-radius: 12px; }
  .top .logo svg { width: 22px; height: 22px; }
  .brand h1 { font-size: 18px; }
  .brand p { font-size: 13px; }
  .qr-btn { flex: none; min-height: 44px; width: 44px; padding: 0; justify-content: center; }
  .qr-btn span { display: none; }
  .display-btn + .qr-btn { margin-left: 6px; }
  .tab { min-height: 44px; }
}

/* Settings tabs */
.subtabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtab {
  flex: 1 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent;
  font-weight: 650; color: var(--ink-2); white-space: nowrap;
}
.subtab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 160px; }
.cred { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.cred > div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.cred b { display: block; font-size: 20px; letter-spacing: .02em; overflow-wrap: anywhere; }
.cred .link-btn { margin-top: 4px; font-size: 14px; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent-text); }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-row h3 { margin-bottom: 6px; }
@media (max-width: 380px) { .cred { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .subtabs { gap: 2px; } .subtab { flex: 1 1 auto; padding: 0 8px; font-size: 14px; } }
/* Display screen: soft, friendly motion (all of it is switched off for reduced-motion users) */
.board { position: relative; z-index: 1; }
.board-now { position: relative; overflow: hidden; isolation: isolate; }
.board-next { position: relative; }

/* Slow-drifting warm glow behind everything */
.board-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.board-bg i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; opacity: .16; }
.board-bg i:nth-child(1) { left: -20vmax; top: -25vmax; background: radial-gradient(circle, var(--b-blob-1) 0, transparent 65%); animation: drift-a 38s ease-in-out infinite alternate; }
.board-bg i:nth-child(2) { right: -25vmax; bottom: -30vmax; background: radial-gradient(circle, var(--b-blob-2) 0, transparent 65%); animation: drift-b 46s ease-in-out infinite alternate; }
.board-bg i:nth-child(3) { left: 30vw; top: 40vh; width: 40vmax; height: 40vmax; background: radial-gradient(circle, var(--b-blob-3) 0, transparent 65%); opacity: .08; animation: drift-a 54s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-16vw, -12vh) scale(1.2); } }

/* The token being called breathes with a soft glow */
.board-token { animation: glow 3.2s ease-in-out infinite; }
@keyframes glow { 50% { text-shadow: 0 0 40px var(--b-glow), 0 0 90px var(--b-glow); } }

/* A new call: the number pops in, the name follows, the panel lights up */
.board-now.is-new .board-token { animation: token-in .9s cubic-bezier(.2, 1.4, .3, 1) both, glow 3.2s ease-in-out .9s infinite; }
.board-now.is-new .board-name { animation: rise-in .7s ease-out .35s both; }
.board-now.is-new .board-hint { animation: rise-in .7s ease-out .55s both; }
.board-now.is-new { animation: panel-warm 2.4s ease-out; }
@keyframes token-in {
  0% { opacity: 0; transform: scale(.4) translateY(40px); filter: blur(12px); }
  60% { opacity: 1; transform: scale(1.1); filter: blur(0); }
  100% { transform: scale(1); }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes panel-warm { 0%, 30% { background: var(--b-warm); } }

/* Rings rippling out from the number */
.board-now .ripple {
  position: absolute; left: 50%; top: 50%; z-index: -1; width: 30vmin; height: 30vmin; margin: -15vmin 0 0 -15vmin;
  border-radius: 50%; border: 3px solid var(--b-accent); opacity: 0; animation: ripple 2.6s ease-out forwards;
}
@keyframes ripple { 0% { transform: scale(.3); opacity: .8; } 100% { transform: scale(3); opacity: 0; } }

/* Confetti drifting down over the panel */
.board-now .confetti { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.board-now .confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; opacity: 0;
  animation-name: fall; animation-timing-function: cubic-bezier(.25, .6, .4, 1); animation-fill-mode: forwards;
}
@keyframes fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 110vh) rotate(var(--spin)); }
}

/* "Next" list: new arrivals slide in */
.board-next li.row-in { animation: row-in .6s ease-out both; }
@keyframes row-in { from { opacity: 0; transform: translateX(30px); } }

/* Nobody called yet: gentle breathing text and bouncing dots */
.board-idle { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }
.dots { display: inline-flex; gap: 8px; margin-left: 12px; vertical-align: middle; }
.dots i { width: .28em; height: .28em; border-radius: 50%; background: var(--b-accent); animation: bounce 1.4s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .2s; background: var(--b-lemon); }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-.35em); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .board-bg i, .board-token, .board-idle, .dots i { animation: none !important; }
}

.board-theme { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--b-line); background: transparent; color: inherit; }

/* Everything in the "Now calling" panel scales with the panel's own height, so the number, name,
   hint and "Also called" always fit, whatever the screen. (Older TV browsers keep the sizes above.) */
@supports (font-size: 1cqh) {
  .board-now { container-type: size; }
  .board-now .board-label { font-size: clamp(12px, 4.5cqh, 24px); }
  .board-token { font-size: clamp(56px, min(24vw, 50cqh), 380px); margin: 0; }
  .board-name { font-size: clamp(20px, 10cqh, 80px); }
  .board-hint { font-size: clamp(14px, 5.5cqh, 32px); margin-top: 1cqh; }
  .board-also { font-size: clamp(14px, 5cqh, 28px); margin-top: 2.5cqh; }
  .board-idle { font-size: clamp(22px, min(4vw, 10cqh), 64px); }
}