/* ==========================================================================
   USWeather.live - Master Design System
   Dynamic Atmospheric Glassmorphism & Modern Weather Dashboard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Dynamic Atmospheric Midnight (Default / Dark) */
  --bg-body: #070b14;
  --bg-canvas: #0b1220;
  --bg-card: rgba(18, 27, 46, 0.65);
  --bg-card-solid: #111a2e;
  --bg-card-hover: rgba(28, 41, 68, 0.75);
  --bg-card-elevated: rgba(24, 36, 61, 0.85);
  --bg-glass-input: rgba(12, 19, 34, 0.7);
  --bg-pill: rgba(255, 255, 255, 0.08);
  --bg-pill-hover: rgba(56, 189, 248, 0.18);
  --bg-badge: rgba(56, 189, 248, 0.12);

  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glass-bright: rgba(255, 255, 255, 0.18);
  --border-glass-active: rgba(56, 189, 248, 0.45);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-on-accent: #ffffff;

  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.25);
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --gradient-brand: linear-gradient(135deg, #38bdf8 0%, #3b82f6 50%, #6366f1 100%);
  --gradient-sun: linear-gradient(135deg, #fde047 0%, #f59e0b 50%, #ea580c 100%);
  --gradient-night: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  --gradient-radar: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-cyan: 0 8px 24px -4px rgba(56, 189, 248, 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --blur-glass: blur(20px);
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-height: 74px;
}

/* Light / Daylight Theme */
[data-theme="light"],
body.theme-day {
  --bg-body: #f0f6fe;
  --bg-canvas: #e8f2fc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-card-elevated: #ffffff;
  --bg-glass-input: rgba(255, 255, 255, 0.9);
  --bg-pill: rgba(14, 165, 233, 0.08);
  --bg-pill-hover: rgba(14, 165, 233, 0.16);
  --bg-badge: rgba(14, 165, 233, 0.1);

  --border-glass: rgba(15, 23, 42, 0.08);
  --border-glass-bright: rgba(14, 165, 233, 0.25);
  --border-glass-active: rgba(14, 165, 233, 0.6);

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
  --shadow-cyan: 0 8px 24px -4px rgba(14, 165, 233, 0.25);

  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 246, 255, 0.7) 100%);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Atmospheric Ambient Background Glow */
.atmospheric-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.atmospheric-bg::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 15%;
  width: 70vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.06) 50%, transparent 80%);
  filter: blur(80px);
  border-radius: 50%;
  animation: atmospheric-drift 24s ease-in-out infinite alternate;
}

.atmospheric-bg::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: 5%;
  width: 50vw;
  height: 50vh;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(59, 130, 246, 0.04) 60%, transparent 80%);
  filter: blur(90px);
  border-radius: 50%;
}

@keyframes atmospheric-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.05); }
  100% { transform: translate(40px, -20px) scale(0.95); }
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7dd3fc;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

main.container {
  padding-top: 32px;
  padding-bottom: 80px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(11, 18, 32, 0.78);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--border-glass);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.82);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-cyan);
  transition: transform 0.2s ease;
}

.brand:hover .brand-icon {
  transform: scale(1.05) rotate(2deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-title span.tld {
  color: var(--accent-cyan);
  font-weight: 700;
}

.brand-tagline {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-tagline .live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

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

/* Live Global Search Bar */
.search-container {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon-left {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 84px 0 42px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-glass-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  outline: none;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
  background: var(--bg-card-elevated);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-actions {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-locate {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-locate:hover {
  color: var(--accent-cyan);
  background: var(--bg-pill);
}

.search-shortcut {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-pill);
  border: 1px solid var(--border-glass);
  padding: 2px 7px;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}

/* Autocomplete Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  display: none;
  backdrop-filter: var(--blur-glass);
}

.search-dropdown.active {
  display: block;
  animation: dropdown-fade-in 0.18s ease-out;
}

@keyframes dropdown-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  padding: 10px 14px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--text-main);
  text-decoration: none;
  transition: background 0.15s ease;
  font-size: 0.95rem;
}

.dropdown-item:hover,
.dropdown-item.focused {
  background: var(--bg-pill-hover);
  color: var(--accent-cyan);
}

.dropdown-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-badge {
  background: var(--bg-badge);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Header Controls & Nav */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
  background: var(--bg-pill);
}

/* Unit Toggle (°F / °C) */
.unit-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-pill);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 3px;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.unit-btn {
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unit-btn.active {
  background: var(--accent-cyan);
  color: #0b1220;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.4);
}

/* Theme Toggle */
.theme-toggle-btn {
  background: var(--bg-pill);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--accent-amber);
  background: var(--bg-pill-hover);
  border-color: var(--border-glass-bright);
}

/* Mobile Hamburger */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 8px;
  cursor: pointer;
}

/* ==========================================================================
   Severe Weather Alerts Banner
   ========================================================================== */
.alert-container {
  margin-bottom: 24px;
}

.severe-alert-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(185, 28, 28, 0.25) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-left: 5px solid #ef4444;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  backdrop-filter: var(--blur-glass);
  box-shadow: 0 8px 24px -4px rgba(239, 68, 68, 0.2);
  margin-bottom: 12px;
  animation: alert-glow 3s infinite alternate;
}

@keyframes alert-glow {
  0% { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15); }
  100% { box-shadow: 0 8px 30px rgba(239, 68, 68, 0.35); }
}

.alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.alert-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-beacon {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse-beacon 1.5s infinite;
}

@keyframes pulse-beacon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.alert-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
}

.alert-headline {
  font-size: 1rem;
  font-weight: 700;
  color: #fee2e2;
}

.alert-toggle-icon {
  color: #fca5a5;
  transition: transform 0.2s ease;
}

.alert-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 0.92rem;
  color: #fecaca;
  line-height: 1.6;
  white-space: pre-line;
  display: none;
}

.alert-body.expanded {
  display: block;
}

/* Light theme: pink translucent card needs dark red text for contrast */
[data-theme="light"] .alert-headline {
  color: #991b1b;
}

[data-theme="light"] .alert-body {
  color: #7f1d1d;
}

[data-theme="light"] .alert-body strong {
  color: #991b1b;
}

[data-theme="light"] .alert-toggle-icon {
  color: #b91c1c;
}

/* ==========================================================================
   Hero & Weather Dashboard Layout
   ========================================================================== */
.weather-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

/* Station Live Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.status-station {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Hero Weather Card */
.hero-weather-card {
  position: relative;
  background: var(--bg-card);
  background-image: var(--gradient-card);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl);
  padding: 36px 36px;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero-weather-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, var(--accent-cyan-glow) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 32px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.location-heading {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.state-tag {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: var(--bg-badge);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

.temp-hero-display {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0;
}

.temp-huge {
  font-family: var(--font-display);
  font-size: 5.6rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-main);
}

.temp-unit-symbol {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 6px;
}

.hero-condition-text {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-main);
}

.hero-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-pill);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.meta-pill strong {
  color: var(--text-main);
  font-weight: 600;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-weather-artwork {
  width: 170px;
  height: 170px;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
  animation: float-art 6s ease-in-out infinite alternate;
}

@keyframes float-art {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

/* ==========================================================================
   Key Meteorological Metrics Grid (6 Cards)
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: var(--blur-glass);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glass-bright);
  box-shadow: var(--shadow-md);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.metric-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-pill);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.metric-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Interactive Hourly Forecast (24 Hours)
   ========================================================================== */
.forecast-section {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-md);
}

.section-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 700;
}

.section-title svg {
  color: var(--accent-cyan);
}

.hourly-scroll-wrap {
  position: relative;
}

.hourly-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass-bright) transparent;
}

.hourly-track::-webkit-scrollbar {
  height: 6px;
}

.hourly-track::-webkit-scrollbar-thumb {
  background: var(--border-glass-bright);
  border-radius: var(--radius-full);
}

.hour-card {
  flex: 0 0 100px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.hour-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

.hour-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.hour-card.now .hour-time {
  color: var(--accent-cyan);
  font-weight: 700;
}

.hour-art {
  width: 38px;
  height: 38px;
}

.hour-temp {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.hour-precip {
  font-size: 0.75rem;
  font-weight: 600;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ==========================================================================
   7-Day Extended Forecast
   ========================================================================== */
.daily-forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.daily-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.daily-card:hover {
  border-color: var(--border-glass-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.daily-card.night-period {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 27, 75, 0.4) 100%);
}

.daily-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.daily-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.daily-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.daily-badge.day {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.daily-badge.night {
  background: rgba(129, 140, 248, 0.15);
  color: #a5b4fc;
}

.daily-card-mid {
  display: flex;
  align-items: center;
  gap: 14px;
}

.daily-art {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.daily-temp-wrap {
  display: flex;
  flex-direction: column;
}

.daily-temp {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.daily-desc-short {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.daily-detail-narrative {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border-glass);
  padding-top: 10px;
  display: none;
}

.daily-card.expanded .daily-detail-narrative {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   Radar & Live NOAA Map Hub
   ========================================================================== */
.radar-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.radar-preview-box {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  position: relative;
  background: #080f1d;
}

.radar-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.radar-overlay-banner {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: var(--blur-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass-bright);
}

/* ==========================================================================
   Chips & City List Explorer
   ========================================================================== */
.chip-section {
  margin-bottom: 36px;
}

.chip-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  backdrop-filter: var(--blur-glass);
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #0b1220;
  box-shadow: var(--shadow-cyan);
  transform: translateY(-2px);
  text-decoration: none;
}

.chip.chip-territory {
  border-style: dashed;
}

.chip.chip-active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #0b1220;
  box-shadow: var(--shadow-cyan);
}

/* Alphabet Filter Bar */
.alphabet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.alpha-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
}

.alpha-btn:hover,
.alpha-btn.active {
  background: var(--accent-cyan);
  color: #0b1220;
}

/* ==========================================================================
   States & Regions Cards (Census Regions)
   ========================================================================== */
.regions-container {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 24px;
}

.region-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.states-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.state-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  backdrop-filter: var(--blur-glass);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.state-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.state-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.state-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.state-cities-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.state-code-pill {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-pill);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-cyan);
}

/* ==========================================================================
   Blog Magazine Cards
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: var(--blur-glass);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glass-bright);
  box-shadow: var(--shadow-lg);
}

.post-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.post-card:hover .post-title {
  color: var(--accent-cyan);
}

.post-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Post Detail Article */
.article-container {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 44px;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-lg);
}

.article-header {
  margin-bottom: 28px;
}

.article-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.2;
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ==========================================================================
   Breadcrumbs & Navigation Badges
   ========================================================================== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb-item:hover {
  color: var(--accent-cyan);
}

.breadcrumb-separator {
  color: var(--border-glass-bright);
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   Home Hero Section (when no detected location)
   ========================================================================== */
.welcome-hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 60px 40px;
  margin-bottom: 40px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%), url('../img/bg_day.jpg') center/cover no-repeat;
  border: 1px solid var(--border-glass-bright);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .welcome-hero,
body:not([data-theme="light"]) .welcome-hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(17, 24, 39, 0.9) 100%), url('../img/bg_night.jpg') center/cover no-repeat;
}

.welcome-hero-content {
  max-width: 680px;
  position: relative;
  z-index: 2;
  color: #f1f5f9; /* dark photo card in both themes — always light text */
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.welcome-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: #ffffff;
}

.welcome-subtitle {
  font-size: 1.15rem;
  color: rgba(241, 245, 249, 0.82);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ==========================================================================
   Detected Location Callout Banner
   ========================================================================== */
.detected-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid var(--border-glass-active);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 24px;
  backdrop-filter: var(--blur-glass);
}

.detected-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detected-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.detected-text strong {
  color: var(--text-main);
  font-size: 1.05rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: rgba(7, 11, 20, 0.9);
  backdrop-filter: var(--blur-glass);
  border-top: 1px solid var(--border-glass);
  padding: 50px 0 30px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

[data-theme="light"] .site-footer {
  background: rgba(240, 246, 255, 0.9);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-desc {
  max-width: 380px;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Mobile Bottom Navigation Bar (Fixed for phones)
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-top: 1px solid var(--border-glass-bright);
  z-index: 150;
  justify-content: space-around;
  align-items: center;
}

[data-theme="light"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.94);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-left {
    align-items: center;
  }
  .location-title-wrap {
    justify-content: center;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .site-header .main-nav {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  body {
    padding-bottom: 74px;
  }

  .search-container {
    max-width: none;
  }

  .search-shortcut {
    display: none;
  }

  .brand-tagline {
    display: none;
  }

  .hero-weather-card {
    padding: 24px 20px;
  }

  .location-heading {
    font-size: 1.7rem;
  }

  .temp-huge {
    font-size: 4.2rem;
  }

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

  .welcome-title {
    font-size: 2.1rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .daily-forecast-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-weather-card {
    padding: 20px 16px;
  }

  .temp-huge {
    font-size: 3.6rem;
  }

  .hero-weather-artwork {
    width: 120px;
    height: 120px;
  }

  .metric-card {
    padding: 16px;
  }

  .hour-card {
    flex: 0 0 88px;
    padding: 10px 8px;
  }
}


/* ==========================================================================
   Admin Panel & Form UI
   ========================================================================== */
.form {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 28px;
  border-radius: var(--radius-xl);
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-md);
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.form input,
.form select,
.form textarea {
  padding: 10px 14px;
  background: var(--bg-glass-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.form .check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form button,
.btn-primary {
  align-self: flex-start;
  padding: 10px 24px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-cyan);
  transition: all 0.2s ease;
}

.form button:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.login-box {
  max-width: 440px;
  margin: 80px auto;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  margin-bottom: 32px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 14px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass-bright);
  background: var(--bg-card-solid);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.92rem;
  color: var(--text-main);
}

.admin-table tr:hover td {
  background: var(--bg-pill-hover);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-cyan);
}

.stat span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inline-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.inline-filter select {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
}

.alert-info {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}


/* ==========================================================================
   2-Column Layout & Top Stories Sidebar (AccuWeather Style)
   ========================================================================== */
.home-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: start;
}

.home-main-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.home-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.top-stories-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl);
  padding: 24px 22px;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.top-stories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-glass);
}

.top-stories-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.top-stories-see-more {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}

.top-stories-see-more:hover {
  transform: translateX(3px);
  color: #7dd3fc;
}

.top-stories-list {
  display: flex;
  flex-direction: column;
}

.story-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-glass);
}

.story-item:last-child {
  border-bottom: none;
}

.story-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse-beacon 1.4s infinite;
}

.story-category {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.story-category.badge-live {
  color: #ef4444;
}

.story-category.badge-severe {
  color: #f97316;
}

.story-category.badge-winter {
  color: #38bdf8;
}

.story-category.badge-science {
  color: #a855f7;
}

.story-category.badge-standard {
  color: var(--accent-cyan);
}

.story-headline {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin: 0;
}

.story-headline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.story-headline a:hover {
  color: var(--accent-cyan);
}

.story-sub-entry {
  background: var(--bg-pill);
  border-left: 3px solid #ef4444;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin: 4px 0 2px;
}

.sub-entry-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fca5a5;
  display: block;
}

.sub-entry-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin: 0;
}

.story-time {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.story-thumb-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  background: var(--bg-card-solid);
  display: block;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.story-thumb-wrap:hover {
  transform: scale(1.04);
  border-color: var(--accent-cyan);
}

.story-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-stories-footer {
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid var(--border-glass);
  text-align: center;
}

.all-news-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.all-news-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

@media (max-width: 1080px) {
  .home-layout-grid {
    grid-template-columns: 1fr;
  }
  .top-stories-widget {
    position: static;
  }
}


/* Mobile Header Fixes */
@media (max-width: 768px) {
  .brand-text {
    display: none !important;
  }
  .header-inner {
    gap: 12px !important;
  }
  .header-actions {
    gap: 6px !important;
  }
  .search-input {
    padding: 0 40px 0 36px !important;
    font-size: 16px !important;
  }
}


/* ==========================================================================
   Auth & Account Pages (glassmorphism, design-system variables)
   ========================================================================== */
.muted { color: var(--text-muted); }

.auth-wrap { display: flex; justify-content: center; padding: 20px 0 40px; }
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
}
.auth-card h1 { margin-bottom: 6px; font-size: 1.7rem; }
.auth-card .muted { margin-bottom: 18px; }

.auth-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.auth-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-glass-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-form input::placeholder { color: var(--text-muted); }
.auth-form input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}
.auth-form .btn-primary {
  display: block;
  width: 100%;
  margin: 10px 0 16px;
  padding: 12px;
  font-size: 1rem;
  cursor: pointer;
  align-self: stretch;
}

.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.acct-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
}
.acct-card h3 { margin-top: 0; font-size: 1.15rem; }

/* in-card search row (account page) */
.acct-card .search { display: flex; gap: 8px; }
.acct-card .search input {
  flex: 1;
  padding: 10px 14px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-glass-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  outline: none;
}
.acct-card .search input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}
.acct-card .search button {
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}
.acct-card .search button:hover { transform: translateY(-2px); filter: brightness(1.1); }

.sub-list { list-style: none; padding: 0; margin: 0; }
.sub-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-glass);
  flex-wrap: wrap;
}
.sub-list li:last-child { border-bottom: 0; }
.sub-actions { display: inline-flex; gap: 8px; }
.sub-actions .chip { cursor: pointer; font-family: var(--font-main); }

@media (max-width: 760px) {
  .acct-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 22px; }
}

/* ==========================================================================
   Hero Search (homepage, moved from header — NWS-style labeled field)
   ========================================================================== */
.hero-search { margin: 22px 0 20px; max-width: 560px; }
.hero-search-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.78);
  margin-bottom: 9px;
}
.hero-search-label svg { color: var(--accent-cyan); flex-shrink: 0; }
.hero-search-label strong { color: #ffffff; font-weight: 700; }
.hero-search .search-container { max-width: 100%; }
.hero-search .search-input { height: 52px; font-size: 1rem; padding-right: 108px; }
.hero-search-go {
  border: 0;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 20px;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}
.hero-search-go:hover { transform: translateY(-1px); filter: brightness(1.12); }
@media (max-width: 560px) {
  .hero-search .search-input { height: 46px; padding-right: 96px; font-size: 0.92rem; }
  .hero-search-go { padding: 7px 14px; }
}

/* Small °C alt under hero °F temperature (unit switcher temporarily hidden) */
.temp-alt {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 8px;
}

/* Air Quality (US AQI) metric card — EPA category palette */
.aqi-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid currentColor;
}
.aqi-pm { font-size: 0.78rem; color: var(--text-muted); margin-left: 6px; }
.aqi-good     { color: #34d399; } .aqi-icon-good     { color: #34d399; }
.aqi-moderate { color: #fbbf24; } .aqi-icon-moderate { color: #fbbf24; }
.aqi-usg      { color: #fb923c; } .aqi-icon-usg      { color: #fb923c; }
.aqi-unhealthy{ color: #f87171; } .aqi-icon-unhealthy{ color: #f87171; }
.aqi-very     { color: #c084fc; } .aqi-icon-very     { color: #c084fc; }
.aqi-hazard   { color: #f43f5e; } .aqi-icon-hazard   { color: #f43f5e; }
.aqi-na       { color: var(--text-muted); } .aqi-icon-na { color: var(--text-muted); }

/* Air Quality page — AirNow-style report panel */
.aq-panel {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 60%, #0c2d6b 100%);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  margin: 24px 0 36px;
  color: #e2e8f0;
}
.aq-gauge-col { flex: 0 0 340px; }
.aq-gauge { width: 100%; height: auto; display: block; }
.aq-tick { font-size: 11px; fill: rgba(255,255,255,.85); font-weight: 600; }
.aq-reading { margin-top: 8px; }
.aq-reading-row { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.92rem; margin-top: 8px; }
.aq-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 46px; padding: 0 6px;
  border: 3px solid; border-radius: 50%;
  font-size: 1.3rem; font-weight: 800; color: #fff;
}
.aq-time { color: rgba(226,232,240,.75); font-size: 0.8rem; }
.aq-spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin-top: 18px; }
.aq-bar { flex: 1; min-width: 3px; border-radius: 2px 2px 0 0; }
.aq-spark-label { text-align: center; font-size: 0.8rem; color: rgba(226,232,240,.75); margin-top: 6px; }
.aq-side { flex: 1; min-width: 0; }
.aq-side .search-form { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); }
.aq-city { font-size: 2rem; margin: 22px 0 4px; color: #fff; }
.aq-area { color: rgba(226,232,240,.8); font-size: 0.92rem; }
.aq-side-links { margin: 14px 0 26px; }
.aq-forecast-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(226,232,240,.7); margin-bottom: 12px; }
.aq-forecast { display: flex; gap: 34px; }
.aq-day { text-align: center; }
.aq-day-name { font-size: 0.82rem; color: rgba(226,232,240,.8); margin-bottom: 8px; }
.aq-dot { width: 56px; height: 56px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); margin: 0 auto; }
.aq-day-cat { font-size: 0.8rem; font-weight: 700; color: #fff; margin-top: 8px; max-width: 92px; }
@media (max-width: 860px) {
  .aq-panel { flex-direction: column; padding: 28px 22px; }
  .aq-gauge-col { flex: none; width: 100%; }
}

/* State AQI table (AirNow-style reporting areas) */
.aq-state-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin: 24px 0 36px;
}
.aq-state-title { font-size: 2rem; margin: 0; text-align: center; color: var(--text-main); }
.aq-table { border: 1px solid var(--border-glass); border-radius: var(--radius-lg); overflow: hidden; }
.aq-tr {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  align-items: center;
  border-top: 1px solid var(--border-glass);
}
.aq-tr:first-child { border-top: none; }
.aq-tr:nth-child(even) { background: rgba(120,140,180,.05); }
.aq-th { background: rgba(120,140,180,.1); }
.aq-th > div {
  padding: 14px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.aq-th-date { text-transform: none; font-weight: 500; }
.aq-td { padding: 14px; text-align: center; }
.aq-td-area { padding: 14px 18px; text-align: left; }
.aq-area-link { font-weight: 600; color: var(--accent-cyan, #38bdf8); }
.aq-row-time { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.aq-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  font-weight: 800; font-size: 1.05rem;
}
.aq-circle-na { background: #475569; color: #cbd5e1; font-size: 0.78rem; }
.aq-cell-cat { font-size: 0.78rem; color: var(--text-muted); margin-top: 7px; line-height: 1.35; }
@media (max-width: 640px) {
  .aq-state-wrap { padding: 22px 14px; }
  .aq-tr { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .aq-th > div, .aq-td { padding: 10px 5px; font-size: 0.68rem; }
  .aq-td-area { padding: 10px 8px; font-size: 0.82rem; }
  .aq-circle { width: 36px; height: 36px; font-size: 0.85rem; }
}

/* Interactive AQI map (Leaflet + OSM) */
.aq-map-sec {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  margin: 24px 0 36px;
}
.aq-map-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 700; color: var(--text-main);
  margin-bottom: 14px;
}
.aq-map {
  height: 440px;
  width: 100%;
  border-radius: var(--radius-lg);
  z-index: 1; /* keep leaflet panes below site header */
  background: #e8eef4;
}
.aqi-marker { background: none; border: none; }
.aqi-marker span {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.4);
  font-size: 0.82rem; font-weight: 800;
}
.aqi-pop-link { font-weight: 700; }
.leaflet-container { font-family: inherit; }

/* ==========================================================================
   NOAA Live Services sidebar widget
   ========================================================================== */
.noaa-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 20px 18px;
  backdrop-filter: blur(12px);
}
.noaa-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding: 0 4px;
}
.noaa-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.02rem; font-weight: 800; color: var(--text-main); margin: 0;
}
.noaa-badge {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-cyan); background: rgba(14,165,233,0.1);
  border: 1px solid var(--border-glass-bright);
  padding: 3px 9px; border-radius: 999px;
}
.noaa-list { display: flex; flex-direction: column; gap: 10px; }

.noaa-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.noaa-icon {
  flex: 0 0 34px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.noaa-icon-blue   { background: rgba(59,130,246,.15);  color: #60a5fa; }
.noaa-icon-orange { background: rgba(249,115,22,.15);  color: #fb923c; }
.noaa-icon-red    { background: rgba(239,68,68,.14);   color: #f87171; }
.noaa-icon-fire   { background: rgba(234,88,12,.16);   color: #ff9a3c; }
.noaa-icon-gold   { background: rgba(245,197,24,.16);  color: #f5c518; }
.noaa-icon-cyan   { background: rgba(34,211,238,.14);  color: #22d3ee; }
.noaa-icon-violet { background: rgba(139,92,246,.15);  color: #a78bfa; }
[data-theme="light"] .noaa-icon-blue   { color: #2563eb; }
[data-theme="light"] .noaa-icon-orange { color: #ea580c; }
[data-theme="light"] .noaa-icon-red    { color: #dc2626; }
[data-theme="light"] .noaa-icon-fire   { color: #c2410c; }
[data-theme="light"] .noaa-icon-gold   { color: #b8890a; }
[data-theme="light"] .noaa-icon-cyan   { color: #0891b2; }
[data-theme="light"] .noaa-icon-violet { color: #7c3aed; }

.noaa-body { flex: 1; min-width: 0; }
.noaa-card-title {
  font-size: 0.92rem; font-weight: 800; color: var(--text-main);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.noaa-sub { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; margin-top: 4px; }

.noaa-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem; font-weight: 700; margin-top: 5px;
}
.noaa-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.noaa-status.is-quiet  { color: #34d399; } .noaa-status.is-quiet  .noaa-dot { background: #34d399; }
.noaa-status.is-active { color: #f87171; } .noaa-status.is-active .noaa-dot { background: #ef4444; animation: noaaPulse 1.6s infinite; }
@keyframes noaaPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); } }

.noaa-storm {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  font-size: 0.8rem; color: var(--text-main); margin-top: 6px;
}
.noaa-storm span { color: var(--text-secondary); font-size: 0.76rem; }
.noaa-storm-move { width: 100%; color: var(--text-muted); }

.noaa-thumb {
  display: block; width: 100%; margin-top: 9px;
  border-radius: 8px; border: 1px solid var(--border-glass);
  background: #fff;
}

.noaa-sun-rows { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.noaa-sun-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem; color: var(--text-secondary);
}
.noaa-sun-row svg { color: var(--accent-cyan); }
.noaa-sun-row strong { margin-left: auto; color: var(--text-main); font-size: 0.82rem; }
.noaa-sun-loc { margin-top: 7px; }

.noaa-metar { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.noaa-metar-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.79rem; color: var(--text-secondary);
}
.noaa-metar-row strong { color: var(--text-main); font-weight: 800; letter-spacing: 0.02em; }
.noaa-metar-wind { margin-left: auto; color: var(--text-muted); font-size: 0.75rem; }
.flt-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.flt-vfr  { background: #22c55e; } .flt-mvfr { background: #3b82f6; }
.flt-ifr  { background: #ef4444; } .flt-lifr { background: #c026d3; }

.noaa-card-map .noaa-body { width: 100%; }
.noaa-map {
  height: 210px; margin-top: 8px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-glass);
  background: var(--bg-inner);
}
.noaa-legend {
  display: flex; gap: 14px; margin-top: 8px;
  font-size: 0.68rem; color: var(--text-muted);
}
.noaa-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }



/* ==========================================================================
   NOAA Live Services - professional redesign (overrides)
   ========================================================================== */
.noaa-widget {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.35);
}
.noaa-head {
  margin: 0; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(14,165,233,.14), rgba(99,102,241,.08));
  border-bottom: 1px solid var(--border-glass);
  gap: 10px; flex-wrap: wrap;
}
.noaa-title {
  font-size: 0.95rem; font-weight: 800; letter-spacing: .01em;
  text-transform: none; margin: 0;
}
.noaa-head-sub {
  font-size: 0.68rem; color: var(--text-muted);
  letter-spacing: .03em; margin-top: 3px;
}
.noaa-title svg { color: var(--accent-cyan); }
.noaa-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.62rem; letter-spacing: .1em;
  padding: 4px 10px;
}
.noaa-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: noaaLive 2s infinite;
}
@keyframes noaaLive {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70%,100% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.noaa-list { gap: 10px; padding: 12px 12px 14px; }
.noaa-card {
  --noaa-accent: var(--accent-cyan);
  position: relative;
  gap: 14px; padding: 14px 16px;
  background: linear-gradient(160deg, rgba(148,163,184,.09), rgba(148,163,184,.03));
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.noaa-card::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--noaa-accent);
  opacity: .45; transition: opacity .25s ease;
}
.noaa-card:hover {
  border-color: var(--border-glass-bright);
  background: linear-gradient(160deg, rgba(148,163,184,.14), rgba(148,163,184,.05));
  transform: translateY(-1px);
}
.noaa-card:hover::before { opacity: 1; }

.noaa-card-map { padding-bottom: 13px; }
.noaa-map {
  height: 230px; margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  box-shadow: inset 0 2px 10px rgba(0,0,0,.28), 0 4px 14px -6px rgba(0,0,0,.3);
}
.noaa-legend { gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.noaa-legend span {
  padding: 3px 9px; border-radius: 999px;
  background: rgba(148,163,184,.1);
  border: 1px solid var(--border-glass);
  font-size: 0.66rem; font-weight: 600; letter-spacing: .02em;
}
.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper {
  background: var(--bg-card-solid); color: var(--text-main);
  border-radius: 10px; font-size: 0.78rem;
}
.leaflet-popup-tip { background: var(--bg-card-solid); }
.leaflet-bar a { background: var(--bg-card-solid); color: var(--text-main); border-color: var(--border-glass); }
.leaflet-bar a:hover { background: var(--bg-inner); color: var(--text-main); }
.noaa-card:has(.noaa-icon-blue)   { --noaa-accent: #3b82f6; }
.noaa-card:has(.noaa-icon-orange) { --noaa-accent: #f97316; }
.noaa-card:has(.noaa-icon-red)    { --noaa-accent: #ef4444; }
.noaa-card:has(.noaa-icon-fire)   { --noaa-accent: #ea580c; }
.noaa-card:has(.noaa-icon-gold)   { --noaa-accent: #f5c518; }
.noaa-card:has(.noaa-icon-cyan)   { --noaa-accent: #22d3ee; }
.noaa-card:has(.noaa-icon-violet) { --noaa-accent: #8b5cf6; }

.noaa-icon {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--noaa-accent) 30%, transparent);
  transition: transform .25s ease;
}
.noaa-card:hover .noaa-icon { transform: scale(1.08) rotate(-4deg); }

.noaa-card-title {
  font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-secondary);
}
.noaa-sub { font-size: 0.76rem; margin-top: 5px; }

.noaa-status {
  display: inline-flex; width: fit-content;
  padding: 4px 10px; margin-top: 7px;
  border-radius: 999px; font-size: 0.76rem;
  border: 1px solid transparent;
}
.noaa-status.is-quiet  { background: rgba(52,211,153,.1);  border-color: rgba(52,211,153,.25); }
.noaa-status.is-active { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.28); }

.noaa-storm {
  padding: 8px 10px; margin-top: 8px;
  background: rgba(249,115,22,.08);
  border-left: 2px solid #f97316; border-radius: 6px;
}

.noaa-thumb {
  margin-top: 11px; border-radius: 10px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 4px 14px -6px rgba(0,0,0,.4);
  transition: transform .3s ease, box-shadow .3s ease;
}
.noaa-card:hover .noaa-thumb { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(0,0,0,.5); }

/* SPC risk ladder */
.risk-ladder { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.risk-chip {
  font-size: 0.6rem; font-weight: 800; letter-spacing: .05em;
  padding: 3px 7px; border-radius: 6px;
  color: var(--text-muted); background: rgba(148,163,184,.08);
  border: 1px solid var(--border-glass);
  opacity: .55; transition: opacity .2s;
}
.risk-chip.is-on { opacity: 1; }
.risk-tstm.is-on { background: rgba(140,190,140,.22);  border-color: #8cbe8c; color: #9fd6a0; }
.risk-mrgl.is-on { background: rgba(30,120,50,.28);    border-color: #1e7832; color: #7fce8d; }
.risk-slgt.is-on { background: rgba(240,220,60,.2);    border-color: #d6c840; color: #f0e06a; }
.risk-enh.is-on  { background: rgba(230,140,40,.22);   border-color: #e08c28; color: #f5b35e; }
.risk-mdt.is-on  { background: rgba(215,60,50,.24);    border-color: #d73c32; color: #f08a80; }
.risk-high.is-on { background: rgba(190,40,150,.26);   border-color: #be2896; color: #f08ad0; }

/* Sunrise/sunset stats + daylight track */
.noaa-sun-stats { display: flex; gap: 10px; margin-top: 8px; }
.sun-stat {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 10px;
  background: rgba(148,163,184,.07);
  border: 1px solid var(--border-glass);
}
.sun-stat svg { color: #f5c518; flex: 0 0 auto; }
.sun-stat span {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
}
.sun-stat strong {
  margin-left: auto; font-size: 0.84rem; font-weight: 800;
  color: var(--text-main); font-variant-numeric: tabular-nums;
}
.sun-track {
  position: relative; height: 7px; margin-top: 10px;
  background: rgba(148,163,184,.12); border-radius: 999px; overflow: visible;
}
.sun-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #f5c518, #fb923c);
}
.sun-knob {
  position: absolute; top: 50%; width: 11px; height: 11px;
  transform: translate(-50%, -50%);
  background: #fde047; border: 2px solid #b8890a; border-radius: 50%;
  box-shadow: 0 0 8px rgba(253,224,71,.7);
}
.noaa-sun-loc { margin-top: 8px; }

/* Marine big stat */
.noaa-bigstat {
  display: flex; align-items: baseline; gap: 9px; margin-top: 6px;
}
.noaa-bigstat strong {
  font-size: 1.65rem; font-weight: 800; line-height: 1;
  color: var(--accent-cyan); font-variant-numeric: tabular-nums;
}
.noaa-bigstat span { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; }

/* Aviation METAR tiles */
.noaa-metar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.metar-tile {
  padding: 8px 10px; border-radius: 10px;
  background: rgba(148,163,184,.07);
  border: 1px solid var(--border-glass);
  transition: border-color .2s;
}
.metar-tile:hover { border-color: var(--border-glass-bright); }
.metar-head { display: flex; align-items: center; gap: 6px; }
.metar-head strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem; font-weight: 800; letter-spacing: .04em;
  color: var(--text-main);
}
.metar-vals {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 5px;
}
.metar-temp {
  font-size: 0.9rem; font-weight: 800; color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.metar-wind { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Widget link card */
.noaa-card-link { text-decoration: none; color: inherit; }
.noaa-arrow {
  align-self: center; color: var(--text-muted);
  display: inline-flex; transition: transform .2s ease, color .2s ease;
}
.noaa-card-link:hover .noaa-arrow { transform: translateX(3px); color: var(--accent-cyan); }

/* ===== Long-Range Outlook page ===== */
.lro-hero { margin: 4px 0 22px; }
.lro-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.45rem; font-weight: 800; margin: 0;
  color: var(--text-main);
}
.lro-title svg { color: var(--accent-cyan); }
.lro-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 0.9rem; max-width: 620px; }

.lro-groups { display: grid; gap: 18px; }
.lro-group-title {
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted); margin: 0 0 10px;
}
.lro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lro-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(148,163,184,.09), rgba(148,163,184,.03));
  border: 1px solid var(--border-glass);
  text-decoration: none; color: inherit;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.lro-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-bright);
  background: linear-gradient(160deg, rgba(148,163,184,.14), rgba(148,163,184,.05));
}
.lro-card-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.lro-ic-temp { background: rgba(251,146,60,.14); color: #fb923c; border: 1px solid rgba(251,146,60,.25); }
.lro-ic-prcp { background: rgba(56,189,248,.13); color: #38bdf8; border: 1px solid rgba(56,189,248,.25); }
.lro-card-name { font-weight: 800; font-size: 0.95rem; color: var(--text-main); }
.lro-card-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.lro-card-go { margin-left: auto; color: var(--text-muted); display: inline-flex; transition: transform .2s, color .2s; }
.lro-card:hover .lro-card-go { transform: translateX(3px); color: var(--accent-cyan); }

.lro-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 10px 14px; border-radius: 10px;
  background: rgba(148,163,184,.07); border: 1px solid var(--border-glass);
  font-size: 0.78rem; color: var(--text-muted);
}
.lro-note svg { color: var(--accent-cyan); flex: 0 0 auto; }

/* Detail layout */
.lro-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.lro-side {
  border: 1px solid var(--border-glass); border-radius: 14px;
  background: linear-gradient(160deg, rgba(148,163,184,.09), rgba(148,163,184,.03));
  padding: 14px;
}
.lro-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; color: var(--accent-cyan);
  text-decoration: none; margin-bottom: 12px;
}
.lro-back:hover { text-decoration: underline; }
.lro-side-title {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--text-muted); margin: 0 0 8px;
}
.lro-side-list { display: grid; gap: 6px; }
.lro-side-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; border-radius: 9px;
  text-decoration: none; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.lro-side-item:hover { background: rgba(148,163,184,.1); }
.lro-side-item.is-active {
  background: rgba(14,165,233,.12);
  border-color: rgba(14,165,233,.35);
}
.lro-side-grp { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.lro-side-var { font-size: 0.84rem; font-weight: 700; color: var(--text-main); }
.lro-about { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border-glass); }
.lro-about h3 { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 6px; }
.lro-about p { font-size: 0.76rem; color: var(--text-muted); margin: 0 0 8px; line-height: 1.5; }

.lro-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lro-head .noaa-badge { position: static; }
.lro-desc { font-size: 0.86rem; color: var(--text-muted); margin: 8px 0 14px; }
.lro-map {
  height: 540px; border-radius: 14px;
  border: 1px solid var(--border-glass);
  box-shadow: inset 0 2px 10px rgba(0,0,0,.28), 0 6px 18px -8px rgba(0,0,0,.35);
  overflow: hidden;
}
.lro-mapnote { margin-top: 8px; font-size: 0.74rem; color: var(--text-muted); }

@media (max-width: 860px) {
  .lro-layout { grid-template-columns: 1fr; }
  .lro-side { order: 2; }
  .lro-grid { grid-template-columns: 1fr; }
  .lro-map { height: 380px; }
}
@media (max-width: 640px) {
  .noaa-head { padding: 14px 16px; }
  .noaa-card { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .noaa-badge::before, .noaa-dot { animation: none !important; }
  .noaa-card, .noaa-icon, .noaa-thumb { transition: none; }
}

/* ===== NOAA module pages: shared bits ===== */
.modnav {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 20px;
}
.modnav-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700;
  color: var(--text-muted); text-decoration: none;
  background: rgba(148,163,184,.08);
  border: 1px solid var(--border-glass);
  transition: all .18s ease;
}
.modnav-pill svg { opacity: .75; }
.modnav-pill:hover { color: var(--text-main); border-color: var(--border-glass-bright); transform: translateY(-1px); }
.modnav-pill.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(14,165,233,.35), rgba(99,102,241,.3));
  border-color: rgba(14,165,233,.5);
}
.modnav-pill.is-active svg { opacity: 1; color: var(--accent-cyan); }

/* SPC day tabs + risk legend */
.day-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.day-tab {
  padding: 7px 16px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 800; text-decoration: none;
  color: var(--text-muted); background: rgba(148,163,184,.08);
  border: 1px solid var(--border-glass);
  transition: all .18s ease;
}
.day-tab:hover { color: var(--text-main); border-color: var(--border-glass-bright); }
.day-tab.is-active {
  color: #fff; background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.45);
}
.risk-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.risk-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
}

/* Storm detail cards (hurricanes page) */
.storm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.storm-card {
  padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(249,115,22,.09), rgba(148,163,184,.03));
  border: 1px solid rgba(249,115,22,.3);
}
.storm-card-name { font-weight: 800; font-size: 0.95rem; color: var(--text-main); margin-bottom: 8px; }
.storm-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.storm-card-grid span { display: block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.storm-card-grid strong { font-size: 0.85rem; color: var(--text-main); font-variant-numeric: tabular-nums; }

/* Quiet/empty state panel */
.quiet-panel {
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 16px; padding: 16px 18px; border-radius: 14px;
  background: rgba(52,211,153,.07); border: 1px solid rgba(52,211,153,.25);
}
.quiet-icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(52,211,153,.15); color: #34d399;
}
.quiet-panel strong { color: var(--text-main); }
.quiet-panel p { margin: 4px 0 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* Alert lists (fire/marine pages) */
.alert-list { display: grid; gap: 8px; }
.alert-item {
  padding: 11px 14px; border-radius: 11px;
  background: rgba(148,163,184,.06);
  border: 1px solid var(--border-glass);
  border-left-width: 3px;
}
.alert-warn  { border-left-color: #ef4444; }
.alert-watch { border-left-color: #fb923c; }
.alert-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.alert-item-head strong { font-size: 0.86rem; color: var(--text-main); }
.alert-item-head span { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }
.alert-item-head2 { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }
.alert-item-area { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }
.alert-empty {
  padding: 14px 16px; border-radius: 11px; text-align: center;
  color: var(--text-muted); font-size: 0.82rem;
  background: rgba(148,163,184,.06); border: 1px dashed var(--border-glass);
}

/* METAR table (aviation page) */
.metar-table { display: grid; gap: 4px; }
.mt-row {
  display: grid; grid-template-columns: 90px 1fr 70px 110px 60px;
  align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 9px;
  background: rgba(148,163,184,.05);
  border: 1px solid transparent;
  transition: border-color .15s;
}
.mt-row:hover { border-color: var(--border-glass); }
.mt-id {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800; font-size: 0.8rem; color: var(--text-main);
}
.mt-name { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-temp { font-weight: 800; font-size: 0.9rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.mt-wind { font-size: 0.74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mt-cat { font-size: 0.7rem; font-weight: 800; letter-spacing: .05em; }
@media (max-width: 640px) {
  .mt-row { grid-template-columns: 84px 60px 1fr 54px; }
  .mt-name { display: none; }
}

/* Sunrise/sunset city grid (sun-times page) */
.sun-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sun-city {
  padding: 13px 15px; border-radius: 13px;
  background: linear-gradient(160deg, rgba(148,163,184,.09), rgba(148,163,184,.03));
  border: 1px solid var(--border-glass);
}
.sun-city-name {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 800; font-size: 0.9rem; color: var(--text-main);
}
.sun-city-name span { font-size: 0.66rem; font-weight: 700; color: var(--text-muted); }
.sun-city-times { display: flex; gap: 14px; margin-top: 8px; }
.sun-city-t {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem; font-weight: 700; color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.sun-city-t i { display: inline-flex; color: #f5c518; }
.sun-city .sun-track { margin-top: 11px; }
.sun-city-len { margin-top: 9px; font-size: 0.7rem; color: var(--text-muted); }

/* Full-map link inside widget legend */
.noaa-legend .lg-more {
  margin-left: auto; align-self: center;
  font-size: 0.7rem; font-weight: 800; color: var(--accent-cyan);
  text-decoration: none;
}
.noaa-legend .lg-more:hover { text-decoration: underline; }

/* ===== CPC probability legend (long-range detail) ===== */
.cpc-legend {
  margin-top: 14px; padding: 16px 20px 18px; border-radius: 16px;
  background: rgba(148,163,184,.05);
  border: 1px solid var(--border-glass);
}
.cpc-legend-title {
  text-align: center; font-weight: 800; font-size: 0.9rem;
  color: var(--text-main); margin-bottom: 12px; letter-spacing: .01em;
}
.cpc-legend-grid {
  display: flex; justify-content: center; align-items: flex-start;
  gap: 34px; flex-wrap: wrap;
}
.cpc-col-title {
  text-align: center; font-weight: 800; font-size: 0.72rem;
  color: var(--text-main); margin-bottom: 8px; line-height: 1.2;
}
.cpc-grp { display: flex; align-items: stretch; gap: 9px; margin-bottom: 8px; }
.cpc-grp:last-child { margin-bottom: 0; }
.cpc-grp em {
  display: flex; align-items: center; font-style: normal;
  font-size: 0.62rem; font-weight: 700; line-height: 1.15;
  color: var(--text-muted); text-align: right; min-width: 46px;
}
.cpc-col-right .cpc-grp em { text-align: left; }
.cpc-grp-bands { display: flex; flex-direction: column; gap: 3px; }
.cpc-band { display: flex; align-items: center; gap: 7px; }
.cpc-band i {
  display: block; width: 46px; height: 15px; border-radius: 2px;
  border: 1px solid rgba(0,0,0,.18);
}
.cpc-band span {
  font-size: 0.66rem; font-weight: 700; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; min-width: 44px;
}
.cpc-col-right .cpc-band span { text-align: right; }
.cpc-col-near .cpc-band-near i { margin-top: 2px; }
@media (max-width: 560px) {
  .cpc-legend-grid { gap: 18px; }
  .cpc-grp em { min-width: 38px; }
  .cpc-band i { width: 38px; }
}

/* ===== Marine Weather: 4 sections ===== */
.mw-regions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 14px; margin: 0 0 14px; border-radius: 14px;
  background: rgba(148,163,184,.06); border: 1px solid var(--border-glass);
}
.mw-reg-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin-right: 8px;
}
.mw-region {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-size: 0.74rem; font-weight: 700; font-family: inherit;
  color: var(--text-secondary); background: transparent;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.mw-region:hover { color: var(--text-main); border-color: rgba(34,211,238,.35); }
.mw-region.is-active {
  color: #fff; background: rgba(34,211,238,.16); border-color: var(--accent-cyan);
}
[data-theme="light"] .mw-region.is-active { color: #155e75; }

/* sub-region dropdowns (NOAA Graphical Forecasts style) */
.mw-reg-wrap { position: relative; display: inline-flex; }
.mw-caret { font-weight: 700; opacity: .6; font-style: normal; }
.mw-reg-sub { font-style: normal; font-weight: 600; color: var(--accent-cyan); }
[data-theme="light"] .mw-reg-sub { color: #0e7490; }
.mw-sub {
  position: absolute; top: 100%; left: 0; z-index: 500;
  display: none; flex-direction: column; min-width: 200px;
  margin-top: 6px; padding: 6px;
  background: rgba(15,23,42,.97); border: 1px solid var(--border-glass);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.mw-sub::before {
  content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px;
}
[data-theme="light"] .mw-sub {
  background: rgba(255,255,255,.97); box-shadow: 0 10px 26px rgba(30,41,59,.18);
}
.mw-reg-wrap:hover .mw-sub,
.mw-reg-wrap:focus-within .mw-sub { display: flex; }
.mw-sub-btn {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 0.76rem; font-weight: 600;
  transition: background .12s ease, color .12s ease;
}
.mw-sub-btn:hover { background: rgba(34,211,238,.12); color: var(--text-main); }

.mw-elem-wrap {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: auto; padding-left: 10px;
}
.mw-elem-wrap label {
  font-size: 0.66rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}
.mw-elem {
  font-family: inherit; font-size: 0.74rem; font-weight: 700;
  color: var(--text-main); background: rgba(148,163,184,.08);
  border: 1px solid var(--border-glass); border-radius: 10px;
  padding: 6px 10px; cursor: pointer;
}

/* NOAA-style parameter values on the map */
.mw-param {
  background: rgba(15,23,42,.78); color: #67e8f9;
  border: 1px solid rgba(103,232,249,.5); border-radius: 7px;
  padding: 2px 7px; font-size: 0.7rem; font-weight: 800;
  white-space: nowrap; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  letter-spacing: .01em; cursor: pointer;
}
.mw-param:hover { border-color: #67e8f9; transform: scale(1.06); }

/* zone info popup (Leaflet popup = light bg) */
.mw-zp-t { font-size: 0.82rem; font-weight: 800; color: #155e75; }
.mw-zp-n { font-size: 0.74rem; color: #475569; margin: 2px 0 2px; }
.mw-zp-per {
  font-size: 0.64rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8; margin-bottom: 5px;
}
.mw-zp-row { display: flex; gap: 12px; font-size: 0.74rem; color: #64748b; margin-bottom: 5px; }
.mw-zp-row strong { color: #0e7490; }
.mw-zp-fc { font-size: 0.72rem; line-height: 1.45; color: #334155; border-top: 1px solid #e2e8f0; padding-top: 5px; }
.mw-param-sea { color: #93c5fd; border-color: rgba(147,197,253,.5); }
.mw-param-wx { color: #fcd34d; border-color: rgba(252,211,77,.5); }
.mw-param-temp { color: #fb923c; border-color: rgba(251,146,60,.55); }
[data-theme="light"] .mw-param {
  background: rgba(255,255,255,.9); color: #155e75;
  border-color: rgba(14,116,144,.5); box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
[data-theme="light"] .mw-param-sea { color: #1d4ed8; border-color: rgba(37,99,235,.4); }
[data-theme="light"] .mw-param-wx { color: #b45309; border-color: rgba(217,119,6,.4); }
[data-theme="light"] .mw-param-temp { color: #c2410c; border-color: rgba(234,88,12,.4); }
.mw-tv {
  display: inline-block; padding: 1px 6px; border-radius: 6px;
  color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

#mx-elems { flex-wrap: wrap; overflow-x: visible; }
.mx-sep { align-self: stretch; width: 1px; margin: 4px 6px; background: var(--border-glass, rgba(148,163,184,.35)); }

/* NOAA-style element legend inside the map */
.mw-legend {
  position: absolute; right: 12px; bottom: 28px; z-index: 600;
  min-width: 190px; padding: 9px 12px 7px;
  background: rgba(15,23,42,.85); border: 1px solid var(--border-glass);
  border-radius: 10px; color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); pointer-events: none;
}
[data-theme="light"] .mw-legend {
  background: rgba(255,255,255,.93); color: #334155;
  box-shadow: 0 4px 12px rgba(30,41,59,.18);
}
.mw-leg-u {
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 6px;
}
.mw-leg-bar { height: 8px; border-radius: 4px; }
.mw-leg-t {
  display: flex; justify-content: space-between;
  font-size: 0.58rem; font-weight: 700; color: #94a3b8; margin-top: 3px;
}
[data-theme="light"] .mw-leg-t { color: #64748b; }

/* wind/seas chips inside zone cards */
.zone-params { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.zp-chip {
  font-size: 0.68rem; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  color: var(--accent-cyan); background: rgba(34,211,238,.09);
  border: 1px solid rgba(34,211,238,.3);
}
[data-theme="light"] .zp-chip { color: #0e7490; }

.mw-tabs {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 6px;
}
.mw-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font-size: 0.8rem; font-weight: 700; font-family: inherit;
  color: var(--text-secondary);
  background: rgba(148,163,184,.08);
  border: 1px solid var(--border-glass);
  transition: all .18s ease;
}
.mw-tab:hover { color: var(--text-main); border-color: rgba(34,211,238,.4); }
.mw-tab.is-active {
  color: #fff; background: rgba(34,211,238,.18);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(34,211,238,.18);
}
[data-theme="light"] .mw-tab.is-active { color: #155e75; }
.mw-tab svg { opacity: .85; }
.mw-tab-n {
  min-width: 20px; text-align: center;
  padding: 1px 7px; border-radius: 999px; font-size: 0.64rem; font-weight: 800;
  background: rgba(239,68,68,.14); color: #ef4444;
  border: 1px solid rgba(239,68,68,.3);
}
.mw-tab-n:empty { display: none; }
.mw-panel { margin-top: 4px; }
.mw-sec-title {
  margin: 30px 0 14px; font-size: 1.15rem; font-weight: 800;
  color: var(--text-main); letter-spacing: .01em;
  display: flex; align-items: baseline; gap: 10px;
}
.mw-sec-note {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
}

/* General synopsis */
.syn-box {
  padding: 16px 20px; border-radius: 16px;
  background: rgba(34,211,238,.05); border: 1px solid var(--border-glass);
  font-size: 0.88rem; line-height: 1.65; color: var(--text-secondary);
}
.syn-box strong { color: var(--text-main); }
.syn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.syn-chip {
  padding: 4px 11px; border-radius: 999px; font-size: 0.68rem; font-weight: 800;
  background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.25);
  color: var(--accent-cyan);
}
[data-theme="light"] .syn-chip { color: #0e7490; }

/* Warning group sub-headers */
.mw-grp-t {
  margin: 18px 0 8px; font-size: 0.74rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-main);
  display: flex; align-items: center; gap: 9px;
}
.mw-grp-t:first-child { margin-top: 0; }
.mw-grp-t span {
  padding: 1px 8px; border-radius: 999px; font-size: 0.62rem;
  background: rgba(239,68,68,.12); color: #ef4444;
  border: 1px solid rgba(239,68,68,.3);
}
.mw-grp-t::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-glass), transparent);
}

/* Sea area forecast cards */
.zone-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.zone-card {
  padding: 15px 17px; border-radius: 16px;
  background: rgba(148,163,184,.05); border: 1px solid var(--border-glass);
}
.zone-head { display: flex; align-items: center; gap: 9px; }
.zone-id {
  font-size: 0.66rem; font-weight: 800; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.25);
  color: var(--accent-cyan);
}
[data-theme="light"] .zone-id { color: #0e7490; }
.zone-per {
  margin-left: auto; font-size: 0.66rem; font-weight: 800;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}
.zone-name {
  margin-top: 8px; font-size: 0.85rem; font-weight: 800; color: var(--text-main);
}
.zone-fc {
  margin-top: 6px; font-size: 0.76rem; line-height: 1.6; color: var(--text-secondary);
}

/* Coastal station reports table */
.mw-note {
  font-size: 0.72rem; color: var(--text-muted); margin: -6px 0 10px;
}
.mw-table {
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-glass);
}
.mw-row {
  display: grid;
  grid-template-columns: 1.5fr 1.4fr 1.3fr 0.7fr 0.7fr 0.7fr;
  gap: 10px; padding: 11px 16px; align-items: center;
  font-size: 0.78rem; color: var(--text-secondary);
  border-top: 1px solid var(--border-glass);
}
.mw-row:first-child { border-top: none; }
.mw-row-h {
  background: rgba(148,163,184,.07); font-weight: 800; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted);
}
.mw-row strong { color: var(--text-main); font-size: 0.8rem; display: block; }
.mw-sid {
  font-style: normal; font-size: 0.64rem; font-weight: 700; color: var(--text-muted);
}
@media (max-width: 720px) {
  .mw-row { grid-template-columns: 1.4fr 1.2fr 1.2fr 0.7fr; font-size: 0.72rem; }
  .mw-row > span:nth-child(5), .mw-row > span:nth-child(6) { display: none; }
}

/* ==========================================================================
   Marine Weather - interactive forecast map (mx-*)
   ========================================================================== */
.mx-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.mx-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.mx-stat {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  font-size: .78rem; color: var(--text-secondary); font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: 999px;
}
.mx-stat b { color: var(--text-main); font-weight: 800; font-variant-numeric: tabular-nums; }
.mx-stat-live { color: #34d399; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 800; }
.mx-stat-live i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: noaaLive 2s infinite; }

.mx-console {
  background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-md);
}
.mx-toolbar { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border-glass); }
.mx-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mx-lbl {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; width: 74px;
  font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted);
}
.mx-seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; flex: 1; }
.mx-seg::-webkit-scrollbar { display: none; }
.mx-chip {
  flex: 0 0 auto; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  color: var(--text-secondary); background: var(--bg-pill); border: 1px solid transparent;
  transition: all .18s ease;
}
.mx-chip:hover { color: var(--text-main); background: var(--bg-pill-hover); }
.mx-chip.is-active {
  color: #fff; background: var(--gradient-brand); border-color: transparent;
  box-shadow: 0 6px 16px -6px rgba(56,189,248,.7);
}

/* stage */
.mx-stage { position: relative; height: 660px; background: #0b1220; }
#mx-map { position: absolute; inset: 0; z-index: 1; background: #a9cfe8; }
.mx-field { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity .2s ease; }
#mx-map.leaflet-container { font-family: inherit; cursor: crosshair; }
#mx-map .leaflet-control-zoom { border: 0; box-shadow: var(--shadow-md); }
#mx-map .leaflet-control-zoom a { background: var(--bg-card-solid); color: var(--text-main); border-color: var(--border-glass); }
#mx-map .leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7); }

.mx-topright { position: absolute; z-index: 500; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mx-btn {
  cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; color: var(--text-main); background: var(--bg-card-solid);
  border: 1px solid var(--border-glass-bright); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.mx-btn:hover { border-color: var(--border-glass-active); }
.mx-busy {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; color: var(--text-main); background: var(--bg-card-solid);
  border: 1px solid var(--border-glass); box-shadow: var(--shadow-sm);
}
.mx-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-glass-bright); border-top-color: var(--accent-cyan); animation: mxSpin .7s linear infinite; }
@keyframes mxSpin { to { transform: rotate(360deg); } }
.mx-layers {
  width: 240px; padding: 14px; background: var(--bg-card-solid); border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 8px;
}
.mx-layers[hidden] { display: none; }
.mx-layers-t { font-size: .64rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); }
.mx-layers label { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-main); cursor: pointer; }
.mx-layers input[type=checkbox] { accent-color: #0ea5e9; width: 15px; height: 15px; }
.mx-layers input[type=range] { width: 100%; accent-color: #0ea5e9; }

.mx-legend {
  position: absolute; z-index: 500; left: 12px; bottom: 98px; width: 260px; padding: 9px 12px 22px;
  background: var(--bg-card-solid); border: 1px solid var(--border-glass); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.mx-legend[hidden], .mx-hover[hidden], .mx-hint[hidden], .mx-busy[hidden] { display: none; }
.mx-lg-t { font-size: .7rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px; }
.mx-lg-t span { font-weight: 600; color: var(--text-muted); }
.mx-lg-bar { height: 10px; border-radius: 6px; }
.mx-lg-ticks { position: relative; height: 12px; margin-top: 3px; }
.mx-lg-ticks i { position: absolute; transform: translateX(-50%); font-style: normal; font-size: .62rem; font-weight: 700; color: var(--text-muted); }
.mx-lg-ticks i:first-child { transform: none; }

.mx-hover {
  position: absolute; z-index: 500; left: 12px; top: 12px; padding: 6px 12px; border-radius: 999px;
  font-size: .76rem; color: var(--text-secondary); background: var(--bg-card-solid);
  border: 1px solid var(--border-glass); box-shadow: var(--shadow-sm); pointer-events: none;
}
.mx-hover b { color: var(--text-main); }
.mx-hover span { color: var(--text-muted); margin-left: 6px; }

.mx-hint {
  position: absolute; z-index: 500; left: 50%; top: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 12px; max-width: 92%;
  font-size: .8rem; line-height: 1.35; color: var(--text-main);
  background: var(--bg-card-solid); border: 1px solid var(--border-glass-active); border-radius: 14px;
  box-shadow: 0 10px 30px -8px rgba(14,165,233,.45); animation: mxHint 2.4s ease-in-out infinite;
}
.mx-hint-ic { color: var(--accent-cyan); display: flex; }
.mx-hint button { background: none; border: 0; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; line-height: 1; }
@keyframes mxHint { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3px); } }

/* time bar */
.mx-timebar {
  position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 14px;
  padding: 10px 16px 10px 12px; background: var(--bg-card-solid); border: 1px solid var(--border-glass-bright);
  border-radius: 16px; box-shadow: var(--shadow-md);
}
.mx-play {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: .95rem;
  background: var(--gradient-brand); box-shadow: var(--shadow-cyan); display: flex; align-items: center; justify-content: center;
  padding-left: 3px; transition: transform .15s ease;
}
.mx-play:hover { transform: scale(1.07); }
.mx-play.is-on { padding-left: 0; font-size: .75rem; letter-spacing: -1px; }
.mx-time-main { flex: 1; min-width: 0; }
.mx-time-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.mx-time-lbl { font-size: .86rem; font-weight: 800; color: var(--text-main); }
.mx-time-rel { font-size: .72rem; font-weight: 800; color: var(--accent-cyan); text-transform: uppercase; letter-spacing: .06em; }
#mx-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 4px; outline: none; cursor: pointer;
  --p: 0%; background: linear-gradient(90deg, #38bdf8 var(--p), var(--border-glass-bright) var(--p));
}
#mx-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #0ea5e9; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
#mx-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #0ea5e9; }
.mx-time-ticks { position: relative; height: 14px; margin-top: 5px; }
.mx-time-ticks i { position: absolute; transform: translateX(-50%); font-style: normal; font-size: .62rem; font-weight: 700; color: var(--text-muted); }

/* pin */
.mx-pin span {
  display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; background: #0ea5e9;
  box-shadow: 0 0 0 0 rgba(14,165,233,.7), 0 3px 10px rgba(0,0,0,.5); animation: mxPin 1.8s infinite;
}
@keyframes mxPin { 70%,100% { box-shadow: 0 0 0 16px rgba(14,165,233,0), 0 3px 10px rgba(0,0,0,.5); } }

/* point panel */
.mx-panel {
  position: absolute; z-index: 600; top: 0; right: 0; bottom: 0; width: 410px; display: flex; flex-direction: column;
  background: var(--bg-card-solid); border-left: 1px solid var(--border-glass-bright); box-shadow: -14px 0 40px -14px rgba(0,0,0,.55);
  animation: mxSlide .28s ease;
}
.mx-panel[hidden] { display: none; }
@keyframes mxSlide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.mx-panel-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 14px;
  background: linear-gradient(135deg, rgba(14,165,233,.16), rgba(99,102,241,.08)); border-bottom: 1px solid var(--border-glass);
}
.mx-panel-ttl { flex: 1; min-width: 0; }
.mx-panel-place { font-size: 1.02rem; font-weight: 800; color: var(--text-main); line-height: 1.25; }
.mx-panel-sub { font-size: .72rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.mx-x { cursor: pointer; border: 0; width: 30px; height: 30px; border-radius: 50%; font-size: 1.3rem; line-height: 1; color: var(--text-secondary); background: var(--bg-pill); }
.mx-x:hover { color: var(--text-main); background: var(--bg-pill-hover); }
.mx-panel-body { flex: 1; overflow-y: auto; padding: 14px 16px 20px; overscroll-behavior: contain; }

.mx-p-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.mx-p-alert { border-radius: 12px; border: 1px solid rgba(250,204,21,.4); background: rgba(250,204,21,.09); }
.mx-p-alert.sev-severe, .mx-p-alert.sev-extreme { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.1); }
.mx-p-alert summary { cursor: pointer; padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; list-style: none; }
.mx-p-alert summary::-webkit-details-marker { display: none; }
.mx-p-alert-ev { font-weight: 800; font-size: .84rem; color: var(--text-main); }
.mx-p-alert-ends { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.mx-p-alert-body { padding: 0 12px 12px; font-size: .76rem; color: var(--text-secondary); }
.mx-p-alert-body pre, .mx-al pre { white-space: pre-wrap; font: inherit; font-size: .76rem; line-height: 1.5; margin: 8px 0 0; color: var(--text-secondary); }
.mx-p-ok { font-size: .76rem; font-weight: 700; color: #34d399; padding: 8px 12px; border-radius: 10px; background: rgba(52,211,153,.1); margin-bottom: 14px; }
.mx-p-err { font-size: .8rem; color: var(--text-muted); padding: 14px; border-radius: 12px; background: var(--bg-pill); line-height: 1.5; }

.mx-cards-h { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px; }
.mx-cards-h b { color: var(--accent-cyan); text-transform: none; letter-spacing: 0; }
.mx-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.mx-card { padding: 11px 12px; border-radius: 14px; background: var(--bg-pill); border: 1px solid var(--border-glass); min-width: 0; }
.mx-card-w { grid-column: span 2; background: linear-gradient(135deg, rgba(14,165,233,.14), rgba(99,102,241,.07)); }
.mx-card-na { grid-column: span 2; }
.mx-card-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: linear-gradient(135deg, rgba(250,204,21,.12), rgba(14,165,233,.10)); }
.mx-card-vb { font-size: 2.6rem; }
.mx-wx { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 auto; font-size: .7rem; font-weight: 700; color: var(--text-secondary); text-align: center; }
.mx-wx svg { width: 68px; height: 68px; }
.mx-card-l { font-size: .64rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); }
.mx-card-v { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--text-main); line-height: 1.15; margin-top: 3px; }
.mx-card-v small { font-size: .78rem; font-weight: 700; color: var(--text-muted); margin-left: -2px; }
.mx-card-s { font-size: .72rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.mx-ar { flex: 0 0 auto; transition: transform .3s ease; vertical-align: middle; }
.mx-badge {
  display: inline-block; margin-top: 7px; padding: 3px 9px; border-radius: 999px; font-size: .66rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}

.mx-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg-pill); margin-bottom: 12px; }
.mx-tab { flex: 1; cursor: pointer; font: inherit; font-size: .74rem; font-weight: 700; padding: 8px 4px; border: 0; border-radius: 9px; color: var(--text-secondary); background: transparent; }
.mx-tab.is-active { color: var(--text-main); background: var(--bg-card-solid); box-shadow: var(--shadow-sm); }

.mx-readout { font-size: .72rem; line-height: 1.7; color: var(--text-secondary); padding: 8px 10px; border-radius: 10px; background: var(--bg-pill); margin-bottom: 8px; min-height: 2.4em; }
.mx-readout b { color: var(--text-main); }
.mx-readout .sep { margin: 0 7px; opacity: .35; }
.mx-chart-t { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-secondary); margin: 12px 0 2px; }
.mx-chart-t span { color: var(--text-muted); text-transform: none; font-weight: 600; }
.mx-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.mx-svg .gl { stroke: var(--border-glass); stroke-width: 1; }
.mx-svg .dl { stroke: var(--border-glass-bright); stroke-width: 1; stroke-dasharray: 2 3; }
.mx-svg .yl, .mx-svg .xl { fill: var(--text-muted); font-size: 10px; font-weight: 700; font-family: inherit; }
.mx-svg .cur { stroke: var(--accent-cyan); stroke-width: 1.2; stroke-dasharray: 3 3; }

.mx-tbl-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border-glass); }
.mx-tbl { width: 100%; border-collapse: collapse; font-size: .74rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mx-tbl th { position: sticky; top: 0; text-align: left; padding: 8px 8px; font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); background: var(--bg-pill); }
.mx-tbl td { padding: 7px 8px; border-top: 1px solid var(--border-glass); white-space: nowrap; }
.mx-tbl td b { color: var(--text-main); }
.mx-tbl td small { color: var(--text-muted); }
.mx-tbl tr.day td { background: rgba(14,165,233,.1); color: var(--accent-cyan); font-weight: 800; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.mx-tbl tr.sel td { background: rgba(14,165,233,.12); }

.mx-fc-h { font-size: .84rem; font-weight: 800; color: var(--text-main); margin-bottom: 10px; display: flex; flex-direction: column; gap: 2px; }
.mx-fc-h span { font-size: .68rem; color: var(--text-muted); font-weight: 600; }
.mx-fc { padding: 10px 12px; border-radius: 12px; background: var(--bg-pill); margin-bottom: 8px; border-left: 3px solid var(--accent-cyan); }
.mx-fc-n { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-cyan); }
.mx-fc-t { font-size: .8rem; line-height: 1.55; color: var(--text-secondary); margin-top: 3px; }

.mx-near { display: flex; flex-direction: column; gap: 8px; }
.mx-nb { padding: 10px 12px; border-radius: 12px; background: var(--bg-pill); border: 1px solid var(--border-glass); }
.mx-nb-h { display: flex; align-items: baseline; gap: 8px; }
.mx-nb-h b { color: var(--text-main); font-size: .9rem; }
.mx-nb-h span { font-size: .7rem; color: var(--text-muted); flex: 1; }
.mx-nb-h a { font-size: .72rem; font-weight: 700; color: var(--accent-cyan); }
.mx-nb-g { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .74rem; color: var(--text-secondary); }
.mx-nb-g b { color: var(--text-main); }

.mx-p-links { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-glass); }
.mx-p-links a { font-size: .78rem; font-weight: 700; color: var(--accent-cyan); }
.mx-p-links button { cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; color: var(--text-secondary); background: var(--bg-pill); border: 1px solid var(--border-glass); }

.mx-sk { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mx-sk i, .mx-sk-b { display: block; height: 76px; border-radius: 14px; background: linear-gradient(90deg, var(--bg-pill) 25%, var(--bg-pill-hover) 50%, var(--bg-pill) 75%); background-size: 200% 100%; animation: mxSk 1.3s infinite; }
.mx-sk i:first-child { grid-column: span 2; }
.mx-sk-b { height: 180px; margin-top: 14px; }
@keyframes mxSk { to { background-position: -200% 0; } }

/* coordinate + distance tools */
.mx-tool { position: absolute; left: 10px; top: 96px; z-index: 700; width: 252px; padding: 12px 14px; border-radius: 12px;
  background: rgba(15,23,42,.92); color: #e2e8f0; border: 1px solid var(--border-glass-bright); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.mx-tool[hidden], .mx-tool-help[hidden], .mx-tool-err[hidden] { display: none; }
#mx-ruler-box { top: 96px; }
#mx-coord-box:not([hidden]) ~ #mx-ruler-box { top: 250px; }
.mx-tool-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .88rem; margin-bottom: 4px; }
.mx-tool-x { background: none; border: 0; color: #94a3b8; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.mx-tool-s { font-size: .72rem; color: #94a3b8; margin-bottom: 8px; }
.mx-tool-s a { color: #38bdf8; margin-left: 4px; }
.mx-tool-help { font-size: .72rem; color: #cbd5e1; display: grid; gap: 7px; margin-bottom: 8px; }
.mx-tool-help code { color: #fff; font-size: .74rem; }
.mx-tool input[type=text] { width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 8px; border: 1px solid #38bdf8; background: rgba(2,6,23,.6); color: #fff; font: inherit; font-size: .82rem; }
.mx-tool-err { margin-top: 6px; font-size: .72rem; color: #fca5a5; }
.mx-tool-go { width: 100%; margin-top: 8px; padding: 9px; border: 0; border-radius: 8px; background: #f59e0b; color: #1f1300; font-weight: 800; cursor: pointer; }
.mx-tool-go:hover { background: #fbbf24; }
.mx-rl-total { font-size: 1.7rem; font-weight: 800; color: #facc15; line-height: 1.1; }
.mx-rl-act { display: flex; gap: 8px; }
.mx-rl-act button { flex: 1; padding: 7px; border-radius: 8px; border: 1px solid var(--border-glass-bright); background: rgba(148,163,184,.15); color: #e2e8f0; font-weight: 700; font-size: .78rem; cursor: pointer; }
.mx-btn.is-on { background: #f59e0b; color: #1f1300; }
#mx-map.is-ruler, #mx-map.is-ruler.leaflet-grab, #mx-map.is-ruler .leaflet-interactive { cursor: crosshair !important; }
.leaflet-tooltip.mx-rl-tip { background: rgba(15,23,42,.92); color: #e2e8f0; border: 1px solid #facc15; font-weight: 600; font-size: .72rem; padding: 3px 7px; text-align: center; line-height: 1.25; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.leaflet-tooltip.mx-rl-tip b { color: #facc15; font-weight: 800; }
.leaflet-tooltip.mx-rl-tip::before { display: none; }
.mx-rl-pts { max-height: 120px; overflow-y: auto; margin-bottom: 8px; font-size: .72rem; color: #cbd5e1; display: grid; gap: 3px; }
.mx-rl-pts b { color: #facc15; margin-right: 3px; }
.mx-rl-pts em { color: #94a3b8; font-style: normal; margin-left: 4px; }

/* popups & markers (buoys + weather stations) */
.mx-div-icon { background: none !important; border: 0 !important; }
.mx-mk-buoy {
  width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(2,6,23,.55);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .14s ease, box-shadow .14s ease;
  box-sizing: border-box;
}
.mx-mk-buoy:hover { transform: scale(1.35); box-shadow: 0 2px 8px rgba(220,38,38,.8); }
.mx-mk-stn {
  height: 18px; min-width: 18px; padding: 0 5px 0 4px; border-radius: 999px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 4px rgba(2,6,23,.6);
  color: #ffffff; font: 800 10px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 2.5px;
  white-space: nowrap; cursor: pointer; box-sizing: border-box;
  transition: transform .14s ease, background .14s ease;
}
.mx-mk-stn.is-single { padding: 0 4px; }
.mx-mk-stn:hover { transform: scale(1.15); background: #020617; }
.mx-pop-nm { font-size: .75rem; font-weight: 600; color: var(--accent-cyan); margin-bottom: 2px; }
.mx-pop-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.mx-pop-zm { cursor: pointer; font: inherit; font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border-glass-bright); background: var(--bg-pill); color: var(--accent-cyan); }
.mx-pop-zm:hover { background: var(--bg-pill-hover); }
.mx-pop-list { max-height: 215px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin: 6px 0 8px; padding-right: 2px; }
.mx-pop-item { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 8px; background: rgba(100,116,139,.14); border: 1px solid transparent; cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%; box-sizing: border-box; }
.mx-pop-item:hover { border-color: var(--accent-cyan); background: rgba(14,165,233,.12); }
.mx-pop-ih { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: .78rem; }
.mx-pop-ih b { color: var(--text-main); font-weight: 800; }
.mx-pop-ih span { font-size: .68rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 145px; }
.mx-pop-im { font-size: .71rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 6px; }
.mx-pop-im b { color: var(--text-main); }
.mx-popup .leaflet-popup-content-wrapper { background: var(--bg-card-solid); color: var(--text-main); border-radius: 14px; border: 1px solid var(--border-glass-bright); }
.mx-popup .leaflet-popup-tip { background: var(--bg-card-solid); }
.mx-popup .leaflet-popup-content { margin: 12px 14px; font-family: inherit; }
.mx-pop-t { font-weight: 800; font-size: .9rem; }
.mx-pop-s { font-size: .7rem; color: var(--text-muted); margin-bottom: 8px; }
.mx-pop-r { display: flex; justify-content: space-between; gap: 14px; font-size: .78rem; padding: 3px 0; border-top: 1px solid var(--border-glass); }
.mx-pop-r span { color: var(--text-secondary); }
.mx-pop-a { display: flex; justify-content: space-between; margin-top: 8px; font-size: .74rem; font-weight: 700; }
.mx-pop-a a { color: var(--accent-cyan); }
.mx-pop { min-width: 210px; }
.mx-pop-box { margin: 4px 0 10px; padding: 4px 10px; border-radius: 8px; background: rgba(100,116,139,.14); }
.mx-pop-box .mx-pop-r { border-top: 0; padding: 4px 0; }
.mx-pop-box hr { border: 0; border-top: 1px solid var(--border-glass-bright); margin: 3px 0; }
.mx-pop-btn { display: block; text-align: center; padding: 9px 12px; border-radius: 10px; background: #f59e0b; color: #1f1300 !important; font-weight: 800; font-size: .84rem; text-decoration: none; }
.mx-pop-btn:hover { background: #fbbf24; }
.mx-pop-ndbc { display: block; text-align: center; margin-top: 7px; font-size: .7rem; color: var(--text-muted); }

/* alerts section */
.mx-alerts, .mx-ref { margin-top: 22px; }
.mx-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mx-sec-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin: 0; }
.mx-sec-title svg { color: var(--accent-cyan); }
.mx-sec-note { font-size: .7rem; font-weight: 700; color: var(--accent-cyan); background: rgba(14,165,233,.1); border: 1px solid var(--border-glass-bright); padding: 3px 10px; border-radius: 999px; }
.mx-alert-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mx-ach { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: var(--text-secondary); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.mx-ach b { color: var(--c); }
.mx-alert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.mx-al { position: relative; padding: 13px 14px 12px 16px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border-glass); overflow: hidden; display: flex; flex-direction: column; gap: 5px; }
.mx-al::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.mx-al-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mx-al-ev { font-weight: 800; font-size: .88rem; color: var(--text-main); }
.mx-al-t { font-size: .7rem; color: var(--text-muted); }
.mx-al-a { font-size: .76rem; color: var(--text-secondary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mx-al details summary { cursor: pointer; font-size: .72rem; font-weight: 700; color: var(--accent-cyan); }
.mx-al-go { align-self: flex-start; margin-top: 2px; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 800; color: var(--accent-cyan); background: none; border: 0; padding: 2px 0; }
.mx-calm { grid-column: 1 / -1; text-align: center; padding: 24px; font-size: .88rem; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: 14px; }
.mx-more { margin: 12px auto 0; display: flex; }

.mx-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 12px 0; }
.mx-scale-i { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border-glass); border-top: 3px solid var(--c); }
.mx-scale-i b { font-family: var(--font-display); font-size: 1.15rem; color: var(--c); }
.mx-scale-i span { font-size: .82rem; font-weight: 800; color: var(--text-main); }
.mx-scale-i em { font-size: .72rem; color: var(--text-muted); font-style: normal; }
.mx-foot { font-size: .74rem; line-height: 1.6; color: var(--text-muted); max-width: 900px; }

/* responsive */
@media (max-width: 900px) {
  .mx-stage { height: 620px; }
  .mx-panel { top: auto; left: 0; width: 100%; height: 56%; border-left: 0; border-top: 1px solid var(--border-glass-bright); border-radius: 20px 20px 0 0; box-shadow: 0 -14px 40px -14px rgba(0,0,0,.6); animation: none; }
  .mx-stage.has-panel .mx-timebar { bottom: calc(56% + 10px); }
  .mx-stage.has-panel .mx-legend { display: none; }
  .mx-legend { bottom: 100px; width: 210px; }
  .mx-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .mx-lbl { width: auto; }
}
@media (min-width: 901px) {
  .mx-stage.has-panel .mx-timebar { right: 422px; }
  .mx-stage.has-panel .mx-topright { right: 422px; }
}
@media (max-width: 560px) {
  .mx-hero { margin-bottom: 10px; }
  .mx-timebar { padding: 8px 12px 8px 8px; gap: 10px; }
  .mx-play { flex-basis: 38px; width: 38px; height: 38px; }
  .mx-time-lbl { font-size: .78rem; }
  .mx-cards { gap: 6px; }
  .mx-card-v { font-size: 1.45rem; }
  .mx-alert-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .mx-hint, .mx-pin span, .mx-spin, .mx-stat-live i { animation: none; }
}
.leaflet-container .leaflet-control-attribution,
.leaflet-control-attribution {
  display: none !important;
}
