/* A quiet workspace. Tools are overlays; the preview never jumps when they open. */
body.clean-studio{--clean-bottom:calc(64px + env(safe-area-inset-bottom,0px));--tool-space:0px!important;background:#08090d}
.clean-studio .topbar,.clean-studio .rail,.clean-studio #phoneHeader,.clean-studio #phoneDock,.clean-studio .stage-caption,.clean-studio .stage-tip,.clean-studio #mascotBuddy,.clean-studio #phoneLayers,.clean-studio #phoneSwitches,.clean-studio #toggleTimeline{display:none!important}
.clean-studio .workspace{position:fixed!important;inset:0 0 var(--clean-bottom)!important;width:100%!important;height:auto!important;display:block!important;padding:0!important}
.clean-studio .editor{width:100%;height:100%;display:flex;flex-direction:column;min-height:0}
.clean-studio .stage{flex:1;min-height:0;margin:0!important;padding:12px!important;container-type:size;position:relative}
.clean-studio .canvas-wrap{position:absolute!important;inset:50% auto auto 50%!important;transform:translate(-50%,-50%)!important;width:min(100cqw,56.25cqh)!important;height:min(100cqh,177.777cqw)!important;max-width:100%;max-height:100%;margin:0!important;aspect-ratio:9/16}
.clean-studio.landscape .canvas-wrap{width:min(100cqw,177.777cqh)!important;height:min(100cqh,56.25cqw)!important;aspect-ratio:16/9}
#cleanDock{position:fixed;z-index:140;bottom:0;left:0;right:0;min-height:var(--clean-bottom);padding:7px max(6px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));display:flex;gap:4px;align-items:center;background:#14151c;border-top:1px solid #30323e}
#cleanDock button{flex:1;min-width:0;min-height:48px;padding:5px 2px;border:0;border-radius:12px;background:transparent;color:#d5d6e2;font-size:11px;font-weight:650;white-space:nowrap}
#cleanDock button[aria-expanded=true]{background:#333044;color:#e1ccff}
#cleanDock #play{flex:0 0 44px;background:#c8a4ff;color:#17101f}
#cleanDock #export{background:#eee7fa;color:#241333;max-width:96px}
#cleanPopup{position:fixed;z-index:150;bottom:calc(var(--clean-bottom) + 8px);left:8px;width:min(460px,calc(100vw - 16px));max-height:calc(100dvh - var(--clean-bottom) - 24px);background:#191a23;border:1px solid #3b3c4b;border-radius:20px;box-shadow:0 18px 65px #0009;color:#eee;overflow:hidden}
#cleanPopup[hidden]{display:none}
#cleanPopup>header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid #343541}
#cleanPopup h2{font-size:17px;margin:0}#cleanPopup h3{font-size:12px;color:#bdb5ce;margin:16px 0 8px}
#cleanPopup>header button{width:44px;height:44px;font-size:25px;background:transparent;border:0;color:#ddd}
.clean-content{padding:0 14px 14px;overflow:auto;max-height:calc(100dvh - var(--clean-bottom) - 100px);overscroll-behavior:contain}
.clean-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.clean-grid button,#cleanPopup .fx-row button{min-height:52px;border:1px solid #373846;background:#252631;border-radius:12px;padding:8px;color:#eeebf5;white-space:normal}
#cleanPopup button:focus-visible,#cleanDock button:focus-visible{outline:2px solid #dbbcff;outline-offset:2px}
#cleanPopup .canvas-toolbar,#cleanPopup .header-actions{display:flex!important;flex-wrap:wrap;height:auto;padding:12px 0;gap:8px;background:none}
#cleanPopup .project-title{display:block;padding:14px 0}
#cleanPopup input,#cleanPopup select,#cleanPopup .canvas-toolbar button{min-height:44px;max-width:100%}
#cleanPopup[data-menu=Timeline]{width:min(980px,calc(100vw - 16px))}
#cleanPopup .transport{display:flex!important;position:static!important;flex-wrap:wrap;height:auto!important;min-height:60px;padding:8px 0}
#cleanPopup .timeline{display:block!important;position:relative!important;height:200px!important;max-height:40dvh;visibility:visible!important}
#cleanPopup #scrubber{display:block;flex:1;min-width:120px}
#cleanPopup #camFxBar{display:flex!important;flex-wrap:wrap;margin:0;padding:12px 0;background:none;border:0;position:static!important;width:100%}
#cleanPopup #camFxBar>button{flex:1;min-height:44px}
#cleanPopup #throwBar{width:100%;display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding-top:12px}
#cleanPopup #throwBar[hidden],#cleanPopup #camFxMenu[hidden]{display:none!important}
#cleanPopup #throwBar button{min-height:52px;width:auto}
#cleanPopup #camFxMenu{position:static!important;width:auto!important;max-height:none!important;box-shadow:none;border:0;background:none;padding:0;overflow:visible}
#cleanPopup .fx-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#cleanPopup .fx-sec{padding:12px 0}#cleanPopup summary{padding:14px 0;cursor:pointer;color:#d2c1ec}#cleanPopup textarea{width:100%}
.clean-studio .library,.clean-studio .inspector{position:fixed!important;z-index:145;top:12px;bottom:calc(var(--clean-bottom) + 8px);width:320px!important;max-width:calc(100vw - 16px);border-radius:18px;border:1px solid #363642;box-shadow:0 12px 60px #0008}
.clean-studio .library{left:8px}.clean-studio .inspector{right:8px}
.clean-studio.lib-closed .library,.clean-studio.insp-closed .inspector{display:none!important}
.clean-studio #phoneSheet{bottom:calc(var(--clean-bottom) + 8px)!important;max-height:65dvh!important;border-radius:20px;z-index:150}
.clean-studio #phoneShade{z-index:144}
.clean-studio #takeControls:not([hidden]){position:fixed;z-index:141;bottom:var(--clean-bottom);left:0;right:0;background:#191a23;justify-content:center;min-height:48px}
.clean-studio #phoneCameraControls:not([hidden]){display:flex!important;position:relative!important;inset:auto!important;flex:0 0 auto;min-height:64px!important;height:auto!important;padding:6px!important;gap:8px;align-items:center;justify-content:center;background:#15151d}
@media(min-width:700px){#cleanDock{justify-content:center}#cleanDock button{flex:0 1 100px;font-size:13px}.clean-content{max-height:65dvh}}
@media(max-width:359px){#cleanDock{gap:0;padding-left:6px;padding-right:6px}#cleanDock button{font-size:10px;min-width:44px}}
/* The original phone sheet used --tool-space for its height; overlays reserve no stage space. */
.clean-studio.phone-active #phoneSheet:not([hidden]){height:min(65dvh,calc(100dvh - var(--clean-bottom) - 24px))!important;max-height:calc(100dvh - var(--clean-bottom) - 24px)!important}
.clean-studio.phone-active #phoneSheetBody{flex:1;min-height:0;overflow:auto}
.clean-studio.phone-active #phoneSheetActions:not([hidden]){flex:0 0 auto;display:flex;gap:8px;padding:10px}
.clean-studio.phone-active #phoneSheetActions button{flex:1;min-height:44px}
.clean-studio.phone-active #phoneSheet .inspector{position:static!important;width:auto!important;max-width:none;box-shadow:none;border:0}
#cleanPopup .fx-row button[aria-pressed="true"]{background:#403053;border-color:#cda5ff;color:#fff;box-shadow:inset 0 0 0 1px #cda5ff55}
