/* Stage-first prototype: one panel, one actual renderer viewport, existing command nodes. */
body.stage-first-active{--stage-panel:300px;--stage-top:64px;overflow:hidden}
body.stage-first-active #studio-canvas-host{position:fixed!important;inset:var(--stage-top) var(--stage-panel) 0 0!important;width:auto!important;height:auto!important}
body.stage-first-active.stage-panel-collapsed #studio-canvas-host{right:0!important}
#studio-canvas-host canvas{display:block;width:100%;height:100%;outline-offset:-4px}
#stagePanel{position:fixed;top:64px;bottom:0;right:0;width:300px;z-index:850;background:#11201f;color:#e8f0eb;border-left:1px solid #405b54;display:flex;flex-direction:column;font:15px/1.45 system-ui}
#stagePanel[hidden],#stageShow[hidden],#stageCamera[hidden]{display:none!important}
body:not(.stage-first-active) #stagePanel,body:not(.stage-first-active) #stageShow,body:not(.stage-first-active) #stageCamera{display:none!important}
.stage-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:8px;border-bottom:1px solid #405b54}.stage-panel-heading [role=tablist]{display:flex;gap:3px}.stage-panel-heading button{padding:7px 10px}
#stagePanel button,#stageShow,#stageCamera button{font:inherit;min-height:44px;color:#edf4ee;background:#1c302b;border:1px solid #54756b;border-radius:5px;padding:8px 10px;cursor:pointer}
#stagePanel [role=tab][aria-selected=true]{background:#d3e5d8;color:#10231d;font-weight:700}
#stagePanelScroll{flex:1;min-height:0;overflow:auto;padding:12px}
#stagePanel [hidden]{display:none!important}#stagePanel h2{font-size:18px;margin:0 0 12px;line-height:1.3}#stagePanel h3{font-size:16px;margin:14px 0 8px}#stagePanel p{margin:8px 0 12px}#stagePanel label{font-size:14px}#stagePanel select,#stagePanel input:not([type=color]):not([type=range]),#stagePanel textarea{font:14px/1.4 system-ui;max-width:100%;box-sizing:border-box}#stagePanel select{min-height:44px;width:100%}#stagePanel input[type=color]{min-height:40px}#stagePanel input[type=range]{min-height:36px;width:100%}
#stagePanel .studio-context-panel,#stagePanel .studio-notes-panel,#stagePanel .studio-tutorial-panel{position:static!important;width:auto!important;max-width:none!important;max-height:none!important;overflow:visible!important;padding:0!important;margin:12px 0!important;box-shadow:none;border:0;border-radius:0}
#stagePanel #studio-context-panel{display:block!important}#stagePanel .studio-context-topline,#stagePanel #studioContextKicker,#stagePanel .eyebrow,#stagePanel .studio-quick-section>h3,#stagePanel #studioQuickSelection{display:none!important}
#stagePanel .studio-context-body,#stagePanel .studio-quick-body,#stagePanel .studio-notes-list{max-height:none;overflow:visible;padding:0}
#stagePanel .studio-context-field{margin:10px 0}#stagePanel .studio-context-actions{gap:6px;margin:8px 0}#stagePanel .studio-context-actions button{min-width:0;padding:8px 5px;font-size:14px}
#stagePanel .studio-context-tip{font-size:14px}#stagePanel details{margin:12px 0;border-top:1px solid #3d554b;padding-top:10px}#stagePanel summary{font-size:15px;min-height:32px;cursor:pointer;padding:5px 0}#stagePanel .studio-context-navigation{grid-template-columns:1fr}
#stagePanel .lil-gui{position:static!important;width:100%!important;max-height:none!important;overflow:visible!important;--font-size:14px;--widget-height:28px}#stagePanel .lil-gui>.children{max-height:none!important;overflow:visible!important}#stagePanel .lil-gui .controller{font-size:14px}#stagePanel .lil-gui .name{white-space:normal}
body.stage-first-advanced #stageEditContext{display:none}#stageTechnical:not([open])>.lil-gui{display:none!important}
#stageCategories{display:grid;gap:8px}#stageAddItems>div>button{display:block;width:100%;margin:8px 0;text-align:left}#stageAddItems button strong,#stageAddItems button span{display:block}#stageAddItems button span{font-size:13px;color:#bdd1c6}
#stageShow{position:fixed;right:12px;top:76px;z-index:900;font:15px system-ui}#stageCamera{position:fixed;left:12px;bottom:16px;z-index:820;display:flex;gap:5px;flex-wrap:wrap;max-width:calc(100vw - 330px);padding:6px;background:#10201ff0;border:1px solid #426050;border-radius:8px;font:14px system-ui}#stageCamera button{font-size:14px;min-width:44px;padding:7px 9px}body.stage-panel-collapsed #stageCamera{max-width:calc(100vw - 24px)}
body.stage-first-active #studio-quick-panel,body.stage-first-active #studio-shortcut-strip,body.stage-first-active #studioBuildButton,body.stage-first-active #studioEditButton,body.stage-first-active #studio-selection-status{display:none!important}
body.stage-first-active #studio-toolbar{position:fixed!important;inset:0 0 auto!important;height:64px!important;box-sizing:border-box;width:100%!important;padding:8px 12px!important;display:flex!important;gap:12px;border-radius:0!important;background:#101c19;z-index:1100;flex-wrap:nowrap!important}
body:not(.stage-first-active) #studio-toolbar[hidden]{display:none!important}
body.stage-first-active .studio-toolbar-project{min-width:70px;max-width:430px;flex:1}body.stage-first-active .studio-toolbar-project span{display:none}body.stage-first-active .studio-toolbar-project strong{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:15px}
body.stage-first-active .studio-toolbar-actions{display:flex!important;gap:6px!important;flex-wrap:nowrap!important;flex:none!important}body.stage-first-active #studio-toolbar button,body.stage-first-active .studio-exit-button{font-size:14px!important;min-height:44px!important;padding:8px 11px!important;white-space:nowrap}
body.stage-first-active #studioOverflowWrap{display:block!important;position:relative}body.stage-first-active #studioOverflowPanel{position:absolute!important;right:0!important;top:52px!important;width:300px!important;max-height:calc(100vh - 78px)!important;overflow:auto!important;background:#12251f;padding:14px!important;box-sizing:border-box}
.stage-more-group h3{font:600 15px system-ui;margin:4px 0 8px}.stage-more-group{margin:0 0 16px}.stage-more-group button,.stage-more-group a{display:block!important;width:100%;box-sizing:border-box;text-align:left;margin:5px 0}
#studioOverflowPanel #studioProjectFilesPanel{position:static!important;width:auto!important;max-height:none!important;overflow:visible!important;padding:4px!important}#studioOverflowPanel #studioProjectFilesHelp{font-size:13px}
body.stage-first-active #studio-status{left:12px;right:320px;bottom:83px;max-width:650px;font-size:13px;pointer-events:none}body.stage-first-active.stage-panel-collapsed #studio-status{right:12px}
#stagePanel :focus-visible,#stageCamera :focus-visible,#stageShow:focus-visible,#studioOverflowPanel :focus-visible{outline:3px solid #f1c66b;outline-offset:2px}#stagePanel button:disabled{opacity:.5}
@media(max-width:900px){body.stage-first-active #studio-canvas-host{right:0!important}#stagePanel{width:300px;box-shadow:-8px 0 20px #0008}#stageCamera{max-width:calc(100vw - 330px)}body.stage-first-active #studioInterpretationsButton{max-width:110px;overflow:hidden;text-overflow:ellipsis}body.stage-first-active #studio-toolbar{gap:6px;padding:8px!important}body.stage-first-active #studio-toolbar button{padding:7px!important}.studio-toolbar-project{max-width:140px!important}}
@media(max-width:600px){#stageCamera{max-width:calc(100vw - 24px);bottom:8px}#stagePanel{width:min(300px,92vw)}body.stage-first-active .studio-toolbar-project{display:none}body.stage-first-active #studio-toolbar{gap:3px}#stageCamera button{padding:5px}}

#stagePanel #studio-context-panel[hidden]{display:none!important}

#stagePanel .studio-context-body{gap:4px}#stagePanel .studio-context-field{margin:4px 0}#stagePanel .studio-context-actions{margin:4px 0}#stagePanel label{text-transform:none!important;letter-spacing:normal!important}#stagePanel .studio-catalogue-list{max-height:none;overflow:visible}#stagePanel .studio-context-heading{font-size:18px}

#stagePanel .studio-catalogue-filter{grid-template-columns:1fr}#stagePanel .studio-catalogue-filter input{min-width:0;width:100%}

#stagePanel .studio-catalogue-list button span,#stagePanel .studio-catalogue-list button small,#stagePanel .studio-fixture-grid button span,#stagePanel .studio-notes-list article p{font-size:14px;line-height:1.4}#stagePanel .studio-quick-kicker{text-transform:none}#stagePanel .studio-colour-exact{display:flex;gap:8px;align-items:center;flex-wrap:wrap}#stagePanel .studio-colour-exact label{width:100%}#studioOverflowPanel #studioProjectFilesHelp{font-size:14px}

#stagePanel h2,#stagePanel h3{text-transform:none!important;letter-spacing:normal!important}#stagePanel .studio-colour-exact input[type=color]{min-width:70px}

body.stage-first-active #interpretationBar{top:76px;bottom:auto;left:12px;transform:none;max-width:calc(100vw - 330px);width:max-content;box-sizing:border-box;font-size:14px}body.stage-first-active.stage-panel-collapsed #interpretationBar{max-width:calc(100vw - 24px)}body.stage-first-active #studio-status{color:#d1e0d8;background:#10201fd9;padding:5px 8px;border-radius:5px;font-size:14px}

body.stage-first-active.stage-panel-collapsed #interpretationBar{max-width:calc(100vw - 150px)}.stage-more-group h3{text-transform:none;letter-spacing:normal}

#stagePanel .lil-gui.closed>.children{display:none!important}#stagePanel .lil-gui:not(.closed)>.children{max-height:none!important;overflow:visible!important}

body.stage-first-active #studioOverflowPanel{top:56px!important}#studioOverflowPanel #studioClearStage{border-color:#a46761;color:#ffd4cd}

/* Empty live status must not paint a strip over wrapped portrait camera controls. */
body.stage-first-active #studio-status:empty{padding:0;background:transparent}
@media(max-width:900px){body.stage-first-active #studio-status{bottom:132px}}
@media(min-width:601px){body.stage-first-active .studio-toolbar-project{display:block!important}}

/* The native tablet layout hid this wrapper when its actions lived directly in More. */
body.stage-first-active #studioOverflowPanel #studioProjectFilesWrap{display:block!important}

/* L01: expose the original native Duplicate action next to transform tools. */
#stagePanel .stage-duplicate-action{margin:4px 0 10px}
#stagePanel .stage-duplicate-action button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:600}
#stagePanel .stage-duplicate-action small{font-size:12px;font-weight:400;color:#d0ded8;white-space:nowrap}
