:root {
  --page: #0b1012;
  --panel: #11191d;
  --panel-2: #172126;
  --line: #314047;
  --text: #f3f6f1;
  --muted: #a7b2af;
  --accent: #d7decf;
  --warn: #e9c46a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--text);
}

body {
  min-height: 100svh;
}

.archive-map-app {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(128px, 20svh) auto;
  background: var(--page);
}

.map-shell {
  position: relative;
  min-height: 0;
}

.archive-map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: #0b1012;
}

.corridor-control {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  width: 276px;
  border: 1px solid rgba(49, 64, 71, 0.72);
  border-radius: 8px;
  background: rgba(17, 25, 29, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.corridor-toggle {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  height: 34px;
  color: var(--text);
  font: 900 12px/1 Inter, system-ui, sans-serif;
  white-space: nowrap;
}

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

.corridor-control select {
  height: 34px;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0e1518;
  color: var(--text);
  padding: 0 9px;
  font: 900 12px/1 Inter, system-ui, sans-serif;
}

.corridor-alt {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.corridor-alt span {
  color: var(--muted);
  font: 900 10px/1.1 Inter, system-ui, sans-serif;
  text-transform: uppercase;
}

.corridor-alt input {
  width: 100%;
  accent-color: var(--warn);
}

.corridor-gradient-toggle {
  grid-column: 1 / -1;
  height: 26px;
  border-top: 1px solid rgba(49, 64, 71, 0.72);
  padding-top: 8px;
}

.corridor-popup {
  min-width: 280px;
  max-width: 360px;
  color: #10130f;
  font: 800 11px/1.25 Inter, system-ui, sans-serif;
}

.corridor-popup strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.corridor-popup-list {
  display: grid;
  gap: 5px;
  max-height: 260px;
  overflow: auto;
}

.corridor-popup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid rgba(16, 19, 15, 0.16);
}

.corridor-popup-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corridor-popup-row small {
  display: block;
  margin-top: 2px;
  color: rgba(16, 19, 15, 0.68);
  font-size: 10px;
}

.corridor-popup-row button {
  height: 26px;
  border: 1px solid #10130f;
  border-radius: 5px;
  background: #10130f;
  color: #f2f6f2;
  font: 900 10px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.map-status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 500;
  width: min(420px, calc(100% - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(49, 64, 71, 0.75);
  border-radius: 8px;
  background: rgba(17, 25, 29, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.map-status strong,
.map-status span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-status strong {
  font-size: 13px;
}

.map-status span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.traffic-panel {
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.traffic-panel header {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
}

.traffic-panel h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: 0;
}

.traffic-panel header span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font: 800 13px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.traffic-panel select,
.timeline-panel select,
.timeline-panel button {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0e1518;
  color: var(--text);
  padding: 0 10px;
  font: 900 13px/1 Inter, system-ui, sans-serif;
}

.traffic-table-wrap {
  min-height: 0;
  overflow: auto;
}

.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.traffic-table th,
.traffic-table td {
  padding: 6px 7px;
  border-bottom: 1px solid rgba(49, 64, 71, 0.72);
  text-align: right;
  white-space: nowrap;
}

.traffic-table th:first-child,
.traffic-table td:first-child {
  width: 28px;
  text-align: center;
}

.traffic-table th:nth-child(2),
.traffic-table td:nth-child(2),
.traffic-table th:nth-child(3),
.traffic-table td:nth-child(3) {
  text-align: left;
}

.traffic-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #10181c;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.traffic-table tr {
  cursor: pointer;
}

.traffic-table tr:hover,
.traffic-table tr.is-selected {
  background: #d7decf;
  color: #10130f;
}

.timeline-panel {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.timeline-panel input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.timeline-panel label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.plane-marker {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #111510;
}

.kind-dot {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d7decf;
  color: #10130f;
  font-size: 12px;
  font-weight: 900;
}

.kind-dot.kind-helicopter {
  background: #3fb7c8;
}

.kind-dot.kind-passenger-heavy {
  background: #d7decf;
}

.kind-dot.kind-passenger-small {
  background: #cfe7ff;
}

.kind-dot.kind-cargo {
  background: #f4a261;
}

.kind-dot.kind-turboprop {
  background: #8ec07c;
}

.kind-dot.kind-business-jet {
  background: #b8a5ff;
}

.kind-dot.kind-light-prop {
  background: #9fd6ff;
}

.kind-dot.kind-ultralight {
  background: #e9c46a;
}

.kind-dot.kind-military {
  background: #e76f51;
}

.plane-marker svg {
  width: 41px;
  height: 41px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.plane-marker.is-selected svg {
  width: 53px;
  height: 53px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.85)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.plane-label {
  padding: 2px 5px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.88);
  color: #111510;
  font: 900 11px/1 Inter, system-ui, sans-serif;
}

@media (max-width: 820px) {
  .archive-map-app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(150px, 24svh) auto;
  }

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

  .traffic-panel header {
    grid-template-columns: minmax(0, 1fr) 150px;
    align-items: end;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .timeline-panel {
    grid-template-columns: 70px minmax(0, 1fr) 88px;
    gap: 8px;
    padding: 10px;
  }

  .corridor-control {
    top: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
  }

  .traffic-table th,
  .traffic-table td {
    padding: 6px 5px;
    font-size: 11px;
  }
}
