/* Familiar, readable map chrome; OpenStreetMap attribution stays visible. */
.st-map-v28 { background: #e9eef2; font-family: inherit; }
.st-map-v28 .leaflet-control-zoom { border: 0; border-radius: 14px; box-shadow: 0 3px 15px #152b4933; overflow: hidden; margin: 0 16px 34px 0; }
.st-map-v28 .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; color: #23334c; font-weight: 400; }
.st-map-v28 .leaflet-control-zoom a:hover { background: #f1f6ff; }
.st-map-v28 .leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: 0 5px 28px #132a4630; }
.st-map-v28 .leaflet-control-attribution { background: #ffffffdc; font-size: 10px; padding: 2px 7px; border-radius: 5px 0 0 0; }
.st-map-v28 .leaflet-control-scale-line { border-color: #263c57; color: #263c57; background: #ffffffc9; }
.st-map-toolbar { display: flex; align-items: center; gap: 8px; margin: 3px 3px 0 0; }
.st-map-toolbar button, .st-map-toolbar a { min-height: 44px; border: 0; border-radius: 12px; box-shadow: 0 3px 14px #17334e30; background: #fff; color: #26334a; cursor: pointer; text-decoration: none; font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; }
.st-map-toolbar button:focus-visible, .st-map-toolbar a:focus-visible { outline: 3px solid #2166da; outline-offset: 3px; }
.st-map-toolbar .st-map-navigation { display: flex; align-items: center; gap: 7px; padding: 0 14px; color: #1d5fcc; }
.st-map-navigation .icon { width: 19px; height: 19px; }
.st-map-fullscreen-button { width: 44px; display: grid; place-items: center; }
.st-map-fullscreen-button span { font-size: 28px; line-height: 1; }
.st-map-fullscreen-button[aria-pressed="true"] { color: #fff; background: #2465cf; }
.st-map-v28.st-map-fullscreen { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100dvh !important; min-height: 100vh; z-index: 12000 !important; border-radius: 0 !important; margin: 0 !important; }
body.st-map-expanded { overflow: hidden; }
.st-map-fullscreen .st-map-toolbar { margin-top: max(6px, env(safe-area-inset-top)); margin-right: max(6px, env(safe-area-inset-right)); }
.st-map-fullscreen .leaflet-control-zoom { margin-bottom: max(34px, env(safe-area-inset-bottom)); }
.st-map-v28 .leaflet-top.leaflet-left { top: 62px; }
.osm-route-map-shell:has(.st-map-v28) .gps-map-status { top: 70px; right: 14px; max-width: min(260px, calc(50% - 20px)); }
.osm-route-map-shell:has(.st-map-v28) .ride-map-status { top: 70px; left: 14px; max-width: min(260px, calc(50% - 20px)); }
.osm-route-map-shell:has(.st-map-v28) .idle-map-status { top: 70px; width: min(440px, calc(100% - 32px)); }
.osm-map-legend .st-line-normal, .osm-map-legend .st-line-fast, .osm-map-legend .st-line-unknown { width: 22px; height: 4px; border-radius: 4px; background: #18854b; display: inline-block; }
.osm-map-legend .st-line-fast { background: #db303f; }
.osm-map-legend .st-line-unknown { background: #7c8795; }
.history-stop-node { cursor: pointer; }
/* History-only stop symbols override the older circular playback markers. */
.history-map .history-stop-node.history-stop-symbol { display: grid; place-items: center; width: 44px !important; height: 48px !important; border: 0 !important; border-radius: 0 !important; padding: 0; background: transparent !important; box-shadow: none; filter: drop-shadow(0 2px 3px #14233955); }
.history-map .history-stop-symbol::before, .history-map .history-stop-symbol::after { display: none !important; }
.history-map .history-home-symbol { position: relative; display: grid; place-items: center; box-sizing: border-box; width: 40px; height: 40px; margin: 4px 2px; border: 3px solid #fff; border-radius: 10px; background: #15936f; color: #fff !important; box-shadow: 0 3px 8px #102b2455; }
.history-map .history-home-glyph { display: grid; place-items: center; color: #fff !important; }
.history-map .history-home-glyph .icon { width: 25px; height: 25px; color: #fff !important; stroke-width: 2.1; }
.history-map .history-home-symbol .history-home-number { position: absolute; top: -9px; right: -9px; display: grid; place-items: center; box-sizing: border-box; min-width: 23px; height: 23px; padding: 0 4px; border: 2px solid #15936f; border-radius: 999px; background: #fff; color: #087052 !important; font: 800 12px/1 Arial, sans-serif; direction: ltr; box-shadow: 0 2px 5px #102b2440; }
.history-map .history-stop-symbol .history-school-symbol { display: grid; place-items: center; box-sizing: border-box; width: 40px; height: 40px; margin: 4px 0; border: 3px solid #fff; border-radius: 10px; background: #142339; color: #fff !important; }
.history-map .history-school-symbol .icon { width: 27px; height: 27px; color: #fff; stroke-width: 1.8; }
/* Recorded speed stays inside the history viewport, including fullscreen. */
.st-map-v28.history-map .leaflet-top.leaflet-left { top: 0; left: 0; right: auto; }
.history-map .history-recorded-speed { box-sizing: border-box; width: 112px; margin: 10px 0 0 10px; padding: 7px 9px; border: 1px solid #40536d; border-radius: 12px; background: #142339; color: #f1f5f9; box-shadow: 0 3px 14px #17334e30; pointer-events: none; }
.history-recorded-speed-label { display: block; font-size: 10px; font-weight: 600; line-height: 1.4; }
.history-recorded-speed-reading { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.history-recorded-speed-reading strong { font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 750; line-height: 1.25; color: #fff; }
.history-recorded-speed-unit { font-size: 10px; color: #cbd5e1; }
.history-map.st-map-fullscreen .history-recorded-speed { margin-top: max(10px, env(safe-area-inset-top)); margin-left: max(10px, env(safe-area-inset-left)); }
.st-distance-summary { padding: 16px 0; margin: 14px 0; border-top: 1px solid #e4eaf0; border-bottom: 1px solid #e4eaf0; }
.st-distance-summary label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.st-distance-summary select, .st-zone-filters select { border: 1px solid #d7e0e9; background: #fff; color: #26334a; border-radius: 10px; min-height: 42px; padding: 8px 12px; font: inherit; width: 100%; }
.st-distance-value { display: flex; flex-direction: column; gap: 5px; margin-top: 14px; }
.st-distance-value strong { font-size: 20px; }
.st-distance-value small { color: #66758a; font-size: 11px; line-height: 1.5; }
.st-zone-filters { display: grid; grid-template-columns: minmax(190px, 2fr) minmax(130px, 1fr) minmax(130px, 1fr) auto; gap: 12px; margin-bottom: 18px; }
.st-zone-filters .input-wrap { min-width: 0; }
.st-zone-filters input { min-width: 0; width: 100%; }
.st-zone-map-card { margin-bottom: 18px; }
.st-zone-pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 20px 0; font-size: 12px; color: #64758a; }
[dir="rtl"] .st-map-toolbar { direction: rtl; }
@media (max-width: 760px) {
  .st-zone-filters { grid-template-columns: 1fr 1fr; }
  .st-zone-filters .input-wrap { grid-column: 1 / -1; }
  .st-map-toolbar .st-map-navigation { padding: 0 10px; font-size: 11px; max-width: 200px; }
  .st-map-v28 .leaflet-control-zoom { margin-right: 10px; }
}
@media (max-width: 420px) {
  .st-zone-filters { grid-template-columns: 1fr; }
  .st-map-toolbar .st-map-navigation { max-width: 165px; }
}

/* Parent live maps: a clear top row with status left and navigation right. */
.st-parent-live-map .schooltrack-compass { display: none; }
/* Quiet page refresh may retain the map and recreate its original status sibling. */
.osm-route-map-shell:has(> .st-parent-live-map) > .gps-map-status { display: none; }
.st-parent-live-map .leaflet-top.leaflet-left { top: 0; left: 0; right: auto; }
.st-parent-live-map .leaflet-top.leaflet-right { top: 0; right: 0; left: auto; }
.st-parent-live-map .st-map-toolbar { flex-direction: column; align-items: flex-end; gap: 8px; margin: 0; }
.st-parent-live-map .st-map-navigation { min-height: 44px; max-width: 138px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
.st-parent-live-map .st-parent-map-status { margin-top: 10px; margin-left: 10px; pointer-events: none; }
.osm-route-map-shell .st-parent-live-map .st-parent-map-status .gps-map-status { position: static; inset: auto; max-width: none; min-height: 44px; box-sizing: border-box; padding: 8px 10px; margin: 0; background: #142339; border: 1px solid #40536d; color: #f1f5f9; }
.st-parent-live-map .st-parent-map-status .gps-map-status strong { color: #f1f5f9; }
.st-parent-live-map.st-map-fullscreen .st-parent-map-status { margin-top: max(10px, env(safe-area-inset-top)); margin-left: max(10px, env(safe-area-inset-left)); }
.st-parent-live-map.st-map-fullscreen .st-map-toolbar { margin-top: max(0px, calc(env(safe-area-inset-top) - 10px)); margin-right: max(0px, calc(env(safe-area-inset-right) - 10px)); }

/* Driver route maps retain heading rotation with simpler, separated controls. */
.st-driver-live-map .schooltrack-compass { display: none; }
.osm-route-map-shell:has(> .st-driver-live-map) > .gps-map-status,
.driver-navigation:has(.st-driver-live-map) > .driver-navigation-heading > .badge,
.driver-navigation.is-driving:has(.st-driver-live-map) .nav-signal { display: none; }
.st-driver-live-map .leaflet-top.leaflet-left { top: 0; left: 0; right: auto; }
.st-driver-live-map .leaflet-top.leaflet-right { top: 0; right: 0; left: auto; }
.st-driver-live-map .st-map-toolbar { flex-direction: column; align-items: flex-end; gap: 8px; margin: 10px 10px 0 0; }
.st-driver-live-map .st-map-navigation { min-height: 44px; max-width: 138px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
.st-driver-live-map .st-driver-map-status { margin: 10px 0 0 10px; pointer-events: none; }
.osm-route-map-shell .st-driver-live-map .st-driver-map-status .gps-map-status { display: flex; position: static; inset: auto; max-width: none; min-height: 36px; box-sizing: border-box; padding: 8px 10px; margin: 0; background: #142339; border: 1px solid #40536d; color: #f1f5f9; }
.st-driver-live-map .st-driver-map-status .gps-map-status strong { color: #f1f5f9; }
/* The measured banner bottom keeps GPS clear of wrapped guidance in all locales. */
.driver-navigation.is-driving .st-driver-live-map:not(.st-map-fullscreen) .leaflet-top.leaflet-left { top: var(--driver-turn-bottom, 96px); }
.driver-navigation.is-driving .st-driver-live-map:not(.st-map-fullscreen) .st-driver-map-status { margin-top: 0; }
.driver-navigation .st-driver-live-map.st-map-fullscreen .leaflet-top.leaflet-left,
.driver-navigation .st-driver-live-map.st-map-fullscreen .leaflet-top.leaflet-right { top: 0; }
.driver-navigation .st-driver-live-map.st-map-fullscreen .st-map-toolbar { display: flex; }
.st-driver-live-map.st-map-fullscreen .st-driver-map-status { margin-top: max(10px, env(safe-area-inset-top)); margin-left: max(10px, env(safe-area-inset-left)); }
.st-driver-live-map.st-map-fullscreen .st-map-toolbar { margin-top: max(10px, env(safe-area-inset-top)); margin-right: max(10px, env(safe-area-inset-right)); }


