[hidden] { display: none !important; }
:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --line: #232a32;
  --text: #e9edf1;
  --muted: #8b95a1;
  --sign: #ffc629;      /* airport signage yellow */
  --arr: #46c8ff;
  --dep: #ff9a3c;
  --oth: #e9edf1;
  --gnd: #6c7580;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--sans); }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 18px;
  height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #08090b;
}
.brand { display: flex; align-items: center; gap: 0; text-decoration: none; font-weight: 900; letter-spacing: .04em; }
.brand-word { background: #111; color: var(--sign); padding: 4px 8px; border: 2px solid var(--sign); border-right: 0; font-size: 15px; }
.brand-num { background: var(--sign); color: #111; padding: 4px 8px; border: 2px solid var(--sign); font-size: 15px; }
.brand-live { margin-left: 10px; font-size: 11px; font-weight: 700; color: #ff5a5a; display: flex; align-items: center; gap: 5px; letter-spacing: .12em; }
.brand-live i { width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 0 0 #ff3b3b88; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #ff3b3b88 } 70% { box-shadow: 0 0 0 8px #ff3b3b00 } 100% { box-shadow: 0 0 0 0 #ff3b3b00 } }

.airports { display: flex; gap: 6px; }
.airports button {
  background: transparent; border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 10px; font-family: var(--mono); font-weight: 700; letter-spacing: .06em;
}
.airports button span { font-family: var(--sans); font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.airports button.on { border-color: var(--sign); color: var(--sign); }

.modes { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.mode { background: none; border: 0; padding: 5px 14px; border-radius: 4px; color: var(--muted); font-weight: 600; }
.mode.on { background: var(--sign); color: #111; }
.clock { margin-left: auto; color: var(--muted); font-size: 12px; }
.clock b { font-family: var(--mono); color: var(--text); font-size: 16px; margin-left: 4px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 1fr 360px; height: calc(100% - 56px); }
.map-wrap { position: relative; min-height: 300px; }
#map { position: absolute; inset: 0; background: #0d1014; }
.side { border-left: 1px solid var(--line); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.panel h2 { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { display: flex; flex-direction: column; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stat b { font-family: var(--mono); font-size: 26px; line-height: 1.15; }
.stat.rwy b { color: #111; background: var(--sign); align-self: flex-start; padding: 0 8px; border-radius: 3px; font-size: 22px; margin-top: 2px; }
.c-arr { color: var(--arr); } .c-dep { color: var(--dep); }
.stats-note { margin: -6px 2px 0; font-size: 11px; color: var(--muted); }

/* notable */
.notable { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notable li { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.notable li.empty { display: block; color: var(--muted); cursor: default; }
.notable .ty { font-family: var(--mono); font-weight: 700; color: var(--sign); }
.notable .when { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.notable small { color: var(--muted); }

/* departures board */
.board-panel { flex: 1; min-height: 220px; }
.board { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.board th { text-align: left; color: var(--muted); font-weight: 400; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 0 4px 6px; }
.board td { padding: 5px 4px; border-top: 1px solid var(--line); white-space: nowrap; }
.board tr { cursor: pointer; }
.board tr:hover td { background: #1a2027; }
.board td.empty { color: var(--muted); font-family: var(--sans); cursor: default; }
.board .fl { color: var(--sign); font-weight: 700; }
.tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: .06em; }
.tag.arr { background: #46c8ff22; color: var(--arr); }
.tag.dep { background: #ff9a3c22; color: var(--dep); }
.star { color: var(--sign); }

/* alerts form */
.alerts p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.alerts .row { display: flex; gap: 6px; }
.alerts input[type=email] { flex: 1; min-width: 0; background: #0b0d10; border: 1px solid var(--line); border-radius: 5px; color: var(--text); padding: 8px 10px; font: inherit; }
.alerts button { background: var(--sign); color: #111; border: 0; border-radius: 5px; padding: 8px 12px; font-weight: 700; }
.alerts .ok { color: var(--sign); margin: 8px 0 0; }
.hp { position: absolute; left: -9999px; }

.credits { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; padding: 0 2px 6px; }

/* ---------- map overlays ---------- */
.legend {
  position: absolute; left: 12px; top: 12px; z-index: 500; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: #0b0d10d9; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; color: var(--muted);
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.dot.arr { background: var(--arr); } .dot.dep { background: var(--dep); } .dot.oth { background: var(--oth); } .dot.gnd { background: var(--gnd); }
.toggle { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.notice {
  position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 500; max-width: 520px; text-align: center;
  background: #0b0d10ee; border: 1px solid var(--sign); color: var(--text); border-radius: 6px; padding: 8px 14px; font-size: 13px;
}

.plane-icon { overflow: visible; }
.plane { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.plane svg { display: block; transform-origin: 50% 50%; stroke: #000; stroke-width: .5; paint-order: stroke;
  filter: drop-shadow(0 0 1.5px rgba(0,0,0,.9)) drop-shadow(0 1px 3px rgba(0,0,0,.6)); cursor: pointer; }
.plane svg .rotor { stroke-width: 1.3; opacity: .85; }
.plane.sel svg { filter: drop-shadow(0 0 3px #ffc629) drop-shadow(0 0 8px #ffc629); }
.plane.sel .lbl { color: #ffc629; }
.plane .lbl {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 1px;
  font: 700 10px/1 var(--mono); color: var(--text); text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; white-space: nowrap; pointer-events: none;
}
.no-labels .plane .lbl, .zoom-low .plane.gnd .lbl { display: none; }
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
.pop h3 { margin: 0 0 2px; font: 700 16px var(--mono); color: var(--sign); }
.pop .sub { color: var(--muted); margin-bottom: 6px; }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 8px; font-family: var(--mono); font-size: 12px; }
.pop dt { color: var(--muted); }
.pop dd { margin: 0; }
.pop a { color: var(--sign); margin-right: 10px; font-size: 12px; }
.leaflet-control-attribution { background: #0b0d10cc !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }

/* ---------- replay bar ---------- */
.replay-bar {
  position: absolute; left: 12px; right: 12px; bottom: 22px; z-index: 600;
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center;
  background: #0b0d10ee; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--sign); color: #111; font-size: 16px; }
.timeline { position: relative; }
#histo { width: 100%; height: 34px; display: block; }
#scrub { width: 100%; margin: 2px 0 0; accent-color: var(--sign); }
.ticks { position: relative; height: 14px; font: 10px var(--mono); color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); }
.replay-time { display: flex; flex-direction: column; align-items: flex-end; }
.replay-time b { font: 700 24px var(--mono); color: var(--sign); }
.replay-time span { font-size: 11px; color: var(--muted); }
.speeds { display: flex; gap: 4px; }
.speeds button { background: none; border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px; font: 12px var(--mono); color: var(--muted); }
.speeds button.on { border-color: var(--sign); color: var(--sign); }

@media (max-width: 860px) {
  .top { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .clock { display: none; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .map-wrap { height: 62vh; }
  .side { border-left: 0; }
  .replay-bar { grid-template-columns: auto 1fr auto; bottom: 10px; left: 8px; right: 8px; }
  .speeds { grid-column: 1 / -1; justify-content: center; }
  .legend { font-size: 11px; gap: 8px; right: 56px; }
}

/* ---------- satellite base ---------- */
.sat-tiles { filter: brightness(.72) saturate(.85) contrast(1.05); }
.basemap { position: absolute; left: 12px; top: 54px; z-index: 500; display: flex; background: #0b0d10d9; border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.basemap button { background: none; border: 0; color: var(--muted); padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.basemap button.on { background: var(--sign); color: #111; }

/* ---------- runways, approaches, coverage ---------- */
.rwy-tag { position: absolute; transform: translate(-50%, -50%); font: 800 11px/1 var(--mono); color: #111; background: #e9edf1;
  padding: 3px 5px; border-radius: 3px; box-shadow: 0 1px 4px #000a; white-space: nowrap; opacity: .85; }
.rwy-tag.on { background: var(--sign); opacity: 1; }
.rwy-tag.on::after { content: " LANDING"; font-size: 9px; letter-spacing: .06em; }
.edge-lbl { position: absolute; transform: translate(-50%, -140%); font: 10px var(--sans); color: #ffffff99; white-space: nowrap; text-shadow: 0 0 3px #000; }
.light-canvas { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity .2s; }

/* ---------- spotting pins ---------- */
.spot-pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #111; background: #c9d1d9;
  border: 2px solid #111; box-shadow: 0 1px 6px #000c; cursor: pointer; }
.spot-pin.official { border-color: var(--sign); }
.spot-pin.good { background: #4ade80; }
.pop.spot p { margin: 4px 0 8px; color: var(--text); }
.pop .badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #111; background: var(--sign); padding: 1px 6px; border-radius: 3px; }
.good-now { color: #4ade80; font-weight: 700; margin-bottom: 6px; }
.not-now { color: var(--muted); margin-bottom: 6px; }
.pop small { color: var(--muted); font-size: 11px; }

/* ---------- selected flight card ---------- */
.flight { position: absolute; left: 12px; top: 96px; z-index: 650; width: 300px; max-width: calc(100% - 24px);
  background: #0b0d10f2; border: 1px solid var(--line); border-top: 3px solid var(--sign); border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 30px #000a; }
.flight-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.flight-tools button { background: #1a2027; border: 1px solid var(--line); color: var(--muted); border-radius: 5px; font-size: 11px; padding: 3px 8px; }
.flight-tools button:hover { color: var(--text); }
.fl-head h3 { margin: 0; font: 800 22px/1.1 var(--mono); color: var(--sign); }
.fl-head span { color: var(--muted); font-size: 12px; }
.route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; margin: 10px 0 6px; }
.route div { display: flex; flex-direction: column; }
.route div:last-child { text-align: right; }
.route b { font: 800 26px/1 var(--mono); }
.route span { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route .arrow { color: var(--sign); font-size: 18px; transform: rotate(90deg); }
.route.muted, .flight .muted { color: var(--muted); font-size: 12px; display: block; margin: 8px 0; }
.progress { height: 4px; background: #232a32; border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #46c8ff, #ffc629); }
.prog-txt { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--muted); margin: 4px 0 2px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 10px 0; }
.stats-grid div { display: flex; flex-direction: column; }
.stats-grid .wide { grid-column: 1 / -1; }
.stats-grid dt { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stats-grid dd { margin: 0; font: 600 14px var(--mono); }
.stats-grid dd small { color: var(--muted); font-weight: 400; font-size: 11px; }
.flight .links a { color: var(--sign); font-size: 12px; margin-right: 12px; }
.flight .fine { margin: 8px 0 0; font-size: 10px; color: var(--muted); }
.apt-pin { position: absolute; transform: translate(-50%, -50%); background: var(--sign); color: #111; border-radius: 4px; padding: 2px 6px; font: 11px var(--sans); white-space: nowrap; box-shadow: 0 1px 6px #000c; }
.apt-pin b { font-family: var(--mono); margin-right: 4px; }

/* light-trails toggle */
.speeds .light { margin-left: 6px; }
.speeds .light.on { border-color: #46c8ff; color: #46c8ff; }

@media (max-width: 860px) {
  .flight { top: auto; bottom: 30px; left: 8px; width: auto; right: 8px; padding: 10px 12px; }
  .mode-replay .flight { bottom: 150px; }
  .flight .fine, .flight .links, .stats-grid .wide, .fl-head span { display: none; }
  .fl-head h3 { font-size: 18px; }
  .route { margin: 6px 0 4px; } .route b { font-size: 20px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 4px 8px; margin: 8px 0 0; }
  .stats-grid dd { font-size: 12px; } .stats-grid dd small { display: none; } .stats-grid dt { font-size: 9px; letter-spacing: .04em; }
  .basemap { top: 64px; }
}
.zoom-far .rwy-tag, .zoom-far .edge-lbl, .zoom-far .spot-pin { display: none; }
.zoom-low .spot-pin { transform: scale(.72); }

/* ---------- filters ---------- */
.filter-panel { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.chips button.on { background: var(--sign); border-color: var(--sign); color: #111; font-weight: 700; }
#search { background: #0b0d10; border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 7px 10px; font: 12px var(--sans); }
#search:focus { outline: none; border-color: var(--sign); }
