/* NI Beaches — one light theme, white ground, cool-neutral tints.
   Design tokens follow the climatinfo house style (oklch, low chroma). */
:root {
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  /* Type scale. Fluid from --step-1 up so the big display sizes track the
     viewport; the small end stays fixed so dense data doesn't shrink. */
  --step--2: .72rem;
  --step--1: .82rem;
  --step-0:  1rem;
  --step-1:  clamp(1.05rem, 1rem + .25vw, 1.18rem);
  --step-2:  clamp(1.2rem, 1.1rem + .5vw, 1.45rem);
  --step-3:  clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  --step-4:  clamp(2rem, 1.5rem + 2.4vw, 3.1rem);

  --bg: oklch(100% 0 0);
  --bg-sunken: oklch(97% 0.006 250);
  --bg-tint: oklch(98.5% 0.008 235);
  --panel: oklch(100% 0 0);
  --text: oklch(24% 0.02 260);
  --muted: oklch(46% 0.018 260);
  --border: oklch(90% 0.008 250);
  --border-strong: oklch(84% 0.012 250);
  --accent: oklch(52% 0.13 235);
  --accent-ink: oklch(34% 0.10 235);
  --accent-soft: oklch(95% 0.03 235);
  --brand-blue: oklch(43% 0.11 245); /* home hero band + beach-page top bar */
  --brand-deep: oklch(31% 0.09 250);
  --brand-teal: oklch(52% 0.09 208);

  --good-bg: oklch(95% 0.04 155); --good-ink: oklch(38% 0.11 155); --good-dot: oklch(62% 0.14 155);
  --ok-bg:   oklch(95% 0.035 195); --ok-ink:  oklch(37% 0.09 210); --ok-dot:  oklch(62% 0.11 210);
  --warn-bg: oklch(95% 0.05 90);  --warn-ink: oklch(40% 0.11 75);  --warn-dot: oklch(72% 0.14 85);
  --bad-bg:  oklch(95% 0.045 25); --bad-ink: oklch(40% 0.15 25);   --bad-dot: oklch(62% 0.18 25);
  --info-bg: oklch(95% 0.02 250); --info-ink: oklch(40% 0.02 260);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px oklch(20% 0 0 / .05);
  --shadow: 0 1px 2px oklch(20% 0 0 / .05), 0 6px 18px oklch(20% 0 0 / .05);
  --shadow-lg: 0 2px 4px oklch(20% 0 0 / .05), 0 14px 40px oklch(25% 0.03 250 / .12);

  --bar-h: 57px; /* sticky top bar — anchors scroll-margin and the rail top */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }

/* one visible focus ring for every interactive element, not just search */
:where(a, button, summary, input, select, details):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: oklch(100% 0 0 / .9); backdrop-filter: blur(6px); z-index: 500;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -.02em; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 20px; height: 20px; flex: 0 0 auto; opacity: .9; }

/* landing. z-index so the map can ride up over the hero band's bottom
   edge the way the beach page's facts strip does. */
.landing { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 0 22px 40px; }
.hero { text-align: center; padding: 40px 22px 62px; }
.hero h1 { font-size: var(--step-4); margin: 0 0 10px; }
.lede { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 1.02rem; }

/* home hero band: one blue field behind the top bar, headline and search
   (booking.com-style). The band is a real ancestor of the search bar, so it
   grows with the copy instead of relying on a guessed height. The radial
   pass lifts the middle so it reads as light on water, not a flat swatch. */
.hero-band {
  background:
    radial-gradient(ellipse 85% 70% at 50% -10%, oklch(50% 0.115 230 / .75), transparent 68%),
    linear-gradient(180deg, var(--brand-blue), oklch(37% 0.11 252));
  color: #fff;
}
.hero-band .topbar {
  position: static; background: transparent;
  border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hero-band .brand { color: #fff; }
.hero-band .hero h1 { color: #fff; }
.hero-band .lede { color: oklch(92% 0.03 245); }

/* beach page: the sticky top bar carries the same blue as the hero band,
   and the hero's own top scrim starts in that blue — so bar and photo read
   as one header rather than a stripe stuck above a picture. */
.beachpage .topbar {
  background: var(--brand-blue); border-bottom-color: oklch(100% 0 0 / .14);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.beachpage .brand { color: #fff; }

/* the beach name in the bar, revealed once the <h1> scrolls out of view
   (beachnav.js adds .is-scrolled). Purely additive — no JS, no name. */
.topbar-title {
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  color: oklch(100% 0 0 / .92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease;
  padding-left: 14px; border-left: 1px solid oklch(100% 0 0 / .22);
}
.topbar-beach.is-scrolled .topbar-title { opacity: 1; transform: none; }

.searchwrap {
  display: flex; gap: 8px; max-width: 640px; margin: 22px auto 0;
  align-items: center; flex-wrap: wrap;
}
/* the search input, its icon and the typeahead panel share one positioned box */
.search-field { position: relative; flex: 1 1 320px; min-width: 0; }
.search-i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
#beach-search {
  width: 100%;
  padding: 13px 16px 13px 44px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg);
  box-shadow: var(--shadow); color: var(--text);
}
#beach-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* matched to the search pill: same height and shadow, own chevron instead
   of the OS one so the pair reads as a single control */
#region-filter {
  appearance: none; -webkit-appearance: none;
  padding: 13px 40px 13px 18px; font-size: .95rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: 999px; background-color: var(--bg);
  color: var(--text); box-shadow: var(--shadow); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 13px;
}

/* typeahead: matching beaches under the search box, click to open the beach
   page — so mobile users don't have to scroll past the map to the filtered
   list. Populated by search.js from the rendered card list. */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1200;
  margin: 0; padding: 0; list-style: none; text-align: left;
  max-height: min(58vh, 360px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.suggest[hidden] { display: none; }
.suggest li + li { border-top: 1px solid var(--border); }
.suggest a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 14px; color: var(--text); text-decoration: none;
}
.suggest a:hover, .suggest a.on { background: var(--bg-sunken); }
.suggest .s-name {
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.suggest .s-region { color: var(--muted); font-weight: 400; font-size: .82rem; }
.suggest .s-wqi { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.suggest .s-none { padding: 12px 14px; color: var(--muted); font-size: .88rem; }

/* home: one full-width map. The beach list that used to sit beside it is
   gone; #beach-list is still rendered (hidden) as data for the map filter
   and the search typeahead. */
#map {
  height: min(78vh, 780px); margin-top: -34px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-sunken); box-shadow: var(--shadow-lg); z-index: 2;
}
/* matches NIBasemap.PALETTE.land (basemap.js) so there's no colour flash before tiles paint */
.leaflet-container { background: #f5f6f8; border-radius: var(--radius); font: inherit; }
/* .leaflet-container's font:inherit blows the attribution up to body size —
   pull it back down on every map (home + each beach-page context map) */
.leaflet-control-attribution { font-size: 10px; line-height: 1.4; }
.map-note { font-size: .82rem; color: var(--muted); margin: 12px 4px 0; }

/* landing-map marker popup — a compact card, not stacked text lines
   (className "beachpop" is set on bindPopup in map.js so this stays off
   the beach-page context-map popups) */
.beachpop .leaflet-popup-content-wrapper { border-radius: 12px; }
.beachpop .leaflet-popup-content { margin: 12px 15px; min-width: 150px; line-height: 1.35; }
.beachpop .mp-name {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: .98rem; letter-spacing: -.01em; color: var(--text);
}
.beachpop .mp-name:hover { color: var(--accent); text-decoration: none; }
.beachpop .mp-sub { color: var(--muted); font-size: .8rem; margin-top: 1px; }
.beachpop .mp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.beachpop .mp-wqi { display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600; color: var(--text); }
.beachpop .mp-go { display: inline-block; margin-top: 10px; font-size: .82rem; font-weight: 600; color: var(--accent); }
.beachpop .mp-go:hover { text-decoration: underline; }

/* a link that is really a button — the "clear filters" reset beside the
   result count, which changes state rather than navigating */
.linkbtn {
  font: inherit; color: var(--accent); background: none; border: 0;
  padding: 0; cursor: pointer; text-decoration: underline;
}
.linkbtn:hover { color: var(--accent-ink); }

/* cooperative-gesture hint, centred over whichever map raised it */
.map-hint {
  position: absolute; inset: 0; z-index: 700; pointer-events: none;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 20px; font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  color: #fff; background: oklch(20% 0.03 255 / .48);
  border-radius: var(--radius);
  opacity: 0; transition: opacity .18s ease;
}
.map-hint.on { opacity: 1; }

/* reset-view button, stacked under Leaflet's own zoom bar */
.leaflet-bar.map-reset { margin-top: 8px; }
.leaflet-bar.map-reset a {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; color: var(--text);
}
.leaflet-bar.map-reset a:hover { color: var(--accent-ink); }

/* beach card */
.beach-card {
  display: block; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.beach-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.beach-card.dim { display: none; }
.beach-card.hot { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.bc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bc-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.bc-region { font-family: var(--font-body); font-weight: 400; font-size: .82rem; color: var(--muted); }
.bc-meta { color: var(--muted); font-size: .82rem; margin-top: 2px; display: flex; gap: 5px; flex-wrap: wrap; }
.bc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bc-foryou { margin-top: 8px; font-size: .82rem; color: var(--accent-ink); }

/* badges */
.wqi {
  font-family: var(--font-display); font-weight: 700; font-size: .72rem;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--info-bg); color: var(--info-ink);
}
.wqi-good { background: var(--good-bg); color: var(--good-ink); }
.wqi-ok   { background: var(--ok-bg);   color: var(--ok-ink); }
.wqi-warn { background: var(--warn-bg); color: var(--warn-ink); }
.wqi-bad  { background: var(--bad-bg);  color: var(--bad-ink); }
.wqi-unknown { background: var(--bg-sunken); color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--muted); border: 1px solid var(--border);
}
.tag.flag { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.tag.bad  { background: var(--bad-bg);  color: var(--bad-ink);  border-color: transparent; }
.ti { width: 13px; height: 13px; flex: 0 0 auto; }

/* ================= beach page ================= */

.beach { max-width: 1180px; margin: 0 auto; padding: 0 22px 56px; }
.facets > section, .beach-lede { scroll-margin-top: calc(var(--bar-h) + 18px); }

/* ---- hero ----
   The site's own photo (beach-photos/<slug>.*) where there is one,
   otherwise a rendered sea band. Both are the same shape, so a beach with
   no picture still opens with a header rather than a bare heading. Text
   sits on a bottom scrim; the top scrim starts in --brand-deep so it
   meets the blue top bar cleanly. */
.bhero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(200px, 27vh, 280px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 40px 0 52px;
  background: linear-gradient(150deg, var(--brand-deep), var(--brand-blue) 45%, var(--brand-teal));
  color: #fff;
}
.bhero.has-photo { min-height: clamp(280px, 44vh, 440px); }
.bhero-img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
/* Legibility scrim — only over a photo; the plain band needs none. The
   bottom ramp has to clear the whole text block, which is three or four
   lines tall on a phone once the sub-line wraps, so it stays near-opaque
   well past halfway before releasing the picture. */
.bhero.has-photo::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, oklch(31% 0.09 250 / .85), oklch(31% 0.09 250 / .14) 32%, transparent 48%),
    linear-gradient(0deg, oklch(18% 0.04 255 / .9), oklch(18% 0.04 255 / .58) 32%, oklch(18% 0.04 255 / .18) 66%, transparent 88%);
}
.bhero-inner { max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 22px; }
.bhero h1 {
  font-size: var(--step-4); margin: 0; color: #fff;
  text-shadow: 0 1px 22px oklch(20% 0.04 255 / .35);
}
.bhero-sub {
  margin: 8px 0 0; font-size: .95rem; color: oklch(100% 0 0 / .9);
  text-shadow: 0 1px 3px oklch(18% 0.04 255 / .55), 0 1px 16px oklch(18% 0.04 255 / .45);
}
/* a glass pill, not bare text: the crumb sits highest in the hero, where
   the scrim is weakest and a bright sky can swallow plain white type —
   and it doubles the tap target on a phone */
.bhero .crumb { margin: 0 0 16px; font-size: .82rem; }
.bhero .crumb a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px 6px 12px; border-radius: 999px; font-weight: 600; color: #fff;
  background: oklch(100% 0 0 / .16); border: 1px solid oklch(100% 0 0 / .26);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background-color .12s ease;
}
.bhero .crumb a:hover { background: oklch(100% 0 0 / .3); text-decoration: none; }
.beach-badges { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
/* on the hero the chips sit on imagery, so they get their own glass fill
   rather than the page's sunken grey */
.bhero .tag {
  background: oklch(100% 0 0 / .16); color: #fff; border-color: oklch(100% 0 0 / .28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bhero .tag.flag { background: oklch(100% 0 0 / .92); color: var(--accent-ink); border-color: transparent; }

/* ---- facts strip ----
   Rides up over the hero to tie the two together. Deliberately not a
   verdict (SPEC.md rule 1): each figure is stated with its own provenance
   and no safe/unsafe light is derived from them. */
.glance {
  position: relative; z-index: 2; margin: -34px 0 0; padding: 4px;
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.glance li { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.glance li + li { box-shadow: inset 1px 0 0 var(--border); }
.g-k { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.g-v {
  font-family: var(--font-display); font-weight: 700; font-size: 1.06rem;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.g-s { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Widescreen: a main column plus a sticky right rail (the "next 2 days"
   card + an on-this-page nav). Below 1000px it's a single column — the
   rail is first in source order, so the forecast card floats up under the
   heading, and the nav is dropped (a short page, quick to scroll). */
.beach-body { margin-top: 22px; }
.beach-main { min-width: 0; }
.beach-aside { margin: 0 0 18px; }
.beach-toc { display: none; } /* widescreen only — flipped on in the min-width query */

@media (min-width: 1000px) {
  .beach-body {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px; align-items: start;
  }
  .beach-main { grid-column: 1; grid-row: 1; }
  .beach-aside {
    grid-column: 2; grid-row: 1; margin: 0;
    position: sticky; top: calc(var(--bar-h) + 14px);
    display: flex; flex-direction: column; gap: 14px;
  }
  .beach-toc { display: block; }
}

/* plan-your-visit card: forecast block and/or tide block, each in its
   own child so the divider only lands between them */
.planner {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow); padding: 16px 18px;
}
.planner > * + * { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.planner-h {
  font-size: .7rem; margin: 0 0 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.planner-days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.planner-days li {
  display: grid; grid-template-columns: 5.25em auto 1fr; gap: 3px 10px;
  align-items: baseline; font-size: .86rem;
}
.pd-day { font-family: var(--font-display); font-weight: 700; }
.pd-cond { color: var(--muted); }
.pd-temp { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.pd-min { color: var(--muted); font-weight: 400; }
.pd-meta { grid-column: 1 / -1; font-size: .73rem; color: var(--muted); }
.planner-sun { margin: 10px 0 0; font-size: .78rem; color: var(--muted); }

/* tide mini-table */
.planner-sub {
  font-family: var(--font-display); font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px;
}
.planner-tides ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.planner-tides li {
  display: grid; grid-template-columns: 14px 3em auto 1fr; gap: 8px;
  align-items: center; font-size: .85rem;
}
.tide-i { width: 12px; height: 12px; color: var(--accent); }
.tide-low .tide-i { transform: rotate(180deg); color: var(--muted); }
.tide-k { font-family: var(--font-display); font-weight: 700; }
.tide-t { font-variant-numeric: tabular-nums; }
.tide-h { text-align: right; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* on-this-page nav — widescreen only (shown in the min-width query above).
   beachnav.js marks the section in view with .on. */
.beach-toc { font-size: .84rem; }
.beach-toc-h {
  font-family: var(--font-display); font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  margin: 0 0 8px; padding: 0 11px;
}
.beach-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.beach-toc a {
  display: block; padding: 6px 11px; border-radius: var(--radius-sm);
  color: var(--muted); border-left: 2px solid transparent;
  transition: color .12s ease, background-color .12s ease, border-color .12s ease;
}
.beach-toc a:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.beach-toc a.on {
  color: var(--accent-ink); background: var(--accent-soft);
  border-left-color: var(--accent); font-weight: 600;
}

/* lead: description + context map, above the facets */
.beach-lede { margin: 0 0 4px 0; }
.beach-desc { font-size: var(--step-1); line-height: 1.6; margin: 0 0 6px; max-width: 68ch; }
#beachmap {
  height: min(52vh, 420px); margin-top: 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-sunken); box-shadow: var(--shadow); z-index: 1;
}
.beachmap-note { font-size: .78rem; color: var(--muted); margin: 8px 2px 14px; }

/* beach-page context-map markers (divIcon) + the matching layer-control
   legend swatches: a colour-coded badge carrying a white glyph. Round by
   default; `.sq` (RNLI lifeguard) makes it a square. */
.mkb {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  background: var(--muted); color: #fff;
}
.mkb > svg { width: 13px; height: 13px; }
.mkb.sq { border-radius: 4px; }
.lg {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 16px; height: 16px; margin-right: 6px; border-radius: 50%;
  vertical-align: middle; border: 1px solid #fff; box-shadow: 0 0 0 1px var(--border);
  color: #fff;
}
.lg > svg { width: 10px; height: 10px; }
.lg.sq { border-radius: 3px; }
.mkb.mk-amenity,   .lg.mk-amenity   { background: #3b82c4; }
.mkb.mk-boating,   .lg.mk-boating   { background: #55636f; }
.mkb.mk-overflow,  .lg.mk-overflow  { background: #d98a3d; }
.mkb.mk-overflow.bad               { background: #d1495b; }
.mkb.mk-wwtw,      .lg.mk-wwtw      { background: #8a6fb0; }
.mkb.mk-lifeguard, .lg.mk-lifeguard { background: #e4572e; }
/* the layer key covered a third of the map at its old size — pull it in and
   let the tiles read through it */
.leaflet-control-layers {
  font: inherit; font-size: .76rem; padding: 6px 9px;
  border-radius: var(--radius-sm) !important;
  background: oklch(100% 0 0 / .88) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm) !important; border: 1px solid var(--border) !important;
}
.leaflet-control-layers label { display: flex; align-items: center; gap: 2px; margin-bottom: 1px; }
/* Collapsed, Leaflet draws the toggle from images/layers.png — which this
   repo never vendored (only the marker icons are), so the button rendered
   as an empty white square. Own glyph, inline, no new asset. */
.leaflet-control-layers-toggle {
  border-radius: var(--radius-sm) !important;
  width: 34px; height: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 3 8l9 5 9-5-9-5z'/%3E%3Cpath d='M3 13l9 5 9-5'/%3E%3C/svg%3E") !important;
  background-size: 19px 19px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.facets { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.facet {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
  background: var(--panel); box-shadow: var(--shadow);
}
.facet h2 {
  font-size: var(--step-1); margin: 0 0 14px; display: flex; align-items: center; gap: 9px;
}
.facet .si {
  width: 28px; height: 28px; padding: 5px; flex: 0 0 auto;
  color: var(--accent); background: var(--accent-soft); border-radius: 8px;
}
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.facet p { margin: 6px 0; }

/* a labelled block within a facet (e.g. sewage & overflows inside water) */
.subfacet { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.subfacet h3 {
  font-size: .7rem; font-weight: 700; margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}

/* alerts */
.alert {
  border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  padding: 10px 14px; margin: 8px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--bg-sunken);
}
/* only the left bar carries the severity — tinting all four sides drew a
   loud coloured box around every "info" advisory */
.alert.a-warn { border-left-color: var(--warn-dot); background: var(--warn-bg); }
.alert.a-bad  { border-left-color: var(--bad-dot);  background: var(--bad-bg); }
.alert.a-info { border-left-color: var(--ok-dot); }
.a-title {
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
}
.a-title::-webkit-details-marker { display: none; }
.a-ico { width: 15px; height: 15px; flex: 0 0 auto; opacity: .75; }
.a-text { flex: 1 1 auto; min-width: 0; }
.a-title::after {
  content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-bottom: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease; opacity: .5;
}
details.alert[open] > .a-title::after { transform: rotate(225deg); margin-bottom: -2px; }
.a-derived {
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px; background: var(--accent); color: #fff;
}
.alert p { font-size: .85rem; margin: 6px 0 0; }

/* water */
.latest { font-size: .92rem; }
.sparkwrap { margin: 14px 0; }
.spark { display: flex; gap: 3px; align-items: flex-end; height: 40px; }
.sbar { flex: 1 1 auto; min-width: 3px; height: 100%; border-radius: 3px; background: var(--bg-sunken); }
.sbar.s-good { background: var(--good-dot); }
.sbar.s-ok   { background: var(--ok-dot); }
.sbar.s-warn { background: var(--warn-dot); }
.sbar.s-bad  { background: var(--bad-dot); }
.sbar.s-unknown { background: oklch(86% 0.01 250); }
.sparkwrap figcaption {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: .68rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.dotwqi { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; background: var(--bg-sunken); }
.dotwqi.s-good { background: var(--good-dot); }
.dotwqi.s-ok   { background: var(--ok-dot); }
.dotwqi.s-warn { background: var(--warn-dot); }
.dotwqi.s-bad  { background: var(--bad-dot); }
.dotwqi.s-unknown { background: oklch(80% 0.01 250); }

details.more { margin-top: 10px; }
details.more > summary {
  cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--accent);
  display: inline-block; padding: 2px 0;
}

/* Row-ruled, not boxed: the full grid of hairlines made a 40-row sample
   history read as a spreadsheet. */
table.samples, table.marinas {
  border-collapse: collapse; width: 100%; margin: 8px 0 2px; font-size: .82rem;
}
.samples th, .samples td, .marinas th, .marinas td {
  border: 0; border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: right;
}
.samples th:first-child, .samples td:first-child,
.marinas th:first-child, .marinas td:first-child { text-align: left; padding-left: 0; }
.samples th:last-child, .samples td:last-child,
.marinas th:last-child, .marinas td:last-child { padding-right: 0; }
.samples th, .marinas th {
  font-family: var(--font-display); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  border-bottom-color: var(--border-strong);
}
.samples tbody tr:last-child td, .marinas tbody tr:last-child td { border-bottom: 0; }
.samples td { font-variant-numeric: tabular-nums; }
.marinas td small { color: var(--muted); }
.note { text-align: left; color: var(--muted); }

/* wide tables scroll inside their own box so they never widen the page */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 2px; }
.tscroll > table.samples, .tscroll > table.marinas { margin: 0; }

/* ---- conditions ----
   Two tiers: the three readings people actually came for at display size,
   then the marine detail in the small grid below. */
.cond-primary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2px; margin: 0 0 12px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.cp { background: var(--bg-tint); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.cp-k {
  display: flex; align-items: center; gap: 6px;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600;
}
.cp-k .ti { color: var(--accent); }
.cp-v {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-3);
  line-height: 1.05; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 4px;
}
.cp-v i { font-style: normal; font-size: .46em; font-weight: 600; color: var(--muted); }
.cp em { font-style: normal; font-size: .76rem; color: var(--muted); }
/* points where the wind is blowing to — see windArrow() in server.go */
.wind-arrow {
  width: .62em; height: .62em; flex: 0 0 auto; color: var(--accent);
  align-self: center; transform-box: fill-box; transform-origin: center;
}

.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 0 0 4px; }
.cell {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px;
  display: flex; flex-direction: column; gap: 2px;
}
.cell.wide { grid-column: 1 / -1; }
.cell span { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.cell strong { font-family: var(--font-display); font-size: .95rem; }
.cell em { font-style: normal; font-size: .72rem; color: var(--muted); }
.cond-alerts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
a.tag { cursor: pointer; }
a.tag:hover { text-decoration: none; border-color: var(--muted); }
a.tag.warn:hover, a.tag.bad:hover { border-color: transparent; filter: brightness(0.97); }

/* features */
.features { display: flex; gap: 7px; flex-wrap: wrap; margin: 4px 0 12px; }

/* amenities — icon, label + nearest example, count */
.amen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 4px 0; }
.amen {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
}
.amen-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.amen-ico .ti { width: 15px; height: 15px; }
.amen-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.amen-label { font-family: var(--font-display); font-weight: 600; font-size: .86rem; }
.amen-near {
  font-size: .74rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.amen-n {
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums;
}

/* boating — a list, not a table (the facility column repeated verbatim) */
.boat-list { list-style: none; margin: 4px 0 0; padding: 0; }
.boat-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.boat-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.boat-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-sunken); color: var(--muted);
}
.boat-ico .ti { width: 15px; height: 15px; }
.boat-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.boat-name { font-family: var(--font-display); font-weight: 700; font-size: .92rem; }
.boat-meta { font-size: .78rem; color: var(--muted); }
.boat-facil { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.boat-dist {
  flex: 0 0 auto; font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* dogs / access / vehicle rules */
.access-notes { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.access-notes li { line-height: 1.45; }
.access-notes strong { color: var(--text); font-weight: 600; }

/* nature designations */
.desig { list-style: none; margin: 6px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.desig li { font-size: .9rem; }
.desig-kind {
  display: inline-block; min-width: 3.4em; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: .68rem;
  padding: 3px 8px; border-radius: 999px; margin-right: 8px;
  background: var(--bg-sunken); color: var(--muted);
}
.desig-kind.d-assi { background: var(--ok-bg); color: var(--ok-ink); }
.desig-kind.d-sac  { background: var(--good-bg); color: var(--good-ink); }
.desig-kind.d-spa  { background: var(--info-bg); color: var(--info-ink); }

/* footer + doc */
.footer { border-top: 1px solid var(--border); margin-top: 30px; padding: 24px 22px; color: var(--muted); font-size: .8rem; background: var(--bg-sunken); }
.footer p { max-width: 1000px; margin: 4px auto; }
.footer .fine { color: var(--muted); }
.footer .footer-contact { margin-top: 10px; }
.doc { max-width: 760px; margin: 0 auto; padding: 20px 22px 60px; }
.doc h1 { font-size: var(--step-3); }
.doc h2 { font-size: var(--step-1); margin-top: 28px; }
.srclist { padding-left: 18px; }
.srclist li { margin: 8px 0; font-size: .9rem; }

/* responsive */
@media (max-width: 860px) {
  #map { height: min(68vh, 520px); }
  #beachmap { height: 320px; }
}

@media (max-width: 700px) {
  .beach { padding: 0 16px 40px; }
  .bhero-inner { padding: 0 16px; }
  .bhero { padding: 32px 0 46px; }
  .facet { padding: 16px 16px; }
  /* the strip becomes a swipeable rail rather than a 1-per-row stack that
     pushes the map two screens down */
  .glance {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; margin-top: -28px;
  }
  .glance li { flex: 0 0 auto; min-width: 47%; scroll-snap-align: start; }
  .glance::-webkit-scrollbar { height: 0; }
}

@media (max-width: 560px) {
  table.samples, table.marinas { font-size: .78rem; }
  .samples th, .samples td, .marinas th, .marinas td { padding: 7px 6px; }

  /* home search: the row is too narrow for input + coast filter side by side,
     so it wraps — stack them as two full-width pills instead of leaving the
     select stranded at its intrinsic width with dead space beside it. */
  .search-field, #region-filter { flex-basis: 100%; }
}

/* one identical teardrop pin for every beach (divIcon). The white centre
   keeps overlapping pins legible. Shared by the landing map (map.js, one
   per beach) and each beach-page context map (beachmap.js, the beach
   itself — where it also outranks the feature badges around it). */
.pin-beach {
  position: relative; display: block; width: 26px; height: 26px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4);
  background: var(--accent);
}
.pin-beach::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: #fff;
}

/* low-zoom cluster badge (hand-rolled grid clustering in map.js) */
.pin-cluster {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font: 700 .72rem/1 var(--font-display); color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
  background: var(--accent);
}
