/* Atlas v0.11.33 — TrafficStars-inspired native scroll mechanics.
   Keep Atlas tables, DnD, theme, density, resize and sorting unchanged.
   Vertical scroll belongs to the page; horizontal scroll stays on the grid.
   This file is loaded after atlas-admin.css so historical height rules are overridden.
*/
/* Remove the desktop full-height viewport layout. Without this rule the body
   cannot scroll naturally even if the table itself has no max-height. */
@media (min-width:701px) {
  html body .main:has(#content.page > .table-wrap),
  html body .main:has(#content.page > .campaign-table-wrap),
  html body .main:has(#content.page #reportOutput > .table-wrap) {
    height:auto!important;
    min-height:100dvh!important;
    overflow-x:clip!important;
    overflow-y:visible!important;
  }
  html body #content.page:has(> .table-wrap),
  html body #content.page:has(> .campaign-table-wrap),
  html body #content.page:has(#reportOutput > .table-wrap) {
    display:block!important;
    height:auto!important;
    min-height:0!important;
    padding-bottom:60px!important;
  }
  html body #content.page:has(#reportOutput > .table-wrap) #reportOutput {
    display:block!important;
    min-height:0!important;
  }
  html body #content.page > .atlas-pager,
  html body #content.page #reportOutput > .atlas-pager {
    position:relative!important;
    margin-top:0!important;
    bottom:auto!important;
  }
}
html body #content.page :is(.table-wrap,.campaign-table-wrap,div.local-landing-table) {
  flex:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-x:contain!important;
  overscroll-behavior-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  scroll-behavior:auto!important;
  touch-action:pan-x pan-y!important;
}
/* Old mobile script used to add a forced-height viewport. Remove that model. */
@media (max-width:700px) {
  html body #content.page > :is(.table-wrap,.campaign-table-wrap).atlas-full-scroll-surface,
  html body #content.page #reportOutput > .table-wrap.atlas-full-scroll-surface {
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:hidden!important;
  }
}
/* Avoid nested scroll chaining in horizontally scrollable tables, while letting
   vertical wheel/touch continue up to the main page naturally. */
html body #content.page :is(.table-wrap,.campaign-table-wrap,div.local-landing-table) :is(table,thead,tbody,tfoot) {
  overscroll-behavior-y:auto;
}
/* Modal and drawer tables intentionally keep their independent scroll areas.
   Their constrained height is part of the dialog interaction contract. */
@media (max-width:700px) {
  /* Legacy `overflow-x:hidden` on the page/body created a hidden Y scrollport
     and blocked native vertical gestures over the table. */
  html, html body {
    overflow-x:clip!important;
    overflow-y:visible!important;
    overscroll-behavior-y:none!important; /* retain no pull-to-refresh */
  }
  html body #content.page {
    overflow-x:clip!important;
    overflow-y:visible!important;
    overscroll-behavior-y:auto!important;
  }
  html body .main:has(#content.page .table-wrap),
  html body .main:has(#content.page .campaign-table-wrap) {
    overflow-x:clip!important;
    overflow-y:visible!important;
    overscroll-behavior-y:auto!important;
  }
}
/* Atlas installed as an iOS/Android standalone PWA previously forced a
   viewport-sized grid. Keep the same window-scrolling model in standalone. */
html.atlas-standalone body #content.page :is(.table-wrap,.campaign-table-wrap,div.local-landing-table) {
  flex:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
}
@media (max-width:700px) {
  html.atlas-standalone body.atlas-has-mobile-toolbar #content.page :is(.table-wrap,.campaign-table-wrap,div.local-landing-table) {
    max-height:none!important;
    height:auto!important;
  }
}
