:root {
  --bg: #12150f;
  --panel: #181c14;
  --ink: #efece2;
  --muted: #b4b2a4;
  --faint: #8d8b7c;
  --line: rgba(239, 236, 226, 0.12);
  --open: #b6d48a;
  --open-deep: #6f9a45;
  --priority: #e4b15a;
  --congested: #e07a4c;
  --radio: #8ebfd4;
  --highland: #c9c3ae;
  --down: #8ebfd4;
  --up: #e4b15a;
  --gw: #d39aab;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Figtree", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 400;
}

button, input { font: inherit; color: inherit; }

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

.app {
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  height: 100%;
}

.panel {
  overflow: auto;
  padding: 28px 26px 36px;
  background:
    radial-gradient(1200px 400px at 0% -10%, rgba(228, 177, 90, 0.08), transparent 50%),
    var(--panel);
  border-right: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--priority);
}

h1 {
  margin: 0;
  font-family: "Newsreader", "Iowan Old Style", Palatino, serif;
  font-weight: 640;
  font-size: 40px;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.lede {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.live {
  margin-top: 22px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #10140c;
}

.live-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.live-head h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--open);
  box-shadow: 0 0 0 0 rgba(182, 212, 138, 0.7);
  animation: pulse 1.8s ease-out infinite;
  vertical-align: 1px;
}

.live.is-down .live-head h2::before { background: var(--congested); animation: none; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(182, 212, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(182, 212, 138, 0); }
}

.live-stat, .live-official {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}

.live-stat strong, .live-official strong { color: var(--ink); font-weight: 650; }

.block { margin-top: 22px; }

.sat-tip { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; }

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.asof {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--faint);
}

.spectrum {
  position: relative;
  height: 54px;
  margin-top: 12px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    90deg,
    rgba(239, 236, 226, 0.04) 0 1px,
    transparent 1px 10%
  );
  background-color: #10140c;
  border: 1px solid var(--line);
}

.band {
  position: absolute;
  top: 8px;
  height: 22px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  min-width: 4px;
}

.band.is-on { outline: 2px solid var(--ink); outline-offset: 2px; }

.band.user-down { background: var(--down); }
.band.user-up { background: var(--up); }
.band.gateway { background: var(--gw); }

.band-note {
  min-height: 4.6em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 18px;
  padding: 4px;
  border-radius: 999px;
  background: #10140c;
  border: 1px solid var(--line);
}

.mode {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
}

.mode.is-on {
  background: var(--ink);
  color: #1a1d14;
  font-weight: 650;
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}

.legend li { display: flex; align-items: center; gap: 7px; }

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 99px;
}

.swatch.open { background: var(--open); }
.swatch.priority { background: var(--priority); }
.swatch.congested { background: var(--congested); }
.swatch.radio { background: var(--radio); }
.swatch.highland { background: transparent; border: 1.5px dashed var(--highland); }
.swatch.pass { background: #f4f1e6; box-shadow: 0 0 0 3px rgba(244, 241, 230, 0.18); }

.search { display: block; margin-top: 16px; }

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: #10140c;
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
}

.search input:focus { border-color: rgba(228, 177, 90, 0.7); }

.results {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10140c;
}

.results button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.results button:hover,
.results button:focus { background: rgba(239, 236, 226, 0.06); }

.results small { color: var(--faint); }

.detail {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.kicker {
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.detail h3 {
  margin: 6px 0 0;
  font-family: "Newsreader", Palatino, serif;
  font-size: 32px;
  font-weight: 640;
  letter-spacing: -0.03em;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.open { background: rgba(182, 212, 138, 0.16); color: var(--open); }
.badge.priority { background: rgba(228, 177, 90, 0.16); color: var(--priority); }
.badge.congested { background: rgba(224, 122, 76, 0.16); color: var(--congested); }
.badge.radio { background: rgba(142, 191, 212, 0.16); color: var(--radio); }
.badge.outside { background: rgba(239, 236, 226, 0.08); color: var(--muted); }

.prose {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.prose strong { color: var(--ink); font-weight: 650; }

table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

th, td {
  text-align: right;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

th:first-child, td:first-child { text-align: left; color: var(--muted); }

th {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.sources {
  margin-top: 22px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
}

.sources p { margin: 0 0 8px; }

.sources a { color: var(--priority); }

.map-wrap { position: relative; min-height: 320px; }

#map { height: 100%; background: #0c0f0a; }

.map-tools {
  position: absolute;
  z-index: 500;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}

.map-tools button {
  border: 1px solid rgba(239, 236, 226, 0.2);
  background: rgba(18, 21, 15, 0.88);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.map-tools button:hover { border-color: var(--priority); }

.map-caption {
  position: absolute;
  z-index: 500;
  left: 14px;
  bottom: 14px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 21, 15, 0.88);
  border: 1px solid rgba(239, 236, 226, 0.16);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

.leaflet-container { font-family: "Figtree", sans-serif; background: #0c0f0a; }

.leaflet-control-attribution {
  background: rgba(18, 21, 15, 0.8) !important;
  color: var(--faint) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a { color: var(--muted) !important; }

.city-pin {
  background: transparent;
  border: 0;
}

.city-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 99px;
  border: 2px solid #12150f;
  box-shadow: 0 0 0 1px rgba(239, 236, 226, 0.45);
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(62vh, 1fr); height: auto; min-height: 100%; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  h1 { font-size: 34px; }
  #map { min-height: 62vh; }
}
