/* Chili Fest phone and admin: liquid glass. Frosted cards and capsules float over a soft,
   slowly drifting backdrop. One red accent for the primary action and the selected choice. */

:root {
  --bg: #EEF0F5;
  --surface: #FFFFFF;
  --ink: #1C1C1E;
  --ink-soft: rgba(60, 60, 67, .62);
  --ink-faint: rgba(60, 60, 67, .32);
  --line: rgba(60, 60, 67, .14);
  --accent: #FF3B30;
  --accent-ink: #FFFFFF;
  --accent-glow: rgba(255, 59, 48, .35);
  --accent-wash: rgba(255, 59, 48, .12);
  --ok: #34C759;
  --wait: #AF52DE;
  --wait-wash: rgba(175, 82, 222, .14);
  --blue: #007AFF;
  --blue-wash: rgba(0, 122, 255, .12);
  --p2: #FF9500;
  /* glass */
  --glass-bg: rgba(255, 255, 255, .58);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-hi: rgba(255, 255, 255, .95);
  --glass-shadow: 0 8px 30px rgba(0, 0, 0, .08);
  --capsule-bg: rgba(255, 255, 255, .68);
  --pill-bg: rgba(255, 255, 255, .5);
  --pill-border: rgba(255, 255, 255, .72);
  --pill-hi: rgba(255, 255, 255, .9);
  --blur: blur(30px) saturate(180%);
  --blob-a: #FFC7A8;
  --blob-b: #C9D8FF;
  --blob-c: #FFC1CF;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --serif: var(--sans);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0C; --surface: #1C1C1E; --ink: #FFFFFF; --ink-soft: rgba(235, 235, 245, .62); --ink-faint: rgba(235, 235, 245, .32);
    --line: rgba(255, 255, 255, .12); --accent: #FF453A; --accent-glow: rgba(255, 69, 58, .45); --accent-wash: rgba(255, 69, 58, .18);
    --ok: #30D158; --wait: #BF5AF2; --wait-wash: rgba(191, 90, 242, .2); --blue: #0A84FF; --blue-wash: rgba(10, 132, 255, .2); --p2: #FF9F0A;
    --glass-bg: rgba(44, 44, 48, .55); --glass-border: rgba(255, 255, 255, .12); --glass-hi: rgba(255, 255, 255, .18); --glass-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    --capsule-bg: rgba(44, 44, 48, .62); --pill-bg: rgba(255, 255, 255, .08); --pill-border: rgba(255, 255, 255, .1); --pill-hi: rgba(255, 255, 255, .12);
    --blob-a: #7A1E16; --blob-b: #3B2A7A; --blob-c: #7A4416;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0C; --surface: #1C1C1E; --ink: #FFFFFF; --ink-soft: rgba(235, 235, 245, .62); --ink-faint: rgba(235, 235, 245, .32);
  --line: rgba(255, 255, 255, .12); --accent: #FF453A; --accent-glow: rgba(255, 69, 58, .45); --accent-wash: rgba(255, 69, 58, .18);
  --ok: #30D158; --wait: #BF5AF2; --wait-wash: rgba(191, 90, 242, .2); --blue: #0A84FF; --blue-wash: rgba(10, 132, 255, .2); --p2: #FF9F0A;
  --glass-bg: rgba(44, 44, 48, .55); --glass-border: rgba(255, 255, 255, .12); --glass-hi: rgba(255, 255, 255, .18); --glass-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  --capsule-bg: rgba(44, 44, 48, .62); --pill-bg: rgba(255, 255, 255, .08); --pill-border: rgba(255, 255, 255, .1); --pill-hi: rgba(255, 255, 255, .12);
  --blob-a: #7A1E16; --blob-b: #3B2A7A; --blob-c: #7A4416;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.35 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
h1, h2, h3 { font-family: var(--sans); margin: 0 0 .35em; color: var(--ink); }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.center { text-align: center; }
.stat, .tabular, .lb-score, .lineup-num, .lb-rank, .pot-chip, .progress { font-variant-numeric: tabular-nums; }

/* The drifting backdrop the glass sits on */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; border-radius: 50%; filter: blur(60px); will-change: transform; }
.backdrop i:nth-child(1) { left: -120px; top: -80px; width: 360px; height: 320px; background: var(--blob-a); animation: drift1 26s ease-in-out infinite alternate; }
.backdrop i:nth-child(2) { right: -140px; top: 40%; width: 360px; height: 360px; background: var(--blob-b); animation: drift2 34s ease-in-out infinite alternate; }
.backdrop i:nth-child(3) { left: -60px; bottom: -120px; width: 380px; height: 300px; background: var(--blob-c); animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { 0% { transform: translate(0, 0) scale(1) } 40% { transform: translate(110px, 90px) scale(1.15) } 100% { transform: translate(40px, 200px) scale(.95) } }
@keyframes drift2 { 0% { transform: translate(0, 0) scale(1) } 45% { transform: translate(-120px, -110px) scale(1.12) } 100% { transform: translate(-40px, 160px) scale(1) } }
@keyframes drift3 { 0% { transform: translate(0, 0) scale(1) } 35% { transform: translate(120px, -90px) scale(.9) } 100% { transform: translate(60px, -220px) scale(1.15) } }

/* Materials */
.card, .glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
}
.pill, .input, .tag, .btn.secondary, .notice {
  background: var(--pill-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--pill-border);
  box-shadow: inset 0 1px 0 var(--pill-hi);
}

.wrap { max-width: 640px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right)) 120px max(16px, env(safe-area-inset-left)); }

.banner {
  background: var(--blue-wash);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: var(--ink);
  padding: 10px 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.notice { border-radius: 18px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.notice.warm { background: var(--accent-wash); color: var(--accent); font-weight: 700; border-color: transparent; }

.hero { padding: 18px 4px 6px; }
.hero h1 { margin-bottom: 6px; }
.hero .eyebrow, .eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-soft); margin-bottom: 6px; }
.large-title { padding: 18px 4px 10px; }
.large-title h1 { margin: 0; }
.large-title .muted { font-size: 15px; margin-top: 2px; }

.card { border-radius: 26px; padding: 18px; margin: 12px 0; }
.section-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 24px 4px 8px; }

/* Rows inside a card become an inset list with hairlines */
.card:has(> .lineup-row), .card:has(> .lb-row) { padding: 0; overflow: hidden; }
.lineup-row, .lb-row { position: relative; padding: 12px 18px; }
.lineup-row + .lineup-row::before, .lb-row + .lb-row::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; border-top: 1px solid var(--line); }
.lineup-row { display: flex; gap: 12px; align-items: baseline; }
.lineup-num { width: 24px; flex: 0 0 auto; color: var(--ink-soft); font-weight: 800; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 13px; font-weight: 600; color: var(--ink-soft); border-radius: 999px; padding: 4px 12px; }

/* Buttons: capsules. One red primary per view; everything else is glass. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 15px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 16px var(--accent-glow);
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.secondary { color: var(--ink); font-weight: 600; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.secondary.small { box-shadow: inset 0 1px 0 var(--pill-hi); }
.btn.block { width: 100%; min-height: 50px; font-size: 16px; }
.linkish { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 8px 0; font-size: 15px; font-weight: 600; }
.linkish:hover { text-decoration: underline; }

/* Inputs: glass capsules */
.field-label, .field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 4px 6px; }
.field { display: block; margin: 12px 0; }
.input { width: 100%; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 16px; }
.input:focus { outline: none; border-color: var(--blue); }
.input::placeholder, .comment-input::placeholder { color: var(--ink-soft); opacity: 1; }
textarea.input { border-radius: 20px; padding: 12px 16px; }
.admin .input { min-height: 40px; font-size: 15px; }

/* Selects: no browser arrow, a thin themed chevron */
select { -webkit-appearance: none; appearance: none; cursor: pointer; }
.sw { position: relative; display: flex; min-width: 0; }
.sw > select { flex: 1; min-width: 0; padding-right: 40px; }
.sw::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 7px; height: 7px;
  border-right: 1.8px solid var(--ink-soft); border-bottom: 1.8px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.sw:has(select:disabled)::after { opacity: .4; }
.sw.inline { display: inline-flex; }
.sw.inline > select { padding-left: 14px; }

/* Top bar: a floating glass capsule with the pot strip and the voter */
.topbar {
  position: sticky; top: 0; z-index: 5;
  padding: 12px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  display: flex; justify-content: center;
}
.topbar:has(> .hidden + .hidden) { display: none; }
.topbar > .strip, .topbar > .voter-chip { min-width: 0; }
.topbar::before { content: ""; position: absolute; inset: 12px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); border-radius: 999px; z-index: -1;
  background: var(--capsule-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0, 0, 0, .12); }
.topbar { gap: 10px; align-items: center; }
.strip { flex: 1; padding: 8px 0 8px 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 600px; }
.strip::-webkit-scrollbar { display: none; }
.voter-chip { flex: 0 0 auto; padding: 8px 8px 8px 0; display: flex; align-items: center; }
.topbar:has(> .strip.hidden)::before { display: none; }
.topbar:has(> .strip.hidden) { justify-content: flex-end; }
.topbar:has(> .strip.hidden) .voter-pill { background: var(--capsule-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-color: var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 6px 20px rgba(0, 0, 0, .1); }
.voter-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--pill-bg); border: 1px solid var(--pill-border); box-shadow: inset 0 1px 0 var(--pill-hi);
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.voter-pill .chev { color: var(--ink-soft); display: inline-flex; }
.voter-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pot chips: round glass, green when rated, dashed for your own pot */
.pot-chip {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; cursor: pointer; color: var(--ink);
  background: var(--pill-bg); border: 1px solid var(--pill-border); box-shadow: inset 0 1px 0 var(--pill-hi);
}
.pot-chip.rated { background: var(--ok); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.pot-chip.own { border-style: dashed; border-color: var(--ink-faint); color: var(--ink-faint); background: transparent; box-shadow: none; }
.pot-chip.draft { border-color: var(--p2); color: var(--p2); }

/* Chili card */
.chili { scroll-margin-top: 80px; border-radius: 30px; padding: 18px; }
.chili-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chili-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chili-num { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.chili-name { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.chili-head .small { font-size: 13px; color: var(--ink-soft); }
.chili .note { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.chili.own { opacity: .7; }
.chili.collapsed { padding: 0; border-radius: 26px; }
.summary {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; text-align: left;
  background: none; border: 0; border-radius: 26px; cursor: pointer; color: var(--ink);
}
.summary .chili-num { font-size: 17px; }
.summary .chili-name { font-size: 17px; }
.summary-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.summary-meta { font-size: 14px; color: var(--ink-soft); }
.summary .chev { color: var(--ink-faint); display: inline-flex; }
.check { width: 28px; height: 28px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.label-row { margin: 18px 4px 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* Taste Score: number capsules */
.scores { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.score {
  min-height: 52px; border-radius: 999px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums;
  background: var(--pill-bg); border: 1px solid var(--pill-border); box-shadow: inset 0 1px 0 var(--pill-hi);
}
.score.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 16px var(--accent-glow); }

/* Scoville Score: peppers in round glass, the selected one ringed in its own color */
.peppers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pepper {
  min-height: 52px; border-radius: 999px; padding: 0; cursor: pointer; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
}
.pepper svg { width: 30px; height: 30px; opacity: .4; }
.pepper.lit svg { opacity: 1; }
.pepper.on { background: var(--pill-bg); border-color: var(--pill-border); box-shadow: inset 0 0 0 2px var(--pepper), inset 0 1px 0 var(--pill-hi); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pepper:not(.lit) svg { opacity: .55; } }
:root[data-theme="dark"] .pepper:not(.lit) svg { opacity: .55; }

/* The selected choice's caption, directly under it */
.caption-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 6px; min-height: 20px; }
.peppers + .caption-row { min-height: 34px; }
.caption-cell { position: relative; }
.caption { position: absolute; top: 0; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; line-height: 1.2; font-size: 13px; font-weight: 700; color: var(--ink); }
.caption b { display: block; font-weight: 700; }
.caption span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
/* Centered under the end choices too; on the narrowest phones a touch smaller so it stays inside the card. */
@media (max-width: 359px) { .caption { font-size: 11px; } .caption span { font-size: 10px; } }

/* Guess the chef and the comment card */
.chili .extras { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.chili .extras .input { min-height: 48px; }
.comment-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 10px; border-radius: 22px; cursor: text;
  background: var(--pill-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--pill-border); box-shadow: inset 0 1px 0 var(--pill-hi);
}
.comment-card:focus-within { border-color: var(--blue); }
.comment-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.comment-head .count { font-weight: 500; font-variant-numeric: tabular-nums; }
.comment-input { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-height: 66px; margin: 0; padding: 0; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 16px; line-height: 1.35; color: inherit; }
.draft-note { font-size: 14px; color: var(--p2); font-weight: 600; margin-top: 10px; }
.own-note { color: var(--ink-soft); font-size: 15px; margin-top: 8px; }
.err-note { font-size: 14px; color: var(--accent); margin-top: 8px; }

/* Bottom bar: a floating glass capsule */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 0 12px calc(14px + env(safe-area-inset-bottom)); pointer-events: none; }
.bottom-bar .inner {
  pointer-events: auto; max-width: 600px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 20px; border-radius: 999px;
  background: var(--capsule-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0, 0, 0, .12);
}
.progress { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bottom-bar .btn { min-height: 48px; padding: 0 24px; font-size: 16px; }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync-dot.pending { background: var(--p2); }

/* Sheet (in page confirmation) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .28); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 520px; margin: 0 8px calc(8px + env(safe-area-inset-bottom));
  border-radius: 32px; padding: 22px 20px 20px;
  background: var(--capsule-bg); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 20px 60px rgba(0, 0, 0, .25);
}
.sheet .actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet .actions .btn { flex: 1; min-height: 50px; font-size: 16px; }
.sheet .btn.block { margin-top: 8px; }

/* Leaderboard rows */
.lb-main { display: flex; gap: 12px; align-items: baseline; cursor: pointer; }
.lb-rank { width: 24px; flex: 0 0 auto; font-weight: 800; color: var(--ink-soft); }
.lb-row:first-child .lb-rank { color: var(--ink); }
.lb-title { flex: 1; min-width: 0; font-weight: 700; }
.lb-title .muted { font-weight: 500; }
.lb-score { font-size: 18px; font-weight: 800; }
.lb-meta { font-size: 14px; color: var(--ink-soft); margin: 3px 0 0 36px; }
.lb-comments { margin: 8px 0 0 36px; padding: 10px 14px; border-radius: 16px; background: var(--pill-bg); font-size: 15px; }
.lb-comments p { margin: 4px 0; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .score, .pepper, .admin-nav button, .summary, .pot-chip { transition: background .15s ease, box-shadow .15s ease, opacity .15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .backdrop i { animation: none !important; }
}

/* ---------- Admin ---------- */
.admin .wrap { max-width: 860px; padding-bottom: 64px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 4px 0; }
.admin-head h1 { margin: 0; }
/* Tabs as a glass segmented capsule */
.admin-nav {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; padding: 4px; margin: 14px 0 4px;
  position: sticky; top: 8px; z-index: 4;
  background: var(--capsule-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 6px 20px rgba(0, 0, 0, .08);
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav button { flex: 1 0 auto; border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 36px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); }
.admin-nav button.on { background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .1); font-weight: 700; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.stat { font-size: 26px; font-weight: 800; }
.admin .card { border-radius: 28px; }

/* Chips */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; color: var(--ink-soft); margin: 2px 4px 2px 0; }
.pill.warn { background: var(--wait-wash); color: var(--wait); border-color: transparent; }
.pill.red { background: var(--accent-wash); color: var(--accent); border-color: transparent; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 7px 14px; border-radius: 999px; text-transform: capitalize;
  background: var(--pill-bg); border: 1px solid var(--pill-border); box-shadow: inset 0 1px 0 var(--pill-hi); }
.state-pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); }
.state-pill.open::before { background: var(--ok); }
.state-pill.closed::before { background: var(--p2); }
.state-pill.published::before { background: var(--blue); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-weight: 600; color: var(--ink-soft); font-size: 12px; }
.tbl-wrap { overflow-x: auto; }
.hl { background: var(--accent-wash); border-radius: 16px; }
.chef-qr { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 20px; margin: 8px 8px 0 0; background: #fff; color: #1C1C1E; box-shadow: var(--glass-shadow); }
.chef-qr canvas, .chef-qr img, .chef-qr svg { width: 160px; height: 160px; }
.checkboxes { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.checkboxes label { font-size: 15px; display: flex; gap: 6px; align-items: center; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
/* A checkbox stays beside its label text */
label.row { flex-wrap: nowrap; align-items: center; }
label.row > input[type="checkbox"] { flex: 0 0 auto; }

/* iOS style switch */
input.switch {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 51px; height: 31px; margin: 0;
  border-radius: 999px; background: rgba(120, 120, 128, .24); position: relative; cursor: pointer;
}
input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16);
}
input.switch:checked { background: var(--ok); }
input.switch:checked::after { left: 22px; }
@media (prefers-reduced-motion: no-preference) {
  input.switch, input.switch::after { transition: background .2s ease, left .2s ease; }
}
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-size: 16px; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 600; z-index: 30; max-width: 90vw;
  background: var(--capsule-bg); color: var(--ink); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0, 0, 0, .18);
}
.toast.err { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.remote { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.remote .btn { min-height: 88px; font-size: 22px; border-radius: 32px; }
