:root {
  --bg: #0b0f0c; --bg2: #111712; --bg3: #18201a; --line: #263027;
  --text: #e4e8e1; --muted: #93a093; --dim: #667266;
  --gold: #c9a227; --red: #e5484d; --orange: #f08c2e; --yellow: #e8c547;
  --blue: #4ea1ff; --cyan: #3fd0c9; --green: #5bbf6a; --purple: #b58cff;
  --top: 52px; --foot: 30px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Naskh Arabic", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { display: flex; flex-direction: column; overflow: hidden; }
a { color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mono, .clock, .num { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

/* top bar */
.topbar { height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 14px; background: var(--bg2); border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--gold); text-decoration: none; font-weight: 600; letter-spacing: .12em; font-size: 15px; }
.brand b { color: var(--text); font-weight: 700; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .14em; color: var(--red); font-weight: 600; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.clock { font-size: 13px; color: var(--muted); }
.spacer { flex: 1; }
.icon-btn { display: none; background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }

/* layout */
.shell { flex: 1; display: grid; grid-template-columns: 210px 1fr 360px; min-height: 0; }
.layers, .panel { background: var(--bg2); overflow-y: auto; min-height: 0; }
.layers { border-right: 1px solid var(--line); padding: 14px 12px; }
.panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.layers h2 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
#layer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
#layer-list label { display: grid; grid-template-columns: 16px 12px 1fr auto; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
#layer-list label:hover { background: var(--bg3); }
#layer-list input { margin: 0; accent-color: var(--gold); }
.swatch { width: 10px; height: 10px; border-radius: 50%; }
.count { font-size: 11.5px; color: var(--dim); }
.count.err { color: var(--orange); }
.note { font-size: 12px; color: var(--dim); line-height: 1.45; margin-top: 16px; }

.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #0a0d0b; }
.map-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(11,15,12,.85); border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; border-radius: 20px; font-size: 12px; pointer-events: none; z-index: 500; transition: opacity .4s; }

/* panel */
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; position: sticky; top: 0; background: var(--bg2); z-index: 2; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 12px 6px; font: inherit; font-size: 13px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.tab { padding: 12px 14px 18px; }
.row { display: flex; gap: 8px; margin-bottom: 10px; }
select, input { width: 100%; background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 13.5px; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.news a { color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.4; display: block; }
.news a:hover { color: var(--gold); }
.news .meta { font-size: 11.5px; color: var(--dim); margin-top: 4px; }
.src { font-size: 11.5px; color: var(--dim); margin: 12px 0 0; }
.empty, .loading, .error { color: var(--muted); font-size: 13px; padding: 8px 0; }
.error { color: var(--orange); }

.mkt { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 14px; }
.mkt caption { text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 4px 0 8px; font-weight: 600; }
.mkt td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.mkt td.num { text-align: right; }
.up { color: var(--green); } .down { color: var(--red); }

.dossier-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.dossier-head img { width: 54px; height: auto; border: 1px solid var(--line); border-radius: 3px; }
.dossier-head h3 { margin: 0; font-size: 18px; }
.dossier-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.facts div { background: var(--bg3); border-radius: 6px; padding: 8px 10px; }
.facts dt { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 2px 0 0; font-size: 13.5px; }
.signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.signals div { background: var(--bg3); border-radius: 6px; padding: 8px; text-align: center; }
.signals b { display: block; font-size: 20px; }
.signals span { font-size: 11px; color: var(--muted); }
h4 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }

.foot { height: var(--foot); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; font-size: 11.5px; color: var(--dim); background: var(--bg2); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.foot span:first-child { overflow: hidden; text-overflow: ellipsis; }

/* leaflet overrides */
.leaflet-container { font: inherit; background: #0a0d0b; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg2); color: var(--text); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; line-height: 1.45; min-width: 200px; }
.leaflet-popup-content a { color: var(--gold); }
.leaflet-popup-content .tag { display: inline-block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; background: var(--bg3); color: var(--muted); margin-bottom: 4px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: rgba(11,15,12,.75) !important; color: var(--dim) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: var(--bg2); color: var(--text); border-color: var(--line); }
.plane { color: var(--cyan); font-size: 14px; line-height: 1; text-shadow: 0 0 2px #000; }
.plane.mil { color: var(--yellow); }
.plane.emg { color: var(--red); }
.choke { width: 14px; height: 14px; border: 2px solid var(--purple); transform: rotate(45deg); background: rgba(181,140,255,.25); }

/* tablet and phone */
@media (max-width: 980px) {
  .icon-btn { display: inline-block; }
  .shell { grid-template-columns: 1fr; }
  .layers, .panel { position: fixed; z-index: 1000; top: var(--top); bottom: var(--foot); width: min(360px, 92vw); transition: transform .25s; box-shadow: 0 0 24px rgba(0,0,0,.6); }
  .layers { left: 0; transform: translateX(-105%); }
  .panel { right: 0; transform: translateX(105%); }
  .layers.open, .panel.open { transform: none; }
  .clock { display: none; }
  .foot .foot-links { display: none; }
}
.dim { color: var(--dim); font-size: 11px; }
