/* Layout: a quiet cellar. White or deep-navy ground, Bodoni for names, mono for every number, one cobalt accent. */
:root {
  --bg: #FFFFFF;
  --surface: #F4F8FD;
  --fg: #0B1F3A;
  --muted: #5A6982;
  --line: #D6E2F1;
  --accent: #1F45A8;
  --on-accent: #FFFFFF;
  --land: #CBD9EC;
  --ok: #1D6B4F;
  --pending: #8A6A1F;
  --fav: #B88200;

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --data: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --s1: .25rem; --s2: .5rem; --s3: 1rem; --s4: 1.5rem; --s5: 2.5rem; --s6: 4rem;
  --wrap: 72rem;
  --measure: 65ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07162B; --surface: #0E2342; --fg: #E9F2FB; --muted: #9FB3CF; --line: #1E3658;
    --accent: #7FAAF0; --on-accent: #07162B; --land: #1F3A63; --ok: #6FCFA6; --pending: #E2C27A; --fav: #F2C14E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07162B; --surface: #0E2342; --fg: #E9F2FB; --muted: #9FB3CF; --line: #1E3658;
  --accent: #7FAAF0; --on-accent: #07162B; --land: #1F3A63; --ok: #6FCFA6; --pending: #E2C27A; --fav: #F2C14E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--body);
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0; }
.mono { font-family: var(--data); font-variant-numeric: tabular-nums; }
.eyebrow {
  font: 500 .75rem/1.3 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.prose { max-width: var(--measure); display: grid; gap: var(--s3); }
.prose h2 { margin-top: var(--s4); font-size: 1.7rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: var(--s2); }

/* Bands and wrappers carry the side gutter */
.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.band { padding-block: var(--s6); }
.band + .band { border-top: 1px solid var(--line); }
.band.tint { background: var(--surface); border-top: 0; }
.stack { display: grid; gap: var(--s4); }
.stack-sm { display: grid; gap: var(--s2); }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-block: var(--s3); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--fg); }
.brand svg { width: 22px; height: 30px; flex: none; }
.brand span { font-family: var(--display); font-size: 1.05rem; letter-spacing: .32em; font-weight: 500; }
.nav { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.nav a { color: var(--fg); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.15rem; border-radius: 2px;
  font: 600 .95rem/1 var(--body); text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
}
.btn.ghost { background: transparent; color: var(--accent); }
.nav .btn { color: var(--on-accent); padding: .55rem .9rem; }
.btn-row { display: flex; gap: var(--s3); flex-wrap: wrap; }

/* Pills and badges */
.pill {
  display: inline-flex; align-items: center; gap: .35rem; font: 500 .72rem/1 var(--body);
  letter-spacing: .08em; text-transform: uppercase; padding: .35rem .55rem; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: currentColor; }
.pill.pending { color: var(--pending); border-color: currentColor; }
.pill.draft { color: var(--pending); border-color: currentColor; }

/* Home hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s5); align-items: center; padding-block: var(--s5); }
.hero-copy { display: grid; gap: var(--s4); min-width: 0; }
.hero h1 em { font-style: italic; color: var(--accent); }
/* One line at every width: the headline is about 11.2 times as wide as its font size in Bodoni Moda,
   so the size tracks the column width with a 10% margin. */
.hero h1 { white-space: nowrap; font-size: clamp(1.3rem, calc(4.1vw - 3px), 2.75rem); }
@media (max-width: 860px) { .hero h1 { font-size: clamp(1.3rem, calc(8vw - 3px), 3.4rem); } }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }

.facts-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font: 400 .9rem/1.4 var(--data); color: var(--muted); }
.facts-line b { color: var(--fg); font-weight: 500; }

/* Globe */
.globe { position: relative; width: 100%; max-width: 560px; margin-inline: auto; aspect-ratio: 1; touch-action: none; cursor: grab; }
.globe:active { cursor: grabbing; }
.globe svg { width: 100%; height: 100%; display: block; }
.g-sphere { fill: var(--surface); stroke: var(--line); }
.g-grat { fill: none; stroke: var(--line); stroke-width: .6; }
.g-land { fill: var(--land); stroke: none; }
/* Map dot radius, outline width and name size are set in screen pixels by globe.js, growing with zoom. */
.g-dot { fill: var(--accent); stroke: var(--bg); }
.g-dot.on { stroke: var(--fg); }
.globe svg.is-aim { cursor: pointer; }
.globe svg { overflow: hidden; border-radius: 4px; }
.globe-zoom { position: absolute; top: 2%; right: 0; display: grid; gap: 4px; }
.globe-zoom button {
  font: 500 1.1rem/1 var(--body); width: 2.2rem; height: 2.2rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  cursor: pointer; border-radius: 2px;
}
.globe-zoom button.reset { font-size: .7rem; letter-spacing: .04em; }
.globe-zoom button:hover { color: var(--accent); border-color: var(--accent); }
.globe-card {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); width: min(92%, 22rem);
  background: var(--bg); border: 1px solid var(--line); padding: var(--s3); display: grid; gap: var(--s1);
  box-shadow: 0 6px 24px rgba(7, 22, 43, .12);
}
.globe-card[hidden] { display: none; }
.globe-card h3 { font-size: 1.25rem; }
.globe-card .meta { color: var(--muted); font-size: .9rem; }
.globe-bar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: center; align-items: center; color: var(--muted); font-size: .9rem; }
.switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; color: var(--fg); font-weight: 500; }
.switch input { appearance: none; -webkit-appearance: none; width: 2.4rem; height: 1.35rem; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: .18rem; left: .18rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--bg); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(1.05rem); }
.globe-hint { text-align: center; color: var(--muted); font-size: .85rem; }
.region li[hidden] { display: none; }
.socials { display: flex; flex-wrap: wrap; gap: var(--s2); }
.socials a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 2px; text-decoration: none; color: var(--fg); font-size: .9rem; }
.socials a:hover { border-color: var(--accent); color: var(--accent); }
.socials svg { width: 16px; height: 16px; flex: none; }
.news { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: var(--s4); align-items: end; }
@media (max-width: 760px) { .news { grid-template-columns: 1fr; } }
.news-form { display: flex; gap: var(--s2); flex-wrap: wrap; }
.news-form input { flex: 1 1 14rem; min-width: 0; font: 400 1rem var(--body); padding: .7rem .8rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 2px; }
.news-msg { font-size: .9rem; color: var(--muted); grid-column: 1 / -1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* TDS spectrum */
.spectrum { overflow-x: auto; }
.spectrum svg { min-width: 640px; width: 100%; height: auto; display: block; }
.sp-axis { stroke: var(--line); stroke-width: 1; }
.sp-band { fill: var(--surface); }
.sp-band.alt { fill: var(--land); opacity: .45; }
.sp-tick { fill: var(--muted); font: 400 11px var(--data); }
.sp-class { fill: var(--muted); font: 500 10px var(--body); letter-spacing: .12em; text-transform: uppercase; }
.sp-dot { fill: var(--accent); }
.sp-lab { fill: var(--fg); font: 500 12px var(--body); }
.sp-val { fill: var(--muted); font: 400 10.5px var(--data); }
.sp-lead { stroke: var(--muted); stroke-width: .7; }

/* Cards */
.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 900px) { .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-cards { grid-template-columns: 1fr; } }
.wcard {
  display: grid; gap: var(--s2); align-content: start; padding: var(--s4); text-decoration: none; color: var(--fg);
  border-top: 2px solid var(--fg); background: var(--bg); min-width: 0;
}
.band.tint .wcard { background: var(--bg); }
.wcard:hover h3 { color: var(--accent); }
.wcard .where { color: var(--muted); font-size: .9rem; }
.wcard .readout { display: flex; gap: var(--s3); font: 400 .85rem/1.3 var(--data); color: var(--muted); flex-wrap: wrap; }
.wcard .readout b { color: var(--fg); font-weight: 500; }
.wcard p { font-size: .95rem; }

.topic-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.topic {
  display: grid; gap: var(--s2); padding: var(--s4) var(--s3) var(--s4) 0; text-decoration: none; color: var(--fg);
  border-bottom: 1px solid var(--line); min-width: 0;
}
.topic h3 { font-size: 1.2rem; }
.topic .pill { justify-self: start; }
@media (max-width: 820px) { .topic-list { grid-template-columns: 1fr; } }
.topic p { color: var(--muted); font-size: .95rem; }
.topic:hover h3 { color: var(--accent); }
.topic.planned { color: var(--muted); }
/* Learn page resources: one organization per line at 1.15 line spacing, in dark navy (light text in dark mode). */
.resources { padding-top: var(--s4); border-top: 1px solid var(--line); }
.res-list { list-style: none; margin: 0; padding: 0; line-height: 1.15; }
.res-list a { display: block; padding-block: .2rem; color: var(--fg); text-decoration: none; }
.res-name { font-weight: 600; }
.res-sep { color: var(--muted); }
.res-url { overflow-wrap: anywhere; }
.res-list a:hover .res-name, .res-list a:hover .res-url, .res-list a:focus-visible .res-name { text-decoration: underline; }

/* Report CTA */
.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: center; }
@media (max-width: 720px) { .cta { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.site-footer .wrap { padding-block: var(--s5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); }
.site-footer a { color: var(--muted); }

/* Water page */
.crumbs { font-size: .88rem; color: var(--muted); display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.w-head { display: grid; gap: var(--s3); }
.w-head .sub { font-size: 1.1rem; color: var(--muted); }
.w-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: var(--s5); align-items: start; }
@media (max-width: 900px) { .w-layout { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--s3) var(--s4); margin: 0; }
.facts div { display: grid; gap: .15rem; min-width: 0; border-top: 1px solid var(--line); padding-top: var(--s2); }
.facts dt { font: 500 .72rem/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* The bottle-label analysis panel */
.label {
  border: 1.5px solid var(--fg); padding: var(--s4); display: grid; gap: var(--s3); background: var(--bg);
}
.label-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); border-bottom: 1px solid var(--fg); padding-bottom: var(--s2); flex-wrap: wrap; }
.label-head h2 { font-size: 1.15rem; letter-spacing: .18em; text-transform: uppercase; font-family: var(--body); font-weight: 600; }
.tds-big { display: grid; gap: .2rem; }
.tds-big .n { font: 500 2.6rem/1 var(--data); font-variant-numeric: tabular-nums; }
.tds-big .u { color: var(--muted); font-size: .85rem; }
.ions { width: 100%; border-collapse: collapse; font: 400 .9rem/1.3 var(--data); font-variant-numeric: tabular-nums; }
.ions th { text-align: left; font: 500 .9rem/1.3 var(--body); padding: .3rem 0; white-space: nowrap; }
.ions th small { color: var(--muted); font-family: var(--data); font-weight: 400; margin-left: .3rem; }
.ions td { padding: .3rem 0; }
.ions td.v { text-align: right; width: 5.5rem; padding-right: var(--s2); }
.ions td.bar { width: 45%; }
.ions tr + tr { border-top: 1px dotted var(--line); }
.ions .b { height: 6px; background: var(--accent); min-width: 2px; }
.label-foot { font-size: .8rem; color: var(--muted); display: grid; gap: .3rem; }
.derived { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); border-top: 1px solid var(--fg); padding-top: var(--s3); }
.derived div { display: grid; gap: .1rem; min-width: 0; }
.derived span { font: 500 .68rem/1.3 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.derived b { font: 500 1rem/1.3 var(--data); }
.scale { display: grid; gap: .35rem; }
.scale-track { position: relative; height: 10px; display: grid; grid-template-columns: 21.2% 30.3% 14.4% 34.1%; }
.scale-track i { display: block; height: 100%; background: var(--surface); border-right: 1px solid var(--bg); }
.scale-track i:nth-child(2n) { background: var(--land); }
.scale-mark { position: absolute; top: -4px; width: 3px; height: 18px; background: var(--fg); transform: translateX(-50%); }
.scale-labels { display: grid; grid-template-columns: 21.2% 30.3% 14.4% 34.1%; font: 500 .62rem/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pending-box { border: 1.5px dashed var(--line); padding: var(--s4); display: grid; gap: var(--s2); color: var(--muted); }
.pending-box h2 { font-size: 1.15rem; letter-spacing: .18em; text-transform: uppercase; font-family: var(--body); font-weight: 600; color: var(--fg); }
.note { border-left: 2px solid var(--accent); padding-left: var(--s3); font-family: var(--display); font-size: 1.2rem; font-style: italic; max-width: var(--measure); }
.coords { font: 400 .9rem var(--data); color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }

/* Library */
.controls { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: end; }
.field { display: grid; gap: .3rem; min-width: 0; }
.field label { font: 500 .72rem/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field input[type="search"], .field input[type="email"], .field select {
  font: 400 1rem var(--body); padding: .6rem .7rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 2px; min-width: 0;
}
.field input[type="search"] { width: min(22rem, 100%); }
.check { display: inline-flex; gap: .5rem; align-items: center; font-size: .95rem; padding-bottom: .6rem; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--fg); }
table.lib { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 720px; }
table.lib th { text-align: left; font: 500 .72rem/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .7rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.lib th button { all: unset; cursor: pointer; }
table.lib th button:focus-visible { outline: 2px solid var(--accent); }
table.lib td { padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.lib td.n { font-family: var(--data); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.lib th.n { text-align: right; }
table.lib td a { font-family: var(--display); font-size: 1.1rem; text-decoration: none; }
table.lib td .muted { color: var(--muted); }
.count { color: var(--muted); font: 400 .9rem var(--data); }

/* Map page list */
.regions { columns: 16rem; column-gap: var(--s5); }
.region { break-inside: avoid; display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.region h3 { font-size: 1.15rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
.region ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.region button { all: unset; cursor: pointer; color: var(--accent); }
.region button:hover { text-decoration: underline; }
.region li small { color: var(--muted); }

/* Report */
.form { display: grid; gap: var(--s3); max-width: 30rem; }
.form .field input { width: 100%; }
.form-msg { font-size: .95rem; color: var(--muted); }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.toc li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: var(--s3); padding-block: var(--s3); border-bottom: 1px solid var(--line); }
.toc li span { font: 400 .9rem var(--data); color: var(--muted); padding-top: .2rem; }
.toc li b { font-family: var(--display); font-weight: 500; font-size: 1.15rem; display: block; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.editor-note { background: var(--surface); padding: var(--s3); font-size: .9rem; color: var(--muted); max-width: var(--measure); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.region[hidden] { display: none; }

/* Globe: detail layer, selected label, preview panel */
.g-border { fill: none; stroke: var(--bg); stroke-width: .8; }
.g-label { font: 600 13px var(--body); fill: var(--fg); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.g-name { font-weight: 500; pointer-events: auto; cursor: pointer; }
.g-name.is-sel { font-weight: 700; }
.g-name:hover { fill: var(--accent); }
.gpanel { border-top: 2px solid var(--fg); padding-top: var(--s3); display: grid; gap: var(--s2); min-height: 9rem; align-content: start; }
.gpanel h3 { font-size: 1.6rem; }
.gp-place { color: var(--muted); }
.gp-blurb { max-width: var(--measure); }
.gp-hint { color: var(--muted); }
.gp-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.gp-nearby { display: flex; flex-wrap: wrap; gap: var(--s2); }
.gp-nearby button {
  font: 500 .88rem/1.2 var(--body); padding: .45rem .7rem; border: 1px solid var(--line); background: var(--bg); color: var(--accent);
  border-radius: 2px; cursor: pointer;
}
.gp-nearby button:hover { border-color: var(--accent); }

/* Water page: written description */
.about { display: grid; gap: var(--s3); max-width: var(--measure); }
.about h2 { font-size: 1.4rem; }
.about p { font-size: 1.05rem; }

/* Water Palate charts */
.filter-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.pchart { position: relative; overflow-x: auto; }
.pchart svg { display: block; width: 100%; min-width: 680px; height: auto; }
.pz0 { fill: var(--surface); }
.pz1 { fill: var(--bg); }
.zname { font: italic 500 21px var(--display); fill: var(--muted); }
.pgrid { stroke: var(--line); stroke-width: 1; }
.psplit { stroke: var(--muted); stroke-width: 1; opacity: .55; }
.paxis { stroke: var(--muted); stroke-width: 1; }
.ptick { font: 400 12px var(--data); fill: var(--muted); font-variant-numeric: tabular-nums; }
.pend { font: 500 11px var(--body); letter-spacing: .1em; text-transform: uppercase; fill: var(--muted); }
.plab { font: 500 12px var(--body); fill: var(--fg); }
.plab-a { cursor: pointer; }
.plab-a:hover .plab { fill: var(--accent); text-decoration: underline; }
.pmark { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.phit { fill: transparent; }
.pdot { cursor: pointer; }
.pdot:hover .pmark, .pdot:focus .pmark { stroke: var(--fg); stroke-width: 2.5; }
.pdot:focus { outline: none; }
.pdot:focus-visible .pmark { stroke: var(--fg); stroke-width: 3; }
.us-only .pdot[data-us="0"], .us-only .plab[data-us="0"], .us-only tr[data-us="0"] { display: none; }
.ptip {
  position: absolute; z-index: 3; pointer-events: none; background: var(--bg); border: 1px solid var(--line);
  padding: .5rem .7rem; display: grid; gap: .15rem; box-shadow: 0 6px 20px rgba(7, 22, 43, .14); max-width: 18rem;
}
.ptip b { font: 600 .9rem/1.3 var(--data); color: var(--fg); }
.ptip span { font-size: .85rem; color: var(--muted); }
.zones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin: 0; padding: 0; list-style: none; }
@media (max-width: 760px) { .zones { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.zones li { display: grid; gap: .2rem; border-top: 1px solid var(--line); padding-top: var(--s2); min-width: 0; }
.zones b { font: italic 500 1.15rem var(--display); }
.zones span { color: var(--muted); font-size: .92rem; }
.chart-note { color: var(--muted); font-size: .9rem; max-width: var(--measure); }
details.table-view summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.table-view[open] summary { margin-bottom: var(--s3); }
.ptitle { font: 600 12px var(--body); fill: var(--fg); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.news-form button[disabled] { opacity: .6; cursor: wait; }
.site-footer .credit { flex-basis: 100%; font-size: .78rem; letter-spacing: .02em; }

/* Where to buy panel */
dialog.shop {
  border: 1px solid var(--line); padding: 0; width: min(34rem, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  background: var(--bg); color: var(--fg); border-radius: 4px; box-shadow: 0 18px 60px rgba(7, 22, 43, .28);
}
dialog.shop::backdrop { background: rgba(7, 22, 43, .45); }
.shop-inner { padding: var(--s4); display: grid; gap: var(--s3); }
.shop-inner h2 { font-size: 1.7rem; }
.shop-sub, .shop-note { color: var(--muted); font-size: .92rem; }
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.shop-list li { border-bottom: 1px solid var(--line); }
.shop-list a { display: flex; align-items: center; gap: var(--s3); padding: .8rem .2rem; text-decoration: none; color: var(--fg); }
.shop-list a:hover .shop-go, .shop-list a:focus-visible .shop-go { color: var(--accent); }
.shop-txt { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.shop-txt small { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.shop-go { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* My Cellar controls */
.cellar-bar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.tog {
  font: 500 .92rem/1 var(--body); padding: .6rem .85rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  border-radius: 999px; cursor: pointer;
}
.tog:hover { border-color: var(--accent); }
.tog[data-k="fav"][aria-pressed="true"] { border-color: var(--fav); color: var(--fg); box-shadow: inset 0 0 0 1px var(--fav); }
.tog[data-k="tried"][aria-pressed="true"] { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
details.mynote { max-width: 34rem; }
details.mynote summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.mynote textarea {
  width: 100%; margin-top: var(--s2); font: 400 1rem/1.5 var(--body); padding: .7rem .8rem; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); border-radius: 2px; resize: vertical;
}
.hint { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.hello { border: 1px solid var(--line); background: var(--surface); padding: var(--s3); display: grid; gap: var(--s2); max-width: 32rem; }
.my-palate { border-left: 2px solid var(--fav); padding-left: var(--s3); display: grid; gap: .3rem; max-width: var(--measure); }
.pill.fav { color: var(--fg); border-color: var(--fav); }

/* Globe and palate markers */
.g-marks { pointer-events: none; }
.mk-ring, .mk-star { vector-effect: non-scaling-stroke; }
.mk-ring { fill: none; stroke: var(--ok); stroke-width: 2.5; display: none; }
.mk.is-tried .mk-ring { display: inline; }
.mk-star { fill: var(--fav); stroke: var(--bg); stroke-width: 1.2; display: none; }
.mk.is-fav .mk-star { display: inline; }
.pring, .pstar { display: none; pointer-events: none; }
.pring { fill: none; stroke: var(--ok); stroke-width: 2.5; }
.pstar { fill: var(--fav); stroke: var(--bg); stroke-width: 1.2; }
.pdot.is-tried .pring { display: inline; }
.pdot.is-fav .pstar { display: inline; }

/* Palate quiz */
.quiz-card { border: 1px solid var(--line); padding: var(--s4); display: grid; gap: var(--s3); max-width: 40rem; background: var(--bg); }
.quiz-card h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.quiz-progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.quiz-progress span { display: block; height: 100%; background: var(--accent); }
.quiz-opts { display: grid; gap: var(--s2); }
.quiz-opt {
  text-align: left; font: 500 1.05rem/1.3 var(--body); padding: .95rem 1rem; border: 1px solid var(--line); background: var(--bg);
  color: var(--fg); border-radius: 4px; cursor: pointer;
}
.quiz-opt:hover, .quiz-opt:focus-visible { border-color: var(--accent); color: var(--accent); }
.quiz-foot { display: flex; gap: var(--s4); flex-wrap: wrap; justify-content: center; padding-top: var(--s2); border-top: 1px solid var(--line); }
.quiz-skip { all: unset; cursor: pointer; color: var(--muted); font-size: .9rem; text-decoration: underline; text-underline-offset: .18em; justify-self: center; }
.quiz-skip:hover, .quiz-skip:focus-visible { color: var(--accent); }
.quiz-zone { font-family: var(--display); font-size: 1.15rem; font-style: italic; }
.quiz-matches { display: grid; gap: var(--s3); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .quiz-matches { grid-template-columns: 1fr; } }
.quiz-match { border-top: 2px solid var(--fg); padding-top: var(--s2); display: grid; gap: var(--s2); align-content: start; min-width: 0; }
.quiz-match h3 { font-size: 1.2rem; }
.quiz-match h3 a { text-decoration: none; }
.quiz-match .mono { font-size: .85rem; color: var(--muted); }
.quiz-copy { width: 100%; font: 400 .9rem var(--data); padding: .6rem; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }

/* My Cellar page */
.ccard { border-top: 2px solid var(--fg); padding: var(--s3) 0; display: grid; gap: var(--s2); align-content: start; min-width: 0; }
.ccard h3 a { text-decoration: none; }
.ccard .where { color: var(--muted); font-size: .9rem; }
.cnote { white-space: pre-wrap; border-left: 2px solid var(--line); padding-left: var(--s2); font-size: .95rem; }
.empty { border: 1px dashed var(--line); padding: var(--s4); }
.app-line { flex-basis: 100%; font-size: .85rem; }

/* Account card on My Cellar */
.acct { border: 1px solid var(--line); background: var(--surface); padding: var(--s4); display: grid; gap: var(--s3); max-width: 40rem; }
.acct h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.acct-form { display: grid; gap: var(--s3); }
.acct-form .field input { width: min(24rem, 100%); }
.acct-form #acct-code { font: 500 1.4rem var(--data); letter-spacing: .3em; width: 10ch; }
.acct-msg { color: var(--muted); font-size: .92rem; min-height: 1.2em; }
.acct-confirm { border: 1px solid var(--line); background: var(--bg); padding: var(--s3); display: grid; gap: var(--s2); }

/* "Available in" container icons: logo-style line drawings with italic labels */
.containers { display: grid; gap: var(--s2); }
.pack-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.pack-list li { display: grid; justify-items: center; gap: .3rem; min-width: 3.5rem; }
.pack-list svg { width: 42px; height: 58px; overflow: visible; }
.pk-line { fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pk-water { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.pack-list span { font: italic 500 1.05rem/1.1 var(--display); color: var(--fg); white-space: nowrap; }
/* Smaller set in the map preview panel. */
.gpanel .pack-list { gap: var(--s2) var(--s4); }
.gpanel .pack-list li { min-width: 2.75rem; }
.gpanel .pack-list svg { width: 30px; height: 41px; }
.gpanel .pack-list span { font-size: .92rem; }

/* ---------- Water Passport (My Cellar) ---------- */
.cellar-sec { padding-top: var(--s4); border-top: 1px solid var(--line); }
.list-head { font-size: 1.15rem; margin-top: var(--s3); }
.cstats { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); }
.cstats a { display: grid; text-decoration: none; color: var(--fg); }
.cstats b { font: 500 1.9rem/1.1 var(--display); }
.cstats span { color: var(--muted); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; }
.cstats a:hover b { color: var(--accent); }
.lean { display: grid; gap: .45rem; max-width: 34rem; }
.lean-row { display: grid; grid-template-columns: minmax(8.5rem, auto) 1fr 3rem; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); }
.lean-row .mono { text-align: right; color: var(--fg); }
.lean-bar { display: block; height: .5rem; border-radius: 99px; background: var(--line); overflow: hidden; }
.lean-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--s3) var(--s3); }
.badge { position: relative; display: grid; justify-items: center; text-align: center; gap: .25rem; padding: var(--s2) .25rem; }
.badge svg { width: 56px; height: 56px; overflow: visible; }
.bd-ring { fill: var(--surface); stroke: var(--accent); stroke-width: 1.4; }
.bd-num { font: italic 600 15px var(--display); fill: var(--fg); text-anchor: middle; }
.bd-small { font: italic 600 9px var(--display); fill: var(--fg); text-anchor: middle; }
.bd-name { font: italic 500 1.05rem/1.15 var(--display); color: var(--fg); }
.bd-how { font-size: .76rem; line-height: 1.3; color: var(--muted); }
.badge.locked svg { opacity: .38; }
.badge.locked .bd-ring { fill: none; stroke: var(--muted); stroke-dasharray: 3 3; }
.badge.locked .bd-name { color: var(--muted); }
.bd-new { position: absolute; top: .1rem; right: .4rem; font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--on-accent, #fff); background: var(--accent); border-radius: 99px; padding: .1rem .45rem; }
.bd-banner { border-left: 3px solid var(--accent); padding: .35rem 0 .35rem .75rem; font-weight: 500; }
.stamps { list-style: none; margin: 0; padding: .4rem 0; display: flex; flex-wrap: wrap; gap: var(--s3); }
.stamp { display: grid; gap: .1rem; text-align: center; padding: .55rem .8rem .5rem; border: 1.5px solid var(--accent); border-radius: 6px;
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px var(--accent); background: var(--bg); color: var(--accent);
  font: 600 .74rem/1.15 var(--body); letter-spacing: .1em; text-transform: uppercase; transform: rotate(var(--r, 0deg)); }
.stamp small { font: italic 500 .9rem/1.1 var(--display); letter-spacing: 0; text-transform: none; color: var(--fg); }
.flight-mini .lean-bar { max-width: 14rem; }
.flight-mini.done h3 a::after { content: " ✓"; color: var(--ok); }

/* ---------- Tasting challenges ---------- */
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; max-width: var(--measure); }
.flight { border: 1px solid var(--line); border-radius: 8px; padding: var(--s3) var(--s4); display: grid; gap: var(--s2); }
.flight.done { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.fl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.fl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.fl-row { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .5rem; border-top: 1px solid var(--line); padding-top: var(--s2); }
.fl-num { font: italic 600 1.6rem/1 var(--display); color: var(--accent); }
.fl-body { display: grid; gap: .45rem; min-width: 0; }
.fl-body h3 { font-size: 1.2rem; }
.fl-body h3 a { text-decoration: none; }
.fl-meta { color: var(--muted); font-size: .88rem; }
.fl-reveal { font-size: .85rem; color: var(--muted); font-style: italic; }
.fl-reveal.shown { font-family: var(--data); font-style: normal; color: var(--fg); }
.fl-note { width: 100%; box-sizing: border-box; font: inherit; font-size: .95rem; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); resize: vertical; }
.fl-note:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fl-done { font-weight: 500; color: var(--fg); }
/* Learn article sources */
.prose ol.sources { font-size: .82rem; color: var(--muted); padding-left: 1.4rem; }
.prose ol.sources a { overflow-wrap: anywhere; }

/* Ratings out of 10 (water pages, map preview, tasting challenges) */
.rate { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.rate-label { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* Ten equal circles that shrink to fit narrow columns (a tasting challenge on a phone) and stop growing at 28px. */
.rate-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; width: 100%; max-width: 307px; }
.rate-n { width: 100%; aspect-ratio: 1; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--bg);
  color: var(--fg); font: 500 .78rem/1 var(--data); cursor: pointer; }
.fl-row > .rate { grid-column: 1 / -1; }
@media (max-width: 420px) { .flight { padding: var(--s3) .75rem; } }
.rate-n:hover { border-color: var(--accent); }
.rate-n.lit { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rate-n:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rate-out { font: 600 .9rem var(--data); color: var(--fg); }
.pill.rate-pill { font-family: var(--data); color: var(--fg); border-color: var(--accent); }
.top-rated { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; }
.top-rated .eyebrow { margin-right: .4rem; }
.glass-only .pdot[data-glass="0"], .glass-only .plab[data-glass="0"], .glass-only tr[data-glass="0"] { display: none; }

/* Glass bottle viewer (draft) */
.bottle-view { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s4); align-items: center; }
@media (max-width: 820px) { .bottle-view { grid-template-columns: 1fr; } }
.bottle-stage { position: relative; height: min(68vh, 560px); min-height: 340px; border-radius: 10px; overflow: hidden; color-scheme: dark;
  background: #04070e; touch-action: none; cursor: grab; }
.bottle-stage.is-dragging { cursor: grabbing; }
.bottle-stage canvas { display: block; width: 100%; height: 100%; outline: none; }
.bottle-stage canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.bottle-stage.no-3d { display: grid; place-items: center; padding: var(--s4); color: var(--muted); text-align: center; }
.bottle-pick { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tog[data-bottle][aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bottle-caption { display: grid; gap: .2rem; }
.bottle-caption b { font: italic 500 1.7rem/1.1 var(--display); }
.bottle-caption span { color: var(--muted); }
.draft-note { border-left: 3px solid var(--pending); padding-left: .75rem; color: var(--muted); font-size: .9rem; }
.preview-drafts { font-size: .85rem; color: var(--muted); padding-top: var(--s2); }
@media (max-width: 820px) { .bottle-stage { height: min(60vh, 480px); } }

/* Brand logo on a water page (website only): small, on a white chip so dark logos read in dark mode too */
.brand-logo { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: .5rem 0 .25rem; }
.brand-logo img { height: 2.4rem; width: auto; max-width: 11rem; object-fit: contain; background: #fff; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 4px; }
.brand-logo figcaption { max-width: 26rem; font-size: .72rem; line-height: 1.35; color: var(--muted); }
