/* Journey replay shares the fleet map; every layout override ends on exit. */
.replay-endpoint-marker { --endpoint-color: #15834e; display: flex; align-items: center; background: none; border: 0; pointer-events: none; }
.replay-endpoint-end { --endpoint-color: #bd4057; flex-direction: row-reverse; }
.replay-endpoint-badge { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; color: var(--endpoint-color); background: #fffdf9; box-shadow: 0 1px 7px #30254340, inset 0 0 0 1px currentColor; pointer-events: auto; }
.replay-endpoint-badge svg { display: block; width: 17px; height: 17px; }
.replay-endpoint-stem { position: relative; flex: 1; height: 2px; background: var(--endpoint-color); }
.replay-endpoint-stem::after { content: ''; position: absolute; top: -2px; right: -3px; width: 6px; height: 6px; border: 1px solid #fff; border-radius: 50%; background: var(--endpoint-color); box-sizing: border-box; }
.replay-endpoint-end .replay-endpoint-stem::after { right: auto; left: -3px; }
body.replay-active .map-panel { --replay-footer-bottom: calc(max(18px, var(--replay-attribution-height, 24px)) + 8px + env(safe-area-inset-bottom)); container: replay-map / size; }
body.replay-active .selection-card,
body.replay-active .map-legend,
body.replay-active .map-caption,
body.replay-active .map-controls .fit-button,
body.replay-active .map-controls .follow-button,
body.replay-active .map-controls [data-action="fullscreen-map"],
body.replay-active .map-controls [data-action="toggle-geofences"],
body.replay-active .leaflet-control-scale { display: none !important; }
body.replay-active #fleet-map { height: 100%; min-height: 0; }
body.replay-active .map-top-controls { top: 12px; right: 12px; left: auto; width: 208px; max-width: calc(100% - 24px); z-index: 760; justify-content: flex-end; }
body.replay-active #fleet-map-style { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; padding: 3px; max-width: 100%; border: 1px solid #e0d9e8; border-radius: 9px; background: #fffdf9ed; box-shadow: 0 3px 14px #30254312; }
body.replay-active #fleet-map-style button { min-width: 30px; min-height: 30px; padding: 4px 6px; border-radius: 6px; font-size: 10px; }
body.replay-active .map-controls { top: 58px !important; right: 12px; bottom: auto; z-index: 750; display: flex; flex-direction: column !important; gap: 4px; transform: none; }
body.replay-active .map-controls .map-zoom { display: flex; flex-direction: column !important; gap: 3px; }
body.replay-active .map-controls .map-button { width: 30px; height: 30px; min-width: 30px; min-height: 30px; border: 1px solid #e0d9e8; border-radius: 7px; background: #fffdf9ed; }
body.replay-active .map-controls .map-button svg { width: 14px; height: 14px; }
body.replay-active .map-notice { top: auto; left: 12px; right: auto; bottom: calc(var(--replay-footer-bottom) + var(--replay-footer-height, 160px) + 8px); display: flex; align-items: center; gap: 8px; max-width: min(360px, calc(100% - 80px)); max-height: min(100px, max(0px, calc(100% - var(--replay-footer-bottom) - var(--replay-footer-height, 160px) - var(--replay-toolbar-height, 128px) - 32px))); padding: 6px 8px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; font-size: 11px; z-index: 760; }
body.replay-active .map-notice > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
body.replay-active .map-notice button { flex: none; min-height: 30px; min-width: 30px; font-size: 10px; }
body.replay-active .leaflet-bottom { bottom: env(safe-area-inset-bottom) !important; }
body.replay-active .leaflet-bottom.leaflet-right { width: 100%; }
body.replay-active .leaflet-control-attribution { max-width: 100%; margin-bottom: 0; padding: 2px 7px !important; font-size: 10px !important; line-height: 1.45; overflow-wrap: anywhere; }

body.replay-active .replay-host { position: absolute; inset: 0; z-index: 720; min-width: 0; min-height: 0; pointer-events: none; font-size: 12px; line-height: 1.4; }
.replay-host .replay-toolbar,
.replay-host .replay-footer { position: absolute; pointer-events: auto; min-width: 0; border: 1px solid #ffffffd9; border-radius: 11px; background: #fffdf9ed; box-shadow: 0 5px 24px #3025431c; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.replay-host .replay-toolbar { top: 12px; left: 12px; width: min(520px, calc(100% - 248px)); max-height: calc(100% - var(--replay-footer-height, 140px) - var(--replay-footer-bottom) - 24px); padding: 3px 4px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.replay-host .replay-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 30px; background: #fffdf9f5; }
.replay-host .replay-heading-copy { min-width: 0; }
.replay-host .replay-eyebrow { display: block; margin-bottom: 1px; color: var(--violet); font-size: 10px; line-height: 1.3; font-weight: 750; letter-spacing: .1em; }
.replay-host .replay-title,
.replay-host .replay-vehicle { display: block; color: var(--ink); font-size: 12px; line-height: 1.3; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.replay-host button,
.replay-host select { min-width: 30px; min-height: 30px; border: 1px solid #e1d9ec; border-radius: 7px; font-family: inherit; font-size: 10px; line-height: 1.3; }
.replay-host button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; padding: 4px 6px; color: var(--secondary); background: #fffdfb; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.replay-host button svg,
.replay-host button .icon { width: 14px; height: 14px; flex: none; }
.replay-host button:hover:not(:disabled) { color: var(--violet); border-color: #c8b6e7; background: var(--violet-soft); }
.replay-host button:disabled,
.replay-host select:disabled { cursor: default; opacity: .5; }
.replay-host :is(button, select, input, summary):focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.replay-host .replay-exit { flex: none; color: var(--violet); border-color: transparent; background: #f0e9fa; font-weight: 700; }
.replay-host .replay-range-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.replay-host .replay-range-caption { grid-column: 1 / -1; margin: 2px 0 0; color: var(--secondary); font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.replay-host .replay-presets { flex: 1; min-width: 0; }
.replay-host .replay-preset-label { display: flex; align-items: center; gap: 4px; color: var(--secondary); font-size: 10px; }
.replay-host select { width: 100%; min-width: 0; padding: 4px 22px 4px 6px; color: var(--ink); background-color: #fff; }
.replay-host .replay-range-actions { display: flex; align-items: center; flex: none; gap: 4px; }
.replay-host .replay-load { color: #fff; border-color: var(--violet); background: var(--violet); font-weight: 700; white-space: nowrap; }
.replay-host .replay-load:hover:not(:disabled) { color: #fff; background: #6541aa; border-color: #6541aa; }
.replay-host .replay-custom { order: 3; flex: 0 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-height: min(320px, 36dvh); padding: 9px 3px 3px; border-top: 1px solid #e6dfec; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.replay-host .replay-custom .report-filter-field { width: 100%; min-width: 0; margin: 0; }
.replay-host .replay-custom .report-filter-field:has(.report-datetime-panel:not(.d-none)) { grid-column: 1 / -1; }
.replay-host .replay-custom .report-filter-field > label { display: block; margin-bottom: 4px; color: var(--secondary); font-size: 10px; }
.replay-host .replay-custom .report-datetime-input { width: 100%; height: 36px; min-width: 0; padding: 6px 40px 6px 8px !important; border: 1px solid #e1d9ec; border-radius: 9px; color: var(--ink); background: #fff; font-size: 12px; }
.replay-host .replay-custom .report-datetime-toggle { width: 36px; height: 36px; padding: 6px; border: 0; background: transparent; border-radius: 0 9px 9px 0; }
.replay-host .replay-custom .report-datetime-panel { position: static; width: 100%; max-width: 100%; margin-top: 8px; padding: 8px; gap: 7px; border-color: #e1d9ec; border-radius: 11px; box-shadow: none; background: #fffefa; }
.replay-host .replay-custom .report-datetime-title { font-size: 12px; }
.replay-host .replay-custom .report-datetime-nav { width: 36px; height: 36px; padding: 0; border-radius: 9px; }
.replay-host .replay-custom .report-datetime-week,
.replay-host .replay-custom .report-datetime-grid { gap: 2px; }
.replay-host .replay-custom .report-datetime-week span { font-size: 10px; }
.replay-host .replay-custom .report-datetime-day { min-width: 0; min-height: 36px; padding: 4px 0; border: 0; border-radius: 7px; font-size: 11px; background: transparent; }
.replay-host .replay-custom .report-datetime-day.is-muted { color: #aaa1b4; }
.replay-host .replay-custom .report-datetime-day.is-selected { color: #fff; background: var(--violet); }
.replay-host .replay-custom .report-datetime-time { padding-top: 7px; border-color: #e6dfec; }
.replay-host .replay-custom .report-datetime-time label { color: var(--secondary); font-size: 10px; }
.replay-host .replay-custom .report-datetime-time-inputs { gap: 5px; }
.replay-host .replay-custom .report-datetime-time-inputs input { width: 54px; height: 36px; min-width: 0; border-color: #e1d9ec; font-size: 13px; }
.replay-host .replay-custom .report-datetime-time-inputs select { width: 76px; min-width: 0; min-height: 36px; padding: 6px; font-size: 12px; }
.replay-host .replay-custom .report-datetime-actions .btn { min-height: 36px; font-size: 11px; }
.replay-host .replay-custom .report-datetime-actions .btn-primary { color: #fff; border-color: var(--violet); background: var(--violet); }

.replay-host .replay-footer { left: 50%; bottom: var(--replay-footer-bottom); transform: translateX(-50%); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 6px; width: min(600px, calc(100% - 24px)); max-height: min(170px, 40%, calc(50% - 26px - var(--replay-footer-bottom))); padding: 3px 4px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.replay-host .replay-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); align-items: center; gap: 6px; min-width: 0; }
.replay-host .replay-metric { min-width: 0; }
.replay-host .replay-metric > span,
.replay-host .replay-metric > small,
.replay-host .replay-clock > span,
.replay-host .replay-clock > small { display: block; color: var(--secondary); font-size: 10px; line-height: 1.4; }
.replay-host .replay-metric > strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.025em; overflow-wrap: anywhere; }
.replay-host .replay-metric > strong > small { font-size: 10px; font-weight: 500; letter-spacing: 0; }
.replay-host .replay-clock { min-width: 0; text-align: right; }
.replay-host .replay-clock > strong,
.replay-host .replay-clock > time { display: block; color: var(--ink); font-size: 11px; line-height: 1.5; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.replay-host .replay-timeline { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--secondary); font-size: 10px; }
.replay-host .replay-timeline input { flex: 1; min-width: 0; width: 100%; height: 26px; margin: 0; padding: 0; border: 0; accent-color: var(--violet); background: transparent; cursor: pointer; touch-action: pan-x; }
.replay-host .replay-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 4px; min-width: 0; }
.replay-host .replay-actions button { min-width: 30px; min-height: 30px; padding: 4px; font-size: 10px; }
.replay-host .replay-actions button[data-replay-action="play"] { color: #fff; border-color: var(--violet); background: var(--violet); }
.replay-host .replay-actions button[aria-pressed="true"]:not([data-replay-action="play"]) { color: var(--violet); border-color: #c5afe7; background: #eee5fa; }
.replay-host .replay-actions select { width: auto; min-width: 58px; max-width: 84px; padding: 4px 20px 4px 5px; font-size: 11px; }
.replay-host .replay-speed-label { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--secondary); font-size: 10px; }
.replay-host #replay-info { grid-column: 1 / -1; margin: 0; color: var(--secondary); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.replay-host #replay-info:empty { display: none; }
.replay-host #replay-info.replay-error { color: #a33c4f; }
body.replay-active .map-panel:has(.replay-custom:not([hidden])) .map-top-controls,
body.replay-active .map-panel:has(.replay-custom:not([hidden])) .map-controls,
body.replay-active .map-panel:has(.replay-custom:not([hidden])) .map-notice { visibility: hidden; pointer-events: none; }

/* Phones keep the map full height; Fleet list opens the existing card panel. */
@media (max-width: 760px), (max-width: 1024px) and (max-height: 500px) {
  body.replay-active .fleet-workspace { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 1fr) !important; gap: 0; }
  body.replay-active .fleet-workspace .map-panel { display: block !important; grid-column: 1; grid-row: 1; min-height: 0; height: 100%; }
  body.replay-active .fleet-workspace .vehicles-panel[data-drawer] { display: none !important; position: absolute; inset: 6px auto 6px 6px; grid-column: 1; grid-row: 1; z-index: 1000; width: min(420px, calc(100% - 12px)); height: calc(100% - 12px); min-width: 0; min-height: 0; margin: 0; border: 1px solid #e0d9e8; border-radius: 12px; background: var(--surface-soft); box-shadow: 0 8px 30px #30254330; overflow: hidden; }
  body.replay-active.replay-fleet-open .fleet-workspace .vehicles-panel[data-drawer] { display: flex !important; }
  body.replay-active .vehicles-panel #drawer-list-panel { display: flex !important; min-width: 0; min-height: 0; height: 100%; }
  body.replay-active .vehicles-panel .sheet-handle,
  body.replay-active .vehicles-panel .fleet-list-minimize,
  body.replay-active .vehicles-panel #drawer-detail-panel { display: none !important; }
  body.replay-active .vehicles-panel .fleet-list-heading { display: flex; position: relative; inset: auto; align-items: center; justify-content: space-between; flex: none; gap: 8px; min-height: 0; padding: 5px 8px; border-bottom: 1px solid #e8e4dd; background: linear-gradient(110deg, #f6f2fa, #faf9f5); }
  body.replay-active .vehicles-panel .fleet-list-close { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
  body.replay-active .vehicles-panel .vehicle-list-toolbar { flex: none; min-width: 0; }
  body.replay-active .vehicles-panel .vehicles-heading { display: none; }
  body.replay-active .vehicles-panel .vehicle-search-tools { margin: 6px 8px; }
  body.replay-active .vehicles-panel .vehicle-search-tools .search-field { height: 34px; min-height: 34px; }
  body.replay-active .vehicles-panel .vehicle-list { flex: 1; min-height: 0; max-height: none; padding: 0 8px 6px; overflow-y: auto; overscroll-behavior: contain; }
}


/* The desktop view keeps its full toolbar; compact controls follow map size. */
.replay-host .replay-more,
.replay-host .replay-fleet,
.replay-host .replay-exit-close,
.replay-host .replay-clock-compact,
.replay-host .replay-metric > .replay-metric-label-compact { display: none; }
@container replay-map (min-width: 860px) {
  .replay-host .replay-toolbar { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(250px, 1.25fr); align-items: start; gap: 2px 4px; }
  .replay-host .replay-range-form { margin-top: 0; }
}
@container replay-map (max-width: 760px) or (max-height: 420px) {
  .replay-host .replay-toolbar { top: 6px; left: 50%; right: auto; transform: translateX(-50%); width: min(420px, calc(100% - 12px)); display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 2px 4px; padding: 3px 4px; max-height: calc(100% - var(--replay-footer-height, 66px) - var(--replay-footer-bottom) - 18px); border-radius: 9px; }
  .replay-host .replay-heading { display: contents; }
  .replay-host .replay-exit { position: sticky; top: 0; z-index: 3; grid-column: 1; grid-row: 1; width: 30px; min-width: 30px; padding: 0; }
  .replay-host .replay-range-form { grid-column: 2; grid-row: 1; margin: 0; gap: 4px; }
  .replay-host .replay-preset-label { gap: 0; font-size: 0; }
  .replay-host .replay-range-actions { gap: 4px; }
  .replay-host .replay-load,
  .replay-host .replay-edit-dates { width: 30px; min-width: 30px; padding: 0; }
  .replay-host .replay-heading-copy,
  .replay-host .replay-range-caption,
  .replay-host .replay-exit > span:not(.icon):not(.replay-exit-back):not(.replay-exit-close),
  .replay-host .replay-load > span:not(.icon),
  .replay-host .replay-edit-dates > span:not(.icon),
  .replay-host .replay-timeline > span,
  .replay-host .replay-metric > .replay-metric-label,
  .replay-host .replay-clock > span,
  .replay-host .replay-clock > #replay-time,
  .replay-host .replay-actions button[data-replay-action="play"] > span:not(.icon),
  .replay-host .replay-more > span:not(.icon) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .replay-host .replay-custom { max-height: min(240px, 45cqh); grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 6px; }
  .replay-host .replay-toolbar:has(.replay-custom:not([hidden])) { grid-template-columns: 30px minmax(0, 1fr) 30px; }
  .replay-host .replay-toolbar:has(.replay-custom:not([hidden])) .replay-range-form { display: contents; }
  .replay-host .replay-toolbar:has(.replay-custom:not([hidden])) .replay-presets { grid-column: 2; grid-row: 1; }
  .replay-host .replay-toolbar:has(.replay-custom:not([hidden])) .replay-range-actions { grid-column: 3; grid-row: 1; }
  .replay-host .replay-custom:not([hidden]) { grid-column: 1 / -1; grid-row: 2; }

  .replay-host .replay-footer { display: grid; grid-template-columns: 30px minmax(0, 1fr) 58px 30px; align-items: center; gap: 2px 4px; width: min(460px, calc(100% - 12px)); max-height: none; padding: 3px 4px; overflow: visible; border-radius: 9px; }
  .replay-host .replay-metrics { grid-column: 1 / -1; grid-row: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 4px; }
  .replay-host .replay-metric { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }
  .replay-host .replay-metric > .replay-metric-label-compact { display: inline; color: var(--secondary); font-size: 10px; line-height: 1.3; }
  .replay-host .replay-metric > strong { font-size: 13px; line-height: 1.3; white-space: nowrap; }
  .replay-host .replay-metric > strong > small { font-size: 10px; }
  .replay-host .replay-clock-compact { display: grid; justify-content: end; gap: 0; font-size: 10px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .replay-host #replay-date-compact { color: var(--secondary); }
  .replay-host #replay-time-compact { color: var(--ink); font-size: 11px; font-weight: 650; }
  .replay-host .replay-actions { display: contents; }
  .replay-host .replay-actions button[data-replay-action="play"] { grid-column: 1; grid-row: 2; width: 30px; min-width: 30px; padding: 0; }
  .replay-host .replay-timeline { grid-column: 2; grid-row: 2; display: flex; min-width: 0; gap: 0; }
  .replay-host .replay-timeline input { height: 26px; }
  .replay-host .replay-speed-label { grid-column: 3; grid-row: 2; display: block; min-width: 0; gap: 0; font-size: 0; }
  .replay-host .replay-actions select { width: 58px; min-width: 58px; max-width: 58px; padding: 4px 17px 4px 4px; }
  .replay-host .replay-more { grid-column: 4; grid-row: 2; display: inline-flex; width: 30px; min-width: 30px; padding: 0; }
  .replay-host .replay-actions button:is([data-replay-action="reset"], [data-replay-action="fit"], [data-replay-action="follow"]) { display: none; grid-column: 1 / -1; grid-row: 3; width: calc((100% - 8px) / 3); padding: 4px; font-size: 10px; }
  .replay-host.replay-tools-open .replay-actions button:is([data-replay-action="reset"], [data-replay-action="fit"], [data-replay-action="follow"]) { display: inline-flex; }
  .replay-host .replay-actions button[data-replay-action="reset"] { justify-self: start; }
  .replay-host .replay-actions button[data-replay-action="fit"] { justify-self: center; }
  .replay-host .replay-actions button[data-replay-action="follow"] { justify-self: end; }
  .replay-host #replay-info { display: none; grid-column: 1 / -1; margin: 0; font-size: 10px; line-height: 1.4; }
  .replay-host.replay-tools-open #replay-info,
  .replay-host:not([data-state="ready"]) #replay-info,
  .replay-host #replay-info.replay-gap { display: block; }
  .replay-host #replay-info:empty { display: none; }

  body.replay-active .map-top-controls,
  body.replay-active .map-controls { visibility: hidden; pointer-events: none; }
  body.replay-active .map-top-controls { top: auto; right: max(6px, calc((100% - 460px) / 2)); left: auto; bottom: calc(var(--replay-footer-bottom) + var(--replay-footer-height, 104px) + 4px); width: auto; max-width: calc(100% - 82px); }
  body.replay-active .map-controls { top: auto !important; left: max(6px, calc((100% - 460px) / 2)); right: auto; bottom: calc(var(--replay-footer-bottom) + var(--replay-footer-height, 104px) + 4px); }
  body.replay-active .map-controls,
  body.replay-active .map-controls .map-zoom { flex-direction: row !important; }
  body.replay-active .map-panel:has(.replay-tools-open) .map-top-controls,
  body.replay-active .map-panel:has(.replay-tools-open) .map-controls { visibility: visible; pointer-events: auto; }
  body.replay-active .map-notice { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(var(--replay-footer-bottom) + var(--replay-footer-height, 66px) + 4px); width: min(460px, calc(100% - 12px)); max-width: calc(100% - 12px); max-height: max(38px, min(90px, calc(100% - var(--replay-footer-bottom) - var(--replay-footer-height, 66px) - var(--replay-toolbar-height, 38px) - 18px))); align-items: flex-start; gap: 4px; padding: 3px 4px; }
  body.replay-active .map-notice button { position: sticky; top: 0; align-self: flex-start; background: #fff9ed; }
  body.replay-active .map-panel:has(.replay-tools-open) .map-notice { bottom: calc(var(--replay-footer-bottom) + var(--replay-footer-height, 104px) + 46px); max-height: max(38px, min(90px, calc(100% - var(--replay-footer-bottom) - var(--replay-footer-height, 104px) - var(--replay-toolbar-height, 38px) - 58px))); }
  body.replay-active .google-map-credit { font-size: 12px; }
  body.replay-active .map-panel:has(.replay-custom:not([hidden])) .map-top-controls,
  body.replay-active .map-panel:has(.replay-custom:not([hidden])) .map-controls { visibility: hidden; pointer-events: none; }
}
@container replay-map (min-width: 480px) {
  .replay-host .replay-clock-compact { grid-auto-flow: column; align-items: baseline; gap: 4px; }
}
@container replay-map (max-height: 300px) {
  .replay-host.replay-tools-open .replay-toolbar,
  body.replay-active .map-panel:has(.replay-tools-open) .map-notice { visibility: hidden; pointer-events: none; }
  .replay-host.replay-tools-open .replay-footer { gap: 2px 4px; padding-top: 3px; padding-bottom: 3px; }
}
@media (max-width: 760px), (max-width: 1024px) and (max-height: 500px) {
  .replay-host select { font-size: 11px !important; }
  .replay-host .replay-custom .report-datetime-input,
  .replay-host .replay-custom .report-datetime-time-inputs input { font-size: 12px !important; }
  .replay-host .replay-toolbar { grid-template-columns: auto minmax(0, 1fr) 30px; }
  .replay-host .replay-fleet { display: inline-flex; grid-column: 1; grid-row: 1; min-width: 30px; padding: 4px; color: var(--violet); background: #f0e9fa; border-color: transparent; white-space: nowrap; }
  .replay-host .replay-range-form { grid-column: 2; }
  .replay-host .replay-exit { grid-column: 3; }
  .replay-host .replay-exit-back { display: none; }
  .replay-host .replay-exit-close { display: inline-flex; }
  .replay-host .replay-toolbar:has(.replay-edit-dates:not([hidden])) { grid-template-columns: 30px minmax(0, 1fr) 30px; }
  .replay-host .replay-toolbar:has(.replay-edit-dates:not([hidden])) .replay-fleet > span:not(.icon) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .replay-host .replay-toolbar:has(.replay-custom:not([hidden])) { grid-template-columns: auto minmax(0, 1fr) 30px 30px; }
  .replay-host .replay-toolbar:has(.replay-custom:not([hidden])) .replay-exit { grid-column: 4; }
}
@media (prefers-reduced-motion: reduce) {
  .replay-host *, body.replay-active .replay-vehicle-marker .map-vehicle-bearing { transition: none !important; scroll-behavior: auto; }
}
