:root {
  --bg: #07141f;
  --panel: rgba(13, 27, 42, 0.88);
  --panel-2: rgba(18, 38, 59, 0.92);
  --line: rgba(139, 190, 255, 0.22);
  --text: #e8f1fb;
  --muted: #95abc5;
  --accent: #7bdff6;
  --accent-2: #ffd166;
  --danger: #ff6b6b;
  --success: #5dd39e;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(123, 223, 246, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.15), transparent 28%),
    linear-gradient(180deg, #081019 0%, #03090f 100%);
}

.app-shell {
  width: min(1600px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.hero,
.controls,
.panel-card,
.drawer {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  padding: 22px;
  border-radius: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
}

.lede {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.55;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-stats div,
.timeline-readout {
  padding: 14px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.hero-stats strong,
.timeline-readout strong {
  display: block;
  font-size: 28px;
}

.hero-stats span,
.timeline-readout span {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
}

.controls label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.controls span {
  color: var(--muted);
}

.controls input,
.controls select,
.controls button,
.controls a {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(139, 190, 255, 0.24);
  background: rgba(5, 12, 20, 0.8);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.controls button,
.controls a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.controls button {
  background: linear-gradient(135deg, #1763a3 0%, #15324a 100%);
}

.controls a {
  background: linear-gradient(135deg, #444f62 0%, #1f2834 100%);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.95fr);
  gap: 16px;
  margin-top: 16px;
}

.map-panel {
  position: relative;
  min-height: 72vh;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
}

#map {
  position: absolute;
  inset: 0;
}

.map-caveat {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(3, 8, 14, 0.82);
  color: var(--muted);
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.side-panel {
  display: grid;
  gap: 16px;
}

.panel-card {
  border-radius: 18px;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-header button,
.report-actions button {
  background: rgba(17, 34, 51, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.panel-subhead button {
  background: rgba(17, 34, 51, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.incident-list {
  display: grid;
  gap: 10px;
  max-height: 42vh;
  overflow: auto;
}

.incident-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.incident-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.incident-meta,
.incident-source {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.incident-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.incident-badges span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(123, 223, 246, 0.14);
  font-size: 11px;
}

.aircraft-list {
  max-height: 34vh;
}

.aircraft-item {
  background:
    linear-gradient(180deg, rgba(6, 12, 22, 0.9) 0%, rgba(8, 19, 34, 0.8) 100%);
}

.aircraft-marker {
  background: transparent;
  border: 0;
}

.aircraft-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(123, 223, 246, 0.45);
  font-size: 18px;
  line-height: 1;
}

.aircraft-icon span {
  display: block;
}

.aircraft-icon-grounded {
  color: var(--accent-2);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.report-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.report-output {
  max-height: 42vh;
  overflow: auto;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.drawer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(520px, calc(100vw - 36px));
  max-height: min(72vh, 760px);
  border-radius: 18px;
  padding: 18px;
  z-index: 9000;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.drawer-content {
  overflow: auto;
  max-height: calc(72vh - 90px);
  color: var(--muted);
  line-height: 1.55;
}

.drawer-content strong {
  color: var(--text);
}

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

.drawer-grid div {
  padding: 10px;
  border-radius: 12px;
  background: rgba(5, 10, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
  .hero,
  .main-grid,
  .controls {
    grid-template-columns: 1fr;
  }

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