/* La Cave — La Malle's "premium minimal with a playful spark", poured into a glass.
   Near-monochrome surfaces, hairlines, one tangerine accent; wine colours only as small dots. */

@font-face {
  font-family: "Geist";
  src: url("/static/geist.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- tokens -------------------------------------------------------------------- */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --surface-3: #ececea;
  --line: rgb(24 24 27 / .08);
  --line-2: rgb(24 24 27 / .14);
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #6b6b72;
  --ink: #18181b;
  --ink-text: #fafaf9;
  --ink-text-2: #a1a1aa;
  --accent: #ff6a2b;
  --accent-strong: #f0561a;
  --accent-ink: #1c0a02;
  --accent-text: #c2410c;
  --accent-soft: rgb(255 106 43 / .10);
  --accent-softer: rgb(255 106 43 / .05);
  --hover: rgb(24 24 27 / .035);
  --danger: #b42318;
  --danger-soft: #fef1ef;
  --ok: #15803d;
  --ok-soft: rgb(22 163 74 / .10);
  --glow: rgb(255 106 43 / .10);
  --glow-edge: rgb(255 106 43 / .45);
  --shadow-sm: 0 1px 2px rgb(24 24 27 / .05);
  --shadow: 0 1px 2px rgb(24 24 27 / .04), 0 6px 20px -6px rgb(24 24 27 / .08);
  --shadow-lg: 0 2px 4px rgb(24 24 27 / .06), 0 24px 48px -12px rgb(24 24 27 / .22);
  --dots: rgb(24 24 27 / .09);
  --thumb: #ffffff;
  --stone: #d6d3d1;
  --stone-2: #a8a29e;
  /* wine colours: dots and bottle drawings only – the app accent stays tangerine */
  --w-red: #8f1d33; --w-white: #dcc27a; --w-rose: #f0a0b2; --w-sparkling: #e9d79a; --w-orange: #df8a35; --w-sweet: #c8901c;
  --star-off: #e4e4e1;
  /* trophy tiers */
  --t-bronze: #b9773f;
  --t-bronze-2: #e3a46b;
  --t-silver: #8a96a3;
  --t-silver-2: #d6dde4;
  --t-gold: #d29a12;
  --t-gold-2: #f8d667;
  --t-legend: #ff6a2b;
  --t-legend-2: #ffb547;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --surface: #111113; --surface-2: #19191c; --surface-3: #232327;
    --line: rgb(255 255 255 / .07); --line-2: rgb(255 255 255 / .13);
    --text: #ededef; --text-2: #a8a8b0; --text-3: #8c8c95;
    --ink: #f4f4f5; --ink-text: #111113; --ink-text-2: #5c5c66;
    --accent: #ff7a3d; --accent-strong: #ff8a52; --accent-ink: #1c0a02; --accent-text: #ff9a66;
    --accent-soft: rgb(255 122 61 / .14); --accent-softer: rgb(255 122 61 / .06);
    --hover: rgb(255 255 255 / .035);
    --danger: #ff8a80; --danger-soft: rgb(255 90 80 / .12);
    --ok: #4ade80; --ok-soft: rgb(74 222 128 / .12);
    --glow: rgb(255 122 61 / .10); --glow-edge: rgb(255 122 61 / .55);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 56px -12px rgb(0 0 0 / .8);
    --dots: rgb(255 255 255 / .07); --thumb: #2a2a2f;
    --stone: #3f3f46; --stone-2: #52525b;
    --w-red: #e5566f; --w-white: #e6d08e; --w-rose: #f4aabb; --w-sparkling: #efe0a6; --w-orange: #eea04f; --w-sweet: #e0a93c;
    --star-off: #2c2c31;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --surface: #111113; --surface-2: #19191c; --surface-3: #232327;
  --line: rgb(255 255 255 / .07); --line-2: rgb(255 255 255 / .13);
  --text: #ededef; --text-2: #a8a8b0; --text-3: #8c8c95;
  --ink: #f4f4f5; --ink-text: #111113; --ink-text-2: #5c5c66;
  --accent: #ff7a3d; --accent-strong: #ff8a52; --accent-ink: #1c0a02; --accent-text: #ff9a66;
  --accent-soft: rgb(255 122 61 / .14); --accent-softer: rgb(255 122 61 / .06);
  --hover: rgb(255 255 255 / .035);
  --danger: #ff8a80; --danger-soft: rgb(255 90 80 / .12);
  --ok: #4ade80; --ok-soft: rgb(74 222 128 / .12);
  --glow: rgb(255 122 61 / .10); --glow-edge: rgb(255 122 61 / .55);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 56px -12px rgb(0 0 0 / .8);
  --dots: rgb(255 255 255 / .07); --thumb: #2a2a2f;
  --stone: #3f3f46; --stone-2: #52525b;
  --w-red: #e5566f; --w-white: #e6d08e; --w-rose: #f4aabb; --w-sparkling: #efe0a6; --w-orange: #eea04f; --w-sweet: #e0a93c;
  --star-off: #2c2c31;
  color-scheme: dark;
}

/* ---- base ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
small { font-size: .72em; font-weight: 500; color: var(--text-3); margin-left: 2px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.accent-text { color: var(--accent-text); font-weight: 600; }
.link { font-size: 13.5px; font-weight: 550; color: var(--accent-text); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---- buttons ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 550; letter-spacing: -.005em; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-primary:hover { box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 6px 18px -6px var(--glow-edge), inset 0 1px 0 rgb(255 255 255 / .25); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--line-2); background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--surface); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; height: 44px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ico { width: 18px; height: 18px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---- logo ---------------------------------------------------------------------- */
.logo { width: 28px; height: 28px; flex: none; overflow: visible; }
.logo-bg { fill: var(--ink); }
.logo-fg { fill: var(--ink-text); }
.logo-shine { fill: none; stroke: var(--ink); stroke-width: .9; stroke-linecap: round; opacity: .3; }
.logo-wine { fill: var(--accent); transform-box: view-box; transform-origin: 16px 11.2px; transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
/* the glass tilts – santé! – with La Malle's spring, and the wine stays level */
.logo-glass { transform-box: view-box; transform-origin: 16px 24px; transition: transform .38s cubic-bezier(.3,1.6,.5,1); }
.brand:hover .logo-glass { transform: rotate(-12deg); }
.brand:hover .logo-wine { transform: rotate(12deg); }
.logo-bubble { fill: var(--accent); opacity: 0; }
.brand:hover .logo-bubble-1 { animation: bubble 1s .1s ease-out; }
.brand:hover .logo-bubble-2 { animation: bubble 1s .3s ease-out; }

/* ---- theme toggle -------------------------------------------------------------- */
.theme-toggle { --seg: 32px; position: relative; display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.theme-toggle button { position: relative; z-index: 1; display: grid; place-items: center; width: var(--seg); height: calc(var(--seg) - 4px); padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text-3); transition: color .2s ease; }
.theme-toggle button:hover, .theme-toggle button[aria-pressed="true"] { color: var(--text); }
.theme-toggle .ico { width: 16px; height: 16px; }
.theme-thumb { position: absolute; top: 2px; left: 2px; width: var(--seg); height: calc(var(--seg) - 4px); border-radius: 999px; background: var(--thumb); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: transform .32s cubic-bezier(.3,1.3,.5,1); }
:root[data-theme-pref="light"] .theme-thumb { transform: translateX(var(--seg)); }
:root[data-theme-pref="dark"] .theme-thumb { transform: translateX(calc(var(--seg) * 2)); }
.theme-toggle button[data-set-theme="light"][aria-pressed="true"] .ico { animation: spin-in .45s cubic-bezier(.3,1.4,.5,1); }
.theme-toggle button[data-set-theme="dark"][aria-pressed="true"] .ico { animation: tilt-in .45s cubic-bezier(.3,1.4,.5,1); }
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-old(root) { z-index: 1; }
html.theme-vt::view-transition-new(root) { z-index: 2; }

/* ---- top bar ------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 24px;
  padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -.015em; min-height: 40px; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.nav a { position: relative; padding: 7px 11px; border-radius: 9px; font-size: 14px; font-weight: 520; color: var(--text-2); transition: color .15s ease, background-color .15s ease; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: -11px; height: 2px; border-radius: 2px; background: var(--accent); }
.topbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.userbox { display: flex; align-items: center; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text-2); transition: background-color .15s ease, color .15s ease, transform .4s cubic-bezier(.3,1.4,.5,1); }
.avatar:hover { background: var(--hover); color: var(--text); }
.avatar:hover .ico { transform: rotate(60deg); transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.avatar .ico { width: 19px; height: 19px; }

.banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 16px; border-top: 1px solid var(--line);
  background: var(--danger-soft); color: var(--danger); font-size: 13.5px; font-weight: 520;
}
.banner .ico { width: 17px; height: 17px; }
.banner a { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* ---- bottom tab bar (phones) -------------------------------------------------------- */
.tabbar { display: none; }
@media (max-width: 899px) {
  .nav { display: none; }
  .tabbar {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 2px; border-radius: 12px; font-size: 11px; font-weight: 550; color: var(--text-3); transition: color .15s ease; }
  .tabbar a .ico { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"] .ico { color: var(--accent-text); stroke-width: 2; }
  .tabbar .tab-add {
    justify-self: center; width: 54px; height: 54px; margin-top: -22px; padding: 0; justify-content: center;
    border-radius: 18px; background: var(--accent); color: var(--accent-ink);
    box-shadow: 0 6px 20px -4px var(--glow-edge), 0 0 0 4px var(--bg);
    transition: transform .2s cubic-bezier(.3,1.5,.5,1);
  }
  .tabbar .tab-add .ico { width: 26px; height: 26px; stroke-width: 2; color: var(--accent-ink); }
  .tabbar .tab-add:active { transform: scale(.92); }
  body.has-tabbar .page, body:not(.login-page):not(.add-page) .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .add-page .tabbar { display: none; }
}

/* ---- page / hero --------------------------------------------------------------- */
.page {
  max-width: 1120px; margin: 0 auto;
  padding: 40px 24px 120px;
  padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
}
.hero { margin-bottom: 24px; animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.hero-tight { margin-bottom: 18px; }
.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 0; font-size: 13px; font-weight: 550; color: var(--text-3); letter-spacing: .01em; margin-bottom: 8px; }
.dot { margin: 0 7px; opacity: .55; }
.greeting { font-size: clamp(28px, 4.2vw, 38px); line-height: 1.12; font-weight: 650; letter-spacing: -.032em; text-wrap: balance; overflow-wrap: anywhere; }
.wave { display: inline-block; transform-origin: 70% 75%; animation: wave 1.4s .35s ease-in-out both; }
.greeting .who { text-transform: capitalize; }
.hero-sub { margin-top: 10px; color: var(--text-3); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px -6px; padding: 4px 8px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--text-3); }
.back:hover { color: var(--text); background: var(--hover); }
.back .ico { width: 16px; height: 16px; }

/* ---- cards & grid ---------------------------------------------------------------- */
.card {
  position: relative; isolation: isolate;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
}
a.card { display: block; transition: transform .25s cubic-bezier(.3,1.4,.5,1), box-shadow .2s ease, border-color .2s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid > .card { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.grid > .card:nth-child(2) { animation-delay: 40ms; } .grid > .card:nth-child(3) { animation-delay: 80ms; } .grid > .card:nth-child(4) { animation-delay: 120ms; }
.grid > .card:nth-child(5) { animation-delay: 160ms; } .grid > .card:nth-child(n+6) { animation-delay: 200ms; }
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}
.grid-2 { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; }
.card-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.card-eyebrow .ico { width: 15px; height: 15px; color: var(--accent-text); }
.card-title { font-size: 22px; font-weight: 680; letter-spacing: -.028em; line-height: 1.2; }
.card-sub { margin-top: 4px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill .ico { width: 14px; height: 14px; }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.pill-ok { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--text-3); vertical-align: 1px; letter-spacing: .02em; }

.tile { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; color: var(--k, var(--text-2)); background: color-mix(in srgb, var(--k, var(--text-3)) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k, var(--text-3)) 18%, transparent); }
.tile .ico { width: 19px; height: 19px; }
.tile-sm { width: 30px; height: 30px; border-radius: 9px; }
.tile-sm .ico { width: 16px; height: 16px; }
.tile-lg { width: 64px; height: 64px; border-radius: 18px; }
.tile-lg .ico { width: 30px; height: 30px; }

/* XP / HP bars */
.xpbar { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--metal-2, var(--accent)), var(--metal, var(--accent-strong))); box-shadow: 0 0 12px var(--glow-edge); animation: grow 1s .2s cubic-bezier(.2,.8,.2,1) both; }

/* medals */
.medal { width: 100%; height: 100%; overflow: visible; }
.medal .m-outer { fill: var(--t1, var(--metal, var(--stone-2))); }
.medal .m-inner { fill: var(--t2, var(--metal-2, var(--stone))); stroke: rgb(255 255 255 / .35); stroke-width: 1; }
.medal .m-glyph { color: var(--t1, var(--metal)); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.medal .m-num { fill: color-mix(in srgb, var(--metal) 65%, black); font: 750 21px/1 "Geist", ui-sans-serif, sans-serif; letter-spacing: -.04em; }
.tier-bronze { --t1: var(--t-bronze); --t2: var(--t-bronze-2); }
.tier-silver { --t1: var(--t-silver); --t2: var(--t-silver-2); }
.tier-gold { --t1: var(--t-gold); --t2: var(--t-gold-2); }
.tier-legendary { --t1: var(--t-legend); --t2: var(--t-legend-2); }
.medal.tier-legendary { filter: drop-shadow(0 0 8px rgb(255 120 50 / .45)); }
.medal.locked { --t1: var(--stone-2); --t2: var(--surface-3); filter: none; }
.medal.locked .m-inner { stroke: var(--line-2); }
.medal.locked .m-glyph { color: var(--text-3); opacity: .7; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .inline-form { grid-template-columns: 1fr 1fr; } .inline-form .btn { grid-column: 1 / -1; } }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field input {
  height: 44px; padding: 0 13px; width: 100%; min-width: 0;
  border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg);
  font-size: 15px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.level-hero { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center; background: radial-gradient(80% 130% at 0% 50%, color-mix(in srgb, var(--metal) 14%, transparent), transparent 70%), var(--surface); }
.level-hero .medal-big { width: 150px; height: 150px; animation: float-y 4s ease-in-out infinite; filter: drop-shadow(0 10px 20px color-mix(in srgb, var(--metal) 35%, transparent)); }
.level-hero .stat-value { font-size: 30px; }
@media (max-width: 640px) { .level-hero { grid-template-columns: 96px 1fr; gap: 16px; } .level-hero .medal-big { width: 96px; height: 96px; } .level-hero .stat-value { font-size: 23px; } }
.trophy-group { margin-top: 26px; }
.trophy-group > header { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.trophy-group h2 { font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.trophy-group header span { font-size: 13px; color: var(--text-3); }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.trophy { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.3,1.4,.5,1), box-shadow .2s ease; scroll-margin-top: 90px; }
.trophy:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: var(--shadow-lg); }
.trophy .medal { width: 64px; height: 64px; transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.trophy:hover .medal:not(.locked) { transform: rotateY(180deg) scale(1.05); }
.trophy h3 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
.trophy p { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.trophy .when { font-size: 11.5px; font-weight: 600; color: var(--accent-text); }
.trophy.locked h3 { color: var(--text-2); }
.trophy .prog { width: 100%; margin-top: 2px; }

/* ---- settings ----------------------------------------------------------------------------- */
.settings { display: grid; gap: 16px; max-width: 760px; }
.settings .card { scroll-margin-top: 80px; }
.status-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.status-row:last-of-type { border-bottom: 0; }
.status-row .k { color: var(--text-3); width: 150px; flex: none; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: none; }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.status-dot.warn { background: #f59e0b; }
.form-grid { display: grid; gap: 12px; margin-top: 14px; }
.form-grid .btn { justify-self: start; }
.steps-guide { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 9px; font-size: 14px; color: var(--text-2); }
.steps-guide strong, .steps-guide b { color: var(--text); }
.steps-guide a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
code, .code { font: 500 12.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.copy-line { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 10px; background: var(--surface-2); margin-top: 6px; }
.copy-line code { flex: 1; background: transparent; padding: 0; }
.ok-msg { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 550; }
.alert { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 500; animation: shake .4s cubic-bezier(.36,.07,.19,.97) both; }
.progress-line { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.progress-line i { display: block; height: 100%; width: var(--p); background: var(--accent); transition: width .4s ease; }

/* ---- La Cave: wine colours ---------------------------------------------------------- */
.c-red { --w: var(--w-red); } .c-white { --w: var(--w-white); } .c-rose { --w: var(--w-rose); }
.c-sparkling { --w: var(--w-sparkling); } .c-orange { --w: var(--w-orange); } .c-sweet { --w: var(--w-sweet); }
.cdot { display: inline-block; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--w, var(--surface-3)); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); vertical-align: 0; }
.cdot.c-sparkling { background: radial-gradient(circle at 35% 35%, #fff 0 1.2px, transparent 1.6px), radial-gradient(circle at 68% 62%, #fff 0 1px, transparent 1.4px), var(--w); }
.f { font-weight: 450; color: var(--text-3); font-style: italic; }

/* ---- stars ------------------------------------------------------------------------- */
.stars { display: inline-block; width: 80px; height: 16px; flex: none; overflow: visible; vertical-align: -2px; }
.stars path { stroke-width: 1.4; stroke-linejoin: round; }
.st-off path { fill: var(--star-off); stroke: var(--star-off); }
.st-on path { fill: var(--accent); stroke: var(--accent); }
.stars-sm { width: 62px; height: 12.4px; }
.stars-lg { width: 230px; height: 46px; }
.stars-md { width: 120px; height: 24px; }
.rate { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; border-radius: 12px; }
.rate .stars { transition: transform .2s cubic-bezier(.3,1.5,.5,1); }
.rate.pop .stars { animation: star-pop .38s cubic-bezier(.3,1.6,.5,1); }
.rate-word { font-size: 14.5px; font-weight: 620; color: var(--text-2); min-width: 7em; font-variant-numeric: tabular-nums; }
.rate-word b { color: var(--accent-text); font-weight: 750; margin-right: 6px; }
.rate-hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

/* ---- wine rows / tiles -------------------------------------------------------------- */
.wine-list { display: grid; gap: 10px; }
@media (min-width: 900px) { .wine-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wine-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.3,1.4,.5,1), box-shadow .2s ease, border-color .2s ease;
  animation: rise .4s cubic-bezier(.2,.8,.2,1) both;
}
.wine-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.wine-list .wine-row:nth-child(2) { animation-delay: 30ms; } .wine-list .wine-row:nth-child(3) { animation-delay: 60ms; }
.wine-list .wine-row:nth-child(4) { animation-delay: 90ms; } .wine-list .wine-row:nth-child(n+5) { animation-delay: 120ms; }
.wr-photo { position: relative; width: 58px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.wr-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wr-body { display: grid; gap: 3px; min-width: 0; }
.wr-title { font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-title .vint { font-weight: 550; color: var(--text-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.wr-sub { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); min-width: 0; }
.wr-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-rates { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.wr-rate { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; color: var(--text-2); }
.wr-rate .ini { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 6px; background: var(--surface-2); font-size: 10px; font-weight: 750; color: var(--text-2); }
.wr-rate.me .ini { background: var(--ink); color: var(--ink-text); }
.wr-rate.none { color: var(--text-3); font-weight: 500; }
.wr-end { display: grid; justify-items: end; gap: 6px; }
.loved-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.loved-mark .ico { width: 16px; height: 16px; fill: currentColor; }
.btl { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.btl .ico { width: 13px; height: 13px; }
.todo-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 11.5px; font-weight: 650; }

/* grid view: the labels, big */
:root[data-view="grid"] .wine-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
:root[data-view="grid"] .wine-row { grid-template-columns: 1fr; grid-template-rows: auto auto; padding: 0; gap: 0; overflow: hidden; align-items: stretch; }
:root[data-view="grid"] .wr-photo { width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: 0; }
:root[data-view="grid"] .wr-body { padding: 10px 12px 12px; }
:root[data-view="grid"] .wr-sub span { white-space: nowrap; }
:root[data-view="grid"] .wr-end { position: absolute; top: 8px; right: 8px; }
:root[data-view="grid"] .wr-end .btl, :root[data-view="grid"] .wr-end .todo-pill { background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
:root[data-view="grid"] .wine-row { position: relative; }
:root[data-view="grid"] .wr-rate .stars { width: 56px; height: 11.2px; }

/* the bottle drawn when there's no photo yet */
.bottle-art { width: 60%; height: 80%; overflow: visible; }
.ba-glass { fill: var(--surface-3); }
.ba-wine { fill: var(--w, var(--stone-2)); }
.ba-label { fill: var(--surface); opacity: .92; }
.ba-shine { fill: none; stroke: #fff; stroke-opacity: .5; stroke-width: 1.4; stroke-linecap: round; }
:root[data-view="grid"] .bottle-art { width: 42%; height: 62%; }

/* ---- filters ------------------------------------------------------------------------ */
.searchbar { position: relative; display: flex; align-items: center; margin-bottom: 12px; }
.searchbar .ico { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.searchbar input { width: 100%; height: 46px; padding: 0 44px 0 42px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); font-size: 15.5px; outline: none; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.searchbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar .clear { position: absolute; right: 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px 8px; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none; height: 34px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  font-size: 13.5px; font-weight: 560; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .2s cubic-bezier(.3,1.5,.5,1);
}
.chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"], .chip.on, input:checked + .chip { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.chip .ico { width: 15px; height: 15px; }
.chip .x { width: 14px; height: 14px; margin-right: -4px; opacity: .7; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 2px 12px; font-size: 13px; color: var(--text-3); }
.view-toggle { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.view-toggle button { display: grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); }
.view-toggle button .ico { width: 16px; height: 16px; }
:root:not([data-view="grid"]) .view-toggle [data-view-set="list"], :root[data-view="grid"] .view-toggle [data-view-set="grid"] { background: var(--thumb); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }

/* ---- home ------------------------------------------------------------------------ */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; animation: rise .45s .05s cubic-bezier(.2,.8,.2,1) both; }
.stat { display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
a.stat:hover { transform: translateY(-2px); }
.stat .ico { width: 18px; height: 18px; color: var(--accent-text); margin-bottom: 4px; }
.stat b { font-size: 24px; font-weight: 720; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--text-3); font-weight: 520; }
@media (max-width: 640px) {
  .stat-strip { gap: 8px; }
  .stat { padding: 11px 10px 10px; border-radius: 14px; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat .ico { width: 16px; height: 16px; margin-bottom: 2px; }
}
.section { margin-top: 26px; }
.section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; margin: 0 4px 10px; }
.section > header > :last-child { white-space: nowrap; }
.section h2 { font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.section h2 .f { font-size: 14px; margin-left: 4px; }
.queue-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); font-size: 14px; font-weight: 560; }
.queue-banner .ico { width: 18px; height: 18px; }
.queue-banner button { margin-left: auto; }
.card.month-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; background: radial-gradient(90% 140% at 0% 0%, var(--accent-soft), transparent 60%), var(--surface); }
.month-card .mc-photo { position: relative; width: 96px; height: 120px; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; box-shadow: var(--shadow); }
.month-card .mc-photo img { width: 100%; height: 100%; object-fit: cover; }
.month-card .crown { position: absolute; top: -2px; left: 50%; translate: -50% 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px -2px var(--glow-edge); animation: crown-bob 3s ease-in-out infinite; }
.month-card .crown .ico { width: 17px; height: 17px; stroke-width: 2; }
.month-card .mc-photo { overflow: visible; }
.month-card .mc-photo img, .month-card .mc-photo .bottle-art { border-radius: 14px; }
.month-card h3 { font-size: 19px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.month-card p { color: var(--text-3); font-size: 13.5px; }
.card.cta-card { display: grid; justify-items: start; gap: 8px; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }

/* ---- add (quick add at the table) ---------------------------------------------------- */
.add-page .page { max-width: 560px; padding-top: 18px; padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
.add-page .hero { margin-bottom: 14px; }
.add-page .greeting { font-size: clamp(25px, 4vw, 32px); }
.add-page .seg { margin-bottom: 12px; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--text-3); cursor: pointer; transition: color .2s ease; }
.seg label .ico { width: 17px; height: 17px; }
.seg input:checked + label { color: var(--text); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); }
.seg-thumb { position: absolute; top: 3px; left: 3px; width: calc(50% - 3px); height: 40px; border-radius: 11px; background: var(--thumb); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: transform .32s cubic-bezier(.3,1.3,.5,1); }
.seg:has(#mode-bought:checked) .seg-thumb { transform: translateX(100%); }
.shot { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border-radius: 22px; border: 1.5px dashed var(--line-2); background: radial-gradient(ellipse 60% 50% at 50% 40%, var(--accent-softer), transparent), var(--surface); overflow: hidden; cursor: pointer; transition: border-color .2s ease, transform .25s cubic-bezier(.3,1.4,.5,1); }
.shot:hover { border-color: var(--accent); }
.shot:active { transform: scale(.99); }
.shot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.shot-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 20px; }
.shot-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 21px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px -8px var(--glow-edge); animation: shot-breathe 3s ease-in-out infinite; }
.shot-ico .ico { width: 30px; height: 30px; stroke-width: 1.8; }
.shot-empty b { font-size: 18px; font-weight: 680; letter-spacing: -.02em; }
.shot-empty .shot-sub { font-size: 13.5px; color: var(--text-3); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: develop .6s cubic-bezier(.2,.8,.2,1) both; }
.shot.has-photo { border-style: solid; border-color: var(--line); }
.shot-retake { position: absolute; right: 12px; bottom: 12px; z-index: 2; }
.gallery-link { display: flex; justify-content: center; margin: 10px 0 2px; }
.gallery-link label { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 560; color: var(--text-2); cursor: pointer; }
.gallery-link label:hover { background: var(--hover); color: var(--text); }
.gallery-link .ico { width: 16px; height: 16px; }
.gallery-link input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.add-block { margin-top: 16px; }
.add-block > p { font-size: 13px; font-weight: 600; color: var(--text-3); margin: 0 2px 8px; letter-spacing: .01em; }
.color-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.color-pick input { position: absolute; opacity: 0; pointer-events: none; }
.color-pick label { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 12px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 580; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform .2s cubic-bezier(.3,1.5,.5,1); }
.color-pick label .cdot { width: 16px; height: 16px; transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.color-pick label small { display: block; margin: 0; font-size: 11px; font-weight: 500; color: var(--text-3); line-height: 1.1; }
.color-pick label span { line-height: 1.15; }
.color-pick input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.color-pick input:checked + label .cdot { transform: scale(1.25); }
.color-pick input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.color-pick label:active { transform: scale(.97); }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.stepper button:active { transform: scale(.94); }
.stepper output, .stepper input { width: 56px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; border: 0; background: transparent; outline: none; }
.add-more summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 6px 2px; list-style: none; display: flex; align-items: center; gap: 6px; }
.add-more summary::-webkit-details-marker { display: none; }
.add-more summary .ico { width: 15px; height: 15px; transition: transform .2s ease; }
.add-more[open] summary .ico { transform: rotate(90deg); }
.save-bar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: linear-gradient(transparent, var(--bg) 30%); }
.save-bar .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.save-bar .btn-accent { flex: 1; height: 52px; border-radius: 15px; font-size: 16px; }
.save-bar .btn-ghost { height: 52px; border-radius: 15px; }
.edit-page .save-bar .inner { max-width: 760px; }

/* ---- wine page ---------------------------------------------------------------------- */
.wine-hero { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; margin-bottom: 18px; }
@media (max-width: 719px) { .wine-hero { grid-template-columns: 1fr; gap: 18px; } }
.wh-photo { position: relative; display: grid; place-items: center; border-radius: 22px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-lg); aspect-ratio: 3 / 4; max-height: 420px; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
@media (max-width: 719px) { .wh-photo { max-height: none; aspect-ratio: 4 / 5; } }
.wh-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.wh-photo .bottle-art { width: 34%; height: 70%; }
.wh-photo .icon-btn { position: absolute; right: 10px; bottom: 10px; background: color-mix(in srgb, var(--surface) 85%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: var(--shadow-sm); }
.wh-photo label.icon-btn { cursor: pointer; }
.wh-photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wh-body { display: grid; gap: 12px; align-content: start; animation: rise .45s .05s cubic-bezier(.2,.8,.2,1) both; }
.wh-body h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 680; letter-spacing: -.032em; line-height: 1.12; text-wrap: balance; }
.wh-body h1 .vint { color: var(--text-3); font-weight: 560; }
.wh-sub { color: var(--text-2); font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts .pill { height: 28px; padding: 0 11px; font-size: 13px; }
.verdict { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 15px; font-weight: 620; }
.verdict .ico { width: 20px; height: 20px; }
.verdict-loved { background: var(--accent-soft); color: var(--accent-text); }
.verdict-loved .ico { fill: currentColor; animation: heartbeat 1.6s .4s ease-in-out 2; }
.verdict-agree { background: var(--ok-soft); color: var(--ok); }
.verdict-waiting { color: var(--text-3); font-weight: 520; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.person { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.person.me { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.person-head { display: flex; align-items: center; gap: 10px; }
.avatar-i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3); font-size: 14px; font-weight: 750; color: var(--text-2); flex: none; }
.person.me .avatar-i { background: var(--ink); color: var(--ink-text); }
.person-head b { font-size: 15px; font-weight: 650; }
.person-head .muted { margin-left: auto; font-size: 13px; }
.person .note-ro { font-size: 14.5px; color: var(--text-2); white-space: pre-line; }
.person .waiting { font-size: 14px; color: var(--text-3); font-style: italic; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tagrow .chip { height: 30px; padding: 0 11px; font-size: 12.5px; }
.tagrow .tag-ro { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 580; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.note-input { width: 100%; min-height: 84px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); font-size: 15px; line-height: 1.45; resize: vertical; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.note-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.saved-tick { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ok); opacity: 0; transition: opacity .25s ease; }
.saved-tick.on { opacity: 1; }
.saved-tick .ico { width: 14px; height: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 10px 0; }
.timeline li + li::before { content: ""; position: absolute; left: 14.5px; top: -10px; height: 20px; border-left: 1px dashed var(--line-2); }
.tl-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.tl-ico .ico { width: 16px; height: 16px; }
.tl-body b { font-size: 14.5px; font-weight: 640; }
.tl-body p { font-size: 13.5px; color: var(--text-3); }
.cellar-box { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.cellar-box .count { font-size: 30px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.cellar-box .count small { font-size: 14px; }
.window { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--text-2); }
.win-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.win-ready { background: var(--ok-soft); color: var(--ok); }
.win-soon, .win-past { background: var(--accent-soft); color: var(--accent-text); }
.win-wait { background: var(--surface-2); color: var(--text-2); }
.suggest { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px dashed var(--line-2); background: transparent; color: var(--text-3); font-size: 13px; font-weight: 560; cursor: pointer; transition: color .15s ease, border-color .15s ease, background-color .15s ease, transform .2s cubic-bezier(.3,1.5,.5,1); }
.suggest:hover { color: var(--text); border-color: var(--accent); background: var(--accent-softer); }
.suggest:active { transform: scale(.96); }
.suggest .ico { width: 14px; height: 14px; color: var(--accent-text); }
.suggest.taken { animation: take .4s cubic-bezier(.3,1.6,.5,1); }
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 18px; }
.danger-zone form { display: contents; }

.burst { position: fixed; inset: 0; z-index: 99; width: 100%; height: 100%; pointer-events: none; }
.ac-list li b { font-weight: inherit; }
.ac-wrap { position: relative; display: block; }
.stack { display: grid; gap: 2px; min-width: 0; }
.sort-select { border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; padding: 0 2px; cursor: pointer; }
.add-top .ico { width: 16px; height: 16px; }
@media (max-width: 899px) { .add-top { display: none; } }
.stack-cards { display: grid; align-content: start; }

/* photo zoom */
.zoom { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: rgb(9 9 11 / .9); animation: fade .2s ease both; cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: var(--shadow-lg); animation: cel-in .35s cubic-bezier(.3,1.3,.5,1) both; }

/* ---- edit ---------------------------------------------------------------------------- */
.edit-page .page { max-width: 760px; padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
.edit-head { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; margin-bottom: 18px; }
.edit-head .wr-photo { width: 72px; height: 90px; cursor: zoom-in; }
.form-card { display: grid; gap: 14px; }
.form-card > h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; }
.form-card > h2 .f { font-size: 13.5px; margin-left: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 > :first-child { grid-column: 1 / -1; } }
.field .f { font-size: 12px; }
.field select, .field textarea { height: 44px; padding: 0 13px; width: 100%; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg); font-size: 15px; outline: none; }
.field input::placeholder { color: var(--text-3); opacity: .75; }
.field input.suggested::placeholder { color: var(--text-3); opacity: .9; font-style: italic; }
.ac { position: relative; }
.card:focus-within { z-index: 5; } /* suggestion lists hang over the next card */
.ac-wrap { position: relative; }
.ac-use { position: absolute; right: 6px; top: 50%; translate: 0 -50%; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); font-size: 12.5px; font-weight: 650; cursor: pointer; animation: pop .3s cubic-bezier(.3,1.6,.5,1); }
.ac-use .ico { width: 14px; height: 14px; }
.ac-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; animation: rise .18s ease both; }
.ac-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 14.5px; cursor: pointer; }
.ac-list li span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--surface-2); }
.ac-list mark { background: none; color: var(--accent-text); font-weight: 650; }
.grapes-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg); }
.grapes-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.grapes-box input { flex: 1; min-width: 120px; height: 30px; border: 0; background: transparent; outline: none; font-size: 15px; padding: 0 6px; }
.grape { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 11px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 580; animation: pop .25s cubic-bezier(.3,1.6,.5,1); }
.grape button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); }
.grape button .ico { width: 13px; height: 13px; }
.grape-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.tasting-edit { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.tasting-edit header { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 640; }
.tasting-edit .field input, .tasting-edit .field select { background: var(--surface); }
.remove-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.remove-toggle input { accent-color: var(--danger); }
.tasting-edit:has(.remove-toggle input:checked) { opacity: .5; }
.cur-toggle { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.cur-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cur-toggle label { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; font-weight: 650; color: var(--text-3); cursor: pointer; }
.cur-toggle input:checked + label { background: var(--thumb); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.price-row { display: flex; gap: 8px; align-items: end; }
.price-row .field { flex: 1; }

/* ---- cellar ---------------------------------------------------------------------------- */
.cellar-group { margin-top: 22px; }
.cellar-group > header { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 10px; }
.cellar-group h2 { font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.cellar-group header .muted { margin-left: auto; font-size: 13px; }
.cellar-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.cellar-row + .cellar-row { margin-top: 8px; }
.cellar-row .wr-photo { width: 46px; height: 58px; border-radius: 10px; }
.cellar-row .wr-title { font-size: 15px; }
.mini-stepper { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.mini-stepper button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); }
.mini-stepper button:hover { background: var(--surface); color: var(--text); }
.mini-stepper button .ico { width: 16px; height: 16px; }
.mini-stepper output { min-width: 26px; text-align: center; font-size: 16px; font-weight: 720; font-variant-numeric: tabular-nums; }
.mini-stepper output.bump { animation: bump .35s cubic-bezier(.3,1.6,.5,1); }
.open-btn { height: 34px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }

/* ---- tour ---------------------------------------------------------------------------- */
.tour-map { display: block; width: 100%; max-width: 420px; margin: 0 auto; overflow: visible; }
.hex { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; transition: transform .3s cubic-bezier(.3,1.5,.5,1); transform-box: fill-box; transform-origin: center; }
.hex-1 { fill: color-mix(in srgb, var(--accent) 22%, var(--surface)); stroke: color-mix(in srgb, var(--accent) 40%, transparent); }
.hex-2 { fill: color-mix(in srgb, var(--accent) 48%, var(--surface)); stroke: color-mix(in srgb, var(--accent) 60%, transparent); }
.hex-3 { fill: var(--accent); stroke: var(--accent-strong); }
.hex-cell { cursor: pointer; }
.hex-cell:hover .hex { transform: scale(1.06); }
.hex-cell.empty { cursor: default; }
.hex-cell.empty:hover .hex { transform: none; }
.hex-name { font: 620 10.5px/1 "Geist", ui-sans-serif, sans-serif; fill: var(--text-2); text-anchor: middle; letter-spacing: -.01em; pointer-events: none; }
.hex-n { font: 750 17px/1 "Geist", ui-sans-serif, sans-serif; fill: var(--text); text-anchor: middle; pointer-events: none; font-variant-numeric: tabular-nums; }
.hex-cell.empty .hex-n { fill: var(--text-3); font-weight: 500; }
.hex-3 ~ .hex-name, .hex-3 ~ .hex-n { fill: var(--accent-ink); }
.hex-cell { animation: hex-in .5s cubic-bezier(.3,1.4,.5,1) both; }
.tour-legend { display: flex; justify-content: center; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.tour-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.lg-0 { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); } .lg-1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); } .lg-2 { background: color-mix(in srgb, var(--accent) 48%, var(--surface)); } .lg-3 { background: var(--accent); }
.country-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.country-chips a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 580; }
.country-chips b { font-variant-numeric: tabular-nums; color: var(--accent-text); }
.months { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.months a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; transition: background-color .15s ease; }
.months a:hover { background: var(--surface-2); }
.months .wr-photo { width: 40px; height: 50px; border-radius: 9px; }
.months b { font-size: 14.5px; font-weight: 640; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.months span.muted { font-size: 12.5px; }
.trophy .f { display: block; font-size: 11.5px; margin-top: -3px; }
.trophy .pair-hint { font-size: 11px; color: var(--text-3); font-style: italic; }

/* ---- celebrations ------------------------------------------------------------------------ */
.celebrate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgb(9 9 11 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .3s ease both; }
.celebrate .sparks, .dialog .sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cel-card { display: none; position: relative; width: 100%; max-width: 400px; padding: 32px 28px 28px; border-radius: 26px; background: var(--surface); text-align: center; box-shadow: var(--shadow-lg), 0 0 80px -20px var(--glow-edge); }
.cel-card.on { display: block; animation: cel-in .6s cubic-bezier(.3,1.4,.5,1) both; }
.cel-badge { width: 112px; height: 112px; margin: -86px auto 14px; display: grid; place-items: center; border-radius: 30px; background: var(--surface); box-shadow: var(--shadow-lg); padding: 12px; animation: badge-spin 1s .1s cubic-bezier(.3,1.4,.5,1) both; }
.cel-badge > .ico { width: 54px; height: 54px; color: var(--accent-text); }
.pass-badge { background: var(--accent); color: var(--accent-ink); font-size: 46px; font-weight: 800; letter-spacing: -.05em; }
.cel-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.cel-card h2, .dialog h2 { font-size: 26px; font-weight: 720; letter-spacing: -.03em; margin: 6px 0 8px; }
.cel-card p, .dialog p { color: var(--text-2); }
.cel-sub { margin-top: 10px; font-size: 13.5px; }
.cel-actions { position: fixed; left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.cel-actions .btn { min-width: 160px; height: 48px; border-radius: 14px; font-size: 15px; }
.dialog { width: min(420px, calc(100% - 32px)); border: 0; padding: 0; border-radius: 26px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: visible; }
.dialog::backdrop { background: rgb(9 9 11 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-body { padding: 30px 26px 24px; text-align: center; display: grid; gap: 4px; }
.dialog-body .cel-badge { margin-top: -84px; }
.dialog-body .btn { margin-top: 16px; }
.toast { position: fixed; z-index: 90; left: 50%; top: calc(76px + env(safe-area-inset-top)); translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: toast-in .4s cubic-bezier(.3,1.4,.5,1) both; max-width: calc(100% - 32px); }
.toast .ico { color: var(--accent); }
.toast.pr { background: var(--accent); color: var(--accent-ink); }
.toast.pr .ico { color: var(--accent-ink); }

/* ---- empty / login ----------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px 64px; border: 1px dashed var(--line-2); border-radius: 20px; background: radial-gradient(ellipse 55% 65% at 50% 0%, var(--accent-softer), transparent); animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.empty h1, .empty h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; }
.empty p { color: var(--text-3); max-width: 360px; font-size: 14.5px; }
.empty .btn { margin-top: 14px; }
.empty-art { width: 168px; height: 126px; overflow: visible; }
.ea-shadow { fill: var(--text); opacity: .07; transform-origin: 80px 106px; animation: shadow 3.2s ease-in-out infinite; }
.ea-float { animation: bob 3.2s ease-in-out infinite; }
.ea-glass { fill: var(--ink); }
.ea-wine { fill: var(--accent); }
.ea-face { fill: none; stroke: var(--ink-text); stroke-width: 2.4; stroke-linecap: round; }
.ea-spark { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
.ea-spark-2 { animation-delay: .8s; } .ea-spark-3 { animation-delay: 1.5s; }

.login-page { display: grid; place-items: center; align-content: center; gap: 20px; padding: 80px 16px 40px; position: relative; overflow-x: hidden; }
.login-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--dots) 1px, transparent 1.2px); background-size: 22px 22px; -webkit-mask: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%); mask: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%); }
.login-page::after { content: ""; position: fixed; z-index: -1; pointer-events: none; width: 520px; height: 520px; left: 50%; top: 42%; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); filter: blur(10px); }
.login-corner { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 36px 32px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.login-mark { margin-bottom: 22px; }
.login-mark .logo { width: 44px; height: 44px; }
.login-mark .logo-glass { animation: glass-clink 1.1s .35s cubic-bezier(.3,1.4,.5,1) both; }
.login-mark .logo-wine { animation: wine-level 1.1s .35s cubic-bezier(.3,1.4,.5,1) both; }
.login-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.login-lede { margin-top: 6px; color: var(--text-3); font-size: 14.5px; }
.login-form { display: grid; gap: 14px; margin-top: 26px; }
.login-form .btn-block { margin-top: 8px; }
.login-foot { font-size: 12.5px; color: var(--text-3); }

/* ---- small screens --------------------------------------------------------------------- */
@media (max-width: 719px) {
  .topbar-inner { height: 56px; gap: 8px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .topbar-end { gap: 4px; }
  .userbox { padding-left: 6px; gap: 0; }
  .icon-btn { width: 40px; height: 40px; }
  .theme-toggle { display: none; }
  .settings .theme-toggle { display: inline-flex; }
  .page { padding: 24px 16px 120px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .hero { margin-bottom: 18px; }
  .card { padding: 16px; border-radius: 16px; }
  .card-title { font-size: 20px; }
  .login-card { padding: 30px 22px 24px; border-radius: 20px; }
}
@media (pointer: coarse) { .theme-toggle { --seg: 40px; } }

@media (max-width: 719px) {
  .wine-row { gap: 12px; padding-right: 12px; }
  .card.month-card { grid-template-columns: 78px minmax(0, 1fr); gap: 14px; }
  .month-card .mc-photo { width: 78px; height: 98px; }
}

/* ---- keyframes ----------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); } 30% { transform: rotate(-8deg); }
  45% { transform: rotate(14deg); } 60% { transform: rotate(-4deg); } 75% { transform: rotate(10deg); }
}
@keyframes glass-clink { 0%, 100% { transform: none; } 35%, 55% { transform: rotate(-12deg); } }
@keyframes wine-level { 0%, 100% { transform: none; } 35%, 55% { transform: rotate(12deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow { from { width: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-in { from { transform: rotate(-90deg) scale(.6); } }
@keyframes tilt-in { from { transform: rotate(40deg) scale(.6); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes float-y { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }
@keyframes arm { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(4deg); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: .08; } 50% { transform: scaleX(.86); opacity: .05; } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.5) rotate(45deg); opacity: .4; } }
@keyframes twinkle-once { 0% { transform: scale(0) rotate(-120deg); } 100% { transform: none; } }
@keyframes ember { 0% { opacity: 0; transform: translateY(2px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes shake { 20%, 80% { transform: translateX(-2px); } 40%, 60% { transform: translateX(3px); } }
@keyframes pop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 33% { transform: scale(1.08, .95) rotate(2deg); } 66% { transform: scale(.95, 1.06) rotate(-1deg); } }
@keyframes glow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes nudge { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes cel-in { from { opacity: 0; transform: translateY(30px) scale(.9); } }
@keyframes badge-spin { from { transform: rotateY(-180deg) scale(.4); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.95); } }
@keyframes bubble { 0% { opacity: 0; transform: translateY(1px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes star-pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes crown-bob { 0%, 100% { transform: translateY(-10px) rotate(-6deg); } 50% { transform: translateY(-13px) rotate(6deg); } }
@keyframes shot-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes develop { from { opacity: 0; filter: blur(8px) saturate(.4); transform: scale(1.04); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } 40% { transform: scale(.95); } 60% { transform: scale(1.15); } }
@keyframes take { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes hex-in { from { opacity: 0; transform: scale(.6); } }

/* ---- reduced motion ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
}

/* ---- utilities (inline styles are blocked by the CSP) --------------------------------------- */
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.bleed { margin-left: -10px; margin-right: -10px; }
.page-narrow { max-width: 820px; }
.pr-card { background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.num-r { text-align: right; }
