/* ── Palate design tokens ───────────────────────────────────────────────────
   Ground: bone with a mulberry bias. Accent: mulberry (wine list, not terracotta).
   The like/dislike axis is deliberately a separate hue family from the accent so
   a strong opinion never reads as branding.
   ──────────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #F3F0F2;
  --surface: #FCFAFB;
  --surface-2: #F7F3F5;
  --ink: #1A1418;
  --ink-2: #4B3F46;
  --muted: #7A6A73;
  --line: #E2D9DE;
  --line-strong: #CFC2C9;

  --accent: #7A2E4E;
  --accent-ink: #FFFFFF;
  --accent-soft: #F1E2E8;
  --accent-line: #DFC3CF;

  --good: #2F6E52;
  --good-soft: #E1EEE7;
  --bad: #A9453C;
  --bad-soft: #F6E2DF;
  --warn: #9A6410;
  --warn-soft: #F7EBD8;

  --shadow: 0 1px 2px rgba(26, 20, 24, .05), 0 8px 24px -12px rgba(26, 20, 24, .18);
  --radius: 10px;
  --radius-sm: 6px;

  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141013; --surface: #1C171B; --surface-2: #241D23;
    --ink: #F1E9ED; --ink-2: #CBB9C3; --muted: #9C8A94;
    --line: #322A30; --line-strong: #463B43;
    --accent: #D9789E; --accent-ink: #21121A; --accent-soft: #33202A; --accent-line: #4C3340;
    --good: #74C09A; --good-soft: #1D2E26; --bad: #E38C82; --bad-soft: #33201E;
    --warn: #D6A44E; --warn-soft: #302517;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #141013; --surface: #1C171B; --surface-2: #241D23;
  --ink: #F1E9ED; --ink-2: #CBB9C3; --muted: #9C8A94;
  --line: #322A30; --line-strong: #463B43;
  --accent: #D9789E; --accent-ink: #21121A; --accent-soft: #33202A; --accent-line: #4C3340;
  --good: #74C09A; --good-soft: #1D2E26; --bad: #E38C82; --bad-soft: #33201E;
  --warn: #D6A44E; --warn-soft: #302517;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7);
}
:root[data-theme="light"] {
  --bg: #F3F0F2; --surface: #FCFAFB; --surface-2: #F7F3F5;
  --ink: #1A1418; --ink-2: #4B3F46; --muted: #7A6A73;
  --line: #E2D9DE; --line-strong: #CFC2C9;
  --accent: #7A2E4E; --accent-ink: #FFFFFF; --accent-soft: #F1E2E8; --accent-line: #DFC3CF;
  --good: #2F6E52; --good-soft: #E1EEE7; --bad: #A9453C; --bad-soft: #F6E2DF;
  --warn: #9A6410; --warn-soft: #F7EBD8;
  --shadow: 0 1px 2px rgba(26,20,24,.05), 0 8px 24px -12px rgba(26,20,24,.18);
}

/* ── Palettes ────────────────────────────────────────────────────────────────
   Named accent palettes on top of the light/dark theme. Each redefines only the
   accent family and the stripe tint; the ground stays with the theme. Selected
   via data-palette on <html>, remembered in localStorage.
   ──────────────────────────────────────────────────────────────────────────── */
:root { --stripe: #EDE7EA; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --stripe: #211B20; } }
:root[data-theme="dark"] { --stripe: #211B20; }
:root[data-theme="light"] { --stripe: #EDE7EA; }

:root[data-palette="bistro"] {
  --accent: #8A4A17; --accent-ink: #FFF; --accent-soft: #F3E5D8; --accent-line: #E2C9AE;
  --stripe: #EFE8E0;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="bistro"]:not([data-theme="light"]) {
    --accent: #E09B58; --accent-ink: #221304; --accent-soft: #33261A; --accent-line: #4C3A26;
    --stripe: #241E17;
  }
}
:root[data-palette="bistro"][data-theme="dark"] {
  --accent: #E09B58; --accent-ink: #221304; --accent-soft: #33261A; --accent-line: #4C3A26;
  --stripe: #241E17;
}

:root[data-palette="harbor"] {
  --accent: #2C5F7C; --accent-ink: #FFF; --accent-soft: #DFEAF1; --accent-line: #BAD2E0;
  --stripe: #E7ECEF;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="harbor"]:not([data-theme="light"]) {
    --accent: #7FB5D3; --accent-ink: #0C1E28; --accent-soft: #1D2C36; --accent-line: #2C4250;
    --stripe: #1A2228;
  }
}
:root[data-palette="harbor"][data-theme="dark"] {
  --accent: #7FB5D3; --accent-ink: #0C1E28; --accent-soft: #1D2C36; --accent-line: #2C4250;
  --stripe: #1A2228;
}

:root[data-palette="verdant"] {
  --accent: #2F6E52; --accent-ink: #FFF; --accent-soft: #E1EEE7; --accent-line: #BFD9CC;
  --stripe: #E8EDEA;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="verdant"]:not([data-theme="light"]) {
    --accent: #74C09A; --accent-ink: #0D211A; --accent-soft: #1D2E26; --accent-line: #2C453A;
    --stripe: #1A211E;
  }
}
:root[data-palette="verdant"][data-theme="dark"] {
  --accent: #74C09A; --accent-ink: #0D211A; --accent-soft: #1D2E26; --accent-line: #2C453A;
  --stripe: #1A211E;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; line-height: 1.15; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font: 600 10px/1 var(--body); letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail {
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.wordmark { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; }
.wordmark b { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.wordmark span { font: 600 9px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--ink-2); font-size: 14px; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a .n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.nav a.on .n { color: var(--accent); }
.nav-group { display: flex; flex-direction: column; gap: 6px; }

.main { min-width: 0; padding: 26px 30px 90px; max-width: 1180px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head .lede { color: var(--muted); font-size: 14px; max-width: 62ch; margin-top: 5px; }

.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .main { padding: 16px 14px 84px; }
  .tabbar {
    display: grid; grid-auto-flow: column; position: fixed; inset: auto 0 0 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a {
    text-decoration: none; text-align: center; padding: 7px 2px; border-radius: var(--radius-sm);
    font: 600 10.5px/1.35 var(--body); color: var(--muted);
  }
  .tabbar a.on { color: var(--accent); background: var(--accent-soft); }
  .tabbar a i { display: block; font-style: normal; font-size: 15px; margin-bottom: 2px; }
}

/* ── Primitives ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 7px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.scroll-x { overflow-x: auto; }

.btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13.5px; font-weight: 500; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font: 600 10px/1 var(--body); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 7px 10px; width: 100%;
}
textarea { resize: vertical; min-height: 62px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 999px; padding: 2.5px 9px; font-size: 11.5px; white-space: nowrap;
}
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.chip.good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
button.chip { cursor: pointer; }

.price { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .5px; }

/* ── Match meter — the recurring device ─────────────────────────────────── */
.meter { display: flex; align-items: center; gap: 10px; }
.meter-track {
  flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2);
  border: 1px solid var(--line); overflow: hidden; position: relative;
}
.meter-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .5s cubic-bezier(.22,.9,.3,1); }
.meter-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 600; min-width: 46px; text-align: right; }
.meter.weak .meter-fill { background: var(--muted); }
.meter.strong .meter-val { color: var(--accent); }

/* Provenance trail — how a recommendation reached you */
.path { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.path .node { color: var(--ink-2); }
.path .node.src { color: var(--accent); font-weight: 600; }
.path .arrow { color: var(--line-strong); }
.hopmark {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}

/* ── Score picker: -2 … +2 ──────────────────────────────────────────────── */
.scores { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.scores button {
  border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  border-right: 1px solid var(--line); transition: background .1s, color .1s;
}
.scores button:last-child { border-right: 0; }
.scores button:hover { background: var(--surface-2); color: var(--ink); }
.scores button.on { font-weight: 700; }
.scores button.on[data-v="2"], .scores button.on[data-v="1"] { background: var(--good); color: #fff; }
.scores button.on[data-v="0"] { background: var(--line-strong); color: var(--ink); }
.scores button.on[data-v="-1"], .scores button.on[data-v="-2"] { background: var(--bad); color: #fff; }
.scores.sm button { padding: 3px 7px; font-size: 11.5px; }

/* ── Dish list ──────────────────────────────────────────────────────────── */
.dish { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.dish:first-child { border-top: 0; }
.dish-name { font-weight: 500; }
.dish-meta { display: flex; gap: 8px; align-items: center; }

/* ── Affinity bars ──────────────────────────────────────────────────────── */
.bars { display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 9px; font-size: 12.5px; }
.bar-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 3px; border: 1px solid var(--line); }
.bar-track::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.bar-fill { position: absolute; top: 1px; bottom: 1px; border-radius: 2px; }
.bar-fill.pos { background: var(--good); left: 50%; }
.bar-fill.neg { background: var(--bad); right: 50%; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 600 10px/1 var(--body); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
td.n, th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* Alternating rows: stripes carry the palette tint, hover stays distinct on top. */
tbody tr:nth-child(even) { background: var(--stripe); }
tbody tr:hover { background: var(--surface-2); }
.dish:nth-child(even) { background: var(--stripe); }
.dish { padding-left: 8px; padding-right: 8px; margin: 0 -8px; border-radius: 4px; }
.list-striped > *:nth-child(even) { background: var(--stripe); }
.list-bordered > * { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cell-score { display: inline-block; min-width: 30px; text-align: center; border-radius: 3px; padding: 1px 4px; font-family: var(--mono); font-size: 11.5px; }
.cell-score.p2 { background: var(--good); color: #fff; }
.cell-score.p1 { background: var(--good-soft); color: var(--good); }
.cell-score.z { background: var(--surface-2); color: var(--muted); }
.cell-score.n1 { background: var(--bad-soft); color: var(--bad); }
.cell-score.n2 { background: var(--bad); color: #fff; }

/* ── Voting ─────────────────────────────────────────────────────────────── */
.ballot-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.ballot-item:hover { border-color: var(--line-strong); }
.ballot-item.picked { border-color: var(--accent); background: var(--accent-soft); }
.rank-badge {
  width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface);
}
.ballot-item.picked .rank-badge { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

.round { border-left: 2px solid var(--line); padding: 0 0 14px 14px; position: relative; }
.round:last-child { padding-bottom: 0; }
.round::before {
  content: ""; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--line-strong);
}
.round.final::before { background: var(--accent); }
.tally-row { display: grid; grid-template-columns: 1fr 46px 90px; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.tally-bar { height: 8px; background: var(--surface-2); border-radius: 2px; border: 1px solid var(--line); overflow: hidden; }
.tally-bar span { display: block; height: 100%; background: var(--accent); }
.tally-row.out { opacity: .45; text-decoration: line-through; }
.tally-row.out .tally-bar span { background: var(--muted); }

/* ── Misc ───────────────────────────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat b { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 14px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.divider { height: 1px; background: var(--line); }
.linkish { color: var(--accent); text-decoration: none; cursor: pointer; font-weight: 500; }
.linkish:hover { text-decoration: underline; }
.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--line-strong); }

/* ── Auth ───────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 48px; align-items: center; padding: 40px 6vw; max-width: 1180px; margin: 0 auto;
}
.auth-pitch h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.1; margin: 22px 0 14px; max-width: 16ch;
}
.auth-pitch p { color: var(--ink-2); max-width: 46ch; }
.auth-points { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-width: 48ch; }
.auth-points li {
  font-size: 13.5px; color: var(--muted); padding-left: 15px; position: relative; line-height: 1.5;
}
.auth-points li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}
.auth-points b { color: var(--ink); font-weight: 600; }

.auth-card { max-width: 400px; width: 100%; }
.auth-tabs { display: flex; gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth-tab {
  border: 0; background: none; padding: 8px 2px; margin-right: 18px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.auth-tab:hover { color: var(--ink); }
.auth-error {
  background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}

.profile-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; text-align: left; font-size: 13.5px;
}
.profile-row:hover { border-color: var(--accent-line); background: var(--accent-soft); }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; gap: 28px; padding: 32px 20px; align-content: start; }
  .auth-card { max-width: none; }
  .auth-points { display: none; }
}

/* ── Onboarding wizard ──────────────────────────────────────────────────── */
.wizard { max-width: 660px; margin: 0 auto; padding: 30px 0 60px; }
.wizard .lede { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 58ch; }
.wizard-progress { position: sticky; top: 10px; z-index: 5; }
.wizard-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wizard-bar { display: flex; flex-direction: column; gap: 4px; }

.wizard-card h2 { font-size: 1.6rem; }
.wizard-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.wizard-opinions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wizard-choice {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 11px 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; transition: background .12s, border-color .12s, color .12s;
}
.wizard-choice:hover { border-color: currentColor; }
.wizard-choice.love:hover, .wizard-choice.yes:hover { color: var(--good); background: var(--good-soft); }
.wizard-choice.no:hover, .wizard-choice.avoid:hover { color: var(--bad); background: var(--bad-soft); }
.wizard-choice.love { font-weight: 600; }
.wizard-skip { width: 100%; color: var(--muted); }

@media (min-width: 620px) {
  .wizard-actions { flex-direction: row-reverse; align-items: stretch; }
  .wizard-opinions { flex: 1; grid-template-columns: repeat(4, 1fr); }
  .wizard-skip { width: auto; flex: 0 0 116px; }
}

.rail-nudge {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm); padding: 9px 11px;
}
.rail-nudge b { color: var(--accent); font-size: 12.5px; }
.rail-nudge span { color: var(--ink-2); font-size: 11.5px; line-height: 1.4; }
.rail-account { display: flex; flex-direction: column; gap: 1px; padding: 0 2px; }

/* ── Offers & coupons ───────────────────────────────────────────────────── */
.offer-card.locked { opacity: .72; }
.offer-card.eligible { border-color: var(--accent-line); }
.offer-value {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px;
}
.offer-value b { font-family: var(--display); font-size: 1.05rem; }
.offer-save {
  font: 600 11px/1 var(--body); letter-spacing: .04em; text-transform: uppercase;
  color: var(--good); white-space: nowrap;
}
.offer-checks { display: flex; flex-direction: column; gap: 4px; }
.check { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; }
.check span:first-child { font-family: var(--mono); width: 12px; flex: none; }
.check.ok { color: var(--ink-2); }
.check.ok span:first-child { color: var(--good); }
.check.no { color: var(--muted); }
.check.no span:first-child { color: var(--bad); }

.coupon.spent { opacity: .6; }
.coupon-qr {
  display: grid; place-items: center; padding: 12px; background: #fff;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.coupon-qr svg { width: 168px; height: 168px; display: block; }
.coupon-code {
  text-align: center; font-size: 20px; letter-spacing: .16em; font-weight: 600;
  padding: 7px; background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
}

/* ── Tabs, settings rows, choices ───────────────────────────────────────── */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  border: 0; background: none; padding: 9px 0; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab:hover { color: var(--ink); }

.setting-row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.setting-row:first-of-type { border-top: 0; }
.setting-control { min-width: 150px; display: flex; justify-content: flex-end; }
@media (max-width: 600px) {
  .setting-row { grid-template-columns: 1fr; gap: 8px; }
  .setting-control { justify-content: flex-start; }
}

.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.toggle-row input { width: 16px; height: 16px; accent-color: var(--accent); }

.choice-row {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left;
  padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
}
.choice-row:hover:not(:disabled) { border-color: var(--line-strong); }
.choice-row.on { border-color: var(--accent); background: var(--accent-soft); }
.choice-row:disabled { opacity: .5; cursor: not-allowed; }
.choice-dot {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line-strong);
  flex: none; margin-top: 2px;
}
.choice-row.on .choice-dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }

/* ── Star pickers & facet scorecards ────────────────────────────────────── */
.stars { display: inline-flex; gap: 1px; }
.star {
  border: 0; background: none; cursor: pointer; padding: 1px 2px;
  font-size: 21px; line-height: 1; color: var(--line-strong);
  transition: color .1s, transform .08s;
}
.star:hover { transform: scale(1.15); }
.star.on { color: var(--warn); }
.stars-static { color: var(--warn); font-size: 14px; letter-spacing: 1px; }
.facet-row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; }
.facet-row > label { font-size: 13px; color: var(--ink-2); }
.facet-chip {
  display: inline-flex; gap: 6px; align-items: baseline;
  background: var(--stripe); border-radius: 999px; padding: 3px 10px; font-size: 11.5px;
}
.facet-chip b { color: var(--ink); }
.facet-chip .stars-static { font-size: 11px; }

/* ── Ad slot ─────────────────────────────────────────────────────────────── */
.ad-slot {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 14px; text-align: center; margin: 14px 0;
  background: var(--stripe);
}
.ad-slot .ad-label {
  font: 600 9px/1 var(--body); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); display: block; margin-bottom: 6px;
}
.ad-slot ins { display: block; min-height: 90px; }

/* ── Venue picker ───────────────────────────────────────────────────────── */
.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.venue-card {
  display: flex; gap: 10px; align-items: center; text-align: left; cursor: pointer;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.venue-card:hover { border-color: var(--line-strong); }
.venue-card.on { border-color: var(--accent); background: var(--accent-soft); }
.venue-icon { font-size: 26px; line-height: 1; flex: none; }
.venue-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.venue-meta b { font-size: 13.5px; }

/* Restaurant icon shown alongside names in lists and cards. */
.r-icon { font-size: 20px; line-height: 1; margin-right: 6px; }
.r-thumb {
  width: 100%; height: 132px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--line); display: block;
}

/* ── Table-side redemption ──────────────────────────────────────────────── */
.redeem-panel { max-width: 520px; }
.scan-btn { padding: 15px; font-size: 15px; font-weight: 600; }
#scan-video { width: 100%; max-height: 260px; border-radius: var(--radius); background: #000; object-fit: cover; }

.verify-panel {
  border-radius: var(--radius); padding: 18px; margin-top: 12px;
  display: flex; flex-direction: column; gap: 9px; text-align: center;
  border: 2px solid transparent;
}
.verify-panel.ok { background: var(--good-soft); border-color: var(--good); }
.verify-panel.done { background: var(--good-soft); border-color: var(--good); }
.verify-panel.bad { background: var(--bad-soft); border-color: var(--bad); }
.verify-verdict {
  font: 700 15px/1 var(--body); letter-spacing: .08em; text-transform: uppercase;
}
.verify-panel.ok .verify-verdict, .verify-panel.done .verify-verdict { color: var(--good); }
.verify-panel.bad .verify-verdict { color: var(--bad); }
.verify-amount {
  font-family: var(--mono); font-size: 42px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.verify-panel .row { justify-content: center; }

/* ── Palette picker ─────────────────────────────────────────────────────── */
.palette-row { display: flex; gap: 10px; flex-wrap: wrap; }
.palette-swatch {
  display: flex; align-items: center; gap: 8px; padding: 8px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: 13px;
}
.palette-swatch.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.palette-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px;
  font-size: 13px; z-index: 90; box-shadow: var(--shadow); animation: rise .25s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

.modal-scrim {
  position: fixed; inset: 0; background: rgba(20,14,18,.5); z-index: 80;
  display: grid; place-items: center; padding: 18px; overflow-y: auto;
}
.modal { background: var(--surface); border-radius: 12px; border: 1px solid var(--line); max-width: 560px; width: 100%; box-shadow: var(--shadow); }

canvas { display: block; max-width: 100%; }

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