/* =============================================================================
   Kookam design system
   -----------------------------------------------------------------------------
   Brand: warm cream paper, deep sea green ink, amber accent. Serif display
   (Grandview) for names + numbers that matter; a quiet system sans for dense
   UI labels. One radius/shadow/motion scale everywhere. Light + dark themes
   are the same semantic tokens redefined under html.dark.
   ========================================================================== */

@font-face {
  font-family: "Grandview Bold";
  src: url("/fonts/GrandviewBold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Grandview Serif";
  src: url("/fonts/GrandviewSerif.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Fixed brand palette */
  --cream: #ece9db;
  --cream-card: #f6f3e9;
  --cream-hi: #fcfaf3;
  --green: #34473b;
  --green-deep: #2b3a30;
  --green-soft: #64786a;
  --amber: #dda23f;
  --amber-deep: #c68d2e;
  --line: #d8d2bf;
  --video-bg: #131a12;

  --font-title: "Grandview Bold", Georgia, "Times New Roman", serif;
  --font-body: "Grandview Serif", Georgia, "Times New Roman", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Semantic tokens */
  --bg: var(--cream);
  --surface: var(--cream-card);
  --surface-hi: var(--cream-hi);
  --ink: var(--green);
  --ink-soft: var(--green-soft);
  --border: var(--line);
  --btn-bg: var(--green);
  --btn-bg-hover: var(--green-deep);
  --btn-fg: var(--cream-hi);
  --accent: var(--amber);
  --accent-hover: var(--amber-deep);
  --accent-ink: var(--green-deep);
  --star-idle: var(--green-soft);
  --header-bg: rgba(236, 233, 219, 0.86);

  /* Scales */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(43, 58, 48, 0.08), 0 1px 2px rgba(43, 58, 48, 0.05);
  --shadow-md: 0 6px 18px rgba(43, 58, 48, 0.12), 0 2px 6px rgba(43, 58, 48, 0.07);
  --shadow-lg: 0 18px 44px rgba(43, 58, 48, 0.18), 0 6px 14px rgba(43, 58, 48, 0.08);
  --t-fast: 0.16s cubic-bezier(0.3, 0.7, 0.4, 1);
  --t-med: 0.32s cubic-bezier(0.25, 0.8, 0.35, 1);
}

html.dark {
  color-scheme: dark;
  --bg: #141d17;
  --surface: #1d2921;
  --surface-hi: #253227;
  --ink: #eaeee7;
  --ink-soft: #a3b5a8;
  --border: #35493c;
  --btn-bg: #46614f;
  --btn-bg-hover: #547560;
  --btn-fg: #f6f3e9;
  --accent: #dda23f;
  --accent-hover: #e7b258;
  --accent-ink: #141d17;
  --star-idle: #8aa093;
  --header-bg: rgba(20, 29, 23, 0.86);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.5), 0 6px 14px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: var(--green-deep); }

/* Every interactive element gets a visible, consistent focus ring. */
:where(button, a, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Map page fills the viewport and doesn't scroll */
body.mapview {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

/* ---- Header ------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px clamp(14px, 3vw, 24px);
}
.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px 16px;
}
.bar > h1, .bar > .brand { justify-self: start; }
.bar > .controls { justify-self: center; }
.bar > .headright { justify-self: end; }
.headright { display: flex; align-items: center; gap: 10px; }
@media (max-width: 1020px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar > h1, .bar > .brand { grid-row: 1; grid-column: 1; }
  .bar > .headright { grid-row: 1; grid-column: 2; }
  .bar > .controls { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; }
}

/* Brand lockup: wave mark + wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand img, .brand svg { width: 34px; height: 34px; display: block; }
.brand .brand-name {
  font-family: var(--font-title);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  transform: translateY(1px);
}
h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1;
}

/* Explore / Map nav */
.viewnav {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-hi);
  box-shadow: var(--shadow-sm);
}
.viewnav a {
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background var(--t-fast), color var(--t-fast);
}
.viewnav a:hover { color: var(--ink); }
.viewnav a.active { background: var(--btn-bg); color: var(--btn-fg); }

/* Dark-mode toggle: split light/dark circle */
.themebtn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hi);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.themebtn:hover { background: var(--surface); }
.themebtn .modeicon { width: 19px; height: 19px; display: block; }
.modeicon .mi-rot {
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(0deg);
  transition: transform 0.45s ease;
}
html.dark .modeicon .mi-rot { transform: rotate(180deg); }
.modeicon .mi-base { fill: #1a241d; }
.modeicon .mi-top { fill: #f4f1e6; }
.modeicon .mi-ring { fill: none; stroke: var(--ink-soft); stroke-width: 1.3; }

/* ---- Search controls ----------------------------------------------------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.favfilter {
  padding: 8px 13px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface-hi);
  color: var(--ink);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.favfilter:hover { background: var(--surface); }
.favfilter.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.favfilter svg { width: 16px; height: 16px; }
.favfilter .favlabel { font-variant-numeric: tabular-nums; }
.favfilter .star { fill: none; stroke: currentColor; stroke-width: 1.7; }
.favfilter.on .star { fill: currentColor; }

label {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 6px;
}
input[type="text"], input[type="number"], input[type="password"], input[type="email"], select {
  font-family: var(--font-body);
  padding: 9px 12px;
  font-size: 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input[type="text"] { width: 230px; max-width: 100%; }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 28%, transparent);
}

.geobtn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.geobtn:hover { background: var(--surface); color: var(--accent-hover); }
.geobtn svg { width: 18px; height: 18px; fill: currentColor; }

/* Autocomplete */
.field { position: relative; }
.ac {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  min-width: 240px;
  margin: 6px 0 0;
  padding: 5px;
  list-style: none;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 12;
  max-height: 288px;
  overflow-y: auto;
  display: none;
}
.ac-item {
  padding: 9px 11px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--t-fast);
}
.ac-item:hover { background: var(--surface); }
.ac-item.active { background: var(--accent); color: var(--accent-ink); }

.radius-wrap { display: flex; align-items: center; gap: 8px; }
.rlabel {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}
.rval { font-family: var(--font-ui); font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
input[type="range"] { width: 150px; vertical-align: middle; accent-color: var(--accent); cursor: pointer; }
#radiusVal { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

button {
  font-family: var(--font-ui);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--btn-bg);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
button:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: default; transform: none; }

main { padding: clamp(14px, 2.4vw, 24px); }
main.mapmain { padding: 0; flex: 1; min-height: 0; }
#hint { color: var(--ink-soft); font-size: 16px; padding: 48px 16px; text-align: center; }

/* ---- Grid ----------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 1.8vw, 20px);
}
@media (max-width: 1150px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  container-type: inline-size;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
  animation: card-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
/* staggered entrance for the first rows */
.card:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.14s; }
.card:nth-child(5) { animation-delay: 0.18s; }
.card:nth-child(6) { animation-delay: 0.22s; }
.card:nth-child(7) { animation-delay: 0.26s; }
.card:nth-child(8) { animation-delay: 0.30s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--green-deep) center/cover no-repeat;
  overflow: hidden;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.card:hover .thumb img { transform: scale(1.04); }
.thumb video.preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.thumb video.preview.ready { opacity: 1; }

.favbtn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.favbtn svg { width: clamp(20px, 7.6cqi, 27px); height: clamp(20px, 7.6cqi, 27px); transition: transform var(--t-fast); }
.favbtn:hover svg { transform: scale(1.12); }
.favbtn .star { fill: none; stroke: var(--star-idle); stroke-width: 1.8; transition: fill var(--t-fast), stroke var(--t-fast); }
.favbtn:hover .star { stroke: var(--ink); }
.favbtn.on .star { fill: var(--amber); stroke: var(--amber); }

.angles {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(19, 26, 18, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--cream-hi);
}
.meta {
  padding: clamp(9px, 3.4cqi, 14px) clamp(11px, 4.4cqi, 17px) clamp(4px, 1.6cqi, 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 3cqi, 12px);
}
.meta .info { min-width: 0; }
.name { font-family: var(--font-title); font-size: clamp(16px, 6.2cqi, 21px); font-weight: 700; color: var(--ink); line-height: 1.15; }
.dist { font-family: var(--font-ui); font-size: clamp(11px, 3.8cqi, 13px); color: var(--ink-soft); margin-top: 3px; }

/* ---- Map ------------------------------------------------------------------ */
#map { width: 100%; height: 100%; background: var(--bg); position: relative; z-index: 0; }
html:not(.dark) .leaflet-tile { filter: sepia(0.28) saturate(0.82) brightness(1.03) hue-rotate(-8deg); }
html.dark .leaflet-tile { filter: brightness(2.05) contrast(0.85); }
.leaflet-container { background: var(--bg); font-family: inherit; }
.leaflet-tooltip.spot-tip {
  background: var(--surface-hi);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 9px;
  box-shadow: var(--shadow-md);
}
.leaflet-tooltip.spot-tip::before { border-top-color: var(--accent); }

.buoy-icon { background: none; border: none; }
.buoy-icon .buoy-dot {
  display: block; width: 11px; height: 11px; margin: 2px;
  background: #2b83ff; border: 2px solid #fff; border-radius: 3px;
  transform: rotate(45deg); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
html.dark .buoy-icon .buoy-dot { border-color: #0c1a26; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
.leaflet-tooltip.buoy-tip {
  background: #123; color: #eaf3ff; border: 1px solid #2b83ff; border-radius: 8px;
  font-weight: 600; font-size: 12px; padding: 4px 9px; box-shadow: var(--shadow-md);
}
.leaflet-tooltip.buoy-tip .bt-sub { color: #9dc2ff; font-weight: 400; }
.leaflet-tooltip.buoy-tip::before { border-top-color: #2b83ff; }

/* Wind overlay canvas: above the map pane (400), below controls (1000). */
.wind-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 450;
}
.wind-toggle a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--surface-hi);
  color: var(--ink-soft);
}
.wind-toggle a:hover { background: var(--surface); color: var(--ink); }
.wind-toggle a.on { background: var(--accent); color: var(--accent-ink); }
.wind-legend {
  background: var(--surface-hi);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
}
.wind-legend .wl-title {
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.wind-legend .wl-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.wind-legend .wl-row i { width: 14px; height: 4px; border-radius: 2px; flex-shrink: 0; }

#mapHint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 20px;
  color: var(--ink-soft);
  font-size: 15px;
  box-shadow: var(--shadow-md);
}

/* ---- Cam detail shared bits ------------------------------------------------ */
.favstar {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.favstar svg { width: 22px; height: 22px; transition: transform var(--t-fast); }
.favstar:hover svg { transform: scale(1.12); }
.favstar .star { fill: none; stroke: var(--cream-hi); stroke-width: 1.6; }
.favstar.on .star { fill: var(--amber); stroke: var(--amber); }
.playerbar select {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream-hi);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 6px 9px;
  font-family: var(--font-ui);
  font-size: 13px;
}
.playerbar .spacer { flex: 1; }
.playerbar button {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--green-deep);
  padding: 8px 16px;
  border-radius: 999px;
}
.playerbar button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.playerbar .rescanbtn {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); color: var(--cream-hi);
  font-size: 12px; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.playerbar .rescanbtn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--cream-hi); color: var(--cream-hi); }
.playerbar .rescanbtn:disabled { opacity: 0.6; cursor: default; }
#pstatus {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  font-size: 16px;
  z-index: 1;
}
#pstatus.show { display: flex; }

/* ---- Auth pages (gate / login) --------------------------------------------- */
.authwrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.authcard {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 30px;
  box-shadow: var(--shadow-lg);
  animation: card-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.authlogo { display: flex; justify-content: center; margin-bottom: 10px; }
.authlogo img { width: 64px; height: 64px; }
.authbrand {
  font-family: var(--font-title);
  font-size: 34px;
  color: var(--ink);
  text-align: center;
}
.authsub {
  margin: 4px 0 22px;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 11px;
}
.authcard form { display: block; }
.authcard label {
  display: block;
  margin: 14px 0 6px;
}
.authcard input { width: 100%; }
.authcard button[type="submit"] {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  font-size: 15px;
}
.authtabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.authtab {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 0;
  background: var(--surface-hi);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.authtab.active { background: var(--btn-bg); color: var(--btn-fg); }
.authhint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.authmsg { margin-top: 12px; font-size: 14px; min-height: 18px; text-align: center; }
.authmsg.err { color: #c0563b; }
html.dark .authmsg.err { color: #e79b84; }
.authmsg.ok { color: var(--green-soft); }

/* ---- User icon + account panel ---------------------------------------------- */
.usericon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.usericon:hover { background: var(--surface); }
.usericon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.acct-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 26, 18, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 39;
}
.acct-backdrop.open { opacity: 1; pointer-events: auto; }
.acct-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 350px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.25, 0.8, 0.35, 1);
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.acct-panel.open { transform: translateX(0); }
.acct-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.acct-head h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--ink);
}
.acct-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.acct-close:hover { background: var(--surface-hi); color: var(--ink); }
.acct-emailrow {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  border: 1px solid var(--border);
}
.acct-emaillabel {
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}
.acct-email { font-weight: 700; color: var(--ink); word-break: break-all; }
.acct-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.acct-section label { margin: 0; }
.acct-section input { width: 100%; }
.acct-section button[type="submit"] { margin-top: 4px; align-self: flex-start; padding: 8px 16px; }
.acct-msg { font-family: var(--font-ui); font-size: 13px; min-height: 16px; }
.acct-msg.err { color: #c0563b; }
html.dark .acct-msg.err { color: #e79b84; }
.acct-msg.ok { color: var(--green-soft); }
.acct-appearance {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.acct-approw-label { font-weight: 600; color: var(--ink); }
.acct-logout {
  margin-top: auto;
  padding: 11px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.acct-logout:hover { background: var(--surface-hi); border-color: var(--border); }

/* Surfer profile + quiver manager */
.acct-profrow { display: flex; align-items: center; gap: 8px; }
.acct-profrow .acct-inline-lbl { flex: 1; font-size: 12px; color: var(--ink-soft); text-transform: none; letter-spacing: 0; margin: 0; }
.acct-profrow input, .acct-profrow select { flex: 1; min-width: 0; }
.acct-quiver-empty { font-size: 13px; color: var(--ink-soft); font-style: italic; }
.acct-boards { display: flex; flex-direction: column; gap: 6px; }
.acct-board {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-hi);
}
.acct-board-info { display: flex; flex-direction: column; min-width: 0; }
.acct-board-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.acct-board-dims { font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); text-transform: capitalize; }
.acct-board-del {
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 999px;
  background: transparent; color: var(--ink-soft); font-size: 18px; line-height: 1;
  cursor: pointer; flex-shrink: 0;
}
.acct-board-del:hover { background: var(--surface); color: #dc2626; }
.acct-boardform { display: flex; flex-direction: column; gap: 8px; }

/* Account panel: units */
.acct-units { display: flex; flex-direction: column; gap: 10px; }
.acct-unitrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-unitlbl { color: var(--ink); font-size: 14px; }
.acct-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.acct-seg button { font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  padding: 6px 12px; background: var(--surface-hi); color: var(--ink-soft);
  border: none; border-left: 1px solid var(--border); cursor: pointer; border-radius: 0; }
.acct-seg button:first-child { border-left: none; }
.acct-seg button.on { background: var(--btn-bg); color: var(--btn-fg); }

/* =============================================================================
   Forecast readout (shared by /forecast + the cam detail view)
   ========================================================================== */
.fc-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fc-field { display: inline-flex; align-items: center; gap: 8px; }
.fc-lbl { font-family: var(--font-ui); font-weight: 600; color: var(--ink-soft); font-size: 13px; }
#spotSel { max-width: 340px; }
.fc-units { display: inline-flex; align-items: center; gap: 4px; }
.fc-units button {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--ink-soft);
  cursor: pointer;
}
.fc-units button.on { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.fc-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

.fc-main { max-width: 1100px; margin: 0 auto; padding: 22px 20px 60px; }
.fc-status { padding: 40px 10px; text-align: center; color: var(--ink-soft); font-size: 17px; }

.card2 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card2 h2 {
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
}

/* Fade the readout in as one block once mounted */
.fc-readout { animation: card-in 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

/* ---- Time scrubber + day strip ---- */
.fc-time { padding-bottom: 14px; }
.fc-time-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 10px; }
.fc-when { font-weight: 700; color: var(--ink); font-size: 15px; }
.fc-nowtag, .fc-nowbtn {
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.fc-nowtag { color: var(--accent); margin-left: 6px; }
.fc-nowbtn {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-hi); color: var(--ink); cursor: pointer;
}
.fc-nowbtn:hover { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.fc-hour { width: 100%; accent-color: var(--accent); }

/* Day strip: one pill per forecast day, colored by that day's BEST hour */
.fc-days {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px;
  scrollbar-width: thin;
}
.fc-day {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 52px;
  padding: 7px 9px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  cursor: pointer;
  font-family: var(--font-ui);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.fc-day:hover { border-color: var(--accent); transform: translateY(-1px); }
.fc-day.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.fc-day .d-name { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.fc-day .d-dot { width: 22px; height: 6px; border-radius: 999px; background: var(--dc, var(--border)); }
.fc-day .d-val { font-size: 11px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- Headline card ---- */
.fc-headcard { padding: 22px 24px; }
.fc-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fc-spotname { font-family: var(--font-title); font-size: clamp(22px, 3.4vw, 28px); color: var(--ink); line-height: 1.05; }
.fc-spotmeta { font-family: var(--font-ui); color: var(--ink-soft); font-size: 13px; margin-top: 5px; text-transform: capitalize; }
.fc-ratingbar {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--rc); color: #fff;
  padding: 10px 16px; border-radius: var(--r-md);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background 0.4s ease;
}
.fc-rlabel { font-family: var(--font-title); font-size: 17px; letter-spacing: 0.03em; text-transform: uppercase; }
.fc-rnum { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-rnum small { font-size: 12px; opacity: 0.8; }
.fc-head-rate { display: flex; flex-direction: column; align-items: stretch; gap: 8px; flex-shrink: 0; }
.fc-crowdbar {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--cc, var(--ink-soft)); color: #fff;
  padding: 10px 16px; border-radius: var(--r-md); white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.fc-crowd-star { cursor: help; font-weight: 700; }

.fc-surf { font-family: var(--font-title); font-size: clamp(30px, 5vw, 42px); color: var(--ink); margin: 14px 0 2px; }
.fc-surf small { font-size: clamp(14px, 2vw, 17px); color: var(--ink-soft); font-family: var(--font-body); }
.fc-why { color: var(--ink-soft); font-style: italic; margin-bottom: 10px; }

/* Historical comparison: today vs this spot's own climatology */
.fc-history { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: help; flex-wrap: wrap; }
.fc-history-dial {
  position: relative; width: 120px; height: 8px; flex-shrink: 0;
  background: var(--surface-hi); border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden;
}
.fc-history-dial i {
  position: absolute; inset: 0 auto 0 0; display: block;
  background: linear-gradient(90deg, var(--ink-soft), var(--accent));
  border-radius: 999px;
}
.fc-history-text { font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--ink); }

/* Storm flag under the headline + storm-watch panel */
.fc-stormflag {
  margin: 0 0 12px; padding: 8px 12px; border-radius: var(--r-sm);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  background: rgba(217, 119, 6, 0.12); color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.35);
}
html.dark .fc-stormflag { color: #fbbf24; background: rgba(217, 119, 6, 0.16); }
.fc-p-storms[hidden] { display: none; }

.fc-head-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 22px;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.fc-stat { display: flex; flex-direction: column; gap: 2px; }
.fc-stat .k { font-family: var(--font-ui); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.fc-stat .v { font-size: 15px; color: var(--ink); }
.fc-stat .v.gustflag { color: #ef4444; }

.fc-arrow { display: inline-block; font-weight: 700; }

/* ---- Advanced panels ---- */
.fc-panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.fc-panels .card2 { margin-bottom: 0; }
.fc-p-rating, .fc-p-tide, .fc-p-windmap, .fc-p-storms { grid-column: 1 / -1; }

.fc-windmap { width: 100%; height: 300px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); position: relative; z-index: 0; }
.fc-windmap-msg { color: var(--ink-soft); padding: 20px; text-align: center; }

.fc-autobadge {
  display: inline-block; vertical-align: middle;
  font-family: var(--font-ui);
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; margin-left: 6px;
  background: var(--surface-hi); color: var(--ink-soft); border: 1px solid var(--border);
}
.fc-autobadge[hidden] { display: none; }
.fc-tunedbadge {
  display: inline-block; vertical-align: middle;
  font-family: var(--font-ui);
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; margin-left: 6px;
  background: rgba(34, 197, 94, 0.14); color: #15803d; border: 1px solid rgba(34, 197, 94, 0.40);
}
html.dark .fc-tunedbadge { color: #86efac; background: rgba(34, 197, 94, 0.16); border-color: rgba(34, 197, 94, 0.38); }
.fc-tunedbadge[hidden] { display: none; }

/* Sub-score bars */
.fc-sub { display: grid; grid-template-columns: 210px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 8px; }
.fc-sub-lbl { font-size: 14px; color: var(--ink); }
.fc-sub-lbl small { font-family: var(--font-ui); color: var(--ink-soft); font-size: 11px; }
.fc-sub-track { height: 12px; background: var(--surface-hi); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.fc-sub-fill {
  display: block; height: 100%; background: var(--accent); border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.25, 0.8, 0.35, 1);
}
.fc-sub-val { font-family: var(--font-ui); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-size: 13px; }
.fc-hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.fc-formula { margin-top: 10px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); }
.fc-confidence { margin-top: 8px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); }
.fc-confidence b { text-transform: uppercase; letter-spacing: 0.04em; }
.fc-confidence[data-level="high"] b { color: #16a34a; }
.fc-confidence[data-level="medium"] b { color: #d97706; }
.fc-confidence[data-level="low"] b { color: #dc2626; }

/* Tables */
.fc-tbl { width: 100%; border-collapse: collapse; }
.fc-tbl th, .fc-tbl td { text-align: left; padding: 6px 8px; font-size: 14px; border-bottom: 1px solid var(--border); }
.fc-tbl th { font-family: var(--font-ui); color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.fc-tbl td { color: var(--ink); }
.fc-tbl tr:last-child th, .fc-tbl tr:last-child td { border-bottom: none; }
.fc-tide-events { margin-top: 10px; }
.fc-buoyhead { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.fc-buoyhead small { color: var(--ink-soft); font-weight: 400; }

/* Board call panel */
.fc-arch {
  font-weight: 700; color: var(--ink); margin-bottom: 12px;
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-hi); border: 1px solid var(--border);
}
.fc-board { margin-bottom: 12px; }
.fc-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.fc-board-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.fc-board-verdict { font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.fc-board.top .fc-board-verdict { color: var(--accent-hover); }
.fc-board.capped .fc-board-verdict { color: #dc2626; }
.fc-board-note { margin-top: 4px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); }
.fc-board .fc-sub-track { display: block; height: 10px; }
.fc-boards-empty, .fc-boards-hint { font-size: 13px; color: var(--ink-soft); }
.fc-boards-hint { margin-top: 10px; font-style: italic; }

/* Inline bar charts */
.fc-chartlabel { margin: 14px 0 6px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); }
.fc-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; }
.fc-bar { flex: 1; min-width: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: 0.85; }
.fc-bar.hi { outline: 2px solid var(--ink); outline-offset: -1px; opacity: 1; }

/* Tide SVG */
.fc-tidesvg { width: 100%; height: 130px; }
.fc-svgtext { fill: var(--ink-soft); font-size: 11px; font-family: var(--font-body); }

.fc-attrib { margin-top: 18px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); text-align: center; }

@media (max-width: 760px) {
  .fc-panels { grid-template-columns: 1fr; }
  .fc-p-rating, .fc-p-tide, .fc-p-windmap, .fc-p-storms { grid-column: auto; }
  .fc-head-grid { grid-template-columns: repeat(2, 1fr); }
  .fc-head-top { flex-direction: column; }
  .fc-head-rate { flex-direction: row; flex-wrap: wrap; }
  .fc-sub { grid-template-columns: 120px 1fr 40px; }
  .fc-headcard { padding: 18px 16px; }
  .card2 { padding: 16px 14px; }
}

/* =============================================================================
   Grid forecast strip + area tide bar + detail overlay
   ========================================================================== */
.fc-strip {
  padding: 0 clamp(11px, 4.4cqi, 17px) clamp(10px, 3.6cqi, 14px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  min-height: 40px;
  font-size: clamp(12px, 4.4cqi, 14px);
}
.strip-fc { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; width: 100%; }
.strip-fc.prompt, .strip-fc.loading { color: var(--ink-soft); font-style: italic; font-size: 0.92em; }
/* Skeleton shimmer while a forecast loads */
.strip-fc.loading {
  display: block; color: transparent; font-style: normal;
  border-radius: 8px; height: 24px; width: 78%;
  background: linear-gradient(100deg, var(--surface-hi) 40%, var(--surface) 50%, var(--surface-hi) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  from { background-position: 130% 0; }
  to   { background-position: -70% 0; }
}
.strip-rating, .strip-crowd {
  font-family: var(--font-title); font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff; padding: 3px 10px; border-radius: 8px;
  font-size: clamp(12px, 4.4cqi, 14px);
}
.strip-rating { background: var(--rc); }
.strip-crowd { background: var(--cc, #64748b); }
.strip-crowd sup { font-size: 0.8em; }
.strip-surf { font-weight: 700; color: var(--ink); }
.strip-hist {
  font-family: var(--font-ui);
  font-size: 0.82em; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--ink-soft); background: var(--surface-hi);
  cursor: help;
}
.strip-hist.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.strip-wind { font-family: var(--font-ui); font-size: 0.88em; color: var(--ink-soft); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* Area tide bar */
.tidebar {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 18px; margin: 0 0 18px;
  box-shadow: var(--shadow-sm);
  animation: card-in 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.tidebar-info { flex-shrink: 0; min-width: 180px; }
.tidebar-title { font-family: var(--font-ui); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.tidebar-now { font-weight: 700; color: var(--ink); margin-top: 2px; }
.tidebar-chart { flex: 1; min-width: 0; }
.tidebar-svg { width: 100%; height: 52px; display: block; }
.tidebar-axis { position: relative; height: 14px; margin-top: 1px; }
.tidebar-axis span { position: absolute; transform: translateX(-50%); font-family: var(--font-ui); font-size: 10px; color: var(--ink-soft); white-space: nowrap; }
.tidebar-axis .tidebar-nowlbl { color: var(--accent-hover); font-weight: 700; }
@media (max-width: 640px) {
  .tidebar { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 14px; }
  .tidebar-info { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
}

/* Time axis under swell/wind charts */
.fc-axis { display: flex; gap: 2px; margin-top: 2px; height: 16px; }
.fc-axis-cell { flex: 1; min-width: 2px; position: relative; border-top: 1px solid var(--border); }
.fc-axis-cell.lbl { border-top-color: var(--ink-soft); }
.fc-axis-cell i { position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
  font-style: normal; font-family: var(--font-ui); font-size: 10px; color: var(--ink-soft); white-space: nowrap; }

/* ---- Detail overlay ---- */
body.player-open { overflow: hidden; }
#player {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
#player.open { display: flex; animation: player-in 0.34s cubic-bezier(0.25, 0.8, 0.35, 1) both; }
@keyframes player-in {
  from { opacity: 0; transform: translateY(3vh); }
  to   { opacity: 1; transform: translateY(0); }
}
.playerbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(12px, 2.5vw, 18px);
  background: rgba(19, 26, 18, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 3;
}
.playerbar .pname { font-family: var(--font-title); font-size: 18px; font-weight: 700; color: var(--cream-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-stage {
  position: relative;
  background: var(--video-bg);
  padding: 16px;
  display: flex;
  justify-content: center;
}
.player-stage video {
  width: 100%;
  max-width: 1400px;
  max-height: 74vh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--video-bg);
  border-radius: var(--r-md);
}
.player-forecast {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 20px clamp(12px, 2.5vw, 20px) 60px;
}
@media (max-width: 640px) {
  .player-stage { padding: 0 0 10px; }
  .player-stage video { border-radius: 0; max-height: 40vh; }
  .playerbar .rescanbtn { display: none; }  /* admin tool; desktop only */
}
/* ---- Alternative cam source: iframe stage, "No camera Found", credit popup ---- */
.player-stage .embed-box {
  position: relative;
  width: 100%;
  max-width: 1400px;
  max-height: 74vh;
  aspect-ratio: 16 / 9;
  background: var(--video-bg);
  border-radius: var(--r-md);
  overflow: hidden;
}
.player-stage .embed-box .stage-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Transparent overlay that swallows pointer events so a third-party embed's own
   hover UI (e.g. YouTube's title bar / controls / "Watch on YouTube") never
   appears. In the hero the click bubbles up to open our own player. */
.embed-shield { position: absolute; inset: 0; z-index: 2; }
.player-stage .no-cam {
  width: 100%;
  max-width: 1400px;
  aspect-ratio: 16 / 9;
  max-height: 74vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--cream-hi);
  background: var(--video-bg);
  border-radius: var(--r-md);
}
.no-cam .nc-ico { font-size: 36px; opacity: 0.65; }
.no-cam > span:last-child { font-family: var(--font-ui); font-weight: 600; font-size: 15px; }
@media (max-width: 640px) {
  .player-stage .embed-box,
  .player-stage .no-cam { border-radius: 0; max-height: 56vh; }
}

/* Corner "popup" crediting the camera's owner, over any alternative feed. */
.cam-credit {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 68%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(19, 26, 18, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--cream-hi);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.15s ease;
}
a.cam-credit:hover { background: rgba(19, 26, 18, 0.94); }
.cam-credit .cc-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-credit .cc-arr { opacity: 0.75; font-size: 10px; }
.cam-credit.on-card { top: 8px; right: 8px; padding: 3px 8px; font-size: 10px; }

/* Thumbnail placeholder when a card has no still image (live embed, or no cam). */
.thumb-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  color: var(--cream-hi);
  background: var(--green-deep);
}
.thumb-ph .ph-ico { font-size: 22px; opacity: 0.7; }
.thumb-ph .ph-txt { font-family: var(--font-ui); font-size: 12px; font-weight: 600; opacity: 0.9; }
.thumb-ph.nocam .ph-txt { opacity: 0.8; }

/* Always-on live embed inside the Home hero thumbnail (youtube/iframe cams). */
.hero-live-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
}

.pl-units { display: inline-flex; align-items: center; gap: 4px; }
.pl-units button {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  padding: 5px 9px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent; color: var(--cream); cursor: pointer;
}
.pl-units button.on { background: var(--amber); color: var(--green-deep); border-color: var(--amber); }
.pl-units .fc-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.25); margin: 0 3px; }
.playerbar .favstar { background: transparent; border: none; }
.playerbar .favstar:hover { background: transparent; }

/* ---- Motion accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Home page (/) — hero pick + area overview + your breaks
   ========================================================================== */
main.home { display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 18px); max-width: 1280px; margin: 0 auto; width: 100%; --r-box: 8px; }
/* The `hidden` attribute must win over the display rules on home sections
   (.onboarding/.place-row/.breaks-section etc. all set an explicit display). */
main.home [hidden] { display: none !important; }
/* Squarer content boxes + tighter grids on the home page. */
main.home .card, main.home .grid > .card { border-radius: var(--r-box); }
main.home .grid { gap: clamp(10px, 1.2vw, 14px); }

.section-title {
  font-family: var(--font-title); font-weight: 700;
  font-size: clamp(17px, 2.4vw, 22px); color: var(--ink);
  margin: 0 0 12px;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.see-all, .onboard-explore, .cta-explore {
  font-family: var(--font-ui); font-weight: 700; font-size: 14px;
  color: var(--accent); text-decoration: none; white-space: nowrap;
}
.see-all:hover, .onboard-explore:hover, .cta-explore:hover { color: var(--accent-hover); }

/* Place label + change */
.place-row { display: flex; align-items: center; gap: 12px; }
.place-label { font-family: var(--font-body); font-size: clamp(18px, 3vw, 26px); color: var(--ink); }
.place-label strong { font-family: var(--font-title); color: var(--ink); }
.place-change {
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  color: var(--ink-soft); background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 12px; cursor: pointer; transition: all var(--t-fast);
}
.place-change:hover { color: var(--ink); border-color: var(--accent); }

.home-status { color: var(--ink-soft); font-size: 15px; padding: 8px 2px; }

/* Onboarding empty state */
.onboarding {
  text-align: center; padding: clamp(30px, 7vw, 70px) 16px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.onboarding h1 { font-family: var(--font-title); font-size: clamp(26px, 5vw, 40px); color: var(--ink); margin: 4px 0 0; }
.onboarding p { font-family: var(--font-body); font-size: clamp(15px, 2.2vw, 18px); color: var(--ink-soft); max-width: 46ch; line-height: 1.5; margin: 0; }
.onboard-search { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.onboard-search .field { position: relative; }
.onboard-search input {
  font-family: var(--font-ui); font-size: 15px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); min-width: 240px;
}
.onboard-search input:focus { outline: none; border-color: var(--accent); }
.btn-primary {
  font-family: var(--font-ui); font-weight: 700; font-size: 15px;
  background: var(--btn-bg); color: var(--btn-fg); border: none;
  border-radius: var(--r-sm); padding: 11px 18px; cursor: pointer; transition: background var(--t-fast);
}
.btn-primary:hover { background: var(--btn-bg-hover); }

/* Hero: today's pick */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-box); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-md); transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
}
.hero:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.hero-thumb { aspect-ratio: 16 / 9; min-height: 100%; }
.hero-body { padding: clamp(16px, 2.4vw, 26px); display: flex; flex-direction: column; gap: 12px; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-name { font-family: var(--font-title); font-size: clamp(22px, 3.4vw, 32px); color: var(--ink); margin: 0; line-height: 1.1; }
.hero-rating { align-self: flex-start; font-size: 14px; }
.hero-stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.hero-why { font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.hero-cta { font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--accent); margin-top: auto; }

.hero-board {
  border: 1px solid var(--border); border-radius: var(--r-box);
  background: var(--surface-hi); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.hb-label { font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-soft); }
.hb-board { font-family: var(--font-body); font-size: 15px; color: var(--ink); }
.hb-board strong { font-family: var(--font-title); }
.hb-dims { font-family: var(--font-ui); font-size: 13px; color: var(--ink-soft); }
.hb-note { font-family: var(--font-ui); font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.hb-loading { font-family: var(--font-ui); font-size: 13px; color: var(--ink-soft); font-style: italic; }

@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } }

/* Area conditions overview */
.overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 1vw, 10px); }
.overview-section .tidebar { margin: 10px 0 0; border-radius: var(--r-box); }
/* Give the tide axis two rows: hour labels on top, "now" beneath, so a "now"
   that lands on an hour tick can't overlap that tick's label. */
.overview-section .tidebar-axis { height: 26px; }
.overview-section .tidebar-axis span { top: 0; }
.overview-section .tidebar-axis .tidebar-nowlbl { top: 13px; }
.ov-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-box); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm);
}
.ov-key { font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-soft); }
.ov-value { font-family: var(--font-title); font-size: clamp(15px, 2vw, 19px); color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ov-value .strip-rating { font-size: 13px; }
.ov-sub { font-family: var(--font-ui); font-size: 12px; color: var(--ink-soft); }
@media (max-width: 640px) { .overview { grid-template-columns: 1fr; } }

/* Intraday outlook: a one-line trend summary + an hourly rating heat strip */
.outlook {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-box); padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px;
}
.ol-summary { font-family: var(--font-body); font-size: clamp(14px, 2vw, 17px); color: var(--ink); margin: 0; line-height: 1.4; }
.ol-strip { display: flex; align-items: flex-end; gap: 3px; height: 92px; }
.ol-cell {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
}
.ol-cell .ol-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 8px; transition: opacity var(--t-fast); }
.ol-cell.now .ol-bar { outline: 2px solid var(--ink); outline-offset: 1px; }
.ol-cell:hover .ol-bar { opacity: 0.8; }
.ol-hr { font-family: var(--font-ui); font-size: 10px; color: var(--ink-soft); white-space: nowrap; height: 12px; }

/* Your breaks groups */
.breaks-section { display: flex; flex-direction: column; gap: clamp(14px, 2vw, 20px); }

/* CTA */
.cta-section { text-align: center; padding: 8px 0 24px; }
.cta-explore {
  display: inline-block; font-size: 15px;
  border: 1px solid var(--border); border-radius: 999px; padding: 10px 22px;
  transition: all var(--t-fast);
}
.cta-explore:hover { border-color: var(--accent); background: var(--surface); }
