/* ═══════════════════════════════════════════════════════════════════════════
   Vinage — Mobile-first Wine Cellar App
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Fraunces (brand typeface) ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,100;9..144,300;9..144,400;9..144,600&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  /* ── Brand palette — warm light theme ──────────────────────────── */
  --burgundy:    #801A33;   /* wine-red — primary accent (was purple) */
  --burgundy-dk: #3B1422;   /* aubergine deep — nav, gradient darks */
  --burgundy-lt: #A5263F;   /* lighter wine-red — hovers */
  --gold:        #A3835B;   /* Gold/Brons — secondary accent */
  --gold-lt:     #C4A478;   /* lighter gold */
  --cream:       #F2EBE1;   /* Crème — warm background */
  --cream-dk:    #E8DED2;   /* slightly darker cream — borders, secondary bg */
  --brown:       #3B1422;   /* aubergine — deepest tone, replaces near-black */
  --brown-md:    #7A4A3A;   /* mid warm brown */
  --text:        #2A0E16;   /* near-black warm brown for body text */
  --text-md:     #6B3A30;   /* medium warm text */
  --text-lt:     #9A7060;   /* muted warm text */
  --white:       #FFFFFF;
  --shadow:      rgba(59,20,34,.10);
  --shadow-md:   rgba(59,20,34,.20);

  /* ── Wine type colours ──────────────────────────────────────────── */
  --red-wine:    #7B1A2E;
  --white-wine:  #E8D5A0;
  --rose-wine:   #E8A0A8;
  --sparkling:   #C8D8A8;
  --dessert:     #D4A030;
  --fortified:   #8B4513;

  /* ── Layout ─────────────────────────────────────────────────────── */
  --nav-h:       64px;
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius:      14px;
  --radius-sm:   8px;
  --transition:  .18s ease;
  --slot-w:      40px;
}

/* ── Dark theme ─────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --cream:       #160B0F;   /* near-black warm background */
  --cream-dk:    #221018;   /* dark surface borders / secondary bg */
  --white:       #1D0E14;   /* dark card surface */
  --text:        #F0E8DE;   /* cream → primary text */
  --text-md:     #C09060;   /* warm mid text */
  --text-lt:     #7A5848;   /* muted warm text */
  --shadow:      rgba(0,0,0,.40);
  --shadow-md:   rgba(0,0,0,.65);
  /* brand + type colours intentionally unchanged */
}

/* Dark overrides for elements with hardcoded colours ────────────────────────── */
[data-theme="dark"] body { background: var(--cream); }

[data-theme="dark"] .form-control,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--cream-dk);
  color: var(--text);
  border-color: #3A1A24;
}
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--text-lt); }

[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.75); }
[data-theme="dark"] .modal-box     { background: var(--white); border: 1px solid var(--cream-dk); }

[data-theme="dark"] #bottom-nav   { background: var(--white); border-color: #3A1A24; }
[data-theme="dark"] .page-header  { background: var(--white); border-color: #3A1A24; }

[data-theme="dark"] .stats-card       { background: var(--white); }
[data-theme="dark"] .settings-section { border-color: #3A1A24; }
[data-theme="dark"] .settings-row     { border-color: #3A1A24; }

/* Urgency pills in dark mode — darken backgrounds to work on dark cards */
[data-theme="dark"] .drink-soon-urgency--past  { background: #3d1010; color: #e57373; }
[data-theme="dark"] .drink-soon-urgency--ready { background: #0d2e12; color: #81c784; }
[data-theme="dark"] .drink-soon-urgency--soon  { background: #2e1e00; color: #ffb74d; }

/* Toast stays readable in dark mode */
[data-theme="dark"] .toast { box-shadow: 0 4px 16px rgba(0,0,0,.5); }

/* Key input wrapper */
[data-theme="dark"] .key-input-wrap { background: var(--cream-dk); border-radius: var(--radius-sm); }

/* Decant bubble */
[data-theme="dark"] #decant-bubble { background: var(--white); border-color: #3A1A24; }

/* Scan panel */
[data-theme="dark"] .scan-panel { background: var(--white); }

/* Cellar map */
[data-theme="dark"] .cellar-section { background: var(--white); }

/* Pairing cards */
[data-theme="dark"] .pairing-external-card { background: var(--white); }

/* Stats bars */
[data-theme="dark"] .stats-bar-wrap { background: #3A1A24; }

/* ── Splash screen ──────────────────────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0e001c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .65s ease;
}
#splash-screen.splash-fade { opacity: 0; pointer-events: none; }
.splash-img {
  width: 100%; height: 100%;
  object-fit: contain;   /* show full image — no cropping on wide screens */
  object-position: center center;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Helvetica Neue', Helvetica, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
#main-content { overflow-x: hidden; }
input, textarea, select, button { font-family: inherit; font-size: 1rem; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
ul { list-style: none; }

/* ── Layout shell ───────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

#main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
}

/* ── Bottom Navigation ──────────────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--cream-dk);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 16px var(--shadow);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--text-lt);
  transition: color var(--transition);
  min-width: 0;
}
.nav-item.active { color: var(--burgundy); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: .62rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ── Scan centre pill ───────────────────────────────────────────────────────── */
.nav-item-scan {
  position: relative;
  margin-top: -20px;      /* lifts the pill above the nav bar */
  flex: 1.2;              /* slightly wider tap target than siblings */
}
.nav-scan-pill {
  width: 52px;
  height: 52px;
  background: var(--burgundy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59,20,34,.40);
  transition: transform .15s, box-shadow .15s;
  margin: 0 auto 3px;
}
.nav-item-scan svg { width: 26px; height: 26px; color: #fff; }
.nav-item-scan span { color: var(--text-lt); }
.nav-item-scan.active .nav-scan-pill {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(59,20,34,.55);
}
.nav-item-scan.active span { color: var(--burgundy); }
/* keep the pill white-icon even in dark mode */
[data-theme="dark"] .nav-scan-pill { background: var(--burgundy); }
[data-theme="dark"] .nav-item-scan svg { color: #fff; }

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid var(--cream-dk);
  padding: calc(10px + var(--safe-top)) 16px 8px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.page-header h1 { font-size: 1.4rem; font-weight: 300; color: var(--burgundy); font-family: 'Fraunces', Georgia, serif; letter-spacing: .04em; width: 100%; flex: none; }
.page-header .header-actions { display: flex; gap: 8px; align-items: center; width: 100%; justify-content: flex-end; padding-bottom: 4px; flex-wrap: wrap; }

/* Wishlist cart toggle button — active state */
.wishlist-active { color: var(--burgundy) !important; }

/* ── Collection header — two-row layout ─────────────────────────────────── */
.collection-header { flex-direction: column; gap: 6px; padding-bottom: 10px; }
.collection-header .ch-row1 {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.collection-header .ch-row1 h1 { width: auto; flex: 1; }
.collection-header .ch-row2 {
  display: flex; align-items: center; gap: 8px; width: 100%;
}

/* Sort dropdown — stretches to fill available space in row 2 */
.collection-sort-select {
  padding: 7px 28px 7px 12px;
  font-size: .88rem;
  flex: 1;
  min-width: 0;
  max-width: none;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 20px;
  border-radius: 50px; font-weight: 600; font-size: .95rem;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn-primary   { background: var(--burgundy); color: var(--white); }
.btn-secondary { background: var(--cream-dk); color: var(--text); }
.btn-gold      { background: var(--gold); color: var(--white); }
.btn-ghost     { background: transparent; color: var(--burgundy); border: 1.5px solid var(--burgundy); }
.btn-danger    { background: #D93025; color: var(--white); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-icon { padding: 10px; border-radius: 50%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-full { width: 100%; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  overflow: hidden;
}
.card-body { padding: 16px; }

/* ── Wine type badge ────────────────────────────────────────────────────────── */
.type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.type-red      { background: #F8DDE0; color: #B00018; }
.type-white    { background: #FBF3D0; color: #806000; }
.type-rosé     { background: #FCE0F5; color: #B010A0; }
.type-sparkling{ background: #DDF5D8; color: #1F7018; }
.type-dessert  { background: #FFF0C8; color: #A05800; }
.type-fortified{ background: #F0E0D0; color: #8A2A08; }

/* ── Stars ──────────────────────────────────────────────────────────────────── */
.stars { color: var(--gold); letter-spacing: .1em; font-size: 1rem; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-md); margin-bottom: 6px; }

/* Quantity stepper — −  [input]  + */
.qty-stepper { display: flex; align-items: center; gap: 0; }
.qty-btn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border: 1.5px solid var(--cream-dk);
  background: var(--cream);
  color: var(--burgundy);
  font-size: 1.3rem; font-weight: 700; line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.qty-btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.qty-btn:active { background: var(--burgundy); color: var(--white); }
.qty-input { border-radius: 0 !important; text-align: center; -moz-appearance: textfield; }
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--cream-dk);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font-size: .95rem;
  transition: border-color var(--transition);
  appearance: none;
}
.form-control:focus { outline: none; border-color: var(--burgundy); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A4F38' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.star-picker { display: flex; gap: 6px; }
.star-picker button { font-size: 1.6rem; color: var(--cream-dk); transition: color var(--transition); padding: 4px; }
.star-picker button.on { color: var(--gold); }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
#modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
#modal-overlay.open { display: flex; animation: fade-in .15s ease; }
#modal-box {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  animation: slide-up .2s ease;
}
#modal-header {
  display: flex; align-items: center;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--cream-dk);
  gap: 12px;
}
#modal-title { flex: 1; font-size: 1.1rem; font-weight: 300; color: var(--burgundy); font-family: 'Fraunces', Georgia, serif; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#modal-body { overflow-y: auto; padding: 16px; flex: 1; }
#modal-footer {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--cream-dk);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Each button can grow to fill space but won't shrink below 140 px —
   so on a ~360 px phone two fit per row, three always wrap to 2 + 1. */
#modal-footer .btn {
  flex: 1 1 140px;
  min-width: 0;
}

@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes slide-up { from { transform:translateY(60px); opacity:0; } to { transform:none; opacity:1; } }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; top: calc(16px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: 90%; max-width: 400px;
}
.toast {
  background: var(--brown);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 4px 16px var(--shadow-md);
  animation: toast-in .2s ease, toast-out .3s ease 2.5s forwards;
  text-align: center;
}
.toast.success { background: #2D6A4F; }
.toast.error   { background: #B30000; }
@keyframes toast-in  { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }

/* ════════════════════════════════════════════════════════════════════════════
   SCAN VIEW
   ════════════════════════════════════════════════════════════════════════════ */
#scan-view { display: flex; flex-direction: column; min-height: calc(100dvh - var(--nav-h)); }

.camera-area {
  position: relative;
  background: #0A0A0A;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 50dvh;
  overflow: hidden;
  flex-shrink: 0;
}
/* Subtle bottom fade so camera blends into controls */
.camera-area::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.55));
  pointer-events: none;
  z-index: 2;
}
.camera-area video, .camera-area canvas {
  width: 100%; height: 100%; object-fit: cover;
}
.camera-area video {
  transition: transform .25s ease;
  transform-origin: center center;
}
.camera-area canvas { position: absolute; inset: 0; display: none; }
.camera-area canvas.show { display: block; }

.camera-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.camera-frame {
  width: 64%; max-width: 230px;
  aspect-ratio: 2/3;
  border-radius: 10px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,.42);
  /* Four-corner bracket effect using multiple backgrounds */
  background:
    linear-gradient(to right,  rgba(255,255,255,.88) 3px, transparent 3px) 0   0   / 26px 26px no-repeat,
    linear-gradient(to bottom, rgba(255,255,255,.88) 3px, transparent 3px) 0   0   / 26px 26px no-repeat,
    linear-gradient(to left,   rgba(255,255,255,.88) 3px, transparent 3px) 100% 0   / 26px 26px no-repeat,
    linear-gradient(to bottom, rgba(255,255,255,.88) 3px, transparent 3px) 100% 0   / 26px 26px no-repeat,
    linear-gradient(to right,  rgba(255,255,255,.88) 3px, transparent 3px) 0   100% / 26px 26px no-repeat,
    linear-gradient(to top,    rgba(255,255,255,.88) 3px, transparent 3px) 0   100% / 26px 26px no-repeat,
    linear-gradient(to left,   rgba(255,255,255,.88) 3px, transparent 3px) 100% 100% / 26px 26px no-repeat,
    linear-gradient(to top,    rgba(255,255,255,.88) 3px, transparent 3px) 100% 100% / 26px 26px no-repeat;
}

.camera-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: rgba(255,255,255,.8);
  padding: 24px; text-align: center;
}
.camera-placeholder svg { opacity: .6; }
.camera-placeholder p { font-size: .9rem; line-height: 1.4; }
.scan-instruction-text {
  font-size: .85rem;
  line-height: 1.45;
  color: rgba(255,255,255,.75);
  margin: 0;
}

/* ── Barcode overlay ─────────────────────────────────────────────────────── */
.barcode-overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 3;
}
.barcode-overlay.active { display: flex; }

.barcode-frame {
  position: relative;
  width: 68%;
  max-width: 260px;
  aspect-ratio: 1 / 1;   /* square — QR codes are square */
  border-radius: 10px;
  /* darkened surround */
  box-shadow: 0 0 0 2000px rgba(0,0,0,.52);
  /* corner brackets */
  background:
    linear-gradient(to right,  rgba(255,220,80,.95) 2px, transparent 2px) 0   0   / 24px 24px no-repeat,
    linear-gradient(to bottom, rgba(255,220,80,.95) 2px, transparent 2px) 0   0   / 24px 24px no-repeat,
    linear-gradient(to left,   rgba(255,220,80,.95) 2px, transparent 2px) 100% 0   / 24px 24px no-repeat,
    linear-gradient(to bottom, rgba(255,220,80,.95) 2px, transparent 2px) 100% 0   / 24px 24px no-repeat,
    linear-gradient(to right,  rgba(255,220,80,.95) 2px, transparent 2px) 0   100% / 24px 24px no-repeat,
    linear-gradient(to top,    rgba(255,220,80,.95) 2px, transparent 2px) 0   100% / 24px 24px no-repeat,
    linear-gradient(to left,   rgba(255,220,80,.95) 2px, transparent 2px) 100% 100% / 24px 24px no-repeat,
    linear-gradient(to top,    rgba(255,220,80,.95) 2px, transparent 2px) 100% 100% / 24px 24px no-repeat;
  overflow: hidden;
}
.barcode-scanline {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: rgba(255,220,80,.80);
  box-shadow: 0 0 6px 2px rgba(255,220,80,.5);
  animation: scanline 1.8s ease-in-out infinite;
}
@keyframes scanline {
  0%   { top: 10%; }
  50%  { top: 85%; }
  100% { top: 10%; }
}

/* ── Scan mode toggle ────────────────────────────────────────────────────── */
.scan-mode-toggle-bar {
  display: flex;
  justify-content: center;
  padding: calc(8px + var(--safe-top)) 16px 0;
  background: var(--cream);
}
.scan-mode-toggle {
  display: flex;
  background: var(--cream-dk);
  border-radius: 50px;
  padding: 3px;
  gap: 2px;
}
.scan-mode-btn {
  padding: 6px 18px;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-lt);
  background: none;
  border: none;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.scan-mode-btn.active {
  background: var(--burgundy);
  color: var(--white);
}

/* ── Wine search mode ────────────────────────────────────────────────────── */
.search-mode-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 24px;
  gap: 16px;
}
.search-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.search-input-row .form-control {
  flex: 1;
  font-size: .92rem;
}
.search-input-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.search-results-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-lt);
  margin: 0;
}
.search-result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--transition);
}
.search-result-card:active { box-shadow: 0 4px 16px var(--shadow); opacity: .9; }
}
.search-result-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.search-result-type-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.search-result-title-block { flex: 1; min-width: 0; }
.search-result-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.search-result-producer {
  font-size: .82rem;
  color: var(--text-md);
  margin-top: 2px;
}
.search-result-meta {
  font-size: .78rem;
  color: var(--text-lt);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.search-result-tag {
  background: var(--cream-dk);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: .72rem;
  color: var(--text-md);
  font-weight: 500;
}
.search-result-notes {
  font-size: .84rem;
  color: var(--text-md);
  line-height: 1.5;
  font-style: italic;
}
.search-result-price {
  font-size: .88rem;
  font-weight: 700;
  color: var(--burgundy);
}
.search-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.search-result-actions .btn {
  flex: 1;
  min-width: 120px;
  font-size: .82rem;
  padding: 9px 12px;
}
.search-status {
  text-align: center;
  color: var(--text-lt);
  font-size: .88rem;
  padding: 32px 0;
}
[data-theme="dark"] .search-result-card { background: var(--white); }
[data-theme="dark"] .search-result-tag  { background: #2A1020; }

/* Branded scan controls header */
.scan-controls {
  padding: 0 0 8px;
  display: flex; flex-direction: column; gap: 0;
  align-items: center;
}

/* Statement strip — cream band above dark panel */
.scan-statement-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 8px;
  background: var(--cream);
}
.scan-statement-text {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--gold);
  text-transform: uppercase;
  user-select: none;
}

/* Dark gradient brand panel */
.scan-brand-panel {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;  /* equal outer columns → button always dead centre */
  align-items: center;
  padding: 16px 20px 18px;
  background: linear-gradient(160deg, #5C1828 0%, #3B1422 60%, #2A0E14 100%);
}

.scan-brand-mark {
  height: 72px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
  user-select: none;
  justify-self: start;   /* pin to left edge of its column */
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.40));
  transition: transform var(--transition), filter var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.scan-brand-mark:active { transform: scale(.93); }

.scan-brand-name {
  height: 28px;
  width: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  justify-self: end;     /* pin to right edge of its column */
  filter: brightness(0) invert(1) opacity(.90);
}

.capture-btn-wrap { display: flex; justify-content: center; }
.capture-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid rgba(255,255,255,.60);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.40);
  transition: transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.capture-btn:active { transform: scale(.90); box-shadow: 0 2px 10px rgba(0,0,0,.30); }
.capture-btn svg { width: 30px; height: 30px; color: var(--burgundy); }

.scan-status {
  text-align: center; padding: 12px;
  font-size: .9rem; color: var(--text-md);
  min-height: 44px; display: flex; align-items: center; justify-content: center;
}
.scan-status.found { color: #2D6A4F; font-weight: 600; }
.scan-status.error { color: #B30000; }

.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid var(--cream-dk);
  border-top-color: var(--burgundy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════════════════
   WINE FORM (modal)
   ════════════════════════════════════════════════════════════════════════════ */
.wine-form-image {
  width: 100%;
  min-height: 180px;     /* always visible even while loading */
  max-height: 55vh;
  height: auto;
  object-fit: contain; border-radius: var(--radius-sm);
  margin-bottom: 16px; background: #111;
  display: block;
}
/* Thumbnail-only: don't upscale an 80×120 px image to fill the full modal width */
.wine-form-image--thumb {
  width: auto;
  min-height: unset;
  max-height: 160px;
  max-width: 120px;
  background: transparent;
  margin-left: auto;
  margin-right: auto;
}
.type-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.type-option {
  padding: 7px 14px; border-radius: 50px;
  border: 1.5px solid var(--cream-dk);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.type-option.selected { border-color: var(--burgundy); background: var(--burgundy); color: var(--white); }

/* ════════════════════════════════════════════════════════════════════════════
   CELLAR VIEW
   ════════════════════════════════════════════════════════════════════════════ */
.cellar-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }

.cellar-card { cursor: pointer; display: flex; align-items: stretch; }
.cellar-drag-handle {
  display: flex; align-items: center; justify-content: center;
  width: 44px; min-width: 44px;
  background: var(--burgundy-dk);
  border-radius: var(--radius) 0 0 var(--radius);
  color: rgba(255,255,255,.5);
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}
.cellar-drag-handle:active { cursor: grabbing; color: rgba(255,255,255,.85); }
.cellar-card-body { flex: 1; min-width: 0; }
.cellar-card-header {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  background: var(--burgundy);
  color: var(--white);
  border-radius: 0 var(--radius) 0 0;
}
.cellar-card-header h3 { flex: 1; font-size: 1rem; font-weight: 700; }
.cellar-type-tag {
  font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; opacity: .8;
}
.cellar-card-stats {
  padding: 10px 16px;
  display: flex; gap: 16px;
  background: var(--burgundy-dk);
  border-radius: 0 0 var(--radius) var(--radius);
  color: rgba(255,255,255,.8); font-size: .82rem;
}
.cellar-stat { display: flex; align-items: center; gap: 5px; }
.cellar-stat strong { color: var(--white); }

/* Rack grid */
.rack-container { padding: 12px 16px; overflow-x: auto; }
.rack-title {
  font-size: 1.1rem; font-weight: 700; color: var(--burgundy);
  margin-bottom: 4px; display: flex; align-items: center; gap: 10px;
}
.rack-subtitle { font-size: .8rem; color: var(--text-lt); margin-bottom: 12px; }
.rack-back { margin-bottom: 12px; }

/* ── Elegant rack frame (light stone / natural oak) ─────────────────────────── */
.rack-wood-frame {
  display: inline-block;
  min-width: 100%;
  background: linear-gradient(160deg, #F7F1E8 0%, #EDE5D8 50%, #F2EBE0 100%);
  border-radius: 14px;
  padding: 12px 14px 16px;
  box-shadow:
    0 6px 28px rgba(100,70,40,.14),
    0 2px 6px  rgba(100,70,40,.08),
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(160,130,90,.15);
  border: 1.5px solid rgba(195,170,135,.55);
  overflow-x: auto;
}

/* Column-label row */
.rack-col-labels {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.rack-corner { width: 26px; flex-shrink: 0; }
.rack-col-label {
  width: var(--slot-w);
  text-align: center;
  font-size: .65rem;
  font-weight: 800;
  color: rgba(80,50,20,.70);
  letter-spacing: .06em;
  flex-shrink: 0;
}

/* Rows — extra bottom padding to give room for the below-circle position label */
.rack-body { display: flex; flex-direction: column; gap: 18px; }
.rack-body-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(180,150,110,.18);
}
.rack-body-row:last-child { border-bottom: none; padding-bottom: 0; }
.rack-row-lbl {
  width: 26px;
  text-align: center;
  font-size: .65rem;
  font-weight: 800;
  color: rgba(80,50,20,.70);
  flex-shrink: 0;
}

/* Grid & Diamond racks */
.rack-grid {
  display: grid;
  gap: 6px;
  width: fit-content;
  min-width: 100%;
}
.rack-diamond .rack-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.rack-diamond .rack-row:nth-child(even) { margin-left: 21px; }

/* ── Slot — circular hole ────────────────────────────────────────────────────── */
.slot {
  width: var(--slot-w);
  height: var(--slot-w);   /* square → circle */
  border-radius: 50%;
  /* Dark depth illusion — like looking into a hole */
  background: radial-gradient(circle at 38% 32%, #3C200C 0%, #1C0D04 55%, #0E0602 100%);
  box-shadow:
    inset 0 4px 14px rgba(0,0,0,.92),
    inset 0 1px 4px  rgba(0,0,0,.70),
    0 1px 0 rgba(255,255,255,.55),
    0 2px 4px rgba(0,0,0,.10);
  border: 2px solid rgba(210,185,150,.38);
  cursor: pointer;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot:hover {
  box-shadow:
    inset 0 4px 14px rgba(0,0,0,.82),
    0 0 0 2.5px var(--burgundy-lt),
    0 3px 10px rgba(107,39,55,.25),
    0 1px 0 rgba(255,255,255,.55);
}

/* Occupied slot — the full bottle viewed from above.
   Outer area = dark glass with gloss highlight.
   Inner rings = recessed neck with depth shading.
   Capsule lives inside .bottle-top (only 42 % of the slot diameter).           */
.slot.occupied {
  background:
    /* Gloss highlight — upper-left crescent on the bottle glass */
    radial-gradient(ellipse 50% 36% at 28% 20%, rgba(255,255,255,.18) 0%, transparent 100%),
    /* Neck depth — concentric shadow rings showing the recess */
    radial-gradient(circle at 50% 50%,
      rgba(0,0,0,.80) 0%,   rgba(0,0,0,.80) 37%,   /* deep neck well */
      rgba(0,0,0,.35) 44%,  rgba(0,0,0,.60) 50%,   /* inner neck wall */
      rgba(0,0,0,.20) 57%,  rgba(0,0,0,.55) 64%,   /* outer neck wall */
      rgba(0,0,0,.10) 70%                           /* shoulder / glass */
    ),
    /* Bottle glass base: very dark olive-black */
    radial-gradient(circle at 42% 35%, #2A2210 0%, #12100A 50%, #060503 100%);
  box-shadow:
    inset 0 3px 10px rgba(0,0,0,.80),
    0 1px 0 rgba(255,255,255,.45),
    0 2px 6px rgba(0,0,0,.20);
}
.slot.occupied:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,.70),
    0 6px 20px rgba(0,0,0,.28),
    0 1px 0 rgba(255,255,255,.50);
}

/* ── Bottle top — small matte capsule sitting in the neck ───────────────────────
   Proportions: ~42 % of the slot diameter, centred.
   The slot.occupied background provides the dark glass + neck rings behind it.  */
.bottle-top {
  width: 42%;
  height: 42%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  /* Capsule edge: thin dark rim where foil meets the neck */
  box-shadow:
    0 0 0 2px rgba(0,0,0,.60),
    0 2px 6px rgba(0,0,0,.70),
    inset 0 1px 2px rgba(255,255,255,.15);
}

/* Concave inner ring — the slight depression in the capsule face */
.bottle-top::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* A single shadow ring ~65 % in, matching the reference photo */
  background: radial-gradient(circle at 50% 50%,
    transparent 58%,
    rgba(0,0,0,.28) 62%,
    rgba(0,0,0,.12) 68%,
    transparent 72%
  );
  z-index: 1;
  pointer-events: none;
}

/* Centre dome — very subtle raised disc with off-centre highlight */
.bottle-top::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 55%; height: 55%;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%,
    rgba(255,255,255,.22) 0%,
    rgba(255,255,255,.04) 55%,
    transparent           100%
  );
  z-index: 2;
  pointer-events: none;
}

/* Capsule colours — matte base radial gradient per wine type */
.slot.red-wine   .bottle-top { background: radial-gradient(circle at 44% 40%, #D83030 0%, #901010 55%, #4E0606 100%); }
.slot.white-wine .bottle-top { background: radial-gradient(circle at 44% 40%, #E8D038 0%, #B88C08 55%, #706000 100%); }
.slot.rosé       .bottle-top { background: radial-gradient(circle at 44% 40%, #EC28BE 0%, #C008A0 55%, #800870 100%); }
.slot.sparkling  .bottle-top { background: radial-gradient(circle at 44% 40%, #58D838 0%, #269014 55%, #0E5006 100%); }
.slot.dessert    .bottle-top { background: radial-gradient(circle at 44% 40%, #E8AC18 0%, #B07006 55%, #6A4400 100%); }
.slot.fortified  .bottle-top { background: radial-gradient(circle at 44% 40%, #CC5828 0%, #962008 55%, #501200 100%); }

/* Position label — shows below the circle */
.slot-label {
  position: absolute;
  bottom: 5px;          /* inside the slot, not below it */
  left: 0; right: 0;
  text-align: center;
  font-size: .58rem;
  font-weight: 800;
  color: rgba(255,255,255,.70);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.80);
}
/* Position label on empty slot — centred inside the hole */
.slot-pos {
  font-size: .58rem;
  font-weight: 800;
  color: rgba(255,255,255,.38);
  letter-spacing: .03em;
  user-select: none;
}

/* ── Rack zoom controls ─────────────────────────────────────────────────────── */
.rack-zoom-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.rack-zoom-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cream-dk);
  border: 1.5px solid var(--cream-dk);
  font-size: 1.1rem; line-height: 1;
  font-weight: 700; color: var(--text-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.rack-zoom-btn:hover { background: var(--burgundy); color: var(--white); border-color: var(--burgundy); }
.rack-zoom-level {
  font-size: .72rem; font-weight: 600;
  color: var(--text-lt); min-width: 36px; text-align: center;
}

/* Zoom container — inner content is scaled, container scrolls */
.rack-zoom-container {
  overflow: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.rack-zoom-container:active { cursor: grabbing; }
.rack-zoom-inner {
  display: inline-block;
  transform-origin: top left;
}

/* Case rack (3×4) */
.rack-case {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px; max-width: 320px;
}

/* Shelf (list) */
.shelf-list { display: flex; flex-direction: column; gap: 8px; }
.shelf-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--cream-dk);
  cursor: pointer;
}
.shelf-item:active { background: var(--cream); }
.shelf-bottle-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.shelf-thumb {
  width: 36px; height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.shelf-wine-name { flex: 1; font-size: .9rem; font-weight: 600; }
.shelf-wine-meta { font-size: .78rem; color: var(--text-lt); }
.shelf-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 2px dashed var(--cream-dk);
  border-radius: var(--radius-sm); color: var(--text-lt);
  font-size: .9rem; cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════════════════
   COLLECTION VIEW
   ════════════════════════════════════════════════════════════════════════════ */
.collection-toolbar {
  padding: 10px 16px;
  display: flex; gap: 8px; align-items: center;
  border-bottom: 1px solid var(--cream-dk);
}
.search-input-wrap { flex: 1; position: relative; }
.search-input-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-lt); width: 18px; height: 18px; pointer-events: none;
}
.search-input {
  width: 100%; padding: 9px 34px 9px 34px;
  border: 1.5px solid var(--cream-dk);
  border-radius: 50px; background: var(--cream); color: var(--text); font-size: .9rem;
}
.search-input:focus { outline: none; border-color: var(--burgundy); }
.search-clear-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: var(--text-lt); border: none; border-radius: 50%;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; color: var(--white); font-size: 11px; line-height: 1;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.search-input-wrap.has-value .search-clear-btn {
  opacity: 1; pointer-events: auto;
}

.filter-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px;
  scrollbar-width: none; border-bottom: 1px solid var(--cream-dk);
}
.filter-strip::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 5px 14px; border-radius: 50px; border: 1.5px solid var(--cream-dk);
  font-size: .82rem; font-weight: 500; white-space: nowrap; cursor: pointer;
  background: var(--white); transition: all var(--transition);
}
.filter-chip.active { background: var(--burgundy); color: var(--white); border-color: var(--burgundy); }

.wine-grid { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.wine-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; background: var(--white);
  border-radius: var(--radius); box-shadow: 0 1px 6px var(--shadow);
  cursor: pointer; transition: box-shadow var(--transition);
}
.wine-card:active { box-shadow: 0 3px 12px var(--shadow-md); }
.wine-card-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; margin-top: 3px;
}
.wine-card-thumb {
  width: 44px; height: 62px;
  object-fit: cover; object-position: center top;
  border-radius: 6px; flex-shrink: 0;
  box-shadow: 0 1px 5px rgba(0,0,0,.18);
  background: var(--cream-dk);
}
.wine-card-body { flex: 1; min-width: 0; }
.wine-card-name { font-size: .97rem; font-weight: 700; margin-bottom: 3px; }
.wine-card-sub { font-size: .8rem; color: var(--text-lt); margin-bottom: 5px; }
.wine-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wine-qty { font-size: .8rem; font-weight: 600; color: var(--burgundy); background: var(--cream-dk); padding: 2px 8px; border-radius: 50px; }
.wine-qty--empty { color: var(--text-lt); background: transparent; border: 1px dashed var(--cream-dk); }
.wine-cellar-tag { font-size: .75rem; color: var(--text-lt); }

/* ── Collection stats bar ───────────────────────────────────────────────────── */
.collection-stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--burgundy-dk) 0%, var(--burgundy) 100%);
  color: var(--white);
}
.stat-pill {
  text-align: center;
  flex-shrink: 0;
}
.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-label {
  font-size: .68rem;
  font-weight: 500;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.2);
  margin: 0 16px;
  flex-shrink: 0;
}
.stats-type-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.stats-type-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  font-weight: 600;
  opacity: .88;
}
.stats-type-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Drink-window alerts ────────────────────────────────────────────────────── */
.drink-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: .84rem;
  font-weight: 600;
}
.drink-alert-ready { background: #EDFAF0; color: #1A6B3C; border-bottom: 1px solid #C0EDD0; }
.drink-alert-past  { background: #FFF5E0; color: #8B5000; border-bottom: 1px solid #F0D890; }
.drink-alert-active.drink-alert-ready { background: #C0EDD0; font-weight: 700; }
.drink-alert-active.drink-alert-past  { background: #F0D890; font-weight: 700; }
.drink-alert-arrow { margin-left: auto; font-size: .8rem; opacity: .6; }

/* ── Drink-window badges on wine cards ──────────────────────────────────────── */
.drink-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.drink-badge-ready  { background: #EDFAF0; color: #1A6B3C; }
.drink-badge-past   { background: #FFF5E0; color: #8B5000; }
.drink-badge-cellar { background: var(--cream-dk); color: var(--text-lt); }

.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-lt); white-space: pre-line; line-height: 1.7;
}
.empty-state svg { margin: 0 auto 16px; opacity: .35; }

/* ════════════════════════════════════════════════════════════════════════════
   PAIRING VIEW
   ════════════════════════════════════════════════════════════════════════════ */
.pairing-hero {
  background: linear-gradient(135deg, var(--burgundy-dk) 0%, var(--burgundy) 60%, var(--burgundy-lt) 100%);
  padding: calc(24px + var(--safe-top)) 16px 24px;
  color: var(--white);
}
.pairing-hero h2 { font-size: 1.05rem; margin-bottom: 12px; opacity: .85; }
.pairing-input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pairing-input {
  flex: 1 1 160px;   /* grow freely, shrink to 160px, then wraps */
  padding: 12px 16px;
  border: none; border-radius: 50px;
  font-size: .95rem; background: rgba(255,255,255,.15);
  color: var(--white);
  backdrop-filter: blur(4px);
}
.pairing-input::placeholder { color: rgba(255,255,255,.55); }
.pairing-input:focus { outline: 2px solid var(--gold); }
/* Keep button at its natural size; flex-wrap handles line breaks */
.pairing-input-row .btn { flex-shrink: 0; }

.pairing-results { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pairing-section-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-lt); margin-bottom: 8px;
}
.pairing-wine-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; background: var(--white);
  border-radius: var(--radius); box-shadow: 0 1px 6px var(--shadow);
  border-left: 4px solid var(--burgundy);
  cursor: pointer;
  transition: box-shadow .15s, transform .12s;
}
.pairing-wine-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px var(--shadow);
}
.pairing-match-badge {
  background: var(--gold); color: var(--white);
  font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 50px;
  text-transform: uppercase;
}
.pairing-acceptable-badge {
  background: var(--surface2); color: var(--text-md);
  border: 1px solid var(--border);
  font-size: .72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 50px;
  text-transform: uppercase;
}
.pairing-no-match {
  text-align: center;
  padding: 24px 16px;
  background: var(--cream-dk);
  border-radius: var(--radius);
  color: var(--text-md);
}
.pairing-reason { font-size: .85rem; color: var(--text-md); margin-top: 5px; line-height: 1.4; }

.general-suggestion {
  background: var(--cream-dk);
  border-radius: var(--radius);
  padding: 16px;
  font-size: .88rem; color: var(--text-md); line-height: 1.6;
}
.general-suggestion strong { display: block; margin-bottom: 6px; color: var(--text); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

/* External suggestions (wines to buy) */
.pairing-external-card { background: var(--cream); }
.pairing-price-badge {
  background: var(--burgundy); color: var(--white);
  font-size: .75rem; font-weight: 700;
  padding: 3px 10px; border-radius: 50px;
}
.pairing-find-store-btn {
  display: block; text-align: center;
  margin-top: 4px; padding: 12px;
  background: var(--gold); color: var(--white);
  border-radius: var(--radius); font-weight: 700;
  font-size: .9rem; text-decoration: none;
  letter-spacing: .02em;
}
.pairing-find-store-btn:active { opacity: .85; }

/* Importer partner block */
.pairing-importer-block {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}
.pairing-importer-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  color: var(--white);
  font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.pairing-importer-header a {
  color: rgba(255,255,255,.75);
  font-size: .72rem; font-weight: 500;
  text-decoration: none; margin-left: auto;
  text-transform: none; letter-spacing: 0;
}
.pairing-importer-header a:hover { color: var(--white); }
.pairing-importer-wine {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px; background: var(--white);
  border-top: 1px solid var(--cream-dk);
}
.pairing-importer-wine:first-of-type { border-top: none; }
.pairing-importer-wine-info { flex: 1; min-width: 0; }
.pairing-importer-wine-name {
  font-weight: 700; font-size: .95rem; margin-bottom: 3px;
}
.pairing-importer-wine-meta {
  font-size: .8rem; color: var(--text-lt); margin-bottom: 5px;
}
.pairing-importer-wine-footer {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.pairing-importer-badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  padding: 2px 9px; border-radius: 50px;
  color: var(--white);
}
.pairing-importer-price {
  font-size: .8rem; color: var(--text-lt);
}
.pairing-importer-link {
  margin-left: auto; font-size: .8rem; font-weight: 600;
  color: var(--burgundy); text-decoration: none; white-space: nowrap;
}
.pairing-importer-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════════════
   SETTINGS VIEW
   ════════════════════════════════════════════════════════════════════════════ */
.settings-section { padding: 16px; border-bottom: 1px solid var(--cream-dk); }
.settings-section h2 {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--gold); margin-bottom: 14px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--cream-dk);
}
.settings-row:last-child { border-bottom: none; }
.settings-row label { font-size: .95rem; font-weight: 500; }

/* Lang toggle */
/* Dark mode toggle */
.dark-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dark-toggle-track {
  position: relative;
  width: 48px;
  height: 27px;
  background: var(--cream-dk);
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.dark-toggle-track.on { background: var(--burgundy); }
.dark-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  background: var(--white);
  border-radius: 50%;
  transition: left var(--transition);
  box-shadow: 0 1px 4px var(--shadow-md);
}
.dark-toggle-track.on .dark-toggle-thumb { left: 24px; }
.dark-toggle-label {
  font-size: .88rem;
  color: var(--text-md);
  font-weight: 500;
}

.lang-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.lang-toggle button {
  padding: 7px 4px; font-size: .85rem; font-weight: 600;
  color: var(--text-lt); transition: all var(--transition);
  border-radius: 50px; background: var(--cream-dk); text-align: center;
}
.lang-toggle button.active { background: var(--burgundy); color: var(--white); }

/* Provider toggle */
.provider-toggle { display: flex; gap: 6px; }
.provider-btn {
  padding: 7px 14px; border-radius: 50px;
  border: 1.5px solid var(--cream-dk);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  background: var(--white); color: var(--text-md);
  transition: all var(--transition);
}
.provider-btn.active { background: var(--burgundy); color: var(--white); border-color: var(--burgundy); }

.key-hint { font-size: .75rem; color: var(--text-lt); margin-top: 5px; }
.key-input-wrap { position: relative; }
.key-input-wrap input { padding-right: 48px; }
.key-toggle-vis {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-lt); font-size: .8rem; font-weight: 600;
  cursor: pointer; padding: 4px 6px;
}

.settings-btn-row { padding: 16px; }
.about-info { padding: 16px 16px 24px; text-align: center; color: var(--text-lt); font-size: .88rem; line-height: 1.8; }

/* ── About full-screen overlay ──────────────────────────────────────────────── */
#about-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10,4,30,.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;        /* bottom-sheet on mobile */
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}
#about-overlay.about-overlay-visible { opacity: 1; }

.about-overlay-inner {
  position: relative;
  width: 100%;
  max-width: 480px;             /* centered card on desktop */
  max-height: 96dvh;
  background: var(--cream);
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
  transform: translateY(40px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
#about-overlay.about-overlay-visible .about-overlay-inner { transform: translateY(0); }

/* On wider screens: center it vertically too, add bottom gap */
@media (min-width: 520px) {
  #about-overlay { align-items: center; }
  .about-overlay-inner {
    border-radius: 24px;
    max-height: 90dvh;
  }
}

.about-close-btn {
  position: absolute;
  top: 14px; right: 16px;
  background: rgba(59,20,34,.12);
  border: none;
  color: var(--text);
  font-size: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
}

.about-hero-wrap {
  width: 100%;
  border-radius: 24px 24px 0 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px 28px;
}
@media (min-width: 520px) {
  .about-hero-wrap { border-radius: 24px 24px 0 0; padding: 44px 24px 32px; }
}

/* Floating tile inside the hero wrap */
.about-hero-tile {
  background: linear-gradient(160deg, #6B1E2E 0%, #3B1422 55%, #2A0E14 100%);
  border-radius: 22px;
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 62%;
  max-width: 240px;
  box-shadow: 0 16px 48px rgba(59,20,34,.45), 0 4px 16px rgba(0,0,0,.25);
}
.about-hero-img {
  width: 78%;
  max-width: 150px;
  height: auto;
  display: block;
}
.about-tile-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: 1.45rem;
  color: #F2EBE1;
  letter-spacing: .05em;
  line-height: 1;
}

.about-content {
  padding: 24px 24px 40px;
  text-align: center;
  color: var(--text);
}
.about-wordmark {
  height: 28px;
  width: auto;
  margin-bottom: 4px;
}
.about-tagline {
  color: #A3835B;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin: 0 0 20px;
}
.about-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  text-align: left;
}
.about-feature-item {
  background: var(--white);
  border: 1px solid var(--cream-dk);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: .9rem;
  color: var(--text);
}
.about-version {
  font-size: .78rem;
  color: var(--text-lt);
  margin-top: 4px;
}
.about-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--cream-dk);
  font-size: .74rem;
  color: #A3835B;
  letter-spacing: .03em;
}


/* ── Help overlay (reuses about-overlay styles) ─────────────────────────────── */
#help-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10,4,30,.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}
#help-overlay.about-overlay-visible { opacity: 1; }
@media (min-width: 520px) {
  #help-overlay { align-items: center; }
}
.help-section {
  margin-bottom: 24px;
}
.help-section-title {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--burgundy);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.help-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.help-list li {
  font-size: .88rem;
  color: var(--text);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.help-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--gold);
  font-weight: 700;
}

/* ── Rack hover tooltip (desktop, hover-capable devices only) ───────────────── */
#rack-tooltip {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
  width: 180px;
}
#rack-tooltip.visible { opacity: 1; }
.rack-tooltip-card {
  background: #1A0C05;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0,0,0,.7);
}
.rack-tooltip-img {
  width: 100%; height: 110px;
  object-fit: cover; object-position: center;
  display: block;
}
.rack-tooltip-body { padding: 10px 12px 12px; }
.rack-tooltip-pos {
  font-size: .6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--gold); margin-bottom: 5px;
}
.rack-tooltip-name {
  font-size: .85rem; font-weight: 700;
  color: var(--white); line-height: 1.25; margin-bottom: 5px;
}
.rack-tooltip-meta {
  font-size: .7rem; color: rgba(255,255,255,.5);
  line-height: 1.4; display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.rack-tooltip-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

/* ── Wine picker modal list ─────────────────────────────────────────────────── */
.wine-picker-list { display: flex; flex-direction: column; gap: 6px; }
.wine-picker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
  border: 1.5px solid var(--cream-dk);
}
.wine-picker-item:hover { background: var(--cream); }
.wine-picker-item.selected { border-color: var(--burgundy); background: var(--cream-dk); }
.picker-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.picker-name { font-size: .9rem; font-weight: 600; flex: 1; }
.picker-meta { font-size: .78rem; color: var(--text-lt); }

/* ── Desktop enhancement (≥640px) ───────────────────────────────────────────── */
@media (min-width: 640px) {
  #bottom-nav { justify-content: center; }
  .nav-item { max-width: 90px; }

  .camera-area { max-height: 65dvh; aspect-ratio: auto; min-height: 360px; }

  #modal-box {
    border-radius: var(--radius);
    margin-bottom: 32px;
    max-width: 520px;
  }
  #modal-overlay { align-items: center; }

  :root { --slot-w: 48px; }
  .rack-grid, .rack-diamond .rack-row, .rack-body-row, .rack-col-labels { gap: 8px; }
  .rack-body { gap: 20px; }
  .rack-body-row { padding-bottom: 20px; }
}

@media (min-width: 1024px) {
  #main-content { max-width: 760px; margin: 0 auto; }
  .pairing-hero { border-radius: 0 0 var(--radius) var(--radius); }
}

/* ── Cloud Sync UI ───────────────────────────────────────────────────────────── */

/* Floating sync status dot (bottom-left) */
#sync-indicator {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  left: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 900;
  transition: background var(--transition);
}
.sync-live  { background: #34A853; box-shadow: 0 0 0 3px rgba(52,168,83,.25); }
.sync-off   { background: transparent; }

/* Sign-in with Google button */
.btn-google {
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: box-shadow var(--transition), background var(--transition);
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 2px 6px rgba(0,0,0,.15); }

.btn-microsoft {
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: box-shadow var(--transition), background var(--transition);
}
.btn-microsoft:hover { background: #f3f3f3; box-shadow: 0 2px 6px rgba(0,0,0,.15); }

/* Sign-in buttons spacing */
.btn-google.btn-full,
.btn-microsoft.btn-full { margin-bottom: 10px; }

/* "or" divider between social buttons and email form */
.signin-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--text-lt);
  font-size: .8rem;
}
.signin-divider::before,
.signin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Email link form */
.email-signin-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.email-signin-form .form-input {
  flex: 1;
  min-width: 0;
}
.email-signin-form .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Confirmation state after email link is sent */
.email-signin-sent {
  background: var(--surface-alt, rgba(163,131,91,.08));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.email-signin-sent-icon { font-size: 2rem; margin-bottom: 6px; }
.email-signin-sent strong { display: block; margin-bottom: 6px; }
.email-signin-sent p { font-size: .85rem; color: var(--text-lt); margin: 0 0 12px; }

/* Signed-in user row */
.sync-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.sync-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--burgundy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Active sync badge */
.sync-active-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  font-weight: 600;
  color: #34A853;
  margin: 10px 0 14px;
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34A853;
  animation: pulse-green 2s ease infinite;
}
@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(52,168,83,.5); }
  50%      { box-shadow: 0 0 0 5px rgba(52,168,83,0); }
}

/* Invite code box */
.sync-code-box {
  background: var(--cream-dk);
  border: 1.5px dashed var(--burgundy-lt);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.sync-code-label  { font-size: .75rem; color: var(--text-lt); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.sync-code-value  { font-size: 2rem; font-weight: 800; letter-spacing: .22em; color: var(--burgundy); font-family: 'SF Mono', 'Fira Code', monospace; }
.sync-code-hint   { font-size: .78rem; color: var(--text-lt); margin-top: 6px; }

/* Members list */
.sync-members-title {
  font-size: .75rem;
  color: var(--text-lt);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 16px 0 8px;
}
.sync-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sync-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cream-dk);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.sync-member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--burgundy);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sync-member-avatar--you { background: var(--gold); color: var(--burgundy); }
.sync-member-info { flex: 1; min-width: 0; }
.sync-member-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-member-email {
  font-size: .74rem;
  color: var(--text-lt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-member-badge {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(163,131,91,.12);
  border-radius: 20px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.sync-member-lastseen {
  font-size: .68rem;
  color: var(--text-lt);
  flex-shrink: 0;
  text-align: right;
}
[data-theme="dark"] .sync-member-row { background: #2A1020; }

/* Join row */
.sync-join-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sync-join-row .form-control { flex: 1; }

/* Info text */
.sync-info-text {
  font-size: .88rem;
  color: var(--text-md);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 2 — READY TONIGHT BANNER
   ════════════════════════════════════════════════════════════════════════════ */
.ready-tonight-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1A6B3C 0%, #2D8A55 100%);
  color: #fff;
  cursor: pointer;
  transition: opacity var(--transition);
}
.ready-tonight-banner:active { opacity: .85; }
.ready-tonight-icon { font-size: 1.8rem; flex-shrink: 0; }
.ready-tonight-text { flex: 1; }
.ready-tonight-count { font-size: 1rem; font-weight: 700; }
.ready-tonight-sub { font-size: .8rem; opacity: .8; margin-top: 2px; }
.ready-tonight-arrow { font-size: 1.2rem; opacity: .7; }

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 3 — TAGS
   ════════════════════════════════════════════════════════════════════════════ */
.wine-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.wine-tag-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 600;
  background: var(--cream-dk);
  color: var(--text-md);
  border: 1px solid rgba(128,26,51,.12);
}

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 5 — GALLERY MODE
   ════════════════════════════════════════════════════════════════════════════ */
.wine-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 12px;
}
.gallery-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--cream-dk);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.gallery-card:active .gallery-card-img { transform: scale(1.04); }
.gallery-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  padding: 6px 6px 5px;
}
.gallery-card-name {
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card-vintage {
  font-size: .58rem;
  color: rgba(255,255,255,.7);
}
.gallery-card-placeholder .gallery-card-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  opacity: .7;
  margin-bottom: 24px; /* room for the overlay */
}

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 6 — CELLAR MAP OVERVIEW
   ════════════════════════════════════════════════════════════════════════════ */
.cellar-map-section {
  margin: 12px 16px 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px var(--shadow);
  overflow: hidden;
}
.cellar-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--burgundy-dk);
  color: var(--white);
  cursor: pointer;
  user-select: none;
}
.cellar-map-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cellar-map-toggle {
  font-size: .75rem;
  opacity: .75;
}
.cellar-mini-maps-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 14px;
  scrollbar-width: none;
}
.cellar-mini-maps-row::-webkit-scrollbar { display: none; }
.cellar-mini-map {
  flex-shrink: 0;
  width: 90px;
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition);
}
.cellar-mini-map:active { transform: scale(.96); }
.cellar-mini-map:hover { opacity: .85; }
.mini-map-name {
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}
.mini-map-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  min-height: 30px;
  width: 100%;
}
/* grid/diamond cellars override display:grid via inline style */
.map-dot {
  flex-shrink: 0;
}
.map-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.map-dot-filled { opacity: .9; }
.map-dot-empty {
  background: var(--cream-dk);
  border: 1px solid var(--cream-dk);
}
.mini-map-pct {
  font-size: .68rem;
  font-weight: 700;
  color: var(--burgundy);
  margin-top: 5px;
}

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 7 — DECANTING TIMER BUBBLE
   ════════════════════════════════════════════════════════════════════════════ */
#decant-bubble {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
  left: 14px;
  background: var(--burgundy);
  color: var(--white);
  padding: 9px 14px;
  border-radius: 50px;
  font-size: .88rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(92,40,150,.45);
  z-index: 900;
  cursor: pointer;
  transition: transform var(--transition);
  white-space: nowrap;
}
#decant-bubble:active { transform: scale(.95); }

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 8 — BATCH SELECT
   ════════════════════════════════════════════════════════════════════════════ */
.batch-select-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--cream-dk);
  border-bottom: 1px solid var(--cream-dk);
}
.batch-count {
  font-size: .85rem;
  font-weight: 700;
  color: var(--burgundy);
  flex: 1;
  white-space: nowrap;
}
.batch-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--cream-dk);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}
.batch-checkbox.checked {
  background: var(--burgundy);
  border-color: var(--burgundy);
}
.batch-checkbox.checked::after {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .65rem;
  font-weight: 900;
  height: 100%;
}
.wine-card.batch-selected {
  border: 2px solid var(--burgundy);
  background: var(--cream);
}
.wine-card.batch-selectable { cursor: pointer; }

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 11 — NOTIFICATION PROMPT TOAST
   ════════════════════════════════════════════════════════════════════════════ */
.notif-prompt-toast {
  background: var(--brown);
  color: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  line-height: 1.45;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 4px 20px var(--shadow-md);
  pointer-events: all;
  max-width: 400px;
  text-align: left;
}
.notif-prompt-toast span { flex: 1 1 100%; }

/* ── Notification settings ───────────────────────────────────────────────── */
.notif-status {
  font-size: .8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.notif-status.granted { background: #d4edda; color: #1a5c2a; }
.notif-status.denied  { background: #f8d7da; color: #7a1a20; }
.notif-status.default { background: #fff3cd; color: #7a5c00; }

.notif-toggle-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--cream-dk);
}
.notif-toggle-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-toggle-label span  { font-size: .9rem; font-weight: 500; color: var(--text); }
.notif-toggle-label small { font-size: .75rem; color: var(--text-muted); line-height: 1.3; }

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--burgundy); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ════════════════════════════════════════════════════════════════════════════
   FEATURE 4 — WISHLIST (uses existing wine-card styles + minor additions)
   ════════════════════════════════════════════════════════════════════════════ */
/* wishlist uses existing wine-grid + wine-card — no new base styles needed */

/* ── Wine location block (shown in wine detail card) ───────────────────────── */
.wine-location-block {
  margin-top: 12px;
  border-top: 1px solid var(--cream-dk);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.location-cellar-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.location-cellar-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1.5px solid var(--burgundy);
  border-radius: 20px;
  color: var(--burgundy);
  font-size: .8rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.location-cellar-name:hover,
.location-cellar-name:active {
  background: var(--burgundy);
  color: var(--white);
}
.location-coords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.location-coord-pill {
  background: var(--cream-dk);
  color: var(--text-md);
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

/* ── Stats view ─────────────────────────────────────────────────────────────── */
.stats-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 16px;
}
.stats-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 4px var(--shadow);
  text-align: center;
}
.stats-card--highlight { background: var(--burgundy); color: var(--white); }
.stats-card--highlight .stats-card-label { color: rgba(255,255,255,.75); }
.stats-card-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--burgundy);
  line-height: 1.1;
}
.stats-card--highlight .stats-card-value { color: var(--white); }
.stats-card-label {
  font-size: .72rem;
  color: var(--text-lt);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
/* ── Spending chart ──────────────────────────────────────────────────────── */
.spending-chart-wrap {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 12px 10px;
  box-shadow: 0 1px 4px var(--shadow);
}
.spending-chart-svg {
  width: 100%;
  display: block;
}
.spending-chart-total {
  font-size: .75rem;
  color: var(--text-lt);
  text-align: right;
  margin-top: 6px;
  font-weight: 500;
}
.spending-no-data {
  text-align: center;
  padding: 20px 0;
  font-size: .85rem;
  color: var(--text-lt);
}

/* ── Cellar Health ───────────────────────────────────────────────────────── */
.health-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 4px var(--shadow);
}

/* Readiness segmented bar */
.readiness-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 12px;
}
.readiness-bar-segment {
  height: 100%;
  transition: width .4s ease;
}
.readiness-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.readiness-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--text-md);
}
.readiness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Health score badge */
.health-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cream-dk);
}
.health-score-label {
  font-size: .78rem;
  color: var(--text-lt);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.health-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
}
.health-score-badge--good { background: #e8f5e9; color: #2e7d32; }
.health-score-badge--ok   { background: #fff8e1; color: #e65100; }
.health-score-badge--poor { background: #fde8e8; color: #c0392b; }
[data-theme="dark"] .health-score-badge--good { background: #0d2e12; color: #81c784; }
[data-theme="dark"] .health-score-badge--ok   { background: #2e1e00; color: #ffb74d; }
[data-theme="dark"] .health-score-badge--poor { background: #3d1010; color: #e57373; }

/* Highlight tiles */
.health-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.health-tile {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}
[data-theme="dark"] .health-tile { background: var(--cream-dk); }
.health-tile-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--burgundy);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.health-tile-label {
  font-size: .65rem;
  color: var(--text-lt);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 4px;
}
.health-tile-name {
  font-size: .68rem;
  color: var(--gold);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.health-tile--link {
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.health-tile--link:active {
  transform: scale(.96);
  box-shadow: 0 0 0 2px var(--burgundy);
}

.stats-section {
  padding: 0 16px 24px;
}
.stats-section-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}
.stats-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.stats-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--cream-dk);
  border-radius: 4px;
  overflow: hidden;
}
.stats-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 4px;
  transition: width .4s ease;
}
.stats-type-count {
  font-size: .78rem;
  color: var(--text-md);
  min-width: 54px;
  text-align: right;
}
.stats-type-val {
  font-size: .78rem;
  color: var(--text-lt);
  min-width: 46px;
  text-align: right;
}
.stats-history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stats-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px var(--shadow);
}
.stats-history-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.stats-history-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-history-meta {
  font-size: .74rem;
  color: var(--text-lt);
  margin-top: 2px;
}
.stats-history-tasting {
  font-size: .72rem;
  color: var(--text-md);
  margin-top: 3px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.stats-tasting-stars {
  color: var(--gold);
  font-size: .75rem;
  letter-spacing: 1px;
}

/* ── Drink Soon section ──────────────────────────────────────── */
.drink-soon-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drink-soon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px var(--shadow);
}
.drink-soon-urgency {
  flex-shrink: 0;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 20px;
}
.drink-soon-urgency--past {
  background: #fde8e8;
  color: #c0392b;
}
.drink-soon-urgency--ready {
  background: #e8f5e9;
  color: #2e7d32;
}
.drink-soon-urgency--soon {
  background: #fff8e1;
  color: #e65100;
}
.drink-soon-info {
  flex: 1;
  min-width: 0;
}
.drink-soon-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drink-soon-meta {
  font-size: .73rem;
  color: var(--text-lt);
  margin-top: 2px;
}
.drink-soon-qty {
  flex-shrink: 0;
  font-size: .8rem;
  color: var(--text-md);
  font-weight: 600;
}

/* ── Serving temperature badge ───────────────────────────────── */
.serving-temp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--cream);
  border: 1px solid var(--cream-dk);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin: 10px auto 0;
}
.serving-temp-badge .temp-icon {
  font-size: 1rem;
}

/* ── Star rating ─────────────────────────────────────────────── */
.star-rating {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 8px 0;
}
.star-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--cream-dk);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .15s, transform .1s;
}
.star-btn:hover,
.star-btn.active {
  color: var(--gold);
  transform: scale(1.15);
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME — Decision-first screen
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Tonight header ─────────────────────────────────────────────────── */
.home-tonight-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(20px + var(--safe-top)) 16px 4px;
}
.home-tonight-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.home-tonight-title {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

/* ── Pick cards ──────────────────────────────────────────────────────── */
.home-picks-list {
  padding: 12px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-pick-card {
  background: var(--white);
  border: 1.5px solid var(--cream-dk);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 2px 6px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.home-pick-card:active {
  box-shadow: 0 1px 3px var(--shadow);
  border-color: var(--burgundy);
}
.home-pick-card.home-pick-primary {
  border-color: var(--burgundy);
  border-width: 2px;
  background: linear-gradient(135deg, #fff 0%, #fdf4f6 100%);
}
.home-pick-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.home-pick-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.home-pick-main {
  flex: 1;
  min-width: 0;
}
.home-pick-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.home-pick-producer {
  font-size: .82rem;
  color: var(--text-md);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-pick-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.home-pick-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 3px 8px;
  border-radius: 20px;
}
.home-pick-status.status-ready   { background: #e8f5e9; color: #2e7d32; }
.home-pick-status.status-peak    { background: #fff3e0; color: #e65100; }
.home-pick-status.status-past    { background: #fce4ec; color: #b71c1c; }
.home-pick-status.status-soon    { background: #e3f2fd; color: #1565c0; }
.home-pick-location {
  font-size: .75rem;
  color: var(--text-lt);
  display: flex;
  align-items: center;
  gap: 3px;
}
.home-pick-qty {
  font-size: .75rem;
  color: var(--text-lt);
}
.home-pick-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.home-pick-btn-open {
  flex: 1;
  background: var(--burgundy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .02em;
  transition: background .15s;
}
.home-pick-btn-open:active { background: var(--burgundy-lt); }
.home-pick-btn-view {
  background: var(--cream);
  color: var(--text-md);
  border: 1.5px solid var(--cream-dk);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s;
}
.home-pick-btn-view:active { background: var(--cream-dk); }

/* ════════════════════════════════════════════════════════════════════════════
   FIRST-RUN CONSENT OVERLAY (GDPR)
   Hard-coded brand colours — never affected by dark mode.
   ════════════════════════════════════════════════════════════════════════════ */
#consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(20, 6, 2, 0.97);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .35s ease;
}
#consent-overlay.consent-overlay-visible { opacity: 1; }
.consent-inner {
  background: #F2EBE1;          /* brand cream — always light */
  border-radius: 18px 18px 0 0;
  padding: 28px 20px calc(32px + env(safe-area-inset-bottom, 0px));
  max-width: 480px;
  width: 100%;
  transform: translateY(40px);
  transition: transform .35s ease;
}
#consent-overlay.consent-overlay-visible .consent-inner { transform: translateY(0); }
.consent-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}
.consent-title {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 600;
  color: #3B1422;               /* brand burgundy */
  text-align: center;
  margin: 0 0 6px;
}
.consent-body {
  font-size: .88rem;
  color: #5C3244;               /* wine mid */
  text-align: center;
  margin: 0 0 14px;
}
.consent-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #EAE0D5;          /* slightly deeper cream for contrast */
  border-radius: 10px;
  padding: 12px 14px;
}
.consent-list li {
  font-size: .84rem;
  line-height: 1.6;
  color: #2C1010;               /* near-black warm */
  padding-left: 22px;
  position: relative;
}
.consent-list li::before {
  content: '🍷';
  position: absolute;
  left: 0;
  font-size: .78rem;
}
.consent-privacy-note {
  font-size: .74rem;
  color: #8A6A5A;               /* muted warm brown */
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.5;
}
.consent-accept-btn { margin-top: 4px; }

/* ════════════════════════════════════════════════════════════════════════════
   LEGAL PAGES (Privacy Policy / Terms of Service)
   ════════════════════════════════════════════════════════════════════════════ */
.legal-page-body {
  padding: 0 16px 48px;
  max-width: 680px;
  margin: 0 auto;
}
.legal-page-body h2 {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--burgundy);
  margin: 24px 0 6px;
}
.legal-page-body p {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 10px;
}
.legal-page-body p em {
  font-style: italic;
  color: var(--text-md);
}
.legal-updated {
  font-size: .78rem;
  color: var(--text-lt);
  letter-spacing: .04em;
  margin-top: 4px !important;
  margin-bottom: 20px !important;
}
[data-theme="dark"] .legal-page-body p { color: var(--text); }
[data-theme="dark"] .legal-page-body h2 { color: var(--gold); }

/* ── Empty / nudge state ─────────────────────────────────────────────── */
.home-empty-picks {
  margin: 12px 16px 4px;
  background: var(--cream);
  border: 1.5px dashed var(--cream-dk);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.home-empty-picks-icon { font-size: 2rem; margin-bottom: 8px; }
.home-empty-picks-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.home-empty-picks-sub {
  font-size: .85rem;
  color: var(--text-lt);
  line-height: 1.5;
}

/* ── Quick actions ───────────────────────────────────────────────────── */
.home-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 6px;
}
.home-quick-row {
  display: flex;
  gap: 10px;
}
.home-quick-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1.5px solid var(--cream-dk);
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  box-shadow: 0 1px 4px var(--shadow);
}
.home-quick-btn:active {
  background: var(--cream);
  border-color: var(--burgundy);
  transform: scale(.97);
}
.home-quick-btn-icon {
  font-size: 1.35rem;
  line-height: 1;
}
.home-quick-btn-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-md);
  letter-spacing: .02em;
  text-align: center;
  line-height: 1.2;
}

/* ── Cellar summary strip ────────────────────────────────────────────── */
.home-stats-strip {
  display: flex;
  gap: 8px;
  padding: 6px 16px 2px;
  flex-wrap: wrap;
}
.home-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--cream);
  border: 1px solid var(--cream-dk);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: .75rem;
  color: var(--text-md);
  font-weight: 500;
}
.home-stat-pill.pill-warn { background: #fce4ec; color: #b71c1c; border-color: #f48fb1; }
.home-stat-pill.pill-ready { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }

/* ── Cellars section header ──────────────────────────────────────────── */
.home-cellars-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 4px;
}
.home-cellars-title {
  font-weight: 700;
  color: var(--text);
  font-size: .95rem;
}
.home-manage-btn {
  font-size: .8rem;
  color: var(--burgundy);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}

/* ── Dark mode overrides ─────────────────────────────────────────────── */
[data-theme="dark"] .home-pick-card {
  background: #2A1520;
  border-color: #4A2535;
}
[data-theme="dark"] .home-pick-card.home-pick-primary {
  background: linear-gradient(135deg, #2A1520 0%, #3A1828 100%);
  border-color: var(--burgundy-lt);
}
[data-theme="dark"] .home-pick-name { color: #F2EBE1; }
[data-theme="dark"] .home-pick-producer { color: #9A7060; }
[data-theme="dark"] .home-pick-status.status-ready  { background: #1b3a1e; color: #81c784; }
[data-theme="dark"] .home-pick-status.status-peak   { background: #3a2000; color: #ffb74d; }
[data-theme="dark"] .home-pick-status.status-past   { background: #3a1018; color: #ef9a9a; }
[data-theme="dark"] .home-pick-status.status-soon   { background: #0d2a3a; color: #64b5f6; }
[data-theme="dark"] .home-pick-btn-view {
  background: #1E0E14;
  border-color: #4A2535;
  color: #C4A478;
}
[data-theme="dark"] .home-empty-picks {
  background: #1E0E14;
  border-color: #4A2535;
}
[data-theme="dark"] .home-empty-picks-title { color: #F2EBE1; }
[data-theme="dark"] .home-quick-btn {
  background: #2A1520;
  border-color: #4A2535;
}
[data-theme="dark"] .home-quick-btn:active { background: #3A1828; }
[data-theme="dark"] .home-quick-btn-label { color: #C4A478; }
[data-theme="dark"] .home-stat-pill { background: #1E0E14; border-color: #4A2535; color: #9A7060; }
[data-theme="dark"] .home-stat-pill.pill-warn  { background: #3a1018; color: #ef9a9a; border-color: #7a2030; }
[data-theme="dark"] .home-stat-pill.pill-ready { background: #1b3a1e; color: #81c784; border-color: #2e7d32; }
[data-theme="dark"] .home-cellars-title { color: #F2EBE1; }
[data-theme="dark"] .home-tonight-title { color: #F2EBE1; }

/* ── Wine Preview Card (scan/search result modal) ───────────────────────── */
.wine-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}
.wp-image {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.wp-type-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
}
.wp-name {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--burgundy);
  text-align: center;
  margin: 0;
  line-height: 1.25;
}
.wp-source-badge {
  font-size: .72rem;
  color: var(--text-lt);
  letter-spacing: .04em;
}
.wp-details {
  width: 100%;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}
.wp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: .875rem;
}
.wp-label {
  color: var(--text-lt);
  flex-shrink: 0;
}
.wp-value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}
.wp-desc {
  font-size: .82rem;
  color: var(--text-lt);
  line-height: 1.5;
  text-align: left;
  margin: 0;
  font-style: italic;
}
.wp-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--burgundy);
  margin: 14px 0 4px;
}
.wp-pairings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.wp-pairing-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .75rem;
  padding: 3px 10px;
  color: var(--text);
}

/* ── Upgrade / Paywall Screen ──────────────────────────────────────────────── */
.upgrade-screen {
  padding: 0 16px 120px;
}
.upgrade-intro {
  font-size: .9rem;
  color: var(--text-md);
  text-align: center;
  margin: 0 0 18px;
}
.upgrade-plans {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.upgrade-plan-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  position: relative;
}
.upgrade-plan-card--current {
  border-color: var(--burgundy);
  background: color-mix(in srgb, var(--burgundy) 6%, var(--surface));
}
.upgrade-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.upgrade-badge--popular {
  background: var(--burgundy);
  color: #fff;
}
.upgrade-badge--annual {
  background: var(--gold);
  color: #3B1422;
}
.upgrade-plan-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 2px;
}
.upgrade-plan-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--burgundy);
  line-height: 1.2;
  margin-bottom: 12px;
}
.upgrade-plan-period {
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-md);
  margin-left: 2px;
}
.upgrade-feature-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.upgrade-feature-list li {
  font-size: .84rem;
  color: var(--text-md);
}
.upgrade-cta {
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: block;
}
.upgrade-current-label {
  text-align: center;
  font-size: .8rem;
  color: var(--text-lt);
  padding: 8px 0 2px;
  font-weight: 600;
  letter-spacing: .04em;
}
.upgrade-footnote {
  font-size: .76rem;
  color: var(--text-lt);
  text-align: center;
  margin: 20px 0 0;
  line-height: 1.5;
}

.btn-reset-plan {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-lt);
  font-size: .72rem;
  font-family: inherit;
  padding: 5px 14px;
  cursor: pointer;
  opacity: .65;
  letter-spacing: .03em;
}
.btn-reset-plan:hover { opacity: 1; color: var(--gold); border-color: var(--gold); }

/* ── Settings plan card ────────────────────────────────────────────────────── */
.settings-plan-card {
  background: color-mix(in srgb, var(--burgundy) 8%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--burgundy) 30%, var(--border));
}

/* ── OrigoVero status indicator ────────────────────────────────────────────── */
.origo-status {
  display: flex;
  align-items: center;
  gap: 12px;
}
.origo-status-dot {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 15%, var(--surface));
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: .9rem;
  font-weight: 700;
}
.origo-status-title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--gold);
}
.origo-status-sub {
  font-size: .76rem;
  color: var(--text-lt);
  margin-top: 2px;
  line-height: 1.4;
}
.settings-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.settings-plan-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-lt);
}
.settings-plan-name {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.settings-plan-badge {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.settings-plan-usage {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-plan-usage span {
  font-size: .82rem;
  color: var(--text-md);
}

/* ── Settings — AI proxy notice (signed-in users) ──────────────────────────── */
.settings-ai-proxy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
}
