/* ==========================================================================
   Kochi Rain: Mobile-First Editorial Weather Design System
   Locked Mobile Viewport · All 27 Labels Visible · Persistent Alerts State
   ========================================================================== */

:root {
  --bg: #F8F9FB;
  --surface: #FFFFFF;
  --surface-subtle: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --text: #0F172A;
  --text-secondary: #334155;
  --text-muted: #475569;

  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-text: #FFFFFF;

  --wa-bg: #15803D;
  --wa-hover: #166534;
  --wa-fg: #15803D;

  --status-clear: #15803D;
  --status-light: #0284C7;
  --status-mod: #A16207;
  --status-mod-fill: #EAB308;
  --status-heavy: #DC2626;
  --status-heavy-fill: #DC2626;

  --rain-now-bg: rgba(3, 105, 161, 0.08);

  --map-sea: #EAF2FA;
  --map-land: #FFFFFF;
  --map-water: #D8E9FC;
  --map-river: #BFD9F8;
  --map-coast: #94A3B8;

  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark {
  --bg: #0B0F17;
  --surface: #111827;
  --surface-subtle: #172033;
  --border: #1F2937;
  --border-strong: #334155;

  --text: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --accent: #3B82F6;
  --accent-hover: #60A5FA;
  --accent-text: #FFFFFF;

  --wa-bg: #16A34A;
  --wa-hover: #15803D;
  --wa-fg: #4ADE80;

  --status-clear: #4ADE80;
  --status-light: #38BDF8;
  --status-mod: #FDE047;
  --status-mod-fill: #FACC15;
  --status-heavy: #EF4444;
  --status-heavy-fill: #EF4444;

  --rain-now-bg: rgba(56, 189, 248, 0.11);

  --map-sea: #0D1524;
  --map-land: #131D30;
  --map-water: #112440;
  --map-river: #1E3E66;
  --map-coast: #475569;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

html:fullscreen,
html:-webkit-full-screen,
:fullscreen {
  background-color: var(--bg);
  width: 100%;
  min-height: 100dvh;
}

:fullscreen::backdrop,
:-webkit-full-screen::backdrop {
  background-color: var(--bg);
}

#live-sky,
#district-map,
#forecast {
  scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 68px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
}

.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* Top Bar: Frosted Sticky 3-Zone Single Row */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background-color: rgba(248, 249, 251, 0.78);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid rgba(203, 213, 225, 0.7);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), padding-top 180ms var(--ease);
}

html.dark .topbar {
  background-color: rgba(11, 15, 23, 0.76);
  border-bottom-color: rgba(51, 65, 85, 0.55);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
  background-color: #FFFFFF;
  padding: 2px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  padding-block: 4px;
  border-bottom: 1.5px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  border-bottom-color: var(--text);
}

.topbar-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
}

.btn-topbar-gps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.btn-topbar-gps:hover {
  color: var(--accent);
  background-color: var(--surface-subtle);
  border-color: var(--text-muted);
}

/* Refined Subtle Header Location Trigger */
.btn-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 38px;
  max-width: 240px;
  padding: 6px 11px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 1;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.btn-location:hover {
  background-color: var(--surface-subtle);
  border-color: var(--text-muted);
}

.btn-location svg {
  flex-shrink: 0;
  color: var(--accent);
}

#header-area-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Touch-Friendly Buttons */
button, .btn-primary, .btn-secondary, .btn-ghost, .btn-icon, .btn-whatsapp, .btn-alert-toggle {
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), transform 140ms var(--ease);
}

button:active, .btn-whatsapp:active {
  transform: scale(0.98);
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-text);
  background-color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.btn-secondary:hover {
  background-color: var(--surface-subtle);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #FFFFFF;
  background-color: var(--wa-bg);
  border: 1px solid var(--wa-bg);
  border-radius: var(--radius-sm);
}

.btn-whatsapp:hover {
  background-color: var(--wa-hover);
  border-color: var(--wa-hover);
}

/* Explicit Stateful Alerts Toggle (On vs Off) */
.btn-alert-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.btn-alert-toggle:hover {
  background-color: var(--surface-subtle);
}

.alert-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex-shrink: 0;
}

.btn-alert-toggle.is-on {
  color: var(--accent-text);
  background-color: var(--accent);
  border-color: var(--accent);
}

.btn-alert-toggle.is-on:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-alert-toggle.is-on .alert-indicator {
  background-color: #FFFFFF;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background-color: var(--surface);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  color: var(--text);
  background-color: var(--surface-subtle);
}

.btn-sm {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.875rem;
}

/* Pull-to-Refresh Indicator */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: height 180ms var(--ease), opacity 160ms var(--ease);
}

.ptr-indicator.is-dragging {
  transition: none;
}

.ptr-indicator.is-ready {
  color: var(--accent);
}

.ptr-icon {
  transition: transform 160ms var(--ease);
  flex-shrink: 0;
}

.ptr-indicator.is-ready .ptr-icon {
  transform: rotate(180deg);
}

.ptr-indicator.is-refreshing .ptr-icon {
  animation: ptrSpin 0.8s linear infinite;
}

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

/* Health Banner */
.health-banner {
  margin-top: 14px;
  padding: 10px 14px;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--status-mod);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Dynamic Scrolling Announcement Ticker */
.announcement-ticker {
  margin-top: 12px;
  padding: 7px 10px 7px 12px;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  --ticker-accent: var(--accent);
  --ticker-tint: rgba(29, 78, 216, 0.08);
  --ticker-duration: 18s;
}

html.dark .announcement-ticker {
  --ticker-tint: rgba(59, 130, 246, 0.14);
}

.announcement-ticker[hidden] {
  display: none;
}

.announcement-ticker.is-offer {
  --ticker-accent: #15803D;
  --ticker-tint: rgba(21, 128, 61, 0.1);
}

html.dark .announcement-ticker.is-offer {
  --ticker-accent: #4ADE80;
  --ticker-tint: rgba(74, 222, 128, 0.14);
}

.announcement-ticker.is-alert {
  --ticker-accent: #B45309;
  --ticker-tint: rgba(217, 119, 6, 0.11);
}

html.dark .announcement-ticker.is-alert {
  --ticker-accent: #FBBF24;
  --ticker-tint: rgba(251, 191, 36, 0.14);
}

.announcement-ticker.is-update {
  --ticker-accent: #0284C7;
  --ticker-tint: rgba(2, 132, 199, 0.1);
}

html.dark .announcement-ticker.is-update {
  --ticker-accent: #38BDF8;
  --ticker-tint: rgba(56, 189, 248, 0.14);
}

.announcement-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ticker-accent);
  background-color: var(--ticker-tint);
  border: 1px solid color-mix(in srgb, var(--ticker-accent) 28%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}

.announcement-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
}

.announcement-track {
  display: inline-flex;
  align-items: center;
  width: max-content;
  will-change: transform;
  animation: announcementMarquee var(--ticker-duration, 18s) linear infinite;
}

.announcement-ticker:hover .announcement-track,
.announcement-ticker:focus-within .announcement-track {
  animation-play-state: paused;
}

.announcement-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding-right: 48px;
}

@keyframes announcementMarquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.announcement-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ticker-accent);
  background-color: var(--ticker-tint);
  border: 1px solid color-mix(in srgb, var(--ticker-accent) 32%, transparent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 150ms var(--ease), transform 140ms var(--ease);
}

.announcement-link[hidden] {
  display: none;
}

.announcement-link:hover {
  background-color: color-mix(in srgb, var(--ticker-accent) 18%, transparent);
}

.announcement-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
}

.announcement-close:hover {
  color: var(--text);
  background-color: var(--surface-subtle);
  border-color: var(--border);
}

@media (max-width: 680px) {
  .announcement-ticker {
    margin-top: 10px;
    padding: 6px 8px 6px 10px;
    gap: 8px;
  }

  .announcement-text {
    font-size: 0.83rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-viewport {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .announcement-track {
    animation: none !important;
    width: 100%;
  }
  .announcement-text {
    white-space: normal;
    padding-right: 0;
  }
  .announcement-text-dup {
    display: none;
  }
}

/* Neat PWA Install Banner */
.install-banner {
  margin-top: 14px;
  padding: 10px 12px 10px 14px;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.install-banner[hidden] {
  display: none;
}

.install-banner-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.install-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background-color: #FFFFFF;
  flex-shrink: 0;
  object-fit: contain;
}

.install-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.install-banner-title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.install-banner-sub {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.install-banner-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-text);
  background-color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
  animation: installCtaPulse 2.8s var(--ease) infinite;
}

.install-banner-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.34) 50%, transparent 100%);
  transform: translateX(-160%);
  pointer-events: none;
  animation: installCtaShimmer 3.4s ease-in-out infinite;
}

.install-banner-cta:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

@keyframes installCtaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.42); }
  55% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

@keyframes installCtaShimmer {
  0%, 58% { transform: translateX(-160%); }
  100% { transform: translateX(300%); }
}

.install-banner-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.install-banner-close:hover {
  color: var(--text);
  background-color: var(--surface-subtle);
  border-color: var(--border);
}

/* Section 1: Framed Hero Verdict Card + Interactive Vector Map */
.hero-section {
  padding-top: 22px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.18fr;
  gap: 20px;
  align-items: stretch;
}

.hero-grid > * {
  min-width: 0;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  transition: background 240ms var(--ease), border-color 240ms var(--ease), box-shadow 240ms var(--ease);
}

html.dark .hero-copy {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 10px rgba(0, 0, 0, 0.28);
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 320ms var(--ease), background 320ms var(--ease);
}

.hero-meta-row,
.hero-verdict-body,
.hero-area-bar,
.hero-copy .summary-strip {
  position: relative;
  z-index: 1;
}

.hero-copy.is-state-clear {
  background: linear-gradient(180deg, rgba(21, 128, 61, 0.085) 0%, rgba(21, 128, 61, 0.025) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(21, 128, 61, 0.34);
}

html.dark .hero-copy.is-state-clear {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.12) 0%, rgba(74, 222, 128, 0.03) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(74, 222, 128, 0.32);
}

.hero-copy.is-state-clear.is-sky-day::before {
  opacity: 1;
  background:
    radial-gradient(240px 160px at 88% 12%, rgba(250, 204, 21, 0.20), transparent 72%),
    radial-gradient(260px 180px at 14% 18%, rgba(56, 189, 248, 0.12), transparent 72%);
}

.hero-copy.is-state-clear.is-sky-night::before {
  opacity: 1;
  background:
    radial-gradient(1.3px 1.3px at 18% 24%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1.1px 1.1px at 78% 20%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 86% 36%, rgba(167, 243, 208, 0.6), transparent),
    radial-gradient(1px 1px at 31% 16%, rgba(191, 219, 254, 0.55), transparent),
    radial-gradient(280px 180px at 84% 12%, rgba(99, 102, 241, 0.18), transparent 72%),
    radial-gradient(240px 160px at 16% 18%, rgba(45, 212, 191, 0.12), transparent 72%);
}

html:not(.dark) .hero-copy.is-state-clear.is-sky-night::before {
  background:
    radial-gradient(260px 170px at 85% 12%, rgba(79, 70, 229, 0.12), transparent 72%),
    radial-gradient(220px 150px at 15% 18%, rgba(13, 148, 136, 0.08), transparent 72%);
}

.hero-copy.is-state-light {
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.11) 0%, rgba(2, 132, 199, 0.035) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(2, 132, 199, 0.38);
}

html.dark .hero-copy.is-state-light {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0.04) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(56, 189, 248, 0.36);
}

.hero-copy.is-state-light::before {
  opacity: 1;
  background: radial-gradient(300px 190px at 50% 8%, rgba(56, 189, 248, 0.22), transparent 74%);
}

.hero-copy.is-state-moderate {
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.16) 0%, rgba(234, 179, 8, 0.045) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(161, 98, 7, 0.42);
}

html.dark .hero-copy.is-state-moderate {
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.15) 0%, rgba(250, 204, 21, 0.04) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(250, 204, 21, 0.38);
}

.hero-copy.is-state-moderate::before {
  opacity: 1;
  background: radial-gradient(300px 190px at 50% 8%, rgba(250, 204, 21, 0.22), transparent 74%);
}

.hero-copy.is-state-heavy {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.12) 0%, rgba(220, 38, 38, 0.035) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(220, 38, 38, 0.40);
}

html.dark .hero-copy.is-state-heavy {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.16) 0%, rgba(239, 68, 68, 0.045) 68%, var(--surface) 100%), var(--surface);
  border-color: rgba(239, 68, 68, 0.40);
}

.hero-copy.is-state-heavy::before {
  opacity: 1;
  background: radial-gradient(320px 200px at 50% 8%, rgba(239, 68, 68, 0.22), transparent 74%);
}

.hero-copy.is-state-unavailable {
  background-color: var(--surface);
  border-color: var(--border-strong);
}

/* Live Feed Pulse Dot */
.live-status-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--status-clear);
}

.live-status-dot.is-live::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--status-clear);
  opacity: 0;
  animation: liveDotPulse 2.4s var(--ease) infinite;
}

.live-status-dot.is-cached {
  background-color: var(--status-mod-fill);
}

.live-status-dot.is-offline {
  background-color: var(--text-muted);
}

@keyframes liveDotPulse {
  0% { transform: scale(0.7); opacity: 0.75; }
  75%, 100% { transform: scale(1.9); opacity: 0; }
}

.hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background-color: rgba(15, 23, 42, 0.025);
  flex-wrap: nowrap;
}

html.dark .hero-meta-row {
  background-color: rgba(255, 255, 255, 0.025);
}

.meta-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

#scan-time-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-meta-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  flex-shrink: 0;
}

.btn-meta-icon::after {
  content: "";
  position: absolute;
  inset: -6px -3px;
}

.btn-meta-icon:hover {
  color: var(--text);
  border-color: var(--accent);
  background-color: var(--surface);
}

.hero-meta-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-theme-subtle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
}

.btn-theme-subtle::after {
  content: "";
  position: absolute;
  inset: -5px -2px;
}

.btn-theme-subtle[hidden] {
  display: none;
}

.btn-theme-subtle:hover {
  color: var(--text);
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
}

.btn-install-subtle {
  color: var(--accent);
  border-color: rgba(29, 78, 216, 0.38);
  background-color: rgba(29, 78, 216, 0.06);
}

html.dark .btn-install-subtle {
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.45);
  background-color: rgba(59, 130, 246, 0.12);
}

.btn-install-subtle:not([hidden]) {
  animation: installChipNudge 2.8s var(--ease) infinite;
}

@keyframes installChipNudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.34); }
  55% { box-shadow: 0 0 0 5px rgba(59, 130, 246, 0); }
}

.hero-verdict-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 28px 24px;
}

.hero-headline-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.hero-weather-visual {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.hero-weather-visual svg {
  display: block;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.hero-copy.is-state-clear .hero-weather-visual {
  background-color: rgba(21, 128, 61, 0.1);
  border-color: rgba(21, 128, 61, 0.35);
}

html.dark .hero-copy.is-state-clear .hero-weather-visual {
  background-color: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.38);
}

.hero-copy.is-state-light .hero-weather-visual {
  background-color: rgba(2, 132, 199, 0.11);
  border-color: rgba(2, 132, 199, 0.38);
}

html.dark .hero-copy.is-state-light .hero-weather-visual {
  background-color: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}

.hero-copy.is-state-moderate .hero-weather-visual {
  background-color: rgba(234, 179, 8, 0.15);
  border-color: rgba(161, 98, 7, 0.42);
}

html.dark .hero-copy.is-state-moderate .hero-weather-visual {
  background-color: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.42);
}

.hero-copy.is-state-heavy .hero-weather-visual {
  background-color: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.42);
}

html.dark .hero-copy.is-state-heavy .hero-weather-visual {
  background-color: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.44);
}

.hero-headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.75vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
  text-wrap: balance;
}

.hero-subcopy {
  margin: 0 auto;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 46ch;
  text-align: center;
}

/* Active Rain Clearing Progress Bar */
.hero-spell-progress {
  width: 100%;
  max-width: 380px;
  margin: 2px auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hero-spell-progress[hidden] {
  display: none;
}

.hero-spell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
}

.hero-spell-title {
  font-weight: 700;
  color: var(--text);
}

.hero-spell-eta {
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-spell-track {
  position: relative;
  height: 7px;
  border-radius: 4px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hero-spell-fill {
  height: 100%;
  border-radius: 3px;
  background-color: var(--status-light);
  transition: width 320ms var(--ease), background-color 220ms var(--ease);
}

.hero-spell-fill.is-moderate {
  background-color: var(--status-mod-fill);
}

.hero-spell-fill.is-heavy {
  background-color: var(--status-heavy-fill);
}

/* 3-Hour Visual Rain Timeline Bar */
.hero-timeline {
  width: 100%;
  max-width: 380px;
  margin: 4px auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hero-timeline[hidden] {
  display: none;
}

.hero-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
}

.hero-timeline-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.hero-timeline-summary {
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-timeline-track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  overflow: visible;
  cursor: pointer;
  touch-action: pan-y;
}

.timeline-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--border);
  z-index: 2;
  pointer-events: none;
}

.timeline-scrub-cursor {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background-color: var(--text);
  border-radius: 2px;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--surface);
}

.timeline-scrub-cursor::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 1.5px solid var(--surface);
}

.timeline-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  transition: left 260ms var(--ease), width 260ms var(--ease);
}

.timeline-segment.is-clear {
  background: linear-gradient(90deg, rgba(21, 128, 61, 0.22), rgba(21, 128, 61, 0.08));
}

html.dark .timeline-segment.is-clear {
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.28), rgba(74, 222, 128, 0.09));
}

.timeline-segment.is-light {
  background-color: var(--status-light);
}

.timeline-segment.is-moderate {
  background-color: var(--status-mod-fill);
}

.timeline-segment.is-heavy {
  background-color: var(--status-heavy-fill);
}

.timeline-segment.is-distant {
  opacity: 0.55;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.28) 0 4px,
    transparent 4px 8px
  );
}

.hero-timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hero-area-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background-color: rgba(15, 23, 42, 0.02);
}

html.dark .hero-area-bar {
  background-color: rgba(255, 255, 255, 0.02);
}

.hero-area-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-favorites-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.hero-favorites-bar[hidden] {
  display: none;
}

.btn-fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
}

.btn-fav-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-fav-chip.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background-color: rgba(29, 78, 216, 0.08);
}

html.dark .btn-fav-chip.is-active {
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.55);
  background-color: rgba(59, 130, 246, 0.16);
}

.fav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--status-clear);
  flex-shrink: 0;
}

.fav-dot.is-soon {
  background-color: var(--status-mod-fill);
}

.fav-dot.is-active {
  background-color: var(--status-light);
}

.fav-dot.is-heavy {
  background-color: var(--status-heavy-fill);
}

.btn-scope-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
}

html.dark .btn-scope-chip {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.btn-scope-chip.btn-scope-primary {
  color: var(--accent);
  border-color: rgba(29, 78, 216, 0.38);
  background-color: rgba(29, 78, 216, 0.07);
}

html.dark .btn-scope-chip.btn-scope-primary {
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.42);
  background-color: rgba(59, 130, 246, 0.14);
}

.btn-scope-chip.btn-scope-secondary {
  color: var(--text);
  background-color: var(--surface);
  border-color: var(--border-strong);
}

.btn-scope-chip[hidden] {
  display: none;
}

.btn-scope-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--surface);
}

/* Interactive Zoom & Pan Vector Map */
.map-frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

html.dark .map-frame {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 10px rgba(0, 0, 0, 0.28);
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

/* Dual-row Interactive Map Legend (Compact Spacing) */
.map-legend-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 10px;
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.map-legend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  flex-wrap: wrap;
}

.map-intensity-row {
  gap: 6px;
  padding-top: 3px;
  border-top: 1px solid var(--border);
}

.legend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.legend-btn:hover {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.legend-btn.is-active {
  background-color: var(--surface);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.14);
}

.legend-btn-sm {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

.swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
}

.swatch-light { background-color: var(--status-light); }
.swatch-mod {
  background-color: var(--status-mod-fill);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.16);
}
.swatch-heavy { background-color: var(--status-heavy-fill); }

.legend-svg {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.map-canvas-wrap {
  flex: 1;
  background-color: var(--map-sea);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.map-canvas-wrap.is-zoomed {
  touch-action: none;
  cursor: grab;
}

.map-canvas-wrap.is-dragging {
  cursor: grabbing;
}

#corridor-map-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 580 / 560;
  max-height: none;
  display: block;
  user-select: none;
  touch-action: inherit;
  transition: opacity 180ms var(--ease), transform 200ms var(--ease);
}

#corridor-map-svg.is-region-settling {
  animation: mapRegionSettle 210ms var(--ease);
}

@keyframes mapRegionSettle {
  0% { opacity: 0.58; transform: scale(0.985); }
  100% { opacity: 1; transform: scale(1); }
}

/* Floating Fullscreen & Zoom Controls inside Map Corners */
.map-fullscreen-btn {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 5;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-size: 0.8125rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  touch-action: manipulation;
}

.map-fullscreen-btn:hover {
  background-color: var(--surface-subtle);
}

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

.map-zoom-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 5;
  touch-action: manipulation;
}

/* Fullscreen Map Sheet Mode */
body.map-fullscreen-open {
  overflow: hidden;
}

.map-frame.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  margin: 0;
  border: none;
  border-radius: 0;
}

.map-frame.is-fullscreen .map-header {
  padding: 6px 12px;
  padding-top: max(6px, env(safe-area-inset-top));
}

.map-frame.is-fullscreen .map-legend-stack {
  padding: 4px 8px;
}

.map-frame.is-fullscreen .map-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.map-frame.is-fullscreen #corridor-map-svg {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
}

.map-frame.is-fullscreen .map-inspector {
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.zoom-btn:hover {
  background-color: var(--surface-subtle);
}

.zoom-reset-btn {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border-strong);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.zoom-reset-btn[hidden] {
  display: none;
}

/* Crisp Readability Halo & Enhanced Rain Animations inside SVG */
#map-rain-clouds,
#map-approach-vectors {
  transition: opacity 200ms var(--ease);
}

.svg-town-node {
  transition: opacity 200ms var(--ease);
}

.svg-town-node.is-dimmed {
  opacity: 0.16;
}

.svg-town-label {
  font-family: var(--font-body);
  paint-order: stroke;
  stroke: var(--map-land);
  stroke-width: 5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  user-select: none;
}

.svg-rain-aura {
  transform-box: fill-box;
  transform-origin: center;
  animation: svgAuraPulse 2.8s ease-in-out infinite alternate;
}

.svg-rain-ripple {
  transform-box: fill-box;
  transform-origin: center;
  animation: svgRipple 2.2s var(--ease) infinite;
}

.svg-rain-ripple-delayed {
  animation-delay: 1.1s;
}

.svg-soon-orbit {
  transform-box: fill-box;
  transform-origin: center;
  animation: svgSpin 11s linear infinite;
}

.svg-wind-drift {
  animation: svgFlow 2.6s linear infinite;
}

.svg-rain-cloud {
  transform-box: fill-box;
  transform-origin: center;
  animation: cloudCellBreathe 4.2s ease-in-out infinite alternate;
}

.svg-approach-path {
  animation: svgFlow 2.1s linear infinite;
}

@keyframes cloudCellBreathe {
  0% { transform: scale(0.96); opacity: 0.88; }
  100% { transform: scale(1.05); opacity: 1; }
}

.weather-drop { animation: dropFall 1.3s ease-in infinite; }
.weather-drop-2 { animation-delay: 0.45s; }
.weather-drop-3 { animation-delay: 0.85s; }
.weather-cloud-drift { animation: cloudFloat 3.6s ease-in-out infinite alternate; }
.weather-sun-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: svgSpin 24s linear infinite;
}

@keyframes svgAuraPulse {
  0% { transform: scale(0.92); opacity: 0.16; }
  100% { transform: scale(1.12); opacity: 0.28; }
}
@keyframes svgRipple {
  0% { transform: scale(0.75); opacity: 0.88; }
  100% { transform: scale(2.3); opacity: 0; }
}
@keyframes svgSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes svgFlow {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}
@keyframes dropFall {
  0% { transform: translateY(-4px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(7px); opacity: 0; }
}
@keyframes cloudFloat {
  0% { transform: translateX(-2px); }
  100% { transform: translateX(3px); }
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.map-inspector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.015), transparent), var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

html.dark .map-inspector {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.map-inspector .btn-secondary:disabled {
  background-color: var(--surface-subtle);
  border-color: var(--border);
  color: var(--accent);
  cursor: default;
  opacity: 1;
}

.inspector-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.inspector-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inspector-details strong {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspector-eta-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.45;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.inspector-eta-badge[hidden] {
  display: none;
}

.inspector-eta-badge.is-light {
  color: var(--status-light);
  background-color: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.25);
}

.inspector-eta-badge.is-moderate {
  color: var(--status-mod);
  background-color: rgba(234, 179, 8, 0.14);
  border-color: rgba(161, 98, 7, 0.28);
}

.inspector-eta-badge.is-heavy {
  color: var(--status-heavy);
  background-color: rgba(220, 38, 38, 0.11);
  border-color: rgba(220, 38, 38, 0.28);
}

.inspector-status {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Integrated 4-Metric Summary Strip Inside Hero Card */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--surface-subtle);
  border-top: 1px solid var(--border);
}

.summary-cell {
  padding: 13px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  text-align: center;
}

.summary-cell:last-child {
  border-right: none;
}

.summary-cell:hover {
  background-color: var(--surface);
}

.summary-number {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.summary-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.summary-cell-active .summary-number { color: var(--status-light); }
.summary-cell-soon .summary-number { color: var(--accent); }
.summary-cell-later .summary-number { color: var(--status-mod); }
.summary-cell-dry .summary-number { color: var(--status-clear); }

/* Content Sections */
.content-section {
  padding-block: 26px;
  border-bottom: 1px solid var(--border);
}

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

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Segmented Control */
.segmented-control {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 3px;
}

.seg-btn {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.is-active {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 2px rgba(15, 23, 42, 0.08);
}

html.dark .seg-btn.is-active {
  background-color: #1E293B;
  color: #F8FAFC;
  border-color: #475569;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Unified Schedule Rows */
.schedule-group {
  margin-bottom: 18px;
  animation: panelFadeIn 200ms var(--ease);
}

.schedule-group:last-child {
  margin-bottom: 0;
}

.schedule-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-strong);
}

.schedule-group-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.schedule-group-caption {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.schedule-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.schedule-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 7px;
  padding: 13px 16px 13px 20px;
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 2px rgba(15, 23, 42, 0.04);
  text-align: left;
  white-space: normal;
  overflow: hidden;
  transition: background-color 170ms var(--ease), border-color 170ms var(--ease), box-shadow 170ms var(--ease), transform 140ms var(--ease);
}

html.dark .schedule-row {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 4px rgba(0, 0, 0, 0.24);
}

.schedule-row::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background-color: var(--status-light);
}

.schedule-row.is-tier-moderate::before {
  background-color: var(--status-mod-fill);
}

.schedule-row.is-tier-heavy::before {
  background-color: var(--status-heavy-fill);
}

.schedule-row.is-distant-row::before {
  opacity: 0.52;
}

.schedule-row:hover {
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.schedule-row.is-pinned {
  background-color: rgba(29, 78, 216, 0.05);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 1px var(--accent);
}

html.dark .schedule-row.is-pinned {
  background-color: rgba(59, 130, 246, 0.11);
}

.schedule-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.schedule-row-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.schedule-row-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.schedule-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.schedule-row-meta-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.eta-micro-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  border: 1px solid transparent;
}

.eta-micro-badge.is-light {
  color: var(--status-light);
  background-color: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.24);
}

.eta-micro-badge.is-moderate {
  color: var(--status-mod);
  background-color: rgba(234, 179, 8, 0.14);
  border-color: rgba(161, 98, 7, 0.28);
}

.eta-micro-badge.is-heavy {
  color: var(--status-heavy);
  background-color: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.26);
}

.schedule-pin-note {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--accent);
  background-color: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  white-space: nowrap;
}

.schedule-row-meta {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.schedule-row-time {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.schedule-row-sub {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.is-clear { color: var(--status-clear); }
.is-light { color: var(--status-light); }
.is-moderate { color: var(--status-mod); }
.is-heavy { color: var(--status-heavy); }
.is-unavailable { color: var(--text-muted); }

.empty-state {
  padding: 22px 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.empty-state-title {
  margin: 0 0 2px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.empty-state-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Compact 27-Place Directory */
.areas-view {
  animation: panelFadeIn 200ms var(--ease);
}

.areas-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input {
  min-height: 40px;
  padding: 8px 12px;
  width: 260px;
  max-width: 100%;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

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

.areas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background-color: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

html.dark .areas-grid {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 10px rgba(0, 0, 0, 0.25);
}

.area-row-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 12px 13px;
  background-color: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  width: 100%;
  min-height: 62px;
  min-width: 0;
  transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.area-row-card:hover {
  background-color: var(--surface-subtle);
}

.area-row-card.is-pinned {
  background-color: var(--surface-subtle);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.area-row-card.is-raining-card {
  background-color: rgba(2, 132, 199, 0.08);
}

html.dark .area-row-card.is-raining-card {
  background-color: rgba(56, 189, 248, 0.11);
}

.area-row-card.is-raining-card.is-tier-moderate {
  background-color: rgba(234, 179, 8, 0.11);
}

html.dark .area-row-card.is-raining-card.is-tier-moderate {
  background-color: rgba(250, 204, 21, 0.12);
}

.area-row-card.is-raining-card.is-tier-heavy {
  background-color: rgba(220, 38, 38, 0.095);
}

html.dark .area-row-card.is-raining-card.is-tier-heavy {
  background-color: rgba(239, 68, 68, 0.13);
}

.area-row-card.is-approaching-card {
  background-color: rgba(2, 132, 199, 0.04);
}

html.dark .area-row-card.is-approaching-card {
  background-color: rgba(56, 189, 248, 0.06);
}

.area-row-card.is-approaching-card.is-tier-moderate {
  background-color: rgba(234, 179, 8, 0.06);
}

html.dark .area-row-card.is-approaching-card.is-tier-moderate {
  background-color: rgba(250, 204, 21, 0.065);
}

.area-row-card.is-approaching-card.is-tier-heavy {
  background-color: rgba(220, 38, 38, 0.055);
}

html.dark .area-row-card.is-approaching-card.is-tier-heavy {
  background-color: rgba(239, 68, 68, 0.07);
}

.area-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.area-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 3-Bar Micro Rain Intensity Meter */
.rain-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex-shrink: 0;
}

.rain-meter-bar {
  width: 3px;
  border-radius: 1px;
  background-color: var(--border-strong);
  opacity: 0.45;
}

.rain-meter-bar:nth-child(1) { height: 5px; }
.rain-meter-bar:nth-child(2) { height: 8px; }
.rain-meter-bar:nth-child(3) { height: 12px; }

.rain-meter.is-clear .rain-meter-bar {
  height: 3px;
  opacity: 0.25;
}

.rain-meter.is-light .rain-meter-bar.is-lit {
  background-color: var(--status-light);
  opacity: 1;
}

.rain-meter.is-moderate .rain-meter-bar.is-lit {
  background-color: var(--status-mod-fill);
  opacity: 1;
}

.rain-meter.is-heavy .rain-meter-bar.is-lit {
  background-color: var(--status-heavy-fill);
  opacity: 1;
}

.rain-meter.is-approaching .rain-meter-bar.is-lit {
  opacity: 0.62;
}

.area-card-state-line {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Alerts & WhatsApp Channel Strip */
.alerts-strip {
  border-bottom: none;
  padding-block: 20px;
}

.alerts-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 3px rgba(15, 23, 42, 0.04);
}

html.dark .alerts-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 10px rgba(0, 0, 0, 0.25);
}

.alerts-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.alerts-heading-group {
  min-width: 0;
}

.alerts-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.alerts-desc {
  margin: 3px 0 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.alerts-device-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 14px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.alerts-device-panel.is-alerts-on {
  border-color: var(--accent);
  background-color: rgba(29, 78, 216, 0.05);
}

html.dark .alerts-device-panel.is-alerts-on {
  background-color: rgba(59, 130, 246, 0.09);
}

.alerts-device-panel .btn-alert-toggle {
  min-height: 42px;
  padding: 8px 16px;
}

.alert-intensity-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-intensity-picker[hidden] {
  display: none;
}

.alert-intensity-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.alert-intensity-tabs {
  background-color: var(--bg);
}

.alert-intensity-tabs .seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 11px;
  font-size: 0.8125rem;
}

.tier-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tier-dot-1 { background-color: var(--status-light); }
.tier-dot-2 { background-color: var(--status-mod-fill); }
.tier-dot-3 { background-color: var(--status-heavy-fill); }

.tier-check {
  display: none;
  flex-shrink: 0;
}

/* Strong active-tier distinction when Alerts are Off (standby preset) */
.alert-intensity-tabs .seg-btn.is-active {
  background-color: rgba(29, 78, 216, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.12);
}

html.dark .alert-intensity-tabs .seg-btn.is-active {
  background-color: rgba(59, 130, 246, 0.22);
  border-color: var(--accent);
  color: #F8FAFC;
}

.alert-intensity-tabs .seg-btn.is-active .tier-check {
  display: inline-block;
}

/* Solid active highlight when Alerts are ON */
.alerts-device-panel.is-alerts-on .alert-intensity-tabs .seg-btn.is-active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 1px 4px rgba(29, 78, 216, 0.28);
}

.alerts-device-panel.is-alerts-on .alert-intensity-tabs .seg-btn.is-active .tier-dot {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}

.alerts-channel-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.alerts-channel-caption {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.alerts-channel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 18px 20px;
}

.footer-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
}

.footer-brand-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.btn-footer-theme {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.8rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.footer-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 5px;
  background-color: #FFFFFF;
  padding: 2px;
  border: 1px solid var(--border);
}

.footer-sep {
  color: var(--text-muted);
  font-weight: 600;
}

.footer-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.footer-disclaimer {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: right;
}

@media (max-width: 860px) {
  .footer-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .footer-brand-group {
    justify-content: center;
  }

  .footer-disclaimer {
    text-align: center;
    max-width: 52ch;
  }
}

/* Centralised Floating Toast Notification */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 10px;
  background-color: var(--text);
  color: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  animation: toastSlideUp 180ms var(--ease);
}

.app-toast[hidden] {
  display: none;
}

.app-toast.is-warn {
  background-color: var(--status-mod-fill);
  color: #0F172A;
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Mobile Quick Navigation Bar (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
}

/* Area Picker & Install Guide Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: 100%;
  max-width: 540px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  animation: panelFadeIn 180ms var(--ease);
}

.modal-panel-compact {
  max-width: 420px;
}

.ios-install-note {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.ios-install-steps {
  margin: 4px 0 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.install-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -3px;
  margin: 0 2px;
  padding: 2px 4px;
  border-radius: 5px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--accent);
}

.modal-grabber {
  display: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-areas-list {
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-area-row {
  display: flex;
  align-items: stretch;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.modal-area-row:nth-child(2n) {
  border-right: none;
}

.modal-area-row-full {
  grid-column: 1 / -1;
  border-right: none;
  background-color: var(--surface-subtle);
}

.modal-area-section-label {
  grid-column: 1 / -1;
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}

.modal-area-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 12px 14px;
  min-height: 46px;
  min-width: 0;
  flex: 1 1 auto;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-area-item:hover {
  background-color: var(--surface-subtle);
}

.modal-area-item.is-selected {
  background-color: var(--surface-subtle);
  color: var(--accent);
  font-weight: 700;
}

.modal-area-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
}

.modal-area-star:hover {
  background-color: var(--surface-subtle);
  color: var(--status-mod-fill);
}

.modal-area-star.is-saved {
  color: var(--status-mod-fill);
}

.modal-area-item-all {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-subtle);
}

/* Loading Skeleton */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-row {
  height: 48px;
  background-color: var(--surface-subtle);
  border-radius: var(--radius-sm);
}

/* Tablet Breakpoint */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .areas-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.btn-hero-gps {
  display: none;
}

/* Mobile Phone Breakpoint (375px-680px): Strictly confined horizontally */
@media (max-width: 680px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .container {
    padding-inline: 14px;
  }

  .topbar-nav {
    display: none;
  }

  .topbar-inner {
    min-height: 48px;
    gap: 8px;
  }

  .brand-wordmark {
    font-size: 1rem;
    gap: 7px;
  }

  .brand-logo {
    width: 26px;
    height: 26px;
  }

  .btn-topbar-gps {
    width: 32px;
    height: 32px;
  }

  .btn-location {
    min-height: 32px;
    max-width: min(176px, 46vw);
    padding: 4px 8px;
    gap: 4px;
    font-size: 0.84rem;
  }

  .install-banner {
    margin-top: 10px;
    padding: 9px 10px;
    gap: 10px;
  }

  .install-banner-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .install-banner-title {
    font-size: 0.95rem;
  }

  .install-banner-sub {
    font-size: 0.83rem;
  }

  .install-banner-cta {
    min-height: 36px;
    padding: 6px 13px;
    font-size: 0.84rem;
  }

  .hero-section {
    padding-top: 12px;
    padding-bottom: 16px;
  }

  .hero-grid {
    gap: 14px;
  }

  .hero-meta-row {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .meta-line {
    font-size: 0.8rem;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .btn-meta-icon {
    width: 32px;
    height: 32px;
  }

  .hero-meta-controls {
    gap: 5px;
    flex-shrink: 0;
  }

  .btn-theme-subtle {
    min-height: 36px;
    padding: 6px 9px;
    gap: 4px;
    font-size: 0.8rem;
  }

  .hero-verdict-body {
    padding: 18px 14px;
    gap: 10px;
  }

  .hero-headline {
    font-size: clamp(1.68rem, 5.2vw, 2.05rem);
  }

  .hero-timeline-head {
    font-size: 0.8rem;
  }

  .hero-timeline-axis {
    font-size: 0.76rem;
  }

  .hero-area-bar {
    padding: 9px 10px;
  }

  .hero-area-actions {
    gap: 7px;
  }

  .btn-scope-chip {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.83rem;
  }

  .btn-hero-gps {
    padding: 6px 9px;
  }

  .hero-headline-row {
    gap: 12px;
  }

  .hero-weather-visual {
    width: 46px;
    height: 46px;
  }

  .hero-subcopy {
    font-size: 1rem;
  }

  /* Strictly confined within mobile container (zero horizontal overflow / panning) */
  .map-frame {
    margin-inline: 0;
    border-radius: var(--radius-md);
  }

  .map-header {
    padding: 8px 12px;
  }

  .map-zoom-tabs .seg-btn {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 0.84rem;
  }

  .map-legend-stack {
    padding: 5px 6px;
    gap: 3px;
  }

  .map-legend-row {
    flex-wrap: nowrap;
    gap: 2px 3px;
  }

  .map-intensity-row {
    padding-top: 3px;
    gap: 5px;
  }

  .legend-svg {
    width: 15px;
    height: 15px;
  }

  .legend-btn {
    min-height: 28px;
    padding: 2px 5px;
    font-size: clamp(0.74rem, 3.1vw, 0.81rem);
    gap: 3px;
  }

  .legend-btn-sm {
    min-height: 26px;
    padding: 2px 8px;
    font-size: 0.8rem;
  }

  #corridor-map-svg {
    aspect-ratio: 580 / 560;
    max-height: none;
  }

  .map-frame.is-fullscreen #corridor-map-svg {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    max-height: none;
  }

  .map-inspector {
    padding: 10px 12px;
  }

  .inspector-details strong {
    font-size: 1rem;
  }

  .inspector-eta-badge {
    font-size: 0.78rem;
  }

  .inspector-status {
    font-size: 0.875rem;
  }

  .summary-strip {
    margin-top: 0;
  }

  .summary-cell {
    padding: 10px 6px;
  }

  .summary-number {
    font-size: 1.32rem;
  }

  .summary-label {
    font-size: 0.8125rem;
  }

  .content-section {
    padding-block: 18px;
  }

  .section-header {
    margin-bottom: 12px;
    gap: 10px;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .view-tabs .seg-btn {
    padding: 7px 4px;
    font-size: 0.875rem;
  }

  .areas-controls {
    gap: 8px;
  }

  .search-input {
    width: 100%;
    font-size: 1rem;
  }

  .areas-filter-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .areas-filter-bar .seg-btn {
    padding: 7px 4px;
    font-size: 0.875rem;
  }

  .schedule-group-title {
    font-size: 1.0625rem;
  }

  .schedule-group-caption {
    font-size: 0.85rem;
  }

  .schedule-row-name {
    font-size: 1.0625rem;
  }

  .eta-micro-badge {
    font-size: 0.76rem;
  }

  .schedule-pin-note {
    font-size: 0.74rem;
  }

  .schedule-row-meta {
    font-size: 0.875rem;
  }

  .schedule-row-time {
    font-size: 0.98rem;
  }

  .schedule-row-sub {
    font-size: 0.82rem;
  }

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

  .area-card-name {
    font-size: 1rem;
  }

  .area-card-state-line {
    font-size: 0.875rem;
  }

  .alerts-card {
    padding: 14px;
    gap: 12px;
  }

  .alerts-title {
    font-size: 1.125rem;
  }

  .alerts-desc {
    font-size: 0.9375rem;
  }

  .alerts-device-panel {
    padding: 12px;
    gap: 10px;
  }

  .alerts-device-panel .btn-alert-toggle {
    width: 100%;
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .alert-intensity-picker {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .alert-intensity-label {
    font-size: 0.875rem;
  }

  .alert-intensity-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .alert-intensity-tabs .seg-btn {
    min-height: 40px;
    padding: 6px 4px;
    font-size: 0.82rem;
    gap: 4px;
  }

  .alerts-channel-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .alerts-channel-caption {
    font-size: clamp(0.84rem, 3.6vw, 0.92rem);
    text-align: center;
    white-space: nowrap;
  }

  .alerts-channel-actions {
    width: 100%;
    display: flex;
  }

  .alerts-channel-actions .btn-whatsapp {
    width: 100%;
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .site-footer {
    padding-block: 14px 16px;
  }

  .footer-layout {
    gap: 6px;
  }

  .footer-disclaimer {
    font-size: clamp(0.74rem, 3.2vw, 0.82rem);
    white-space: nowrap;
  }

  /* Compact Bottom Mobile Navigation Bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(54px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 45;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-strong);
  }

  html.dark .mobile-bottom-nav {
    background-color: rgba(17, 24, 39, 0.9);
  }

  .mobile-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-right: 1px solid var(--border);
    transition: color 160ms var(--ease), background-color 160ms var(--ease);
  }

  .mobile-nav-item:last-child {
    border-right: none;
  }

  .mobile-nav-item.is-active {
    color: var(--accent);
    font-weight: 700;
  }

  .mobile-nav-item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background-color: var(--accent);
  }

  .mobile-nav-item:active {
    background-color: var(--surface-subtle);
    color: var(--accent);
  }

  .app-toast {
    bottom: calc(66px + env(safe-area-inset-bottom));
  }

  /* Bottom-Sheet Modal on Mobile */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
    transition: background-color 160ms var(--ease);
  }

  .modal-panel {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 18px 18px 0 0;
    padding: 10px 14px 18px 14px;
    border-bottom: none;
    transition: transform 200ms var(--ease);
  }

  .modal-panel.is-dragging {
    transition: none;
  }

  .modal-grabber {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--border-strong);
    margin: 0 auto 10px auto;
  }

  .modal-title {
    font-size: 1.125rem;
  }

  .modal-area-item {
    padding: 11px 8px 11px 10px;
    font-size: 0.9rem;
  }
}

/* Edge-to-edge mobile fullscreen: tuck topbar cleanly into status ears around center camera cutout */
@media (max-width: 960px) {
  :fullscreen .topbar,
  :-webkit-full-screen .topbar,
  body.is-app-fullscreen .topbar {
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  :fullscreen .topbar-inner,
  :-webkit-full-screen .topbar-inner,
  body.is-app-fullscreen .topbar-inner {
    min-height: 38px;
    gap: 10px;
  }

  :fullscreen .brand-wordmark,
  :-webkit-full-screen .brand-wordmark,
  body.is-app-fullscreen .brand-wordmark {
    max-width: 40%;
    font-size: 0.94rem;
    gap: 6px;
    overflow: hidden;
  }

  :fullscreen .brand-logo,
  :-webkit-full-screen .brand-logo,
  body.is-app-fullscreen .brand-logo {
    width: 24px;
    height: 24px;
  }

  :fullscreen .topbar-action,
  :-webkit-full-screen .topbar-action,
  body.is-app-fullscreen .topbar-action {
    max-width: 44%;
    gap: 0;
  }

  :fullscreen #gps-locate-btn,
  :-webkit-full-screen #gps-locate-btn,
  body.is-app-fullscreen #gps-locate-btn {
    display: none;
  }

  :fullscreen .btn-hero-gps,
  :-webkit-full-screen .btn-hero-gps,
  body.is-app-fullscreen .btn-hero-gps {
    display: inline-flex;
  }

  :fullscreen .btn-location,
  :-webkit-full-screen .btn-location,
  body.is-app-fullscreen .btn-location {
    max-width: 100%;
    min-height: 30px;
    padding: 4px 7px;
    gap: 3px;
    font-size: 0.78rem;
  }

  :fullscreen .btn-location svg:first-of-type,
  :-webkit-full-screen .btn-location svg:first-of-type,
  body.is-app-fullscreen .btn-location svg:first-of-type {
    width: 12px;
    height: 12px;
  }

  :fullscreen .btn-location svg:last-of-type,
  :-webkit-full-screen .btn-location svg:last-of-type,
  body.is-app-fullscreen .btn-location svg:last-of-type {
    width: 10px;
    height: 10px;
  }

  :fullscreen .map-frame.is-fullscreen .map-header,
  :-webkit-full-screen .map-frame.is-fullscreen .map-header,
  body.is-app-fullscreen .map-frame.is-fullscreen .map-header {
    padding-top: max(env(safe-area-inset-top, 0px), 34px);
  }
}

@media (max-width: 960px) and (display-mode: fullscreen) {
  .topbar {
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  .topbar-inner {
    min-height: 38px;
    gap: 10px;
  }

  .brand-wordmark {
    max-width: 40%;
    font-size: 0.94rem;
    gap: 6px;
    overflow: hidden;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
  }

  .topbar-action {
    max-width: 44%;
    gap: 0;
  }

  #gps-locate-btn {
    display: none;
  }

  .btn-hero-gps {
    display: inline-flex;
  }

  .btn-location {
    max-width: 100%;
    min-height: 30px;
    padding: 4px 7px;
    gap: 3px;
    font-size: 0.78rem;
  }

  .btn-location svg:first-of-type {
    width: 12px;
    height: 12px;
  }

  .btn-location svg:last-of-type {
    width: 10px;
    height: 10px;
  }

  .map-frame.is-fullscreen .map-header {
    padding-top: max(env(safe-area-inset-top, 0px), 34px);
  }
}

@media (max-width: 400px) {
  .hero-meta-row {
    padding: 7px 8px;
    gap: 4px;
  }

  .meta-line {
    font-size: 0.76rem;
    gap: 4px;
  }

  .btn-meta-icon {
    width: 30px;
    height: 30px;
  }

  .hero-meta-controls {
    gap: 4px;
  }

  .btn-theme-subtle {
    min-height: 36px;
    padding: 6px 6.5px;
    gap: 3px;
    font-size: 0.76rem;
  }

  .btn-theme-subtle svg {
    width: 12px;
    height: 12px;
  }
}

body.is-page-hidden svg *,
body.is-page-hidden .weather-sun-spin,
body.is-page-hidden .weather-cloud-drift,
body.is-page-hidden .weather-drop,
body.is-page-hidden .live-status-dot.is-live::after,
body.is-page-hidden .install-banner-cta,
body.is-page-hidden .install-banner-cta::after,
body.is-page-hidden .btn-install-subtle,
body.is-page-hidden .announcement-track {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
