/* ConfigureX performance dashboard, speedometer and SEE SPECS drawer. Uses the existing :root tokens. */

.sx-see-specs { align-self: stretch; height: 34px; padding: 0 16px; border: 1px solid #2a62a6; border-radius: 6px; background: #151719e6; color: var(--lime); font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .22em; text-align: center; cursor: pointer; pointer-events: auto; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.sx-see-specs:hover, .sx-see-specs[aria-expanded="true"] { border-color: var(--lime); background: var(--lime); color: #07101b; }
.sx-see-specs:focus-visible, .sx-close:focus-visible, .sx-unit-toggle button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* HUD: sits in the empty band above the bike and in the top-right corner, never over the model */
.sx-hud { position: absolute; z-index: 2; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
/* Stats bar: four equal columns that line up with the SEE SPECS button underneath. */
.sx-top { position: absolute; top: 10px; left: 50%; display: flex; flex-direction: column; gap: 8px; width: min(600px, calc(100% - 360px)); transform: translateX(-50%); transition: transform .32s cubic-bezier(.2,.8,.3,1), opacity .24s ease; }
/* Hide / show the spec bar. The arrow stays on screen so it can be brought back. */
.sx-hud-collapsed .sx-top { transform: translateX(-50%) translateY(calc(-100% - 20px)); opacity: 0; pointer-events: none; }
.sx-hud-toggle { position: absolute; top: 10px; left: 50%; z-index: 3; display: grid; place-items: center; width: 42px; height: 24px; padding: 0; border: 1px solid #31353a; border-radius: 0 0 10px 10px; border-top: 0; background: #181a1ce8; backdrop-filter: blur(6px); color: #9aa3ad; cursor: pointer; pointer-events: auto; transform: translate(-50%, calc(var(--sx-top-h, 92px) + 6px)); transition: transform .32s cubic-bezier(.2,.8,.3,1), color .16s ease, border-color .16s ease; }
.sx-hud-toggle svg { width: 16px; height: 16px; transition: transform .32s ease; }
.sx-hud-toggle:hover { border-color: #2a62a6; color: var(--lime); }
.sx-hud-toggle:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.sx-hud-collapsed .sx-hud-toggle { transform: translate(-50%, 0); }
.sx-hud-collapsed .sx-hud-toggle svg { transform: rotate(180deg); }
html[data-theme="light"] .sx-hud-toggle { border-color: #d2d6da; background: #ffffffe8; color: #5a616b; }
@media (prefers-reduced-motion: reduce) { .sx-top, .sx-hud-toggle, .sx-hud-toggle svg { transition: none; } }
.sx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #31353a; border-radius: 9px; background: linear-gradient(180deg, #181a1cf2, #121315eb); box-shadow: 0 10px 30px #0006, inset 0 1px 0 #ffffff08; overflow: hidden; backdrop-filter: blur(6px); }
.sx-chip { position: relative; min-width: 0; padding: 10px 13px 10px; border-right: 1px solid #25282c; }
.sx-chip:last-child { border-right: 0; }
.sx-chip::before { position: absolute; top: 0; left: 13px; right: 13px; height: 2px; border-radius: 0 0 2px 2px; background: #373b41; content: ""; }
.sx-chip-label { display: flex; align-items: center; gap: 5px; overflow: hidden; color: #868f9a; font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; }
.sx-chip-label svg { flex: 0 0 13px; width: 13px; height: 13px; color: #3275c8; }
.sx-chip-value { margin-top: 4px; overflow: hidden; color: #e9f0f9; font-family: "Teko", "Arial Narrow", sans-serif; font-size: 22px; font-weight: 600; letter-spacing: .015em; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.sx-chip-sub { margin-top: 4px; overflow: hidden; color: #7e8793; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
/* System peak is the headline number: lime value and accent. */
.sx-chip--system { background: linear-gradient(180deg, #2e8bff14, #2e8bff05); }
.sx-chip--system::before { background: var(--lime); box-shadow: 0 0 10px #2e8bff88; }
.sx-chip--system .sx-chip-value { color: var(--lime); }
.sx-chip--system .sx-chip-label svg { color: var(--lime); }
.sx-chip[title] { pointer-events: auto; cursor: help; }

.sx-gauge { position: absolute; top: 48px; right: 22px; width: 148px; pointer-events: none; }
.sx-gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.sx-arc-track, .sx-arc-fill { fill: none; stroke-width: 5; stroke-linecap: round; }
.sx-arc-track { stroke: #2a2d32; }
.sx-arc-fill { stroke: var(--lime); }
.sx-ticks line { stroke: #495058; stroke-width: 1; }
.sx-ticks text { fill: #717b87; font-size: 6.5px; }
.sx-needle line { stroke: #e3ecf8; stroke-width: 1.8; stroke-linecap: round; }
.sx-needle circle { fill: #e3ecf8; }
/* Speed number: below the needle, tucked into the open bottom of the dial */
.sx-speed { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 5px; margin-top: -22%; text-align: center; font-variant-numeric: tabular-nums; }
.sx-speed-num { color: #edf3fa; font-family: "Teko", "Arial Narrow", sans-serif; font-size: 44px; font-weight: 600; line-height: .9; letter-spacing: .01em; }
.sx-speed-unit { color: var(--lime); font-size: 12px; font-weight: 700; }
.sx-speed-label { flex-basis: 100%; margin-top: 3px; color: #78828e; font-size: 8px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.sx-gauge-meta { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-top: 8px; }
.sx-max { text-align: center; }
.sx-max-label { color: #78828e; font-size: 9px; font-weight: 600; }
.sx-unit-toggle { display: flex; pointer-events: auto; border: 1px solid #32363c; border-radius: 6px; overflow: hidden; }
.sx-unit-toggle button { min-width: 42px; height: 24px; padding: 0 7px; border: 0; background: #181a1c; color: #848d98; font-size: 9px; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
.sx-unit-toggle button[aria-pressed="true"] { background: #282b2f; color: var(--lime); }

/* Full-screen specs overlay: opens as a circle growing from the centre of the screen */
.sx-overlay { position: fixed; z-index: 100; inset: 0; display: flex; flex-direction: column; background: #090a0b; clip-path: circle(0% at 50% 50%); opacity: 0; transition: clip-path .45s cubic-bezier(.2, .75, .2, 1), opacity .2s ease; }
.sx-overlay[hidden] { display: none; }
.sx-overlay.is-open { clip-path: circle(150% at 50% 50%); opacity: 1; }
.sx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px clamp(18px, 4vw, 48px) 16px; }
.sx-eyebrow { color: var(--lime); font-size: 9px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.sx-title { margin: 5px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.03em; }
.sx-close { width: 40px; height: 40px; border: 1px solid #35393f; border-radius: 8px; background: #141619; color: #b5bbc2; font-size: 22px; line-height: 1; cursor: pointer; }
.sx-close:hover { border-color: #2a62a6; color: var(--lime); }
.sx-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px clamp(18px, 4vw, 48px) 44px; scrollbar-color: #606872 #191b1d; }
.sx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; max-width: 1240px; margin: 0 auto; }
.sx-card { min-width: 0; padding: 18px 20px 12px; border: 1px solid #25282c; border-radius: 8px; background: linear-gradient(#121315, #0e0f10); }
.sx-wide { grid-column: 1 / -1; }
.sx-h { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; color: #eeeff1; font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.sx-icon { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--lime); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sx-note { margin: 8px 0 6px; color: #6d7783; font-size: 10.5px; line-height: 1.55; }
.sx-rows { margin: 0; }
.sx-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 12.5px; }
.sx-row dt { flex: 0 0 auto; max-width: 48%; color: #87909b; }
.sx-row dd { margin: 0; color: #eeeff1; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.sx-row dd.sx-missing { color: #535a63; font-weight: 500; }
.sx-product { display: flex; flex-direction: column; }
.sx-product .sx-h { margin-bottom: 12px; }
.sx-product-name { margin: 0; color: #eaf1fa; font-size: 17px; font-weight: 700; line-height: 1.25; }
.sx-product-identity { margin: 4px 0 12px; color: #9ba2ac; font-size: 12px; line-height: 1.45; }
.sx-product-weight { display: grid; gap: 4px; margin-bottom: 12px; padding: 10px 12px; border-left: 2px solid var(--lime); background: #17191b; }
.sx-product-weight-value { color: #eaf1fa; font-size: 15px; font-weight: 750; }
.sx-product-status { justify-self: start; padding: 2px 6px; border: 1px solid #42474e; border-radius: 3px; color: #9ca3ac; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.sx-product-status.is-estimated { border-color: #22518a; color: var(--lime); }
.sx-product-weight-label, .sx-product-weight-range, .sx-product-weight-change { color: #9fa6af; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.sx-product-weight-change { color: var(--lime); font-weight: 650; }
.sx-product-fields { margin: 0; border-top: 1px solid #24282c; }
.sx-product-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid #24282c; font-size: 12px; line-height: 1.4; }
.sx-product-field dt { color: #9fa6af; }
.sx-product-field dd { margin: 0; color: #eeeff1; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.sx-product-meta { display: grid; grid-template-columns: minmax(95px, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 8px 0 0; font-size: 11px; line-height: 1.5; }
.sx-product-meta-label { color: #7a8490; font-weight: 700; }
.sx-product-meta-value { color: #c1c6cc; overflow-wrap: anywhere; }
.sx-product-meta.is-source .sx-product-meta-value { color: #8c949f; }
.sx-tag { margin-left: 7px; padding: 1px 5px; border: 1px solid #193c65; border-radius: 3px; color: var(--lime); font-size: 8px; font-weight: 750; letter-spacing: .1em; vertical-align: 1px; }
.sx-table { width: 100%; margin: 12px 0 4px; border-collapse: collapse; font-size: 11.5px; }
.sx-table th { padding: 6px 0; color: #78828e; font-size: 9px; font-weight: 750; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.sx-table td { padding: 6px 8px 6px 0; border-top: 1px solid #1e2125; color: #a5acb4; }
.sx-table tr.is-upgraded td:last-child { color: var(--lime); font-weight: 650; }
.sx-sub { margin: 16px 0 6px; color: #a8afb7; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.sx-list { margin: 0 0 8px; padding-left: 16px; color: #939aa4; font-size: 11px; line-height: 1.6; }
.sx-list.is-warn { color: #e9c46a; }
.sx-status { flex: none; padding: 2px 7px; border: 1px solid #42474e; border-radius: 3px; font-size: 8.5px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.sx-status.is-ok { border-color: #22518a; color: var(--lime); }
.sx-status.is-mod { border-color: #8a7436; color: #e9c46a; }
.sx-status.is-bad { border-color: #8a3d3d; color: #ef7d7d; }
.sx-status.is-unv { border-color: #515862; color: #9db4c6; }
.sx-compat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; color: #c1c6cc; font-size: 12.5px; }
.sx-banner { margin: 0 0 8px; padding: 8px 10px; border-left: 2px solid; background: #151719; font-size: 11.5px; line-height: 1.5; }
.sx-banner.is-unv { border-color: #6f8aa0; color: #b8cbd9; }
.sx-banner.is-bad { border-color: #b85a5a; color: #f0a0a0; }
.sx-compat-item { border-top: 1px solid #1e2125; }
.sx-compat-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; font-size: 12.5px; color: #e1e3e6; }
.sx-compat-item.is-selected summary { color: var(--lime); }
.sx-compat-name { min-width: 0; overflow-wrap: anywhere; }
.sx-compat-body { padding: 0 0 10px 4px; }
.sx-compat-checks { margin: 0; padding: 0; list-style: none; }
.sx-compat-check { padding: 4px 0; color: #939aa4; font-size: 11px; line-height: 1.5; }
.sx-compat-check strong { color: #d6d9dd; font-weight: 650; }
.sx-compat-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #535a63; vertical-align: 1px; }
.sx-compat-check.is-ok .sx-compat-dot { background: var(--lime); }
.sx-compat-check.is-mod .sx-compat-dot { background: #e9c46a; }
.sx-compat-check.is-bad .sx-compat-dot { background: #ef7d7d; }
.sx-compat-check.is-unv .sx-compat-dot { background: #6f8aa0; }
.sx-matrix { overflow-x: auto; scrollbar-width: thin; }
.sx-speed-table th, .sx-speed-table td { padding-right: 12px; text-align: right; white-space: nowrap; }
.sx-speed-table th:first-child, .sx-speed-table td:first-child { text-align: left; }
.sx-speed-table tbody th { color: #a5acb4; font-size: 11.5px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.sx-speed-table td { color: #eeeff1; font-weight: 650; }
.sx-speed-table td.is-blocked { color: #4c525a; font-weight: 500; }
.sx-speed-table tr.is-selected th, .sx-speed-table tr.is-selected td:not(.is-blocked) { color: var(--lime); }
.sx-missing-list { margin: 14px 0 6px; }
.sx-missing-list summary { padding: 6px 0; color: #939aa4; font-size: 11px; font-weight: 650; cursor: pointer; }

/* Medium screens: anchor the bar left, under "LIVE PREVIEW", so it never runs into the speedo. */
@media (max-width: 1280px) and (min-width: 761px) { .sx-top { top: 44px; left: 24px; right: 196px; width: auto; transform: none; } }
@media (max-width: 960px) and (min-width: 761px) {
  .sx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-chip:nth-child(2n) { border-right: 0; }
  .sx-chip:nth-child(-n + 2) { border-bottom: 1px solid #25282c; }
}
@media (max-width: 1100px) { .sx-chip { padding: 9px 10px; } .sx-chip::before { left: 10px; right: 10px; } .sx-chip-value { font-size: 15px; } .sx-chip-label svg { display: none; } }

@media (max-width: 760px) {
  .topbar-note, .angles-badge { display: none; }
  .sx-top { left: 12px; right: 12px; width: auto; max-width: none; transform: none; top: 40px; }
  .sx-chip { padding: 8px 7px 8px; pointer-events: auto; }
  .sx-chip::before { left: 7px; right: 7px; }
  .sx-chip-label { font-size: 8px; letter-spacing: .06em; }
  .sx-chip-value { margin-top: 4px; font-size: 13px; }
  .sx-chip-sub { display: none; }
  .sx-see-specs { height: 38px; }
  .sidebar .side-heading { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
  .sidebar .side-heading .eyebrow, .sidebar .side-heading h1 { grid-column: 1; }
  .side-heading .sx-gauge { position: static; grid-column: 2; grid-row: 1 / span 2; width: 100px; pointer-events: auto; }
  .sx-gauge-meta { margin-top: 4px; gap: 4px; }
  .sx-max-label { display: none; }
  .sx-speed-num { font-size: 26px; }
  .sx-speed-label { font-size: 7px; }
  .sx-head { padding-top: 16px; }
  .sx-close { width: 44px; height: 44px; }
  .sx-card { padding: 16px 16px 10px; }
  .sx-product-name { font-size: 16px; }
  .sx-product-field { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 8px; font-size: 12px; }
  .sx-product-meta { grid-template-columns: minmax(78px, .65fr) minmax(0, 1.35fr); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) { .sx-overlay { transition: none; } }

/* Parts list: no description under a part's name; motors, controllers and batteries show one figure (Specs/part-info.js) */
#part-list .part-row .part-label > .part-meta { display: none; }
.part-info { display: block; margin-top: 3px; color: #8d97a3; font-size: 11px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.part-row.selected .part-info { color: #7fb0ea; }
html[data-theme="light"] .part-info { color: #5d6672; }
html[data-theme="light"] .part-row.selected .part-info { color: #0b4fae; }

/* Part dropdowns (battery size, motor / controller model, light colour): a full-width line under the part */
.part-row.has-option { flex-wrap: wrap; row-gap: 0; padding-bottom: 10px; }
.part-row.has-option > select.battery-capacity {
  flex: 1 1 100%; width: auto; max-width: none; height: 32px; margin: 0 0 0 52px; padding: 0 30px 0 10px;
  border: 1px solid #30353b; border-radius: 8px; background: #121416 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238d97a3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #d8dde3; font: inherit; font-size: 12px; font-weight: 600; text-overflow: ellipsis; cursor: pointer;
  -webkit-appearance: none; appearance: none; transition: border-color .15s ease, background-color .15s ease;
}
.part-row.has-option > select.battery-capacity:hover { border-color: #4a5058; }
.part-row.has-option > select.battery-capacity:focus-visible { outline: 2px solid var(--lime, #2e8bff); outline-offset: 1px; border-color: transparent; }
.part-row.has-option.selected > select.battery-capacity { border-color: #24476f; background-color: #111a24; color: #e8f1fb; }
.part-row.has-option > select.battery-capacity option { background: #16181b; color: #e3e8ee; }
.part-row.child.has-option > select.battery-capacity { margin-left: 52px; }
html[data-theme="light"] .part-row.has-option > select.battery-capacity { border-color: #d0d5db; background-color: #f7f8fa; color: #1c2430; }
html[data-theme="light"] .part-row.has-option.selected > select.battery-capacity { border-color: #9cc2ef; background-color: #eef5fd; }
html[data-theme="light"] .part-row.has-option > select.battery-capacity option { background: #fff; color: #1c2430; }
@media (max-width: 760px) {
  .part-row.has-option > select.battery-capacity { height: 40px; margin-left: 0; }
}

/* build weight in the parts panel heading (Specs/part-info.js) */
.cx-weight { display: inline-flex; align-items: baseline; gap: 6px; margin-top: 10px; padding: 6px 10px; border: 1px solid #2a2e33; border-radius: 9px; background: #121417; font-variant-numeric: tabular-nums; }
.cx-weight svg { width: 13px; height: 13px; align-self: center; color: var(--lime, #2e8bff); }
.cx-weight-k { color: #7f8995; font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.cx-weight b { color: #fff; font-family: var(--teko, "Teko", sans-serif); font-size: 21px; font-weight: 600; line-height: .9; }
.cx-weight em { color: #8d97a3; font-size: 11px; font-style: normal; font-weight: 700; }
.cx-weight em.up { color: #ffb36b; } .cx-weight em.down { color: #7dffb0; }
html[data-theme="light"] .cx-weight { border-color: #dde1e5; background: #fff; }
html[data-theme="light"] .cx-weight b { color: #16202c; }
html[data-theme="light"] .cx-weight em.up { color: #b25d00; } html[data-theme="light"] .cx-weight em.down { color: #138a3d; }
@media (max-width: 760px) {
  .sidebar .side-heading { flex-wrap: wrap; }
  .side-heading .cx-weight { order: 3; flex: 1 1 100%; margin-top: 2px; padding: 4px 10px; }
  .cx-weight b { font-size: 18px; }
}

/* background picker in Settings (configurator.html) */
.bg-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.bg-pick .reset-button { justify-content: center; }
.bg-pick .reset-button[aria-pressed="true"] { border-color: #2a62a6; background: #16243a; color: var(--lime, #2e8bff); }
html[data-theme="light"] .bg-pick .reset-button[aria-pressed="true"] { border-color: #9cc2ef; background: #eef5fd; }

