/* FleetHandle workspace foundation. Preserve the existing brand assets.
   Loaded after the legacy cascade; this is the single ASTRA design entry point. */
:root {
  --fh-canvas: #080f18;
  --fh-surface: #101c2b;
  --fh-surface-inset: #0b1522;
  --fh-line: #28394e;
  --fh-copy: #e8eef6;
  --fh-secondary: #acbbce;
  --fh-radius: 12px;
  --fh-control: 38px;
  --bg: var(--fh-canvas);
  --panel: var(--fh-surface);
  --border: var(--fh-line);
  --text: var(--fh-copy);
  --muted: var(--fh-secondary);
}
body.fh-console-nav { background: var(--fh-canvas); color: var(--fh-copy); }
body.fh-console-nav .module-source-status {
  margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--fh-line);
  border-left: 3px solid #d5ac58; border-radius: var(--fh-radius);
  color: var(--fh-copy); background: var(--fh-surface); font-size: 14px !important;
  line-height: 1.6 !important; white-space: normal !important; overflow-wrap: anywhere;
  height: auto !important; max-height: none !important; overflow: visible !important; flex: 1 1 280px;
}
body.fh-console-nav .module-source-status[data-state="ready"] { border-left-color: var(--fh-secondary); }
body.fh-console-nav .module-source-bar { display: flex; flex-wrap: wrap; align-items: start; gap: 12px; }
body.fh-console-nav .module-source-bar > button { min-height: 44px; padding: 10px 16px; margin-bottom: 16px; }
body.fh-console-nav #tachographsPage .tacho-metric-card.is-unknown .tacho-metric-icon { color: var(--fh-secondary); background: var(--fh-surface-inset); }
body.fh-console-nav #tachographsPage .tacho-metric-card.is-unknown b { color: var(--fh-secondary); }
body.fh-console-nav #tachographsPage .tacho-metric-card small { white-space: normal !important; }
body.fh-console-nav .page { font-size: 14px; line-height: 1.5; }
body.fh-console-nav :is(button,input,select,textarea):focus-visible {
  outline: 2px solid var(--accent-2) !important;
  outline-offset: 3px !important;
}
body.fh-console-nav button:hover { transform: none; }
body.fh-console-nav .page :is(button,input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea) {
  font-size: 13px;
  line-height: 1.4;
}
body.fh-console-nav .page :is(.panel,.ai-console-surface,.communication-panel,.drivers-ops-panel) {
  border-color: var(--fh-line) !important;
  border-radius: var(--fh-radius) !important;
  background: var(--fh-surface) !important;
  box-shadow: none !important;
}
body.fh-console-nav .page :is(.panel-title,.ai-section-head h2,.ai-map-toolbar h2,.drivers-ops-panel h2) {
  color: var(--fh-copy) !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
}
body.fh-console-nav .page :is(.panel-subtitle,.ai-section-head p,.ai-map-toolbar p) {
  color: var(--fh-secondary) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}
body.fh-console-nav .page .comm-empty {
  color: var(--fh-secondary) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  padding: 28px 20px !important;
}
body.fh-console-nav .page :is(.btn-primary,.ai-run-button) {
  min-height: 42px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}
/* Desktop shell: unchanged logo, readable navigation and stable hit targets. */
@media (min-width: 901px) {
  body.fh-console-nav .header { height: 60px !important; min-height: 60px !important; flex-shrink: 0; }
  body.fh-console-nav .header-inner { height: 60px !important; min-height: 60px !important; }
  body.fh-console-nav .nav { align-self: stretch; align-items: stretch; overflow-x: auto !important; }
  body.fh-console-nav .nav-btn { min-height: 44px !important; padding-inline: 9px !important; font-size: 12px !important; }
  body.fh-console-nav .nav-icon { width: 15px !important; height: 15px !important; }
  body.fh-console-nav .page { padding: 20px 24px 12px !important; min-height: 0 !important; height: calc(100dvh - 60px) !important; max-height: calc(100dvh - 60px) !important; flex: 1 1 0 !important; }
  body.fh-console-nav #handlerPage { padding: 0 !important; }
}
/* Handler: a readable decision queue, evidence workspace, then outcome log. */
body.fh-console-nav #commsPage .comm-template-scope {
  display: flex; flex: 0 0 auto; align-items: center; flex-wrap: wrap;
  gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--fh-line);
  font-size: 13px; line-height: 1.5;
}
body.fh-console-nav #commsPage #communicationTemplateCompany {
  max-width: 100%; min-width: 160px; min-height: 42px; width: auto;
  padding: 8px 12px; border: 1px solid var(--fh-line); border-radius: 8px;
  color: var(--fh-copy); background: var(--fh-surface-inset);
}
body.fh-console-nav #commsPage #communicationTemplateScopeStatus { flex: 1 1 240px; color: var(--fh-secondary); }
body.fh-console-nav #commsPage #communicationTemplateRetry { min-height: 42px; padding: 8px 12px; }
body.fh-console-nav #commsPage .comm-thread-actions button { min-width: 44px; min-height: 44px; }
body.fh-console-nav #handlerPage .handler-scope-bar {
  display: flex; align-items: center; flex-wrap: wrap; flex-shrink: 0;
  gap: 10px 14px; padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid var(--fh-line); border-radius: var(--fh-radius); background: var(--fh-surface);
  font-size: 14px; line-height: 1.5;
}
body.fh-console-nav #handlerPage #handlerCompanySelect {
  width: auto; max-width: 100%; min-height: 42px; min-width: 180px;
  padding: 8px 12px; border: 1px solid var(--fh-line); border-radius: 8px;
  color: var(--fh-copy); background: var(--fh-surface-inset); font-size: 14px;
}
body.fh-console-nav #handlerPage #handlerScopeStatus { flex: 1 1 280px; color: var(--fh-secondary); }
body.fh-console-nav #handlerPage #handlerScopeStatus[data-state="error"],
body.fh-console-nav #handlerPage #handlerScopeStatus[data-state="partial"] { color: #fbbf24; }
body.fh-console-nav #handlerPage :is(.handler-recommendation.info,.severity-pill.info) { color: var(--fh-secondary); border-color: var(--fh-line); }
body.fh-console-nav #handlerPage .handler-live-state:not([data-state="ready"]) .handler-live-dot { background: var(--fh-secondary); box-shadow: none; }
body.fh-console-nav #handlerPage .handler-live-state:is([data-state="error"],[data-state="partial"]) .handler-live-dot { background: #fbbf24; }
body.fh-console-nav #handlerPage .handler-page-head {
  display: flex !important; align-items: center !important; flex-wrap: wrap;
  height: auto !important; min-height: 0 !important; max-height: none !important; flex-shrink: 0 !important;
  justify-content: space-between; gap: 16px !important; margin-bottom: 18px !important;
}
body.fh-console-nav #handlerPage .handler-page-title { display: block !important; flex: 1 1 360px; min-width: 0; }
body.fh-console-nav #handlerPage .handler-page-title h1,
body.fh-console-nav #aiAnalysisPage .ai-control-copy h1 {
  display: block !important; margin: 0 0 5px !important; font-size: 26px !important;
  line-height: 1.2 !important; letter-spacing: -.025em; color: var(--fh-copy);
}
body.fh-console-nav #handlerPage .handler-page-title p,
body.fh-console-nav #aiAnalysisPage .ai-control-copy > p {
  display: block !important; margin: 0 !important; font-size: 14px !important;
  line-height: 1.5 !important; color: var(--fh-secondary) !important; max-width: 65ch;
}
body.fh-console-nav #handlerPage .handler-controls { flex: 0 1 510px; width: auto !important; gap: 10px !important; }
body.fh-console-nav #handlerPage :is(.handler-search-shell,.handler-filter-shell) { height: 42px !important; }
body.fh-console-nav #handlerPage :is(.handler-search-shell input,.handler-filter-shell select,.fh-select-trigger) {
  font-size: 13px !important; min-height: 40px !important; height: auto !important;
}
body.fh-console-nav #handlerPage .decision-layout { grid-template-rows: auto minmax(0,1fr) !important; gap: 16px !important; }
body.fh-console-nav #handlerPage .decision-metrics { gap: 12px !important; }
body.fh-console-nav #handlerPage .handler-metric-card {
  min-height: 102px !important; padding: 16px !important; gap: 12px !important;
  border-radius: var(--fh-radius) !important; background: var(--fh-surface) !important;
  grid-template-columns: 36px minmax(0,1fr) !important;
}
body.fh-console-nav #handlerPage .handler-metric-icon { width: 34px !important; height: 34px !important; border: 0 !important; background: var(--accent-soft) !important; }
body.fh-console-nav #handlerPage .metric-label { font-size: 13px !important; line-height: 1.35 !important; }
body.fh-console-nav #handlerPage .metric-value { margin-top: 4px; font-size: 28px !important; line-height: 1.1 !important; font-variant-numeric: tabular-nums; }
body.fh-console-nav #handlerPage .handler-metric-note { font-size: 12px !important; line-height: 1.4 !important; color: var(--fh-secondary) !important; }
body.fh-console-nav #handlerPage .handler-metric-trend { display: none; }
body.fh-console-nav #handlerPage .decision-workspace { grid-template-columns: minmax(250px, .85fr) minmax(360px,1.65fr) minmax(240px,.8fr) !important; gap: 16px !important; }
body.fh-console-nav #handlerPage .panel-header { padding: 18px 18px 12px !important; min-height: 0 !important; }
body.fh-console-nav #handlerPage .panel-body { padding: 8px 18px 18px !important; }
body.fh-console-nav #handlerPage :is(.handler-icon-button,.handler-rec-dismiss,.handler-detail-dismiss) { width: 36px !important; height: 36px !important; min-width: 36px !important; }
body.fh-console-nav #handlerPage .handler-recommendation { padding: 14px !important; border-radius: 9px !important; gap: 10px !important; }
body.fh-console-nav #handlerPage .handler-recommendation.active { background: #162b40 !important; border-color: #4a8bb0 !important; box-shadow: inset 3px 0 var(--accent) !important; }
body.fh-console-nav #handlerPage .handler-recommendation.is-dismissible .handler-rec-top:first-of-type { padding-right: 38px !important; flex-wrap: wrap; gap: 8px; }
body.fh-console-nav #handlerPage :is(.handler-rec-title,.handler-detail-title) { font-size: 15px !important; line-height: 1.45 !important; font-weight: 650 !important; }
body.fh-console-nav #handlerPage .handler-detail-title { font-size: 18px !important; }
body.fh-console-nav #handlerPage :is(.handler-rec-meta,.handler-fact,.handler-rec-footer,.status-line) { font-size: 13px !important; line-height: 1.6 !important; color: var(--fh-secondary) !important; }
body.fh-console-nav #handlerPage :is(.severity-pill,.confidence-pill,.action-state,.handler-log-kicker,.handler-log-time,.handler-log-filter) { font-size: 12px !important; line-height: 1.4 !important; }
body.fh-console-nav #handlerPage .handler-log-filter { height: 36px !important; }
body.fh-console-nav #handlerPage .handler-detail-grid { gap: 20px !important; }
body.fh-console-nav #handlerPage .handler-detail-split { display: grid !important; grid-template-columns: 1fr !important; gap: 18px !important; }
body.fh-console-nav #handlerPage .handler-section { gap: 9px !important; }
body.fh-console-nav #handlerPage .handler-section h3 { margin: 0 !important; font-size: 13px !important; line-height: 1.4 !important; font-weight: 700; }
body.fh-console-nav #handlerPage .handler-detail-split > .handler-section { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
body.fh-console-nav #handlerPage .handler-fact-list { padding-left: 18px !important; }
body.fh-console-nav #handlerPage .handler-fact-list .handler-fact { padding: 3px 0 !important; }
body.fh-console-nav #handlerPage .handler-action-options { gap: 8px !important; }
body.fh-console-nav #handlerPage .handler-action-option { min-height: 68px !important; padding: 12px !important; gap: 12px !important; border-radius: 8px !important; }
body.fh-console-nav #handlerPage .handler-action-title { font-size: 14px !important; line-height: 1.4 !important; }
body.fh-console-nav #handlerPage .handler-action-note { font-size: 12px !important; line-height: 1.5 !important; color: var(--fh-secondary) !important; }
body.fh-console-nav #handlerPage .handler-dispatch { padding: 14px !important; border-radius: 9px !important; }
body.fh-console-nav #handlerPage .handler-dispatch b { font-size: 14px !important; line-height: 1.4; }
body.fh-console-nav #handlerPage :is(.handler-current-card,.handler-log-item) { border-radius: 9px !important; }
body.fh-console-nav #handlerPage .handler-console-footer { height: auto !important; min-height: 44px !important; gap: 12px !important; padding-top: 12px !important; font-size: 11px !important; flex-wrap: wrap; }
body.fh-console-nav #handlerPage .confidence-bar.unavailable {
  display: block !important; height: auto !important; min-height: 34px !important;
  padding: 8px 10px !important; border: 1px dashed #536276 !important; border-radius: 6px;
  background: #182433 !important; color: var(--fh-secondary) !important;
  font-size: 12px !important; line-height: 1.5 !important;
}
body.fh-console-nav #handlerPage .confidence-bar.unavailable span { display: block !important; height: auto !important; background: transparent !important; color: inherit !important; font: inherit !important; }
/* AI uses a scrolling investigation canvas instead of shrinking all content. */
body.fh-console-nav #aiAnalysisPage.page-section.active {
  display: flex !important; flex-direction: column !important; gap: 20px !important;
  height: 100% !important; min-height: 0 !important; overflow-y: auto !important;
  overflow-x: hidden !important; padding-right: 6px !important; padding-bottom: 24px !important;
}
body.fh-console-nav #aiAnalysisPage > * { flex-shrink: 0 !important; min-width: 0; }
body.fh-console-nav #aiAnalysisPage .ai-control-strip {
  display: grid !important; grid-template-columns: minmax(0,1fr) !important;
  padding: 22px !important; gap: 20px !important; min-height: 0 !important; height: auto !important; max-height: none !important; overflow: visible !important;
}
body.fh-console-nav #aiAnalysisPage .ai-control-form { margin-top: 20px !important; gap: 12px !important; flex-wrap: wrap !important; }
body.fh-console-nav #aiAnalysisPage .ai-control-copy { width: 100% !important; max-width: none !important; }
body.fh-console-nav #aiAnalysisPage .ai-control-form { display: grid !important; grid-template-columns: minmax(180px,260px) minmax(160px,220px) max-content !important; width: 100% !important; max-width: none !important; align-items: end !important; }
body.fh-console-nav #aiAnalysisPage :is(.ai-foundation-actions-v149,#aiStatus,#fhAiHandoffBannerV1) { grid-column: 1 / -1; }
body.fh-console-nav #aiAnalysisPage .ai-foundation-actions-v149 { width: 100% !important; max-width: none !important; }
body.fh-console-nav #aiAnalysisPage .ai-run-button span { font-size: 14px !important; }
body.fh-console-nav #aiAnalysisPage .ai-run-button { height: 44px !important; min-height: 44px !important; font-size: 14px !important; padding: 0 18px !important; }
body.fh-console-nav #aiAnalysisPage .ai-field > span:first-child { font-size: 12px !important; color: var(--fh-secondary) !important; margin-bottom: 6px !important; }
body.fh-console-nav #aiAnalysisPage :is(.ai-select-shell, .ai-select-shell select, .fh-select-trigger) { min-height: 42px !important; height: 42px !important; font-size: 14px !important; }
body.fh-console-nav #aiAnalysisPage .ai-foundation-actions-v149 { gap: 8px !important; flex-wrap: wrap !important; }
body.fh-console-nav #aiAnalysisPage .ai-foundation-actions-v149 button { min-height: 36px !important; padding: 8px 12px !important; font-size: 12px !important; }
body.fh-console-nav #aiAnalysisPage #aiStatus { font-size: 13px !important; line-height: 1.5 !important; color: var(--fh-secondary) !important; }
body.fh-console-nav #aiAnalysisPage .ai-control-statuses { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)) !important; border: 0 !important; border-top: 1px solid var(--fh-line) !important; padding: 16px 0 0 !important; gap: 16px !important; }
body.fh-console-nav #aiAnalysisPage .ai-control-status { min-height: 48px !important; padding: 0 0 0 28px !important; border: 0 !important; background: transparent !important; }
body.fh-console-nav #aiAnalysisPage .ai-control-status small { font-size: 12px !important; line-height: 1.5 !important; color: var(--fh-secondary) !important; }
body.fh-console-nav #aiAnalysisPage .ai-control-status b { font-size: 14px !important; line-height: 1.5 !important; }
body.fh-console-nav #aiAnalysisPage #aiTelemetryIndicator { grid-template-columns: 18px minmax(0,1fr); margin-left: 0; }
body.fh-console-nav #aiAnalysisPage #aiTelemetryIndicator :is(small,b,.ai-telemetry-detail) { white-space: normal !important; overflow: visible !important; overflow-wrap: anywhere; }
body.fh-console-nav #aiAnalysisPage #aiTelemetryIndicator .ai-telemetry-detail { grid-column: 2; font-size: 12px !important; line-height: 1.5; color: var(--fh-secondary); }
body.fh-console-nav #aiAnalysisPage #aiTelemetryIndicator .fh-icon { color: var(--fh-secondary); }
body.fh-console-nav #aiAnalysisPage #aiTelemetryIndicator[data-state="fresh"] .fh-icon { color: #65c85c; }
body.fh-console-nav #aiAnalysisPage #aiTelemetryIndicator:is([data-state="stale"],[data-state="offline"]) .fh-icon { color: #d5ac58; }
body.fh-console-nav #aiAnalysisPage #aiTelemetryIndicator:is([data-state="invalid"],[data-state="error"]) .fh-icon { color: #ff9b98; }
body.fh-console-nav #aiAnalysisPage :is(.ai-upper-grid,.ai-lower-grid) { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr) !important; gap: 20px !important; height: auto !important; min-height: 340px !important; }
body.fh-console-nav #aiAnalysisPage .ai-lower-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; min-height: 260px !important; }
body.fh-console-nav #aiAnalysisPage :is(.ai-section-head,.ai-map-toolbar) { padding: 18px !important; gap: 12px !important; flex-wrap: wrap !important; min-height: 0 !important; height: auto !important; }
body.fh-console-nav #aiAnalysisPage .ai-map-toolbar-copy { flex: 1 1 100% !important; }
body.fh-console-nav #aiAnalysisPage :is(.ai-section-link,.ai-map-toggles label,.ai-layer-trigger-v164,.ai-llm-head-actions-v160 button) { font-size: 12px !important; min-height: 36px !important; line-height: 1.5 !important; }
body.fh-console-nav #aiAnalysisPage .ai-map-toggles { flex-wrap: wrap; height: auto !important; }
body.fh-console-nav #aiAnalysisPage .ai-map-stage { height: 270px !important; min-height: 270px !important; }
body.fh-console-nav #aiAnalysisPage :is(#aiAnalysisResult,.ai-llm-body-v160,.ai-events-table-scroll) { max-height: 560px !important; overflow-y: auto !important; min-height: 0 !important; font-size: 14px !important; }
body.fh-console-nav #aiAnalysisPage .ai-llm-panel-v160 { min-height: 170px !important; height: auto !important; }
body.fh-console-nav #aiAnalysisPage :is(.ai-llm-summary-v160,.ai-llm-list-v160) { font-size: 14px !important; line-height: 1.65 !important; }
/* Tablet moves the supporting log below; phone preserves task order. */
@media (min-width: 761px) and (max-width: 1150px) {
  body.fh-console-nav #handlerPage { overflow-y: auto !important; }
  body.fh-console-nav #handlerPage .decision-layout { display: block !important; overflow: visible !important; }
  body.fh-console-nav #handlerPage .decision-workspace { margin-top: 16px; grid-template-columns: minmax(250px,.8fr) minmax(0,1.2fr) !important; overflow: visible !important; }
  body.fh-console-nav #handlerPage .decision-workspace > .panel { min-height: 420px !important; }
  body.fh-console-nav #handlerPage .decision-workspace > .panel:last-child { grid-column: 1 / -1; min-height: 220px !important; }
}
@media (max-width: 900px) {
  body.fh-console-nav #aiAnalysisPage :is(.ai-upper-grid,.ai-lower-grid) { grid-template-columns: minmax(0,1fr) !important; }
}
@media (max-width: 760px), (pointer: coarse) and (max-width: 900px) {
  body.fh-phone .page { scroll-padding-bottom: calc(var(--mobile-nav-height,76px) + var(--mobile-safe-bottom,34px) + 24px) !important; }
  body.fh-phone #handlerPage { width: 100% !important; padding: 16px 12px calc(var(--mobile-nav-height,76px) + var(--mobile-safe-bottom,34px) + 24px) !important; }
  body.fh-phone #handlerPage .handler-page-head { height: auto !important; max-height: none !important; min-height: 0 !important; overflow: visible !important; }
  body.fh-phone #handlerPage .handler-page-title { flex-basis: 100%; }
  body.fh-phone #handlerPage .handler-page-title h1,
  body.fh-phone #aiAnalysisPage .ai-control-copy h1 { font-size: 24px !important; }
  body.fh-phone #handlerPage .handler-controls { flex: 1 1 100%; width: 100% !important; display: grid !important; grid-template-columns: minmax(0,1fr) 110px !important; }
  body.fh-phone #handlerPage .handler-search-shell { flex: 1 1 100%; }
  body.fh-phone #handlerPage .handler-filter-shell { width: 100% !important; min-width: 0 !important; max-width: none !important; padding: 0 !important; }
  body.fh-phone #handlerPage .handler-filter-shell > .fh-icon { display: none !important; }
  body.fh-phone #handlerPage .fh-handler-select-trigger-v104 { width: 100% !important; min-width: 0 !important; padding: 0 10px !important; gap: 8px !important; }
  body.fh-phone #handlerPage .fh-handler-select-label-v104 { width: auto !important; font-size: 13px !important; }
  body.fh-phone #handlerPage .fh-handler-select-trigger-v104 .fh-icon { position: static !important; width: 14px !important; height: 14px !important; }
  body.fh-phone #handlerPage .decision-metrics { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  body.fh-phone #handlerPage .handler-metric-card { padding: 12px !important; grid-template-columns: minmax(0,1fr) !important; min-height: 118px !important; }
  body.fh-phone #handlerPage .handler-metric-icon { display: none !important; }
  body.fh-phone #handlerPage .decision-workspace { grid-template-columns: minmax(0,1fr) !important; }
  body.fh-phone #handlerPage :is(.handler-icon-button,.handler-rec-dismiss,.handler-detail-dismiss,.handler-log-filter) { min-height: 44px !important; min-width: 44px !important; }
  body.fh-phone #handlerPage .handler-detail-top { flex-wrap: wrap; gap: 12px; }
  body.fh-phone #handlerPage .handler-detail-main { flex: 1 1 100%; }
  body.fh-phone #aiAnalysisPage.page-section.active { height: auto !important; overflow: visible !important; padding: 0 0 24px !important; }
  body.fh-phone #aiAnalysisPage .ai-control-strip { padding: 16px !important; }
  body.fh-phone #aiAnalysisPage .ai-control-form { grid-template-columns: minmax(0,1fr) !important; }
  body.fh-phone #aiAnalysisPage .ai-field { width: 100% !important; max-width: none !important; }
  body.fh-phone #aiAnalysisPage .ai-control-form > .ai-field:nth-child(1) { grid-column: 1 !important; grid-row: 1 !important; }
  body.fh-phone #aiAnalysisPage .ai-control-form > .ai-field:nth-child(2) { grid-column: 1 !important; grid-row: 2 !important; }
  body.fh-phone #aiAnalysisPage .ai-run-button { grid-column: 1 !important; grid-row: 3 !important; width: 100% !important; }
  body.fh-phone #aiAnalysisPage .ai-foundation-actions-v149 { grid-column: 1 !important; grid-row: 4 !important; width: 100% !important; flex-direction: row !important; }
  body.fh-phone #aiAnalysisPage #aiStatus { grid-column: 1 !important; grid-row: 5 !important; }
  body.fh-phone #aiAnalysisPage .ai-control-statuses { grid-template-columns: 1fr !important; gap: 12px !important; }
  body.fh-phone #aiAnalysisPage .ai-control-status { min-height: 42px !important; }
  body.fh-phone #aiAnalysisPage :is(.ai-foundation-actions-v149 button,.ai-section-link,.ai-layer-trigger-v164) { min-height: 44px !important; }
  body.fh-phone #driversPage .drivers-ops-grid > .drivers-ops-panel:nth-child(1) { order: 2 !important; }
  body.fh-phone #driversPage .drivers-ops-grid > .drivers-ops-panel:nth-child(2) { order: 1 !important; }
  body.fh-phone #driversPage .drivers-ops-grid > .drivers-ops-panel:nth-child(3) { order: 3 !important; }
  body.fh-phone #commsPage .communication-grid > .communication-panel[aria-label="Communication contacts"] { order: 1 !important; }
  body.fh-phone #commsPage .communication-grid > .comm-thread-panel { order: 2 !important; }
  body.fh-phone #commsPage .communication-grid > .communication-panel[aria-label="Vehicle context"] { order: 3 !important; }
  body.fh-phone #commsPage .comm-compose { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 8px !important; width: calc(100% - 32px) !important; max-width: calc(100% - 32px) !important; }
  body.fh-phone #commsPage .comm-thread-actions { width: auto !important; flex: 0 0 auto; }
  body.fh-phone #commsPage .comm-thread-person h2 { white-space: normal; font-size: 14px; overflow-wrap: anywhere; }
  body.fh-phone #commsPage .comm-template-menu button { width: 100%; min-height: 44px; font-size: 13px; text-align: left; white-space: normal; }
  body.fh-phone #commsPage :is(.comm-compose-field,.comm-compose-actions) { width: 100% !important; min-width: 0 !important; }
  body.fh-phone #commsPage .comm-compose-actions { grid-template-columns: minmax(0,1fr) 52px !important; align-items: stretch !important; }
  body.fh-phone #commsPage #communicationSendButton { width: 100% !important; min-width: 0 !important; }
  body.fh-phone #commsPage .comm-template-button { width: 52px !important; min-width: 52px !important; max-width: 52px !important; }
  body.fh-phone #commsPage .comm-template-manage-v144 { grid-column: 1 / -1 !important; width: 100% !important; min-width: 0 !important; min-height: 44px; }
  body.fh-phone #dashboardPage .map-layer-toggle { left: 8px !important; right: 8px !important; width: auto !important; max-width: none !important; overflow-x: auto !important; scrollbar-width: none !important; }
  body.fh-phone #dashboardPage .map-layer-toggle::-webkit-scrollbar { display: none !important; }
  body.fh-phone #dashboardPage .map-layer-toggle button { flex: 0 0 auto !important; white-space: nowrap !important; padding: 8px 10px !important; font-size: 11px !important; }
}
@media (prefers-reduced-motion: reduce) {
  body.fh-console-nav :is(button,input,select,textarea) { transition: none !important; }
}

/* Preferences: compact professional hierarchy, not compressed labels in tall cards. */
body.fh-console-nav #preferencesPage.page-section.active { display: block !important; height: auto !important; min-height: 0 !important; overflow: visible !important; padding: 20px 24px 28px !important; }
body.fh-console-nav #preferencesPage .preferences-console-head { display: block !important; margin: 0 0 20px !important; padding: 0 !important; }
body.fh-console-nav #preferencesPage .preferences-console-head h1 { font-size: 26px !important; margin: 0 0 4px; line-height: 1.3; }
body.fh-console-nav #preferencesPage .preferences-console-head p { font-size: 13px !important; color: var(--fh-secondary); }
body.fh-console-nav #preferencesPage .preference-grid { display: grid !important; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr) !important; gap: 20px !important; align-items: start !important; height: auto !important; min-height: 0 !important; flex: none !important; }
body.fh-console-nav #preferencesPage .preferences-console-card { height: auto !important; min-height: 0 !important; overflow: visible !important; border-radius: var(--fh-radius); background: var(--fh-surface); }
body.fh-console-nav #preferencesPage .preferences-card-head { padding: 18px 20px 16px !important; align-items: start; gap: 12px; }
body.fh-console-nav #preferencesPage .preferences-card-head h2 { font-size: 17px !important; line-height: 1.4; }
body.fh-console-nav #preferencesPage .preferences-card-head p { font-size: 12px !important; line-height: 1.5; color: var(--fh-secondary); margin-top: 4px; }
body.fh-console-nav #preferencesPage :is(.preferences-profile-body,.preferences-status-body) { display: block !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; padding: 0 20px 20px !important; }
body.fh-console-nav #preferencesPage .preferences-profile-form { display: grid !important; gap: 16px !important; }
body.fh-console-nav #preferencesPage .preferences-form-group { border: 0; padding: 0; margin: 0; min-width: 0; }
body.fh-console-nav #preferencesPage .preferences-form-group legend { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--fh-secondary); }
body.fh-console-nav #preferencesPage .preferences-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 16px; }
body.fh-console-nav #preferencesPage .preference-field { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 6px !important; min-width: 0; }
body.fh-console-nav #preferencesPage .preference-field > span { font-size: 12px !important; font-weight: 500; line-height: 1.5; color: var(--fh-secondary); }
body.fh-console-nav #preferencesPage .preference-field :is(input,select) { width: 100% !important; height: 40px !important; min-height: 40px !important; font-size: 14px !important; padding: 8px 10px !important; box-sizing: border-box; }
body.fh-console-nav #preferencesPage input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--fh-surface-inset) inset; -webkit-text-fill-color: var(--fh-copy); caret-color: var(--fh-copy); }
body.fh-console-nav #preferencesPage .preferences-security { border-top: 1px solid var(--fh-line); border-bottom: 1px solid var(--fh-line); padding: 4px 0; }
body.fh-console-nav #preferencesPage .preferences-security summary { cursor: pointer; padding: 10px 0; min-height: 40px; font-size: 13px; font-weight: 600; }
body.fh-console-nav #preferencesPage .preferences-security summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
body.fh-console-nav #preferencesPage .preferences-security p { font-size: 12px; line-height: 1.5; color: var(--fh-secondary); margin: 8px 0 12px; }
body.fh-console-nav #preferencesPage .preferences-security[open] { padding-bottom: 16px; }
body.fh-console-nav #preferencesPage .preferences-workspace-options { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--fh-line); }
body.fh-console-nav #preferencesPage .preferences-workspace-options h3 { font-size: 16px; margin: 0 0 8px; }
body.fh-console-nav #preferencesPage .preferences-autosave-note-v114 { margin: 0 0 16px !important; color: var(--fh-secondary); font-size: 12px !important; line-height: 1.5; }
body.fh-console-nav #preferencesPage .preferences-option-list { display: grid; gap: 8px !important; margin: 14px 0 !important; }
body.fh-console-nav #preferencesPage .preferences-option-list label { min-height: 32px; font-size: 13px !important; gap: 10px; line-height: 1.5; }
body.fh-console-nav #preferencesPage input[type="checkbox"] { width: 18px !important; height: 18px !important; flex: 0 0 18px; }
body.fh-console-nav #preferencesPage .preferences-actions { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
body.fh-console-nav #preferencesPage .preferences-actions button { width: auto !important; min-height: 40px !important; font-size: 13px !important; padding: 9px 16px !important; }
body.fh-console-nav #preferencesPage .preferences-status-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 10px !important; }
body.fh-console-nav #preferencesPage .preferences-status-card { min-height: 100px !important; padding: 12px !important; }
body.fh-console-nav #preferencesPage .preferences-status-card :is(small,span) { font-size: 11px !important; line-height: 1.5; white-space: normal; color: var(--fh-secondary); }
body.fh-console-nav #preferencesPage .preferences-status-card b { font-size: 20px !important; background: none !important; }
body.fh-console-nav #preferencesPage .preferences-status-card b:not(.success):not(.warning) { color: var(--fh-secondary) !important; }
body.fh-console-nav #preferencesPage .preferences-status-card b.success { color: #69cc5e !important; }
body.fh-console-nav #preferencesPage .preferences-status-card b.warning { color: #ffb31d !important; }
body.fh-console-nav #preferencesPage .preferences-alert-groups-v114 { margin: 20px 0 0 !important; padding: 18px 0 0 !important; border: 0 !important; border-top: 1px solid var(--fh-line) !important; border-radius: 0; background: none !important; }
body.fh-console-nav #preferencesPage .preferences-alert-groups-head { align-items: start; gap: 12px; }
body.fh-console-nav #preferencesPage .preferences-alert-groups-head h3 { font-size: 16px; }
body.fh-console-nav #preferencesPage .preferences-alert-groups-head p { font-size: 12px; line-height: 1.5; color: var(--fh-secondary); }
body.fh-console-nav #preferencesPage .preferences-alert-groups-head button { min-height: 40px; padding: 8px 14px; white-space: nowrap; }
body.fh-console-nav #preferencesPage .preferences-alert-list { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 0 !important; }
body.fh-console-nav #preferencesPage .preferences-alert-option { border: 0 !important; border-bottom: 1px solid var(--fh-line) !important; border-radius: 0; padding: 12px 0 !important; gap: 12px !important; background: none !important; }
body.fh-console-nav #preferencesPage .preferences-alert-option:last-child { border-bottom: 0 !important; }
body.fh-console-nav #preferencesPage .preferences-alert-option :is(b,strong) { font-size: 13px; }
body.fh-console-nav #preferencesPage .preferences-alert-option :is(small,p) { font-size: 12px; line-height: 1.5; color: var(--fh-secondary); }
body.fh-console-nav #preferencesPage #preferencesSaveStatus { font-size: 13px !important; line-height: 1.5; margin: 0 0 14px; }
body.fh-console-nav #preferencesPage #preferencesSaveStatus:empty { display: none; }
body.fh-console-nav #preferencesPage .console-page-footer { font-size: 11px !important; margin-top: 20px; padding: 0 !important; min-height: 24px; }
@media (max-width: 1000px) {
  body.fh-console-nav #preferencesPage .preference-grid { grid-template-columns: minmax(0,1fr) !important; }
}
@media (max-width: 600px) {
  body.fh-console-nav #preferencesPage.page-section.active { padding: 16px 12px calc(var(--mobile-nav-height,76px) + var(--mobile-safe-bottom,34px) + 24px) !important; }
  body.fh-console-nav #preferencesPage .preferences-field-grid { grid-template-columns: minmax(0,1fr); }
  body.fh-console-nav #preferencesPage .preferences-card-head { padding: 16px !important; }
  body.fh-console-nav #preferencesPage :is(.preferences-profile-body,.preferences-status-body) { padding: 0 16px 16px !important; }
  body.fh-console-nav #preferencesPage .preferences-status-grid { grid-template-columns: minmax(0,1fr) !important; }
  body.fh-console-nav #preferencesPage .preferences-status-card { min-height: 0 !important; }
  body.fh-console-nav #preferencesPage :is(.preference-field input,.preference-field select,.preferences-actions button,.preferences-option-list label,.preferences-security summary,.preferences-alert-groups-head button) { min-height: 44px !important; }
}

/* Vehicle profile: readable priorities with actions inside their own cells. */
body.fh-console-nav #vehiclesPage .vehicles-profile-title-row { grid-template-columns: minmax(0,1fr) auto; }
body.fh-console-nav #vehiclesPage .vehicles-profile-title-row h1 { font-size: 26px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-states { flex-wrap: wrap; }
body.fh-console-nav #vehiclesPage .vehicles-profile-states > button { min-height: 28px; padding: 4px 10px; border: 1px solid var(--fh-line); border-radius: 5px; background: var(--fh-surface); color: var(--accent-2); font: inherit; font-size: 12px; cursor: pointer; }
body.fh-console-nav #vehiclesPage .vehicles-profile-states > button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-scheduled-work { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px 20px; padding: 16px; margin-block: 0 20px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-scheduled-work > h2 { min-height: 0; padding: 0; margin: 0; border: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-scheduled-work > h2 span { color: var(--accent-2); font-variant-numeric: tabular-nums; }
body.fh-console-nav #vehiclesPage .vehicles-profile-scheduled-work > p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--fh-secondary); overflow-wrap: anywhere; }
body.fh-console-nav #vehiclesPage .vehicles-profile-scheduled-work > div { grid-column: 2; grid-row: 1 / 3; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
body.fh-console-nav #vehiclesPage .vehicles-profile-scheduled-work button { min-height: 36px; padding: 8px 12px; font-size: 12px; line-height: 1.4; white-space: normal; }
body.fh-console-nav #vehiclesPage .vehicles-profile-back { min-height: 36px; font-size: 12px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-head-actions { align-items: center; flex-wrap: wrap; }
body.fh-console-nav #vehiclesPage .vehicles-profile-head-actions :is(button,summary) { min-height: 40px; font-size: 13px; padding: 8px 12px; box-sizing: border-box; }

/* Scheduled work is rendered in the shared floating data modal, outside the profile card. */
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap > table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: auto; color: #bac9da; }
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap > table th,
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap > table td { padding: 12px; border-bottom: 1px solid rgba(105,146,187,.16); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap > table th { color: #8998ad; background: #0b1c2f; font-size: 10px; font-weight: 600; }
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap > table td { color: #bac9da; font-size: 12px; line-height: 1.45; }
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap > table tbody tr:last-child td { border-bottom: 0; }
.floating-modal-panel.data-modal .fh-data-modal-body .vehicles-profile-table-wrap > table td button { margin: 2px; }

body.fh-console-nav #vehiclesPage .vehicles-profile-card.vehicles-profile-scheduled-work > h2 { justify-content: flex-start; gap: 8px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-card.vehicles-profile-scheduled-work > h2 > span { width: auto; min-width: 0; padding: 0; border-radius: 0; color: var(--accent-2); background: transparent; font-size: 13px; font-weight: 600; text-align: left; }
body.fh-console-nav #vehiclesPage .vehicles-profile-more > summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-more[open] > div { width: 216px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-more > div button { justify-content: flex-start; white-space: normal; }
body.fh-console-nav #vehiclesPage .vehicles-profile-card > h2 { min-height: 46px; font-size: 16px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-summary-card small { font-size: 12px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority th { font-size: 12px; height: 36px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority :is(th,td) { padding: 8px 10px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority th:nth-child(1) { width: 22%; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority th:nth-child(2) { width: 17%; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority th:nth-child(3) { width: 15%; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority th:nth-child(4) { width: 18%; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority th:nth-child(5) { width: 28%; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority td { font-size: 13px; line-height: 1.5; vertical-align: middle; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority td :is(button,.vehicles-profile-state) { max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; box-sizing: border-box; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority td button { min-height: 36px; height: auto; padding: 6px 10px; line-height: 1.4; }
body.fh-console-nav #vehiclesPage .vehicles-profile-priority td button.vehicles-profile-cell-link { padding-left: 0; padding-right: 0; }
body.fh-console-nav #vehiclesPage .vehicles-profile-info-section { margin-inline: 14px; padding-block: 14px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-info-section h3 { font-size: 13px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-fact { min-height: 28px; gap: 12px; }
body.fh-console-nav #vehiclesPage .vehicles-profile-fact > :is(span,div) { font-size: 12px; line-height: 1.5; }
body.fh-console-nav #vehiclesPage .vehicles-profile-empty-block { font-size: 12px; }
@media (max-width: 680px) {
  body.fh-console-nav #vehiclesPage .vehicles-profile-title-row { grid-template-columns: minmax(0,1fr); }
  body.fh-console-nav #vehiclesPage .vehicles-profile-head-actions { justify-self: start; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-header { position: static; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-summary-card { grid-template-columns: minmax(0,1fr) auto; padding: 12px; gap: 6px 10px; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-summary-card strong { line-height: 1.1; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-summary-card small { grid-column: 1 / -1; line-height: 1.4; }
  body.fh-console-nav #vehiclesPage :is(.vehicles-profile-head-actions button,.vehicles-profile-head-actions summary,.vehicles-profile-back,.vehicles-profile-priority td button) { min-height: 44px; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority :is(table,tbody) { display: block; width: 100%; min-width: 0; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 6px 12px; padding: 12px; border-bottom: 1px solid var(--fh-line); }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority tr:last-child { border-bottom: 0; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority td { display: block; min-width: 0; height: auto; padding: 0; border: 0; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority td:first-child { grid-column: 1 / -1; font-weight: 600; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority td[data-label]::before { content: attr(data-label); display: block; color: var(--fh-secondary); font-size: 12px; margin-bottom: 4px; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority td:last-child { align-self: end; }
  body.fh-console-nav #vehiclesPage .vehicles-profile-priority td:last-child button { width: 100%; }
}
/* Read-only task audit; native modal supplies focus containment and Escape. */
.fh-dispatch-dialog { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; margin: auto; padding: 20px; overflow: auto; border: 1px solid var(--fh-line); border-radius: var(--fh-radius); background: var(--fh-surface); color: var(--fh-copy); font-size: 14px; line-height: 1.5; }
.fh-dispatch-dialog::backdrop { background: #000a; }
.fh-dispatch-dialog .fh-activity-header, .fh-dispatch-dialog .fh-activity-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fh-dispatch-dialog h2 { margin: 0; font-size: 20px; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) .fh-service-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin: 16px 0; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) textarea { box-sizing: border-box; width: 100%; min-height: 80px; padding: 8px; color: var(--fh-copy); background: var(--fh-surface-inset); border: 1px solid var(--fh-line); border-radius: 6px; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) .fh-service-note, :is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) [data-submit] { grid-column: 1 / -1; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) .fh-service-list { padding-left: 20px; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) .fh-service-list li { border-top: 1px solid var(--fh-line); padding: 12px 0; overflow-wrap: anywhere; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) .fh-service-list p { margin: 4px 0; white-space: pre-wrap; }
:is(.fh-vehicle-services, .fh-vehicle-service-correction, .fh-vehicle-service-documents) [data-error="true"] { font-weight: 600; }
.fh-vehicle-service-correction .fh-service-form > h3, .fh-vehicle-service-correction .fh-service-plan { grid-column: 1 / -1; }
.fh-vehicle-service-correction .fh-service-correction-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.fh-vehicle-service-documents .fh-service-document-item { padding: 12px 0; border-top: 1px solid var(--fh-line); overflow-wrap: anywhere; }
.fh-vehicle-service-documents .fh-service-document-item p { margin: 4px 0; }
.fh-vehicle-service-documents .fh-service-document-choice { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; overflow-wrap: anywhere; }
.fh-vehicle-service-documents button { margin: 4px 8px 4px 0; }
/* Service items: full-width fields and compact actions, with paired intervals. */
.fh-vehicle-service-items > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fh-vehicle-service-items .fh-service-form.fh-data-form { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; margin: 16px 0; }
.fh-vehicle-service-items .fh-service-form > :is(h3, label, .fh-service-item-actions, fieldset, .fh-service-note) { grid-column: 1 / -1; min-width: 0; }
.fh-vehicle-service-items textarea { box-sizing: border-box; width: 100%; min-height: 80px; padding: 8px; resize: vertical; font: inherit; color: var(--fh-copy); background: var(--fh-surface-inset); border: 1px solid var(--fh-line); border-radius: 6px; }
.fh-vehicle-service-items .fh-service-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fh-vehicle-service-items .fh-service-form button { box-sizing: border-box; width: auto; min-width: 0; max-width: 100%; height: auto; flex: 0 0 auto; align-self: start; justify-self: start; padding: 8px 12px; }
.fh-vehicle-service-items .fh-service-item-intervals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--fh-line); border-radius: 6px; }
.fh-vehicle-service-items .fh-service-item-intervals > :is(.fh-service-note, button) { grid-column: 1 / -1; }
.fh-vehicle-service-items .fh-service-form .fh-service-note { margin: 0; }
.fh-vehicle-service-costs > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fh-vehicle-service-costs { overflow-wrap: anywhere; }
.fh-vehicle-service-costs .fh-service-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin: 16px 0; }
.fh-vehicle-service-costs .fh-service-form > :is(h3, fieldset, section, p, button), .fh-vehicle-service-costs .fh-service-field:has(textarea) { grid-column: 1 / -1; }
.fh-vehicle-service-costs fieldset { min-width: 0; border: 1px solid var(--fh-line); padding: 12px; }
.fh-vehicle-service-costs .fh-service-cost-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); align-items: end; gap: 10px; margin: 12px 0; }
.fh-vehicle-service-costs textarea { box-sizing: border-box; width: 100%; min-height: 80px; padding: 8px; resize: vertical; color: var(--fh-copy); background: var(--fh-surface-inset); border: 1px solid var(--fh-line); border-radius: 6px; }
.fh-vehicle-service-costs [data-documents] label { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.fh-vehicle-service-costs input[type="radio"] { width: auto; min-height: 0; flex: none; margin-top: 5px; }
.fh-vehicle-service-costs [data-items] { padding-left: 20px; }
.fh-vehicle-service-costs [data-items] li { border-top: 1px solid var(--fh-line); padding: 12px 0; }
.fh-vehicle-service-costs [data-items] p { margin: 4px 0; white-space: pre-wrap; }
.fh-vehicle-service-costs [data-error="true"] { font-weight: 600; }
.fh-cost-summary { border: 1px solid var(--fh-line); border-radius: var(--fh-radius); padding: 16px; margin: 16px 0; background: var(--fh-surface); color: var(--fh-copy); }
.fh-cost-summary header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.fh-cost-summary h2 { font-size: 18px; margin: 0; }
.fh-cost-summary p { margin: 10px 0; overflow-wrap: anywhere; }
.fh-cost-summary-scroll { max-width: 100%; overflow: auto; }
.fh-cost-summary table { border-collapse: collapse; width: 100%; font-size: 13px; }
.fh-cost-summary :is(th,td) { text-align: left; border-bottom: 1px solid var(--fh-line); padding: 8px; white-space: nowrap; }
.fh-cost-summary caption { text-align: left; margin: 8px 0; }
.fh-cost-source-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
dialog.fh-cost-sources-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; margin: auto; }
dialog.fh-cost-sources-dialog::backdrop { background: rgba(0,0,0,.4); }
#reportsPage [hidden] { display: none !important; }
.fh-cost-sources-dialog td:first-child { white-space: normal; min-width: 180px; max-width: 320px; overflow-wrap: anywhere; }
.fh-vehicle-service-rule-preview > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fh-vehicle-service-rule-preview .fh-service-rule-preview-item { padding: 12px 0; border-top: 1px solid var(--fh-line); }
.fh-vehicle-service-rule-preview .fh-service-rule-baseline { padding: 10px; margin: 12px 0; border: 1px solid var(--fh-line); border-radius: 8px; }
.fh-vehicle-service-rule-preview label { display: grid; gap: 6px; margin: 12px 0; }
.fh-vehicle-service-rule-preview textarea { width: 100%; min-height: 76px; box-sizing: border-box; resize: vertical; }
.fh-vehicle-service-rule-preview .fh-service-rule-preview-warning { font-weight: 600; }
.fh-vehicle-service-rule-history .fh-service-rule-history-item { padding: 12px 0; border-top: 1px solid var(--fh-line); }
.fh-vehicle-service-rule-preview { overflow-wrap: anywhere; }
.fh-vehicle-service-rule-preview p { margin: 6px 0; }
.fh-vehicle-service-rule-preview [data-error="true"] { font-weight: 600; }
.fh-dispatch-dialog h3 { margin: 0 0 6px; font-size: 15px; }
.fh-dispatch-dialog small, .fh-dispatch-dialog .status-line { color: var(--fh-secondary); font-size: 12px; white-space: normal; }
.fh-dispatch-dialog label { display: grid; gap: 4px; flex: 1 1 260px; }
.fh-dispatch-dialog input, .fh-dispatch-dialog select { width: 100%; box-sizing: border-box; min-height: 40px; color: var(--fh-copy); background: var(--fh-surface-inset); border: 1px solid var(--fh-line); border-radius: 6px; padding: 8px; }
.fh-dispatch-dialog button { min-height: 40px; }
.fh-dispatch-dialog .fh-activity-event { border-top: 1px solid var(--fh-line); padding: 14px 0; overflow-wrap: anywhere; }
.fh-dispatch-dialog .fh-activity-event p { margin: 4px 0 8px; }
.fh-dispatch-dialog summary { cursor: pointer; padding: 6px 0; }
.fh-dispatch-dialog .fh-activity-table { overflow-x: auto; }
.fh-dispatch-dialog table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.fh-dispatch-dialog th, .fh-dispatch-dialog td { padding: 8px; border: 1px solid var(--fh-line); vertical-align: top; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.fh-dispatch-dialog [role="alert"] { color: #ffb9b9; }
@media (max-width: 600px) { .fh-dispatch-dialog { padding: 12px; } .fh-dispatch-dialog table { min-width: 520px; } }
/* History functionality remains available at narrow widths, not just map/charts. */
/* Client catalogue adds selectable records: fixed legacy grid rows must not clip them. */
#clientsPage.page-section.active { overflow: auto !important; }
#clientsPage .clients-console-layout { height: auto; min-height: 100%; align-items: start; }
#clientsPage .clients-main { display: flex; flex-direction: column; }
#clientsPage .clients-groups-panel { max-height: 75vh; }
#clientsPage .clients-map-panel { flex: none; height: 360px; min-height: 300px; }
#clientsPage .clients-detail-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); min-height: 180px; }
#clientsPage .clients-console-foot { height: auto; min-height: 42px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fh-client-editor { width: min(760px, calc(100vw - 32px)); }
.fh-client-editor [data-fields] { margin: 0; border: 0; padding: 0; }
.fh-client-editor .fh-data-form label, .fh-client-editor .fh-data-form input, .fh-client-editor .fh-data-form select, .fh-client-editor textarea { font-size: 14px; }
.fh-client-editor textarea { width: 100%; min-height: 72px; box-sizing: border-box; color: inherit; background: var(--fh-surface, #101b2c); }
.fh-client-editor .fh-data-form p, .fh-client-editor .fh-client-weekdays { grid-column: 1 / -1; }
.fh-client-editor .fh-client-weekdays { display: flex; flex-wrap: wrap; gap: 12px; }
.fh-client-editor .fh-client-weekdays label { display: flex; align-items: center; }
.fh-client-editor .fh-client-weekdays input { width: auto; min-height: 0; }
.fh-client-editor .fh-data-inline-actions { flex-wrap: wrap; }
.fh-client-import { width: min(880px, calc(100vw - 32px)); }
.fh-client-import [data-settings] { padding: 0; border: 0; margin: 12px 0; }
.fh-client-import-preview { overflow: auto; max-height: 50vh; }
.fh-client-import-preview table { min-width: 0; }
.fh-client-import-preview th:first-child { width: 65px; }
.fh-client-import-preview dl { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr); gap: 4px 12px; margin: 0; }
.fh-client-import-preview dd { margin: 0; }
.fh-client-import [data-receipt], .fh-client-import details { overflow-wrap: anywhere; }
@media (max-width: 900px) {
    #clientsPage .clients-console-layout { grid-template-columns: minmax(0, 1fr); }
    #clientsPage .clients-groups-panel { max-height: 280px; }
    #clientsPage .clients-toolbar { grid-template-columns: minmax(0, 1fr); }
    #clientsPage .clients-summary-strip { overflow-x: auto; }
}
@media (max-width: 540px) { .fh-client-editor .fh-data-form { grid-template-columns: minmax(0, 1fr); } }
.clients-directory-list { padding: 12px; min-width: 0; }
.clients-directory-paging { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.clients-directory-paging span { flex: 1 1 240px; }
.clients-directory-scroll { max-height: 280px; overflow: auto; }
.clients-directory-scroll table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.clients-directory-scroll th, .clients-directory-scroll td { padding: 8px; border-bottom: 1px solid var(--fh-line); text-align: left; overflow-wrap: anywhere; }
.clients-directory-scroll caption { text-align: left; padding-bottom: 6px; }
.clients-directory-scroll small { display: block; }
.clients-directory-scroll button[aria-pressed="true"] { outline: 2px solid var(--fh-accent, #4cbaef); }
.fh-logist-v85-task-status { grid-column: 1 / -1; flex: 1 0 100%; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.fh-logist-v85-task-status button { margin-top: 4px; }
#historyPage .history-status-bar { display: block; margin-top: 8px; }
#historyPage .history-status-bar .status-line { white-space: normal; font-size: 12px; line-height: 1.5; }
#historyPage .history-actions-panel { flex: 0 0 auto !important; height: auto !important; }
.fh-service-plan-work [data-items] { display: grid; gap: 8px; margin: 8px 0 16px; padding: 0; list-style: none; }
.fh-service-plan-work .fh-service-plan-item { min-width: 0; padding: 10px 12px; border: 1px solid var(--fh-line); border-radius: 8px; background: var(--fh-surface-inset); overflow-wrap: anywhere; }
.fh-service-plan-work .fh-service-plan-item-label { display: inline-flex; align-items: flex-start; gap: 9px; min-width: 0; max-width: 100%; line-height: 1.5; overflow-wrap: anywhere; }
.fh-service-plan-work .fh-service-plan-item-label input[type="checkbox"] { flex: 0 0 18px; width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; padding: 0; }
.fh-service-plan-work .fh-service-plan-item > p { margin: 6px 0 0 27px; color: var(--fh-secondary); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.fh-service-plan-work .fh-service-plan-work-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 16px 0 12px; }
.fh-service-plan-work .fh-service-plan-work-form > label { display: grid; min-width: 0; gap: 5px; line-height: 1.4; }
.fh-service-plan-work .fh-service-plan-work-form :is(input:not([type="checkbox"]), select, textarea) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--fh-line); border-radius: 6px; color: var(--fh-copy); background: var(--fh-surface-inset); font: inherit; }
.fh-service-plan-work .fh-service-plan-work-form textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.fh-service-plan-work .fh-service-plan-work-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fh-service-plan-work .fh-service-plan-work-actions button,
.fh-service-plan-work .fh-service-plan-work-form [data-submit] { min-height: 40px; margin: 0; }
@media (min-width: 601px) {
    .fh-service-plan-work .fh-service-plan-work-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
    .fh-service-plan-work .fh-service-plan-work-form > label:first-child,
    .fh-service-plan-work .fh-service-plan-work-form > label:nth-of-type(6),
    .fh-service-plan-work .fh-service-plan-work-form > [data-submit] { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    body.fh-phone #historyPage:not(.history-is-empty) .history-summary-panel,
    body.fh-phone #historyPage:not(.history-is-empty) .history-routes-panel {
        display: flex !important; height: auto !important; max-height: none !important;
    }
    body.fh-phone #historyPage .history-status-bar { display: block !important; }
    body.fh-phone #historyPage .history-summary-panel .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body.fh-phone #historyPage .history-routes-body > .route-table-wrap { max-height: 420px !important; overflow: auto !important; }
}
