/* R02 entrance hierarchy: existing routes and content, no additional hero. */
#stageCameraToggle{display:none}
#stageLandscapeRail{display:none}
.studio-entry .studio-welcome-panel{padding:24px;width:min(920px,100%)}
.studio-entry h1{font-size:clamp(2rem,3.5vw,2.5rem);margin-bottom:14px}
.studio-entry .studio-device-guidance{margin-bottom:16px}
.studio-entry .studio-start-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.studio-entry .studio-entry-question{font-size:1.05rem;margin:0;max-width:36ch}
.studio-entry .studio-start-heading .studio-continue{flex:none;min-height:44px;padding:10px 12px;border:1px solid #526b63;border-radius:7px;background:#172720;color:#e4f0e8}
.studio-entry .studio-route-picker button{padding:10px;transition:border-color .12s}
.studio-entry .studio-route-image{margin-bottom:10px}
.studio-entry .studio-route-picker button:hover{background:#15231e}
.studio-entry .studio-route-picker button strong{font-size:1.08rem;color:#f0f5f2}
.studio-entry .studio-route-picker button span{font-size:.95rem;color:#d4ddd9}
.studio-entry .studio-entry-support{margin-top:16px}
.studio-entry .studio-load-status{line-height:1.5}
.studio-entry .studio-route-panel{padding-top:8px}
.studio-entry .studio-set-text-summary{padding:14px;background:#14201c;border-left:3px solid #75d6b9;border-radius:0 7px 7px 0}
.studio-entry .studio-set-text-summary #studioSetTextTitle{font-size:1.05rem;color:#f2f5ef;line-height:1.5}
.studio-entry .studio-set-text-summary #studioSetTextRoute{color:#c6d6cf}
.studio-entry .studio-set-text-start{gap:16px}
.studio-entry .studio-route-panel .launch-btn{background:#b9dfc9;color:#10291e;border:1px solid #b9dfc9;min-height:46px;padding:10px 18px;font-weight:750}
.studio-entry .studio-route-panel .launch-btn:disabled{opacity:.65}
.studio-entry .studio-production-brief-start{align-items:start;gap:14px 24px}
.studio-entry .studio-production-brief-copy{padding:12px 14px;background:#14201c;border-left:3px solid #75d6b9;border-radius:0 7px 7px 0}
.studio-entry .studio-production-brief-copy p:last-child{margin-bottom:0}
.studio-entry .studio-brief-details{border:1px solid #43594f;border-radius:7px;padding:0 12px;min-width:0}
.studio-entry .studio-brief-details summary{cursor:pointer;align-content:center;font-weight:700;line-height:1.4;min-height:48px;color:#e6eee8}
.studio-entry .studio-brief-details ul{padding-left:20px}
.studio-entry .studio-brief-details .studio-brief-evidence{padding:0;border:0}
.studio-entry .studio-production-brief-start>.studio-practice-disclaimer{grid-column:1/-1;margin:0;color:#c9d8cd;font-size:.85rem;line-height:1.5}
.studio-entry .studio-route-picker button img{background:#111b17}
.studio-entry[aria-busy="true"] .studio-load-status{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:20001;box-sizing:border-box;width:min(600px,calc(100vw - 24px));padding:16px;background:#173129;color:#f1f6f1;border:1px solid #89bea5;border-radius:8px;box-shadow:0 4px 25px #0008}
.studio-entry .studio-resume{min-height:44px;padding:8px 12px;background:#1b3027;border:1px solid #678e7b;color:#e9f2eb;border-radius:6px;margin:0 0 14px}
@media(min-width:821px){.studio-entry .studio-production-brief-start>button{grid-column:1;grid-row:3}.studio-entry .studio-brief-details{grid-column:2;grid-row:2 / span 2}}
@media(max-width:820px){.studio-entry .studio-welcome-panel{padding:20px}.studio-entry .studio-route-image{margin-bottom:0}.studio-entry .studio-start-heading{align-items:flex-start;flex-wrap:wrap;gap:8px}.studio-entry .studio-entry-question{flex:1 1 190px}.studio-entry .studio-start-heading .studio-continue{padding:8px 10px}.studio-entry .studio-brief-details{grid-row:auto}.studio-entry #startProductionBriefStudio{grid-row:auto}.studio-entry .studio-set-text-controls{gap:12px}}
@media(max-height:500px){.studio-entry{padding-top:8px}.studio-entry .studio-entry-nav{margin-bottom:4px}.studio-entry .studio-device-guidance{padding:8px 12px;font-size:.9rem}.studio-entry .studio-welcome-panel{padding:16px}}
/* Existing editor command nodes are reused. */
body.stage-first-active #studioProjectFilesWrap{display:block!important;position:relative}
body.stage-first-active #studioProjectFilesPanel{position:absolute!important;inset:52px 0 auto auto!important;width:min(360px,calc(100vw - 24px))!important;max-height:calc(100dvh - 100px)!important;overflow:auto!important;padding:12px!important}
body.stage-first-active #stageNameDesign{display:block;width:100%;min-width:0;text-align:left;background:transparent!important;border-color:transparent!important;padding:5px 0!important}
body.stage-first-active #stageNameDesign:hover{border-color:#719481!important}
body.stage-first-active #studio-toolbar .studio-toolbar-project{min-width:70px}
#stageNameDialog{width:min(560px,calc(100vw - 24px));box-sizing:border-box;max-height:calc(100dvh - 24px);overflow:auto;padding:18px;border:1px solid #789785;border-radius:12px;background:#12211b;color:#e8eee8}
#stageNameDialog::backdrop{background:#000a}
#stageNameDialog>p{font:14px/1.5 system-ui;margin:12px}
#stageNameDialog #studioProjectDetails{border:0;margin:0;padding:0}
#stageNameDialog #studioProjectDetails>summary{font-size:20px;font-weight:750;list-style:none;pointer-events:none;padding:8px 12px}
#stageNameDialog #studioProjectDetailsForm{display:grid;gap:8px}
#stageNameDialog input,#stageNameDialog textarea{width:100%;box-sizing:border-box;scroll-margin:20px}
#stageNameDialog button{font:inherit;min-height:44px;padding:8px 12px;color:#ebf3ed;background:#244333;border:1px solid #6b927d;border-radius:6px}
.ux-dialog-close{float:right}
.ux-start-actions{display:grid;gap:8px}.ux-edit-hint{font-size:14px;color:#c1d4c7}
.ux-phone-note{display:none;font-size:13px!important;color:#c7d6cc;border-bottom:1px solid #466353;padding-bottom:8px}
.ux-phone-heading{display:none}
#stageMobileDock{display:none}
.design-studio-page dialog{max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box}
@media(min-width:601px) and (max-width:1100px){body.stage-first-active{--stage-panel: min(300px,38vw)}body.stage-first-active #studio-canvas-host{right:var(--stage-panel)!important}body.stage-first-active #stagePanel{width:var(--stage-panel)}body.stage-first-active.stage-panel-collapsed #studio-canvas-host{right:0!important}}
@media(max-width:600px), (max-width:1100px) and (max-height:500px){
 body.stage-first-active{--stage-top:58px;--ux-drawer:min(42dvh,360px)}
 body.stage-first-active #studio-toolbar{height:58px!important;padding:6px 8px!important;gap:4px!important}
 body.stage-first-active #studio-toolbar .studio-toolbar-actions{gap:4px!important;margin-left:auto}
 body.stage-first-active #studio-toolbar button{font-size:13px!important;padding:6px!important;min-height:44px!important}
 body.stage-first-active #studio-toolbar #studioReturnToChoices{width:64px;flex:none;font-size:0!important;white-space:nowrap;overflow:hidden}
 body.stage-first-active #studioReturnToChoices::after{content:'← Back';font-size:13px}
 body.stage-first-active #studio-toolbar .studio-toolbar-project{display:none!important}
 body.stage-first-active #studio-canvas-host{inset:58px 0 calc(var(--ux-drawer) + 52px) 0!important}
 body.stage-first-active.stage-panel-collapsed #studio-canvas-host{bottom:52px!important}
 body.stage-first-active #stagePanel{inset:auto 0 52px;width:100%;height:var(--ux-drawer);max-height:none;box-sizing:border-box;border:1px solid #5e816d;border-radius:12px 12px 0 0}
 body.stage-first-active #stageShow{display:none}
 body.stage-first-active #stageMobileDock{position:fixed;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));inset:auto 0 0;height:52px;background:#11251c;z-index:900;border-top:1px solid #5f816e;padding:4px;box-sizing:border-box;gap:4px}
 #stageMobileDock button{font:700 15px system-ui;background:#20392c;border:1px solid #678b74;color:#edf5ed;border-radius:6px;min-height:44px}
 #stageMobileDock button[aria-expanded="true"]{background:#c2e1cb;color:#132c1d}
 body.stage-first-active #stageCamera{inset:66px 8px auto;max-width:none;width:auto;box-sizing:border-box;display:grid;grid-template-columns:44px 44px repeat(3,minmax(0,1fr));padding:4px;gap:3px;margin:0}
 #stageCamera button{font-size:14px;min-width:0;padding:5px 2px;min-height:44px}
 body.stage-first-active #studio-status{left:8px;right:8px;bottom:calc(var(--ux-drawer) + 60px);font-size:12px;max-width:none;max-height:54px;overflow:hidden}
 body.stage-first-active.stage-panel-collapsed #studio-status{bottom:60px}
 #stagePanel .stage-panel-heading [role="tablist"]{display:none}
 .ux-phone-heading{display:block;font-size:15px;font-weight:700}
 #stagePanelScroll{padding:8px}
 #stagePanel #studioContextHeading{display:none}
 body.stage-first-active #studioOverflowPanel{width:min(300px,calc(100vw - 16px))!important}
}
@media(min-width:601px) and (max-width:1100px) and (max-height:500px){
 body.stage-first-active{--stage-panel: min(300px,38vw)}
 body.stage-first-active #stagePanel{inset:58px 0 52px auto;width:var(--stage-panel);height:auto;border-radius:0}
 body.stage-first-active #studio-canvas-host{right:var(--stage-panel)!important;bottom:0!important}
 body.stage-first-active.stage-panel-collapsed #studio-canvas-host{right:0!important;bottom:0!important}
 body.stage-first-active #stageMobileDock{left:auto;width:var(--stage-panel)}
 body.stage-first-active #stageCamera{right:calc(var(--stage-panel) + 8px)}
 body.stage-first-active.stage-panel-collapsed #stageCamera{right:8px;max-width:400px}
 body.stage-first-active #studio-status{right:calc(var(--stage-panel) + 8px);bottom:10px}
}
@media(prefers-reduced-motion:reduce){.studio-entry .studio-route-picker button{transition:none}}

/* R02a: authored constraints precede the native start action. */
.studio-entry .ux-essential-constraints,.studio-entry .studio-brief-details{grid-column:1/-1;grid-row:auto}
.studio-entry .studio-production-brief-start>button{grid-column:1;grid-row:auto}
.ux-essential-constraints{margin:0;font-size:.94rem;line-height:1.5}
@media(max-width:600px), (max-width:1100px) and (max-height:500px){
 body.stage-first-active{--ux-dock:calc(52px + env(safe-area-inset-bottom,0px))}
 body.stage-first-active #stageMobileDock{height:var(--ux-dock);padding-bottom:calc(4px + env(safe-area-inset-bottom,0px))}
 #stageMobileDock button[hidden]{display:none}
 #stageMobileDock button[aria-pressed="true"]{background:#c2e1cb;color:#132c1d;border:2px solid #f4fff5}
 #stageMobileDock button:disabled{opacity:.5}
 #stagePanel .stage-panel-heading [role="tablist"]{display:flex}
 #stagePanel .stage-panel-heading button{min-height:44px;padding:6px 10px}
 .ux-phone-heading{display:none}
 #stagePanel #studioContextHeading{display:block}
 body.stage-first-active #stagePanel{bottom:var(--ux-dock)}
 body.stage-first-active #studio-canvas-host{bottom:calc(var(--ux-drawer) + var(--ux-dock))!important}
 body.stage-first-active.stage-panel-collapsed #studio-canvas-host{bottom:var(--ux-dock)!important}
}
@media(min-width:601px) and (max-width:1100px) and (max-height:500px){
 body.stage-first-active #studio-canvas-host,body.stage-first-active.stage-panel-collapsed #studio-canvas-host{bottom:0!important}
}

/* Phone landscape: full-height stage beside one independently scrolling rail. */
@media(min-width:601px) and (max-width:1100px) and (max-height:500px){
 body.stage-first-active{--stage-panel:32vw}
 body.stage-first-active #studio-canvas-host,
 body.stage-first-active.stage-panel-collapsed #studio-canvas-host{inset:58px var(--stage-panel) 0 0!important}
 body.stage-first-active #stageLandscapeRail:not([hidden]){display:flex;flex-direction:column;gap:6px;position:fixed;inset:58px 0 0 auto;width:var(--stage-panel);box-sizing:border-box;overflow:auto;overscroll-behavior:contain;padding:6px max(6px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) 6px;background:#11201f;border-left:1px solid #5e816d;z-index:850}
 body:not(.stage-first-active) #stageLandscapeRail{display:none!important}
 body.stage-first-active #stageMobileDock{position:static;inset:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%;height:auto;flex:none;border:0;padding:0;background:transparent;gap:4px}
 #stageMobileDock button{min-width:0}
 #stageMobileDock[data-count="1"] button:first-child{grid-column:1/-1}
 body.stage-first-active #stageCameraToggle,
 body.stage-first-active #stageShow:not([hidden]){display:block;position:static;inset:auto;width:100%;box-sizing:border-box;flex:none;min-height:44px;padding:6px 10px;font:14px system-ui;color:#edf4ee;background:#1c302b;border:1px solid #54756b;border-radius:6px;cursor:pointer}
 #stageCameraToggle:focus-visible{outline:3px solid #f1c66b;outline-offset:2px}
 body.stage-first-active #stageCamera{display:none;position:static;inset:auto;width:100%;max-width:none;box-sizing:border-box;flex:none;grid-template-columns:repeat(2,minmax(0,1fr));padding:4px;gap:4px}
 body.stage-first-active.stage-camera-open #stageCamera{display:grid}
 #stageCamera button{min-width:44px;min-height:44px}
 #stageCamera #stageFit{grid-column:1/-1}
 body.stage-first-active #stagePanel{position:static;inset:auto;width:100%;height:auto;max-height:none;flex:none;border:0;border-top:1px solid #5e816d;border-radius:0;box-shadow:none}
 #stagePanel .stage-panel-heading{flex-wrap:wrap;gap:4px;padding:4px 0}
 #stagePanel .stage-panel-heading [role=tablist]{gap:2px;min-width:0;flex:1}
 #stagePanel .stage-panel-heading button{font-size:13px;padding:6px;min-width:44px}
 #stagePanelScroll{overflow:visible;flex:none;padding:6px 0}
 body.stage-first-active #studio-status{left:8px;right:calc(var(--stage-panel) + 8px);bottom:8px;max-width:300px;max-height:36px;font-size:12px}
 body.stage-first-active #interpretationBar,
 body.stage-first-active.stage-panel-collapsed #interpretationBar{left:8px;top:66px;max-width:calc(100vw - var(--stage-panel) - 16px)}
}


/* Keep the currently published two-line Studio identity inside the rename target. */
body.stage-first-active #studio-toolbar #stageNameDesign{display:flex!important;flex-direction:column;align-items:flex-start;justify-content:center;min-height:44px!important;padding:0!important;gap:0;max-width:100%}
body.stage-first-active #stageNameDesign .sd-studio-identity{margin:0!important;line-height:20px}
body.stage-first-active #stageNameDesign #studioToolbarTitle{line-height:20px}
