:root {
  --bg: #edece6;
  --surface: #f8f7f3;
  --surface-sunk: #e2e0d7;
  --ink: #17181a;
  --ink-soft: #53555c;
  --ink-faint: #626368; /* ≥4.5:1 on all light surfaces */
  --wine: #5c1220;
  --wine-fill: #5c1220; /* backgrounds behind light text */
  --wine-deep: #3c0c15;
  --wine-tint: #e9dfdf;
  --gold: #736138;
  --gold-tint: #e7e0cd;
  --slate: #414753;
  --slate-tint: #e1e3e8;
  --white-wine: #957c39; /* graphics: ≥3:1 */
  --line: rgba(23, 24, 26, 0.15);
  --line-soft: rgba(23, 24, 26, 0.08);
  --shadow: rgba(23, 24, 26, 0.18);
  --focus: #7d6a3d;

  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
  --step-4: clamp(2.5rem, 1.9rem + 2.6vw, 3.9rem);

  /* map */
  --map-sea: #d5dde0;
  --map-land: #e3e1d9;
  --map-italy: #f6f4ee;
  --map-water: #7e9fae;
  --map-label: #4c5560;
  --pin-red: #7a1a2c;
  --pin-white: #957c39;
  --pin-sparkling: #2b6b70;
  --pin-sweet: #a4521a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131315;
    --surface: #1b1a1a;
    --surface-sunk: #232222;
    --ink: #e8e6e1;
    --ink-soft: #ada9a2;
    --ink-faint: #8c8984;
    --wine: #c17380; /* text and strokes, ≥4.5:1 */
    --wine-fill: #ae4e5d; /* behind light text, ≥4.5:1 */
    --wine-deep: #d98a97;
    --wine-tint: #331b20;
    --gold: #bfa876;
    --gold-tint: #34301f;
    --slate: #96a0b3;
    --slate-tint: #24272e;
    --white-wine: #cdb46a;
    --line: rgba(232, 230, 225, 0.15);
    --line-soft: rgba(232, 230, 225, 0.08);
    --shadow: rgba(0, 0, 0, 0.45);
    --focus: #bfa876;

    --map-sea: #12181c;
    --map-land: #1f1e1d;
    --map-italy: #2b2a28;
    --map-water: #47697a;
    --map-label: #a6aeb8;
    --pin-red: #d77f8e;
    --pin-white: #d6bd70;
    --pin-sparkling: #6fb7bb;
    --pin-sweet: #e39a5c;
  }
}

:root[data-theme="dark"] {
  --bg: #131315;
  --surface: #1b1a1a;
  --surface-sunk: #232222;
  --ink: #e8e6e1;
  --ink-soft: #ada9a2;
  --ink-faint: #8c8984;
  --wine: #c17380; /* text and strokes, ≥4.5:1 */
    --wine-fill: #ae4e5d; /* behind light text, ≥4.5:1 */
  --wine-deep: #d98a97;
  --wine-tint: #331b20;
  --gold: #bfa876;
  --gold-tint: #34301f;
  --slate: #96a0b3;
  --slate-tint: #24272e;
  --white-wine: #cdb46a;
  --line: rgba(232, 230, 225, 0.15);
  --line-soft: rgba(232, 230, 225, 0.08);
  --shadow: rgba(0, 0, 0, 0.45);
  --focus: #bfa876;

  --map-sea: #12181c;
  --map-land: #1f1e1d;
  --map-italy: #2b2a28;
  --map-water: #47697a;
  --map-label: #a6aeb8;
  --pin-red: #d77f8e;
  --pin-white: #d6bd70;
  --pin-sparkling: #6fb7bb;
  --pin-sweet: #e39a5c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.label {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-faint);
  font-weight: 600;
}

.wrap {
  max-width: 76rem;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.contour {
  height: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0, var(--line) 40px,
    transparent 40px, transparent 56px
  );
}

/* ---------- header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--wine);
  white-space: nowrap;
}
.brand-sub { font-size: var(--step--1); color: var(--ink-faint); letter-spacing: 0.04em; white-space: nowrap; }
@media (max-width: 1840px) { .brand-sub { display: none; } }
/* App shell: the header spans the window like the map below it. */
header.site .wrap { max-width: none; }
.nav-row { padding-block: 0.65rem; flex-wrap: nowrap; }
.nav-right { display: flex; align-items: center; gap: clamp(0.6rem, 1.4vw, 1.2rem); flex-wrap: nowrap; }
nav.links { display: flex; gap: clamp(0.8rem, 1.5vw, 1.5rem); flex-wrap: nowrap; }
nav.links a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-soft);
  padding-block: 0.3rem;
  border-bottom: 1px solid transparent;
}
nav.links a:hover { color: var(--wine); border-bottom-color: var(--wine); }
.cellar-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  padding: 0.4rem 0.75rem;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.cellar-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--wine); color: var(--wine); }
.theme-toggle svg { width: 15px; height: 15px; display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.3rem;
  border-radius: 2px;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--wine-fill); color: #f7eeee; }
.btn-primary:hover { background: color-mix(in srgb, var(--wine-fill) 82%, #000); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--wine); color: var(--wine); }


/* ---------- section shell ---------- */
section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  flex-wrap: wrap;
}
.section-head h2 { font-size: var(--step-3); }
.section-head .desc { max-width: 38rem; color: var(--ink-soft); margin-top: 0.5rem; }

.step-eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.step-eyebrow .n {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--wine);
  font-size: var(--step-1);
}
.step-eyebrow .t {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--ink-soft);
}
.step-block + .step-block { margin-top: clamp(2rem, 5vw, 3rem); }

/* ---------- map hero: the map is the start of the page ---------- */
.map-hero { padding: 0; }
.map-hero h1 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.3rem); line-height: 1.08; margin-top: 0.2rem; }
.map-hero h1 em { font-style: italic; color: var(--wine); }
.map-hero-lede { color: var(--ink-soft); margin-top: 0.35rem; font-size: var(--step--1); }
.map-hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1rem clamp(2rem, 5vw, 3rem); }
.map-hero-foot .map-hint { margin: 0; text-align: left; max-width: 60rem; }

/* Title and search float over the top left of the map. */
.map-intro {
  position: absolute; z-index: 4; top: clamp(0.75rem, 2vw, 1.5rem); left: clamp(0.75rem, 2vw, 1.5rem);
  width: min(24.5rem, calc(100% - 5rem)); padding: 1.1rem 1.2rem 0.9rem;
  background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line);
  box-shadow: 0 6px 24px var(--shadow); backdrop-filter: blur(6px);
}
.map-intro .map-search { margin-top: 0.9rem; }
/* While a region is open, the intro shrinks to the search field. */
@media (min-width: 901px) {
  .map-wrap.panel-open .map-intro { padding: 0.5rem; }
  .map-wrap.panel-open .map-intro > :not(.map-search) { display: none; }
  .map-wrap.panel-open .map-intro .map-search { margin-top: 0; }
}
.map-intro-tally { margin-top: 0.5rem; font-size: 0.72rem; color: var(--ink-faint); min-height: 1em; }
.map-search { position: relative; }
.map-search input {
  width: 100%; padding: 0.75rem 0.9rem 0.75rem 2.6rem; font: inherit; font-size: var(--step-0);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 2px;
  box-shadow: 0 1px 2px var(--shadow);
}
.map-search input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.map-search-icon { position: absolute; left: 0.8rem; top: 50%; width: 1.1rem; height: 1.1rem; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.map-search-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 0.3rem 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px var(--shadow); max-height: 22rem; overflow-y: auto;
}
.map-search-list[hidden] { display: none; }
.map-search-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.45rem 0.9rem; cursor: pointer; }
.map-search-list li[aria-selected="true"], .map-search-list li:hover { background: var(--wine-tint); }
.map-search-list .hit-label { font-weight: 600; }
.map-search-list .hit-sub { font-size: var(--step--1); color: var(--ink-faint); text-align: right; }
.map-search-list .hit-empty { color: var(--ink-faint); cursor: default; }

/* The map spans the full width and fills the window below the header. */
.map-stage { position: relative; border-bottom: 1px solid var(--line); background: var(--map-sea); }
.map-wrap { position: relative; height: max(30rem, calc(100svh - var(--header-h, 4.25rem))); overflow: hidden; background: var(--map-sea); }
.italy-svg { width: 100%; height: 100%; display: block; overflow: hidden; cursor: grab; touch-action: none; user-select: none; }
.italy-svg.is-panning { cursor: grabbing; }

/* Region details: an overlay on the right, only after a region is clicked. */
.map-wrap > .detail-panel {
  position: absolute; z-index: 5; top: clamp(0.75rem, 2vw, 1.5rem); right: clamp(0.75rem, 2vw, 1.5rem); bottom: clamp(0.75rem, 2vw, 1.5rem);
  width: min(25rem, 42%); min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(1.5rem, 4vw, 2.25rem); box-shadow: 0 10px 36px var(--shadow); /* same as .region-photo bleed */
  animation: panel-in 220ms ease-out;
}
.map-wrap > .detail-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateX(1.5rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .map-wrap > .detail-panel { animation: none; } }
.panel-close {
  position: sticky; top: 0; float: right; z-index: 2; margin: -0.5rem -0.5rem 0 0.5rem; width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center; font-size: 1.4rem; line-height: 1; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 3px var(--shadow);
}
.panel-close:hover { border-color: var(--wine); color: var(--wine); }
.panel-appellation { display: block; margin-bottom: 0.8rem; font-weight: 600; font-size: var(--step--1); color: var(--wine); }
.panel-appellation[hidden] { display: none; }
.panel-wineries { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.panel-wineries .map-winery-list { columns: 1; margin-top: 0.5rem; }
/* With the panel open, the zoom buttons move left of it. */
.map-wrap.panel-open .map-controls { right: calc(min(25rem, 42%) + clamp(0.75rem, 2vw, 1.5rem) + 0.6rem); }
/* Phones and small tablets: the map fills the screen between header and tab
   bar, the intro shrinks to the search field, the panel becomes a bottom sheet. */
@media (max-width: 900px) {
  .map-wrap { height: calc(100svh - var(--header-h, 3.5rem) - var(--tabbar-h, 0px)); min-height: 24rem; }
  .map-intro { left: 0.6rem; right: 0.6rem; top: 0.6rem; width: auto; padding: 0.45rem; }
  .map-intro > :not(.map-search) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .map-intro .map-search { margin-top: 0; }
  .map-wrap .map-controls { top: 4.6rem; }
  .map-wrap.panel-open .map-controls { right: 0.6rem; }
  .map-legend { font-size: 0.66rem; gap: 0.2rem 0.6rem; padding: 0.3rem 0.5rem; }
  .map-wrap > .detail-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: none; height: 50%;
    padding-top: 1.6rem; border-radius: 14px 14px 0 0; transition: height 220ms ease;
    animation-name: sheet-in;
  }
  .map-wrap > .detail-panel[data-sheet="full"] { height: calc(100% - 4.2rem); }
  .map-wrap > .detail-panel.is-dragging { transition: none; }
  .map-wrap > .detail-panel .region-photo { aspect-ratio: auto; height: 9rem; }
  .map-wrap.panel-open .map-legend { display: none; }
}
@keyframes sheet-in { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }

.map-legend {
  position: absolute; left: 0.6rem; bottom: 0.6rem; z-index: 2; display: flex; flex-wrap: wrap; gap: 0.3rem 0.85rem;
  padding: 0.4rem 0.7rem; font-size: 0.72rem; color: var(--ink-soft); max-width: calc(100% - 1.2rem);
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line);
}
.map-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; border: 1.5px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.legend-cluster {
  min-width: 1.15rem; height: 1.15rem; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-weight: 700;
  font-size: 0.62rem; background: var(--ink); color: var(--bg);
}
.style-red { --pin: var(--pin-red); } .style-white { --pin: var(--pin-white); }
.style-sparkling { --pin: var(--pin-sparkling); } .style-sweet { --pin: var(--pin-sweet); }
.legend-dot, .map-winery-list .dot[class*="style-"] { background: var(--pin); }

/* ---------- map layers (from data/map_layers.json, Natural Earth) ---------- */
.map-sea { fill: var(--map-sea); }
.map-land { fill: var(--map-land); stroke: var(--line); stroke-width: 0.8; vector-effect: non-scaling-stroke; pointer-events: none; }
/* Mid grey in the relief image changes nothing; darker shades, lighter lights. */
.map-relief { mix-blend-mode: hard-light; opacity: 0.42; pointer-events: none; }
/* The relief is coarse; close up it would only blur, so it fades out. */
.italy-svg.z2 .map-relief { opacity: 0.22; }
.italy-svg.z3 .map-relief { opacity: 0.08; }
:root[data-theme="dark"] .italy-svg:not(.z2) .map-relief { opacity: 0.32; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .italy-svg:not(.z2) .map-relief { opacity: 0.32; } }
.map-lake { fill: var(--map-sea); stroke: var(--map-water); stroke-width: 0.6; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-river { fill: none; stroke: var(--map-water); stroke-width: 1.1; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-labels, .region-labels { pointer-events: none; }
.map-labels text {
  font-family: var(--font-body); fill: var(--map-label);
  paint-order: stroke; stroke: color-mix(in srgb, var(--map-italy) 80%, transparent); stroke-linejoin: round;
  font-size: calc(11px * var(--map-k, 1)); stroke-width: calc(3px * var(--map-k, 1));
}
.map-labels .map-sea-label, .map-labels .map-lake-label, .map-labels .map-river-label {
  font-family: var(--font-display); font-style: italic; fill: var(--map-water); stroke: color-mix(in srgb, var(--map-sea) 85%, transparent);
}
.map-labels .map-sea-label { font-size: calc(13px * var(--map-k, 1)); letter-spacing: 0.08em; text-anchor: middle; }
.map-labels .map-lake-label { font-size: calc(10px * var(--map-k, 1)); text-anchor: middle; }
.map-labels .map-river-label { font-size: calc(10px * var(--map-k, 1)); stroke: color-mix(in srgb, var(--map-italy) 85%, transparent); }
.map-labels .map-country-label {
  font-size: calc(10px * var(--map-k, 1)); text-transform: uppercase; letter-spacing: 0.14em; text-anchor: middle;
  fill: var(--ink-faint); stroke: color-mix(in srgb, var(--map-land) 85%, transparent);
}
.map-labels .map-range-label {
  font-family: var(--font-display); font-style: italic; font-size: calc(13px * var(--map-k, 1)); letter-spacing: 0.3em;
  text-anchor: middle; fill: var(--ink-soft); opacity: 0.85;
}
.map-labels .map-peak-mark { font-size: calc(8px * var(--map-k, 1)); text-anchor: middle; dominant-baseline: central; fill: var(--ink-soft); }
.map-labels .map-peak-label { font-size: calc(10px * var(--map-k, 1)); font-style: italic; dominant-baseline: central; }
.map-city circle { fill: var(--ink); stroke: var(--map-italy); stroke-width: calc(1px * var(--map-k, 1)); }
.map-labels .map-city text { fill: var(--ink); font-size: calc(10.5px * var(--map-k, 1)); }
.map-labels .map-city.is-capital text { font-weight: 700; }
/* Zoom levels: data-z features appear from that level (classes z1-z3 set by script). */
.italy-svg [data-z="1"], .italy-svg [data-z="2"], .italy-svg [data-z="3"] { display: none; }
.italy-svg.z1 [data-z="1"], .italy-svg.z2 [data-z="2"], .italy-svg.z3 [data-z="3"] { display: inline; }

.region-context {
  fill: color-mix(in srgb, var(--surface-sunk) 65%, var(--bg));
  stroke: var(--line-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.region-group { cursor: pointer; outline: none; }
.region-shape {
  fill: var(--map-italy);
  stroke: var(--line);
  stroke-width: 1.3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 150ms ease, stroke 150ms ease, stroke-width 150ms ease;
}
@media (prefers-reduced-motion: reduce) { .region-shape { transition: none; } }
.region-group:hover .region-shape { stroke: var(--ink-faint); fill: color-mix(in srgb, var(--map-italy) 80%, var(--wine-tint)); }
.region-group.visited .region-shape { fill: color-mix(in srgb, var(--map-italy) 45%, var(--gold-tint)); stroke: var(--gold); }
.region-group[aria-current="true"] .region-shape { fill: var(--wine-tint); stroke: var(--wine); stroke-width: 2; }
.region-group[aria-current="true"].visited .region-shape { fill: var(--wine-tint); stroke: var(--wine); }
.region-group:focus-visible .region-shape { stroke: var(--focus); stroke-width: 2.4; }

.region-label {
  font-family: var(--font-body);
  font-size: calc(10px * var(--map-k, 1)); /* constant on-screen size while zooming */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  fill: var(--ink-soft);
  paint-order: stroke;
  stroke: var(--map-italy);
  stroke-width: calc(3.5px * var(--map-k, 1)); /* halo scales with the label */
  stroke-linejoin: round;
  pointer-events: none;
}
.region-label.visited { fill: var(--gold); }
.region-label.is-current { fill: var(--wine); }
/* Closer in, towns matter more than region names. */
.italy-svg.z2 .region-label:not(.is-current) { opacity: 0.6; }

.map-hint {
  text-align: center;
  font-size: var(--step--1);
  color: var(--ink-faint);
  margin-top: 1rem;
}

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 1px 2px var(--shadow);
  min-height: 420px;
}

.region-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: calc(-1 * clamp(1.5rem, 4vw, 2.25rem)) calc(-1 * clamp(1.5rem, 4vw, 2.25rem)) 1.5rem;
  width: calc(100% + clamp(1.5rem, 4vw, 2.25rem) * 2);
  background: var(--surface-sunk);
}
.region-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-credit {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: #f2efe9;
  background: rgba(20, 18, 16, 0.55);
  padding: 0.2rem 0.5rem;
}
.photo-credit-inline {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.detail-top h3 { font-size: var(--step-2); }
.detail-tagline { color: var(--wine); font-style: italic; margin-top: 0.2rem; }
.detail-desc { margin-top: 1rem; color: var(--ink-soft); max-width: 56ch; }

.fact-row {
  display: flex;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.fact dt { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; }
.fact dd { margin: 0.3rem 0 0; font-size: var(--step-0); max-width: 24ch; }

.bottle-count {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--step--1);
  color: var(--gold);
  font-weight: 700;
}

.region-history-btn {
  display: block;
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  font-size: var(--step--1);
}

.region-modal .modal { max-width: 34rem; }
.region-modal-section + .region-modal-section { margin-top: 1.4rem; }
.region-modal-section h4 {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wine);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.region-modal-section p { color: var(--ink-soft); }
.region-facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.25rem;
  margin: 0;
}
.region-facts-grid dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); font-weight: 600; }
.region-facts-grid dd { margin: 0.25rem 0 0; font-family: var(--font-display); font-size: 1.05rem; }

/* ---------- grape picker + radar ---------- */
.grape-picker { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.grape-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.6rem 1rem;
  cursor: pointer;
}
.grape-chip:hover { border-color: var(--ink-faint); }
.grape-chip[aria-current="true"] { background: var(--wine-tint); border-color: var(--wine); }
.grape-chip .swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.grape-chip .gname { font-family: var(--font-display); font-weight: 600; }
.grape-chip .gstyle { font-size: 0.76rem; color: var(--ink-faint); display: block; }
.grape-chip .gcommon { font-weight: 700; }
.grape-chip .gcommon.standard { color: var(--wine); }
.grape-chip .gcommon.special { color: var(--gold); }

.taste-panel {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
@media (max-width: 760px) { .taste-panel { grid-template-columns: 1fr; } }

.radar-svg { overflow: visible; }
.radar-svg { overflow: visible; }
.radar-svg text { font-family: var(--font-body); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; fill: var(--ink-faint); font-weight: 600; }
.radar-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-axis { stroke: var(--line); stroke-width: 1; }
.radar-shape { fill: color-mix(in srgb, var(--wine) 18%, transparent); stroke: var(--wine); stroke-width: 2; stroke-linejoin: round; transition: all 200ms ease; }
@media (prefers-reduced-motion: reduce) { .radar-shape { transition: none; } }
.radar-hint { text-align: center; font-size: var(--step--1); color: var(--ink-faint); margin-top: 0.6rem; }

.taste-explainer { margin-top: 1.25rem; background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.25rem; }
.taste-explainer summary {
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--wine);
  list-style: none;
}
.taste-explainer summary::-webkit-details-marker { display: none; }
.taste-explainer summary::before { content: "+ "; }
.taste-explainer[open] summary::before { content: "\2212 "; }
.taste-explainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.5rem;
  margin: 1rem 0 0;
}
.taste-explainer-grid dt {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.taste-explainer-grid dd { margin: 0; font-size: var(--step-0); color: var(--ink-soft); }

.grape-note { display: flex; gap: 1.1rem; align-items: flex-start; }
.grape-photo {
  flex-shrink: 0;
  width: 92px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--surface-sunk);
}
.grape-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grape-note-text { min-width: 0; }
.grape-note-top { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.grape-note-text h4 { font-size: var(--step-1); }
.grape-note-text .gtag { color: var(--wine); font-style: italic; font-family: var(--font-display); margin-top: 0.15rem; }
.grape-note-text p { margin-top: 0.7rem; color: var(--ink-soft); max-width: 48ch; }
.grape-note-text .usage-note { font-size: 0.95rem; color: var(--ink-faint); font-style: italic; }
.grape-note-text .aka-note { font-size: 0.95rem; color: var(--ink-soft); }
.grape-note-text .aka-note strong { color: var(--ink); font-weight: 700; }
@media (max-width: 480px) { .grape-note { flex-direction: column; } .grape-photo { width: 120px; } }

/* ---------- winery grid ---------- */
.winery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.winery-empty {
  grid-column: 1 / -1;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  text-align: center;
  color: var(--ink-faint);
  border: 1px dashed var(--line);
}
.wine-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.wine-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
}
.badge.famous { background: var(--wine-tint); color: var(--wine); }
.badge.hidden { background: var(--gold-tint); color: var(--gold); }
.badge.grape-standard { background: var(--wine-tint); color: var(--wine); }
.badge.grape-special { background: var(--gold-tint); color: var(--gold); }
.badge.specialty { background: var(--slate-tint); color: var(--slate); }
.wine-price { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.winery-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-top: 0.4rem; }
.bottle-name { font-size: var(--step--1); color: var(--wine); font-style: italic; margin-top: 0.1rem; }
.winery-note { font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.6rem; line-height: 1.5; }
.wine-card-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.btn-cellar {
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  padding: 0.6rem 0.9rem;
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-align: center;
}
.btn-cellar:hover { border-color: var(--wine); }
.btn-cellar.in-cellar { background: var(--wine-fill); border-color: var(--wine-fill); color: #f7eeee; }
.shop-placeholder {
  display: block;
  width: 100%;
  background: transparent;
  appearance: none;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-faint);
  padding: 0.4rem;
  border: 1px dashed var(--line);
  cursor: default;
}
button.shop-placeholder { cursor: pointer; }
button.shop-placeholder:hover { color: var(--ink); border-color: var(--ink-faint); }

/* ---------- catalog ---------- */
.catalog-controls { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.catalog-search {
  width: 100%;
  max-width: 26rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-0);
  font-family: inherit;
}
.catalog-search::placeholder { color: var(--ink-faint); }
.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--ink-faint); }
.filter-chip[aria-current="true"] { background: var(--wine-tint); border-color: var(--wine); color: var(--wine); }
.catalog-sort {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  font-family: inherit;
}

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.catalog-card { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.catalog-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-sunk);
  display: flex;
  align-items: center;
  justify-content: center;
}
.catalog-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.catalog-body { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.catalog-region { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 600; margin-bottom: 0.3rem; }
.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(2rem, 6vw, 3rem);
  color: var(--ink-faint);
  border: 1px dashed var(--line);
}
.catalog-empty .btn-cellar { display: inline-block; width: auto; margin-top: 1rem; }

.catalog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--step--1);
  font-weight: 700;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) { border-color: var(--ink-faint); color: var(--ink); }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-btn[aria-current="true"] { background: var(--wine-fill); border-color: var(--wine-fill); color: #f7eeee; }

/* ---------- cellar section (the "game") ---------- */
.cellar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.rank-card {
  background: var(--wine-fill);
  color: #f7eeee;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.rank-card .rank-name { font-size: var(--step-2); }
.rank-card .rank-sub { margin-top: 0.4rem; color: color-mix(in srgb, #f7eeee 82%, transparent); font-size: var(--step--1); max-width: 40ch; }
.rank-progress { min-width: 220px; }
.rank-progress .bar-track { height: 6px; background: color-mix(in srgb, #f7eeee 25%, transparent); position: relative; }
.rank-progress .bar-fill { height: 100%; background: #f7eeee; transition: width 250ms ease; }
@media (prefers-reduced-motion: reduce) { .rank-progress .bar-fill { transition: none; } }
.rank-progress .bar-label { font-size: 0.7rem; margin-top: 0.4rem; color: color-mix(in srgb, #f7eeee 85%, transparent); text-align: right; font-variant-numeric: tabular-nums; }

.rack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.rack-empty {
  border: 1px dashed var(--line);
  padding: clamp(2rem, 6vw, 3rem);
  text-align: center;
  color: var(--ink-faint);
  grid-column: 1 / -1;
}
.rack-empty a { color: var(--wine); font-weight: 700; text-decoration: underline; }
.rack-item {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.rack-item .bottle-icon { flex-shrink: 0; }
.rack-item .rack-meta { min-width: 0; }
.rack-item .rack-wine { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.rack-item .rack-region { font-size: 0.75rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem; }
.rack-item .rack-price { font-size: var(--step--1); color: var(--gold); font-weight: 700; margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
.rack-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem;
  flex-shrink: 0;
}
.rack-remove:hover { color: var(--wine); }

/* ---------- about / footer ---------- */
.about-band {
  background: var(--wine-fill);
  color: #f2f3f5;
  padding: clamp(2rem, 5vw, 3rem);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
}
@media (max-width: 760px) { .about-band { grid-template-columns: 1fr; } }
.about-band h2 { color: #f2f3f5; font-size: var(--step-3); }
.about-band p { margin-top: 0.9rem; color: color-mix(in srgb, #f2f3f5 82%, transparent); max-width: 46ch; }
.about-note {
  background: color-mix(in srgb, #f2f3f5 12%, transparent);
  border: 1px solid color-mix(in srgb, #f2f3f5 25%, transparent);
  padding: 1.25rem 1.4rem;
  font-size: var(--step--1);
}
.about-note .label { color: color-mix(in srgb, #f2f3f5 70%, transparent); }
.about-note p { color: #f2f3f5; margin-top: 0.5rem; }

footer.site {
  padding-block: 2.5rem;
  color: var(--ink-faint);
  font-size: var(--step--1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--ink) 50%, transparent);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  max-width: 30rem;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 12px 40px var(--shadow);
  max-height: 85vh;
  overflow-y: auto;
  border-top: 3px solid var(--wine);
}
.modal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.modal-close {
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-price { font-family: var(--font-display); font-size: var(--step-1); margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.modal-desc { margin-top: 1.1rem; color: var(--ink-soft); }
.modal-actions { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.modal-visit { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); font-size: var(--step--1); color: var(--ink-faint); }

/* ---------- content pages (rebsorten, regionen, weine, wein-zu, quiz) ---------- */
.page { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }
.crumbs { font-size: var(--step--1); color: var(--ink-faint); margin-bottom: 1.25rem; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { margin-inline: 0.4rem; }
.page-head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); max-width: 48rem; }
.page-head h1 { font-size: var(--step-4); line-height: 1.08; }
.page-head .tagline { font-family: var(--font-display); font-style: italic; color: var(--wine); font-size: var(--step-1); margin-top: 0.4rem; }
.page-head .lede { color: var(--ink-soft); font-size: var(--step-1); margin-top: 0.9rem; }
.page h2 { font-size: var(--step-2); margin: clamp(2rem, 5vw, 3rem) 0 1rem; }
.page h3 { font-size: var(--step-1); }
.prose { max-width: 44rem; }
.prose p { color: var(--ink-soft); }
.prose p + p, .prose p + h3, .prose h3 + p { margin-top: 0.8rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 860px) { .content-grid { grid-template-columns: minmax(0, 1fr); } }
.side-card { background: var(--surface); border: 1px solid var(--line); padding: 1.25rem; box-shadow: 0 1px 2px var(--shadow); }
.side-card + .side-card { margin-top: 1rem; }
.side-card .radar-svg { width: 100%; max-width: 260px; display: block; margin: 0 auto; }
.page-photo { margin: 0 0 1.5rem; }
.page-photo img { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.page-photo figcaption { font-size: 0.7rem; color: var(--ink-faint); margin-top: 0.3rem; }
.fact-list { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1rem; margin: 0; font-size: var(--step--1); }
.fact-list dt { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; font-size: 0.7rem; padding-top: 0.15rem; }
.fact-list dd { margin: 0; color: var(--ink); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.card-grid .wine-card h3 a, .link-card h3 a { text-decoration: none; }
.card-grid .wine-card h3 a:hover, .link-card h3 a:hover { text-decoration: underline; }
.link-card { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; text-decoration: none; }
.link-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.link-card .link-card-body { padding: 1rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; }
.link-card p { color: var(--ink-soft); font-size: 0.95rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }
.chip-list a { display: inline-block; text-decoration: none; border: 1px solid var(--line); background: var(--surface); padding: 0.35rem 0.75rem; font-size: var(--step--1); }
.chip-list a:hover { border-color: var(--wine); color: var(--wine); }
.text-link { color: var(--wine); font-weight: 600; font-size: var(--step--1); text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.region-page-link { display: inline-block; margin-top: 0.9rem; margin-left: 1rem; }
.pairing-note a { color: var(--wine); }
.rule-box { border-left: 3px solid var(--gold); background: var(--gold-tint); padding: 0.9rem 1.1rem; margin-top: 1.25rem; max-width: 44rem; }
.rule-box strong { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 0.2rem; }
.az-index { columns: 3 14rem; column-gap: 2rem; }
.az-group { break-inside: avoid; margin-bottom: 1.25rem; }
.az-group h2 { margin: 0 0 0.4rem; font-size: var(--step-2); color: var(--wine); }
.az-group ul { list-style: none; margin: 0; padding: 0; }
.az-group li { padding-block: 0.2rem; }
.az-group li a { text-decoration: none; font-weight: 600; }
.az-group li a:hover { text-decoration: underline; }
.az-group li span { color: var(--ink-faint); font-size: var(--step--1); }
.btn-shop { display: block; text-align: center; background: var(--wine-fill); color: #fff; text-decoration: none; padding: 0.65rem 0.9rem; font-size: var(--step--1); font-weight: 700; }
.btn-shop:hover { background: color-mix(in srgb, var(--wine-fill) 82%, #000); }
.btn-shop + .btn-shop { margin-top: 0.4rem; }
.ad-label { font-size: 0.68rem; color: var(--ink-faint); margin-top: 0.3rem; text-align: center; }
.side-card .btn-cellar { width: 100%; margin-top: 0.75rem; }

/* quiz */
.quiz-form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 46rem; }
.quiz-q { border: 1px solid var(--line); background: var(--surface); padding: 1.1rem 1.25rem 1.25rem; margin: 0; }
.quiz-q legend { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; padding: 0 0.4rem; margin-left: -0.4rem; }
.quiz-n { display: inline-block; color: var(--wine); margin-right: 0.5rem; }
.quiz-hint { color: var(--ink-faint); font-size: var(--step--1); margin-top: 0.25rem; }
.quiz-options { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.quiz-options label { cursor: pointer; position: relative; }
.quiz-options input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-options label:has(input:checked) { background: var(--wine-fill); color: #fff; border-color: var(--wine-fill); }
.quiz-options label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.quiz-form .btn { align-self: flex-start; border: 0; cursor: pointer; }
.quiz-result { margin-top: clamp(2rem, 5vw, 3rem); scroll-margin-top: 5rem; }
.quiz-result h2 { margin-top: 0; }

/* footer navigation */
footer.site nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
footer.site a { color: var(--ink-soft); text-decoration: none; }
footer.site a:hover { text-decoration: underline; }

/* ---------- tasting list: share, print, shared lists ---------- */
.cellar-tools[hidden], .shared-list[hidden] { display: none; }
.cellar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 1.25rem 0 0; }
.cellar-tools .btn { cursor: pointer; }
.cellar-tools-msg { font-size: var(--step--1); color: var(--ink-soft); }
.share-url { font: inherit; font-size: var(--step--1); width: min(28rem, 100%); padding: 0.4rem 0.6rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.shared-list { border: 1px solid var(--gold); background: var(--gold-tint); padding: 1rem 1.25rem; margin-top: 1.25rem; }
.shared-list ul { margin: 0.5rem 0 1rem; padding-left: 1.2rem; }
.shared-list .btn { border: 0; cursor: pointer; }
.rack-item .rack-wine a { text-decoration: none; }
.rack-item .rack-wine a:hover { text-decoration: underline; }
.rack-item .rack-detail { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.1rem; }
.rack-offers { margin-top: 0.5rem; }
.rack-offers .ad-label { text-align: left; }
.winery-site { font-size: var(--step--1); }
.winery-site a { color: var(--wine); }

@media print {
  header.site, footer.site, .contour, #explore, #grapes, #catalog, #about, .rank-card, .cellar-tools,
  .shared-list, .rack-remove, .rack-offers, .modal-backdrop { display: none !important; }
  body { background: #fff; color: #000; }
  section { padding-block: 0; }
  #cellar .desc { display: none; }
  #cellar h2::after { content: " – Probierliste der Kellerkarte"; font-weight: 400; font-size: 0.7em; }
  .rack-grid { display: block; margin-top: 1rem; }
  .rack-item { break-inside: avoid; border: 0; border-bottom: 1px solid #ccc; box-shadow: none; padding: 0.6rem 0; background: none; }
  .rack-item a { color: #000; }
}
.prose h1 { font-size: var(--step-4); line-height: 1.08; margin-bottom: 0.5rem; }
.prose ul { color: var(--ink-soft); padding-left: 1.2rem; }
.credit-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 0.9rem; }
.credit-list li { display: flex; gap: 0.8rem; align-items: flex-start; font-size: var(--step--1); color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); padding: 0.6rem; }
.credit-list img { width: 96px; height: 64px; object-fit: cover; flex-shrink: 0; }
.credit-list a, .page-photo figcaption a, .photo-credit a, .photo-credit-inline a { color: inherit; }

/* ---------- lexicon: glossary links, glossary page, page meta ---------- */
a.gloss { color: inherit; text-decoration: underline dotted color-mix(in srgb, var(--wine) 70%, transparent); text-underline-offset: 3px; position: relative; cursor: help; }
a.gloss:hover, a.gloss:focus-visible { color: var(--wine); }
a.gloss::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30;
  width: max-content; max-width: min(18rem, 80vw); padding: 0.55rem 0.7rem;
  background: var(--ink); color: var(--bg); font-size: 0.82rem; line-height: 1.4; font-weight: 400; font-style: normal;
  text-transform: none; letter-spacing: 0; box-shadow: 0 4px 14px var(--shadow);
  display: none; pointer-events: none; /* not just invisible: a hidden tooltip near the edge would widen the page on phones */
}
a.gloss:hover::after, a.gloss:focus-visible::after { display: block; }
.glossary { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 0.9rem; }
.glossary-item { background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.15rem; scroll-margin-top: 5rem; }
.glossary-item:target { border-color: var(--wine); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wine) 25%, transparent); }
.glossary-item dt { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); }
.glossary-item dd { margin: 0.35rem 0 0; color: var(--ink-soft); }
.page-meta { margin-top: clamp(2rem, 5vw, 3rem); padding-top: 1rem; border-top: 1px solid var(--line-soft); font-size: var(--step--1); color: var(--ink-faint); }
.page-meta a { color: var(--ink-soft); }
.prose ul li + li { margin-top: 0.35rem; }

/* ---------- comparison ---------- */
.compare-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.compare-pickers label { display: flex; align-items: center; gap: 0.5rem; }
.compare-vs { font-family: var(--font-display); font-style: italic; color: var(--ink-faint); }
.compare-swatch { display: inline-block; width: 0.8rem; height: 0.8rem; vertical-align: -0.05rem; margin-right: 0.3rem; }
.compare-swatch.compare-a { background: var(--wine); }
.compare-swatch.compare-b { background: var(--slate); }
.radar-shape.compare-a { stroke: var(--wine); fill: color-mix(in srgb, var(--wine) 18%, transparent); }
.radar-shape.compare-b { stroke: var(--slate); fill: color-mix(in srgb, var(--slate) 14%, transparent); stroke-dasharray: 5 3; }
.compare-radar { width: 100%; max-width: 320px; display: block; margin: 0 auto; }
.compare-grid h2:first-child { margin-top: 0; }
.compare-diffs { margin: 0 0 1.5rem; padding-left: 1.2rem; color: var(--ink-soft); }
.compare-diffs li + li { margin-top: 0.35rem; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--surface); border: 1px solid var(--line); }
.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line-soft); }
.compare-table thead th { font-family: var(--font-display); font-size: var(--step-1); }
.compare-table thead th a { text-decoration: none; }
.compare-table tbody th { width: 8rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 600; }
.compare-table td { color: var(--ink-soft); }
@media (max-width: 600px) {
  .compare-table { font-size: 0.85rem; table-layout: fixed; }
  .compare-table tbody th { width: 5.5rem; }
  .compare-table th, .compare-table td { padding: 0.5rem 0.45rem; overflow-wrap: anywhere; hyphens: auto; }
}

/* ---------- quiz result type ---------- */
.quiz-type { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--wine); padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.quiz-type h2 { margin: 0.2rem 0 0.5rem; font-size: var(--step-3); }
.quiz-type h2 a { text-decoration: none; color: var(--wine); }
.quiz-type p { color: var(--ink-soft); max-width: 46rem; }
.quiz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.quiz-actions .btn { border: 0; cursor: pointer; }

/* ---------- newsletter ---------- */
.newsletter { padding-block: 0 2.5rem; }
.newsletter-box { display: grid; grid-template-columns: 1fr minmax(16rem, 24rem); gap: 1.5rem 2.5rem; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: clamp(1.25rem, 3vw, 2rem); }
@media (max-width: 760px) { .newsletter-box { grid-template-columns: 1fr; } }
.newsletter-box h2 { margin: 0.2rem 0 0.4rem; }
.newsletter-box p { color: var(--ink-soft); }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.newsletter-form input[type="email"] { flex: 1 1 12rem; font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.newsletter-form .btn { border: 0; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- winery points on the map (radius set in JS per zoom level) ---------- */
.winery-pin circle { fill: var(--pin); stroke: var(--surface); }
.winery-pin { cursor: pointer; }
.winery-pin.in-region circle { stroke: var(--ink); }
.winery-pin.is-active circle, .winery-pin:focus-visible circle { stroke: var(--focus); stroke-width: 2px !important; vector-effect: non-scaling-stroke; }
.winery-pin .pin-label { fill: var(--ink); font-family: var(--font-body); font-weight: 600; paint-order: stroke; stroke: var(--map-italy); stroke-linejoin: round; }
.winery-pin:hover .pin-label, .winery-pin.is-active .pin-label { fill: var(--wine); }
.pin-cluster { cursor: zoom-in; }
.pin-cluster circle { fill: var(--ink); fill-opacity: 0.86; stroke: var(--surface); }
.pin-cluster.in-region circle { fill: var(--wine-fill); fill-opacity: 0.95; }
.pin-cluster.is-active circle { fill-opacity: 1; stroke: var(--focus); }
.pin-cluster text { fill: var(--bg); font-family: var(--font-body); font-weight: 700; text-anchor: middle; pointer-events: none; }
.pin-cluster.in-region text { fill: #fff; }

/* ---------- map controls, tooltip, enlarged view ---------- */
.map-controls { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2; display: flex; flex-direction: column; gap: 0.3rem; }
.map-controls button {
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-size: 1.15rem; line-height: 1;
  box-shadow: 0 1px 3px var(--shadow);
}
.map-controls button:hover { border-color: var(--wine); color: var(--wine); }
.map-tooltip {
  position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 0.45rem 0.65rem; font-size: 0.8rem; line-height: 1.35;
  display: flex; flex-direction: column; max-width: 15rem; box-shadow: 0 4px 12px var(--shadow); text-align: center;
}
.map-tooltip[hidden] { display: none; }
.map-tooltip strong { font-weight: 700; }
.map-tooltip .map-tooltip-wine { font-style: italic; opacity: 0.85; }
.map-wheel-hint {
  position: absolute; left: 50%; bottom: 0.75rem; transform: translateX(-50%); z-index: 3; margin: 0;
  background: color-mix(in srgb, var(--ink) 85%, transparent); color: var(--bg); padding: 0.35rem 0.7rem; font-size: 0.75rem; white-space: nowrap;
}
.map-wheel-hint[hidden] { display: none; }
.map-winery-list { list-style: none; margin: 1rem 0 0; padding: 0; columns: 2 12rem; column-gap: 1.25rem; font-size: var(--step--1); }
.map-winery-list li { break-inside: avoid; }
.map-winery-list a { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.2rem 0.25rem; text-decoration: none; color: var(--ink); }
.map-winery-list a:hover, .map-winery-list a.is-active { background: var(--wine-tint); color: var(--wine); }
.map-winery-list .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--gold); flex-shrink: 0; transform: translateY(0.05rem); }
.map-winery-place { display: block; color: var(--ink-faint); font-size: 0.72rem; }

.map-stage.is-expanded { position: fixed; inset: 0; z-index: 70; }
.map-stage.is-expanded .map-wrap { height: 100%; }
html.map-open { overflow: hidden; }

/* ---------- brand ---------- */
.brand { align-items: center; }
.brand-emblem { width: 1.9rem; height: 1.9rem; color: var(--wine); flex-shrink: 0; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-brand .brand-emblem { width: 1.3rem; height: 1.3rem; }

/* ---------- skip link (visible on keyboard focus) ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--wine-fill); color: #f7eeee; padding: 0.6rem 1rem; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- bottle illustrations ---------- */
.wine-card.has-bottle { position: relative; padding-right: 3.4rem; }
.bottle-small { position: absolute; right: 0.9rem; bottom: 0.9rem; width: 1.55rem; height: auto; filter: drop-shadow(0 1px 1px var(--shadow)); }
.bottle-figure { margin: 0 0 1rem; text-align: center; }
.bottle-figure .bottle-large { width: 40%; max-width: 6.5rem; height: auto; filter: drop-shadow(0 4px 8px var(--shadow)); }
.bottle-figure img { max-width: 60%; max-height: 22rem; object-fit: contain; }
.bottle-figure figcaption { font-size: 0.68rem; color: var(--ink-faint); margin-top: 0.3rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- one look for photos from many sources ---------- */
.page-photo img, .link-card img, .region-photo img, .grape-photo img, .catalog-photo img, .credit-list img {
  filter: saturate(0.86) contrast(1.03) sepia(0.07);
}
:root[data-theme="dark"] .page-photo img, :root[data-theme="dark"] .link-card img,
:root[data-theme="dark"] .region-photo img, :root[data-theme="dark"] .grape-photo img,
:root[data-theme="dark"] .catalog-photo img { filter: saturate(0.8) contrast(1.02) sepia(0.07) brightness(0.9); }
.page-photo img { aspect-ratio: 16 / 9; height: auto; }

/* ---------- Wein-Finder ---------- */
.finder { background: var(--surface); border: 1px solid var(--line); padding: clamp(1.25rem, 3vw, 2rem); scroll-margin-top: 5rem; }
.finder-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.finder-steps li { display: flex; align-items: center; gap: 0.5rem; font-size: var(--step--1); color: var(--ink-faint); }
.finder-steps li[data-goto] { cursor: pointer; color: var(--ink-soft); }
.finder-steps li[data-goto]:hover { color: var(--wine); }
.finder-steps li.is-current { color: var(--ink); font-weight: 700; }
.finder-step-n { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1.5px solid var(--line); flex-shrink: 0; font-weight: 700; }
/* Phones: only the current step keeps its label. */
@media (max-width: 600px) { .finder-steps { display: flex; } .finder-steps li.is-current { flex: 1; } .finder-steps li:not(.is-current) > :not(.finder-step-n) { display: none; } }
.finder-steps li.is-current .finder-step-n { background: var(--wine-fill); border-color: var(--wine-fill); color: #f7eeee; }
.finder-steps li.is-done .finder-step-n { background: var(--gold-tint); border-color: var(--gold); color: var(--gold); }
.finder-progress { height: 3px; background: var(--line-soft); margin: 0.9rem 0 1.25rem; }
.finder-progress span { display: block; height: 100%; background: var(--wine); transition: width 300ms ease; }
.finder-choice { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 0.75rem; }
.finder-panel:focus { outline: none; }
.finder-panel h2 { margin: 0 0 0.5rem; }
.finder-intro { color: var(--ink-soft); max-width: 46rem; margin-bottom: 1.25rem; }
.food-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.75rem; }
.food-tiles:has(.food-tile-dish) { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); }
.food-tile {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 1.25rem 0.75rem; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.food-tile:hover, .food-tile:focus-visible { border-color: var(--wine); box-shadow: 0 4px 14px var(--shadow); transform: translateY(-2px); }
.food-tile small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--ink-faint); margin-top: 0.2rem; }
.food-tile small.food-tile-top { color: var(--wine); font-weight: 600; }
.food-tile-dish { flex-direction: row; justify-content: flex-start; text-align: left; padding: 1rem; }
.food-icon { width: 2.6rem; height: 2.6rem; color: var(--wine); flex-shrink: 0; }
.food-tile-dish .food-icon { width: 2rem; height: 2rem; }
.food-icon-large { width: 4rem; height: 4rem; }
.food-head { display: flex; gap: 1.25rem; align-items: flex-start; max-width: 54rem; }
.finder-options { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; }
.finder-option { width: 100%; height: 100%; text-align: left; padding: 1rem 1.1rem; background: var(--bg); border: 1px solid var(--line); font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 0.3rem; }
.finder-option:hover, .finder-option:focus-visible { border-color: var(--wine); }
.finder-option span { font-size: var(--step--1); color: var(--ink-soft); }
.finder-result { margin-top: 1.5rem; }
.pairing-list { display: flex; flex-direction: column; gap: 0.75rem; }
.pairing-card { background: var(--bg); border: 1px solid var(--line); padding: 1rem 1.15rem; }
.finder .pairing-card { background: var(--bg); }
.page .pairing-card { background: var(--surface); }
.pairing-card.is-best { border-color: var(--wine); border-width: 2px; }
.pairing-card-head { display: flex; align-items: flex-start; gap: 0.8rem; }
.pairing-card-head > div { flex: 1; }
.pairing-card-head h3 { margin: 0; font-size: var(--step-1); }
.pairing-card-head h3 a { text-decoration: none; }
.pairing-rank { display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 50%; background: var(--wine-tint); color: var(--wine); font-weight: 700; font-family: var(--font-display); }
.pairing-card.is-best .pairing-rank { background: var(--wine-fill); color: #f7eeee; }
.pairing-reasons { margin: 0.7rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); font-size: 0.95rem; }
.pairing-reasons li + li { margin-top: 0.2rem; }
.pairing-wines { list-style: none; margin: 0.8rem 0 0; padding: 0.7rem 0 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 0.35rem; font-size: var(--step--1); }
.pairing-wines li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pairing-wines .bottle-small { position: static; width: 0.85rem; }
.pairing-wines a { font-weight: 600; }
.pairing-wines span { color: var(--ink-faint); }
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.variant { background: var(--surface); border: 1px solid var(--line); padding: 1rem 1.15rem; }
.variant h3 { margin: 0 0 0.3rem; font-size: var(--step-0); }
.variant p { color: var(--ink-soft); font-size: var(--step--1); margin-bottom: 0.6rem; }
.variant .chip-list { margin-bottom: 0.6rem; }
.prose-list { color: var(--ink-soft); padding-left: 1.2rem; max-width: 46rem; }
.prose-list li + li { margin-top: 0.35rem; }

/* ---------- switch the grape shown against the ideal profile ---------- */
.profile-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; margin-top: 0.75rem; }
.profile-picks button {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.6rem 0.25rem 0.25rem; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: var(--step--1);
}
.profile-picks button .pairing-rank { width: 1.4rem; height: 1.4rem; font-size: 0.75rem; }
.profile-picks button:hover { border-color: var(--slate); }
.profile-picks button[aria-pressed="true"] { border-color: var(--slate); background: var(--slate-tint); font-weight: 700; }
.profile-diff { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.75rem; text-align: left; min-height: 2.6em; }
.profile-show {
  margin-top: 0.6rem; padding: 0.3rem 0.65rem; cursor: pointer; font: inherit; font-size: var(--step--1); font-weight: 600;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
}
.profile-show::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.4rem; vertical-align: -0.05rem; border: 2px dashed var(--slate); background: var(--slate-tint); }
.profile-show:hover { border-color: var(--slate); color: var(--ink); }
/* The card shown in the diagram: a bar on the left, not a second frame around the best card's border. */
.pairing-card.is-selected { box-shadow: inset 4px 0 0 var(--slate); }
.pairing-card.is-selected .profile-show { border-color: var(--slate); background: var(--slate-tint); color: var(--ink); }


/* =====================================================================
   App shell: header actions, tab bar, cellar drawer, search, toasts
   ===================================================================== */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
header.site { view-transition-name: site-header; }
.tabbar { view-transition-name: tabbar; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
html.has-overlay { overflow: hidden; }

button.cellar-chip { font: inherit; font-size: var(--step--1); font-weight: 700; cursor: pointer; }
button.cellar-chip:hover, .search-chip:hover { border-color: var(--wine); color: var(--wine); }
.search-chip {
  display: flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.6rem 0.4rem 0.7rem; cursor: pointer;
  font: inherit; font-size: var(--step--1); color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line);
}
.search-chip svg { width: 15px; height: 15px; }
.search-chip kbd { font-family: var(--font-body); font-size: 0.68rem; padding: 0.05rem 0.3rem; border: 1px solid var(--line); color: var(--ink-faint); }
.is-bumped { animation: bump 380ms ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

.tabbar { display: none; }
@media (max-width: 1320px) { .search-chip-text, .search-chip kbd { display: none; } nav.links a { font-size: 0.8125rem; } }
/* Phones and tablets: tab bar at the bottom instead of the text navigation. */
@media (max-width: 1272px) {
  :root { --tabbar-h: calc(3.7rem + env(safe-area-inset-bottom)); }
  body { padding-bottom: var(--tabbar-h); }
  .nav-row { padding-block: 0.55rem; flex-wrap: nowrap; }
  nav.links, .brand-sub, header.site .cellar-chip, .search-chip-text, .search-chip kbd { display: none; }
  .nav-right { gap: 0.5rem; flex-wrap: nowrap; }
  .search-chip { width: 2.15rem; height: 2.15rem; padding: 0; justify-content: center; }
  .brand-mark { font-size: 1.3rem; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  }
  .tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
    font: inherit; font-size: 0.66rem; font-weight: 600; color: var(--ink-faint); text-decoration: none;
    background: none; border: 0; cursor: pointer; padding: 0.35rem 0 0;
  }
  .tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tab[aria-current="page"] { color: var(--wine); }
  .tab-badge {
    position: absolute; top: 0.25rem; left: calc(50% + 0.35rem); min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem; border-radius: 1rem;
    font-size: 0.62rem; line-height: 1.05rem; text-align: center; background: var(--wine-fill); color: #fff;
  }
  .tab-badge[hidden] { display: none; }
  footer.site { padding-bottom: 1rem; }
}

/* ---------- toasts ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(1.25rem + var(--tabbar-h, 0px)); transform: translate(-50%, 1rem);
  display: flex; align-items: center; gap: 1rem; max-width: calc(100vw - 2rem);
  padding: 0.7rem 0.8rem 0.7rem 1.1rem; background: var(--ink); color: var(--bg); box-shadow: 0 8px 28px var(--shadow);
  font-size: var(--step--1); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-action { font: inherit; font-weight: 700; color: var(--bg); background: none; border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); padding: 0.3rem 0.6rem; cursor: pointer; white-space: nowrap; }
.toast a { color: inherit; }
.cellar-fly { position: fixed; z-index: 95; width: 24px; height: 24px; pointer-events: none; }
.cellar-fly svg { width: 100%; height: 100%; fill: var(--wine-fill); }

/* ---------- drawer (cellar) and search palette ---------- */
.drawer, .palette { position: fixed; inset: 0; z-index: 80; }
.drawer[hidden], .palette[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 12, 0.45); animation: fade-in 180ms ease; }
@keyframes fade-in { from { opacity: 0; } }
.drawer-sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(27rem, 100%); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); box-shadow: -10px 0 40px var(--shadow); padding: 1.4rem 1.5rem 2rem; outline: none;
  animation: drawer-in 240ms cubic-bezier(.2,.8,.2,1);
}
@keyframes drawer-in { from { transform: translateX(100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.drawer-head h2 { font-size: var(--step-2); }
.drawer-head .panel-close { position: static; float: none; margin: 0; }
.drawer-rank { margin-top: 1.1rem; padding: 1rem 1.1rem; background: var(--wine-fill); color: #f7eeee; }
.drawer-rank .label { color: color-mix(in srgb, #f7eeee 70%, transparent); }
.drawer-rank-name { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; margin-top: 0.2rem; }
.drawer-rank-sub { font-size: var(--step--1); opacity: 0.85; margin-top: 0.2rem; }
.drawer-rank .bar-track { margin-top: 0.7rem; height: 6px; background: rgba(255, 255, 255, 0.2); }
.drawer-rank .bar-fill { height: 100%; background: #f7eeee; transition: width 400ms ease; }
.drawer-rank-count { font-size: 0.72rem; margin-top: 0.35rem; opacity: 0.85; }
.drawer-empty, .drawer-loading, .drawer-note { margin-top: 1.2rem; color: var(--ink-soft); font-size: var(--step--1); }
.drawer-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.drawer-list li { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line-soft); }
.drawer-bottle { width: 1.1rem; flex-shrink: 0; margin-top: 0.15rem; }
.drawer-item { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; font-size: var(--step--1); color: var(--ink-soft); }
.drawer-item > a:first-child { font-weight: 700; color: var(--ink); text-decoration: none; font-size: var(--step-0); }
.drawer-item > a:first-child:hover { color: var(--wine); text-decoration: underline; }
.drawer-shop { margin-top: 0.35rem; color: var(--wine); font-weight: 600; }
.drawer-item .ad-label { text-align: left; margin: 0; font-size: 0.65rem; }
.drawer-remove { background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--ink-faint); cursor: pointer; padding: 0.1rem 0.3rem; }
.drawer-remove:hover { color: var(--wine); }
.drawer-tools { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.drawer-shared { margin-top: 1.1rem; padding: 1rem; border: 1px solid var(--wine); background: var(--wine-tint); }
.drawer-shared ul { margin: 0.6rem 0 0.9rem 1.1rem; }
.sheet-handle { display: none; }
@media (max-width: 760px) {
  .drawer-sheet {
    top: auto; left: 0; width: auto; height: 70%; border-radius: 14px 14px 0 0; padding-top: 1.7rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom)); animation-name: sheet-up; transition: height 220ms ease;
  }
  .drawer-sheet[data-sheet="full"] { height: 92%; }
  .drawer-sheet.is-dragging { transition: none; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (max-width: 900px) {
  .sheet-handle {
    display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 4.5rem; height: 1.4rem;
    cursor: grab; touch-action: none; z-index: 3;
  }
  .sheet-handle::before { content: ""; position: absolute; left: 50%; top: 0.5rem; width: 2.6rem; height: 4px; margin-left: -1.3rem; border-radius: 4px; background: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .drawer-sheet, .drawer-backdrop, .map-wrap > .detail-panel, .toast { animation: none; transition: none; }
}

.palette-box {
  position: absolute; top: 12vh; left: 50%; transform: translateX(-50%); width: min(40rem, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 60px var(--shadow); animation: palette-in 160ms ease;
}
@keyframes palette-in { from { opacity: 0; transform: translate(-50%, -0.6rem); } }
.palette-field { display: flex; align-items: center; gap: 0.7rem; padding: 0.4rem 0.6rem 0.4rem 1rem; border-bottom: 1px solid var(--line); }
.palette-field svg { width: 1.15rem; height: 1.15rem; color: var(--ink-faint); flex-shrink: 0; }
.palette-field input { flex: 1; min-width: 0; padding: 0.8rem 0; font: inherit; font-size: var(--step-1); background: none; border: 0; color: var(--ink); outline: none; }
.palette-esc { font: inherit; font-size: 0.7rem; color: var(--ink-faint); background: none; border: 1px solid var(--line); padding: 0.2rem 0.45rem; cursor: pointer; }
.palette-list { list-style: none; margin: 0; padding: 0.4rem 0; max-height: 60vh; overflow-y: auto; }
.palette-list li[role="option"] { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.6rem 1rem; cursor: pointer; }
.palette-list li[aria-selected="true"], .palette-list li[role="option"]:hover { background: var(--wine-tint); }
.palette-list .hit-label { font-weight: 600; }
.palette-list .hit-sub { font-size: var(--step--1); color: var(--ink-faint); text-align: right; }
.palette-hint { padding: 0.8rem 1rem; color: var(--ink-faint); font-size: var(--step--1); line-height: 2.2; }
@media (max-width: 760px) {
  .palette-box { top: 0; left: 0; right: 0; bottom: 0; width: auto; transform: none; animation: none; display: flex; flex-direction: column; }
  .palette-list { max-height: none; flex: 1; }
}

/* ---------- wine in the map panel ---------- */
.panel-crumbs { display: flex; align-items: center; gap: 0.45rem; font-size: var(--step--1); color: var(--ink-faint); margin-bottom: 1rem; padding-right: 2.5rem; flex-wrap: wrap; }
.panel-back { font: inherit; font-weight: 700; color: var(--wine); background: none; border: 0; padding: 0; cursor: pointer; }
.panel-back:hover { text-decoration: underline; }
.wine-hero { display: flex; gap: 1rem; align-items: flex-start; }
.wine-hero-bottle { width: 2.6rem; flex-shrink: 0; filter: drop-shadow(0 4px 6px var(--shadow)); }
.wine-hero h3 { font-size: var(--step-2); line-height: 1.15; margin-top: 0.15rem; }
.wine-hero-price { margin-top: 0.4rem; font-weight: 700; }
.wine-hero-price span { display: block; font-weight: 400; font-size: 0.72rem; color: var(--ink-faint); }
.wine-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.1rem; }
.wine-actions .btn-cellar { width: 100%; padding-block: 0.75rem; }
.wine-actions .btn-shop { text-align: center; }
.wine-taste { display: grid; grid-template-columns: minmax(8rem, 11rem) 1fr; gap: 0.5rem 1rem; align-items: center; margin-top: 1.2rem; padding-block: 0.9rem; border-block: 1px solid var(--line-soft); }
.wine-taste .radar-svg { width: 100%; }
.wine-taste-grape { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; }
.wine-taste-grape a { color: var(--ink); }
.wine-taste .text-link { font: inherit; font-size: var(--step--1); background: none; border: 0; padding: 0; cursor: pointer; margin-top: 0.4rem; }
.panel-sub { margin-top: 1.3rem; }
.panel-sub-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-faint); margin-left: 0.3rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.chip-row .filter-chip { text-decoration: none; }
.panel-wine-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.panel-wine-link {
  display: flex; gap: 0.6rem; align-items: baseline; width: 100%; text-align: left; font: inherit; font-size: var(--step--1);
  padding: 0.45rem 0.3rem; background: none; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); cursor: pointer;
}
.panel-wine-link:hover { background: var(--wine-tint); }
.panel-wine-link .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--pin); flex-shrink: 0; }
.panel-wine-link strong { display: block; font-size: var(--step-0); }
.panel-wine-link span span { color: var(--ink-faint); }

/* Selected wine and its taste neighbours on the map */
.winery-pin.is-selected circle { stroke: var(--focus); stroke-width: 3px !important; vector-effect: non-scaling-stroke; }
.winery-pin.is-related circle, .pin-cluster.is-related circle { stroke: var(--focus); stroke-width: 2.5px !important; vector-effect: non-scaling-stroke; animation: pin-pulse 1.6s ease-in-out infinite; }
@keyframes pin-pulse { 50% { stroke-opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .winery-pin.is-related circle, .pin-cluster.is-related circle { animation: none; } }

@media print {
  html.has-overlay body > :not(.drawer) { display: none !important; }
  .drawer { position: static; }
  .drawer-backdrop, .drawer .panel-close, .drawer-tools, .drawer-remove, .drawer-shop, .drawer .ad-label, .sheet-handle, .tabbar { display: none !important; }
  .drawer-sheet { position: static; width: auto; height: auto; box-shadow: none; overflow: visible; animation: none; }
}

/* Long German compounds (e.g. Herkunftsbezeichnungen) must not push the page wider on phones. */
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
.content-grid > * { min-width: 0; }

/* =====================================================================
   The map as an answer: grape distribution, cellar route, taste links
   ===================================================================== */
.page-actions { margin-top: 1.2rem; }
.italy-svg.focus-mode .region-group:not(.is-focus) .region-shape { fill: color-mix(in srgb, var(--map-italy) 50%, var(--map-land)); stroke: var(--line-soft); }
.italy-svg.focus-mode .region-label:not(.is-focus) { opacity: 0.4; }
.italy-svg.focus-grape .region-group.is-focus .region-shape { fill: color-mix(in srgb, var(--focus-fill, var(--wine)) 30%, var(--map-italy)); stroke: var(--focus-fill, var(--wine)); stroke-width: 1.8; }
.italy-svg.focus-mode:not(.focus-grape) .region-group.is-focus .region-shape { fill: color-mix(in srgb, var(--gold-tint) 75%, var(--map-italy)); stroke: var(--gold); }
.winery-pin.is-dim, .pin-cluster.is-dim { opacity: 0.25; }
.winery-pin.is-focus circle { stroke: var(--ink); stroke-width: 2px !important; vector-effect: non-scaling-stroke; }
.map-links { pointer-events: none; }
.map-link { fill: none; stroke: var(--focus); stroke-width: 1.6; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; animation: link-flow 1.4s linear infinite; }
@keyframes link-flow { to { stroke-dashoffset: -16; } }
.map-route { fill: none; stroke: var(--wine); stroke-width: 2.2; stroke-dasharray: 7 5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0.85; }
.route-num {
  font-family: var(--font-body); font-weight: 700; font-size: calc(11px * var(--map-k, 1)); text-anchor: middle; fill: var(--wine);
  paint-order: stroke; stroke: var(--map-italy); stroke-width: calc(3px * var(--map-k, 1)); stroke-linejoin: round;
}
@media (prefers-reduced-motion: reduce) { .map-link { animation: none; } }

.grape-hero-photo { width: 3.4rem; height: 3.4rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.grape-hero-swatch { width: 2.6rem; height: 2.6rem; border-radius: 50%; flex-shrink: 0; }
.wine-taste-note { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.3rem; }
.link-button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--wine); }
.fact-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.fact dd.chip-row { margin-top: 0.35rem; }
.fact .filter-chip { cursor: pointer; font-size: 0.75rem; }
.fact .filter-chip:hover { border-color: var(--wine); color: var(--wine); }
.cellar-map-title { font-size: var(--step-2); line-height: 1.15; }
.cellar-stops { counter-reset: stop; }
.cellar-stops li { counter-increment: stop; }
.cellar-stops .panel-wine-link .dot { display: none; }
.cellar-stops .panel-wine-link::before {
  content: counter(stop); flex-shrink: 0; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 700; background: var(--wine-fill); color: #fff; align-self: center;
}
.panel-cellar-open { margin-top: 1.2rem; }
.drawer-tools .btn-primary { text-decoration: none; }

/* ---------- feedback form ---------- */
.feedback-chip svg { width: 16px; height: 16px; }
.feedback-intro { color: var(--ink-soft); font-size: var(--step--1); margin-top: 0.6rem; }
.feedback-form { display: flex; flex-direction: column; gap: 0.45rem; }
.feedback-form fieldset { border: 0; padding: 0; margin: 0.8rem 0 0; }
.feedback-form legend { margin-bottom: 0.45rem; }
.feedback-form .optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-faint); }
.feedback-types { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.choice-chip input, .star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-chip span {
  display: inline-block; padding: 0.4rem 0.75rem; border: 1px solid var(--line); background: var(--surface-sunk);
  font-size: var(--step--1); font-weight: 600; cursor: pointer;
}
.choice-chip input:checked + span { background: var(--wine-fill); border-color: var(--wine-fill); color: #fff; }
.choice-chip input:focus-visible + span, .star input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.feedback-rating { display: flex; gap: 0.15rem; }
.star span[aria-hidden] { font-size: 1.7rem; line-height: 1; color: var(--line); cursor: pointer; }
.feedback-rating:has(.star:nth-of-type(1) input:checked) .star:nth-of-type(-n+1) span[aria-hidden],
.feedback-rating:has(.star:nth-of-type(2) input:checked) .star:nth-of-type(-n+2) span[aria-hidden],
.feedback-rating:has(.star:nth-of-type(3) input:checked) .star:nth-of-type(-n+3) span[aria-hidden],
.feedback-rating:has(.star:nth-of-type(4) input:checked) .star:nth-of-type(-n+4) span[aria-hidden],
.feedback-rating:has(.star:nth-of-type(5) input:checked) .star:nth-of-type(-n+5) span[aria-hidden] { color: var(--gold); }
.feedback-form label.label { margin-top: 0.8rem; }
.feedback-form textarea, .feedback-form input[type="email"] {
  width: 100%; font: inherit; padding: 0.65rem 0.75rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.feedback-form textarea:focus, .feedback-form input[type="email"]:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.feedback-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.feedback-context { font-size: 0.75rem; color: var(--ink-faint); margin-top: 0.5rem; }
.feedback-error { color: var(--wine); font-weight: 600; font-size: var(--step--1); }
.feedback-error[hidden] { display: none; }
.feedback-form .btn { align-self: flex-start; margin-top: 0.6rem; }
.footer-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1272px) { .feedback-chip { width: 2.15rem; height: 2.15rem; padding: 0; justify-content: center; } }

/* =====================================================================
   Full-screen flows: "Mein Geschmacksprofil" (quiz) and the wine finder
   ===================================================================== */
.flow {
  min-height: calc(100svh - var(--header-h, 4rem) - var(--tabbar-h, 0px));
  display: flex; flex-direction: column; max-width: 74rem; margin: 0 auto; overflow-x: clip; /* the slide-in must not widen the page */
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
}
.flow-top { display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: 1rem; }
.flow-back {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 1.2rem; cursor: pointer; display: grid; place-items: center;
}
.flow-back:hover { border-color: var(--wine); color: var(--wine); }
.flow-progress { height: 6px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.flow-progress span { display: block; height: 100%; background: var(--wine-fill); border-radius: 6px; transition: width 320ms ease; }
.flow-count { font-size: var(--step--1); color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-body {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 21rem); gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: center; margin-top: clamp(1.25rem, 5vh, 3.5rem);
}
.flow-result { align-items: start; }
.flow-card h1 { font-size: var(--step-3); line-height: 1.12; margin-top: 0.3rem; }
.flow-card h1 a { color: inherit; }
.flow-lede { color: var(--ink-soft); font-size: var(--step-1); margin-top: 0.7rem; max-width: 42ch; }
.flow-options { display: grid; gap: 0.75rem; margin-top: 1.6rem; max-width: 34rem; }
.flow-option {
  display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: 1rem; text-align: left;
  padding: 1rem 1.2rem; font: inherit; font-size: var(--step-1); font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.flow-option:hover { border-color: var(--wine); transform: translateY(-1px); box-shadow: 0 6px 18px var(--shadow); }
.flow-option:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.flow-option[aria-pressed="true"] { border-color: var(--wine-fill); background: var(--wine-tint); }
.flow-option-icon { font-size: 2rem; line-height: 1; text-align: center; }
.flow-option kbd { font-family: var(--font-body); font-size: 0.7rem; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 4px; padding: 0.1rem 0.4rem; }
@media (hover: none) { .flow-option kbd { display: none; } }
.flow-skip { margin-top: 1rem; font: inherit; font-size: var(--step--1); color: var(--ink-faint); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.flow-radar { margin: 0; text-align: center; }
.flow-radar .radar-svg { width: 100%; max-width: 21rem; }
.flow-radar figcaption { font-size: var(--step--1); color: var(--ink-faint); margin-top: 0.4rem; }
.radar-shape.profile-shape { fill: color-mix(in srgb, var(--focus) 22%, transparent); stroke: var(--focus); stroke-width: 2; stroke-dasharray: 5 3; transition: all 300ms ease; }
.compare-swatch.profile-swatch { background: var(--focus); }
.compare-swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 2px; vertical-align: -0.05rem; margin-right: 0.3rem; }
.flow-intro { margin: auto; text-align: center; max-width: 40rem; padding-block: 8vh; }
.flow-intro .flow-lede { margin-inline: auto; }
.flow-start { margin-top: 1.8rem; font-size: 1rem; padding: 1rem 1.9rem; }
.flow-note { margin-top: 1rem; color: var(--ink-faint); font-size: var(--step--1); }
.flow-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.flow-actions .btn { text-decoration: none; }
.flow-sub { margin-top: 2.2rem; }
.flow-matches { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.75rem; }
.flow-matches li { display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.flow-matches h2 { font-size: var(--step-1); }
.flow-matches h2 a { color: var(--ink); }
.flow-matches p { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.15rem; }
.flow-matches .flow-wines a { color: var(--wine); }
.flow.is-moving .flow-card, .flow.is-moving .flow-radar { animation: flow-in 260ms ease; }
.flow.is-moving[data-dir="back"] .flow-card { animation-name: flow-back; }
@keyframes flow-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes flow-back { from { opacity: 0; transform: translateX(-28px); } }
@media (prefers-reduced-motion: reduce) { .flow.is-moving .flow-card, .flow.is-moving .flow-radar { animation: none; } }
@media (max-width: 860px) {
  .flow-body { grid-template-columns: 1fr; align-items: start; gap: 1rem; }
  .flow-body:not(.flow-result) .flow-radar { order: -1; }
  .flow-body:not(.flow-result) .flow-radar .radar-svg { max-width: 11rem; }
  .flow-option { font-size: var(--step-0); padding: 0.85rem 1rem; grid-template-columns: 2.4rem 1fr auto; }
  .flow-option-icon { font-size: 1.6rem; }
}
.flow-below { padding-block: clamp(2rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }
.flow-below h2 { margin-top: 1.4rem; font-size: var(--step-2); }
.flow-below p { color: var(--ink-soft); max-width: 60ch; margin-top: 0.5rem; }
/* Wine finder inside the flow: progress sits on top, so the step list goes. */
.finder.flow > .flow-card { margin-top: clamp(1.25rem, 4vh, 3rem); }
.finder .finder-steps, .finder .finder-progress { display: none; }
.finder .food-tiles { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.75rem; margin-top: 1.4rem; }
.finder .food-tile { border-radius: 14px; transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease; }
.finder .food-tile:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--shadow); }
.finder .finder-options { margin-top: 1.2rem; }
.finder .finder-option { border-radius: 12px; }
/* Ranked grapes in the map panel (profile and food views) */
.ranked-grapes .pairing-rank { flex-shrink: 0; }
.ranked-grapes .panel-wine-link { align-items: center; }
@media (max-width: 1840px) {
  .feedback-chip .search-chip-text { display: none; }
  .feedback-chip { width: 2.15rem; height: 2.15rem; padding: 0; justify-content: center; }
}

/* ---------- DOC/DOCG zones on the map ---------- */
.appellation-areas { pointer-events: none; }
.appellation-area { stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: opacity 200ms ease; }
.appellation-area.level-docg { fill: color-mix(in srgb, var(--wine) 16%, transparent); stroke: color-mix(in srgb, var(--wine) 75%, transparent); }
.appellation-area.level-doc { fill: color-mix(in srgb, var(--gold) 14%, transparent); stroke: color-mix(in srgb, var(--gold) 80%, transparent); stroke-dasharray: 3 2; }
.italy-svg .appellation-area.is-wide { display: none; }
.italy-svg .appellation-area.is-open { display: inline; stroke-width: 2.2; }
.appellation-area.level-docg.is-open { fill: color-mix(in srgb, var(--wine) 30%, transparent); }
.appellation-area.level-doc.is-open { fill: color-mix(in srgb, var(--gold) 30%, transparent); }
.italy-svg.focus-app .appellation-area:not(.is-open) { opacity: 0.25; }
.appellation-labels { pointer-events: auto; }
.appellation-label {
  font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: calc(10.5px * var(--map-k, 1)); text-anchor: middle;
  paint-order: stroke; stroke: var(--map-italy); stroke-width: calc(3px * var(--map-k, 1)); stroke-linejoin: round; cursor: pointer;
}
.appellation-label.level-docg { fill: var(--wine); }
.appellation-label.level-doc { fill: var(--gold); }
.appellation-label:hover { text-decoration: underline; }
.italy-svg.focus-mode .appellation-label { opacity: 0.45; }
.legend-area { width: 0.8rem; height: 0.65rem; border: 1.5px solid; }
.legend-area.level-docg { background: color-mix(in srgb, var(--wine) 22%, transparent); border-color: var(--wine); }
.legend-area.level-doc { background: color-mix(in srgb, var(--gold) 22%, transparent); border-color: var(--gold); border-style: dashed; }
.level-badge { display: inline-block; padding: 0.1rem 0.45rem; margin-right: 0.3rem; border-radius: 3px; font-weight: 700; color: #fff; }
.level-badge.level-docg { background: var(--wine-fill); }
.level-badge.level-doc { background: var(--gold); color: var(--surface); }
.app-rules { margin: 0.4rem 0 0 1.1rem; padding: 0; font-size: var(--step--1); color: var(--ink-soft); }
.app-rules li + li { margin-top: 0.3rem; }

/* =====================================================================
   Map layers: everything, or only wineries, wine regions or DOC/DOCG zones
   ===================================================================== */
.map-controls button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.map-controls [data-map="layers"][aria-expanded="true"] { border-color: var(--wine); color: var(--wine); }
.map-layers {
  position: absolute; z-index: 6; top: 0.6rem; right: 3.4rem; width: min(19rem, calc(100% - 4.5rem));
  padding: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px var(--shadow); animation: layers-in 140ms ease;
}
@keyframes layers-in { from { opacity: 0; transform: translateY(-4px); } }
.map-layers[hidden] { display: none; }
.map-wrap.panel-open .map-layers { right: calc(min(25rem, 42%) + clamp(0.75rem, 2vw, 1.5rem) + 3.4rem); }
.map-layers .label { margin: 0 0 0.45rem; }
.map-layers .label + .layer-toggle, .layer-modes + .label { margin-top: 0.9rem; }
.layer-modes { display: grid; gap: 0.35rem; }
.layer-mode { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.layer-mode:hover { border-color: var(--wine); }
.layer-mode:has(input:checked) { border-color: var(--wine-fill); background: var(--wine-tint); }
.layer-mode:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.layer-mode input, .layer-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.layer-mode strong { display: block; font-size: var(--step--1); }
.layer-mode small { display: block; font-size: 0.72rem; color: var(--ink-faint); }
/* Small pictograms of each view */
.layer-mode-icon { width: 2.2rem; height: 2.2rem; flex-shrink: 0; border-radius: 8px; background: var(--map-sea); position: relative; overflow: hidden; }
.layer-mode-icon::before { content: ""; position: absolute; inset: 0.35rem 0.55rem 0.3rem 0.65rem; background: var(--map-italy); clip-path: polygon(20% 0, 70% 8%, 62% 40%, 100% 75%, 80% 100%, 45% 60%, 10% 30%); }
.mode-icon-wineries::after, .mode-icon-all::after {
  content: ""; position: absolute; left: 0.85rem; top: 0.7rem; width: 5px; height: 5px; border-radius: 50%; background: var(--pin-red);
  box-shadow: 0.35rem 0.35rem 0 var(--pin-white), 0.55rem 0.8rem 0 var(--pin-red), 0.1rem 0.55rem 0 var(--pin-sparkling);
}
.mode-icon-regions::before { background: linear-gradient(160deg, #c79aa3 0 35%, #d7bf95 35% 62%, #a9bda5 62%); }
.mode-icon-apps::after { content: ""; position: absolute; left: 0.8rem; top: 0.75rem; width: 0.8rem; height: 0.55rem; border: 1.5px solid var(--wine); background: color-mix(in srgb, var(--wine) 25%, transparent); border-radius: 3px; }
.layer-toggle { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0.1rem; font-size: var(--step--1); cursor: pointer; }
.layer-toggle span { flex: 1; }
.layer-toggle::after {
  content: ""; width: 2.2rem; height: 1.25rem; border-radius: 1rem; background: var(--line); flex-shrink: 0; order: 2;
  background-image: radial-gradient(circle at 0.62rem 50%, var(--surface) 0.42rem, transparent 0.45rem); transition: background-color 150ms ease, background-position 150ms ease;
}
.layer-toggle:has(input:checked)::after { background-color: var(--wine-fill); background-position: 0.95rem 0; }
.layer-toggle:has(input:focus-visible)::after { outline: 2px solid var(--focus); outline-offset: 2px; }

/* What each view hides (a view opened in the panel always keeps its points) */
.italy-svg.mode-wineries .appellation-areas, .italy-svg.mode-wineries .appellation-labels,
.italy-svg.mode-regions .appellation-areas, .italy-svg.mode-regions .appellation-labels { display: none; }
.italy-svg.mode-wineries.focus-app .appellation-areas, .italy-svg.mode-regions.focus-app .appellation-areas { display: inline; }
.italy-svg.mode-regions:not(.focus-mode) .winery-pins, .italy-svg.mode-apps:not(.focus-mode) .winery-pins,
.italy-svg.mode-regions:not(.focus-mode) .map-links, .italy-svg.mode-apps:not(.focus-mode) .map-links { display: none; }
.italy-svg.mode-wineries .region-labels, .italy-svg.mode-apps .region-labels { opacity: 0.4; }
/* Regions view: every region in its own tint, stronger on hover */
.italy-svg.mode-regions:not(.focus-mode) .region-group .region-shape { fill: color-mix(in srgb, var(--region-tint) 26%, var(--map-italy)); stroke: color-mix(in srgb, var(--region-tint) 70%, var(--map-italy)); }
.italy-svg.mode-regions:not(.focus-mode) .region-group:hover .region-shape { fill: color-mix(in srgb, var(--region-tint) 45%, var(--map-italy)); }
.italy-svg.mode-regions .region-label { font-size: calc(11.5px * var(--map-k, 1)); }
/* Zones view: zones from the first zoom step on, clickable */
.italy-svg.mode-apps .appellation-areas { pointer-events: auto; }
.italy-svg.mode-apps .appellation-area[data-z] { display: inline; cursor: pointer; }
.italy-svg.mode-apps .appellation-area.is-wide:not(.is-open) { display: none; }
.italy-svg.mode-apps .appellation-area:hover { stroke-width: 2.2; }
.italy-svg.mode-apps.level-hover .appellation-area { opacity: 0.6; }
.italy-svg.mode-apps:not(.focus-mode) .region-group .region-shape { fill: color-mix(in srgb, var(--map-italy) 70%, var(--map-land)); }
/* Details */
.italy-svg.hide-places .map-labels, .italy-svg.hide-places .map-rivers, .italy-svg.hide-places .map-lake { display: none; }
.italy-svg.hide-relief .map-relief { display: none; }
/* Legend follows the view */
.map-wrap .lg-regions { display: none; }
.map-wrap.mode-regions .lg-regions { display: inline-flex; }
.map-wrap.mode-regions .lg-pins, .map-wrap.mode-apps .lg-pins, .map-wrap.mode-regions .lg-apps, .map-wrap.mode-wineries .lg-apps { display: none; }
@media (max-width: 900px) {
  .map-layers { top: auto; bottom: 3.4rem; right: 3.4rem; }
  .map-wrap.panel-open .map-layers { right: 3.4rem; }
}

/* ---------- quiet map in the background of all pages except the atlas ---------- */
body.page-sub::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("/img/map-backdrop.webp") no-repeat right -6vw top 3.5rem / auto min(118vh, 1500px);
  opacity: 0.55;
  /* Strongest at the right edge, fading out towards the reading column. */
  -webkit-mask-image: linear-gradient(to left, #000 18%, rgba(0, 0, 0, 0.35) 55%, transparent 85%);
  mask-image: linear-gradient(to left, #000 18%, rgba(0, 0, 0, 0.35) 55%, transparent 85%);
}
:root[data-theme="dark"] body.page-sub::before { filter: invert(1); opacity: 0.4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.page-sub::before { filter: invert(1); opacity: 0.4; } }
@media (max-width: 760px) {
  body.page-sub::before { background-position: right -40vw top 3.5rem; opacity: 0.35; }
}
@media print { body.page-sub::before { display: none; } }

/* Sections below the full-screen map are laid out only when scrolled near. */
#grapes { content-visibility: auto; contain-intrinsic-size: auto 1100px; }

/* ---------- zones: lighter, so overlapping zones stay readable ---------- */
.appellation-area { stroke-width: 1; }
.appellation-area.level-docg { fill: color-mix(in srgb, var(--wine) 7%, transparent); stroke: color-mix(in srgb, var(--wine) 45%, transparent); }
.appellation-area.level-doc { fill: color-mix(in srgb, var(--gold) 6%, transparent); stroke: color-mix(in srgb, var(--gold) 50%, transparent); }
.italy-svg.mode-apps .appellation-area.level-docg:not(.is-open) { fill: color-mix(in srgb, var(--wine) 10%, transparent); }
.italy-svg.mode-apps .appellation-area.level-doc:not(.is-open) { fill: color-mix(in srgb, var(--gold) 9%, transparent); }
.italy-svg.mode-apps .appellation-area:hover { fill-opacity: 1; stroke-width: 2; }

/* ---------- legend: top centre of the map, clearly readable ---------- */
.map-wrap .map-legend {
  top: clamp(0.75rem, 2vw, 1.5rem); bottom: auto; left: 50%; transform: translateX(-50%);
  max-width: min(44rem, calc(100% - 2 * 25.5rem)); justify-content: center; gap: 0.3rem 0.8rem; white-space: nowrap;
  padding: 0.5rem 0.95rem; border-radius: 999px; font-size: 0.75rem; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 4px 16px var(--shadow);
}
/* With the panel open the legend centres in the part of the map left free. */
.map-wrap.panel-open .map-legend { left: calc(24.5rem + 2.5rem); right: calc(min(25rem, 42%) + 4.5rem); transform: none; max-width: none; border-radius: 14px; }
@media (max-width: 1350px) {
  .map-wrap .map-legend { left: calc(24.5rem + 2.5rem); right: 4rem; transform: none; max-width: none; border-radius: 14px; }
  .map-wrap.panel-open .map-legend { left: 23rem; right: calc(min(25rem, 42%) + 4.5rem); }
}
@media (max-width: 900px) {
  .map-wrap .map-legend, .map-wrap.panel-open .map-legend {
    top: 4.35rem; left: 0.6rem; right: 3.5rem; transform: none; max-width: none; border-radius: 10px;
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; font-size: 0.68rem; padding: 0.35rem 0.6rem;
  }
  .map-wrap.panel-open .map-legend { display: flex; }
  .map-legend span { white-space: nowrap; }
}

/* ---------- wine finder: see-through, so the background map shows like in the quiz ---------- */
.finder.flow { background: transparent; border: 0; }
.finder .food-tile, .finder .finder-option, .finder .pairing-card, .finder .side-card {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.finder .rule-box { background: color-mix(in srgb, var(--gold-tint) 70%, transparent); }

/* Legend entries for the dashed lines, shown while the lines are on the map */
.map-wrap .lg-links, .map-wrap .lg-route { display: none; }
.map-wrap.has-links .lg-links, .map-wrap.has-route .lg-route { display: inline-flex; }
.legend-line { width: 1.6rem; height: 0; border-top: 2px dashed; }
.legend-line-links { border-color: var(--focus); }
.legend-line-route { border-color: var(--wine); }

/* ---------- wine finder: cleaner cards and calmer type ---------- */
.finder h1 { font-size: clamp(1.45rem, 1.05rem + 1.5vw, 2.15rem); line-height: 1.15; }
.finder .flow-lede, .finder .finder-intro { font-size: var(--step-0); max-width: 52ch; margin-top: 0.5rem; }
.finder .finder-choice { margin-bottom: 0.4rem; }
/* Dishes need wider cards than the categories (name plus a line of examples). */
.finder .food-tiles:has(.food-tile-dish) { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.finder .food-tile-dish { align-items: center; gap: 0.9rem; padding: 0.9rem 1rem; font-size: 0.95rem; line-height: 1.3; }
.finder .food-tile-dish small { font-size: 0.78rem; line-height: 1.35; }
/* No lift on hover: with the blurred, see-through cards it made the text shimmer. */
.finder .food-tile:hover, .finder .food-tile:focus-visible { transform: none; }
.finder .finder-option strong { font-size: 0.95rem; }
.finder .finder-option span { font-size: 0.8rem; }
.finder .pairing-card-head { flex-wrap: wrap; }
.finder .pairing-card-head > div { flex: 1 1 11rem; min-width: 0; }
.finder .pairing-card-head h3 { font-size: 1.1rem; }
.finder .pairing-reasons { font-size: 0.875rem; }
.finder .rule-box { font-size: 0.95rem; }
.finder .profile-picks button { font-size: 0.8rem; }
/* Names (grapes, wines) are not hyphenated, only long words in big headings. */
h3 { hyphens: manual; }
@media (max-width: 600px) {
  .finder .food-tiles:has(.food-tile-dish) { grid-template-columns: 1fr; }
  .finder .pairing-card { padding: 0.9rem; }
  .finder .pairing-card-head .badge { order: 3; margin-left: 2.8rem; }
}

/* Cellar drawer: actions right under the title */
.drawer-tools.drawer-tools-top { margin-top: 0.9rem; }
.drawer-tools-top .btn { padding: 0.6rem 0.9rem; }
.drawer-tools-top .btn-primary { flex: 1 1 100%; justify-content: center; }

/* About page: photo and text side by side */
.about-me { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 0.8rem; }
.about-photo { flex: 0 0 8rem; aspect-ratio: 1; display: grid; place-items: center; margin: 0; background: var(--surface-sunk); border-radius: 50%; overflow: hidden; text-align: center; font-size: var(--step--1); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) { .about-me { flex-direction: column; } }
.prose .footer-link { color: var(--wine); font-weight: 600; }

/* Seven nav items: tighter spacing on narrow desktops so the header stays one row. */
@media (min-width: 1273px) and (max-width: 1600px) {
  nav.links { gap: 0.75rem; }
  nav.links a { font-size: 0.78rem; }
  .nav-right { gap: 0.6rem; }
}

/* Medium screens with the panel open: too little room between search and panel,
   so the legend moves under the search box. */
@media (min-width: 901px) and (max-width: 1350px) {
  .map-wrap.panel-open .map-legend { top: calc(var(--legend-under-search, 5.4rem)); left: 1.75rem; right: auto; width: min(24.5rem, calc(100% - min(25rem, 42%) - 6rem)); justify-content: flex-start; }
}
/* Headings that receive focus from script (screen readers) need no visible ring. */
[tabindex="-1"]:focus { outline: none; }
