/* Fundamentos responsivos comuns do navegador móvel e PWA instalado.
   Os estilos específicos de cada fluxo continuam em pwa-mobile.css. */
html.pwa-mobile-app {
  --pwa-viewport-height: 100vh;
  --pwa-safe-top: env(safe-area-inset-top, 0px);
  --pwa-safe-right: env(safe-area-inset-right, 0px);
  --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
  --pwa-safe-left: env(safe-area-inset-left, 0px);
  --pwa-navigation-clearance: calc(68px + var(--pwa-safe-bottom));
  --pwa-content-gutter: clamp(10px, 3vw, 16px);
  min-width: 0;
  min-height: 0;
  height: var(--pwa-viewport-height);
  overflow: hidden;
  scroll-padding-block: 12px;
}

@supports (height: 100dvh) {
  html.pwa-mobile-app {
    --pwa-viewport-height: 100dvh;
  }
}

html.pwa-mobile-app *,
html.pwa-mobile-app *::before,
html.pwa-mobile-app *::after {
  box-sizing: border-box;
}

html.pwa-mobile-app body {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: var(--pwa-viewport-height);
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior: none;
}

html.pwa-mobile-app #workspace {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: var(--pwa-viewport-height);
  max-height: var(--pwa-viewport-height);
  overflow: hidden;
}

html.pwa-mobile-app #workspace > .app-main {
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
}

html.pwa-mobile-app #workspace > .app-main > :is(
  #map-view,
  #mobile-vehicles-view,
  #history-view,
  #report-panel,
  #module-view
) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

html.pwa-mobile-app :is(
  #module-view:not([hidden]),
  #history-view:not([hidden]),
  #report-panel:not([hidden]),
  #mobile-vehicles-view:not([hidden])
) {
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-block: 12px var(--pwa-navigation-clearance);
}

html.pwa-mobile-app :is(
  #module-view,
  #module-content,
  #history-view,
  #history-result,
  #report-panel,
  #report-result,
  #mobile-vehicles-view,
  .panel,
  .module-header,
  .report-section,
  .report-content,
  form,
  fieldset,
  label
) {
  min-width: 0;
  max-width: 100%;
}

html.pwa-mobile-app :is(input, select, textarea) {
  max-width: 100%;
  scroll-margin-block: 12px var(--pwa-navigation-clearance);
}

html.pwa-mobile-app :is(button, [role="button"], summary) {
  max-width: 100%;
  touch-action: manipulation;
}

html.pwa-mobile-app :is(.data-table-wrap, .history-structured-table-wrap, .report-table-wrap) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

html.pwa-mobile-app dialog[open]:not(.map-vehicle-dialog) {
  box-sizing: border-box;
  max-width: calc(100vw - 2 * var(--pwa-content-gutter));
  max-height: calc(var(--pwa-viewport-height) - var(--pwa-safe-top) - var(--pwa-safe-bottom) - 16px);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 12px;
}

html.pwa-mobile-app .pwa-mobile-nav {
  padding-right: max(7px, var(--pwa-safe-right));
  padding-left: max(7px, var(--pwa-safe-left));
}

@media (max-height: 640px) {
  html.pwa-mobile-app {
    --pwa-navigation-clearance: calc(60px + var(--pwa-safe-bottom));
  }

  html.pwa-mobile-app .pwa-mobile-nav {
    min-height: calc(52px + var(--pwa-safe-bottom));
    padding-top: 3px;
    padding-bottom: max(3px, var(--pwa-safe-bottom));
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  html.pwa-mobile-app :is(
    #module-view:not([hidden]),
    #history-view:not([hidden]),
    #report-panel:not([hidden]),
    #mobile-vehicles-view:not([hidden])
  ) {
    scroll-padding-block: 8px var(--pwa-navigation-clearance);
  }
}
/* LAB: make the approved status colors reach each existing SVG contour. */
@media (max-width: 768px) {
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].success > span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="success"] > span { color: #197a31 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].danger > span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="danger"] > span { color: #a51823 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger > span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger > span svg { color: #a51823 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOn"].success > span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOn"].success > span svg { color: #197a31 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="anchor"].success > span { color: #197a31 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="anchor"].danger > span { color: #a51823 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="satellite"]:not(.unknown) > span { color: #8b1739 !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-communication svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-location-main h3 svg { color: #8b1739 !important; }

  /* In these data-driven indicator SVGs, inherit semantic color for visible
     contours and filled details while retaining every explicit transparent fill. */
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].success > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].danger > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="success"] > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="danger"] > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="satellite"]:not(.unknown) > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="anchor"]:not(.unknown) > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOn"].success > span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].success > span svg :not([stroke="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].danger > span svg :not([stroke="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="success"] > span svg :not([stroke="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="danger"] > span svg :not([stroke="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="satellite"]:not(.unknown) > span svg :not([stroke="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="anchor"]:not(.unknown) > span svg :not([stroke="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger > span svg :not([stroke="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOn"].success > span svg :not([stroke="none"]),
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-communication svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-location-main h3 svg * {
    stroke: currentColor !important;
  }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].success > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].danger > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="success"] > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="danger"] > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="satellite"]:not(.unknown) > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="anchor"]:not(.unknown) > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOn"].success > span svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-communication svg [fill]:not([fill="none"]),
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-location-main h3 svg [fill]:not([fill="none"]) { fill: currentColor !important; }

  /* Preserve existing drawings and stroke widths; recolor only the contours. */
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="route"],
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="share"],
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="edit"] { color: #8b1739 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="route"] .vehicle-detail-action-icon svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="share"] .vehicle-detail-action-icon svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="edit"] .vehicle-detail-action-icon svg { filter: none !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="route"] .vehicle-detail-action-icon svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="share"] .vehicle-detail-action-icon svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="edit"] .vehicle-detail-action-icon svg * { stroke: #8b1739 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="anchor"] .vehicle-detail-action-icon svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="lock"] .vehicle-detail-action-icon svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="unlock"] .vehicle-detail-action-icon svg { filter: none !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="anchor"].danger .vehicle-detail-action-icon svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="lock"] .vehicle-detail-action-icon svg * { stroke: #a51823 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="anchor"].success .vehicle-detail-action-icon svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="unlock"] .vehicle-detail-action-icon svg * { stroke: #197a31 !important; }
}

/* Fix only the vehicle PWA state labels and outline action icons. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition {
    width: max-content !important;
    max-width: 100% !important;
    justify-self: start !important;
  }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition > span {
    display: inline-flex !important;
    flex: 0 1 auto !important;
    width: max-content !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Keep Share/Edit as unfilled contour drawings; keep the shared burgundy stroke. */
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="share"] .vehicle-detail-action-icon svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar > button:not(:disabled)[data-vehicle-action="edit"] .vehicle-detail-action-icon svg * {
    fill: none !important;
    stroke: #8b1739 !important;
  }
}


/* LAB mobile/PWA: show known last motion/ignition with status color while retaining explicit stale wording for assistive technology. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-success,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.motion.stale-success,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.ignition.stale-success { background:#e1f5e5!important;border-color:#ccebd4!important;color:#197a31!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-danger,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.motion.stale-danger,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.ignition.stale-danger { background:#fde5e6!important;border-color:#f3d2d5!important;color:#a51823!important; }
  /* State badges in the list size to content. Ignition text has no stretched gray fill. */
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition { width:max-content!important;max-width:100%!important;justify-self:start!important;box-sizing:border-box!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition { padding:0!important;border:0!important;border-radius:0!important;background:transparent!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.unknown,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger { background:transparent!important;border-color:transparent!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-success,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-danger,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.success,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.danger { min-height:22px!important;padding:2px 8px!important;border-radius:999px!important;font-size:11px!important;white-space:nowrap!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-success>span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success>span { color:#197a31!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-danger>span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger>span { color:#a51823!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-success svg,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success svg { color:#197a31!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-danger svg,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger svg { color:#a51823!important; }
  /* Reach actual SVG elements that have their own color from the older mobile sheet. */
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].success>span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].success>span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="success"]>span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="success"]>span svg { color:#197a31!important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].danger>span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].danger>span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="danger"]>span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="danger"]>span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger>span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger>span svg { color:#a51823!important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="satellite"]:not(.unknown)>span,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="satellite"]:not(.unknown)>span svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-times p svg { color:#8b1739!important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-times p svg * { stroke:#8b1739!important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].success>span svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="battery"].danger>span svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="success"]>span svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="trackerBattery"][data-display-state="danger"]>span svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="satellite"]:not(.unknown)>span svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicator[data-kind="ignitionOff"].danger>span svg * { stroke:currentColor!important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar>button:not(:disabled)[data-vehicle-action="share"] .vehicle-detail-action-icon svg,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar>button:not(:disabled)[data-vehicle-action="edit"] .vehicle-detail-action-icon svg { color:#8b1739!important;fill:none!important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar>button:not(:disabled)[data-vehicle-action="share"] .vehicle-detail-action-icon svg *,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-iconbar>button:not(:disabled)[data-vehicle-action="edit"] .vehicle-detail-action-icon svg * { fill:none!important;stroke:#8b1739!important; }
}


/* States from an older known reading retain semantic colors while remaining explicitly unconfirmed. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-success,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.motion.stale-success,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.ignition.stale-success { background:#e1f5e5!important; border-color:#ccebd4!important; color:#197a31!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-danger,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.motion.stale-danger,
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-mobile-badge.ignition.stale-danger { background:#fde5e6!important; border-color:#f3d2d5!important; color:#a51823!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition > span { background:transparent!important; border:0!important; border-radius:0!important; padding:0!important; color:inherit!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success > svg { color:#197a31!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger > svg { color:#a51823!important; }
}


/* Match the approved vehicle list: ignition is plain text; movement stays on one line. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition { background:transparent!important; border:0!important; border-radius:0!important; box-shadow:none!important; padding:0!important; width:max-content!important; min-height:0!important; justify-self:start!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition > span { display:inline!important; background:transparent!important; border:0!important; border-radius:0!important; box-shadow:none!important; padding:0!important; white-space:nowrap!important; overflow-wrap:normal!important; word-break:normal!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion { width:max-content!important; max-width:100%!important; white-space:nowrap!important; overflow-wrap:normal!important; word-break:normal!important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion > span { width:max-content!important; max-width:none!important; white-space:nowrap!important; overflow-wrap:normal!important; word-break:normal!important; }
}


/* LAB mobile/PWA: composição única dos indicadores para todas as larguras móveis. */
@media (max-width: 900px), (pointer: coarse) and (max-width: 1366px) {
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, 50px) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: 50px !important;
    align-items: stretch !important;
    gap: 4px !important;
    min-height: 104px !important;
    height: auto !important;
    margin: 0 0 5px !important;
  }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 13px minmax(0, 1fr) !important;
    grid-template-rows: 1fr 1fr !important;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    margin: 0 !important;
    padding: 3px 4px !important;
    gap: 0 3px !important;
    overflow: hidden !important;
  }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator > span {
    grid-column: 1 !important; grid-row: 1 !important; display: flex !important;
    align-items: center !important; justify-content: center !important;
    width: 13px !important; height: 13px !important; min-width: 13px !important; margin: 0 !important;
  }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator > span svg {
    display: block !important; width: 13px !important; height: 13px !important;
    max-width: 13px !important; max-height: 13px !important;
  }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator > small {
    grid-column: 2 !important; grid-row: 1 !important; align-self: center !important;
    width: 100% !important; min-width: 0 !important; margin: 0 !important;
    font-size: 9px !important; line-height: 1 !important; white-space: nowrap !important;
  }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator > strong {
    grid-column: 1 / -1 !important; grid-row: 2 !important; align-self: center !important;
    justify-self: center !important; width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; margin: 0 !important; font-size: 10.5px !important;
    line-height: 1.05 !important; font-weight: 750 !important; text-align: center !important;
    white-space: normal !important; overflow-wrap: normal !important; word-break: normal !important;
  }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="battery"] { order: 1 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="trackerBattery"] { order: 2 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="satellite"] { order: 3 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="signal"] { order: 4 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="anchor"] { order: 5 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="lock"] { order: 6 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="ignitionOn"],
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="ignitionOff"] { order: 7 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="speed"] { order: 8 !important; }
  html.pwa-mobile-app #vehicle-panel.vehicle-details-active #vehicle-drawer .vehicle-detail-indicators > .vehicle-detail-indicator[data-kind="lock"] > strong {
    font-size: 9px !important; white-space: nowrap !important;
  }
}

/* O marcador de veículo mantém o mesmo tamanho visual no navegador móvel e no PWA instalado. */
@media (max-width: 900px), (pointer: coarse) and (max-width: 1366px) {
  html.pwa-mobile-app body:has(#map-view:not([hidden])) #map .vehicle-map-marker > .vehicle-directional-icon {
    width: 52px !important; height: 52px !important;
  }
}

/* Final cascade guard: no ignition-state badge background in the vehicle list. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.success,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.danger,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.unknown,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition:not(.success):not(.danger):not(.unknown):not(.stale-success):not(.stale-danger) {
    background: transparent !important;
    box-shadow: none !important;
  }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.success > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.danger > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.unknown > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition:not(.success):not(.danger):not(.unknown):not(.stale-success):not(.stale-danger) > span {
    background: transparent !important;
    box-shadow: none !important;
  }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.danger > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-danger > span {
    font-weight: 700 !important;
  }
}

/* LAB mobile/PWA: emphasize the green ignition-on label in vehicle-list cards. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.success > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.stale-success > span {
    color: #197a31 !important;
    font-weight: 700 !important;
  }
}


/* LAB mobile/PWA: emphasize only the never-communicated vehicle-list message. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-communication.never-communicated > span {
    font-weight: 700 !important;
  }
}


/* LAB mobile/PWA: unknown ignition/motion keep their slots and icons without an unknown-value label. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.unknown > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.unknown > span { display: none !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.unknown > svg { color: #52575e !important; stroke: currentColor !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.unknown > svg * { stroke: currentColor !important; }
}


/* LAB mobile/PWA: known movement states match the bold weight of Online/Offline. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.success > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.danger > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-success > span,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.stale-danger > span { font-weight: 700 !important; }
}


/* LAB mobile/PWA: hide unavailable movement and ignition indicators without leaving grid slots. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-motion.unknown-value-hidden,
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .mobile-map-vehicle-ignition.unknown-value-hidden { display: none !important; }
}


/* LAB mobile/PWA: compact vehicle filters and keep every option label on one line. */
@media (max-width: 768px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel #filter-options:not([hidden]) { gap: 7px !important; max-height: min(46vh, 360px) !important; padding: 7px !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel #filter-options > .vehicle-group-filter { grid-template-columns: 42px minmax(0, 1fr) !important; gap: 6px !important; font-size: 11px !important; line-height: 1.1 !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel #filter-options > .vehicle-group-filter select { height: 34px !important; min-height: 34px !important; padding: 0 7px !important; font-size: 11px !important; white-space: nowrap !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-groups { gap: 7px 8px !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group:nth-child(1),
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group:nth-child(4) { padding-bottom: 6px !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group { gap: 4px !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group > strong { font-size: 11px !important; line-height: 1.1 !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group-options { gap: 5px !important; }
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group-options button { min-height: 34px !important; height: 34px !important; padding: 4px 3px !important; font-size: 10.5px !important; line-height: 1 !important; white-space: nowrap !important; overflow: visible !important; text-overflow: clip !important; }
}
@media (max-width: 440px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group:nth-child(1) .vehicle-filter-group-options { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 440px) {
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group:nth-child(2),
  html.pwa-mobile-app #fleet-layout.vehicles-sheet-expanded:not(.has-selection) #vehicle-panel .vehicle-filter-group:nth-child(3) { grid-column: 1 / -1 !important; }
}

/* Desktop-only last-layer overrides for the Map panels. Mobile rules remain unchanged. */
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicators .vehicle-detail-indicator:not([data-kind="speed"]) small {
    display: block !important; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicators .vehicle-detail-indicator strong { display: block !important; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-action-label,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-disclosure .vehicle-detail-action-label { display: block !important; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions { width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions .vehicle-detail-icon { width: 100%; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions [data-location-action="google"]::after { content: "Google Maps"; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions [data-location-action="street"]::after { content: "Street View"; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions [data-location-action="focus"]::after { content: "Focar"; }
}

/* Final desktop Map composition refinements; intentionally isolated from PWA/mobile. */
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-name strong {
    display: -webkit-box; overflow: hidden; white-space: normal; line-height: 1.15;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-driver-fact { order: 4; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-supplementary { order: 5; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row { order: 6; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions { order: 7; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-action-label { font-size: 9px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions [data-location-action="google"]::after { content: "Google Maps" !important; font-size: 9px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions [data-location-action="street"]::after { content: "Street View" !important; font-size: 9px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions [data-location-action="focus"]::after { content: "Focar" !important; font-size: 9px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator small { font-size: 9px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator strong { font-size: 10px; }
}
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-identification { order: 0; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-status { order: 1; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicators { order: 3; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-driver-fact { order: 4; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-supplementary { order: 5; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row { order: 6; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions { order: 7; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-disclosure { order: 8; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator strong { white-space: normal; }
}

/* Desktop Map final readability and hit-target corrections. The selectors require
   the desktop map layout and never match mobile/PWA pages. */
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #fleet-layout.desktop-map-list-open {
    grid-template-columns: minmax(330px, 26%) minmax(0, 1fr);
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #fleet-layout.has-selection {
    grid-template-columns: minmax(0, 1fr) minmax(370px, 29%);
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-panel {
    border: 1px solid #dfe4ea;
    border-radius: 12px;
    box-shadow: 0 5px 18px #17263a20;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 70px;
    gap: 4px 8px;
    padding: 8px 9px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-name {
    grid-column: 1;
    grid-row: 1;
    gap: 8px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-vehicle-icon {
    width: 46px;
    height: 36px;
    flex-basis: 46px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-vehicle-icon svg {
    width: 44px;
    height: 34px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-vehicle-copy strong {
    display: block;
    overflow: hidden;
    color: #1d2938;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-vehicle-copy small {
    display: block;
    margin-top: 3px;
    overflow: visible;
    color: #536174;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: clip;
    white-space: nowrap;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-vehicle-copy small strong {
    display: inline;
    color: #26364a;
    font-size: 11px;
    font-weight: 700;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row > td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-status-dot {
    padding: 4px 7px;
    font-size: 10px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-updated {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-left: 54px;
    color: #465568;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-functions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
    padding-left: 54px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-functions > .vehicle-function {
    display: none;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-list-state-labels {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    white-space: normal;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-list-state {
    display: inline-flex;
    min-height: 20px;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    background: #f5f7f9;
    color: #36465a;
    font-size: 10px;
    line-height: 1.1;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-list-state svg {
    width: 13px;
    height: 13px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-list-state.unknown { color: #697587; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer {
    position: absolute;
    z-index: 625;
    top: 12px;
    right: 14px;
    bottom: 12px;
    width: min(400px, calc(100% - 28px));
    max-height: none;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #dce2e8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 22px #17263a24;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-scroll.desktop-map-detail-layout {
    display: flex;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px;
    overflow: auto !important;
    padding: 9px 10px 14px !important;
    scroll-padding-block: 10px 14px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-identification {
    gap: 9px;
    padding: 2px 2px 4px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-photo {
    display: grid;
    width: 48px;
    height: 40px;
    flex: 0 0 48px;
    place-items: center;
    overflow: hidden;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-photo img,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-photo svg {
    display: block;
    width: 46px;
    height: 38px;
    object-fit: contain;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-identification .vehicle-detail-name {
    font-size: 16px;
    line-height: 1.2;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-identification-copy > p {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin: 2px 0 0;
    color: #465568;
    font-size: 12px;
    line-height: 1.25;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-identification-copy > p strong {
    color: #202d3d;
    font-weight: 700;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-state {
    min-height: 22px;
    padding: 3px 8px;
    font-size: 10px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-times p {
    grid-template-columns: 15px minmax(0, 1fr);
    font-size: 11px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-times small { font-size: 10px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-times strong { font-size: 11px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicators {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator {
    min-height: 43px;
    grid-template-columns: 16px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    align-items: center;
    gap: 2px 5px;
    padding: 5px 6px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator > span,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator > span svg {
    width: 15px;
    height: 15px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator small {
    overflow: visible;
    color: #5b6675;
    font-size: 10px;
    line-height: 1.15;
    text-overflow: clip;
    white-space: normal;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator strong {
    overflow: visible;
    color: #202d3d;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-driver-fact,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-driver-fact strong { font-size: 11px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-supplementary { gap: 5px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-stat { min-height: 38px; padding: 5px 6px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-stat small { font-size: 9px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-stat strong { font-size: 10px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-icon {
    color: #a31943;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-icon svg {
    color: #a31943;
    stroke: #a31943;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-action-label {
    color: #27374a;
    font-size: 10px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-quick-actions .vehicle-detail-icon::after { font-size: 10px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-disclosure > summary {
    min-height: 31px;
    font-size: 11px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-disclosure .vehicle-detail-action-label { font-size: 9px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #map-panel .map-toolbar {
    z-index: 640;
    right: min(420px, calc(100% - 62px));
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #fleet-layout.has-selection #map-panel .map-layer-options {
    right: auto;
    left: 42px;
    z-index: 645;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #mobile-vehicles-sheet {
    right: 14px;
    bottom: 59px;
    left: 14px;
    width: auto;
    min-height: 38px;
    justify-content: space-between;
    font-size: 13px;
  }
}
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-name .desktop-map-vehicle-copy small,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-name .desktop-map-vehicle-copy small strong {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-name .desktop-map-vehicle-copy small strong {
    display: inline !important;
    -webkit-line-clamp: unset !important;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-updated::before { content: none; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-icon,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-icon svg,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-shortcut-row .vehicle-detail-icon svg * {
    color: #a31943 !important;
    stroke: #a31943 !important;
  }
}
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-identification-copy > p {
    font-size: 11px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-detail-identification-copy > p > span {
    white-space: nowrap;
  }
}
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer { bottom: 62px; }
}

@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] > span {
    position: absolute;
    top: 5px;
    left: 5px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] small,
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] strong {
    grid-column: 1;
    justify-self: center;
    max-width: 100%;
    text-align: center;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] strong {
    font-size: 10px;
    white-space: nowrap;
  }
}
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer {
    bottom: auto;
    height: auto;
    max-height: calc(100% - 74px);
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] {
    grid-template-rows: minmax(12px, auto) minmax(13px, auto);
    align-content: center;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] small {
    display: block;
    grid-row: 1;
    align-self: end;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .vehicle-detail-indicator[data-kind="lock"] strong {
    display: block;
    grid-row: 2;
    align-self: start;
  }
}

/* Desktop Map: prevent detail accordions from shrinking into clipped strips. */
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-layout > .desktop-map-detail-disclosure {
    display: block;
    flex: 0 0 auto;
    align-self: stretch;
    min-width: 0;
    min-height: 31px;
    overflow: hidden;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-layout > .desktop-map-detail-disclosure > summary {
    display: flex;
    min-height: 31px;
    flex: 0 0 auto;
    align-items: center;
    box-sizing: border-box;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #vehicle-drawer .desktop-map-detail-layout > .desktop-map-detail-disclosure[open] > summary {
    min-height: 31px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active #fleet-layout:not(.has-selection) #map-panel .map-toolbar {
    right: 12px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row {
    min-height: 64px;
    gap: 3px 7px;
    padding: 6px 8px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row .vehicle-updated {
    font-size: 10.5px;
    line-height: 1.1;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-list-state-labels {
    gap: 4px;
  }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .desktop-map-list-state {
    min-height: 18px;
    gap: 3px;
    padding: 2px 6px;
    font-size: 9.5px;
  }
}
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row { padding-block: 5px; }
}
@media screen and (min-width: 1201px) and (hover: hover) and (pointer: fine) {
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table tbody { gap: 3px; }
  html:not(.pwa-mobile-app) #workspace.desktop-map-layout-active .vehicle-table-row { padding-block: 3px; }
}
