/* 3.8.3: a consistent default HUD, with independently sized panels and touch controls. */
body{height:100%;height:100dvh}#app{height:100%}
body.touch-mode{--side:max(12px,env(safe-area-inset-left),6.5vw);--right:max(12px,env(safe-area-inset-right),6.5vw);--top:max(10px,env(safe-area-inset-top),5.1vh);--bottom:max(12px,env(safe-area-inset-bottom),5.4vh);--touch-size:86px;--control-rail:var(--hud-control-rail,96px)}
body.touch-mode #app #hud .bottom{display:contents}
body.touch-mode #app #hud .hud-head{align-items:flex-start;max-width:none;gap:9px;transform:scale(var(--hud-panel-scale,1));transform-origin:top left}
body.touch-mode #app #hud .hud-brand{padding:4px;flex:none;border-radius:12px}
body.touch-mode #app #hud .hud-brand img{width:37px;height:37px}
body.touch-mode #app #hud .hud-brand span{display:none}
body.touch-mode #app #hud .climate{flex:none;min-width:118px;width:118px;min-height:51px;grid-template-columns:17px minmax(0,1fr);padding:7px 8px;gap:2px 5px;border-radius:12px}
body.touch-mode #app #hud .climate .city-clock{display:flex;align-items:baseline;gap:5px;white-space:nowrap}
body.touch-mode #app #hud .climate b{font-size:12px}
body.touch-mode #app #hud #clock-day{font-size:9px}
body.touch-mode #app #hud #weather-label{display:block;white-space:normal;font-size:9px;line-height:1.2}
body.touch-mode #app #hud #city-bulletin{grid-column:1/-1;white-space:nowrap;max-width:none;font-size:9px;line-height:1.2}
body.touch-mode #app #hud .wallet-controls331{flex:none;min-width:0}
body.touch-mode #app #hud .wallet-trip-stack{display:grid;justify-items:start;gap:4px;min-width:0}
body.touch-mode #app #hud #trip-review-hud{width:max-content;min-width:0;min-height:41px;flex-wrap:nowrap;padding:5px 9px;gap:6px;border-radius:12px}
body.touch-mode #app #hud .trip-review-emblem{width:24px;height:24px}
body.touch-mode #app #hud #trip-review-score{font-size:14px}
body.touch-mode #app #hud #trip-review-hud[data-empty="true"] #trip-review-score{font-size:10px}
body.touch-mode #app #hud #trip-review-count{font-size:10px;white-space:nowrap}
body.touch-mode #app #hud #trip-review-count .trip-count-label{display:inline}
body.touch-mode #app #hud #money-hud33{min-height:32px;font-size:12px;padding:5px 8px;border-radius:11px}
body.touch-mode #app #hud .map-wrap{display:grid;grid-template-columns:56px 100px 42px;grid-template-rows:41px 19px;align-items:start;gap:6px 8px;transform:scale(var(--hud-panel-scale,1));transform-origin:top right}
body.touch-mode #app #hud #garage-pin359{grid-column:1;grid-row:1;order:0;width:56px;min-height:37px;font-size:11px;padding:3px 5px;gap:3px}
body.touch-mode #app #hud #garage-pin359 svg{width:13px;height:13px}
body.touch-mode #app #hud .map-card{grid-column:2;grid-row:1/3;width:100px;height:66px;min-height:0;padding:4px;border-radius:12px;transform:none}
body.touch-mode #app #hud .hud-menu{grid-column:3;grid-row:1;width:42px;min-height:41px;height:41px}
body.touch-mode #app #hud .fps-hud{position:static;grid-column:3;grid-row:2;justify-self:stretch;min-width:0;padding:3px 4px;font-size:9px;text-align:center}
body.touch-mode #app #hud .hud-shortcuts{right:var(--right);transform:scale(var(--hud-panel-scale,1));transform-origin:top right;gap:6px}
body.touch-mode #app #hud .hud-bag-tools{gap:6px}
body.touch-mode #app #hud .hud-bag-tools .hud-customize{width:42px;max-width:42px;height:34px;min-height:34px;font-size:8px}
body.touch-mode #app #hud .hud-bag-tools .hud-settings331{width:33px;height:38px;min-height:38px}
body.touch-mode #app #hud #bag-hud328{min-height:38px;font-size:11px;padding:4px 6px}
body.touch-mode #app #hud .touch{display:block;inset:0;pointer-events:none}
body.touch-mode #app #hud .touch-direction{position:absolute;left:var(--side);right:auto;bottom:var(--bottom);transform:translate(var(--layout-x,0px),var(--layout-y,0px)) scale(var(--hud-controls-scale,1));transform-origin:bottom left;pointer-events:auto}
body.touch-mode #app #hud .touch-pedals{position:absolute;right:var(--right);left:auto;bottom:var(--bottom);width:max-content;display:flex;gap:8px;transform:translate(var(--layout-x,0px),var(--layout-y,0px)) scale(var(--hud-controls-scale,1));transform-origin:bottom right;pointer-events:auto}
body.touch-mode #app #hud .touch-pedals button{min-width:0;min-height:0;flex:none;border-radius:16px;font-size:10px}
body.touch-mode #app #hud .touch-pedals .reverse-pedal{width:51px;height:58px}
body.touch-mode #app #hud .touch-pedals .brake-pedal{width:59px;height:53px}
body.touch-mode #app #hud .touch-pedals .boost-pedal{width:59px;height:75px}
body.touch-mode #app #hud .touch-pedals .gas-pedal{width:69px;height:63px}
body.touch-mode #app #hud .touch-pedals button span{font-size:10px}
body.touch-mode #app #hud #jump-key{right:var(--right);bottom:var(--bottom);width:69px;min-width:0;min-height:58px;transform:scale(var(--hud-controls-scale,1));transform-origin:bottom right;pointer-events:auto}
body.touch-mode.left-mode #app #hud .touch-direction{left:auto;right:var(--right);transform-origin:bottom right}
body.touch-mode.left-mode #app #hud .touch-pedals{right:auto;left:var(--side);transform-origin:bottom left}
body.touch-mode #app #hud .bottom>.instrument{position:absolute;left:var(--side);bottom:calc(var(--bottom) + var(--hud-control-rail,96px));transform:scale(var(--hud-panel-scale,1));transform-origin:bottom left;max-width:none}
body.touch-mode #app.vehicle-hud #hud .bottom>.instrument{width:164px;max-width:none;min-width:0;padding:5px 6px;border-radius:11px}
body.touch-mode #app #hud .instrument .vehicle-aids{gap:4px;margin-bottom:4px;min-height:0}
body.touch-mode #app #hud .instrument .vehicle-aids button{min-height:34px;padding:3px 5px;font-size:10px}
body.touch-mode #app #hud .instrument .vehicle-aids svg{width:12px;height:12px;display:block}
body.touch-mode #app #hud .instrument .drive-speed-controls{display:flex;gap:4px}
body.touch-mode #app #hud .instrument .speed-row{display:flex;flex-wrap:nowrap;gap:3px;min-width:0}
body.touch-mode #app.vehicle-hud #hud .instrument .speed-row strong{font-size:23px;min-width:25px}
body.touch-mode #app #hud #vehicle-hud-name:not([hidden]){font-size:9px;max-width:none;white-space:normal;line-height:1.05;padding-left:3px}
body.touch-mode #app #hud #speed-lock-control{min-height:28px}
body.touch-mode #app #hud #speed-lock-label{font-size:9px;padding:3px}
body.touch-mode #app #hud .instrument #vehicle-speed-stats:not([hidden]){display:flex;flex-wrap:wrap;gap:1px 6px;font-size:8.5px;line-height:1.25;margin-top:4px}
body.touch-mode #app.car-hud #hud .instrument #vehicle-speed-stats:not([hidden]){display:grid;gap:2px}
body.touch-mode #app #hud .instrument .meters{margin-top:3px;padding-top:3px;gap:6px}
body.touch-mode #app #hud .instrument .meters>span{font-size:9px}
body.touch-mode #app #hud .instrument .meter-label331{display:block;font-size:8px}
body.touch-mode #app #hud .instrument .driver-status-line{margin-top:3px}
body.touch-mode #app #hud .instrument #driver-health-hud{min-height:24px;padding:3px 6px;font-size:10px}
body.touch-mode #app #hud .shortcuts{position:absolute;right:var(--right);left:auto;bottom:calc(var(--bottom) + var(--hud-control-rail,96px));gap:6px;transform:scale(var(--hud-controls-scale,1));transform-origin:bottom right}
body.touch-mode #app #hud .shortcuts .icon-button{width:42px;min-height:46px;border-radius:12px}
body.touch-mode #app #hud .shortcuts .view-key{width:62px}
body.touch-mode #app #hud .shortcuts .view-key small{font-size:8px}
body.touch-mode #app #hud .shortcuts .icon-button svg{width:24px;height:24px}
body.touch-mode #app #hud .context{position:absolute;left:50%;right:auto;bottom:var(--bottom);width:max-content;max-width:38%;min-width:0;transform:translateX(-50%) scale(var(--hud-panel-scale,1));transform-origin:bottom center;gap:3px}
body.touch-mode #app #hud .context .context-actions{gap:6px;max-width:100%}
body.touch-mode #app #hud .context .drive-action{min-height:40px;font-size:12px;padding:6px 10px}
body.touch-mode #app #hud #car-controls button{min-height:28px;padding:4px 8px;font-size:11px;border-radius:10px}
body.touch-mode #app #hud #ride-talk{transform:scale(var(--hud-panel-scale,1));transform-origin:top left}
body.touch-mode #app #hud .offer-toast{max-width:220px;font-size:11px;white-space:normal}
body.touch-mode #app #hud.hud-edit-all .touch{pointer-events:none}
@media(orientation:landscape) and (max-width:780px){body.touch-mode #app #hud .context{bottom:calc(var(--bottom) + var(--hud-control-rail,96px) + 7px);max-width:43%}body.touch-mode #app #hud .context p{display:none}body.touch-mode #app #hud .hud-head{gap:6px}}
/* Portrait keeps the same left/right roles with a separate, wider vertical stacking order. */
body.touch-portrait{--side:max(8px,env(safe-area-inset-left));--right:max(8px,env(safe-area-inset-right));--top:max(8px,env(safe-area-inset-top));--bottom:max(10px,env(safe-area-inset-bottom))}
body.touch-portrait #app #hud .hud-head{max-width:calc(100% - var(--side) - var(--right) - 116px);gap:4px}
body.touch-portrait #app #hud .hud-brand{padding:3px}
body.touch-portrait #app #hud .hud-brand img{width:27px;height:27px}
body.touch-portrait #app #hud .climate{width:auto;min-width:56px;min-height:33px;grid-template-columns:14px auto;padding:3px 4px;gap:1px 2px}
body.touch-portrait #app #hud .climate .city-clock{display:grid;gap:0}
body.touch-portrait #app #hud #weather-label,body.touch-portrait #app #hud #city-bulletin{display:none}
body.touch-portrait #app #hud .wallet-controls331{flex:1;min-width:0}
body.touch-portrait #app #hud .wallet-trip-stack{min-width:0;max-width:100%}
body.touch-portrait #app #hud #trip-review-hud{min-height:33px;max-width:100%;padding:4px 5px;gap:4px;flex-wrap:wrap}
body.touch-portrait #app #hud #trip-review-hud[data-empty="true"] #trip-review-score{font-size:9px}
body.touch-portrait #app #hud #trip-review-score{font-size:12px}
body.touch-portrait #app #hud #trip-review-count{font-size:8px;white-space:normal}
body.touch-portrait #app #hud #money-hud33{min-height:29px;font-size:10px;padding:4px 5px;max-width:100%}
body.touch-portrait #app #hud .map-wrap{grid-template-columns:65px 42px;grid-template-rows:48px 35px;gap:4px;transform:scale(var(--hud-panel-scale,1))}
body.touch-portrait #app #hud .map-card{grid-column:1;grid-row:1;width:65px;height:48px}
body.touch-portrait #app #hud .hud-menu{grid-column:2;grid-row:1}
body.touch-portrait #app #hud .fps-hud{grid-column:1;grid-row:2;justify-self:end}
body.touch-portrait #app #hud #garage-pin359{grid-column:2;grid-row:2;width:42px;min-height:35px;font-size:10px}
body.touch-portrait #app #hud #garage-pin359 svg{display:none}
body.touch-portrait #app #hud .touch-pedals{gap:5px}
body.touch-portrait #app #hud .touch-pedals .reverse-pedal{width:46px;height:54px}
body.touch-portrait #app #hud .touch-pedals .brake-pedal{width:48px;height:54px}
body.touch-portrait #app #hud .touch-pedals .boost-pedal{width:48px;height:64px}
body.touch-portrait #app #hud .touch-pedals .gas-pedal{width:56px;height:68px}
body.touch-portrait #app.vehicle-hud #hud .bottom>.instrument{width:146px}
body.touch-portrait #app #hud .shortcuts .view-key{display:none}
body.touch-portrait #app #hud .context{bottom:calc(var(--bottom) + var(--hud-control-rail,96px) + var(--hud-instrument-height,150px) + 8px);max-width:92%}
body.touch-portrait #app #hud .context p{display:none}
body.touch-portrait #app #hud .hud-shortcuts{gap:5px}
@media(orientation:portrait) and (max-height:620px){body.touch-portrait #app #hud .context .drive-action{min-height:34px;font-size:10px}body.touch-portrait #app #hud .context{bottom:calc(var(--bottom) + var(--hud-control-rail,96px) + var(--hud-instrument-height,150px) + 4px)}}
/* Dialogs and the in-game phone follow the available viewport, including browser chrome. */
.phone{max-height:calc(100% - var(--top) - var(--bottom));width:min(389px,calc(100% - var(--side) - var(--right)))}
.dialog{max-height:calc(100% - 12px)}
@media(max-width:400px){.dialog-content{padding:10px}.phone-content{padding:9px}.phone-head{gap:6px}.phone-head strong{font-size:15px}}
/* Keep the reference wheel size independent of legacy portrait breakpoints. */
body.touch-mode[data-touch-layout][data-control-size]{--touch-size:86px}
body.touch-mode[data-touch-layout][data-control-size="small"]{--touch-size:86px}
body.touch-mode[data-touch-layout][data-control-size="large"]{--touch-size:86px}
body.touch-mode #app #hud .bottom>.context{transform:translateX(-50%) scale(var(--hud-panel-scale,1));transform-origin:bottom center}
body.touch-mode #app #hud #jump-key{position:absolute}
#hud{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* Keyboard layouts keep the dashboard above the left key cluster and clear of central actions. */
body.desktop-mode #app #hud{--desktop-rail:123px}
body.desktop-mode #app #hud .bottom{display:contents}
body.desktop-mode #app #hud #desktop-controls{bottom:var(--bottom);align-items:flex-end}
body.desktop-mode #app #hud .desktop-extras{grid-template-columns:repeat(2,minmax(64px,auto));gap:5px}
body.desktop-mode #app #hud .desktop-key{min-height:52px;height:52px;padding:3px 7px}
body.desktop-mode #app #hud .bottom>.instrument{position:absolute;left:var(--side);bottom:calc(var(--bottom) + var(--desktop-rail));width:194px;max-width:none;transform:none;transform-origin:bottom left}
body.desktop-mode #app #hud .bottom>.context{position:absolute;left:50%;right:auto;bottom:var(--bottom);width:max-content;max-width:35%;transform:translateX(-50%);transform-origin:bottom center}
body.desktop-mode #app #hud .bottom>.shortcuts{position:absolute;right:var(--right);bottom:calc(var(--bottom) + 90px);gap:5px}
@media(max-width:1100px){body.desktop-mode #app #hud .bottom>.context{bottom:calc(var(--bottom) + var(--desktop-rail) + 8px);max-width:38%}}
@media(max-height:520px){body.desktop-mode #app #hud{--desktop-rail:99px}body.desktop-mode #app #hud .desktop-key{min-height:40px;height:40px;font-size:11px;line-height:1.1}body.desktop-mode #app #hud .bottom>.instrument{width:184px;padding:5px 6px}body.desktop-mode #app #hud .instrument .speed-row strong{font-size:26px;min-width:30px}body.desktop-mode #app #hud .instrument .vehicle-aids button{min-height:28px;font-size:9px}body.desktop-mode #app #hud .instrument #driver-health-hud{min-height:24px;font-size:10px}}
@media(max-height:420px){body.desktop-mode #app #hud .bottom>.instrument{transform:scale(.9);transform-origin:bottom left}}
