/* PUBLIC shell only. Media, cube, carousel geometry and editor are unchanged. */
html.fdPublicScene {
  --fd-surface-height:100dvh;
  height:var(--fd-surface-height);overflow:hidden;overscroll-behavior:none;
}
/* Installed iOS can report a visual viewport / dvh shorter than the drawable screen.
   Use the full CSS viewport for paint, never screen.height or an invented safe-area sum.
   Keep the root in normal positioning: fixed root boxes are clipped by WebKit. */
html.fdPublicScene.fdStandaloneScene {--fd-surface-height:100vh;}
body[data-mode="public"] {
  position:relative;width:100%;height:var(--fd-surface-height,100dvh);min-height:0!important;
  margin:0;padding:0!important;overflow:hidden!important;overscroll-behavior:none;
}
body[data-mode="public"]>.app {
  height:var(--fd-scene-height,100%);min-height:0!important;overflow:hidden;overscroll-behavior:none;
}
/* The original background node lives beside .app, so short-screen scroll/clipping
   affects controls only. No negative inset, extra image zoom or crop-data changes. */
body[data-mode="public"]>#homeBackdrop {
  position:absolute;inset:0;width:100%;height:100%;
}
/* One full-screen reference for both the video layer and its inner sliding panels.
   Override the historical 100dvh of screenWrap; never crop/stretch the film itself. */
body[data-mode="public"]>#viewerLayer {
  position:absolute!important;height:100%;
}
body[data-mode="public"] #viewerLayer .screenWrap {
  height:100%;
}
/* This carousel is driven by pointer events, not native scrolling. Keep pinch zoom. */
body[data-mode="public"] #rail,
body[data-mode="public"] #rail .tile {
  touch-action:pinch-zoom!important;
}
/* Long reading panels and the compact vertical menus remain native scroll containers. */
body[data-mode="public"] .layer:not(#viewerLayer),
body[data-mode="public"] .compactNames,
body[data-mode="public"] #partnerInlineNames {
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
}
body[data-mode="public"] .layer:not(#viewerLayer) {
  height:var(--fd-scene-height,100dvh);max-height:var(--fd-scene-height,100dvh);
}
/* On a genuinely short viewport / enlarged text, allow necessary scene scrolling
   instead of hiding the footer. The backdrop stays fixed and the rail keeps its gestures. */
body[data-mode="public"].fdSceneNeedsScroll>.app {overflow-y:auto;overflow-x:hidden;}
/* Only while a text field is focused and the keyboard reduces the visible viewport.
   No keyboard or visual-viewport override is applied to the video player or game. */
html.fdSceneKeyboard body[data-mode="public"] .layer:not(#viewerLayer) {
  top:var(--fd-panel-top,0px)!important;bottom:auto!important;
  height:var(--fd-panel-height,100%)!important;max-height:var(--fd-panel-height,100%)!important;
  scroll-padding-top:18px;scroll-padding-bottom:24px;
}
