:root {
  --navy: #173f60;
  --blue: #176f9f;
  --blue-soft: #e7f3f9;
  --sky: #65b6d7;
  --ink: #20313d;
  --muted: #60717d;
  --paper: #f5f8fa;
  --panel: #ffffff;
  --line: #d6e1e7;
  --yellow: #e7b73e;
  --yellow-soft: #fff7d9;
  --green: #2f8564;
  --green-soft: #e8f5ef;
  --red: #a84a4a;
  --red-soft: #faecec;
  --orange: #b96926;
  --shadow: 0 20px 55px rgba(23, 63, 96, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(101, 182, 215, .19), transparent 26%),
    linear-gradient(180deg, #f8fbfc, var(--paper));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { width: 100%; height: auto; }

.build-header {
  width: min(1500px, calc(100% - 28px));
  margin: 14px auto 0;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 10px;
  z-index: 30;
  border: 1px solid rgba(23, 63, 96, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 35px rgba(23, 63, 96, .08);
  backdrop-filter: blur(16px);
}
.build-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.build-brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--blue), var(--navy));
  border-radius: 13px;
  font-size: 1.35rem;
}
.build-brand strong, .build-brand small { display: block; }
.build-brand strong { color: var(--navy); }
.build-brand small { color: var(--muted); }
.build-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.build-header-actions a,
.build-header-actions button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--navy);
  background: white;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}
.build-header-actions a:hover,
.build-header-actions button:hover { border-color: var(--sky); background: var(--blue-soft); }

.build-layout {
  width: min(1500px, calc(100% - 28px));
  margin: 28px auto 70px;
  display: grid;
  grid-template-columns: 295px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.build-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 4px;
}
.progress-card {
  padding: 20px;
  margin-bottom: 14px;
  color: white;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.progress-card .eyebrow { color: #cdeaf7; }
.progress-card strong { display: block; margin-top: 5px; font-size: 1.2rem; }
.progress-card small { color: rgba(255,255,255,.72); }
.progress-track { height: 10px; margin: 12px 0 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: white; transition: width .25s ease; }
.step-nav { display: grid; gap: 6px; }
.step-nav button {
  width: 100%;
  min-height: 47px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 34px 1fr 16px;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.step-nav button:hover { background: white; border-color: var(--line); }
.step-nav button.is-active { color: var(--navy); background: white; border-color: #a9ccdc; box-shadow: 0 8px 20px rgba(23,63,96,.07); }
.step-nav button.is-complete i { background: var(--green); }
.step-nav b { color: var(--blue); font-size: .78rem; }
.step-nav span { font-weight: 760; }
.step-nav i { width: 9px; height: 9px; border-radius: 50%; background: #d8e0e5; }
.reset-button {
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #e3c7c7;
  border-radius: 11px;
  color: var(--red);
  background: white;
  font-weight: 750;
  cursor: pointer;
}

.build-content { min-width: 0; }
.build-hero {
  padding: clamp(28px, 4vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 30px;
  align-items: center;
  border: 1px solid rgba(23,63,96,.12);
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow);
}
.build-hero h1 {
  max-width: 820px;
  margin: 8px 0 14px;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.04em;
}
.build-hero p:not(.eyebrow) { max-width: 780px; color: var(--muted); font-size: 1.08rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero-badges span { padding: 7px 10px; border: 1px solid #c7dde8; border-radius: 999px; color: var(--navy); background: var(--blue-soft); font-size: .87rem; font-weight: 760; }
.hero-system { padding: 18px; border-radius: 22px; color: var(--navy); background: linear-gradient(145deg, #edf7fb, #f8fbfc); }
.hero-system svg * { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.hero-system .chassis { fill: #f5e4b8; stroke: #8b6728; }
.hero-system .wheel { fill: #263746; stroke: #13212d; }
.hero-system .gearbox { fill: #dcebf2; }
.hero-system .motor { fill: #c9d7de; }
.hero-system .gear { fill: white; }
.hero-system .gear.small { fill: var(--yellow-soft); }
.mobile-step-picker { display: none; }

.build-step {
  margin-top: 24px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: white;
  box-shadow: 0 14px 40px rgba(23,63,96,.065);
}
body:not(.show-all) .build-step:not(.is-active) { display: none; }
.step-heading { margin-bottom: 28px; }
.step-heading > span { color: var(--blue); font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.step-heading h2 { margin: 6px 0 8px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 500; line-height: 1.05; }
.step-heading p { max-width: 850px; margin: 0; color: var(--muted); font-size: 1.05rem; }

.callout { margin: 22px 0; padding: 18px 20px; border-radius: 16px; border-left: 5px solid; }
.callout strong { display: block; margin-bottom: 4px; }
.callout p { margin: 0; }
.safety-callout { border-color: var(--orange); background: #fff3e7; }
.teacher-callout { border-color: var(--blue); background: var(--blue-soft); }
.warning-callout { border-color: var(--red); background: var(--red-soft); }

.card-grid { display: grid; gap: 16px; }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-card, .large-instruction-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfdfe;
}
.info-card h3, .large-instruction-card h3 { margin: 12px 0 7px; color: var(--navy); }
.info-card p, .large-instruction-card p, .large-instruction-card li { color: var(--muted); }
.card-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-weight: 850; }
.large-instruction-card > span { color: var(--blue); font-size: .78rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.large-instruction-card ol, .large-instruction-card ul { padding-left: 20px; }
.large-instruction-card li + li { margin-top: 8px; }
.check-card { border-color: #b8d8c8; background: var(--green-soft); }

.checklist-card {
  margin-top: 24px;
  padding: 22px;
  display: grid;
  gap: 9px;
  border: 1px solid #b8d1df;
  border-radius: 18px;
  background: #f2f8fb;
}
.checklist-card h3 { margin: 0 0 5px; color: var(--navy); }
.checklist-card label { padding: 10px 12px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid transparent; border-radius: 11px; background: white; cursor: pointer; }
.checklist-card label:has(input:checked) { border-color: #9dcbb5; background: var(--green-soft); }
.checklist-card input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--green); flex: 0 0 auto; }

.component-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.component-card { min-height: 142px; padding: 17px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto 1fr; gap: 4px 10px; align-items: start; border: 1px solid var(--line); border-radius: 16px; background: #fbfdfe; cursor: pointer; }
.component-card:has(input:checked) { border-color: #87bea3; background: var(--green-soft); }
.component-card input { grid-row: 1 / 4; width: 18px; height: 18px; margin-top: 6px; accent-color: var(--green); }
.component-icon { font-size: 1.8rem; color: var(--navy); }
.component-card strong { color: var(--navy); }
.component-card small { color: var(--muted); }
.white-gear { color: #8ca0ad; }
.yellow-gear { color: #c8981a; }

.diagram-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; align-items: stretch; }
.diagram-layout.reverse { grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); }
.diagram-card { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #f9fcfd; }
.diagram-card figcaption { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.diagram-card svg text { fill: var(--navy); stroke: none; font: 700 16px Inter, sans-serif; text-anchor: middle; }
.diagram-base { fill: #f1dfb3; stroke: #8d692b; stroke-width: 4; }
.diagram-gearbox { fill: #dcebf2; stroke: var(--navy); stroke-width: 4; }
.diagram-battery { fill: #eef1f3; stroke: #596b76; stroke-width: 4; }
.diagram-switch { fill: var(--yellow-soft); stroke: #9b7619; stroke-width: 4; }
.diagram-wheel { fill: #273a48; stroke: #13212d; stroke-width: 5; }
.diagram-axle { stroke: var(--navy); stroke-width: 6; }
.diagram-wire { stroke: var(--red); stroke-width: 4; stroke-dasharray: 7 7; }
.guide-tube { fill: white; stroke: #87a8ba; stroke-width: 5; }
.steel-shaft { stroke: #4c5f6b; stroke-width: 9; }
.dimension-line { stroke: var(--blue); stroke-width: 3; }
.instruction-stack { display: grid; gap: 10px; }
.instruction-stack article { padding: 14px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.instruction-stack article b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); }
.instruction-stack strong { color: var(--navy); }
.instruction-stack p { margin: 2px 0 0; color: var(--muted); }
.instruction-stack.horizontal { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.design-note-card { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdfe; }
.design-note-card label { display: block; margin-bottom: 9px; color: var(--navy); }
.design-note-card textarea { width: 100%; resize: vertical; padding: 12px; border: 1px solid #b9cbd5; border-radius: 12px; color: var(--ink); background: white; }

.process-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.process-strip article { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfe; }
.process-strip span { color: var(--blue); font-weight: 900; }
.process-strip strong { display: block; margin: 8px 0 4px; color: var(--navy); }
.process-strip p { margin: 0; color: var(--muted); font-size: .92rem; }

.tradeoff-panel { padding: 22px; display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 20px; align-items: center; border: 1px solid #bfd7e3; border-radius: 18px; background: linear-gradient(90deg, #edf7fb, white, #fff8df); }
.tradeoff-panel > div:not(.tradeoff-arrow) { display: grid; gap: 4px; }
.tradeoff-panel > div:last-child { text-align: right; }
.tradeoff-panel strong { color: var(--navy); }
.tradeoff-panel span { color: var(--blue); font-weight: 760; }
.tradeoff-panel small { color: var(--muted); }
.tradeoff-arrow { height: 8px; position: relative; border-radius: 999px; background: linear-gradient(90deg, var(--sky), var(--yellow)); }
.tradeoff-arrow::before, .tradeoff-arrow::after { content: ""; width: 14px; height: 14px; position: absolute; top: 50%; border-top: 3px solid var(--navy); border-right: 3px solid var(--navy); }
.tradeoff-arrow::before { left: 0; transform: translateY(-50%) rotate(-135deg); }
.tradeoff-arrow::after { right: 0; transform: translateY(-50%) rotate(45deg); }
.gear-selector { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.gear-selector button { min-height: 145px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; border: 2px solid var(--line); border-radius: 17px; color: var(--ink); background: white; text-align: left; cursor: pointer; }
.gear-selector button:hover { border-color: var(--sky); transform: translateY(-2px); }
.gear-selector button.is-selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 12px 25px rgba(23,111,159,.12); }
.gear-selector span { color: var(--blue); font-size: .76rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.gear-selector strong { margin: 8px 0 4px; color: var(--navy); font-size: 1.1rem; }
.gear-selector small { color: var(--muted); }
.gear-choice-summary { margin-top: 14px; padding: 18px; border-radius: 15px; background: #eef5f8; }
.gear-choice-summary strong { color: var(--navy); }
.gear-choice-summary p { margin: 4px 0 0; color: var(--muted); }

.gear-build-panel { min-height: 250px; padding: 22px; border: 1px solid #bfd7e3; border-radius: 20px; background: #f8fcfe; }
.empty-state { min-height: 205px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state strong { color: var(--navy); font-size: 1.25rem; }
.empty-state p { color: var(--muted); }
.empty-state button { padding: 10px 14px; border: 0; border-radius: 11px; color: white; background: var(--blue); font-weight: 800; cursor: pointer; }
.gear-build-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.gear-build-header h3 { margin: 5px 0; color: var(--navy); font-size: 1.55rem; }
.gear-build-header p { margin: 0; color: var(--muted); }
.output-badge { padding: 8px 11px; border-radius: 999px; color: var(--navy); background: var(--yellow-soft); font-weight: 850; white-space: nowrap; }
.gear-build-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 18px; margin-top: 18px; }
.parts-list, .gear-assembly-steps { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.parts-list h4, .gear-assembly-steps h4 { margin: 0 0 12px; color: var(--navy); }
.parts-list ul, .gear-assembly-steps ol { margin: 0; padding-left: 20px; }
.parts-list li, .gear-assembly-steps li { margin: 7px 0; color: var(--muted); }
.shaft-stack { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shaft-column { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.shaft-column h4 { margin: 0 0 10px; color: var(--navy); }
.gear-chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.gear-chip { padding: 7px 9px; border-radius: 999px; font-size: .82rem; font-weight: 800; }
.gear-chip.white { color: #526672; background: #edf1f3; border: 1px solid #bdcbd2; }
.gear-chip.yellow { color: #7d5d08; background: var(--yellow-soft); border: 1px solid #e4c66d; }
.gear-chip.locator { color: var(--navy); background: var(--blue-soft); border: 1px solid #acd2e3; }
.gear-chip.washer { color: #5c4a2b; background: #f4ead7; border: 1px solid #d9c5a3; }
.gear-chip.empty { color: var(--muted); background: #f4f6f7; border: 1px dashed #c8d1d6; }
.gear-rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.gear-rules-grid article { padding: 16px; display: grid; grid-template-columns: 28px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.gear-rules-grid strong { color: var(--navy); }
.gear-rules-grid p { margin: 2px 0 0; color: var(--muted); }
.gear-dot { width: 25px; height: 25px; border-radius: 50%; border: 4px dashed currentColor; }
.gear-dot.white { color: #95a5af; background: white; }
.gear-dot.yellow { color: #b88a16; background: var(--yellow-soft); }
.gear-dot.locator { color: var(--blue); width: 19px; height: 19px; margin: 3px; }
.gear-dot.washer { color: #8c7450; border-style: solid; border-width: 3px; background: transparent; }

.motor-process { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr); gap: 20px; }
.motor-body { fill: #d8e1e6; stroke: #526672; stroke-width: 5; }
.motor-shaft, .rear-shaft { stroke: #526672; stroke-width: 10; }
.motor-pinion { fill: var(--yellow-soft); stroke: #9a7619; stroke-width: 5; }
.tap-arrow { fill: none; stroke: var(--orange); stroke-width: 6; }

.wheel-check-visual { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wheel-example { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.wheel-example span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 900; }
.wheel-example.good { border-color: #9ec8b2; background: var(--green-soft); }
.wheel-example.good span { background: var(--green); }
.wheel-example.bad { border-color: #e2baba; background: var(--red-soft); }
.wheel-example.bad span { background: var(--red); }
.wheel-example strong { display: block; margin: 10px 0 4px; color: var(--navy); }
.wheel-example p { margin: 0; color: var(--muted); }

.wiring-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.wiring-controls button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--navy); background: white; font-weight: 760; cursor: pointer; }
.wiring-controls button.is-active { color: white; border-color: var(--blue); background: var(--blue); }
.wiring-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; }
.wiring-diagram-card { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #fbfdfe; }
.wiring-diagram-card figcaption { padding: 10px 6px 2px; color: var(--muted); font-size: .9rem; }
#wiringDiagram text { fill: var(--navy); stroke: none; font: 800 16px Inter, sans-serif; text-anchor: middle; }
#wiringDiagram .wire-device rect, #wiringDiagram .switch-device rect { fill: white; stroke: var(--navy); stroke-width: 4; }
#wiringDiagram .motor-device rect { fill: #e2e9ed; }
#wiringDiagram .battery-device rect { fill: #fff8df; stroke: #9a7619; }
#wiringDiagram .terminal circle { fill: white; stroke: var(--navy); stroke-width: 4; }
#wiringDiagram .terminal text { font-size: 15px; }
#wiringDiagram .wire-path path { fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
#wiringDiagram .motor-wire path { stroke: #176f9f; }
#wiringDiagram .battery-wire.positive path { stroke: #c34848; }
#wiringDiagram .battery-wire.negative path { stroke: #344b5c; }
#wiringDiagram .jumper-wire path { stroke: #d98f27; stroke-dasharray: 12 8; }
#wiringDiagram[data-layer="motor"] .battery-wire,
#wiringDiagram[data-layer="motor"] .jumper-wire,
#wiringDiagram[data-layer="battery"] .motor-wire,
#wiringDiagram[data-layer="battery"] .jumper-wire,
#wiringDiagram[data-layer="jumpers"] .motor-wire,
#wiringDiagram[data-layer="jumpers"] .battery-wire { opacity: .13; }
.wiring-steps { display: grid; gap: 10px; }
.wiring-steps article { padding: 14px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.wiring-steps span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-weight: 900; }
.wiring-steps strong { color: var(--navy); }
.wiring-steps p { margin: 2px 0 0; color: var(--muted); }

.first-test-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.first-test-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfe; }
.first-test-grid span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-weight: 900; }
.first-test-grid strong { display: block; margin: 9px 0 4px; color: var(--navy); }
.first-test-grid p { margin: 0; color: var(--muted); }
.diagnostic-tool { margin-top: 22px; padding: 22px; display: grid; grid-template-columns: minmax(260px, .6fr) minmax(0, 1.4fr); gap: 20px; border: 1px solid #bed7e3; border-radius: 20px; background: var(--blue-soft); }
.diagnostic-tool h3 { margin: 5px 0 10px; color: var(--navy); }
.diagnostic-tool select { width: 100%; padding: 11px; border: 1px solid #a8c5d3; border-radius: 11px; background: white; }
.diagnostic-result { padding: 18px; border-radius: 15px; background: white; }
.diagnostic-result strong { color: var(--navy); }
.diagnostic-result ol { margin-bottom: 0; padding-left: 20px; color: var(--muted); }
.test-log-card { display: grid; gap: 8px; }

.final-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.final-check-grid label { padding: 18px; display: grid; grid-template-columns: auto 40px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: white; cursor: pointer; }
.final-check-grid label:has(input:checked) { border-color: #91c3a8; background: var(--green-soft); }
.final-check-grid input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--green); }
.final-check-grid span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-weight: 900; }
.final-check-grid strong { color: var(--navy); }
.final-check-grid p { margin: 3px 0 0; color: var(--muted); }
.completion-panel { margin-top: 22px; padding: 24px; display: flex; align-items: center; gap: 18px; border-radius: 18px; color: white; background: linear-gradient(145deg, var(--navy), var(--blue)); }
.completion-panel > span { font-size: 2.6rem; }
.completion-panel .eyebrow { color: #cdeaf7; }
.completion-panel h3 { margin: 3px 0; font-size: 1.4rem; }
.completion-panel p { margin: 0; color: rgba(255,255,255,.8); }
.completion-panel.is-complete { background: linear-gradient(145deg, #23684d, var(--green)); }

.step-footer-controls { margin-top: 18px; padding: 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.step-footer-controls button { padding: 10px 14px; border: 0; border-radius: 11px; color: white; background: var(--navy); font-weight: 800; cursor: pointer; }
.step-footer-controls button:last-child { justify-self: end; }
.step-footer-controls button:disabled { opacity: .35; cursor: not-allowed; }
.step-footer-controls span { color: var(--muted); font-weight: 760; text-align: center; }
body.show-all .step-footer-controls { display: none; }

.build-footer { padding: 30px 16px 50px; color: var(--muted); text-align: center; }
.build-footer p { margin: 0; }

@media (max-width: 1180px) {
  .build-layout { grid-template-columns: 245px minmax(0, 1fr); }
  .build-hero { grid-template-columns: 1fr; }
  .hero-system { max-width: 620px; }
  .component-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gear-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagram-layout, .diagram-layout.reverse, .motor-process, .wiring-layout { grid-template-columns: 1fr; }
  .gear-build-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .build-header { position: static; align-items: flex-start; }
  .build-header-actions { display: none; }
  .build-layout { display: block; }
  .build-sidebar { display: none; }
  .mobile-step-picker { margin: 18px 0 0; padding: 14px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 14px; background: white; }
  .mobile-step-picker label { color: var(--navy); font-weight: 800; }
  .mobile-step-picker select { padding: 10px; border: 1px solid #aec6d3; border-radius: 10px; background: white; }
  .card-grid.three, .card-grid.two, .process-strip, .wheel-check-visual, .first-test-grid, .final-check-grid, .instruction-stack.horizontal { grid-template-columns: 1fr; }
  .tradeoff-panel { grid-template-columns: 1fr; text-align: left; }
  .tradeoff-panel > div:last-child { text-align: left; }
  .tradeoff-arrow { transform: rotate(90deg); margin: 16px 0; }
  .diagnostic-tool { grid-template-columns: 1fr; }
}

@media (max-width: 570px) {
  .build-layout, .build-header { width: min(100% - 16px, 1500px); }
  .build-brand small { display: none; }
  .build-hero, .build-step { padding: 22px 17px; border-radius: 20px; }
  .build-hero h1 { font-size: 2.55rem; }
  .component-grid, .gear-selector, .gear-rules-grid, .shaft-stack { grid-template-columns: 1fr; }
  .component-card { min-height: 0; }
  .step-footer-controls { grid-template-columns: 1fr 1fr; }
  .step-footer-controls span { grid-column: 1 / -1; grid-row: 1; }
  .step-footer-controls button { grid-row: 2; }
}

@media print {
  body { background: white; }
  .build-header, .build-sidebar, .mobile-step-picker, .step-footer-controls, .wiring-controls, .reset-button { display: none !important; }
  .build-layout { width: 100%; margin: 0; display: block; }
  .build-content { width: 100%; }
  .build-hero { box-shadow: none; border: 1px solid #aaa; break-after: page; }
  .build-step { display: block !important; box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .build-step + .build-step { margin-top: 18px; }
  .checklist-card label, .component-card, .final-check-grid label { break-inside: avoid; }
  .build-footer { padding: 20px 0; }
}
