/* Fixed three-page production theatre. No production behavior is attached to motion. */
body.immersive-project{height:var(--project-height,100dvh);overflow:hidden;overscroll-behavior:none}
.immersive-project #app{position:fixed;inset:0;max-width:none;width:100%;height:var(--project-height,100dvh);padding:0;margin:0;overflow:clip;perspective:1600px}
.immersive-project>footer{display:none}.immersive-project .topbar{position:fixed;inset:0 0 auto;z-index:25;pointer-events:none}.immersive-project .topbar>*{pointer-events:auto}
.project-deck{position:absolute;inset:0;overflow:clip;perspective:1600px;isolation:isolate;touch-action:none}
.project-page{position:absolute;inset:0;overflow:hidden;background:#080c16;transform-origin:50% 50%;backface-visibility:hidden;transition:transform .62s cubic-bezier(.22,.8,.2,1),opacity .5s;will-change:transform,opacity}
.project-page[data-position=before]{transform:translateY(-105%) rotateX(18deg) scale(.93);opacity:0;pointer-events:none}
.project-page[data-position=after]{transform:translateY(105%) rotateX(-18deg) scale(.93);opacity:0;pointer-events:none}
.project-page[data-position=current]{transform:none;opacity:1;z-index:1}
.cover-page .project-top{height:100%;width:100%;min-height:0;border:0;border-radius:0;padding:clamp(28px,7vw,110px);display:flex;align-items:center;margin:0;transform:none;box-shadow:none}
.cover-page .project-top>img{width:100%;height:100%;object-fit:cover;opacity:.85;object-position:center}
.cover-page .project-top:after{background:linear-gradient(90deg,#040811dc,transparent 95%),linear-gradient(0deg,#060a15ef,transparent 70%)}
.cover-page .project-title{max-width:850px}.cover-page .project-title>a{margin-bottom:clamp(40px,8vh,100px)}
.cover-page .project-title h1{font-size:clamp(42px,7vw,100px);line-height:1.02;max-width:900px;letter-spacing:-.045em}
.cover-page .project-title p{font-size:15px;max-width:580px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.cover-page .hero-whisper{display:none}.cover-enter{position:absolute;bottom:calc(105px + env(safe-area-inset-bottom));left:clamp(28px,7vw,110px);z-index:3;padding:14px 20px;border:1px solid #cdc3ff50;border-radius:28px;background:#141c30b3;backdrop-filter:blur(16px);color:#e0dcff;font-size:13px}
.page-switcher{position:absolute;bottom:calc(22px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:12;display:flex;gap:4px;padding:5px;border:1px solid #9e9dcb33;border-radius:30px;background:#0a1020d9;backdrop-filter:blur(20px);max-width:calc(100% - 154px)}
.page-switcher button{padding:9px 15px;border:0;border-radius:24px;background:transparent;color:#939bb4;white-space:nowrap;font-size:11px;min-height:38px}
.page-switcher button[aria-current=step]{background:#9d8bff24;color:#ede8ff;box-shadow:inset 0 0 0 1px #b5a6ff40}
.scenes-page{padding:80px clamp(24px,5vw,80px) 88px;background:radial-gradient(ellipse at 50% -20%,#382b5745,transparent 65%),#080c16;display:flex;flex-direction:column;gap:14px}
.immersive-title{display:grid;grid-template-columns:1fr auto;align-items:end;gap:3px 15px;flex:none}.immersive-title h1{font-size:clamp(20px,2.3vw,32px);font-weight:450;letter-spacing:-.035em;margin:0;grid-column:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.immersive-label{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:#c2b5f4}.immersive-title .immersive-label:empty{display:none}.scene-position{grid-column:2;grid-row:1 / span 2;color:#8e97b0;font-size:12px}
.scenes-page>section{display:flex;flex-direction:column;min-height:0;flex:1}.scenes-page>section>.section-head:first-child{display:none}.scenes-page>section>.section-head{margin:9px 0;min-height:34px;flex:none}
.scenes-page .story-strip{display:flex;gap:8px;margin:0;padding:2px 0 8px;flex:none;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:none;touch-action:none}.scenes-page .story-strip::-webkit-scrollbar{display:none}
.scenes-page .scene-tab{min-width:78px;width:78px;flex:0 0 78px;border-radius:9px;transform:none;overflow:hidden}.scenes-page .scene-art{height:44px;aspect-ratio:auto}.scenes-page .scene-label{padding:4px 7px}.scenes-page .scene-label strong{font-size:10px}.scenes-page .scene-tab[aria-selected=true]{border-color:#bdaeff;box-shadow:0 0 18px #a18aff33}.scenes-page .play-badge{font-size:8px;padding:3px}
.scenes-page .scene-detail{position:relative;min-height:0;flex:1;display:flex;flex-direction:column;border-radius:20px;overflow:hidden;transform:none!important;box-shadow:0 18px 60px #0005,inset 0 1px #c9c1ff1a}
.scenes-page .viewer{flex:1;min-height:0;aspect-ratio:auto;order:0;display:grid;place-items:center;background:radial-gradient(ellipse at center,#1c2234,#070a11 80%);overflow:hidden}
.scenes-page .viewer img,.scenes-page .viewer video{width:100%;height:100%;max-height:100%;object-fit:contain}.scenes-page .viewer .text-preview{overflow:auto;max-height:100%;padding:24px 60px;white-space:pre-wrap;touch-action:pan-y}
.scenes-page .scene-copy{order:1;padding:12px 58px;display:flex;flex-direction:row;flex-wrap:wrap;gap:8px 18px;align-items:center;flex:none;background:#0d1421;border-top:1px solid #b4b0da1c;max-height:32%;overflow:auto;touch-action:pan-y}
.scenes-page .scene-copy:before,.scenes-page .scene-copy>p{display:none}.scenes-page .scene-copy h2{font-size:15px;margin:0;flex:1}.scenes-page .scene-copy>span{font-size:11px}.scenes-page .scene-copy button{font-size:11px;padding:7px 10px;min-height:34px;margin:0}.scene-reference-fold{width:100%;font-size:11px;color:#b2bbce}.scene-reference-fold summary{cursor:pointer;padding:6px 0}.scene-reference-fold .scene-inputs{padding:8px 0;display:flex;gap:8px;max-height:120px;overflow:auto;touch-action:pan-y}
.immersive-scene-nav{position:absolute;inset:50% 12px auto;display:flex;justify-content:space-between;pointer-events:none;transform:translateY(-50%)}.scene-arrow{pointer-events:auto;width:38px;height:48px;border:1px solid #ceccff35;border-radius:16px;background:#091023aa;backdrop-filter:blur(12px);color:#efebff;font-size:28px;line-height:1}.scene-arrow:disabled{opacity:.22}
.materials-page{padding:85px clamp(24px,6vw,90px) 88px;background:radial-gradient(ellipse at 10% 0,#372a5940,transparent 65%),#090e19;display:flex;flex-direction:column;gap:20px}.materials-heading{font-size:clamp(24px,3vw,40px);font-weight:350;letter-spacing:-.03em;flex:none}.materials-content{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:0 8px 20px 0;scrollbar-width:thin;scrollbar-color:#4d4565 transparent}.materials-content .group{margin:0 0 12px}.materials-content .reference-toolbar{margin:8px 0 20px}.materials-content .creative-document{white-space:pre-wrap}.materials-content .cast-gallery{grid-template-columns:repeat(auto-fill,minmax(115px,1fr))}.materials-content .final-cut{margin:0}.materials-content .final-cut video{max-height:55vh;object-fit:contain}
.immersive-comparison{position:absolute!important;inset:85px 8vw 100px!important;z-index:20;overflow:auto;background:#0b1221!important;touch-action:pan-y}
.immersive-project .waiting{flex:1;min-height:0;margin:0}.immersive-project input,.immersive-project textarea,.immersive-project select{font-size:16px}
/* Keep every orb status in the established violet/blue family. */
.orb[data-state=attention] .sphere-body{border-color:#c9bbff;box-shadow:inset 3px 3px 8px #d7e8ff66,inset -5px -9px 15px #070a35c9,0 0 15px #a18aff70,0 0 28px #788dff40}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
 .scenes-page{padding:72px 14px 90px;gap:10px}.immersive-title h1{font-size:21px}.immersive-label{font-size:9px;letter-spacing:.1em}.scenes-page .scene-tab{min-width:64px;width:64px;flex-basis:64px}.scenes-page .scene-art{height:36px}.scenes-page .scene-detail{border-radius:16px}.scenes-page .scene-copy{padding:10px 14px;gap:6px 10px;max-height:35%}.scenes-page .scene-copy h2{font-size:13px;min-width:45%}.scenes-page .scene-copy>span{display:none}.scenes-page .scene-copy button{font-size:10px}.scene-arrow{width:32px;height:44px}.immersive-scene-nav{inset-inline:8px}.scenes-page .viewer .text-preview{font-size:14px;padding:20px 48px;touch-action:pan-y}.materials-page{padding:78px 18px 90px;gap:18px}.materials-heading{font-size:27px}.materials-content .cast-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.cover-page .project-top{padding:28px;align-items:center}.cover-page .project-title h1{font-size:clamp(38px,11vw,60px)}.cover-page .project-title p{font-size:13px}.cover-page .project-title>a{margin-bottom:50px}.cover-enter{left:28px;bottom:calc(110px + env(safe-area-inset-bottom))}.page-switcher{left:18px;transform:none;max-width:calc(100% - 108px);bottom:calc(23px + env(safe-area-inset-bottom));gap:0;padding:3px}.page-switcher button{font-size:10px;padding:8px 9px;min-height:38px}.immersive-comparison{inset:75px 10px 90px!important}
}
@media(prefers-reduced-motion:reduce){.project-page{transition:none;transform:none!important;will-change:auto}}
html[data-motion=off] .project-page{transition:none;transform:none!important;will-change:auto}

.scenes-page .story-strip{min-height:0;height:76px}.scenes-page .scene-tab{min-height:0}.project-page img{-webkit-user-drag:none}.project-deck{user-select:none}.materials-content,.text-preview,.scene-copy{user-select:text}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.scenes-page .story-strip{height:66px}}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
 .immersive-project #studio-navigation{left:auto;right:14px;top:16px;bottom:auto;transform:none;width:42px;height:42px}
 .immersive-project #navigation-toggle{width:42px;height:42px;border-radius:50%;min-height:42px}
 .immersive-project #navigation-toggle span{display:none}
 .immersive-project .topbar .motion-toggle{margin-right:52px}
 .immersive-project .nav-panel{left:auto;right:0;top:52px;bottom:auto;width:calc(100vw - 28px);transform:translateY(-10px) scale(.97);transform-origin:top right}
 .immersive-project #studio-navigation[data-open=true] .nav-panel{transform:none}
}
/* Asset and document previews stay in the production. */
.scene-arrow svg,.mobile-brief-media{display:none}
.material-preview{color:#e9e7f5;background:#0d1422;border:1px solid #b6a7ed45;border-radius:20px;width:min(960px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:20px;box-shadow:0 30px 100px #0009;overflow:auto;overscroll-behavior:contain}
.material-preview::backdrop{background:#030714c9;backdrop-filter:blur(12px)}
.preview-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px}.preview-heading h2{font-size:20px;margin:0}.preview-close{flex:none;width:44px;height:44px;border-radius:50%;border:1px solid #b6a7ed40;color:#eee8ff;background:#b6a7ed15;font-size:26px}.preview-content{overflow:auto;max-height:70dvh;touch-action:pan-y;user-select:text}.preview-content img,.preview-content video{width:100%;max-height:65dvh;object-fit:contain}.preview-content audio{width:100%}.preview-content .creative-document{white-space:pre-wrap;line-height:1.7}.preview-download{display:inline-block;padding:12px 0}.asset:focus-visible,.cast-card:focus-visible{outline:2px solid #c2b5f4;outline-offset:3px}
/* Scroll is consumed by the gesture handler before a page can turn. */
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.project-deck .materials-content,.project-deck .scene-copy,.project-deck .text-preview,.project-deck .scene-inputs{touch-action:none}}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
 /* Geometry only: retain the existing font sizes. */
 .scenes-page{padding:72px 11px 90px;gap:8px}.scenes-page .story-strip{height:53px;gap:6px;padding-bottom:6px}.scenes-page .scene-tab{min-width:51px;width:51px;flex-basis:51px;border-radius:7px}.scenes-page .scene-art{height:29px}.scenes-page .scene-label{padding:3px 6px}
 .scenes-page .scene-detail{border-radius:13px}.scenes-page .scene-copy{display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:8px 11px;max-height:44%;flex:0 1 auto}.scenes-page .scene-copy h2{min-width:0}.scenes-page .scene-copy>p{display:block;margin:0;line-height:1.5}.scenes-page .scene-copy button{align-self:flex-start;padding:6px 8px}.scene-reference-fold summary{padding:5px 0}
 .scenes-page .scene-mode-row{order:3;justify-content:center;margin:7px 0 0;min-height:34px}.scenes-page .scene-mode-row>span{display:none}.scenes-page .mode-switch{padding:3px;gap:3px}.scenes-page .mode-switch button{padding:6px 12px}.scenes-page .scene-detail>.scene-mode-row{padding:0 0 6px;background:#0d1421;margin:0;flex:none}
 .scenes-page .viewer.has-brief-media .text-preview{display:none}.scenes-page .viewer .mobile-brief-media{display:block}
 .scene-arrow .desktop-chevron{display:none}.scene-arrow svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.scene-arrow{display:grid;place-items:center;width:28px;height:36px;border-radius:12px;background:#10192ac9;position:relative}.scene-arrow:before{content:'';position:absolute;inset:-6px}.immersive-scene-nav{inset-inline:6px;top:32%}
 .materials-page{padding-inline:14px;gap:14px}.materials-content .group{margin-bottom:10px}.materials-content .cast-gallery{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}.materials-content .cast-card{padding:8px}.materials-content .cast-portrait{max-width:80%;margin-inline:auto}.materials-content .reference-toolbar{margin:6px 0 16px}
 .cover-page .project-top{padding:22px}.cover-page .project-title>a{margin-bottom:40px}.cover-enter{left:22px;padding:11px 16px}
 .page-switcher{left:10px;bottom:calc(18px + env(safe-area-inset-bottom));max-width:calc(50% - 37px);padding:2px}.page-switcher button{padding:7px 5px;min-height:38px}
 .immersive-project #studio-navigation{left:50%;right:auto;top:auto;bottom:calc(18px + env(safe-area-inset-bottom));transform:translateX(-50%);width:42px;height:42px}
 .immersive-project #navigation-toggle{width:42px;height:42px}.immersive-project .topbar .motion-toggle{margin-right:0}
 .immersive-project .nav-panel{left:50%;right:auto;top:auto;bottom:54px;width:calc(100vw - 28px);transform:translate(-50%,10px) scale(.97);transform-origin:bottom center}.immersive-project #studio-navigation[data-open=true] .nav-panel{transform:translate(-50%,0)}
 .material-preview{padding:16px;border-radius:16px}
}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
 .scenes-page .mode-switch{margin-right:0}.scene-arrow{padding:0;min-height:36px}.page-switcher button{padding-inline:3px}
 .materials-content .cast-portrait{width:69px;height:69px;max-width:none}
}

.preview-close{display:grid;place-items:center;padding:0}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
 .scenes-page .story-strip{height:53px;padding:2px 0 6px;align-items:flex-start}
 .scenes-page .scene-tab{height:45px;min-height:0;padding:0;flex-shrink:0}
 .scenes-page .scene-art{height:27px;min-height:0}
 .scenes-page .scene-label{height:16px;min-height:0;padding:0 5px;display:block;overflow:hidden}
 .scenes-page .scene-label strong{display:block;line-height:16px;margin:0;white-space:nowrap}
}

@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){html .scenes-page .story-strip .scene-tab{transform:none!important;animation:none!important}}
/* Current project status follows the titles on every production page. */
.project-status{display:inline-flex;align-items:center;gap:6px;font-size:11px;line-height:1.5;font-weight:400;letter-spacing:0;color:#c5cbd9;white-space:nowrap}
.project-status:before{content:'';width:5px;height:5px;flex:none;border-radius:50%;background:currentColor}.project-status[data-status=ready]{color:#92d4b5}.project-status[data-status=active]{color:#bfb4ff}.project-status[data-status=failure]{color:#ff969c}.project-status[data-status=choice]{color:#c4c7ce}
.project-title>.project-status{margin:10px 0 12px}.immersive-title>.project-status{grid-column:1;grid-row:3}.materials-heading h1{font:inherit;letter-spacing:inherit;margin:0}.materials-heading>.project-status{display:flex;margin-top:5px}
.cover-actions{position:absolute;left:clamp(28px,7vw,110px);bottom:calc(105px + env(safe-area-inset-bottom));display:flex;flex-wrap:wrap;gap:10px;z-index:3}.cover-actions .cover-enter{position:static}.cover-watch{border:1px solid #d4caff66;border-radius:28px;background:#9984ed36;color:#f3efff;padding:14px 20px;font-size:13px;backdrop-filter:blur(16px)}
.cover-film{position:absolute;inset:0;z-index:5;background:#050811;display:flex;flex-direction:column;padding:85px clamp(20px,5vw,80px) 100px;gap:14px}.cover-film[hidden]{display:none}.cover-film-heading{display:grid;grid-template-columns:1fr auto;gap:6px 20px}.cover-film-heading h2{font-size:20px;margin:0}.cover-film-heading .project-status{grid-column:1}.cover-film-close{grid-column:2;grid-row:1 / span 2;align-self:center;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;padding:0;font-size:26px}.cover-film>video{width:100%;min-height:0;flex:1;object-fit:contain;touch-action:manipulation}
.orb-status-mark{display:none;position:absolute;inset:0;place-items:center;z-index:4;font-size:34px;line-height:1;font-weight:600;color:#fff;text-shadow:0 1px 5px #0006}
.orb:is([data-indicator=choice],[data-indicator=failure]) .orb-status-mark{display:grid}.orb:is([data-indicator=choice],[data-indicator=failure]) .orb-logo-mark{display:none}
.orb[data-indicator=choice] .living-sphere{filter:grayscale(1)}.orb[data-indicator=choice] .sphere-body{background:radial-gradient(ellipse at 25% 15%,#e2e4eb66,transparent 45%),#555a6680;border-color:#c4c7d0;box-shadow:inset 2px 3px 7px #fff5,0 0 16px #a9aeba70,0 0 28px #81869145}
.orb[data-indicator=failure] .sphere-body{background:radial-gradient(ellipse at 25% 15%,#ffb5b866,transparent 45%),#a31e37aa;border-color:#ff8794;box-shadow:inset 2px 3px 7px #ffd3d366,0 0 16px #ff486c88,0 0 28px #d51b454d}.orb[data-indicator=failure] .sphere-aura{background:radial-gradient(circle,#ff536d70,#dc204535 35%,transparent 69%)}.orb[data-indicator=failure] .sphere-mist{background:radial-gradient(ellipse,#ff9b9b50,transparent 68%)}.orb[data-indicator=failure] .sphere-mote{background:#ffe3e3;box-shadow:0 0 5px #ff9393}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.cover-actions{left:22px;right:22px;bottom:calc(110px + env(safe-area-inset-bottom));gap:8px}.cover-watch{padding:11px 16px}.cover-film{padding:74px 12px 94px;gap:10px}.cover-film-heading h2{font-size:18px}.hero.home-composer .hero-emblem{height:94px}.hero.home-composer .hero-emblem .living-sphere{--sphere-size:72px}}


/* Consistent production progress on Library, cover, scenes and Manager. */
.state.ready,.project-status[data-status=ready]{color:#43d995}
.state:is(.choice,.attention,.paused),.project-status:is([data-status=choice],[data-status=paused]){color:#aeb4bf}
.state:before{background:currentColor;box-shadow:none}
.state.active,.project-status[data-status=active]{color:#bfb4ff}
.state.active:before,.project-status[data-status=active]:before{animation:production-pulse 1.4s ease-in-out infinite}
.working-status{display:flex;align-items:center;gap:9px}
.working-status:before{content:'';width:12px;height:12px;flex:none;border:2px solid #bfb4ff40;border-top-color:#bfb4ff;border-radius:50%;animation:production-spin 1s linear infinite}
@keyframes production-pulse{0%,100%{opacity:1;box-shadow:0 0 0 0 #bfb4ff60}50%{opacity:.55;box-shadow:0 0 0 5px #bfb4ff00}}
@keyframes production-spin{to{transform:rotate(360deg)}}
.card-art,.scene-art,.viewer{position:relative}
.duration-badge{position:absolute;top:10px;right:10px;z-index:3;padding:4px 7px;border-radius:6px;background:#070b15d9;color:#fff;font-size:12px;font-weight:550;font-variant-numeric:tabular-nums;line-height:1.2;pointer-events:none}
.cover-page .project-top>.duration-badge{top:calc(76px + env(safe-area-inset-top));right:20px}
.scenes-page .scene-art>.duration-badge{top:2px;right:2px;font-size:9px;padding:1px 3px;border-radius:3px}
.scene-progress{margin-top:7px}
.scene-position{white-space:normal;text-align:right;font-size:11px;max-width:160px}
.orb[data-indicator=ready] .orb-caption{color:#43d995}
.orb[data-indicator=choice] .orb-caption{color:#aeb4bf}
@media(prefers-reduced-motion:reduce){.state.active:before,.project-status[data-status=active]:before,.working-status:before{animation:none}}

.asset-preview,.cast-portrait{position:relative;display:block;overflow:hidden}
.version-badge{position:absolute;top:7px;right:7px;z-index:3;background:#080d18dd;color:#fff;padding:3px 6px;border-radius:5px;font-size:11px;line-height:1.3;font-variant-numeric:tabular-nums;pointer-events:none}
.asset-preview>img,.asset-preview>video{width:100%;display:block;object-fit:cover}
.reference-review form{display:grid;gap:10px;padding:16px 0;border-bottom:1px solid var(--line)}
.reference-review label{display:grid;gap:5px}.reference-review input,.reference-review select{width:100%;min-width:0;font-size:16px;padding:10px}
.home-attachments{margin:12px 0;text-align:left}.home-attachments button{font-size:12px}.home-attachments #home-file-list>div{overflow-wrap:anywhere;font-size:13px;margin:6px 0}
#prompt-editor textarea{min-height:220px}
.audio-role-options{border:0;padding:0;margin:8px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.audio-role-options legend{margin-bottom:10px;font-weight:550}
.reference-review .audio-role-options label{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:10px;min-height:44px;font-size:14px}
.reference-review .audio-role-options input{width:auto;min-height:0;flex:none;accent-color:#a99aff}
.audio-role-options label:has(input:checked){border-color:#a99aff;background:#a99aff20}

.delete-project{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin-left:12px;padding:10px;vertical-align:middle;cursor:pointer}.delete-project:hover{color:#ff9a9a}.delete-project:focus-visible{outline:2px solid currentColor;outline-offset:3px}

.cover-page .project-top{position:relative}
.cover-page .project-top .cover-delete{position:absolute;top:12px;right:12px;z-index:5;margin:0;width:44px;height:44px;padding:14px;background:rgba(15,18,30,.55);border-radius:50%;color:#fff}
.cover-delete svg{width:16px;height:16px}
.cover-page .project-top>.duration-badge{right:64px}
.cover-facts{display:flex;flex-wrap:wrap;gap:8px 24px;margin-top:16px;font-size:14px;font-variant-numeric:tabular-nums}
.state.active:before,.project-status[data-status=active]:before{width:10px;height:10px;background:#c6b6ff;animation:production-pulse 1.1s ease-out infinite}
@keyframes production-pulse{0%{opacity:1;transform:scale(1);box-shadow:0 0 10px 2px #b69bffcc,0 0 0 0 #b69bff99}60%{opacity:1;transform:scale(1.2);box-shadow:0 0 16px 4px #b69bffbb,0 0 0 10px #b69bff00}100%{opacity:.85;transform:scale(1);box-shadow:0 0 10px 2px #b69bff99,0 0 0 12px #b69bff00}}
@media(prefers-reduced-motion:reduce){.state.active:before,.project-status[data-status=active]:before{animation:none}}

/* Mobile density: vertical spacing 80%, text 90%; retain widths, geometry and media proportions. */
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
.immersive-project #app{padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0}
.cover-page .project-top{padding-top:clamp(22.4px,5.6vw,88px);padding-bottom:clamp(22.4px,5.6vw,88px);margin-top:0;margin-bottom:0}
.cover-page .project-title>a{margin-bottom:clamp(32px,8vh,80px)}
.cover-page .project-title h1{font-size:clamp(37.8px,6.3vw,90px)}
.cover-page .project-title p{font-size:13.5px}
.cover-enter{padding-top:11.2px;padding-bottom:11.2px;font-size:11.7px}
.page-switcher{row-gap:3.2px;padding-top:4px;padding-bottom:4px}
.page-switcher button{padding-top:7.2px;padding-bottom:7.2px;font-size:9.9px}
.scenes-page{padding-top:64px;padding-bottom:70.4px;row-gap:11.2px}
.immersive-title{row-gap:2.4px}
.immersive-title h1{font-size:clamp(18px,2.07vw,28.8px);margin-top:0;margin-bottom:0}
.immersive-label{font-size:9px}
.scene-position{font-size:10.8px}
.scenes-page>section>.section-head{margin-top:7.2px;margin-bottom:7.2px}
.scenes-page .story-strip{row-gap:6.4px;margin-top:0;margin-bottom:0;padding-top:1.6px;padding-bottom:6.4px}
.scenes-page .scene-label{padding-top:3.2px;padding-bottom:3.2px}
.scenes-page .scene-label strong{font-size:9px}
.scenes-page .play-badge{font-size:7.2px;padding-top:2.4px;padding-bottom:2.4px}
.scenes-page .viewer .text-preview{padding-top:19.2px;padding-bottom:19.2px}
.scenes-page .scene-copy{padding-top:9.6px;padding-bottom:9.6px;row-gap:6.4px}
.scenes-page .scene-copy h2{font-size:13.5px;margin-top:0;margin-bottom:0}
.scenes-page .scene-copy>span{font-size:9.9px}
.scenes-page .scene-copy button{font-size:9.9px;padding-top:5.6px;padding-bottom:5.6px;margin-top:0;margin-bottom:0}
.scene-reference-fold{font-size:9.9px}
.scene-reference-fold summary{padding-top:4.8px;padding-bottom:4.8px}
.scene-reference-fold .scene-inputs{padding-top:6.4px;padding-bottom:6.4px;row-gap:6.4px}
.scene-arrow{font-size:25.2px}
.materials-page{padding-top:68px;padding-bottom:70.4px;row-gap:16px}
.materials-heading{font-size:clamp(21.6px,2.7vw,36px)}
.materials-content{padding-top:0;padding-bottom:16px}
.materials-content .group{margin-top:0;margin-bottom:9.6px}
.materials-content .reference-toolbar{margin-top:6.4px;margin-bottom:16px}
.materials-content .final-cut{margin-top:0;margin-bottom:0}
.immersive-project .waiting{margin-top:0;margin-bottom:0}
.immersive-project input,.immersive-project textarea,.immersive-project select{font-size:14.4px}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.scenes-page{padding-top:57.6px;padding-bottom:72px;row-gap:8px}
.immersive-title h1{font-size:18.9px}
.immersive-label{font-size:8.1px}
.scenes-page .scene-copy{padding-top:8px;padding-bottom:8px;row-gap:4.8px}
.scenes-page .scene-copy h2{font-size:11.7px}
.scenes-page .scene-copy button{font-size:9px}
.scenes-page .viewer .text-preview{font-size:12.6px;padding-top:16px;padding-bottom:16px}
.materials-page{padding-top:62.4px;padding-bottom:72px;row-gap:14.4px}
.materials-heading{font-size:24.3px}
.cover-page .project-top{padding-top:22.4px;padding-bottom:22.4px}
.cover-page .project-title h1{font-size:clamp(34.2px,9.9vw,54px)}
.cover-page .project-title p{font-size:11.7px}
.cover-page .project-title>a{margin-bottom:40px}
.page-switcher{row-gap:0;padding-top:2.4px;padding-bottom:2.4px}
.page-switcher button{font-size:9px;padding-top:6.4px;padding-bottom:6.4px}}
.material-preview{padding-top:16px;padding-bottom:16px}
.preview-heading{row-gap:16px;margin-bottom:12.8px}
.preview-heading h2{font-size:18px;margin-top:0;margin-bottom:0}
.preview-close{font-size:23.4px}
.preview-download{padding-top:9.6px;padding-bottom:9.6px}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.scenes-page{padding-top:57.6px;padding-bottom:72px;row-gap:6.4px}
.scenes-page .story-strip{row-gap:4.8px;padding-bottom:4.8px}
.scenes-page .scene-label{padding-top:2.4px;padding-bottom:2.4px}
.scenes-page .scene-copy{row-gap:4px;padding-top:6.4px;padding-bottom:6.4px}
.scenes-page .scene-copy>p{margin-top:0;margin-bottom:0}
.scenes-page .scene-copy button{padding-top:4.8px;padding-bottom:4.8px}
.scene-reference-fold summary{padding-top:4px;padding-bottom:4px}
.scenes-page .scene-mode-row{margin-top:5.6px;margin-bottom:0}
.scenes-page .mode-switch{padding-top:2.4px;padding-bottom:2.4px;row-gap:2.4px}
.scenes-page .mode-switch button{padding-top:4.8px;padding-bottom:4.8px}
.scenes-page .scene-detail>.scene-mode-row{padding-top:0;padding-bottom:4.8px;margin-top:0;margin-bottom:0}
.materials-page{row-gap:11.2px}
.materials-content .group{margin-bottom:8px}
.materials-content .cast-gallery{row-gap:8px}
.materials-content .cast-card{padding-top:6.4px;padding-bottom:6.4px}
.materials-content .reference-toolbar{margin-top:4.8px;margin-bottom:12.8px}
.cover-page .project-top{padding-top:17.6px;padding-bottom:17.6px}
.cover-page .project-title>a{margin-bottom:32px}
.cover-enter{padding-top:8.8px;padding-bottom:8.8px}
.page-switcher{padding-top:1.6px;padding-bottom:1.6px}
.page-switcher button{padding-top:5.6px;padding-bottom:5.6px}
.material-preview{padding-top:12.8px;padding-bottom:12.8px}}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.scene-arrow{padding-top:0;padding-bottom:0}}
.preview-close{padding-top:0;padding-bottom:0}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.scenes-page .story-strip{padding-top:1.6px;padding-bottom:4.8px}
.scenes-page .scene-tab{padding-top:0;padding-bottom:0}
.scenes-page .scene-label{padding-top:0;padding-bottom:0}
.scenes-page .scene-label strong{margin-top:0;margin-bottom:0}}
.project-status{row-gap:4.8px;font-size:9.9px}
.project-title>.project-status{margin-top:8px;margin-bottom:9.6px}
.materials-heading h1{margin-top:0;margin-bottom:0}
.materials-heading>.project-status{margin-top:4px}
.cover-actions{row-gap:8px}
.cover-watch{padding-top:11.2px;padding-bottom:11.2px;font-size:11.7px}
.cover-film{padding-top:68px;padding-bottom:80px;row-gap:11.2px}
.cover-film-heading{row-gap:4.8px}
.cover-film-heading h2{font-size:18px;margin-top:0;margin-bottom:0}
.cover-film-close{padding-top:0;padding-bottom:0;font-size:23.4px}
.orb-status-mark{font-size:30.6px}
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){.cover-actions{row-gap:6.4px}
.cover-watch{padding-top:8.8px;padding-bottom:8.8px}
.cover-film{padding-top:59.2px;padding-bottom:75.2px;row-gap:8px}
.cover-film-heading h2{font-size:16.2px}}
.working-status{row-gap:7.2px}
.duration-badge{padding-top:3.2px;padding-bottom:3.2px;font-size:10.8px}
.scenes-page .scene-art>.duration-badge{font-size:8.1px;padding-top:0.8px;padding-bottom:0.8px}
.scene-progress{margin-top:5.6px}
.scene-position{font-size:9.9px}
.version-badge{padding-top:2.4px;padding-bottom:2.4px;font-size:9.9px}
.reference-review form{row-gap:8px;padding-top:12.8px;padding-bottom:12.8px}
.reference-review label{row-gap:4px}
.reference-review input,.reference-review select{font-size:14.4px;padding-top:8px;padding-bottom:8px}
.home-attachments{margin-top:9.6px;margin-bottom:9.6px}
.home-attachments button{font-size:10.8px}
.home-attachments #home-file-list>div{font-size:11.7px;margin-top:4.8px;margin-bottom:4.8px}
.audio-role-options{padding-top:0;padding-bottom:0;margin-top:6.4px;margin-bottom:6.4px;row-gap:6.4px}
.audio-role-options legend{margin-bottom:8px}
.reference-review .audio-role-options label{row-gap:6.4px;padding-top:8px;padding-bottom:8px;font-size:12.6px}
.delete-project{padding-top:8px;padding-bottom:8px}
.cover-page .project-top .cover-delete{margin-top:0;margin-bottom:0;padding-top:11.2px;padding-bottom:11.2px}
.cover-facts{row-gap:6.4px;margin-top:12.8px;font-size:12.6px}
:root{font-size:90%}
input:not([type=checkbox]):not([type=radio]),textarea,select{font-size:16px!important}
button,summary,a.button{min-height:44px!important}
}


/* Mobile layout correction: anchors and content tracks are not density-scaled. */
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
  .immersive-project #studio-navigation{left:50%;right:auto;top:auto;bottom:calc(18px + env(safe-area-inset-bottom));transform:translateX(-50%);width:44px;height:44px}
  .immersive-project #navigation-toggle{width:44px;height:44px;min-height:44px}
  .immersive-project .nav-panel{left:50%;right:auto;top:auto;bottom:56px;width:calc(100vw - 28px);transform:translate(-50%,10px) scale(.97);transform-origin:bottom center}
  .immersive-project #studio-navigation[data-open=true] .nav-panel{transform:translate(-50%,0)}
  .immersive-project .topbar .motion-toggle{margin-right:0}
  .cover-page .project-top{align-items:flex-end;padding-top:calc(72px + env(safe-area-inset-top));padding-bottom:calc(164px + env(safe-area-inset-bottom))}
  .cover-page .project-title{max-height:100%;overflow-y:auto;touch-action:pan-y}
  .cover-page .project-title>a{margin-bottom:16px}
  .scenes-page{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
  .scenes-page .story-strip{height:56px;min-height:56px;flex:0 0 56px;padding:2px 0 8px;overflow-x:auto}
  .scenes-page .scene-tab{height:44px;min-height:44px;flex-shrink:0}
  .scenes-page .scene-art{height:26px;min-height:26px}
  .scenes-page .scene-label{height:16px;min-height:16px;line-height:16px}
  .scenes-page .scene-label strong{line-height:16px}
  .cast-card>p{display:none}
}


/* Desktop metadata within the original scrolling workspace. */
@media(min-width:761px) and (min-height:601px), (min-width:761px) and (hover:hover){
  body:not(.immersive-project) .project-top .cover-delete{position:absolute;top:12px;right:12px;z-index:5;margin:0;width:44px;height:44px;padding:14px;border-radius:50%;background:#0f121e8c}
  body:not(.immersive-project) .project-top>.duration-badge{top:18px;right:64px}
  body:not(.immersive-project) .project-top .hero-whisper{display:none}
  body:not(.immersive-project) .project-title{padding-right:40px}
}
/* Mobile content uses available width; only spacing becomes denser. */
@media(max-width:760px), (hover:none) and (pointer:coarse) and (max-height:600px){
  .cover-page .project-title,.cover-page .project-title h1,.cover-page .project-title p{width:100%;max-width:100%;min-width:0}
  .scenes-page>section,.scenes-page .scene-detail,.materials-content{min-width:0;width:100%}
  .scenes-page .viewer img,.scenes-page .viewer video{object-fit:contain}
  .scenes-page .scene-tab{width:64px;min-width:64px;flex:0 0 64px}
  .cast-portrait{flex-shrink:0;aspect-ratio:1}
  .scene-arrow{min-width:44px;min-height:44px}
  .cover-page .project-top .cover-delete{width:44px;height:44px;padding:14px}
}
@media (orientation:landscape) and (hover:none) and (pointer:coarse) and (max-height:600px){
 body.scene-playing .project-page[data-position=current].scenes-page{transform:none!important;overflow:visible!important}
 body.scene-playing .scenes-page .scene-detail{transform:none!important;overflow:visible!important}
 body.scene-playing .scenes-page .viewer{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-height:none!important;padding:0!important;border:0!important;border-radius:0!important;background:#000!important;z-index:10000!important}
 body.scene-playing .scenes-page .viewer video{width:100%!important;height:100%!important;max-height:none!important;object-fit:contain!important;border-radius:0!important}
 body.scene-playing .scenes-page .viewer .duration-badge{display:none}
 body.scene-playing .project-deck{perspective:none!important;transform:none!important}
 body.scene-playing .project-page{will-change:auto!important}
 body.scene-playing #orb,body.scene-playing .page-switcher,body.scene-playing #studio-navigation{visibility:hidden}
}

/* Saved reference editors close only after an acknowledged save. */
.reference-review form[hidden],.reference-review [data-reference-summary][hidden],.reference-review [data-edit-reference][hidden]{display:none}
.reference-saved-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.reference-saved-summary>div{min-width:0;overflow-wrap:anywhere}
.reference-saved-summary p{margin:4px 0}.reference-saved-summary button{min-height:44px;flex:none}

.reference-saved-summary{flex-wrap:wrap}.reference-saved-summary>div{flex:1 1 160px}
.reference-review [data-remove-reference],.reference-review [data-restore-reference]{min-height:44px}
.removed-references{margin-top:20px}.removed-references>summary{min-height:44px;cursor:pointer}
