/* Final layout layer: shared control tokens, usable phone launcher, clear input modes. */
.ux-key,.ux-touch-key{display:inline-flex;justify-content:center;align-items:center;min-width:27px;min-height:27px;padding:3px 7px;border:1px solid #aabecb8c;border-radius:6px;background:#24343f;color:#f3f7fa;font:700 11px/1.2 system-ui;box-shadow:0 2px 0 #0006;white-space:nowrap;vertical-align:middle}.ux-touch-key{border-radius:9px;background:#204049;box-shadow:none;white-space:normal}.ux-binding{display:inline-flex;align-items:center;gap:7px;line-height:1.4}.ux-key-join{display:inline-block;margin:0 3px;color:#a9bdc9}.ux-binding .xbox-key{vertical-align:middle}kbd{letter-spacing:0;text-transform:none}
html[data-pad=playstation] .xbox-a{color:#a9caff;border-color:#8aaee2}html[data-pad=playstation] .xbox-b{color:#ffacb2;border-color:#e68b95}html[data-pad=playstation] .xbox-x{color:#edb3e8;border-color:#bd8cb8}html[data-pad=playstation] .xbox-y{color:#a1dfcc;border-color:#85bda9}
#controller-help{z-index:1050!important;padding:max(12px,env(safe-area-inset-top)) 16px max(12px,env(safe-area-inset-bottom));backdrop-filter:blur(16px)}#controller-help>div{width:min(850px,100%);max-width:850px;max-height:calc(100dvh - 32px);overflow:auto;padding:0;background:#101d2b;border:1px solid #a8c6d640;border-radius:20px;overscroll-behavior:contain}#controller-help>div>:not(#ux-controls){display:none!important}#ux-controls{padding:24px;color:#eaf3f7;font:14px/1.5 system-ui}.ux-help-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.ux-help-heading small{font-size:10px;letter-spacing:2px;color:#9ebcce}#controller-help h2{font:700 30px/1.1 system-ui;margin:6px 0 18px;letter-spacing:-.5px}#ux-controls button{min-height:44px;border:1px solid #829ba64d;border-radius:9px;background:#203442;color:#eaf5f5;padding:9px 14px;font:600 12px system-ui}#ux-controls button:focus-visible,#ux-controls .menu-pad-focus{outline:3px solid #b4e5d2;outline-offset:2px}#ux-help-close{font-size:24px!important;min-width:44px;align-self:flex-start}.ux-device-tabs{display:flex;gap:8px;margin:0 0 16px}.ux-device-tabs button{flex:1}.ux-device-tabs button[aria-selected=true],.ux-contexts button[aria-pressed=true]{color:#0b252b!important;background:#b6e5d4!important;border-color:#b6e5d4!important}.ux-contexts{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:18px}.ux-contexts button{min-height:40px!important;font-size:11px!important}#ux-control-rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.ux-control-row{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#192c3a;padding:12px;border-radius:10px;min-height:62px}.ux-control-row b{font-size:12px;font-weight:600}.ux-control-row small{display:block;color:#a6c1ce;font-size:10px}.ux-control-value{display:flex;align-items:center;justify-content:flex-end;gap:4px;text-align:right;max-width:55%;flex-wrap:wrap}.ux-route-label{font-size:11px;color:#c3e5df}#ux-help-note{font-size:12px;color:#b1c5cf;line-height:1.6;margin:18px 0}#ux-help-done{width:100%;background:#b6e5d4!important;color:#10272c!important}#ux-controls-open{min-width:44px;min-height:44px}
#duber-phone .home-hint,#duber-phone .phone-clock-note,#duber-phone .phone-status{display:none!important}#duber-phone[data-app=home] .duber-device{height:min(790px,calc(100dvh - 24px));max-height:calc(100dvh - 24px)}#duber-phone[data-app=home] .phone-home{display:flex!important;flex-direction:column;gap:12px;min-height:0;overflow:auto;padding:18px 22px 16px;flex:1;overscroll-behavior:contain}#duber-phone .phone-app-pages{flex:1;display:flex;align-items:center;min-height:0;overflow:visible;width:100%}#duber-phone .phone-app-pages .home-grid{width:100%;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(12px,2.8vh,26px) 12px;align-items:start}#duber-phone .home-app{min-width:0;min-height:96px;gap:8px;padding:4px 2px;border-radius:15px}#duber-phone .home-app .app-icon{width:clamp(64px,9.5vh,84px);height:clamp(64px,9.5vh,84px)}#duber-phone .home-app>span{font-size:12px;line-height:1.3;white-space:normal}#duber-phone .home-app:focus-visible,#duber-phone .home-app.menu-pad-focus{outline:3px solid #b8e8dc;outline-offset:2px;background:#8ad6d81a}#duber-phone .phone-page-nav{flex:none;gap:8px;margin:0;min-height:44px}#duber-phone .phone-page-nav button{min-width:44px;min-height:44px}#duber-phone .phone-overview{flex:none;margin:0;padding:8px 0;gap:5px}#duber-phone .phone-overview>*{min-height:48px}#duber-phone .phone-overview strong{font-size:18px}#duber-phone .phone-resume{flex:none;min-height:48px;margin:0;letter-spacing:.04em;background:#b7e0d2;color:#11252d}#duber-phone .duber-bar{flex:none}#duber-phone button:focus-visible{outline:3px solid #b7e0d2;outline-offset:2px}#duber-phone .phone-page-status{font-size:10px}
/* A paused phone never shares the screen with live driving overlays. */
html:has(#duber-phone:not([hidden])) :is(#police-hud,#sr-hud,#sr-invite,#retail-hud-2084,#xbox-guide,.keyboard){visibility:hidden!important}
html[data-input=keyboard] #xbox-guide,html[data-input=touch] #xbox-guide{display:none!important}html[data-input=controller] .keyboard,html[data-input=touch] .keyboard{display:none!important}.keyboard{display:flex!important;align-items:center;justify-content:center;flex-wrap:wrap;gap:9px 18px;bottom:10px!important;max-width:calc(100vw - 300px);width:max-content;padding:8px 12px;border:1px solid #7b9aa447;border-radius:10px;background:#101e2aeb;font:11px/1.2 system-ui;letter-spacing:0;color:#d9e7ed;white-space:normal;z-index:80;pointer-events:none}.keyboard .ux-key{min-height:24px;min-width:24px;font-size:10px}.is-driving[data-input=keyboard] #radio-mini.drive-radio{bottom:72px!important}.is-driving[data-input=keyboard] .speed{bottom:70px!important}.is-driving[data-input=controller] #radio-mini.drive-radio{bottom:calc(var(--guide-height,72px) + 12px)!important}
/* Explicit reset avoids inherited top + bottom constraints stretching the radio. */
html.is-driving #radio-mini.drive-radio{top:auto!important;height:50px!important;min-height:0!important;max-height:50px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;padding:5px 7px!important;align-content:center!important;overflow:hidden!important;width:min(410px,calc(100vw - 28px))!important}#radio-mini.drive-radio .drive-radio-controls{display:flex!important;gap:3px!important}#radio-mini.drive-radio .drive-radio-help,#radio-mini-state,#radio-mini-open>span>small,#radio-mini-open>b,#drive-radio-shuffle-state{display:none!important}#radio-mini-open{min-height:38px!important}#radio-mini.drive-radio .drive-radio-controls button{width:38px;min-height:38px;height:38px}#radio-mini-open strong{font-size:11px;line-height:1.3}#radio-mini-open img{display:none!important}
#quick-actions-open{display:inline-flex;align-items:center;gap:7px;justify-content:center;min-height:44px!important;min-width:44px}#quick-actions-open .ux-key,#quick-actions-open .xbox-key{height:24px;min-height:24px;font-size:10px}.qa-panel #qa-close{min-width:44px;min-height:44px}.qa-panel footer,#rl-hints,#sr-help{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;line-height:1.5}.qa-panel #qa-context .xbox-key{vertical-align:middle}.qa-panel button[aria-disabled=true]{opacity:.6}.qa-panel button small{font-size:11px!important}.qa-panel #qa-items{padding:3px}.qa-panel #qa-items button{scroll-margin:12px}#retail-2084 .rl-camera button,#retail-2084 [data-rl=close]{min-width:44px;min-height:44px}#retail-2084 #rl-tabs button{min-height:44px}#sr-close{min-width:44px;min-height:44px}#street-racing :focus-visible{outline:3px solid #d5c1ff;outline-offset:3px}
html[data-input=touch].is-driving .controls{display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}html[data-input=controller] .controls,html[data-input=keyboard] .controls{display:none!important}html[data-input=touch] #walk-hud.walk-touch #walk-stick{display:block!important}html[data-input=touch] #walk-help{display:none!important}
@media(max-width:760px){#ux-controls-open{display:none!important}#ux-controls{padding:16px}#ux-control-rows{grid-template-columns:1fr}.ux-device-tabs{gap:5px}.ux-device-tabs button{font-size:11px!important;padding:9px 5px!important}.ux-contexts{gap:5px}.ux-contexts button{padding:8px 10px!important}.keyboard{max-width:calc(100vw - 24px);bottom:10px!important}.keyboard .ux-binding{gap:4px;font-size:10px}.is-driving[data-input=keyboard] #radio-mini.drive-radio{bottom:99px!important}.is-driving[data-input=touch] #radio-mini.drive-radio{bottom:max(184px,calc(env(safe-area-inset-bottom) + 176px))!important;left:50%!important;transform:translateX(-50%)!important}.is-driving[data-input=touch] #quick-actions-open{bottom:max(244px,calc(env(safe-area-inset-bottom) + 236px))!important;right:14px!important}.is-driving[data-input=touch] .controls{bottom:max(12px,env(safe-area-inset-bottom))!important;left:14px!important;right:14px!important}.is-driving[data-input=touch] .wheel-area,.is-driving[data-input=touch] #wheel{width:132px!important}.is-driving[data-input=touch] #wheel{height:132px!important}.is-driving[data-input=touch] #quick-actions-2084{padding:12px 12px 242px}.is-driving[data-input=touch] .qa-panel{width:min(440px,100%);max-height:calc(100dvh - 362px)}#quick-actions-2084[data-page=main] .qa-orbit{height:auto!important}#quick-actions-2084[data-page=main] #qa-items{display:grid!important;grid-template-columns:1fr 1fr}#quick-actions-2084[data-page=main] #qa-items button{position:static!important;width:auto!important;height:auto!important;min-height:60px;padding:10px!important;text-align:left!important}#quick-actions-2084[data-page=main] #qa-center{display:none!important}#qa-help .ux-binding{font-size:10px}.qa-panel footer .xbox-key{height:22px;min-width:22px;font-size:10px}.qa-panel footer .xbox-key svg{width:20px;height:20px}}
@media(max-width:600px){#duber-phone[data-app] {padding:max(6px,env(safe-area-inset-top)) 6px max(6px,env(safe-area-inset-bottom))}#duber-phone[data-app=home] .duber-device{height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);width:100%;border-radius:24px}#duber-phone[data-app=home] .phone-home{padding:14px 16px;gap:10px}#duber-phone .phone-app-pages .home-grid{gap:clamp(12px,3vh,26px) 8px}#duber-phone .home-app .app-icon{width:clamp(64px,19vw,82px);height:clamp(64px,19vw,82px)}#duber-phone .phone-page-status{display:none}}
@media(max-height:540px) and (min-width:600px){#duber-phone[data-app=home] .duber-device{height:calc(100dvh - 16px);width:min(820px,calc(100vw - 24px))}#duber-phone[data-app=home] .phone-home{display:grid!important;grid-template-columns:minmax(0,1fr) 185px;grid-template-rows:1fr auto;gap:10px 20px;padding:10px 18px}#duber-phone .phone-app-pages{grid-column:1;grid-row:1/3;align-self:center}#duber-phone .phone-page-nav{grid-column:2;grid-row:1;align-self:start;gap:3px;flex-wrap:wrap}#duber-phone .phone-page-status{display:none}#duber-phone .phone-overview{display:none}#duber-phone .phone-resume{grid-column:2;grid-row:2;align-self:end}#duber-phone .phone-app-pages .home-grid{gap:6px 12px}#duber-phone .home-app{min-height:66px;gap:4px;padding:0}#duber-phone .home-app .app-icon{width:46px;height:46px}#duber-phone .home-app>span{font-size:10px}#duber-phone .duber-bar{min-height:46px!important;height:46px!important}#duber-phone .duber-bar button{min-height:40px!important}html.is-driving[data-input=touch] #radio-mini.drive-radio{width:270px!important;bottom:12px!important}html.is-driving[data-input=touch] .controls{bottom:12px!important}.is-driving[data-input=touch] #quick-actions-open{bottom:120px!important;right:16px!important}.is-driving[data-input=touch] #quick-actions-2084{padding:64px 14px 116px}.is-driving[data-input=touch] .qa-panel{max-height:calc(100dvh - 180px);width:440px}.is-driving[data-input=touch] #wheel{width:116px!important;height:116px!important}.is-driving[data-input=touch] .wheel-area{width:116px!important}.ux-contexts{margin-bottom:10px}#ux-controls{padding:14px}#ux-control-rows{grid-template-columns:repeat(2,minmax(0,1fr))}#controller-help h2{font-size:24px;margin-bottom:10px}}
@media(prefers-reduced-motion:reduce){#ux-controls *,#duber-phone .phone-home *,#quick-actions-2084 *{scroll-behavior:auto!important;transition:none!important}}
html:not(.is-driving):not(.is-afoot) .keyboard,html .keyboard.ux-guide-hidden{display:none!important}.map-pad-help,.radio-hint .xbox-only,.display-pad-help,.radio-pad-help{gap:8px 14px;align-items:center;flex-wrap:wrap}html[data-input=controller] .map-pad-help,html[data-input=controller] .radio-hint .xbox-only,html[data-input=controller] .display-pad-help{display:flex!important}html:not([data-input=controller]) :is(.map-pad-help,.radio-hint .xbox-only,.display-pad-help,.radio-pad-help,#menu .garage-help .xbox-only){display:none!important}#sr-invite .xbox-key{display:inline-flex;vertical-align:middle}.qa-panel #qa-context .ux-binding{margin:2px 6px 2px 0}.qa-panel header .xbox-key{font-size:12px}#sr-invite span.ux-key-join{display:inline}#av-camera .ux-key{min-height:22px}#retail-2084 .rl-sheet{overscroll-behavior:contain}
/* Keep the launcher apps and buttons only; content never overlaps on short phones. */
#duber-phone .phone-home>.home-top{display:none!important}#duber-phone .phone-app-pages{flex:1 0 auto;min-height:min-content}#duber-phone .phone-overview{padding:6px 0}#duber-phone .phone-overview>*{padding:3px;gap:3px;min-height:52px}#duber-phone .phone-overview svg{width:18px;height:18px}#duber-phone .phone-overview strong{font-size:clamp(12px,3.5vw,17px);line-height:1.15;max-width:100%;overflow:hidden;text-overflow:ellipsis}#duber-phone .phone-overview small{font-size:8px}
@media(max-width:600px) and (max-height:700px){#duber-phone .phone-app-pages .home-grid{gap:10px 8px}#duber-phone .home-app{min-height:90px}#duber-phone .home-app .app-icon{width:64px;height:64px}#duber-phone .phone-home{gap:10px!important}}
@media(max-width:600px) and (orientation:portrait){
 html.phone-hud-ready.is-driving header .tools{position:absolute!important;top:46px!important;left:0!important;right:0!important;width:100%!important;height:44px!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:5px!important}
 html.phone-hud-ready.is-driving header #navigation#navigation{top:98px!important}
 html.is-driving #retail-hud-2084{bottom:208px!important;right:12px!important}
}
@media(min-width:600px) and (max-height:540px){html.is-driving #retail-hud-2084{bottom:150px!important;right:12px!important}}
/* Input ownership is based on the last used device, including touch/controller hybrids. */
html.phone-hud-ready.is-driving[data-input=keyboard] #hud#hud .controls,html.phone-hud-ready.is-driving[data-input=controller] #hud#hud .controls{display:none!important}
html.phone-hud-ready.is-driving[data-input=touch] #hud#hud .controls{display:flex!important;visibility:visible!important;opacity:1!important}
html.phone-hud-ready.is-driving[data-input=touch] #hud#hud .controls>*{pointer-events:auto!important}
#duber-phone #home-cash{font:700 clamp(11px,3.3vw,15px)/1.2 system-ui;letter-spacing:-.04em;max-width:100%;white-space:nowrap}
html.is-afoot .keyboard{display:none!important}
/* Live action headers are not the fixed driving header. */
html.phone-hud-ready.is-driving #quick-actions-2084 .qa-panel header{position:static!important;inset:auto!important;width:auto!important;height:auto!important;min-height:0!important;padding:0!important;margin:0!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;background:transparent!important}
html:has(#quick-actions-2084:not([hidden])) #quick-actions-open{visibility:hidden!important}

/* Keep the original title treatment while the redundant footer copy stays removed. */
#duber-phone[data-app=home] .phone-brand{display:block!important;flex:none;min-height:0;padding:6px 0 2px;text-align:center}
#duber-phone[data-app=home] .phone-brand strong{font-size:38px;line-height:1}
#duber-phone[data-app=home] .phone-brand small:first-child{margin:0 0 5px}
#duber-phone[data-app=home] .phone-brand span{margin-top:6px}
@media(max-width:600px) and (max-height:700px){#duber-phone[data-app=home] .phone-brand{padding:0}#duber-phone[data-app=home] .phone-brand strong{font-size:30px}#duber-phone .home-app{min-height:76px}#duber-phone .home-app .app-icon{width:56px;height:56px}#duber-phone .phone-app-pages .home-grid{gap:7px 8px}#duber-phone[data-app=home] .phone-home{gap:7px!important}}
@media(max-height:540px) and (min-width:600px){#duber-phone[data-app=home] .phone-home{grid-template-rows:auto 1fr auto}#duber-phone[data-app=home] .phone-brand{grid-column:2;grid-row:1;align-self:start;padding:0}#duber-phone[data-app=home] .phone-brand strong{font-size:26px}#duber-phone[data-app=home] .phone-brand small:first-child,#duber-phone[data-app=home] .phone-brand span{font-size:7px;letter-spacing:.12em}#duber-phone .phone-app-pages{grid-row:1/4}#duber-phone .phone-page-nav{grid-row:2;align-self:center}#duber-phone .phone-resume{grid-row:3}}

/* HUD cohesion: one spacing system, measured action clearance, native phone detail. */
:root{--ui-panel:linear-gradient(145deg,#152c3ded,#0b1723f5);--ui-line:#8eafbf55;--ui-muted:#b1c7d1;--ui-radius:14px;--ui-edge:max(12px,env(safe-area-inset-left),env(safe-area-inset-right));--ui-bottom:max(12px,env(safe-area-inset-bottom));--ui-actions-height:44px;--ui-footer:72px}
html.hud-cohesion :is(.qa-panel,.sr-sheet,#retail-2084 .rl-sheet,#story-journal .story-shell,#ux-controls){font-family:'DM Sans',system-ui,sans-serif;color:#eaf3f7}
html.hud-cohesion :is(.qa-panel,.sr-sheet,#retail-2084 .rl-sheet,#story-journal .story-detail,#controller-help>div){background:var(--ui-panel);border-color:var(--ui-line);border-radius:var(--ui-radius)}
html.hud-cohesion :is(.qa-panel h1,#street-racing h1,#retail-2084 h1,#story-journal h1,#controller-help h2){font-family:'Barlow Condensed',sans-serif;font-weight:700;letter-spacing:.015em;font-size:clamp(28px,3vw,38px);line-height:1.1}
html.hud-cohesion :is(.qa-panel button,#street-racing button,#retail-2084 button,#story-objective button,#story-journal button,#ux-controls button){font-family:'DM Sans',system-ui,sans-serif;min-height:44px;border-radius:9px;touch-action:manipulation}
html.hud-cohesion :is(.qa-panel button,#street-racing button,#retail-2084 button,#story-journal button):focus-visible{outline:3px solid #b7e6d7;outline-offset:2px}
html.hud-cohesion #retail-2084 .rl-sheet{border-radius:0;background:var(--ui-panel)}
html.hud-cohesion #retail-2084 #rl-products button{background:#182c38}
html.hud-cohesion #retail-2084 #rl-products button.selected{background:#2b4449;border-color:#badacc}
html.hud-cohesion #retail-2084 .rl-primary{background:#b7e0d2;border-color:#b7e0d2;color:#10272c}
html.hud-cohesion #rl-outfits{padding-top:8px;border-top:1px solid var(--ui-line)}
/* A summary stays a summary. The chart and intervals belong to expanded detail. */
html.hud-cohesion #market-hud[data-compact=true] :is(.market-graph,.market-periods,.market-stamp){display:none!important}
html.hud-cohesion #market-hud .market-portfolio{border-radius:var(--ui-radius);background:var(--ui-panel);border-color:var(--ui-line);gap:6px;padding:10px 12px}
html.hud-cohesion #market-hud .market-minimize{min-height:44px;min-width:68px;font-size:11px;background:#203c43;color:#c9e8dd}
html.hud-cohesion #market-hud .market-periods{flex-wrap:wrap;gap:4px}
html.hud-cohesion #market-hud .market-periods button{min-height:44px;min-width:36px}
html.hud-cohesion #market-hud .market-open{min-height:44px;text-align:center;border:1px solid var(--ui-line);background:#203a43;border-radius:9px}
html.hud-cohesion #market-hud .market-gain{font-size:11px!important}
html.hud-cohesion #market-hud .market-top{align-items:center}
html.hud-cohesion #market-hud .market-value .pv-number{font-size:26px}
/* Important declarations in this named layer supersede legacy important rules
   without escalating selector specificity across input modes. */
@layer hud-cohesion-layout{
html.hud-cohesion #retail-hud-2084{right:var(--ui-edge)!important;bottom:calc(var(--ui-bottom) + var(--ui-footer))!important;max-width:min(360px,calc(100vw - 24px))!important;gap:6px!important;font-family:'DM Sans',sans-serif!important}
html.hud-cohesion #retail-hud-2084 button{min-height:44px!important;background:#142a37ef!important;border:1px solid var(--ui-line)!important;border-radius:9px!important;box-shadow:inset 0 1px 0 #dceeff19!important}
html.hud-cohesion #retail-hud-2084 #rl-parking[aria-pressed=true]{background:#3b352ce8!important;border-color:#d5ad6a99!important;color:#f1d3a0!important}
html.hud-cohesion.is-driving .drive-right-stack.drive-right-stack{top:auto!important;right:var(--ui-edge)!important;bottom:calc(var(--ui-bottom) + var(--ui-footer) + var(--ui-actions-height) + 12px)!important;width:300px!important;max-width:28vw!important;max-height:calc(100dvh - var(--drive-header-bottom,80px) - var(--ui-footer) - var(--ui-actions-height) - 40px)!important;gap:10px!important;overscroll-behavior:contain!important;scroll-padding:8px!important}
html.hud-cohesion.is-driving #hud#hud>.speed{top:auto!important;left:auto!important;right:var(--ui-edge)!important;bottom:var(--ui-bottom)!important;width:144px!important;min-height:56px!important;height:auto!important;padding:6px 10px!important;background:var(--ui-panel)!important;border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important;transform:none!important}
html.hud-cohesion.is-driving #hud#hud>.speed strong{font-size:34px!important;line-height:1!important}
html.hud-cohesion.is-driving #hud#hud>.speed small{font-size:9px!important}
html.hud-cohesion.is-driving #radio-mini#radio-mini.drive-radio:not([hidden]){height:56px!important;min-height:56px!important;max-height:56px!important;bottom:var(--ui-bottom)!important;border-radius:var(--ui-radius)!important;background:var(--ui-panel)!important;border-color:var(--ui-line)!important}
html.hud-cohesion.is-driving #radio-mini#radio-mini .drive-radio-controls button{min-width:44px!important;width:44px!important;min-height:44px!important;height:44px!important}
html.hud-cohesion.is-driving #radio-mini-open{min-height:44px!important}
html.hud-cohesion.is-driving .keyboard{bottom:calc(var(--ui-bottom) + 66px)!important;max-width:calc(100vw - var(--gps-render-width,330px) - 370px)!important;font-family:'DM Sans',sans-serif!important}
html.hud-cohesion.is-driving #xbox-guide{bottom:calc(var(--ui-bottom) + 66px)!important;left:calc(var(--gps-render-width,330px) + 28px)!important;width:calc(100vw - var(--gps-render-width,330px) - 370px)!important;max-height:112px!important;overflow:auto!important;box-sizing:border-box!important;flex-wrap:wrap!important}
/* All objective panels start after the actual header, including wrapped headers. */
html.hud-cohesion:not(.is-aviation) :is(#story-objective,#sr-hud,#police-hud){top:calc(var(--drive-header-bottom,80px) + 8px)!important}
html.hud-cohesion #story-objective{background:var(--ui-panel)!important;border-radius:var(--ui-radius)!important;font-family:'DM Sans',sans-serif!important}
html.hud-cohesion #story-objective>div{flex-wrap:wrap!important;gap:6px!important}
html.hud-cohesion:is(.story-tracking,.police-active) #sr-invite{display:none!important}
html.hud-cohesion.police-active .drive-left-stack{visibility:hidden!important}
/* Menus have one scrollable surface and a reachable close control. */
html.hud-cohesion #quick-actions-2084{padding:var(--ui-edge)!important;padding-bottom:calc(var(--ui-bottom) + var(--ui-footer))!important;align-items:flex-end!important}
html.hud-cohesion #quick-actions-2084 .qa-panel{max-height:calc(100dvh - var(--ui-footer) - 2 * var(--ui-edge))!important;overscroll-behavior:contain!important;scroll-padding:10px!important;width:440px!important}
html.hud-cohesion:not([data-input=controller]) #quick-actions-2084[data-page=main] .qa-orbit{height:auto!important}
html.hud-cohesion:not([data-input=controller]) #quick-actions-2084[data-page=main] #qa-items{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
html.hud-cohesion:not([data-input=controller]) #quick-actions-2084[data-page=main] #qa-items button{position:static!important;width:auto!important;height:auto!important;min-height:72px!important;text-align:left!important;padding:12px!important;justify-content:space-between!important}
html.hud-cohesion:not([data-input=controller]) #quick-actions-2084[data-page=main] #qa-center{display:none!important}
html.hud-cohesion :is(#quick-actions-2084 .qa-panel,#retail-2084 .rl-sheet) header{position:static!important;inset:auto!important;width:auto!important;height:auto!important;min-height:44px!important;display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;padding:0!important;background:transparent!important}
html.hud-cohesion:has(#quick-actions-2084:not([hidden])) :is(.drive-right-stack,#retail-hud-2084){visibility:hidden!important}
html.hud-cohesion:has(:is(#duber-phone,#street-racing,#story-journal,#retail-2084,#controller-help):not([hidden])) :is(#retail-hud-2084,.drive-left-stack,.drive-right-stack,#story-objective,#sr-invite,.phone-toast){visibility:hidden!important}
/* Compact screens use the phone for passive apps; gameplay keeps its own space. */
@media(max-width:1100px),(max-height:560px),(pointer:coarse) and (max-width:1400px){
 html.hud-cohesion.is-driving #market-hud{display:none!important}
 html.hud-cohesion.is-driving .drive-left-stack.drive-left-stack{display:none!important}
 html.hud-cohesion.is-driving .keyboard,html.hud-cohesion.is-driving #xbox-guide{display:none!important}
 html.hud-cohesion.is-driving .drive-right-stack.drive-right-stack{top:calc(var(--drive-header-bottom,80px) + 8px)!important;bottom:auto!important;width:min(300px,calc(100vw - 160px))!important;max-width:none!important;max-height:calc(100dvh - var(--drive-header-bottom,80px) - 250px)!important}
 html.hud-cohesion.is-driving #hud#hud .map{top:calc(var(--drive-header-bottom,80px) + 8px)!important;bottom:auto!important;left:var(--ui-edge)!important;right:auto!important;width:112px!important;height:80px!important}
 html.hud-cohesion.is-driving #hud#hud .map .map-size-control{display:none!important}
 html.hud-cohesion.is-driving #hud#hud>.speed{top:calc(var(--drive-header-bottom,80px) + 96px)!important;bottom:auto!important;left:var(--ui-edge)!important;right:auto!important;width:112px!important;min-height:40px!important;height:40px!important;display:flex!important;align-items:baseline!important;gap:4px!important}
 html.hud-cohesion.is-driving #hud#hud>.speed strong{font-size:25px!important}
 html.hud-cohesion.is-driving #hud#hud>.speed :is(small,.revbar){display:none!important}
 html.hud-cohesion.is-driving #radio-mini#radio-mini.drive-radio:not([hidden]){left:50%!important;right:auto!important;transform:translateX(-50%)!important;width:min(410px,calc(100vw - 28px))!important}
 html.hud-cohesion.is-driving #retail-hud-2084{bottom:calc(var(--ui-bottom) + 66px)!important}
 html.hud-cohesion.story-tracking #story-objective{left:auto!important;right:var(--ui-edge)!important;transform:none!important;width:calc(100vw - 156px)!important;max-width:420px!important;min-width:0!important;padding:10px 12px!important;box-sizing:border-box!important;max-height:calc(100dvh - var(--drive-header-bottom,80px) - 240px)!important;overflow:auto!important}
 html.hud-cohesion.story-tracking #story-objective #drive-direction{display:none!important}
 html.hud-cohesion.police-active #police-hud{left:auto!important;right:var(--ui-edge)!important;width:min(280px,calc(100vw - 156px))!important}
 html.hud-cohesion #story-journal .story-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:1100px) and (min-height:561px){
 html.hud-cohesion.is-driving[data-input=touch]{--ui-footer:210px!important}
 html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini.drive-radio:not([hidden]){bottom:calc(var(--ui-bottom) + 142px)!important}
 html.hud-cohesion.is-driving[data-input=touch] #retail-hud-2084{bottom:calc(var(--ui-bottom) + 208px)!important}
 html.hud-cohesion.is-driving[data-input=touch] #quick-actions-2084{padding-bottom:calc(var(--ui-bottom) + 148px)!important;justify-content:center!important}
 html.hud-cohesion.is-driving[data-input=touch] #quick-actions-2084 .qa-panel{max-height:calc(100dvh - 180px)!important}
 html.hud-cohesion.is-driving[data-input=touch]:has(#quick-actions-2084:not([hidden])) #radio-mini{visibility:hidden!important}
}
@media(max-height:560px) and (orientation:landscape){
 html.hud-cohesion.is-driving[data-input=touch]{--ui-footer:12px!important}
 html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini.drive-radio:not([hidden]){width:min(370px,calc(100vw - 304px))!important}
 html.hud-cohesion.is-driving[data-input=touch] #retail-hud-2084{bottom:calc(var(--ui-bottom) + 146px)!important;max-width:calc(100vw - 160px)!important;flex-wrap:nowrap!important}
 html.hud-cohesion.is-driving[data-input=touch] #quick-actions-2084{padding:12px 150px!important;align-items:center!important;justify-content:center!important}
 html.hud-cohesion.is-driving[data-input=touch] #quick-actions-2084 .qa-panel{width:100%!important;max-height:calc(100dvh - 24px)!important}
 html.hud-cohesion #story-objective strong{font-size:13px!important}
 html.hud-cohesion #story-objective p{font-size:11px!important}
 html.hud-cohesion.story-tracking #story-objective{max-height:calc(100dvh - var(--drive-header-bottom,80px) - 170px)!important}
 html.hud-cohesion #story-radio{bottom:calc(var(--ui-bottom) + 62px)!important;max-width:calc(100vw - 300px)!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important}
}
@media(max-width:600px){
 html.hud-cohesion #story-journal .story-cards{grid-template-columns:1fr!important}
 html.hud-cohesion #retail-2084 .rl-camera{display:grid!important;grid-template-columns:repeat(4,minmax(44px,1fr))!important;width:calc(100% - 24px)!important;white-space:normal!important;box-sizing:border-box!important}
 html.hud-cohesion #retail-2084 .rl-camera button{min-width:44px!important;padding:5px!important;min-height:44px!important}
 html.hud-cohesion #retail-2084 .rl-sheet{border-radius:18px 18px 0 0!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important}
 html.hud-cohesion #retail-2084 #rl-products button{min-width:150px!important;white-space:normal!important}
 html.hud-cohesion #retail-2084 .rl-wallet{position:static!important;padding:6px 0!important;gap:8px!important}
 html.hud-cohesion #rl-detail{flex-shrink:0!important}
}

}
@layer hud-cohesion-layout{
 /* Keep passive summaries out of the controller layout on compact displays too. */
 @media(max-width:1100px),(max-height:560px),(pointer:coarse) and (max-width:1400px){
  html.hud-cohesion.is-driving .drive-right-stack :is(#duber-card,#duber-progress){position:relative!important;inset:auto!important;width:100%!important;max-height:none!important}
  html.hud-cohesion.is-driving #retail-hud-2084 #rl-parking{min-width:152px!important;white-space:normal!important}
  html.hud-cohesion.is-driving #retail-hud-2084 #quick-actions-open{min-width:64px!important}
  html.hud-cohesion.story-tracking #destination-hud{display:none!important}
 }
 @media(max-width:600px) and (orientation:portrait){
  html.hud-cohesion.story-tracking #hud#hud .map{visibility:hidden!important}
  html.hud-cohesion.story-tracking #story-objective{left:var(--ui-edge)!important;right:var(--ui-edge)!important;width:auto!important;max-height:min(210px,calc(100dvh - var(--drive-header-bottom,128px) - var(--ui-bottom) - 208px - var(--ui-actions-height) - 20px))!important;padding:10px 12px!important}
  html.hud-cohesion.story-tracking #hud#hud>.speed{top:auto!important;bottom:calc(var(--ui-bottom) + 208px)!important;left:var(--ui-edge)!important;right:auto!important;width:60px!important}
 }
 @media(max-height:560px) and (orientation:landscape){
  html.hud-cohesion #sr-invite{min-height:44px!important}
  html.hud-cohesion.story-tracking #story-objective{max-height:calc(100dvh - var(--drive-header-bottom,80px) - 224px)!important}
 }
}
@layer hud-cohesion-layout{
 @media(min-width:1101px) and (min-height:561px){
  html.hud-cohesion.is-driving:not([data-input=touch]) #hud .map{display:block!important}
 }
 @media(min-width:601px) and (max-width:1100px) and (min-height:561px){
  html.hud-cohesion.is-driving body>header{height:116px!important;min-height:116px!important}
  html.hud-cohesion.is-driving body>header .tools{position:absolute!important;top:46px!important;left:0!important;right:0!important;width:100%!important;max-width:100%!important;display:flex!important;flex-wrap:nowrap!important;justify-content:flex-end!important;gap:6px!important;height:44px!important;overflow:visible!important}
  html.hud-cohesion.is-driving body>header .tools>button{flex:0 0 auto!important;max-width:120px!important;min-width:44px!important;padding:6px 10px!important;font-size:10px!important}
  html.hud-cohesion.is-driving body>header #navigation{position:absolute!important;top:94px!important;left:0!important;right:0!important;width:auto!important;height:22px!important;min-height:22px!important}
  html.hud-cohesion.is-driving body>header #player-hud .player-stat strong{font-size:16px!important}
 }
 /* Hide duplicate navigation during an active story; its card owns the route. */
 html.hud-cohesion.story-tracking:not(.is-aviation) #destination-hud{display:none!important}
}
@layer hud-cohesion-layout{
 @media(min-width:601px) and (max-width:1100px) and (min-height:561px){
  html.hud-cohesion.is-driving body>header .tools #toggle-controls{width:auto!important;min-width:88px!important;white-space:nowrap!important}
  html.hud-cohesion.is-driving body>header .tools #toggle-controls::before{content:none!important;display:none!important}
 }
 @media(max-width:600px),(max-height:560px){
  html.hud-cohesion #story-objective>div:not(#drive-direction){position:sticky!important;bottom:-10px!important;background:#102531!important;padding:4px 0!important;margin-top:5px!important;z-index:1!important}
  html.hud-cohesion #story-objective [data-action][aria-disabled=true]{display:none!important}
 }
}
@layer hud-cohesion-layout{
 @media(max-height:560px) and (orientation:landscape){
  html.hud-cohesion.story-tracking #story-objective{padding:6px 10px!important}
  html.hud-cohesion #story-objective>:is(small,.story-step,p,.story-live-progress){display:none!important}
  html.hud-cohesion #story-objective>strong{display:block!important;font-size:13px!important;line-height:18px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;margin:0!important}
  html.hud-cohesion #story-objective>div:not(#drive-direction){position:static!important;padding:0!important;margin-top:4px!important}
 }
}

/* Nearby races share the HUD's surface, type and input glyphs. The whole card
   is one touch target; accepting starts the existing staging countdown. */
#sr-invite{position:relative;width:100%;box-sizing:border-box;padding:14px 16px 10px;border:1px solid #74c9f366;border-radius:var(--ui-radius,14px);background:var(--ui-panel,#102531f5);box-shadow:0 8px 28px #0004,inset 0 1px #ffffff10;color:#edf7fa;font:13px/1.35 'DM Sans',sans-serif;text-align:left;cursor:pointer;touch-action:manipulation;}
#sr-invite:focus-visible{outline:3px solid #b4e4ff;outline-offset:3px}
@media(hover:hover){#sr-invite:hover{border-color:#8fd7ff;background:#183647}}
#sr-invite:active{border-color:#c4ecff}
#sr-invite .sr-invite-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:5px}
#sr-invite .sr-invite-eyebrow{font-size:9px;letter-spacing:1.7px;font-weight:700;color:#91d3f4}
#sr-invite .sr-invite-prize{font-variant-numeric:tabular-nums;font-weight:700;color:#c2f4d6;white-space:nowrap}
#sr-invite .sr-invite-prize small{font-size:8px;color:#a7c1b6;letter-spacing:.6px}
#sr-invite .sr-invite-title{display:block;font:700 23px/1.05 'Barlow Condensed','DM Sans',sans-serif;letter-spacing:.2px;overflow-wrap:anywhere}
#sr-invite .sr-invite-detail{display:block;margin-top:5px;font-size:11px;color:#aebfcb}
#sr-invite .sr-invite-action{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;min-height:36px;margin-top:9px;padding-top:8px;border-top:1px solid var(--ui-line,#aec9d326);font-weight:700;color:#d6edfa}
#sr-invite .sr-invite-input{display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:500;color:#afc6d4;white-space:nowrap}
#sr-invite .ux-key{color:#e5f4ff;min-height:26px;font-size:11px}
#sr-invite .sr-invite-tap{font-size:20px;color:#91d3f4}
@media(max-width:600px){#sr-invite .sr-invite-title{font-size:20px}#sr-invite .sr-invite-top{gap:3px 8px}#sr-invite .sr-invite-action{margin-top:7px;padding-top:7px}#sr-invite .sr-invite-detail{font-size:10px}}
@media(max-height:560px) and (orientation:landscape){#sr-invite .sr-invite-title{font-size:20px}#sr-invite .sr-invite-action{margin-top:5px;padding-top:5px;min-height:28px}}

/* Race invitations are a member of the app dock, so sibling panels reserve
   their own space. Never position the invitation over the driving view. */
@layer hud-cohesion-layout{
 html.hud-cohesion.is-driving .drive-right-stack.drive-right-stack{
  max-height:var(--ui-side-available,calc(100dvh - 240px))!important;
  overflow:auto!important;scrollbar-width:thin;scroll-padding:6px!important;
 }
 html.hud-cohesion .drive-right-stack>#sr-invite{
  position:relative!important;inset:auto!important;transform:none!important;
  width:100%!important;max-width:none!important;min-width:0!important;
  flex:none!important;order:-5!important;z-index:auto;box-shadow:inset 0 1px #ffffff10;
 }
 html.hud-cohesion .drive-right-stack>#cloud-controls{flex:none!important;min-width:0!important}
 @media(max-width:1100px),(max-height:560px),(pointer:coarse) and (max-width:1400px){
  html.hud-cohesion.is-driving .drive-right-stack.drive-right-stack{
   width:min(300px,calc(100vw - 148px))!important;gap:8px!important;
  }
 }
 @media(max-width:600px),(max-height:560px){
  html.hud-cohesion .drive-right-stack>#sr-invite{padding:6px 8px!important;font-size:11px!important}
  html.hud-cohesion #sr-invite .sr-invite-title{font-size:17px!important;line-height:1.05!important}
  html.hud-cohesion #sr-invite .sr-invite-top{margin-bottom:3px!important;gap:2px 6px!important}
  html.hud-cohesion #sr-invite .sr-invite-eyebrow{font-size:8px!important;letter-spacing:.7px!important}
  html.hud-cohesion #sr-invite .sr-invite-prize{font-size:10px!important}
  html.hud-cohesion #sr-invite .sr-invite-detail{display:none!important}
  html.hud-cohesion #sr-invite .sr-invite-action{margin-top:3px!important;padding-top:3px!important;min-height:26px!important;gap:3px 6px!important}
  html.hud-cohesion #sr-invite .sr-invite-input{gap:2px!important;font-size:9px!important}
  html.hud-cohesion #sr-invite .ux-key{min-height:22px!important;font-size:10px!important}
 }
 @media(max-height:560px) and (orientation:landscape){
  html.hud-cohesion.is-driving .drive-right-stack.drive-right-stack:has(#sr-invite:not([hidden])){
   width:min(300px,calc(100vw - 148px))!important;display:grid!important;
   grid-template-columns:minmax(0,1fr);align-items:start!important;
  }
  html.hud-cohesion.is-driving .drive-right-stack:has(#sr-invite:not([hidden])):has(#cloud-controls:not([hidden])){
   width:min(600px,calc(100vw - 148px))!important;grid-template-columns:minmax(0,1fr) minmax(160px,.8fr)!important;
  }
 }
}

@layer hud-cohesion-layout{
 /* Large touch displays still reserve the lower corners for both hands. */
 @media(min-width:1101px) and (min-height:561px){
  html.hud-cohesion.is-driving[data-input=touch] #hud#hud>.speed{bottom:calc(var(--ui-bottom) + 210px)!important}
  html.hud-cohesion.is-driving[data-input=touch] #retail-hud-2084{bottom:calc(var(--ui-bottom) + 276px)!important}
  html.hud-cohesion.is-driving[data-input=touch] .drive-right-stack.drive-right-stack{bottom:calc(var(--ui-bottom) + 276px + var(--ui-actions-height) + 12px)!important}
  html.hud-cohesion.is-driving[data-input=touch] #hud#hud .map{display:block!important;width:240px!important;height:180px!important;bottom:calc(var(--ui-bottom) + 210px)!important;top:auto!important}
  html.hud-cohesion.is-driving[data-input=touch] .drive-left-stack.drive-left-stack{bottom:calc(var(--ui-bottom) + 220px + var(--gps-render-height,330px))!important}
 }
 @media(max-width:600px) and (orientation:landscape){
  html.hud-cohesion.is-driving body>header{height:68px!important;min-height:68px!important}
 }
 @media(max-height:360px) and (orientation:landscape){
  html.hud-cohesion.is-driving[data-input=touch] #hud#hud>.speed{left:136px!important;top:auto!important;bottom:78px!important}
  html.hud-cohesion.is-driving[data-input=touch] #retail-hud-2084{right:160px!important;bottom:78px!important}
 }
}
@layer hud-cohesion-layout{
 @media(min-height:361px) and (max-height:560px) and (orientation:landscape){
  html.hud-cohesion.is-driving[data-input=touch] #retail-hud-2084{bottom:calc(var(--ui-bottom) + 130px)!important}
 }
 @media(max-width:600px){
  html.hud-cohesion #sr-invite .sr-invite-input>span:first-child{display:none!important}
 }
}

/* Touch radio: now-playing stays visible; the title opens the complete player.
   Match the toolbar scale without borrowing space from steering or pedals. */
@layer hud-cohesion-layout{
 @media(max-width:1100px),(pointer:coarse){
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini.drive-radio:not([hidden]){
   display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
   width:300px!important;max-width:calc(100vw - 28px)!important;
   height:48px!important;min-height:48px!important;max-height:48px!important;
   padding:1px 3px 1px 7px!important;gap:4px!important;box-sizing:border-box!important;
   border:1px solid var(--ui-line)!important;border-radius:12px!important;
   box-shadow:0 3px 12px #0003,inset 0 1px #ffffff0a!important;
   overflow:hidden!important;touch-action:manipulation;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #radio-mini-open{
   display:flex!important;align-items:center!important;gap:7px!important;
   width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;
   padding:0!important;margin:0!important;border:0!important;border-radius:7px!important;
   background:transparent!important;box-shadow:none!important;overflow:hidden!important;
   color:#f1f7fa!important;text-align:left!important;touch-action:manipulation;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #drive-radio-cover{
   display:block!important;width:30px!important;height:30px!important;flex:0 0 30px!important;
   border-radius:5px!important;object-fit:cover!important;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini-open>span{
   display:grid!important;min-width:0!important;gap:2px!important;overflow:hidden!important;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini-open>span::before{
   content:'RADIO ›';font:600 8px/1 'DM Sans',system-ui,sans-serif;letter-spacing:.09em;color:var(--ui-muted);
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #radio-mini-title{
   display:block!important;min-width:0!important;font:600 11px/1.25 'DM Sans',system-ui,sans-serif!important;
   white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini .drive-radio-controls{
   display:flex!important;gap:0!important;width:auto!important;min-width:0!important;
   margin:0!important;padding:0!important;border:0!important;background:transparent!important;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini .drive-radio-controls button{
   flex:0 0 44px!important;width:44px!important;min-width:44px!important;max-width:44px!important;
   height:44px!important;min-height:44px!important;padding:12px!important;border:0!important;
   border-radius:9px!important;background:transparent!important;box-shadow:none!important;
   color:#eef8fc!important;touch-action:manipulation;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #drive-radio-play{
   background:radial-gradient(circle at center,#b7e0d21a 0 16px,transparent 17px)!important;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini .drive-radio-controls svg{width:20px!important;height:20px!important}
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini :is(#drive-radio-prev,#drive-radio-shuffle){display:none!important}
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini button:active{background:#b7e0d230!important}
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini button:focus-visible{outline:2px solid #b7e0d2!important;outline-offset:-2px!important}
 }
 @media(max-width:600px) and (orientation:portrait){
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini.drive-radio:not([hidden]){
   top:calc(var(--web-top,env(safe-area-inset-top,0px)) + 44px)!important;bottom:auto!important;
   left:var(--web-left,8px)!important;right:auto!important;transform:none!important;
   width:calc(100vw - var(--web-left,8px) - var(--web-right,8px) - 199px)!important;
   max-width:240px!important;z-index:31!important;
  }
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #drive-radio-next{display:none!important}
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #drive-radio-cover{width:28px!important;height:28px!important;flex-basis:28px!important}
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #radio-mini-open{gap:6px!important}
 }
 /* The oldest narrow phones need a separate header row to keep every target usable. */
 @media(max-width:359px) and (orientation:portrait){
  html.hud-cohesion.is-driving[data-input=touch] body>header{height:172px!important;min-height:172px!important}
  html.hud-cohesion.is-driving[data-input=touch] body>header #navigation#navigation{top:calc(var(--web-top,0px) + 148px)!important}
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini.drive-radio:not([hidden]){top:calc(var(--web-top,0px) + 96px)!important;width:calc(100vw - var(--web-left,8px) - var(--web-right,8px))!important;max-width:none!important}
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini #drive-radio-next{display:block!important}
 }
 @media(max-height:560px) and (orientation:landscape){
  html.hud-cohesion.is-driving[data-input=touch] #radio-mini#radio-mini.drive-radio:not([hidden]){
   top:auto!important;bottom:var(--ui-bottom)!important;left:50%!important;right:auto!important;
   transform:translateX(-50%)!important;width:min(300px,calc(100vw - 304px))!important;
  }
 }
 html.hud-cohesion #radio-mini[hidden]{display:none!important}
}

/* Actions belongs to the pedal cluster. Context buttons can extend left;
   the Actions target stays directly above the handbrake at the same width. */
@layer hud-cohesion-layout{
 html.hud-cohesion.is-driving[data-input=touch].touch-actions-anchored #retail-hud-2084{
  top:auto!important;left:auto!important;right:var(--ui-actions-right)!important;
  bottom:var(--ui-actions-bottom)!important;transform:none!important;
  max-width:calc(100vw - var(--ui-actions-right) - var(--ui-edge))!important;
  align-items:flex-end!important;flex-wrap:wrap!important;gap:6px!important;
 }
 html.hud-cohesion.is-driving[data-input=touch].touch-actions-anchored #quick-actions-open{
  position:static!important;inset:auto!important;transform:none!important;order:10!important;
  width:var(--ui-actions-width)!important;min-width:var(--ui-actions-width)!important;
  max-width:var(--ui-actions-width)!important;flex:0 0 var(--ui-actions-width)!important;
  height:44px!important;min-height:44px!important;padding:6px!important;
 }
 html.hud-cohesion.is-driving[data-input=touch].touch-actions-anchored .drive-right-stack.drive-right-stack{
  top:calc(var(--drive-header-bottom,80px) + 8px)!important;bottom:auto!important;
  max-height:var(--ui-side-available)!important;overflow:auto!important;min-height:0!important;
 }
 html.hud-cohesion.is-driving[data-input=touch].touch-actions-anchored :is(#story-objective,#police-hud){
  max-height:var(--ui-side-available)!important;min-height:0!important;overflow:auto!important;pointer-events:auto!important;
 }
 html.hud-cohesion.is-driving[data-input=touch].touch-actions-anchored :is(.phone-toast,#rl-action-toast){
  top:auto!important;bottom:var(--ui-actions-clearance)!important;
  max-height:var(--ui-side-available)!important;overflow:auto!important;box-sizing:border-box!important;
 }
 /* No driving button may sit above a modal, even during its opening frame. */
 html.hud-cohesion:has(:is(#radio-panel,#city-map,#display-settings,#graphics-recovery,#duber-phone,#street-racing,#story-journal,#retail-2084,#controller-help,#quick-actions-2084):not([hidden])) #retail-hud-2084{
  visibility:hidden!important;pointer-events:none!important;
 }
}
@layer hud-cohesion-layout{
 /* Short landscape: use the lane between the map and the action button. */
 html.hud-cohesion.is-driving[data-input=touch].touch-actions-beside :is(.drive-right-stack.drive-right-stack,#story-objective,#police-hud,.phone-toast,#rl-action-toast){
  top:calc(var(--drive-header-bottom,80px) + 8px)!important;bottom:auto!important;
  left:auto!important;right:var(--ui-context-right)!important;transform:none!important;
  width:min(300px,var(--ui-context-width))!important;max-width:var(--ui-context-width)!important;
  max-height:var(--ui-context-available)!important;min-height:0!important;overflow:auto!important;
 }
 html.hud-cohesion.is-driving[data-input=touch].touch-actions-beside .drive-right-stack:has(#sr-invite:not([hidden])):has(#cloud-controls:not([hidden])){
  width:min(300px,var(--ui-context-width))!important;grid-template-columns:minmax(0,1fr)!important;
 }
}

/* Opaque mobile sheets let the city sleep without allocating Safari backdrop
   snapshots on every open/close. Desktop keeps its existing presentation. */
@media (min-width:0px){
 html.mobile-panel-mode #duber-phone,html.mobile-panel-mode #radio-panel{
  background:#07111e!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
 }
 html.mobile-panel-mode #duber-phone *,html.mobile-panel-mode #radio-panel *{
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
 }
}

/* Race information shares the navigation area instead of covering the map.
   The measured dock follows portrait, landscape, safe areas and map resizing. */
@layer hud-cohesion-layout{
 html.hud-cohesion.street-race-active #sr-hud{
  left:var(--race-hud-left,calc(var(--ui-edge) + 120px))!important;
  top:var(--race-hud-top,calc(var(--drive-header-bottom,80px) + 8px))!important;
  width:var(--race-hud-width,calc(100vw - 144px))!important;
  right:auto!important;bottom:auto!important;transform:none!important;
  min-width:0!important;max-width:none!important;min-height:118px!important;
  padding:8px 10px!important;border-radius:var(--ui-radius)!important;
  background:var(--ui-panel)!important;border-color:var(--ui-line)!important;
 }
 html.hud-cohesion.street-race-active.race-hud-beside #police-hud#police-hud{
  top:calc(var(--race-hud-bottom) + 8px)!important;
  left:var(--race-alert-left,var(--race-hud-left))!important;right:auto!important;transform:none!important;
  width:var(--race-alert-width,var(--race-hud-width))!important;max-width:none!important;box-sizing:border-box!important;
  max-height:calc(100dvh - var(--race-hud-bottom) - 24px)!important;
  min-height:0!important;overflow:auto!important;
 }
}
html.hud-cohesion #sr-hud .sr-overview{padding-right:50px;min-height:44px}
html.hud-cohesion #sr-hud .sr-name{display:block;max-width:none;line-height:13px;font-size:11px;margin:0 0 2px;color:var(--ui-muted)}
html.hud-cohesion #sr-hud .sr-ranking{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:0 6px;white-space:nowrap}
html.hud-cohesion #sr-hud .sr-ranking strong{font-size:23px;line-height:27px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
html.hud-cohesion #sr-hud .sr-ranking strong small{font-size:12px;font-weight:500;color:var(--ui-muted)}
html.hud-cohesion #sr-hud .sr-time{font-size:11px;color:#d6e5eb}
html.hud-cohesion #sr-hud progress{margin:4px 0;height:3px}
html.hud-cohesion #sr-hud .sr-turn{gap:6px;margin:0;min-height:28px}
html.hud-cohesion #sr-hud .sr-turn-icon{font-size:24px;line-height:26px;width:22px;text-align:center}
html.hud-cohesion #sr-hud .sr-turn-copy b{font-size:11px;line-height:14px;overflow-wrap:anywhere}
html.hud-cohesion #sr-hud .sr-turn-copy small{font-size:10px;line-height:13px}
html.hud-cohesion #sr-hud .sr-meta{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:10px;line-height:13px;margin-top:4px;color:var(--ui-muted);white-space:nowrap}
html.hud-cohesion #sr-hud .sr-count{font-size:34px;line-height:36px;text-align:left}
html.hud-cohesion #sr-hud .sr-count+small{text-align:left;font-size:11px;line-height:16px;color:var(--ui-muted)}
html.hud-cohesion #sr-pause{width:44px;height:44px;padding:3px;border-radius:9px;background:#b7e0d210}
@layer hud-cohesion-layout{
 /* Race instructions take priority; new app notices stay queued until finish. */
 html.hud-cohesion.street-race-active :is(.phone-toast,#market-alert){visibility:hidden!important}
 html.hud-cohesion.street-race-active.police-active:not(.race-hud-beside) #police-hud{
  top:var(--race-hud-top)!important;left:calc(var(--race-hud-left) + var(--race-hud-width) + 8px)!important;right:auto!important;
  width:254px!important;max-width:calc(100vw - var(--race-hud-left) - var(--race-hud-width) - 32px)!important;transform:none!important;
 }
 html.hud-cohesion.street-race-active:has(:is(#duber-phone,#radio-panel,#city-map,#display-settings,#controller-help,#quick-actions-2084,#street-racing):not([hidden])) #sr-hud{visibility:hidden!important}
 html.hud-cohesion.street-race-active.race-hud-beside #police-hud{padding:3px 8px!important}
 html.hud-cohesion.street-race-active.race-hud-beside #pp-stars{font-size:16px!important}
 html.hud-cohesion.street-race-active.race-hud-beside #pp-hint{font-size:10px!important;line-height:12px!important;margin-top:2px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
 html.hud-cohesion.street-race-active.race-hud-beside #pp-track{margin-top:2px!important}
 @media(max-height:350px) and (orientation:landscape){
  html.hud-cohesion.street-race-active #sr-hud{padding:6px 8px!important;min-height:110px!important}
 }
}
@media(max-height:350px) and (orientation:landscape){
 html.hud-cohesion #sr-hud progress{margin:3px 0}
 html.hud-cohesion #sr-hud .sr-turn{min-height:26px}
 html.hud-cohesion #sr-hud .sr-turn-copy b{line-height:13px}
 html.hud-cohesion #sr-hud .sr-turn-copy small{line-height:11px}
 html.hud-cohesion #sr-hud .sr-meta{margin-top:2px}
 html.hud-cohesion #sr-pause{top:6px;right:6px}
}
