:root {
  --bg: #14181d;
  --panel: rgba(16, 20, 26, 0.78);
  --panel-solid: #181d24;
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef2f6;
  --muted: #a9b4c0;
  --amber: #ffb02e;
  --green: #37e67b;
  --red: #ff5a4f;
  --blue: #4fc3ff;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { overscroll-behavior-x: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--amber); color: #111; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.sim-shell { position: relative; }
.stage {
  position: relative; width: 100%; height: 100vh; height: 100svh; min-height: 300px; overflow: hidden;
  background: #9fb6c8; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: none;
}
.stage:focus-visible { box-shadow: inset 0 0 0 3px var(--amber); }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body[data-view="loading"] .hud-top, body[data-view="loading"] .cluster { visibility: hidden; }

/* ---------- top HUD ---------- */
.hud-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 0 calc(128px + var(--safe-l)); pointer-events: none; z-index: 5;
}
.obj {
  pointer-events: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 13px 10px;
  max-width: min(440px, 46vw); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.obj .title { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); font-weight: 800; }
.obj p { margin: 0; }
.obj-mode { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.diff-chip { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,0.1); color: var(--text); }
.diff-chip[data-d="assisted"] { background: rgba(55,230,123,0.18); color: #9ff2c0; }
.diff-chip[data-d="standard"] { background: rgba(79,195,255,0.18); color: #a9e2ff; }
.diff-chip[data-d="expert"] { background: rgba(255,90,79,0.2); color: #ffb3ad; }
.obj-title { font-size: 16px; font-weight: 750; margin-top: 2px !important; line-height: 1.2; }
.obj-text { font-size: 13px; color: #d4dbe2; margin-top: 3px !important; line-height: 1.35; }
.obj-steps { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: #d4dbe2; line-height: 1.35; }
.obj-steps li.now { color: var(--text); font-weight: 650; }
.obj-steps li.done { color: var(--green); }
.obj-progress { font-size: 12px; color: var(--amber); margin-top: 4px !important; font-weight: 650; }
.top-actions { display: flex; gap: 6px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.hbtn {
  min-width: 44px; height: 44px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 13px; font-weight: 650;
}
.hbtn svg { width: 20px; height: 20px; flex: none; }
.hbtn:hover { background: rgba(40, 48, 58, 0.9); }
.hbtn[aria-pressed="true"] { border-color: var(--blue); color: #bfe9ff; }
.hbtn[disabled] { opacity: 0.4; cursor: not-allowed; }
.hbtn.sound .x { display: none; }
.hbtn.sound[aria-pressed="true"] .x { display: block; }
.hbtn.sound[aria-pressed="true"] .wave { display: none; }
.hbtn.menu { background: rgba(255,176,46,0.92); color: #1b1408; border-color: transparent; }

/* ---------- instrument cluster ---------- */
.cluster {
  position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); z-index: 4; display: flex; gap: 8px; align-items: stretch;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.c-speed { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; }
.c-speed b { font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1; }
.c-speed small { color: var(--muted); font-size: 11px; }
.c-gear { display: flex; flex-direction: column; justify-content: center; gap: 1px; font-weight: 800; font-size: 13px; }
.c-gear span { width: 26px; text-align: center; border-radius: 6px; color: #5d6773; line-height: 18px; }
.c-gear span.on { background: var(--amber); color: #1b1408; }
.c-gear span.on[data-g="R"] { background: #fff; color: #111; }
.c-steer { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.mini-wheel { width: 40px; height: 40px; color: #dfe5ea; transition: none; }
.c-steer-txt { display: flex; flex-direction: column; gap: 4px; min-width: 84px; font-size: 12px; font-variant-numeric: tabular-nums; }
.c-steer .bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.c-steer .bar em { position: absolute; left: 50%; top: -2px; width: 2px; height: 10px; background: #fff; transform: translateX(-1px); }
.c-steer .bar i { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: var(--amber); border-radius: 3px; }
.c-artic { display: flex; align-items: center; gap: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.c-artic svg { width: 52px; height: 52px; }
.c-artic svg rect { fill: #cfd6dd; }
.c-artic svg .tractor { fill: var(--amber); }
.c-artic svg .pin { fill: #111; }
.c-artic[data-level="warn"] svg #artic-trailer rect { fill: #ffd34a; }
.c-artic[data-level="danger"] svg #artic-trailer rect { fill: var(--red); }
.c-artic[data-level="danger"] span { color: var(--red); font-weight: 800; }

/* ---------- prompts ---------- */
.hint {
  position: absolute; left: 50%; top: calc(86px + var(--safe-t)); transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 99px; background: rgba(20, 26, 34, 0.85); border: 1px solid rgba(79,195,255,0.5); font-weight: 700; font-size: 15px; white-space: nowrap;
}
.hint svg { width: 22px; height: 22px; color: var(--blue); }
.hint[data-kind="right"] svg { transform: scaleX(-1); }
.hint[data-kind="hold"] svg, .hint[data-kind="pull"] svg { display: none; }
.hint[data-kind="pull"] { border-color: var(--amber); }
.warn {
  position: absolute; left: 50%; top: calc(132px + var(--safe-t)); transform: translateX(-50%); z-index: 4; padding: 7px 14px; border-radius: 10px;
  background: rgba(255, 90, 79, 0.92); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 0.02em;
}
.warn[data-level="warn"] { background: rgba(255, 196, 46, 0.94); color: #1b1408; }
.toast {
  position: absolute; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(10px); z-index: 6; max-width: min(560px, 92vw);
  padding: 10px 16px; border-radius: 12px; background: rgba(16,20,26,0.92); border: 1px solid var(--line); font-weight: 650; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast:not(.show) { visibility: hidden; transition: opacity .2s, transform .2s, visibility 0s .2s; }
.toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.toast button { margin-left: 10px; }
.toast.bad { border-color: rgba(255,90,79,0.7); }
.toast.good { border-color: rgba(55,230,123,0.7); }
.park { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; text-shadow: 0 1px 3px #000; pointer-events: none; }
.park svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.park .track { fill: none; stroke: rgba(0,0,0,0.35); stroke-width: 5; }
.park .fill { fill: none; stroke: var(--green); stroke-width: 5; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; stroke-linecap: round; }
.flash { position: absolute; inset: 0; pointer-events: none; z-index: 3; box-shadow: inset 0 0 0 0 rgba(255,60,50,0); transition: box-shadow .35s; }
.flash.on { box-shadow: inset 0 0 70px 18px rgba(255,60,50,0.55); transition: none; }

.guide {
  position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); z-index: 5; width: 270px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.guide p { margin: 0 0 4px; }
.guide-tip { color: var(--amber); margin-top: 6px !important; }
.guide-x { position: absolute; right: 4px; top: 2px; width: 40px; height: 40px; border: 0; background: none; font-size: 22px; color: var(--muted); }
.guide-touch { display: none; }
body.touch-ui .guide-touch { display: block; }
body.touch-ui .guide-keys { display: none; }
kbd { display: inline-block; min-width: 22px; padding: 0 5px; border-radius: 5px; background: #2a323c; border: 1px solid #4a5563; border-bottom-width: 2px; font: 700 12px/18px system-ui, sans-serif; text-align: center; }
.resume { position: absolute; left: 50%; top: calc(92px + var(--safe-t)); transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 99px; background: rgba(16,20,26,0.92); border: 1px solid var(--amber); font-weight: 650; font-size: 14px; }
.pill { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 0; background: var(--amber); color: #1b1408; font-weight: 800; }
.pill.ghost { background: rgba(255,255,255,0.1); color: var(--text); width: 36px; padding: 0; }

/* ---------- touch controls ---------- */
.touch { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l)); pointer-events: none; }
.touch > * { pointer-events: auto; }
.t-steer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wheel { width: 168px; height: 168px; border-radius: 50%; touch-action: none; background: radial-gradient(circle, rgba(0,0,0,0.0) 52%, rgba(0,0,0,0.28) 53%); }
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel .rim { fill: none; stroke: #222830; stroke-width: 11; }
.wheel .rim-in { fill: rgba(20,24,30,0.35); stroke: #4a5361; stroke-width: 2; }
.wheel .spoke { fill: none; stroke: #3a424e; stroke-width: 7; stroke-linejoin: round; }
.wheel .hub { fill: #2a313a; stroke: #6b7684; stroke-width: 2; }
.wheel .mark { fill: var(--amber); }
.wheel.active .rim { stroke: #2d3640; }
.tbtn { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 750; font-size: 14px; }
.tbtn.primary { background: var(--amber); color: #1b1408; border-color: transparent; }
.tbtn[disabled] { opacity: 0.45; }
.t-pedals { display: grid; grid-template-columns: 84px 84px; grid-template-rows: 84px 64px; gap: 8px; }
.truck-only.t-pedals { grid-template-rows: 48px 96px; }
.pedal { border-radius: 16px; border: 2px solid rgba(255,255,255,0.18); background: rgba(22,27,34,0.82); font-weight: 900; font-size: 15px; letter-spacing: 0.04em; touch-action: none; }
.pedal.fwd { color: #9ff2c0; }
.pedal.rev { color: #fff; }
.pedal.brake { grid-column: 1 / span 2; color: #ffb3ad; }
.pedal.throttle { color: #9ff2c0; grid-column: 2; grid-row: 2; }
.truck-only .brake { grid-column: 1; grid-row: 2; }
.pedal.down { background: rgba(255,176,46,0.85); color: #1b1408; border-color: var(--amber); transform: scale(0.97); }
.gears { grid-column: 1 / span 2; grid-row: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gearbtn { border-radius: 10px; border: 1px solid var(--line); background: rgba(22,27,34,0.85); font-weight: 900; }
.gearbtn.on { background: var(--amber); color: #1b1408; }
.gearbtn.on[data-gear="R"] { background: #fff; color: #111; }
.truck-only { display: none; }
body.truck-controls .truck-only { display: grid; }
body.truck-controls .simple-only { display: none; }
body.touch-ui .cluster { left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); padding: 6px 8px; gap: 6px; }
body.touch-ui .guide { bottom: auto; top: calc(150px + var(--safe-t)); }
body.touch-ui .toast { bottom: calc(200px + var(--safe-b)); }

.look-ui, .edit-ui { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); z-index: 6; display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); }
.look-label, .edit-ui > span { font-size: 13px; color: var(--muted); padding: 0 6px; }
body.looking .cluster, body.looking .touch, body.editing .touch, body.editing .cluster { display: none; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); background: rgba(8, 10, 14, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet[hidden] { display: none; }
.sheet-card { width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); overscroll-behavior: contain; }
.sheet-card.wide { width: min(980px, 100%); }
.sheet-card.narrow { width: min(460px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 20px; flex: 1; }
.x, .back { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); font-size: 20px; }
.sheet-note { color: var(--muted); font-size: 14px; margin: 4px 0 12px; line-height: 1.45; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick .ghost { min-height: 44px; font-size: 14px; }
.quick .ghost[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }
.mode { text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); display: flex; flex-direction: column; gap: 4px; min-height: 88px; }
.mode strong { font-size: 16px; }
.mode span { color: var(--muted); font-size: 13px; }
.mode:hover { border-color: var(--amber); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.cta, .ghost { min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 750; border: 1px solid var(--line); background: rgba(255,255,255,0.06); text-decoration: none; display: inline-flex; align-items: center; }
.cta { background: var(--amber); color: #1b1408; border-color: transparent; }
.ghost.danger { color: #ffb3ad; border-color: rgba(255,90,79,0.5); }
.diff-pick { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 2px 0 4px; }
.diff-pick button { min-height: 42px; padding: 0 16px; border: 0; background: transparent; font-weight: 700; }
.diff-pick button[aria-checked="true"] { background: var(--amber); color: #1b1408; }
.ch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ch-group { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgba(255,255,255,0.025); }
.ch-group h3 { margin: 0 0 8px; font-size: 14px; color: var(--amber); display: flex; justify-content: space-between; gap: 8px; }
.ch-group h3 small { color: var(--muted); font-weight: 500; }
.ch { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 10px; border: 1px solid transparent; background: rgba(255,255,255,0.04); margin-top: 6px; min-height: 52px; }
.ch:hover, .ch:focus-visible { border-color: var(--amber); }
.ch .num { font-weight: 900; color: var(--muted); }
.ch .nm { font-size: 14px; font-weight: 650; line-height: 1.2; }
.ch .nm small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.ch .st { color: #4d5763; font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.ch .st b { color: var(--amber); font-weight: 400; }
.ch .best { display: block; font-size: 11px; color: var(--muted); text-align: right; letter-spacing: 0; }
.ch.rec { border-color: rgba(79,195,255,0.45); }
.ls-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ls { width: 100%; text-align: left; display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); }
.ls .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.08); font-weight: 800; }
.ls.done .n { background: var(--green); color: #082012; }
.ls strong { display: block; }
.ls span { color: var(--muted); font-size: 13px; }
.settings { display: grid; gap: 4px; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); min-height: 48px; }
.set span { font-size: 14px; }
.set select { background: #232a33; border: 1px solid var(--line); border-radius: 10px; min-height: 40px; padding: 0 10px; max-width: 58%; }
.set input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--amber); }
.set input[type="range"] { width: 46%; accent-color: var(--amber); }
.set output { color: var(--amber); font-variant-numeric: tabular-nums; margin-left: 6px; }
.help-list { padding-left: 18px; line-height: 1.5; color: #d4dbe2; }
.help-list li { margin-bottom: 8px; }
.results .kicker { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.results h2 { margin: 2px 0 6px; font-size: 28px; }
.stars { font-size: 34px; letter-spacing: 6px; color: #3a434e; }
.stars span.on { color: var(--amber); }
.score { display: flex; align-items: baseline; gap: 6px; }
.score strong { font-size: 44px; font-variant-numeric: tabular-nums; }
.score span { color: var(--muted); }
.record { color: var(--green); font-weight: 800; margin: 2px 0; }
.parts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.parts div { background: rgba(255,255,255,0.04); border-radius: 10px; padding: 8px 10px; }
.parts dt { font-size: 12px; color: var(--muted); }
.parts dd { margin: 2px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.deduct { margin: 6px 0; padding-left: 18px; color: #d4dbe2; font-size: 14px; line-height: 1.45; }

.loading { position: absolute; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 12px; background: #1b2229; font-weight: 650; }
.loading[hidden] { display: none; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.15); border-top-color: var(--amber); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fallback { position: absolute; inset: 0; z-index: 41; display: grid; place-content: center; text-align: center; gap: 8px; padding: 24px; background: #1b2229; }

.about { max-width: 860px; margin: 0 auto; padding: 36px 20px 64px; line-height: 1.6; color: #d6dde4; }
.about h2 { color: var(--text); font-size: 26px; margin: 0 0 10px; }
.about h3 { color: var(--text); margin: 26px 0 8px; }
.about a { color: var(--amber); }
.faq dt { font-weight: 750; color: var(--text); margin-top: 12px; }
.faq dd { margin: 4px 0 0; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .hud-top { padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r)); padding-top: calc(66px + var(--safe-t)); flex-direction: column; align-items: stretch; gap: 6px; }
  .obj { max-width: none; padding: 7px 10px; }
  .obj .title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .obj-title { font-size: 14px; }
  .obj-text { font-size: 12px; }
  .obj-steps { font-size: 12px; }
  .top-actions { position: absolute; top: calc(10px + var(--safe-t)); right: calc(8px + var(--safe-r)); gap: 5px; flex-wrap: nowrap; }
  #pred-btn, #mute-btn { display: none; }
  .hbtn { padding: 0 9px; height: 44px; }
  .hbtn .lbl, #cam-label { display: none; }
  .hint { top: auto; bottom: calc(316px + var(--safe-b)); font-size: 14px; }
  .warn { top: auto; bottom: calc(360px + var(--safe-b)); }
  .menu-grid { grid-template-columns: 1fr; }
  .mode { min-height: 64px; }
  .parts { grid-template-columns: 1fr; }
  body.touch-ui .cluster { left: 50%; bottom: calc(236px + var(--safe-b)); transform: translateX(-50%); }
  body.touch-ui .c-steer-txt { min-width: 64px; }
  body.touch-ui .guide { top: auto; bottom: calc(318px + var(--safe-b)); left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); width: auto; }
  .wheel { width: 150px; height: 150px; }
  .t-pedals { grid-template-columns: 74px 74px; grid-template-rows: 78px 58px; }
  body.touch-ui .toast { bottom: calc(316px + var(--safe-b)); }
}
/* landscape phones: keep the controls at the sides and the HUD slim */
@media (max-height: 500px) and (orientation: landscape) {
  .hud-top { padding-top: calc(8px + var(--safe-t)); padding-left: calc(128px + var(--safe-l)); flex-direction: row; }
  .obj { max-width: 46vw; padding: 6px 10px; }
  .obj .title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .obj-text { display: none; }
  .obj-steps { display: none; }
  .top-actions { position: static; }
  .hbtn .lbl, #cam-label { display: none; }
  .wheel { width: 132px; height: 132px; }
  .t-steer { flex-direction: row; align-items: flex-end; }
  .t-pedals { grid-template-columns: 70px 70px; grid-template-rows: 70px 50px; gap: 6px; }
  body.touch-ui .cluster { bottom: calc(8px + var(--safe-b)); transform: translateX(-50%) scale(0.92); transform-origin: bottom center; }
  body.touch-ui .guide { top: calc(64px + var(--safe-t)); width: 240px; }
  .hint { top: calc(60px + var(--safe-t)); bottom: auto; }
  .warn { top: calc(100px + var(--safe-t)); bottom: auto; }
  body.touch-ui .toast { bottom: calc(80px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) { .toast, .flash { transition: none; } .spinner { animation-duration: 2.5s; } }
body.reduced .toast, body.reduced .flash { transition: none; }
