/* source block 227: dmm-v21902-driver-terms-scroll-start-layout-fix; v2.19.18 line 38054 */

/* v2.19.02 — restore approved Driver T&C scroll + Start/T&C control separation after SAFE rollback.
   UI/CSS only: no sync, SQLite, API, Required Data or lifecycle logic changes. */

/* Keep the company/job summary in its own row and the job controls beneath it. */
body.driver-mode .driver-selected-pane > .driver-job-v3{
  grid-template-rows:auto minmax(0,1fr)!important;
}
body.driver-mode .driver-selected-pane .driver-job-summary{
  position:relative!important;
  z-index:2!important;
  flex:0 0 auto!important;
}
body.driver-mode .driver-selected-pane .driver-job-detail-v3{
  position:relative!important;
  z-index:1!important;
  min-height:0!important;
}
body.driver-mode .driver-main-stack .driver-time-control{
  position:relative!important;
  z-index:3!important;
  flex:0 0 auto!important;
}

/* When T&C is open, the selected job pane is the single vertical scroll owner.
   This restores reliable finger scrolling in Android WebView and browser. */
body.driver-mode .driver-selected-pane:has(#driverTermsInline){
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain!important;
  touch-action:pan-y!important;
}
body.driver-mode .driver-selected-pane:has(#driverTermsInline) > .driver-job-v3{
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  height:auto!important;
  min-height:100%!important;
  max-height:none!important;
  overflow:visible!important;
}
body.driver-mode .driver-selected-pane:has(#driverTermsInline) .driver-job-detail-v3,
body.driver-mode .driver-selected-pane:has(#driverTermsInline) .driver-detail-grid,
body.driver-mode .driver-selected-pane:has(#driverTermsInline) .driver-main-stack{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
body.driver-mode .driver-selected-pane:has(#driverTermsInline) .driver-main-stack{
  display:block!important;
  padding-bottom:110px!important;
}
body.driver-mode #driverTermsInline{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
body.driver-mode #driverTermsInline .driver-terms-copy-body{
  max-height:none!important;
  overflow:visible!important;
}
body.driver-mode #driverTermsInline .driver-terms-sign-grid{
  grid-template-columns:minmax(0,1fr)!important;
}
body.driver-mode #driverTermsInline .driver-terms-actions{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:10px!important;
}
body.driver-mode #driverTermsInline .driver-terms-actions .spacer{display:none!important;}
body.driver-mode #driverTermsInline .driver-terms-actions button{width:100%!important;min-height:48px!important;}
body.driver-mode #driverTermsInline canvas{touch-action:none!important;}

/* Do not alter Finalise > Required Data scrolling; its existing scroll owner remains authoritative. */

/* source block 228: dmm-v21906-mobile-dashboard-top-refinement; v2.19.18 line 38136 */

/* v2.19.06 — mobile-only Dashboard Date & Time refinement.
   Keep desktop and all other mobile Back Office/Driver UI unchanged. */
@media (max-width:900px){
  body:not(.driver-mode) #dashboardSection .dashboard-quick-datetime{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    padding:12px!important;
    margin-left:0!important;
    margin-right:0!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-quick-datetime-copy{
    width:100%!important;
    min-width:0!important;
    margin:0 0 10px!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-quick-datetime-copy strong{
    display:block!important;
    font-size:1.05rem!important;
    line-height:1.15!important;
    margin:0!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-quick-datetime-copy > span{
    display:none!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-current-week-label{
    display:block!important;
    margin-top:5px!important;
    font-size:.78rem!important;
    line-height:1.2!important;
    white-space:normal!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-quick-datetime-controls{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }

  /* Compact Job lookup: input + action on one row. */
  body:not(.driver-mode) #dashboardSection .dashboard-find-job-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 104px!important;
    gap:7px!important;
    align-items:end!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0 0 9px!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-find-job-row > small{
    display:none!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-find-job{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    font-size:.72rem!important;
    line-height:1.1!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-find-job input{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:42px!important;
    margin-top:4px!important;
    padding:8px 10px!important;
    box-sizing:border-box!important;
    font-size:16px!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-find-job-btn{
    width:104px!important;
    min-width:104px!important;
    max-width:104px!important;
    height:42px!important;
    min-height:42px!important;
    padding:7px 8px!important;
    margin:0!important;
    font-size:.88rem!important;
    line-height:1!important;
    white-space:nowrap!important;
    box-sizing:border-box!important;
  }

  /* Four date/time fields form a clean 2x2 grid; actions sit below. */
  body:not(.driver-mode) #dashboardSection .dashboard-date-filter-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:7px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    align-items:end!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-date-filter-row label{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    font-size:.7rem!important;
    line-height:1.1!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body:not(.driver-mode) #dashboardSection .dashboard-date-filter-row input{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:42px!important;
    margin-top:4px!important;
    padding:7px 7px!important;
    box-sizing:border-box!important;
    font-size:13px!important;
    line-height:1!important;
  }
  body:not(.driver-mode) #dashboardSection #dashboardQuickClear,
  body:not(.driver-mode) #dashboardSection #dashboardQuickApply{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:42px!important;
    height:42px!important;
    margin:0!important;
    padding:7px 10px!important;
    font-size:.88rem!important;
    line-height:1!important;
    box-sizing:border-box!important;
  }
}

@media (max-width:430px){
  body:not(.driver-mode) #dashboardSection .dashboard-quick-datetime{padding:10px!important;}
  body:not(.driver-mode) #dashboardSection .dashboard-find-job-row{grid-template-columns:minmax(0,1fr) 92px!important;}
  body:not(.driver-mode) #dashboardSection .dashboard-find-job-btn{width:92px!important;min-width:92px!important;max-width:92px!important;font-size:.82rem!important;}
  body:not(.driver-mode) #dashboardSection .dashboard-date-filter-row input{font-size:12px!important;padding-left:5px!important;padding-right:5px!important;}
}

/* source block 229: live-v2-19-07-mobile-planner-date-nav; v2.19.18 line 38283 */

/* v2.19.07 — mobile-only Planner date navigation fix.
   Keep the approved mobile Planner layout; ensure BOTH previous and next
   controls remain visible without requiring a horizontal toolbar swipe. */
@media(max-width:720px){
  #calendarSection .calendar-toolbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto!important;
    gap:8px!important;
    overflow:visible!important;
  }
  #calendarSection .view-tabs{
    grid-column:1!important;
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  #calendarSection .date-controls{
    grid-column:2!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    overflow:visible!important;
    gap:0!important;
  }
  #calendarSection .date-nav{
    display:grid!important;
    grid-template-columns:54px 54px!important;
    gap:6px!important;
    min-width:114px!important;
  }
  #calendarSection #previousBtn,
  #calendarSection #nextBtn{
    display:inline-flex!important;
    width:54px!important;
    min-width:54px!important;
    height:44px!important;
    align-items:center!important;
    justify-content:center!important;
    padding:0!important;
    font-size:24px!important;
  }
  #calendarSection #todayBtn,
  #calendarSection .date-controls h3{display:none!important;}
  #calendarSection .notes-toolbar-action,
  #calendarSection .planner-pinned-notes{display:none!important;}
}

