/* Builder v3 (2026-10-24): /order/ opens on "Build your kit", a top-down range
   you scroll down. Scoped to the order page; shared tokens stay in style.css
   (docs/site_audit_2026-10-22/DESIGN.md). Layout:
     >= 1100  [range: (slice | controls) per section] [quote rail, sticky]
     700-1099 [slice | controls] per section; the rail becomes the bottom bar + sheet
     < 700    one column; a 32 px range rail down the left edge, bottom bar
   Orange only for the thing to press, the bull and the newest hole: watched
   cameras are told apart by line weight and dashes, never by colour. */

.builder[hidden], #builder-fallback[hidden], #builder-error[hidden], .builder [hidden] { display: none !important; }
.order-page > .bld-wrap, .order-page > .addon-grid { max-width: none !important; }
.bld-wrap { margin: 1rem 0 3rem; }
.builder { margin: 0; }
.builder fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.builder legend { font: 650 1.0625rem/1.4 var(--sans); color: var(--ink); padding: 0; margin-bottom: .75rem; }
.builder h2 { margin: 0 0 .75rem; padding: 0; border: 0; font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.2; letter-spacing: -.02em; }
.builder h2:focus { outline: none; }
.builder h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.builder p { margin: 0 0 .75rem; }
.builder .bld-group { margin: 1.5rem 0 0; padding-top: 1.25rem; box-shadow: inset 0 1px 0 var(--line); }
.builder .bld-group > legend { float: left; width: 100%; }
.builder .bld-group > legend + * { clear: both; }
.builder .bld-hint { font-size: var(--t-label); line-height: 1.5; color: var(--ink-dim); margin: .4rem 0 .75rem; }
.builder .bld-included { margin: .5rem 0 .75rem; padding-left: 1.2rem; font-size: var(--t-small); color: var(--ink-dim); }
.builder .bld-included li { margin-bottom: .2rem; }
.builder :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* -- step 0: the kits as chips ------------------------------------------- */
.bld-start { margin-bottom: 1.5rem; }
.bld-chips { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; overscroll-behavior-x: contain; }
.bld-chip { position: relative; flex: 0 0 152px; scroll-snap-align: start; display: grid; gap: 4px; align-content: start; padding: 10px; min-height: 48px;
  border: 2px solid var(--line-2); border-radius: var(--radius-s); background: var(--panel); cursor: pointer; line-height: 1.3; }
.bld-chip input { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.bld-chip strong { font-size: var(--t-small); padding-right: 22px; }
.bld-chip-pic { display: block; width: 100%; height: 40px; }
.bld-chip-pic svg { width: 100%; height: 100%; display: block; }
.bld-chip-price { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.bld-chip-desc { font-size: var(--t-label); color: var(--ink-dim); }
.bld-chip-status { font-size: var(--t-label); color: var(--ink-dim); min-height: 1.3em; }
.bld-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.bld-chip:hover { border-color: var(--ink-dim); }
.bld-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 700px) { .bld-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; } }
@media (min-width: 1100px) { .bld-chips { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* -- the range: sections, slices, the links overlay, the bench cap --------- */
.bld-layout { display: grid; gap: 24px; align-items: start; }
.bld-range { position: relative; min-width: 0; }
.bld-rows { position: relative; }
.bld-row { display: grid; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 120px; min-width: 0; }
.bld-row:first-child { border-top: 0; }
.bld-ctl { min-width: 0; }
.bld-slice { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-s); background: var(--bg-2); min-width: 0; cursor: pointer; }
.bld-slice-empty { display: none; }
.bld-art, .bld-art svg { width: 100%; height: 100%; display: block; }
.bld-row-bench .bld-slice { aspect-ratio: auto; background: none; }
.bld-row-bench .bld-art { aspect-ratio: 16 / 10; height: auto; border-radius: var(--radius-s); background: var(--bg-2); }
.builder .bld-slice-note { margin: 6px 0 0; font-size: var(--t-label); color: var(--ink-mute); }
.bld-slice-tag { position: absolute; left: 30px; top: 8px; margin: 0 !important; padding: 2px 8px; border-radius: 4px; background: var(--bg); color: var(--ink-dim);
  font-size: var(--t-label); line-height: 1.4; font-variant-numeric: tabular-nums; pointer-events: none; }
.bld-row.is-selected .bld-slice { outline: 2px solid var(--line-2); outline-offset: -2px; }
.bld-row.is-selected .bld-tick { stroke: var(--ink); }

.bld-links { position: absolute; top: 0; left: 0; z-index: 4; pointer-events: none; overflow: visible; }
.bld-links .lk { fill: none; stroke: var(--ink-mute); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; transition: opacity 160ms ease-out; }
.bld-links .lk-air { stroke-dasharray: 2 6; }
.bld-links .lk-cable { stroke-width: 2; }
.bld-links .is-dim { opacity: .3; }
.bld-links .is-sel { stroke: var(--ink-dim); }
.bld-links .lk-tick { stroke: var(--ink-mute); stroke-width: 1.5; }
.bld-links .lk-tick.is-sel { stroke: var(--ink); stroke-width: 2.5; }

.bld-cap { position: sticky; top: 64px; z-index: 5; height: 44px; margin-bottom: -44px; opacity: 0; pointer-events: none; transition: opacity 120ms ease-out;
  background: var(--bg); border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius-s) var(--radius-s); }
.bld-cap.is-on { opacity: 1; }
.bld-cap svg { height: 100%; width: auto; display: block; }

/* the drawing language inside a slice (gear art carries its own paint) */
.bld-scene { fill: none; }
.bld-scene .bld-ruler path { stroke: var(--line-2); stroke-width: 1.5; fill: none; }
.bld-scene .bld-ruler .bld-tick { stroke: var(--ink-mute); stroke-width: 2; }
.bld-scene .bld-break { stroke: var(--ink-mute); stroke-width: 1.5; }
.bld-scene .bld-ruler-line { stroke: var(--line-2); stroke-width: 1.5; }
.bld-scene .bld-ground { stroke: var(--line-2); stroke-width: 1.5; }
.bld-scene .bld-wire { stroke: var(--ink-mute); stroke-width: 1; }
.bld-scene .bld-junction { fill: var(--surface-3); stroke: var(--ink-dim); stroke-width: 1.5; }
.bld-scene .bld-air { stroke: var(--ink-mute); stroke-width: 1.5; stroke-dasharray: 2 5; }
.bld-scene .bld-cable { stroke: var(--ink-mute); stroke-width: 1.5; }
.bld-scene .bld-tick { stroke: var(--ink-mute); stroke-width: 2; }
.bld-scene * { vector-effect: non-scaling-stroke; }
.bld-scene .bld-stake { stroke: var(--ink-mute); stroke-width: 1.5; }
.bld-scene .bld-firing { fill: var(--surface-1); stroke: var(--ink-dim); stroke-width: 1.5; }
.bld-links .lk-view { stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
/* watched vs standby: weight and dash, not colour */
/* a camera's sight line, lens to bull (side elevation, 2026-10-25) */
.bld-scene .sight { fill: none; stroke: var(--ink-dim); stroke-width: 1.5; stroke-linecap: round; }
.bld-scene .is-standby .sight { stroke: var(--ink-mute); stroke-width: 1; stroke-dasharray: 3 4; }
.bld-scene .cam.is-standby { opacity: .75; }
/* a pan-tilt-zoom fan: every sight line dashed, the one it looks at now solid */
.bld-scene .fan .fan-w .sight { stroke: var(--ink-mute); stroke-dasharray: 6 6; transition: stroke 200ms ease-out; }
.bld-scene .fan:not([data-step]) .fan-w[data-i="0"] .sight,
.bld-scene .fan[data-step="0"] .fan-w[data-i="0"] .sight, .bld-scene .fan[data-step="1"] .fan-w[data-i="1"] .sight,
.bld-scene .fan[data-step="2"] .fan-w[data-i="2"] .sight, .bld-scene .fan[data-step="3"] .fan-w[data-i="3"] .sight { stroke: var(--ink-dim); stroke-dasharray: none; }
.bld-scene .fan.is-standby .fan-w .sight { stroke: var(--ink-mute) !important; stroke-width: 1; stroke-dasharray: 3 4 !important; }
.bld-scene .is-coming * { stroke-dasharray: 2 3; }
.bld-scene .is-ghost { opacity: .4; }
.bld-scene .is-ghost * { stroke-dasharray: 3 4; }
.bld-scene .spin { transform-box: fill-box; transform-origin: center; }
.bld-scene [data-part] { transition: opacity 120ms ease-out; }
.bld-scene[data-light] [data-part]:not(.scene-focus) { opacity: .3; }

/* -- controls -------------------------------------------------------------- */
.bld-action, .bld-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 48px; margin: 8px 0;
  padding: 10px 12px; border: 2px solid var(--line-2); border-radius: var(--radius-s); background: transparent; color: var(--ink);
  font: 400 var(--t-small)/1.4 var(--sans); text-align: left; cursor: pointer; }
.bld-choice { grid-template-columns: 20px minmax(0, 1fr) auto; }
.bld-choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); align-self: start; margin-top: 2px; }
.bld-choice-name { min-width: 0; }
.bld-choice-name strong { font-weight: 600; }
.bld-choice-sub { display: block; font-size: var(--t-label); color: var(--ink-dim); }
.bld-choice-hint { grid-column: 2 / -1; font-size: var(--t-label); line-height: 1.5; color: var(--ink-dim); }
.bld-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.bld-choice:has(:disabled) { color: var(--ink-mute); border-style: dashed; cursor: not-allowed; }
.bld-choice:hover, .bld-action:hover:not(:disabled) { border-color: var(--ink-dim); }
.bld-delta { text-align: right; font-variant-numeric: tabular-nums; font-size: var(--t-label); color: var(--ink-dim); white-space: nowrap; }
.bld-action:disabled { cursor: not-allowed; color: var(--ink-mute); border-style: dashed; }
.bld-tag { display: inline-block; margin-left: 8px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: var(--t-label); font-weight: 500; color: var(--ink-dim); vertical-align: 1px; }
.bld-sub { margin: 4px 0 8px 32px; }
.bld-stepper-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; margin: 8px 0; }
.bld-stepper-label { font-size: var(--t-small); }
.bld-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-s); flex: none; }
.bld-step { width: 48px; height: 48px; background: transparent; color: var(--ink); border: 0; font-size: 1.4rem; cursor: pointer; }
.bld-step:disabled { color: var(--ink-mute); cursor: not-allowed; }
.bld-stepper output { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.bld-field { margin: 12px 0; }
.bld-field label { display: block; font-size: var(--t-small); font-weight: 600; margin-bottom: 6px; }
.bld-opt { font-weight: 400; color: var(--ink-mute); }
.bld-dist { display: flex; gap: 8px; }
.builder input[type="number"], .builder input[type="text"], .builder input[type="email"], .builder input[type="tel"], .builder select, .builder textarea,
.bld-nojs input[type="text"], .bld-nojs input[type="email"], .bld-nojs textarea {
  min-height: 48px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--panel); color: var(--ink);
  font: 400 1rem/1.4 var(--sans); width: 100%; box-sizing: border-box; }
.builder .bld-dist input { width: 9ch; flex: none; }
.builder .bld-dist select { width: auto; flex: none; }
.builder textarea, .bld-nojs textarea { min-height: 110px; resize: vertical; }
.builder [aria-invalid="true"] { border-color: var(--danger); }
.bld-link { display: inline-flex; align-items: center; min-height: 48px; padding: 4px 0; border: 0; background: transparent; color: var(--link);
  font: 400 var(--t-small)/1.4 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bld-tools { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 1rem !important; }
.builder .bld-warning { border-left: 3px solid var(--accent-2); background: var(--accent-2-soft); color: var(--accent-2); padding: 8px 12px; font-size: var(--t-small); line-height: 1.5; margin: 12px 0; }
.builder .bld-warning .bld-link { color: var(--accent-2); }

/* -- the quote: rail (desktop), review section, phone sheet ----------------- */
.bld-rail { display: none; }
.bld-rail, .bld-sheet { padding: 20px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); color: var(--ink); }
.builder .bld-q-title { font-size: 1.3rem; margin-bottom: .5rem; }
.builder .bld-origin { font-size: var(--t-small); color: var(--ink-dim); margin: 0; }
.builder .bld-fine a, .bld-fine a { display: inline-flex; align-items: center; min-width: 48px; min-height: 48px; }
.builder .bld-total { font-variant-numeric: tabular-nums; margin: 12px 0 0; line-height: 1.1; }
.bld-total strong { font-size: 2.4rem; letter-spacing: -.03em; }
.bld-total span { font-size: var(--t-small); color: var(--ink-dim); }
.builder .bld-pending { font-size: var(--t-small); color: var(--ink); margin: .25rem 0 .5rem; }
.builder .bld-here { font-size: var(--t-small); border-left: 3px solid var(--line-2); padding-left: 10px; color: var(--ink-dim); }
.builder .bld-lines { list-style: none; margin: 12px 0; padding: 0; }
.builder .bld-lines li { display: grid; grid-template-columns: 1fr auto; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; margin: 0; font-size: var(--t-small); line-height: 1.4; }
.builder .bld-lines .bld-line-pending { color: var(--ink-dim); }
.builder .bld-send-btn { width: 100%; margin-top: 12px; }
.builder .bld-layout-list { margin: .5rem 0 1rem; padding-left: 1.2rem; font-size: var(--t-small); color: var(--ink-dim); }
@media (min-width: 1100px) {
  .bld-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .bld-rail { display: block; position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; }
}

/* -- the send step ---------------------------------------------------------- */
.bld-recap { padding: 16px 20px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); align-self: start; }
.builder .bld-recap-label { font-size: var(--t-label); color: var(--ink-mute); margin: 0; }
.builder .bld-recap-kit { font-weight: 650; margin: .25rem 0 0; }
.builder .bld-recap-total { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; margin: 0 0 .25rem; }
.bld-edit { display: inline-flex; align-items: center; min-height: 48px; }
.bld-copied { font-size: var(--t-label); color: var(--ink-dim); word-break: break-all; }
.bld-form .button { width: 100%; margin-top: 8px; }
.builder .bld-form-error { border-left: 3px solid var(--danger); padding: 8px 12px; color: var(--ink); font-size: var(--t-small); margin: 12px 0; }
.bld-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.builder .bld-fine, .bld-fine { font-size: var(--t-label); color: var(--ink-mute); line-height: 1.5; margin-top: 12px; }
.bld-done { padding: 20px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
.builder .bld-done h3 { margin: 0 0 .5rem; font-size: 1.25rem; }
.builder .bld-done h3:focus { outline: none; }

/* -- motion (all of it off under reduced motion) ---------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .bld-row.is-new { animation: bld-rise 160ms ease-out both; }
  .bld-links .lk-air.is-sel { animation: bld-flow 1.2s linear infinite; }
  .bld-slice.is-visible .spin { animation: bld-spin 4s linear infinite; }
}
@keyframes bld-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bld-flow { to { stroke-dashoffset: -16; } }
@keyframes bld-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .builder *, .builder *::before, .builder *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }}

/* -- phone bar and the review sheet (< 1100) -------------------------------- */
.bld-phone-bar { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; min-height: 64px; box-sizing: border-box;
  padding: 8px max(16px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--panel); border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px;
  transition: transform 160ms ease-out, visibility 160ms; }
.bld-bar-total { font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.bld-bar-cad { font-size: var(--t-label); color: var(--ink-dim); }
.builder .bld-phone-bar .button { margin: 0; min-height: 48px; padding: 10px 20px; }
.bld-bar-hidden .bld-phone-bar { transform: translateY(110%); visibility: hidden; }
.bld-ready { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.bld-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: 540px; margin: 0 auto; max-height: 85svh; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 16px 16px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.bld-sheet::backdrop { background: rgb(0 0 0 / .7); }
.bld-sheet-open { overflow: hidden; }
.bld-close { float: right; min-height: 48px; padding: 0 8px; border: 0; background: transparent; color: var(--link); font: 400 var(--t-small)/1 var(--sans); text-decoration: underline; cursor: pointer; }
.bld-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--ink-mute); margin: 0 auto 12px; }
@media (min-width: 1100px) { .bld-phone-bar { display: none; } .bld-ready { padding-bottom: 0; } }

/* -- tablet and up: slice beside its controls ------------------------------- */
@media (min-width: 700px) {
  .bld-row { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .bld-slice { position: sticky; top: 116px; }
  .bld-slice-empty { display: block; background: transparent; cursor: default; aspect-ratio: auto; }
  .bld-cap { width: calc(100% - 364px); }
  .bld-row-send { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); }
}
/* -- phone: one column and the range rail down the left edge ---------------- */
@media (max-width: 699px) {
  .bld-range { padding-left: 32px; }
  .bld-cap { width: 32px; margin-left: -32px; border-radius: 0; border: 0; background: var(--bg); }
  .bld-cap svg { width: 32px; height: auto; margin-top: 10px; }
  .bld-slice-tag { left: 8px; }
  .bld-sub { margin-left: 0; }
  .bld-choice-hint { grid-column: 1 / -1; }
  /* Prices must not squeeze labels into a narrow, overlapping third column. */
  .bld-choice { grid-template-columns: 20px minmax(0, 1fr); }
  .bld-choice > .bld-delta { grid-column: 2; text-align: left; white-space: normal; }
  .bld-choice > .bld-delta:empty { display: none; }
  .bld-choice-name, .bld-lines li > span:first-child { overflow-wrap: anywhere; }
  .builder :is(button, input, select, textarea, .bld-choice) { scroll-margin-top: 80px; scroll-margin-bottom: 88px; }
}

/* -- the static parts of the page ------------------------------------------- */
#builder-error { border-left: 3px solid var(--accent-2); padding: 12px; }
.bld-nojs { max-width: 36rem; }
.bld-nojs label { display: block; font-weight: 600; margin-bottom: 6px; }
.bld-nojs fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.bld-nojs legend { font-weight: 650; margin-bottom: .5rem; }
.bld-fallback-presets { display: grid; gap: 8px; }
.bld-nojs .bld-nojs-kit { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-s); font-weight: 400; margin: 0; cursor: pointer; }
.bld-nojs-kit input { width: 20px; height: 20px; accent-color: var(--accent); }
.order-page .word-strip { display: grid; gap: 12px 24px; margin: 1.2rem 0 1.5rem; }
.order-page .word-strip > div { border-left: 3px solid var(--line-2); padding-left: 12px; }
.order-page .word-strip dt { font-weight: 650; color: var(--ink); }
.order-page .word-strip dd { margin: 0; color: var(--ink-dim); font-size: var(--t-small); }
@media (min-width: 700px) { .order-page .word-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.order-page .tag-coming { display: inline-block; margin-left: 6px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: var(--t-label); font-weight: 500; color: var(--ink-dim); vertical-align: 2px; }
.order-page .addon-req { font-size: var(--t-small); color: var(--ink-dim); }
.order-page .addon-price strong { font-size: 1.25rem; }
