/* Shared staff-only semantic palette. Loaded last in both workspaces.
   Explicit surface/text pairs prevent legacy light styles leaking into dark UI. */
body.staff-dark {
  --text-primary:#f1f5f8; --text-secondary:#c3d0da; --text-muted:#c3d0da;
  --surface:#17232c; --surface-elevated:#263640; --surface-inset:#101b23;
  --surface-hover:#344955; --surface-selected:#354b5a; --border:#718694;
  --accent:#ffad70; --accent-fill:#f58636; --on-accent:#111b22;
  --success:#85e0b1; --success-surface:#173f30;
  --warning:#ffda83; --warning-surface:#483919;
  --danger:#ffb1b5; --danger-surface:#52252d;
  --info:#a9cfff; --info-surface:#253e60;
  --ink:var(--text-primary); --muted:var(--text-muted); --paper:var(--surface);
  --line:var(--border); --orange:var(--accent); --orange-2:var(--accent);
  --orange-soft:var(--warning-surface); --green:var(--success); --green-soft:var(--success-surface);
  --red:var(--danger); --red-soft:var(--danger-surface); --blue:var(--info); --blue-soft:var(--info-surface);
  --amber:var(--warning); --amber-soft:var(--warning-surface);
  color-scheme:dark;
}
body.staff-dark.southwest-workspace {
  --accent:#83e3eb; --accent-fill:#55cad7; --on-accent:#102b39;
  --surface:#142b35; --surface-elevated:#223d47; --surface-inset:#0e222b;
  --surface-hover:#31505b; --surface-selected:#284752;
}
/* Scope excludes public marketing pages and printable/PDF artwork. */
body.staff-dark :is(#app,#modal-root,#toast-root) {color:var(--text-primary)}
body.staff-dark #app :is(.main,.app-shell,.view,.driver-app){background:var(--surface);color:var(--text-primary)}
body.staff-dark :is(#app,#modal-root) :is(.sidebar,.topbar,.op-selector-bar,.panel,.ops-panel,.record-panel,.record-list,.record-detail,.metric,.billing-card,.module-stat,.account-metric,.op-metrics article,.ops-metrics>div,.info-card,.detail-box,.detail-box-body,.note,.note-entry,.op-timeline-list li,.toolbar,.filter-bar,.ops-toolbar,.op-table-wrap,.ops-table-wrap,.table-wrap,.job-card,.job-card-head,.module-row,.request-row,.ops-card,.ops-task,.ops-alert,.ops-strip,.command-intro,.command-panel,.command-stat,.command-money,.command-empty,.driver-card,.driver-empty,.driver-shift-card,.driver-inspection,.driver-note,.driver-detail dl,.driver-tabs,.driver-report-status,.modal,.modal-body,.cad-intake,.cad-intake-strip){background:var(--surface-elevated)!important;color:var(--text-primary);border-color:var(--border)}
body.staff-dark :is(#app,#modal-root) :is(.panel-head,.ops-panel-head,.detail-box-head,.modal-head,.modal-foot,.form-section-title,.ops-head,.nav-label,.nav-section-label,.user-card,.command-panel-head,th){background:var(--surface-inset)!important;color:var(--text-secondary)!important;border-color:var(--border)}
body.staff-dark :is(#app,#modal-root) :is(h1,h2,h3,h4,h5,strong,.cell-main,.metric-value,.module-stat strong,.account-metric strong,.section-title,.detail-fact,.driver-detail dd){color:var(--text-primary)!important}
body.staff-dark :is(#app,#modal-root) :is(p,small,label,dt,.cell-sub,.metric-label,.metric-foot,.eyebrow,.date-chip,.toolbar-count,.account-note,.op-note,.op-empty,.ops-empty,.empty,.staff-loading,.driver-muted,.driver-card-location,.driver-detail dt,.job-issue,.job-meta-row,.cad-intake-help,.form-note,.detail-fact span,.module-stat span,.account-metric span,.op-metrics span,.banking-account dt,.banking-account>span,.user-copy span,.brand-text span){color:var(--text-secondary)!important}
body.staff-dark :is(#app,#modal-root) :is(input,textarea,select,option,optgroup){background:var(--surface-inset)!important;color:var(--text-primary)!important;border-color:var(--border)!important;color-scheme:dark;opacity:1}
body.staff-dark :is(#app,#modal-root) :is(input,textarea)::placeholder{color:var(--text-muted)!important;opacity:1}
body.staff-dark :is(#app,#modal-root) :is(a,.text-link,.table-id,.job-id,.command-tag,.command-overline,.driver-card-top,.driver-greeting>span,.driver-shift-card>span){color:var(--accent)}
body.staff-dark :is(#app,#modal-root) :is(.secondary-btn,.tiny-btn,.ghost-btn,.icon-btn,.modal-close,.driver-outline,.driver-detail-actions a,.driver-detail-actions button,.account-tabs button,.op-tabs button,.segmented button,.driver-tabs button,.workspace-switch,.nav-btn,.signout-btn,.flow-step,.op-po-line button){background:var(--surface-elevated)!important;color:var(--text-primary)!important;border-color:var(--border)}
body.staff-dark :is(#app,#modal-root) :is(.primary-btn,.driver-primary,.command-main-action,.nav-badge,.avatar){background:var(--accent-fill)!important;color:var(--on-accent)!important;border-color:var(--accent-fill)!important}
body.staff-dark :is(#app,#modal-root) :is(.primary-btn,.driver-primary,.command-main-action) :is(span,strong,svg){color:inherit!important}
body.staff-dark :is(#app,#modal-root) :is(.nav-btn,.account-tabs button,.op-tabs button,.driver-tabs button,.segmented button,.flow-step):is(.active,.current,.selected){background:var(--surface-selected)!important;color:var(--accent)!important;border-color:var(--accent)}
body.staff-dark #app :is(.nav-btn svg,.nav-btn.active svg){color:inherit}
body.staff-dark :is(#app,#modal-root) :is(button,a):hover:not(:disabled){filter:brightness(1.12)}
body.staff-dark :is(#app,#modal-root) :is(.record-item,.active-row,.data-table tbody tr,.op-table tbody tr,.ops-table tbody tr,.module-row,.driver-card):hover{background:var(--surface-hover)!important;color:var(--text-primary)}
body.staff-dark #app .record-item.selected{background:var(--surface-selected);color:var(--text-primary)}
body.staff-dark :is(#app,#modal-root) :is(button,input,textarea,select,a,summary):focus-visible{outline:3px solid var(--accent)!important;outline-offset:3px}
body.staff-dark :is(#app,#modal-root) :is(button,input,select,textarea):disabled{opacity:1!important;background:var(--surface-inset)!important;color:var(--text-muted)!important;border-color:var(--border)!important;cursor:not-allowed;box-shadow:none}
body.staff-dark :is(#app,#modal-root) :is(.status-pill,.type-pill,.bill-pill,.priority-pill,.driver-status,.mode-chip,.board-count,.staff-state){background:var(--info-surface);color:var(--info);border:1px solid currentColor}
body.staff-dark :is(#app,#modal-root) :is(.status-completed,.bill-paid,.staff-state.active,.flow-step.done){background:var(--success-surface)!important;color:var(--success)!important}
body.staff-dark :is(#app,#modal-root) :is(.status-new,.bill-draft,.priority-pill,.driver-status){background:var(--warning-surface);color:var(--warning)}
body.staff-dark :is(#app,#modal-root) :is(.bill-overdue,.status-cancelled,.staff-state.disabled,.danger-btn,.delete-warning,.op-error){background:var(--danger-surface)!important;color:var(--danger)!important;border-color:var(--danger)}
body.staff-dark :is(#app,#modal-root) :is(.required,.banking-debit,[role=alert],.op-record-form>p){color:var(--danger)!important}
body.staff-dark :is(#app,#modal-root) :is(.banking-credit,.trend-up){color:var(--success)!important}
body.staff-dark :is(#app,#modal-root) td{color:var(--text-primary);border-color:var(--border)}
body.staff-dark .toast{background:var(--surface-elevated);color:var(--text-primary);border-color:var(--accent)}
/* CAD keeps its reference layout and blue/gold signals, with AA text pairs. */
body.staff-dark #app .ref-summary h1{color:var(--warning)!important}
body.staff-dark #app .ref-tab.selected{background:#2458a0}
body.staff-dark #app :is(.ref-rail>button,.ref-modules summary,.ref-related-tabs button.selected,#ref-note-form button){background:#624b08;color:#fff;border-color:#e9ad12}
body.staff-dark #app .ref-unit{background:#15614f;color:#fff}
body.staff-dark #app :is(.ref-footer,.ref-log article header,.ref-related-body>article header){color:#91bcff}
body.staff-dark #app .ref-muted{color:var(--text-muted)}
body.staff-dark #app .ref-related h2{color:var(--warning)!important}
body.staff-dark :is(#app,#modal-root) ::selection{background:var(--accent-fill);color:var(--on-accent)}
@media(forced-colors:active){body.staff-dark :is(#app,#modal-root) :is(button,input,select,textarea){border:1px solid ButtonText}}
/* Shared header, customer selection and identity controls found in page audit. */
body.staff-dark #app :is(.welcome-row,.command-hero,.top-search,.shortcut,.record-item){background:var(--surface-elevated)!important;color:var(--text-primary);border-color:var(--border)}
body.staff-dark :is(#app,#modal-root) :is(.request-row span,.record-item span,.info-card span,.billing-card span,.ops-head span,.shortcut){color:var(--text-secondary)!important}
body.staff-dark :is(#app,#modal-root) :is(.record-avatar,.detail-avatar,.staff-row em){background:var(--accent-fill)!important;color:var(--on-accent)!important}
body.staff-dark #app .record-item.active{background:var(--surface-selected)!important}
/* Inspections retain their SAFER table layout and share the staff palette. */
body.staff-dark:has(#view-fmcsa.active) .content{background:var(--surface)}
body.staff-dark #app #view-fmcsa{background:var(--surface);color:var(--text-primary)}
body.staff-dark #app #view-fmcsa .inspection-masthead{background:linear-gradient(90deg,var(--surface-inset),transparent),linear-gradient(#101b23cc,#101b23cc),url('roadside-hero.webp') center 60%/cover no-repeat;border-color:var(--border);color:var(--text-primary)}
body.staff-dark #app #view-fmcsa .inspection-brand{color:var(--text-primary);text-shadow:none}
body.staff-dark #app #view-fmcsa .inspection-brand span{color:var(--info);text-shadow:none}
body.staff-dark #app #view-fmcsa :is(h2,.inspection-search-title){color:var(--info)!important}
body.staff-dark #app #view-fmcsa :is(.inspection-query,.inspection-choice){background:var(--surface-elevated);color:var(--text-primary);border:1px solid var(--border)}
body.staff-dark #app #view-fmcsa :is(h3,.op-form label,.inspection-item strong){background:var(--info-surface);color:var(--text-primary)!important;border-color:var(--border)}
body.staff-dark #app #view-fmcsa :is(.inspection-choice legend,.inspection-record-title){color:var(--text-primary)}
body.staff-dark #app #view-fmcsa :is(.op-form,.inspection-item,table){background:var(--border);border-color:var(--border)}
body.staff-dark #app #view-fmcsa :is(td,.inspection-item label){background:var(--surface-elevated)!important;color:var(--text-primary)!important;border-color:var(--border)}
body.staff-dark #app #view-fmcsa :is(th,td:first-child){background:var(--info-surface)!important;color:var(--text-primary)!important;border-color:var(--border)}
body.staff-dark #app #view-fmcsa :is(.op-form input,.op-form select){border:1px solid var(--border);box-shadow:none}
body.staff-dark #app #view-fmcsa button{background:var(--surface-elevated);color:var(--text-primary);border-color:var(--border);box-shadow:none}
body.staff-dark #app #view-fmcsa :is(.inspection-links,.inspection-footer,.op-table) button{background:transparent!important;color:var(--accent)!important;border:0;box-shadow:none}
body.staff-dark #app #view-fmcsa .inspection-footer{color:var(--text-secondary);border-color:var(--border)}
body.staff-dark #app #view-fmcsa #inspection-message:not(:empty){color:var(--info)}
body.staff-dark #app #view-fmcsa input:is([type=checkbox],[type=radio]){accent-color:var(--accent-fill)}
body.staff-dark #app #view-fmcsa tr:hover td{background:var(--surface-hover)!important}
body.staff-dark #app #view-fmcsa button.inspection-delete{color:var(--danger)!important;border-color:var(--danger)}
body.staff-dark :is(#app,#modal-root) :is(.carrier-lookup,.carrier-summary){background:var(--surface-elevated);color:var(--text-primary);border-color:var(--border)}
body.staff-dark :is(#app,#modal-root) .carrier-lookup button{background:var(--surface-inset);color:var(--text-primary);border-color:var(--border)}
body.staff-dark :is(#app,#modal-root) .carrier-lookup-result a{color:var(--accent)}
body.staff-dark #app #view-fmcsa .inspection-photo-controls{background:var(--surface-elevated);color:var(--text-primary)}
body.staff-dark #app #view-fmcsa td.inspection-overdue{background:var(--danger-surface)!important;color:var(--danger)!important}
body.staff-dark #app #view-fmcsa td.inspection-due-soon{background:var(--warning-surface)!important;color:var(--warning)!important}


body.staff-dark.compliance-active #app .sidebar,body.staff-dark.compliance-active #app .topbar{display:none!important}
body.staff-dark.compliance-active #app .main{margin-left:0!important;width:100%!important;min-height:100dvh;background:#fff!important}
body.staff-dark.compliance-active #app .content{padding:0!important;margin:0!important;max-width:none!important;width:100%!important}
body.staff-dark #app #view-safer{background:#fff!important;min-height:100dvh;padding:0!important;color:#17202a!important}
body.staff-dark #app #view-safer .safer-snapshot{padding:24px 4%;margin:0;width:100%;max-width:none;box-sizing:border-box;background:#fff!important;font:15px/1.5 Arial,sans-serif;color-scheme:light}
body.staff-dark #app #view-safer .safer-snapshot *{color:#17202a!important;border-color:#8a96a3!important;text-shadow:none!important;opacity:1!important}
body.staff-dark #app #view-safer .safer-snapshot :is(p,form,table,tr,td,label,span){background:#fff!important}
body.staff-dark #app #view-safer .safer-snapshot header{padding:20px;background:#003366!important;display:flex;gap:20px;align-items:center;flex-wrap:wrap}
body.staff-dark #app #view-safer .safer-snapshot header *{background:#003366!important;color:#fff!important}
body.staff-dark #app #view-safer .safer-snapshot header strong{font:bold 28px Georgia,serif}
body.staff-dark #app #view-safer .safer-snapshot :is(nav,h3,th){background:#e4e9ef!important;color:#12385b!important;padding:10px}
body.staff-dark #app #view-safer .safer-snapshot h2{color:#12385b!important;font:700 26px Georgia,serif}
body.staff-dark #app #view-safer .safer-snapshot table{width:100%;border-collapse:collapse;margin:12px 0;table-layout:fixed}
body.staff-dark #app #view-safer .safer-snapshot :is(th,td){border:1px solid #8a96a3!important;padding:10px;text-align:left;overflow-wrap:anywhere}
body.staff-dark #app #view-safer .safer-snapshot a{color:#004b91!important;text-decoration:underline}
body.staff-dark #app #view-safer .safer-snapshot input{background:#fff!important;color:#111!important;caret-color:#111;border:1px solid #64748b!important;padding:8px;color-scheme:light}
body.staff-dark #app #view-safer .safer-snapshot button{background:#164b78!important;color:#fff!important;border:1px solid #164b78!important;padding:9px 14px;border-radius:2px;font-weight:700;cursor:pointer;white-space:normal}
body.staff-dark #app #view-safer .safer-snapshot button:hover{background:#003366!important;color:#fff!important}
body.staff-dark #app #view-safer .safer-snapshot :focus-visible{outline:3px solid #a34b00!important;outline-offset:3px}
body.staff-dark #app #view-safer .safer-snapshot select,body.staff-dark #app #view-safer .safer-snapshot option{background:#fff!important;color:#111!important;border:1px solid #64748b!important;padding:8px;color-scheme:light}
@media print{body.staff-dark.compliance-active #app .safer-snapshot{padding:0!important;font-size:10pt}body.staff-dark.compliance-active #app .safer-snapshot :is(nav,form,button,#saved-searches,#carrier-matches,#carrier-saved),body.staff-dark.compliance-active #app .safer-snapshot h3:has(+ #carrier-saved){display:none!important}body.staff-dark.compliance-active #app .safer-snapshot table{break-inside:auto}body.staff-dark.compliance-active #app .safer-snapshot tr{break-inside:avoid}body.staff-dark.compliance-active #app #view-safer{min-height:0}body.staff-dark.compliance-active #app .safer-snapshot header{background:#fff!important}body.staff-dark.compliance-active #app .safer-snapshot header *{background:#fff!important;color:#111!important}}

body.staff-dark #app #view-safer [hidden]{display:none!important}
body.staff-dark #app #view-safer #view-fmcsa{background:#fff!important;color:#17202a!important}
body.staff-dark #app #view-safer #view-fmcsa :is(h2,h3,h4,p,label,strong,span,td,th){color:#17202a!important}
body.staff-dark #app #view-safer #view-fmcsa :is(.inspection-item,td,fieldset,.op-form){background:#fff!important;color:#17202a!important}
body.staff-dark #app #view-safer #view-fmcsa :is(h3,h4,th,.inspection-links,.inspection-footer){background:#e4e9ef!important;color:#12385b!important}
body.staff-dark #app #view-safer #view-fmcsa :is(input,select,textarea,option){background:#fff!important;color:#111!important;border:1px solid #64748b!important;color-scheme:light}
body.staff-dark #app #view-safer #view-fmcsa button{background:#164b78!important;color:#fff!important;border:1px solid #164b78!important}
body.staff-dark #app #view-safer [data-compliance-tab][aria-pressed=true]{background:#003366!important;outline:2px solid #fff;outline-offset:-4px}
/* Embedded inspection workspace: override all legacy dark inspection rules. */
body.staff-dark.compliance-active #app #view-safer #view-fmcsa,
body.staff-dark.compliance-active #app #view-safer #view-fmcsa *{color:#17202a!important;background-color:transparent!important;border-color:#8a96a3!important;text-shadow:none!important;color-scheme:light!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa{background:#fff!important;padding:20px 0;overflow-x:auto}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa :is(td,fieldset,.inspection-item,.op-form,.inspection-choice,.inspection-query){background:#fff!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa :is(h3,h4,th,.inspection-masthead,.inspection-links,.inspection-footer,.inspection-record-title){background:#e4e9ef!important;color:#12385b!important;padding:10px}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa :is(input,textarea,select,option){background:#fff!important;color:#111!important;border:1px solid #64748b!important;caret-color:#111!important;opacity:1!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa :is(input,textarea)::placeholder{color:#52616d!important;opacity:1!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa button{background:#164b78!important;color:#fff!important;border:1px solid #164b78!important;padding:8px 12px;box-shadow:none!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa button *{color:#fff!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa button:hover{background:#003366!important;color:#fff!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa a{color:#004b91!important;text-decoration:underline}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa :disabled{background:#edf1f4!important;color:#344553!important;opacity:1!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa button:disabled{background:#dce4ea!important;color:#344553!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa input:is([type=checkbox],[type=radio]){accent-color:#164b78!important}
body.staff-dark.compliance-active #app #view-safer #view-fmcsa :focus-visible{outline:3px solid #a34b00!important;outline-offset:2px}

/* New-call intake: keep legacy light panels from mixing with staff dark text. */
body.staff-dark #modal-root #dispatch-form.cad-intake {
  background:var(--surface-elevated)!important;color:var(--text-primary);font-size:13px;
}
body.staff-dark #modal-root #dispatch-form :is(.form-section,.carrier-lookup,.carrier-summary) {
  background:var(--surface-elevated)!important;color:var(--text-primary)!important;border-color:var(--border)!important;
}
body.staff-dark #modal-root #dispatch-form :is(.modal-head,.modal-foot,.form-section-title,.cad-intake-strip) {
  background:var(--surface-inset)!important;color:var(--text-primary)!important;border-color:var(--border)!important;
}
body.staff-dark #modal-root #dispatch-form :is(label,p,small,.cad-intake-help,.cad-intake-strip span) {
  color:var(--text-secondary)!important;font-size:12px;
}
body.staff-dark #modal-root #dispatch-form :is(h2,.form-section-title,.cad-intake-strip b) {
  color:var(--text-primary)!important;
}
body.staff-dark #modal-root #dispatch-form :is(input,select,textarea,option) {
  background:var(--surface-inset)!important;color:var(--text-primary)!important;border:1px solid var(--border)!important;
  font-size:13px;min-height:36px;box-shadow:none;caret-color:var(--text-primary);color-scheme:dark;
}
body.staff-dark #modal-root #dispatch-form :is(input,textarea)::placeholder {
  color:var(--text-muted)!important;font-size:12px;opacity:1;
}
body.staff-dark #modal-root #dispatch-form :is(.secondary-btn,.modal-close,.carrier-lookup button) {
  background:var(--surface-hover)!important;color:var(--text-primary)!important;border:1px solid var(--border)!important;
}
body.staff-dark #modal-root #dispatch-form .primary-btn {
  background:var(--accent-fill)!important;color:var(--on-accent)!important;border-color:var(--accent-fill)!important;
}
body.staff-dark #modal-root #dispatch-form .required {color:var(--danger)!important}

/* The legacy mobile icon rule also hid the menu trigger. */
.mobile-nav-close,.mobile-nav-backdrop{display:none}
@media(max-width:1000px){
  body.staff-dark #app .main{margin-left:0!important;min-width:0}
  body.staff-dark #app .topbar{display:flex!important;position:sticky;top:0;z-index:35;flex-wrap:wrap;gap:8px;min-height:58px}
  body.staff-dark #app .topbar>.mobile-menu{display:flex!important;align-items:center;justify-content:center;flex:0 0 44px;min-width:44px;min-height:44px;color:var(--text-primary)!important;background:var(--surface-hover)!important;border:1px solid var(--border)}
  body.staff-dark #app .top-search,body.staff-dark #app .date-chip{display:none}
  body.staff-dark #app .sidebar{display:flex!important;position:fixed;inset:0 auto 0 0;width:min(300px,88vw);height:100dvh;z-index:60;transform:translateX(-105%);overflow-y:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom);transition:transform .2s ease}
  body.staff-dark #app .sidebar.open{transform:translateX(0);box-shadow:12px 0 40px #0009}
  body.staff-dark #app .sidebar .nav-btn{min-height:44px;flex-shrink:0}
  body.staff-dark #app .sidebar .brand{flex-shrink:0}
  body.staff-dark #app .mobile-nav-close{display:block;align-self:flex-end;margin:8px;padding:10px 14px;min-height:44px;background:var(--surface-inset);color:var(--text-primary);border:1px solid var(--border);border-radius:4px}
  body.staff-dark #app .mobile-nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:55;background:#0009;border:0;width:100%;height:100dvh}
}

/* Compliance workspace reflows on phones; only record tables scroll sideways. */
@media screen and (max-width:800px){
  body.staff-dark.compliance-active #app #view-safer .safer-snapshot{padding:12px!important;font-size:14px;max-width:100%;overflow-wrap:anywhere}
  body.staff-dark #app #view-safer .safer-snapshot header{padding:14px;gap:8px}
  body.staff-dark #app #view-safer .safer-snapshot header strong{font-size:22px}
  body.staff-dark #app #view-safer .safer-snapshot h2{font-size:22px}
  body.staff-dark #app #view-safer .safer-snapshot>nav{display:flex;flex-wrap:wrap;gap:8px;padding:10px}
  body.staff-dark #app #view-safer .safer-snapshot>nav button{flex:1 1 140px;min-height:44px}
  body.staff-dark #app #view-safer #safer-search{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
  body.staff-dark #app #view-safer #safer-search label{display:grid;gap:6px;min-width:0}
  body.staff-dark #app #view-safer #safer-search :is(input,select,button){width:100%;min-height:44px;font-size:16px;box-sizing:border-box}
  body.staff-dark #app #view-safer .safer-snapshot :is(button,input,select,textarea){max-width:100%;box-sizing:border-box}
  body.staff-dark #app #view-safer .safer-snapshot button{min-height:44px;margin:3px 0}
  body.staff-dark #app #view-safer .safer-snapshot table{display:block;max-width:100%;overflow-x:auto;table-layout:auto;-webkit-overflow-scrolling:touch}
  body.staff-dark #app #view-safer .safer-snapshot :is(th,td){padding:9px;min-width:110px;word-break:normal}
  body.staff-dark #app #view-safer #safer-result table{display:table;table-layout:fixed;width:100%}
  body.staff-dark #app #view-safer #safer-result :is(th,td){min-width:0;width:50%;overflow-wrap:anywhere}
  body.staff-dark.compliance-active #app #view-safer #view-fmcsa{padding:12px 0;overflow-x:visible;min-width:0;width:100%;box-sizing:border-box}
  body.staff-dark.compliance-active #app #view-safer #view-fmcsa .inspection-masthead{padding:12px;min-height:0}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-brand{font-size:16px}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-brand span{font-size:22px;line-height:1.25}
  body.staff-dark #app #view-safer #view-fmcsa :is(.inspection-links,.inspection-footer){display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%;box-sizing:border-box}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-links>span{display:none}
  body.staff-dark #app #view-safer #view-fmcsa :is(.inspection-query,.inspection-choice,.op-form,.inspection-item,h3,.op-table-wrap,#fmcsa-form>fieldset>p,#fmcsa-form>fieldset>label){width:100%;max-width:100%;box-sizing:border-box}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-query{margin:16px 0;padding:12px}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-query label{display:grid;text-align:left;justify-content:stretch;gap:6px}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-query :is(input,select){width:100%}
  body.staff-dark #app #view-safer #view-fmcsa .op-form{grid-template-columns:minmax(0,1fr);gap:12px;padding:12px}
  body.staff-dark #app #view-safer #view-fmcsa .op-form label{display:grid;grid-template-columns:minmax(0,1fr);text-align:left;padding:0;gap:6px;font-size:14px}
  body.staff-dark #app #view-safer #view-fmcsa .op-form :is(input,select){margin:0;max-width:100%}
  body.staff-dark.compliance-active #app #view-safer #view-fmcsa :is(input,select,textarea){width:100%;min-width:0;min-height:44px;font-size:16px;padding:9px;box-sizing:border-box}
  body.staff-dark.compliance-active #app #view-safer #view-fmcsa input:is([type=checkbox],[type=radio]){width:22px;min-width:22px;min-height:22px;height:22px;flex:0 0 22px}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-item{grid-template-columns:minmax(0,1fr);gap:10px;margin:12px 0;padding:12px;border:1px solid #8a96a3}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-item strong{grid-column:auto;text-align:left;font-size:14px;padding:8px}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-item label{grid-column:auto;font-size:14px;padding:0;gap:6px}
  body.staff-dark #app #view-safer #view-fmcsa .op-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  body.staff-dark #app #view-safer #view-fmcsa .op-table-wrap table{display:table;min-width:700px;table-layout:auto;overflow:visible}
  body.staff-dark #app #view-safer #view-fmcsa :is(.op-toolbar,.carrier-lookup-controls){display:flex;flex-wrap:wrap;gap:10px}
  body.staff-dark #app #view-safer #view-fmcsa .carrier-lookup-controls label{width:100%;max-width:none}
  body.staff-dark #app #view-safer #view-fmcsa .op-toolbar button{flex:1 1 180px;white-space:normal}
  body.staff-dark #app #view-safer #view-fmcsa .inspection-attestation{align-items:flex-start;gap:10px;line-height:1.5}
}

/* Phone CAD uses one page scroll instead of three clipped desktop columns. */
@media screen and (max-width:800px){
  body.staff-dark.cad-active #app #view-dashboard{height:auto;min-height:100dvh;min-width:0}
  body.staff-dark #app .ref-cad{height:auto;min-height:100dvh;overflow:visible;width:100%;max-width:100%;font-size:14px}
  body.staff-dark #app .ref-tabs{height:auto;min-height:0;padding:10px;gap:8px;align-items:center;flex-wrap:wrap}
  body.staff-dark #app .ref-new{min-height:44px;min-width:120px;margin:0;flex:1}
  body.staff-dark #app [data-ref-workspace]{min-height:44px;width:130px;font-size:14px}
  body.staff-dark #app .ref-tabstrip{order:3;flex:1 0 100%;min-width:0;width:100%;height:48px;align-items:stretch;overflow-x:auto;gap:8px;padding:0 2px}
  body.staff-dark #app .ref-tab{transform:none;min-width:190px;height:44px;border:1px solid #77b8ff;border-radius:4px;flex-shrink:0}
  body.staff-dark #app .ref-tab button{transform:none;padding:10px;min-height:44px}
  body.staff-dark #app .ref-tab button:last-child{min-width:44px}
  body.staff-dark #app .ref-layout{display:flex;flex-direction:column;min-height:0;gap:0}
  body.staff-dark #app .ref-rail{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:10px;gap:8px;overflow:visible;border-right:0;border-bottom:1px solid #718694}
  body.staff-dark #app .ref-rail>button,body.staff-dark #app .ref-modules summary{width:100%;min-height:48px;margin:0;padding:8px;font-size:12px;box-sizing:border-box}
  body.staff-dark #app .ref-modules{margin:0;min-width:0;grid-column:1/-1}
  body.staff-dark #app .ref-modules[open]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  body.staff-dark #app .ref-modules[open] summary{grid-column:1/-1}
  body.staff-dark #app .ref-modules button{width:100%;min-height:44px;font-size:13px;padding:10px}
  body.staff-dark #app .ref-main{display:block;min-height:0;min-width:0;border-right:0}
  body.staff-dark #app .ref-summary{padding:16px;overflow:visible}
  body.staff-dark #app .ref-summary h1{font-size:20px;overflow-wrap:anywhere}
  body.staff-dark #app .ref-times{line-height:1.7;overflow-wrap:anywhere}
  body.staff-dark #app .ref-assignment{flex-wrap:wrap;gap:14px;padding:12px 0}
  body.staff-dark #app .ref-assignment>div{flex:1 1 110px}
  body.staff-dark #app .ref-facts{grid-template-columns:minmax(0,1fr);gap:4px;margin-top:16px}
  body.staff-dark #app .ref-facts dt{text-align:left;font-size:12px;margin-top:12px;font-weight:700}
  body.staff-dark #app .ref-facts dd{font-size:15px;line-height:1.5}
  body.staff-dark #app .ref-log{padding:16px;min-height:0}
  body.staff-dark #app .ref-activity{overflow:visible;padding:0;min-height:0}
  body.staff-dark #app .ref-log article{overflow-wrap:anywhere}
  body.staff-dark #app #ref-note-form{flex-wrap:wrap;gap:8px}
  body.staff-dark #app #ref-note-form input{min-height:44px;font-size:16px;flex:1 1 200px}
  body.staff-dark #app #ref-note-form button{min-height:44px;min-width:65px}
  body.staff-dark #app .ref-related{padding:16px;overflow:visible;min-width:0}
  body.staff-dark #app .ref-related-tabs{flex-wrap:wrap;gap:6px;margin-bottom:16px}
  body.staff-dark #app .ref-related-tabs button{flex:1 1 120px;min-height:44px;white-space:normal;padding:8px}
  body.staff-dark #app .ref-table{display:block;max-width:100%;overflow-x:auto;table-layout:auto;-webkit-overflow-scrolling:touch}
  body.staff-dark #app .ref-table :is(th,td){min-width:110px;padding:10px 8px}
  body.staff-dark #app .ref-table button{min-height:44px}
  body.staff-dark #app .ref-related h2{font-size:16px;overflow-wrap:anywhere}
  body.staff-dark #app .ref-related h2 span{float:none;font-size:13px}
  body.staff-dark #app .ref-footer{height:auto;min-height:44px;flex-wrap:wrap;padding:12px;gap:8px;font-size:12px}
  body.staff-dark #app .ref-footer .ref-connection{margin-left:0}
  body.staff-dark #modal-root #ref-queue-results{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  body.staff-dark #modal-root #ref-queue-results .ref-table{min-width:520px;table-layout:auto}
  body.staff-dark #modal-root #ref-queue-results button{min-height:44px}
  body.staff-dark #modal-root #ref-queue-search{width:100%;min-height:44px;font-size:16px;box-sizing:border-box}
}
