/* beta.7-polish4-mobile1-fix4 — PHONE ONLY. Tablet and desktop retain the verified baseline except shared Alerts density. */
@media(max-width:560px){
  body.sf-phone-companion{--sf-mobile-nav-h:72px}
  body.sf-phone-companion .sidebar,
  body.sf-phone-companion.mobile-menu-open .sidebar{display:none!important}
  body.sf-phone-companion #menuToggle{display:none!important}
  body.sf-phone-companion #logoutBtn,
  body.sf-phone-companion main>header .customer-chip{display:none!important}
  body.sf-phone-companion .app:not(.hidden){padding-bottom:calc(82px + env(safe-area-inset-bottom,0px))!important}
  body.sf-phone-companion main>header{padding-left:14px!important;padding-right:12px!important;gap:8px!important}
  body.sf-phone-companion main>header>div:first-of-type{min-width:0;flex:1}
  body.sf-phone-companion main>header h2{font-size:19px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.sf-phone-companion main>header p{max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.sf-phone-companion main>header .header-actions{width:auto!important;margin-left:auto!important}

  /* Dedicated four-item phone navigation. Overrides the inherited hamburger-only polish layer. */
  body.sf-phone-companion .sf-phone-companion-nav{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;left:8px!important;right:8px!important;bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;min-height:62px;padding:5px!important;border-radius:18px!important;z-index:1400!important}
  body.sf-phone-companion .sf-phone-companion-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:52px!important;font-size:10px!important;color:#647982!important;border-radius:13px!important}
  body.sf-phone-companion .sf-phone-companion-nav button.active{background:#e7f4f4!important;color:#126b70!important}
  body.sf-phone-companion .sf-phone-nav-icon{display:block;min-height:17px;font-size:18px;line-height:17px;font-weight:850;letter-spacing:-1px}

  /* More is intentionally not a gateway to desktop fleet administration. */
  body.sf-phone-companion .sf-phone-more{width:calc(100vw - 24px)!important;max-width:480px!important;margin:auto 12px calc(78px + env(safe-area-inset-bottom,0px))!important;padding:14px!important;border:1px solid #dbe7e9!important;border-radius:18px!important;background:#fff!important;color:#17343d;box-shadow:0 18px 54px rgba(20,48,58,.24)}
  body.sf-phone-companion .sf-phone-more::backdrop{background:rgba(13,34,42,.34);backdrop-filter:blur(2px)}
  body.sf-phone-companion .sf-phone-more-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
  body.sf-phone-companion .sf-phone-more-head span{display:block;color:#778c94;font-size:9px;font-weight:850;letter-spacing:.12em}
  body.sf-phone-companion .sf-phone-more-head h3{margin:2px 0 0;font-size:20px}
  body.sf-phone-companion .sf-phone-more-head button{min-width:36px;min-height:36px;padding:5px 8px;font-size:20px;line-height:1}
  body.sf-phone-companion .sf-phone-account{display:grid;gap:2px;margin:12px 0 8px;padding:11px 12px;border-radius:12px;background:#f2f7f8}
  body.sf-phone-companion .sf-phone-account strong{font-size:15px}body.sf-phone-companion .sf-phone-account span{color:#6e828a;font-size:11px}
  body.sf-phone-companion .sf-phone-desktop-note{margin:8px 0 12px;color:#5d737c;font-size:11px;line-height:1.4}
  body.sf-phone-companion .sf-phone-more-actions{display:grid;gap:8px}
  body.sf-phone-companion .sf-phone-more-actions button{width:100%;min-height:40px;padding:8px 12px;font-size:11px}
  body.sf-phone-companion .sf-phone-signout{background:#fff7f7!important;color:#8d3f46!important;border:1px solid #eed6d8!important}
  body.sf-phone-companion .sf-phone-more>small{display:block;margin-top:14px;color:#91a0a6;text-align:center;font-size:9px}

  /* Live = quick check. Map and vehicle directory are the only modes exposed. */
  body.sf-phone-companion #liveView .map-toolbar{display:flex!important;align-items:center!important;justify-content:space-between!important;padding:0 8px!important;margin:0 0 8px!important;gap:8px!important}
  body.sf-phone-companion #liveView .map-toolbar>div:first-child{min-width:0}
  body.sf-phone-companion #liveView .map-toolbar h3{font-size:15px!important;margin:0!important}
  body.sf-phone-companion #liveView .map-toolbar .map-tools{display:flex!important;width:auto!important;margin-left:auto!important;gap:6px!important}
  body.sf-phone-companion #liveView #mobileMapToggle,
  body.sf-phone-companion #liveView #mapFit,
  body.sf-phone-companion #liveView #sfMapOptions,
  body.sf-phone-companion #liveView .sf-toolbar>.sf-chip{display:none!important}
  body.sf-phone-companion #liveView #refreshLiveBtn{min-height:38px!important;padding:7px 10px!important;font-size:10px!important}
  body.sf-phone-companion #liveView .fleet-workspace{margin:0 8px!important;height:calc(100dvh - 205px)!important;min-height:440px!important;border-radius:16px!important}
  body.sf-phone-companion #liveView .sf-fleet-table{margin:0 8px 10px!important;padding:9px!important;border-radius:15px!important}
  body.sf-phone-companion #liveView .sf-list-header{display:grid!important;grid-template-columns:1fr!important;gap:4px!important;margin-bottom:7px!important}
  body.sf-phone-companion #liveView .sf-list-heading p{display:none!important}
  body.sf-phone-companion #liveView .sf-list-heading span{font-size:8px!important;letter-spacing:.12em!important}
  body.sf-phone-companion #liveView .sf-list-heading h3{font-size:16px!important;margin:2px 0 0!important}
  body.sf-phone-companion #liveView .sf-list-filter-host .map-filters{grid-template-columns:1fr!important;gap:6px!important;padding:8px!important;margin:0 0 8px!important;border-radius:11px!important}
  body.sf-phone-companion #liveView .sf-list-filter-host .sf-search{min-height:40px!important}
  body.sf-phone-companion #liveView .sf-list-filter-host .map-filter-row{grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important}
  body.sf-phone-companion #liveView .sf-list-filter-host .map-filter-row select,body.sf-phone-companion #liveView .sf-list-filter-host .map-filter-row button{min-height:38px!important;padding-top:7px!important;padding-bottom:7px!important}
  body.sf-phone-companion #liveView .sf-list-filter-host #mapCount{font-size:9px!important;margin:0!important}
  body.sf-phone-companion #liveView .sf-list-header>label{display:none!important}
  body.sf-phone-companion #liveView .sf-live-directory-table thead{display:none!important}
  body.sf-phone-companion #liveView .sf-live-directory-table tbody{display:grid!important;gap:8px!important}
  body.sf-phone-companion #liveView .sf-live-directory-table tbody tr{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:5px 8px!important;padding:10px!important;border:1px solid #e2ebed!important;border-radius:12px!important;background:#fff!important}
  body.sf-phone-companion #liveView .sf-live-directory-table td{display:block!important;padding:0!important;border:0!important;font-size:10px!important;min-width:0!important}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(1){grid-column:1;grid-row:1}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(2){grid-column:2;grid-row:1;text-align:right}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(3){display:none!important}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(4){grid-column:1;grid-row:2}
  body.sf-phone-companion #liveView .sf-live-directory-table .sf-list-vehicle-inner{gap:7px!important}
  body.sf-phone-companion #liveView .sf-live-directory-table .sf-vehicle-symbol{width:30px!important;height:30px!important;margin-right:5px!important}
  body.sf-phone-companion #liveView .sf-live-directory-table .sf-list-identity strong{font-size:13px!important}
  body.sf-phone-companion #liveView .sf-live-directory-table .sf-list-identity small{font-size:9px!important}
  body.sf-phone-companion #liveView .sf-live-directory-table .sf-list-status small{font-size:8px!important}
  body.sf-phone-companion #liveView .sf-live-directory-table .sf-list-location .sf-table-link{min-height:28px!important;padding:3px 0!important;background:transparent!important;border:0!important;text-align:left!important}
  body.sf-phone-companion #liveView .sf-live-directory-table .sf-list-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;width:100%!important;align-items:stretch!important}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(5){grid-column:1/-1;grid-row:3;color:#5d737c}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(6){grid-column:1;grid-row:4;color:#7b8c93}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(7){grid-column:1/-1;grid-row:5;align-self:center;margin-top:3px}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(7)::before{content:none!important;display:none!important}
  body.sf-phone-companion #liveView .sf-live-directory-table td:nth-child(7) button{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;min-height:38px!important;padding:7px 8px!important;font-size:10px!important;margin:0!important;white-space:nowrap!important}
  body.sf-phone-companion #liveView .sf-context-sheet{left:8px!important;right:8px!important;bottom:8px!important;max-height:45%!important}
  body.sf-phone-companion #liveView .sf-context-more{display:none!important}

  /* Single vehicle remains monitoring-only: map, live essentials and history. */
  body.sf-phone-companion #vehicleDetailView>.sf-vehicle-detail-shell{margin:0 8px!important;padding:10px!important}
  body.sf-phone-companion #vehicleDetailView .sf-mobile-vehicle-sections,
  body.sf-phone-companion #vehicleDetailView #detailFuelLink,
  body.sf-phone-companion #vehicleDetailView #detailFuelSummary,
  body.sf-phone-companion #vehicleDetailView .document-panel,
  body.sf-phone-companion #vehicleDetailView #vehicleInstallationPanel,
  body.sf-phone-companion #vehicleDetailView #vehicleDocumentTab,
  body.sf-phone-companion #vehicleDetailView #vehicleInstallationTab{display:none!important}
  body.sf-phone-companion #vehicleDetailView .vehicle-tabs{display:none!important}
  body.sf-phone-companion #vehicleDetailView .vehicle-tab{width:100%!important;min-width:0!important}
  body.sf-phone-companion #vehicleDetailView .sf-vehicle-map-focus{height:45dvh!important;min-height:300px!important;margin:8px 0!important}
  body.sf-phone-companion #vehicleDetailView .sf-history-map-focus{height:auto!important;min-height:0!important;margin:8px 0!important}
  body.sf-phone-companion #vehicleDetailView #historyMap{height:42dvh!important;min-height:290px!important}
  body.sf-phone-companion #vehicleDetailView #vehicleMeta{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body.sf-phone-companion #vehicleDetailView #vehicleTelemetry{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}

  /* History = vehicle + date + trips/stops + route. Reporting and deep analytics stay on desktop/tablet. */
  body.sf-phone-companion #tripsView .trip-analytics-shell{margin:0 8px!important;padding:10px!important}
  body.sf-phone-companion #tripsView .panel-head .eyebrow,
  body.sf-phone-companion #tripsView .panel-head .customer-chip{display:none!important}
  body.sf-phone-companion #tripsView .panel-head h3{font-size:18px!important}
  body.sf-phone-companion #tripsView .panel-head p{font-size:11px!important;margin-top:3px!important}
  body.sf-phone-companion #tripsView .trip-selector{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;margin-bottom:8px!important}
  body.sf-phone-companion #tripsView .trip-selector #tripVehicleSelect{grid-column:1/-1}
  body.sf-phone-companion #tripsView .trip-selector input,body.sf-phone-companion #tripsView .trip-selector select,body.sf-phone-companion #tripsView .trip-selector button{min-height:40px!important;padding-top:7px!important;padding-bottom:7px!important}
  body.sf-phone-companion #tripsView .trip-selector>*{width:100%!important;min-width:0!important}
  body.sf-phone-companion #tripsView .trip-period-report,
  body.sf-phone-companion #tripsView .trip-detail-head .row-actions,
  body.sf-phone-companion #tripsView .trip-speed-panel,
  body.sf-phone-companion #tripsView .trip-evidence-grid,
  body.sf-phone-companion #tripsView #tripDriverContext{display:none!important}
  body.sf-phone-companion #tripsView #tripSummary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body.sf-phone-companion #tripsView .trip-list-block .table-wrap{overflow:visible!important}
  body.sf-phone-companion #tripsView table thead{display:none!important}
  body.sf-phone-companion #tripsView #tripsTable{display:grid!important;gap:8px!important}
  body.sf-phone-companion #tripsView #tripsTable tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px 10px!important;padding:10px!important;border:1px solid #e1eaed!important;border-radius:12px!important;background:#fff!important}
  body.sf-phone-companion #tripsView #tripsTable td{display:block!important;padding:0!important;border:0!important;font-size:11px!important;min-width:0!important}
  body.sf-phone-companion #tripsView #tripsTable td::before{display:block;color:#78909a;font-size:8px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;margin-bottom:1px}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(1){grid-column:1/-1;font-weight:800;color:#126b70}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(1)::before{content:"Trip"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(2)::before{content:"Start"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(3)::before{content:"End"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(4)::before{content:"Duration"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(5)::before{content:"Distance"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(6)::before{content:"Max speed"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(8)::before{content:"Stopped"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(9)::before{content:"Stop location"}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(7){grid-column:1/-1;grid-row:auto}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(9){grid-column:1/-1;color:#607780;font-size:9px!important}
  body.sf-phone-companion #tripsView #tripsTable td:nth-child(7) button{width:100%!important;min-height:36px!important;padding:7px 10px!important;font-size:10px!important}
  body.sf-phone-companion #tripsView .sf-phone-history-overview{margin:8px 0 12px;padding:9px;border:1px solid #dfe9eb;border-radius:13px;background:#fbfdfd}
  body.sf-phone-companion #tripsView .sf-phone-history-head{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;margin-bottom:7px}
  body.sf-phone-companion #tripsView .sf-phone-history-head>div>span{display:block;color:#168187;font-size:8px;font-weight:850;letter-spacing:.12em}
  body.sf-phone-companion #tripsView .sf-phone-history-head h4{margin:2px 0 1px;font-size:14px}
  body.sf-phone-companion #tripsView .sf-phone-history-head p{margin:0;color:#6a7d85;font-size:9px;line-height:1.35}
  body.sf-phone-companion #tripsView #sfPhoneHistoryOverviewStatus{color:#71858d;font-size:8px;white-space:nowrap;margin-top:3px}
  body.sf-phone-companion #tripsView #sfPhoneHistoryMap{height:38dvh!important;min-height:270px!important;border-radius:11px!important;overflow:hidden}
  body.sf-phone-companion #tripsView .sf-phone-history-legend{display:flex;gap:12px;align-items:center;padding:7px 2px 0;color:#63767e;font-size:8px}
  body.sf-phone-companion #tripsView .sf-phone-history-legend span{display:flex;align-items:center;gap:4px}
  body.sf-phone-companion #tripsView .sf-phone-history-legend i{width:9px;height:9px;border-radius:50%;display:inline-block}
  body.sf-phone-companion #tripsView .sf-phone-history-legend .route{background:#3568D4}
  body.sf-phone-companion #tripsView .sf-phone-history-legend .stop{background:#d94b50}
  body.sf-phone-companion #tripsView .sf-phone-history-legend .alert{background:#d9413b;box-shadow:0 0 0 2px #f4c8c6 inset}
  .sf-history-map-card{min-width:190px;max-width:240px;padding:2px 1px;color:#20343d}
  .sf-history-map-card-top{display:flex;align-items:center;gap:9px;margin-bottom:6px}
  .sf-history-map-card-top small{display:block;color:#7a8e96;font-size:8px;font-weight:800;letter-spacing:.08em}
  .sf-history-map-card-top strong{display:block;font-size:13px;margin-top:1px}
  .sf-history-map-card-icon{width:32px;height:32px;display:grid;place-items:center;flex:none;border-radius:50%;color:#fff;font-weight:850}
  .sf-history-map-card-icon.stop{background:#d94b50}
  .sf-history-map-card-icon.alert{background:#d9413b}
  .sf-history-map-card p{margin:5px 0;color:#455f69;font-size:10px;line-height:1.35}
  .sf-history-map-card>span{display:block;color:#7d9097;font-size:9px}
  body.sf-phone-companion #tripsView .trip-playback-grid{display:block!important}
  body.sf-phone-companion #tripsView .trip-map{height:43dvh!important;min-height:300px!important}
  body.sf-phone-companion #tripsView .trip-hud{display:none!important}
  body.sf-phone-companion #tripsView .trip-playback-bar{grid-template-columns:1fr 1fr!important}

  /* Alerts = inbox/activity only. Rule configuration and renewals stay on larger screens. */
  body.sf-phone-companion #alertsView .sf-alert-hub{margin:0 8px!important;padding:9px!important;gap:9px!important}
  body.sf-phone-companion #alertsView .sf-alert-tabs,
  body.sf-phone-companion #alertsView #alertSettingsPane,
  body.sf-phone-companion #alertsView #alertRenewalsPane{display:none!important}
  body.sf-phone-companion #alertsView .panel-head p{font-size:11px!important}
  body.sf-phone-companion #alertsView .sf-alert-summary{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-flow:row!important;overflow:visible!important;gap:7px!important}
  body.sf-phone-companion #alertsView .sf-alert-summary article{min-width:0!important;padding:8px 9px!important}
  body.sf-phone-companion #alertsView .sf-alert-activity-toolbar{padding:7px!important;gap:6px!important}
  body.sf-phone-companion #alertsView .sf-alert-category-segment,
  body.sf-phone-companion #alertsView .sf-alert-more{display:none!important}
  body.sf-phone-companion #alertsView .sf-alert-card{padding:8px!important;border-radius:11px!important}

  body.sf-phone-companion .sf-mobile-scroll-hint{display:none!important}
}
