.selected-components {
    padding: 16px 0 70px;
}
.selected-components h2 {
    font-family: "Chakra Petch", sans-serif;
    font-size: clamp(23px, 3vw, 32px);
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0 0 20px;
    color: var(--ink);
}
.component-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.component-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 12px 15px 16px;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font:
        12px/1.5 "Chakra Petch",
        sans-serif;
    border-radius: 4px;
    min-width: 0;
}
.component-choice:hover,
.component-choice[aria-pressed="true"] {
    border-color: var(--green-line);
    background: var(--paper);
}
.component-ref {
    font:
        10px "JetBrains Mono",
        monospace;
    color: var(--muted);
}
.component-choice img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin: 6px 0 12px;
    filter: drop-shadow(0 6px 5px #0002);
}
.component-choice strong {
    font:
        600 16px "Chakra Petch",
        sans-serif;
    color: var(--ink);
    margin: 3px 0;
}
.component-maker {
    color: var(--muted);
    font-size: 10px;
}
.component-detail {
    font:
        12px/1.8 "Chakra Petch",
        sans-serif;
    color: var(--muted);
    min-height: 48px;
    margin: 18px 0 0;
    max-width: 780px;
}
.component-detail a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.component-choice:focus-visible,
.ag-document-link:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 4px;
}
.ag-vis.panel {
    padding: 35px 23px 25px;
}
.panel-figure {
    width: 100%;
    position: relative;
    aspect-ratio: 3102/1020;
}
.panel-figure svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.panel-figure path {
    fill: none;
    stroke: #efce82;
    stroke-width: 7;
    stroke-dasharray: 24 19;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 2px #13251f);
    stroke-width: 1.2px;
}
.panel-caption {
    position: absolute;
    top: 14px;
    left: 20px;
    font:
        9px "JetBrains Mono",
        monospace;
    letter-spacing: 1px;
    color: var(--green-deep);
}
.ag-drafts {
    margin-top: 20px;
}
.ag-draft-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ag-drafts .ag-vis {
    padding: 10px;
    background: #f6f4ed;
}
.ag-files a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
    display: inline-block;
    padding: 6px 0;
}
.ag-document-link {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 135px;
    height: 180px;
}
.ag-document-link:first-child {
    transform: translateX(-37px);
}
.ag-document-link:last-child {
    transform: translateX(25px);
}
.ag-document-link .ag-page.back {
    transform: rotate(-6deg);
}
.ag-document-link .ag-page.front {
    transform: rotate(2.5deg);
}
.ag-document-link:hover {
    z-index: 2;
}
.ag-next {
    margin-top: 20px;
}
@media (max-width: 640px) {
    .component-picker {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .component-choice img {
        height: 108px;
    }
    .selected-components {
        padding-bottom: 40px;
    }
    .component-detail {
        font-size: 13px;
    }
    .ag-files a {
        min-height: 44px;
    }
    .panel-caption {
        font-size: 8px;
    }
    .component-choice strong {
        font-size: 15px;
    }
}
.ag-next {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 640px) {
    .ag-next {
        grid-template-columns: 1fr;
    }
}
.component-choice {
    cursor: default;
    padding: 12px 10px 15px;
}
.component-choice.selected {
    border-color: var(--green-line);
    background: var(--paper);
}
.component-select {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    background: none;
    border: 0;
    padding: 0 5px;
    width: 100%;
    cursor: pointer;
    color: var(--muted);
    font:
        12px/1.6 "Chakra Petch",
        sans-serif;
    min-height: 80px;
}
.component-detail {
    font-size: 14px;
    line-height: 1.7;
    max-width: 760px;
    margin-top: 20px;
    min-height: 80px;
}
.component-detail > a {
    display: block;
    width: fit-content;
    margin-top: 8px;
    white-space: nowrap;
    font-size: 13px;
}
.orbit-stage {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.part-orbit {
    width: 100%;
    height: 150px;
    margin: 2px 0 10px;
    background: radial-gradient(ellipse, #cbd0c62c, transparent 70%);
}
.orbit-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    cursor: grab;
}
.orbit-stage canvas:active {
    cursor: grabbing;
}
.orbit-stage canvas:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: -3px;
}
.orbit-hint {
    position: absolute;
    bottom: 5px;
    left: 10px;
    font:
        9px "JetBrains Mono",
        monospace;
    color: var(--muted);
    pointer-events: none;
}
.orbit-hint.used {
    opacity: 0;
}
.orbit-reset {
    position: absolute;
    right: 3px;
    bottom: 0;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 18px;
    width: 35px;
    height: 35px;
    cursor: pointer;
}
.ag-drafts .assembly-orbit {
    height: 260px;
    padding: 0;
    background: radial-gradient(ellipse at 50% 65%, #d2d6c9, #f6f4ed 70%);
}
.assembly-orbit .orbit-hint {
    color: #60675e;
    bottom: 12px;
    left: 15px;
}
.assembly-orbit .orbit-reset {
    color: #4f6555;
    right: 10px;
    bottom: 7px;
}
.panel-figure path {
    stroke: #e7d5a5;
    stroke-width: 1.4px;
    stroke-dasharray: none;
    filter: none;
}
.panel-caption {
    font-size: 9px;
}
.panel-figure svg {
    overflow: hidden;
}
@media (max-width: 640px) {
    .part-orbit {
        height: 135px;
    }
    .component-detail {
        font-size: 13px;
    }
    .component-detail > a {
        font-size: 12px;
    }
    .ag-drafts .assembly-orbit {
        height: 250px;
    }
}

.ag-vis.panel {
    padding: 35px 12px 25px;
}
.panel-breakup {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: var(--green);
    font:
        9px "JetBrains Mono",
        monospace;
}
.panel-breakup svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}
.panel-unit {
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel-rails {
    transition: opacity 1s ease;
}
.panel-breakup[aria-pressed="true"] .panel-unit {
    transform: translate(var(--dx), var(--dy));
}
.panel-breakup[aria-pressed="true"] .panel-rails {
    opacity: 0.16;
}
.panel-action {
    position: absolute;
    bottom: -15px;
    right: 6px;
    color: var(--muted);
}
.panel-breakup:focus-visible {
    outline: 1px solid var(--green);
    outline-offset: 8px;
    border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
    .panel-unit,
    .panel-rails {
        transition: none;
    }
}

/* Each catalog part has a short, directed reveal instead of free orbit. */
.component-choice {
    transition:
        background 0.3s,
        border-color 0.3s;
    overflow: hidden;
}
.part-orbit canvas,
.part-orbit canvas:active {
    cursor: default;
    pointer-events: none;
}
.part-orbit {
    transition:
        filter 0.4s,
        transform 0.6s;
    margin-bottom: 0;
}
.is-exploring .part-orbit {
    filter: drop-shadow(0 8px 12px #62dbab25);
    transform: translateY(-4px);
}
.part-insight {
    position: relative;
    width: 100%;
    height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0 5px 13px;
    box-sizing: border-box;
    opacity: 0.45;
    transition: opacity 0.35s;
}
.part-insight .part-function {
    font:
        9px "JetBrains Mono",
        monospace;
    letter-spacing: 1.2px;
    color: var(--green);
}
.part-insight strong {
    font:
        500 14px "Chakra Petch",
        sans-serif;
    margin: 5px 0 2px;
    color: var(--ink);
}
.part-insight > span:last-child {
    font:
        10px "Chakra Petch",
        sans-serif;
    color: var(--muted);
}
.part-insight svg {
    position: absolute;
    right: 3px;
    top: 0;
    width: 68px;
    height: 28px;
    fill: none;
    stroke: var(--green);
    stroke-width: 1.4;
    opacity: 0;
    transform: translateX(-8px);
    transition:
        opacity 0.4s,
        transform 0.4s;
}
.is-exploring .part-insight {
    opacity: 1;
}
.is-exploring .part-insight svg {
    opacity: 1;
    transform: none;
}
.part-insight svg > path:first-child {
    opacity: 0.25;
}
.signal-travel {
    stroke-dasharray: 14 90;
    stroke-dashoffset: 104;
}
.is-exploring .signal-travel {
    animation: part-signal 1.6s linear infinite;
}
@keyframes part-signal {
    to {
        stroke-dashoffset: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .is-exploring .signal-travel {
        animation: none;
        stroke-dasharray: none;
    }
    .part-orbit,
    .part-insight,
    .part-insight svg {
        transition: none;
    }
}
.part-insight svg {
    width: 100%;
    height: 28px;
    right: 0;
    top: -18px;
    stroke-width: 1.2;
}
.part-insight svg > path:first-child {
    opacity: 0.85;
}
.signal-travel {
    stroke: #d5ffec;
    stroke-dasharray: 3 140;
    stroke-dashoffset: 143;
}
.waveform-note {
    font:
        10px "JetBrains Mono",
        monospace;
    color: var(--muted);
    margin-top: 8px;
}
.assembly-orbit .orbit-hint,
.panel-action {
    display: none;
}
.component-select {
    min-height: 76px;
    padding-top: 8px;
}
.part-orbit {
    height: 170px;
    margin-bottom: 8px;
}
.component-choice.selected {
    background: transparent;
}
.component-choice.is-exploring {
    background: var(--paper);
    border-color: var(--green-line);
}
@media (max-width: 640px) {
    .part-orbit {
        height: 145px;
    }
}
.parts-registry-note {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin: 22px 0 0;
    color: var(--muted);
    font:
        12px/1.7 "Chakra Petch",
        sans-serif;
    max-width: 760px;
}
.assembly-orbit .orbit-reset {
    opacity: 0;
    width: 64px;
    font:
        10px "JetBrains Mono",
        monospace;
}
.assembly-orbit .orbit-reset:focus-visible {
    opacity: 1;
}
.assembly-orbit .orbit-reset:focus-visible:after {
    content: "Toggle";
}
.selected-components h2 {
    max-width: 740px;
    margin-bottom: 12px;
}
.parts-registry-intro {
    max-width: 650px;
    font:
        16px/1.7 "Chakra Petch",
        sans-serif;
    color: var(--muted);
    margin: 0 0 32px;
}
.parts-example-label {
    font:
        9px "JetBrains Mono",
        monospace;
    letter-spacing: 1.2px;
    color: var(--muted);
    margin: 0 0 12px;
}
@media (max-width: 640px) {
    .parts-registry-intro {
        font-size: 14px;
        margin-bottom: 24px;
    }
}

/* Keep the same controls available to mouse, touch and keyboard users. */
.assembly-orbit .orbit-reset {
    opacity: 1;
    width: auto;
    min-width: 64px;
    min-height: 44px;
    padding: 0 10px;
    background: var(--paper, #f6f4ed);
    border: 1px solid var(--line, #ccd1c8);
    border-radius: 4px;
}
.assembly-orbit .orbit-reset:focus-visible:after {
    content: none;
}
.orbit-reset:focus-visible,
.orbit-fallback button:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}
.orbit-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
    text-align: center;
    font: 12px/1.5 sans-serif;
    color: var(--muted, #60675e);
}
.orbit-fallback button {
    min-height: 44px;
    cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
    .component-choice {
        transition: none;
    }
    .is-exploring .part-orbit {
        transform: none;
    }
}

.component-preview{width:100%;height:190px;display:flex;align-items:center;justify-content:center;padding:15px 0}
.component-preview img{width:auto;height:100%;max-width:100%;object-fit:contain;margin:0;background:white;border:1px solid var(--line);filter:none;box-shadow:0 8px 20px #0002}
.component-choice .part-datasheet{padding-top:14px;margin-top:14px}
.ag-vis.native-view img{width:100%;height:100%;object-fit:contain;padding:12px;box-sizing:border-box}
.ag-next{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:640px){.component-preview{height:155px}.ag-next{grid-template-columns:1fr}}
