:root {
  --bg: #0d1726;
  --panel: #12203a;
  --panel-2: #182a49;
  --line: #24395f;
  --text: #e6edf7;
  --muted: #8ea3c4;
  --accent: #ffc83d;
  --accent-2: #4fc3f7;
  --bad: #ff7a7a;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
.bar {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1000;
}
.brand { font-weight: 700; font-size: 17px; color: var(--accent); margin-right: 8px; align-self: center; white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 2px; position: relative; flex: 1 1 150px; max-width: 240px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
input {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 10px; font: inherit; width: 100%; color-scheme: dark;
}
input:focus { outline: none; border-color: var(--accent); }
button {
  font: inherit; cursor: pointer; border-radius: var(--radius); padding: 7px 12px;
  background: var(--accent); color: #1a1300; border: 0; font-weight: 600;
}
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.ghost:hover { color: var(--text); border-color: var(--muted); }
.dropdown {
  position: absolute; top: 100%; left: 0; right: 0; min-width: 260px; margin: 4px 0 0; padding: 4px 0;
  list-style: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  max-height: 320px; overflow-y: auto; z-index: 2000; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.dropdown li { padding: 6px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.dropdown li.active, .dropdown li:hover { background: var(--line); }
.dropdown .code { font-weight: 700; color: var(--accent); min-width: 32px; }
.dropdown .sub { color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; }

main { flex: 1; display: flex; min-height: 0; }
#panel {
  width: 360px; flex: 0 0 360px; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line);
  padding: 14px 16px 24px;
}
#map { flex: 1; background: #0a1220; }
.loading, .muted { color: var(--muted); }
h2 { margin: 0 0 2px; font-size: 20px; }
h2 .code { color: var(--accent); }
h3 { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sub { color: var(--muted); }
.stats { display: flex; gap: 16px; margin: 10px 0; }
.stat b { display: block; font-size: 20px; color: var(--text); }
.stat { color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
  font-size: 12px; cursor: pointer; color: var(--text);
}
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--accent); color: #1a1300; border-color: var(--accent); }
.chip small { color: var(--muted); margin-left: 3px; }
.chip.on small { color: #4a3a00; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 7px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list li:hover { background: var(--panel-2); }
.row { display: flex; gap: 8px; align-items: baseline; }
.row .code { font-weight: 700; color: var(--accent); min-width: 34px; }
.row .right { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.carriers { color: var(--muted); font-size: 12px; margin-left: 42px; }
.flights { margin: 3px 0 0 42px; font-size: 12px; color: var(--accent-2); }
.notice {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent-2);
  padding: 8px 10px; border-radius: 6px; margin: 10px 0; font-size: 13px; color: var(--muted);
}
.notice.bad { border-left-color: var(--bad); }
.tools { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.tools input { padding: 5px 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.seg button { background: transparent; color: var(--muted); border-radius: 0; padding: 4px 8px; font-weight: 500; font-size: 12px; }
.seg button.on { background: var(--line); color: var(--text); }
a.back { color: var(--accent-2); cursor: pointer; font-size: 13px; text-decoration: none; display: inline-block; margin-bottom: 8px; }
.ftable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ftable td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.ftable td:first-child { color: var(--accent); font-variant-numeric: tabular-nums; width: 48px; }
.foot { margin-top: 24px; font-size: 11px; color: var(--muted); }
.foot a { color: var(--muted); }

.leaflet-container { background: #0a1220; font: inherit; }
.leaflet-tooltip.tt {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); box-shadow: none; padding: 3px 7px;
}
.leaflet-tooltip.tt::before { display: none; }
.leaflet-control-attribution { background: rgba(10,18,32,.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }

@media (max-width: 800px) {
  .bar { padding: 8px 16px; gap: 6px; align-items: center; }
  .brand, .field label { display: none; }
  .field { flex: 1 1 calc(50% - 6px); max-width: none; }
  .field:has(#date) { flex: 1 1 30%; }
  #clear { flex: none; }
  main { flex-direction: column-reverse; }
  #panel { width: auto; flex: 0 0 45vh; border-right: 0; border-top: 1px solid var(--line); }
  input { font-size: 16px; padding: 6px 9px; }
}
.leaflet-tile-pane { filter: brightness(1.5) sepia(.35) hue-rotate(175deg) saturate(2.2); }
