/* Keep the existing 40/60 mobile composition; only stabilize its viewport. */
body:not(.static-mode) .stage,body.loading-motion .stage {
 inset:0 0 auto;height:100vh;height:100svh;min-height:0;margin:0;overflow:hidden;
}
body.loading-motion #scene {display:block!important;}
/* Do not let the static document's next-room photographs cover the fixed
   entrance poster during preparation. Keep their layout space unchanged. */
body.loading-motion .room-still,body.loading-motion .screening-opening-poster {visibility:hidden;}
body:not(.static-mode) .stage .still,body.loading-motion .stage .still {
 position:absolute;inset:0;width:100%;height:100%;overflow:hidden;
}
/* Desktop uses the original horizontal 36mm/35mm framing. */
body:not(.static-mode) .stage .still img,body.loading-motion .stage .still img {
 position:absolute;inset:auto;width:100%;height:auto;left:0;top:50%;
 transform:translateY(-50%);object-fit:contain;aspect-ratio:8/5;
}
/* Transparent wrappers preserve the desktop layout and its original stage. */
.room-panel,.room-view{display:contents}
#story .entry-mobile-still{display:none}

/* Static and loading frames keep their approved mobile composition.
   Motion on uses the original fixed stage and scrolling chapter copy. */
@media(max-width:700px){
 body .stage,body.static-mode .stage,body.loading-motion .stage{
  position:fixed;inset:0 0 auto;width:100%;height:100svh;min-height:0;margin:0;
  visibility:hidden;overflow:hidden;
 }
 #story .chapter{padding-top:40px;padding-bottom:35px}
 #story .chapter.entry{padding-top:0}
 #story .room-panel{display:block;position:relative}
 #story .room-view{
  display:block;position:relative;isolation:isolate;
  width:calc(100% + 2 * var(--gutter));height:calc(100vw - 2 * var(--gutter));
  margin:0 calc(-1 * var(--gutter));overflow:hidden;
 }
 #story .entry .room-view{height:100vw}
 #story .room-view .room-still{
  display:block;visibility:visible;position:absolute;inset:0;
  width:100%;height:100%;max-width:none;margin:0;
 }
 #story .room-view .room-still img{
  display:block;position:absolute;inset:0;width:100%;height:100%;
  max-width:none;max-height:none;aspect-ratio:auto;transform:none;
  object-fit:cover;object-position:50% 95%;
 }
 #story .production .room-still img,#story .screening .room-still img{object-position:50% 100%}
 #story .room-view .screening-opening-poster{display:none;margin:0}
 .preparing-motion #story #work .room-still{display:block;visibility:hidden}
 .preparing-motion #story #work .screening-opening-poster{
  display:block;position:absolute;inset:0;width:100%;height:100%;margin:0;object-fit:cover;
 }
 #story .room-panel .copy{
  position:relative;top:auto;max-width:none;padding:0;margin:28px 0 0;opacity:1;
 }
 body.scene-ready:not(.static-mode) #story .chapter:not(.current-chapter) .copy{opacity:1}
 #story .entry .room-panel .copy{margin-top:40px}
 #story .chapter h1{font-size:12.24vw;line-height:1.02}
 #story .chapter h2{font-size:10.44vw;line-height:1.02}
 #story .room-view .motion-loading{position:absolute;inset:0;width:100%;height:100%;z-index:2}
 body.static-mode #story .chapter{height:auto;min-height:0}
 /* Keep the fixed 40svh/60svh camera viewport, including the first hidden
    draw during loading. Toolbar changes do not replace svh with dynamic vh. */
 body:not(.static-mode) .stage{visibility:visible}
 body:not(.static-mode) #scene,body.loading-motion #scene,
 body:not(.static-mode) .stage .still,body.loading-motion .stage .still{
  inset:40svh 0 auto;width:100%;height:60svh;
 }
 body:not(.static-mode) .stage .still img,body.loading-motion .stage .still img{
  inset:0;left:0;top:0;width:100%;height:100%;max-width:none;
  aspect-ratio:auto;transform:none;object-fit:cover;
 }
 body:not(.static-mode) #story .room-panel{display:contents}
 body:not(.static-mode) #story .room-view{display:none}
 /* The original bounded sticky copy scrolls out at each chapter boundary;
    only the canvas stays fixed. Retain the latest font metrics and gutters. */
 body:not(.static-mode) #story .room-panel .copy{
  position:sticky;top:12svh;margin:0;padding-bottom:10svh;
 }

}
