:root {
  --bg: #0b0f17;
  --panel: #131a26;
  --panel-2: #1a2433;
  --line: #243043;
  --text: #e6edf6;
  --muted: #8aa0bd;
  --accent: #2dd4bf;
  --crit: #ff4d5e;
  --high: #ff9f43;
  --pred: #ffd166;
  --ok: #36d399;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { height: 100vh; display: flex; flex-direction: column; }

header.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
header .brand { font-weight: 700; letter-spacing: .3px; }
header .brand span { color: var(--accent); }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--line); }
.badge.live { color: var(--ok); }
.spacer { flex: 1; }
button.btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
button.btn:hover { border-color: var(--accent); }
button.btn.primary { background: var(--accent); color: #04201c; border-color: var(--accent); font-weight: 600; }
button.btn.danger { color: var(--crit); border-color: #43222a; }

.layout { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.stage { position: relative; background:
  radial-gradient(circle at 50% 100%, #16202f 0%, #0b0f17 70%); overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; }
.stage .hint { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--muted);
  background: rgba(11,15,23,.7); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.stage .editor-bar { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; align-items: center;
  background: rgba(19,26,38,.92); padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.stage .editor-bar input { background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 7px; font-size: 12px; }

aside.side { background: var(--panel); border-left: 1px solid var(--line); display: flex;
  flex-direction: column; min-height: 0; }
.side h3 { margin: 0; padding: 12px 14px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--line); }
.feed { flex: 1; overflow-y: auto; }
.incident { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.incident:hover { background: var(--panel-2); }
.incident .row { display: flex; align-items: center; gap: 8px; }
.incident .kind { font-weight: 700; font-size: 13px; }
.incident .when { color: var(--muted); font-size: 11px; margin-left: auto; }
.incident .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.k-intrusion { color: var(--crit); } .bg-intrusion { background: var(--crit); }
.k-proximity { color: var(--high); } .bg-proximity { background: var(--high); }
.k-predicted { color: var(--pred); } .bg-predicted { background: var(--pred); }
.pill { font-size: 10px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  width: min(560px, 92vw); overflow: hidden; }
.modal header { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal video { width: 100%; display: block; background: #000; }
.modal .body { padding: 14px 16px; font-size: 13px; color: var(--muted); }
.modal .body b { color: var(--text); }
.empty { color: var(--muted); font-size: 13px; padding: 18px 14px; }
