/* ============================================================
   AIWine — companion app styles
   Mobile adaptation of the aiwine.co.nz design language:
   warm bone, claret, aged brass · Cormorant + Manrope + mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Manrope:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #F4EFE5;
  --bg-alt: #EDE6D8;
  --card: #FAF6EE;
  --card-2: #FFFCF6;
  --ink: #1B1410;
  --ink-soft: #4A3D34;
  --muted: #8B7E6E;
  --faint: #B6A992;
  --line: #D8CFBE;
  --line-soft: #E6DECF;
  --claret: #5C1B27;
  --claret-deep: #3A0E18;
  --brass: #A98654;
  --brass-soft: #C9A878;
  --gold: #C9A45A;
  --green: #3F6B4B;

  /* accent = primary action colour (tweakable claret/brass) */
  --accent: var(--claret);
  --accent-deep: var(--claret-deep);
  --on-accent: #F4EFE5;

  /* variety tints */
  --t-pinot: #6B1F2A;
  --t-syrah: #2A0E18;
  --t-chard: #C9A45A;
  --t-sauv: #93A35E;
  --t-pinotg: #D9B58C;
  --t-ries: #D7BE54;
  --t-rose: #D9889A;
  --t-sparkling: #C9B98C;

  --safe-top: 50px;
  --safe-bottom: 30px;
  --nav-h: 64px;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
}

body.accent-brass {
  --accent: #8A6A3C;
  --accent-deep: #5A4527;
  --on-accent: #FBF7EE;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea { font: inherit; color: inherit; }

.serif { font-family: 'Cormorant Garamond', Georgia, serif; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.lbl {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}

/* ============ APP SHELL ============ */
#app {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: 1;
}
.screen.active { opacity: 1; pointer-events: auto; z-index: 2; }

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 52px) 18px calc(var(--nav-h) + var(--safe-bottom) + 18px);
}
.scroll::-webkit-scrollbar { width: 0; }

/* screens that own the top (camera/chat) */
.screen.full .scroll { padding: 0; }

/* ============ TOP BAR ============ */
.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: calc(var(--safe-top) + 46px);
  padding: var(--safe-top) 18px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  z-index: 5; pointer-events: none;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 16px;
  background: linear-gradient(var(--bg), rgba(244, 239, 229, 0));
  pointer-events: none;
}
.topbar .wm { display: flex; align-items: baseline; gap: 2px; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.topbar .wm .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--claret); transform: translateY(-7px); }
.topbar .wm .tld { font-size: 12px; color: var(--muted); font-style: italic; font-weight: 400; }
.icon-btn {
  pointer-events: auto;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line);
}
.top-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.case-btn { position: relative; }
.case-badge {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--claret); color: #F4EFE5;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--bg);
}
.case-badge[hidden] { display: none; }

/* ============ ENGAGEMENT: missions, quests, stamps, personality ============ */
/* wine personality */
.persona-card { padding: 16px; margin-top: 0; }
.persona-lead { font-family: 'Cormorant Garamond', serif; font-size: 22px; line-height: 1.1; }
.persona-lead em { font-style: italic; color: var(--claret); }
.persona-blurb { color: var(--ink-soft); font-size: 13px; line-height: 1.45; margin-top: 6px; }
.persona-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-top: 14px; background: var(--bg-alt); }
.persona-bar span { display: block; height: 100%; }
.persona-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 11px; }
.pa-leg { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.pa-leg b { color: var(--ink); }
.pa-dot { width: 9px; height: 9px; border-radius: 50%; }
.persona-shift { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--claret); font-style: italic; }
.persona-shift svg { flex: none; }

/* monthly mission card (passport) */
.mission-card { background: linear-gradient(155deg, #241019, var(--claret-deep)); color: #F4EFE5; border-radius: var(--r-lg); padding: 16px; border: 1px solid var(--claret-deep); }
.mission-card.done { background: linear-gradient(155deg, #2a2113, #4a3618); border-color: var(--brass); }
.mc-top { display: flex; justify-content: space-between; align-items: center; }
.mc-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass-soft); }
.mc-days { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: rgba(244,239,229,0.7); }
.mc-main { display: flex; gap: 15px; align-items: center; margin-top: 12px; }
.mc-ring { position: relative; width: 64px; height: 64px; flex: none; }
.mc-ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mc-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 20px; line-height: 1.05; }
.mc-desc { font-size: 13px; color: rgba(244,239,229,0.82); line-height: 1.4; margin-top: 4px; }
.mc-foot { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--brass-soft); margin-top: 9px; display: flex; align-items: center; gap: 6px; }
.mc-foot b { color: #F4EFE5; }

/* discovery challenges */
.quest-list { display: flex; flex-direction: column; gap: 12px; }
.quest-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px; }
.quest-card.done { border-color: var(--brass-soft); background: linear-gradient(160deg, rgba(169,134,84,0.08), var(--card)); }
.qc-head { display: flex; gap: 11px; align-items: flex-start; }
.qc-ic { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border: 1px solid var(--line-soft); }
.qc-h { flex: 1; min-width: 0; }
.qc-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.qc-badge { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); border: 1px solid var(--brass-soft); border-radius: 4px; padding: 1px 5px; }
.qc-desc { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.qc-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-soft); flex: none; font-weight: 600; }
.qc-track { height: 6px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; margin: 12px 0 11px; }
.qc-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.qc-items { display: flex; flex-wrap: wrap; gap: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); background: var(--bg-alt); border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px 10px 4px 6px; }
.chk.on { color: var(--ink); border-color: var(--brass-soft); }
.chk .tick { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chk.on .tick { background: var(--brass); border-color: var(--brass); }
.qc-reward { display: flex; align-items: center; gap: 7px; margin-top: 11px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.04em; color: var(--muted); }

/* passport stamps */
.stamp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stamp { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 8px; text-align: center; opacity: 0.5; filter: grayscale(0.6); }
.stamp.on { opacity: 1; filter: none; border-style: solid; }
.stamp-medal { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border: 1.5px dashed var(--line); }
.stamp.on .stamp-medal { border-style: solid; border-color: var(--brass-soft); background: radial-gradient(circle at 35% 30%, rgba(201,168,120,0.28), rgba(169,134,84,0.12)); }
.stamp-t { font-weight: 700; font-size: 11.5px; line-height: 1.15; }
.stamp-s { font-size: 9.5px; color: var(--muted); margin-top: 3px; line-height: 1.2; }
.stamp.on .stamp-s { font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; color: var(--brass); }

/* home: monthly mission strip */
.home-mission { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 14px; }
.home-mission.done { border-color: var(--brass-soft); background: linear-gradient(160deg, rgba(169,134,84,0.08), var(--card)); }
.hm-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border: 1px solid var(--line-soft); }
.hm-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hm-t { font-weight: 600; font-size: 14px; }
.hm-s { color: var(--muted); font-size: 12px; line-height: 1.3; }
.hm-track { height: 5px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; margin-top: 5px; }
.hm-fill { display: block; height: 100%; border-radius: 999px; }
.hm-meta { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; color: var(--claret); flex: none; }

/* ============ CASE / CART ============ */
.case-list { display: flex; flex-direction: column; gap: 10px; margin-top: calc(var(--safe-top) + 58px); }
.case-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; }
.case-row .cr-art { width: 56px; height: 56px; border-radius: var(--r-sm); display: flex; align-items: flex-end; justify-content: center; flex: none; overflow: hidden; padding-bottom: 4px; background: radial-gradient(120% 80% at 50% 8%, #FBF7EF, #E6DAC2); border: 1px solid rgba(92,27,39,0.12); }
.case-row .cr-bd { flex: 1; min-width: 0; }
.case-row .cr-bd .nm { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 17px; line-height: 1.1; }
.case-row .cr-bd .mt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.case-row .cr-bd .pr { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.cr-qty { display: flex; align-items: center; gap: 10px; flex: none; }
.cr-qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.cr-qty button:active { background: var(--bg-alt); }
.cr-qty span { font-family: 'JetBrains Mono', monospace; font-size: 14px; min-width: 14px; text-align: center; }
.case-empty { margin-top: calc(var(--safe-top) + 120px); text-align: center; padding: 0 30px; }
.case-empty .ce-ic { margin-bottom: 14px; }
.case-empty .ce-t { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 24px; }
.case-empty .ce-s { color: var(--muted); font-size: 14px; margin-top: 8px; line-height: 1.5; }
.case-bar { display: flex; align-items: center; gap: 12px; }
.case-bar .cb-total { display: flex; flex-direction: column; flex: none; }
.case-bar .cb-total .gst { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.case-bar .cb-total .lbl { font-size: 9px; }
.case-bar .cb-total .amt { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 23px; line-height: 1; }
.case-bar .btn.block { flex: 1; }

/* ============ HEADINGS ============ */
.h-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); margin-bottom: 8px; }
.h-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 34px; line-height: 1.04; letter-spacing: -0.01em; }
.h-sub { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 2px 12px; }
.section-h .t { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 22px; white-space: nowrap; }
.section-h .a { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); white-space: nowrap; flex: none; }

/* ============ CARD ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--on-accent);
  border-radius: 999px; padding: 14px 22px;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(0.97); }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.brass { background: var(--brass); color: #1B1410; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  transition: all .12s ease;
}
.chip:active { transform: scale(0.96); }
.chip.sel { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ============ BOTTOM NAV ============ */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex; align-items: stretch;
  background: rgba(250,246,238,0.86);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--faint); position: relative;
}
.tab .ic { width: 24px; height: 24px; }
.tab .tx { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.tab.on { color: var(--accent); }
.tab.scan-tab .ic { width: 26px; height: 26px; }

/* hide tabbar on full screens (onboarding) */
#app.no-nav .tabbar { display: none; }

/* ============ HOME ============ */
.greet { margin-top: 4px; }
.greet .hi { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 30px; line-height: 1.05; }
.greet .hi em { font-style: italic; color: var(--claret); }
.greet .meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

.prompt-card {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--claret), var(--claret-deep));
  color: #F4EFE5; border-radius: var(--r-lg); padding: 20px;
  border: 1px solid var(--claret-deep);
}
.prompt-card .k { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-soft); }
.prompt-card .q { font-family: 'Cormorant Garamond', serif; font-size: 23px; line-height: 1.2; margin: 10px 0 16px; }
.prompt-card .go { display: inline-flex; align-items: center; gap: 8px; background: rgba(244,239,229,0.14); border: 1px solid rgba(244,239,229,0.25); color: #F4EFE5; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.prompt-card .grape { position: absolute; right: -14px; bottom: -20px; opacity: 0.16; }

.sugg { display: flex; flex-direction: column; gap: 10px; }
.sugg-row {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 14px;
  transition: transform .12s ease;
}
.sugg-row:active { transform: scale(0.985); }
.sugg-row .ico { width: 42px; height: 42px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); }
.sugg-row .bd { flex: 1; min-width: 0; }
.sugg-row .bd .t { font-weight: 600; font-size: 14.5px; }
.sugg-row .bd .s { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.sugg-row .ch { color: var(--faint); flex: none; }

/* mini bottle row */
.bottle-rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.bottle-rail::-webkit-scrollbar { display: none; }
.bottle-card { flex: none; width: 138px; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.bottle-art {
  height: 168px; border-radius: 0; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center; padding: 10px;
  background: radial-gradient(120% 80% at 50% 8%, #FBF7EF 0%, #F1E9D8 55%, #E6DAC2 100%);
  border: 0; border-bottom: 1px solid var(--line);
}
.bottle-art::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(92,27,39,0.14); border-radius: 3px; pointer-events: none; z-index: 3; }
.bottle-art::after { content: ''; position: absolute; left: 50%; bottom: 16px; width: 54%; height: 12px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(40,20,10,0.28), transparent 70%); filter: blur(3px); z-index: 1; }
.bottle-art .ba-shot { position: relative; z-index: 2; height: 78%; width: auto; filter: drop-shadow(0 8px 11px rgba(0,0,0,0.22)); }
.bottle-art .ba-region { position: absolute; top: 9px; left: 9px; z-index: 4; font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--claret); background: rgba(255,255,255,0.8); border: 1px solid rgba(92,27,39,0.16); border-radius: 999px; padding: 3px 7px 3px 6px; display: inline-flex; align-items: center; gap: 4px; max-width: calc(100% - 54px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottle-art .ba-region::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--brass); flex: none; }
.bottle-art .ba-seal { position: absolute; top: 8px; right: 8px; z-index: 4; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #C9A878, #8a6a3c); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(90,60,20,0.35); border: 1.5px solid rgba(255,255,255,0.5); }
.bottle-art .ba-seal b { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 14px; line-height: 1; }
.bottle-art .ba-seal i { font-family: 'JetBrains Mono', monospace; font-style: normal; font-size: 5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.9; margin-top: 1px; }
.bottle-art .ba-sample { position: absolute; left: 50%; top: 46%; transform: translateX(-50%); z-index: 5; width: 74%; text-align: center; background: linear-gradient(180deg,#f6efe0,#ece0c9); border: 1px solid #d8c9a8; border-radius: 2px; padding: 7px 6px; box-shadow: 0 2px 6px rgba(0,0,0,0.24); }
.bottle-art .ba-sample .bs-w { display: block; font-family: 'JetBrains Mono', monospace; font-size: 5.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #8a6a3c; }
.bottle-art .ba-sample .bs-n { display: block; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 12px; line-height: 1.05; color: #3a2a18; margin-top: 2px; }
.bottle-card .bd { padding: 8px 10px 11px; }
.bottle-card .wy { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottle-card .nm { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 15px; line-height: 1.1; margin-top: 3px; }
.bottle-card .vr { color: var(--muted); font-size: 11px; margin-top: 2px; }
.bottle-card .pr { font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-top: 5px; color: var(--ink-soft); }

/* the wine "bottle" glyph block */
.bottleglyph { width: 30px; height: 92px; border-radius: 7px 7px 4px 4px; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.bottleglyph::before { content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 9px; height: 14px; border-radius: 3px; background: inherit; }
.bottleglyph .cap { position: absolute; left: 4px; right: 4px; bottom: 18px; height: 30px; border-radius: 3px; background: rgba(244,239,229,0.92); }

/* ============ SCAN ============ */
.cam {
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 30%, #2a2320, #14100d 80%);
  display: flex; flex-direction: column;
}
.cam .cam-top { padding: calc(var(--safe-top) + 6px) 18px 0; display: flex; align-items: center; justify-content: space-between; color: #F4EFE5; }
.cam .cam-top .lbl { color: rgba(244,239,229,0.7); }
.cam .vp { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; }
.reticle { width: 232px; height: 320px; position: relative; }
.reticle .corner { position: absolute; width: 30px; height: 30px; border: 2.5px solid rgba(244,239,229,0.9); }
.reticle .c1 { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.reticle .c2 { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.reticle .c3 { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.reticle .c4 { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.reticle .ghost-bottle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0.5; }
.scan-line { position: absolute; left: 6px; right: 6px; height: 2px; background: linear-gradient(90deg, transparent, var(--brass-soft), transparent); box-shadow: 0 0 12px 2px rgba(201,168,120,0.6); top: 8px; }
.cam.scanning .scan-line { animation: scanmove 1.5s ease-in-out infinite; }
@keyframes scanmove { 0%,100% { top: 8px; } 50% { top: 304px; } }
.cam .hint { text-align: center; color: rgba(244,239,229,0.78); font-size: 13px; padding: 0 30px; min-height: 20px; }
.cam .cam-bottom { padding: 16px 18px calc(var(--nav-h) + var(--safe-bottom) + 18px); display: flex; align-items: center; justify-content: center; gap: 34px; }
.shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid rgba(244,239,229,0.9); display: flex; align-items: center; justify-content: center; }
.shutter .core { width: 56px; height: 56px; border-radius: 50%; background: #F4EFE5; transition: transform .12s; }
.shutter:active .core { transform: scale(0.88); }
.cam-mini { width: 46px; height: 46px; border-radius: 12px; display:flex;align-items:center;justify-content:center; color: rgba(244,239,229,0.85); border: 1px solid rgba(244,239,229,0.25); }
.analyzing { color: var(--brass-soft); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }

/* match detail sheet */
.detail-hero { position: relative; padding: calc(var(--safe-top) + 10px) 18px 20px; color: #F4EFE5; overflow: hidden; }
.detail-hero .bk { position: absolute; inset: 0; z-index: 0; }
.detail-hero .bk::after { content:''; position:absolute; inset:0; background: linear-gradient(160deg, rgba(0,0,0,0.15), rgba(0,0,0,0.55)); }
.detail-hero > * { position: relative; z-index: 1; }
.detail-hero .back { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,0.28); border: 1px solid rgba(244,239,229,0.25); display: flex; align-items: center; justify-content: center; }
.detail-hero .match-tag { display: inline-flex; align-items: center; gap: 7px; background: rgba(244,239,229,0.16); border: 1px solid rgba(244,239,229,0.3); padding: 6px 12px; border-radius: 999px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.detail-hero .dh-name { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 33px; line-height: 1.05; margin-top: 14px; }
.detail-hero .dh-meta { font-size: 13px; opacity: 0.85; margin-top: 6px; }
.detail-hero .dh-bottle { position: absolute; right: 12px; top: 50%; transform: translateY(-32%); z-index: 1; }

.stat-row { display: flex; gap: 10px; margin: 16px 0; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; text-align: center; }
.stat .v { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 24px; line-height: 1; }
.stat .v small { font-size: 13px; color: var(--muted); }
.stat .k { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.notes-p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tag { font-size: 11.5px; padding: 6px 11px; border-radius: 999px; background: var(--bg-alt); color: var(--ink-soft); border: 1px solid var(--line-soft); }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pair { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 11px; font-size: 13px; }

.sticky-buy {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  padding: 12px 18px calc(var(--safe-bottom) + 12px);
  background: linear-gradient(rgba(244,239,229,0), var(--bg) 30%);
  display: flex; gap: 10px;
}

/* ============ PASSPORT ============ */
.pp-head { background: linear-gradient(160deg, #241019, var(--claret-deep)); color: #F4EFE5; border-radius: var(--r-lg); padding: 20px; position: relative; overflow: hidden; }
.pp-head .ring { position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(201,168,120,0.3); }
.pp-head .ring2 { position: absolute; right: -10px; top: -70px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(201,168,120,0.18); }
.pp-head .who { display: flex; align-items: center; gap: 13px; }
.pp-head .av { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--brass), var(--claret)); display: flex; align-items: center; justify-content: center; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 22px; color: #F4EFE5; border: 1px solid rgba(244,239,229,0.3); }
.pp-head .who .nm { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 21px; white-space: nowrap; }
.pp-head .who .sub { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass-soft); margin-top: 2px; }
.pp-stats { display: flex; margin-top: 18px; }
.pp-stats .s { flex: 1; text-align: center; position: relative; }
.pp-stats .s + .s::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: rgba(244,239,229,0.18); }
.pp-stats .v { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 26px; line-height: 1; }
.pp-stats .k { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244,239,229,0.6); margin-top: 5px; }

/* segmented control */
.seg { display: flex; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 18px 0 4px; }
.seg button { flex: 1; padding: 9px 0; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card-2); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.seg.seg5 button { font-size: 11px; padding: 8px 0; letter-spacing: -0.01em; }

/* taste profile bars */
.taste-bar { margin-bottom: 12px; }
.taste-bar .tl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.taste-bar .tl .pc { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); }
.taste-track { height: 8px; border-radius: 6px; background: var(--bg-alt); overflow: hidden; }
.taste-fill { height: 100%; border-radius: 6px; }

/* badges */
.badge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 14px; display: flex; flex-direction: column; gap: 9px; }
.badge.locked { opacity: 0.55; }
.badge .bmedal { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, var(--brass-soft), var(--brass)); color: #2A0E18; border: 1px solid rgba(0,0,0,0.1); }
.badge.locked .bmedal { background: var(--bg-alt); color: var(--faint); border-color: var(--line); }
.badge .bt { font-weight: 700; font-size: 13.5px; }
.badge .bs { color: var(--muted); font-size: 11.5px; line-height: 1.35; }

/* history list */
.hist { display: flex; flex-direction: column; }
.hist-row { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.hist-row:last-child { border-bottom: 0; }
.hist-row .hb { flex: none; }
.hist-row .hd { flex: 1; min-width: 0; }
.hist-row .hd .nm { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 16px; line-height: 1.1; }
.hist-row .hd .mt { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hist-row .hd .note { color: var(--ink-soft); font-size: 12.5px; margin-top: 6px; font-style: italic; }
.stars { display: inline-flex; gap: 1px; color: var(--brass); }
.stars .e { color: var(--line); }

/* map */
.map-wrap { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; overflow: hidden; }
.nz-map { width: 100%; height: auto; max-height: 360px; display: block; margin: 0 auto; }
.map-legend { display: flex; gap: 14px; margin-top: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.map-legend .lg { display: flex; align-items: center; gap: 6px; }
.map-dot { width: 9px; height: 9px; border-radius: 50%; }

/* region list (aligned to AIWine directory) */
.region-list { padding: 4px 4px; }
.region-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.region-row:last-child { border-bottom: 0; }
.region-row:active { background: var(--bg-alt); }
.region-row .rdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.region-row .rn { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.region-row .rlive { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); border: 1px solid var(--brass-soft); border-radius: 999px; padding: 2px 6px; }
.region-row .rc { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); flex: none; }
.region-row .rstate { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); flex: none; width: 56px; text-align: right; }
.region-row .rstate.on { color: var(--claret); }

/* cellar */
.cellar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.region-row .rsoon { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

/* cellar summary strip */
.cellar-summary { display: flex; gap: 8px; margin-top: calc(var(--safe-top) + 4px); }
.cellar-summary .cz { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 8px; text-align: center; }
.cellar-summary .cz .v { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 21px; line-height: 1; color: var(--claret); }
.cellar-summary .cz .k { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.open-btl { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--claret); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--bg); }
.open-btl:active { background: var(--bg-alt); }

/* home: region rail */
.region-rail { display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.region-rail::-webkit-scrollbar { display: none; }
.region-chip { flex: none; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 11px 15px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.region-chip:active { background: var(--bg-alt); }
.region-chip .rc-n { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 16px; white-space: nowrap; }
.region-chip .rc-c { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }

/* detail: why you'll like this */
.why-card { background: linear-gradient(160deg, rgba(169,134,84,0.10), var(--card)); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.why-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.4; color: var(--ink-soft); }
.why-row svg { flex: none; margin-top: 2px; }

/* detail: track this bottle */
.track-row { display: flex; gap: 10px; }
.track-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 10px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.track-btn:active { background: var(--bg-alt); }

/* journal note input */.note-input { width: 100%; margin-top: 14px; min-height: 64px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-alt); padding: 11px 12px; font: inherit; font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.note-input::placeholder { color: var(--faint); }
.note-input:focus { outline: none; border-color: var(--brass); background: var(--card); }
.btn.ghost.block { display: flex; width: 100%; justify-content: center; }
.hist-row .je-pill { display: inline-flex; align-items: center; background: rgba(169,134,84,0.18); color: #8A6A34; font-weight: 600; font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; border-radius: 20px; padding: 2px 9px; }

/* region browse screen */
.region-hero { margin-top: calc(var(--safe-top) + 52px); padding: 20px; border-radius: var(--r-lg); background: linear-gradient(150deg, var(--claret), var(--claret-deep)); color: #F4EFE5; border: 1px solid var(--claret-deep); }
.region-hero .rh-k { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-soft); }
.region-hero .rh-t { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 32px; line-height: 1.05; margin-top: 8px; }
.region-hero .rh-s { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: rgba(244,239,229,0.8); margin-top: 8px; }
.bottle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-top: 18px; }
.bottle-grid .bottle-card { width: 100%; }

/* ============ MEMBERSHIP ============ */
.m-hero { margin-top: calc(var(--safe-top) + 52px); padding: 22px 20px; border-radius: var(--r-lg); background: linear-gradient(150deg, #241019, var(--claret-deep)); color: #F4EFE5; border: 1px solid var(--claret-deep); position: relative; overflow: hidden; }
.m-hero-k { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-soft); }
.m-hero-t { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 31px; line-height: 1.04; margin-top: 8px; }
.m-hero-t em { color: var(--brass-soft); font-style: italic; }
.m-hero-s { font-size: 13px; line-height: 1.55; color: rgba(244,239,229,0.82); margin-top: 10px; }
.m-hero-s b { color: #F4EFE5; font-weight: 600; }
.m-all { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink-soft); background: var(--bg-alt); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 11px 13px; margin-top: 12px; line-height: 1.45; }
.m-all svg { flex: none; margin-top: 1px; }
.m-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.m-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; position: relative; }
.m-card.best { border-color: var(--acc); box-shadow: 0 14px 34px rgba(92,27,39,0.12); }
.m-card.is-current { border-color: var(--acc); }
.m-flag { position: absolute; top: -10px; right: 16px; background: var(--claret); color: #F4EFE5; font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; }
.m-card-top { display: flex; gap: 13px; align-items: flex-start; }
.m-ic { width: 42px; height: 42px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--acc), color-mix(in oklab, var(--acc), black 26%)); }
.m-name { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 24px; line-height: 1; }
.m-tag { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.4; }
.m-price { display: flex; align-items: baseline; gap: 8px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.m-amt { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 30px; line-height: 1; color: var(--ink); }
.m-per { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
.m-free-now { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--brass); background: rgba(169,134,84,0.12); border-radius: 999px; padding: 4px 10px; margin-top: 9px; }
.m-later { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--muted); margin-top: 7px; }
.m-feats { margin-top: 15px; display: flex; flex-direction: column; gap: 9px; }
.mtf-head { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.mtf-row { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.mtf-tick { flex: none; margin-top: 2px; }
.m-cta { width: 100%; margin-top: 17px; padding: 13px; border-radius: var(--r-md); background: var(--acc); color: #fff; font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; }
.m-cta:active { filter: brightness(0.94); }
.m-cta.current { background: var(--bg-alt); color: var(--ink-soft); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 7px; }
.m-cta.current svg { stroke: var(--green); }
.m-foot { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 18px; text-align: center; padding: 0 6px; }

/* membership entry row (passport profile) */
.plan-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: linear-gradient(150deg, rgba(169,134,84,0.10), var(--card)); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 14px; margin-bottom: 4px; }
.plan-row:active { background: var(--bg-alt); }
.plan-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--acc), color-mix(in oklab, var(--acc), black 26%)); }
.plan-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-k { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.plan-v { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 18px; line-height: 1; }
.plan-cta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

/* entitlements / upsell */
.founding-pill { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; background: var(--brass); border-radius: 5px; padding: 1px 5px; margin-left: 5px; vertical-align: middle; }
.section-h .lock-a { display: inline-flex; align-items: center; gap: 4px; color: var(--brass); font-weight: 600; }
.upsell { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: linear-gradient(150deg, rgba(169,134,84,0.12), var(--card)); border: 1px solid var(--brass-soft); border-radius: var(--r-md); padding: 14px 15px; }
.upsell:active { background: var(--bg-alt); }
.upsell .up-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border: 1px solid var(--line-soft); color: var(--brass); }
.upsell .up-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upsell .up-t { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 17px; line-height: 1; }
.upsell .up-s { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.upsell .up-cta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--claret); white-space: nowrap; }
.stat.club-stat { background: linear-gradient(160deg, rgba(169,134,84,0.16), var(--card)); border-color: var(--brass-soft); }
.stat.club-stat .k { color: var(--brass); font-weight: 600; }
.bottle-card .pr .mp-now { color: var(--claret); font-weight: 600; }
.bottle-card .pr .mp-was { color: var(--muted); text-decoration: line-through; font-size: 0.85em; }

/* split shipments (app case) */
.ship-note { font-size: 12px; color: var(--ink-soft); line-height: 1.5; background: rgba(169,134,84,0.10); border: 1px solid var(--brass-soft); border-radius: var(--r-sm); padding: 10px 13px; margin: 0 0 14px; }
.ship-note:first-child { margin-top: calc(var(--safe-top) + 58px); }
.ship-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 14px 11px; margin-bottom: 14px; }
.ship-card:first-child { margin-top: calc(var(--safe-top) + 58px); }
.ship-card .ship-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 4px; }
.ship-card .ship-k { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--brass); }
.ship-card .ship-w { font-family: 'Cormorant Garamond', serif; font-size: 19px; font-weight: 600; line-height: 1.1; margin-top: 2px; }
.ship-card .ship-meta { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ship-card .case-row { border-top: 1px solid var(--line-soft); padding: 10px 0; }
.ship-card .ship-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line-soft); padding-top: 9px; }
.ship-card .ship-hint { font-size: 11px; color: var(--muted); line-height: 1.4; }
.ship-card .ship-hint.good { color: var(--claret); font-weight: 600; }
.ship-card .ship-sums { display: flex; gap: 9px; white-space: nowrap; }
.ship-card .ship-disc { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--green); }
.ship-card .ship-post { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-soft); }
.market-note { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.04em; color: var(--muted); text-align: center; padding: 4px 10px 0; line-height: 1.6; }

/* ============ CONCIERGE ============ */
.chat { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-head { padding: calc(var(--safe-top) + 6px) 18px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; background: rgba(244,239,229,0.9); backdrop-filter: blur(10px); z-index: 4; }
.chat-head .sa { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, var(--claret), var(--brass)); display: flex; align-items: center; justify-content: center; }
.chat-head .nm { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 18px; line-height: 1; }
.chat-head .st { font-size: 11px; color: var(--green); display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.chat-head .st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 130px); display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; }
.chat-log::-webkit-scrollbar { display: none; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; }
.msg.bot strong { color: var(--claret); }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; border-bottom-left-radius: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* recommended wine card inside chat */
.rec-card { align-self: flex-start; max-width: 86%; display: flex; gap: 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; padding: 11px; }
.rec-card .rb { flex: none; }
.rec-card .rd .nm { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 15px; line-height: 1.1; }
.rec-card .rd .mt { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rec-card .rd .pr { font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-top: 6px; }
.rec-card .rd .add { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }

.composer {
  position: absolute; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bottom));
  padding: 10px 14px; background: rgba(244,239,229,0.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.quick-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 9px; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.quick { flex: none; font-size: 12.5px; padding: 8px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.composer .field { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 16px; }
.composer input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14.5px; padding: 7px 0; }
.composer .send { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex: none; }

/* ============ ONBOARDING ============ */
.onb { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 24px) 26px calc(var(--safe-bottom) + 24px); }
.onb .progress { display: flex; gap: 6px; margin-bottom: 30px; }
.onb .progress .p { flex: 1; height: 4px; border-radius: 3px; background: var(--line); }
.onb .progress .p.on { background: var(--accent); }
.onb .ob-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); }
.onb .ob-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 34px; line-height: 1.08; margin: 12px 0 8px; letter-spacing: -0.01em; }
.onb .ob-title em { font-style: italic; color: var(--claret); }
.onb .ob-sub { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.onb .ob-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.opt {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  padding: 16px; border-radius: var(--r-md); background: var(--card); border: 1.5px solid var(--line);
  transition: all .14s ease; text-align: left;
}
.opt:active { transform: scale(0.97); }
.opt.sel { border-color: var(--accent); background: var(--card-2); box-shadow: 0 0 0 3px rgba(92,27,39,0.08); }
.opt .oi { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); }
.opt .ot { font-weight: 600; font-size: 14.5px; }
.opt .os { font-size: 12px; color: var(--muted); }
.onb-splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; background: radial-gradient(110% 70% at 50% 25%, #2a1019, var(--claret-deep)); color: #F4EFE5; }

/* palate-quiz reveal */
.onb.reveal .ob-body { justify-content: flex-start; padding-top: 8px; }
.rv-stamp { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); background: color-mix(in oklab, var(--brass), var(--bg) 84%); border: 1px solid color-mix(in oklab, var(--brass), var(--bg) 60%); padding: 6px 11px; border-radius: 999px; }
.rv-type { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 40px; line-height: 1.04; color: var(--claret); letter-spacing: -0.01em; margin: 2px 0 6px; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 6px; }
.rv-chip { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); background: var(--card); border: 1px solid var(--line); padding: 6px 11px; border-radius: 999px; }
.rv-hero-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); margin: 22px 0 10px; }
.rv-hero { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--card); box-shadow: 0 12px 30px rgba(27,20,16,0.10); }
.rv-label { padding: 20px 20px 22px; position: relative; }
.rv-label::after { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,0.18); pointer-events: none; border-radius: 4px; }
.rv-meta { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; margin-bottom: 8px; }
.rv-name { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 27px; line-height: 1.05; }
.rv-winery { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.82; margin-top: 9px; }
.rv-hero-body { padding: 16px 18px 18px; }
.rv-note { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.rv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft, var(--line)); }
.rv-price { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 500; }
.rv-stars { color: var(--brass); letter-spacing: 2px; font-size: 13px; }

/* drink-window alert (home) */
.dw-card { margin-top: 16px; background: var(--card); border: 1px solid color-mix(in oklab, var(--brass), var(--line) 55%); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 8px 22px rgba(27,20,16,0.06); }
.dw-head { display: flex; align-items: center; gap: 10px; padding: 13px 15px 11px; background: color-mix(in oklab, var(--brass), var(--card) 88%); }
.dw-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: color-mix(in oklab, var(--brass), var(--card) 70%); flex-shrink: 0; }
.dw-h { display: flex; flex-direction: column; }
.dw-k { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); }
.dw-t { font-weight: 600; font-size: 14.5px; color: var(--ink); margin-top: 1px; }
.dw-row { display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-top: 1px solid var(--line); cursor: pointer; }
.dw-row:active { background: var(--bg-alt); }
.dw-swatch { width: 30px; height: 40px; border-radius: 4px; flex-shrink: 0; position: relative; }
.dw-swatch::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(255,255,255,0.22); border-radius: 2px; }
.dw-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dw-nm { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.dw-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-pill { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; font-weight: 600; flex-shrink: 0; }
.dw-pill.peak { background: color-mix(in oklab, var(--brass), var(--card) 72%); color: #7A5E33; }
.dw-pill.past { background: color-mix(in oklab, var(--claret), var(--card) 80%); color: var(--claret); }
.dw-reorder { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--card-2); border: 1px solid var(--line); }
.dw-reorder:active { transform: scale(0.94); }
.dw-foot { width: 100%; text-align: center; padding: 11px; border-top: 1px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); background: none; display: flex; align-items: center; justify-content: center; gap: 5px; }

/* fade-up util — transform-only so content is ALWAYS visible (no opacity:0
   base state) — reliable in DOM-snapshot captures, print & reduced-motion */
.fu { animation: fadeUp .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fadeUp { from { transform: translateY(12px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .fu { animation: none; } }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .19s; } .d4 { animation-delay: .26s; }

/* toast */
.toast { position: absolute; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 40; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== AUTH SCREEN (sign in / create account / reset) ===== */
.auth-screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 0%, #FBF7EF 0%, var(--bg, #F4EFE5) 55%, #EDE4D2 100%); padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); }
.auth-inner { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.auth-brand { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 34px; font-weight: 500; color: var(--ink, #1B1410); margin-bottom: 26px; }
.auth-brand span { color: var(--claret, #5C1B27); }
.auth-title { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 32px; font-weight: 500; line-height: 1.1; color: var(--ink, #1B1410); margin-bottom: 10px; }
.auth-sub { font-size: 14px; line-height: 1.55; color: var(--ink-soft, #4A3D34); margin-bottom: 26px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-input { width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line, #D8CFBE); background: #FFFDF8; color: var(--ink, #1B1410); font: inherit; font-size: 15px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.auth-input::placeholder { color: var(--muted, #8B7E6E); }
.auth-input:focus { border-color: var(--brass, #A98654); box-shadow: 0 0 0 3px rgba(169,134,84,.18); }
.auth-err { padding: 11px 14px; border-radius: 12px; background: rgba(92,27,39,.08); border: 1px solid rgba(92,27,39,.25); color: var(--claret, #5C1B27); font-size: 13px; line-height: 1.45; text-align: left; }
.auth-submit { margin-top: 4px; padding: 15px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.auth-link, .auth-toggle { background: none; border: none; font: inherit; font-size: 13.5px; color: var(--ink-soft, #4A3D34); margin-top: 18px; cursor: pointer; }
.auth-link { text-decoration: underline; text-underline-offset: 3px; }
.auth-toggle b { color: var(--claret, #5C1B27); font-weight: 700; }

/* ===== SOMMELIER RITUAL (concierge entry — dark room, swirling glass) ===== */
.ritual { position: fixed; inset: 0; z-index: 500; background: radial-gradient(120% 100% at 50% 30%, #17100D 0%, #0B0706 62%, #060403 100%); opacity: 0; transition: opacity .8s ease; display: block; }
.ritual.in { opacity: 1; }
.ritual-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ritual-wm { position: absolute; top: calc(26px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; color: rgba(244,239,229,0.55); letter-spacing: .02em; }
.ritual-wm span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #A98654; margin: 0 4px 2px; }
.ritual-line { position: absolute; left: 24px; right: 24px; top: 62%; text-align: center; font-family: 'Cormorant Garamond', Georgia, serif; font-size: clamp(20px, 5.6vw, 28px); line-height: 1.35; color: #F4EFE5; text-wrap: balance; min-height: 3em; }
.ritual-line em { font-style: italic; color: #C9A878; }
.ritual-ctl { position: absolute; left: 0; right: 0; bottom: calc(30px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 12px; color: rgba(244,239,229,0.4); }
.ritual-ctl button { background: none; border: none; font: inherit; font-size: 13px; letter-spacing: .06em; color: rgba(244,239,229,0.72); cursor: pointer; padding: 10px 6px; }
.ritual-ctl .rt-skip { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(201,168,120,0.6); }
.ritual .rt-lock-t { display: block; font-size: clamp(22px, 6vw, 30px); margin-bottom: 8px; }
.ritual .rt-lock-s { display: block; font-family: inherit; font-size: 15px; color: rgba(244,239,229,0.75); margin-bottom: 18px; }
.ritual .rt-unlock { background: #A98654; color: #1B1410; border: none; font: inherit; font-size: 14px; font-weight: 700; padding: 13px 26px; border-radius: 999px; cursor: pointer; }
