:root { --fg: #e8eaed; --mute: #9aa0a6; --bg: #17191eee; --line: #ffffff22; --acc: #8ab4f8; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #17191e; color: var(--fg);
  font: 13px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
button, select, input { font: inherit; color: var(--fg); }
button { background: #2a2d34; border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button.on { background: #3b4f74; border-color: var(--acc); }
button.small { padding: 2px 7px; font-size: 12px; }
select { background: #2a2d34; border: 1px solid var(--line); border-radius: 4px; }
#top { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; gap: 6px; align-items: center; pointer-events: none; flex-wrap: wrap; }
#top > * { pointer-events: auto; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: 6px 0 0 6px; }
.seg button:last-child { border-radius: 0 6px 6px 0; }
#status { background: #0009; padding: 3px 8px; border-radius: 6px; color: var(--mute); font-size: 12px; pointer-events: none; }
#toggle { margin-left: auto; }
#panel { position: fixed; top: 52px; right: 8px; width: 300px; max-height: calc(100% - 64px); overflow: auto; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
#panel h2 { font-size: 14px; margin: 2px 0 6px; }
#panel h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 10px 0 4px; }
#panel label { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
#panel input[type=range] { flex: 1; min-width: 60px; }
#panel output { width: 34px; text-align: right; color: var(--mute); }
.row { display: flex; gap: 4px; flex-wrap: wrap; margin: 3px 0; }
.cloud { display: grid; grid-template-columns: 18px 22px 1fr auto 24px; gap: 4px; align-items: center; margin: 2px 0; }
.cloud input[type=color] { width: 20px; height: 18px; padding: 0; border: 0; background: none; }
.cloud .n { color: var(--mute); font-size: 11px; text-align: right; }
.cloud .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font: 11px/1.4 ui-monospace, Menlo, monospace; color: var(--mute); white-space: pre-wrap; }
.help { color: var(--mute); font-size: 11px; }
#hud { position: fixed; left: 10px; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
#scalebar { font-size: 11px; }
#sbar { height: 6px; border: 2px solid #fff; border-top: 0; margin-bottom: 2px; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; transform: translate(-50%, -130%); background: #000c; color: #ffd60a; padding: 1px 5px; border-radius: 4px; font: 11px ui-monospace, Menlo, monospace; white-space: nowrap; }
.dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #ffd60a; border: 1px solid #000; }
#joy { position: fixed; left: 24px; bottom: 80px; width: 120px; height: 120px; border-radius: 50%; background: #ffffff18; border: 1px solid #ffffff40; touch-action: none; }
#knob { position: absolute; left: 40px; top: 40px; width: 40px; height: 40px; border-radius: 50%; background: #ffffff60; }
#err { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: #400; padding: 16px; border-radius: 8px; max-width: 90%; }
@media (max-width: 600px) { #panel { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 60%; } }
