:root {
  --bg: #0e1012; --panel: #16191c; --line: #2a2f34; --text: #e6e3dc; --muted: #9a968c;
  --accent: #c8a86b; --red: #e05a4f; --green: #5fb37a; --blue: #5b9bd5; --warn: #e0a84f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
.hidden { display: none !important; }
button { font: inherit; color: var(--text); background: #23282d; border: 1px solid var(--line);
  border-radius: 4px; padding: 5px 10px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.link { background: none; border: none; color: var(--muted); padding: 2px 6px; }
input, select, textarea { font: inherit; color: var(--text); background: #101315; border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 8px; }
.brand { font-family: Oswald, "Arial Narrow", sans-serif; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; font-size: 15px; }
.mark { color: var(--bg); background: var(--accent); padding: 1px 6px; margin-right: 4px; border-radius: 2px; }

.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.login form { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 24px; display: grid; gap: 12px; }
.login label { display: grid; gap: 4px; color: var(--muted); }
.login button { background: var(--accent); color: #111; border: none; padding: 9px; font-weight: 600; }
.sub, .fine { color: var(--muted); margin: 0; }
.fine { font-size: 11px; }
.err { color: var(--red); margin: 0; min-height: 1em; }

#app { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
header { display: flex; align-items: center; gap: 16px; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button { background: none; border-color: transparent; }
nav button.on { border-color: var(--accent); color: var(--accent); }
header .right { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.pill { border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.pill.warn { border-color: var(--warn); color: var(--warn); }
main { position: relative; display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
#map { min-height: 300px; }
aside { border-left: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 10px 12px; }
footer { font-size: 11px; color: var(--muted); padding: 4px 12px; border-top: 1px solid var(--line); }

.layers { position: absolute; left: 10px; top: 10px; background: rgba(22,25,28,.92); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; display: grid; gap: 3px; z-index: 2; }
.layers label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.detail { position: absolute; right: 392px; top: 10px; width: 340px; max-height: calc(100% - 80px); overflow: auto;
  background: rgba(22,25,28,.97); border: 1px solid var(--line); border-radius: 6px; padding: 12px; z-index: 3; }
.playback { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 3; display: flex;
  gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; width: min(600px, 70%); }
.playback input { flex: 1; }

h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 14px 0 6px; }
h2:first-child { margin-top: 2px; }
h3 { margin: 0 0 4px; font-size: 15px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 4px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 11px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #1d2125; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 2px 8px; }
.kv div:nth-child(odd) { color: var(--muted); }
.muted { color: var(--muted); }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; font-size: 11px; }
.tag.high { border-color: var(--green); color: var(--green); }
.tag.medium { border-color: var(--warn); color: var(--warn); }
.tag.low { border-color: var(--red); color: var(--red); }
.tag.confirmed { border-color: var(--green); color: var(--green); }
.tag.candidate { border-color: var(--warn); color: var(--warn); }
.tag.rejected { color: var(--muted); }
.note { border-left: 3px solid var(--warn); padding: 4px 8px; color: var(--muted); margin: 6px 0; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.bar { height: 8px; background: var(--accent); border-radius: 2px; }

@media (max-width: 820px) {
  main { grid-template-columns: 1fr; grid-template-rows: 55vh auto; }
  aside { border-left: none; border-top: 1px solid var(--line); }
  .detail { right: 10px; left: 10px; width: auto; top: auto; bottom: 10px; max-height: 50%; }
  .layers { font-size: 12px; }
}
.legend { font-size: 11px; color: var(--muted); margin-top: 4px; }
.legend span { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 6px; border: 1px solid #fff; }
.legend span:first-child { margin-left: 0; }
.layers { max-height: calc(100% - 20px); overflow: auto; min-width: 210px; }
.layers-toggle { padding: 0; color: var(--accent); font-weight: 600; }
.layers.collapsed .layers-body { display: none; }
.lg { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 6px 0 1px; }
.badge { background: var(--red); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; margin-left: 3px; }
.toasts { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; display: grid; gap: 6px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 4px;
  padding: 6px 10px; cursor: pointer; max-width: 420px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.toast.squawk, .toast.signal_lost { border-left-color: var(--red); }
.toast.launch, .toast.entered { border-left-color: var(--green); }
.toast.exited { border-left-color: var(--warn); }
.cam-img { width: 100%; border-radius: 4px; border: 1px solid var(--line); background: #000; min-height: 120px; }
.cams-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; }
.cams-strip img { width: 100%; height: 64px; object-fit: cover; border-radius: 3px; cursor: pointer; border: 1px solid var(--line); }
.proj { border-left: 3px solid var(--blue); padding: 4px 8px; margin: 6px 0; }
@media (max-width: 820px) { .layers { min-width: 0; } }
.key { font-size: 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; }
