.anatomy-page { background-image: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.anatomy-header { width: min(100% - 2rem, 1320px); margin: 1.5rem auto; }
.anatomy-header > a { display: inline-block; padding-block: .5rem; margin-bottom: .5rem; }
.anatomy-header h1 { max-width: none; font-size: clamp(2.4rem, 5vw, 4rem); }
.anatomy-header > p:last-child { margin: .8rem 0 0; font-size: 1.15rem; }
main.anatomy-layout { width: min(100% - 2rem, 1320px); display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1.5rem; align-items: start; }
.anatomy-view { position: sticky; top: .7rem; }
.view-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding-block: .75rem; border-block: 2px solid var(--ink); }
.view-heading h2 { font-size: 1.2rem; margin: 0; }
.view-heading span { font-size: .65rem; letter-spacing: .06em; font-weight: 800; }
#anatomy-stage { position: relative; height: clamp(380px, 56vw, 590px); overflow: hidden; background: #e6edf3; border-bottom: 2px solid var(--ink); }
#anatomy-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#label-leaders, #model-labels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.code-view:not(.code-labels-visible) #model-labels, .code-view:not(.code-labels-visible) #label-leaders { visibility: hidden; }
#label-leaders path { stroke: #627992; fill: none; stroke-width: 1; stroke-dasharray: 3 3; opacity: .8; }
#model-labels .servo-label { position: absolute; pointer-events: auto; display: flex; flex-direction: column; gap: .15rem; align-items: start; min-height: 44px; padding: .4rem .55rem; border: 1px solid #7691ab; border-radius: 6px; background: #fffdf4ed; box-shadow: none; font: 600 11px / 1.1 ui-monospace, monospace; color: #213e60; }
#model-labels .servo-label strong { font-size: 13px; font-weight: 850; }
#model-labels .servo-label[hidden] { display: none; }
#model-labels .servo-label[aria-pressed="true"] { background: #ffdf82; border: 2px solid #243f61; }
#model-labels .assembly-label { background: #eef9ee; border-color: #498277; max-width: 150px; text-align: left; }
#model-labels .assembly-label strong { font: 700 11px/1.4 var(--body); }
#speech-bubble { position: absolute; max-width: min(62%, 300px); top: 10px; left: 50%; transform: translateX(-50%); margin: 0; padding: .8rem 1rem; background: #fff6c9; border: 2px solid #274563; border-radius: 15px 15px 15px 0; color: #193453; z-index: 2; font-weight: 750; overflow-wrap: anywhere; }
.preset-buttons, .workspace-switch { display: flex; gap: .4rem; padding: .6rem 0; }
.preset-buttons button { flex: 1; }
.workspace-switch { border-bottom: 2px solid var(--ink); margin-bottom: .8rem; padding-top: .75rem; }
.workspace-switch button { flex: 1; font-size: .85rem; }
.workspace-switch button[aria-pressed="true"] { background: #234b77; color: #fffdf7; border-color: #234b77; }
.pose-readout { font: 500 .74rem/1.6 ui-monospace, monospace; border-block: 1px solid #bcc9d5; padding-block: .5rem; }
.panel-intro { margin-top: .5rem; font-size: .95rem; }
.schematic-tag { font-size: .65rem; border: 1px solid #508078; padding: .12rem .2rem; color: #245c53; }
#explore-panel[hidden], #code-panel[hidden], #undo-example[hidden] { display: none; }
.editor-tools, .run-controls { display: flex; flex-wrap: wrap; gap: .4rem; margin-block: .65rem; }
.editor-tools button, .run-controls button { font-size: .8rem; padding-inline: .65rem; min-height: 44px; }
.editor-label { font-size: .8rem; font-weight: 750; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; margin-block: .6rem; }
.editor-label span { font-size: .68rem; font-weight: 500; }
#python-code { width: 100%; height: 325px; min-height: 160px; resize: vertical; background: #172d45; color: #f7f4dc; border: 2px solid #172d45; border-radius: 8px; padding: 1rem; font: 400 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; box-sizing: border-box; }
#python-code:focus-visible { outline: 3px solid #c18a25; outline-offset: 3px; }
.code-challenge { font-size: .85rem; padding: .7rem .8rem; background: #f5e7ae; border-left: 3px solid #b6882f; }
#run-code { background: #234b77; border-color: #234b77; color: #fff; font-weight: 800; flex: 1; }
#run-code:disabled { background: #687887; border-color: #687887; }
#stop-code:not(:disabled) { background: #fff0de; border-color: #9d4f22; color: #813b19; }
#code-status { font-size: .88rem; padding: .6rem .8rem; background: #e3eee9; border-left: 3px solid #3c7865; margin-bottom: .3rem; }
#code-status[data-state="error"] { background: #fff0dd; border-color: #b75d29; }
#code-output { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 5rem; max-height: 220px; overflow-y: auto; font: 400 .76rem/1.5 ui-monospace, monospace; background: #edf1f1; color: #233747; padding: .8rem; border: 1px solid #9cafbb; border-radius: 4px; }
.microcopy { font-size: .73rem; color: #4c5c6d; margin-block: .45rem; }
.code-details { font-size: .84rem; border-top: 1px solid #acb9c6; margin-top: .6rem; }
.code-details summary { cursor: pointer; min-height: 44px; padding-block: .65rem; font-weight: 700; }
.code-details code { overflow-wrap: anywhere; }
.assembly-key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem; padding: .5rem 0 2rem; margin-bottom: 1rem; border-bottom: 2px solid #29486b; }
.assembly-key span { font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: #375e70; }
.assembly-key h3 { font-size: 1.35rem; margin-block: .7rem; }
.assembly-key p { font-size: .95rem; }
.motor-table-wrap { max-width: 780px; overflow-x: auto; }
.motor-crosswalk { width: 100%; font-size: .9rem; border-collapse: collapse; }
.motor-crosswalk caption { text-align: left; font-size: .8rem; padding-bottom: .8rem; }
.motor-crosswalk th, .motor-crosswalk td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid #adbecb; }
.motor-crosswalk th { background: #dfe8ee; }
.motor-crosswalk td:last-child { font-weight: 800; }
#model-status { position: absolute; z-index: 1; left: .8rem; right: .8rem; bottom: .5rem; margin: 0; padding: .45rem .7rem; background: #fffdf7; border: 1px solid #718397; font-size: .8rem; pointer-events: none; }
.camera-buttons { display: flex; flex-wrap: wrap; gap: .45rem; padding-block: .8rem; }
.view-help { font-size: .85rem; margin: .3rem 0; }
.anatomy-caution { font-size: .82rem; border-top: 1px solid #a5b5cb; padding-top: .7rem; }
#explorer-controls h2 { font-size: 1.6rem; }
.check-field { display: flex; gap: .6rem; align-items: center; min-height: 44px; font-weight: 700; font-size: .9rem; }
.check-field input { width: 20px; height: 20px; accent-color: #254f89; }
#wire-explanation { font-size: .87rem; }
.wire-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .75rem; }
.wire-legend[hidden] { display: none; }
.wire-legend span::before { content: ''; display: inline-block; width: 1.3rem; margin-right: .4rem; border-top: 4px solid; vertical-align: middle; }
.power-key::before { color: #be4c18; }.ground-key::before { color: #283c50; }.data-key::before { color: #0065b8; }
.part-info { border-block: 2px solid var(--ink); padding-block: .8rem; margin-top: 1.3rem; }
.part-info h3 { font-size: 1.4rem; margin: 0; }.part-info p { font-size: .9rem; }
#part-task { background: #f5e7ae; padding: .7rem; font-weight: 650; }
.anatomy-story { grid-column: 1 / -1; max-width: 100%; border-top: 3px solid var(--ink); padding-top: 1.8rem; }
.anatomy-story > p { max-width: 85ch; }
.anatomy-story h2 { font-size: 2rem; }
.signal-story { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; list-style-position: inside; padding: 0; }
.signal-story li { padding-top: .7rem; border-top: 3px solid #c18728; }
.signal-story p { font-size: .95rem; }
.anatomy-story details { max-width: 85ch; padding-block: .75rem; border-top: 1px solid #a5b5cb; }
.anatomy-story summary { cursor: pointer; min-height: 44px; padding-block: .5rem; font-weight: 750; }
@media(max-width: 950px) { main.anatomy-layout { grid-template-columns: 1fr; }.anatomy-view { position: static; }.signal-story { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 600px) { .assembly-key { grid-template-columns: 1fr; gap: .5rem; }.motor-crosswalk { font-size: .75rem; }.motor-crosswalk th, .motor-crosswalk td { padding: .5rem .35rem; } #model-labels .servo-label span { max-width: 88px; font-size: 9px; } }
@media(max-width: 450px) { .signal-story { grid-template-columns: 1fr; } #anatomy-stage { height: 430px; } #model-labels .servo-label span { display: none; } #model-labels .servo-label { padding: .4rem; } #model-labels .assembly-label { max-width: 88px; } #model-labels .assembly-label strong { font-size: 10px; } .anatomy-header h1 { font-size: 2.5rem; } }
