* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #0f172a; background: #f8fafc; }
#app { display: flex; height: 100%; }
#panel { width: 340px; flex: none; overflow-y: auto; padding: 14px 16px 40px; background: #fff; border-right: 1px solid #e2e8f0; }
#stage { flex: 1; position: relative; min-width: 0; }
#gl { width: 100%; height: 100%; display: block; }
h1 { font-size: 19px; margin: 0 0 4px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #475569; margin: 18px 0 6px; }
p { margin: 4px 0 8px; }
.muted { color: #475569; }
.small { font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.btn { display: inline-block; border: 1px solid #cbd5e1; background: #f8fafc; color: #0f172a; border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; }
.btn.primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn.on { background: #0f172a; color: #fff; border-color: #0f172a; }
select { width: 100%; padding: 7px; border-radius: 8px; border: 1px solid #cbd5e1; font: inherit; background: #fff; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.slider { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.slider input { width: 100%; }
.banner { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #fef3c7; border: 1px solid #f59e0b; font-size: 13px; }
.scale { height: 14px; border-radius: 4px; margin-top: 8px; position: relative; }
.scale-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: #475569; margin-top: 2px; }
.info { font-size: 13px; background: #f1f5f9; border-radius: 8px; padding: 8px 10px; }
.info b { color: #0f172a; }
.units { display: flex; flex-direction: column; gap: 6px; }
.unit { display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; padding: 7px 8px; border-radius: 8px; background: #f1f5f9; font-size: 13px; }
.unit.deco { background: #dbeafe; }
.unit.gateway { background: #ffedd5; }
.unit.connected { outline: 2px solid #0f172a; }
.unit .meta { grid-column: 2; color: #475569; font-size: 12px; word-break: break-all; }
.swatch { width: 16px; height: 16px; margin-top: 2px; }
.swatch.deco { border-radius: 50%; background: #2563eb; box-shadow: inset 0 0 0 4px #2563eb, inset 0 0 0 8px #fff; }
.swatch.gateway { background: #ea580c; }
.swatch.other { border-radius: 50%; background: #64748b; width: 12px; height: 12px; margin: 4px 2px; }
.swatch.ignore { border-radius: 50%; background: #cbd5e1; width: 12px; height: 12px; margin: 4px 2px; }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #475569; pointer-events: none; }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 6px; background: #0f172a; color: #fff; margin-left: 4px; }
.tag.gw { background: #ea580c; }
.tag.deco { background: #2563eb; }
@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #panel { width: 100%; height: 48%; border-right: 0; border-top: 1px solid #e2e8f0; }
  #stage { height: 52%; flex: none; }
}
[hidden] { display: none !important; }
