:root {
  color-scheme: light;
  --bg: #f2efe8;
  --panel: rgba(249, 246, 240, 0.96);
  --card: rgba(255, 255, 255, 0.7);
  --text: #22313a;
  --muted: #5b6a72;
  --border: rgba(34, 49, 58, 0.12);
  --shadow: 0 16px 40px rgba(61, 76, 85, 0.08);
  --accent: #123f52;
  --accent-soft: #dde8ec;
  --blocked: #ec6206;
  --blocked-fill: #ec6206;
  --increase: #ffa723;
  --decrease: #00457f;
  --neutral: #a6a39a;
  --unchanged: #edf5fa;
  --positive-soft: rgba(255, 167, 35, 0.14);
  --negative-soft: rgba(0, 69, 127, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 180, 124, 0.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(84, 124, 145, 0.16), transparent 24%),
    linear-gradient(180deg, #f7f4ee 0%, var(--bg) 100%);
}

body {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  min-height: 100vh;
}

.panel {
  padding: 14px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(14px);
  overflow-y: auto;
}

.map-shell {
  min-height: 100vh;
}

#map {
  width: 100%;
  min-height: 100vh;
}

.section-kicker,
.label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.logo {
  display: block !important;
  width: 90px !important;
  max-width: 90px !important;
  height: auto !important;
  margin: 0 0 10px !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.4rem;
  line-height: 1.1;
}

h2 {
  margin-top: 2px;
  font-size: 1.05rem;
}

h3 {
  font-size: 1rem;
}







.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 12px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.55);
}

.mode-button,
.timeline-row button,
.ghost-button,
select,
input {
  font: inherit;
}

.mode-button,
.timeline-row button,
.ghost-button {
  border: 1px solid transparent;
  border-radius: 0;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.mode-button.active,
.timeline-row button,
.ghost-button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--border);
  color: var(--text);
}

.stats,
.filters,
.summary-grid {
  display: grid;
  gap: 6px;
}

.stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.stat,
.summary-card,
.table-card,
.storm-activity-card {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat strong,
.summary-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.mode-panel {
  margin-top: 12px;
}

.hidden {
  display: none;
}

.section-header {
  margin-bottom: 7px;
}

.filters {
  margin-top: 7px;
}

.control {
  display: grid;
  gap: 8px;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

select:disabled,
input:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.control-head,
.timeline-row,
.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.timeline-row {
  margin-top: 5px;
}

.summary-card {
  margin-top: 9px;
}

.storm-activity-card {
  margin-top: 7px;
}

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

.summary-copy {
  margin-top: 7px;
  line-height: 1.55;
  font-size: 1rem;
  color: var(--text);
}

.compact .summary-copy {
  color: var(--muted);
}

.table-card {
  margin-top: 9px;
}

.storm-activity-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  height: 128px;
  margin-top: 7px;
  padding: 14px;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(237, 245, 250, 0.92));
  border: 1px solid rgba(34, 49, 58, 0.08);
}

.storm-bar {
  appearance: none;
  border: 0;
  width: 100%;
  min-height: 8px;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  background: linear-gradient(180deg, var(--increase) 0%, var(--blocked) 100%);
  box-shadow: 0 6px 18px rgba(236, 98, 6, 0.18);
  opacity: 0.58;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.storm-bar.is-peak,
.storm-bar:hover,
.storm-bar:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 69, 127, 0.22);
  outline: none;
}

.table-wrap {
  margin-top: 5px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 12px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.row-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 0;
  display: inline-block;
}

.dot.blocked {
  background: var(--blocked-fill);
  box-shadow: 0 0 0 2px var(--blocked);
}

.dot.increase {
  background: var(--increase);
}

.dot.decrease {
  background: var(--decrease);
}

.dot.unchanged {
  background: var(--neutral);
}

.value-positive {
  color: var(--increase);
}

.value-negative {
  color: var(--decrease);
}

.value-neutral {
  color: var(--muted);
}

.legend {
  display: grid;
  gap: 10px;
  margin-top: 25px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.62);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.status {
  margin-top: 21px;
  color: var(--muted);
  line-height: 1.45;
}

.microcopy {
  color: var(--muted);
  font-size: 0.85rem;
}

.leaflet-popup-content {
  margin: 12px 14px;
  line-height: 1.5;
}

.leaflet-interactive.site-marker {
  transform-box: fill-box;
  transform-origin: center;
}

.leaflet-interactive.site-marker.pulse-blocked {
  animation: blockedPulse 0.95s ease-in-out infinite;
}

.leaflet-interactive.site-marker.pulse-increase {
  animation: warmPulse 1.05s ease-in-out infinite;
}

.leaflet-interactive.site-marker.pulse-decrease {
  animation: coolPulse 1.25s ease-in-out infinite;
}

.leaflet-interactive.site-marker.pulse-unchanged {
  animation: neutralPulse 1.8s ease-in-out infinite;
}

@keyframes blockedPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 200, 0, 0.3));
  }
  50% {
    transform: scale(1.42);
    filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.48));
  }
}

@keyframes warmPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 119, 0, 0.28));
  }
  50% {
    transform: scale(1.32);
    filter: drop-shadow(0 0 7px rgba(255, 119, 0, 0.38));
  }
}

@keyframes coolPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(6, 70, 141, 0.26));
  }
  50% {
    transform: scale(1.24);
    filter: drop-shadow(0 0 8px rgba(6, 70, 141, 0.4));
  }
}

@keyframes neutralPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.96;
  }
}

@media (max-width: 1080px) {
  body {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  #map {
    min-height: 72vh;
  }
}

@media (max-width: 720px) {
  .panel {
    padding: 21px;
  }

  .stats,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .timeline-row,
  .table-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Site labels - shown on hover */
.leaflet-tooltip.site-label {
  background: rgba(255,255,255,0.85) !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  box-shadow: none !important;
  padding: 3px 6px !important;
  margin: 0 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #333 !important;
  white-space: nowrap !important;
  width: auto !important;
  max-width: 200px !important;
  pointer-events: none !important;
  text-align: center !important;
}
.leaflet-tooltip.site-label::before {
  display: none !important;
}

#map.storm-paused path { animation: none !important; }

/* Remove all pulse animations */
.site-marker { animation: none !important; }
