/* Mountain Driving only: transparent upper-left route instruments. Taxi and
   parking keep their own placement, map surfaces and controls. */
.road-mode .road-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.road-mode #parking-app{--hud-inset:max(12px,env(safe-area-inset-left));--hud-top:max(68px,calc(env(safe-area-inset-top) + 60px))}
.road-mode .park-topbar{top:env(safe-area-inset-top,0px);height:60px;padding:8px max(12px,env(safe-area-inset-right)) 8px var(--hud-inset);gap:10px}
.road-mode #parking-app:not([data-state=menu]) .park-wordmark,.road-mode #parking-app:not([data-state=menu]) .park-brand small{display:none}
.road-mode .park-menu{top:calc(60px + env(safe-area-inset-top,0px))}
.road-mode .top-actions{gap:4px;align-items:center}
.road-mode .top-actions button,.road-mode .road-music-controls summary{min-height:44px;height:44px;padding:8px;font-size:12px}
.road-mode .road-icon-button,.road-mode .camera-tools>summary{width:44px;min-width:44px;height:44px;min-height:44px;padding:10px;display:grid;place-items:center;line-height:1}
.road-mode .road-icon-button svg,.road-mode .camera-tools>summary svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.road-mode .camera-tools{position:relative;top:auto;right:auto;bottom:auto;left:auto;display:block;z-index:15;flex:none}
.road-mode .camera-tools>summary{list-style:none;border:1px solid var(--line);border-radius:7px;background:#1b303ae8;cursor:pointer;touch-action:manipulation}
.road-mode .camera-tools>summary::-webkit-details-marker{display:none}
.road-mode .camera-tools>summary:focus-visible{outline:3px solid var(--yellow);outline-offset:3px}
.road-mode .camera-options{position:absolute;right:0;top:calc(100% + 8px);display:grid;grid-template-columns:repeat(2,44px);gap:6px;padding:8px;border:1px solid var(--line);border-radius:9px;background:#142a33f7;box-shadow:0 5px 20px #0005}
/* Only the upper toolbar and camera icon strip: no backing panel, even on
   hover/press. Expanded music settings retain their readable explanations. */
.road-mode .park-topbar,.road-mode .top-actions,.road-mode .camera-options{background:transparent;border:0;box-shadow:none;backdrop-filter:none}
.road-mode .top-actions>.road-icon-button,.road-mode .top-actions details>summary,.road-mode .camera-options>.road-icon-button{width:44px;min-width:44px;height:44px;min-height:44px;box-sizing:border-box;padding:10px;display:grid;place-items:center;background:transparent;border:0;box-shadow:none;border-radius:0;color:var(--ink);flex:none}
.road-mode .top-actions>.road-icon-button:hover,.road-mode .top-actions>.road-icon-button:active,.road-mode .top-actions details>summary:hover,.road-mode .top-actions details>summary:active,.road-mode .camera-options>.road-icon-button:hover,.road-mode .camera-options>.road-icon-button:active{background:transparent;border:0;box-shadow:none}
.road-mode .top-actions>.road-icon-button:focus-visible,.road-mode .top-actions details>summary:focus-visible,.road-mode .camera-options>.road-icon-button:focus-visible{outline:2px solid var(--yellow);outline-offset:0}
.road-mode .top-actions .road-icon-button svg,.road-mode .camera-tools>summary svg{filter:drop-shadow(0 1px 2px #0009)}
.road-mode .top-actions .icon-off{display:none}
.road-mode #park-sound[aria-pressed=true] .icon-off,.road-mode #drive-music-summary[data-enabled=false] .icon-off{display:block}
.road-mode #park-sound[aria-pressed=true] .sound-waves{display:none}
.road-mode .park-hud{top:var(--hud-top);left:var(--hud-inset);right:max(12px,env(safe-area-inset-right));display:block;text-shadow:0 1px 3px #000,0 0 9px #000c}
.road-mode .road-route-hud{width:clamp(154px,42vw,220px);pointer-events:auto;background:linear-gradient(110deg,#081b2473,transparent 95%);border-radius:5px}
.road-mode .mission-hud{display:block;max-width:none;padding:0 4px}
.road-mode .mission-hud strong{display:block;max-width:none;font-size:16px;line-height:1.4;overflow-wrap:anywhere}
.road-mode .score-hud{display:block;text-align:left;padding:3px 4px 0;font-size:12px}
.road-mode .road-total{display:flex;align-items:baseline;justify-content:space-between;gap:6px}
.road-mode .road-total>span{font-size:12px;color:#e3ece6;white-space:nowrap}
.road-mode .road-total strong{font-size:26px;line-height:1.2;letter-spacing:-.6px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.road-mode .road-time-breakdown{display:flex;flex-wrap:wrap;column-gap:12px;row-gap:0;color:#e2e8e1;font-size:12px;line-height:1.5}
.road-mode .road-time-breakdown span{white-space:nowrap}.road-mode .road-time-breakdown b{font-weight:500;font-variant-numeric:tabular-nums}
.road-mode #drive-penalty{color:#ffe1a3}
.road-mode .driving-minimap[data-integrated=true]{position:relative;left:auto!important;top:auto!important;width:100%!important;min-width:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
.road-mode .driving-minimap[data-integrated=true] .minimap-header{height:44px;gap:0}
.road-mode .driving-minimap[data-integrated=true] button{font-size:12px;padding:0 6px;min-width:44px;text-shadow:0 1px 3px #000}
.road-mode .driving-minimap[data-integrated=true] .minimap-zoom{border-left:0}
.road-mode .driving-minimap[data-integrated=true] button:hover{background:#102b3466}
.road-mode .driving-minimap[data-integrated=true] .minimap-graph{background:transparent;box-shadow:none}
.road-mode .driving-minimap[data-integrated=true] svg{filter:drop-shadow(0 1px 2px #001116)}
.road-mode .driving-minimap[data-integrated=true] .minimap-road{stroke:#e3ecdc}.road-mode .driving-minimap[data-integrated=true] .minimap-road-edge{stroke:#06171ee6}
.road-mode .road-slip-warning{display:grid;place-items:center;width:36px;height:36px;color:#ffd05f;filter:drop-shadow(0 1px 2px #000);animation:road-slip-pulse 1.2s ease-in-out infinite}
.road-mode .road-slip-warning svg{height:30px;width:28px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@keyframes road-slip-pulse{0%,100%{opacity:1}50%{opacity:.28}}
@media(prefers-reduced-motion:reduce){.road-mode .road-slip-warning{animation:none;opacity:1}}
@media(max-width:650px){.road-mode .park-brand{font-size:29px}.road-mode .park-topbar{gap:6px}.road-mode .park-notice{bottom:140px;font-size:12px}}
@media(max-height:560px){.road-mode #parking-app{--hud-top:max(60px,calc(env(safe-area-inset-top) + 54px))}.road-mode .park-menu{top:calc(52px + env(safe-area-inset-top,0px))}.road-mode .park-topbar{height:52px;padding-top:4px;padding-bottom:4px}.road-mode .road-route-hud{width:clamp(154px,28vw,210px)}.road-mode .mission-hud strong{font-size:14px}.road-mode .road-total strong{font-size:24px}.road-mode .road-time-breakdown{column-gap:8px}.road-mode .park-notice{bottom:116px;max-width:calc(100vw - 24px)}}
@media(max-height:560px) and (orientation:landscape){.road-mode .park-notice{left:50%;bottom:108px;max-width:360px}}

.road-mode .driving-minimap[data-integrated=true] .minimap-north,.road-mode .driving-minimap[data-integrated=true] .minimap-scale{font-size:10px}

/* On narrow screens the camera popover gets its own temporary band. Keep the
   route HUD below the 62px strip plus an 8px gap; the dial stays bottom-anchored. */
@media(max-width:650px){
 .road-mode .camera-options{position:fixed;left:var(--hud-inset);right:auto;top:var(--hud-top);grid-template-columns:repeat(4,44px)}
 .road-mode #parking-app:has(#park-camera-tools[open]) .park-hud{top:calc(var(--hud-top) + 70px)}
}

/* The Driving dial lives above the full-sized pedals, independently of the
   route/map height or temporary camera-menu band. Reserve the tallest pedal
   plus 12px; safe-bottom is counted exactly once, as in attribution CSS. */
.road-mode #parking-app{--gauge-size:148px;--gauge-right:max(22px,env(safe-area-inset-right));--gauge-bottom:calc(160px + env(safe-area-inset-bottom,0px))}
.road-mode .drive-hud.road-gauge{position:fixed;top:auto;right:var(--gauge-right);bottom:var(--gauge-bottom);width:var(--gauge-size);height:var(--gauge-size)}
.road-mode .road-slip-warning{position:fixed;top:auto;right:calc(var(--gauge-right) + (var(--gauge-size) - 36px)/2);bottom:calc(var(--gauge-bottom) + var(--gauge-size) + 6px)}
@media(max-width:650px){
 .road-mode #parking-app{--gauge-size:120px;--gauge-right:max(12px,env(safe-area-inset-right));--gauge-bottom:calc(132px + env(safe-area-inset-bottom,0px))}
 .road-mode .road-route-hud{max-width:calc(100vw - var(--hud-inset) - var(--gauge-right) - var(--gauge-size) - 8px)}
 /* Short portrait cannot fit the expanded music panel above the dial in full.
    Scroll only that popover; keep all buttons and the volume slider full-sized. */
 .road-mode .road-music-panel{position:fixed;top:var(--hud-top);right:var(--gauge-right);max-height:calc(100dvh - var(--gauge-bottom) - var(--gauge-size) - 48px - var(--hud-top));overflow:auto;overscroll-behavior:contain}
}
@media(max-height:560px) and (orientation:landscape){
 .road-mode #parking-app{--gauge-size:104px;--gauge-right:max(15px,env(safe-area-inset-right));--gauge-bottom:calc(136px + env(safe-area-inset-bottom,0px))}
 /* Reserve a 56px wrapped notice plus 8px clearance above its dial anchor.
    The panel scrolls independently so the slider and status remain reachable. */
 .road-mode .road-music-panel{position:fixed;top:var(--hud-top);right:calc(var(--gauge-right) + var(--gauge-size) + 12px);max-height:calc(100dvh - var(--hud-top) - var(--gauge-bottom) - 64px);overflow:auto;overscroll-behavior:contain}
}
@media(max-height:500px) and (orientation:landscape){.road-mode #parking-app{--gauge-bottom:calc(122px + env(safe-area-inset-bottom,0px))}}

/* Transient route/collision notices wrap beside the dial, above the pedals.
   Use the same safe-area anchor so neither text nor its box covers the face. */
.road-mode .park-notice{left:auto;right:calc(var(--gauge-right) + var(--gauge-size) + 12px);bottom:var(--gauge-bottom);transform:none;min-width:0;width:min(360px,calc(100vw - var(--hud-inset) - var(--gauge-right) - var(--gauge-size) - 12px));max-width:none;overflow-wrap:anywhere}

/* Explicit ?drivingTiming=1 diagnostic only; same-origin CSP-compatible styling. */
.driving-startup-timing{position:fixed;right:8px;bottom:8px;z-index:10000;max-width:min(460px,95vw);padding:12px;background:#10202c;color:#fff;border:1px solid #92c6b1;font:13px system-ui}
.driving-startup-timing .driving-startup-timing-output{display:block;width:min(420px,82vw);height:180px}
