/* Coastal Glass 2026 — cascade architecture
 * Core owns reset, tokens, base, layout, and shared components.
 * Later stylesheets add feature-specific layers without specificity wars.
 */
@layer reset, tokens, base, layout, components, features, themes, motion, utilities, overrides;

@layer tokens {
:root {
  /* Semantic color roles — light is the default. */
  --bg: #edf7f8;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --surface: #f9fdfd;
  --card: rgba(255, 255, 255, 0.78);
  --card-strong: #ffffff;
  --card-border: rgba(8, 54, 67, 0.14);
  --text: #092f3b;
  --text-muted: #52717b;
  --ink: #092f3b;
  --accent: #087f91;
  --accent-2: #0f9f9a;
  --sea: #087f91;
  --sea-deep: #075a6a;
  --warm: #b85f31;
  --cool: #286da8;
  --good: #167a5b;
  --danger: #b33d4d;
  --focus: #087f91;

  /* Type, rhythm, geometry, depth, and motion. */
  --font: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --step--1: clamp(0.78rem, 0.74rem + 0.16vw, 0.88rem);
  --step-0: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --step-1: clamp(1.15rem, 1.03rem + 0.5vw, 1.42rem);
  --step-2: clamp(1.45rem, 1.2rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.45rem + 2.2vw, 3.25rem);
  --space-1: clamp(0.35rem, 0.3rem + 0.2vw, 0.5rem);
  --space-2: clamp(0.65rem, 0.55rem + 0.35vw, 0.9rem);
  --space-3: clamp(1rem, 0.85rem + 0.55vw, 1.35rem);
  --space-4: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  --space-5: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 5px 16px rgba(8, 54, 67, 0.08);
  --shadow: 0 18px 48px rgba(8, 54, 67, 0.12);
  --shadow-lg: 0 30px 80px rgba(8, 40, 55, 0.18);
  --blur: 20px;
  --content-max: 1280px;
  --z-base: 1;
  --z-sticky: 100;
  --z-map: 500;
  --z-overlay: 1500;
  --z-modal: 3000;
  --duration-fast: 140ms;
  --duration-base: 280ms;
  --duration-slow: 650ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.22, 1.35, 0.36, 1);
  --glow: 0 0 42px rgba(8, 127, 145, 0.08);
}
}

@layer reset {
*, *::before, *::after { box-sizing: border-box; }
:where(body, h1, h2, h3, h4, p, figure) { margin: 0; }
:where(img, svg) { max-inline-size: 100%; }
}

@layer base {
  html {
    min-block-size: 100%;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
  }

  body {
    min-block-size: 100svh;
    color: var(--text);
    font: 400 var(--step-0)/1.6 var(--font);
    overflow-x: clip;
    text-rendering: optimizeLegibility;
  }

  :where(button, input, select, textarea) { font: inherit; }
  :where(a) { color: var(--accent); text-underline-offset: 0.18em; }
  ::selection { color: #fff; background: var(--accent); }
}

@layer layout {
  .header,
  .main,
  .footer {
    position: relative;
    z-index: var(--z-base);
  }
}

@layer components {

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.4); }

/* ── Background orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #0ea5e9, #0369a1);
  top: -150px;
  right: -100px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #6366f1, #4338ca);
  bottom: 8%;
  left: -120px;
  animation-delay: -7s;
}

.orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #14b8a6, #0d9488);
  top: 42%;
  right: 18%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(18px, -22px) scale(1.04); }
  66% { transform: translate(-12px, 14px) scale(0.97); }
}

/* ── Layout ── */
.header,
.main,
.footer {
  position: relative;
  z-index: 1;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 4px 16px rgba(56, 189, 248, 0.45));
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand p {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.1);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-ghost {
  backdrop-filter: blur(12px);
}

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #0f172a;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.4);
}

.btn-danger { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.25); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-success { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.btn-success:hover { background: rgba(52,211,153,0.2); }

.theme-toggle .theme-icon-moon { display: none; }
[data-theme="light"] .theme-toggle .theme-icon-sun { display: none; }
[data-theme="light"] .theme-toggle .theme-icon-moon { display: inline; }

/* ── Main ── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow), var(--glow);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.card:hover {
  border-color: rgba(56, 189, 248, 0.15);
  box-shadow: var(--shadow), 0 0 40px rgba(56, 189, 248, 0.06);
}

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: 2rem 2.25rem;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(56,189,248,0.08), transparent 70%);
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .hero-visual {
    display: none;
  }
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(34,211,238,0.1));
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(56,189,248,0.15);
}

.hero h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-temp {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.temp-value {
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #e0f2fe, #38bdf8 45%, #2dd4bf 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 20px rgba(56, 189, 248, 0.25));
  transition: filter 0.4s;
}

.temp-unit {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.hero-desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.6;
}

.comfort {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
}

.comfort-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.comfort.cool .comfort-dot { background: var(--cool); box-shadow: 0 0 10px var(--cool); }
.comfort.warm .comfort-dot { background: var(--warm); box-shadow: 0 0 10px var(--warm); }
.comfort.cold .comfort-dot { background: #94a3b8; box-shadow: none; animation: none; }

.hero-visual {
  position: relative;
  width: 140px;
  height: 200px;
  align-self: center;
}

.wave-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 1; }
}

.thermo {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 36px;
  height: 160px;
  background: var(--bg-elevated);
  border: 2px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
}

.thermo-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, #0ea5e9, #22d3ee, #2dd4bf);
  border-radius: 0 0 16px 16px;
  transition: height 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.15rem 1.3rem;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease backwards;
}

.stat-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Grid layouts ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

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

/* ── Card heads ── */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0;
  flex-wrap: wrap;
}

.card-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Map controls ── */
.map-head-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.map-scale-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.map-head-actions > .map-scale-control,
.map-fs-toolbar-controls > .map-scale-control {
  display: none !important;
}

.map-scale-select {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
}

.map-scale-legend {
  display: flex;
  align-items: center;
}

.map-scale-legend[hidden] {
  display: none !important;
}

.sst-scale-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(15, 55, 72, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  backdrop-filter: blur(8px);
}

.sst-scale-legend i {
  display: block;
  width: 140px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

.sst-scale-legend span {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 2.4em;
}

.scale-legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.1rem 0.25rem;
}

.scale-legend-item i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.tpm-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
}

.tpm-toggle input {
  accent-color: var(--accent);
}

.map-ocean-source {
  display: none !important;
}

.map-ocean-source-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}

.ocean-src-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}

.ocean-src-btn:hover:not(:disabled) {
  color: var(--text);
  background: rgba(56, 189, 248, 0.12);
}

.ocean-src-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #0e7490, #38bdf8);
}

.ocean-src-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-admin-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  border: 1px dashed rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.04);
}

.map-admin-controls[hidden] {
  display: none !important;
}

.map-admin-extra.tpm-range-row,
.tpm-extra.tpm-range-row {
  flex-wrap: wrap;
}

.admin-divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 1.25rem 0;
}

.nc-hint, .nc-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.45;
}

.nc-status {
  margin-top: 0.75rem;
}

.tpm-range-auto-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  line-height: 1.2;
  border-radius: 6px;
  opacity: 0.75;
}

.tpm-range-auto-btn.active {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45);
}

.tpm-range-input {
  width: 3.2rem;
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
}

.tpm-opacity-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tpm-opacity-control input[type="range"] {
  width: 72px;
  accent-color: var(--accent);
}

/* ── Leaflet grid layers ── */
.leaflet-tpm-grid {
  pointer-events: none;
  z-index: 250;
  mix-blend-mode: normal;
  filter: none;
  will-change: auto;
}

.leaflet-tpm-grid.leaflet-tpm-bams {
  mix-blend-mode: normal;
  filter: none;
  opacity: 1;
}

.leaflet-tpm-grid.leaflet-tpm-modis {
  mix-blend-mode: normal;
  filter: none;
}

/* ── Sea probe ── */
.sea-probe-wrap {
  pointer-events: auto;
  cursor: pointer;
}

.sea-probe-pin {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.3), 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: probeGlow 2s ease-in-out infinite;
}

@keyframes probeGlow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.3), 0 4px 14px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.15), 0 4px 14px rgba(0, 0, 0, 0.35); }
}

.sea-probe-card {
  position: absolute;
  left: 12px;
  top: -8px;
  min-width: 125px;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  background: rgba(10, 15, 30, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.sea-probe-temp {
  font-size: 1.2rem;
  font-weight: 800;
  color: #7dd3fc;
}

.sea-probe-temp.na {
  color: #94a3b8;
  font-size: 0.95rem;
}

.sea-probe-wind-dir {
  margin-top: 0.1rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: #cbd5e1;
}

.sea-probe-coords {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* ── Language switch ── */
.lang-switch {
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
}

.lang-switch-btn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.lang-switch-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.lang-switch-btn:hover:not(.active) {
  color: var(--text);
}

/* ── Beach detail panel ── */
.beach-detail {
  padding: 0 1rem 1.25rem;
  overflow-y: auto;
  animation: beachSlideIn 0.35s ease;
}

@keyframes beachSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.beach-detail-header {
  padding-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.beach-detail-header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.beach-detail-hero {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.15), rgba(45, 212, 191, 0.06));
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 12px 36px rgba(14, 165, 233, 0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}

.beach-detail-temp-ring {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
}

.beach-detail-temp {
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #e0f2fe, #38bdf8 40%, #2dd4bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(56,189,248,0.2));
}

.beach-detail-unit {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.5rem;
}

.beach-detail-source {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Beach forecast chart ── */
.beach-forecast-chart-card {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(56, 189, 248, 0.15);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.beach-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.beach-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.beach-chart-tabs--primary {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 0.25rem;
}

.beach-chart-tabs--primary .beach-tab.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(45, 212, 191, 0.2));
  color: #fff;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}

.beach-chart-canvas-wrap {
  position: relative;
  height: 220px;
  min-height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 15, 30, 0.5);
  border: 1px solid var(--card-border);
}

.beach-chart-canvas-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.06), transparent 70%);
  pointer-events: none;
}

#beach-chart {
  width: 100% !important;
  height: 100% !important;
  max-height: none;
}

.beach-chart-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1.5rem;
  color: var(--muted);
  text-align: center;
}

.beach-chart-empty[hidden] {
  display: none;
}

/* ── Forecast strip ── */
.forecast-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-bottom: 0.25rem;
}

@media (max-width: 520px) {
  .forecast-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.forecast-strip[hidden] {
  display: none;
}

.forecast-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.7rem 0.5rem 0.6rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  min-width: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
}

.forecast-pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(45, 212, 191, 0.12);
  border-color: rgba(45,212,191,0.3);
}

.forecast-pill.today {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
}

.forecast-pill.active {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.3), 0 4px 16px rgba(45,212,191,0.12);
}

.forecast-pill .pill-icon {
  font-size: 1rem;
  line-height: 1;
}

.forecast-pill .pill-temp {
  font-size: 1.2rem;
  font-weight: 800;
  color: #2dd4bf;
  line-height: 1.1;
}

.forecast-pill .pill-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  text-align: center;
}

.forecast-pill .pill-weekday {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: lowercase;
  line-height: 1;
}

/* ── Beach items ── */
.beach-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: all 0.25s ease;
  position: relative;
}

.beach-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transition: height 0.25s ease;
}

.beach-item:hover::before,
.beach-item.active::before {
  height: 60%;
}

.beach-item:hover,
.beach-item.active {
  border-color: rgba(56,189,248,0.15);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.1);
}

.beach-item.active {
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.18);
}

.beach-item-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.beach-item-city {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.beach-item-temp {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

/* ── Beach panel (fullscreen) ── */
.beach-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--card-border);
  background: linear-gradient(180deg, var(--card), rgba(255, 255, 255, 0.02));
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.beach-panel-title {
  margin: 0;
  padding: 1rem 1.1rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  flex: 0 0 auto;
}

.beach-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.beach-list.hidden {
  display: none;
}

.beach-detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.1rem 1.25rem;
}

.beach-detail.hidden {
  display: none;
}

.beach-detail-back {
  border: none;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s;
}

.beach-detail-back:hover {
  opacity: 0.8;
}

.beach-detail h3 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  font-weight: 800;
}

.beach-detail-meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.beach-detail-desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.beach-detail-comfort {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.beach-detail-infra {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.beach-detail-infra li {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s;
}

.beach-detail-infra li:hover {
  border-color: rgba(56,189,248,0.25);
}

/* ── Swim score ── */
.beach-swim-score {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
}

.swim-score-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.swim-score-head strong {
  color: var(--text);
  font-size: 0.92rem;
}

.swim-score-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.swim-score-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  transition: width 0.6s cubic-bezier(0.34,1.2,0.64,1);
}

.swim-score-bar span.bad { background: #64748b; }
.swim-score-bar span.cool { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.swim-score-bar span.ok { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.swim-score-bar span.good { background: linear-gradient(90deg, #14b8a6, #34d399); }

/* ── Beach mini stats ── */
.beach-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.beach-mini-stat {
  padding: 0.6rem 0.5rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  text-align: center;
  transition: border-color 0.2s;
}

.beach-mini-stat:hover {
  border-color: rgba(56,189,248,0.2);
}

.beach-mini-stat .val {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
}

.beach-mini-stat .lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Beach chart block ── */
.beach-chart-block {
  margin-bottom: 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
}

.beach-chart-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
  background: rgba(0,0,0,0.15);
  padding: 0.25rem;
  border-radius: 10px;
}

.beach-tab {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.beach-tab.active {
  background: rgba(56,189,248,0.15);
  color: var(--text);
}

.beach-tab:hover:not(.active) {
  color: var(--text);
}

#beach-chart {
  width: 100% !important;
  max-height: 160px;
}

/* ── Beach forecast ── */
.beach-forecast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

.beach-forecast-head h4 {
  margin: 0;
}

.beach-forecast-tabs {
  display: flex;
  gap: 0.25rem;
}

.beach-forecast-tab {
  font-family: inherit;
  font-size: 0.7rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.beach-forecast-tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(56,189,248,0.1);
}

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

.beach-forecast-section h4 {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

@media (max-width: 400px) {
  .forecast-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.forecast-day {
  padding: 0.55rem 0.25rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  text-align: center;
  transition: all 0.2s;
}

.forecast-day:hover {
  transform: translateY(-1px);
  border-color: rgba(56,189,248,0.2);
}

.forecast-day.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.forecast-day .day-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.forecast-day .day-temp {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent);
}

.forecast-day .day-icon {
  font-size: 1rem;
  line-height: 1;
  margin: 0.15rem 0;
}

/* ── Map (card & fullscreen) ── */
.map-wrap {
  position: relative;
  margin: 1rem;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 12px 36px rgba(8, 35, 52, 0.08);
}

#map {
  height: 520px;
  min-height: 380px;
  width: 100%;
  background:
    radial-gradient(120% 80% at 50% 20%, #134a62 0%, #0b2a3a 55%, #071c28 100%);
  z-index: 0;
}

#map .leaflet-container {
  height: 100%;
  width: 100%;
  font-family: Manrope, sans-serif;
}

.leaflet-control-attribution {
  display: none !important;
}

.map-card {
  position: relative;
}

.map-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.map-fullscreen[hidden] {
  display: none !important;
}

body.map-fs-open {
  overflow: hidden;
}

.map-fs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(16px);
}

.map-fs-toolbar h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.map-fs-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.map-fs-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.map-fs-body > .beach-panel {
  height: 100%;
  max-width: none;
  width: auto;
}

.map-fs-body > .map-fs-map {
  min-width: 0;
  min-height: 0;
}

@media (max-width: 768px) {
  .map-fs-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(30vh, 38vh);
  }

  .map-fs-body > .map-fs-map {
    order: 1;
  }

  .map-fs-body > .beach-panel {
    order: 2;
    max-height: none;
    border-right: none;
    border-top: 1px solid var(--card-border);
  }
}

.map-fs-map {
  position: relative;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#map-fs-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-fs-map #map,
#map-fs-container #map {
  position: absolute;
  inset: 0;
  height: 100% !important;
  width: 100% !important;
  margin: 0;
  border-radius: 0;
  border: none;
}

.map-fs-map .leaflet-container {
  height: 100% !important;
  width: 100% !important;
}

/* ── Map legend ── */
.map-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.temp {
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
}

.legend-dot.beach {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
}

/* ── Map markers ── */
.beach-marker-icon {
  background: transparent !important;
  border: none !important;
}

.beach-pin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.beach-pin-label {
  display: block;
  max-width: 128px;
  margin-bottom: 3px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(10, 15, 30, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  color: #e2e8f0;
  font-family: Manrope, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

[data-theme="light"] .beach-pin-label {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-color: rgba(14,165,233,0.25);
}

:root:not([data-theme="light"]) .beach-pin-label {
  background: rgba(10, 15, 30, 0.92);
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.4);
}

.beach-marker-icon .beach-pin {
  width: 32px;
  height: 40px;
  filter: drop-shadow(0 3px 12px rgba(6, 182, 212, 0.5));
  transition: transform 0.2s ease;
}

.beach-marker-icon .beach-pin-shape {
  fill: var(--pin-color, #0ea5e9);
  stroke: #fff;
  stroke-width: 2;
}

.beach-marker-icon .beach-pin-sun {
  fill: #fde68a;
}

.beach-marker-icon .beach-pin-wave {
  stroke: #fbbf24;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.beach-marker-icon:hover .beach-pin {
  transform: scale(1.12) translateY(-3px);
}

.map-legend-hint {
  opacity: 0.75;
  font-size: 0.7rem;
}

/* ── Station markers ── */
.custom-marker,
.city-marker-icon,
.region-marker-icon {
  background: transparent !important;
  border: none !important;
}

.station-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: Manrope, sans-serif;
  white-space: nowrap;
}

.station-marker-name {
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.2;
  text-align: center;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .station-marker-name {
  color: var(--text);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

.station-marker-temp {
  border-radius: 20px;
  color: #fff;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.45);
  line-height: 1;
}

.city-marker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.45);
  font-family: Manrope, sans-serif;
  white-space: nowrap;
}

.city-marker-icon--compact .city-marker-inner {
  border-radius: 20px;
}

.city-marker-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-marker-temp {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.region-marker-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.4);
  font-family: Manrope, sans-serif;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
}

/* ── Chart card ── */
.chart-card .chart-body {
  padding: 0 1rem 0.5rem;
}

.chart-card canvas {
  padding: 0 0 1.25rem;
  max-height: 280px;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-elevated);
  padding: 0.25rem;
  border-radius: 12px;
}

.tab {
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active,
.tab:hover {
  background: var(--card);
  color: var(--text);
}

.tab.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tab.active {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* ── Stations ── */
.stations-card {
  padding-bottom: 0.5rem;
}

.search {
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  min-width: 180px;
  transition: all 0.2s;
}

.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.stations-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
}

.station-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.station-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

.station-item-right {
  text-align: right;
  flex-shrink: 0;
}

.station-item.expanded {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--sea) 35%, var(--card-border));
  box-shadow: 0 12px 28px rgba(8, 35, 52, 0.1);
  cursor: default;
}

.station-item-detail {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.station-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0 0.5rem;
}

.station-detail-title {
  margin: 0;
  font-weight: 750;
  font-size: 1.05rem;
}

.station-detail-sub {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.station-detail-now {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--sea);
  line-height: 1;
}

.station-detail-now span {
  font-size: 0.85rem;
  margin-left: 0.15rem;
  opacity: 0.75;
}

.station-detail-tabs {
  margin: 0.35rem 0 0.65rem;
}

.station-detail-chart {
  height: 220px;
  position: relative;
}

.station-detail-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chart-card[hidden] {
  display: none !important;
}

.station-dat-mark {
  color: #c45c26;
  font-size: 0.75em;
  font-weight: 600;
}

.station-fc {
  display: flex;
  gap: 0.28rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.station-fc-day {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sea-deep, #1a6b7a);
  background: rgba(26, 107, 122, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.station-fc-range {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.station-forecast-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.station-fc-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 3.4rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(8, 166, 182, 0.14), rgba(26, 107, 122, 0.06));
  border: 1px solid rgba(26, 107, 122, 0.16);
}

.station-fc-pill-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.station-fc-pill-temp {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sea-deep, #1a6b7a);
  font-variant-numeric: tabular-nums;
}

.station-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transition: height 0.25s ease;
}

.station-item:hover::before {
  height: 50%;
}

.station-item:hover {
  border-color: rgba(56,189,248,0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.1);
}

.station-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.station-item.active::before {
  height: 60%;
}

.station-name {
  font-weight: 700;
  margin: 0;
}

.station-region {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.station-temp {
  font-size: 1.35rem;
  font-weight: 800;
  white-space: nowrap;
}

.station-temp span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.trend {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
}

.trend.up { color: #f87171; background: rgba(248, 113, 113, 0.12); }
.trend.down { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.trend.flat { color: var(--text-muted); background: var(--bg-elevated); }

/* ── Info grid ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.info-card {
  padding: 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.info-card:hover::before {
  opacity: 0.6;
}

.info-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.55rem;
}

.info-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.info-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-card code {
  font-size: 0.8em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--bg-elevated);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer p { margin: 0; }

/* ── Animations ── */
.btn.refreshing svg {
  animation: spin 0.8s linear infinite;
}

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

/* ── Leaflet popup ── */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  font-family: var(--font);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

.popup-temp {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0ea5e9;
}

/* ── Auth overlay ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.auth-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.auth-box {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2.25rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 60px rgba(56,189,248,0.06);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.auth-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
}

.auth-box h2 {
  margin: 0 0 1.25rem;
  font-weight: 800;
}

.auth-box input {
  width: 100%;
  padding: 0.8rem 1rem;
  margin: 0.4rem 0;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
}

.auth-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}

.auth-error {
  color: #f87171;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 0.5rem 0;
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.link-btn {
  margin-top: 0.85rem;
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.link-btn:hover {
  opacity: 0.8;
}

.user-badge {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(34,211,238,0.08));
  color: var(--accent);
  border: 1px solid rgba(56,189,248,0.2);
}

/* ── Admin panel ── */
.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}

.admin-panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: 95%;
  max-width: 960px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--card-border);
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.85rem 1.25rem 0;
  background: var(--bg-elevated);
}

.admin-tab {
  flex: 1;
  padding: 0.55rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.admin-table tbody tr {
  transition: background 0.15s;
}

.admin-table tbody tr:hover {
  background: rgba(56,189,248,0.04);
}

.admin-actions {
  display: flex;
  gap: 0.4rem;
}

.admin-form {
  padding: 1.25rem;
  border-top: 1px solid var(--card-border);
  background: var(--bg-elevated);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.form-label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  gap: 0.3rem;
}

.form-label input,
.form-label textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.form-label input:focus,
.form-label textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}

.form-label textarea {
  resize: vertical;
  min-height: 60px;
}

.form-label input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ── Light theme overrides ── */
[data-theme="light"] .beach-forecast-chart-card {
  background: linear-gradient(180deg, #fff, #f0f9ff);
  border-color: rgba(14, 165, 233, 0.12);
}

[data-theme="light"] .beach-chart-canvas-wrap {
  background: #f8fafc;
}

[data-theme="light"] .beach-detail-hero {
  background: linear-gradient(145deg, #e0f2fe, #f0fdfa);
}

[data-theme="light"] .brand h1 {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--text);
}

/* ── Beach detail actions ── */
.beach-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}
}

@layer utilities {
  /* Strict visibility contract used by HTML and application scripts. */
  [hidden],
  .hidden {
    display: none !important;
  }

  .sr-only {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

@layer overrides {
  html {
    color-scheme: light;
    accent-color: var(--accent);
  }

  [data-theme="dark"] { color-scheme: dark; }
  [data-theme="light"] { color-scheme: light; }

  body {
    font-family: var(--font);
    background:
      radial-gradient(circle at 8% 4%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 28rem),
      radial-gradient(circle at 92% 15%, color-mix(in srgb, var(--accent-2) 11%, transparent), transparent 32rem),
      var(--bg);
  }

  :where(button, [role="button"], a, input, select, textarea):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 52%, transparent);
    outline-offset: 3px;
  }

  :where(button, .btn, .tab, .section-tab, .layer-tab, .depth-tab, .admin-tab) {
    min-block-size: 44px;
  }

  .main,
  .header,
  .landing {
    inline-size: min(100%, var(--content-max, 1280px));
    margin-inline: auto;
  }

  .card,
  .landing-card,
  .landing-top,
  .admin-panel,
  .auth-box {
    border-color: var(--card-border);
    background: var(--card);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(var(--blur));
    backdrop-filter: blur(var(--blur));
  }

  .stats-grid,
  .stations-list,
  .info-grid {
    container-type: inline-size;
  }

  @container (max-width: 560px) {
    .station-item-main,
    .card-head {
      align-items: stretch;
      flex-direction: column;
    }
  }

  .card:has(.refreshing),
  .station-item:has(.refreshing) {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--card-border));
  }

  @supports (grid-template-columns: subgrid) {
    .compare-grid {
      align-items: stretch;
    }
    .compare-card {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 5;
    }
  }

  @media (forced-colors: active) {
    :where(.card, .btn, .tab, .section-tab, .layer-tab, .station-item, .beach-item) {
      border: 1px solid CanvasText;
    }
    :where(.brand-mark, .comfort-dot, .legend-dot) {
      forced-color-adjust: none;
    }
  }
}
