/* Final presentation-only overrides for tablet and phone layouts.
   Keep this file last: it must not change API, routing or production behavior. */
html,body{width:100%;max-width:100%;overflow-x:clip}
body{min-height:100%;overscroll-behavior-x:none}
.app,.app>*,main,.view,.page,.modules,.module-page-body{min-width:0;max-width:100%}
img,video,audio,canvas,iframe,svg{max-width:100%}
video,audio{height:auto}
input,select,textarea,button{max-width:100%}
.commands,.tabs,.subtabs,.module-subtabs,.my-task-tabs,.studio-department-tabs,.leave-filters{min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;overscroll-behavior-x:contain}
.commands>*,.tabs>*,.subtabs>*,.module-subtabs>*,.my-task-tabs>*,.studio-department-tabs>*,.leave-filters>*{flex:0 0 auto}
.desktop-tool-window,.web-modal-card,.fenrir-window,.data-safe-window,.studio-config-window,.enneagram-window,.recruiting-browser-window{box-sizing:border-box;max-width:calc(100vw - 16px)}
.desktop-tool-body,.web-modal-body{min-width:0;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
.pipeline-form,.pipeline-form label,.pipeline-form input,.pipeline-form select,.pipeline-form textarea{min-width:0;width:100%}
.review-workspace>*,.checker-main>*,.image-review-layout>*,.asset-review-3d>*,.mail-workspace>*,.leave-workspace>*{min-width:0}
.asset-review-fullscreen-open{overflow:hidden!important}
.asset-review-3d.asset-review-fullscreen{position:fixed!important;inset:0!important;z-index:10020!important;width:100vw!important;height:100dvh!important;max-height:none!important;background:#08030f!important;display:grid!important;grid-template-columns:minmax(220px,300px) minmax(0,1fr)!important;overflow:hidden!important}
.asset-review-3d.asset-review-fullscreen .asset-review-sidebar{display:flex!important;flex-direction:column!important;width:auto!important;max-height:100dvh!important;overflow:auto!important}
.asset-review-3d.asset-review-fullscreen .asset-review-view{min-width:0!important;min-height:0!important;height:100dvh!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important}
.asset-review-3d.asset-review-fullscreen .asset-review-stage{height:auto!important;min-height:0!important}
.asset-review-3d.asset-review-fullscreen #assetReviewDrawCanvas{z-index:4!important}
@media(max-width:800px){.asset-review-3d.asset-review-fullscreen{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(150px,34dvh) minmax(0,1fr)!important}.asset-review-3d.asset-review-fullscreen .asset-review-sidebar{width:100%!important;max-height:34dvh!important}.asset-review-3d.asset-review-fullscreen .asset-review-view{height:auto!important;min-height:0!important}}
.screen video,.image-review-canvas img,.image-review-canvas video{width:100%;height:100%;object-fit:contain}
@media(max-width:1180px){
 html,body{height:auto;min-height:100%;overflow-y:auto}
 .app{width:100%;height:auto;min-height:100dvh;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto auto minmax(0,1fr) auto;padding-left:env(safe-area-inset-left,0);padding-right:env(safe-area-inset-right,0)}
 .identity{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;height:auto}
 .identity .brand{grid-column:1/-1;min-width:0}.identity label{display:flex!important;min-width:0;white-space:normal}.identity select{width:100%;max-width:none}
 .section{position:static;min-width:0}main{min-width:0;min-height:0;overflow:visible}.view,.view.active{height:auto;min-height:0;max-width:100%}.page,.modules{padding:12px;overflow:visible}
 .desktop-tool-window,.fenrir-window,.data-safe-window,.studio-config-window,.enneagram-window,.recruiting-browser-window{position:fixed!important;inset:max(8px,env(safe-area-inset-top,0)) 8px max(8px,env(safe-area-inset-bottom,0)) 8px!important;width:auto!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;resize:none}
 .web-modal{padding:max(8px,env(safe-area-inset-top,0)) 8px max(8px,env(safe-area-inset-bottom,0))}.web-modal-card{width:100%;max-height:calc(100dvh - 16px)}
 .review-workspace,.review-workspace.desktop-player-layout,.checker-main,.image-review-layout,.image-review-layout.storyboard-review{grid-template-columns:minmax(0,1fr);height:auto}
 .review-workspace .screen{width:100%;height:auto;min-height:0;aspect-ratio:16/9}.review-workspace .screen video{position:absolute;inset:0}
 .player-browser,.review-queue{width:100%;min-height:0;max-height:42dvh;overflow:auto}.asset-review-3d{height:auto;min-height:0;overflow:visible}.asset-review-stage{height:50dvh;min-height:240px}
 .manager-table,.shot-table,.gantt-board,.agenda-week{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
 .draw,.transport,.playerbar,.review-head,.review-head>div,.module-page-head,.title,.pipeline-search,.agenda-toolbar{flex-wrap:wrap;min-width:0;max-width:100%}
 .app>footer{position:static;width:100%;height:auto;min-height:44px;overflow-x:auto;overflow-y:hidden;justify-content:flex-start;flex-wrap:nowrap;padding:4px 8px max(4px,env(safe-area-inset-bottom,0));-webkit-overflow-scrolling:touch}.app>footer>*{display:flex!important;flex:0 0 auto}
}
@media(max-width:700px){
 .identity{grid-template-columns:minmax(0,1fr)}.identity .brand{grid-column:1}.identity label{flex-direction:column;align-items:stretch}.identity input,.identity select,input,select,textarea{font-size:16px}
 .section{align-items:stretch;flex-direction:column;padding:7px 8px}.section label,.section select{width:100%}.section .role-note{white-space:normal;overflow-wrap:anywhere}
 .core.view.active{display:grid;grid-template-columns:minmax(0,1fr)}.core .agent{display:flex;width:auto;min-height:88px;padding:8px;justify-content:center}.core .center{width:100%;min-height:0;grid-template-rows:auto minmax(260px,45dvh) auto auto}
 .selectors{width:auto;max-width:100%;padding:10px}.chat{min-height:260px;margin:0 8px;padding:12px}
 #composer{grid-template-columns:repeat(4,minmax(0,1fr));margin:6px 8px;gap:5px}#composer textarea{grid-column:1/-1;min-width:0;min-height:88px;padding:12px;font-size:16px}#composer button{min-width:0;padding-inline:6px}
 .draw,.transport,.playerbar{overflow-x:auto;flex-wrap:nowrap}.draw>*,.transport>*,.playerbar>*{flex:0 0 auto}.screen{min-height:200px;aspect-ratio:16/9}
 .asset-review-3d{display:flex;flex-direction:column;min-height:0}.asset-review-sidebar{width:100%;min-height:0;max-height:40dvh;overflow:auto}.asset-review-view{min-height:0}.asset-review-stage{height:48dvh;min-height:220px}
 .kpis,.cards,.platform-cards,.business-form,.studio-settings-grid,.studio-artist-form,.audio-workspace,.reference-image-viewer,.recruiting-browser-grid{grid-template-columns:minmax(0,1fr)!important}
 .status-manager-list>article,.role-manager-list article,.studio-artist-row,.document-row,.my-task-card,.task-file-row{grid-template-columns:minmax(0,1fr)!important}
 .floating-chat{left:6px!important;right:6px!important;bottom:max(6px,env(safe-area-inset-bottom,0))!important;width:auto!important;height:min(72dvh,620px)!important;max-width:none!important}
}
@media(max-width:430px){
 .brand b{font-size:10px;line-height:1.25;overflow-wrap:anywhere}.brand img{width:58px;height:28px}.commands button,.tabs button{min-height:44px;font-size:11px}.page,.modules{padding:8px}
 .desktop-tool-window,.fenrir-window,.data-safe-window,.studio-config-window,.enneagram-window,.recruiting-browser-window{inset:max(4px,env(safe-area-inset-top,0)) 4px max(4px,env(safe-area-inset-bottom,0)) 4px!important}.web-modal{padding:4px}.web-modal-card{max-width:calc(100vw - 8px);max-height:calc(100dvh - 8px)}
}

/* Fullscreen review presentation only: keep production controls reachable. */
#tasks .player:fullscreen,
#tasks .player:-webkit-full-screen,
#tasks .player.review-pseudo-fullscreen{
 position:fixed!important;inset:0!important;z-index:100000!important;
 display:flex;width:100vw;height:100dvh;min-width:0;min-height:0;
 padding:0;background:#000;border:0;overflow:hidden
}
#tasks .player:fullscreen #reviewScreen,
#tasks .player:-webkit-full-screen #reviewScreen,
#tasks .player.review-pseudo-fullscreen #reviewScreen{
 flex:1;width:100%;height:100%;min-height:0;aspect-ratio:auto;border:0
}
#tasks .player:fullscreen #drawingTools,
#tasks .player:-webkit-full-screen #drawingTools,
#tasks .player.review-pseudo-fullscreen #drawingTools{
 position:absolute;z-index:30;top:max(12px,env(safe-area-inset-top,0));right:max(12px,env(safe-area-inset-right,0));
 display:flex!important;flex-direction:column;align-items:stretch;gap:6px;width:min(190px,38vw);max-height:calc(100dvh - 86px);
 padding:9px;overflow:auto;background:#0a0611e8;border:1px solid #8750a3;border-radius:8px;box-shadow:0 8px 28px #000b;
 backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)
}
#tasks .player:fullscreen #drawingTools>*,
#tasks .player:-webkit-full-screen #drawingTools>*,
#tasks .player.review-pseudo-fullscreen #drawingTools>*{flex:0 0 auto;min-width:0;width:100%;margin:0}
#tasks .player:fullscreen .transport,
#tasks .player:-webkit-full-screen .transport,
#tasks .player.review-pseudo-fullscreen .transport{
 position:absolute;z-index:31;left:50%;bottom:max(12px,env(safe-area-inset-bottom,0));transform:translateX(-50%);
 width:max-content;max-width:calc(100vw - 24px);overflow-x:auto;flex-wrap:nowrap;background:#0a0611e8;border:1px solid #8750a3;border-radius:8px;box-shadow:0 8px 28px #000b
}
#tasks .player:fullscreen .timeline,
#tasks .player:-webkit-full-screen .timeline,
#tasks .player.review-pseudo-fullscreen .timeline,
#tasks .player:fullscreen .review-notes,
#tasks .player:-webkit-full-screen .review-notes,
#tasks .player.review-pseudo-fullscreen .review-notes{display:none}

#modulePageBody:fullscreen,
#modulePageBody:-webkit-full-screen{
 position:relative;display:grid;width:100vw;height:100dvh;min-height:0;
 padding:max(8px,env(safe-area-inset-top,0)) max(8px,env(safe-area-inset-right,0)) max(8px,env(safe-area-inset-bottom,0)) max(8px,env(safe-area-inset-left,0));
 grid-template-rows:auto minmax(0,1fr);gap:8px;background:#080611;overflow:hidden
}
#modulePageBody:fullscreen>.checker-head,
#modulePageBody:-webkit-full-screen>.checker-head{
 position:relative;z-index:30;display:flex!important;max-height:34dvh;overflow:auto;align-items:end;flex-wrap:wrap;background:#111d;border:1px solid #4b2a65;border-radius:7px
}
#modulePageBody:fullscreen>.checker-main,
#modulePageBody:-webkit-full-screen>.checker-main{min-height:0;height:100%;grid-template-columns:minmax(0,1fr) minmax(220px,290px)}
#modulePageBody:fullscreen .checker-main>section,
#modulePageBody:-webkit-full-screen .checker-main>section{min-height:0;grid-template-rows:auto auto minmax(0,1fr) auto auto}
#modulePageBody:fullscreen .checker-stage,
#modulePageBody:-webkit-full-screen .checker-stage{height:100%;min-height:0}
#modulePageBody:fullscreen .checker-result,
#modulePageBody:-webkit-full-screen .checker-result{display:none}
@media(max-width:700px){
 #tasks .player:fullscreen #drawingTools,#tasks .player:-webkit-full-screen #drawingTools,#tasks .player.review-pseudo-fullscreen #drawingTools{top:max(6px,env(safe-area-inset-top,0));right:max(6px,env(safe-area-inset-right,0));width:min(156px,46vw);max-height:70dvh;padding:6px}
 #modulePageBody:fullscreen>.checker-main,#modulePageBody:-webkit-full-screen>.checker-main{grid-template-columns:minmax(0,1fr)}
 #modulePageBody:fullscreen .checker-browser,#modulePageBody:-webkit-full-screen .checker-browser{display:none}
}

/* Main navigation: all tabs visible without horizontal scrolling. */
#tabs{display:flex;flex-wrap:wrap!important;overflow:visible!important;height:auto!important;min-width:0;max-width:100%;gap:3px;flex-shrink:0}#tabs>button{flex:1 1 110px!important;min-width:0!important;max-width:100%;white-space:normal!important;overflow-wrap:anywhere;padding:8px 10px;min-height:36px}

/* Compact single-row navigation. */
#tabs{display:flex;flex-wrap:nowrap!important;overflow:hidden!important;height:auto!important;min-width:0;max-width:100%;gap:2px;flex-shrink:0}#tabs>button{flex:1 1 0!important;min-width:0!important;max-width:100%;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;padding:8px 3px!important;min-height:34px;font-size:clamp(9px,.63vw,12px)!important;letter-spacing:0!important}
