html, body { margin: 0; height: 100%; overflow: hidden; background: #181818; color: #eee; font: 14px/1.4 system-ui, sans-serif; }
#stage, #stage canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 260px; text-align: center; }
#loading[hidden] { display: none; }
#bar { height: 6px; width: 0; background: #4da3ff; transition: width .2s; }
#message { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: 80%; padding: 12px 16px; background: #5a1c1c; border-radius: 6px; }
#message[hidden] { display: none; }
#hud { position: fixed; left: 8px; top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#hud button { background: #000a; color: #eee; border: 1px solid #666; border-radius: 4px; padding: 6px 10px; cursor: pointer; }
#status { background: #000a; padding: 4px 8px; border-radius: 4px; font-variant-numeric: tabular-nums; }
#help { position: fixed; left: 8px; bottom: 8px; right: 8px; font-size: 12px; opacity: .7; pointer-events: none; }
#measure-panel { position: fixed; right: 8px; top: 8px; width: 260px; display: flex; flex-direction: column; gap: 6px; }
#measure-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#measure-panel button { background: #000a; color: #eee; border: 1px solid #666; border-radius: 4px; padding: 5px 8px; cursor: pointer; }
#measure-panel button.active { background: #7a5c00; border-color: #fc0; }
#measure-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
#measure-list li { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: #000a; padding: 3px 6px; border-radius: 4px; font-size: 12px; }
#measure-list li:hover { background: #5a2a1ccc; }
#measure-list li button { padding: 0 6px; }
#measure-labels { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.measure-label { position: absolute; left: 0; top: 0; white-space: nowrap; background: #000c; color: #fc0; padding: 1px 6px; border-radius: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.measure-label[hidden] { display: none; }
.measure-label.hot { color: #f53; }
#measure-hint { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: #000c; padding: 4px 10px; border-radius: 4px; font-size: 12px; pointer-events: none; }
#measure-hint[hidden] { display: none; }
#measure-draft-actions { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; gap: 8px; }
#measure-draft-actions[hidden] { display: none; }
#measure-draft-actions button { background: #000c; color: #eee; border: 1px solid #fc0; border-radius: 4px; padding: 8px 14px; cursor: pointer; }
#views-panel { position: fixed; left: 8px; top: 52px; width: 220px; display: flex; flex-direction: column; gap: 4px; }
#views-title { font-weight: 600; }
#views-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
#views-list button, #views-actions button { width: 100%; text-align: left; background: #000a; color: #eee; border: 1px solid #666; border-radius: 4px; padding: 5px 8px; cursor: pointer; }
#views-empty { font-size: 12px; opacity: .7; }
#views-empty[hidden] { display: none; }
.views-warning { font-size: 12px; color: #fc0; background: #000a; padding: 2px 6px; border-radius: 4px; }
#views-actions { display: flex; gap: 4px; }
#views-text { width: 100%; box-sizing: border-box; background: #000c; color: #eee; border: 1px solid #666; border-radius: 4px; font: 11px/1.3 ui-monospace, monospace; resize: vertical; }
#views-text[hidden] { display: none; }
#views-note { font-size: 12px; opacity: .8; }
[hidden] { display: none !important; }
#activate { position: fixed; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; box-sizing: border-box; touch-action: manipulation; cursor: pointer; background: #0000; color: #fff; text-shadow: 0 0 4px #000; outline-offset: -3px; }
#loading, #message { z-index: 20; }
#hud, #views-panel, #measure-panel { z-index: 10; }
#measure-hint, #measure-draft-actions { z-index: 20; }
#views-toggle, #measure-toggle { display: none; }
body.embed #views-toggle, body.embed #measure-toggle { display: inline-block; }
body.embed #help, body.embed #status { display: none; }
body.embed #views-panel:not(.open), body.embed #measure-panel:not(.open) { display: none; }
body.embed #views-panel, body.embed #measure-panel { background: #000c; padding: 8px; box-sizing: border-box; border-radius: 6px; }
#hud button[aria-expanded="true"] { border-color: #fc0; }
@media (max-width: 519px) {
  body.embed #views-panel, body.embed #measure-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 6px 6px 0 0; max-height: 60vh; overflow-y: auto; }
}
