/* ================================================================
   DRAM LEDGER — Stylesheet
   Same design language as Stonewood Advisors / Daeffler's:
   flat dark surfaces, 1px hairlines instead of shadows, square
   corners, light Cormorant display type, Inter UI, one muted accent.
   Islay mood comes from colour (peat-black, sea-slate, brass), not texture.
   ================================================================ */

/* ── 1. Tokens ────────────────────────────────────────────────── */
:root {
  --bg:        #141514;
  --bg2:       #1b1c1a;
  --bg3:       #232420;
  --text:      #ebe6dc;
  --muted:     #b7b0a3;
  --dim:       #8f887b;
  --brass:     #bfa274;          /* accent: aged brass */
  --brass-ink: #141514;
  --sea:       #7f9a97;          /* secondary: Islay sea-slate, used sparingly */

  --line:        rgba(191, 162, 116, 0.14);
  --line-strong: rgba(191, 162, 116, 0.32);
  --line-soft:   rgba(235, 230, 220, 0.06);

  /* region palette (CVD-validated on this surface; always shown with a label) */
  --r-islay: #1898ab;
  --r-highlands: #c4552c;
  --r-speyside: #9a6ad0;
  --r-islands: #5f9b3b;
  --r-campbeltown: #c2527e;
  --r-lowlands: #b8841c;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* legacy aliases used by inline styles in app.js */
  --font-display: var(--serif);
  --font-engraved: var(--serif);
  --font-ui: var(--sans);
  --font-body: var(--sans);
  --ink: var(--text); --ink-2: var(--muted); --ink-3: var(--dim);
  --brass-hi: var(--brass); --brass-mid: var(--brass); --brass-lo: var(--line-strong);
  --smoke: #8f887b; --walnut-800: var(--bg); --walnut-900: var(--bg);

  --pad: clamp(1rem, 5vw, 2.5rem);
  --max: 1240px;
  --nav-h: 72px;
  --t-fast: 0.2s ease;
  --t-base: 0.35s ease;
  color-scheme: dark;
}

/* ── 2. Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; font-weight: 300; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: var(--brass); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }
strong, b { font-weight: 500; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
::selection { background: var(--brass); color: var(--brass-ink); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.1; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h3 { font-size: 1.4rem; font-weight: 500; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.9em; margin: 0 0 0.9rem;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }
.lede { font-size: clamp(1.02rem, 1.2vw, 1.15rem); color: var(--muted); max-width: 640px; margin: 1rem 0 0; }
.muted { color: var(--dim); }
.small { font-size: 0.875rem; }
.ui { font-family: var(--sans); font-size: 0.8125rem; }
.hide-sm { }

/* ── 3. Header ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 1500;  /* above Leaflet controls (1000), below overlays (2000) */ height: var(--nav-h);
  display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.25rem); padding: 0 var(--pad);
  background: rgba(20, 21, 20, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.crest { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--text); flex-shrink: 0; }
.crest svg { width: 30px; height: 30px; color: var(--brass); }
.crest-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1; }
.crest-sub { display: none; }
.nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.2vw, 2.1rem); flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-size: 0.75rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; padding: 0.4rem 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--brass); }
/* Grouped menus: open on hover, keyboard focus or click (touch) */
.navgroup { position: relative; }
.navtop { font: inherit; font-size: 0.75rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
  padding: 0.4rem 0; background: none; border: 0; border-bottom: 1px solid transparent; cursor: pointer; }
.navtop::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 0 3px 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); opacity: 0.7; }
.navgroup:hover .navtop, .navgroup.open .navtop { color: var(--text); }
.navgroup.active > .navtop { color: var(--text); border-bottom-color: var(--brass); }
.navmenu { display: none; position: absolute; top: calc(100% + 20px); left: -20px; min-width: 290px; padding: 6px 0; background: var(--bg); border: 1px solid var(--line); z-index: 1100; }
.navmenu::before { content: ""; position: absolute; top: -21px; left: 0; right: 0; height: 21px; }  /* hover bridge */
.navgroup:hover .navmenu, .navgroup:focus-within .navmenu, .navgroup.open .navmenu { display: block; }
.nav .navmenu a { display: block; padding: 0.7rem 20px; border-bottom: 0; }
.nav .navmenu a:hover { background: var(--bg2); }
.nav .navmenu a.active { color: var(--brass); }
.navmenu small { display: block; margin-top: 3px; font-size: 0.75rem; letter-spacing: 0; text-transform: none; color: var(--dim); }
.top-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }
.topbar .menu-btn { display: none; }
/* When the links don't fit (narrow window, zoom, larger text), app.js adds .nav-collapsed and the menu becomes a drop-down */
body.nav-collapsed .topbar .menu-btn { display: inline-flex; }
body.nav-collapsed .nav { position: fixed; top: var(--nav-h); left: 0; right: auto; width: min(320px, 100vw); flex-direction: column; gap: 0; padding: 0.5rem var(--pad) 1.25rem; background: var(--bg); border: 1px solid var(--line); border-top: 0; display: none; overflow: visible; }
body.nav-collapsed .nav.open { display: flex; }
body.nav-collapsed .nav a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
body.nav-collapsed .nav a.active { border-bottom-color: var(--line); color: var(--brass); }
body.nav-collapsed .nav { align-items: stretch; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
body.nav-collapsed .navtop { pointer-events: none; padding: 1.1rem 0 0.2rem; font-size: 0.6875rem; color: var(--brass); border: 0; text-align: left; }
body.nav-collapsed .navtop::after { display: none; }
body.nav-collapsed .navmenu { display: block; position: static; min-width: 0; padding: 0; border: 0; background: none; }
body.nav-collapsed .navmenu::before, body.nav-collapsed .navmenu small { display: none; }
body.nav-collapsed .nav .navmenu a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
body.nav-collapsed .nav .navmenu a:hover { background: none; }
body.nav-collapsed .topbar { justify-content: space-between; }
body.nav-collapsed .crest { margin-right: auto; }

/* ── 4. Buttons, chips, inputs ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.85em 1.6em; border: 1px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--text);
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.2;
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn:hover { border-color: var(--brass); color: var(--brass); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.btn-brass { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn-brass:hover { background: var(--text); border-color: var(--text); color: var(--brass-ink); }
.btn-ghost { border-color: transparent; }
.btn-danger:hover { border-color: #c4553a; color: #e39a86; }
.btn-sm { padding: 0.55em 1em; font-size: 0.6875rem; }
.icon-btn { padding: 0.55em 0.75em; }
.kbd { font-size: 0.625rem; padding: 0 5px; border: 1px solid var(--line-strong); color: var(--dim); }
#acctBtn { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

.chip {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 0.35em 0.8em;
  border: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted);
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
button.chip { cursor: pointer; }
button.chip:hover, a.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { border-color: var(--brass); color: var(--brass); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.plaque {
  display: inline-block; padding: 0.3em 0.75em; border: 1px solid var(--line-strong); color: var(--brass);
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
}

.input, select.input, textarea.input {
  width: 100%; padding: 0.75em 0.9em; border: 1px solid var(--line-strong); border-radius: 0; background: var(--bg);
  color: var(--text); font-family: var(--sans); font-size: 0.9rem; font-weight: 300; outline: none; transition: border-color var(--t-fast);
}
.input:focus { border-color: var(--brass); }
textarea.input { line-height: 1.6; min-height: 90px; resize: vertical; }
select.input { appearance: none; padding-right: 2.2em; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=range] { accent-color: var(--brass); width: 100%; }
input[type=checkbox] { accent-color: var(--brass); width: 16px; height: 16px; }
label.lbl { display: block; margin-bottom: 0.4rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }

/* ── 5. Layout ────────────────────────────────────────────────── */
main { min-height: calc(100vh - var(--nav-h)); }
.page { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--pad) 5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: clamp(2rem, 4vw, 3rem); }
.rule { border: 0; height: 1px; background: var(--line); margin: clamp(2.5rem, 5vw, 4rem) 0; }
.wool, .tartan { background: var(--bg2); }

/* hairline grids (Stonewood's 1px-gap technique) */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid > .empty, .grid > .gate { grid-column: 1 / -1; background: var(--bg); border: 0; margin: 0; }

.card { position: relative; display: flex; flex-direction: column; background: var(--bg2); color: var(--text); overflow: hidden; transition: background var(--t-base); }
a.card:hover { background: var(--bg3); color: var(--text); }
.card-body { padding: 1.25rem 1.4rem 1.4rem; flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.card-title { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; line-height: 1.15; }
.card-meta { font-size: 0.75rem; color: var(--dim); letter-spacing: 0.02em; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 0.9rem; }
.card-band { height: 2px; }
.card-img { aspect-ratio: 4/3; background: var(--bg); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img.bottle-img { aspect-ratio: 1/1; display: grid; place-items: center; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.card-img.bottle-img img { height: 86%; width: auto; object-fit: contain; }
.ribbon { position: absolute; top: 12px; left: 12px; padding: 0.25em 0.6em; background: var(--bg); border: 1px solid var(--line-strong); color: var(--brass); font-size: 0.625rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* peat gauge */
.peat { display: flex; align-items: center; gap: 10px; font-size: 0.75rem; }
.peat svg { display: none; }
.peat-track { flex: 1; height: 2px; background: var(--line); position: relative; min-width: 60px; }
.peat-fill { position: absolute; inset: 0 auto 0 0; background: var(--brass); }
.peat-val { color: var(--muted); min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── 6. Filters ───────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 1.75rem; padding: 0 0 1.25rem; border-bottom: 1px solid var(--line); background: none !important; }
.filters .grow { flex: 1; min-width: 200px; }
.filters select.input { width: auto; }
.search-inline { max-width: 320px; }

/* ── 7. Stats ─────────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 1.5rem 0; }
.stat { padding: 1.1rem 1.2rem 1.1rem 0; }
.stat + .stat { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.stat .v { font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .l { margin-top: 0.3rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

/* ── 8. Atlas ─────────────────────────────────────────────────── */
.atlas { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - var(--nav-h)); }
.atlas-side { border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; background: var(--bg) !important; }
.atlas-side .section { padding: 1.4rem 1.5rem; border-bottom: 1px solid var(--line); }
.atlas-side h1 { font-size: 2.1rem; }
.atlas-map { position: relative; }
#map, .map-el { width: 100%; height: 100%; background: #111312; }
.map-el { border: 1px solid var(--line); min-height: 320px; }
.atlas-list { flex: 1; }
.atlas-item { display: flex; gap: 12px; align-items: center; padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--line-soft); color: var(--text); cursor: pointer; transition: background var(--t-fast); }
.atlas-item:hover { background: var(--bg2); }
.atlas-item .nm { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; line-height: 1.1; }
.atlas-item .sub { font-size: 0.6875rem; color: var(--dim); letter-spacing: 0.04em; }
.atlas-item .ppm { margin-left: auto; font-size: 0.6875rem; color: var(--dim); white-space: nowrap; }
.legend-float { position: absolute; right: 14px; bottom: 26px; z-index: 500; display: grid; gap: 6px; padding: 12px 14px; background: rgba(20,21,20,0.92); border: 1px solid var(--line); font-size: 0.6875rem; letter-spacing: 0.06em; }
.legend-float div { display: flex; align-items: center; gap: 8px; }

.leaflet-container { font-family: var(--sans); background: #111312; }
.leaflet-tile-pane .osm-dark { filter: invert(1) hue-rotate(180deg) grayscale(1) brightness(0.8) contrast(0.95); }
.map-labels { pointer-events: none; opacity: 0.85; }
.leaflet-control-zoom a { background: var(--bg) !important; color: var(--muted) !important; border-color: var(--line) !important; border-radius: 0 !important; }
.leaflet-bar { border-radius: 0 !important; border: 1px solid var(--line) !important; box-shadow: none !important; }
.leaflet-control-attribution { background: rgba(20,21,20,0.8) !important; color: var(--dim) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg2); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.leaflet-popup-content-wrapper { border-radius: 0; }
.leaflet-popup-content { margin: 16px 18px; font-size: 0.875rem; min-width: 220px; line-height: 1.5; }
.leaflet-popup-close-button { color: var(--dim) !important; }
.leaflet-tooltip { background: var(--bg2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 0; box-shadow: none; font-family: var(--sans); font-size: 0.75rem; }
.leaflet-tooltip-top::before { border-top-color: var(--line-strong); } .leaflet-tooltip-right::before { border-right-color: var(--line-strong); }
.leaflet-tooltip.pin-label-tt { background: transparent; border: 0; padding: 0; font-family: var(--serif); font-size: 0.95rem; color: var(--text); text-shadow: 0 0 4px #000, 0 0 2px #000; }
.leaflet-tooltip.pin-label-tt::before { display: none; }
.pop-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; line-height: 1.1; margin-bottom: 2px; }
.pop-meta { font-size: 0.6875rem; color: var(--dim); letter-spacing: 0.04em; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pop-links { display: flex; gap: 14px; margin-top: 12px; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #111312; }
.pin.visited { box-shadow: 0 0 0 2px var(--brass); }
.pin.planned { opacity: 0.5; border-style: dashed; }
.pin-num { width: 24px; height: 24px; display: grid; place-items: center; background: var(--brass); color: var(--brass-ink); font-size: 0.6875rem; font-weight: 600; border: 2px solid #111312; }

/* ── 9. Detail pages ──────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; background: var(--bg2) !important; border-bottom: 1px solid var(--line); }
.hero-inner { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) var(--pad) clamp(2.5rem, 5vw, 3.5rem); display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; }
.hero-photo { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.22; filter: grayscale(0.4); }
.hero .crumbs { font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 1.25rem; }
.hero .crumbs a { color: var(--muted); }
.hero h1 { font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 400; letter-spacing: -0.015em; line-height: 1; }
.hero .pron { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.25rem; margin-top: 0.6rem; }
.hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(2rem, 4vw, 3.5rem); }
.detail-main > section { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.detail-side > .panel { margin-bottom: 1px; }
.detail-side { display: flex; flex-direction: column; gap: 1rem; }
.panel { background: var(--bg2); border: 1px solid var(--line); padding: 1.4rem 1.5rem; }
.panel h3 { font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); margin-bottom: 1rem; }
.section-title { margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.section-title h2 { font-family: var(--serif); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 400; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 1.25rem; margin: 0; font-size: 0.9rem; }
.facts dt { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding-top: 0.2rem; }
.facts dd { margin: 0; color: var(--text); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.prose { font-size: 1.02rem; line-height: 1.8; color: var(--text); max-width: 68ch; }
.prose p { margin: 0 0 1.1em; }
.prose:not(.plain) p:first-child { font-family: var(--serif); font-size: 1.45rem; line-height: 1.45; font-weight: 400; color: var(--text); }
.prose code { font-size: 0.85em; background: var(--bg3); padding: 1px 5px; }
.prose ul { padding-left: 1.2rem; }

.list-rows { border-top: 1px solid var(--line); }
.list-rows > * { display: flex; gap: 1rem; align-items: baseline; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.list-rows .k { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.list-rows .t { font-size: 0.625rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); white-space: nowrap; min-width: 70px; }
.list-rows .n { color: var(--muted); font-size: 0.9rem; }

.tasting { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tasting .panel { border: 0; }
.tasting .panel p { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--text); }
.score { font-family: var(--serif); font-size: 3.5rem; font-weight: 400; line-height: 1; color: var(--text); }
.score small { font-family: var(--sans); font-size: 0.8rem; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.gallery button { padding: 0; border: 0; aspect-ratio: 1; background: var(--bg); cursor: zoom-in; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--t-fast); }
.gallery button:hover img { opacity: 0.85; }

.bottle-hero { display: grid; grid-template-columns: 340px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.bottle-stage { aspect-ratio: 3/4; display: grid; place-items: center; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); }
.bottle-stage img { max-height: 90%; width: auto; object-fit: contain; }
.bottle-hero h1 { font-size: clamp(2.4rem, 4.8vw, 3.8rem); }
.thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.thumbs button { width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); cursor: pointer; background: var(--bg); overflow: hidden; }
.thumbs button.on { border-color: var(--brass); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ── 10. Peat index ───────────────────────────────────────────── */
.scale-bands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 1.5rem 0 2rem; }
.scale-bands .panel { border: 0; }
.scale-bands .panel .v { font-family: var(--serif); font-size: 1.8rem; color: var(--text); }
.peat-chart { display: grid; gap: 1px; }
.pc-row { display: grid; grid-template-columns: 220px 1fr 64px; gap: 14px; align-items: center; padding: 4px 6px; color: var(--text); transition: background var(--t-fast); }
.pc-row:hover { background: var(--bg3); color: var(--text); }
.pc-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 500; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-bar { height: 10px; position: relative; }
.pc-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar, var(--brass)); min-width: 2px; }
.pc-val { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.pc-axis { display: grid; grid-template-columns: 220px 1fr 64px; gap: 14px; font-size: 0.625rem; color: var(--dim); padding: 0 6px; margin-bottom: 8px; }
.pc-axis .ticks { position: relative; height: 14px; }
.pc-axis .ticks span { position: absolute; transform: translateX(-50%); }
.tooltip { position: fixed; z-index: 3000; pointer-events: none; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line-strong); font-size: 0.75rem; color: var(--text); max-width: 260px; opacity: 0; transition: opacity 0.1s; }
.tooltip b { font-family: var(--serif); font-size: 1rem; font-weight: 500; display: block; }

/* ── 11. Timeline & journal ───────────────────────────────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; margin-bottom: 1.1rem; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 8px; width: 7px; height: 7px; background: var(--brass); transform: rotate(45deg); }
.tl-item .when { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }
.journal-entry { display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.journal-entry .date { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); line-height: 1.3; }
.journal-entry .date b { display: block; font-family: var(--serif); font-size: 2.6rem; font-weight: 400; color: var(--text); letter-spacing: 0; }
.journal-entry h2 { font-size: 2rem; margin-bottom: 0.5rem; }

/* ── 12. Bottle database rows ─────────────────────────────────── */
.vbadge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 0.3em 0.7em; border: 1px solid var(--line); color: var(--muted); font-size: 0.625rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.vbadge b { font-weight: 600; }
.vbadge.v-verified { border-color: var(--brass); color: var(--brass); }
.vbadge.v-partial { border-color: var(--line-strong); color: var(--text); }
.vbadge.v-theoretical { border-style: dashed; color: var(--dim); }
.vbadge.sm { font-size: 0.5625rem; }
.brows { display: grid; }
.brows.boxed { border-top: 1px solid var(--line); }
.brow { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 150px 34px; gap: 1rem; align-items: center; padding: 0.7rem 0.25rem; border-bottom: 1px solid var(--line); transition: background var(--t-fast); }
.brows.boxed .brow:has(.bdist) { grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 150px 34px; }
.brow .vbadge { justify-self: start; }
.brow .btn { justify-self: end; }
.brow:hover { background: var(--bg2); }
.brow .bname { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; color: var(--text); line-height: 1.15; }
.brow .bname:hover { color: var(--brass); }
.brow .bmeta { font-size: 0.75rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.brow .bdist { font-size: 0.75rem; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.brow .btn { padding: 0.35em 0.7em; }
.brow .btn.on { border-color: var(--brass); color: var(--brass); }
.bhead { font-size: 0.6875rem; font-weight: 500; color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 0.6rem; }
details.series { border-top: 1px solid var(--line); }
details.series:last-of-type { border-bottom: 1px solid var(--line); }
details.series summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 1rem 0.25rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; color: var(--text); }
details.series summary::-webkit-details-marker { display: none; }
details.series summary::before { content: ""; width: 7px; height: 7px; margin-right: 14px; border-right: 1px solid var(--brass); border-bottom: 1px solid var(--brass); transform: rotate(-45deg); transition: transform var(--t-fast); }
details.series[open] summary::before { transform: rotate(45deg); }
details.series summary span:first-child { flex: 1; }
details.series .brows { border-top: 1px solid var(--line-soft); margin-bottom: 0.5rem; }
details.series .brow { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr) minmax(0, 1fr) 150px 34px; }
details.series .brow:last-child { border-bottom: 0; }
ol.sources { margin: 0.75rem 0 0; padding-left: 1.2rem; font-size: 0.8125rem; }
ol.sources li { margin: 4px 0; word-break: break-all; }

/* ── 13. Membership ───────────────────────────────────────────── */
.gate { max-width: 760px; margin: 1rem auto; padding: clamp(2.5rem, 6vw, 4rem) 2rem; text-align: center; background: var(--bg2) !important; border: 1px solid var(--line); }
.gate h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 1rem 0 0; }
.notice { margin-bottom: 1.5rem; padding: 0.9rem 1.1rem; border: 1px solid var(--line); border-left: 2px solid var(--brass); background: var(--bg2); font-size: 0.875rem; color: var(--text); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 2.5rem; }
.plan { background: var(--bg2) !important; padding: clamp(1.5rem, 3vw, 2.25rem); display: flex; flex-direction: column; }
.plan.featured { background: var(--bg3) !important; box-shadow: inset 0 2px 0 var(--brass); }
.plan h3 { font-family: var(--serif); font-size: 1.9rem; font-weight: 400; margin: 1.25rem 0 1rem; }
.plan ul { list-style: none; margin: 0 0 1.25rem; padding: 1rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 0.55rem; }
.plan li { position: relative; padding-left: 1.25rem; font-size: 0.9375rem; color: var(--text); }
.plan li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 8px; height: 1px; background: var(--brass); }
#buyBox { margin-top: auto; }
.auth { max-width: 460px; padding: clamp(1.5rem, 3vw, 2.25rem); background: var(--bg2) !important; border: 1px solid var(--line); display: grid; gap: 6px; }
.auth form { display: grid; gap: 6px; margin-top: 1rem; }
.auth .lbl { margin-top: 0.6rem; }

/* ── 14. Modal / overlays ─────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; background: rgba(10, 11, 10, 0.82); backdrop-filter: blur(4px); }
.modal { width: 100%; max-width: 840px; background: var(--bg2) !important; border: 1px solid var(--line-strong); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; }
.modal-body { padding: 1.5rem; display: grid; gap: 1rem; grid-template-columns: repeat(6, 1fr); }
.modal-foot { display: flex; gap: 0.6rem; justify-content: flex-end; padding: 1rem 1.5rem; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }
.f { grid-column: span 6; }
.f.w1 { grid-column: span 1; } .f.w2 { grid-column: span 2; } .f.w3 { grid-column: span 3; } .f.w4 { grid-column: span 4; }
.f .hint { font-size: 0.6875rem; color: var(--dim); margin-top: 4px; }
.subrows { display: grid; gap: 8px; }
.subrow { display: grid; gap: 8px; grid-template-columns: repeat(var(--cols, 3), 1fr) auto; align-items: start; padding: 10px; border: 1px solid var(--line); background: var(--bg); }
.img-field { display: flex; flex-wrap: wrap; gap: 6px; }
.img-field .im { position: relative; width: 84px; height: 84px; border: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.img-field .im img { width: 100%; height: 100%; object-fit: cover; }
.img-field .im button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; background: rgba(0,0,0,0.75); color: var(--text); cursor: pointer; }
.img-field .add { width: 84px; height: 84px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line-strong); color: var(--brass); cursor: pointer; font-size: 0.6875rem; }
.img-field .add:hover { border-color: var(--brass); }
.flavor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; }
.flavor-grid label { font-size: 0.75rem; color: var(--muted); display: flex; justify-content: space-between; text-transform: capitalize; }
.lightbox { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 30px; background: rgba(8,9,8,0.95); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 90vh; border: 1px solid var(--line); }
.search-box { max-width: 680px; }
.search-box .input { font-family: var(--serif); font-size: 1.4rem; padding: 1rem 1.25rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.search-results { max-height: 60vh; overflow-y: auto; }
.search-results a { display: flex; gap: 12px; align-items: center; padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--bg3); }
.search-results .ty { margin-left: auto; font-size: 0.625rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 5000; padding: 0.8rem 1.2rem; background: var(--bg3); border: 1px solid var(--line-strong); font-size: 0.8125rem; }
.empty { padding: 3.5rem 1.5rem; text-align: center; color: var(--dim); border: 1px solid var(--line); }
.empty h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; color: var(--text); margin-bottom: 0.5rem; }

/* ── 15. Footer ───────────────────────────────────────────────── */
footer.site { border-top: 1px solid var(--line); padding: 2.5rem var(--pad); text-align: center; font-size: 0.75rem; letter-spacing: 0.06em; color: var(--dim); }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--text); }
body.fullmap footer.site { display: none; }

/* ── 16. Responsive ───────────────────────────────────────────── */
@media (max-width: 1000px) {
  .detail { grid-template-columns: 1fr; }
  .atlas { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .atlas-map { order: -1; }
  .atlas-side { border-right: 0; }
  .bottle-hero { grid-template-columns: 1fr; }
  .bottle-stage { max-width: 340px; }
  .plans { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  .topbar { gap: 0.75rem; }
  .crest-name { font-size: 0.95rem; letter-spacing: 0.08em; }
  .topbar { padding: 0 0.75rem; }
  .top-actions { gap: 0.25rem; }
  .top-actions .btn-ghost { padding: 0.5em; }
  .topbar .menu-btn { display: inline-flex; }
  .nav { position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0; padding: 0.5rem var(--pad) 1.5rem; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
  .nav a.active { border-bottom-color: var(--line); color: var(--brass); }
  .nav { align-items: stretch; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
  .navtop { pointer-events: none; padding: 1.1rem 0 0.2rem; font-size: 0.6875rem; color: var(--brass); border: 0; text-align: left; }
  .navtop::after { display: none; }
  .navmenu { display: block; position: static; min-width: 0; padding: 0; border: 0; background: none; }
  .navmenu::before, .navmenu small { display: none; }
  .nav .navmenu a { padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .top-actions .kbd, .hide-sm { display: none; }
  #acctBtn { max-width: 110px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
  .tasting { grid-template-columns: 1fr; }
  .modal-body { grid-template-columns: 1fr; }
  .f, .f.w1, .f.w2, .f.w3, .f.w4 { grid-column: span 1; }
  .flavor-grid { grid-template-columns: repeat(2, 1fr); }
  .pc-row, .pc-axis { grid-template-columns: 120px 1fr 48px; gap: 8px; }
  .pc-name { font-size: 0.95rem; }
  .journal-entry { grid-template-columns: 1fr; gap: 0.4rem; }
  .subrow { grid-template-columns: 1fr; }
  .search-inline { max-width: none; }
  .scale-bands { grid-template-columns: repeat(2, 1fr); }
  .stat + .stat { padding-left: 0.9rem; }
  .brow, .brows.boxed .brow:has(.bdist), details.series .brow { grid-template-columns: minmax(0, 1fr) auto 34px; gap: 8px; }
  .brow .bmeta, .brow .bdist { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.plaque { align-self: flex-start; justify-self: start; width: fit-content; }
.bottle-hero .stat-row { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.bottle-hero .stat + .stat { padding-left: 1rem; }

/* ── 17. Shared trips ─────────────────────────────────────────── */
.avatars { display: flex; flex-wrap: wrap; gap: 4px; }
.avatar { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); color: var(--text); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; background: var(--bg); flex-shrink: 0; }
.avatar.pending { border-style: dashed; color: var(--dim); }
.stop { border-top: 1px solid var(--line); padding: 1.4rem 0 1.2rem; }
.stop:last-child { border-bottom: 1px solid var(--line); }
.stop-head { display: flex; gap: 1rem; align-items: flex-start; }
.stop-num { font-family: var(--serif); font-size: 1.1rem; font-weight: 500; color: var(--brass); padding-top: 0.25rem; min-width: 2rem; }
.stop-title { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; }
.stop-title a { color: var(--text); }
.stop-title a:hover { color: var(--brass); }
.stop-actions { display: flex; gap: 6px; flex-shrink: 0; }
.logblock { margin: 1rem 0 0 3rem; }
.logtitle { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); padding-bottom: 0.4rem; border-bottom: 1px solid var(--line-soft); }
.logrow { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line-soft); }
.logname { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; line-height: 1.2; }
.logname a { color: var(--text); }
.logname a:hover { color: var(--brass); }
.logmeta { font-size: 0.75rem; color: var(--dim); margin-top: 2px; }
.lognote { font-size: 0.875rem; color: var(--muted); margin-top: 4px; }
.logby { font-size: 0.6875rem; color: var(--dim); white-space: nowrap; text-align: right; }
.linkbtn { background: none; border: 0; padding: 0; margin-left: 6px; color: var(--brass); font: inherit; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.linkbtn:hover { color: var(--text); }
.members { display: grid; }
.member { display: flex; gap: 0.75rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--line-soft); }
.member-name { font-size: 0.9375rem; color: var(--text); }
.addmember { display: grid; gap: 8px; margin-top: 1.25rem; }
.addmember .btn { justify-self: start; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 4px; }
.checks label { display: inline-flex; gap: 8px; align-items: center; color: var(--text); }
@media (max-width: 760px) {
  .stop-head { flex-wrap: wrap; }
  .stop-actions { width: 100%; padding-left: 3rem; }
  .logblock { margin-left: 0; }
}

/* ── 18. Trip stops, place search, world scope ────────────────── */
.stop.missed { opacity: 0.72; }
.stop.missed .stop-title { font-style: italic; }
.stop-tools { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; }
.stop-actions { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.placebox { display: flex; gap: 8px; }
.placebox .input { flex: 1; }
.georesults { display: grid; gap: 1px; margin-top: 6px; max-height: 220px; overflow-y: auto; }
.georesults .geo { display: grid; text-align: left; gap: 2px; padding: 0.55rem 0.75rem; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; font: inherit; }
.georesults .geo:hover { border-color: var(--brass); }
.georesults .geo b { font-weight: 500; font-size: 0.875rem; }
.georesults .geo span { font-size: 0.6875rem; color: var(--dim); }
.pin-num.alt { background: var(--bg); color: var(--brass); border-color: var(--brass); }
.pin-num.planned { opacity: 0.75; border-style: dashed; }
.pin-missed { width: 20px; height: 20px; display: grid; place-items: center; border: 1px dashed var(--dim); color: var(--dim); background: rgba(17,19,18,0.8); font-size: 13px; line-height: 1; }
.pin.alt-spirit { border-radius: 0; transform: rotate(45deg); }
.dayhead { margin: 1.75rem 0 0; padding-bottom: 0.5rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }
.dayhead:first-child { margin-top: 0; }
.dayhead + .stop { border-top-color: var(--line-strong); }
.thumbrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumbrow button { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); background: var(--bg); cursor: zoom-in; overflow: hidden; }
.thumbrow img { width: 100%; height: 100%; object-fit: cover; }
.section-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
/* trip cover photo */
.hero--cover { min-height: clamp(360px, 52vh, 560px); display: flex; align-items: flex-end; }
.hero--cover .hero-inner { width: 100%; }
.hero-cover { position: absolute; inset: 0; background-size: cover; background-position: center 35%; }
.hero-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,21,20,0.92) 0%, rgba(20,21,20,0.55) 45%, rgba(20,21,20,0.15) 100%); }
.hero--cover h1, .hero--cover .pron, .hero--cover .crumbs { text-shadow: 0 1px 12px rgba(0,0,0,0.5); }
.hero--cover .btn:not(.btn-brass) { background: rgba(20,21,20,0.6); }
.gitem { position: relative; background: var(--bg); }
.gitem > button[data-lb] { display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 1; background: var(--bg); cursor: zoom-in; overflow: hidden; }
.gitem img { width: 100%; height: 100%; object-fit: cover; }
.gcover { position: absolute; left: 6px; bottom: 6px; padding: 0.3em 0.6em; border: 1px solid var(--line-strong); background: rgba(20,21,20,0.85); color: var(--muted); font: inherit; font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; opacity: 0; transition: opacity var(--t-fast); }
.gitem:hover .gcover, .gcover.on, .gcover:focus-visible { opacity: 1; }
.gcover.on { color: var(--brass); border-color: var(--brass); }
@media (hover: none) { .gcover { opacity: 1; } }

/* ── Tours (public reviews) ── */
.stars { color: var(--brass); letter-spacing: 0.08em; white-space: nowrap; }
.tour { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.tour:first-child { padding-top: 0; }
.tour-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.tour-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; }
.tour-title a { color: var(--ink); }
.tour-review { margin: 8px 0 0; color: var(--ink-2); max-width: 68ch; white-space: pre-line; }
/* server-rendered copy for crawlers; replaced as soon as the app boots */
.prerender { max-width: 900px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
#csvPreview { max-height: 46vh; overflow: auto; }

/* ── Public tasting notes + badges ── */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px; border: 1px solid var(--line); color: var(--muted); margin-left: 4px; vertical-align: 2px; white-space: nowrap; }
.badges .badge { margin-left: 0; }
.badges.big .badge { font-size: 0.75rem; padding: 5px 10px; }
.badge.tier2 { border-color: var(--sea); color: var(--sea); }
.badge.tier3 { border-color: var(--brass); color: var(--brass); }
.notes-sum { display: flex; gap: 2.5rem; padding: 0 0 1.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.notes-sum .v { font-family: var(--serif); font-size: 2rem; line-height: 1; }
.notes-sum .v small { font-size: 0.9rem; color: var(--dim); }
.notes-sum .l { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }
.note { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.note-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.note-score { font-family: var(--serif); font-size: 1.4rem; color: var(--brass); }
.note-row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 0.9rem; color: var(--ink-2); margin: 2px 0; }
.note-row .k { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); padding-top: 3px; }
.note-text { margin: 6px 0; color: var(--ink-2); white-space: pre-line; }
.like, .like-count { margin-left: 10px; color: var(--muted); }
.like.on { color: var(--brass); }
.prog { margin: 10px 0; }
.prog-l { font-size: 0.85rem; margin-bottom: 4px; }
.prog-bar { height: 3px; background: var(--line); }
.prog-bar i { display: block; height: 100%; background: var(--brass); }

/* ── Learn ── */
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 2rem; }
.learn-card { display: block; padding: 1.1rem 0; border-bottom: 1px solid var(--line); color: var(--text); }
.learn-card:hover .lc-title { color: var(--brass); }
.learn-card p { margin: 6px 0 8px; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.lc-title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; }
.learn-progress { text-align: right; }
.learn-progress .v { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--brass); }
.learn-progress .v small { font-size: 1rem; color: var(--dim); }
.learn-progress .l { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }
.learn-page { max-width: 780px; }
.learn-page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 1.8em 0 0.5em; }
.prose h3 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 1.4em 0 0.4em; }
.prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.25em 0; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
.prose .table { font-size: 0.92rem; line-height: 1.5; }
.learn-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.quiz { margin-top: 3rem; padding: 1.5rem; border: 1px solid var(--line-strong); }
.quiz h2 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin: 4px 0 12px; }
.qq { border: 0; border-top: 1px solid var(--line); padding: 1rem 0 0.75rem; margin: 0; }
.qq legend { font-weight: 500; padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.qo { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; cursor: pointer; clear: both; }
.qq.wrong legend { color: #d79a8c; }
.qq.right legend::after { content: "  ✓"; color: var(--brass); }
.qo.answer span { color: var(--brass); }
.qwhy { font-size: 0.85rem; color: var(--muted); margin-top: 4px; clear: both; }
.learn-grid { margin-bottom: 3rem; }
