/* ---------- fonts (self-hosted, SIL Open Font License, see fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bebas Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); }

/* ---------- tokens ---------- */
:root {
  /* Partner brand colours: A Fishing Guru gold; Islamorada Dive Center blue, teal and navy. */
  --afg-gold: #f5a524;
  --idc-blue: #2b6fd4;
  --idc-teal: #3ecfcf;
  --idc-navy: #0b1e3a;
  --idc-deep: #060f1e;
  --display: "Bebas Neue", "Barlow Condensed", Impact, sans-serif;

  color-scheme: light;
  --page: #f4f5f3;
  --surface: #fcfcfb;
  --surface-2: #f3f3f0;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #6f6e69;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2b6fd4;
  --accent-ink: #ffffff;
  --idc-teal-ink: #138a8a;
  --idc-blue-ink: #2b6fd4;
  --afg-gold-ink: #b56f00;
  --night: rgba(30, 40, 70, 0.075);
  --twilight: rgba(30, 40, 70, 0.035);

  --tide: #2a78d6;
  --wind: #eb6834;
  --sea: #1baf7a;
  --sol: #eda100;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-ink: #006300;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.04);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #9a9890;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3ecfcf;
    --accent-ink: #06202e;
    --idc-teal-ink: #3ecfcf;
    --idc-blue-ink: #e8f0ff;
    --afg-gold-ink: #f5a524;
    --night: rgba(150, 170, 230, 0.07);
    --twilight: rgba(150, 170, 230, 0.035);
    --tide: #3987e5;
    --wind: #d95926;
    --sea: #199e70;
    --sol: #c98500;
    --good-ink: #0ca30c;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #9a9890;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3ecfcf;
  --accent-ink: #06202e;
  --idc-teal-ink: #3ecfcf;
  --night: rgba(150, 170, 230, 0.07);
  --twilight: rgba(150, 170, 230, 0.035);
  --tide: #3987e5;
  --wind: #d95926;
  --sea: #199e70;
  --sol: #c98500;
  --good-ink: #0ca30c;
  --shadow: none;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0 0 0.6em; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon, .chip-icon, .arrow, .status-icon { display: inline-flex; align-items: center; }

/* ---------- header ---------- */
.site-header {
  background:
    radial-gradient(900px 260px at 88% -40%, rgba(62, 207, 207, 0.22), transparent 65%),
    radial-gradient(700px 240px at 0% 130%, rgba(245, 165, 36, 0.12), transparent 60%),
    linear-gradient(120deg, var(--idc-deep), var(--idc-navy) 55%, #0e2c55);
  color: #fff;
  padding: 16px 0 14px;
  position: relative;
}
/* Shared brand stripe: A Fishing Guru gold into Islamorada Dive Center teal and blue. */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--afg-gold), var(--idc-teal) 55%, var(--idc-blue));
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; }
.brand { display: grid; gap: 10px; min-width: 0; }
.brand h1 { font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: 0.03em; line-height: 1; }
.brand p { margin: 3px 0 0; font-size: 14px; color: rgba(232, 240, 255, 0.8); }

/* Partner lockups */
.collab { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.collab-x { font-family: var(--display); font-size: 26px; color: rgba(232, 240, 255, 0.55); line-height: 1; }
.lockup { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
a.lockup:hover .wm-afg-a, a.lockup:hover .wm-idc b { text-decoration: underline; text-underline-offset: 3px; }
.partner-logo { height: 46px; width: auto; max-width: 100%; object-fit: contain; display: block; flex: none; }
.partner-logo-wrap .partner-logo { height: 58px; }
.mark-img { display: block; height: 20px; width: auto; }
.mark { display: block; flex: none; }
.lockup-afg .mark { width: 40px; height: 40px; }
.lockup-idc .mark { width: 54px; height: 35px; }
.afg-ring { fill: var(--idc-navy); stroke: var(--afg-gold); stroke-width: 2; }
.afg-wave { fill: none; stroke: var(--idc-teal); stroke-width: 1.8; stroke-linecap: round; }
.afg-hook { fill: none; stroke: var(--afg-gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.idc-box { fill: var(--idc-blue); }
.idc-diver { fill: #fff; }
.idc-limb { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.idc-torso { stroke-width: 6.5; }
.idc-tank { stroke-width: 4.4; }
.idc-arm { stroke-width: 2.4; }
.idc-leg { stroke-width: 3.6; }
.wm-afg { font-family: var(--display); font-size: 27px; letter-spacing: 0.04em; line-height: 1; white-space: nowrap; }
.wm-afg-b { color: var(--afg-gold); }
.wm-idc { display: grid; font-weight: 500; font-size: 17px; line-height: 1.02; letter-spacing: 0.07em; text-transform: lowercase; }
.wm-idc b { font-weight: 500; color: #e8f0ff; }
.wm-idc i { font-style: normal; color: var(--idc-teal); }

.header-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clock { font-size: 13px; color: rgba(232, 240, 255, 0.85); margin-right: 4px; font-variant-numeric: tabular-nums; }
.tool-btn, .units summary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.10); color: #fff; font-size: 13px; cursor: pointer;
}
.tool-btn:hover, .units summary:hover { background: rgba(255, 255, 255, 0.18); }
.i-theme { fill: none; stroke: #fff; stroke-width: 2; }
.i-theme-fill { fill: #fff; }
.i-refresh { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.refreshing .i-refresh { animation: spin 1s linear infinite; transform-origin: 12px 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.units { position: relative; }
.units summary { list-style: none; }
.units summary::-webkit-details-marker { display: none; }
.units-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 12px; display: grid; gap: 10px; min-width: 230px;
}
.seg { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.seg legend { font-size: 12px; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- alerts ---------- */
.alerts { display: grid; gap: 8px; margin-top: 14px; }
.alerts:empty { display: none; }
.alert { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--serious); border-radius: 10px; }
.alert.critical { border-left-color: var(--critical); }
.alert.warning { border-left-color: var(--warning); }
.alert summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.alert summary::-webkit-details-marker { display: none; }
.alert-when { color: var(--text-2); }
.alert-more { margin-left: auto; font-size: 13px; color: var(--accent); }
.alert[open] .alert-more { visibility: hidden; }
.alert-body { padding: 0 14px 12px 38px; }
.alert-headline { font-weight: 600; }
.alert-text { white-space: pre-line; color: var(--text-2); }

/* ---------- day navigation ---------- */
.day-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 18px 0 10px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 14px 8px 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; box-shadow: var(--shadow);
}
#next-day { padding: 8px 10px 8px 14px; }
.nav-btn:hover:not(:disabled) { border-color: var(--accent); }
.nav-btn:disabled { opacity: 0.4; cursor: default; }
.i-chevron { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon { display: inline-flex; }
.day-title { text-align: center; }
.day-title h2 { font-family: var(--display); font-weight: 400; font-size: 36px; letter-spacing: 0.03em; line-height: 1.05; }
.day-title p { margin: 2px 0 0; color: var(--text-2); }
.today-btn { margin-top: 6px; border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: underline; }

.day-strip {
  list-style: none; margin: 0 0 18px; padding: 4px 2px 10px;
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.day-strip li { flex: 0 0 auto; scroll-snap-align: center; }
.chip {
  width: 92px; display: grid; justify-items: center; gap: 1px; padding: 8px 4px 9px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; box-shadow: var(--shadow);
}
.chip:hover { border-color: var(--accent); }
.chip.past { background: var(--surface-2); }
.chip.past .chip-day { color: var(--muted); }
.chip.today { border-color: var(--accent); }
.chip.selected { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip.selected .chip-day, .chip.selected .chip-date, .chip.selected .chip-seas, .chip.selected .chip-wind { color: var(--accent-ink); }
.chip-day { font-weight: 700; font-size: 13px; }
.chip-date { font-size: 12px; color: var(--text-2); }
.chip-icon { height: 32px; }
.chip-temp { font-size: 13px; font-weight: 600; }
.chip-wind, .chip-seas { font-size: 11.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 2px; min-height: 16px; }
.chip.selected .wind-arrow path { fill: var(--accent-ink); }

/* ---------- layout ---------- */
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.outlook-row { grid-template-columns: 1fr; }
.three, .two { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .three { grid-template-columns: 1fr 1fr; }
  .three > :last-child { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .two { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .outlook-row { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .three { grid-template-columns: 1.05fr 1.2fr 1fr; }
  .three > :last-child { grid-column: auto; }
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.04em; line-height: 1.05; }
.conf { font-size: 12px; color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
body.refreshing main { opacity: 0.7; transition: opacity 0.2s; }

/* ---------- outlook ---------- */
.rating { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px;
  border-radius: 999px; font-weight: 700; font-size: 18px; background: var(--surface-2); border: 1px solid var(--border);
}
.status-svg > :first-child { stroke: none; }
.status-svg.good > :first-child { fill: var(--good); }
.status-svg.warning > :first-child { fill: var(--warning); }
.status-svg.serious > :first-child { fill: var(--serious); }
.status-svg.critical > :first-child { fill: var(--critical); }
.status-svg .mark { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status-svg.warning .mark { stroke: #3a2a00; }
.stars { font-size: 20px; letter-spacing: 1px; color: var(--axis); }
.star.on { color: var(--sol); }
.reasons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.reasons li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; font-size: 14px; color: var(--text-2); }
.r-mark { font-weight: 800; text-align: center; color: var(--muted); }
.reasons .plus .r-mark { color: var(--good-ink); }
.reasons .minus .r-mark { color: var(--critical); }
.wetsuit { font-size: 14px; margin-bottom: 10px; }
.outlook { display: flex; flex-direction: column; }
.outlook-fishing { border-top: 4px solid var(--afg-gold); }
.outlook-diving { border-top: 4px solid var(--idc-blue); }
.byline { display: flex; align-items: center; gap: 6px; margin: 5px 0 0; font-size: 12.5px; color: var(--text-2); }
.byline strong { font-weight: 600; color: var(--text); }
.byline-mark .mark-afg { width: 18px; height: 18px; }
.byline-mark .mark-idc { width: 24px; height: 16px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: auto; padding-top: 14px; }
.outlook .cta-row { border-top: 1px solid var(--grid); margin-top: 14px; }
.outlook .reasons { margin-bottom: auto; }
.cta {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border-radius: 999px;
  font-weight: 600; font-size: 14px; text-decoration: none; color: #fff;
}
.cta:hover { filter: brightness(1.1); }
.cta-fishing { background: var(--idc-navy); box-shadow: inset 0 0 0 2px var(--afg-gold); }
.cta-diving { background: var(--idc-blue); }
.cta-phone { font-weight: 600; font-size: 14px; color: var(--text-2); text-decoration: none; }
.cta-phone:hover { text-decoration: underline; }
.live-dot { font-size: 12px; color: var(--good-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }

.kv { margin: 0; display: grid; gap: 8px; }
.kv-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; display: grid; }
.kv dd small { color: var(--muted); font-size: 12px; }
.kv.compact { gap: 4px; }
.kv.compact .kv-row { grid-template-columns: minmax(110px, auto) 1fr; }
.kv.compact dd { font-variant-numeric: tabular-nums; }
.summary-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.summary-desc { font-size: 18px; font-weight: 700; margin: 0; }
.nws-short p { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.nws-short { margin-bottom: 10px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  display: grid; gap: 2px; box-shadow: var(--shadow); min-width: 0;
}
.tile-label { font-size: 12.5px; color: var(--muted); }
.tile-value { font-size: 21px; font-weight: 650; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tile-sub { font-size: 12.5px; color: var(--text-2); }
.tile .wind-arrow path { fill: var(--text-2); }

/* ---------- chart ---------- */
.select-label { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
select {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; max-width: 220px;
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 16px; height: 2px; border-radius: 1px; display: inline-block; }
.lg-box { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-line.tide { background: var(--tide); }
.lg-line.wind { background: var(--wind); }
.lg-line.sea { background: var(--sea); }
.lg-box.gust { background: color-mix(in srgb, var(--wind) 22%, transparent); }
.lg-box.major { background: color-mix(in srgb, var(--sol) 40%, transparent); }
.lg-box.minor { background: color-mix(in srgb, var(--sol) 20%, transparent); }
.lg-box.night { background: var(--night); border: 1px solid var(--border); }
.chart-host { position: relative; width: 100%; }
.day-chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
.day-chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.day-chart text { font-family: inherit; }
.day-chart .night { fill: var(--night); }
.day-chart .twilight { fill: var(--twilight); }
.day-chart .grid { stroke: var(--grid); stroke-width: 1; }
.day-chart .baseline { stroke: var(--axis); stroke-width: 1; }
.day-chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.day-chart .panel-title { fill: var(--text-2); font-size: 12px; font-weight: 600; }
.day-chart .tide-line { fill: none; stroke: var(--tide); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.day-chart .tide-area { fill: var(--tide); opacity: 0.1; }
.day-chart .tide-dot { fill: var(--tide); stroke: var(--surface); stroke-width: 2; }
.day-chart .tide-label { fill: var(--text); font-size: 11px; font-weight: 650; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.day-chart .tide-time { font-weight: 450; fill: var(--text-2); }
.day-chart .wind-line { fill: none; stroke: var(--wind); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.day-chart .gust-area { fill: var(--wind); opacity: 0.13; }
.day-chart .gust-line { fill: none; stroke: var(--wind); stroke-width: 1; opacity: 0.45; }
.day-chart .sea-line { fill: none; stroke: var(--sea); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.day-chart .sea-area { fill: var(--sea); opacity: 0.1; }
.day-chart .sol-major { fill: var(--sol); opacity: 0.24; }
.day-chart .sol-minor { fill: var(--sol); opacity: 0.12; }
.day-chart .sun-tick { stroke: var(--axis); stroke-width: 1; }
.day-chart .sun-label { fill: var(--text-2); font-size: 11px; }
.day-chart .now-line { stroke: var(--text); stroke-width: 1.5; }
.day-chart .now-label { fill: var(--text); font-size: 11px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.day-chart .empty { fill: var(--muted); font-size: 13px; }
.day-chart .hit { fill: transparent; cursor: crosshair; }
.day-chart .xhair-line { stroke: var(--text-2); stroke-width: 1; }
.day-chart .xhair-dot { stroke: var(--surface); stroke-width: 2; }
.day-chart .xhair-dot.tide { fill: var(--tide); }
.day-chart .xhair-dot.wind { fill: var(--wind); }
.day-chart .xhair-dot.sea { fill: var(--sea); }
.chart-tip {
  position: absolute; top: 40px; left: 0; z-index: 5; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); padding: 8px 10px; min-width: 170px; font-size: 13px;
}
.tip-time { font-weight: 700; margin-bottom: 4px; }
.tip-row { display: grid; grid-template-columns: 12px auto 1fr; align-items: center; gap: 6px; }
.tip-row strong { font-weight: 650; white-space: nowrap; }
.tip-label { color: var(--muted); font-size: 12px; text-align: right; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; }
.tip-key.tide { background: var(--tide); }
.tip-key.wind { background: var(--wind); }
.tip-key.sea { background: var(--sea); }
.tip-note { margin-top: 4px; font-size: 12px; color: var(--text-2); }

/* ---------- tides / sun & moon / bite ---------- */
.tide-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tide-block h4 { font-size: 14px; margin-bottom: 6px; }
.tide-block h4 small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.tide-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 14px; }
.tide-table th, .tide-table td { padding: 4px 6px 4px 0; text-align: left; border-top: 1px solid var(--grid); }
.tide-table th { font-weight: 600; width: 46px; }
.tide-table td.num { text-align: right; }
.tide-table tr.low th { color: var(--text-2); font-weight: 500; }
.tide-now { font-size: 13px; color: var(--text-2); margin: 6px 0 0; }

.sm-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .sm-grid { grid-template-columns: 1fr 1fr; } }
.moon-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.moon-hero > div { display: grid; }
.moon-hero small { color: var(--muted); }
.moon-dark { fill: var(--surface-2); stroke: var(--axis); stroke-width: 1; }
.moon-lit { fill: #e9e4cf; }
:root[data-theme="dark"] .moon-lit { fill: #f1ead2; }
.phase-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 13px; }
.phase-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; align-items: center; }

.bite-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.bite-list li { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.bite-time { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bite-time strong { font-variant-numeric: tabular-nums; }
.bite-kind { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--sol) 26%, transparent); }
.bite-kind.minor { background: color-mix(in srgb, var(--sol) 12%, transparent); }
.bite-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 3px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--grid); display: inline-block; }
.dots i.on { background: var(--sol); }

/* ---------- forecasts ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tab { border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.tab[aria-pressed="true"],
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.zone-name { font-size: 12px; color: var(--muted); }
.periods { display: grid; gap: 10px; }
.period h4 { font-size: 14px; margin-bottom: 2px; }
.period p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- fishing & lobster guide ---------- */
:root {
  --rate-good: #86b6ef;
  --rate-peak: #256abf;
  --rate-good-chip: #cde2fb;
  --rate-good-ink: #104281;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --rate-good: #184f95;
    --rate-peak: #3987e5;
    --rate-good-chip: #184f95;
    --rate-good-ink: #e8f0ff;
  }
}
:root[data-theme="dark"] {
  --rate-good: #184f95;
  --rate-peak: #3987e5;
  --rate-good-chip: #184f95;
  --rate-good-ink: #e8f0ff;
}
.guide { margin-bottom: 14px; }
.section-title { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.04em; margin: 22px 0 12px; }
.guide-row { grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .guide-row { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); } }
.guide-side { display: grid; gap: 14px; }
.guide-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.guide-controls .tabs { margin: 0; }
.check { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.sp-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.sp { border: 1px solid var(--border); border-left: 4px solid var(--rate-good); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: grid; gap: 6px; align-content: start; }
.sp-P { border-left-color: var(--rate-peak); }
.sp-slow { border-left-color: var(--axis); }
.sp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sp-head h4 { font-size: 16px; font-weight: 700; }
.rating { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.rating-P { background: var(--rate-peak); color: #fff; }
.rating-G { background: var(--rate-good-chip); color: var(--rate-good-ink); }
.rating-slow { background: var(--grid); color: var(--text-2); }
.sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sp-group { font-size: 12px; color: var(--muted); }
.harvest { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.harvest .status-svg { width: 14px; height: 14px; }
.harvest.release { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--axis); color: var(--text-2); font-weight: 600; }
.sp-where, .sp-best, .sp-rule { margin: 0; font-size: 13.5px; color: var(--text-2); }
.sp-best strong, .sp-rule strong { color: var(--text); font-weight: 600; }
.sp-rule { font-size: 12.5px; }
.more-btn { margin-top: 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 7px 16px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--accent); }
.more-btn:hover { border-color: var(--accent); }

.lobster-headline { margin: 2px 0 10px; font-weight: 600; }
.yearbar-wrap { margin: 0 0 4px; }
.yearbar { display: block; width: 100%; height: auto; }
.yb-track { fill: var(--grid); }
.yb-open { fill: var(--good); }
.yb-mini { fill: var(--afg-gold); }
.yb-tick { stroke: var(--surface); stroke-width: 1.5; }
.yb-label { fill: var(--muted); font-size: 11px; }
.yb-today { fill: var(--text); }
.yb-today-line { stroke: var(--text); stroke-width: 2; }
.lg-box.yb-open-key { background: var(--good); }
.lg-box.yb-mini-key { background: var(--afg-gold); }
.lg-line.yb-today-key { background: var(--text); width: 2px; height: 12px; }
.mini-dates { font-size: 13.5px; color: var(--text-2); margin: 8px 0 10px; }
.mini-dates strong { color: var(--text); }
.rules { margin: 0; display: grid; gap: 7px; }
.rule { display: grid; grid-template-columns: 88px 1fr; gap: 8px; font-size: 13.5px; }
.rule dt { font-weight: 600; color: var(--text); }
.rule dd { margin: 0; color: var(--text-2); }
.mini-rules { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.mini-rules.active { border-color: var(--afg-gold); box-shadow: inset 4px 0 0 var(--afg-gold); }
.mini-rules ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.stone-crab { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--grid); }
.stone-crab h4 { font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.stone-crab p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.basics { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }

.cal-legend { margin-bottom: 10px; }
.lg-box.cal-P { background: var(--rate-peak); }
.lg-box.cal-G { background: var(--rate-good); }
.lg-box.cal-slow { background: var(--surface-2); border: 1px solid var(--border); }
.x-key { font-size: 12px; font-weight: 700; color: var(--text-2); }
.cr { margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--axis); color: var(--text-2); vertical-align: 1px; }
.cal-scroll { overflow-x: auto; border: 1px solid var(--grid); border-radius: 10px; }
.calendar { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 640px; font-size: 13px; }
.calendar th { font-weight: 600; text-align: center; color: var(--text-2); padding: 4px 2px; }
.calendar thead th.cur { color: var(--accent); }
.calendar .rowhead { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; white-space: nowrap; padding: 4px 10px 4px 8px; color: var(--text); font-weight: 600; }
.calendar .cal-group th { text-align: left; font-family: var(--display); font-weight: 400; font-size: 16px; letter-spacing: 0.05em; color: var(--text-2); padding: 10px 8px 2px; }
/* The group row spans the whole table, so keep just its label pinned while scrolling. */
.calendar .cal-group th span { position: sticky; left: 8px; }
.calendar td.cal { height: 24px; border-radius: 4px; text-align: center; min-width: 38px; }
.calendar td.cal-P { background: var(--rate-peak); }
.calendar td.cal-G { background: var(--rate-good); }
.calendar td.cal-slow { background: var(--surface-2); }
.calendar td.cur { box-shadow: inset 0 0 0 2px var(--text); }
.calendar .x { font-size: 11px; font-weight: 700; color: var(--text); }
.calendar td.cal-P .x { color: #fff; }

/* ---------- hourly ---------- */
.hourly-scroll { overflow-x: auto; border: 1px solid var(--grid); border-radius: 10px; }
.hourly { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.hourly th, .hourly td { padding: 6px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--grid); }
.hourly tbody tr:last-child th, .hourly tbody tr:last-child td { border-bottom: 0; }
.hourly thead th { font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
.hourly .rowhead { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--surface); font-weight: 600; color: var(--text-2); border-right: 1px solid var(--grid); min-width: 104px; }
.hourly thead .rowhead { background: var(--surface-2); z-index: 2; }
.hourly td.nightcol, .hourly th.nightcol { background: var(--night); }
.hourly .now { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.hourly thead th.now { color: var(--accent); }
.cell-icon { justify-content: center; }
.hourly .arrow { vertical-align: -2px; margin-right: 2px; }

/* ---------- icons ---------- */
.wx-icon .i-sun { fill: #fab219; }
.wx-icon .i-ray { stroke: #fab219; stroke-width: 2; stroke-linecap: round; }
.wx-icon .i-moon { fill: #c9c3a8; }
.wx-icon .i-cloud { fill: #c7ccd3; stroke: #9aa3ad; stroke-width: 1; }
.wx-icon .i-rain { stroke: #3987e5; stroke-width: 2; stroke-linecap: round; }
.wx-icon .i-bolt { fill: #fab219; stroke: #b47800; stroke-width: 0.6; }
.wx-icon .i-fog { stroke: #9aa3ad; stroke-width: 2; stroke-linecap: round; }
.wx-icon .i-snow { fill: #9ec5f4; }
.wind-arrow path { fill: var(--text-2); }
.moon-inline .moon-dark { stroke-width: 1; }

/* ---------- footer ---------- */
.site-footer { margin-top: 28px; padding: 26px 0 36px; border-top: 1px solid var(--border); background: var(--surface); }
.partners { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.partners-title { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.05em; color: var(--text-2); text-align: center; margin-bottom: 14px; }
.partner-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .partner-grid { grid-template-columns: 1fr 1fr; } }
.partner { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.partner-fishing { border-top: 4px solid var(--afg-gold); }
.partner-diving { border-top: 4px solid var(--idc-blue); }
.partner-logo-wrap { margin-bottom: 6px; }
.partner .wm-afg-a { color: var(--text); }
.partner .wm-afg-b { color: var(--afg-gold-ink); }
.partner .wm-idc b { color: var(--idc-blue-ink); }
.partner .wm-idc i { color: var(--idc-teal-ink); }
.partner-blurb { font-weight: 600; color: var(--text); margin: 0; }
.partner-tagline { color: var(--text-2); margin: 0; }
.partners-address { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; font-size: 13.5px; color: var(--text-2); }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1fr 1.4fr; } }
.site-footer h3 { font-family: var(--display); font-weight: 400; font-size: 19px; letter-spacing: 0.04em; color: var(--text); margin-bottom: 8px; }
.source-status { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.source-status li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--grid); padding: 3px 0; }
.source-status li.err span:first-child::after { content: " ⚠"; color: var(--critical); }
.biz:empty { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .site-header { padding: 10px 0; }
  .brand h1 { font-size: 27px; }
  .brand p { display: none; }
  .collab { gap: 10px; }
  .collab-x { font-size: 20px; }
  .lockup { gap: 7px; }
  .lockup-afg .mark { width: 32px; height: 32px; }
  .collab .partner-logo { height: 36px; }
  .lockup-idc .mark { width: 44px; height: 29px; }
  .wm-afg { font-size: 21px; }
  .wm-idc { font-size: 13.5px; }
  .day-title h2 { font-size: 28px; }
  .clock { width: 100%; order: -1; }
  .header-inner { gap: 8px; }
  .header-tools { width: 100%; justify-content: flex-start; }
  .nav-text { display: none; }
  .nav-btn, #next-day { padding: 8px; }
  .chip { width: 82px; }
  .card { padding: 14px; }
  .tile-value { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .day-strip, .nav-btn, .header-tools, #today-btn { display: none; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
}
