/* Reef: looking down into a lagoon. The page is the water (turquoise,
   deepening as you scroll), cards are white sand, coral orange is the one
   loud accent, sunny yellow the helper. One narrow column, phone first. */
:root {
  --lagoon-1: #5fe0e6;
  --lagoon-2: #1fb9cf;
  --lagoon-3: #0b8fb3;
  --lagoon-4: #08628a;
  --card: #ffffff;
  --card-2: #e6f8f8;
  --ink: #073046;
  --ink-2: #4d7183;
  --line: #d3ecee;
  --on-water: #ffffff;
  --on-water-2: rgba(255, 255, 255, 0.88);
  --glass: rgba(255, 255, 255, 0.2);
  --glass-line: rgba(255, 255, 255, 0.4);
  --clown: #ff7a1f;
  --clown-deep: #d95500;
  --clown-soft: #fff1e6;
  --clown-ink: #b84600;
  --yellow: #ffd23f;
  --yellow-soft: #fff6d1;
  --aqua-ink: #0b6f7f;

  --s-ex: #00a99d;
  --s-good: #63b83e;
  --s-fair: #f5b700;
  --s-poor: #f2668b;
  --s-nogo: #c81d4e;
  --s-dark: #7d97a3;
  --s-none: rgba(255, 255, 255, 0.45);

  --good: #00917f;
  --bad: #d4335e;
  --note: #4d7183;

  --f-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --f-body: "Nunito", system-ui, sans-serif;

  --r: 22px;
  --r-lg: 28px;
  --r-sm: 12px;
  color-scheme: light;
}

/* Night lagoon */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lagoon-1: #0f5c73;
    --lagoon-2: #0a4257;
    --lagoon-3: #072e40;
    --lagoon-4: #04192a;
    --card: #0f2f3f;
    --card-2: #173f52;
    --ink: #e6f6f8;
    --ink-2: #9ec0c9;
    --line: #21495b;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-line: rgba(255, 255, 255, 0.22);
    --clown: #ff8a33;
    --clown-deep: #e0660f;
    --clown-soft: #3b2a1e;
    --clown-ink: #ffb27a;
    --yellow-soft: #3a3418;
    --aqua-ink: #7fe3e8;
    --s-ex: #19c9b8;
    --s-good: #7fd05a;
    --s-fair: #ffc93a;
    --s-poor: #ff86a6;
    --s-nogo: #ff5577;
    --s-dark: #7d97a3;
    --s-none: rgba(255, 255, 255, 0.25);
    --good: #4fd8b8;
    --bad: #ff7f9d;
    --note: #9ec0c9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --lagoon-1: #0f5c73;
  --lagoon-2: #0a4257;
  --lagoon-3: #072e40;
  --lagoon-4: #04192a;
  --card: #0f2f3f;
  --card-2: #173f52;
  --ink: #e6f6f8;
  --ink-2: #9ec0c9;
  --line: #21495b;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-line: rgba(255, 255, 255, 0.22);
  --clown: #ff8a33;
  --clown-deep: #e0660f;
  --clown-soft: #3b2a1e;
  --clown-ink: #ffb27a;
  --yellow-soft: #3a3418;
  --aqua-ink: #7fe3e8;
  --s-ex: #19c9b8;
  --s-good: #7fd05a;
  --s-fair: #ffc93a;
  --s-poor: #ff86a6;
  --s-nogo: #ff5577;
  --s-dark: #7d97a3;
  --s-none: rgba(255, 255, 255, 0.25);
  --good: #4fd8b8;
  --bad: #ff7f9d;
  --note: #9ec0c9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--lagoon-4); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 600 15px/1.45 var(--f-body);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background:
    radial-gradient(130px 60px at 18% 160px, rgba(255, 255, 255, 0.22), transparent 70%),
    radial-gradient(170px 70px at 82% 420px, rgba(255, 255, 255, 0.14), transparent 70%),
    radial-gradient(150px 60px at 26% 900px, rgba(255, 255, 255, 0.1), transparent 70%),
    linear-gradient(180deg, var(--lagoon-1) 0, var(--lagoon-2) 520px, var(--lagoon-3) 1300px, var(--lagoon-4) 2400px);
  background-color: var(--lagoon-4);
}
.top, main, .foot {
  max-width: 640px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
a { color: var(--clown-deep); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible + span {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.fish-ico { display: inline-block; vertical-align: -2px; }

/* ---------- header ---------- */
.top { padding-block: 20px 4px; position: relative; color: var(--on-water); }
.bubbles span { position: absolute; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.55); pointer-events: none; }
.top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; }
.top-row > div:first-child { flex: 1; min-width: 0; }
/* On the title's row only, so the place under it keeps the full width. */
.top-tools { position: absolute; top: -4px; right: 0; display: flex; gap: 8px; }
.pill-btn {
  height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px 0 13px; border-radius: 999px;
  border: 2px solid var(--glass-line); background: var(--glass); color: #fff; font: 600 15px var(--f-display); cursor: pointer;
}
.pill-btn svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 379px) { .bubbles { display: none; } }
@media (max-width: 345px) {
  .pill-btn { width: 44px; padding: 0; justify-content: center; }
  .pill-btn span { display: none; }
}
h1 { font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; text-shadow: 0 2px 0 rgba(7, 48, 70, 0.18); }
h1 span { color: var(--yellow); }
.sub { margin: 7px 0 0; color: var(--on-water-2); font-weight: 700; font-size: 14.5px; }
.sub.small { font-size: 13px; }
.sub.small:empty { display: none; }
.origin {
  border: 0; cursor: pointer; color: var(--on-water); font-weight: 800;
  background: var(--glass); padding: 2px 10px; border-radius: 999px;
}
.origin::after { content: " ▾"; opacity: 0.8; }
.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--clown-deep); font-weight: 800; text-decoration: underline; text-underline-offset: 3px;
}
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--glass-line); background: var(--glass); cursor: pointer;
  display: grid; place-items: center; position: relative; z-index: 1;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { margin: 6px 0 0; font-size: 12.5px; color: var(--on-water-2); min-height: 18px; font-weight: 700; }
.status .err { color: #fff; background: rgba(200, 29, 78, 0.85); padding: 2px 8px; border-radius: 8px; }
.status .link { color: #fff; }
.pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--yellow); margin-right: 4px; vertical-align: 1px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- time picker: days and hour bubbles ---------- */
.when {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; padding-block: 10px 8px;
  margin-inline: -8px; padding-inline: 8px; border-radius: 0 0 20px 20px;
  background: color-mix(in srgb, var(--lagoon-2) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--lagoon-2);
}
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar, .hours::-webkit-scrollbar { display: none; }
.day {
  flex: none; border: 0; background: var(--glass); color: var(--on-water);
  border-radius: 999px; padding: 8px 15px; font: 600 15px var(--f-display); cursor: pointer;
}
.day.on { background: var(--card); color: var(--clown-deep); box-shadow: 0 3px 0 rgba(7, 48, 70, 0.15); }
.day.now.on { background: var(--clown); color: #fff; box-shadow: 0 3px 0 var(--clown-deep); }
.hours {
  display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; scrollbar-width: none;
  padding: 4px 2px 2px; scroll-padding-inline: 40px;
}
.hour {
  flex: 1 0 40px; min-width: 40px; display: grid; justify-items: center; gap: 4px;
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--on-water);
  font: 800 12px/1 var(--f-body); font-variant-numeric: tabular-nums;
}
.bubble {
  width: 30px; height: 30px; border-radius: 50%; display: block;
  background: var(--c, var(--s-none)); border: 3px solid rgba(255, 255, 255, 0.75);
  transition: transform 0.15s;
}
.hour.on .bubble { transform: scale(1.18); border-color: #fff; box-shadow: 0 0 0 3px var(--clown); }
.hour .sky { width: 20px; height: 20px; display: block; margin-top: -1px; }
.hour.past { opacity: 0.5; }
.hour.is-now .h-num::after { content: "•"; color: var(--yellow); margin-left: 1px; }

/* score colours, shared by bubbles, strips, dots, badges */
.s-ex { --c: var(--s-ex); }
.s-good { --c: var(--s-good); }
.s-fair { --c: var(--s-fair); }
.s-poor { --c: var(--s-poor); }
.s-nogo { --c: var(--s-nogo); }
.s-dark { --c: var(--s-dark); }
.s-none { --c: var(--s-none); }

/* ---------- best pick ---------- */
.hero { margin-top: 14px; }
.hero-card {
  position: relative; overflow: hidden; background: var(--card); border-radius: var(--r-lg);
  padding: 18px 18px 16px; box-shadow: 0 16px 32px -16px rgba(4, 52, 80, 0.6);
}
.hero-card::after {
  content: ""; position: absolute; right: -30px; bottom: -50px; width: 190px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--lagoon-1) 28%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-art { position: absolute; right: 14px; top: 14px; width: 84px; height: 84px; }
.dark-pick .hero-art { opacity: 0.5; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 104px);
  font: 600 13px var(--f-display); color: #fff; background: var(--clown);
  padding: 4px 12px 4px 9px; border-radius: 999px;
}
.hero-card h2 { font-size: 31px; font-weight: 700; line-height: 1.05; margin-top: 12px; max-width: calc(100% - 96px); }
.hero-meta { margin: 4px 0 0; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.score-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.score-row > div:last-child { flex: 1; min-width: 0; }
.big { font: 700 56px/0.95 var(--f-display); color: var(--c); font-variant-numeric: tabular-nums; }
.big small { font-size: 18px; color: var(--ink-2); margin-left: 2px; }
.fishes { display: flex; gap: 3px; }
.fishes svg { width: 28px; height: 17px; }
.fishes .on { fill: var(--clown); }
.fishes .off { fill: var(--line); }
.verdict { font: 600 18px/1.2 var(--f-display); color: var(--c); margin: 3px 0 0; }
.hero-actions, .spot-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 18px; border-radius: 999px; border: 0;
  background: var(--card-2); color: var(--ink); font: 600 15px var(--f-display);
  text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--clown); color: #fff; box-shadow: 0 4px 0 var(--clown-deep); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--clown-deep); }
.btn.ghost { background: transparent; border: 2px solid var(--line); }
.runners { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; position: relative; z-index: 1; }
.runners-k { font: 600 14px var(--f-display); color: var(--ink-2); margin-right: 2px; }
.runner {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: var(--card-2); border-radius: 999px; padding: 5px 11px; font-weight: 800; font-size: 13.5px;
}
.runner b { color: var(--aqua-ink); font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.next {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; margin-top: 12px;
  text-align: left; background: var(--yellow-soft); border: 2px dashed var(--yellow); border-radius: 16px;
  padding: 10px 12px; cursor: pointer; font-size: 14px; position: relative; z-index: 1;
}
.next > span:first-child { font: 600 14px var(--f-display); color: var(--clown-ink); width: 100%; }
.next b:last-child { font-variant-numeric: tabular-nums; }

.reasons { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; position: relative; z-index: 1; }
.reasons li { position: relative; padding-left: 20px; font-size: 14.5px; }
.reasons li::before {
  content: ""; position: absolute; left: 1px; top: 0.45em; width: 10px; height: 10px; border-radius: 50%;
}
.reasons li.good::before { background: var(--good); }
.reasons li.bad::before { background: var(--bad); }
.reasons li.note::before { background: var(--yellow); }

/* ---------- sea & sky tiles, on the water ---------- */
.sea { margin-top: 22px; }
.sec {
  font: 600 20px/1.2 var(--f-display); color: var(--on-water); margin: 0 4px 10px;
  display: flex; align-items: center; gap: 8px;
}
.sec small { font: 700 13px var(--f-body); color: var(--on-water-2); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile {
  background: var(--glass); border: 2px solid var(--glass-line); border-radius: 18px;
  padding: 9px 10px 10px; min-width: 0; color: var(--on-water);
}
.t-k { margin: 0; font-size: 12px; font-weight: 800; color: var(--on-water-2); }
.t-v { margin: 1px 0 0; font: 700 23px/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.t-v small { font: 700 12px var(--f-body); color: var(--on-water-2); margin-left: 2px; }
.t-s { margin: 2px 0 0; font-size: 12px; color: var(--on-water-2); line-height: 1.3; font-weight: 700; }
.arrow { width: 15px; height: 15px; vertical-align: -3px; display: inline-block; }
.arrow path { fill: none; stroke: var(--yellow); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- controls on the water ---------- */
.list-head { margin-top: 26px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.seg { display: inline-flex; border-radius: 999px; padding: 3px; background: var(--glass); }
.seg button {
  border: 0; background: none; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  font: 600 14px var(--f-display); color: var(--on-water);
}
.seg button.on { background: var(--card); color: var(--clown-deep); }
.seg-view { background: color-mix(in srgb, var(--ink) 22%, transparent); padding: 4px; }
.seg-view button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; font-size: 16px; }
.seg-view svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.switch { display: inline-flex; align-items: center; font: 600 14px var(--f-display); color: var(--on-water); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; padding-left: 44px; line-height: 24px; }
.switch span::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 38px; height: 22px; border-radius: 999px;
  background: var(--glass); border: 2px solid var(--glass-line); transition: background 0.15s;
}
.switch span::after {
  content: ""; position: absolute; left: 5px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; transition: left 0.15s;
}
.switch input:checked + span::before { background: var(--clown); border-color: var(--clown); }
.switch input:checked + span::after { left: 21px; }

/* ---------- spot cards ---------- */
.spots { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.spot {
  background: var(--card); border-radius: var(--r); scroll-margin-top: 140px;
  box-shadow: 0 10px 20px -14px rgba(4, 52, 80, 0.65);
}
.spot details > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 14px;
}
.spot details > summary::-webkit-details-marker { display: none; }
.sk-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 14px; align-items: center; }
.badge {
  width: 58px; height: 58px; border-radius: 18px; background: var(--c); color: #fff;
  display: grid; place-items: center; font: 700 25px var(--f-display); font-variant-numeric: tabular-nums;
}
.skeleton .badge { color: var(--ink-2); background: var(--card-2); }
.spot-main { min-width: 0; }
.spot-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.spot-title h3 { font-size: 19px; font-weight: 600; line-height: 1.15; }
.tag { flex: none; font: 600 13px var(--f-display); color: var(--c); }
.spot-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip {
  font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--card-2); color: var(--aqua-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip.good { background: var(--card-2); color: var(--good); }
.chip.bad { background: var(--clown-soft); color: var(--clown-ink); }
.chip.soft { background: var(--yellow-soft); color: var(--ink); }

.strip { margin-top: 10px; }
.cells { display: flex; gap: 3px; }
.cell { flex: 1; height: 8px; border-radius: 4px; background: var(--c); }
.cell.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.strip-axis {
  display: flex; justify-content: space-between; margin-top: 5px;
  font: 800 11px/1 var(--f-body); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.strip-axis span:nth-child(2) { color: var(--ink); font-family: var(--f-display); font-weight: 600; font-size: 12px; }

.spot-body { padding: 0 14px 16px; border-top: 2px dashed var(--line); }
.spot-body .reasons { margin-top: 12px; }
.desc { margin: 12px 0 0; font-size: 14.5px; max-width: 62ch; display: flow-root; }
.desc p { margin: 0; }
.desc-art { float: right; width: 76px; height: 76px; margin: 0 0 6px 12px; }
.spot-photo { margin: 12px 0 0; }
.spot-photo img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; border-radius: 14px; background: var(--card-2); }
.spot-photo figcaption { margin-top: 4px; font-size: 11.5px; color: var(--ink-2); }
.spot-photo figcaption a { color: inherit; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 14px 0 0; }
.facts div { min-width: 0; }
.facts dt { font: 600 13px var(--f-display); color: var(--ink-2); }
.facts dd { margin: 1px 0 0; font-size: 13.5px; }
.hazard { margin: 12px 0 0; font-size: 13.5px; padding: 9px 12px; border-radius: 14px; background: var(--clown-soft); color: var(--ink); }
.hazard b { color: var(--clown-ink); }
.maps-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }

/* ---------- map ---------- */
.map-wrap { margin-top: 12px; }
.map-controls { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 10px; }
/* Six colour layers: two rows of three on a phone, one row when there is room. */
.seg-wide { display: grid; grid-template-columns: repeat(3, auto); border-radius: 22px; }
.seg-wide button { padding-inline: 12px; white-space: nowrap; }
@media (min-width: 520px) { .seg-wide { grid-template-columns: repeat(6, auto); border-radius: 999px; } }
.map {
  /* Leaflet's layers have z-indexes up to 1000: keep them inside the map, so
     the time bar, sheets and the photo viewer stay on top. */
  isolation: isolate;
  height: max(380px, calc(100dvh - 300px)); max-height: 780px;
  border-radius: var(--r); border: 3px solid rgba(255, 255, 255, 0.7); overflow: hidden; background: #cfeff2;
  /* The map tiles are light in both themes, so pins keep the light score colours. */
  --s-ex: #00a99d; --s-good: #63b83e; --s-fair: #f5b700; --s-poor: #f2668b; --s-nogo: #c81d4e; --s-dark: #7d97a3;
}
.map-err { padding: 16px; color: #c81d4e; }
.map-legend { display: grid; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--on-water-2); font-weight: 700; }
.lg-block { display: grid; gap: 4px; }
.lg-k { margin: 0; font: 600 15px var(--f-display); color: var(--on-water); }
.lg-k span { font: 700 13px var(--f-body); color: var(--on-water-2); }
/* Colour scales. Waves and wind have a handle that sets the top; the right
   margin leaves room for the handle at the end. */
.lg-scale { position: relative; max-width: 340px; margin: 2px 14px 0 0; }
.lg-scale[data-scale] { padding-top: 26px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.lg-track { position: relative; height: 14px; }
.lg-fill { position: absolute; inset: 0; border-radius: 7px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
.lg-thumb {
  position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: #fff; border: 3px solid var(--clown); box-shadow: 0 2px 6px rgba(7, 48, 70, 0.4);
}
.lg-thumb:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lg-thumb b {
  position: absolute; bottom: 27px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 600 14px var(--f-display); color: var(--on-water);
}
.lg-thumb b.end { left: auto; right: -3px; transform: none; }
.lg-ticks {
  position: relative; height: 12px; margin-top: 7px;
  font: 800 12px/1 var(--f-body); font-variant-numeric: tabular-nums; color: var(--on-water);
}
.lg-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.lg-ticks:not(.lg-marks) span:first-child { transform: none; }
.lg-ticks:not(.lg-marks) span:last-child { transform: translateX(-100%); }
.lg-marks { margin-top: 5px; font-weight: 700; color: var(--on-water-2); }
.lg-scores {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  --s-ex: #00a99d; --s-good: #63b83e; --s-fair: #f5b700; --s-poor: #f2668b; --s-nogo: #c81d4e;
}
.lg-scores span { display: inline-flex; align-items: center; gap: 5px; }
.lg-scores .dot { border: 2px solid #fff; width: 12px; height: 12px; }
.lg-note { margin: 0; }
.lg-note.err { color: #fff; background: rgba(200, 29, 78, 0.85); padding: 4px 8px; border-radius: 8px; }

/* Leaflet pieces stay light in both themes, like the map under them. */
.map .leaflet-control-attribution { font-size: 10px; }
.map .leaflet-bar { border: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(7, 48, 70, 0.3); }
.map .leaflet-bar a { color: #073046; }
.map-tools-bar a { display: grid !important; place-items: center; }
.map-tools-bar svg { width: 18px; height: 18px; fill: none; stroke: #073046; stroke-width: 2; stroke-linecap: round; }
.pin-wrap { background: none; border: 0; display: grid; place-items: center; }
.pin {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 11px;
  background: var(--c); color: #fff; font: 700 13px/1 var(--f-display); font-variant-numeric: tabular-nums;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(7, 48, 70, 0.45);
}
.z-low .pin-wrap .pin { width: 22px; height: 22px; font-size: 10.5px; border-width: 1.5px; border-radius: 8px; }
.z-mid .pin-wrap .pin { width: 26px; height: 26px; font-size: 12px; border-radius: 9px; }
.pin-sm { width: 34px; height: 34px; flex: none; font-size: 15px; }
/* Another region's spot before its forecast is in. */
.pin-wait { --c: #8aa3ae; }
.pin-name {
  display: none; position: absolute; left: 34px; top: 7px; white-space: nowrap;
  font: 600 12.5px/1.2 var(--f-display); color: #073046;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff;
}
.show-names .pin-name { display: block; }
.is-sat .pin-name { color: #fff; text-shadow: 0 0 2px #000, 0 0 4px #000; }
.pin-origin span {
  display: block; width: 16px; height: 16px; border-radius: 50%;
  background: #ff7a1f; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(255, 122, 31, 0.35);
}
/* The phone's live position, apart from the place distances count from. */
.pin-me span {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.3), 0 1px 4px rgba(7, 48, 70, 0.5);
}
path.me-accuracy { fill: #1a73e8; fill-opacity: 0.12; stroke: #1a73e8; stroke-opacity: 0.4; stroke-width: 1; }
.wind-canvas { pointer-events: none; }
path.sector { fill: #ff7a1f; fill-opacity: 0.16; stroke: #ff7a1f; stroke-width: 1.5; stroke-dasharray: 5 4; }
.is-sat path.sector { fill-opacity: 0.25; }

.snork-pop .leaflet-popup-content-wrapper { border-radius: 20px; }
.snork-pop .leaflet-popup-content { margin: 12px 14px; }
.pop { font: 600 13.5px/1.45 var(--f-body); color: #073046; display: grid; gap: 6px; }
.leaflet-popup-content .pop p { margin: 0; }
.pop b { font: 600 17px/1.15 var(--f-display); }
.pop-h { display: flex; gap: 10px; align-items: center; }
.pop-h .pin { box-shadow: none; border-width: 0; }
.pop-sub { display: block; font-size: 12.5px; color: #4d7183; }
.pop-k { font: 600 13px var(--f-display); color: #b84600; }
.pop .muted { color: #4d7183; font-size: 12.5px; }
.pop-dl { margin: 0; display: grid; gap: 3px; }
.pop-dl div { display: grid; grid-template-columns: 52px 1fr; gap: 6px; }
.pop-dl dt { font: 600 13.5px var(--f-display); color: #4d7183; }
.pop-dl dd { margin: 0; font-variant-numeric: tabular-nums; }
.pop-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.leaflet-container a.pop-btn {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border-radius: 999px;
  background: #e6f8f8; color: #073046; font: 600 13.5px var(--f-display); text-decoration: none;
}
.leaflet-container a.pop-btn.primary { background: #ff7a1f; color: #fff; box-shadow: 0 3px 0 #d95500; }
.pop .link { color: #b84600; justify-self: start; font-size: 13.5px; }

/* ---------- feedback, about, footer ---------- */
.feedback {
  margin-top: 26px; padding: 15px 16px; display: grid; gap: 12px; justify-items: start;
  background: var(--card); color: var(--ink); border-radius: var(--r); box-shadow: 0 10px 20px -14px rgba(4, 52, 80, 0.65);
}
.feedback p { margin: 0; font-size: 14.5px; }
.feedback b { font: 600 17px var(--f-display); display: block; margin-bottom: 2px; }
.about { margin-top: 26px; }
.about details { background: var(--card); border-radius: var(--r); box-shadow: 0 10px 20px -14px rgba(4, 52, 80, 0.65); }
.about summary { cursor: pointer; padding: 15px 16px; font: 600 17px var(--f-display); }
.about-body { padding: 0 16px 16px; font-size: 14.5px; max-width: 65ch; }
.about-body ul { padding-left: 18px; display: grid; gap: 6px; }
.caution { padding: 10px 12px; border-radius: 14px; background: var(--yellow-soft); }
.foot { padding-block: 20px 30px; font-size: 12.5px; color: var(--on-water-2); font-weight: 700; }
.foot a { color: var(--on-water); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  h1 { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.tag-pill .tag-fish { width: 18px; height: 11px; fill: #fff; flex: none; }

/* ---------- my style: line under the title ---------- */
.style-line {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; text-align: left;
  background: var(--card); border: 0; border-radius: 18px; padding: 10px 12px; cursor: pointer;
  box-shadow: 0 8px 18px -12px rgba(4, 52, 80, 0.6);
}
.style-ico { width: 34px; height: 34px; border-radius: 12px; background: var(--clown); display: grid; place-items: center; flex: none; }
.style-ico svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.style-txt { min-width: 0; display: grid; }
.style-txt b { font: 600 16px/1.15 var(--f-display); }
.style-txt span { font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.style-go { margin-left: auto; font: 600 14px var(--f-display); color: var(--clown-deep); white-space: nowrap; }
.mine {
  display: inline-block; margin-left: 8px; vertical-align: 2px; font: 800 12px var(--f-body);
  color: var(--clown-ink); background: var(--clown-soft); padding: 3px 9px; border-radius: 999px;
}
.hidden-note { margin: 10px 4px 0; font-size: 13.5px; color: var(--on-water-2); font-weight: 700; }
.hidden-note .link { color: var(--on-water); }
.hero-card.empty h2 { max-width: none; }

/* ---------- my style: bottom sheet ---------- */
body.sheet-open { overflow: hidden; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(4, 40, 60, 0.4); }
.sheet {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); color: var(--ink); border-radius: 28px 28px 0 0;
  padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  box-shadow: 0 -10px 30px rgba(4, 52, 80, 0.35);
}
.sheet:focus { outline: none; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-h h2 { font-size: 24px; font-weight: 700; }
.sheet-reset { border: 0; background: none; cursor: pointer; font: 600 14px var(--f-display); color: var(--ink-2); padding: 6px; }
.sheet-hint { margin: 2px 0 12px; font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.presets button {
  border: 0; cursor: pointer; border-radius: 16px; padding: 9px 6px 8px; text-align: center;
  background: var(--card-2); color: var(--ink); font: 600 15px var(--f-display);
}
.presets svg { width: 26px; height: 16px; display: block; margin: 0 auto 3px; fill: #1fb9cf; }
.presets small { display: block; font: 700 11px var(--f-body); color: var(--ink-2); margin-top: 1px; }
.presets button.on { background: var(--clown); color: #fff; box-shadow: 0 3px 0 var(--clown-deep); }
.presets button.on svg { fill: #fff; }
.presets button.on small { color: rgba(255, 255, 255, 0.9); }
.slider { padding: 12px 0 10px; border-top: 2px dashed var(--line); margin-top: 6px; }
.slider-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.slider-h label, .slider-k { font: 600 17px var(--f-display); }
.readout {
  font: 800 13px var(--f-body); color: var(--clown-ink); background: var(--clown-soft);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.ends { display: flex; justify-content: space-between; margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 34px; margin: 6px 0 2px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track {
  height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, #5fe0e6, #1fb9cf) 0 0 / var(--pct, 50%) 100% no-repeat, var(--card-2);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 4px solid var(--clown); box-shadow: 0 2px 6px rgba(7, 48, 70, 0.3);
}
.range::-moz-range-track { height: 10px; border-radius: 5px; background: var(--card-2); }
.range::-moz-range-progress { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #5fe0e6, #1fb9cf); }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--clown); }
.range:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }
.drive-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.drive-chips button {
  border: 0; cursor: pointer; border-radius: 999px; padding: 7px 12px; min-height: 36px;
  background: var(--card-2); color: var(--ink); font: 600 14px var(--f-display);
}
.drive-chips button.on { background: var(--clown); color: #fff; }
.switches { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 12px 0 0; border-top: 2px dashed var(--line); margin-top: 6px; }
.sheet .switch { color: var(--ink); }
.sheet .switch span::before { background: var(--card-2); border-color: var(--line); }
.sheet .switch span::after { background: var(--ink-2); }
.sheet .switch input:checked + span::before { background: var(--clown); border-color: var(--clown); }
.sheet .switch input:checked + span::after { background: #fff; }
.place-here {
  display: block; width: 100%; border: 0; cursor: pointer; border-radius: 16px; padding: 12px 14px; margin: 4px 0 6px;
  background: var(--card-2); color: var(--ink); font: 600 16px var(--f-display); text-align: left;
}
.place-here::before { content: "⌖ "; }
.place-here.on { background: var(--clown); color: #fff; }
.place-country { border-top: 2px dashed var(--line); margin-top: 6px; }
.place-country > summary {
  list-style: none; cursor: pointer; padding: 12px 2px 8px; font: 600 19px var(--f-display);
  display: flex; align-items: baseline; gap: 8px;
}
.place-country > summary::-webkit-details-marker { display: none; }
.place-country > summary::after { content: "▾"; margin-left: auto; color: var(--ink-2); transition: transform 0.15s; }
.place-country:not([open]) > summary::after { transform: rotate(-90deg); }
.place-country > summary small { font: 700 12.5px var(--f-body); color: var(--ink-2); }
.place-group { padding: 0 0 6px; }
.place-group h3 { margin: 4px 0 0; font: 600 15px var(--f-display); color: var(--ink-2); }
.place-group h3 small { font: 700 12px var(--f-body); margin-left: 4px; }
#placeSheet .done { width: 100%; margin-top: 12px; }
.sw-note { margin: 6px 0 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.safety {
  display: flex; gap: 10px; align-items: flex-start; font-size: 13px;
  background: var(--yellow-soft); border: 2px dashed var(--yellow); border-radius: 16px; padding: 9px 12px;
}
.safety svg { flex: none; }
.safety p { margin: 0; }
.safety b { font: 600 14px var(--f-display); }
.preview { display: flex; align-items: center; gap: 12px; margin-top: 12px; min-height: 48px; }
.preview .badge { width: 48px; height: 48px; border-radius: 15px; font-size: 21px; flex: none; }
.preview p { margin: 0; font-size: 13.5px; }
.preview b { font: 600 15px var(--f-display); }
.btn.done { width: 100%; margin-top: 14px; font-size: 17px; }

/* sea-life stars */
.chip.life { background: var(--yellow-soft); color: var(--clown-ink); letter-spacing: 1px; }
.stars { color: var(--clown-ink); letter-spacing: 1px; }
.facts .wide { grid-column: 1 / -1; }
.pop-stars { color: #b84600; letter-spacing: 1px; }

/* tap-anywhere popups and saved spots */
.pop-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.pop-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.pop-reasons li { position: relative; padding-left: 14px; }
.pop-reasons li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: #4d7183; }
.pop-reasons li.good::before { background: #00917f; }
.pop-reasons li.bad::before { background: #d4335e; }
.leaflet-container .pop-btn.save, .pop-btn.save {
  border: 0; cursor: pointer; display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px;
  border-radius: 999px; background: #fff6d1; color: #073046; font: 600 13.5px var(--f-display);
}
.pop-saved { font: 600 13.5px var(--f-display); color: #00917f; }
.pop .err { color: #c81d4e; }
.pin.pin-mine { border-style: dashed; border-color: #073046; }
.mine-tag {
  display: inline-block; vertical-align: 3px; margin-left: 4px; padding: 1px 7px; border-radius: 999px;
  font: 700 11px var(--f-body); background: var(--yellow-soft); color: var(--clown-ink);
}

/* ---------- experiences: written up after a swim ---------- */
.ico-note { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chip.exp { background: var(--yellow-soft); color: var(--ink); display: inline-flex; gap: 4px; align-items: center; }
.exp-sec { margin-top: 16px; padding: 12px 14px 14px; border-radius: 18px; background: var(--card-2); }
.exp-sec h4 { margin: 0; font: 600 16px var(--f-display); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.exp-sec h4 span { font: 700 13px var(--f-body); color: var(--ink-2); }
.exp-meta { font: 700 13px var(--f-body); color: var(--ink-2); margin: 8px 0 0; }
.exp-meta b { color: var(--ink); font-family: var(--f-display); font-weight: 600; font-size: 14px; }
.exp-cond { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; align-items: center; }
.exp-cond .chip { margin: 0; background: var(--card); }
/* Like a map pin, with a class of its own: ".pin" means a map pin elsewhere. */
.exp-score {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 9px;
  background: var(--c); color: #fff; font: 700 12px/1 var(--f-display); font-variant-numeric: tabular-nums;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(7, 48, 70, 0.45);
}
.exp-said { font: 700 12.5px var(--f-body); color: var(--ink-2); margin-right: 2px; }
.exp-text { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; }
.exp-text p { margin: 0 0 6px; }
.exp-text.clip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.exp-photos { display: flex; gap: 6px; margin-top: 9px; overflow-x: auto; }
.exp-photo { flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 12px; overflow: hidden; }
.exp-photo img { display: block; width: 92px; height: 70px; object-fit: cover; }
.exp-sec .exp-photo img { width: 76px; height: 58px; }
.exp-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.exp-tags span { font: 700 12.5px var(--f-body); color: var(--aqua-ink); background: var(--card-2); padding: 3px 9px; border-radius: 999px; }
.exp-all { margin-top: 12px; width: 100%; background: var(--card); }
.exp-list .exp { padding: 14px 0 16px; border-top: 2px dashed var(--line); }
.exp-list .exp:first-child { border-top: 0; padding-top: 4px; }
.exp-list .exp-cond .chip { background: var(--card-2); }
.sheet-x { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--card-2); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(2, 20, 32, 0.96); display: grid; grid-template-rows: auto 1fr auto; color: #fff; }
.viewer[hidden] { display: none; }
.viewer:focus { outline: none; }
.viewer-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; font: 600 15px var(--f-display); }
.viewer-x { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.viewer-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; min-height: 0; }
.viewer-strip::-webkit-scrollbar { display: none; }
.viewer-strip figure { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; min-height: 0; }
.viewer-strip img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-cap { margin: 0; padding: 14px 18px calc(24px + env(safe-area-inset-bottom, 0px)); font-size: 14.5px; color: rgba(255, 255, 255, 0.88); }
.leaflet-container .pop-exp { margin: 8px 0 2px; }
.pop-exp button {
  border: 0; background: var(--yellow-soft); color: var(--ink); font: 600 14px var(--f-display);
  padding: 6px 12px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer;
}
/* The place's time zone, when it differs from the phone's. */
.tz-note { margin: 6px 4px 0; font-size: 12.5px; font-weight: 700; color: var(--on-water-2); }
