/* V158 — one scroll owner on phones/tablets/iPad.
   No custom pull-to-refresh. No global touch interception. */
#v80-pull-refresh{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* Touch devices (including iPad landscape > 1024px) use document scrolling.
   Do not override Radix's temporary body lock while a real modal is open. */
@media (hover:none), (pointer:coarse), (max-width:1023px){
  html{
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
    touch-action:auto!important;
    scroll-behavior:auto!important;
  }

  body:not([data-scroll-locked]){
    position:static!important;
    inset:auto!important;
    width:auto!important;
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
    touch-action:pan-y pinch-zoom!important;
    -webkit-overflow-scrolling:touch!important;
  }

  body:not([data-scroll-locked]) > #root{
    position:relative!important;
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow:visible!important;
    touch-action:pan-y!important;
  }

  /* Admin shell: old V28/V29 rules alternate between body-scroll and
     main-scroll. On touch devices the document is the single owner. */
  body.v28-admin-route:not([data-scroll-locked]) > #root > .flex.min-h-screen,
  body.v28-admin-route:not([data-scroll-locked]) > #root > .flex.min-h-screen.w-full.overflow-x-hidden,
  body.v28-admin-route:not([data-scroll-locked]) > #root > .flex.min-h-screen.w-full.overflow-x-hidden > .flex.min-w-0.flex-1.flex-col{
    height:auto!important;
    min-height:100dvh!important;
    max-height:none!important;
    overflow:visible!important;
    align-items:stretch!important;
  }

  body.v28-admin-route:not([data-scroll-locked]) main.admin-mobile-main{
    position:relative!important;
    height:auto!important;
    min-height:calc(100dvh - 60px)!important;
    max-height:none!important;
    flex:0 0 auto!important;
    overflow-x:hidden!important;
    overflow-y:visible!important;
    overscroll-behavior-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
    scrollbar-gutter:auto!important;
    padding-bottom:calc(2.5rem + env(safe-area-inset-bottom,0px))!important;
  }

  body.v28-admin-route:not([data-scroll-locked]) .admin-mobile-scroll{
    height:auto!important;
    max-height:none!important;
    overflow-y:visible!important;
    overscroll-behavior-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
  }

  /* Horizontal tables remain horizontally scrollable without stealing Y scroll. */
  body.v28-admin-route .overflow-x-auto{
    overflow-x:auto!important;
    overflow-y:visible!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-x pan-y!important;
  }

  /* Native modal scrolling remains native and isolated. */
  [role="dialog"]{
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y pinch-zoom!important;
  }
}
