:root {
  --bg: #0f151b; --panel: #151d25; --line: rgba(255,255,255,.1); --text: #eef3f7; --mut: #9aa7b3;
  --accent: #4ade80; --warn: #ffb454;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { display: grid; grid-template-columns: 1fr 350px; height: 100vh; }
#stage { position: relative; min-width: 0; min-height: 0; background: #080c10; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#view.pan { cursor: grabbing; }
#hud { position: absolute; top: 12px; left: 14px; pointer-events: none; display: flex; flex-direction: column; }
#hud b { font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#hud span { color: var(--mut); font-size: 12px; }
#hint { position: absolute; bottom: 24px; left: 14px; right: 14px; color: var(--mut); font-size: 11px; pointer-events: none; }
#zoomBtns { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
#zoomBtns .ghost { width: 34px; height: 34px; padding: 0; font-size: 18px; line-height: 1; background: rgba(21,29,37,.85); }

#panel { background: var(--panel); border-left: 1px solid var(--line); padding: 16px 18px 24px; overflow-y: auto; }
h1 { margin: 0 0 4px; font-size: 22px; }
h2 { margin: 20px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--mut); }
.sub, .note, .foot { color: var(--mut); font-size: 12px; line-height: 1.5; margin: 0 0 12px; }
.foot { margin-top: 18px; font-size: 11px; }
.row { display: flex; gap: 8px; margin-bottom: 10px; }
.row.wrap { flex-wrap: wrap; }
.primary { background: linear-gradient(135deg, #22c55e, #15803d); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 600; flex: 1; }
.ghost { background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; }
.ghost:hover { background: rgba(255,255,255,.14); }
.ghost.on { background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.5); }
.preset { font-size: 12px; padding: 5px 9px; }
.ctl { display: block; font-size: 13px; margin: 8px 0; }
.ctl output { float: right; font-variant-numeric: tabular-nums; color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; }
.toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--mut); font-weight: 500; padding: 3px 4px; }
td { padding: 5px 4px; border-top: 1px solid var(--line); }
table.kv td:last-child { text-align: right; }
table.kv td:first-child { color: var(--mut); }
#selInfo h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
#bodies { margin-top: 10px; }
#bodies tbody tr { cursor: pointer; }
#bodies tbody tr:hover { background: rgba(255,255,255,.05); }
#bodies tbody tr.sel { background: rgba(74,222,128,.12); }
.ok { color: var(--accent); } .warn { color: var(--warn); }
details { margin-top: 16px; font-size: 13px; }
summary { cursor: pointer; color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.facts { padding-left: 18px; line-height: 1.5; color: #cfd8df; }
.facts li { margin: 6px 0; }
@media (max-width: 900px) {
  html, body { height: auto; }
  #app { grid-template-columns: 1fr; height: auto; }
  #stage { height: 80vw; min-height: 340px; }
  #panel { border-left: 0; border-top: 1px solid var(--line); }
  #hint { display: none; }
}
