/* Only ordinary iPhone Safari tabs use an inner page scroller. The native
   root viewport does not scroll, avoiding its collapsing-toolbar transition.
   Existing navigation, page content, safe areas and modal locks stay intact. */
@media (max-width:760px) {
  html[data-safari-page-scroll="true"] {
    height:100%;
    overflow:hidden;
    overscroll-behavior-y:none;
  }
  html[data-safari-page-scroll="true"] body {
    position:relative;
    height:100%;
    min-height:0;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    scroll-behavior:smooth;
  }
}

/* Ordinary Safari only: lay the unchanged bar at the end of a top-origin frame.
   The bounded body scroller above keeps the native root viewport still. */
@media (max-width:760px) {
  html[data-safari-page-scroll="true"] .mobile-nav-viewport {
    inset:0 0 auto!important;
    height:100%!important;
    height:100dvh!important;
    display:flex!important;
    flex-direction:column;
    justify-content:flex-end;
    pointer-events:none;
  }
  html[data-safari-page-scroll="true"] .mobile-nav-viewport[data-keyboard-open="true"] {
    display:none!important;
  }
}
