:root {
  --bg: #f6f7f9; --panel: #fff; --border: #dde1e6; --text: #1d2430; --muted: #6b7380;
  --accent: #2563eb; --moving: #16a34a; --still: #dc2626; --unknown: #9ca3af;
}
* { box-sizing: border-box; }
body { margin: 0; font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg);
  height: 100vh; display: flex; flex-direction: column; }
header { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 14px; background: #111827; color: #e5e7eb; }
header h1 { font-size: 15px; margin: 0 10px 0 0; }
header select, header input { font: inherit; }
header .muted { color: #9ca3af; }
nav#tabs { display: flex; gap: 2px; padding: 0 14px; background: #1f2937; }
nav#tabs button { background: none; border: 0; color: #cbd5e1; padding: 8px 14px; cursor: pointer; font: inherit; border-bottom: 2px solid transparent; }
nav#tabs button.active { color: #fff; border-bottom-color: var(--accent); }
main { flex: 1; min-height: 0; }
.tab { display: none; height: 100%; }
.tab.active { display: block; }
.split { display: flex; height: 100%; }
.pane-left { width: 55%; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); min-height: 0; }
.pane-left.narrow { width: 300px; flex: none; padding: 8px; overflow: auto; }
.pane-right { flex: 1; overflow: auto; padding: 10px 14px; min-width: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 6px 8px; flex-wrap: wrap; }
.table-wrap { overflow: auto; flex: 1; }
table.grid { border-collapse: collapse; width: 100%; }
table.grid th, table.grid td { padding: 3px 6px; border-bottom: 1px solid #eef0f3; text-align: left; white-space: nowrap; }
table.grid th { position: sticky; top: 0; background: #f1f3f6; font-weight: 600; z-index: 1; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover { background: #eef4ff; }
tr.sel { background: #dbeafe !important; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mono, code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.hex { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; background: #f3f4f6; padding: 6px; border-radius: 4px; }
.hex .hl { background: #fde047; outline: 1px solid #ca8a04; }
.map { height: 420px; border: 1px solid var(--border); border-radius: 6px; margin-top: 8px; }
.chart-box { position: relative; height: 320px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 6px; }
.chart-box.small { height: 220px; }
#key-filter { width: 100%; margin-bottom: 6px; padding: 4px; }
#key-list label { display: flex; gap: 6px; padding: 2px 0; align-items: center; cursor: pointer; }
#key-list label .cnt { margin-left: auto; color: var(--muted); font-size: 11px; }
.beacon-item { padding: 6px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.beacon-item:hover { border-color: var(--accent); }
.beacon-item.sel { border-color: var(--accent); background: #eff6ff; }
.beacon-item .id { font-family: ui-monospace, Consolas, monospace; font-size: 11px; word-break: break-all; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px; margin-bottom: 10px; }
.card h3 { margin: 0 0 8px; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .card { flex: 1; min-width: 320px; }
.form-grid { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; align-items: center; }
.form-grid input, .form-grid select, .form-grid textarea { font: inherit; padding: 3px; width: 100%; }
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
button { font: inherit; padding: 3px 10px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 4px; }
.pill { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: 11px; color: #fff; }
.pill.m { background: var(--moving); } .pill.s { background: var(--still); } .pill.u { background: var(--unknown); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.stat { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 6px; }
.stat b { display: block; font-size: 16px; }
.confusion td { text-align: center; padding: 4px 10px; border: 1px solid var(--border); }
.legend span { margin-right: 12px; } .legend i { display: inline-block; width: 22px; height: 4px; vertical-align: middle; margin-right: 4px; }
.bytes td { text-align: center; font-family: ui-monospace, Consolas, monospace; font-size: 11px; padding: 2px 4px; border: 1px solid #eee; cursor: pointer; }
.bytes td.var { background: #fef3c7; } .bytes td.var2 { background: #fde68a; }
.err { color: var(--still); }
label.chk { display: inline-flex; gap: 4px; align-items: center; }
