/* ConfigureX Suspension Lab */
.lab-button svg { width: 15px; height: 15px; flex: 0 0 15px; }
.lab-button:hover, .lab-button[aria-pressed="true"] { border-color: #2a62a6; color: var(--lime); }
.lab-button[aria-pressed="true"] { background: #16243a; }

/* stage */
#lab-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#lab-canvas.dragging { cursor: grabbing; } #lab-canvas.pan { cursor: move; }
.stage.lab-active #preview { visibility: hidden; }
.stage.lab-active .view-controls, .stage.lab-active .angle-count, .stage.lab-active .sx-gauge { visibility: hidden; }
.stage.lab-active .rotate-hint-text { display: none; }
.lab-hint { display: none; }
.stage.lab-active .lab-hint { display: inline; }

/* top-right: live fork + shock */
.lab-hud { position: absolute; z-index: 3; top: 18px; right: 22px; display: none; gap: 10px; padding: 12px 14px; border: 1px solid #2e323866; border-radius: 16px; background: #15171ad9; backdrop-filter: blur(8px); }
.stage.lab-active .lab-hud { display: flex; }
.lab-hud-item { display: grid; justify-items: center; gap: 4px; width: 84px; }
.lab-hud-item svg { width: 54px; height: 112px; overflow: visible; }
.lab-hud-pct { color: #fff; font-family: var(--teko); font-size: 30px; line-height: .9; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.lab-hud-pct small { color: #8d96a2; font-family: inherit; font-size: 15px; margin-left: 1px; }
.lab-hud-label { color: #8d96a2; font-size: 9px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.lab-hud-mm { color: #a4acb6; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.lab-hud-item.bottom .lab-hud-pct { color: #ff8a5c; }

/* sidebar */
.sidebar.lab-mode > :not(.lab-panel) { display: none; }
.sidebar.lab-mode.lab-show-parts > :not(.lab-panel) { display: revert; }
.sidebar.lab-mode.lab-show-parts > .lab-panel .lab-body { display: none; }
.lab-panel { animation: lab-in .28s ease-out; }
@keyframes lab-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.lab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 21px 20px 6px; }
.lab-head h1 { margin: 4px 0 0; }
.lab-sub { margin: 0; padding: 0 20px 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.lab-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.lab-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 11px; border: 1px solid #31363c; border-radius: 10px; background: #1b1e22; color: #d3d8de; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; transition: border-color .15s, background .15s; }
.lab-btn svg { width: 15px; height: 15px; flex: 0 0 15px; }
.lab-btn:hover { border-color: #46505c; }
.lab-btn[aria-pressed="true"] { border-color: #2a62a6; background: #16243a; color: var(--lime); }
.lab-btn.primary { border-color: #2a62a6; background: linear-gradient(180deg, #1d4f93, #173f76); color: #fff; }
.lab-note { margin: 14px 20px 0; padding: 10px 12px; border: 1px solid #5a4a24; border-radius: 10px; background: #2a2416; color: #f0c674; font-size: 12px; }
.lab-tip { display: flex; gap: 10px; margin: 14px 20px 0; padding: 11px 12px; border: 1px solid #23406a; border-radius: 10px; background: #12203a; color: #b9cdee; font-size: 11.5px; line-height: 1.5; }
.lab-tip b { color: #fff; }
.lab-tip button { align-self: flex-start; border: 0; background: none; color: #7fa6e3; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.lab-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.lab-actions .lab-btn { flex-direction: column; gap: 5px; padding: 10px 6px; font-size: 11px; }
.lab-actions .lab-btn svg { width: 18px; height: 18px; }
.lab-group { border-bottom: 1px solid var(--line); }
.lab-group > summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; list-style: none; }
.lab-group > summary::-webkit-details-marker { display: none; }
.lab-group > summary .lab-g-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: #1d2a3e; color: var(--lime); }
.lab-group > summary .lab-g-icon svg { width: 17px; height: 17px; }
.lab-g-text { display: grid; gap: 1px; min-width: 0; }
.lab-g-title { color: #e8ecf0; font-size: 13px; font-weight: 750; }
.lab-g-sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-group > summary .lab-chev { margin-left: auto; color: #6f7883; transition: transform .2s; }
.lab-group[open] > summary .lab-chev { transform: rotate(90deg); }
.lab-group-body { padding: 0 20px 18px; }
.lab-info { margin: 0 0 12px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.lab-kind { margin: 14px 0 2px; color: #7f8a96; font-size: 9.5px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.lab-field { margin: 10px 0 12px; }
.lab-field-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lab-field-top label { color: #e3e7eb; font-size: 12.5px; font-weight: 650; }
.lab-help { margin: 2px 0 6px; color: #8a939e; font-size: 11px; line-height: 1.4; }
.lab-step { display: inline-flex; align-items: center; border: 1px solid #31363c; border-radius: 9px; overflow: hidden; }
.lab-step button { width: 28px; height: 26px; border: 0; background: #1b1e22; color: #d3d8de; font: inherit; font-size: 15px; cursor: pointer; }
.lab-step button:hover { background: #242830; }
.lab-step output { min-width: 82px; padding: 0 6px; color: #fff; font-size: 12px; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.lab-field input[type=range] { width: 100%; accent-color: var(--lime); }
.lab-scale { display: flex; justify-content: space-between; color: #6f7883; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.lab-field select { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid #31363c; border-radius: 9px; background: #1b1e22; color: #e8ecf0; font: inherit; font-size: 12px; }
.lab-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lab-chip { padding: 5px 10px; border: 1px solid #31363c; border-radius: 99px; background: #1b1e22; color: #c5cbd2; font: inherit; font-size: 11px; cursor: pointer; }
.lab-chip[aria-pressed="true"] { border-color: #2a62a6; background: #16243a; color: var(--lime); }
.lab-result { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 10px 12px; border: 1px solid #2c3238; border-radius: 10px; background: #181b1f; }
.lab-result-text { display: grid; gap: 2px; }
.lab-result-text span:first-child { color: #8a939e; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lab-result-text b { color: #fff; font-size: 13px; }
.lab-badge { padding: 4px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 750; }
.lab-badge.good { background: #143a24; color: #5fd48c; }
.lab-badge.soft { background: #3f2516; color: #ff9a5c; }
.lab-badge.firm { background: #1d2a3e; color: #7fb0ff; }
.lab-badge.idle { background: #23272c; color: #9aa3ae; }
.lab-reset { margin-top: 10px; width: 100%; }

/* light theme */
html[data-theme="light"] .lab-btn, html[data-theme="light"] .lab-step button, html[data-theme="light"] .lab-chip, html[data-theme="light"] .lab-field select { border-color: #d0d4d9; background: #f4f5f7; color: #2b3138; }
html[data-theme="light"] .lab-step { border-color: #d0d4d9; }
html[data-theme="light"] .lab-btn[aria-pressed="true"], html[data-theme="light"] .lab-chip[aria-pressed="true"] { background: #e6efff; color: #0b66e4; border-color: #9cc0f5; }
html[data-theme="light"] .lab-btn.primary { background: #0b66e4; color: #fff; }
html[data-theme="light"] .lab-g-title, html[data-theme="light"] .lab-field-top label, html[data-theme="light"] .lab-step output, html[data-theme="light"] .lab-result-text b { color: #14181d; }
html[data-theme="light"] .lab-result { background: #f6f7f9; border-color: #dfe2e6; }
html[data-theme="light"] .lab-group > summary .lab-g-icon { background: #e6efff; }
html[data-theme="light"] .lab-tip { background: #eef4ff; border-color: #c7dafb; color: #34507a; }
html[data-theme="light"] .lab-tip b { color: #14181d; }
html[data-theme="light"] .lab-hud { background: #ffffffe6; border-color: #d9dce0; }
html[data-theme="light"] .lab-hud-pct { color: #14181d; }
html[data-theme="light"] .lab-button[aria-pressed="true"] { background: #e6efff; }
@media (max-width: 760px) { .lab-hud { top: 10px; right: 10px; padding: 8px 10px; } .lab-hud-item { width: 64px; } .lab-hud-item svg { width: 40px; height: 84px; } }
#lab-canvas[hidden] { display: none; }   /* the site styles every canvas as display:block, which would beat [hidden] */
.lab-tip[hidden], .lab-note[hidden], .lab-panel[hidden] { display: none; }
/* phones: icon-only Lab button, compact live panel, no long hint line, bigger touch targets */
@media (max-width: 760px) {
  .lab-button .garage-button-label { display: none; }
  .stage.lab-active .lab-hint { display: none; }
  .lab-hud { gap: 4px; padding: 6px 8px; border-radius: 12px; }
  .lab-hud-item { width: 54px; gap: 2px; }
  .lab-hud-item svg { width: 30px; height: 62px; }
  .lab-hud-pct { font-size: 22px; } .lab-hud-pct small { font-size: 12px; }
  .lab-hud-label { font-size: 7.5px; letter-spacing: .1em; } .lab-hud-mm { display: none; }
  .lab-step button { width: 36px; height: 34px; font-size: 17px; }
  .lab-step output { min-width: 74px; }
  .lab-field input[type=range] { height: 28px; }
  .lab-chip { padding: 8px 12px; }
  .lab-actions .lab-btn { padding: 12px 6px; }
}
.lab-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lab-panel { min-width: 0; overflow-x: hidden; }
@media (max-width: 760px) {
  .topbar-right { gap: 5px; min-width: 0; }
  .topbar-right > button, .topbar-right .garage-button { padding-left: 9px; padding-right: 9px; }
  .lab-hud { top: auto; bottom: 70px; right: 10px; }   /* clear of the spec bar at the top */
}
@media (max-width: 760px) { .topbar .garage-button-label { display: none; } }   /* Lab + Garage as icons so the top bar fits a phone */
@media (max-width: 760px) { #reset-build { max-width: 31px; overflow: hidden; white-space: nowrap; padding-left: 10px; padding-right: 0; } }   /* just the ↺ on phones, so the Lab button fits */
@media (max-width: 760px) { #theme-toggle { display: none; } }   /* phones: room for the Lab and Ride buttons (theme still follows the device) */
