* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a1628;
  color: #e0e0e0;
  height: 100vh;
  display: flex;
}

/* ── Index page (map + sidebar) ───────────────────────────────────── */

#sidebar {
  width: 300px;
  padding: 0;
  background: #0f1f3d;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

#sidebar-footer {
  padding: 12px 16px;
  font-size: 0.72rem;
  color: #ffffff;
  text-align: center;
  line-height: 1.5;
}

#sidebar-footer a {
  color: #ffffff;
  text-decoration: none;
}

#sidebar-footer a:hover {
  text-decoration: underline;
}

#sidebar h1 {
  font-size: 1.4rem;
  color: #4fc3f7;
  margin-bottom: 4px;
}

#sidebar > p {
  font-size: 0.85rem;
  color: #90a4ae;
  padding: 0 16px;
  margin-bottom: 16px;
}

#site-list {
  padding: 0 16px 16px;
}

#site-list a {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #1a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}

#site-list a:hover {
  background: #264a7a;
}

#map {
  flex: 1;
  min-height: 100vh;
  position: relative;
}

/* Particle overlay canvas above MapLibre's WebGL canvas */
#particle-overlay {
  z-index: 1;
}

/* Station HTML markers */
.station-marker {
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #4fc3f7;
  border-radius: 50%;
  cursor: pointer;
}

.station-marker:hover {
  background: #4fc3f7;
}

.station-marker-label {
  color: #e0e0e0;
  font-size: 10px;
  text-shadow: 0 0 4px #0a1628, 0 0 2px #0a1628;
  white-space: nowrap;
  margin-top: 2px;
  pointer-events: none;
}

/* ── Site detail page ─────────────────────────────────────────────── */

#header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #1a2a4a;
}

#header a {
  color: #4fc3f7;
  text-decoration: none;
  font-size: 0.8rem;
}

#header h1 {
  font-size: 1.2rem;
  color: #4fc3f7;
  margin-top: 6px;
}

#header p {
  color: #90a4ae;
  font-size: 0.8rem;
  margin-top: 2px;
}

/* ── Time control ─────────────────────────────────────────────────── */

#time-control {
  padding: 12px 16px;
  border-bottom: 1px solid #1a2a4a;
}

#time-control label {
  font-size: 0.8rem;
  color: #90a4ae;
  display: block;
  margin-bottom: 6px;
}

#time-control strong {
  color: #4fc3f7;
  font-size: 0.95rem;
}

#time-slider {
  width: 100%;
  margin-bottom: 8px;
  accent-color: #4fc3f7;
}

#time-buttons {
  display: flex;
  gap: 8px;
}

#time-buttons button {
  background: #1a2a4a;
  color: #e0e0e0;
  border: 1px solid #264a7a;
  padding: 4px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

#time-buttons button:hover {
  background: #264a7a;
}

/* ── Layer control ────────────────────────────────────────────────── */

#layer-control {
  padding: 10px 16px;
  border-bottom: 1px solid #1a2a4a;
}

#layer-control h3 {
  font-size: 0.8rem;
  color: #90a4ae;
  margin-bottom: 6px;
}

#layer-control label {
  display: block;
  font-size: 0.8rem;
  padding: 3px 0;
  cursor: pointer;
  color: #ccc;
}

#layer-control input[type="checkbox"] {
  accent-color: #4fc3f7;
  margin-right: 6px;
}

/* ── Station list ─────────────────────────────────────────────────── */

#station-list h3,
#chart-panel h3 {
  font-size: 0.85rem;
  color: #90a4ae;
  padding: 10px 16px 4px;
}

#station-list a {
  display: block;
  padding: 6px 16px;
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.2s;
}

#station-list a:hover {
  background: #1a2a4a;
}

/* ── Charts ───────────────────────────────────────────────────────── */

#chart-panel {
  border-top: 1px solid #1a2a4a;
  margin-top: 8px;
  padding-top: 4px;
}

.chart-wrap {
  padding: 6px 16px;
  height: 140px;
}

/* ── Utility ──────────────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Brand logo overlay (top-center of each map) ──────────────────── */

#brand-overlay {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(10, 22, 40, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid #1a2a4a;
  border-radius: 22px;
  padding: 7px 18px;
  pointer-events: none;
}

#brand-logo {
  height: 44px;
  width: auto;
  display: block;
  opacity: 0.92;
}

/* ── On-map forecast timestamp ────────────────────────────────────── */

#frame-time {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  background: rgba(10, 22, 40, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid #1a2a4a;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #4fc3f7;
  pointer-events: none;
}

#frame-time small {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #7e93a8;
}

#frame-time small:last-child {
  text-transform: none;
  letter-spacing: 0.2px;
  margin-top: 1px;
  color: #5e7488;
}

/* ── Station time-series popup ────────────────────────────────────── */

#station-popup {
  position: absolute;
  z-index: 30;
  width: 340px;
  max-height: calc(100% - 24px);
  overflow: auto;
  background: rgba(10, 22, 40, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid #25406b;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  padding: 8px 10px 10px;
  /* top / left are set inline by site.js */
}

#station-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid #1a2a4a;
}

#station-popup-head #station-name {
  font-size: 13px;
  font-weight: 600;
  color: #4fc3f7;
}

#station-popup-close {
  background: transparent;
  border: none;
  color: #90a4ae;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}
#station-popup-close:hover { color: #fff; background: #1a2a4a; }

#station-popup .chart-wrap {
  padding: 4px 2px;
  height: 108px;
}

/* ── Map colorbar legend ──────────────────────────────────────────── */

#legend {
  position: absolute;
  left: 12px;
  bottom: 16px;
  z-index: 20;
  background: rgba(10, 22, 40, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid #1a2a4a;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 10px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* Hawaii's domain is wide and the bottom-left corner sits over coloured mesh,
   making the legend hard to spot. Move it to the empty, prominent top-right.
   Scoped to hawaii so the other sites keep the bottom-left placement.
   REVERT: delete this rule. */
body.site-hawaii #legend {
  top: 14px;
  right: 12px;
  left: auto;
  bottom: auto;
}

.legend-row + .legend-row { margin-top: 8px; }

.legend-title {
  margin-bottom: 3px;
  color: #ffffff;
}

.legend-bar {
  width: 180px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.legend-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: #ffffff;
}

/* ── Initial-load progress overlay ────────────────────────────────── */

#map-loader {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: none;     /* the map still receives interaction; only the card is opaque */
}

#map-loader-card {
  width: 320px;
  background: rgba(15, 31, 61, 0.96);
  border: 1px solid #264a7a;
  border-radius: 10px;
  padding: 18px 20px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

#map-loader-title {
  font-size: 13px;
  font-weight: 600;
  color: #4fc3f7;
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

#map-loader-bar {
  height: 8px;
  background: #0a1628;
  border: 1px solid #1a2a4a;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

#map-loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4fc3f7, #80d8ff);
  transition: width 0.18s ease-out;
}

#map-loader-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #b3c4d4;
  margin-bottom: 4px;
}

#map-loader-pct {
  color: #ffffff;
  font-weight: 600;
}

#map-loader-stage {
  font-size: 10px;
  color: #7e93a8;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ── SCHISM mesh hover tooltip ────────────────────────────────────── */

#mesh-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  background: rgba(10, 22, 40, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid #25406b;
  border-radius: 7px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  padding: 6px 9px;
  font-size: 11px;
  color: #e0e0e0;
  max-width: 220px;
}

#mesh-tooltip strong {
  display: block;
  color: #4fc3f7;
  font-size: 11px;
  font-weight: 600;
}

#mesh-tooltip .big {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 1px 0;
}

#mesh-tooltip .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #cfd8e3;
  margin: 2px 0;
}

#mesh-tooltip .row span {
  color: #90a4ae;
}

#mesh-tooltip .row b {
  color: #ffffff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#mesh-tooltip small {
  display: block;
  font-size: 9.5px;
  color: #7e93a8;
  margin-top: 2px;
}
