:root {
  --bg: #050a12;
  --bg-soft: #0b1320;
  --panel: rgba(9, 19, 32, 0.92);
  --panel-strong: rgba(12, 24, 41, 0.98);
  --edge: rgba(101, 142, 184, 0.24);
  --edge-strong: rgba(120, 173, 214, 0.42);
  --text: #ecf3ff;
  --muted: #91a5be;
  --soft: #c7d3e1;
  --accent: #59d3ff;
  --accent-strong: #1f9fd6;
  --arrival: #73d6ff;
  --departure: #ffb66b;
  --watch: #c6f36f;
  --warning: #ffd36b;
  --danger: #ff8f8f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --mono: "IBM Plex Mono", "SFMono-Regular", "Menlo", monospace;
  --sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(33, 85, 145, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(19, 154, 197, 0.16), transparent 26%),
    linear-gradient(180deg, #07111d 0%, #050a12 100%);
  color: var(--text);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.airmon-shell {
  width: min(1980px, calc(100vw - 20px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 10px 0 20px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 18px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(13, 25, 42, 0.92), rgba(8, 15, 26, 0.88));
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.brand-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand-title strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.top-nav {
  position: relative;
  z-index: 70;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-lines {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-label {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle-lines span {
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.top-nav-menu {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100vh - 36px);
  padding: 18px;
  border: 1px solid var(--edge);
  border-radius: 26px;
  background: rgba(8, 15, 26, 0.97);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.34);
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.nav-link,
.nav-button,
.tools-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--soft);
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link,
.nav-button {
  width: 100%;
  justify-content: flex-start;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-button:hover,
.nav-button:focus-visible,
.tools-menu a:hover,
.tools-menu a:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: var(--edge-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.nav-link[aria-current="page"] {
  border-color: rgba(89, 211, 255, 0.44);
  background: rgba(89, 211, 255, 0.12);
  color: #f2fbff;
}

.nav-tools {
  position: relative;
  width: 100%;
}

.nav-button {
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.tools-menu {
  position: static;
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: rgba(8, 16, 28, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: none;
  display: none;
}

.nav-tools.is-open .tools-menu {
  display: grid;
}

.tools-menu a {
  justify-content: flex-start;
  border-radius: 12px;
  min-height: 40px;
  padding-inline: 14px;
}

.airmon-main {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.airmon-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.hero-copy,
.hero-meta,
.airmon-disclaimer,
.tower-panel {
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(11, 20, 33, 0.94), rgba(7, 13, 22, 0.92));
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-meta {
  padding: 24px;
}

.hero-kicker,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(89, 211, 255, 0.28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(89, 211, 255, 0.08);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2rem, 3.2vw, 3.45rem);
  line-height: 1.02;
}

.hero-copy p {
  margin: 16px 0 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.68;
}

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

.status-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(118, 153, 186, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.status-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-card strong {
  font-size: 1.06rem;
}

.region-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.region-button {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  min-width: 168px;
  padding: 14px 16px;
  border: 1px solid rgba(113, 149, 185, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.region-button:hover,
.region-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(89, 211, 255, 0.36);
  background: rgba(89, 211, 255, 0.08);
}

.region-button.is-active {
  border-color: rgba(89, 211, 255, 0.46);
  background: linear-gradient(180deg, rgba(89, 211, 255, 0.16), rgba(38, 106, 136, 0.18));
  color: #f3fbff;
}

.region-button strong {
  font-size: 0.98rem;
}

.region-button span {
  color: var(--muted);
  font-size: 0.82rem;
}

.airmon-disclaimer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--warning);
  font-size: 0.92rem;
  line-height: 1.55;
}

.airmon-mobile-tabs {
  display: none;
}

.airmon-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(0, 2.45fr) minmax(320px, 0.94fr);
  gap: 18px;
  align-items: start;
}

.tower-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  min-height: auto;
}

.main-stack,
.side-panel,
.strip-panel,
.airport-panel {
  align-content: start;
}

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

.side-panel,
.airport-panel {
  position: sticky;
  top: 10px;
}

.panel-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin: 4px 0 0;
  font-size: 1.18rem;
}

.section-head strong {
  font-size: 0.96rem;
}

.section-head span,
.panel-pill,
.metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(111, 142, 173, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
}

.strip-section,
.airport-section,
.airport-focus,
.alert-panel,
.flight-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(112, 145, 178, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.strip-list,
.alert-list,
.runway-list,
.top-list {
  display: grid;
  gap: 10px;
}

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

.strip-section-watch {
  grid-column: 1 / -1;
}

.strip-button {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(105, 140, 175, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.strip-button:hover,
.strip-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(89, 211, 255, 0.3);
  background: rgba(89, 211, 255, 0.08);
}

.strip-button.is-active {
  border-color: rgba(89, 211, 255, 0.5);
  background: rgba(89, 211, 255, 0.12);
}

.strip-button.is-arrival {
  box-shadow: inset 3px 0 0 var(--arrival);
}

.strip-button.is-departure {
  box-shadow: inset 3px 0 0 var(--departure);
}

.strip-button.is-watch {
  box-shadow: inset 3px 0 0 var(--watch);
}

.strip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.strip-top strong {
  font-size: 1rem;
}

.strip-route,
.strip-meta,
.airport-copy,
.map-hint,
.detail-track,
.alert-item p,
.top-item span {
  color: var(--muted);
}

.map-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.map-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(89, 211, 255, 0.24);
  border-radius: 999px;
  background: rgba(89, 211, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.map-refresh-button:hover,
.map-refresh-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(89, 211, 255, 0.42);
  background: rgba(89, 211, 255, 0.16);
}

.map-refresh-button:disabled {
  opacity: 0.64;
  cursor: wait;
  transform: none;
}

.strip-route {
  font-size: 0.86rem;
}

.strip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.strip-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.map-panel {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.map-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.airmon-map {
  border: 1px solid rgba(110, 149, 188, 0.16);
  border-radius: 24px;
  min-height: clamp(640px, 76vh, 980px);
  height: clamp(640px, 76vh, 980px);
  background: #051018;
  overflow: hidden;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background: #07111d;
  font-family: var(--sans);
}

.airmon-airport-label {
  background: rgba(8, 14, 24, 0.94);
  border: 1px solid rgba(118, 162, 206, 0.24);
  border-radius: 999px;
  color: var(--text);
  padding: 2px 8px;
  box-shadow: none;
}

.airmon-airport-label::before {
  display: none;
}

.airmon-flight-icon-shell,
.airmon-flight-icon-shell.leaflet-div-icon {
  background: transparent;
  border: 0;
}

.flight-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(188, 220, 246, 0.24);
  border-radius: 999px;
  background: rgba(6, 18, 30, 0.9);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  color: #b0c4db;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.flight-marker.is-arrival {
  color: var(--arrival);
}

.flight-marker.is-departure {
  color: var(--departure);
}

.flight-marker.is-watch {
  color: var(--watch);
}

.flight-marker.is-selected {
  transform: scale(1.16);
  border-color: rgba(217, 248, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(89, 211, 255, 0.14), 0 16px 28px rgba(0, 0, 0, 0.34);
}

.flight-arrow {
  display: block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 12px solid currentColor;
  transform-origin: center 72%;
}

.flight-detail-card[hidden] {
  display: none;
}

.flight-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.flight-detail-head h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.detail-close {
  padding: 8px 12px;
  border: 1px solid rgba(116, 154, 192, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  cursor: pointer;
}

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

.detail-item,
.airport-metric,
.runway-item,
.alert-item,
.top-item {
  padding: 12px;
  border: 1px solid rgba(110, 147, 186, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.detail-item span,
.airport-metric span,
.runway-item span,
.top-item span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-item strong,
.airport-metric strong,
.runway-item strong,
.top-item strong {
  display: block;
  margin-top: 8px;
  font-size: 0.96rem;
}

.alert-item {
  display: grid;
  gap: 8px;
}

.alert-item.is-warning {
  border-color: rgba(255, 211, 107, 0.24);
}

.alert-item.is-info {
  border-color: rgba(89, 211, 255, 0.16);
}

.alert-item h3 {
  margin: 0;
  font-size: 0.95rem;
}

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

.airport-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(109, 145, 180, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  cursor: pointer;
}

.airport-chip:hover,
.airport-chip:focus-visible {
  outline: none;
  border-color: rgba(89, 211, 255, 0.3);
  background: rgba(89, 211, 255, 0.08);
}

.airport-chip.is-active {
  border-color: rgba(89, 211, 255, 0.46);
  background: rgba(89, 211, 255, 0.14);
  color: var(--text);
}

.airport-chip strong {
  font-size: 0.86rem;
}

.airport-chip span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

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

.runway-item strong {
  margin-bottom: 6px;
}

.runway-copy {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

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

.top-button {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.top-button:hover,
.top-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(89, 211, 255, 0.28);
  background: rgba(89, 211, 255, 0.08);
}

.empty-state {
  padding: 16px;
  border: 1px dashed rgba(111, 149, 188, 0.18);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .airmon-shell {
    width: calc(100vw - 18px);
  }

  .airmon-layout {
    grid-template-columns: minmax(220px, 0.78fr) minmax(0, 2.1fr) minmax(280px, 0.9fr);
  }

  .hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav-menu {
    top: 12px;
    right: 12px;
    width: min(360px, calc(100vw - 16px));
    max-height: calc(100vh - 24px);
  }

  .nav-toggle {
    width: auto;
  }

  .airmon-hero {
    grid-template-columns: 1fr;
  }

  .airmon-mobile-tabs {
    display: flex;
    gap: 10px;
  }

  .airmon-mobile-tabs button {
    flex: 1;
    min-height: 42px;
    border: 1px solid rgba(110, 145, 180, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--soft);
    cursor: pointer;
  }

  .airmon-mobile-tabs button.is-active {
    border-color: rgba(89, 211, 255, 0.46);
    background: rgba(89, 211, 255, 0.14);
    color: var(--text);
  }

  .airmon-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  body[data-mobile-view="map"] .traffic-panel,
  body[data-mobile-view="map"] .airport-panel,
  body[data-mobile-view="traffic"] .map-panel,
  body[data-mobile-view="traffic"] .airport-panel,
  body[data-mobile-view="airport"] .map-panel,
  body[data-mobile-view="airport"] .traffic-panel {
    display: none;
  }

  .tower-panel {
    min-height: auto;
  }

  .side-panel,
  .airport-panel {
    position: static;
  }

  .main-stack {
    order: 1;
  }

  .side-panel {
    order: 2;
  }

  .airport-panel {
    order: 3;
  }

  .airmon-map {
    min-height: 58vh;
    height: 58vh;
  }
}

@media (max-width: 640px) {
  .airmon-shell {
    width: calc(100% - 18px);
    padding-top: 10px;
  }

  .site-header,
  .hero-copy,
  .hero-meta,
  .airmon-disclaimer,
  .tower-panel {
    border-radius: 22px;
  }

  .site-header,
  .hero-copy,
  .hero-meta,
  .tower-panel {
    padding: 16px;
  }

  .hero-status-grid,
  .traffic-columns,
  .detail-grid,
  .airport-grid,
  .runway-list {
    grid-template-columns: 1fr;
  }

  .brand img {
    width: 46px;
    height: 46px;
  }

  .brand-title span {
    font-size: 0.8rem;
  }

  .hero-copy h1 {
    font-size: 1.78rem;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .nav-toggle {
    width: 100%;
    justify-content: center;
  }

  .nav-toggle-label {
    font-size: 0.8rem;
  }
}
