/* A short screen or larger text must never hide the rest of an activity. */
.app-shell { position: relative; }

.catalogue-menu,
.story-menu.catalogue-menu,
.science-menu,
.story-scroll,
.science-scroll,
.chapter-scroll,
.parents-dialog > .parent-panel {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-y: contain;
}

.catalogue-menu > *,
.science-menu > *,
.parents-dialog > .parent-panel > * { flex-shrink: 0; }

.story-scroll,
.science-scroll,
.chapter-scroll { flex: 1 1 0%; }

.full-page-lesson[hidden] { display: none !important; }
.full-page-lesson:not([hidden]) { flex: 1 1 0%; min-height: 0; }

/* Menus scroll below the shared header; lessons retain their own scroll region. */
.inner-stage:not(.catalogue-stage):not(.chapter-stage),
.home-stage.explorer-home,
.science-quiz {
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}
.inner-stage:not(.catalogue-stage):not(.chapter-stage) > .liam-header,
.explorer-home .liam-header.home-header {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  background: #fffef8;
}
.inner-stage > .exercise-page,
.inner-stage > .mission-page,
.inner-stage > .difficulty-page,
.inner-stage > .practice-library,
.inner-stage > .completion-wrap { flex: 1 0 auto; }
.science-quiz > * { flex-shrink: 0; }
.science-quiz > .science-quiz-body { flex: 1 0 auto; min-height: 280px; }
.parents-dialog > .parent-panel { justify-content: flex-start; }
.explorer-home .explorer-layout { flex: 1 0 auto; min-height: 440px; }
@media (orientation: portrait) {
  .explorer-home .explorer-layout { min-height: 600px; }
}
