/**
 * Faded Buoy Report — Electric Tide Design System
 * Clean, minimal surf report UI
 */

:root {
  /* ===== ELECTRIC TIDE — locked palette ===== */
  /* base / ground */
  --abyss: #0B0E14;       /* page background */
  --deep-navy: #141A24;   /* card surface */
  --hull: #1C2430;        /* raised panel */
  --rule: #222C38;        /* hairline dividers */
  --frame: #2A3340;       /* card borders */

  /* text */
  --foam: #EAF2F7;        /* primary text (never pure white) */
  --haze: #8A93A0;        /* secondary / labels */
  --slate-gray: #5E6878;  /* captions / timestamps */

  /* accents */
  --tide: #2BB3D9;        /* PRIMARY — bright cyan, data + headers */
  --sky: #4F9BE8;         /* secondary blue */
  --coral: #FF7A4D;       /* WARNING ONLY — blown out / alerts */
  --mustard: #E0A95C;     /* optional warm highlight */

  /* fonts */
  --display: 'Bebas Neue', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --body: 'Work Sans', sans-serif;
}

/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--abyss);
  color: var(--foam);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Subtle radial glow + grain texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(800px 460px at 80% -10%, rgba(43,179,217,.07), transparent 60%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 22px 64px;
  position: relative;
  z-index: 1;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  height: 42px;
  width: auto;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-word {
  font-family: var(--display);
  font-size: 34px;
  line-height: .78;
  letter-spacing: .02em;
  color: var(--foam);
}

.logo-word b {
  color: var(--tide);
  font-weight: inherit;
}

.logo-coords {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--slate-gray);
  margin-top: 3px;
  white-space: nowrap;
}

.live {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clock {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--haze);
  letter-spacing: .06em;
}

.refresh {
  background: transparent;
  border: 1px solid var(--frame);
  color: var(--haze);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: 3px;
  cursor: pointer;
  transition: .2s;
  text-decoration: none;
}

.refresh:hover {
  border-color: var(--tide);
  color: var(--tide);
}

.refresh:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 2px;
}

.refresh.spinning {
  border-color: var(--tide);
  color: var(--tide);
  animation: refresh-spin .8s linear infinite;
}

/* Install (PWA) button — cyan-accented to stand out from refresh */
.install {
  background: transparent;
  border: 1px solid var(--tide);
  color: var(--tide);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: 3px;
  cursor: pointer;
  transition: .2s;
}

.install:hover {
  background: var(--tide);
  color: var(--abyss);
}

.install[hidden] { display: none; }

/* Glyph + label spacing for top-bar buttons (label hides on mobile) */
.btn-label { margin-left: 5px; }

/* Share button */
.share {
  background: transparent;
  border: 1px solid var(--frame);
  color: var(--haze);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: 3px;
  cursor: pointer;
  transition: .2s;
  white-space: nowrap;
}
.share:hover { border-color: var(--tide); color: var(--tide); }
.share.busy { opacity: .6; pointer-events: none; }

/* Right side of a panel head: source meta + per-section share button */
.ph-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ph-right .meta { text-align: right; }

/* Compact per-section share button (Swell/Wind forecast + trend panels) */
.share-mini {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--frame);
  color: var(--haze);
  font-size: 13px;
  line-height: 1;
  width: 30px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  transition: .2s;
}
.share-mini:hover { border-color: var(--tide); color: var(--tide); }
.share-mini:focus-visible { outline: 2px solid var(--tide); outline-offset: 2px; }
.share-mini.busy { opacity: .5; pointer-events: none; }

/* Toast (share fallback feedback) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--deep-navy);
  border: 1px solid var(--tide);
  color: var(--foam);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 10px 16px;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 10000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* iOS "Add to Home Screen" hint */
.ios-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--deep-navy);
  border: 1px solid var(--tide);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--haze);
}

.ios-hint b { color: var(--foam); font-weight: 600; }
.ios-hint .ios-share { font-size: 13px; }
.ios-hint[hidden] { display: none; }

.ios-hint-x {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--slate-gray);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.ios-hint-x:hover { color: var(--foam); }

@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

/* ===== HERO CARD ===== */
.card {
  border: 2px solid var(--frame);
  background: var(--deep-navy);
  box-shadow: inset 0 2px 30px rgba(0,0,0,.5);
  overflow: hidden;
  margin-bottom: 16px;
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 0;
}

.spot {
  font-family: var(--display);
  font-size: 46px;
  line-height: .86;
}

.loc {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--haze);
  margin-top: 6px;
}

.asof {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-gray);
  text-align: right;
  line-height: 1.7;
  white-space: nowrap;
}

.verdict-row {
  display: flex;
  flex-wrap: wrap; /* long verdict + stamp must not clip on phones */
  align-items: center;
  gap: 16px;
  row-gap: 10px;
  padding: 16px 24px 22px;
}

.verdict {
  font-family: var(--display);
  font-size: 40px;
  line-height: .85;
  letter-spacing: .02em;
  color: var(--tide);
}

.stamp {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tide);
  border: 1.5px solid var(--tide);
  border-radius: 3px;
  padding: 6px 11px;
  transform: rotate(-3deg);
}

.stamp.fair {
  color: var(--mustard);
  border-color: var(--mustard);
}

.stamp.blown {
  color: var(--coral);
  border-color: var(--coral);
}

.stamp.flat {
  color: var(--slate-gray);
  border-color: var(--slate-gray);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}

.metric {
  padding: 22px 22px 24px;
  border-right: 1px solid var(--rule);
}

.metric:last-child {
  border-right: none;
}

.metric .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 12px;
}

.metric .val {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 42px;
  line-height: .95;
}

.metric .val .u {
  font-size: 14px;
  color: var(--haze);
  font-weight: 400;
}

.metric .det {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--haze);
  margin-top: 8px;
}

.compass {
  margin-top: 8px;
}

.compass svg {
  width: 42px;
  height: 42px;
}

/* ===== SECONDARY METRICS STRIP ===== */
.substrip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.subcard {
  border: 1px solid var(--frame);
  background: var(--deep-navy);
  padding: 14px 16px;
}

.subcard .l {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate-gray);
  margin-bottom: 6px;
}

.subcard .v {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 18px;
}

.subcard .v .u {
  font-size: 11px;
  color: var(--haze);
}

/* ===== TREND PANEL ===== */
.panel {
  border: 1px solid var(--frame);
  background: var(--deep-navy);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
}

.panel-head h1,
.panel-head h2,
.panel-head h3 { flex-shrink: 0; } /* the meta wraps, the title never */

.panel-head h1,
.panel-head h2,
.panel-head h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .04em;
}

.panel-head .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-gray);
  text-align: right;
  line-height: 1.5;
}

.chart {
  padding: 18px 20px 20px;
}

.chart svg {
  width: 100%;
  height: 120px;
  display: block;
}

.chart-area {
  position: relative;
}

/* Y-axis scale labels overlaid in the chart corners */
.y-lbl {
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--slate-gray);
  background: rgba(20, 26, 36, .6);
  padding: 0 4px;
  pointer-events: none;
}

.y-max { top: -2px; }
.y-min { bottom: -2px; }

/* Labeled y-axis ticks — one per gridline, centered on the line. Positioned
   in px (top) by JS to match the chart's fixed 120px height. */
.y-tick {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--slate-gray);
  background: rgba(20, 26, 36, .6);
  padding: 0 4px;
  pointer-events: none;
  z-index: 2;
}

/* X-axis time labels below the chart */
.x-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-gray);
}

/* HTML overlays for chart annotations — text inside the stretched SVG
   (preserveAspectRatio="none") gets horizontally squeezed on phones */
.now-lbl {
  position: absolute;
  top: 12px;
  margin-left: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--haze);
  pointer-events: none;
  z-index: 2;
}
.compass-lbl {
  position: absolute;
  left: 4px;
  transform: translateY(-110%);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--slate-gray);
  background: rgba(20, 26, 36, .55);
  padding: 0 2px;
  pointer-events: none;
  z-index: 2;
}

/* Interactive chart scrubber (crosshair + dot + value tooltip) */
.chart-area.scrubbable { touch-action: pan-y; cursor: crosshair; }

.scrub-line, .scrub-dot, .scrub-tip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 3;
}
.chart-area.scrub-active .scrub-line,
.chart-area.scrub-active .scrub-dot,
.chart-area.scrub-active .scrub-tip { opacity: 1; }

.scrub-line {
  top: 0; bottom: 0;
  width: 1px;
  background: var(--haze);
  transform: translateX(-0.5px);
}
.scrub-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--foam);
  border: 2px solid var(--tide);
  transform: translate(-50%, -50%);
}
.scrub-tip {
  top: 2px;
  background: rgba(11, 14, 20, .9);
  border: 1px solid var(--frame);
  color: var(--foam);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .03em;
  padding: 3px 7px;
  border-radius: 3px;
  white-space: nowrap;
  transform: translateX(-50%);
}

/* ===== SOURCE FOOTER ===== */
.src-foot {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-gray);
  text-align: center;
  margin-top: 34px;
  line-height: 1.8;
}

/* ===== ERROR MESSAGE ===== */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--coral);
  color: var(--coral);
  padding: 1rem;
  border-radius: 3px;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
}

.retry-button {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--tide);
  color: var(--abyss);
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  transition: all 0.2s ease;
  border-radius: 3px;
}

.retry-button:hover {
  background: var(--sky);
  transform: scale(1.05);
}

.retry-button:active {
  transform: scale(0.98);
}

/* ===== RESPONSIVE ===== */
@media(max-width: 520px) {
  /* Declutter the top bar: drop the clock, collapse buttons to icons. */
  .clock { display: none; }
  .live { gap: 8px; }
  .btn-label { display: none; }
  .install, .share { padding: 7px 9px; }

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

  .metric {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .metric:last-child {
    border-bottom: none;
  }

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

  .wrap {
    padding: 24px 16px 48px;
  }

  .spot {
    font-size: 36px;
  }

  .verdict {
    font-size: 32px;
  }

  .metric .val {
    font-size: 36px;
  }

  /* Disable grain texture on mobile for better performance */
  body::before {
    display: none;
  }
}

/* ============================================================
   ADDED-BACK SECTIONS — Electric Tide components
   ============================================================ */

/* Hero quality score chip */
.score {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  color: var(--foam);
}
.score .s {
  font-size: 13px;
  color: var(--haze);
}
.verdict-row .stamp {
  margin-left: auto;
}

/* Generic stat grid (hairlines via 1px gap over rule-colored bg) */
.statgrid {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
}
.statgrid-3 { grid-template-columns: repeat(3, 1fr); }
.statgrid-4 { grid-template-columns: repeat(4, 1fr); }
.statgrid-5 { grid-template-columns: repeat(5, 1fr); }

.period-note {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-gray);
  padding: 9px 20px;
  border-top: 1px solid var(--rule);
}
.statcell {
  background: var(--deep-navy);
  padding: 16px 18px;
}
.statcell .l {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate-gray);
  margin-bottom: 6px;
}
.statcell .v {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 16px;
  color: var(--foam);
}
.statcell .v .u {
  font-size: 11px;
  color: var(--haze);
}

/* Secondary header inside a panel (wind direction sub-chart) */
.panel-subhead {
  display: flex;
  flex-wrap: wrap; /* tabs + legend overflow phone width — wrap, don't clip */
  justify-content: space-between;
  align-items: center;
  row-gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate-gray);
}
.panel-subhead .legend { display: flex; gap: 14px; align-items: center; }
.panel-subhead .legend i {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-off { background: var(--tide); }
.dot-on  { background: var(--coral); }

/* Forecast panel — legend dots echo CDIP (obs / NCEP / ECMWF) */
.dot-obs  { background: var(--tide); }
.dot-gfs  { background: var(--coral); }
.dot-ec   { background: var(--mustard); }
.dot-hrrr { background: var(--sky); }

/* Forecast metric tabs (Hs / Tp / Dp) */
.fc-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-tab {
  background: none;
  border: 1px solid var(--frame);
  color: var(--slate-gray);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
}
.fc-tab:hover { color: var(--haze); }
.fc-tab.active { color: var(--foam); border-color: var(--tide); }

/* kt / mph segmented toggle */
.unit-seg {
  display: flex;
  border: 1px solid var(--frame);
  border-radius: 3px;
  overflow: hidden;
}
.unit-seg button {
  background: none;
  border: none;
  color: var(--slate-gray);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .5px;
  padding: 3px 9px;
  cursor: pointer;
}
.unit-seg button + button { border-left: 1px solid var(--frame); }
.unit-seg button.active { color: var(--abyss); background: var(--tide); font-weight: 600; }
@media (max-width: 520px) {
  .unit-seg button { padding: 8px 10px; }
}

/* Windy-style wind model table */
.wind-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--rule);
  /* Branded scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: var(--frame) var(--abyss);
}
/* Branded scrollbar (WebKit) */
.wind-table-wrap::-webkit-scrollbar { height: 8px; }
.wind-table-wrap::-webkit-scrollbar-track { background: var(--abyss); }
.wind-table-wrap::-webkit-scrollbar-thumb {
  background: var(--frame);
  border-radius: 4px;
  border: 2px solid var(--abyss);
}
.wind-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--tide); }
.wind-table {
  border-collapse: collapse;
  font-family: var(--mono);
  white-space: nowrap;
}
.wind-table th {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-gray);
  text-align: left;
  padding: 5px 8px 4px;
}
.wind-table .wt-days th { border-bottom: 1px solid var(--rule); color: var(--haze); }
.wind-table .wt-days th:not(.wt-sticky) { border-left: 1px solid var(--frame); }
.wind-table .wt-hours th { padding-top: 2px; padding-bottom: 6px; text-align: center; }
.wind-table td {
  min-width: 42px;
  padding: 6px 4px 7px;
  text-align: center;
  border-left: 1px solid rgba(34, 44, 56, .55);
  border-top: 1px solid rgba(34, 44, 56, .55);
}
.wind-table td b { display: block; font-size: 12px; font-weight: 600; color: var(--foam); line-height: 1.3; }
.wind-table td i { display: block; font-style: normal; font-size: 9px; color: var(--haze); line-height: 1.2; }
.wt-arrow {
  display: block;
  font-size: 11px;
  line-height: 1;
  height: 12px;
  color: var(--coral); /* onshore */
}
.wt-arrow.off { color: var(--tide); } /* offshore */
.wt-sticky {
  position: sticky;
  left: 0;
  background: var(--deep-navy);
  z-index: 2;
  border-right: 1px solid var(--rule);
}
.wt-empty { background: none; }

/* Wind map tab — locator with per-model direction chips */
.wind-map {
  height: 300px;
  background: var(--abyss);
  border-top: 1px solid var(--rule);
  z-index: 1;
}
.wind-map[hidden] { display: none; }
.wind-pt { position: relative; }
.wp-dot {
  position: absolute;
  left: -5px; top: -5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--foam);
  border: 2px solid var(--tide);
  box-shadow: 0 0 0 4px rgba(43, 179, 217, .25);
}
/* Radius ring around the locator (Windy-style) */
.wp-ring {
  position: absolute;
  left: -58px; top: -58px;
  width: 116px; height: 116px;
  border: 1px solid rgba(234, 242, 247, .15);
  border-radius: 50%;
}

/* Windy-style flags: each source is a vertical lozenge pivoting around the
   dot (rotated to where the wind blows), heat-tinted by speed with a
   model-colored border; the label reads outward along the flag. */
.wp-flag {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
}
.wp-flag-body {
  position: absolute;
  left: -9px; top: -94px;
  width: 18px; height: 86px;
  display: block;
  border-radius: 3px;
  /* Slim pennant: tapers to a point at the dot-facing end. The background
     (model color, set inline) shows as a 1px rim around the inset fill. */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 50% 100%, 0 calc(100% - 9px));
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--foam);
}
.wp-flag-fill {
  position: absolute;
  top: 1px; left: 1px; right: 1px; bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  border-radius: 2px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), 50% 100%, 0 calc(100% - 8px));
  padding-bottom: 8px;
  white-space: nowrap;
}

/* South-half flags: counter-rotate so the label stays right side up; the
   180° spin moves the local bottom away from the dot, so the pennant point
   flips to the local top to keep facing the reference dot. */
.wp-flag-body.flip {
  transform: rotate(180deg);
  clip-path: polygon(50% 0, 100% 9px, 100% 100%, 0 100%, 0 9px);
}
.wp-flag-body.flip .wp-flag-fill {
  clip-path: polygon(50% 0, 100% 8px, 100% 100%, 0 100%, 0 8px);
  padding-bottom: 0;
  padding-top: 8px;
}

/* Wind detail callout pinned over the map, tracking the slider */
.wind-callout {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 1000;
  pointer-events: none;
  background: rgba(11, 14, 20, .92);
  border: 1px solid var(--frame);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: var(--mono);
}
.wind-callout h5 {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--haze);
  margin: 0 0 7px;
}
.wc-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--foam);
  padding: 2.5px 0;
}
.wc-row i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.wc-row b { width: 44px; font-weight: 600; letter-spacing: .04em; }
.wc-row .wc-kt { width: 34px; text-align: right; }
.wc-row .wc-g { width: 28px; color: var(--haze); }
.wc-row .wc-dir { width: 30px; color: var(--haze); }
.wc-row em { font-style: normal; font-size: 9px; letter-spacing: .06em; }
.wc-row em.off { color: var(--tide); }
.wc-row em.on { color: var(--coral); }
@media (max-width: 520px) {
  .wind-callout { top: 8px; right: 8px; padding: 8px 10px; }
  .wc-row { font-size: 9px; gap: 5px; }
  .wc-row b { width: 38px; }
}

/* Map time slider */
.wind-map-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
}
.wind-map-bar[hidden] { display: none; }
.wind-map-bar input[type="range"] {
  flex: 1;
  accent-color: var(--tide);
  min-width: 0;
}
.wm-time {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--haze);
  white-space: nowrap;
  min-width: 96px;
  text-align: right;
}

/* Tide hi/lo schedule strip */
.tide-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
}
.tide-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  border: 1px solid var(--frame);
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--haze);
  white-space: nowrap;
}
.tide-chip .ty {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 9px;
  color: var(--slate-gray);
  margin-right: 6px;
}
.tide-chip.high { border-color: var(--tide); }
.tide-chip.high .ty { color: var(--tide); }
.tide-chip b { color: var(--foam); font-weight: 600; }

/* Swell vs wind-wave split bar */
.splitbar-wrap {
  padding: 18px 20px;
  border-top: 1px solid var(--rule);
}
.splitbar {
  display: flex;
  height: 14px;
  border: 1px solid var(--frame);
  border-radius: 3px;
  overflow: hidden;
}
.split-swell { background: var(--tide); }
.split-wind  { background: var(--slate-gray); }
.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  row-gap: 4px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--haze);
}
.split-legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.split-legend .sw { background: var(--tide); }
.split-legend .wd { background: var(--slate-gray); }

/* Interpretation prose */
.interp {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--haze);
}

/* Sun & Moon row */
.moonrow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--rule);
}
.moonviz {
  width: 46px; height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--frame);
  background: var(--abyss);
}
.mooninfo .v {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--foam);
}
.mooninfo .l {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-gray);
  margin-top: 4px;
}

/* Buoy comparison */
.buoy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
}
.buoy-card {
  background: var(--deep-navy);
  padding: 18px 20px;
}
.buoy-card h4 {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .03em;
  margin-bottom: 2px;
}
.buoy-card .loc2 {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate-gray);
  margin-bottom: 12px;
}
.buoy-stat {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 0;
  color: var(--haze);
}
.buoy-stat b { color: var(--foam); font-weight: 600; }
.buoy-card.offline { opacity: .5; }

@media (max-width: 520px) {
  .statgrid-3, .statgrid-4, .statgrid-5 { grid-template-columns: repeat(2, 1fr); }
  .buoy-grid { grid-template-columns: 1fr; }

  /* Forecast tabs: bigger touch targets, tighter tracking so all four fit */
  .fc-tab { padding: 9px 10px; letter-spacing: .5px; }

  /* Hero subtitle: tighten so it doesn't crowd the As-Of block */
  .loc { font-size: 8.5px; letter-spacing: .08em; }
}

/* ===== DATA SOURCES PANEL ===== */
.sources {
  border-top: 1px solid var(--rule);
}
.src-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--rule);
}
.src-row:last-child {
  border-bottom: none;
}
.src-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--foam);
  letter-spacing: .02em;
}
.src-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-gray);
  margin-top: 4px;
}
.src-freq {
  flex-shrink: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tide);
  border: 1px solid var(--frame);
  border-radius: 3px;
  padding: 5px 9px;
  white-space: nowrap;
}

/* ===== LIVE CAMS MAP ===== */
.cam-map {
  height: 340px;
  width: 100%;
  background: var(--abyss);
  border-top: 1px solid var(--rule);
  z-index: 1; /* keep below sticky overlays */
}

/* Video-camera marker */
.cam-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--deep-navy);
  border: 1.5px solid var(--tide);
  border-radius: 50%;
  color: var(--tide);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  transition: transform .12s, background .12s, color .12s;
}
.cam-marker:hover {
  background: var(--tide);
  color: var(--abyss);
  transform: scale(1.15);
}
.cam-marker svg { width: 16px; height: 16px; display: block; }

/* Dark theme for Leaflet popups */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--deep-navy);
  color: var(--foam);
  border: 1px solid var(--frame);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
}
.leaflet-popup-content { margin: 12px 14px; }
.cam-pop .spot {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: .02em;
  line-height: 1;
}
.cam-pop .name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--haze);
  margin: 6px 0 11px;
}
.cam-pop a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tide);
  border: 1px solid var(--tide);
  border-radius: 3px;
  padding: 6px 10px;
  text-decoration: none;
}
.cam-pop a:hover { background: var(--tide); color: var(--abyss); }
.leaflet-container a.leaflet-popup-close-button { color: var(--haze); }

/* Dark theme for Leaflet controls + attribution */
.leaflet-bar a {
  background: var(--deep-navy);
  color: var(--foam);
  border-bottom-color: var(--frame);
}
.leaflet-bar a:hover { background: var(--hull); }
.leaflet-control-attribution {
  background: rgba(11, 14, 20, .7) !important;
  color: var(--slate-gray) !important;
}
.leaflet-control-attribution a { color: var(--haze) !important; }

/* Static fallback cam list */
.cam-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
}
.cam-item {
  background: var(--deep-navy);
  padding: 12px 14px;
  text-decoration: none;
  display: block;
}
.cam-item:hover { background: var(--hull); }
.ci-spot {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--foam);
}
.ci-name {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-gray);
  margin-top: 3px;
}
@media (max-width: 520px) {
  .cam-list { grid-template-columns: repeat(2, 1fr); }
  .cam-map { height: 280px; }
}

/* ===== LOCAL PHOTOGRAPHERS ===== */
.photog-intro {
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--haze);
}
.photog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
}
.photog-card {
  background: var(--deep-navy);
  padding: 16px 18px;
}
.pg-name {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--foam);
}
.pg-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--slate-gray);
  margin-top: 6px;
}
.pg-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.pg-links a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tide);
  border: 1px solid var(--tide);
  border-radius: 3px;
  padding: 5px 9px;
  text-decoration: none;
}
.pg-links a:hover { background: var(--tide); color: var(--abyss); }
.photog-empty {
  padding: 18px 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-gray);
}
@media (max-width: 520px) {
  .photog-grid { grid-template-columns: 1fr; }
}

/* Support / shop panel (Shopify Buy Button mounts inside) */
.shop-wrap {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--rule);
  min-height: 120px;
}

/* Full-screen product photo lightbox (click the modal's main image) */
.fb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483647; /* above Shopify's modal iframe */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 14, 20, .95);
  cursor: zoom-out;
  padding: 24px;
}
.fb-lightbox[hidden] { display: none; }
.fb-lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  border: 1px solid var(--frame);
  border-radius: 3px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .7);
}

/* Photographer "request to be listed" CTA */
.photog-foot:empty { display: none; }
.photog-foot {
  border-top: 1px solid var(--rule);
  padding: 14px 20px;
}
.photog-request {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tide);
  border: 1px solid var(--tide);
  border-radius: 3px;
  padding: 8px 12px;
  text-decoration: none;
}
.photog-request:hover { background: var(--tide); color: var(--abyss); }

/* ===== FORM PAGES (photographer request) ===== */
.form-wrap { padding: 18px 20px 22px; }
.form-intro {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--haze);
  margin-bottom: 18px;
}
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate-gray);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--abyss);
  border: 1px solid var(--frame);
  border-radius: 3px;
  color: var(--foam);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
}
.field select { appearance: none; -webkit-appearance: none; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--tide); }
.field textarea { resize: vertical; }
.form-submit {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--abyss);
  background: var(--tide);
  border: none;
  border-radius: 3px;
  padding: 11px 18px;
  cursor: pointer;
  transition: background .2s;
}
.form-submit:hover { background: var(--foam); }
.hidden-field { display: none; }
