.engine-lab {
  font-size: 16px;
  line-height: normal;
  h1, h2, h3, p { line-height: normal; }
  .switch strong, .switch small, .segmented button { white-space: normal; }
  .switch { height: auto; min-height: 94px; }
  .brand-title h1 { line-height: 1.2; margin: 0; }
& {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #0f1011;
  --raised: #161718;
  --lime: #e4f222;
  --text: #f4f5f7;
  --secondary: #d0d6e0;
  --muted: #8a8f98;
  --dim: #727780;
  --border: #282b30;
  --border-light: #383b42;
  --danger: #ff8569;
  --warning: #dcb66b;
  --signal: #90bad5;
  --signal-grid: #282d3560;
  --signal-base: #90bad526;
  --gauge-tick: #c7ccd4;
  --gauge-minor: #656b75;
  --bezel-light: #89909a;
  --bezel-dark: #343940;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--font-inter-variable), Inter, sans-serif;
  font-synthesis: none;
  font-feature-settings: "cv01" on, "ss03" on, "zero" on;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
& { margin: 0; background: var(--bg); color: var(--text); }
button, input, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--lime); outline-offset: 5px; }
a { color: inherit; text-decoration: none; }
button { transition: border-color .18s, background .18s, color .18s; }
.cockpit { width: min(1480px, 92%); margin: auto; }

/* Orca chrome, with the instrument cluster as the visual centerpiece. */
.header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; margin-bottom: 18px; border-bottom: 1px solid #ffffff0b; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 36px; height: 36px; flex-shrink: 0; }
.brand-title h1 { display: block; font-size: 21px; font-weight: 500; letter-spacing: -.6px; }
.brand-title small { display: block; margin-top: 5px; color: var(--muted); font: 8px var(--font-mono); letter-spacing: 1.6px; }
.header-right { display: flex; align-items: center; gap: 24px; }
.live-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 9px var(--font-mono); letter-spacing: 1px; }
.live-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); }
.outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: var(--panel); border: 1px solid var(--border-light); border-radius: 6px; padding: 11px 15px; font-size: 11px; color: var(--secondary); }
.outline-button:hover:not(:disabled) { background: var(--raised); border-color: var(--muted); color: #fff; }

.engine-support { position: fixed; inset: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; margin: auto; padding: 32px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 24px 80px #0008; }
.engine-support::backdrop { background: #08090ab3; }
.support-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.support-close:hover { background: var(--raised); color: var(--text); }
.support-star { display: inline-flex; margin-bottom: 20px; color: #e3b341; }
.support-star svg { fill: #e3b3411a; }
.engine-support h2 { margin: 0 0 14px; font-size: 24px; font-weight: 510; line-height: 1.25; letter-spacing: -.5px; }
.engine-support p { margin: 0; color: var(--secondary); font-size: 14px; line-height: 1.75; }
.support-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 26px; }
.support-github { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 14px; border: 1px solid #e5e5e6; border-radius: 6px; background: #e5e5e6; color: var(--bg); font-size: 13px; font-weight: 510; line-height: 1.5; text-align: center; }
.support-github:hover { background: #fff; border-color: #fff; color: var(--bg); }
.support-later { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; }
.support-later:hover { background: var(--raised); color: var(--text); }
.engine-support button:focus-visible, .engine-support a:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
@media (max-width: 480px) { .engine-support { padding: 28px 24px 20px; } }

/* Independent instruments suspended over the page, without a shared enclosure. */
.instrument { position: relative; isolation: isolate; padding: 14px 16px 24px; }
.cluster-topline, .cluster-bottomline { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; max-width: 1120px; margin-inline: auto; padding: 0 30px; color: var(--muted); font: 8px var(--font-mono); letter-spacing: 1px; }
.cluster-topline { display: grid; grid-template-columns: 1fr auto 1fr; }
.cluster-topline > span:last-child { justify-self: end; white-space: nowrap; }
.engine-selector { display: inline-flex; align-items: center; justify-self: start; gap: 8px; height: 34px; padding: 0 10px 0 6px; background: #ffffff03; border: 1px solid #ffffff0e; border-radius: 6px; color: var(--secondary); font: inherit; letter-spacing: inherit; white-space: nowrap; }
.engine-selector:hover, .engine-selector[aria-expanded=true] { background: #151719; border-color: var(--border-light); }
.engine-preview { display: flex; align-items: center; }
.engine-preview svg { display: block; width: 44px; height: 22px; }
.selector-chevron { width: 12px; height: 12px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s; }
.engine-selector[aria-expanded=true] .selector-chevron { transform: rotate(180deg); }
.cluster-signature { display: flex; align-items: center; gap: 8px; }
.cluster-signature i { display: inline-block; width: 12px; height: 8px; background: conic-gradient(#727780 25%, transparent 0 50%, #727780 0 75%, transparent 0) 0 0 / 6px 6px; opacity: .7; }
.cluster { display: grid; grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr); gap: 24px; align-items: center; max-width: 1120px; margin: 16px auto 14px; }
.dial { position: relative; isolation: isolate; aspect-ratio: 1; width: 100%; min-width: 0; max-width: 360px; justify-self: center; display: flex; justify-content: center; }
.dial::before { content: ""; position: absolute; z-index: -1; inset: -8%; background: radial-gradient(ellipse at 50% 70%, #90bad51c, transparent 66%); pointer-events: none; }
.dial::after { content: ""; position: absolute; z-index: -1; bottom: -14px; left: 16%; right: 16%; height: 28px; background: radial-gradient(ellipse, #000b, transparent 72%); pointer-events: none; }
.dial svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 14px 18px #000a); }
.dial text { font-family: Inter, "Helvetica Neue", Arial, sans-serif; font-variant-numeric: tabular-nums; }
.dial-needle { filter: drop-shadow(0 0 2px #ff856938); }
.center-display { text-align: center; align-self: center; padding: 8px 0; display: flex; flex-direction: column; justify-content: center; }
.status-line { display: flex; justify-content: space-around; gap: 8px; color: var(--dim); font: 8px var(--font-mono); letter-spacing: .3px; }
.status-chip { color: var(--muted); }
.status-chip::before { content: ""; display: inline-block; width: 4px; height: 4px; background: #62666d; border-radius: 50%; margin-right: 5px; }
.status-chip.running { color: var(--secondary); }
.status-chip.running::before { background: var(--lime); box-shadow: 0 0 7px #e4f22240; }
.mode-display { color: var(--secondary); font-size: 18px; font-weight: 500; letter-spacing: 3px; margin: 14px 0 6px; }
.mode-display::before { content: ""; display: inline-block; width: 15px; height: 9px; margin-right: 10px; background: repeating-linear-gradient(115deg, var(--lime) 0 3px, transparent 3px 5px); }
.gear-display { padding: 6px 0 8px; }
.tiny-label { font: 8px var(--font-mono); letter-spacing: 1.3px; color: var(--muted); }
.gear-display strong { display: block; font: 400 72px/1.15 var(--font-mono); color: var(--text); text-shadow: 0 6px 28px #90bad518; }
.gear-display > span:last-child { display: block; color: var(--muted); font: 7px var(--font-mono); letter-spacing: .7px; }
.digital-values { display: flex; justify-content: space-evenly; padding: 12px 0; }
.digital-values > div { flex: 1; min-width: 0; }
.digital-values > div + div { border-left: 1px solid var(--border); }
.digital-values strong { display: block; font: 400 23px var(--font-mono); color: var(--secondary); font-variant-numeric: tabular-nums; }
.digital-values span { display: block; font: 7px var(--font-mono); letter-spacing: 1.6px; color: var(--muted); margin-top: 7px; }
.shift-lights { display: flex; justify-content: center; gap: 5px; margin: 2px 0 12px; }
.shift-lights i { width: 12px; height: 4px; background: #292d32; border-radius: 1px; }
.shift-lights i.active { background: var(--lime); box-shadow: 0 0 6px #e4f22240; }
.shift-lights i:nth-last-child(3).active { background: var(--warning); }
.shift-lights i:last-child.active, .shift-lights i:nth-last-child(2).active { background: var(--danger); box-shadow: 0 0 8px #ff856950; }
.cluster-note > span { font: 8px var(--font-mono); letter-spacing: 1px; color: var(--secondary); }
.cluster-note small { display: block; font: 6px var(--font-mono); letter-spacing: .7px; color: var(--dim); margin-top: 8px; }
.cluster-bottomline { font-size: 7px; letter-spacing: .8px; padding-top: 10px; }

/* A compact, text-first preset drawer with a scrollable engine list. */
.garage { display: none; position: fixed; inset: 0 0 0 auto; width: min(388px, 100%); height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; overflow: hidden; flex-direction: column; color: var(--text); background: var(--panel); border: 0; border-left: 1px solid var(--border-light); border-radius: 0; box-shadow: -16px 0 48px #0005; opacity: 0; transform: translateX(100%); transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .2s, display .28s allow-discrete, overlay .28s allow-discrete; }
.garage:popover-open { display: flex; opacity: 1; transform: translateX(0); }
.garage::backdrop { background: #0000; transition: background-color .28s, display .28s allow-discrete, overlay .28s allow-discrete; }
.garage:popover-open::backdrop { background: #0005; }
@starting-style {
  .garage:popover-open { opacity: 0; transform: translateX(100%); }
  .garage:popover-open::backdrop { background: #0000; }
}
.garage-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-shrink: 0; gap: 12px; padding: max(26px, env(safe-area-inset-top)) 24px 24px; border-bottom: 1px solid var(--border); }
.garage-heading .tiny-label { font-size: 9px; letter-spacing: 1px; }
.garage-heading h2 { margin: 12px 0 9px; font-size: 24px; line-height: 1.2; font-weight: 500; letter-spacing: -.6px; }
.garage-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.garage-close { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; margin: -4px -6px 0 0; padding: 8px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; }
.garage-close:hover { color: var(--text); background: var(--raised); border-color: var(--border-light); }
.garage-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.garage-list-heading { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; padding: 24px 24px 12px; color: var(--muted); font: 9px var(--font-mono); letter-spacing: .8px; }
.garage-list-heading > span:last-child { color: var(--dim); font-variant-numeric: tabular-nums; }
.vehicle-rail { display: flex; flex-direction: column; flex: 1; gap: 8px; min-width: 0; min-height: 0; padding: 4px 20px 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-light) transparent; }
.vehicle-card { display: flex; flex-direction: column; align-items: stretch; flex-shrink: 0; text-align: left; overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: #121416; padding: 17px 16px 14px; position: relative; min-width: 0; }
.vehicle-card::before { content: ""; position: absolute; top: 17px; bottom: 17px; left: 0; width: 2px; background: var(--lime); opacity: 0; transition: opacity .18s; }
.vehicle-card:hover { border-color: #4a4f57; background: #191c1f; }
.vehicle-card:focus-visible { outline-offset: -3px; }
.vehicle-card[aria-pressed=true] { border-color: #454a32; background: #181b14; }
.vehicle-card[aria-pressed=true]:hover { border-color: #656d43; background: #1d2117; }
.vehicle-card[aria-pressed=true]::before { opacity: 1; }
.vehicle-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vehicle-copy { display: block; min-width: 0; }
.vehicle-card .marque { display: block; color: var(--muted); font: 10px var(--font-mono); letter-spacing: 1px; }
.vehicle-card .vehicle-name { display: block; font-size: 19px; line-height: 1.3; font-weight: 500; letter-spacing: -.3px; margin-top: 4px; }
.vehicle-selection { display: inline-flex; align-items: center; flex-shrink: 0; gap: 4px; color: var(--lime); font-size: 11px; opacity: 0; }
.vehicle-selection svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.vehicle-card[aria-pressed=true] .vehicle-selection { opacity: 1; }
.vehicle-details { display: block; }
.vehicle-card .vehicle-subtitle { display: block; margin-top: 9px; color: var(--muted); font: 10px/1.6 var(--font-mono); letter-spacing: .1px; }
.card-engine-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #ffffff09; color: var(--muted); font: 10px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; }
.card-engine-label > span { white-space: nowrap; }
.card-engine-label strong { margin-left: 5px; color: var(--secondary); font-weight: 400; }
.card-engine-label small { font: inherit; color: var(--muted); }
.garage-footer { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; gap: 12px; padding: 16px 24px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; line-height: 1.6; }
.garage-footer > span:last-child { white-space: nowrap; }
.garage-footer kbd { margin-right: 5px; font-size: 9px; }

/* Mechanical console: tactile buttons, a machined start switch, metal pedals. */
.console { border: 1px solid var(--border-light); border-radius: 12px; background: linear-gradient(180deg, #181a1d, #121416); display: grid; grid-template-columns: 150px 1.35fr 1.15fr 1fr 185px; padding: 22px 0; box-shadow: inset 0 1px 0 #ffffff04; }
.console-section { padding: 0 22px; min-width: 0; }
.console-section + .console-section { border-left: 1px solid var(--border); }
.console h2 { margin: 0 0 18px; font: 9px var(--font-mono); letter-spacing: 1px; color: var(--muted); }
.ignition-section { text-align: center; }
.ignition { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 4px solid #454a50; outline: 1px solid #777e86; background: radial-gradient(circle at 35% 25%, #eff872, #dbe929 60%, #adb918); color: #171b0b; width: 94px; height: 94px; border-radius: 50%; box-shadow: 0 0 0 4px #090b0d, 0 4px 8px #0006, inset 0 0 0 2px #f6ff9d70; margin: 0 auto; transition: filter .18s, transform .1s; }
.ignition:hover:not(:disabled) { filter: brightness(1.08); }
.ignition:active { transform: translateY(2px); }
.ignition i { height: 3px; width: 23px; background: #56620b; border-radius: 1px; }
.ignition[aria-pressed=true] { background: radial-gradient(circle at 35% 25%, #2d3137, #1a1e23 65%, #111418); color: var(--text); box-shadow: 0 0 0 4px #090b0d, 0 4px 8px #0006, inset 0 0 0 1px #ffffff12; }
.ignition[aria-pressed=true] i { background: var(--lime); box-shadow: 0 0 7px #e4f22260; }
.ignition small { font: 6px var(--font-mono); letter-spacing: 1px; }
.ignition strong { font-size: 15px; font-weight: 600; letter-spacing: 1.7px; }
.ignition > span { font: 5px var(--font-mono); letter-spacing: .7px; opacity: .75; }
.switches, .segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid #07090b; border-radius: 6px; background: #0a0c0e; }
.switch { display: flex; align-items: center; flex-direction: column; border: 1px solid var(--border-light); border-radius: 4px; background: linear-gradient(#23262b, #1b1e22); padding: 10px 5px; flex: 1; min-width: 0; height: 94px; box-shadow: inset 0 1px 0 #ffffff04, 0 2px 2px #0003; }
.switch:hover, .segmented button:hover { border-color: #5a606a; background: #2a2e34; }
.switch i { height: 3px; width: 22px; background: #090b0d; border: 1px solid #0006; border-radius: 1px; }
.switch[aria-checked=true] i { background: var(--lime); box-shadow: 0 0 6px #e4f22240; }
.switch[aria-checked=true] { border-color: #62683c; }
.switch-icon { display: flex; align-items: center; justify-content: center; color: var(--secondary); height: 28px; margin: 5px 0 4px; }
.switch-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.switch strong { font-size: 10px; font-weight: 400; white-space: nowrap; }
.switch small { font: 6px var(--font-mono); letter-spacing: .1px; color: var(--muted); margin-top: 7px; white-space: nowrap; }
.segmented button { flex: 1; min-width: 0; padding: 22px 8px 13px; white-space: nowrap; position: relative; font-size: 11px; background: linear-gradient(#23262b, #1b1e22); border: 1px solid var(--border-light); border-radius: 4px; }
.segmented button::before { content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 22px; height: 3px; background: #090b0d; border: 1px solid #0006; border-radius: 1px; }
.segmented button[aria-pressed=true] { border-color: #62683c; color: #fff; }
.segmented button[aria-pressed=true]::before { background: var(--lime); box-shadow: 0 0 6px #e4f22240; }
.segmented small { display: block; font: 6px var(--font-mono); letter-spacing: .1px; color: var(--muted); margin-top: 10px; }
.neutral-button { display: flex; align-items: center; justify-content: space-between; gap: 7px; background: transparent; border: 0; padding: 11px 2px 0; width: 100%; color: var(--muted); font-size: 9px; }
.neutral-button > span { color: var(--secondary); font: 10px var(--font-mono); border: 1px solid var(--border-light); border-radius: 2px; padding: 2px 4px; }
.neutral-button i { font: 7px var(--font-mono); color: var(--muted); }
.neutral-button[aria-pressed=true] i, .neutral-button[aria-pressed=true] > span { color: var(--lime); }
.small-help { font-size: 9px; color: var(--muted); margin: 11px 0 0; line-height: 1.6; }
.pedals-section h2 { display: flex; justify-content: space-between; gap: 3px; font-size: 8px; }
.pedals-section h2 span { font-size: 5px; color: var(--dim); letter-spacing: .2px; }
.pedal-pair { display: flex; justify-content: center; align-items: flex-end; gap: 22px; margin-top: -5px; }
.pedal-pair > div { text-align: center; }
.pedal { border: 0; position: relative; background: transparent; display: block; padding: 0 3px; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .1s; }
.pedal-face { display: block; background: repeating-linear-gradient(0deg, #16191e 0 3px, transparent 3px 7px), linear-gradient(105deg, #545a64, #9ca3ab 45%, #565d67); border: 3px solid #7c838d; border-radius: 4px; box-shadow: 0 5px 3px #0007, inset 0 1px 2px #ffffff60; }
.brake .pedal-face { width: 49px; height: 35px; }
.throttle .pedal-face { width: 27px; height: 76px; }
.pedal[aria-pressed=true] { transform: translateY(5px) perspective(100px) rotateX(-9deg); }
.pedal[aria-pressed=true] .pedal-face { border-color: var(--lime); box-shadow: 0 0 10px #e4f22220; }
.brake[aria-pressed=true] .pedal-face { border-color: var(--danger); box-shadow: 0 0 10px #ff856920; }
.pedal-pair p { font: 6px var(--font-mono); letter-spacing: .3px; margin: 10px 0 0; color: var(--muted); white-space: nowrap; }
.pedal-pair output { color: var(--secondary); margin-left: 4px; font-variant-numeric: tabular-nums; }
.hint-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 13px 2px 0; }
.hint-row p { font-size: 9px; color: var(--muted); margin: 0; line-height: 1.8; }
.hint-row p span { margin: 0 4px; color: var(--dim); }
kbd { font: 8px var(--font-mono); color: var(--secondary); background: var(--raised); border: 1px solid var(--border-light); padding: 2px 4px; border-radius: 3px; }
.hint-row #notice { color: var(--muted); text-align: right; }
.hint-row #notice.error { color: var(--danger); }

/* Telemetry bench: quiet surfaces and cool-blue signal visualization. */
.lab { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); margin-top: 32px; padding: 26px 28px 28px; }
.lab-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 25px; }
.lab-heading h2 { font-size: 23px; font-weight: 500; letter-spacing: -.7px; margin: 8px 0 0; }
.record-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.recording .record-dot { background: var(--danger); animation: engine-lab-blink 1s infinite; }
.outline-button.recording { border-color: #a55848; color: var(--danger); }
@keyframes engine-lab-blink { 50% { opacity: .25; } }
.lab-grid { display: grid; grid-template-columns: 1fr 1.5fr .72fr; gap: 32px; }
.tuning { min-width: 0; border-right: 1px solid var(--border); padding-right: 32px; display: flex; flex-direction: column; justify-content: center; }
.slider-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--secondary); margin: 20px 0 9px; }
.slider-label:first-child { margin-top: 0; }
.slider-label output { color: var(--secondary); font: 10px var(--font-mono); font-variant-numeric: tabular-nums; }
input[type=range] { appearance: none; -webkit-appearance: none; width: 100%; height: 18px; accent-color: var(--secondary); cursor: pointer; margin: 0; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(to right, #aeb5bf 0 var(--fill,50%), var(--border-light) var(--fill,50%) 100%); border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; border: 2px solid var(--panel); width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 0 1px #aeb5bf; }
input[type=range]::-moz-range-track { height: 3px; background: var(--border-light); border-radius: 3px; }
input[type=range]::-moz-range-progress { height: 3px; background: #aeb5bf; }
input[type=range]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid var(--panel); border-radius: 50%; background: var(--secondary); box-shadow: 0 0 0 1px #aeb5bf; }
.range-captions { display: flex; justify-content: space-between; font: 6px var(--font-mono); letter-spacing: .7px; color: var(--dim); margin-top: 4px; }
.signal { min-width: 0; }
.signal-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.signal-heading h3 { font: 8px var(--font-mono); letter-spacing: .8px; color: var(--muted); margin: 0; }
.signal-heading > span { font: 7px var(--font-mono); letter-spacing: .3px; color: var(--dim); }
canvas { display: block; width: 100%; height: 75px; margin: 10px 0 16px; background: #0a0c0e; border: 1px solid #24272c; border-radius: 4px; }
.signal canvas:last-child { margin-bottom: 0; }
.engine-facts { min-width: 0; border-left: 1px solid var(--border); padding-left: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.fact > span { font: 8px var(--font-mono); letter-spacing: .7px; color: var(--muted); }
.fact p { font-size: 11px; color: var(--muted); margin: 6px 0 5px; }
.fact p strong { font: 400 25px var(--font-mono); color: var(--secondary); font-variant-numeric: tabular-nums; }
.fact small { font-size: 8px; color: var(--dim); }
.load-track { height: 3px; background: var(--border-light); margin-top: 7px; max-width: 150px; border-radius: 2px; overflow: hidden; }
.load-track i { display: block; height: 100%; background: var(--signal); width: 0; }
/* An asset workbench below the instruments: shared materials, independent transport. */
.audio-export { margin-top: 24px; padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.audio-export [hidden] { display: none !important; }
.export-heading { display: flex; justify-content: space-between; align-items: start; gap: 24px; }
.export-heading h2 { margin: 0; font-size: 23px; font-weight: 500; letter-spacing: -.7px; }
.audio-export p { max-width: 65ch; color: var(--muted); font-size: 12px; line-height: 1.7; }
.export-heading p { margin: 9px 0 0; }
.export-format { display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px 12px; flex-shrink: 0; }
.export-format > span { grid-column: 1 / -1; color: var(--signal); font: 10px var(--font-mono); }
.export-format label { font-size: 10px; color: var(--muted); }
.audio-export select { appearance: auto; font: inherit; color: var(--secondary); background: var(--raised); border: 1px solid var(--border-light); border-radius: 4px; padding: 8px; min-height: 36px; max-width: 100%; }
.audio-export select:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.export-source { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 24px 0; padding: 14px 0; border-block: 1px solid var(--border); font-size: 10px; color: var(--muted); }
.export-source strong { font: 11px var(--font-mono); color: var(--secondary); }
.export-source > span:last-child { margin-left: auto; }
.export-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; }
.export-grid h3 { margin: 0; font-size: 15px; font-weight: 500; }
.export-grid p { margin: 8px 0 20px; }
.loop-workshop, .wav-workshop { min-width: 0; }
.wav-workshop { border-left: 1px solid var(--border); padding-left: 36px; }
.audio-export fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.audio-export fieldset:disabled { opacity: .55; }
.rpm-setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 22px 0 8px; font-size: 12px; color: var(--secondary); }
.rpm-setting > div { display: flex; align-items: center; gap: 8px; font: 10px var(--font-mono); }
.rpm-setting input { width: 94px; font: 18px var(--font-mono); padding: 7px; color: var(--secondary); background: var(--raised); border: 1px solid var(--border-light); border-radius: 4px; }
.export-load-captions { display: flex; justify-content: space-between; color: var(--dim); font-size: 9px; margin-top: 4px; }
.loop-duration-setting { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; font-size: 11px; color: var(--secondary); }
.loop-duration-setting > span { margin-left: auto; color: var(--muted); font: 10px var(--font-mono); }
.export-actions { display: flex; gap: 12px; margin-top: 20px; }
.export-primary { min-height: 40px; border: 1px solid var(--signal); border-radius: 5px; padding: 10px 20px; background: #90bad519; color: var(--secondary); font-size: 12px; }
.export-primary:hover:not(:disabled) { background: #90bad52d; color: var(--text); }
.audio-export .export-help { font-size: 10px; margin: 14px 0 0; }
.wav-transport { padding: 25px 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.wav-transport output { font: 32px var(--font-mono); color: var(--secondary); font-variant-numeric: tabular-nums; }
.wav-transport > span { font-size: 9px; color: var(--dim); }
.wav-workshop > button { min-height: 40px; }
.export-preview { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.export-preview #export-empty { margin: 0; }
.export-result-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 14px; }
.export-result-heading > div { min-width: 0; }
.export-result-heading #export-filename { margin: 0 0 5px; color: var(--secondary); font: 11px/1.6 var(--font-mono); overflow-wrap: anywhere; }
#export-details { color: var(--muted); font: 10px var(--font-mono); }
.export-repeat { display: flex; align-items: center; gap: 7px; flex-shrink: 0; font-size: 10px; color: var(--secondary); }
.export-repeat input { accent-color: var(--signal); }
.export-player-row { display: flex; align-items: center; gap: 20px; }
.export-player-row audio { width: 100%; min-width: 0; height: 42px; }
.export-preview-player { display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--raised); }
.export-preview-player > button { flex-shrink: 0; min-width: 104px; padding: 8px; border: 0; background: transparent; }
.export-preview-player > input { min-width: 40px; }
.export-preview-player > output { flex-shrink: 0; font: 10px var(--font-mono); color: var(--muted); }
.audio-export .export-tier-note { font-size: 10px; margin: 10px 0 0; color: var(--secondary); }
.export-player-row > button { flex-shrink: 0; min-height: 42px; }
.audio-export .export-status { margin: 16px 0 0; font-size: 10px; }
.export-status.error { color: var(--danger); }
.export-upgrade { width: min(700px, calc(100% - 28px)); max-height: 88dvh; padding: 30px; border: 1px solid var(--border-light); background: var(--panel); }
.upgrade-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.export-upgrade .upgrade-heading h2 { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -.8px; }
.export-upgrade .upgrade-heading p { margin: 12px 0 0; font-size: 12px; line-height: 1.7; max-width: 52ch; }
.upgrade-close { width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 4px; background: var(--raised); color: var(--muted); font-size: 22px; }
.upgrade-close:hover { color: var(--text); }
.upgrade-asset { display: flex; flex-direction: column; gap: 7px; margin: 22px 0 16px; padding: 13px 16px; border-left: 2px solid var(--signal); background: var(--raised); }
.upgrade-asset > span { color: var(--signal); font-size: 10px; }
.upgrade-asset strong { font: 10px/1.7 var(--font-mono); color: var(--secondary); overflow-wrap: anywhere; }
.export-upgrade .upgrade-account { margin: 0 0 20px; font-size: 11px; line-height: 1.7; }
.upgrade-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.upgrade-plan { display: flex; flex-direction: column; min-width: 0; padding: 22px 18px; background: var(--raised); border: 1px solid var(--border-light); border-radius: 8px; }
.upgrade-plan:first-child { border-color: #737d30; }
.upgrade-plan h3 { margin: 0; font-size: 17px; font-weight: 500; }
.upgrade-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin: 19px 0 8px; }
.upgrade-price strong { color: var(--text); font-size: 36px; font-weight: 400; letter-spacing: -1px; overflow-wrap: anywhere; }
.upgrade-price > span { color: var(--muted); font-size: 10px; }
.export-upgrade .upgrade-allowance { font-size: 10px; margin: 0 0 18px; line-height: 1.7; }
.upgrade-plan ul { list-style: none; padding: 0; margin: 0 0 24px; color: var(--secondary); font-size: 11px; line-height: 1.7; }
.upgrade-plan li { display: flex; gap: 8px; margin-top: 8px; }
.upgrade-plan li::before { content: '✓'; color: var(--muted); flex-shrink: 0; }
.upgrade-plan-action { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 10px 12px; margin-top: auto; border: 1px solid var(--border-light); border-radius: 5px; font-size: 11px; text-align: center; }
.upgrade-plan:first-child .upgrade-plan-action { color: var(--bg); background: var(--lime); border-color: var(--lime); }
.upgrade-plan-action:hover { background: var(--panel); color: var(--text); }
.upgrade-plan:first-child .upgrade-plan-action:hover { background: #f1fc58; color: var(--bg); }
.export-upgrade .upgrade-status { font-size: 10px; line-height: 1.7; margin: 16px 0 0; }
.upgrade-recovery { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.upgrade-recovery > a { font-size: 10px; color: var(--secondary); text-decoration: underline; text-underline-offset: 3px; }
.upgrade-recovery .outline-button { padding: 9px 11px; font-size: 10px; }
.export-upgrade .upgrade-footnote { font-size: 10px; line-height: 1.7; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 560px) {
  .export-upgrade { padding: 22px 18px; }
  .export-upgrade .upgrade-heading h2 { font-size: 23px; }
  .upgrade-plans { grid-template-columns: 1fr; }
  .upgrade-plan { padding: 18px; }
  .upgrade-price { margin-top: 12px; }
  .upgrade-plan ul { margin-bottom: 16px; }
  .export-preview-player { flex-wrap: wrap; gap: 6px 12px; }
  .export-preview-player > input { order: 3; flex-basis: 100%; }
  .export-preview-player > output { margin-left: auto; }
}
@media (max-width: 760px) {
  .export-heading { flex-wrap: wrap; gap: 16px; }
  .export-format { grid-template-columns: auto auto auto; width: 100%; }
  .export-format > span { grid-column: auto; margin-right: auto; }
  .export-grid { grid-template-columns: 1fr; gap: 26px; }
  .wav-workshop { border-left: 0; border-top: 1px solid var(--border); padding: 22px 0 0; }
  .export-source > span:last-child { margin-left: 0; flex-basis: 100%; }
  .wav-transport { padding: 8px 0 18px; }
}
@media (max-width: 560px) {
  .audio-export { padding: 21px 17px; }
  .export-heading h2 { font-size: 20px; }
  .export-result-heading { flex-direction: column; gap: 12px; }
  .export-player-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .export-player-row audio { min-width: 0; }
  .export-format { gap: 8px; }
  .export-format label { font-size: 9px; }
  .export-format > span { font-size: 9px; }
}
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 0 28px; color: var(--dim); font-size: 8px; }
footer > span:first-child { font: 8px var(--font-mono); letter-spacing: .7px; color: var(--muted); }
footer i { margin: 0 6px; font-style: normal; color: var(--border-light); }
.footer-tagline { color: var(--dim); margin-left: 8px; font-size: 7px; }
footer button { background: transparent; border: 0; padding: 0; color: var(--muted); font-size: 9px; }
footer button:hover { color: var(--text); }

dialog { width: min(520px, 92%); max-height: 85dvh; background: var(--panel); border: 1px solid var(--border-light); border-radius: 12px; padding: 30px; color: var(--text); box-shadow: 0 25px 100px #0009; }
dialog::backdrop { background: #000b; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading button { background: transparent; border: 0; font-size: 24px; color: var(--muted); padding: 0 5px; }
dialog h2 { font-size: 32px; font-weight: 500; letter-spacing: -.8px; margin: 17px 0; }
dialog p { font-size: 13px; color: var(--muted); line-height: 1.8; }

@media (min-width: 1650px) {
  .cockpit { width: min(1550px, 90%); }
  .instrument { padding-left: 24px; padding-right: 24px; }
  .cluster { grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr); }
  .console { grid-template-columns: 165px 1.35fr 1.15fr 1fr 205px; }
  .console-section { padding-left: 28px; padding-right: 28px; }
}

@media (max-width: 1150px) {
  .header-right { gap: 15px; }
  .live-label { display: none; }
  .instrument { padding: 18px 6px 24px; }
  .cluster { grid-template-columns: minmax(0, 1fr) 165px minmax(0, 1fr); gap: 14px; }
  .center-display { padding: 12px 0; }
  .mode-display { font-size: 17px; letter-spacing: 3px; margin: 17px 0 8px; }
  .gear-display { padding: 8px 0 10px; }
  .gear-display strong { font-size: 64px; }
  .gear-display > span:last-child { font-size: 6px; }
  .status-line { font-size: 6px; gap: 3px; letter-spacing: 0; }
  .digital-values { padding: 14px 0; }
  .digital-values strong { font-size: 20px; }
  .shift-lights { gap: 4px; margin: 2px 0 13px; }
  .shift-lights i { width: 9px; }
  .cluster-note > span { font-size: 7px; }
  .cluster-note small { font-size: 5px; }
  .cluster-topline, .cluster-bottomline { padding-left: 28px; padding-right: 28px; letter-spacing: .5px; font-size: 7px; }
  .console { grid-template-columns: 125px 1.2fr 1.2fr 1fr 155px; }
  .console-section { padding: 0 12px; }
  .console h2 { font-size: 8px; letter-spacing: .5px; }
  .switch { padding-left: 3px; padding-right: 3px; }
  .switch strong { font-size: 9px; }
  .switch small, .segmented small { font-size: 5px; }
  .segmented button { font-size: 10px; padding-left: 4px; padding-right: 4px; }
  .pedal-pair { gap: 16px; }
  .neutral-button, .small-help { font-size: 8px; }
  .lab-grid { gap: 22px; }
  .tuning { padding-right: 22px; }
  .engine-facts { padding-left: 22px; }
  .slider-label { font-size: 11px; }
  .signal-heading > span { font-size: 6px; }
  .hint-row p { font-size: 8px; }
  .footer-tagline { display: none; }
}

@media (max-width: 850px) {
  .header { padding: 21px 0; margin-bottom: 16px; }
  .brand-title h1 { font-size: 19px; }
  .brand-title small { font-size: 7px; letter-spacing: 1px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-right .outline-button { font-size: 10px; padding: 10px 12px; }
  .instrument { padding: 16px 8px 22px; }
  .cluster { grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); gap: 12px; margin-top: 16px; margin-bottom: 14px; }
  .center-display { padding: 7px 0; }
  .status-line { flex-direction: column; gap: 5px; font-size: 6px; }
  .mode-display { font-size: 14px; letter-spacing: 2px; margin: 12px 0 8px; }
  .mode-display::before { width: 10px; height: 7px; margin-right: 6px; }
  .gear-display { padding: 7px 0 10px; }
  .gear-display strong { font-size: 52px; }
  .gear-display .tiny-label { font-size: 6px; }
  .gear-display > span:last-child { font-size: 5px; }
  .digital-values { padding: 11px 0; }
  .digital-values strong { font-size: 17px; }
  .digital-values span { font-size: 6px; margin-top: 5px; }
  .shift-lights { gap: 3px; margin: 0 0 9px; }
  .shift-lights i { width: 7px; height: 3px; }
  .cluster-note > span { font-size: 6px; }
  .cluster-note small, .cluster-topline .cluster-signature { display: none; }
  .cluster-topline { grid-template-columns: 1fr auto; }
  .cluster-bottomline { font-size: 6px; letter-spacing: .2px; }
  .console { grid-template-columns: 125px 1fr 1fr; padding-bottom: 0; }
  .ignition-section, .sound-section, .mode-section { grid-row: 1; }
  .console-section { padding: 0 18px 22px; }
  .transmission-section { grid-column: 1 / 3; grid-row: 2; border-left: 0 !important; }
  .pedals-section { grid-column: 3; grid-row: 2; }
  .transmission-section, .pedals-section { padding-top: 20px; border-top: 1px solid var(--border); }
  .transmission-section .segmented { max-width: 280px; }
  .pedals-section .pedal-pair { gap: 30px; }
  .pedals-section h2 > span { display: none; }
  .lab-grid { grid-template-columns: 1fr 1.3fr; }
  .engine-facts { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); padding: 20px 0 0; flex-direction: row; gap: 20px; }
  .fact { flex: 1; min-width: 0; }
  .fact + .fact { padding-left: 20px; border-left: 1px solid var(--border); }
  .hint-row > p:first-child { max-width: 270px; }
  .hint-row #notice { max-width: 260px; }
  footer > span:nth-child(2) { display: none; }
}

@media (max-width: 560px) {
  .cockpit { width: calc(100% - 28px); }
  .header { padding: 17px 0; gap: 8px; margin-bottom: 12px; }
  .brand { gap: 7px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-title h1 { font-size: 16px; letter-spacing: -.4px; }
  .brand-title small { font-size: 5px; letter-spacing: .65px; margin-top: 4px; }
  .header-right .outline-button { font-size: 9px; gap: 6px; padding: 9px; }
  .instrument { padding: 12px 8px 18px; }
  .cluster-topline, .cluster-bottomline { padding: 0 4px; font-size: 6px; letter-spacing: .1px; gap: 8px; }
  /* Keep both analog dials legible; the telemetry screen sits beneath them. */
  .cluster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 14px auto; }
  #speed-dial { grid-column: 1; grid-row: 1; }
  #rpm-dial { grid-column: 2; grid-row: 1; }
  .center-display { grid-column: 1 / -1; grid-row: 2; padding: 0 10px; margin-top: 14px; display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 10px 18px; align-items: center; }
  .status-line { grid-column: 1 / -1; grid-row: 1; flex-direction: row; justify-content: space-between; font-size: 7px; }
  .mode-display { grid-column: 2; grid-row: 2; font-size: 17px; margin: 0; }
  .gear-display { grid-column: 1; grid-row: 2 / 5; padding: 8px 0; }
  .gear-display strong { font-size: 64px; }
  .gear-display .tiny-label { font-size: 5px; letter-spacing: .4px; }
  .gear-display > span:last-child { display: none; }
  .digital-values { grid-column: 2; grid-row: 3; padding: 0; }
  .digital-values strong { font-size: 22px; }
  .digital-values span { font-size: 6px; margin-top: 4px; }
  .shift-lights { grid-column: 2; grid-row: 4; margin: 0; gap: 4px; }
  .shift-lights i { width: 9px; height: 3px; }
  .cluster-note { grid-column: 1 / -1; grid-row: 5; }
  .cluster-note > span { font-size: 7px; }
  .cluster-bottomline { padding-top: 2px; font-size: 5px; align-items: flex-end; }
  .cluster-bottomline > span:first-child { max-width: 180px; line-height: 1.7; }
  .cluster-bottomline > span:last-child { white-space: nowrap; }
  .engine-selector { gap: 6px; padding: 0 7px 0 4px; font-size: 7px; letter-spacing: .1px; }
  .engine-preview svg { width: 34px; height: 20px; }
  .selector-chevron { width: 10px; height: 10px; }
  
  .garage { width: 100%; }
  .garage-heading { padding: max(24px, env(safe-area-inset-top)) 20px 22px; }
  .garage-close { width: 44px; height: 44px; margin-top: -8px; }
  .garage-list-heading { padding: 22px 20px 12px; }
  .vehicle-rail { padding: 4px 16px 20px; }
  .vehicle-card { padding: 16px 14px 13px; }
  .garage-footer { padding: 16px 20px max(16px, env(safe-area-inset-bottom)); }
  .garage-footer > span:last-child { display: none; }
  .console { grid-template-columns: 107px 1fr; padding-top: 20px; }
  .console-section { padding: 0 12px 20px; }
  .console h2 { font-size: 8px; margin-bottom: 16px; }
  .sound-section { grid-column: 2; }
  .mode-section { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--border); padding: 17px 14px; border-left: 0 !important; }
  .mode-section .neutral-button { max-width: 245px; }
  .mode-section .segmented button { padding: 22px 8px 11px; }
  .transmission-section { grid-column: 1; grid-row: 3; }
  .pedals-section { grid-column: 2; grid-row: 3; }
  .transmission-section, .pedals-section { padding-top: 17px; }
  .transmission-section .segmented { flex-direction: column; }
  .transmission-section .segmented button { font-size: 10px; padding: 20px 3px 8px; }
  .transmission-section .segmented small { margin-top: 5px; }
  .transmission-section .small-help { font-size: 7px; line-height: 1.8; }
  .pedals-section h2 { margin-bottom: 23px; }
  .pedals-section .pedal-pair { gap: 28px; margin-top: 24px; }
  .pedal-pair p { font-size: 7px; }
  .throttle .pedal-face { width: 29px; height: 82px; }
  .brake .pedal-face { width: 50px; height: 37px; }
  .ignition { width: 78px; height: 78px; gap: 4px; }
  .ignition strong { font-size: 12px; }
  .ignition small { font-size: 5px; }
  .switches { gap: 3px; padding: 3px; }
  .switch { height: 82px; padding: 8px 2px; }
  .switch-icon { height: 24px; margin-top: 4px; }
  .switch-icon svg { width: 18px; height: 18px; }
  .switch strong { font-size: 9px; }
  .switch small { font-size: 4px; letter-spacing: 0; }
  .switch i { width: 18px; }
  .hint-row { display: block; padding: 12px 2px 0; }
  .hint-row > p:first-child { max-width: none; font-size: 8px; }
  .hint-row #notice { text-align: left; max-width: none; font-size: 10px; padding-top: 8px; }
  .lab { padding: 21px 17px; margin-top: 24px; }
  .lab-heading h2 { font-size: 20px; }
  .lab-heading .tiny-label { font-size: 7px; }
  .lab-heading .outline-button { font-size: 9px; padding: 10px; gap: 7px; }
  .lab-heading { margin-bottom: 22px; gap: 8px; }
  .lab-grid { grid-template-columns: 1fr; gap: 23px; }
  .tuning { padding-right: 0; border-right: 0; }
  .slider-label { font-size: 12px; }
  .signal { border-top: 1px solid var(--border); padding-top: 21px; }
  .signal-heading h3 { font-size: 7px; }
  .engine-facts { grid-column: 1; padding-top: 18px; gap: 10px; }
  .fact + .fact { padding-left: 10px; }
  .fact > span { font-size: 6px; letter-spacing: .1px; }
  .fact p strong { font-size: 19px; }
  .fact small { font-size: 6px; line-height: 1.5; display: block; }
  .fact p { font-size: 8px; }
  footer { padding-bottom: 23px; gap: 10px; }
  footer > span:first-child { font-size: 7px; letter-spacing: .3px; }
  footer button { font-size: 8px; }
  dialog { padding: 23px; }
  dialog h2 { font-size: 27px; }
  dialog p { font-size: 12px; }
}

@media (max-width: 360px) {
  .center-display { padding-left: 4px; padding-right: 4px; gap: 10px 12px; }
  .console { grid-template-columns: 96px 1fr; }
  .console-section { padding-left: 9px; padding-right: 9px; }
  .switch strong { font-size: 8px; }
  .pedals-section .pedal-pair { gap: 19px; }
  .lab-heading h2 { font-size: 18px; }
  .lab-heading .outline-button { padding: 9px 7px; font-size: 8px; }
  .fact p strong { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

}
@media (max-width: 560px) { body:has(.engine-lab .garage:popover-open) { overflow: hidden; } }
body:has(.engine-lab .export-upgrade[open]) { overflow: hidden; }
.engine-lab {
  .switch strong, .switch small, .segmented button { white-space: normal; }
  .brand-title h1 { font-weight: 500; }
  .brand-mark { display: block; object-fit: contain; }
  .header-right .outline-button { min-height: 38px; }
  .header-right .tool-language { flex-shrink: 0; }
  .header-right .tool-language summary { min-height: 38px; }
  .header-right .cloud-nav .nav-install {
    min-height: 38px;
    padding: 10px 14px;
    font-size: 11px;
    background: var(--panel);
    border-color: var(--border-light);
    color: var(--secondary);
  }
  .header-right .cloud-nav .nav-install:hover { background: var(--raised); border-color: var(--muted); color: var(--text); }
  @media (max-width: 760px) {
    .header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 12px; }
    .header .brand { grid-column: 1; grid-row: 1; min-width: 0; }
    .header-right { display: contents; }
    .header-right .live-label { display: none; }
    .header-right .tool-language { grid-column: 2; grid-row: 1; justify-self: end; }
    .header-right #about-button { grid-column: 1; grid-row: 2; justify-self: start; }
    .header-right .cloud-nav { grid-column: 2; grid-row: 2; justify-self: end; }
  }
  @media (max-width: 560px) {
    .header { gap: 12px 8px; }
  }
}
