:root{color-scheme:dark;--bg:#111820;--panel:#19232e;--line:#344251;--text:#ecf2f7;--muted:#a8b7c6;--accent:#87cff5;font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}button,select,summary{cursor:pointer}button:disabled{cursor:default;opacity:.4}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}[hidden]{display:none!important}
.app-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:17px 24px;border-bottom:1px solid var(--line)}h1{font-size:24px;font-weight:600;letter-spacing:-.6px;margin:0}.eyebrow{font-size:10px;font-weight:600;letter-spacing:2px;color:var(--accent)}.header-actions,#file-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}#save-status{font-size:12px;color:var(--muted)}
#overhead-rc{display:grid;grid-template-columns:320px minmax(0,1fr);gap:0;min-height:calc(100dvh - 89px)}.editor-sidebar{background:var(--panel);padding:20px;border-right:1px solid var(--line);min-width:0}.editor-sidebar h2{font-size:13px;text-transform:uppercase;letter-spacing:1.3px;font-weight:600;color:var(--muted);margin:0 0 15px}.mode-switch{display:flex;flex-direction:column;gap:7px;margin-bottom:22px}.mode-switch .btn{text-align:left}
.viewer{min-width:0;padding:18px;display:flex;flex-direction:column;gap:12px}.view-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}#oh-stage{height:calc(100dvh - 215px)!important;min-height:420px;touch-action:none;background:radial-gradient(ellipse at center,#253343 0%,#111820 75%);overflow:hidden;border-radius:8px}canvas{display:block;width:100%;height:100%}#oh-message{color:var(--muted);font-size:12px;min-height:35px}.viewer:fullscreen{background:var(--bg);height:100dvh}.viewer:fullscreen #oh-stage{height:auto!important;flex:1;min-height:0}
.btn{background:#243342;color:var(--text);border:1px solid #415165;border-radius:6px;padding:9px 12px;line-height:1.2;transition:background .15s}.btn:hover:not(:disabled){background:#32495d}.btn[aria-pressed=true]{background:#91d1f4;color:#102232;border-color:#91d1f4}.viz-controls,.viz-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:14px}.editor-sidebar .viz-controls{align-items:stretch}.editor-sidebar .form-label{width:100%}.editor-sidebar .viz-row .btn{flex:1}.form-label{display:flex;flex-direction:column;gap:7px;color:var(--muted);min-width:0;max-width:100%;font-size:12px}.form-label span,.form-label output{display:inline}.form-range{width:100%;accent-color:var(--accent);height:24px}.form-select,.form-control{width:100%;min-width:0;background:#101923;color:var(--text);border:1px solid #405066;padding:9px 10px;border-radius:5px;font-size:14px}.form-check{display:flex;align-items:center;gap:7px}.form-check-input{accent-color:var(--accent);width:16px;height:16px}.form-check-label{font-size:12px}.tabular-nums{font-variant-numeric:tabular-nums}output{color:var(--text);font-weight:500}details{border-top:1px solid var(--line);margin-top:16px;padding-top:14px}summary{color:var(--text);margin-bottom:12px}.editor-sidebar details .viz-row{margin-top:10px}#oh-transfer{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}textarea{resize:vertical}#oh-transfer .viz-row{margin-top:10px}.help-note{font-size:12px;color:var(--muted);border-top:1px solid var(--line);margin-top:24px;padding-top:16px}
@media(min-width:1500px){#overhead-rc{grid-template-columns:350px minmax(0,1fr)}}
@media(max-width:800px){.app-header{padding:14px 16px;align-items:flex-start;flex-wrap:wrap;gap:10px}.header-actions{width:100%;justify-content:space-between}#overhead-rc{grid-template-columns:1fr}.viewer{grid-row:1;padding:12px}#oh-stage{height:52dvh!important;min-height:300px}.editor-sidebar{border-right:0;border-top:1px solid var(--line);padding:16px}.mode-switch{flex-direction:row;flex-wrap:wrap}.mode-switch .btn{flex:1}.editor-sidebar .form-label{width:calc(50% - 5px)}.view-toolbar{gap:4px}.view-toolbar .viz-controls{margin-bottom:0}.help-note{margin-top:12px}button{min-height:40px}}
@media(max-width:420px){.editor-sidebar .form-label{width:100%}.header-actions{align-items:flex-start;flex-direction:column}.btn{padding:9px 10px}.viewer{padding:8px}.mode-switch{gap:5px}.mode-switch .btn{font-size:12px}}

.pipe-section-tools{padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid #344553}.pipe-section-tools strong{display:block;margin-bottom:12px}.pipe-section-tools .viz-row{margin-top:10px}

@media(max-width:800px){.viewer{position:relative;top:auto;background:var(--bg)}#oh-stage{height:36dvh!important;min-height:210px}.viewer #oh-message{min-height:0;margin:0}}

/* Keep editing controls independent from the camera viewport. */
html,body{height:100%;overflow:hidden}body{height:100dvh;display:flex;flex-direction:column}.app-header{flex:none}main{flex:1;min-height:0;overflow:hidden}#overhead-rc{height:100%;min-height:0;overflow:hidden}.editor-sidebar{min-height:0;overflow-y:auto;overscroll-behavior:contain}.viewer{min-height:0;overflow:hidden}#oh-stage{height:auto!important;min-height:0;flex:1}.view-toolbar{flex:none}#oh-message{flex:none}
@media(max-width:800px){#overhead-rc{grid-template-rows:minmax(220px,55%) minmax(0,1fr)}.viewer{grid-row:1}.editor-sidebar{grid-row:2}#oh-stage{height:auto!important;min-height:80px}.app-header{padding:6px 12px}.app-header h1{font-size:18px}.header-actions{flex-direction:row;gap:5px}.viewer{padding:8px;gap:6px}}

/* Full-window fallback for browsers without element fullscreen. */
.viewer.expanded-view{position:fixed!important;inset:0;z-index:9999;width:100%;height:100dvh;box-sizing:border-box;background:var(--bg);padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}
.viewer.expanded-view #oh-stage{flex:1;height:auto!important;min-height:0!important}
@media(max-width:800px){#track-fullscreen,#track-full-page{order:-1;min-height:44px;flex-shrink:0}.viewer:fullscreen{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}}
