:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}[hidden]{display:none!important}img{max-width:100%}

/* Layout: phone-first app shell. Sticky header, one scrolling column, fixed bottom tab bar; content caps at 720px on wide screens. */
:root {
  --ts: 1.125; /* v2.5: text size for every screen (1 = original). One number to tune. */
  --bg: #f3eee2;          /* day shift: linen under warm bar light */
  --surface: #fffdf7;
  --surface-2: #ece5d4;
  --fg: #1a211d;
  --muted: #595e54;
  --line: #dcd2bc;
  --accent: #86500f;      /* brass */
  --accent-fg: #ffffff;
  --bottle: #1b5540;      /* bottle green */
  --bottle-fg: #fffaf0;
  --bar-bg: #0e1814;      /* the back bar stays ink in both themes */
  --bar-fg: #f3ead6;
  --good: #1f6f45;
  --good-bg: #e0efdf;
  --bad: #a8321f;
  --bad-bg: #f7e1d9;
  --warn-bg: #f7ead0;
  --shadow: 0 1px 2px rgba(40, 30, 12, .08), 0 6px 18px rgba(40, 30, 12, .07);
  --shadow-lift: 0 2px 4px rgba(40, 30, 12, .10), 0 12px 28px rgba(40, 30, 12, .12);
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .8);
  --glow: rgba(196, 140, 50, .13);
  --hover-line: #c9a86a;

  /* speakeasy shell: ink, ivory and brass, identical in both themes */
  --shell-bg: #0e1814;
  --shell-bg-2: #172720;
  --shell-fg: #f3ead6;
  --shell-muted: #a9b4aa;
  --shell-accent: #dcb266;
  --shell-line: rgba(220, 178, 102, .30);
  --gold-1: #efd08e;
  --gold-2: #d6a852;
  --gold-3: #b8893a;
  --gold-fg: #1a1209;

  /* illustration tokens */
  --ink: #26352d;
  --glass: rgba(170, 205, 215, .30);
  --ice: rgba(255, 255, 255, .75);
  --metal: #d3d9da;
  --metal-2: #b9c2c4;
  --copper: #c9793f;
  --wood: #c9955c;
  --rubber: #3d4642;
  --liq-amber: #d08a2c;
  --liq-pale: #e9f0d6;
  --liq-clear: #eef5f4;
  --liq-pink: #eca3a0;
  --liq-lime: #cfe39a;
  --liq-orange: #f2a54a;
  --liq-gold: #f0c24b;
  --liq-hazy: #f3cf7a;
  --liq-stout: #2a1a12;
  --liq-wine: #7d1f33;
  --liq-white: #f3ecbc;
  --liq-coffee: #5a3520;
  --foam: #fbf6ea;
  --lime: #6aa83a;
  --lime-in: #c7e28f;
  --lemon: #f2cf2e;
  --lemon-in: #fbeb9d;
  --orange: #ee8a22;
  --orange-in: #f9c27a;
  --cherry: #b3182c;
  --olive: #8aa04a;
  --pimento: #d94a2e;
  --onion: #f4f0e2;
  --mint: #3f9a55;
  --celery: #a9cf73;
  --cuke: #3e7f3c;
  --cuke-in: #d8ecc0;
  --pine: #f6cf52;
  --rind: #9a7a2a;
  --bean: #5b3620;
  --salt: #ffffff;
  --flame: #3f7fe0;        /* torch flame (blue = clean burn) */
  --flame-in: #cfe6ff;
  --smoke: #9aa3a6;

  --font-display: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="frost"]):not([data-theme="gold"]):not([data-theme="neon"]):not([data-theme="clear"]) {
    --bg: #0b1210; --surface: #131d19; --surface-2: #1b2722; --fg: #f1ead9; --muted: #a9b4a9; --line: #2b3a33;
    --accent: #dcb266; --accent-fg: #17110a; --bottle: #7ccfa4; --bottle-fg: #06140e; --bar-bg: #0e1814; --bar-fg: #f3ead6;
    --good: #79d6a6; --good-bg: #15352a; --bad: #f19282; --bad-bg: #3a1c18; --warn-bg: #33280f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 22px rgba(0, 0, 0, .30);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 14px 32px rgba(0, 0, 0, .42), 0 0 0 1px rgba(220, 178, 102, .10);
    --card-hi: inset 0 1px 0 rgba(255, 240, 210, .05); --glow: rgba(220, 170, 90, .11); --hover-line: #6d5a36;
    --ink: #d7e3dc; --glass: rgba(150, 200, 215, .16); --ice: rgba(220, 240, 245, .35);
    --metal: #7d8a8d; --metal-2: #626f72; --copper: #b8703c; --wood: #9c7446; --rubber: #2b3230;
    --liq-pale: #b9c79a; --liq-clear: #9fb4b1; --liq-white: #cfc58e; --foam: #e9e1cc; --onion: #d9d3c0; --salt: #f2f2f2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1210; --surface: #131d19; --surface-2: #1b2722; --fg: #f1ead9; --muted: #a9b4a9; --line: #2b3a33;
  --accent: #dcb266; --accent-fg: #17110a; --bottle: #7ccfa4; --bottle-fg: #06140e; --bar-bg: #0e1814; --bar-fg: #f3ead6;
  --good: #79d6a6; --good-bg: #15352a; --bad: #f19282; --bad-bg: #3a1c18; --warn-bg: #33280f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 22px rgba(0, 0, 0, .30);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 14px 32px rgba(0, 0, 0, .42), 0 0 0 1px rgba(220, 178, 102, .10);
  --card-hi: inset 0 1px 0 rgba(255, 240, 210, .05); --glow: rgba(220, 170, 90, .11); --hover-line: #6d5a36;
  --ink: #d7e3dc; --glass: rgba(150, 200, 215, .16); --ice: rgba(220, 240, 245, .35);
  --metal: #7d8a8d; --metal-2: #626f72; --copper: #b8703c; --wood: #9c7446; --rubber: #2b3230;
  --liq-pale: #b9c79a; --liq-clear: #9fb4b1; --liq-white: #cfc58e; --foam: #e9e1cc; --onion: #d9d3c0; --salt: #f2f2f2;
  color-scheme: dark;
}

/* Gold: a warm golden-hour light look (honey-gold bar, cream and gold cards, bronze buttons); picked from Home */
:root[data-theme="gold"] {
  --bg: #f7ecd2; --surface: #fffaf0; --surface-2: #f1e2bf; --fg: #2a1d08; --muted: #6b5528; --line: #e2cd9c;
  --accent: #7a4e00; --accent-fg: #ffffff; --bottle: #5a3a06; --bottle-fg: #fff6dd; --bar-bg: #e3b03b; --bar-fg: #2a1d08;
  --good: #1f6a3c; --good-bg: #e2f0d9; --bad: #a3301c; --bad-bg: #f8e0d4; --warn-bg: #fbe7b5;
  --shadow: 0 1px 2px rgba(80, 55, 5, .10), 0 6px 18px rgba(80, 55, 5, .09);
  --shadow-lift: 0 2px 4px rgba(80, 55, 5, .12), 0 12px 28px rgba(80, 55, 5, .16);
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .85); --glow: rgba(230, 170, 40, .22); --hover-line: #d4aa55;
  --shell-bg: #e3b03b; --shell-bg-2: #f2cd6a; --shell-fg: #2a1d08; --shell-muted: #4a3610; --shell-accent: #5a1f00;
  --shell-line: rgba(90, 58, 6, .30);
  --gold-1: #8a5d10; --gold-2: #6e4a0c; --gold-3: #553806; --gold-fg: #fff6dd;
  color-scheme: light;
}

/* Neon: a dark nightclub look (deep purple-black, hot pink and cyan glow); picked from Home */
:root[data-theme="neon"] {
  --bg: #120b1f; --surface: #1c1230; --surface-2: #261a3f; --fg: #f5ecff; --muted: #b9a8d6; --line: #3a2b58;
  --accent: #ff5fc8; --accent-fg: #1a0618; --bottle: #2fe6e0; --bottle-fg: #04161a; --bar-bg: #0d0817; --bar-fg: #f5ecff;
  --good: #5ff0a8; --good-bg: #10301f; --bad: #ff7a8a; --bad-bg: #3a1222; --warn-bg: #3a2410;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 22px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 14px 32px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 95, 200, .18);
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .04); --glow: rgba(255, 95, 200, .16); --hover-line: #6b3f8f;
  --shell-bg: #0d0817; --shell-bg-2: #1a0f2e; --shell-fg: #f5ecff; --shell-muted: #a99bc4; --shell-accent: #ff5fc8;
  --shell-line: rgba(255, 95, 200, .35);
  --gold-1: #ff8ad8; --gold-2: #ff5fc8; --gold-3: #c94dff; --gold-fg: #1a0618;
  --ink: #e4dcf2; --glass: rgba(170, 150, 230, .16); --ice: rgba(225, 220, 250, .35);
  --metal: #8a84a0; --metal-2: #6c6684; --copper: #b8703c; --wood: #9c7446; --rubber: #2e2838;
  --liq-pale: #b9c79a; --liq-clear: #a9b0c8; --liq-white: #cfc58e; --foam: #ece3f2; --onion: #dcd4e2; --salt: #f2f2f2;
  color-scheme: dark;
}

/* Frost: a cool, light look (icy blue-white, steel accents); picked from Home, overrides the phone setting */
:root[data-theme="frost"] {
  --bg: #edf3f8; --surface: #ffffff; --surface-2: #e2ebf3; --fg: #13212d; --muted: #4c5e6e; --line: #cddae5;
  --accent: #1f5f8f; --accent-fg: #ffffff; --bottle: #0f6466; --bottle-fg: #ffffff; --bar-bg: #e9f1f7; --bar-fg: #13212d;
  --good: #1d6e47; --good-bg: #ddf0e5; --bad: #ad3128; --bad-bg: #f9e1df; --warn-bg: #f6efdc;
  --shadow: 0 1px 2px rgba(20, 45, 70, .07), 0 6px 18px rgba(20, 45, 70, .07);
  --shadow-lift: 0 2px 4px rgba(20, 45, 70, .09), 0 12px 28px rgba(20, 45, 70, .12);
  --card-hi: inset 0 1px 0 rgba(255, 255, 255, .9); --glow: rgba(90, 160, 215, .17); --hover-line: #8db4d2;
  --shell-bg: #e9f1f7; --shell-bg-2: #f8fbfd; --shell-fg: #13212d; --shell-muted: #4c5e6e; --shell-accent: #1f5f8f;
  --shell-line: rgba(31, 95, 143, .22);
  --gold-1: #d6edfb; --gold-2: #a2d1ef; --gold-3: #6aaed9; --gold-fg: #0b1a26;
  color-scheme: light;
}

/* v2.6 Clear: GitHub's light color system (Primer) for easy reading; the default look. White cards on a soft gray page,
   near-black text, blue accent, green primary buttons, system fonts. Overrides the phone's dark setting, like Frost. */
:root[data-theme="clear"] {
  --bg: #f6f8fa; --surface: #ffffff; --surface-2: #eff2f5; --fg: #1f2328; --muted: #59636e; --line: #d1d9e0;
  --accent: #0969da; --accent-fg: #ffffff; --bottle: #0550ae; --bottle-fg: #ffffff; --bar-bg: #ffffff; --bar-fg: #1f2328;
  --good: #1a7f37; --good-bg: #dafbe1; --bad: #d1242f; --bad-bg: #ffebe9; --warn-bg: #fff8c5;
  --shadow: 0 1px 0 rgba(31, 35, 40, .04), 0 1px 3px rgba(31, 35, 40, .08);
  --shadow-lift: 0 3px 6px rgba(140, 149, 159, .15), 0 8px 24px rgba(140, 149, 159, .20);
  --card-hi: inset 0 0 0 0 transparent; --glow: rgba(9, 105, 218, .10); --hover-line: #8c959f;
  --shell-bg: #ffffff; --shell-bg-2: #ffffff; --shell-fg: #1f2328; --shell-muted: #59636e; --shell-accent: #0969da;
  --shell-line: #d1d9e0;
  --gold-1: #1f883d; --gold-2: #1a7f37; --gold-3: #116329; --gold-fg: #ffffff;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: calc(16px * var(--ts)); line-height: 1.5;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--bar-bg); color: var(--bar-fg);
  padding: 10px 16px; display: flex; align-items: center; gap: 10px; min-height: 56px;
}
.topbar .back {
  background: transparent; border: 0; color: inherit; padding: 6px 8px 6px 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-weight: 600;
}
.topbar .back svg { width: 22px; height: 22px; }
.topbar .back { font-size: 16px; } /* v2.5: header stays its original size so screen titles keep their room */
.topbar .back.home-btn { padding-left: 4px; flex: none; } /* v2.6: Home button beside Back on the main screens */
.topbar .back.home-btn svg { width: 20px; height: 20px; }
@media (max-width: 419px) { .topbar .back.home-btn .home-word { display: none; } .topbar .back.home-btn { padding-right: 6px; } } /* narrow phones: house icon only, so the gear and streak still fit */
.brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: calc(12px * var(--ts)); opacity: .8; letter-spacing: .04em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.streak { font-size: calc(13px * var(--ts)); font-weight: 600; background: rgba(255, 255, 255, .16); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + var(--ad-h, 0px) + 28px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 18px; }
main > * { min-width: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); /* v2.4: + Stock, equal widths; v2.6: More moved to Home; v2.6.3: + Print */
}
.tabbar button {
  height: var(--nav-h); background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: min(calc(12px * var(--ts)), 3.8vw); font-weight: 600; color: var(--muted); /* v2.5: larger labels, never wider than 7 tabs allow (>= 12px at 320) */
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--bottle); }
.tabbar button[aria-current="page"] svg { stroke-width: 2.4; }

/* ---------- common ---------- */
.eyebrow { font-size: calc(12px * var(--ts)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.h-page { font-size: calc(28px * var(--ts)); font-weight: 800; letter-spacing: -.02em; }
.h-sec { font-size: calc(20px * var(--ts)); font-weight: 700; }
.lede { color: var(--muted); max-width: 62ch; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg);
  border-radius: 99px; padding: 10px 18px; font-weight: 700; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.legend .mastery-dot { display: inline-block; }
.btn.primary { background: var(--bottle); border-color: var(--bottle); color: var(--bottle-fg); }
.btn.brass { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.good { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.btn.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--bottle); border-radius: inherit; transition: width .4s; }

/* ---------- home ---------- */
.hero {
  background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow);
  display: grid; gap: 12px;
}
.hero-row { display: flex; gap: 14px; align-items: center; }
.hero-row .dial { flex: none; width: 76px; height: 76px; }
.hero-row .dial text { font-family: var(--font-display); font-weight: 800; fill: var(--fg); }
.hero-row .dial .track { stroke: var(--surface-2); }
.hero-row .dial .val { stroke: var(--bottle); transition: stroke-dasharray .6s; }
.hero .stats { font-size: calc(14px * var(--ts)); color: var(--muted); }
.hero .stats b { color: var(--fg); font-variant-numeric: tabular-nums; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px; text-align: left; cursor: pointer; display: grid; gap: 8px; align-content: start;
}
.tile:hover { border-color: var(--bottle); }
.tile .thumb { width: 56px; height: 56px; }
.tile .glyph {
  width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: calc(20px * var(--ts)); color: var(--bottle);
}
.tile h3 { font-size: calc(16px * var(--ts)); font-weight: 700; }
.tile .count { font-size: calc(12px * var(--ts)); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- section ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: 99px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 99px; padding: 9px 4px; font-weight: 700; cursor: pointer; color: var(--muted); min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

.item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.item > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px;
}
.item > summary::-webkit-details-marker { display: none; }
.item .thumb { width: 52px; height: 52px; background: var(--surface-2); border-radius: 10px; }
.item .thumb.txt { display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: var(--bottle); font-size: calc(18px * var(--ts)); }
.item h3 { font-size: calc(16px * var(--ts)); font-weight: 700; }
.item .sum { font-size: calc(14px * var(--ts)); color: var(--muted); }
.item .chev { width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.item[open] .chev { transform: rotate(180deg); }
.item .body { padding: 0 14px 14px; display: grid; gap: 10px; }
.item .big-art { width: 100%; max-width: 220px; aspect-ratio: 1; margin: 0 auto; background: var(--surface-2); border-radius: var(--r-md); }
.item ul, .detail ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.mastery-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--surface-2); border: 1.5px solid var(--line); flex: none; }
.mastery-dot.l1 { background: var(--warn-bg); border-color: var(--accent); }
.mastery-dot.l2 { background: var(--good-bg); border-color: var(--good); }
.mastery-dot.l3 { background: var(--good); border-color: var(--good); }

.note { background: var(--warn-bg); border-radius: var(--r-md); padding: 12px 14px; font-size: calc(14px * var(--ts)); }
.sources { font-size: calc(14px * var(--ts)); display: grid; gap: 6px; }
.sources a { color: var(--bottle); font-weight: 600; word-break: break-word; }

/* ---------- flashcards ---------- */
.fc-wrap { perspective: 1200px; }
.fc {
  position: relative; width: 100%; cursor: pointer; border: 0; padding: 0; background: none;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .7, .2, 1); display: grid; text-align: left;
}
.fc.flipped { transform: rotateY(180deg); }
.fc .face {
  grid-area: 1 / 1; min-height: 380px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.fc .back { transform: rotateY(180deg); }
.fc .face .art { width: 190px; height: 190px; margin: 4px auto 0; flex: none; }
.fc .face .q { font-family: var(--font-display); font-size: calc(22px * var(--ts)); font-weight: 700; text-align: center; margin: auto 0; }
.fc .face .hint { text-align: center; font-size: calc(13px * var(--ts)); color: var(--muted); margin-top: auto; }
.fc .face h3 { font-size: calc(22px * var(--ts)); }
.fc-bar { display: flex; justify-content: space-between; align-items: center; font-size: calc(14px * var(--ts)); color: var(--muted); font-variant-numeric: tabular-nums; }
.fc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- quiz ---------- */
.quiz-card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.quiz-card > .art { width: 160px; height: 160px; margin: 0 auto; }
.quiz-card .qtext { font-family: var(--font-display); font-size: calc(20px * var(--ts)); font-weight: 700; }
.opts { display: grid; gap: 10px; }
.opt {
  text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md);
  padding: 12px 14px; cursor: pointer; min-height: 48px; font-size: calc(15px * var(--ts)); line-height: 1.35;
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start;
}
.opt .k { width: 26px; height: 26px; border-radius: 99px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: calc(13px * var(--ts)); }
.opt:hover:not(:disabled) { border-color: var(--bottle); }
.opt.correct { border-color: var(--good); background: var(--good-bg); }
.opt.correct .k { background: var(--good); color: var(--surface); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .k { background: var(--bad); color: var(--surface); }
.opt:disabled { cursor: default; }
.feedback { border-radius: var(--r-md); padding: 12px 14px; font-size: calc(15px * var(--ts)); }
.feedback.ok { background: var(--good-bg); }
.feedback.no { background: var(--bad-bg); }
.feedback b { display: block; margin-bottom: 2px; }
.progress-line { display: flex; justify-content: space-between; font-size: calc(14px * var(--ts)); color: var(--muted); font-variant-numeric: tabular-nums; }
.score-big { font-family: var(--font-display); font-size: calc(56px * var(--ts)); font-weight: 800; color: var(--bottle); line-height: 1; font-variant-numeric: tabular-nums; }

.modes { display: grid; gap: 12px; }
.mode {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; cursor: pointer; text-align: left;
}
.mode:hover { border-color: var(--bottle); }
.mode .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--bottle); }
.mode .ic svg { width: 26px; height: 26px; }
.mode h3 { font-size: calc(16px * var(--ts)); font-weight: 700; }
.mode p { font-size: calc(14px * var(--ts)); color: var(--muted); }
.pill { font-size: calc(12px * var(--ts)); font-weight: 800; padding: 4px 9px; border-radius: 99px; background: var(--accent); color: var(--accent-fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.quiet { background: var(--surface-2); color: var(--muted); }

/* build-the-drink */
.build-step { display: grid; gap: 8px; }
.build-step h4 { margin: 0; font-size: calc(13px * var(--ts)); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: calc(14px * var(--ts)); min-height: 40px;
}
.chip[aria-pressed="true"] { border-color: var(--bottle); background: var(--bottle); color: var(--bottle-fg); }
.chip.correct { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.chip.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.glass-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.glass-pick {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 6px 4px; cursor: pointer;
  display: grid; justify-items: center; gap: 2px; font-size: calc(11px * var(--ts)); font-weight: 600; line-height: 1.2; text-align: center;
}
.glass-pick svg { width: 52px; height: 52px; }
.glass-pick[aria-pressed="true"] { border-color: var(--bottle); box-shadow: inset 0 0 0 2px var(--bottle); }
.glass-pick.correct { border-color: var(--good); background: var(--good-bg); }
.glass-pick.wrong { border-color: var(--bad); background: var(--bad-bg); }

/* ---------- drinks ---------- */
.search {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 99px;
  padding: 11px 16px; font: inherit; min-height: 46px;
}
.filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filter .chip { flex: none; }
.drink-list { display: grid; gap: 10px; }
.drink-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center;
}
.drink-row svg { width: 52px; height: 52px; }
.drink-row h3 { font-size: calc(16px * var(--ts)); font-weight: 700; }
.drink-row p { font-size: calc(13px * var(--ts)); color: var(--muted); }
.detail { display: grid; gap: 16px; }
.detail-head { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; }
.detail-head svg { width: 120px; height: 120px; background: var(--surface-2); border-radius: var(--r-md); }
.detail-head .h-page { font-size: clamp(calc(22px * var(--ts)), calc(7.5vw * var(--ts)), calc(28px * var(--ts))); overflow-wrap: anywhere; }
@media (max-width: 360px) { .detail-head { grid-template-columns: 88px minmax(0, 1fr); } .detail-head svg { width: 88px; height: 88px; } }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.fact span { display: block; font-size: calc(11px * var(--ts)); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.fact b { font-size: calc(15px * var(--ts)); }
.spec { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-md); overflow: hidden; }
.spec td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec tr:last-child td { border-bottom: 0; }
.spec td:first-child { font-family: var(--font-mono); font-size: calc(14px * var(--ts)); color: var(--accent); font-weight: 600; white-space: nowrap; width: 1%; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.steps li::marker { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }

/* ---------- progress ---------- */
.prog-list { display: grid; gap: 10px; }
.prog-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 8px; }
.prog-row .top { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.prog-row .top span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; font-size: calc(14px * var(--ts)); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: calc(13px * var(--ts)); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.confirm { background: var(--bad-bg); border-radius: var(--r-md); padding: 14px; display: grid; gap: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--ad-h, 0px) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 600; font-size: calc(14px * var(--ts)); z-index: 40;
  max-width: calc(100% - 32px);
}

/* ---------- illustration classes ---------- */
svg.art { display: block; }
.art .ln { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.art .ln.thin { stroke-width: 1.2; }
.art .gl { fill: var(--glass); stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.art .ic { fill: var(--ice); stroke: var(--ink); stroke-width: 1.2; }
.art .bub { fill: var(--ice); }
.art .fz { fill: var(--foam); }
.art .mt { fill: var(--metal); }
.art .mt2 { fill: var(--metal-2); }
.art .cu { fill: var(--copper); }
.art .wd { fill: var(--wood); }
.art .rubber { fill: var(--rubber); }
.art .shine { fill: none; stroke: var(--ice); stroke-width: 3; stroke-linecap: round; }
.art .frost { fill: none; stroke: var(--ice); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 5; }
.art .hole { fill: var(--ink); }
.art .coil { fill: none; stroke: var(--ink); stroke-width: 2; }
.art .twist { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.art .cut { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .5; }
.art .grain { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .35; }
.art .mesh { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .6; }
.art .mesh-fill { fill: var(--glass); }
.art .lbl { fill: var(--ink); font: 700 9px var(--font-body); }
.art .bottle { fill: var(--glass); }
.art .label { fill: var(--foam); stroke: var(--ink); stroke-width: 1.2; }
.art .press { fill: var(--lemon); stroke: var(--ink); stroke-width: 1.4; }
.art .peel { fill: none; stroke: var(--lemon); stroke-width: 5; stroke-linecap: round; }
.art .peel-thick { fill: none; stroke-width: 10; stroke-linecap: round; }
.art .lemon-stroke { stroke: var(--lemon); }
.art .lq-amber { fill: var(--liq-amber); } .art .lq-pale { fill: var(--liq-pale); } .art .lq-clear { fill: var(--liq-clear); }
.art .lq-pink { fill: var(--liq-pink); } .art .lq-lime { fill: var(--liq-lime); } .art .lq-orange { fill: var(--liq-orange); }
.art .lq-gold { fill: var(--liq-gold); } .art .lq-hazy { fill: var(--liq-hazy); } .art .lq-stout { fill: var(--liq-stout); }
.art .lq-wine { fill: var(--liq-wine); } .art .lq-white { fill: var(--liq-white); } .art .lq-coffee { fill: var(--liq-coffee); }
.art .lime { fill: var(--lime); } .art .lime-in { fill: var(--lime-in); }
.art .lemon { fill: var(--lemon); stroke: var(--ink); stroke-width: 1.2; } .art .lemon-in { fill: var(--lemon-in); }
.art .orange { fill: var(--orange); } .art .orange-in { fill: var(--orange-in); }
.art .seg { fill: none; stroke: var(--foam); stroke-width: 1.6; }
.art .pith { fill: var(--foam); }
.art .cherry { fill: var(--cherry); }
.art .stem { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; }
.art .olive { fill: var(--olive); stroke: var(--ink); stroke-width: 1.4; }
.art .pimento { fill: var(--pimento); }
.art .onion { fill: var(--onion); stroke: var(--ink); stroke-width: 1.4; }
.art .pick { fill: none; stroke: var(--wood); stroke-width: 3; stroke-linecap: round; }
.art .mint { fill: var(--mint); stroke: var(--ink); stroke-width: 1; }
.art .vein { fill: none; stroke: var(--lime-in); stroke-width: 1; opacity: .8; }
.art .leaf { fill: none; stroke: var(--mint); stroke-width: 4; stroke-linecap: round; }
.art .celery { fill: var(--celery); }
.art .cuke { fill: var(--cuke); } .art .cuke-in { fill: var(--cuke-in); }
.art .seed { fill: var(--foam); stroke: var(--cuke); stroke-width: .8; }
.art .pine { fill: var(--pine); stroke: var(--ink); stroke-width: 1.2; } .art .rind { fill: var(--rind); }
.art .bean { fill: var(--bean); stroke: var(--ink); stroke-width: 1.2; }
.art .bean-line { fill: none; stroke: var(--foam); stroke-width: 1.6; opacity: .6; }
.art .salt { fill: var(--salt); stroke: var(--ink); stroke-width: .5; }
.art .sugar { fill: var(--salt); stroke: var(--ink); stroke-width: .4; }
.art .rim-salt { fill: none; stroke: var(--salt); stroke-width: 4; stroke-dasharray: 2 2; }
.art .dot { fill: var(--orange-in); }
.art .mist { fill: none; stroke: var(--orange); stroke-width: 1.4; stroke-dasharray: 1 4; stroke-linecap: round; }
.art .nub { fill: var(--metal-2); }
.art .flame { fill: var(--flame); }
.art .flame-in { fill: var(--flame-in); }
.art .smoke { fill: none; stroke: var(--smoke); stroke-width: 2.4; stroke-linecap: round; opacity: .7; }

/* ---------- ask ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.askbox {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 99px; padding: 5px 5px 5px 14px; box-shadow: var(--shadow);
}
.askbox:focus-within { border-color: var(--bottle); }
.askbox-ic { display: grid; place-items: center; color: var(--muted); flex: none; }
.askbox-ic svg { width: 20px; height: 20px; }
.askbox input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: calc(16px * var(--ts)); padding: 8px 0; outline: none;
}
.askbox input::-webkit-search-cancel-button { cursor: pointer; }
.askbox .btn { min-height: 40px; padding: 8px 16px; flex: none; }
.ask-results { display: grid; gap: 16px; }
.ask-examples .chip { text-align: left; }
.ans { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; min-width: 0; }
.ans-title { font-size: calc(24px * var(--ts)); font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ans-fix { font-size: calc(14px * var(--ts)); margin-top: -8px; }
.ans-lead { font-size: calc(17px * var(--ts)); }
.ans-arts { display: flex; gap: 8px; }
.ans-arts figure { margin: 0; flex: 1 1 0; min-width: 0; max-width: 160px; background: var(--surface-2); border-radius: var(--r-md); padding: 6px; display: grid; gap: 2px; justify-items: center; }
.ans-arts svg { width: 100%; max-width: 110px; aspect-ratio: 1; height: auto; }
.ans-arts figcaption { font-size: calc(12px * var(--ts)); font-weight: 700; text-align: center; color: var(--muted); }
.ans-bullets { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ans-group { display: grid; gap: 8px; min-width: 0; }
.ans-group h3 { margin: 0; }
.ans-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%;
}
.ans .ans-row { background: var(--bg); }
.ans-row:hover { border-color: var(--bottle); }
.ans-row svg { width: 48px; height: 48px; }
.ans-row .glyph { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: var(--bottle); font-size: calc(15px * var(--ts)); }
.ans-row h4 { margin: 0; font-size: calc(15px * var(--ts)); font-weight: 700; }
.ans-row p { font-size: calc(13px * var(--ts)); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.flash-hi { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.group-head { margin-top: 10px; }
.matrix-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.matrix { border-collapse: collapse; width: 100%; font-size: calc(14px * var(--ts)); }
.matrix th, .matrix td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.matrix thead th { font-size: calc(11px * var(--ts)); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.matrix tbody th { font-family: var(--font-display); font-size: calc(15px * var(--ts)); }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .matrix thead { display: none; }
  .matrix, .matrix tbody, .matrix tr, .matrix th, .matrix td { display: block; width: 100%; }
  .matrix tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .matrix tbody th { border-bottom: 0; padding-bottom: 0; }
  .matrix td { border-bottom: 0; padding-top: 6px; }
  .matrix td::before { content: attr(data-col); display: block; font-size: calc(11px * var(--ts)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
}

.seg2 { grid-template-columns: repeat(2, 1fr); }
.mix-picks { max-height: none; }
.chip.static { cursor: default; background: var(--surface-2); border-color: transparent; }
.mix-list { display: grid; gap: 10px; }
.mix-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; text-align: left; width: 100%; color: inherit; font: inherit;
}
.mix-card > svg { width: 56px; height: 56px; background: var(--surface-2); border-radius: 10px; }
.mix-card .mix-body { grid-column: auto; display: grid; gap: 6px; min-width: 0; }
.mix-card:not(:has(> svg)) { grid-template-columns: minmax(0, 1fr); }
.mix-card h3 { font-size: calc(16px * var(--ts)); font-weight: 700; margin: 0; }
.mix-card p { font-size: calc(14px * var(--ts)); }
.mix-card .btn { justify-self: start; min-height: 38px; padding: 6px 14px; }
.mix-combo { color: var(--accent); font-weight: 700; font-size: calc(13px * var(--ts)) !important; letter-spacing: .02em; }
.mix-card.warn { border-color: var(--bad); background: var(--bad-bg); }
.mix-food { cursor: pointer; }
.mix-food:hover { border-color: var(--bottle); }

.pill.zp { background: var(--good-bg); color: var(--good); font-size: calc(11px * var(--ts)); vertical-align: middle; }
/* v3.2 top 100 stars */
.top-star { display: inline-block; margin-left: 4px; color: var(--top-star, #9a6a00); font-size: .95em; line-height: 1; vertical-align: 1px; }
/* v3.3 popularity stars */
.pop-stars { color: var(--top-star, #9a6a00); letter-spacing: 1px; white-space: nowrap; font-size: .95em; }
.pop-stars .pop-off { color: inherit; } /* empty stars are outlines in the same color, so the count reads by shape, not a faint color */
.pill.pop-pill { background: var(--top-bg, #fdf1cf); color: var(--top-fg, #6b4a00); white-space: normal; max-width: 100%; line-height: 1.35; border-radius: 14px; }
.pill.pop-pill .pop-stars { color: inherit; } .pill.pop-pill .pop-off { color: inherit; }
.sort-row { align-items: center; gap: 8px; } .sort-row .eyebrow { margin-right: 2px; }
/* v3.3 Lab: ingredients that might not fit */
.lab-row.fit-bad { border-left: 4px solid var(--bad); padding-left: 8px; background: var(--bad-bg, #f8e0d4); border-radius: 10px; }
.lab-row.fit-bad .lab-ing-name { color: var(--bad); }
.lab-row.fit-bad .lab-ing .glyph { background: var(--bad); color: var(--bad-bg, #fff); }
.lab-fit { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: 16px 1fr; gap: 6px; font-size: calc(13px * var(--ts)); line-height: 1.35; }
.lab-fit > span:first-child { font-weight: 800; text-align: center; }
.lab-fit.fit-no { color: var(--bad); font-weight: 600; }
.lab-fit.fit-unk { color: var(--muted); }
.pill.top-pill { background: var(--top-bg, #fdf1cf); color: var(--top-fg, #6b4a00); }
:root[data-theme="dark"], :root[data-theme="neon"] { --top-star: #f2c14e; --top-bg: #3a2e10; --top-fg: #f6d47a; }
:root[data-theme="gold"] { --top-star: #8a5d10; --top-bg: #fbe7b5; --top-fg: #553806; } /* Gold is a light look */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="frost"]):not([data-theme="gold"]):not([data-theme="neon"]):not([data-theme="clear"]) { --top-star: #f2c14e; --top-bg: #3a2e10; --top-fg: #f6d47a; } }
/* v3.2 taste prediction */
.taste-card .pill.tp-great { background: var(--good-bg); color: var(--good); }
.taste-card .pill.tp-good { background: var(--surface-2); color: var(--accent); }
.taste-card .pill.tp-average { background: var(--warn-bg); color: var(--fg); }
.taste-card .pill.tp-bad { background: var(--bad-bg, #f6dcd5); color: var(--bad); }
.taste-card .pill.tp-unsure { background: var(--surface-2); color: var(--muted); }
.tp-meter { position: relative; height: 14px; margin: 12px 0 4px; border-radius: 99px; overflow: visible; }
.tp-zone { position: absolute; top: 3px; height: 8px; }
.tp-z-bad { background: var(--bad); opacity: .35; border-radius: 99px 0 0 99px; }
.tp-z-avg { background: #d9a43a; opacity: .45; }
.tp-z-good { background: var(--accent); opacity: .4; }
.tp-z-great { background: var(--good); opacity: .5; border-radius: 0 99px 99px 0; }
.tp-range { position: absolute; top: 0; height: 14px; border: 2px solid var(--fg); border-radius: 6px; box-sizing: border-box; opacity: .55; }
.tp-dot { position: absolute; top: -3px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--surface); border: 3px solid var(--fg); box-sizing: border-box; }
.tp-ends { display: grid; grid-template-columns: 45fr 20fr 15fr 20fr; font-size: calc(11px * var(--ts)); color: var(--muted); font-weight: 600; }
.tp-ends span:nth-child(n+2) { text-align: center; }
.tp-line { margin: 8px 0; font-size: calc(14px * var(--ts)); }
.tp-why { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: calc(14px * var(--ts)); }
.tp-why li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; }
.tp-why li > span:first-child { font-weight: 800; text-align: center; }
.tp-why li.ok > span:first-child { color: var(--good); }
.tp-why li.no > span:first-child { color: var(--bad); }
/* v3.5 Take it to Great */
.tp-boost { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; display: grid; gap: 8px; }
.tp-boost-h { margin: 0; font-size: calc(17px * var(--ts)); }
.tp-sub { margin: 2px 0 0; font-size: calc(13px * var(--ts)); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tp-needs { margin: 0; }
.tp-tip { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.tp-tip-what { margin: 0; font-weight: 700; font-size: calc(15px * var(--ts)); }
.tp-tip-why { margin: 2px 0 0; font-size: calc(13px * var(--ts)); color: var(--muted); }
.tp-tip-score { color: var(--good); white-space: nowrap; }
.tp-none { margin: 0; font-size: calc(14px * var(--ts)); }
.tp-applied { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--good-bg); color: var(--fg); font-size: calc(14px * var(--ts)); margin-top: 10px; }
.list-count { font-size: calc(13px * var(--ts)); }
.used-in { font-size: calc(12px * var(--ts)); color: var(--accent); font-weight: 700; }
.swap-item .body { gap: 8px; }
.swap { display: grid; gap: 2px; border-left: 3px solid var(--line); padding-left: 10px; }
.swap span { font-size: calc(11px * var(--ts)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.swap.eq { border-color: var(--bottle); }
.swap.up { border-color: var(--accent); }
.swap.pinch { border-color: var(--line); }

.tabbar button span { white-space: nowrap; }
/* ---------- lab ---------- */
.lab-tabs { gap: 6px; }
.lab-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.lab-card .h-sec { margin: 0; }
.chip.tmpl { display: grid; text-align: left; line-height: 1.2; padding: 8px 12px; flex: none; }
.chip.tmpl span { font-size: calc(11px * var(--ts)); font-weight: 600; color: var(--muted); }
.lab-rows { display: grid; gap: 8px; }
.lab-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.lab-row:last-child { border-bottom: 0; }
.lab-ing { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; min-width: 0; color: inherit; font: inherit; }
.lab-ing.static { cursor: default; }
.lab-ing .glyph, .creation .glyph { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: calc(13px * var(--ts)); color: var(--bottle); }
.lab-ing-name { font-weight: 600; font-size: calc(15px * var(--ts)); overflow-wrap: anywhere; }
.lab-ing-name small { color: var(--muted); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 99px; overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--surface-2); font-size: calc(20px * var(--ts)); font-weight: 700; cursor: pointer; color: var(--fg); }
.stepper .amt { min-width: 76px; text-align: center; font-family: var(--font-mono); font-size: calc(16px * var(--ts)); letter-spacing: -.03em; font-weight: 600; color: var(--accent); padding: 0 2px; }  /* v2.1.1: 16px (was 13px), same width as before so names keep their room */
/* v2.5: with larger text, phones give the ingredient name its own full line; stepper and remove sit below, right-aligned */
@media (max-width: 559px) {
  #lab-rows .lab-row .lab-ing { grid-column: 1 / -1; }
  #lab-rows .lab-row .stepper { grid-column: 2; }
}
.lab-x { width: 34px; height: 34px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-size: calc(18px * var(--ts)); cursor: pointer; color: var(--muted); }
.picker { border-color: var(--bottle); }
.pick-list { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.pick-group h4 { margin: 0 0 6px; }
.more-hint { font-size: calc(12px * var(--ts)); align-self: center; }
.lab-setup { display: grid; gap: 12px; }
.lab-setup .eyebrow { display: block; margin-bottom: 6px; }
select.search { appearance: auto; }
.meter-wrap { display: grid; gap: 6px; }
.bal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bal-label { font-family: var(--font-display); font-size: calc(18px * var(--ts)); }
.bal-balanced { color: var(--good); } .bal-tart, .bal-sweet, .bal-dry { color: var(--accent); } .bal-too-tart, .bal-too-sweet { color: var(--bad); }
.bal-track { position: relative; height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--bad-bg), var(--warn-bg) 25%, var(--good-bg) 40%, var(--good-bg) 65%, var(--warn-bg) 80%, var(--bad-bg)); border: 1px solid var(--line); }
.bal-track.dry { background: linear-gradient(90deg, var(--warn-bg), var(--good-bg) 20%, var(--good-bg) 45%, var(--warn-bg) 80%, var(--bad-bg)); }
.bal-dot { position: absolute; top: 50%; width: 20px; height: 20px; margin-left: -10px; transform: translateY(-50%); border-radius: 99px; background: var(--fg); border: 3px solid var(--surface); box-shadow: var(--shadow); transition: left .3s; }
.bal-ends { display: flex; justify-content: space-between; font-size: calc(12px * var(--ts)); color: var(--muted); }
.lab-facts .fact small { display: block; font-size: calc(12px * var(--ts)); color: var(--muted); line-height: 1.3; margin-top: 2px; }
.lab-warn { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lab-warn li { border-radius: var(--r-sm); padding: 8px 10px; font-size: calc(14px * var(--ts)); border-left: 4px solid var(--line); background: var(--surface-2); }
.lab-warn .w-bad { border-color: var(--bad); background: var(--bad-bg); }
.lab-warn .w-warn { border-color: var(--accent); background: var(--warn-bg); }
.lab-warn .w-info { border-color: var(--bottle); }
.lab-ok { color: var(--good); font-weight: 700; }
.lab-fine { font-size: calc(12px * var(--ts)); }
.lab-notes { border-radius: var(--r-md); resize: vertical; min-height: 80px; font: inherit; }
.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: 0; font-size: calc(26px * var(--ts)); line-height: 1; cursor: pointer; color: var(--line); padding: 2px; }
.star.on { color: var(--accent); }
.star:disabled { cursor: default; }
.pair-bars { display: grid; gap: 6px; }
.pair-bar { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 2.5rem; gap: 8px; align-items: center; background: none; border: 1px solid transparent; border-radius: var(--r-sm); padding: 4px 6px; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.pair-bar:hover, .pair-bar[aria-pressed="true"] { border-color: var(--bottle); background: var(--surface-2); }
.pb-name { font-size: calc(14px * var(--ts)); font-weight: 600; overflow-wrap: anywhere; }
.pb-track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pb-track span { display: block; height: 100%; background: var(--bottle); border-radius: 99px; }
.pb-n { font-family: var(--font-mono); font-size: calc(13px * var(--ts)); text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.riff-alts { padding: 4px 0 8px; }
.riff-result { border-color: var(--accent); }
.bar-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bar-stats div { background: var(--surface-2); border-radius: var(--r-md); padding: 10px; display: grid; }
.bar-stats b { font-family: var(--font-display); font-size: calc(26px * var(--ts)); color: var(--bottle); font-variant-numeric: tabular-nums; }
.bar-stats span { font-size: calc(12px * var(--ts)); color: var(--muted); }
.bar-group { border-top: 1px solid var(--line); padding: 8px 0; }
.bar-group summary { display: flex; justify-content: space-between; cursor: pointer; font-weight: 700; padding: 4px 0; list-style: none; }
.bar-group summary::-webkit-details-marker { display: none; }
.bar-group .chips { padding-top: 8px; }
.creation p { overflow-wrap: anywhere; }

/* ================= Speakeasy layer (visual only) =================
   Ink back-bar shell, brass accents, warm amber glow, serif headings, subtle motion.
   Everything below restyles existing classes; no markup or behaviour depends on it. */
body {
  background-color: var(--bg);
  background-image: radial-gradient(1100px 520px at 50% -240px, var(--glow), transparent 72%);
  background-repeat: no-repeat;
}
h1, h2, h3 { letter-spacing: -.005em; }

/* shell */
.topbar {
  background-color: var(--shell-bg);
  background-image: linear-gradient(180deg, var(--shell-bg-2), var(--shell-bg));
  color: var(--shell-fg);
  border-bottom: 1px solid var(--shell-line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.brand { font-weight: 700; font-size: 21px; letter-spacing: 0; }
.brand small { color: var(--shell-accent); opacity: 1; font-weight: 600; font-size: calc(11px * var(--ts)); letter-spacing: .16em; }
.streak { background: rgba(220, 178, 102, .12); color: var(--shell-accent); border: 1px solid var(--shell-line); }
.tabbar {
  background-color: var(--shell-bg);
  background-image: linear-gradient(0deg, var(--shell-bg), var(--shell-bg-2));
  border-top: 1px solid var(--shell-line);
  box-shadow: 0 -6px 22px rgba(0, 0, 0, .16);
}
.tabbar button { color: var(--shell-muted); position: relative; font-family: var(--font-ui); letter-spacing: .01em; transition: color .2s; }
.tabbar button[aria-current="page"] { color: var(--shell-accent); }
.tabbar button[aria-current="page"] svg { filter: drop-shadow(0 0 6px rgba(220, 178, 102, .45)); }
.tabbar button::after {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--shell-accent); opacity: 0; transform: scaleX(.3); transition: opacity .25s, transform .25s;
}
.tabbar button[aria-current="page"]::after { opacity: 1; transform: none; box-shadow: 0 0 10px rgba(220, 178, 102, .7); }

/* type */
.eyebrow { letter-spacing: .16em; font-size: calc(11.5px * var(--ts)); }
.h-page { font-weight: 700; font-size: calc(30px * var(--ts)); letter-spacing: -.01em; }
.h-sec { font-weight: 700; }
.ans-title { font-weight: 700; }

/* buttons */
.btn { transition: transform .15s ease, box-shadow .2s ease, border-color .2s, background-color .2s; }
.btn:hover:not(:disabled) { border-color: var(--hover-line); }
.btn.primary {
  background-color: var(--gold-2); border-color: var(--gold-3); color: var(--gold-fg);
  background-image: linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  box-shadow: inset 0 1px 0 rgba(255, 246, 220, .6), 0 2px 10px rgba(184, 137, 58, .28);
}
.btn.primary:hover:not(:disabled) { border-color: var(--gold-3); box-shadow: inset 0 1px 0 rgba(255, 246, 220, .6), 0 4px 16px rgba(184, 137, 58, .40); }
.btn.brass { background: var(--surface); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 0 transparent, var(--card-hi); }
.btn.brass:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }

/* progress: brass with a single gentle sheen */
.meter { background: var(--surface-2); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .12); }
.meter > span {
  position: relative; overflow: hidden;
  background-color: var(--gold-2); background-image: linear-gradient(90deg, var(--gold-3), var(--gold-2) 60%, var(--gold-1));
}
.meter > span::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 250, 230, .75) 50%, transparent 80%);
  transform: translateX(-120%); animation: bab-sheen 1.4s .45s ease-out 1 both;
}
@keyframes bab-sheen { to { transform: translateX(120%); } }

/* home hero: always the ink back bar, tokens re-scoped so everything inside adapts */
.hero {
  --surface: #172720; --surface-2: #22362d; --fg: #f3ead6; --muted: #b3bdb2; --line: #34493f;
  --accent: #dcb266; --accent-fg: #17110a; --bottle: #7ccfa4; --hover-line: #8a7141;
  background-color: var(--shell-bg);
  background-image:
    radial-gradient(420px 220px at 12% 0%, rgba(220, 170, 90, .22), transparent 70%),
    radial-gradient(360px 200px at 100% 100%, rgba(124, 207, 164, .10), transparent 70%),
    linear-gradient(160deg, var(--shell-bg-2), var(--shell-bg));
  color: var(--fg);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 240, 210, .06);
  position: relative; overflow: hidden;
}
.hero .h-sec { font-size: calc(22px * var(--ts)); }
.hero-row .dial .val { stroke: var(--shell-accent); filter: drop-shadow(0 0 4px rgba(220, 178, 102, .65)); }
.hero-row .dial .track { stroke: rgba(220, 178, 102, .16); }
.hero-row .dial text { font-variant-numeric: lining-nums tabular-nums; }

/* cards: warm surfaces, hairline highlight, lift on hover/tap */
.tile, .item, .mode, .drink-row, .mix-card, .prog-row, .lab-card, .ans-row, .quiz-card, .ans, .fact, .spec, .matrix-wrap {
  box-shadow: var(--shadow), var(--card-hi);
}
.tile, .mode, .drink-row, .ans-row, .mix-food, .opt, .chip, .glass-pick, .pair-bar {
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .2s ease, border-color .2s, background-color .2s;
}
.tile:hover, .mode:hover, .drink-row:hover, .ans-row:hover, .mix-food:hover {
  border-color: var(--hover-line); transform: translateY(-2px); box-shadow: var(--shadow-lift), var(--card-hi);
}
.tile:active, .mode:active, .drink-row:active, .ans-row:active, .mix-food:active, .opt:active:not(:disabled), .glass-pick:active { transform: translateY(0) scale(.985); }
.drink-row:hover, .mode:hover { border-color: var(--hover-line); }
.item > summary { transition: background-color .2s; }
.item > summary:hover { background: var(--surface-2); }
.item[open] { border-color: var(--hover-line); }

/* coaster icons */
.tile .thumb, .tile .glyph {
  border-radius: 50%; padding: 5px;
  background: radial-gradient(circle at 50% 38%, var(--surface), var(--surface-2) 72%);
  box-shadow: inset 0 0 0 1.5px var(--hover-line), inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--line);
}
.tile .glyph { color: var(--accent); font-size: calc(22px * var(--ts)); }
.mode .ic { border-radius: 50%; background: radial-gradient(circle at 50% 38%, var(--surface), var(--surface-2) 72%); box-shadow: inset 0 0 0 1.5px var(--hover-line); color: var(--accent); }
.ans-row .glyph, .lab-ing .glyph, .creation .glyph, .item .thumb.txt { color: var(--accent); }

/* flashcards: deco frame */
.fc .face {
  background-image: radial-gradient(420px 240px at 50% 0%, var(--glow), transparent 70%);
  outline: 1px solid var(--hover-line); outline-offset: -9px;
}
.fc .face .q, .fc .face h3 { letter-spacing: -.005em; }

/* quiz */
.opt .k { font-family: var(--font-display); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--hover-line); color: var(--accent); }
.opt:hover:not(:disabled) { border-color: var(--hover-line); }
.opt.correct .k { box-shadow: none; }
.opt.wrong .k { box-shadow: none; }
.score-big { color: var(--accent); font-variant-numeric: lining-nums tabular-nums; text-shadow: 0 0 22px var(--glow); }
.feedback { border-left: 4px solid transparent; }
.feedback.ok { border-left-color: var(--good); }
.feedback.no { border-left-color: var(--bad); }

/* selection and chips */
.chip:hover:not([aria-pressed="true"]):not(.static):not(.correct):not(.wrong) { border-color: var(--hover-line); }
.seg { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .10); }
.seg button { transition: background-color .2s, color .2s, box-shadow .2s; }
.seg button[aria-pressed="true"] { box-shadow: var(--shadow), inset 0 -2px 0 var(--accent); }

/* fields */
.search, .askbox { transition: border-color .2s, box-shadow .2s; }
.search:focus, .askbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow), var(--shadow); outline: none; }

/* notes, detail */
.note { border-left: 4px solid var(--accent); }
.detail-head svg, .item .big-art, .mix-card > svg { box-shadow: inset 0 0 0 1px var(--line); background-image: radial-gradient(circle at 50% 30%, var(--glow), transparent 70%); }
.spec td:first-child { letter-spacing: -.01em; }
.bar-stats div { box-shadow: var(--card-hi); }
.bar-stats b { color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.bal-dot { box-shadow: 0 0 0 1px var(--line), 0 0 10px var(--glow), var(--shadow); }
.pb-track span { background-color: var(--gold-2); background-image: linear-gradient(90deg, var(--gold-3), var(--gold-1)); }
.star.on { text-shadow: 0 0 10px var(--glow); }

.toast {
  background: var(--shell-bg); color: var(--shell-fg); border: 1px solid var(--shell-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: bab-toast .28s cubic-bezier(.2, .7, .2, 1) backwards;
}
@keyframes bab-toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* page entrance: plays only when the screen changes (render() adds .enter) */
main.enter > * { animation: bab-enter .34s cubic-bezier(.2, .7, .2, 1) backwards; }
main.enter > :nth-child(2) { animation-delay: .04s; }
main.enter > :nth-child(3) { animation-delay: .08s; }
main.enter > :nth-child(4) { animation-delay: .12s; }
main.enter > :nth-child(n+5) { animation-delay: .16s; }
@keyframes bab-enter { from { opacity: 0; transform: translateY(8px); } }

::selection { background: rgba(220, 178, 102, .35); }

/* ---------- v2.0: learning paths, Learn, Shift, floating Ask ---------- */
.path-list { display: grid; gap: 12px; }
@media (min-width: 640px) { .path-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.path-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; cursor: pointer; color: inherit; font: inherit;
  box-shadow: var(--shadow), var(--card-hi);
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .2s ease, border-color .2s;
}
.path-card:hover { border-color: var(--hover-line); transform: translateY(-2px); box-shadow: var(--shadow-lift), var(--card-hi); }
.path-card:active { transform: translateY(0) scale(.985); }
.path-card .thumb {
  width: 56px; height: 56px; border-radius: 50%; padding: 5px;
  background: radial-gradient(circle at 50% 38%, var(--surface), var(--surface-2) 72%);
  box-shadow: inset 0 0 0 1.5px var(--hover-line), inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--line);
}
.path-body { display: grid; gap: 6px; min-width: 0; }
.path-body h3 { font-size: calc(18px * var(--ts)); font-weight: 700; }
.path-body p { font-size: calc(14px * var(--ts)); color: var(--muted); }
.path-body .count { font-size: calc(12px * var(--ts)); color: var(--muted); font-variant-numeric: tabular-nums; }
.learn-group { margin-top: 4px; }

.shift-search { font-size: calc(18px * var(--ts)); min-height: 52px; }
.shift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .shift-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shift-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); color: var(--fg); font-weight: 700; font-size: calc(15px * var(--ts)); cursor: pointer;
  box-shadow: var(--shadow), var(--card-hi);
}
.shift-btn svg { width: 26px; height: 26px; color: var(--accent); }
.shift-btn:hover { border-color: var(--hover-line); }
.shift-btn:active { transform: scale(.97); }
.age-date { font-family: var(--font-display); font-size: clamp(28.5px, 9.3vw, calc(32px * var(--ts))); /* v2.5: larger, longest date still on one line at 320px */ font-weight: 700; color: var(--accent); line-height: 1.1; font-variant-numeric: lining-nums; }
.shift-id .eyebrow { font-size: clamp(14px, 3.7vw, calc(14px * var(--ts))); letter-spacing: .02em; } /* v2.5: larger, one line from 390px */  /* v2.1.1: bigger "21 or older" label on the ID check */
/* v2.2 welcome screen */
.welcome { display: grid; gap: 8px; }
.welcome-title { margin: 0; }
.welcome-tag { margin: 0; font-family: var(--font-display); font-size: calc(21px * var(--ts)); font-weight: 700; color: var(--accent); line-height: 1.25; }
.welcome-go { display: grid; gap: 8px; justify-items: center; text-align: center; }
.welcome-go .btn { min-width: 200px; justify-content: center; }
/* v2.6 logo on Home: always on its own white card so it looks as designed in every look */
.home-logo { margin: 0; background: #ffffff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 10px; display: grid; justify-items: center; }
.home-logo img { display: block; width: 100%; max-width: 300px; height: auto; }
.made-by { margin: 0; text-align: center; font-size: calc(13px * var(--ts)); }
.recipe-switch { margin-top: 4px; } /* v2.7 Cocktails | Shots */
.lab-glass-wrap { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; gap: 14px; align-items: center; } /* v2.8 Lab glass */
.lab-glass-svg { width: 100%; height: auto; max-width: 200px; max-height: 240px; justify-self: center; overflow: hidden; }
.lab-glass-svg .gl { fill: var(--glass); stroke: none; }
.lab-glass-svg .lg-outline { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.lab-glass-svg .lg-seam { stroke: rgba(40, 60, 70, .35); stroke-width: .5; stroke-dasharray: 1.5 1.5; }
.lab-glass-svg .lg-ice { stroke: rgba(255, 255, 255, .95); stroke-width: .7; } /* v2.9: fill comes from the ice gradient */
.lab-glass-svg .lg-full { stroke: var(--accent); stroke-width: 1.1; stroke-dasharray: 3 2.5; }
.lab-glass-svg .lg-full-t { fill: var(--accent); font: 700 6.5px var(--font-body); }
.lab-glass-svg .lg-spill { fill: none; stroke: var(--bad); stroke-width: 2.4; stroke-linecap: round; }
.lg-status { margin: 0 0 8px; font-size: calc(14px * var(--ts)); }
.lg-bad { color: var(--bad); }
.lg-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: calc(13px * var(--ts)); }
.lg-legend li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; }
.lg-legend i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: block; }
.lg-legend .lg-fruit-key { background: radial-gradient(circle at 35% 35%, #f26b7a 0 35%, #7cbf3a 36% 70%, transparent 71%); border: 0; }
.lg-legend b { font-weight: 600; white-space: nowrap; }
.lg-note { margin: 8px 0 0; font-size: calc(12px * var(--ts)); }
@media (max-width: 359px) { .lab-glass-wrap { grid-template-columns: 1fr; } }
/* v2.9 realistic glass */
.lab-glass-svg { --glass-edge: var(--ink); }
.lab-glass-svg .lg-back { fill: var(--glass); stroke: none; }
.lab-glass-svg .lg-solid { stroke: var(--ink); stroke-opacity: .55; stroke-width: .9; }
.lab-glass-svg .lg-rim-back { fill: none; stroke: var(--ink); stroke-opacity: .3; stroke-width: 1.1; }
.lab-glass-svg .lg-outline { stroke-width: 1.7; stroke-opacity: .85; }
.lab-glass-svg .lg-rim { fill: none; stroke: var(--ink); stroke-opacity: .85; stroke-width: 1.5; }
.lab-glass-svg .lg-rim-hi { fill: none; stroke: #fff; stroke-opacity: .85; stroke-width: .8; stroke-linecap: round; }
.lab-glass-svg .lg-edge-in { fill: none; stroke: #fff; stroke-opacity: .45; stroke-width: 3.2; }
.lab-glass-svg .lg-hi { opacity: .75; } .lab-glass-svg .lg-hi2 { opacity: .45; }
.lab-glass-svg .lg-ice-hi { fill: none; stroke: #fff; stroke-width: .8; stroke-linecap: round; opacity: .9; }
.lab-glass-svg .lg-surface { stroke: rgba(255, 255, 255, .6); stroke-width: .5; }
.lab-glass-svg .lg-bubble { fill: rgba(255, 255, 255, .75); stroke: rgba(255, 255, 255, .95); stroke-width: .2; }
.lab-glass-svg .lg-drop { fill: rgba(255, 255, 255, .7); stroke: rgba(60, 90, 100, .35); stroke-width: .22; }
.lab-glass-svg .lg-pick { stroke: #b8894a; stroke-width: 1.2; stroke-linecap: round; }
.lab-glass-svg .lg-pick-end { fill: #d0301e; }
.lab-glass-svg .lg-full-t { paint-order: stroke; stroke: var(--surface); stroke-width: 2.4px; stroke-linejoin: round; }
.lab-glass-svg .lg-slit { stroke: var(--ink); stroke-width: .6; opacity: .5; }
@media (max-width: 519px) { .lab-glass-wrap { grid-template-columns: 1fr; } .lab-glass-svg { max-width: 230px; max-height: 280px; } }
/* v2.9 ingredient wheel */
.wheel-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.wheel-tabs::-webkit-scrollbar { display: none; }
.wheel-tabs .chip { flex: none; white-space: nowrap; min-height: 36px; padding: 6px 12px; font-size: calc(13px * var(--ts)); }
.wheel { position: relative; height: 220px; perspective: 520px; border-radius: 14px; background: var(--surface-2); overflow: hidden; border: 1.5px solid var(--line); }
.wheel::before, .wheel::after { content: ''; position: absolute; left: 0; right: 0; height: 66px; z-index: 2; pointer-events: none; }
.wheel::before { top: 0; background: linear-gradient(var(--surface-2), transparent); }
.wheel::after { bottom: 0; background: linear-gradient(transparent, var(--surface-2)); }
.wheel-band { position: absolute; left: 8px; right: 8px; top: 88px; height: 44px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); pointer-events: none; }
.wheel-list.pick-list { display: block; position: relative; z-index: 1; height: 220px; max-height: none; overflow-y: auto; scroll-snap-type: y mandatory; padding: 88px 0; box-sizing: border-box; scrollbar-width: none; overscroll-behavior: contain; outline: none; }
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-list:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 12px; }
.wheel-item.chip { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; min-height: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: 0; background: none; scroll-snap-align: center;
  font-size: calc(16px * var(--ts)); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; backface-visibility: hidden; }
.wheel-item.chip:hover:not([aria-pressed="true"]) { background: none; border-color: transparent; }
.wheel-item.on { color: var(--accent); font-weight: 800; }
.wheel-item[data-g]::after { content: attr(data-g); font-size: calc(11px * var(--ts)); color: var(--muted); font-weight: 600; }
.wheel-empty { margin: 0; padding: 0 16px; text-align: center; }
.wheel-foot { display: grid; gap: 8px; margin-top: 10px; }
.wheel-hint { margin: 0; font-size: calc(12px * var(--ts)); text-align: center; }
#lab-wheel-add b { font-weight: 800; }
/* v2.9 how fruit is used */
.lab-use { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-left: 46px; border: 1.5px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--surface); }
.lab-use .chip { min-height: 34px; padding: 2px 4px; border: 0; border-radius: 0; font-size: calc(12.5px * var(--ts)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-use .chip + .chip { border-left: 1.5px solid var(--line); }
@media (max-width: 400px) { .lab-use { margin-left: 0; } }
/* v2.9 your own ingredient */
.cust-form { display: grid; gap: 8px; }
.cust-slider label { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: calc(14px * var(--ts)); }
.cust-slider label b { color: var(--accent); font-weight: 700; text-align: right; }
.cust-slider input[type="range"] { width: 100%; accent-color: var(--accent); height: 32px; margin: 0; }
.cust-note { margin: 0; font-size: calc(12.5px * var(--ts)); }
.cust-manage { margin-top: 12px; display: grid; gap: 6px; }
.cust-row { justify-content: space-between; align-items: center; gap: 8px; }
.home-group .chips { gap: 6px; } /* v2.8 Home Bar */
.home-tools { margin: 0 0 10px; padding-left: 20px; columns: 2; column-gap: 18px; font-size: calc(14px * var(--ts)); }
.home-syrups { display: grid; gap: 10px; margin: 10px 0; }
.home-syrup { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; border-top: 1px solid var(--line); padding-top: 10px; }
.home-syrup h4 { margin: 0 0 2px; font-size: calc(15px * var(--ts)); }
.home-syrup p { margin: 0; font-size: calc(13px * var(--ts)); }
.home-formula { font-size: calc(18px * var(--ts)); margin: 4px 0 8px; }
.home-formula span { color: var(--muted); margin: 0 4px; }
@media (max-width: 359px) { .home-tools { columns: 1; } }
.home-age { text-align: center; } /* v2.6.1: 21-date on Home, under the logo */
/* v2.6.2 printable lessons, quizzes, and answer keys: always a white sheet with dark text, whatever the look */
.print-row { display: grid; gap: 8px; }
.print-row .row { gap: 8px; }
.print-row .btn svg, .print-tools .btn svg { width: 18px; height: 18px; }
.print-tools { display: grid; gap: 10px; }
.print-tip { margin: 0; font-size: calc(13px * var(--ts)); }
.paper { --ink: #26352d; --glass: rgba(170, 205, 215, .30); --ice: rgba(255, 255, 255, .75); --foam: #fbf6ea; --copper: #c9793f; --liq-clear: #eef5f4; --liq-pale: #e9f0d6;
  --liq-white: #f3ecbc; --metal: #d3d9da; --metal-2: #b9c2c4; --onion: #f4f0e2; --rubber: #3d4642; --salt: #ffffff; --wood: #c9955c;
  background: #ffffff; color: #13212d; border: 1px solid #cddae5; border-radius: var(--r-lg); padding: 22px 18px; box-shadow: var(--shadow);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.45; }
.paper h1 { font-size: 24px; line-height: 1.15; margin: 2px 0 8px; color: #13212d; font-family: inherit; }
.paper h3 { font-size: 16px; margin: 0 0 2px; color: #13212d; font-family: inherit; }
.paper .p-meta { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #4c5e6e; }
.paper .p-intro { margin: 0 0 12px; color: #13212d; }
.paper .note { color: #13212d; background: #f6efdc; border-color: #e3d6ae; }
.paper .p-h2 { font-size: 17px; margin: 18px 0 6px; color: #13212d; font-family: inherit; }
.paper .p-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; border-top: 1px solid #dfe6ec; padding: 10px 0; }
.paper .p-item > div { grid-column: 2; }
.paper .p-item:not(:has(.art)) { grid-template-columns: 1fr; }
.paper .p-item:not(:has(.art)) > div { grid-column: 1; }
.paper .p-art { width: 56px; height: 56px; }
.paper .p-sum { margin: 0; font-weight: 600; }
.paper ul { margin: 6px 0 0; padding-left: 20px; }
.paper li { margin: 2px 0; }
.paper .p-fields { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 14px; margin: 6px 0 12px; font-size: 14px; }
.paper .p-fields span { border-bottom: 1px solid #13212d; padding: 14px 0 2px; }
.paper .p-qs { margin: 0; padding-left: 24px; }
.paper .pq { margin: 0 0 14px; padding-left: 4px; }
.paper .pq-q { margin: 0 0 4px; font-weight: 700; white-space: pre-line; }
.paper .pq-quote { margin: 0 0 6px; font-style: italic; }
.paper .pq-art { width: 92px; height: 92px; display: block; margin: 4px 0 6px; }
.paper .pq-opts { list-style: none; margin: 0; padding-left: 4px; }
.paper .pq-opts li { margin: 3px 0; }
.paper .p-teacher { margin: 0 0 10px; font-weight: 600; color: #ad3128; }
.paper .p-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 10px; }
.paper .p-table th, .paper .p-table td { border: 1px solid #cddae5; padding: 6px 7px; text-align: left; vertical-align: top; color: #13212d; }
.paper .p-table thead th { background: #edf3f8; }
.paper .p-key td:first-child { width: 2.2em; text-align: center; }
.paper .p-sources { font-size: 12px; overflow-wrap: anywhere; }
.paper .p-foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #dfe6ec; font-size: 11px; color: #4c5e6e; }
.print-sec { display: grid; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.print-sec h3 { margin: 0; font-size: calc(16px * var(--ts)); }
.print-sec p { margin: 2px 0 0; font-size: calc(13px * var(--ts)); }
.print-sec .row { gap: 8px; }
.print-sec .btn svg { width: 18px; height: 18px; }
.print-group { gap: 8px; }
.paper .p-break { height: 0; border-top: 2px dashed #cddae5; margin: 26px 0; }
.paper .p-toc { margin: 0; padding-left: 0; list-style: none; }
.paper .p-toc li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted #cddae5; padding: 5px 0; }
.paper .p-toc .muted { color: #4c5e6e; white-space: nowrap; font-size: 13px; }
.paper ol { padding-left: 22px; }
@media print {
  .print-mode .paper .p-break { border: 0; margin: 0; break-before: page; page-break-before: always; }
  .print-mode body { background: #ffffff !important; }
  .print-mode #topbar, .print-mode #tabbar, .print-mode .ask-fab, .print-mode #toast, .print-mode .no-print { display: none !important; }
  .print-mode #main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .print-mode main.enter > * { animation: none !important; } /* never print a half-faded sheet */
  .print-mode .paper { border: 0; border-radius: 0; box-shadow: none; padding: 0; font-size: 11.5pt; }
  .print-mode .pq, .print-mode .p-item, .print-mode .p-table tr { break-inside: avoid; page-break-inside: avoid; }
  .print-mode .p-head, .print-mode .p-h2 { break-after: avoid; page-break-after: avoid; }
}
.welcome-by { text-align: left; }
/* v2.3 settings + full-guide unlock */
.gear { flex: none; width: 40px; height: 40px; margin-right: -6px; border: 0; border-radius: 99px; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.gear svg { width: 22px; height: 22px; }
.gear:active { transform: scale(.94); }
.tabbar button { position: relative; }
.tab-lock { display: none; position: absolute; top: 4px; left: calc(50% + 7px); width: 15px; height: 15px; border-radius: 99px; background: var(--surface); color: var(--muted); place-items: center; }
.tab-lock svg { width: 10px !important; height: 10px !important; stroke-width: 2.6; }
.tabbar.is-free .tab-lock { display: grid; }
.paywall { display: grid; gap: 12px; }
.pw-ic, .plan-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; }
.pw-ic svg { width: 30px; height: 30px; }
.pw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pw-list li { display: flex; gap: 10px; align-items: flex-start; }
.pw-list svg { width: 20px; height: 20px; flex: none; color: var(--good); margin-top: 2px; }
.pw-go { display: grid; gap: 10px; }
.pw-go .btn, .buy-btn { justify-content: center; }
.free-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.free-banner p { margin: 0; flex: 1; min-width: 0; font-size: calc(14px * var(--ts)); }
.free-banner .btn { flex: none; min-height: 38px; padding: 6px 14px; }
.fb-ic { color: var(--accent); display: grid; }
.fb-ic svg { width: 20px; height: 20px; }
.plan-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.plan-card > div:nth-child(2) { flex: 1; min-width: 160px; }
.plan-card h2 { margin: 2px 0; }
.plan-card p { margin: 0; }
.plan-ic { width: 48px; height: 48px; border-radius: 14px; }
.plan-ic svg { width: 26px; height: 26px; }
.plan-full .plan-ic { color: var(--good); }
.price-big { font-family: var(--font-display); font-size: calc(40px * var(--ts)); font-weight: 800; color: var(--accent); line-height: 1; }
.price-card p { margin: 0; }
.unlock-msg { margin: 0; min-height: 1.2em; color: var(--good); font-weight: 600; }
.unlock-msg.bad { color: var(--bad); }
.code-input { font-family: var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.info-list { margin: 0; display: grid; gap: 8px; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.info-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.legal { display: grid; gap: 18px; }
.legal section { display: grid; gap: 6px; }
.legal h2 { margin: 0; }
.legal p { margin: 0; line-height: 1.6; }
.data-text { width: 100%; min-height: 0; font-family: var(--font-mono); font-size: calc(13px * var(--ts)); resize: vertical; }
.file-btn { justify-self: start; cursor: pointer; }
.danger-card { border-color: var(--bad); }
.wl-tag { display: inline-block; margin-top: 6px; }
.test-note { margin: 0; font-size: calc(13px * var(--ts)); text-align: center; } /* v2.4.1 testing-mode note */
.settings-foot { text-align: center; font-size: calc(13px * var(--ts)); }
/* v2.4 Stock (liquor inventory) */
.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg4 button { padding: 9px 2px; font-size: calc(14px * var(--ts)); }
.inv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.inv-stats b { display: block; font-family: var(--font-display); font-size: calc(22px * var(--ts)); color: var(--accent); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.inv-stats span { font-size: calc(12px * var(--ts)); color: var(--muted); }
.inv-last { margin: 0; font-size: calc(13px * var(--ts)); text-align: center; }
.inv-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.inv-chips .chip { flex: none; }
.inv-group { display: grid; gap: 8px; }
.inv-group h2 { margin: 6px 0 0; }
.inv-row, .inv-orow, .inv-erow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 8px; }
.inv-row.below { border-color: var(--accent); }
.inv-row.done, .inv-orow.done { background: var(--surface-2); }
.inv-head, .inv-orow { display: flex; align-items: center; gap: 10px; }
.inv-orow { grid-template-columns: none; }
.inv-name { flex: 1; min-width: 0; }
.inv-name h3 { margin: 0; font-size: calc(15px * var(--ts)); overflow-wrap: anywhere; }
.inv-name p { margin: 2px 0 0; font-size: calc(13px * var(--ts)); color: var(--muted); }
.inv-done { flex: none; width: 36px; height: 36px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; }
.inv-done svg { width: 20px; height: 20px; stroke-width: 3; }
.inv-done[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: var(--surface); }
.inv-need { flex: none; }
.inv-ctls { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.inv-ctl { display: grid; gap: 2px; }
.inv-lbl { font-size: calc(12px * var(--ts)); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.inv-step { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 99px; overflow: hidden; }
.inv-step button { width: 44px; height: 44px; border: 0; background: var(--surface-2); font-size: calc(22px * var(--ts)); font-weight: 700; color: var(--fg); cursor: pointer; }
.inv-step button:active { background: var(--line); }
.inv-val { min-width: 52px; text-align: center; font-family: var(--font-mono); font-size: calc(17px * var(--ts)); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.inv-form { display: grid; gap: 10px; }
.inv-form label { display: grid; gap: 4px; font-size: calc(13px * var(--ts)); font-weight: 700; color: var(--muted); }
.inv-form .search { color: var(--fg); font-weight: 400; }
.inv-erow .inv-ebtns { gap: 8px; }
.inv-erow .inv-ebtns .btn { min-height: 38px; padding: 6px 12px; }
.inv-erow.hidden-item .inv-name h3 { color: var(--muted); }
.inv-table-wrap { overflow-x: auto; }
.inv-table { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--ts)); }
.inv-table th, .inv-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.inv-table th:not(:first-child), .inv-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-table tr.below td:nth-child(2) { color: var(--bad); font-weight: 700; }
@media (max-width: 359px) { .topbar > .brand { font-size: max(17px, 5.6vw); } } /* v2.4: keep the name on one line beside the gear */
.counter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .counter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.counter-btn {
  display: grid; justify-items: center; gap: 2px; padding: 10px 6px; min-height: 84px; cursor: pointer;
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-md); color: var(--fg); font: inherit;
}
.counter-btn b { font-family: var(--font-display); font-size: calc(28px * var(--ts)); line-height: 1; color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.counter-btn span { font-weight: 700; }
.counter-btn small { font-size: calc(12px * var(--ts)); color: var(--muted); }
.counter-btn:active { transform: scale(.97); }
.counter-total { justify-content: space-between; }
.counter-total b { font-size: calc(20px * var(--ts)); color: var(--accent); }
.e86-chip { border-color: var(--bad); }

.ask-fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--ad-h, 0px) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 35;
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--gold-3); cursor: pointer;
  display: grid; place-items: center; color: var(--gold-fg);
  background-color: var(--gold-2); background-image: linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  box-shadow: inset 0 1px 0 rgba(255, 246, 220, .5), 0 6px 18px rgba(0, 0, 0, .28);
}
.ask-fab svg { width: 24px; height: 24px; }
.ask-fab:active { transform: scale(.95); }
.ask-fab[hidden] { display: none; }
main { padding-bottom: calc(var(--nav-h) + var(--ad-h, 0px) + 92px + env(safe-area-inset-bottom, 0px)); }

/* ---------- v2.1: Rush Hour ---------- */
.rush-tickets { display: grid; gap: 10px; }
@media (min-width: 640px) { .rush-tickets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rush-ticket { background: var(--surface-2); border-radius: var(--r-md); padding: 10px; display: grid; gap: 8px; border-top: 4px solid var(--accent); }
.rush-ticket-head { display: flex; justify-content: space-between; font-size: calc(14px * var(--ts)); }
.rush-ticket-head span { color: var(--muted); }
.rush-item {
  display: flex; align-items: center; gap: 10px; text-align: left; min-height: 48px; padding: 8px 10px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm); color: var(--fg); font: inherit; font-weight: 600;
}
.rush-item.picked { border-color: var(--accent); }
.rush-item:disabled { cursor: default; }
.rush-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: calc(14px * var(--ts));
  border: 1.5px dashed var(--line); color: var(--accent-fg); font-variant-numeric: tabular-nums;
}
.rush-item.picked .rush-n { background: var(--accent); border: 0; }
.rush-ideal li { line-height: 1.35; }

/* ---------- theme picker (Home) ---------- */
.theme-pick { display: grid; gap: 8px; }
.theme-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } /* v2.6: 7 looks, 4 + 3 on phones */
@media (min-width: 560px) { .theme-opts { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 64px; padding: 8px 4px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--fg);
  font-weight: 700; font-size: calc(13px * var(--ts)); cursor: pointer; box-shadow: var(--shadow), var(--card-hi);
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), border-color .2s, box-shadow .2s;
}
.theme-opt:hover { border-color: var(--hover-line); }
.theme-opt:active { transform: scale(.97); }
.theme-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow), inset 0 0 0 1px var(--accent); }
.theme-opt .sw { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .15); }
.sw-clear { background: radial-gradient(circle at 50% 50%, #0969da 0 28%, #ffffff 31%); }
.sw-auto { background: linear-gradient(135deg, #f3eee2 0 50%, #0e1814 50% 100%); }
.sw-dark { background: radial-gradient(circle at 50% 50%, #dcb266 0 28%, #0e1814 31%); }
.sw-light { background: radial-gradient(circle at 50% 50%, #86500f 0 28%, #f3eee2 31%); }
.sw-frost { background: radial-gradient(circle at 50% 50%, #1f5f8f 0 28%, #e2ebf3 31%); }
.sw-gold { background: radial-gradient(circle at 50% 50%, #7a4e00 0 28%, #e3b03b 31%); }
.sw-neon { background: radial-gradient(circle closest-side, #ff5fc8 0 36%, #120b1f 40% 78%, #2fe6e0 82%); }

/* ---------- Frost overrides for the parts that carry brass light ---------- */
:root[data-theme="frost"] .topbar { box-shadow: 0 4px 16px rgba(20, 50, 80, .08); }
:root[data-theme="frost"] .tabbar { box-shadow: 0 -4px 16px rgba(20, 50, 80, .07); }
:root[data-theme="frost"] .streak { background: rgba(31, 95, 143, .08); }
:root[data-theme="frost"] .tabbar button[aria-current="page"] svg { filter: drop-shadow(0 0 5px rgba(31, 95, 143, .35)); }
:root[data-theme="frost"] .tabbar button[aria-current="page"]::after { box-shadow: 0 0 10px rgba(31, 95, 143, .45); }
:root[data-theme="frost"] .btn.primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 2px 10px rgba(60, 130, 190, .25); }
:root[data-theme="frost"] .btn.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 4px 16px rgba(60, 130, 190, .35); }
:root[data-theme="frost"] .meter { box-shadow: inset 0 1px 1px rgba(20, 50, 80, .08); }
:root[data-theme="frost"] .hero {
  --surface: #ffffff; --surface-2: #dde9f3; --fg: #13212d; --muted: #4a5c6c; --line: #c6d6e3;
  --accent: #1f5f8f; --accent-fg: #ffffff; --bottle: #0f6466; --hover-line: #8db4d2;
  background-color: #e6f0f7;
  background-image:
    radial-gradient(420px 220px at 12% 0%, rgba(120, 185, 230, .30), transparent 70%),
    radial-gradient(360px 200px at 100% 100%, rgba(15, 100, 102, .08), transparent 70%),
    linear-gradient(160deg, #f8fbfd, #dcebf6);
  border-color: rgba(31, 95, 143, .20);
  box-shadow: var(--shadow-lift), inset 0 1px 0 #ffffff;
}
:root[data-theme="frost"] .hero-row .dial .val { filter: drop-shadow(0 0 4px rgba(31, 95, 143, .35)); }
:root[data-theme="frost"] .hero-row .dial .track { stroke: rgba(31, 95, 143, .14); }
:root[data-theme="frost"] .toast { background: #13212d; color: #eef4f9; border-color: #13212d; }
:root[data-theme="frost"] ::selection { background: rgba(31, 95, 143, .22); }

/* ---------- Clear overrides: flat GitHub-style chrome, no glow ---------- */
:root[data-theme="clear"] .topbar { box-shadow: 0 1px 0 rgba(31, 35, 40, .04); }
:root[data-theme="clear"] .tabbar { box-shadow: 0 -1px 0 rgba(31, 35, 40, .04); }
:root[data-theme="clear"] .streak { background: #ddf4ff; color: #0969da; border-color: #b6e3ff; }
:root[data-theme="clear"] .tabbar button[aria-current="page"] svg { filter: none; }
:root[data-theme="clear"] .tabbar button[aria-current="page"]::after { box-shadow: none; }
:root[data-theme="clear"] .btn.primary { box-shadow: 0 1px 0 rgba(31, 35, 40, .10); }
:root[data-theme="clear"] .btn.primary:hover:not(:disabled) { box-shadow: 0 1px 0 rgba(31, 35, 40, .10), 0 3px 8px rgba(31, 136, 61, .25); }
:root[data-theme="clear"] .meter { box-shadow: none; }
:root[data-theme="clear"] .meter > span::after { display: none; }
:root[data-theme="clear"] .hero {
  --surface: #ffffff; --surface-2: #eff2f5; --fg: #1f2328; --muted: #59636e; --line: #d1d9e0;
  --accent: #0969da; --accent-fg: #ffffff; --bottle: #0550ae; --hover-line: #8c959f;
  background-color: #ffffff; background-image: none;
  border-color: #d1d9e0;
  box-shadow: var(--shadow);
}
:root[data-theme="clear"] .hero-row .dial .val { stroke: #1a7f37; filter: none; }
:root[data-theme="clear"] .hero-row .dial .track { stroke: #eff2f5; }
:root[data-theme="clear"] .fc .face { background-image: none; outline-color: #d1d9e0; }
:root[data-theme="clear"] .score-big { text-shadow: none; }
:root[data-theme="clear"] .toast { background: #1f2328; color: #ffffff; border-color: #1f2328; }
:root[data-theme="clear"] ::selection { background: rgba(9, 105, 218, .20); }
:root[data-theme="clear"] .topbar > .brand { font-size: min(21px, 5.1vw); letter-spacing: -.01em; } /* system font is wider: keep the name on one line beside the gear */

/* ---------- Gold overrides ---------- */
:root[data-theme="gold"] .topbar { box-shadow: 0 4px 18px rgba(120, 80, 0, .18); }
:root[data-theme="gold"] .tabbar { box-shadow: 0 -4px 18px rgba(120, 80, 0, .14); }
:root[data-theme="gold"] .streak { background: rgba(90, 31, 0, .10); }
:root[data-theme="gold"] .tabbar button[aria-current="page"] svg { filter: drop-shadow(0 0 4px rgba(255, 240, 190, .8)); }
:root[data-theme="gold"] .tabbar button[aria-current="page"]::after { box-shadow: 0 0 8px rgba(90, 31, 0, .35); }
:root[data-theme="gold"] .btn.primary { box-shadow: inset 0 1px 0 rgba(255, 220, 140, .45), 0 2px 10px rgba(110, 74, 12, .30); }
:root[data-theme="gold"] .btn.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 220, 140, .45), 0 4px 16px rgba(110, 74, 12, .40); }
:root[data-theme="gold"] .meter { box-shadow: inset 0 1px 1px rgba(80, 55, 5, .10); }
:root[data-theme="gold"] .hero {
  --surface: #fffaf0; --surface-2: #f6e3b4; --fg: #2a1d08; --muted: #5f4a1e; --line: #e0c487;
  --accent: #7a4e00; --accent-fg: #ffffff; --bottle: #5a3a06; --hover-line: #c99a3c;
  background-color: #f6dc95;
  background-image:
    radial-gradient(420px 220px at 12% 0%, rgba(255, 245, 210, .75), transparent 70%),
    radial-gradient(360px 200px at 100% 100%, rgba(200, 130, 20, .22), transparent 70%),
    linear-gradient(160deg, #fbe7ad, #ecc35e);
  border-color: rgba(122, 78, 0, .28);
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, .7);
}
:root[data-theme="gold"] .hero-row .dial .val { stroke: #7a4e00; filter: drop-shadow(0 0 4px rgba(255, 230, 160, .9)); }
:root[data-theme="gold"] .hero-row .dial .track { stroke: rgba(122, 78, 0, .18); }
:root[data-theme="gold"] .toast { background: #2a1d08; color: #fbe7b5; border-color: #2a1d08; }
:root[data-theme="gold"] ::selection { background: rgba(227, 176, 59, .45); }

/* ---------- Neon overrides ---------- */
:root[data-theme="neon"] .topbar { box-shadow: 0 6px 22px rgba(255, 95, 200, .12); }
:root[data-theme="neon"] .tabbar { box-shadow: 0 -6px 22px rgba(255, 95, 200, .10); }
:root[data-theme="neon"] .streak { background: rgba(255, 95, 200, .12); }
:root[data-theme="neon"] .tabbar button[aria-current="page"] svg { filter: drop-shadow(0 0 6px rgba(255, 95, 200, .75)); }
:root[data-theme="neon"] .tabbar button[aria-current="page"]::after { box-shadow: 0 0 12px rgba(255, 95, 200, .9); }
:root[data-theme="neon"] .btn.primary { box-shadow: inset 0 1px 0 rgba(255, 220, 245, .5), 0 0 16px rgba(255, 95, 200, .45); }
:root[data-theme="neon"] .btn.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 220, 245, .5), 0 0 24px rgba(255, 95, 200, .6); }
:root[data-theme="neon"] .hero {
  --surface: #1f1436; --surface-2: #2c1e4a; --fg: #f5ecff; --muted: #c4b5df; --line: #45336a;
  --accent: #ff5fc8; --accent-fg: #1a0618; --bottle: #2fe6e0; --hover-line: #8a4fb8;
  background-color: #0d0817;
  background-image:
    radial-gradient(420px 220px at 12% 0%, rgba(255, 95, 200, .28), transparent 70%),
    radial-gradient(360px 200px at 100% 100%, rgba(47, 230, 224, .18), transparent 70%),
    linear-gradient(160deg, #1a0f2e, #0d0817);
  border-color: rgba(255, 95, 200, .35);
  box-shadow: var(--shadow-lift), 0 0 24px rgba(255, 95, 200, .12);
}
:root[data-theme="neon"] .hero-row .dial .val { stroke: #2fe6e0; filter: drop-shadow(0 0 6px rgba(47, 230, 224, .8)); }
:root[data-theme="neon"] .hero-row .dial .track { stroke: rgba(255, 95, 200, .18); }
:root[data-theme="neon"] .toast { background: #1c1230; color: #f5ecff; border-color: #ff5fc8; box-shadow: 0 0 18px rgba(255, 95, 200, .4); }
:root[data-theme="neon"] ::selection { background: rgba(255, 95, 200, .35); }

@media (prefers-reduced-motion: reduce) {
  .fc, .meter > span, .item .chev, .hero-row .dial .val { transition: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile:hover, .mode:hover, .drink-row:hover, .ans-row:hover, .mix-food:hover,
  .tile:active, .mode:active, .drink-row:active, .ans-row:active, .mix-food:active, .opt:active, .glass-pick:active, .theme-opt:active,
  .path-card:hover, .path-card:active, .shift-btn:active, .counter-btn:active, .ask-fab:active { transform: none; }
  .meter > span::after { display: none; }
}

