/* Live Fleet only: integrated map workspace and compact fleet directory. */
main:has(#liveView:not(.hidden))>header{min-height:76px;padding:14px 22px!important}
#liveView{padding:0 20px 16px;margin:0}main:has(#liveView:not(.hidden))>header{margin-bottom:0}
#liveView .map-toolbar{min-height:66px;margin:0;gap:16px;align-items:center;flex-wrap:wrap}
#liveView .map-toolbar h3{display:none}
#liveView .map-toolbar>div:first-child{flex:1}
#liveView .map-toolbar .map-tools{gap:6px;flex-wrap:wrap}
#liveView .map-toolbar button{min-height:36px;padding:8px 12px;font-size:12px}
#liveView .sf-map-switch{margin:0;gap:0;flex-wrap:nowrap}
#liveView .sf-map-switch>.sf-chip{display:none}
#liveView #mapMessage:empty{display:none}
#liveView #mapMessage:not(:empty){margin:0 0 8px;padding:10px 14px;border-left:3px solid #d24654;background:#fff3f3}
#liveView .fleet-workspace{height:calc(100dvh - 176px);min-height:480px;grid-template-columns:304px minmax(0,1fr);border:0;border-radius:12px;box-shadow:0 2px 12px #163d4608;overflow:hidden}
#liveView .map-list{background:#fff;border-right:1px solid #e1eaed;display:flex;flex-direction:column;overflow:hidden}
#liveView .sf-directory-title{display:flex;align-items:center;justify-content:space-between;padding:18px 18px 2px;font-size:14px;color:#24414a}
#liveView .sf-directory-title>button{display:none}
#liveView .map-filters{padding:12px 14px;border-bottom:1px solid #e4edef;flex-shrink:0}
#liveView .map-filters>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#liveView .sf-search{display:flex;align-items:center;gap:6px;padding:0 4px 0 10px;border:1px solid #dce7e9;border-radius:9px;background:#f7fafb}
#liveView .sf-search>span{color:#64818b;font-size:25px;line-height:1}
#liveView .sf-search input{margin:0;border:0;background:transparent;min-width:0;min-height:40px;padding:8px 4px;font-size:13px;box-shadow:none}
#liveView .sf-search:focus-within{outline:2px solid #03989e66}
#liveView .sf-search button{flex-shrink:0;background:transparent;border:0;color:#6c838b;font-size:20px;padding:4px 8px;min-height:34px}
#liveView .map-filter-row{margin-top:10px;gap:6px}
#liveView .map-filter-row select,#liveView .map-filter-row button{min-height:36px;padding:7px 10px;font-size:12px}
#liveView #mapCount{margin:10px 2px 0;font-size:11px;color:#72909a}
#liveView #mapVehicles{overflow:auto;flex:1;overscroll-behavior:contain}
#liveView .map-vehicle{margin:0!important;padding:0!important;border:0;border-bottom:1px solid #edf2f3;border-radius:0!important;box-shadow:none;background:white}
#liveView .map-vehicle.selected{background:#edf8f7!important;box-shadow:inset 3px 0 #03989e!important}
#liveView .sf-directory-row{display:grid;grid-template-columns:48px minmax(0,1fr);gap:10px;align-items:center;padding:16px 14px;min-height:98px;border-radius:0;background:transparent;color:#233d46;white-space:normal;width:100%;text-align:left}
#liveView .sf-directory-row:hover{background:#f0f7f8;filter:none}
#liveView .sf-directory-row:focus-visible{outline:2px solid #03989e;outline-offset:-3px}
.sf-directory-symbol{height:52px;width:52px;object-fit:contain;flex-shrink:0}
#liveView .sf-directory-copy{display:block;margin:0;min-width:0}
#liveView .sf-directory-copy strong{font-size:14px;line-height:1.25;overflow-wrap:anywhere;color:#233d46}
#liveView .sf-directory-copy .sf-directory-model{font-size:10px;line-height:1.4;margin:4px 0 7px;color:#78909a}
#liveView .sf-directory-status{display:flex;flex-wrap:wrap;gap:3px 7px;margin:0;align-items:center;font-size:10px}
#liveView .sf-directory-status>b{font-size:9px;letter-spacing:.03em;color:#3178c6}
#liveView .sf-directory-status>b.moving{color:#15a34a}
#liveView .sf-directory-status>b.offline{color:#e05454}
#liveView .sf-directory-status>b.ignition{color:#f0a51b}
#liveView .sf-directory-status>b.alert{color:#c33647}
#liveView .sf-directory-status>span{font-size:10px;margin:0;color:#6c848e}
#liveView .sf-directory-empty{padding:24px 18px;color:#6b858e;font-size:13px}
#liveView .fleet-map-panel{position:relative;display:flex;overflow:hidden;background:#e9f0f2}
#liveView #liveMap{min-height:0!important;flex:1;height:100%;background:#e9f0f2}
#liveView #mapSelection{padding:8px 14px;font-size:10px;background:#f9fcfc;min-height:30px}
.sf-map-floats{position:absolute;right:64px;top:16px;display:grid;gap:7px;z-index:5;width:130px}
.sf-map-floats button,.sf-map-floats select{width:100%;min-height:40px;padding:9px 12px;border:1px solid #dce7ea;background:#fff;color:#2b515b;border-radius:9px;box-shadow:0 3px 12px #233f4812;font-size:12px;text-align:left;font-weight:600;margin:0}
.sf-map-floats button[aria-pressed=true]{background:#e6f6f3;color:#007970;border-color:#80c6c2}
.sf-marker-label{background:#fffffff0;border:1px solid #d4e3e5;border-radius:5px;padding:3px 6px;box-shadow:0 2px 5px #152f3912}
.sf-map-state{position:absolute;left:50%;top:43%;transform:translate(-50%,-50%);max-width:340px;width:calc(100% - 40px);padding:22px;background:#ffffffed;border:1px solid #dae6e9;border-radius:12px;box-shadow:0 6px 24px #253f4810;text-align:center;pointer-events:none;z-index:4}
.sf-map-state strong,.sf-map-state span{display:block}.sf-map-state strong{font-size:16px;color:#274851}.sf-map-state span{font-size:12px;color:#6e8992;margin-top:7px}
.sf-loading-state:before{content:'';display:block;width:40px;height:3px;background:#03989e;border-radius:3px;margin:0 auto 14px}
#liveMap .map-message{padding:24px;font-size:12px;color:#6e8790}
#liveMap .gm-style-iw-c{padding:0!important;border-radius:12px!important;box-shadow:0 8px 32px #19384026!important;max-width:340px!important}
#liveMap .gm-style-iw-d{overflow:auto!important;max-height:65vh!important}
#liveMap .gm-style-iw-chr{display:none}
#liveMap .gm-style-iw-tc{filter:drop-shadow(0 3px 2px #19384012)}
.sf-vehicle-context{width:320px;max-width:100%;padding:16px!important;box-sizing:border-box;color:#233f48;background:white;font:12px/1.45 'Segoe UI',Arial,sans-serif}
.sf-context-heading{display:flex;align-items:center;gap:8px}
.sf-context-heading>div{flex:1;min-width:0}.sf-context-heading strong{display:block;font-size:16px!important;line-height:1.3;overflow-wrap:anywhere}.sf-context-heading small{display:block;font-size:10px;color:#7b9098;margin-top:3px}
.sf-context-heading>button{padding:3px 7px;min-height:32px;align-self:flex-start;color:#69808a;background:transparent;border:0;font-size:23px}
.sf-context-status{display:flex;align-items:center;gap:8px;margin:10px 0}.sf-context-status>span:last-child{font-size:10px;color:#748c95}
.sf-context-speed{display:flex;align-items:baseline;gap:6px;padding:9px 0;border-bottom:1px solid #edf2f3}.sf-context-speed strong{font-size:26px!important;color:#203d47}.sf-context-speed>span:last-child{margin-left:auto;font-size:11px;color:#66828c}.sf-context-speed>span.sf-ignition-on{color:#996509}
.sf-context-location{padding:0;margin:12px 0!important;color:#31545e;font-size:12px!important;overflow-wrap:anywhere}
.sf-vehicle-context .sf-context-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}
.sf-context-grid dt{font-size:10px;color:#7b919a}.sf-context-grid dd{font-size:11px;margin:2px 0 0;font-weight:600;overflow-wrap:anywhere}
.sf-context-alert{font-size:10px!important;color:#6d8993;border-top:1px solid #edf2f3;padding-top:9px;margin:10px 0!important}.sf-context-alert.has-alert{color:#c43f4b}
.sf-context-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.sf-context-actions button{font-size:11px;min-height:36px;padding:8px 12px}.sf-context-actions>details{flex:1}.sf-context-actions summary{font-size:11px;cursor:pointer;min-height:36px;padding:9px 4px;list-style:none;color:#66848e}.sf-context-actions>details[open]{flex-basis:100%}.sf-context-more{padding:8px 10px;border-radius:8px;background:#f5f9fa;font-size:11px}.sf-context-more p{font-size:11px!important;margin:4px 0}
.sf-context-sheet{position:absolute;bottom:46px;left:20px;width:320px;border:1px solid #deeaed;border-radius:12px;box-shadow:0 6px 30px #203f4826;z-index:10;overflow:auto;max-height:70%}
.sf-map-drawer{width:350px}.sf-map-drawer header{margin-bottom:12px}.sf-map-drawer>p{font-size:12px;color:#78929b}.sf-map-drawer legend{text-transform:uppercase;font-size:10px;letter-spacing:.1em;color:#6a858f}.sf-map-drawer label{font-size:12px;margin:14px 0;font-weight:500}.sf-map-drawer select{font-size:12px;min-height:36px;padding:8px;max-width:175px}.sf-map-drawer fieldset{padding:12px 0;margin:14px 0}.sf-map-drawer fieldset>p{font-size:11px;color:#78929b}
.sf-map-drawer input.sf-switch{appearance:none;width:34px!important;height:20px;min-height:20px;flex-shrink:0;padding:0;border-radius:12px;border:1px solid #c8d8de;background:#dbe5e9;position:relative;cursor:pointer}
.sf-map-drawer input.sf-switch:before{content:'';position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:white;box-shadow:0 1px 3px #24455222;transition:transform .15s}
.sf-map-drawer input.sf-switch:checked{background:#03989e;border-color:#03989e}.sf-map-drawer input.sf-switch:checked:before{transform:translateX(14px)}
#liveView.sf-list-mode .fleet-workspace{height:auto;min-height:0;display:block;background:transparent;box-shadow:none}
#liveView.sf-list-mode .map-list{border:0}.sf-list-mode .sf-directory-title{display:none!important}.sf-list-mode .sf-search{flex:1;min-width:200px}.sf-list-mode .map-filter-row{flex:1}.sf-list-mode .sf-fleet-table{margin-top:12px}
@media(max-width:1100px){#liveView .fleet-workspace{grid-template-columns:280px minmax(0,1fr)}#liveView .map-toolbar .map-tools{gap:4px}#liveView .map-toolbar button{font-size:11px;padding:8px}.sf-map-floats{right:58px;width:112px}}
@media(max-width:720px){
  main:has(#liveView:not(.hidden))>header{padding:10px 14px!important;min-height:70px;gap:8px}main:has(#liveView:not(.hidden))>header h2{font-size:19px!important}
  #liveView{padding:0 8px 8px}#liveView .map-toolbar{min-height:100px;gap:5px;padding:8px 0;display:grid;grid-template-columns:1fr auto}#liveView .map-toolbar>div:first-child{grid-column:1/-1;line-height:1.3}#liveView #mapUpdated{font-size:10px}
  #liveView .map-toolbar button{min-height:40px}#liveView .sf-map-switch .sf-segment{padding:2px}#liveView .sf-map-switch .sf-segment button{padding:7px 10px;font-size:11px}
  #liveView .map-tools{justify-content:flex-end}#liveView .map-tools #sfFollowVehicle{display:none}#liveView #mobileMapToggle{display:inline-block}
  #liveView .fleet-workspace{height:calc(100dvh - 220px);min-height:420px;display:block;position:relative;border-radius:10px}
  #liveView:not(.sf-list-mode) .fleet-map-panel{display:flex!important;width:100%;height:100%;min-height:0}
  #liveView:not(.sf-list-mode) .map-list{display:none!important}
  #liveView.sf-directory-open:not(.sf-list-mode) .map-list{display:flex!important;position:absolute;inset:0 32px 0 0;z-index:20;border-radius:10px;box-shadow:8px 0 30px #183d4533}
  #liveView .sf-directory-title>button{display:block;min-height:36px;padding:6px 10px;font-size:20px;background:transparent;border:0}
  #liveView .map-filter-row button,#liveView .map-filter-row select{min-height:40px}#liveView .sf-search input{font-size:16px}
  .sf-map-floats{top:12px;right:56px;width:105px;gap:5px}.sf-map-floats button,.sf-map-floats select{min-height:40px;font-size:11px;padding:8px}
  .sf-context-sheet{left:8px;right:8px;bottom:42px;width:auto;max-height:48%;border-radius:14px;overscroll-behavior:contain;scrollbar-width:thin}
  .sf-context-sheet:before{content:'';display:block;width:32px;height:3px;margin:8px auto 0;border-radius:3px;background:#cbdcdf}
  .sf-context-sheet .sf-vehicle-context{width:100%;padding:8px 13px 13px!important}.sf-context-heading .sf-directory-symbol{width:42px;height:42px}.sf-context-heading strong{font-size:15px!important}.sf-context-status{margin:6px 0}.sf-context-speed{padding:4px 0}.sf-context-speed strong{font-size:22px!important}.sf-context-location{margin:8px 0!important}.sf-context-actions button,.sf-context-actions summary{min-height:42px}
  .sf-map-state{top:48%;padding:18px;max-width:280px}.sf-map-state strong{font-size:15px}.sf-map-state span{font-size:11px}#liveView #mapSelection{font-size:9px;padding:7px 10px}
  #liveView.sf-list-mode .fleet-workspace{height:auto;min-height:0}#liveView.sf-list-mode .map-list{display:block!important}#liveView.sf-list-mode .fleet-map-panel{display:none!important}#liveView.sf-list-mode .sf-search{min-width:0;width:100%}
  .sf-map-drawer{width:100vw;padding:20px}.sf-map-drawer select{font-size:16px;max-width:200px;min-height:42px}
}

/* Compact map variant of the shared PEKTECH design language. */
#liveView .fleet-workspace{border-radius:var(--pk-radius-card);box-shadow:var(--pk-shadow)}
#liveMap .gm-style-iw-c{border-radius:var(--pk-radius-card)!important;box-shadow:var(--pk-shadow-overlay)!important}
.sf-vehicle-context{font-family:var(--pk-font);color:var(--pk-ink)}.sf-context-sheet,.sf-map-state{border-radius:16px;box-shadow:var(--pk-shadow-overlay)}.sf-map-floats button,.sf-map-floats select{border-radius:var(--pk-radius-control)}

@media(max-width:720px){
 #liveView .sf-map-switch button{white-space:nowrap}#liveView .sf-map-floats #mapFit{font-size:10px;white-space:normal}
 .sf-context-sheet{height:58%;max-height:400px;overflow:hidden}.sf-context-sheet .sf-vehicle-context{height:calc(100% - 11px);display:flex;flex-direction:column;min-height:0}
 .sf-context-heading,.sf-context-status,.sf-context-speed,.sf-context-actions{flex-shrink:0}.sf-context-body{overflow:auto;min-height:0;flex:1;overscroll-behavior:contain}
 .sf-context-actions{padding-top:8px;border-top:1px solid var(--pk-border);background:#fff}.sf-context-actions>details[open]{max-height:110px;overflow:auto}
}

/* dev17-livefleet1 — cleaner map controls and refined list workspace. */
#liveView .sf-map-switch{display:flex;align-items:center;gap:8px}
#liveView .sf-map-switch>#sfMapOptions{margin-left:2px;background:#fff;border:1px solid var(--pk-border);color:var(--pk-ink);box-shadow:0 2px 8px #19384008}
#liveView .sf-map-switch>#sfMapOptions:hover{background:var(--pk-brand-soft);color:var(--pk-brand-strong);filter:none}
#liveView .sf-map-switch>.sf-segment{flex-shrink:0}

/* Map type and traffic now live only inside Map Options; no duplicate floating stack. */
.sf-map-floats{display:none!important}
.sf-map-drawer{width:390px}
.sf-map-drawer fieldset{padding:16px 0;margin:12px 0}
.sf-map-drawer fieldset>label{min-height:38px;margin:8px 0;padding:5px 0}
.sf-map-drawer fieldset>label+label{border-top:1px solid #edf2f3}
.sf-map-drawer legend{margin-bottom:6px}
.sf-map-drawer select{width:180px;max-width:52%}
.sf-map-drawer input[type=range]{width:150px}

/* List view becomes one cohesive workspace instead of a filter card plus a second table card. */
#liveView.sf-list-mode .fleet-workspace{display:none!important}
#liveView.sf-list-mode .sf-fleet-table{margin:0 0 18px;padding:20px;border-radius:16px;box-shadow:var(--pk-shadow);background:#fff}
#liveView .sf-list-header{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:12px}
#liveView .sf-list-heading>span{display:block;margin-bottom:5px;font-size:9px;font-weight:800;letter-spacing:.16em;color:var(--pk-brand-strong)}
#liveView .sf-list-heading h3{font-size:18px;margin:0}
#liveView .sf-list-heading p{font-size:11px;color:var(--pk-muted);margin:4px 0 0}
#liveView .sf-list-header>label{width:220px;flex:0 0 220px;margin:0;font-size:10px;color:var(--pk-muted)}
#liveView .sf-list-header select{margin-top:5px;min-height:38px;padding:8px 10px;font-size:12px}
#liveView .sf-list-filter-host .map-filters{display:grid;grid-template-columns:minmax(280px,1.5fr) minmax(250px,.8fr);gap:10px 12px;align-items:center;padding:12px;margin:0 0 16px;border:1px solid #e2eaed;border-radius:12px;background:#f8fbfc}
#liveView .sf-list-filter-host .map-filters>label{display:none}
#liveView .sf-list-filter-host .sf-search{min-width:0;width:100%;background:#fff}
#liveView .sf-list-filter-host .map-filter-row{display:grid;grid-template-columns:minmax(160px,1fr) auto;gap:8px;margin:0;min-width:0}
#liveView .sf-list-filter-host #mapCount{grid-column:1/-1;margin:0 2px;font-size:10px;color:#78909a}
#liveView .sf-list-filter-host .map-filter-row select,#liveView .sf-list-filter-host .map-filter-row button{margin:0;min-height:40px}

#liveView .sf-live-table-wrap{overflow:auto;border-radius:12px;border:1px solid #e1e8ec;background:#fff}
#liveView .sf-live-directory-table{table-layout:fixed;min-width:1040px;width:100%}
#liveView .sf-live-directory-table th{padding:11px 12px;background:#f6f9fa;font-size:9px;letter-spacing:.075em}
#liveView .sf-live-directory-table td{padding:13px 12px;white-space:normal;vertical-align:middle;font-size:12px;line-height:1.35}
#liveView .sf-live-directory-table tbody tr{height:76px;background:#fff}
#liveView .sf-live-directory-table tbody tr:hover{background:#f5fafb}
#liveView .sf-live-directory-table th:nth-child(1){width:18%}
#liveView .sf-live-directory-table th:nth-child(2){width:11%}
#liveView .sf-live-directory-table th:nth-child(3){width:13%}
#liveView .sf-live-directory-table th:nth-child(4){width:11%}
#liveView .sf-live-directory-table th:nth-child(5){width:23%}
#liveView .sf-live-directory-table th:nth-child(6){width:14%}
#liveView .sf-live-directory-table th:nth-child(7){width:10%}
#liveView .sf-list-vehicle-inner{display:flex;align-items:center;gap:10px;min-width:0}
#liveView .sf-list-vehicle .sf-vehicle-symbol{width:38px;height:38px;margin:0;flex:0 0 38px}
#liveView .sf-list-identity{display:block;min-width:0}
#liveView .sf-list-identity strong{display:block;font-size:12px;color:var(--pk-ink);overflow-wrap:anywhere}
#liveView .sf-list-identity small{display:block;margin-top:3px;font-size:9px;color:var(--pk-muted);overflow-wrap:anywhere}
#liveView .sf-list-status .sf-chip{margin-bottom:5px}
#liveView .sf-list-status small,#liveView .sf-list-movement small,#liveView .sf-list-updated small,#liveView .sf-list-location small{display:block;margin-top:4px;font-size:9px;color:var(--pk-muted);line-height:1.35}
#liveView .sf-list-movement strong{display:block;font-size:12px;color:var(--pk-ink)}
#liveView .sf-list-ignition-on{color:#a76b0a!important;font-weight:700}
#liveView .sf-list-location>span{display:block;font-variant-numeric:tabular-nums;font-size:11px;color:#38565f;overflow-wrap:anywhere}
#liveView .sf-list-location .sf-list-address{color:#38565f;font-size:10px}
#liveView .sf-table-link{display:inline-block;margin-top:5px;min-height:0!important;padding:2px 0!important;border:0!important;background:transparent!important;color:var(--pk-brand-strong)!important;font-size:9px!important;box-shadow:none!important}
#liveView .sf-table-link:hover{text-decoration:underline;filter:none}
#liveView .sf-list-updated>span{display:block;font-size:11px;color:#38565f}
#liveView .sf-list-actions{white-space:nowrap}
#liveView .sf-list-actions button{display:block;width:100%;min-height:34px;padding:6px 8px;font-size:10px}
#liveView .sf-list-actions button+button{margin-top:6px}

/* Keep the primary live controls balanced as the viewport narrows. */
@media(max-width:1180px){
  #liveView .sf-live-directory-table{min-width:980px}
  #liveView .sf-list-header>label{width:190px;flex-basis:190px}
}
@media(max-width:720px){
  #liveView .sf-map-switch{width:100%;justify-content:space-between}
  #liveView .sf-map-switch>#sfMapOptions{margin-left:auto;min-height:40px}
  #liveView.sf-list-mode .sf-fleet-table{margin:0;padding:12px}
  #liveView .sf-list-header{align-items:stretch;flex-direction:column;gap:10px}
  #liveView .sf-list-header>label{width:100%;flex-basis:auto}
  #liveView .sf-list-filter-host .map-filters{grid-template-columns:1fr;padding:10px}
  #liveView .sf-list-filter-host .map-filter-row{grid-template-columns:1fr auto}
  #liveView .sf-live-directory-table{min-width:0;table-layout:auto}
  #liveView .sf-live-directory-table tbody tr{height:auto}
  #liveView .sf-live-directory-table td{padding:7px 6px}
  #liveView .sf-list-actions{display:flex!important;justify-content:flex-end!important;gap:7px}
  #liveView .sf-list-actions button{width:auto;display:inline-flex;min-height:40px}
  #liveView .sf-list-actions button+button{margin-top:0}
}
