/* VelocityBench PowerCurve — Family Brass / dark instrument theme (Phase 2 layout) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050607;
  --bg-elevated: #0a0c10;
  --panel: #12171f;
  --panel-2: #171d27;
  --panel-border: rgba(180, 200, 230, 0.1);
  --panel-border-strong: rgba(200, 220, 255, 0.16);
  --text: #f4f7fb;
  --text-muted: #9aa6b8;
  --text-dim: #667084;
  --accent: #4cc9f0;
  --accent-soft: rgba(76, 201, 240, 0.16);
  --lime: #c8ff4a;
  --lime-hover: #d9ff78;
  --lime-glow: rgba(200, 255, 74, 0.38);
  --red: #ff3355;
  --input-bg: rgba(4, 6, 9, 0.88);
  --input-border: rgba(180, 200, 230, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --carbon-fine: repeating-linear-gradient(45deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.28) 0 1px, transparent 1px 3px);
  /* Premium woven CF — crisp CSS twill (no binary tile). Thin brass trim elsewhere. */
  --cf-twill-a: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.045) 0px,
    rgba(255,255,255,0.045) 1px,
    transparent 1px,
    transparent 3px,
    rgba(0,0,0,0.55) 3px,
    rgba(0,0,0,0.55) 4px,
    transparent 4px,
    transparent 6px
  );
  --cf-twill-b: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0.032) 0px,
    rgba(255,255,255,0.032) 1px,
    transparent 1px,
    transparent 3px,
    rgba(0,0,0,0.62) 3px,
    rgba(0,0,0,0.62) 4px,
    transparent 4px,
    transparent 6px
  );
  --cf-checker:
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      #12151a 0deg 90deg,
      #080a0e 90deg 180deg
    );
  --inst-cf-panel:
    radial-gradient(ellipse 42% 58% at 25.5% 36%, rgba(212,184,137,0.07), transparent 62%),
    radial-gradient(ellipse 42% 58% at 74.5% 36%, rgba(212,184,137,0.07), transparent 62%),
    radial-gradient(ellipse 28% 70% at 50% 48%, rgba(255,246,224,0.035), transparent 70%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 42%, rgba(0,0,0,0.58) 100%),
    linear-gradient(135deg, rgba(255,255,255,0.055) 0%, transparent 38%, rgba(255,255,255,0.02) 72%, transparent 100%),
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 26%),
    var(--cf-twill-a),
    var(--cf-twill-b),
    var(--cf-checker),
    linear-gradient(180deg, #10141a 0%, #07090d 52%, #030405 100%);
  --inst-cf-btn:
    linear-gradient(180deg, rgba(255,246,224,0.10) 0%, transparent 34%),
    var(--cf-twill-a),
    var(--cf-twill-b),
    var(--cf-checker),
    linear-gradient(180deg, #141820 0%, #080a0e 100%);
  --brass: rgba(215, 196, 160, 0.42);
  --brass-strong: rgba(240, 226, 196, 0.22);
  --brass-inset: rgba(106, 87, 56, 0.35);
  --brass-text: #e8d7b0;
  --brass-face:
    linear-gradient(145deg, rgba(240,226,196,0.12), transparent 38%),
    linear-gradient(165deg, rgba(255,255,255,0.04) 0%, transparent 45%),
    var(--carbon-fine), var(--panel);
  --brass-shadow:
    inset 0 0 0 1px var(--brass-strong),
    inset 0 0 0 3px var(--brass-inset),
    inset 0 0 28px rgba(0,0,0,0.35),
    0 12px 36px rgba(0,0,0,0.45);
  --btn-brass-face:
    linear-gradient(180deg, rgba(255,246,224,0.16) 0%, transparent 38%),
    linear-gradient(145deg, rgba(240,226,196,0.14), transparent 42%),
    var(--carbon-fine), #141820;
  --btn-brass-rim:
    inset 0 0 0 1px var(--brass-strong),
    inset 0 0 0 2px var(--brass-inset),
    inset 0 1px 0 rgba(255,246,224,0.12),
    0 4px 14px rgba(0,0,0,0.4);

  /* Instruments beauty palette — luxury OEM / high-end sim */
  --inst-brass: rgba(224, 198, 148, 0.55);
  --inst-brass-hi: rgba(255, 236, 196, 0.42);
  --inst-brass-lo: rgba(92, 70, 42, 0.55);
  --inst-brass-solid: #d4b889;
  --inst-brass-text: #f0e2c4;
  --inst-charcoal: #07090d;
  --inst-charcoal-2: #0c1016;
  --inst-face-mid: #161b24;
  --inst-glow-amber: rgba(255, 196, 64, 0.38);
  --inst-glow-green: rgba(70, 255, 120, 0.32);
  --inst-glow-red: rgba(255, 72, 72, 0.28);
  --inst-glow-brass: rgba(212, 184, 137, 0.22);
  --inst-chrome:
    linear-gradient(180deg, rgba(255,246,224,0.14) 0%, transparent 42%),
    linear-gradient(165deg, rgba(240,226,196,0.08), transparent 55%),
    linear-gradient(180deg, #12161e 0%, #080a0e 100%);
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

html, body {
  min-height: 100%;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -8%, rgba(76,201,240,0.08), transparent 58%),
    radial-gradient(800px 480px at 92% 88%, rgba(200,255,74,0.04), transparent 52%),
    var(--carbon-fine),
    linear-gradient(180deg, #0b0e13 0%, var(--bg) 42%, #030405 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

.app {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow-x: clip;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--brass-face);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  box-shadow: var(--brass-shadow);
  flex-wrap: wrap;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.logo-mark {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 30% 26%, #6b778c, #10151d 68%), var(--carbon-fine), #0c1016;
  border: 1.5px solid var(--brass-text);
  box-shadow: inset 0 0 0 1px var(--brass-strong), 0 0 18px rgba(215,196,160,0.18);
  display: grid; place-items: center;
  color: var(--brass-text); font-weight: 700; font-size: 16px;
}

.logo-text {
  font-size: 18px; font-weight: 700; letter-spacing: 0.02em;
  overflow-wrap: anywhere;

  margin: 0;
}

.logo-badge { font-size: 11px; color: var(--brass-text); opacity: 0.85; }

.header-credit {
  color: var(--text-muted); font-size: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.header-credit em { color: var(--brass-text); font-style: normal; font-weight: 600; }

/* 2-column layout ONLY — garage | main (instruments + graphs + Time Slip under graphs).
   No right-rail Time Slip column (removed in Phase 4 / retip). */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  width: 100%;
}

.card {
  background: var(--brass-face);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  box-shadow: var(--brass-shadow);
  padding: 12px 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.card-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brass-text);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(215,196,160,0.18);
  overflow-wrap: anywhere;
}

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; min-width: 0; }
.field > span { color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.field input, .field select, .field textarea {
  width: 100%;
  max-width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(76,201,240,0.55);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(76,201,240,0.35);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.field-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.seg {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 10px;
}
.seg label {
  flex: 1 1 64px; min-width: 0; text-align: center;
  padding: 6px 8px; border-radius: var(--radius-sm);
  background: var(--btn-brass-face);
  box-shadow: var(--btn-brass-rim);
  border: 1px solid transparent;
  cursor: pointer; font-size: 11px; color: var(--text-muted);
}
.seg input { display: none; }
.seg input:checked + span, .seg label:has(input:checked) {
  color: var(--lime); border-color: rgba(200,255,74,0.35);
}
.seg label span { pointer-events: none; }
.seg label.is-locked,
.seg label:has(input:disabled) {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: -4px 0 10px;
}

.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: 13px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--btn-brass-face); color: var(--brass-text);
  box-shadow: var(--btn-brass-rim);
}
.btn:hover { filter: brightness(1.08); }
.btn-run {
  width: 100%; margin-top: 10px;
  appearance: none; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: 13px;
  letter-spacing: 0.06em;
  padding: 12px 16px; border-radius: var(--radius-sm); color: var(--lime);
  background:
    linear-gradient(180deg, rgba(200,255,74,0.22), transparent 40%),
    linear-gradient(145deg, rgba(240,226,196,0.12), transparent 42%),
    #1a2210;
  box-shadow: var(--btn-brass-rim), 0 0 18px var(--lime-glow);
}
.btn-run:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text-muted); box-shadow: none; border: 1px solid var(--panel-border); }

.garage-filter {
  width: 100%; max-width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 8px;
}
.garage-list {
  max-height: 260px; overflow: auto;
  display: flex; flex-direction: column; gap: 3px;
  margin-bottom: 8px;
  min-width: 0;
  scrollbar-width: thin;
}
.garage-item {
  text-align: left; padding: 6px 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer; font-size: 12px;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.garage-item:hover, .garage-item.active {
  border-color: rgba(200,255,74,0.4);
  color: var(--lime);
}
.garage-item small { display: block; color: var(--text-dim); margin-top: 2px; }

.gears-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
  min-width: 0;
}
.gears-editor input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px;
  font-family: var(--mono);
  font-size: 12px;
}

.live-readout {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-muted); margin-bottom: 10px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(215,196,160,0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 55%),
    rgba(0,0,0,0.32);
  box-shadow: inset 0 1px 0 rgba(255,246,224,0.05);
  letter-spacing: 0.02em;
}
.live-readout strong {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(76,201,240,0.28);
}

/* ——— Live twin-gauge cluster — dense CSS-grid pack (NO snip/wallpaper) ——— */
.gauges, .gauges.lfa-cluster {
  position: relative;
  /* Grid: max dials | tight center corridor | max dials, then full-width buttons
     Desktop packs like mobile space-optimize — kill corridor voids. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 0.168fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: stretch;
  column-gap: clamp(2px, 0.45%, 6px);
  row-gap: clamp(3px, 0.55cqw, 6px);
  margin-bottom: 14px;
  min-width: 0;
  width: 100%;
  max-width: 1280px;
  /* Height from content — outer frame hugs dials + buttons */
  aspect-ratio: auto;
  height: auto;
  box-sizing: border-box;
  container-type: inline-size;
  padding: clamp(3px, 0.45%, 6px) clamp(3px, 0.5%, 6px) clamp(3px, 0.5%, 6px);
  border: 1px solid var(--inst-brass);
  border-radius: calc(var(--radius) + 2px);
  box-shadow:
    inset 0 0 0 1px var(--inst-brass-hi),
    inset 0 0 0 3px var(--inst-brass-lo),
    inset 0 1px 0 rgba(255,246,224,0.10),
    inset 0 -40% 80px rgba(0,0,0,0.55),
    0 14px 40px rgba(0,0,0,0.55),
    0 0 48px var(--inst-glow-brass);
  overflow: hidden;
  background: var(--inst-cf-panel);
  background-size:
    auto, auto, auto, auto, auto, auto,
    auto, auto,
    8px 8px,
    auto;
}
/* Soft ambient wash behind dials — fills voids without snip wallpaper */
.gauges.lfa-cluster::before {
  content: "";
  position: absolute;
  inset: 3.2% 2.4%;
  z-index: 1;
  pointer-events: none;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(212,184,137,0.10);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.35),
    inset 0 0 60px rgba(0,0,0,0.35);
  background:
    linear-gradient(90deg,
      transparent 0%,
      rgba(212,184,137,0.025) 22%,
      rgba(212,184,137,0.04) 50%,
      rgba(212,184,137,0.025) 78%,
      transparent 100%),
    radial-gradient(ellipse at 50% 100%, rgba(212,184,137,0.045), transparent 55%);
  opacity: 1;
}

/* Gauge canvases — in-flow grid cells (max diameter = column width) */
.gauges-dials {
  display: contents;
}
.gauge-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  justify-self: stretch;
  align-self: start;
  background:
    radial-gradient(circle at 50% 42%, #1a1f28 0%, var(--inst-charcoal) 72%);
  clip-path: circle(50% at 50% 50%);
  -webkit-clip-path: circle(50% at 50% 50%);
  filter: drop-shadow(0 0 18px rgba(212,184,137,0.18)) drop-shadow(0 10px 22px rgba(0,0,0,0.55));
  pointer-events: none;
}
.gauge-wrap--tach {
  grid-column: 1;
  grid-row: 1;
}
.gauge-wrap--speedo {
  grid-column: 3;
  grid-row: 1;
}
.gauge-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent; /* circle clip + BrassGauge opaque disk handle cover */
}

/* HTML hub wells unused — canvas BrassGauge paints digit wells */
.gauge-hub-readout {
  display: none !important; /* canvas BrassGauge paints wells — avoid double digits */
}
.gauge-hub-readout--tach {
  left: 20.78%;   /* 266/1280 */
  top: 49.58%;    /* 357/720 */
  width: 9.92%;   /* 127/1280 */
  height: 3.33%;  /* 24/720 */
}
.gauge-hub-readout--speedo {
  left: 70.94%;   /* 908/1280 */
  top: 49.72%;    /* 358/720 */
  width: 6.09%;   /* 78/1280 */
  height: 3.61%;  /* 26/720 */
}
.gauge-hub-value {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(11px, 2.2cqh, 18px);
  font-weight: 700;
  color: #7ae0ff;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(80,200,255,0.95), 0 0 16px rgba(40,180,255,0.7);
}
.gauge-hub-unit {
  display: none; /* canvas paints unit in well */
}

/* Center stack — gear → Wheel Spin → G/PeakG → ET/ShiftMPH (desktop) → TRACTION → LEDs (buttons are grid row 2)
   Uniform card chrome; fills dial-row height in corridor between dials. */
.gauge-center {
  display: contents;
}
.gauge-center-stack {
  pointer-events: auto;
  position: relative;
  z-index: 4;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Fill dial-row height: gear at top, LEDs at bottom → buttons flush under */
  justify-content: space-between;
  gap: clamp(2px, 0.4cqw, 4px);
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  align-self: stretch;
  margin: 0;
  padding: 2px 0;
  box-sizing: border-box;
  transform: none;
}
/* Center corridor plate — light CF veil over cluster weave; thin brass trim */
.gauge-center-stack::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 12px;
  border: 1px solid rgba(212,184,137,0.22);
  background:
    linear-gradient(180deg, rgba(255,246,224,0.07) 0%, transparent 16%),
    linear-gradient(180deg, transparent 82%, rgba(255,246,224,0.05) 100%),
    var(--cf-twill-a),
    var(--cf-twill-b),
    linear-gradient(180deg, rgba(10,12,16,0.55) 0%, rgba(5,7,10,0.72) 100%);
  background-size: auto, auto, auto, auto, auto;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 6px 18px rgba(0,0,0,0.30),
    0 0 14px rgba(212,184,137,0.08);
}
.gauge-center-stack > * {
  position: relative;
  z-index: 1;
}

.gear-digit {
  position: relative;
  flex: 0 0 auto;
  width: 82%;
  min-width: 48px;
  aspect-ratio: 1 / 1;
  height: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, #1c222c 0%, #06080c 78%),
    var(--cf-checker);
  background-size: auto, 6px 6px;
  border: 1px solid rgba(212,184,137,0.38);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,246,224,0.10),
    inset 0 2px 8px rgba(0,0,0,0.55),
    0 0 10px rgba(212,184,137,0.10),
    0 3px 10px rgba(0,0,0,0.35);
  padding: 0;
  margin-bottom: 0;
}
.gear-digit-value {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(24px, 5.8cqh, 52px);
  font-weight: 700;
  color: #f7f9fc;
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 14px rgba(255,255,255,0.85), 0 0 28px rgba(212,184,137,0.35);
}

/* Wheel Spin logo — ON TOP of TRACTION % (not beside) */
.wheel-spin {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 82%;
  min-width: 48px;
  box-sizing: border-box;
  opacity: 0.42;
  color: #6a5638;
  background:
    linear-gradient(180deg, rgba(255,246,224,0.06), transparent 65%),
    rgba(5,7,10,0.78);
  border: 1px solid rgba(212,184,137,0.28);
  border-radius: 8px;
  padding: 5px 4px 4px;
  box-shadow:
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 0 8px rgba(212,184,137,0.06);
}
.wheel-spin.on,
.wheel-spin.wheel-spin--demo {
  opacity: 1;
  color: #ffd24a;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,196,64,0.18), transparent 65%),
    linear-gradient(180deg, rgba(255,210,74,0.10), transparent 55%),
    rgba(8,10,12,0.92);
  border-color: rgba(255,196,64,0.50);
  box-shadow:
    inset 0 0 0 1px rgba(255,210,74,0.16),
    inset 0 1px 0 rgba(255,246,224,0.10),
    0 0 12px var(--inst-glow-amber),
    0 0 22px rgba(255,176,36,0.14);
  filter: none;
}
.wheel-spin-mark {
  display: block;
  width: clamp(24px, 3.8cqw, 40px);
  height: clamp(20px, 3.2cqw, 34px);
  filter: drop-shadow(0 0 4px rgba(255,196,64,0.0));
}
.wheel-spin.on .wheel-spin-mark,
.wheel-spin.wheel-spin--demo .wheel-spin-mark {
  filter: drop-shadow(0 0 6px rgba(255,196,64,0.55));
}
.wheel-spin-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
}
.wheel-spin-line {
  font-family: var(--sans);
  font-size: clamp(7px, 1.15cqw, 10px);
  font-weight: 900;
  letter-spacing: 0.14em;
  color: inherit;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 0 transparent;
}
.wheel-spin.on .wheel-spin-line,
.wheel-spin.wheel-spin--demo .wheel-spin-line {
  text-shadow: 0 0 8px rgba(255,208,36,0.65);
}



/* G / Peak G — desktop-only under Wheel Spin, above ET (fills former POWER slot).
   Current longitudinal g + peak this run (timeline g / physics a/G — same as speed chart).
   Hidden on mobile like ET/SHIFT so gear→WS→TRACTION→LEDs stack locks stay intact. */
.g-meter {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 82%;
  min-width: 48px;
  box-sizing: border-box;
  padding: 5px 4px 4px;
  border-radius: 8px;
  border: 1px solid rgba(212,184,137,0.28);
  background:
    linear-gradient(180deg, rgba(255,246,224,0.07), transparent 65%),
    rgba(5,7,10,0.78);
  box-shadow:
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 0 8px rgba(200,255,74,0.06);
  color: var(--inst-brass-text, #e0c694);
}
.g-meter-label {
  display: block;
  font-family: var(--sans);
  font-size: clamp(6px, 1.15cqh, 9px);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--inst-brass-text, #e0c694);
  opacity: 0.92;
  text-shadow: 0 0 8px rgba(212,184,137,0.25);
}
.g-meter-readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  line-height: 1;
}
.g-meter-value {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(13px, 2.9cqh, 22px);
  font-weight: 700;
  color: #c8ff4a;
  letter-spacing: -0.02em;
  text-shadow: 0 0 10px rgba(200,255,74,0.45), 0 0 18px rgba(200,255,74,0.2);
  font-variant-numeric: tabular-nums;
}
.g-meter-peak {
  display: block;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(7px, 1.35cqh, 10px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #a8c85a;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 6px rgba(200,255,74,0.2);
}

/* ET / Elapsed — desktop-only under G/Peak G, above SHIFT/TRACTION.
   Hidden on mobile so gear→WS→TRACTION→LEDs stack locks stay intact.
   Fit lock: widen card + cqw type + tight pad so N.NNNs (e.g. 18.190s) never clips. */
.et-meter {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 94%;
  min-width: 56px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 3px 3px;
  border-radius: 8px;
  border: 1px solid rgba(212,184,137,0.28);
  background:
    linear-gradient(180deg, rgba(255,246,224,0.07), transparent 65%),
    rgba(5,7,10,0.78);
  box-shadow:
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 0 8px rgba(110,231,255,0.06);
  color: var(--inst-brass-text, #e0c694);
  /* Size ET digits against THIS card width */
  container-type: inline-size;
  container-name: etmeter;
  overflow: visible;
}
.et-meter-label {
  display: block;
  font-family: var(--sans);
  font-size: clamp(6px, 1.15cqh, 9px);
  font-weight: 800;
  letter-spacing: 0.10em;
  line-height: 1;
  color: var(--inst-brass-text, #e0c694);
  opacity: 0.92;
  text-shadow: 0 0 8px rgba(212,184,137,0.25);
}
.et-meter-readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  line-height: 1;
  max-width: 100%;
  white-space: nowrap;
  overflow: visible;
}
.et-meter-value {
  font-family: "Courier New", ui-monospace, monospace;
  /* Prefer card-width scale so multi-digit ET (18.190s) fits corridor */
  font-size: clamp(10px, 16.5cqw, 18px);
  font-weight: 700;
  color: #6ee7ff;
  letter-spacing: -0.05em;
  text-shadow: 0 0 10px rgba(110,231,255,0.45), 0 0 18px rgba(110,231,255,0.2);
  font-variant-numeric: tabular-nums;
}
.et-meter-unit {
  font-family: var(--sans);
  font-size: clamp(7px, 11cqw, 10px);
  font-weight: 700;
  color: #7ab8c8;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}


/* SHIFT MPH — desktop-only under ET, above TRACTION.
   Same hide locks as ET so mobile stack (gear→WS→TRACTION→LEDs) stays intact. */
.shift-mph-meter {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 82%;
  min-width: 48px;
  box-sizing: border-box;
  padding: 5px 4px 4px;
  border-radius: 8px;
  border: 1px solid rgba(212,184,137,0.28);
  background:
    linear-gradient(180deg, rgba(255,246,224,0.07), transparent 65%),
    rgba(5,7,10,0.78);
  box-shadow:
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 0 8px rgba(255,179,71,0.06);
  color: var(--inst-brass-text, #e0c694);
}
.shift-mph-meter-label {
  display: block;
  font-family: var(--sans);
  font-size: clamp(6px, 1.15cqh, 9px);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--inst-brass-text, #e0c694);
  opacity: 0.92;
  text-shadow: 0 0 8px rgba(212,184,137,0.25);
}
.shift-mph-meter-readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  line-height: 1;
}
.shift-mph-meter-value {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(13px, 2.9cqh, 22px);
  font-weight: 700;
  color: #ffb347;
  letter-spacing: -0.02em;
  text-shadow: 0 0 10px rgba(255,179,71,0.45), 0 0 18px rgba(255,179,71,0.2);
  font-variant-numeric: tabular-nums;
}
.shift-mph-meter-unit {
  font-family: var(--sans);
  font-size: clamp(7px, 1.35cqh, 10px);
  font-weight: 700;
  color: #d4a05a;
  letter-spacing: 0.04em;
}


.traction-meter {
  flex: 0 0 auto;
  width: 82%;
  min-width: 48px;
  align-self: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(255,246,224,0.07), transparent 65%),
    rgba(5,7,10,0.78);
  border-radius: 8px;
  border: 1px solid rgba(212,184,137,0.28);
  padding: 5px 4px 4px;
  box-shadow:
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 0 8px rgba(212,184,137,0.05);
}
.traction-meter-label {
  display: block;
  font-family: var(--sans);
  font-size: clamp(6px, 1.15cqh, 9px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--inst-brass-text);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  opacity: 0.92;
  background: transparent;
  padding: 0;
  width: auto;
  max-width: 100%;
  text-shadow: 0 0 8px rgba(212,184,137,0.25);
}
.traction-meter-segs {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1px;
  width: 100%;
  height: 12px;
  min-height: 10px;
  max-height: 15px;
  padding: 1px 2px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #0a0c10, #050608);
  box-shadow:
    inset 0 0 0 1.5px rgba(212,184,137,0.45),
    inset 0 2px 4px rgba(0,0,0,0.55);
  border: none;
  box-sizing: border-box;
}
.trac-seg {
  flex: 1 1 0;
  height: 100%;
  min-width: 1px;
  border-radius: 1px;
  background: #2a2620;
  opacity: 0.4;
}
.trac-seg.is-on {
  opacity: 1;
  background: linear-gradient(180deg, #f4f0e8, #d8d2c6);
  box-shadow: 0 0 5px rgba(232,228,220,0.4);
}
.traction-meter.is-low .trac-seg.is-on {
  background: linear-gradient(180deg, #ffc84a, #ffb024);
  box-shadow: 0 0 6px rgba(255,176,36,0.5);
}
.traction-meter.is-critical .trac-seg.is-on {
  background: linear-gradient(180deg, #ff7a4a, #ff5a2a);
  box-shadow: 0 0 7px rgba(255,80,40,0.55);
}

/* Progressive stadium shift-light — 8 grid cells always fit in brass pill (no clipped dots) */
.shift-led-bar {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  width: 92%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Rim pad keeps segment disks clear of brass chrome edge */
  padding: 3px 4px;
  border: 1px solid rgba(212,184,137,0.42);
  border-radius: 6px;
  /* Clip soft glow to pill chrome — segments themselves never overflow (CSS grid) */
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  container-name: shiftled;
  background:
    linear-gradient(180deg, rgba(255,246,224,0.11), transparent 46%),
    linear-gradient(180deg, #161820, #06080c);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,246,224,0.10),
    inset 0 2px 5px rgba(0,0,0,0.55),
    0 0 8px rgba(212,184,137,0.10);
  transform: none;
}
.shift-led-row {
  /* 8 equal columns → every stage fully inside content box at any corridor width */
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: stretch;
  gap: 2px;
  width: 100%;
  min-width: 0;
}
.shift-led {
  /* Stadium blade — fills its grid cell; height drives presence, width cannot overflow */
  display: block;
  width: 100%;
  min-width: 0;
  height: clamp(7px, 9cqw, 11px);
  border-radius: 2.5px;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, #2c2820 0%, #12100c 55%, #080706 100%);
  box-shadow:
    inset 0 0 0 1px rgba(215,196,160,0.32),
    inset 0 1px 2px rgba(0,0,0,0.55);
  opacity: 0.42;
}
.shift-led.is-on.shift-led--g {
  opacity: 1;
  background:
    linear-gradient(180deg, #c8ffd4 0%, #2ae05a 42%, #0a8a30 100%);
  /* Contained glow — soft enough to keep rim clear under overflow:hidden */
  box-shadow:
    0 0 3px rgba(61,255,106,0.85),
    0 0 6px rgba(61,255,106,0.4),
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 2px rgba(0,60,20,0.35);
}
.shift-led.is-on.shift-led--a {
  opacity: 1;
  background:
    linear-gradient(180deg, #ffe6a8 0%, #ffb024 42%, #a06808 100%);
  box-shadow:
    0 0 3px rgba(255,176,36,0.85),
    0 0 6px rgba(255,176,36,0.38),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 2px rgba(80,40,0,0.35);
}
.shift-led.is-on.shift-led--r {
  opacity: 1;
  background:
    linear-gradient(180deg, #ffb8b8 0%, #ff4040 42%, #8a1010 100%);
  box-shadow:
    0 0 3px rgba(255,50,50,0.9),
    0 0 7px rgba(255,40,40,0.42),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 2px rgba(60,0,0,0.4);
}
.shift-led-bar.is-approaching {
  border-color: rgba(255, 180, 40, 0.68);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 0 8px rgba(255,176,36,0.24);
}
.shift-led-bar.is-shift {
  border-color: rgba(255, 60, 60, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,246,224,0.08),
    0 0 10px rgba(255,40,40,0.32);
}
@keyframes shift-led-flash {
  from { filter: brightness(0.72); }
  to   { filter: brightness(1.38); }
}
.shift-led-bar.is-shift .shift-led.is-on {
  animation: shift-led-flash 0.26s ease-in-out infinite alternate;
}

/* START / PAUSE / STOP — grid row under dials (flush, full cluster width band) */
.gauge-run-row {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  z-index: 6;
  justify-self: center;
  align-self: stretch;
  margin: 0;
  width: min(52%, 520px);
  min-height: clamp(26px, 3.2cqw, 38px);
  height: auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: clamp(6px, 1.2%, 12px);
  padding: 0;
  box-sizing: border-box;
  transform: none;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.35));
}
.btn-gauge-run {
  appearance: none;
  border: none;
  cursor: pointer;
  flex: 1 1 0;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(11px, 2cqh, 17px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 1%;
  border-radius: 12px;
  height: auto;
  min-height: inherit;
  align-self: stretch;
  line-height: 1.1;
  transition: filter 0.12s ease, box-shadow 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}
.btn-gauge-ico {
  flex: 0 0 auto;
  display: block;
  width: clamp(14px, 2.5cqh, 20px);
  height: clamp(14px, 2.5cqh, 20px);
}
.btn-gauge-run-label { flex: 0 0 auto; }
.btn-gauge-run--start {
  color: #6dff88;
  background:
    linear-gradient(180deg, rgba(61,255,106,0.14), transparent 55%),
    var(--inst-cf-btn);
  background-size: auto, auto, auto, auto, 7px 7px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(230,206,160,0.72),
    inset 0 0 0 2px rgba(70,55,35,0.55),
    inset 0 1px 0 rgba(255,246,224,0.12),
    inset 0 -2px 8px rgba(0,0,0,0.45),
    0 0 14px var(--inst-glow-green),
    0 4px 12px rgba(0,0,0,0.35);
  text-shadow: 0 0 12px rgba(61,255,106,0.7);
}
.btn-gauge-run--pause {
  color: #ffd85a;
  flex: 1.25 1 0;
  background:
    linear-gradient(180deg, rgba(255,210,74,0.12), transparent 55%),
    var(--inst-cf-btn);
  background-size: auto, auto, auto, auto, 7px 7px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(230,206,160,0.72),
    inset 0 0 0 2px rgba(70,55,35,0.55),
    inset 0 1px 0 rgba(255,246,224,0.12),
    inset 0 -2px 8px rgba(0,0,0,0.45),
    0 0 12px rgba(255,210,74,0.20),
    0 4px 12px rgba(0,0,0,0.35);
  text-shadow: 0 0 10px rgba(255,210,74,0.55);
}
.btn-gauge-run--stop {
  color: #ff6a6a;
  background:
    linear-gradient(180deg, rgba(255,80,80,0.12), transparent 55%),
    var(--inst-cf-btn);
  background-size: auto, auto, auto, auto, 7px 7px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(230,206,160,0.72),
    inset 0 0 0 2px rgba(70,55,35,0.55),
    inset 0 1px 0 rgba(255,246,224,0.12),
    inset 0 -2px 8px rgba(0,0,0,0.45),
    0 0 12px var(--inst-glow-red),
    0 4px 12px rgba(0,0,0,0.35);
  text-shadow: 0 0 10px rgba(255,80,80,0.55);
}
.btn-gauge-run:hover { filter: brightness(1.12); }
.btn-gauge-run:active { filter: brightness(0.94); }
.btn-gauge-run:disabled {
  opacity: 0.42;
  cursor: default;
  filter: none;
}
.btn-gauge-run.is-active {
  filter: brightness(1.14);
  box-shadow:
    inset 0 0 0 2.5px rgba(255,246,224,0.55),
    inset 0 0 0 5px rgba(106,87,56,0.45),
    inset 0 2px 0 rgba(255,246,224,0.2),
    0 0 20px rgba(255,246,224,0.16);
}

.chart-wrap {
  position: relative;
  height: 190px;
  max-width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--brass);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--brass-inset);
  padding: 8px;
  margin-bottom: 4px;
  min-width: 0;
  overflow: hidden;
}
.chart-wrap-speed { height: 210px; margin-top: 6px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }

/* Phase 5: Factory TX preset — Custom Builder only */
#txPresetField.tx-hidden { display: none; }
#txPresetField .tx-hint { font-style: normal; color: var(--text-dim); font-weight: 400; }
#txPreset:disabled { opacity: 0.45; cursor: not-allowed; }

/* Phase 2 soft flag / Gear UI: show baked factory TX name for garage cars */
#txFactoryLabelField.tx-hidden { display: none; }
.tx-factory-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brass-text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.tx-factory-label.is-unknown { color: var(--text-muted); font-weight: 500; }
/* Jorge blank-unsure: empty label still reserves a row so layout does not jump */
.tx-factory-label.is-unknown:empty::before { content: '—'; opacity: 0.55; }
.tx-factory-key {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.chart-wrap { touch-action: none; }

.chart-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Digital run board — dark, graph colors (HP green / TQ blue / shift orange) */
.run-board {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.25;
  margin: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(76, 201, 240, 0.06), transparent 42%),
    linear-gradient(180deg, #10151c 0%, #07090d 100%);
  border: 1px solid rgba(215, 196, 160, 0.38);
  border-radius: 8px;
  padding: 10px 12px 12px;
  color: var(--text);
  width: 100%;
  max-width: 100%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.run-board-idle {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 18px 4px;
}
.rd-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.rd-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brass-text, #e8d7b0);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-tag {
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #4cc9f0;
  border: 1px solid rgba(76, 201, 240, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
}
.rd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 8px;
  align-items: start;
}
/* Run Data is one slip. Distance table, then shifts and gears. Ranges and 0–mph sit under it. */
.rd-slip {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(76, 201, 240, 0.14);
  border-radius: 6px;
  padding: 6px 8px 8px;
  min-width: 0;
}
.rd-slip .rd-mph { color: #ffb347; }
.rd-table--slip { table-layout: fixed; }
.rd-col-k { width: 34%; }
.rd-col-t { width: 36%; }
.rd-col-m { width: 30%; }
.rd-under {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rd-panel {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(76, 201, 240, 0.14);
  border-radius: 6px;
  padding: 6px 8px 8px;
  min-width: 0;
}
.rd-panel h3 {
  margin: 0 0 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.rd-table { width: 100%; border-collapse: collapse; }
.rd-table th {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: right;
  padding: 0 4px 4px;
}
.rd-table th:first-child { text-align: left; }
.rd-table td, .rd-table tbody th {
  padding: 2px 4px;
  font-weight: 500;
  font-size: 12px;
}
.rd-table tbody th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.rd-table td { text-align: right; }
.rd-table tbody tr:nth-child(odd) td,
.rd-table tbody tr:nth-child(odd) th { background: rgba(255, 255, 255, 0.025); }
.rd-time { color: #c8ff4a; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-mph { color: #4cc9f0; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-range { color: #ffb347; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-time.is-miss, .rd-mph.is-miss, .rd-range.is-miss {
  color: var(--text-dim);
  font-weight: 500;
}
.rd-k {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.rd-ranges, .rd-zeros {
  display: grid;
  gap: 4px;
}
.rd-ranges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rd-ranges--row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.rd-ranges--row .rd-chip { flex: 1 1 108px; }
.rd-zeros { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rd-zeros--board {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: 100%;
}
.rd-zeros--board .rd-chip--zero {
  padding: 2px 3px;
}
.rd-zeros--board .rd-chip--zero .rd-k { font-size: 8px; }
.rd-zeros--board .rd-time { font-size: 11px; }
.rd-chip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 179, 71, 0.06);
  min-width: 0;
}
.rd-chip--zero {
  flex-direction: column;
  gap: 1px;
  padding: 3px 5px;
  background: rgba(200, 255, 74, 0.05);
}
.rd-chip--zero .rd-k { font-size: 9px; }
.rd-foot { margin-top: 8px; }
.rd-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: baseline;
}
.rd-shifts {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 8px;
  overflow-x: auto;
}
.rd-shift {
  font-size: 10px;
  letter-spacing: 0.02em;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 71, 0.28);
  background: rgba(255, 179, 71, 0.07);
  color: var(--text-muted);
  white-space: nowrap;
}
.rd-shift b { font-weight: 700; }
.rd-gears {
  margin-top: 7px;
  font-size: 11px;
  color: var(--brass-text, #e8d7b0);
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.slip-title { margin-top: 12px; }

/* Time board — full width under center instruments/graphs column (not a side rail) */
.slip-block {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  clear: both;
}

.disclaimer, .credits {
  font-size: 11px; color: var(--text-dim); line-height: 1.5;
  padding: 10px 12px;
  border: 1px dashed rgba(215,196,160,0.2);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}
.credits a { color: var(--accent); }

.advanced.always-open { margin-top: 0; margin-bottom: 8px; }
.playback-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* ---- Responsive: stack ---- */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .garage-list { max-height: 180px; }
}

/* ---- Responsive: tablet ---- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---- Responsive: mobile ≤800px — page chrome; dials stay absolute ---- */
@media (max-width: 800px) {
  .app { padding: 8px 8px 20px; gap: 8px; }
  .header { padding: 10px 12px; gap: 8px; }
  .logo-text { font-size: 15px; }
  .logo-badge { font-size: 10px; }
  .logo-mark { width: 36px; height: 36px; font-size: 13px; }
  .header-credit { font-size: 11px; width: 100%; }
  .card { padding: 10px 12px; }
  .card-title { margin-bottom: 8px; padding-bottom: 6px; }
  .field { margin-bottom: 6px; }
  .field-row,
  .field-row-3 {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .gears-editor {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* Never force legacy grid/max-width — it crushes absolute BrassGauge dials */
  .gauges, .gauges.lfa-cluster {
    max-width: 100%;
    width: 100%;
    container-type: size;
  }
  .gauges-dials {
    grid-template-columns: unset;
    gap: 0;
  }
  .gauge-wrap, .gauge-wrap--tach, .gauge-wrap--speedo { max-width: none; }
  .chart-wrap { height: 170px; }
  .chart-wrap-speed { height: 180px; }
  .run-board { padding: 8px; }
  .rd-grid { grid-template-columns: 1fr; }
  .rd-zeros { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rd-zeros--board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .seg label { flex: 1 1 calc(50% - 4px); }
  .live-readout { font-size: 11px; gap: 6px; }
  .garage-list { max-height: 140px; }
  .dyno-readout { font-size: 11px; gap: 8px 12px; }
}

@media (max-width: 480px) {
  .field-row,
  .field-row-3 { grid-template-columns: 1fr; }
  .gears-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauges-dials { grid-template-columns: unset; gap: 0; }
  .gauge-wrap, .gauge-wrap--tach, .gauge-wrap--speedo { max-width: none; }
}


/* ---- Instruments — DESKTOP pack (kill corridor voids; LEDs pinned to dial bottoms) ----
   Jorge polish: ET fit, ~2× TRACTION weight, ~3× LED weight, premium CF+brass buttons. */
@media (min-width: 901px) {
  .gauges, .gauges.lfa-cluster {
    /* Corridor slightly wider so ET N.NNNs + heavier TRACTION/LEDs stay in-bounds */
    grid-template-columns: minmax(0, 1fr) minmax(92px, 0.178fr) minmax(0, 1fr);
    column-gap: clamp(2px, 0.35%, 4px);
    row-gap: clamp(3px, 0.5cqw, 5px);
    padding: clamp(3px, 0.4%, 5px) clamp(3px, 0.45%, 5px) clamp(3px, 0.45%, 5px);
  }
  .gauge-center-stack {
    justify-content: flex-start;
    gap: clamp(3px, 0.5cqw, 6px);
    padding: 2px 0 0;
  }
  /* Pack: gear+WS top; G owns mid void (ex-POWER); ET+Shift MPH; TRACTION+LEDs at dial bottoms */
  .g-meter {
    display: flex;
    margin-top: auto;
    margin-bottom: clamp(1px, 0.25cqw, 3px);
  }
  .et-meter {
    display: flex;
    width: 96%;
    min-width: 64px;
    margin-top: 0;
    margin-bottom: clamp(1px, 0.25cqw, 3px);
    padding: 4px 2px 3px;
  }
  .et-meter-value {
    font-size: clamp(11px, 15.5cqw, 17px);
    letter-spacing: -0.055em;
  }
  .et-meter-unit {
    font-size: clamp(7px, 10cqw, 10px);
  }
  .shift-mph-meter {
    display: flex;
    margin-top: 0;
    margin-bottom: clamp(1px, 0.25cqw, 3px);
  }
  /* TRACTION — premium brass/champagne fill (no neon white/amber/orange); weight held */
  .traction-meter {
    margin-top: 0;
    width: 88%;
    padding: 6px 5px 5px;
    gap: 4px;
    border-color: rgba(212,184,137,0.42);
    background:
      linear-gradient(180deg, rgba(255,246,224,0.09), transparent 62%),
      rgba(6,8,11,0.88);
    box-shadow:
      inset 0 1px 0 rgba(255,246,224,0.12),
      inset 0 0 0 1px rgba(0,0,0,0.4),
      0 0 10px rgba(212,184,137,0.08),
      0 3px 10px rgba(0,0,0,0.28);
  }
  /* Label fit: TRACTION % must stay inside brass card (Jorge reject of 081a6a8) */
  .traction-meter-label {
    font-size: clamp(6.5px, 1.12cqh, 9px);
    letter-spacing: 0.05em;
    opacity: 1;
    color: var(--inst-brass-text, #f0e2c4);
    text-shadow: 0 0 8px rgba(212,184,137,0.28);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0 1px;
  }
  .traction-meter-segs {
    /* Fit fix: 20-col grid + rim inset — ticks never float past brass track */
    display: grid;
    grid-template-columns: repeat(20, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    min-width: 0;
    height: 20px;
    min-height: 16px;
    max-height: 24px;
    gap: 1px;
    padding: 3px 6px;
    border-radius: 5px;
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    background:
      linear-gradient(180deg, #0c0e12 0%, #050608 100%);
    box-shadow:
      inset 0 0 0 1.5px rgba(212,184,137,0.48),
      inset 0 2px 6px rgba(0,0,0,0.7),
      inset 0 -1px 0 rgba(255,246,224,0.04);
  }
  .trac-seg {
    display: block;
    width: 100%;
    min-width: 0;
    height: 100%;
    border-radius: 2px;
    border: none;
    box-sizing: border-box;
    background: linear-gradient(180deg, #1c1814, #0e0c0a);
    opacity: 0.55;
    box-shadow:
      inset 0 0 0 1px rgba(90,72,48,0.4),
      inset 0 1px 1px rgba(0,0,0,0.45);
  }
  .trac-seg.is-on {
    opacity: 1;
    /* Polished champagne brass — bright enough to read, still CF/brass (not neon white) */
    background:
      linear-gradient(180deg, #fff8e6 0%, #e8d2a0 38%, #c9a86a 100%);
    box-shadow:
      0 0 3px rgba(212,184,137,0.38),
      inset 0 0 0 1px rgba(232,210,160,0.45),
      inset 0 1px 0 rgba(255,252,240,0.7),
      inset 0 -1px 1px rgba(80,55,20,0.28);
  }
  .traction-meter.is-low .trac-seg.is-on {
    background:
      linear-gradient(180deg, #ffe9b0 0%, #e0b050 42%, #a87828 100%);
    box-shadow:
      0 0 3px rgba(196,150,70,0.34),
      inset 0 0 0 1px rgba(210,170,90,0.45),
      inset 0 1px 0 rgba(255,246,210,0.6),
      inset 0 -1px 1px rgba(70,45,8,0.35);
  }
  .traction-meter.is-critical .trac-seg.is-on {
    background:
      linear-gradient(180deg, #f0b090 0%, #c06042 42%, #8a3420 100%);
    box-shadow:
      0 0 3px rgba(168,80,55,0.36),
      inset 0 0 0 1px rgba(190,110,80,0.45),
      inset 0 1px 0 rgba(255,220,200,0.5),
      inset 0 -1px 1px rgba(55,15,8,0.4);
  }
  /* Stadium shift-light — premium corridor strip; grid guarantees 8 stages + rim clear */
  .shift-led-bar {
    margin-top: 0;
    width: 98%;
    padding: 5px 7px;
    border-width: 1.5px;
    border-radius: 5px;
    border-color: rgba(212,184,137,0.52);
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.52),
      inset 0 1px 0 rgba(255,246,224,0.14),
      inset 0 3px 8px rgba(0,0,0,0.55),
      0 0 12px rgba(212,184,137,0.16);
  }
  .shift-led-row {
    gap: 2.5px;
  }
  .shift-led {
    height: clamp(10px, 11.5cqw, 14px);
    border-radius: 2.5px;
    box-shadow:
      inset 0 0 0 1px rgba(215,196,160,0.4),
      inset 0 1px 3px rgba(0,0,0,0.6);
  }
  .shift-led.is-on.shift-led--g {
    box-shadow:
      0 0 3px rgba(61,255,106,0.95),
      0 0 7px rgba(61,255,106,0.42),
      inset 0 1px 0 rgba(255,255,255,0.58),
      inset 0 -1px 2px rgba(0,60,20,0.35);
  }
  .shift-led.is-on.shift-led--a {
    box-shadow:
      0 0 3px rgba(255,176,36,0.95),
      0 0 7px rgba(255,176,36,0.4),
      inset 0 1px 0 rgba(255,255,255,0.52),
      inset 0 -1px 2px rgba(80,40,0,0.35);
  }
  .shift-led.is-on.shift-led--r {
    box-shadow:
      0 0 3px rgba(255,50,50,1),
      0 0 8px rgba(255,40,40,0.45),
      inset 0 1px 0 rgba(255,255,255,0.52),
      inset 0 -1px 2px rgba(60,0,0,0.4);
  }
  .shift-led-bar.is-approaching {
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.45),
      inset 0 1px 0 rgba(255,246,224,0.1),
      0 0 12px rgba(255,176,36,0.32);
  }
  .shift-led-bar.is-shift {
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.45),
      inset 0 1px 0 rgba(255,246,224,0.1),
      0 0 14px rgba(255,40,40,0.38);
  }
  /* START / PAUSE / STOP — premium CF weave + brass bevel depth; accent colors elevated */
  .gauge-run-row {
    width: min(52%, 520px);
    min-height: clamp(30px, 3.4cqw, 40px);
    filter: drop-shadow(0 10px 22px rgba(0,0,0,0.42));
  }
  .btn-gauge-run {
    border-radius: 13px;
    font-size: clamp(11px, 2cqh, 16px);
    letter-spacing: 0.14em;
    box-shadow:
      inset 0 0 0 1px rgba(245,228,190,0.82),
      inset 0 0 0 3px rgba(78,60,36,0.62),
      inset 0 2px 0 rgba(255,246,224,0.18),
      inset 0 -3px 10px rgba(0,0,0,0.55),
      0 1px 0 rgba(255,246,224,0.08),
      0 6px 16px rgba(0,0,0,0.4);
  }
  .btn-gauge-run--start {
    background:
      linear-gradient(180deg, rgba(61,255,106,0.22) 0%, rgba(61,255,106,0.06) 42%, transparent 70%),
      linear-gradient(180deg, rgba(255,246,224,0.14) 0%, transparent 36%),
      var(--cf-twill-a),
      var(--cf-twill-b),
      var(--cf-checker),
      linear-gradient(180deg, #161c24 0%, #07090d 100%);
    background-size: auto, auto, auto, auto, 7px 7px, auto;
    box-shadow:
      inset 0 0 0 1px rgba(245,228,190,0.85),
      inset 0 0 0 3px rgba(78,60,36,0.62),
      inset 0 2px 0 rgba(255,246,224,0.2),
      inset 0 -3px 10px rgba(0,0,0,0.55),
      0 0 18px rgba(61,255,106,0.38),
      0 0 8px rgba(61,255,106,0.22),
      0 6px 16px rgba(0,0,0,0.4);
    text-shadow: 0 0 14px rgba(61,255,106,0.85), 0 1px 0 rgba(0,0,0,0.45);
  }
  .btn-gauge-run--pause {
    background:
      linear-gradient(180deg, rgba(255,210,74,0.20) 0%, rgba(255,210,74,0.05) 42%, transparent 70%),
      linear-gradient(180deg, rgba(255,246,224,0.14) 0%, transparent 36%),
      var(--cf-twill-a),
      var(--cf-twill-b),
      var(--cf-checker),
      linear-gradient(180deg, #161c24 0%, #07090d 100%);
    background-size: auto, auto, auto, auto, 7px 7px, auto;
    box-shadow:
      inset 0 0 0 1px rgba(245,228,190,0.85),
      inset 0 0 0 3px rgba(78,60,36,0.62),
      inset 0 2px 0 rgba(255,246,224,0.2),
      inset 0 -3px 10px rgba(0,0,0,0.55),
      0 0 16px rgba(255,210,74,0.32),
      0 0 7px rgba(255,210,74,0.18),
      0 6px 16px rgba(0,0,0,0.4);
    text-shadow: 0 0 12px rgba(255,210,74,0.75), 0 1px 0 rgba(0,0,0,0.45);
  }
  .btn-gauge-run--stop {
    background:
      linear-gradient(180deg, rgba(255,80,80,0.20) 0%, rgba(255,80,80,0.05) 42%, transparent 70%),
      linear-gradient(180deg, rgba(255,246,224,0.14) 0%, transparent 36%),
      var(--cf-twill-a),
      var(--cf-twill-b),
      var(--cf-checker),
      linear-gradient(180deg, #161c24 0%, #07090d 100%);
    background-size: auto, auto, auto, auto, 7px 7px, auto;
    box-shadow:
      inset 0 0 0 1px rgba(245,228,190,0.85),
      inset 0 0 0 3px rgba(78,60,36,0.62),
      inset 0 2px 0 rgba(255,246,224,0.2),
      inset 0 -3px 10px rgba(0,0,0,0.55),
      0 0 16px rgba(255,72,72,0.34),
      0 0 7px rgba(255,72,72,0.18),
      0 6px 16px rgba(0,0,0,0.4);
    text-shadow: 0 0 12px rgba(255,80,80,0.75), 0 1px 0 rgba(0,0,0,0.45);
  }
  .btn-gauge-run.is-active {
    filter: brightness(1.16);
    box-shadow:
      inset 0 0 0 2.5px rgba(255,246,224,0.6),
      inset 0 0 0 5px rgba(106,87,56,0.5),
      inset 0 2px 0 rgba(255,246,224,0.22),
      0 0 22px rgba(255,246,224,0.2),
      0 6px 16px rgba(0,0,0,0.4);
  }
  .gear-digit { width: 78%; min-width: 52px; }
  .wheel-spin { padding: 5px 4px 4px; }
}

/* ---- Instruments — phones/tablets PORTRAIT (grid pack) ---- */
@media (max-width: 900px) and (orientation: portrait) {
  .g-meter { display: none !important; }
  .et-meter { display: none !important; }
  .shift-mph-meter { display: none !important; }
  .gauges, .gauges.lfa-cluster {
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(56px, 0.22fr) minmax(0, 1fr);
    column-gap: clamp(3px, 1%, 6px);
    row-gap: clamp(4px, 1cqw, 7px);
    padding: clamp(3px, 0.9%, 6px) clamp(4px, 1.1%, 7px) clamp(4px, 1.1%, 7px);
    container-type: inline-size;
    /* Portrait-only: shrink hub digitals under needles (canvas reads --gauge-dig-scale) */
    --gauge-dig-scale: 0.70;
  }
  .gauge-center-stack {
    gap: clamp(2px, 0.7cqw, 4px);
    padding: 0;
    align-self: stretch;
    height: auto;
  }
  .gear-digit {
    width: 88%;
    min-width: 34px;
    margin-bottom: 0;
  }
  .gear-digit-value { font-size: clamp(16px, 8cqw, 34px); }
  .wheel-spin-mark {
    width: clamp(18px, 6cqw, 30px);
    height: clamp(15px, 5cqw, 24px);
  }
  .wheel-spin-line { font-size: clamp(5px, 1.6cqw, 7px); letter-spacing: 0.1em; }
  /* Portrait TRACTION rim-fit (Jorge reject of LIVE 64ffba4 — ticks hung past right brass rim) */
  .traction-meter {
    width: 92%;
    max-width: 100%;
    min-width: 0;
    padding: 4px 4px 3px;
    gap: 2px;
    border-color: rgba(212,184,137,0.42);
    background:
      linear-gradient(180deg, rgba(255,246,224,0.09), transparent 62%),
      rgba(6,8,11,0.88);
    box-shadow:
      inset 0 1px 0 rgba(255,246,224,0.12),
      inset 0 0 0 1px rgba(0,0,0,0.4),
      0 0 6px rgba(212,184,137,0.08),
      0 2px 6px rgba(0,0,0,0.28);
    overflow: hidden;
    box-sizing: border-box;
  }
  .traction-meter-label {
    font-size: clamp(5px, 1.5cqw, 7px);
    letter-spacing: 0.03em;
    white-space: nowrap;
    color: var(--inst-brass-text, #f0e2c4);
    opacity: 1;
    text-shadow: 0 0 6px rgba(212,184,137,0.25);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0 1px;
  }
  .traction-meter-segs {
    display: grid;
    grid-template-columns: repeat(20, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    min-width: 0;
    height: 9px;
    min-height: 8px;
    max-height: 12px;
    gap: 1px;
    padding: 1px 4px;
    border-radius: 4px;
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    background:
      linear-gradient(180deg, #0c0e12 0%, #050608 100%);
    box-shadow:
      inset 0 0 0 1.5px rgba(212,184,137,0.48),
      inset 0 2px 4px rgba(0,0,0,0.65),
      inset 0 -1px 0 rgba(255,246,224,0.04);
  }
  .trac-seg {
    display: block;
    width: 100%;
    min-width: 0;
    height: 100%;
    border-radius: 1px;
    border: none;
    box-sizing: border-box;
    background: linear-gradient(180deg, #1c1814, #0e0c0a);
    opacity: 0.55;
    box-shadow:
      inset 0 0 0 1px rgba(90,72,48,0.4),
      inset 0 1px 1px rgba(0,0,0,0.45);
  }
  .trac-seg.is-on {
    opacity: 1;
    background:
      linear-gradient(180deg, #fff8e6 0%, #e8d2a0 38%, #c9a86a 100%);
    box-shadow:
      0 0 2px rgba(212,184,137,0.34),
      inset 0 0 0 1px rgba(232,210,160,0.45),
      inset 0 1px 0 rgba(255,252,240,0.65);
  }
  .traction-meter.is-low .trac-seg.is-on {
    background:
      linear-gradient(180deg, #ffe9b0 0%, #e0b050 42%, #a87828 100%);
    box-shadow:
      0 0 2px rgba(196,150,70,0.32),
      inset 0 0 0 1px rgba(210,170,90,0.45),
      inset 0 1px 0 rgba(255,246,210,0.55);
  }
  .traction-meter.is-critical .trac-seg.is-on {
    background:
      linear-gradient(180deg, #f0b090 0%, #c06042 42%, #8a3420 100%);
    box-shadow:
      0 0 2px rgba(168,80,55,0.34),
      inset 0 0 0 1px rgba(190,110,80,0.45),
      inset 0 1px 0 rgba(255,220,200,0.45);
  }
  .shift-led-bar {
    width: 100%;
    min-height: 0;
    padding: 2px 3px;
    border-width: 1.5px;
    border-radius: 5px;
    overflow: hidden;
  }
  .shift-led-row { gap: 1.5px; }
  .shift-led {
    width: 100%;
    min-width: 0;
    height: clamp(5px, 8cqw, 9px);
    border-radius: 2px;
  }
  .gauge-run-row {
    width: min(72%, 420px);
    min-height: clamp(22px, 6cqw, 30px);
  }
  .btn-gauge-run {
    font-size: clamp(7px, 2.2cqw, 11px);
    gap: 2px;
    letter-spacing: 0.04em;
    border-radius: 8px;
  }
  .btn-gauge-ico { width: clamp(9px, 2.4cqw, 12px); height: clamp(9px, 2.4cqw, 12px); }
  .btn-gauge-run-label { letter-spacing: 0.04em; }
}

/* ---- Instruments — phones/tablets LANDSCAPE (grid pack, LARGE dials) ---- */
@media (max-width: 1100px) and (orientation: landscape) {
  /* Landscape MATCHES desktop center stack: gear→WS→G/PK→ET→SHIFT→TRACTION→LEDs→buttons.
     Portrait MQ alone keeps G/ET/SHIFT hide freeze (byte-stable). */
  .g-meter {
    display: flex;
    margin-top: auto;
    margin-bottom: clamp(1px, 0.2cqw, 2px);
    width: 88%;
    min-width: 40px;
    padding: 3px 3px 2px;
    gap: 1px;
  }
  .g-meter-label {
    font-size: clamp(5px, 1.35cqw, 7px);
    letter-spacing: 0.08em;
  }
  .g-meter-value { font-size: clamp(10px, 3.1cqw, 14px); }
  .g-meter-peak { font-size: clamp(5px, 1.45cqw, 8px); }
  .et-meter {
    display: flex;
    width: 96%;
    min-width: 48px;
    margin-top: 0;
    margin-bottom: clamp(1px, 0.2cqw, 2px);
    padding: 3px 2px 2px;
    gap: 1px;
  }
  .et-meter-label {
    font-size: clamp(5px, 1.35cqw, 7px);
    letter-spacing: 0.08em;
  }
  .et-meter-value {
    font-size: clamp(9px, 13.5cqw, 13px);
    letter-spacing: -0.055em;
  }
  .et-meter-unit { font-size: clamp(6px, 9cqw, 8px); }
  .shift-mph-meter {
    display: flex;
    margin-top: 0;
    margin-bottom: clamp(1px, 0.2cqw, 2px);
    width: 88%;
    min-width: 40px;
    padding: 3px 3px 2px;
    gap: 1px;
  }
  .shift-mph-meter-label {
    font-size: clamp(5px, 1.35cqw, 7px);
    letter-spacing: 0.08em;
  }
  .shift-mph-meter-value { font-size: clamp(10px, 3.1cqw, 14px); }
  .shift-mph-meter-unit { font-size: clamp(5px, 1.45cqw, 8px); }
  .gauges, .gauges.lfa-cluster {
    max-width: min(100%, 980px);
    max-height: min(72vh, 100%);
    margin-left: auto;
    margin-right: auto;
    /* Corridor nudged toward desktop so G/ET/SHIFT + champagne TRACTION fit */
    grid-template-columns: minmax(0, 1fr) minmax(74px, 0.185fr) minmax(0, 1fr);
    column-gap: clamp(2px, 0.5%, 6px);
    row-gap: clamp(2px, 0.4cqw, 5px);
    padding: clamp(2px, 0.35%, 4px) clamp(2px, 0.45%, 5px) clamp(2px, 0.45%, 5px);
    container-type: inline-size;
  }
  .gauge-wrap, .gauge-wrap--tach, .gauge-wrap--speedo { max-width: none; }
  .gauge-wrap {
    width: 100%;
    max-width: 100%;
    /* Soft VH ceiling — keep dials dominant without letterbox side voids */
    max-height: calc(100vh - 52px);
    justify-self: stretch;
    align-self: start;
  }
  .gauge-center-stack {
    justify-content: flex-start;
    gap: clamp(1px, 0.35cqw, 3px);
    padding: 1px 0 0;
    align-self: stretch;
    height: auto;
  }
  .gauge-run-row {
    width: min(50%, 480px);
    min-height: clamp(20px, 3.2cqw, 28px);
  }
  .gear-digit { width: 78%; min-width: 32px; margin-bottom: 0; }
  .gear-digit-value { font-size: clamp(16px, 5cqw, 36px); }
  .wheel-spin-mark {
    width: clamp(18px, 3.8cqw, 30px);
    height: clamp(14px, 3.2cqw, 24px);
  }
  .wheel-spin-line { font-size: clamp(5px, 1cqw, 7px); letter-spacing: 0.1em; }
  /* Label fit: same class of overflow as desktop — shrink tracking/type + widen card a hair */
  .traction-meter-label {
    font-size: clamp(5px, 1.05cqw, 7.5px);
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: var(--inst-brass-text, #f0e2c4);
    opacity: 1;
    text-shadow: 0 0 6px rgba(212,184,137,0.25);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0 1px;
  }
  /* Landscape TRACTION — same champagne + rim-fit as desktop (portrait MQ untouched) */
  .traction-meter {
    width: 94%;
    padding: 4px 5px 3px;
    gap: 3px;
    border-color: rgba(212,184,137,0.42);
    background:
      linear-gradient(180deg, rgba(255,246,224,0.09), transparent 62%),
      rgba(6,8,11,0.88);
    box-shadow:
      inset 0 1px 0 rgba(255,246,224,0.12),
      inset 0 0 0 1px rgba(0,0,0,0.4),
      0 0 8px rgba(212,184,137,0.08),
      0 2px 8px rgba(0,0,0,0.28);
  }
  .traction-meter-segs {
    display: grid;
    grid-template-columns: repeat(20, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    min-width: 0;
    height: 12px;
    min-height: 10px;
    max-height: 14px;
    gap: 1px;
    padding: 2px 5px;
    border-radius: 4px;
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    background:
      linear-gradient(180deg, #0c0e12 0%, #050608 100%);
    box-shadow:
      inset 0 0 0 1.5px rgba(212,184,137,0.48),
      inset 0 2px 5px rgba(0,0,0,0.65),
      inset 0 -1px 0 rgba(255,246,224,0.04);
  }
  .trac-seg {
    display: block;
    width: 100%;
    min-width: 0;
    height: 100%;
    border-radius: 1.5px;
    border: none;
    box-sizing: border-box;
    background: linear-gradient(180deg, #1c1814, #0e0c0a);
    opacity: 0.55;
    box-shadow:
      inset 0 0 0 1px rgba(90,72,48,0.4),
      inset 0 1px 1px rgba(0,0,0,0.45);
  }
  .trac-seg.is-on {
    opacity: 1;
    background:
      linear-gradient(180deg, #fff8e6 0%, #e8d2a0 38%, #c9a86a 100%);
    box-shadow:
      0 0 2px rgba(212,184,137,0.36),
      inset 0 0 0 1px rgba(232,210,160,0.45),
      inset 0 1px 0 rgba(255,252,240,0.65);
  }
  .traction-meter.is-low .trac-seg.is-on {
    background:
      linear-gradient(180deg, #ffe9b0 0%, #e0b050 42%, #a87828 100%);
    box-shadow:
      0 0 2px rgba(196,150,70,0.32),
      inset 0 0 0 1px rgba(210,170,90,0.45),
      inset 0 1px 0 rgba(255,246,210,0.55);
  }
  .traction-meter.is-critical .trac-seg.is-on {
    background:
      linear-gradient(180deg, #f0b090 0%, #c06042 42%, #8a3420 100%);
    box-shadow:
      0 0 2px rgba(168,80,55,0.34),
      inset 0 0 0 1px rgba(190,110,80,0.45),
      inset 0 1px 0 rgba(255,220,200,0.45);
  }
  /* Landscape stadium shift-light — desktop polish scaled for corridor */
  .shift-led-bar {
    width: 100%;
    min-height: 0;
    padding: 3px 5px;
    border-width: 1.5px;
    border-radius: 5px;
    border-color: rgba(212,184,137,0.52);
    overflow: hidden;
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,0.52),
      inset 0 1px 0 rgba(255,246,224,0.14),
      inset 0 2px 6px rgba(0,0,0,0.5),
      0 0 8px rgba(212,184,137,0.14);
  }
  .shift-led-row { gap: 2px; }
  .shift-led {
    width: 100%;
    min-width: 0;
    height: clamp(6px, 8cqw, 10px);
    border-radius: 2px;
  }
  .gauge-run-row {
    width: min(48%, 520px);
    min-height: clamp(22px, 3.6cqw, 32px);
  }
  .btn-gauge-run {
    font-size: clamp(8px, 1.7cqw, 12px);
    gap: 3px;
    letter-spacing: 0.05em;
    border-radius: 8px;
  }
  .btn-gauge-ico { width: clamp(10px, 2cqw, 14px); height: clamp(10px, 2cqw, 14px); }
  .btn-gauge-run-label { letter-spacing: 0.04em; }
}

.dyno-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin: 2px 0 6px;
  font-variant-numeric: tabular-nums;
}
.dyno-readout strong { color: var(--accent); font-weight: 600; }

.weight-hint {
  font-size: 10px;
  color: var(--text-dim);
  margin: -2px 0 6px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.balance-note {
  font-size: 10px;
  color: var(--text-dim);
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

/* Left setup panel — compact brass groups, no weight graphic */
.panel-garage {
  padding: 10px 12px 12px;
}
.panel-garage .setup-block + .setup-block {
  margin-top: 4px;
}
.panel-garage .card-title {
  margin-top: 12px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.panel-garage .setup-block:first-child .card-title {
  margin-top: 0;
}
.panel-garage .field {
  gap: 3px;
  margin-bottom: 6px;
}
.panel-garage .field > span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brass-text);
  opacity: 0.78;
}
.panel-garage .field input,
.panel-garage .field select,
.panel-garage .garage-filter {
  padding: 6px 8px;
}
.panel-garage .field-row,
.panel-garage .field-row-3 {
  gap: 6px;
}
.panel-garage .garage-list {
  max-height: 168px;
  margin-bottom: 2px;
}
.panel-garage .seg {
  margin-bottom: 8px;
}
.panel-garage .seg label {
  flex: 1 1 52px;
  padding: 6px 4px;
}
.panel-garage .gears-editor {
  margin-bottom: 6px;
}
.panel-garage .playback-note {
  margin-top: 6px;
}
.panel-garage .btn-run {
  margin-top: 12px;
}

body > .vb-chrome {
  max-width: 1400px;
  margin: 0.55rem auto 0.35rem;
  box-sizing: border-box;
}

/* Four-lane compare — same dark board as Run Data */
.compare-setup .hint {
  margin: 0 0 10px;
  color: var(--text-dim);
}
.compare-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 8px;
  align-items: start;
}
.compare-lane {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  row-gap: 4px;
  align-items: start;
  min-width: 0;
}
.compare-lane-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brass-text);
  opacity: 0.78;
}
.compare-search-pad {
  position: relative;
  min-height: 30px;
  min-width: 0;
}
.compare-slot-name,
.compare-name-row .compare-picked {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-dim);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  height: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-slot-name,
.compare-picked.is-set { color: var(--lime); }
.compare-search {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 12px;
}
.compare-search:focus {
  outline: none;
  border-color: rgba(76, 201, 240, 0.55);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(76, 201, 240, 0.35);
}
.compare-matches {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 168px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #07090d;
  border: 1px solid rgba(215, 196, 160, 0.38);
  border-radius: 6px;
  padding: 4px;
}
.compare-match, .compare-match-empty {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.3;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.compare-match:hover { color: var(--lime); background: rgba(200, 255, 74, 0.06); }
.compare-match-empty { color: var(--text-dim); cursor: default; }
.compare-matches[hidden] { display: none !important; }
.compare-clear {
  margin-top: 0;
  width: fit-content;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
}
.compare-clear:hover { color: var(--text); border-color: rgba(76, 201, 240, 0.4); }
.compare-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 30px;
}
.compare-name-row .compare-slot-name,
.compare-name-row .compare-picked {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
}
.compare-win {
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #c8ff4a;
  border: 1px solid rgba(200, 255, 74, 0.45);
  border-radius: 999px;
  padding: 1px 6px;
}
.compare-slip {
  margin-top: 0;
  width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.2;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(76, 201, 240, 0.14);
  border-radius: 6px;
  padding: 4px 6px 5px;
}
.slip-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.slip-col-k { width: 44%; }
.slip-col-t { width: 32%; }
.slip-col-m { width: 24%; }
.slip-table thead th {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: right;
  padding: 0 0 3px;
}
.slip-table thead th:first-child { text-align: left; }
.slip-table tbody th {
  text-align: left;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 4px 1px 2px;
  white-space: nowrap;
}
.slip-table td {
  text-align: right;
  padding: 1px 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.slip-table tbody tr:nth-child(odd) th,
.slip-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.025);
}
.slip-more tr:first-child th,
.slip-more tr:first-child td {
  border-top: 1px solid rgba(76, 201, 240, 0.16);
  padding-top: 4px;
}

@media (max-width: 900px) {
  .compare-slots { grid-template-columns: 1fr 1fr; }
}

/* 2026 Tesla Roadster estimates note (shown only on cars flagged estimatesDisclaimer) */
.car-estimate-note {
  margin: 6px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 184, 77, 0.55);
  border-left: 3px solid #ffb84d;
  border-radius: 6px;
  background: rgba(255, 184, 77, 0.08);
  font-size: 12px;
  line-height: 1.45;
}
.car-estimate-note strong { color: #ffcf85; }
