/* ═══════════════════════════════════════════════════════════════
   Anvilcast — Design System & Styles
   No framework, no build step. Pure CSS with custom properties.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens: Dark Theme ──────────────────────────────────────── */

:root,
:root[data-theme="dark"] {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --elevated:    #242836;
  --border:      #2e3346;
  --border-strong: #3d4460;

  --text:        #e8eaed;
  --text-muted:  #9ca3af;
  --text-faint:  #6b7280;

  --accent:      #3b82f6;
  --accent-hover:#60a5fa;
  --accent-bg:   rgba(59, 130, 246, 0.12);

  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;

  --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.5);

  --nav-bg:      rgba(15, 17, 23, 0.92);
  --hero-grad:   linear-gradient(135deg, #111827 0%, #0f172a 50%, #1e1b4b 100%);

  --logo-filter: invert(1);
  --prob-0:      transparent;
  --prob-1:      #6cc070;
  --prob-2:      #c5c944;
  --prob-3:      #f0a030;
  --prob-4:      #e0502a;
  --prob-5:      #d42080;
}

/* ── Tokens: Light Theme ─────────────────────────────────────── */

:root[data-theme="light"] {
  --bg:          #f4f6f9;
  --surface:     #ffffff;
  --elevated:    #f0f2f5;
  --border:      #d4d8e0;
  --border-strong: #b0b8c8;

  --text:        #1e293b;
  --text-muted:  #64748b;
  --text-faint:  #94a3b8;

  --accent:      #2563eb;
  --accent-hover:#3b82f6;
  --accent-bg:   rgba(37, 99, 235, 0.08);

  --success:     #16a34a;
  --warning:     #d97706;
  --danger:      #dc2626;

  --shadow-sm:   0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.12);

  --nav-bg:      rgba(255, 255, 255, 0.92);
  --hero-grad:   linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #dbeafe 100%);

  --logo-filter: none;
}

/* ── Reset ───────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

button, select, input {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }

ul { list-style: none; }

.text-muted { color: var(--text-muted); }

/* ── Container ───────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: 6px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  background: var(--elevated);
  border: 1px solid var(--border);
}
.btn-icon:hover { border-color: var(--border-strong); }

/* ── Badge ───────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.8125rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── Categorical risk colors ────────────────────────────────── */

:root {
  --cat-tstm:  #c1e9c1;
  --cat-mrgl:  #66a366;
  --cat-slgt:  #ffe066;
  --cat-enh:   #ffa500;
  --cat-mdt:   #ff0000;
  --cat-high:  #ff69b4;
  --cat-vhi:   #912cee;
}

/* ═══════════════════════════════════════════════════════════════
   New-run notification banner
   ═══════════════════════════════════════════════════════════════ */

.new-run-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--accent-bg);
  border-bottom: 1px solid var(--accent);
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
}

.new-run-banner[hidden] { display: none; }

.new-run-dismiss {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.7;
}
.new-run-dismiss:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   Navigation
   ═══════════════════════════════════════════════════════════════ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
}

.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 8px;
}

.nav-logo {
  display: flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
}

.nav-logo-img {
  height: 30px;
  width: auto;
  filter: var(--logo-filter);
  transition: filter 0.2s;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 150ms, background 150ms;
}
.nav-link:hover { color: var(--text); background: var(--accent-bg); }
.nav-link.active { color: var(--accent); background: var(--accent-bg); }

.nav-theme {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.125rem;
  transition: background 150ms;
  margin-left: 8px;
}
.nav-theme:hover { background: var(--accent-bg); }

.nav-socials {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav-social:hover {
  color: var(--text);
  background: var(--accent-bg);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 200ms, opacity 200ms;
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow-lg);
  }

  #nav-toggle:checked ~ .nav-links { display: flex; }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   Page System
   ═══════════════════════════════════════════════════════════════ */

.page { display: none; }
.page.active { display: block; }

#app { flex: 1; }

.section { padding: 48px 0; }
.section-alt { background: var(--surface); }
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}


/* ═══════════════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Home header */
.home-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}

.home-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.home-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.9rem, 3.8vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.home-sub {
  color: var(--text-muted);
  font-size: clamp(0.6875rem, 2.2vw, 0.8125rem);
  margin-top: 4px;
  white-space: nowrap;
}

.home-spot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.home-spot-input {
  padding: 8px 14px;
  width: 280px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
}
.home-spot-input::placeholder { color: var(--text-faint); }
.home-spot-input:focus { border-color: var(--accent); }

/* Autocomplete dropdown */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  max-height: 260px;
  overflow-y: auto;
  z-index: 150;
  list-style: none;
}
.search-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.search-suggestion:last-child { border-bottom: none; }
.search-suggestion:hover,
.search-suggestion.active {
  background: var(--accent-bg);
}
.search-suggestion-name { color: var(--text); }
.search-suggestion-detail {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 1px;
}

/* USA spotlight grid */
.home-spotlight { padding-top: 24px; }

.spotlight-week { margin-bottom: 24px; }
.spotlight-week:last-child { margin-bottom: 0; }

.sg-week-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.sg-row {
  display: grid;
  grid-template-columns: 36px repeat(7, 1fr);
  gap: 4px;
  align-items: center;
}
.sg-hdr-row { margin-bottom: 2px; }
.sg-img-row { margin-bottom: 2px; }

.sg-lbl {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-align: right;
  padding-right: 4px;
  white-space: nowrap;
}

.sg-colhdr {
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.2;
}
.sg-dn { font-size: 0.6875rem; font-weight: 700; color: var(--text); }
.sg-dd { font-size: 0.5625rem; color: var(--text-faint); }

.sg-cell {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 200ms ease, transform 200ms ease;
}
.sg-cell:hover {
  border-color: var(--accent);
  transform: scale(1.08);
  z-index: 1;
}
.sg-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  background: var(--elevated);
}

.section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.home-grid-section { padding-top: 32px; }

/* Forecast page heading (visually hidden, for SEO) */
.forecast-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Region grid */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.region-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  text-decoration: none;
  color: var(--text);
}
.region-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  color: var(--text);
}
.region-card.hero-card {
  grid-column: 1 / -1;
}

.region-card-img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  background: var(--elevated);
}
.hero-card .region-card-img { aspect-ratio: 21 / 9; }

.region-card-label {
  display: block;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* (about-brief removed — info moved to About page) */


/* ═══════════════════════════════════════════════════════════════
   FORECAST PAGE
   ═══════════════════════════════════════════════════════════════ */

.forecast-layout { padding-bottom: 48px; }

/* Controls bar */
.forecast-controls {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.fc-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.fc-left, .fc-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fc-select {
  padding: 7px 32px 7px 12px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239ca3af' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.fc-select:hover { border-color: var(--border-strong); }
.fc-select:focus { border-color: var(--accent); }

.run-mono { font-variant-numeric: tabular-nums; font-family: "SF Mono", "Cascadia Code", "Consolas", monospace; font-size: 0.8125rem; }

.source-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 4px;
}
.source-aifs { background: #1d4ed8; color: #dbeafe; }
.source-wn2  { background: #059669; color: #d1fae5; }
.source-fcn3 { background: #9333ea; color: #f3e8ff; }
.source-fuxi { background: #d97706; color: #fef3c7; }

.version-tag {
  font-size: 0.5625rem;
  color: var(--text-muted, #888);
  font-style: italic;
  margin-left: 4px;
  opacity: 0.7;
}

/* Day tabs */
.tab-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
  white-space: nowrap;
}
.day-prefix { /* hidden on mobile via media query */ }
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-date {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-faint);
  margin-top: 1px;
}
.tab.active .tab-date { color: var(--accent); opacity: 0.8; }

.tab-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 6px 4px;
}

/* Single-day view layout */
.forecast-single { margin-top: 16px; }

/* Legend (above map) */
.map-legend {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 10px;
  font-size: 0.6875rem;
  color: var(--text-faint);
  flex-wrap: wrap;
}

.legend-swatch {
  width: 28px;
  height: 10px;
  border-radius: 2px;
}

.legend-label {
  margin: 0 4px 0 1px;
  white-space: nowrap;
}

.legend-cat-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 8px;
}

.legend-cat-swatch {
  width: 14px;
  height: 10px;
  border-radius: 2px;
}

/* Separator between probability and CIG legends */
.legend-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
  margin: 0 6px;
}

/* CIG hatching legend items */
.legend-cig-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 6px;
}

.cig-swatch {
  width: 20px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid var(--text-faint);
  position: relative;
  overflow: hidden;
}

.cig-dots {
  background-image: radial-gradient(circle, var(--text-faint) 0.7px, transparent 0.7px);
  background-size: 4px 4px;
}

.cig-diag {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent, transparent 1.5px,
    var(--text-faint) 1.5px, var(--text-faint) 2.5px
  );
}

.cig-cross {
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent, transparent 1.5px,
      var(--text-faint) 1.5px, var(--text-faint) 2.5px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent, transparent 1.5px,
      var(--text-faint) 1.5px, var(--text-faint) 2.5px
    );
}

/* Sidebar + Map flex layout */
.forecast-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* Hazard sidebar (vertical thumbnails) */
.hazard-sidebar {
  flex: 0 0 110px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hazard-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
  text-align: center;
}
.hazard-card:hover { border-color: var(--border-strong); }
.hazard-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.hazard-card-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--elevated);
}

.hazard-card-label {
  display: block;
  padding: 4px 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hazard-card.active .hazard-card-label { color: var(--accent); }

/* Map area (fills remaining space) */
.forecast-map-area {
  flex: 1;
  min-width: 0;
}

.map-frame {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
}

.map-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 200ms;
}
.map-img.loading { opacity: 0.5; }

/* Loading: accent bar only (no spinner) */
.map-frame.reloading::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  animation: loadbar 1.2s ease infinite;
}

@keyframes loadbar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Download button */
.map-download {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms, background 200ms;
  border: none;
}
.map-frame:hover .map-download { opacity: 1; }
.map-download:hover { background: rgba(0,0,0,0.75); }

/* Valid time bar + History button */
.valid-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 6px 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.history-btn {
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
}
.history-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* History view */
.forecast-history { margin-top: 24px; }

.history-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.history-back {
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: background 150ms;
}
.history-back:hover { background: var(--elevated); }

#history-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Thumbnail grids (all-days, history) */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.thumb-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 150ms, transform 150ms;
}
.thumb-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb-card.current { border-color: var(--accent); }

.thumb-card-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--elevated);
}

.thumb-card-label {
  display: block;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* All-days grid margin */
#forecast-alldays { margin-top: 24px; }


/* ═══════════════════════════════════════════════════════════════
   SPOT FORECAST PAGE
   ═══════════════════════════════════════════════════════════════ */

.spot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 16px;
  flex-wrap: wrap;
}

.spot-city {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.spot-coords {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.spot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spot-search-wrap { position: relative; }

.spot-search {
  padding: 8px 14px;
  width: 280px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
}
.spot-search::placeholder { color: var(--text-faint); }
.spot-search:focus { border-color: var(--accent); }

.spot-meta {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Risk color classes */
.risk-none   { color: var(--text-faint); }
.risk-low    { color: var(--prob-1); }
.risk-med    { color: var(--prob-2); }
.risk-high   { color: var(--prob-3); }
.risk-vhigh  { color: var(--prob-4); }
.risk-ext    { color: var(--prob-5); }

/* No-data message */
.spot-nodata {
  margin-top: 32px;
  padding: 40px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Loading state */
.spot-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Charts section */
.spot-charts { margin-top: 16px; }

/* SVG bar tooltip */
.spot-tooltip {
  position: fixed;
  z-index: 200;
  padding: 6px 10px;
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  display: none;
  font-variant-numeric: tabular-nums;
}
.spot-tooltip.show { display: block; }

/* ═══════════════════════════════════════════════════════════════
   HEATMAP
   ═══════════════════════════════════════════════════════════════ */

.heatmap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.heatmap {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.heatmap th {
  padding: 5px 2px;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.heatmap th:first-child {
  text-align: right;
  padding-right: 10px;
  padding-left: 10px;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hm-day th { border-bottom: none; padding-bottom: 0; }
.hm-hour th {
  font-size: 0.5625rem;
  font-weight: 400;
  color: var(--text-faint);
  border-bottom: 2px solid var(--border);
  padding-top: 0;
}
.heatmap td {
  padding: 8px 2px;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  min-width: 34px;
}
.heatmap tbody tr + tr { border-top: 1px solid var(--border); }
.hm-0 { color: var(--text-faint); }
.hm-1 { background: var(--prob-1); color: #fff; }
.hm-2 { background: var(--prob-2); color: #fff; }
.hm-3 { background: var(--prob-3); color: #fff; }
.hm-4 { background: var(--prob-4); color: #fff; }
.hm-5 { background: var(--prob-5); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   BAR CHART
   ═══════════════════════════════════════════════════════════════ */

.barchart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.barchart-svg {
  width: 100%;
  height: auto;
  display: block;
  padding: 8px 4px 4px;
}


/* ═══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════ */

.about-page {
  max-width: 720px;
  padding: 48px 0 64px;
}

.about-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.about-section {
  margin-bottom: 32px;
}

.about-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.about-section p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}

.about-section ul {
  color: var(--text-muted);
  line-height: 1.8;
  padding-left: 0;
}

.about-section li {
  padding-left: 16px;
  position: relative;
  margin-bottom: 10px;
}
.about-section li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.about-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}


/* ── FAQ ──────────────────────────────────────────────────────── */

.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }

.faq-q {
  padding: 14px 0;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::before {
  content: '+';
  display: inline-block;
  width: 1.2em;
  font-weight: 700;
  color: var(--text-muted);
}
details[open] .faq-q::before {
  content: '\2212';
}

.faq-a {
  padding: 0 0 14px 1.2em;
}
.faq-a p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: 0.8125rem;
  color: var(--text-faint);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.footer-sep { opacity: 0.4; }
.footer-link {
  color: var(--text-faint);
  transition: color 0.15s;
}
.footer-link:hover { color: var(--text); }
.footer-note { color: var(--text-faint); }
.footer-socials {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-social {
  color: var(--text-faint);
  transition: color 0.15s;
}
.footer-social:hover {
  color: var(--text);
}


/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .home-header-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .home-spot-input { width: 100%; }
  .home-spot-bar { width: 100%; }
  .home-spot-bar .home-spot-input { flex: 1; }

  .fc-row { gap: 12px; }
  .fc-right { margin-left: auto; }

  .tab { padding: 7px 10px; font-size: 0.8125rem; }
  .tab-date { font-size: 0.625rem; }

  .hazard-sidebar { flex: 0 0 90px; }
  .hazard-card-label { font-size: 0.5625rem; }

  .spot-header { flex-direction: column; }
  .spot-search { width: 100%; }
  .spot-actions { width: 100%; }
  .spot-search-wrap { flex: 1; }

  .nav-logo-img { height: 24px; }

  .about-page h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .nav-socials { display: none; }
  .region-grid { grid-template-columns: 1fr; }
  .hero-card { grid-column: auto; }

  .sg-row { grid-template-columns: 22px repeat(7, 1fr); gap: 2px; }
  .sg-lbl { font-size: 0.5rem; padding-right: 2px; }
  .sg-dn { font-size: 0.5rem; }
  .sg-dd { font-size: 0.4375rem; }
  .sg-week-label { font-size: 0.625rem; }
  .sg-cell { border-radius: 2px; }

  .fc-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .fc-left, .fc-right { width: 100%; }
  .fc-select { width: 100%; }

  .tab { padding: 5px 6px; font-size: 0.75rem; }
  .tab-date { display: none; }
  .day-prefix { display: none; }

  /* Mobile: sidebar becomes horizontal strip above map */
  .forecast-main { flex-direction: column; }
  .hazard-sidebar {
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hazard-sidebar::-webkit-scrollbar { display: none; }
  .hazard-card { width: 80px; flex: 0 0 auto; }
}

/* Attribution fine print */
.about-attribution { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 20px; }
.about-attribution h2 { font-size: 0.85rem; opacity: 0.5; text-transform: uppercase; letter-spacing: 0.05em; }
.about-attribution .attr-text { font-size: 0.75rem; opacity: 0.55; line-height: 1.5; }
.about-attribution .attr-text a { opacity: 1; color: var(--accent); }


/* ── Verification Page ─────────────────────────────────────── */

.verify-page { max-width: 1000px; margin: 0 auto; padding: 32px 0 64px; }
.verify-page h1 { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.8rem; margin-bottom: 12px; }
.verify-mode-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.verify-mode-tab {
  padding: 10px 20px; background: transparent; border: none; color: var(--text-muted);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.15s;
}
.verify-mode-tab:hover { color: var(--text); }
.verify-mode-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.verify-lead { color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }

.verify-loading { color: var(--text-muted); padding: 48px 0; text-align: center; }

.verify-progress { margin-bottom: 20px; }
.verify-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.verify-progress-bar > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
#verify-progress-text { font-size: 0.85rem; color: var(--text-muted); }

.verify-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.verify-pills { display: flex; gap: 6px; }
.verify-pills .pill {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer; font-size: 0.85rem;
  transition: all 0.15s;
}
.verify-pills .pill:hover { border-color: var(--accent); }
.verify-pills .pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.verify-metric-select { min-width: 160px; }

.verify-charts { margin-bottom: 32px; }
.verify-chart-main { margin-bottom: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.verify-chart-main canvas { max-height: 340px; }
.verify-chart-row-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.verify-chart-panel-tall { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.verify-chart-full { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.verify-chart-full canvas { max-height: 260px; }
.verify-chart-title { font-size: 0.85rem; font-weight: 600; margin: 0 0 12px; color: var(--text-muted); }

.verify-summary { margin-bottom: 32px; }
.verify-summary table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.verify-summary th, .verify-summary td { padding: 8px 12px; text-align: center; border-bottom: 1px solid var(--border); }
.verify-summary th { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.verify-summary td:first-child { text-align: left; font-weight: 600; }
.verify-summary .vs-good { color: #4ade80; }
.verify-summary .vs-ok { color: #facc15; }
.verify-summary .vs-poor { color: #f87171; }

.verify-methodology { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.verify-methodology h2 { font-size: 1.1rem; margin-bottom: 12px; }
.verify-methodology p { color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; }

/* Calendar infographic */
.verify-calendar { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.verify-calendar h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); }
.cal-month { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cal-label { font-size: 0.75rem; font-weight: 600; width: 28px; color: var(--text-muted); text-align: right; }
.cal-days { display: flex; gap: 2px; }
.cal-day { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--border); }
.cal-day.cal-done { background: var(--accent); border-color: var(--accent); }
.cal-summary { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

@media (max-width: 768px) {
  .verify-chart-row-2col { grid-template-columns: 1fr; }
  .verify-controls { flex-direction: column; align-items: flex-start; }
}
