/* Phone scrolling, 2026-10-24. #view owns the page's vertical scroll;
   tables/matrices own horizontal movement only. Native dialogs retain theirs.
   Four IDs outrank the earlier desktop and phone geometry layers. */
@media(max-width:760px), (max-width:1100px) and (pointer:coarse) {
  html[data-paper] body.mobile-enhanced .main #view#view#view#view {
    overflow-x:hidden!important; overflow-y:auto!important;
    -webkit-overflow-scrolling:touch; overscroll-behavior-y:auto;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view > .view-fade,
  html[data-paper] body.mobile-enhanced .main #view#view#view#view :is(.pd-wrap,.rp-wrap,.rp-card,.dv-card) {
    height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view :is(.mobile-table-scroll,.mobile-page-table-scroll,.rp-table-wrap,.tr-matrix-wrap,.au-matrix-wrap) {
    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;
    touch-action:pan-x pan-y pinch-zoom; -webkit-overflow-scrolling:touch;
    scrollbar-gutter:auto!important;
  }
  /* Inline anonymous legacy overflow wrappers are also common. With a phone
     table inside, they must not introduce a second viewport or clipping box. */
  html[data-paper] body.mobile-enhanced .main #view#view#view#view :is(div,section):has(> .mobile-table-scroll):not(.modal):not(.lm-register-dialog):not(:is(.mqz-drawer,.tr-cell-detail,.rps-drawer,.lm-register-overlay,.modal-overlay) *) {
    height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important;
  }
  /* This cap also existed in the dedicated material review stylesheet. */
  html[data-paper] body.mobile-enhanced .main #view#view#view#view #pdContent :is(.lm-catalog-table,.mo-list-view > .pd-table-wrap,.ho-table-wrap) {
    height:auto!important; min-height:0!important; max-height:none!important;
    overflow-x:auto!important; overflow-y:hidden!important; overscroll-behavior-y:auto!important;
  }
  /* A tbody TH is a row label, not another header to pin at the top. Setting
     top:auto preserves any deliberate horizontal sticky/left positioning. */
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .mobile-table-scroll th {
    top:auto!important; bottom:auto!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .mobile-table-scroll tbody th {
    z-index:1!important;
  }

  /* Mid-QC is a div ledger. Desktop JS still writes a fixed workspace height;
     natural phone sizing must override that inline height as well. */
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .mqz-wrap,
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .mqz-wrap .mqz-ws,
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .mq-reg2 {
    height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .mqz-wrap .mqz-tool,
  html[data-paper] body.mobile-enhanced .main #view#view#view#view #mqMidRegPager {
    flex:0 0 auto!important; height:auto!important; min-height:0!important; overflow:visible!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view #mqMidRegList {
    flex:0 0 auto!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;
    touch-action:pan-x pan-y pinch-zoom; -webkit-overflow-scrolling:touch; scrollbar-gutter:auto!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view #mqMidRegTable {
    width:max-content!important; min-width:100%!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .mqz-lg-hd {
    position:relative!important; top:auto!important; z-index:auto!important;
  }

  /* The trace keeps one narrow frozen identifier column, while each process
     keeps enough room for its status and detail action. */
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .tr-flow-matrix {
    width:764px!important; min-width:764px!important; table-layout:fixed!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .tr-flow-matrix thead th:first-child,
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .tr-flow-matrix tbody th {
    width:124px!important; min-width:124px!important; max-width:124px!important;
    white-space:normal!important; overflow-wrap:anywhere!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .tr-flow-matrix thead th:first-child { z-index:3!important; }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view #trList {
    height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important;
  }

  /* A schedule is a CSS grid (not a table). Derive the day count from its
     native header so both week and month retain every date. */
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .ui-card:has(#auBody),
  html[data-paper] body.mobile-enhanced .main #view#view#view#view #auBody {
    height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .au-matrix-grid {
    grid-template-columns:104px repeat(var(--mobile-shift-days,7),92px)!important;
    min-width:calc(104px + var(--mobile-shift-days,7) * 92px)!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view :is(.au-matrix-corner,.au-matrix-date) {
    top:auto!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .au-matrix-person {
    padding:8px!important; gap:0!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .au-person-avatar { display:none!important; }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .au-person-info {
    min-width:0!important; max-width:100%!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view .au-person-info b {
    font-size:13px!important; white-space:normal!important; overflow-wrap:anywhere!important;
  }
  html[data-paper] body.mobile-enhanced .main #view#view#view#view :is(#cyList,#catList,.am-page,.dbe-side) {
    height:auto!important; min-height:0!important; max-height:none!important; overflow:visible!important;
  }
}
