:root {
  --bg: #f3efe4;
  --bg-deep: #e8dcc0;
  --card: rgba(255, 249, 240, 0.82);
  --card-strong: rgba(255, 252, 245, 0.94);
  --line: rgba(43, 46, 48, 0.12);
  --line-strong: rgba(43, 46, 48, 0.22);
  --ink: #172225;
  --muted: #607174;
  --wine: #7c2942;
  --wine-deep: #4b1626;
  --sage: #2d6d5c;
  --sage-soft: #dbe9e1;
  --amber: #e3b261;
  --amber-soft: #f3e3bf;
  --rust: #cb654e;
  --rust-soft: #f6ddd5;
  --shadow: 0 18px 45px rgba(31, 28, 24, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(233, 194, 131, 0.38), transparent 30%),
    radial-gradient(circle at top right, rgba(120, 41, 66, 0.14), transparent 26%),
    linear-gradient(180deg, #f7f2e9 0%, #f0e5d3 45%, #efe7d7 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -6rem;
  left: -5rem;
  background: rgba(140, 77, 49, 0.12);
}

body::after {
  right: -6rem;
  bottom: -8rem;
  background: rgba(45, 109, 92, 0.12);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-nav {
  border-bottom: 1px solid var(--line);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 16px;
}

.site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.04em;
  transition: color 0.18s ease;
}

.site-logo:hover {
  color: #60a5fa;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.18s ease;
}

.site-nav-links a:hover {
  color: var(--ink);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 30px 0 72px;
  display: grid;
  gap: 24px;
  overflow-x: hidden;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }
.reveal-d4 { transition-delay: .4s; }

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.masthead-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--wine);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.02;
}

h1 {
  font-size: clamp(2.65rem, 4vw, 4.8rem);
  max-width: 13ch;
}

h2 {
  font-size: clamp(1.5rem, 2vw, 2.25rem);
}

.lede,
.panel-note {
  margin: 14px 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.action-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.action-button {
  background: linear-gradient(135deg, var(--wine), var(--wine-deep));
  color: #fff7f8;
  box-shadow: 0 12px 22px rgba(76, 19, 36, 0.22);
}

.ghost-button {
  background: rgba(255, 250, 242, 0.74);
  color: var(--ink);
  border-color: rgba(23, 34, 37, 0.14);
}

.action-button:hover,
.ghost-button:hover,
.sort-button:hover {
  transform: translateY(-1px);
}

.discovery-hub {
  text-align: center;
}

.browse-section {
  display: none;
}

.browse-section.is-active {
  display: grid;
}

/* hero-layout uses grid already, others need block */
.browse-section.is-active.hero-layout {
  display: grid;
}

.browse-section.is-active:not(.hero-layout) {
  display: block;
}

.discovery-hub.is-hidden {
  display: none;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.back-to-top:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.3);
}

.discovery-hub .eyebrow {
  margin-bottom: 18px;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.discovery-card {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 28px 16px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.discovery-hub.visible .discovery-card {
  opacity: 1;
  transform: translateY(0);
}

.discovery-hub.visible .discovery-card:nth-child(1) { transition-delay: .05s; }
.discovery-hub.visible .discovery-card:nth-child(2) { transition-delay: .12s; }
.discovery-hub.visible .discovery-card:nth-child(3) { transition-delay: .19s; }
.discovery-hub.visible .discovery-card:nth-child(4) { transition-delay: .26s; }

.discovery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.18);
}

.discovery-icon {
  font-size: 2rem;
  line-height: 1;
}

.discovery-card strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.discovery-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.95fr);
  gap: 20px;
  max-width: 100%;
}

.map-panel,
.controls-panel,
.picks-panel,
.table-panel {
  padding: 22px;
  max-width: 100%;
  overflow: hidden;
}

.insight-rail {
  display: grid;
  gap: 20px;
}

.insight-rail .panel {
  padding: 20px;
}

.panel-heading,
.split-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.map-stage {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  margin-top: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#originMap {
  display: block;
  width: 100%;
  height: auto;
}

.map-ocean {
  fill: url(#oceanGlow);
}

.map-graticule line {
  stroke: rgba(244, 228, 192, 0.11);
  stroke-width: 1;
}

.continent {
  fill: rgba(245, 227, 192, 0.16);
  stroke: rgba(255, 247, 219, 0.12);
  stroke-width: 2;
}

.continent-soft {
  fill: rgba(122, 188, 160, 0.12);
}

.map-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(6, 16, 20, 0.46);
  color: rgba(255, 251, 243, 0.86);
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.legend-dot.gain {
  background: var(--sage);
}

.legend-dot.loss {
  background: var(--rust);
}

.map-marker {
  cursor: pointer;
}

.map-marker circle {
  transition: transform 0.18s ease, opacity 0.18s ease, stroke-width 0.18s ease;
}

.map-marker:hover .marker-ring,
.map-marker.is-selected .marker-ring {
  transform: scale(1.08);
}

.marker-ring {
  fill: rgba(255, 241, 214, 0.14);
  stroke: rgba(255, 247, 231, 0.72);
  stroke-width: 1.5;
  filter: url(#markerShadow);
  transform-origin: center;
}

.marker-core {
  fill: url(#markerCore);
  stroke: rgba(255, 251, 241, 0.95);
  stroke-width: 1.5;
}

.map-marker.gain .marker-ring {
  fill: rgba(45, 109, 92, 0.26);
  stroke: rgba(204, 238, 224, 0.78);
}

.map-marker.gain .marker-core {
  fill: #d9f1e5;
}

.map-marker.loss .marker-ring {
  fill: rgba(203, 101, 78, 0.28);
  stroke: rgba(255, 223, 215, 0.84);
}

.map-marker.loss .marker-core {
  fill: #ffe6dd;
}

.map-marker.flat .marker-ring {
  fill: rgba(227, 178, 97, 0.24);
  stroke: rgba(250, 228, 184, 0.8);
}

.marker-count {
  fill: rgba(255, 248, 234, 0.95);
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.map-selection {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 249, 239, 0.88), rgba(240, 233, 217, 0.84));
  border: 1px solid rgba(23, 34, 37, 0.08);
  color: var(--muted);
  line-height: 1.6;
}

.map-selection strong {
  color: var(--ink);
}

.map-selection h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.stat-card {
  min-height: 116px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 252, 246, 0.92), rgba(247, 239, 224, 0.88));
  border: 1px solid rgba(23, 34, 37, 0.08);
}

.stat-card .value {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stat-card .label {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--wine);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-card .detail {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.bar-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.94rem;
}

.bar-copy strong {
  font-weight: 700;
}

.bar-copy span:last-child {
  color: var(--muted);
}

.bar-track {
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 34, 37, 0.08);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wine), #bb5961);
}

.bar-fill.gain {
  background: linear-gradient(90deg, var(--sage), #6f9d89);
}

.bar-fill.loss {
  background: linear-gradient(90deg, var(--rust), #dd8769);
}

.bar-fill.flat {
  background: linear-gradient(90deg, var(--amber), #f0ca7f);
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.pick-card {
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(23, 34, 37, 0.08);
  background:
    radial-gradient(circle at top right, rgba(227, 178, 97, 0.18), transparent 30%),
    linear-gradient(165deg, rgba(255, 253, 248, 0.96), rgba(245, 235, 220, 0.92));
}

.pick-card h3 {
  font-size: 1.32rem;
}

.pick-card p {
  margin: 0;
}

.pick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.verdict-chip,
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.verdict-chip.good,
.pill.good,
.pill.gain {
  background: var(--sage-soft);
  color: var(--sage);
}

.verdict-chip.warn,
.pill.warn,
.pill.loss {
  background: var(--rust-soft);
  color: var(--rust);
}

.verdict-chip.calm,
.pill.calm,
.pill.flat {
  background: var(--amber-soft);
  color: #916a21;
}

.verdict-chip.ghost,
.pill.ghost,
.meta-chip {
  background: rgba(23, 34, 37, 0.07);
  color: var(--muted);
}

.pick-actions,
.wine-links,
.trend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-list {
  margin-top: 10px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(23, 34, 37, 0.06);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.quick-filter-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.quick-filter-block {
  display: grid;
  gap: 10px;
}

.quick-filter-block .eyebrow {
  margin-bottom: 0;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-filter-button,
.country-jump,
.region-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(23, 34, 37, 0.1);
  background: rgba(255, 251, 243, 0.9);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.quick-filter-button span,
.region-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(23, 34, 37, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
}

.quick-filter-button:hover,
.country-jump:hover,
.region-pill:hover {
  transform: translateY(-1px);
}

.quick-filter-button.is-active,
.country-jump.is-active,
.region-pill.is-active {
  border-color: rgba(124, 41, 66, 0.28);
  background: rgba(124, 41, 66, 0.08);
  color: var(--wine);
}

.quick-filter-button.is-active span,
.region-pill.is-active span {
  background: rgba(124, 41, 66, 0.12);
  color: var(--wine);
}

.region-pill.is-muted {
  cursor: default;
  opacity: 0.78;
}

.explorer-panel {
  padding: 22px;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.country-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(23, 34, 37, 0.08);
  background:
    radial-gradient(circle at top right, rgba(45, 109, 92, 0.1), transparent 34%),
    linear-gradient(165deg, rgba(255, 253, 248, 0.98), rgba(243, 234, 217, 0.94));
}

.country-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.country-card h3 {
  font-size: 1.28rem;
}

.region-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.country-spotlight {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(23, 34, 37, 0.05);
  color: var(--muted);
  line-height: 1.55;
}

.country-spotlight strong {
  color: var(--ink);
}

.family-panel {
  padding: 22px;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.family-card {
  border: 1px solid rgba(23, 34, 37, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(124, 41, 66, 0.08), transparent 34%),
    linear-gradient(165deg, rgba(255, 253, 248, 0.98), rgba(244, 236, 223, 0.94));
  overflow: hidden;
}

.family-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 18px;
  padding: 20px;
  list-style: none;
  cursor: pointer;
}

.family-summary::-webkit-details-marker {
  display: none;
}

.family-copy {
  display: grid;
  gap: 10px;
}

.family-copy h3 {
  font-size: 1.34rem;
}

.family-aside {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.family-price {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.family-pill-row,
.family-stats,
.offer-variant-metrics,
.offer-variant-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-body {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}

.offer-variant-grid {
  display: grid;
  gap: 12px;
}

.offer-variant {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.82);
  border: 1px solid rgba(23, 34, 37, 0.08);
}

.offer-variant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.offer-variant-head strong {
  font-size: 0.98rem;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(23, 34, 37, 0.12);
  background: rgba(255, 254, 250, 0.92);
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(124, 41, 66, 0.18);
  border-color: rgba(124, 41, 66, 0.38);
}

.toggle-row,
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-row {
  margin-top: 16px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.86);
  border: 1px solid rgba(23, 34, 37, 0.1);
  color: var(--ink);
  font-weight: 700;
}

.toggle-pill input {
  width: 16px;
  height: 16px;
  accent-color: var(--wine);
}

.active-filters {
  margin-top: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(23, 34, 37, 0.1);
  background: rgba(255, 249, 242, 0.9);
  color: var(--muted);
}

.filter-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 34, 37, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.filter-drawer {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.filter-drawer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  list-style: none;
  background: rgba(255, 255, 255, 0.02);
}

.filter-drawer-toggle::-webkit-details-marker {
  display: none;
}

.filter-drawer-toggle::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--muted);
}

.filter-drawer[open] .filter-drawer-toggle::after {
  content: "−";
}

.filter-drawer-body {
  padding: 0 18px 18px;
}

.results-meta {
  align-self: center;
  color: var(--muted);
  font-weight: 700;
}

.table-scroll {
  margin-top: 18px;
  overflow: auto;
}

.deal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  table-layout: fixed;
}

.deal-table th {
  padding: 0 10px 4px;
  text-align: left;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.sort-button::after {
  content: attr(data-arrow);
  font-size: 0.9rem;
}

.sort-button.is-active {
  color: var(--wine);
}

.deal-row td {
  padding: 14px 10px;
  vertical-align: top;
  background: var(--card-strong);
  border-top: 1px solid rgba(23, 34, 37, 0.08);
  border-bottom: 1px solid rgba(23, 34, 37, 0.08);
}

.deal-row td {
  overflow: hidden;
  word-break: break-word;
}

.deal-row td:first-child {
  border-left: 1px solid rgba(23, 34, 37, 0.08);
  border-radius: 18px 0 0 18px;
}

.deal-row td:last-child {
  border-right: 1px solid rgba(23, 34, 37, 0.08);
  border-radius: 0 18px 18px 0;
}

.wine-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
}

.wine-subline,
.cell-subline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.wine-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wine-notes-cell {
  display: grid;
  gap: 4px;
  max-width: 180px;
}

.notes-region {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wine);
}

.notes-tasting {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.45;
}

.notes-community {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price-stack,
.rating-stack,
.score-stack,
.offer-stack {
  display: grid;
  gap: 6px;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.price-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 4.5ch;
  white-space: nowrap;
}

.per-unit {
  font-size: 0.68rem;
  color: var(--text-muted, #888);
  opacity: 0.7;
}

.money {
  font-size: 0.95rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.gap-figure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
}

.gap-figure.gain {
  color: var(--sage);
}

.gap-figure.loss {
  color: var(--rust);
}

.gap-figure.flat {
  color: #916a21;
}

.score-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 34, 37, 0.08);
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), #d67b58);
}

.empty-state {
  padding: 36px;
  text-align: center;
  color: var(--muted);
}

.deal-signal {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 8px;
  max-width: 150px;
}

.loading-sheen {
  position: relative;
  overflow: hidden;
}

.loading-sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: shimmer 1.4s infinite;
}

.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 0.84rem;
}

.data-freshness {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: #60a5fa;
}

.methodology {
  margin-top: 0;
}

.methodology-body {
  line-height: 1.65;
  color: var(--muted);
}

.methodology-body p {
  margin: 0 0 14px;
}

.methodology-body strong {
  color: var(--ink);
}

.method-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.9rem;
}

.method-table th,
.method-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.method-table th {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.method-table td:nth-child(2) {
  font-weight: 700;
  white-space: nowrap;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

:root {
  --bg: #060608;
  --bg-deep: #0e0e12;
  --card: rgba(14, 14, 18, 0.94);
  --card-strong: rgba(17, 17, 23, 0.98);
  --line: #1c1c24;
  --line-strong: #2a2a36;
  --ink: #eeeef0;
  --muted: #b0b0b8;
  --wine: #60a5fa;
  --wine-deep: #2563eb;
  --sage: #4ade80;
  --sage-soft: rgba(74, 222, 128, 0.12);
  --amber: #d6b066;
  --amber-soft: rgba(214, 176, 102, 0.12);
  --rust: #fb7185;
  --rust-soft: rgba(251, 113, 133, 0.12);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
  --font-display: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

body {
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(96, 165, 250, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #060608 0%, #09090d 44%, #060608 100%);
}

body::before {
  background: rgba(96, 165, 250, 0.08);
}

body::after {
  background: rgba(56, 189, 248, 0.06);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-weight: 800;
}

h1 {
  max-width: 10ch;
}

.eyebrow {
  color: #93c5fd;
  letter-spacing: 0.16em;
}

.panel,
.stat-card,
.pick-card,
.country-card,
.family-card,
.offer-variant {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.deal-row td {
  border-color: var(--line);
}

.panel {
  background: linear-gradient(180deg, rgba(14, 14, 18, 0.98), rgba(11, 11, 15, 0.98));
  backdrop-filter: blur(14px);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button:hover,
.link-chip:hover,
.quick-filter-button:hover,
.country-jump:hover,
.region-pill:hover {
  border-color: rgba(96, 165, 250, 0.3);
}

.ghost-button[hidden] {
  display: none;
}

.map-stage {
  min-height: 440px;
  background: #060608;
  border-color: var(--line);
}

#originMap {
  position: relative;
  width: 100%;
  height: 440px;
  min-height: 440px;
}

.map-selection {
  background: linear-gradient(180deg, rgba(14, 14, 18, 0.98), rgba(11, 11, 15, 0.98));
  border-color: var(--line);
  color: var(--muted);
}

.map-selection strong,
.country-spotlight strong {
  color: var(--ink);
}

.stat-card {
  background: linear-gradient(180deg, rgba(19, 19, 25, 0.98), rgba(13, 13, 18, 0.98));
}

.pick-card {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(19, 19, 25, 0.98), rgba(13, 13, 18, 0.98));
}

.pick-head {
  display: grid;
  gap: 8px;
}

.pick-card-top,
.pick-price-row,
.map-selection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pick-price-row {
  align-items: center;
}

.pick-price {
  display: inline-flex;
  align-items: center;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.rating-badge {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  width: 82px;
  min-width: 82px;
  height: 82px;
  padding: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.18), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(96, 165, 250, 0.22);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.rating-badge.is-empty {
  opacity: 0.7;
}

.rating-value {
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1;
}

.rating-caption {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.2;
}

.country-card {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.06), transparent 34%),
    linear-gradient(180deg, rgba(18, 18, 24, 0.98), rgba(12, 12, 16, 0.98));
}

.family-card {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(18, 18, 24, 0.98), rgba(12, 12, 16, 0.98));
}

.family-card[open] .family-summary {
  border-bottom: 1px solid var(--line);
}

.family-card[open] .toggle-closed,
.family-toggle .toggle-open {
  display: none;
}

.family-card[open] .family-toggle .toggle-open {
  display: inline;
}

.family-card[open] .family-toggle .toggle-closed {
  display: none;
}

.offer-variant {
  background: rgba(255, 255, 255, 0.03);
}

.country-spotlight {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.verdict-chip.ghost,
.pill.ghost,
.meta-chip,
.link-chip,
.toggle-pill,
.filter-chip,
.quick-filter-button,
.country-jump,
.region-pill {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-color: var(--line);
}

.quick-filter-button span,
.region-pill span,
.filter-chip button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.quick-filter-button.is-active,
.country-jump.is-active,
.region-pill.is-active {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.3);
  color: #bfdbfe;
}

.quick-filter-button.is-active span,
.region-pill.is-active span,
.filter-chip button:hover {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

.link-chip {
  border: 1px solid var(--line);
  min-height: 38px;
}

.link-chip.primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.16));
  border-color: rgba(96, 165, 250, 0.28);
  color: #dbeafe;
}

.link-chip.secondary {
  background: rgba(255, 255, 255, 0.04);
}

.link-chip.is-compact {
  min-height: 36px;
  padding: 0 12px;
}

.map-selection {
  display: grid;
  gap: 12px;
}

.map-selection h3 {
  font-size: 1.25rem;
}

.map-selection-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.family-aside {
  gap: 10px;
}

.style-lead {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.style-lead-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.style-lead-name {
  max-width: 22ch;
  font-size: 1rem;
  line-height: 1.35;
}

.family-toggle {
  min-height: 36px;
}

.offer-variant-metrics,
.offer-variant-links,
.wine-links {
  gap: 10px;
}

.field input,
.field select {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.field input::placeholder {
  color: #7f7a87;
}

.field select option {
  background: #0d1218;
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  outline-color: rgba(96, 165, 250, 0.22);
  border-color: rgba(96, 165, 250, 0.38);
}

.toggle-pill input {
  accent-color: var(--wine);
}

.filter-chip {
  color: var(--muted);
}

.results-meta,
.bar-copy span:last-child,
.field span,
.wine-subline,
.cell-subline,
.muted,
.panel-note,
.lede {
  color: var(--muted);
}

.bar-track,
.score-bar {
  background: rgba(255, 255, 255, 0.08);
}

.deal-table th {
  color: var(--muted);
}

.sort-button {
  color: var(--muted);
}

.sort-button.is-active {
  color: #bfdbfe;
}

.deal-row td {
  background: var(--card-strong);
}

.deal-row td,
.deal-row td:first-child,
.deal-row td:last-child {
  border-color: var(--line);
}

.empty-state {
  color: var(--muted);
}

.loading-sheen::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.leaflet-container {
  background: #06080d;
  font-family: var(--font-body);
}

.leaflet-control-zoom a {
  background: rgba(14, 18, 25, 0.96) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(17, 22, 30, 0.98);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.leaflet-popup-tip {
  background: rgba(17, 22, 30, 0.98);
}

.leaflet-control-attribution {
  background: rgba(7, 9, 12, 0.72) !important;
  color: #878093 !important;
}

.leaflet-control-attribution a {
  color: #93c5fd !important;
}

.leaflet-tooltip.country-tooltip {
  background: rgba(8, 11, 16, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  padding: 8px 12px;
}

.leaflet-tooltip-top.country-tooltip::before {
  border-top-color: rgba(8, 11, 16, 0.94);
}

.leaflet-tooltip-bottom.country-tooltip::before {
  border-bottom-color: rgba(8, 11, 16, 0.94);
}

@media (max-width: 1200px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .discovery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .country-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pick-grid,
  .controls-grid,
  .family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: calc(100% - 20px);
    padding-top: 20px;
    overflow-x: hidden;
  }

  .advanced-filter {
    display: none;
  }

  /* Compact quick filters: horizontal scroll strips instead of wrapping pills */
  .quick-filter-layout {
    gap: 8px;
    margin-top: 12px;
  }

  .quick-filter-block {
    gap: 6px;
  }

  .quick-filter-block .eyebrow {
    font-size: 0.6rem;
    margin-bottom: 0;
  }

  .quick-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
  }

  .quick-filter-row::-webkit-scrollbar {
    display: none;
  }

  .quick-filter-button,
  .country-jump,
  .region-pill {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .quick-filter-button span,
  .region-pill span {
    min-width: 20px;
    min-height: 20px;
    padding: 0 5px;
    font-size: 0.7rem;
  }

  /* Tighten filter drawer */
  .filter-drawer {
    margin-top: 10px;
  }

  .filter-drawer-toggle {
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .filter-drawer-body {
    padding: 0 14px 14px;
  }

  /* Compact toggle row */
  .toggle-row {
    gap: 6px;
  }

  .toggle-pill {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  /* Tighten panel heading */
  .table-panel {
    padding: 14px;
  }

  .table-panel .panel-heading h2 {
    font-size: 1.2rem;
  }

  .table-panel .eyebrow {
    font-size: 0.6rem;
  }

  .results-meta {
    font-size: 0.78rem;
  }

  .masthead,
  .panel-heading,
  .split-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    max-width: 11ch;
  }

  .discovery-grid,
  .pick-grid,
  .controls-grid,
  .stat-grid,
  .quick-filter-layout,
  .country-grid,
  .family-grid {
    grid-template-columns: 1fr;
  }

  .discovery-hub .eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
  }

  .discovery-card {
    padding: 20px 14px 18px;
  }

  .panel,
  .pick-card,
  .country-card,
  .family-card {
    overflow: hidden;
    word-break: break-word;
  }

  .pick-card h3 {
    font-size: 1.1rem;
  }

  .pick-actions,
  .wine-links,
  .offer-variant-links {
    flex-wrap: wrap;
  }

  .link-chip {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  .map-stage {
    min-height: 320px;
  }

  #originMap {
    height: 320px;
    min-height: 320px;
  }

  .family-summary,
  .country-card-head,
  .pick-card-top,
  .pick-price-row,
  .map-selection-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-selection-actions {
    width: 100%;
  }

  .family-summary {
    display: flex;
  }

  .family-aside {
    justify-items: start;
    text-align: left;
  }

  .style-lead {
    justify-items: start;
    text-align: left;
  }

  .map-overlay {
    position: static;
    padding: 12px 12px 0;
  }

  /* Mobile card layout for deal table */
  .deal-table {
    min-width: 0;
  }

  .deal-table thead {
    display: none;
  }

  .deal-table,
  .deal-table tbody {
    display: grid;
    gap: 16px;
  }

  .deal-row {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card-strong);
  }

  .deal-row td {
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 16px;
    background: transparent !important;
  }

  /* Wine name + buttons */
  .deal-row td:first-child {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--line) !important;
  }

  /* Notes */
  .deal-row td:nth-child(2) {
    padding: 10px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--line) !important;
  }

  /* Origin — hide on mobile */
  .deal-row td:nth-child(3) {
    display: none;
  }

  /* Prices + Gap — side by side */
  .deal-row td:nth-child(4),
  .deal-row td:nth-child(5) {
    display: inline-block;
    width: 50%;
    vertical-align: top;
    box-sizing: border-box;
  }

  /* Vivino + Score — side by side */
  .deal-row td:nth-child(6),
  .deal-row td:nth-child(7) {
    display: inline-block;
    width: 50%;
    vertical-align: top;
    box-sizing: border-box;
    border-top: 1px solid var(--line) !important;
  }

  /* Offer — full width footer */
  .deal-row td:last-child {
    border-top: 1px solid var(--line) !important;
    padding: 10px 16px;
  }

  /* Mobile cell labels */
  .deal-row td:nth-child(4)::before,
  .deal-row td:nth-child(5)::before,
  .deal-row td:nth-child(6)::before,
  .deal-row td:nth-child(7)::before,
  .deal-row td:last-child::before {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 4px;
  }

  .deal-row td:nth-child(4)::before { content: "Prices"; }
  .deal-row td:nth-child(5)::before { content: "Gap"; }
  .deal-row td:nth-child(6)::before { content: "Vivino"; }
  .deal-row td:nth-child(7)::before { content: "Score"; }
  .deal-row td:last-child::before { content: "Offer"; }

  .table-scroll {
    overflow: visible;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }
}
