/* Assembly shares the Workbench paper, forest and brass palette. */
.assembly-page { --assembly-line: #d6dcd0; min-width: 0; padding-bottom: 32px; }
.assembly-page *, .assembly-page *::before, .assembly-page *::after { min-width: 0; }
.assembly-page button, .assembly-page select, .assembly-page summary, .assembly-page input[type=range] { min-height: 44px; }
.assembly-page button { min-width: 44px; }
.assembly-notices { position: sticky; top: 0; z-index: 6; margin-bottom: 17px; box-shadow: 0 4px 14px #213a2810; }
.assembly-kind-note { display: flex; gap: 10px; padding: 13px 17px; background: #e9eee4; color: #304934; border: 1px solid #c9d5c4; font-size: .94rem; font-weight: 680; }
.assembly-kind-note > span { font-size: 1.15rem; line-height: 1.4; }
.assembly-stale { padding: 12px 17px; background: #fff0c9; border: 1px solid #dcc17c; color: #6a4a16; font-weight: 650; overflow-wrap: anywhere; }
.assembly-stale code { font-size: .8rem; }
.assembly-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.assembly-build { text-align: right; color: var(--muted); font-size: .78rem; }
.assembly-picker { display: grid; grid-template-columns: minmax(230px, .7fr) minmax(0, 2fr); gap: 26px; align-items: center; padding: 14px 23px; border: 1px solid var(--assembly-line); background: #fffdf6; border-radius: 12px; margin-bottom: 16px; }
.assembly-picker label, .assembly-field-label { font-size: .85rem; font-weight: 690; }
.assembly-picker select { margin-top: 7px; }
.assembly-size-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.assembly-size-chips button { background: #fafbf5; min-width: 57px; font-variant-numeric: tabular-nums; }
.assembly-size-chips button[aria-pressed=true] { background: var(--dark); color: #fffbe9; border-color: var(--dark); box-shadow: inset 0 -3px #d4bc7a; }
.assembly-size-chips .unbuilt { color: #7b8178; border-style: dashed; background: #f0f0e9; }
.assembly-workspace { display: grid; grid-template-columns: minmax(290px, 355px) minmax(0, 1fr); gap: 22px; align-items: start; }
.assembly-components { border: 1px solid var(--assembly-line); background: var(--paper); border-radius: 12px; overflow: hidden; }
.assembly-components > summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid var(--assembly-line); font-size: 1.05rem; list-style: none; gap: 10px; }
.assembly-components > summary::-webkit-details-marker { display: none; }
.assembly-components > summary .assembly-subtle { font-size: .76rem; font-weight: 500; }
.assembly-base-part { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 18px; border-bottom: 1px solid #e4e6dd; }
.assembly-base-part p { margin-top: 4px; font-size: .82rem; }
.assembly-eye { flex: 0 0 44px; width: 44px; padding: 0; background: transparent; border-color: #cdd6c9; }
.assembly-eye[aria-pressed=false] { opacity: .55; background: #efefea; }
.assembly-eye[aria-pressed=false] svg { stroke-dasharray: 3 2; }
.assembly-part { padding: 16px 18px; border-bottom: 1px solid #e4e6dd; transition: background .2s, box-shadow .2s; }
.assembly-part.is-selected { background: #fff8df; box-shadow: inset 4px 0 #b58c37; }
.assembly-part-top { display: flex; align-items: center; gap: 8px; }
.assembly-part-top h3 { flex: 1; }
.assembly-part-body { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 13px; margin: 10px 0 6px; }
.assembly-thumb { width: 72px; height: 84px; object-fit: contain; background: #f1efe6; border: 1px solid #dfdfd1; padding: 4px; border-radius: 6px; }
.assembly-no-image { display: grid; place-items: center; font-size: .7rem; color: var(--muted); }
.assembly-part-copy > p:first-child { font-size: .83rem; margin-bottom: 6px; }
.assembly-chip { display: inline-block; max-width: 100%; padding: 3px 7px; border: 1px solid #d3d8ce; border-radius: 4px; color: #52604e; background: #eff2e9; font-size: .69rem; font-weight: 650; line-height: 1.55; overflow-wrap: anywhere; }
.assembly-chip.estimated { color: #866026; background: #faf1dc; border-color: #e9d7af; }
.assembly-chip.confirmed { color: #24513a; background: #e4f0e3; border-color: #c4d9bd; }
.assembly-chip.placeholder { color: #686c67; background: #eceeeb; border-color: #d5d9d3; margin-top: 7px; }
.assembly-chip.warning { color: #8a451e; background: #f8ead8; border-color: #e9ceb0; margin-top: 4px; }
.assembly-part-metric { display: flex; flex-wrap: wrap; gap: 3px 5px; align-items: baseline; font-size: .8rem; margin-top: 8px; }
.assembly-part-metric strong { font-variant-numeric: tabular-nums; }
.assembly-component-content > [data-assembly-original-calculation],
.assembly-component-content > [data-assembly-excluded],
.assembly-component-content > [data-assembly-excluded-other] { margin: 0; padding: 16px 18px; font-size: .82rem; }
.assembly-subtle { color: var(--muted); font-size: .79rem; overflow-wrap: anywhere; }
.assembly-part-details summary { font-size: .78rem; color: #4f604c; }
.assembly-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; padding: 10px 0 13px; border-top: 1px dashed var(--assembly-line); }
.assembly-metrics dt { color: var(--muted); font-size: .71rem; }
.assembly-metrics dd { margin: 1px 0 0; font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.assembly-edit-button { width: 100%; margin-top: 7px; font-size: .82rem; background: #f7f8f1; }
.assembly-coverage { padding: 20px 18px; background: #f2f4eb; font-size: .84rem; }
.assembly-coverage-value { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-top: 16px; }
.assembly-coverage-value strong { font-size: 1.5rem; letter-spacing: -.04em; }
.assembly-coverage-track { height: 5px; background: #d9dfd0; border-radius: 6px; margin-top: 7px; overflow: hidden; }
.assembly-coverage-track span { height: 100%; display: block; background: #6d8165; }
.assembly-stage { min-width: 0; }
.assembly-finished { display: grid; gap: 5px; margin-bottom: 10px; }
.assembly-finished p { margin: 0; }
.assembly-finished-test { scroll-margin-top: 66px; padding: 10px 14px; margin: 0 0 10px; border: 2px solid #976322; border-radius: 8px; background: #fff0cd; color: #582e0d; font-size: 1.125rem; font-weight: 800; }
.assembly-viewport-wrap { position: relative; border: 1px solid #d7daca; border-radius: 12px 12px 0 0; overflow: hidden; background: radial-gradient(ellipse at 52% 40%,#fcfaf0,#e9eadd); }
.assembly-stage-caption { position: absolute; z-index: 2; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; gap: 12px; color: #59634f; pointer-events: none; font-size: .77rem; font-weight: 650; }
.assembly-stage-caption span:last-child { letter-spacing: .07em; }
.assembly-canvas { width: 100%; height: 438px; min-height: 320px; touch-action: none; }
.assembly-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.assembly-canvas-status { position: absolute; top: 50%; left: 12%; right: 12%; transform: translateY(-50%); padding: 12px; text-align: center; background: #fffdf2e8; border-radius: 8px; font-size: .85rem; pointer-events: none; }
.assembly-canvas-status:empty { display: none; }
.assembly-gesture { position: absolute; bottom: 13px; left: 12px; right: 12px; pointer-events: none; text-align: center; font-size: .72rem; color: #66715b; }
.assembly-controls { padding: 21px 23px; border: 1px solid #d7daca; border-top: 0; border-radius: 0 0 12px 12px; background: var(--paper); }
.assembly-morph-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.assembly-morph-heading label { font-size: 1.02rem; }
.assembly-morph-heading label span { color: #8b947e; padding-inline: 6px; }
.assembly-morph-heading output { font-size: 1.25rem; font-weight: 760; color: #3e6041; font-variant-numeric: tabular-nums; }
.assembly-controls input[type=range] { appearance: none; display: block; width: 100%; margin: 4px 0; cursor: pointer; background: transparent; }
.assembly-controls input[type=range]::-webkit-slider-runnable-track { height: 7px; border-radius: 8px; background: #cedacd; }
.assembly-controls input[type=range]::-webkit-slider-thumb { appearance: none; width: 26px; height: 26px; margin-top: -9px; border: 2px solid #fffdf6; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.assembly-controls input[type=range]::-moz-range-track { height: 7px; border-radius: 8px; background: #cedacd; }
.assembly-controls input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 2px solid #fffdf6; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.assembly-controls input[type=range]:disabled { opacity: .5; cursor: default; }
.assembly-play-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.assembly-play-row > button { min-width: 120px; }
.assembly-presets, .assembly-view-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.assembly-presets button { font-size: .85rem; }
.assembly-view-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; border-top: 1px solid #e4e7dd; padding-top: 14px; }
.assembly-view-row button { font-size: .82rem; }
.assembly-opacity { display: grid; grid-template-columns: auto minmax(80px,1fr); gap: 17px; align-items: center; margin-top: 9px; color: #5b6655; font-size: .8rem; }
.assembly-notes { margin: 14px 1px 0; color: #6d735f; font-size: .78rem; }
.assembly-notes p { margin-top: 6px; }
.assembly-notes summary { color: #7a5b2a; font-size: .85rem; }
.assembly-error { padding: 20px; background: #fff0e5; color: #843b26; border: 1px solid #e0b7a3; border-radius: 10px; margin-bottom: 20px; overflow-wrap: anywhere; }
.assembly-error p { margin: 6px 0 12px; }
.assembly-empty { text-align: center; border: 1px dashed #c5ccbc; border-radius: 12px; background: #fafaf2; padding: 62px 24px; }
.assembly-empty p { margin-top: 12px; }
.assembly-editor-panel { border: 1px solid #bdcba7; border-radius: 12px; padding: 20px; background: #f7f8ed; margin-bottom: 15px; }
.assembly-editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.assembly-editor-instruction { font-weight: 730; padding: 12px; background: #e9efda; border-left: 3px solid #789252; margin-bottom: 8px; }
.assembly-editor-step { margin-top: 6px; font-weight: 680; }
[data-assembly-editor] { scroll-margin-top: 115px; }
.assembly-flat { height: 255px; width: 100%; margin-top: 14px; background: #fffdf1; border: 1px solid #cfd6be; border-radius: 7px; overflow: hidden; }
.assembly-paper { display: block; width: 100%; height: 100%; min-height: 44px; cursor: crosshair; }
.assembly-paper:focus-visible { outline-offset: -3px; }
.assembly-pairs { list-style: none; margin: 10px 0; padding: 0; }
.assembly-pairs li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #dde2d1; padding: 5px 0; font-size: .82rem; }
.assembly-pairs li > span:nth-child(2) { flex: 1; }
.assembly-pair-number { display: inline-grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 50%; background: #56734d; color: white; font-size: .77rem; font-weight: 750; }
.assembly-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.assembly-editor-actions .primary { margin-left: auto; min-width: 80px; }
.assembly-preview-note { margin-top: 13px; color: #765b2d; font-size: .82rem; font-weight: 650; }
.assembly-editor-status:not(:empty) { color: #8a3926; font-size: .83rem; margin-top: 8px; overflow-wrap: anywhere; }
.assembly-components > summary::after { content: '⌄'; }
.assembly-components[open] > summary::after { content: '⌃'; }
@media (max-width: 1050px) { .assembly-workspace { grid-template-columns: 290px minmax(0,1fr); gap: 15px; } .assembly-controls { padding: 18px; } .assembly-picker { gap: 18px; padding: 17px; } }
@media (max-width: 760px) {
  .assembly-notices { margin-bottom: 20px; } .assembly-kind-note { font-size: .82rem; padding: 10px 12px; } .assembly-stale { font-size: .81rem; padding: 10px 12px; }
  .assembly-heading { align-items: center; margin-bottom: 18px; gap: 10px; } .assembly-build { font-size: .75rem; }
  .assembly-picker { grid-template-columns: 1fr; gap: 15px; padding: 15px; margin-bottom: 16px; } .assembly-size-chips { gap: 6px; } .assembly-size-chips button { flex: 1 0 52px; }
  .assembly-workspace { display: flex; flex-direction: column; gap: 17px; } .assembly-stage { order: 0; width: 100%; } .assembly-components { order: 1; width: 100%; }
  .assembly-canvas { height: 55vh; min-height: 320px; max-height: 580px; } .assembly-stage-caption { top: 13px; left: 13px; right: 13px; font-size: .7rem; } .assembly-stage-caption > span:first-child { max-width: 74%; }
  .assembly-controls { padding: 16px 13px; } .assembly-play-row { gap: 8px; } .assembly-play-row > button { min-width: 92px; } .assembly-presets { flex: 1; justify-content: flex-end; gap: 5px; } .assembly-presets button { padding-inline: 9px; }
  .assembly-view-row { gap: 9px; } .assembly-view-row > div { flex: 1; gap: 5px; } .assembly-view-row button { flex: 1; padding-inline: 8px; } .assembly-opacity { gap: 13px; }
  .assembly-editor-panel { padding: 13px; } .assembly-flat { height: 230px; } .assembly-editor-instruction { font-size: .88rem; } .assembly-editor-actions { gap: 6px; } .assembly-editor-actions button { font-size: .8rem; padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) { .assembly-part { transition: none; } }
.assembly-feedback:empty { display: none; }
.assembly-feedback:not(:empty) { padding: 12px 16px; margin-bottom: 16px; border: 1px solid #b9cbb0; border-radius: 8px; background: #edf4e4; color: #34502b; font-weight: 650; }

.assembly-picker-fold > summary { min-height:44px; padding:10px 2px; font-weight:650; }
.assembly-quality-row, .assembly-export-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:10px 0; }
.assembly-quality-row label { display:flex; align-items:center; gap:8px; font-size:.82rem; }
.assembly-quality-row select { width:auto; min-width:100px; }
.assembly-note-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.assembly-note-chips .assembly-chip { margin:0; }
body.assembly-export-mode { margin:0; overflow:hidden; background:#f3efe8; }
body.assembly-export-mode > :not(main) { display:none !important; }
body.assembly-export-mode main { position:fixed; inset:0; width:100%; max-width:none; padding:0; margin:0; }
body.assembly-export-mode .view, .assembly-export-host { width:100%; height:100%; padding:0; margin:0; }
body.assembly-export-mode main :not(canvas):not(.view):not(.assembly-export-host) { display:none !important; }
@media (max-width:700px) {
  .assembly-page { display:flex; flex-direction:column; }
  .assembly-notices { position:static; order:0; margin-bottom:8px; }
  .assembly-heading { order:1; margin-bottom:8px; }
  .assembly-workspace { order:2; }
  .assembly-picker-fold { order:3; margin-top:12px; }
  .assembly-feedback, .assembly-error, .assembly-empty { order:4; }
  .assembly-canvas { height:260px; min-height:240px; }
  .assembly-controls { padding-top:10px; }
  .assembly-note-chips .assembly-chip { font-size:.65rem; }
  .assembly-kind-note { padding:7px 10px; font-size:.73rem; }
}

.assembly-workshop-row { display: flex; flex-direction: column; gap: .5rem; margin-block: .6rem; min-width: 0; }
.assembly-workshop-row .design-choice-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.assembly-workshop-row button { display: inline-flex; align-items: center; gap: .4rem; white-space: normal; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.assembly-scan-lighting { flex-wrap: wrap; margin-block: .5rem; }
.assembly-workshop-row[hidden] { display: none; }

.assembly-scan-lighting[hidden] { display: none; }

.assembly-leather-targets { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-block:.6rem; }
.assembly-leather-targets .design-choice-row { display:flex; flex-wrap:wrap; gap:.4rem; }
.assembly-leather-targets[hidden] { display:none; }
