/* Visible window height stays unchanged. The bottom gesture inset belongs
   inside the dock, exactly once. iOS standalone may report zero under contain. */
:root { --dock-gesture-inset:env(safe-area-inset-bottom,0px); }
:root[data-ios-standalone="true"] { --dock-gesture-inset:max(24px,env(safe-area-inset-bottom,0px)); }
html { height:100%; overflow:hidden; background:#0b191e; }
body {
  position:relative; margin:0; padding:0; min-height:0;
  height:var(--app-viewport-height,100dvh);
  display:grid; grid-template-rows:auto minmax(0,1fr) calc(68px + var(--dock-gesture-inset));
  overflow:hidden;
}
.shell-head { top:8px; }
.chapterbar { grid-row:1; width:100%; padding-top:8px; }
#screenViewport { grid-row:2; min-height:0; overflow:auto; overscroll-behavior-y:contain; }
#dockLayer { grid-row:3; position:relative; height:calc(68px + var(--dock-gesture-inset)); padding-bottom:var(--dock-gesture-inset); width:100%; background:#0b191e; border-top:1px solid #42575b; z-index:80; }
#expeditionNav {
  position:static; inset:auto; transform:none; margin:0 auto;
  width:min(100%,720px); height:67px; padding:3px 10px;
  border:0; border-radius:0; box-shadow:none; background:none;
  backdrop-filter:none; -webkit-backdrop-filter:none;
}
body[data-screen="home"] #home, #hutHome { height:100%; min-height:0; padding-bottom:10px; }
#workspace { min-height:0; }
.training-feature .app-shell:has(.adventure-landscape) { padding-bottom:0; }
/* Allow accessible scrolling if text zoom or a keyboard makes content taller;
   normal-sized main screens fit naturally without clipping overflow. */
body[data-screen="home"] #screenViewport, body[data-screen="hutHome"] #screenViewport { overflow:auto; }
.nutrition-feature .ov { max-height:var(--app-viewport-height,100dvh); }
