/* beta.7-mobile3 — operational phone workspaces. Presentation only; existing routes/data stay authoritative. */
.sf-mobile-sheet-toggle,.sf-mobile-vehicle-sections,.sf-mobile-driver-back,.sf-mobile-trip-back{display:none}
@media(max-width:720px){
  /* Live Fleet selected vehicle: compact action-first sheet with explicit expansion. */
  #liveView .sf-context-sheet{height:auto!important;max-height:220px!important;bottom:40px!important;transition:max-height .18s ease, height .18s ease}
  #liveView .sf-context-sheet .sf-context-body{display:none!important}
  #liveView .sf-context-sheet.sf-mobile-sheet-expanded{height:min(58dvh,430px)!important;max-height:min(58dvh,430px)!important}
  #liveView .sf-context-sheet.sf-mobile-sheet-expanded .sf-context-body{display:block!important;overflow:auto;min-height:0;flex:1}
  #liveView .sf-context-sheet .sf-mobile-sheet-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:6px 9px;margin-left:auto;font-size:10px;border:1px solid var(--pk-border,#dce8ea);background:#f7fbfb;color:#35616b}
  #liveView .sf-context-sheet .sf-context-heading>button[aria-label="Close vehicle card"]{margin-left:2px}
  #liveView .sf-context-sheet:not(.sf-mobile-sheet-expanded) .sf-context-location,#liveView .sf-context-sheet:not(.sf-mobile-sheet-expanded) .sf-context-grid,#liveView .sf-context-sheet:not(.sf-mobile-sheet-expanded) .sf-context-alert{display:none!important}
  #liveView .sf-context-sheet:not(.sf-mobile-sheet-expanded) .sf-context-actions>details{display:none}
  #liveView .sf-context-sheet .sf-context-actions{margin-top:5px;padding-top:6px}
  #liveView .sf-context-sheet .sf-context-actions>button{flex:1;min-width:0}

  /* Vehicle detail: compact identity/meta plus a sticky section strip for one-handed navigation. */
  #vehicleDetailView .sf-single-vehicle-sidebar{padding:10px 12px!important}
  #vehicleDetailView .sf-single-vehicle-sidebar .sf-vehicle-meta{display:flex!important;gap:7px!important;overflow-x:auto;scroll-snap-type:x proximity;padding:2px 0 6px;margin:8px 0 0!important;overscroll-behavior-inline:contain}
  #vehicleDetailView .sf-single-vehicle-sidebar .sf-vehicle-meta>*{min-width:128px;scroll-snap-align:start}
  #vehicleDetailView .sf-single-vehicle-toolbar{top:calc(68px + env(safe-area-inset-top,0px))!important;z-index:16!important}
  .sf-mobile-vehicle-sections{display:flex;position:sticky;top:calc(116px + env(safe-area-inset-top,0px));z-index:15;gap:5px;overflow-x:auto;padding:7px 10px;border-bottom:1px solid var(--pk-border,#dce8ea);background:rgba(248,251,252,.97);backdrop-filter:blur(12px);scrollbar-width:none}
  .sf-mobile-vehicle-sections::-webkit-scrollbar{display:none}.sf-mobile-vehicle-sections button{flex:0 0 auto;min-height:36px;padding:7px 11px;border:1px solid #dbe7e9;border-radius:999px;background:#fff;color:#536b74;font-size:10px;box-shadow:none;white-space:nowrap}.sf-mobile-vehicle-sections button.active{border-color:#9fd2d4;background:#e7f5f5;color:#176f73}
  #vehicleDetailView .sf-single-vehicle-main .sf-vehicle-map-focus{height:49dvh!important;min-height:330px!important}
  #vehicleDetailView .sf-single-vehicle-main .sf-history-map-focus{height:auto!important;min-height:0!important}
  #vehicleDetailView #historyMap{height:48dvh!important;min-height:330px!important}
  #vehicleDetailView .sf-history-map-focus .playback-controls{display:grid!important;grid-template-columns:auto minmax(0,1fr);gap:8px!important;align-items:center!important;padding:10px!important}
  #vehicleDetailView .sf-history-map-focus .playback-controls input[type=range]{grid-column:1/-1;min-width:0!important;width:100%}.sf-history-map-focus .playback-controls .playback-speed{min-width:0}.sf-history-map-focus .playback-controls>span{grid-column:1/-1}

  /* Trip Analytics: map-first playback with a compact HUD overlay and reachable controls. */
  #tripsView .trip-analytics-shell{margin-left:8px!important;margin-right:8px!important;padding:12px!important}
  #tripsView .trip-detail-head .row-actions{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}
  #tripsView .trip-detail-head .row-actions button{min-width:0;padding:8px;font-size:10px}.sf-mobile-trip-back{display:inline-flex!important;align-items:center;justify-content:center}
  #tripsView .trip-playback-grid{display:block!important;position:relative}.trip-map{height:52dvh!important;min-height:350px!important}
  #tripsView .trip-hud{position:absolute;left:9px;right:9px;bottom:9px;z-index:6;min-height:0!important;padding:9px 11px!important;border-radius:13px;background:rgba(13,42,52,.92);backdrop-filter:blur(10px);display:grid!important;grid-template-columns:auto minmax(0,1fr);gap:3px 12px;pointer-events:none}
  #tripsView .trip-hud>.eyebrow{display:none}#tripsView .trip-hud>div:nth-of-type(1){margin:0!important;align-items:baseline}#tripsView .trip-hud>div:nth-of-type(1) b{font-size:36px!important;letter-spacing:-1px}#tripsView .trip-hud>div:nth-of-type(1) span{font-size:10px!important;margin-bottom:0!important}#tripsView .trip-hud>p{margin:0!important;align-self:center;font-size:10px;color:#d2e4e7}#tripsView .trip-hud-meta{grid-column:1/-1;display:flex!important;gap:5px;overflow-x:auto}#tripsView .trip-hud-meta span{flex:1 0 92px;padding:6px!important}
  #tripsView .trip-playback-bar{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;padding:10px!important}#tripsView .trip-playback-bar label{min-width:0!important;margin:0!important}#tripsView .trip-playback-bar input[type=range],#tripsView .trip-playback-bar>span{grid-column:1/-1;width:100%!important}
  #tripsView .trip-event-row,#tripsView .trip-driver-row{align-items:flex-start;gap:7px}#tripsView .trip-event-row{display:grid;grid-template-columns:minmax(0,1fr) auto}#tripsView .trip-driver-row{display:grid;grid-template-columns:1fr}#tripsView .trip-driver-row small{white-space:normal}

  /* Alerts: compact horizontal health strip, phone-first filter stack and full-width actions. */
  #alertsView .sf-alert-hub{margin-left:8px!important;margin-right:8px!important;padding:12px!important;gap:12px}.sf-alert-summary{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(138px,43vw);grid-template-columns:none!important;overflow-x:auto;gap:8px!important;padding-bottom:4px;scroll-snap-type:x proximity}.sf-alert-summary article{scroll-snap-align:start;padding:12px!important}.sf-alert-activity-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;padding:10px!important}.sf-alert-category-segment{display:grid!important;grid-template-columns:repeat(3,1fr);width:100%;margin:0!important}.sf-alert-category-segment button{min-width:0}.sf-alert-more-grid{grid-template-columns:1fr!important}.sf-alert-card{padding:12px!important;gap:9px!important}.sf-alert-card-actions{grid-column:1/-1!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.sf-alert-card-actions button,.sf-alert-card-actions a{width:100%;text-align:center;justify-content:center}.sf-alert-flow{gap:9px!important}.sf-alert-step{padding:12px!important}.sf-alert-channels>label{display:flex!important;margin:7px 0!important;min-height:36px}.sf-alert-save-row{display:grid!important;grid-template-columns:1fr}.sf-alert-save-row button{width:100%}

  /* Drivers: list/profile becomes a true master-detail flow on phones. */
  #driversView .sf-driver-head,#driversView .sf-driver-list-panel,#driversView .sf-driver-profile-panel,#driversView .sf-driver-editor{margin-left:8px!important;margin-right:8px!important}
  #driversView .sf-driver-list-panel{max-height:none!important}.sf-mobile-driver-back{display:inline-flex;align-items:center;justify-content:flex-start;width:max-content;margin:0 0 10px;min-height:40px}
  #driversView:not(.sf-mobile-driver-open) .sf-driver-profile-panel{display:none!important}#driversView.sf-mobile-driver-open .sf-driver-list-panel{display:none!important}#driversView.sf-mobile-driver-open .sf-driver-profile-panel{display:block!important}
  #driversView .sf-driver-row{grid-template-columns:42px minmax(0,1fr);padding:11px 9px}#driversView .sf-driver-row-meta{grid-column:2;display:flex;justify-content:flex-start;justify-items:start;flex-wrap:wrap}.sf-driver-profile-actions{display:grid!important;grid-template-columns:1fr 1fr;width:100%}.sf-driver-profile-actions button{width:100%}.sf-driver-profile-grid>section{padding:12px!important}.sf-driver-upload,.sf-inline-form{gap:7px!important}
}
@media(max-width:420px){
  #tripsView .trip-hud-meta span{flex-basis:82px}.sf-alert-summary{grid-auto-columns:74vw}.sf-driver-profile-actions{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){#liveView .sf-context-sheet{transition:none!important}}
