/* TeslaFab — éclairage de tableau de bord la nuit : fond pétrole, rétroéclairage ambre, rouge réservé à la zone rouge. */

@font-face { font-family: 'Big Shoulders'; src: url('../fonts/bigshoulders.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url('../fonts/martian.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --night: #0b1316;
  --panel: #101b1f;
  --panel-2: #15242a;
  --line: #22363d;
  --ink: #e6eee9;
  --dim: #8ea2a0;
  --amber: #ffb03a;
  --amber-soft: rgba(255, 176, 58, 0.14);
  --red: #ff4a36;
  --display: 'Big Shoulders', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 10px;
  --gap: clamp(12px, 2vw, 22px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  background-image: radial-gradient(120% 70% at 30% -10%, #13262c 0%, var(--night) 60%);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
b { font-weight: 600; color: var(--ink); }
a { color: var(--amber); }

/* ---------- en-tête ---------- */
.top {
  display: flex; align-items: center; gap: 14px;
  max-width: 1360px; margin: 0 auto; padding: 14px var(--gap);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand-mark { width: 30px; height: 30px; color: var(--dim); }
.brand-name { font: 800 30px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.brand-name .accent { color: var(--red); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  font: 500 11px/1 var(--mono); letter-spacing: 0.02em;
  padding: 8px 10px 8px 22px; border: 1px solid var(--line); border-radius: 99px; position: relative; color: var(--dim);
  white-space: nowrap;
}
.chip::before { content: ''; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #34484e; }
.chip[data-state="ok"] { color: var(--ink); }
.chip[data-state="ok"]::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.chip[data-state="wait"]::before { background: var(--amber); animation: blink 1s steps(2) infinite; }
.chip[data-state="bad"] { color: var(--red); border-color: rgba(255, 74, 54, 0.4); }
.chip[data-state="bad"]::before { background: var(--red); }
.chip[data-help] { cursor: pointer; text-decoration: underline dotted; }
.lang-btn { background: none; border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px; font-size: 13px; color: var(--dim); }
.lang-btn:hover { color: var(--ink); }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- tableau de bord ---------- */
.dash {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--gap);
  max-width: 1360px; margin: 0 auto; padding: 0 var(--gap) var(--gap);
  align-items: start;
}
.cluster, .console {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 18px; padding: var(--gap);
}
.cluster { position: sticky; top: 10px; }

/* ---------- combiné d'instruments ---------- */
.cluster-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
/* Les pastilles passent à la ligne : aucune n'est jamais coupée. */
.gauge-styles { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gs-chip {
  flex: none; display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 99px; min-height: 34px;
  border: 1px solid var(--line); background: var(--night); color: var(--dim); font-size: 13px; font-weight: 600;
}
.focus-btn {
  flex: none; display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--night); color: var(--ink); font-size: 13px; font-weight: 600;
}
.focus-btn svg { width: 20px; height: 20px; }
.focus-btn[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }
.focus-btn[aria-pressed="true"] .panel { opacity: 0.25; }
.focus-bar { display: none; }
.focus .focus-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.focus .focus-bar .status { margin: 0; flex: 1; min-width: 0; }
.start.start-mini { min-height: 48px; padding: 0 22px; font-size: 20px; flex: none; }
.start-mini .start-led { width: 12px; height: 12px; border-width: 2.5px; }
.focus .dash { grid-template-columns: minmax(0, 1fr); }
.focus .console { display: none; }
.gauges-stage { min-width: 0; }
.gs-chip[aria-checked="true"] { color: var(--ink); border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.gs-dot { position: relative; width: 24px; height: 24px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--ring, #9aa0a6), inset 0 2px 3px rgba(0, 0, 0, 0.5); }
.gs-dot::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin-top: -1px; border-radius: 2px;
  background: var(--nd); transform-origin: 0 50%; transform: rotate(-35deg);
}
.gs-sport { background: radial-gradient(circle at 50% 38%, #2c2f33, #0a0b0d); --ring: #d9dcdf; --nd: #ff5a1f; }
.gs-giallo { background: radial-gradient(circle at 50% 38%, #ffd92e, #e0a400); --ring: #1d1f22; --nd: #d00000; }
.gs-carbon { background: repeating-linear-gradient(45deg, #121416 0 3px, #2c3035 3px 6px); --ring: #8d949b; --nd: #ff2020; }
.gs-vintage { background: radial-gradient(circle at 50% 38%, #f6eed8, #d8c9a2); --ring: #e9ecef; --nd: #141414; }
.gs-night { background: radial-gradient(circle at 50% 38%, #171a1d, #040505); --ring: #2c2f33; --nd: #ff9a2a; }
.gs-digital { background: conic-gradient(from 225deg, var(--amber) 0 40%, #1c2c32 40% 75%, transparent 75%), var(--night); --ring: #22363d; --nd: transparent; }

.gauges { position: relative; display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr); gap: 3%; align-items: center; }
.gauges.digital { grid-template-columns: minmax(0, 1fr); }
.digital-tach { display: block; width: 100%; max-width: 520px; margin: 0 auto; }
.dial { position: relative; aspect-ratio: 1; }
.dial::before { /* le cadran posé dans la casquette du tableau de bord */
  content: ''; position: absolute; inset: 1.5%; border-radius: 50%;
  box-shadow: 0 22px 38px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial-needle, .dial-shadow { transform-origin: 50% 50%; will-change: transform; }
.dial-shadow { opacity: 0.55; filter: blur(2.5px); }
.shift-bar { grid-column: 1 / -1; display: flex; justify-content: center; gap: 1%; padding: 0 0 2px; }
.led { width: 3%; max-width: 16px; aspect-ratio: 1; border-radius: 50%; background: #16191c; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.8), 0 0 0 1px #000; }
.led.g.on { background: radial-gradient(circle at 40% 35%, #b6ffcb, #19d65a 60%); box-shadow: 0 0 12px #19d65a; }
.led.y.on { background: radial-gradient(circle at 40% 35%, #fff2b0, #ffc400 60%); box-shadow: 0 0 12px #ffc400; }
.led.r.on { background: radial-gradient(circle at 40% 35%, #ffc0b8, #ff2a1a 60%); box-shadow: 0 0 12px #ff2a1a; }
.led.flash { background: radial-gradient(circle at 40% 35%, #c9dcff, #2f6bff 60%); box-shadow: 0 0 14px #2f6bff; }
.seg-tick { fill: #1c2c32; transition: fill 60ms linear; }
.seg-tick.red { fill: #3a1f1c; }
.seg-tick.on { fill: var(--amber); }
.seg-tick.red.on { fill: var(--red); }
.gauges.shift .seg-tick.on { fill: var(--red); }
.t-label { font: 700 22px var(--display); fill: var(--dim); text-anchor: middle; dominant-baseline: middle; }
.t-label.red { fill: var(--red); }
.t-speed { font: 800 132px/1 var(--display); fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.t-unit { font: 500 15px var(--mono); fill: var(--dim); text-anchor: middle; letter-spacing: 0.08em; }
.t-gearbox rect { fill: var(--night); stroke: var(--line); }
.t-gear { font: 800 44px var(--display); fill: var(--amber); text-anchor: middle; dominant-baseline: central; }
.t-rpm { font: 500 14px var(--mono); fill: var(--dim); text-anchor: middle; }
#rpm { fill: var(--ink); }

.scope { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r); background: #071013; overflow: hidden; }
.scope-head { display: flex; justify-content: space-between; padding: 8px 12px 0; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber); }
.scope-hint { color: var(--dim); text-transform: none; letter-spacing: 0; font-weight: 400; }
#scope { display: block; width: 100%; height: 96px; }

.meter { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin-top: 14px; font: 500 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.meter-track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--amber); }

/* Pédales de l'essai : plus le doigt est bas, plus elle est enfoncée. */
.test-only { display: none; }
.mode-test .test-only { display: revert; }
.mode-test .pedals.test-only { display: grid; }
.pedals { grid-template-columns: 1fr 1.3fr; gap: 14px; margin-top: 18px; }
.pedal {
  --press: 0;
  display: flex; flex-direction: column; gap: 8px; padding: 0; background: none; border: 0; user-select: none; -webkit-user-select: none; touch-action: none;
}
.pedal-name { font: 800 18px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); text-align: left; }
.pedal-plate {
  position: relative; display: block; height: 190px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden;
  background:
    repeating-linear-gradient(180deg, transparent 0 15px, rgba(255, 255, 255, 0.05) 15px 17px),
    linear-gradient(180deg, #1a2a30, #0d171a);
}
.pedal-plate::after {
  content: ''; position: absolute; inset: 0; transform-origin: top;
  transform: scaleY(var(--press));
  background: linear-gradient(180deg, transparent, var(--fill));
  opacity: 0.85;
}
.pedal-gas { --fill: var(--amber); }
.pedal-brake { --fill: var(--red); }
.pedal.active .pedal-name { color: var(--ink); }
.hold-zone {
  position: absolute; left: 0; right: 0; top: 0; height: 25%; z-index: 1;
  border-bottom: 1px dashed rgba(255, 176, 58, 0.5);
  font: 500 10px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em;
  display: flex; align-items: center; justify-content: center;
}
.note { color: var(--dim); font-size: 13px; margin: 12px 0 0; }

/* ---------- console ---------- */
.console { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.console > * { min-width: 0; }
.gps-warn {
  display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r);
  background: var(--amber-soft); border: 1px solid rgba(255, 176, 58, 0.35); font-size: 14px;
}
.gps-warn strong { color: var(--amber); }
.link-btn { justify-self: start; background: none; border: 0; padding: 0; color: var(--amber); text-decoration: underline; font-size: 14px; }

.start {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 84px; border-radius: 14px; border: 1px solid #ffcc7a;
  background: linear-gradient(180deg, #ffc35e, #f29a16);
  color: #241503; font: 800 30px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 10px 30px -12px rgba(255, 176, 58, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 120ms ease, filter 120ms ease;
}
.start:active { transform: translateY(1px) scale(0.995); }
.start-led { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #241503; }
.start.on { background: linear-gradient(180deg, #23343a, #182529); color: var(--ink); border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.start.on .start-led { border-color: var(--red); background: var(--red); box-shadow: 0 0 12px var(--red); }
.status { margin: -4px 0 0; min-height: 1.5em; font-size: 14px; color: var(--dim); }
.status.warn { color: var(--amber); }
.status.error { color: var(--red); }

.row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px; background: var(--night); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 12px 10px; font-weight: 600; color: var(--dim); }
.seg button[aria-checked="true"] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.seg.small button { padding: 7px 14px; font-size: 14px; }
.rev {
  display: none; flex-direction: column; justify-content: center; padding: 6px 18px; border-radius: 12px;
  border: 1px solid rgba(255, 74, 54, 0.5); background: rgba(255, 74, 54, 0.1);
  font: 800 20px/1.05 var(--display); letter-spacing: 0.08em; text-transform: uppercase; touch-action: none; user-select: none;
}
.rev small { font: 400 11px var(--body); letter-spacing: 0; text-transform: none; color: var(--dim); }
.rev.shown { display: flex; }
.rev.active { background: var(--red); color: #fff; }
.rev.active small { color: #fff; }
.ghost { border: 1px solid var(--line); background: none; border-radius: 12px; padding: 12px; font-weight: 600; }
.ghost.running { border-color: var(--amber); color: var(--amber); }

/* Garage */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 4px 0; }
.hero-art .car-art { width: 100%; height: auto; display: block; }
/* Cadre de hauteur fixe : changer de voiture ne fait jamais bouger la page. */
.hero-art { height: 190px; }
.car-photo { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.55)); }
.hero-art .car-photo, .hero-art .car-art { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.hero-name { margin: 0; font: 800 clamp(30px, 3.6vw, 44px)/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.hero-desc { text-wrap: balance; margin: 8px 0 0; font: 400 12px/1.6 var(--mono); color: var(--dim); }
.garage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.garage-head h2 { margin: 0; font: 800 18px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.garage-head span { font-size: 12px; color: var(--dim); }
.strip {
  list-style: none; margin: 8px 0 0; padding: 0 0 8px; display: grid; grid-auto-flow: column; grid-auto-columns: 164px; gap: 10px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.strip li { position: relative; scroll-snap-align: start; }
.car-btn {
  width: 100%; height: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 10px 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--night);
}
.car-btn .car-art { width: 100%; height: auto; margin-top: 10px; }
.car-btn .pic { display: block; height: 70px; margin-top: 12px; }
.car-btn .pic .car-art { margin-top: 0; height: 100%; }
.car-btn .nm { font: 800 17px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.car-btn[aria-checked="true"] { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber), 0 0 0 3px var(--amber-soft); }
.fav {
  position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: none; color: #43575d; font-size: 18px; line-height: 1;
}
.fav[aria-pressed="true"] { color: var(--amber); }
.car-art .paint { stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.8; }
.car-art .sheen { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 0.8; stroke-dasharray: 200 600; }
.car-art .glass { fill: #0c1a20; }
.car-art .trim { fill: #0f1a1d; }
.car-art .tire { fill: #050909; }
.car-art .rim { fill: #5d6f74; }
.car-art .shadow { fill: rgba(0, 0, 0, 0.5); }

/* Réglages */
.settings { border-top: 1px solid var(--line); padding-top: 10px; }
.settings summary { cursor: pointer; font: 800 18px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding: 4px 0; }
.slider { display: grid; gap: 4px; margin-top: 14px; }
.slider > span { display: flex; justify-content: space-between; font-size: 15px; }
.slider output { font: 500 13px var(--mono); color: var(--amber); }
.slider small { color: var(--dim); font-size: 12px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: none; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--amber) var(--fill, 50%), var(--line) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--amber) var(--fill, 50%), var(--line) var(--fill, 50%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--ink); border: 4px solid var(--night); box-shadow: 0 0 0 1px var(--line); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 4px solid var(--night); }
.units { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 15px; }

/* ---------- informations ---------- */
.about {
  display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gap) * 2);
  max-width: 1360px; margin: 30px auto 0; padding: var(--gap); color: var(--dim); font-size: 15px;
}
.about h2 { font: 800 26px var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); margin: 0 0 12px; }
.about h2 + * { margin-top: 0; }
.about h2:not(:first-child) { margin-top: 28px; }
.steps { padding: 0; margin: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.steps li::before { content: counter(s); font: 800 26px/1 var(--display); color: var(--amber); }
.diag { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.diag li { display: grid; grid-template-columns: 22px 1fr; }
.diag .ok { color: var(--amber); }
.diag .bad { color: var(--red); }
.diag .warn { color: var(--amber); }
.diag .muted { color: var(--dim); }
.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; color: var(--ink); font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--amber); font: 500 18px/1 var(--mono); }
.faq[open] summary::after { content: '–'; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 8px 0 0; }
.foot { max-width: 1360px; margin: 20px auto 0; padding: var(--gap) var(--gap) 40px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.foot p { margin: 4px 0; }

/* ---------- fenêtre d'aide ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(3, 8, 10, 0.75); backdrop-filter: blur(4px); }
.modal-card { position: relative; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); color: var(--dim); }
.modal-card h2 { margin: 0 0 8px; font: 800 28px var(--display); text-transform: uppercase; color: var(--ink); }
.modal-card h3 { margin: 16px 0 4px; color: var(--ink); font-size: 15px; }
.modal-card ol { margin: 0; padding-left: 20px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: none; font-size: 22px; }

/* Thème Halloween : la voiture fantôme teinte les instruments en violet. */
.spooky { --amber: #c08bff; --amber-soft: rgba(192, 139, 255, 0.14); }
.spooky .start { background: linear-gradient(180deg, #c99bff, #8f55e0); border-color: #dcc0ff; color: #1a0b2b; }
.spooky .start.on { background: linear-gradient(180deg, #23343a, #182529); color: var(--ink); border-color: var(--line); }

/* ---------- adaptatif ---------- */
/* Écran paysage (navigateur de la Tesla, ordinateur) : le tableau de bord tient exactement dans la
   hauteur de l'écran ; les cadrans prennent la place réellement disponible ; le panneau de droite
   défile à l'intérieur de lui-même. */
@media (min-width: 901px) and (min-height: 560px) {
  .top { max-width: none; }
  .dash { max-width: none; grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
    height: calc(100vh - 64px); height: calc(100dvh - 64px); grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .focus .dash { grid-template-columns: minmax(0, 1fr); }
  .cluster { position: static; display: flex; flex-direction: column; min-height: 0; }
  .gauges-stage { flex: 1 1 auto; min-height: 140px; container-type: size; display: grid; place-items: center; }
  .gauges { width: min(100%, 178cqh); }
  .gauges.digital { width: min(100%, 104cqh); }
  .gauges.digital .digital-tach { max-width: none; }
  .console { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .scope { flex: none; }
  #scope { height: 84px; }
  /* Mode « Agrandir » : les cadrans prennent toute la hauteur ; commandes et oscilloscope en colonne à droite. */
  .focus .cluster { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 24%, 340px);
    grid-template-rows: auto auto auto auto minmax(0, 1fr); column-gap: var(--gap); }
  .focus .cluster-head { grid-column: 1 / -1; }
  .focus .gauges-stage { grid-column: 1; grid-row: 2 / -1; }
  .focus .focus-bar { grid-column: 2; grid-row: 2; flex-direction: column; align-items: stretch; gap: 8px; }
  .focus .focus-bar .status { min-height: 2.6em; }
  .focus .scope { grid-column: 2; grid-row: 3; margin-top: 0; }
  .focus .meter { grid-column: 2; grid-row: 4; align-self: start; }
  .focus .pedals { grid-column: 2; grid-row: 5; align-self: end; }
  .focus .pedal-plate { height: clamp(110px, 22vh, 190px); }
  .focus .note { display: none !important; }
  .focus .scope-hint { display: none; }
}

@media (max-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .cluster { position: static; }
  .gauges:not(.digital) { grid-template-columns: minmax(0, 1fr); }
  .gauges:not(.digital) .dial-tach { width: min(100%, 440px); justify-self: center; }
  .gauges:not(.digital) .dial-speed { width: min(70%, 300px); justify-self: center; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 520px) {
  .top { flex-wrap: wrap; }
  .chips { order: 3; width: 100%; justify-content: flex-start; }
  .t-speed { font-size: 120px; }
  .gauges:not(.digital) .dial-speed { display: none; } /* la vitesse reste affichée dans l'écran du compte-tours */
  /* Téléphone : seulement les pastilles de couleur, sur une ligne. */
  .gs-name { display: none; }
  .gs-chip { padding: 4px; }
  .gauge-styles { flex-wrap: nowrap; gap: 5px; }
  .start { min-height: 72px; font-size: 26px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-name { font-size: 28px; }
  .hero-art { height: 120px; }
  .row { grid-template-columns: 1fr; }
  .pedal-plate { height: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
