/* V31: physically legible controls, restrained cockpit with no screen-space flicker. */
.v31-drive-telemetry{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;align-items:center;color:#e7f4f4;border-bottom:1px solid rgba(180,222,225,.16);padding:0 2px 8px}
.v31-speed{grid-row:span 2;display:flex;flex-direction:column;align-items:flex-start;line-height:1.1;min-width:90px}
.v31-speed strong{font:600 28px/1.1 ui-monospace,Consolas,monospace;letter-spacing:-1.5px;color:#b6edee;font-variant-numeric:tabular-nums}
.v31-speed small{font-size:9px;color:#a6bbc3}
.v31-physics{display:flex;gap:13px;align-items:center;font:10px ui-monospace,Consolas,monospace;color:#d7e5e9;flex-wrap:wrap}
.v31-drive-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.v31-drive-actions button{background:#14313e;color:#e5f3f3;border:1px solid #417080;border-radius:7px;padding:5px 9px;font-size:10px;cursor:pointer}
.v31-drive-actions button[aria-pressed=true]{border-color:#e1c67f;color:#f4dc9e}
#v31DriveHint{font-size:10px;color:#b1c9cf}
.v31-pedals{grid-column:1/-1;display:flex;align-items:center;gap:7px;justify-content:flex-end}
.v31-pedal,.v31-steer{user-select:none;touch-action:none;color:#fff;background:#193746;border:1px solid #4f8290;border-radius:8px;padding:6px 14px;cursor:pointer;min-width:53px;min-height:38px;font-size:12px;font-weight:650;line-height:1.2}
.v31-pedal small{color:#b6d3d7;font-size:9px;font-weight:400}
.v31-pedal:active,.v31-steer:active{background:#396a70}
.v31-brake{border-color:#cb927d;background:#402927}
.v31-accelerator{border-color:#8cbb9e}
body.is-driving .drive-cockpit{will-change:opacity;transform:translate3d(-50%,0,0)}
body.is-driving .drive-cockpit .wheel{transition:transform .15s ease}
.drive-controls{max-height:min(45vh,360px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.drive-stage-mark{background:rgba(7,29,36,.7);font-size:10px}
@media(max-width:660px){
 .drive-controls{bottom:7px;max-height:39vh;padding:9px 12px;gap:5px}
 .v31-drive-telemetry{grid-template-columns:auto 1fr;gap:3px 9px;padding-bottom:6px}
 .v31-speed{min-width:65px}.v31-speed strong{font-size:23px}.v31-speed small{font-size:8px}
 .v31-physics{gap:4px 8px;font-size:9px}.v31-physics span:nth-child(3){display:none}
 .v31-drive-actions{gap:5px}.v31-drive-actions button{font-size:9px;padding:5px 7px}
 #v31DriveHint{font-size:8px;line-height:1.3}
 .v31-pedals{justify-content:space-between;gap:5px}
 .v31-pedal,.v31-steer{padding:5px 11px;min-width:50px;min-height:38px;font-size:11px}
 .drive-view-rail{bottom:43vh!important;gap:5px}
 .drive-view-rail .drive-btn{background:rgba(1,17,26,.92)}
 .drive-cockpit{bottom:35vh!important;height:70px;opacity:.8}
 .drive-cockpit .wheel{width:64px;height:64px}
 .drive-narrative{max-width:230px;top:76px;opacity:.93}
 .drive-narrative p{display:none}
 .drive-look-controls{display:none}
}
/* Compact desktop layout to preserve road visibility and a readable sightline. */
@media(min-width:661px){
 .drive-controls{width:min(850px,calc(100vw - 28px));bottom:11px;padding:9px 14px;gap:6px;max-height:190px}
 .v31-drive-telemetry{grid-template-columns:84px 1fr 184px;grid-template-rows:auto auto;gap:3px 10px;padding-bottom:6px}
 .v31-speed{grid-column:1;grid-row:1 / 3}
 .v31-physics{grid-column:2;grid-row:1;gap:7px 12px}
 .v31-drive-actions{grid-column:2;grid-row:2}
 .v31-pedals{grid-column:3;grid-row:1 / 3;justify-content:flex-end;flex-wrap:wrap;align-self:center}
 .v31-pedal,.v31-steer{min-width:44px;padding:5px 7px;min-height:35px}
 .v31-pedal small{display:none}
 .drive-cockpit{bottom:87px}
 .drive-look-controls{bottom:143px}
}
/* Mission cards must never cover the 1–4 camera selectors or W/S driving controls. */
@media(min-width:761px){
 body.is-driving #v20BridgeMission.v20-bridge-mission{
  left:16px!important;right:auto!important;bottom:155px!important;top:auto!important;
  width:min(334px,calc(100vw - 30px))!important;max-height:min(43vh,420px)!important;
 }
 .drive-look-controls{bottom:205px!important}
}
@media(max-width:760px){
 body.is-driving #v20BridgeMission.v20-bridge-mission{
  top:auto!important;bottom:41vh!important;left:8px!important;right:8px!important;
  max-height:31vh!important;width:auto!important;
 }
 .drive-view-rail{top:78px!important;bottom:auto!important}
}

/* Subtle damped cabin roll, derived from the physics model; no random camera shake. */
body.is-driving .drive-cockpit{transform:translate3d(-50%,0,0) rotate(var(--v31-roll,0deg));transform-origin:50% 85%}
