:root{--bg:#0b1220;--panel:#0f1a31;--text:#e8eefc;--muted:#9fb2d8;--line:rgba(255,255,255,.10);--green:rgba(78,227,194,.16);--red:rgba(255,123,138,.14);--orange:#ff9a3d}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;background:radial-gradient(1200px 800px at 20% 10%,#11214a 0%,#0b1220 50%,#070b14 100%);color:var(--text)}
.wrap{height:100vh;display:flex;flex-direction:column}

/* top is content-sized (bar + table), map takes the rest */
.top{flex:0;padding:12px 12px 10px 12px;display:flex;flex-direction:column;gap:12px}
.bottom{flex:1;min-height:0;padding:12px 12px 12px 12px}

.bar{display:flex;gap:10px;align-items:center;justify-content:space-between}
.bar .left{display:flex;gap:10px;align-items:center}
.btn{border:1px solid var(--line);background:rgba(255,255,255,.04);color:var(--text);padding:8px 10px;border-radius:12px;cursor:pointer}
.btn:hover{background:rgba(255,255,255,.07)}
.pill{font-size:12px;color:var(--muted);border:1px solid var(--line);padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.03)}

.panel{flex:0 0 auto;background:rgba(15,26,49,.75);border:1px solid var(--line);border-radius:18px;overflow:hidden;display:flex;flex-direction:column}
.table-scroll{height:320px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}

table{width:100%;border-collapse:separate;border-spacing:0}
thead th{position:sticky;top:0;z-index:5;background:rgba(15,26,49,.95);backdrop-filter:blur(6px);text-align:left;font-size:12px;color:var(--muted);padding:10px;border-bottom:1px solid var(--line);white-space:nowrap}
tbody td{padding:10px;border-bottom:1px solid rgba(255,255,255,.06);font-size:13px;vertical-align:middle;white-space:nowrap}
tbody tr.toward{background:var(--green)}
tbody tr.away{background:var(--red)}
tbody tr.hit{background:rgba(255,211,110,.22)!important}
tbody tr.blank td{color:rgba(159,178,216,.35)}

.thumb{width:44px;height:28px;border-radius:8px;border:1px solid rgba(255,255,255,.10);background:linear-gradient(135deg,rgba(255,255,255,.08),rgba(255,255,255,.02));display:inline-flex;align-items:center;justify-content:center;font-size:11px;color:rgba(232,238,252,.7);text-decoration:none;overflow:hidden}
.thumb img{width:44px;height:28px;object-fit:cover;display:block}
.callsign{font-weight:650;letter-spacing:.2px}

#map{height:100%;border-radius:18px;border:1px solid var(--line);overflow:hidden}
.alt-wrap{display:inline-flex;align-items:center;gap:8px}
.alt-chip{width:10px;height:10px;border-radius:3px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)}

:root{
  --alt0:#6ea8ff;  /* < 2k ft */
  --alt1:#4ee3c2;  /* 2–10k */
  --alt2:#ff9a3d;  /* 10–25k */
  --alt3:#ff7b8a;  /* > 25k */
}

/* altitude band class sets a single variable */
.alt0{--altc:var(--alt0)}
.alt1{--altc:var(--alt1)}
.alt2{--altc:var(--alt2)}
.alt3{--altc:var(--alt3)}

/* table chip uses the same var */
.alt-chip{background:var(--altc, rgba(255,255,255,.25))}

/* map marker (divIcon) can use the same var too */
.plane-dot{width:12px;height:12px;border-radius:999px;background:var(--altc, #fff);box-shadow:0 0 0 2px rgba(0,0,0,.35)}
/* outer hit area */
.airport-icon{
  width:35px;
  height:35px;
  margin-left:-14px; /* center the hit box */
  margin-top:-14px;
  pointer-events:auto;
}

/* visible 9x9 dot */
.airport-dot{
  position:absolute;
  left:50%;
  top:50%;
  width:9px;
  height:9px;
  background:#000;
  border-radius:2px;
  transform:translate(-50%,-50%);
}
