/* Tablet workspace: one navigation mode and predictable banner tracks. */
@media (max-width:1366px) {
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header {
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;
  position:sticky;top:0;gap:12px;padding:12px 20px;min-height:0;z-index:50;
 }
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header>a:first-child {
  position:static;grid-column:1;grid-row:1;display:block;justify-self:start;
  width:200px;max-width:100%;height:auto;margin:0;border:0;flex:none;
 }
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header img {width:100%;height:auto}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header>#staff-menu-toggle {grid-column:2;grid-row:1;margin:0;justify-self:end;min-height:44px}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header>:is(.maint-top-banner,.portal-top-banner) {
  grid-column:1/-1;grid-row:2;width:100%;min-width:0;padding:12px 0 0;margin:0;
  border-top:1px solid #edf1f4;align-self:stretch;
 }
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header>:is(.maint-top-banner,.portal-top-banner)>:is(.ops-heading,.heading) {
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;
  gap:12px 20px;width:100%;margin:0;padding:0;border:0;flex-direction:initial;
 }
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header :is(.ops-heading,.heading)>div:first-child {min-width:0;width:auto}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header :is(.ops-heading,.heading) h1 {font-size:1.25rem;line-height:1.35;margin:0;overflow-wrap:anywhere}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header :is(.ops-actions,.heading-actions) {display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:stretch;width:auto;margin:0;padding:0;gap:8px}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header :is(.ops-actions,.heading-actions)>button {flex:0 1 auto;min-width:0;min-height:44px;margin:0;padding:10px 14px;white-space:normal;line-height:1.4}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header .maint-header-actions {position:relative}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header #maint-actions-toggle {display:none}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header #maint-header-menu {display:flex;position:static;flex-wrap:wrap;gap:8px;min-width:0;padding:0;border:0;box-shadow:none;background:transparent}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header .maint-top-banner>.ops-view-toggle {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;margin:12px 0 0;padding:4px;gap:4px}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header .maint-top-banner>.ops-view-toggle button {width:100%;min-width:0;min-height:44px;white-space:normal;margin:0;padding:8px 12px;font-size:.875rem;line-height:1.4}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>main {margin:0;max-width:none;width:100%;padding:20px;min-width:0}
 body[data-portal]:is(.staff-workspace,.driver-workspace) #workspace {display:block;min-width:0}
 body[data-portal] #staff-mobile-menu {background:#263b4a;color:#fff}
 body[data-portal] #staff-mobile-menu .section-tabs {
  position:static;display:flex;flex-direction:column;flex-wrap:nowrap;
  top:auto;bottom:auto;width:100%;height:auto;max-height:none;overflow:visible;
  padding:0;margin:0;border:0;border-radius:0;gap:12px;background:transparent;
 }
 body[data-portal] #staff-mobile-menu .section-tabs::before {display:none}
 body[data-portal] #staff-mobile-menu .section-tabs :is(.admin-nav,.driver-nav-group) {width:100%;min-width:0;margin:0}
 body[data-portal] #staff-mobile-menu .section-tabs button {min-height:46px;width:100%;margin:0!important;white-space:normal;text-align:left;justify-content:flex-start;flex:none}
 body[data-portal] #staff-mobile-menu .section-tabs .admin-nav-items {display:flex;flex-direction:column;gap:6px;padding-bottom:10px}
 body[data-portal] #staff-mobile-menu #signout {width:100%;margin:0!important;min-height:46px}
 body[data-portal] #staff-mobile-menu #driver-account {color:#fff;margin:0 0 10px;padding:0}
 body[data-portal] #staff-mobile-menu #ops-password {position:static;max-width:100%;white-space:normal}
 body[data-portal] :is(#ops-content,#operations-view,#enquiries-view,#customers-view,#deliveries-view,.maint-record-panel,.fuel-panel,.planner-shell) {min-width:0;max-width:100%}
 body[data-portal] :is(.ops-dialog-top,.maint-section-head,.fuel-panel-head,.detail-top) {flex-wrap:wrap;gap:12px;align-items:center}
 body[data-portal] :is(.ops-dialog-top h2,.maint-section-head h2,.fuel-panel-head h2) {min-width:0;overflow-wrap:anywhere;margin:0}
 body[data-portal] .ops-dialog-top>h2 {flex:1 1 200px}
 body[data-portal] .ops-dialog-top>button {flex:none;min-width:44px;min-height:44px}
 body[data-portal] .ops-dialog-top .maint-vehicle-top-actions {display:flex;flex-wrap:wrap;gap:8px;min-width:0;max-width:100%;margin-left:auto}
 body[data-portal] :is(.ops-modal,.email-preview) {max-width:calc(100vw - 40px);max-height:calc(100dvh - 40px);overscroll-behavior:contain}
 body[data-portal] .ops-modal :is(fieldset,label,.edit-grid,.maint-form-content,.maint-service-section) {min-width:0;max-width:100%}
 body[data-portal] .ops-modal :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {min-inline-size:0;max-inline-size:100%;box-sizing:border-box;font-size:16px}
 body[data-portal] input:is([type=date],[type=month],[type=time],[type=datetime-local]) {appearance:none;-webkit-appearance:none;inline-size:100%;min-inline-size:0;max-inline-size:100%}
 body[data-portal] input::-webkit-date-and-time-value {min-width:0;text-align:left}
 body[data-portal] .maint-table-scroll,body[data-portal] .fuel-table-wrap {max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 body[data-portal] .maint-calendar-scroll,body[data-portal] .planner-scroll {max-width:100%;overscroll-behavior-x:contain}
 body[data-portal] .maint-kind-tabs {display:flex;flex-wrap:wrap;gap:8px;overflow:visible}
 body[data-portal] .maint-kind-tabs button {flex:1 1 140px;min-width:0;white-space:normal;min-height:44px}
 body[data-portal] :is(.planner-controls,.planner-navigation,.maint-calendar-controls,.fuel-panel-head) {flex-wrap:wrap;min-width:0}
 body[data-portal] .planner-filters {grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-portal] .planner-filters label:first-child {grid-column:1/-1}
 body[data-portal] .ops-licence-layout {grid-template-columns:minmax(0,1fr)}
 body[data-portal] .ops-licence-layout>section:first-child {grid-row:auto}
 body[data-portal] :is(.directory-team,.desk),body[data-portal] #customers-view .desk {grid-template-columns:minmax(0,1fr)}
 body[data-portal] #customer-detail {position:static;max-height:none}
 body[data-portal] .directory-person {flex-wrap:wrap}
 body[data-portal] .directory-person .ops-actions {max-width:100%;flex-wrap:wrap}
 body[data-portal] .maint-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-portal] .maint-metric-title {font-size:1rem}
}
@media (min-width:761px) and (max-width:1366px) {
 body[data-portal] #maintenance-body .maint-vehicle-dates {grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-portal] .maint-pmi-modal .maint-schedule-dates {grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
 body[data-portal] .maint-pmi-modal .maint-report-check {grid-template-columns:minmax(0,1fr) 264px;gap:12px}
 body[data-portal] .maint-pmi-modal .maint-report-choices {width:100%;grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-portal] .ops-modal .edit-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
 body[data-portal] .maint-section-head>button,body[data-portal] .fuel-panel-head>button {flex:0 0 auto;margin-left:auto}
 body[data-portal] .driver-route {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px) and (min-width:761px) {
 body[data-portal] .maint-pmi-modal .maint-report-check {grid-template-columns:minmax(0,1fr);gap:10px}
 body[data-portal] .maint-vehicle-dates {gap:12px}
 body[data-portal] .maint-doc-filters {grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-portal] .directory-person .ops-actions {width:100%;padding-left:0}
}
@media (max-width:760px) {
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header {padding:12px 14px}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header>a:first-child {width:170px}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>main {padding:16px}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header>:is(.maint-top-banner,.portal-top-banner)>:is(.ops-heading,.heading) {grid-template-columns:minmax(0,1fr)}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header :is(.ops-actions,.heading-actions) {justify-content:flex-start;width:100%}
 body[data-portal]:is(.staff-workspace,.driver-workspace)>header :is(.ops-actions,.heading-actions)>button {flex:1 1 120px}
 body[data-portal] :is(.ops-modal,.email-preview) {max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
 body[data-portal] .planner-filters {grid-template-columns:minmax(0,1fr)}
}
/* Public navigation also uses a menu before its links become crowded. */
@media (min-width:761px) and (max-width:1100px) {
 body:not([data-portal]) .header-inner {display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;padding-top:12px;padding-bottom:12px;min-height:0}
 body:not([data-portal]) .header-inner .logo {width:210px;max-width:100%;height:auto}
 body:not([data-portal]) .header-inner .menu {display:block;min-height:44px;min-width:80px;margin-left:auto}
 body:not([data-portal]) .header-inner .nav {display:none;flex-basis:100%;width:100%;flex-direction:column;align-items:stretch;gap:0;max-height:calc(100dvh - 180px);overflow-y:auto;overscroll-behavior:contain;padding:8px 0;background:#fff}
 body:not([data-portal]) .header-inner .nav.open {display:flex}
 body:not([data-portal]) .header-inner .nav>a,body:not([data-portal]) .header .nav-dropdown>summary {min-height:48px;padding:12px 16px;border:0;white-space:normal}
 body:not([data-portal]) .header .nav-dropdown {width:100%}
 body:not([data-portal]) .header .nav-dropdown-panel {position:static;width:100%;max-height:none;overflow:visible;border:0;border-left:3px solid #ed5626;border-radius:0;box-shadow:none;padding:16px;background:#f4f6f8}
 body:not([data-portal]) .header .nav-product-columns {grid-template-columns:repeat(2,minmax(0,1fr))}
 body:not([data-portal]) .header-inner .nav .button {margin-top:8px;justify-content:center;text-align:center}
 body:not([data-portal]) .contact-strip .wrap {flex-wrap:wrap;gap:10px 20px;padding-top:12px;padding-bottom:12px}
 body:not([data-portal]) .contact-strip .wrap>* {min-width:0;padding:0;border:0;overflow-wrap:anywhere}
 body:not([data-portal]) .photo-cards {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
 body:not([data-portal]) .hero .actions {width:100%;max-width:100%;flex-wrap:wrap}
 body:not([data-portal]) .hero .button {white-space:normal;text-align:center;min-width:0}
 body:not([data-portal]) .contact-layout {grid-template-columns:minmax(0,1fr)}
 body:not([data-portal]) .contact-layout .form-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
 body:not([data-portal]) .footer-contact {padding-right:0;flex-wrap:wrap;gap:16px}
 body:not([data-portal]) .footer-social {grid-column:1/-1;grid-row:auto;justify-self:start;justify-content:flex-start}
}

/* Mobile and iPad compliance actions use the existing accessible toggle. */
@media(max-width:1366px){
body[data-portal] > header .maint-top-banner .ops-heading > .ops-actions:has(#maint-header-menu){grid-column:auto;justify-self:end;display:block;width:auto;min-width:0;margin:0}
body[data-portal] > header .maint-top-banner .maint-header-actions{position:relative;display:block;width:auto;min-width:0}
body[data-portal] > header .maint-top-banner #maint-actions-toggle{display:block;min-height:44px;padding:10px 14px;white-space:nowrap;background:#fff;color:#263b4a;border:1px solid #c9d0d5;border-radius:6px}
body[data-portal] > header .maint-top-banner #maint-header-menu{display:none;position:absolute;right:0;top:calc(100% + 8px);width:240px;max-width:calc(100vw - 32px);min-width:0;padding:8px;gap:8px;border:1px solid #dce1e5;border-radius:8px;background:#fff;box-shadow:0 6px 20px #263b4a22;z-index:60}
body[data-portal] > header .maint-top-banner #maint-actions-toggle[aria-expanded="true"] + #maint-header-menu{display:flex;flex-direction:column}
body[data-portal] > header .maint-top-banner #maint-header-menu > button{width:100%;min-width:0;min-height:44px;margin:0;padding:10px 12px;white-space:normal;line-height:1.35}
}
