:root {
  --weather-bg: #07111d;
  --weather-panel: rgba(8, 20, 34, 0.76);
  --weather-panel-strong: rgba(12, 28, 44, 0.9);
  --weather-border: rgba(196, 223, 255, 0.18);
  --weather-text: #f3f8ff;
  --weather-muted: rgba(220, 233, 248, 0.72);
  --weather-accent: #72d4ff;
  --weather-accent-strong: #12b9ff;
  --weather-shadow: 0 26px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(18, 185, 255, 0.16), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(94, 231, 178, 0.14), transparent 24%),
    linear-gradient(160deg, #04101b 0%, #081724 52%, #0a1621 100%);
  color: var(--weather-text);
  font-family: "Avenir Next", "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

a,
button,
input {
  font: inherit;
}

.weather-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 20px auto 32px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 22px;
  border: 1px solid var(--weather-border);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(115, 168, 214, 0.08));
  box-shadow: var(--weather-shadow);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  position: relative;
  z-index: 30;
  overflow: visible;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  opacity: 0.8;
  pointer-events: none;
}

.brand,
.top-nav,
.top-nav-menu,
.site-header > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
  background: rgba(255, 255, 255, 0.1);
  object-fit: contain;
  object-position: center;
  padding: 4px;
}

.brand-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-title strong {
  font-size: 1.04rem;
  letter-spacing: 0.02em;
}

.brand-title span {
  font-size: 0.82rem;
  color: var(--weather-muted);
}

.top-nav {
  display: flex;
  align-items: center;
  position: relative;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--weather-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible,
.nav-link:hover,
.nav-link:focus-visible,
.nav-button:hover,
.nav-button:focus-visible,
.tools-menu a:hover,
.tools-menu a:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(114, 212, 255, 0.42);
  background: rgba(114, 212, 255, 0.16);
  outline: none;
}

.nav-toggle-lines {
  display: grid;
  gap: 4px;
}

.nav-toggle-lines span {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: rgba(243, 248, 255, 0.92);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.top-nav.is-open .nav-toggle-lines span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.top-nav.is-open .nav-toggle-lines span:nth-child(2) {
  opacity: 0;
}

.top-nav.is-open .nav-toggle-lines span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.top-nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 272px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(160deg, rgba(8, 18, 31, 0.95), rgba(14, 32, 52, 0.9));
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: grid;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-nav.is-open .top-nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-link,
.nav-button,
.tools-menu a,
.ghost-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--weather-text);
  cursor: pointer;
  text-decoration: none;
  padding: 0 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.72;
  margin-left: 10px;
  flex: 0 0 auto;
}

.nav-link[aria-current="page"] {
  border-color: rgba(114, 212, 255, 0.36);
  background: rgba(114, 212, 255, 0.18);
}

.nav-tools {
  position: relative;
}

.tools-menu {
  position: absolute;
  top: 0;
  right: calc(100% + 10px);
  min-width: 196px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(160deg, rgba(8, 18, 31, 0.96), rgba(14, 32, 52, 0.92));
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.34);
  display: grid;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-tools:hover .tools-menu,
.nav-tools:focus-within .tools-menu,
.nav-tools.is-open .tools-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-tools.is-open .nav-button {
  border-color: rgba(114, 212, 255, 0.42);
  background: rgba(114, 212, 255, 0.16);
}

.nav-disabled {
  opacity: 0.78;
  cursor: not-allowed;
  color: rgba(243, 248, 255, 0.76);
}

.nav-disabled small {
  color: rgba(220, 233, 248, 0.52);
}

.weather-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-top: 18px;
}

.hero-copy,
.hero-status,
.map-card,
.panel-card {
  border: 1px solid var(--weather-border);
  background: linear-gradient(170deg, rgba(11, 26, 43, 0.82), rgba(7, 17, 30, 0.74));
  box-shadow: var(--weather-shadow);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.hero-copy {
  padding: 26px 28px;
  border-radius: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(114, 212, 255, 0.84);
}

.hero-copy h1 {
  margin: 12px 0 10px;
  font-size: clamp(1.9rem, 3vw, 3.1rem);
  line-height: 1.02;
}

.hero-copy p {
  margin: 0;
  max-width: 60ch;
  color: var(--weather-muted);
  line-height: 1.6;
}

.hero-status {
  border-radius: 28px;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.status-pill,
.panel-head span,
#overview-badge,
#point-badge,
#runtime-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(114, 212, 255, 0.14);
  border: 1px solid rgba(114, 212, 255, 0.22);
  color: #dff6ff;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.status-pill[data-state="loading"] {
  background: rgba(243, 196, 74, 0.16);
  border-color: rgba(243, 196, 74, 0.26);
  color: #fff1c4;
}

.status-pill[data-state="live"] {
  background: rgba(84, 233, 172, 0.16);
  border-color: rgba(84, 233, 172, 0.24);
  color: #dcfff1;
}

.status-pill[data-state="idle"] {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.22);
  color: #eef2f7;
}

.status-pill[data-state="error"] {
  background: rgba(226, 103, 50, 0.18);
  border-color: rgba(226, 103, 50, 0.28);
  color: #ffe3d5;
}

.status-copy {
  display: grid;
  gap: 6px;
}

.status-copy strong {
  font-size: 1.08rem;
}

.status-copy span {
  color: var(--weather-muted);
  line-height: 1.5;
}

.weather-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.weather-main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.map-card {
  border-radius: 30px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.map-toolbar,
.timeline-bar,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-toolbar {
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.layer-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--weather-text);
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.layer-chip.is-active {
  border-color: rgba(114, 212, 255, 0.38);
  background: rgba(114, 212, 255, 0.18);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.ghost-button {
  width: auto;
  min-width: 124px;
  padding: 0 16px;
  justify-content: center;
}

.timeline-bar {
  margin-bottom: 14px;
  align-items: stretch;
}

#timeline-slider {
  flex: 1 1 auto;
  accent-color: var(--weather-accent-strong);
}

.timeline-meta {
  min-width: 196px;
  display: grid;
  gap: 4px;
  justify-items: end;
}

.timeline-meta strong {
  font-size: 0.95rem;
}

.timeline-meta span {
  color: var(--weather-muted);
  font-size: 0.85rem;
  text-align: right;
}

.weather-map {
  position: relative;
  width: 100%;
  min-height: 680px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.leaflet-container {
  background:
    radial-gradient(circle at 18% 16%, rgba(114, 212, 255, 0.14), transparent 26%),
    radial-gradient(circle at 88% 28%, rgba(84, 233, 172, 0.1), transparent 18%),
    linear-gradient(180deg, #071421 0%, #0b1f31 58%, #08141f 100%);
  font-family: inherit;
}

.weather-field-overlay {
  pointer-events: none;
}

.weather-field-overlay.is-idle {
  opacity: 0.35;
}

.map-overlay {
  position: absolute;
  z-index: 450;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 17, 30, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.legend-card {
  left: 18px;
  bottom: 18px;
  width: min(280px, calc(100% - 36px));
}

.map-note {
  right: 18px;
  top: 18px;
  display: grid;
  gap: 6px;
  width: min(280px, calc(100% - 36px));
}

.map-note strong {
  font-size: 0.9rem;
}

.map-note span,
.legend-head span,
.legend-scale span,
.stack-item span,
.data-card span,
.metric-card span,
.point-card span,
.point-address span {
  color: var(--weather-muted);
}

.legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.legend-ramp {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #334155 0%, #94a3b8 100%);
  overflow: hidden;
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.78rem;
}

.weather-panel {
  display: grid;
  gap: 18px;
}

.panel-card {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.runtime-card .stack-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-head strong {
  font-size: 1rem;
}

.data-grid,
.metric-grid,
.point-layer-grid {
  display: grid;
  gap: 10px;
}

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

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

.data-card,
.metric-card,
.point-card,
.stack-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 6px;
}

.data-card strong,
.metric-card strong,
.point-card strong,
.stack-item strong {
  font-size: 1rem;
}

.data-card span,
.metric-card span,
.point-card span,
.stack-item span {
  font-size: 0.84rem;
  line-height: 1.45;
}

.point-address {
  display: grid;
  gap: 4px;
  padding: 14px 0 4px;
}

.point-address strong {
  font-size: 0.98rem;
  line-height: 1.45;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.leaflet-control-attribution {
  border-radius: 10px 0 0 0;
  background: rgba(7, 17, 30, 0.72) !important;
  color: rgba(220, 233, 248, 0.72) !important;
  font-size: 11px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.leaflet-control-attribution a {
  color: rgba(114, 212, 255, 0.92) !important;
}

.city-label {
  background: transparent;
  border: none;
}

.city-label span {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 17, 30, 0.72);
  color: rgba(240, 248, 255, 0.82);
  font-size: 11px;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  white-space: nowrap;
}

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

  .weather-map {
    min-height: 560px;
  }

  .runtime-card .stack-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .weather-shell {
    width: min(100vw - 20px, 100%);
    margin: 10px auto 24px;
  }

  .site-header,
  .hero-copy,
  .hero-status,
  .map-card,
  .panel-card {
    border-radius: 22px;
  }

  .top-nav-menu {
    min-width: min(280px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  .tools-menu {
    right: 0;
    top: calc(100% + 8px);
    min-width: min(216px, calc(100vw - 52px));
  }

  .timeline-bar {
    flex-direction: column;
  }

  .timeline-meta {
    justify-items: start;
    min-width: 0;
  }

  .map-toolbar,
  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions {
    flex-direction: column;
  }

  .ghost-button {
    width: 100%;
  }

  .data-grid,
  .metric-grid,
  .point-layer-grid,
  .runtime-card .stack-list {
    grid-template-columns: 1fr;
  }

  .weather-map {
    min-height: 480px;
  }

  .legend-card,
  .map-note {
    width: calc(100% - 24px);
    left: 12px;
    right: 12px;
  }

  .map-note {
    top: 12px;
  }

  .legend-card {
    bottom: 12px;
  }
}
