:root {
  color-scheme: dark;
  --bg: #071017;
  --bg-deep: rgba(6, 10, 14, 0.94);
  --panel: rgba(10, 16, 22, 0.9);
  --panel-strong: rgba(8, 13, 19, 0.96);
  --line: rgba(169, 199, 220, 0.15);
  --line-strong: rgba(169, 199, 220, 0.28);
  --text: #edf5fb;
  --text-dim: rgba(237, 245, 251, 0.72);
  --text-faint: rgba(237, 245, 251, 0.46);
  --teal: #7fe6ff;
  --lime: #95ffb4;
  --amber: #ffc97a;
  --orange: #ff9a55;
  --red: #ff6978;
  --blue: #67a6ff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  --left-panel-span: 388px;
  --right-panel-span: 388px;
  --topbar-span: 124px;
  --ticker-span: 116px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 14%, rgba(103, 166, 255, 0.08), transparent 22%),
    radial-gradient(circle at 80% 12%, rgba(127, 230, 255, 0.1), transparent 22%),
    linear-gradient(180deg, #081018, #050a10 64%, #04070b),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.map-ambient,
.map-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.map-ambient {
  filter: blur(120px);
  opacity: 0.42;
}

.map-ambient--north {
  background:
    radial-gradient(circle at 22% 16%, rgba(103, 166, 255, 0.18), transparent 22%),
    radial-gradient(circle at 68% 18%, rgba(127, 230, 255, 0.1), transparent 16%);
}

.map-ambient--sea {
  background:
    radial-gradient(circle at 18% 82%, rgba(149, 255, 180, 0.08), transparent 18%),
    radial-gradient(circle at 74% 80%, rgba(255, 201, 122, 0.06), transparent 16%);
}

.map-grid {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black, transparent 94%);
  opacity: 0.2;
}

.cumbria-shell {
  position: relative;
  height: 100vh;
  isolation: isolate;
  --left-panel-current: var(--left-panel-span);
  --right-panel-current: var(--right-panel-span);
}

.map-canvas {
  position: absolute;
  top: calc(var(--topbar-span) + 22px);
  right: calc(var(--right-panel-current) + 14px);
  bottom: calc(var(--ticker-span) + 16px);
  left: calc(var(--left-panel-current) + 14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015), var(--shadow);
  transition:
    top 180ms ease,
    right 180ms ease,
    bottom 180ms ease,
    left 180ms ease;
}

.cumbria-shell.is-left-collapsed {
  --left-panel-current: 58px;
}

.cumbria-shell.is-right-collapsed {
  --right-panel-current: 58px;
}

.maplibregl-ctrl-group {
  border: 1px solid var(--line);
  background: rgba(7, 12, 18, 0.88);
  box-shadow: var(--shadow);
}

.maplibregl-ctrl button {
  background-color: transparent;
}

.maplibregl-ctrl button .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.25);
}

.maplibregl-popup-content {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 16, 22, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-right .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-top-color: rgba(10, 16, 22, 0.94);
  border-bottom-color: rgba(10, 16, 22, 0.94);
}

.panel-shell {
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    var(--shadow);
  backdrop-filter: blur(16px);
}

.map-topbar,
.control-rail,
.details-drawer,
.ticker-rail,
.panel-dock {
  position: absolute;
  z-index: 2;
}

.map-topbar {
  top: 14px;
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(560px, 1.2fr) 340px;
  gap: 14px;
  align-items: start;
  padding: 14px;
  z-index: 4;
}

.brand-block,
.topbar-controls,
.control-rail,
.details-drawer,
.ticker-rail,
.rail-head,
.control-section,
.section-head,
.score-card,
.provider-list,
.summary-grid {
  display: grid;
}

.brand-block,
.control-rail,
.details-drawer {
  gap: 12px;
}

.eyebrow,
.section-kicker,
.status-pill,
.status-chip,
.ticker-pill,
.toolbar-button,
.toggle-row,
.rail-button,
.search-field,
.view-field,
.replay-chip,
.provider-item,
.detail-row,
.detail-table dt,
.summary-item span,
.score-card span {
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl,
dt,
dd {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3.4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  font-size: 1.18rem;
  line-height: 1.1;
}

h3 {
  font-size: 1rem;
  line-height: 1.15;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.topbar-controls {
  grid-template-columns: minmax(180px, 1fr) auto minmax(170px, 220px) auto auto;
  gap: 10px;
  align-items: end;
}

.search-field,
.view-field {
  gap: 6px;
  color: var(--text-dim);
}

.search-field span,
.view-field span {
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.search-field input,
.view-field select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 9, 13, 0.82);
  color: var(--text);
  outline: none;
}

.search-field input:focus,
.view-field select:focus {
  border-color: var(--line-strong);
}

.status-chip,
.status-pill,
.replay-chip,
.ticker-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 11, 16, 0.88);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.status-chip,
.status-pill {
  color: var(--teal);
}

.status-pill--muted {
  color: var(--text-dim);
}

.replay-controls {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 8px;
  align-items: center;
}

.toolbar-button,
.rail-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(5, 9, 13, 0.9);
  color: var(--text);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.toolbar-button--compact {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.62rem;
}

.toolbar-button:hover,
.toolbar-button:focus-visible,
.rail-button:hover,
.rail-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  outline: none;
}

.toolbar-button--accent,
.rail-button.is-active {
  background:
    linear-gradient(180deg, rgba(103, 166, 255, 0.22), rgba(103, 166, 255, 0.06)),
    rgba(8, 14, 20, 0.96);
}

.toolbar-button--ghost {
  background: rgba(5, 9, 13, 0.5);
}

.topbar-network.site-network {
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(6, 11, 17, 0.74);
}

.topbar-network .site-network__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.topbar-network .site-network__link {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.64rem;
}

.panel-dock {
  top: calc(var(--topbar-span) + 18px);
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.panel-dock--left {
  left: 14px;
}

.panel-dock--right {
  right: 14px;
}

.cumbria-shell.is-left-collapsed .panel-dock--left,
.cumbria-shell.is-right-collapsed .panel-dock--right {
  opacity: 1;
  pointer-events: auto;
}

.control-rail {
  top: 120px;
  left: 14px;
  bottom: calc(var(--ticker-span) + 14px);
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  overflow: auto;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    bottom 180ms ease;
}

.details-drawer {
  top: 120px;
  right: 14px;
  bottom: calc(var(--ticker-span) + 14px);
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  overflow: auto;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    bottom 180ms ease;
}

.cumbria-shell.is-left-collapsed .control-rail {
  transform: translateX(calc(-100% - 18px));
  opacity: 0.18;
  pointer-events: none;
}

.cumbria-shell.is-right-collapsed .details-drawer {
  transform: translateX(calc(100% + 18px));
  opacity: 0.18;
  pointer-events: none;
}

.ticker-rail {
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  z-index: 4;
}

.ticker-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ticker-track {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.ticker-card {
  min-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 11, 16, 0.82);
  display: grid;
  gap: 6px;
}

.ticker-card strong {
  font-size: 0.88rem;
  line-height: 1.2;
}

.ticker-card span {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
}

.rail-head,
.section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.rail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-section {
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(5, 10, 14, 0.56);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toggle-list {
  display: grid;
  gap: 8px;
}

.toggle-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.score-card {
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(3, 8, 12, 0.7);
}

.score-card strong {
  font-size: 1.6rem;
  line-height: 1;
}

.score-card p {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.5;
}

.score-card--hf strong {
  color: var(--amber);
}

.score-card--vhf strong {
  color: var(--lime);
}

.radio-context {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.55;
}

.band-grid {
  display: grid;
  gap: 8px;
}

.band-card {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.band-card strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.band-card span,
.band-card small {
  color: var(--text-dim);
}

.band-card span {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.band-card small {
  font-size: 0.76rem;
  line-height: 1.5;
}

.summary-grid {
  gap: 8px;
}

.summary-item,
.provider-item {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.summary-item strong,
.provider-item strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.summary-item span,
.provider-item span {
  color: var(--text-faint);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.summary-item small,
.provider-item small {
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.45;
}

.provider-item[data-state="ok"] strong {
  color: var(--lime);
}

.provider-item[data-state="warn"] strong {
  color: var(--amber);
}

.provider-item[data-state="down"] strong {
  color: var(--red);
}

.details-meta {
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.6;
}

.details-body {
  display: grid;
  gap: 12px;
}

.detail-empty,
.detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(5, 10, 14, 0.56);
}

.detail-empty p,
.detail-card p {
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.6;
}

.detail-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.detail-row dt {
  color: var(--text-faint);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.detail-row dd {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.55;
}

.marker-popup {
  display: grid;
  gap: 4px;
}

.marker-popup strong {
  font-size: 0.9rem;
}

.marker-popup span {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.layer-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layer-chip {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 1420px) {
  .map-topbar {
    grid-template-columns: 1fr;
  }

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

  .topbar-network .site-network__links {
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .cumbria-shell {
    min-height: 100vh;
    height: auto;
    padding-bottom: 12px;
    --left-panel-current: 0px;
    --right-panel-current: 0px;
  }

  .map-canvas {
    position: relative;
    height: 56vh;
    min-height: 360px;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
  }

  .map-topbar,
  .control-rail,
  .details-drawer,
  .ticker-rail,
  .panel-dock {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    margin: 12px;
  }

  .control-rail,
  .details-drawer {
    max-height: none;
    overflow: visible;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .ticker-rail {
    grid-template-columns: 1fr;
  }

  .panel-dock {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar-controls {
    grid-template-columns: 1fr 1fr;
  }

  .replay-controls {
    grid-column: 1 / -1;
    justify-content: start;
  }

  .score-grid,
  .preset-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .map-topbar,
  .control-rail,
  .details-drawer,
  .ticker-rail {
    margin: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .topbar-controls {
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ticker-card {
    min-width: 220px;
  }
}
