/* Fleet 1068: compact Route Replay controls without horizontal scrolling. */
.replay-compact-workspace{overflow:hidden!important;border-right:0!important;margin-top:2px!important}
.replay-compact-toolbar{display:flex;align-items:flex-end;gap:7px;padding:8px 10px;border-bottom:1px solid #dce4e9;background:#fff;min-height:54px;overflow:visible;white-space:normal;flex-wrap:wrap}
.replay-compact-toolbar>*{flex:0 0 auto}
.replay-driver-toggle{height:38px;min-width:180px;max-width:260px;padding:0 10px;border:1px solid #cfd9df;border-radius:8px;background:#fff;color:#152936;display:flex;align-items:center;gap:7px;cursor:pointer;font:inherit;text-align:left}
.replay-driver-toggle:hover,.replay-driver-toggle.active{border-color:#ed1b2f;box-shadow:0 0 0 2px rgba(237,27,47,.08)}
.replay-driver-toggle .replay-compact-label{font-size:8px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#71818c}
.replay-driver-toggle b{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:120px}
.replay-driver-count{display:grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#edf2f5;color:#334957;font-size:9px;font-weight:900}
.replay-chevron{margin-left:auto;color:#5d707c}
.replay-compact-field{display:flex!important;flex-direction:column!important;gap:3px!important;margin:0!important;font-size:8px!important;font-weight:900!important;letter-spacing:.05em!important;text-transform:uppercase!important;color:#677986!important}
.replay-compact-field input{height:38px!important;min-width:116px!important;border:1px solid #cfd9df!important;border-radius:8px!important;padding:0 8px!important;background:#fff!important;color:#152936!important;font:inherit!important;text-transform:none!important;letter-spacing:0!important}
.replay-compact-field:first-of-type input{min-width:136px!important}
.replay-compact-action,.replay-transport-btn,#replay-toolbar-hide{height:38px!important;min-height:38px!important;margin:0!important;white-space:nowrap!important}
.replay-transport-btn{padding-left:10px!important;padding-right:10px!important}
.replay-zip-toggle{font-weight:800!important}
.replay-zip-toggle.active{background:#0f766e!important;border-color:#0f766e!important;color:#fff!important}
.replay-compact-divider{width:1px;height:30px;background:#d6e0e6;margin:0 2px 4px}
.replay-compact-timeline{width:170px!important;min-width:140px!important;align-self:center;margin-bottom:9px}
.replay-compact-clock{font-size:9px!important;font-weight:800!important;color:#536774!important;max-width:150px;overflow:hidden;text-overflow:ellipsis;align-self:center;margin-bottom:9px}
.replay-compact-speed{height:38px!important;border:1px solid #ccd7de!important;border-radius:8px!important;background:#fff!important;padding:0 8px!important;font-weight:800!important;color:#213845!important;margin-bottom:0!important}
.replay-summary-compact{font-size:9px!important;align-self:center;max-width:190px;overflow:hidden;text-overflow:ellipsis;margin-bottom:9px}
.replay-toolbar-hide{margin-left:auto!important}
.replay-toolbar-show{display:none!important;margin:7px 10px;height:36px!important}
.replay-driver-drawer{padding:8px 10px;border-bottom:1px solid #dce4e9;background:#f7fafc}
.replay-driver-drawer[hidden]{display:none!important}
.replay-driver-box-compact{padding:8px 10px!important;background:#fff!important;border:1px solid #d7e0e6!important;border-radius:8px!important}
.replay-driver-box-compact .replay-section-head{margin-bottom:7px!important}
.replay-driver-box-compact .replay-driver-grid{grid-template-columns:repeat(4,minmax(145px,1fr))!important;max-height:112px!important}
.replay-toolbar-collapsed .replay-compact-toolbar,.replay-toolbar-collapsed .replay-driver-drawer{display:none!important}
.replay-toolbar-collapsed .replay-toolbar-show{display:inline-flex!important;align-items:center!important}

body[data-page="replay"] .content{padding-top:6px!important;padding-right:0!important;padding-bottom:0!important}
body[data-page="replay"] .headline{margin-bottom:5px!important}
body[data-page="replay"] .replay-workspace{border-right:0!important;border-bottom-right-radius:0!important;margin-right:0!important}
body[data-page="replay"] .replay-map{height:calc(100vh - 178px)!important;min-height:560px!important;width:100%!important;border-right:0!important}

:root[data-theme="dark"] .replay-compact-toolbar{background:#17212b;border-color:#2b3945}
:root[data-theme="dark"] .replay-driver-toggle,:root[data-theme="dark"] .replay-compact-field input,:root[data-theme="dark"] .replay-compact-speed{background:#101922!important;color:#eef4f7!important;border-color:#334553!important}
:root[data-theme="dark"] .replay-driver-drawer{background:#121c25;border-color:#2b3945}
:root[data-theme="dark"] .replay-driver-box-compact{background:#17212b!important;border-color:#2b3945!important}

@media(max-width:1250px){
  .replay-compact-toolbar{align-items:center}
  .replay-compact-field input{min-width:104px!important}
  .replay-compact-field:first-of-type input{min-width:124px!important}
  .replay-compact-timeline{width:125px!important;min-width:105px!important}
  .replay-compact-clock{display:none}
  .replay-driver-box-compact .replay-driver-grid{grid-template-columns:repeat(3,minmax(145px,1fr))!important}
}
@media(max-width:900px){
  .replay-compact-toolbar{align-items:flex-end}
  .replay-driver-toggle{min-width:160px}
  .replay-compact-timeline{flex:1 0 180px!important;width:auto!important}
  .replay-driver-box-compact .replay-driver-grid{grid-template-columns:repeat(2,minmax(145px,1fr))!important}
  body[data-page="replay"] .replay-map{height:560px!important}
}
@media(max-width:650px){
  .replay-compact-toolbar{gap:5px}
  .replay-driver-toggle{width:100%;max-width:none}
  .replay-compact-field{flex:1 1 30%}
  .replay-compact-field input{width:100%;min-width:0!important}
  .replay-driver-box-compact .replay-driver-grid{grid-template-columns:1fr!important}
}

/* 1150 — Route Replay uses one compact driver dropdown instead of driver cards. */
.replay-driver-source{display:none!important}
.replay-driver-select-field{display:flex;flex-direction:column;gap:3px;margin:0;font-size:8px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:#677986}
.replay-driver-select-field select{height:38px;min-width:190px;max-width:250px;border:1px solid #cfd9df;border-radius:8px;padding:0 30px 0 9px;background:#fff;color:#152936;font:inherit;font-size:11px;font-weight:800;text-transform:none;letter-spacing:0}
:root[data-theme="dark"] .replay-driver-select-field{color:#8fa4b2}
:root[data-theme="dark"] .replay-driver-select-field select{background:#101922!important;color:#eef4f7!important;border-color:#334553!important}
@media(max-width:650px){.replay-driver-select-field{width:100%}.replay-driver-select-field select{width:100%;max-width:none}}

/* Route Replay: readable, responsive filters and independent driver controls. */
.replay-compact-workspace{--rr-bg:#fff;--rr-soft:#f4f7fa;--rr-ink:#203548;--rr-border:#c9d5df}
:root[data-theme="dark"] .replay-compact-workspace{--rr-bg:#17212b;--rr-soft:#101922;--rr-ink:#e5edf4;--rr-border:#455766}
.replay-compact-toolbar{gap:12px;padding:12px 16px;align-items:flex-end;background:var(--rr-bg);color:var(--rr-ink)}
.replay-compact-toolbar .replay-compact-field{font-size:13px!important;font-weight:700!important;letter-spacing:0!important;text-transform:none!important;color:var(--rr-ink)!important;flex:1 1 135px;max-width:220px}
.replay-compact-toolbar .replay-compact-field input{font:500 15px system-ui!important;width:100%;min-width:0!important;height:42px!important;box-sizing:border-box;color:var(--rr-ink)!important;background:var(--rr-bg)!important;border-color:var(--rr-border)!important}
.replay-driver-picker{position:relative;flex:0 1 230px;min-width:180px}
.replay-driver-picker summary{font-size:15px;font-weight:650;min-height:42px;width:100%;max-width:none;box-sizing:border-box;background:var(--rr-bg);color:var(--rr-ink);border-color:var(--rr-border);display:flex;justify-content:space-between}
.replay-driver-picker summary::after{content:"▾"}
.replay-driver-picker .replay-driver-box{position:absolute;z-index:1100;top:calc(100% + 4px);left:0;width:min(420px,75vw);box-shadow:0 8px 24px #0003;background:var(--rr-bg)!important;border-color:var(--rr-border)!important}
.replay-driver-picker .replay-driver-grid{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))!important;max-height:240px!important}
.replay-driver-picker .replay-driver-check{font-size:14px;color:var(--rr-ink);background:var(--rr-soft);border-color:var(--rr-border)}
.replay-driver-picker .replay-section-head>b{font-size:14px;color:var(--rr-ink)}
.replay-compact-toolbar .btn{font-size:14px!important;min-height:42px!important}
.replay-transport-row{display:flex;align-items:center;flex:1 1 100%!important;gap:8px;flex-wrap:wrap;border-top:1px solid var(--rr-border);padding-top:10px}
.replay-transport-row #replay-timeline{flex:1 1 180px;min-width:100px}
.replay-transport-row #replay-clock{display:block;font-size:13px;color:var(--rr-ink);white-space:normal}
.replay-transport-row #replay-speed{font-size:14px;background:var(--rr-bg);color:var(--rr-ink);border-color:var(--rr-border)}
.replay-summary-compact{font-size:13px!important;max-width:none;flex:1 1 100%!important;overflow:visible;margin:0;white-space:normal;color:var(--rr-ink)}
.replay-driver-states,.replay-layer-controls{display:flex;flex-wrap:wrap;gap:8px;padding:8px 16px;background:var(--rr-soft);color:var(--rr-ink);border-bottom:1px solid var(--rr-border);font-size:14px;align-items:center}
.replay-driver-state{display:flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid var(--rr-border);border-left:5px solid var(--driver-color);border-radius:7px;background:var(--rr-bg);flex-wrap:wrap}
.replay-driver-state button{font-size:13px;min-height:34px}
.replay-driver-state output{font-size:13px;min-width:150px}
.replay-layer-controls label{display:flex;align-items:center;gap:5px;white-space:nowrap}
.replay-layer-controls input[type=number]{width:65px;font:inherit;color:var(--rr-ink);background:var(--rr-bg);border:1px solid var(--rr-border)}
.replay-toolbar-collapsed .replay-driver-states,.replay-toolbar-collapsed .replay-layer-controls{display:none}
body[data-page="replay"] .replay-map{height:clamp(430px,calc(100vh - 310px),900px)!important;min-height:430px!important}
.replay-truck-icon{background:transparent;border:0}
.replay-truck-icon span{display:grid;place-items:center;width:32px;height:32px;border:2px solid white;border-radius:50%;background:var(--driver-color);color:white;box-shadow:0 1px 5px #0008;font-size:17px}
@media(max-width:650px){.replay-driver-picker{flex:1 1 100%}.replay-compact-toolbar .replay-compact-field{max-width:none}.replay-transport-row #replay-clock{flex:1 1 100%}}

/* Map-first replay. Scope to this page; do not alter the global Fleet shell. */
body[data-page="replay"] .content:has(.replay-compact-workspace){
 padding:0!important;min-height:0!important;max-width:none!important;overflow:visible!important;
}
body[data-page="replay"] .content>.replay-redundant-heading{display:none!important}
body[data-page="replay"] .replay-compact-workspace{
 margin:0!important;width:100%!important;max-width:none!important;border-radius:0!important;
 box-sizing:border-box!important;overflow:visible!important;position:relative!important;
}
body[data-page="replay"] .replay-compact-toolbar{
 position:relative;z-index:1101;gap:4px 7px!important;padding:5px 7px!important;
 align-items:center!important;min-height:0!important;background:var(--rr-bg);border-bottom:1px solid var(--rr-border);
}
body[data-page="replay"] .replay-driver-picker{flex:0 1 170px!important;min-width:135px!important}
body[data-page="replay"] .replay-driver-picker summary{
 min-height:30px!important;height:30px!important;font-size:13px!important;padding:0 7px!important
}
body[data-page="replay"] .replay-compact-toolbar .replay-compact-field{
 flex:0 1 auto!important;flex-direction:row!important;align-items:center!important;
 font-size:12px!important;gap:4px!important;max-width:none!important;white-space:nowrap!important
}
body[data-page="replay"] .replay-compact-toolbar .replay-compact-field input{
 height:30px!important;width:auto!important;min-width:0!important;padding:0 4px!important;font-size:13px!important
}
body[data-page="replay"] .replay-compact-toolbar .replay-compact-field input[type=date]{width:123px!important}
body[data-page="replay"] .replay-compact-toolbar .replay-compact-field input[type=time]{width:94px!important}
body[data-page="replay"] .replay-compact-toolbar .btn{
 height:30px!important;min-height:30px!important;font-size:12px!important;padding:0 7px!important;border-radius:5px!important
}
body[data-page="replay"] .replay-transport-row{
 flex:1 1 355px!important;display:flex!important;gap:4px!important;min-width:0!important;
 align-items:center!important;border:0!important;padding:0!important;margin:0!important
}
body[data-page="replay"] .replay-transport-row .replay-transport-btn{
 width:32px!important;min-width:32px!important;padding:0!important;display:inline-grid!important;place-items:center!important
}
body[data-page="replay"] .replay-transport-row #replay-speed{height:30px!important;min-height:30px!important;font-size:12px!important;padding:0 4px!important;max-width:76px!important}
body[data-page="replay"] .replay-transport-row #replay-timeline{flex:1 1 90px!important;min-width:70px!important;max-width:none!important;margin:0!important}
body[data-page="replay"] .replay-transport-row #replay-clock{flex:0 1 auto!important;display:block!important;font-size:12px!important;white-space:normal!important;max-width:180px!important}
body[data-page="replay"] .replay-summary-compact{flex:1 1 100%!important;font-size:12px!important;margin:0!important;line-height:1.2!important}
body[data-page="replay"] .replay-summary-compact:empty{display:none!important}
body[data-page="replay"] .replay-advanced-drawer{background:var(--rr-soft);color:var(--rr-ink);border-bottom:1px solid var(--rr-border);position:relative;z-index:1100}
body[data-page="replay"] .replay-advanced-drawer>summary{cursor:pointer;font-size:12px;font-weight:700;padding:4px 9px;line-height:18px}
body[data-page="replay"] .replay-advanced-body{max-height:min(32vh,230px);overflow:auto}
body[data-page="replay"] :is(.replay-driver-states,.replay-layer-controls){gap:5px!important;padding:4px 8px!important;font-size:12px!important}
body[data-page="replay"] .replay-driver-states:empty{display:none!important}
body[data-page="replay"] .replay-driver-state{gap:5px!important;padding:3px 6px!important}
body[data-page="replay"] .replay-driver-state button{min-height:28px!important;font-size:12px!important}
body[data-page="replay"] .replay-map{
 height:var(--replay-available-height,calc(100dvh - 150px))!important;min-height:180px!important;max-height:none!important;
 width:100%!important;border-radius:0!important;border:0!important;box-sizing:border-box!important;z-index:0
}
@media(max-width:650px){
 body[data-page="replay"] .replay-driver-picker{flex:1 1 140px!important}
 body[data-page="replay"] .replay-compact-toolbar .replay-compact-field{flex:0 1 auto!important}
 body[data-page="replay"] .replay-transport-row{flex:1 1 100%!important}
 body[data-page="replay"] .replay-transport-row #replay-clock{max-width:none!important}
}

/* Route Replay: intrinsic driver name width and two intentional control rows. */
body[data-page="replay"] .replay-compact-toolbar{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:4px!important;container-type:inline-size}
body[data-page="replay"] .replay-primary-row,body[data-page="replay"] .replay-playback-row{display:flex;align-items:center;gap:6px;min-width:0;width:100%;flex-wrap:nowrap;box-sizing:border-box}
body[data-page="replay"] .replay-primary-row>.replay-driver-picker{flex:0 1 auto!important;min-width:145px!important;width:max-content;max-width:100%}
body[data-page="replay"] .replay-driver-picker summary{min-width:0!important;width:100%!important;white-space:nowrap;gap:6px;justify-content:space-between;overflow:hidden}
body[data-page="replay"] .replay-driver-name{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body[data-page="replay"] .replay-driver-picker summary::after{flex:none}
body[data-page="replay"] .replay-primary-row>.replay-compact-field{flex:0 0 auto!important;min-width:0}
body[data-page="replay"] .replay-primary-row>.replay-compact-action{flex:0 0 auto!important}
body[data-page="replay"] .replay-playback-row{position:relative;border-top:1px solid var(--rr-border);padding-top:4px}
body[data-page="replay"] .replay-playback-row>.replay-transport-row{flex:1 1 auto!important;flex-wrap:nowrap!important;min-width:0}
body[data-page="replay"] .replay-playback-row #replay-clock{overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;max-width:190px!important}
body[data-page="replay"] .replay-playback-row>.replay-advanced-drawer{flex:0 0 auto;position:static!important;background:var(--rr-bg);border:1px solid var(--rr-border);border-radius:5px}
body[data-page="replay"] .replay-playback-row>.replay-advanced-drawer>summary{white-space:nowrap;padding:5px 8px;line-height:18px}
body[data-page="replay"] .replay-playback-row .replay-advanced-body{position:absolute;top:100%;right:0;left:0;z-index:1102;background:var(--rr-bg);border:1px solid var(--rr-border);border-radius:5px;box-shadow:0 5px 14px #0003}
body[data-page="replay"] .replay-summary-compact{margin:0!important}
/* Wrap at genuinely narrow canvas widths (including expanded sidebar), never clip required controls. */
@container (max-width: 840px){
 body[data-page="replay"] .replay-primary-row{flex-wrap:wrap}
 body[data-page="replay"] .replay-primary-row>.replay-driver-picker{flex:0 1 auto!important}
}
@container (max-width: 580px){
 body[data-page="replay"] .replay-playback-row{flex-wrap:wrap}
 body[data-page="replay"] .replay-playback-row>.replay-transport-row{flex:1 1 100%!important;flex-wrap:wrap!important}
 body[data-page="replay"] .replay-primary-row>.replay-driver-picker{max-width:100%}
}
