.skill-draw{--dc-accent:#a63d11;--dc-border:#d9d6cf;--dc-ink:#25221f;box-sizing:border-box;background:#fff;color:var(--dc-ink);border:1px solid var(--dc-border);border-radius:12px;padding:clamp(10px,2vw,18px);margin:18px 0;min-width:0}
.draw-heading,.draw-actions,.draw-inventory,.draw-view{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.draw-heading{justify-content:space-between;margin-bottom:10px}.draw-heading h2{font-size:1.14rem;margin:0}
.skill-draw :is(button,select){font:inherit;font-size:.82rem;min-height:38px;border:1px solid var(--dc-border);border-radius:7px;background:white;color:inherit;padding:5px 8px}
.skill-draw button{cursor:pointer}.skill-draw button:disabled{opacity:.42;cursor:default}.skill-draw button[aria-pressed=true]{border-color:var(--dc-accent);background:#fff0e6;color:#782908}
.skill-draw :is(button,select,[tabindex]):focus-visible{outline:2px solid #8d370f;outline-offset:2px}
.draw-inventory{margin:0 0 7px}.draw-inventory label{font-size:.85rem;font-weight:700}.draw-inventory select{max-width:100%}
.draw-palette-wrap{flex:1 0 100%;min-width:0;display:flex;align-items:stretch;gap:4px}.draw-palette-wrap>button{min-width:28px;flex:none}.draw-palette{flex:1;min-width:0;display:flex;gap:6px;overflow-x:auto;padding:3px;scrollbar-width:thin;overscroll-behavior-inline:contain}
.draw-palette button{white-space:nowrap;flex:none;padding-inline:9px;touch-action:none;cursor:grab}.draw-palette button span{display:inline-block;margin-right:5px;font-weight:750;color:#7b300d}
.draw-actions,.draw-view{margin:6px 0}.draw-view{justify-content:space-between}.draw-view small{color:#655f59;font-size:.72rem}.draw-zoom{display:flex;align-items:center;gap:4px}.draw-zoom button{min-width:38px}
.draw-status{min-height:1.6em;font-size:.8rem;color:#594b41;margin:4px 0}
.draw-draft-choice{display:flex;align-items:center;justify-content:space-between;gap:6px 10px;flex-wrap:wrap;margin:0 0 10px}
.draw-draft-choice>p{margin:0;font-size:.8rem;color:#594b41}
.draw-draft-choice>div{display:flex;gap:6px;flex-wrap:wrap}
.skill-draw .draw-draft-choice [data-act=fresh-draft]{border-color:var(--dc-accent);background:#fff0e6;color:#782908;font-weight:700}
.draw-draft-choice[hidden],.draw-instructions[hidden]{display:none}
.draw-scroll{border:1px solid var(--dc-border);border-radius:7px;overflow:auto;max-height:min(58vh,520px);background:#fcfcfa;scrollbar-width:thin;overscroll-behavior:contain}
.draw-svg{display:block;min-width:100%;height:auto;touch-action:none;user-select:none;-webkit-user-select:none}
.draw-svg [data-component],.draw-svg [data-bend],.draw-svg [data-pin]{touch-action:none}
.draw-svg [data-component]{cursor:grab}.draw-svg [data-pin]{cursor:crosshair}.draw-svg [data-bend]{cursor:ew-resize}
.draw-svg text{pointer-events:none;fill:#2e2823}.draw-svg .draw-shape{fill:#fff;stroke:#615a54;stroke-width:1.5}.draw-svg .draw-pin{fill:#fff;stroke:#433b35;stroke-width:2}.draw-svg .draw-selected{stroke:#a63d11;stroke-width:2.8}
.draw-svg .draw-pin-active{fill:#b04715;stroke:#622509}.draw-svg .draw-blank{fill:#756c62}.draw-svg .draw-wire-hit{stroke:transparent;stroke-width:16;fill:none;cursor:pointer}
.draw-readout{font-size:.77rem;color:#655f59;margin:8px 0 1px}.draw-ghost{position:fixed;z-index:110;pointer-events:none;transform:translate(-50%,-115%);border-radius:8px;border:2px solid #ac461c;background:#fff7ef;color:#6e2c0d;padding:5px 12px;font-size:.8rem;white-space:nowrap}
.skill-draw.draw-expanded{position:fixed;inset:0;z-index:100;max-width:none;max-height:none;margin:0;padding:12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));border-radius:0;display:flex;flex-direction:column;overflow:auto}
.draw-expanded .draw-scroll{flex:1;min-height:170px;max-height:none}.draw-expanded .draw-readout{margin-top:6px}
body:has(.draw-expanded){overflow:hidden}.draw-note{font-size:.74rem}
@media(max-width:520px){.skill-draw :is(button,select){min-height:42px}.draw-scroll{max-height:50vh}}

.draw-pole-control{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--dc-border);border-radius:8px;padding:2px 5px;font-size:.82rem;font-weight:700}
.draw-pole-control[hidden]{display:none}.draw-pole-control button{min-width:38px;padding-inline:7px}.draw-pole-count{min-width:2.3em;text-align:center}

.skill-draw .draw-grade-btn{background:#a63d11;color:#fff;border-color:#a63d11;font-weight:750}.draw-grade{margin-top:10px;padding:10px;border:1px solid #d6a58f;background:#fff6f0;border-radius:8px}.draw-grade.passed{border-color:#8eae97;background:#edf8ef}.draw-grade h3{margin:0;font-size:1rem}.draw-grade ul{margin:.3em 0;padding-left:1.4em;font-size:.86rem}.draw-grade p{font-size:.76rem;margin:.45em 0 0;color:#5b5550}.draw-readout{display:flex;gap:7px;align-items:center;flex-wrap:wrap}

/* Keep the official reference with the board, including in full-screen mode. */
.draw-heading>h2{flex:1}
.draw-head-buttons{display:flex;gap:5px;align-items:center}
.draw-head-buttons [aria-expanded="true"]{border-color:var(--dc-accent);background:#fff0e6;color:#782908}
.draw-reference{min-width:0;margin:0 0 9px;border:1px solid var(--dc-border);border-radius:8px;padding:5px;background:#f7f6f3}
.draw-reference .question-stage{min-height:0;margin:0}
.draw-reference .question-pictures{display:grid;place-items:center;min-height:0;margin:0;border:0;border-radius:6px;background:#fff;overflow:hidden}
.draw-reference .question-pictures canvas{display:block;max-width:100%;max-height:min(25dvh,230px);height:auto;object-fit:contain}
.draw-reference .question-controls{margin:3px 0 0;gap:8px}
.draw-reference .question-controls>button,.draw-reference .question-controls>a{min-height:34px}
.draw-reference dialog .question-dialog-body canvas{max-width:none;max-height:none}
.draw-device{display:flex;align-items:center;flex-wrap:wrap;gap:5px 10px;margin-top:6px;padding:5px 6px;border:1px solid var(--dc-border);border-radius:7px;background:#fbf9f5}
.draw-device-name{font-size:.77rem}
.draw-terminal-buttons{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.skill-draw .draw-terminal-buttons button{min-width:44px;min-height:44px;font-weight:750;padding-inline:7px;touch-action:manipulation}
.draw-device[hidden],.draw-reference[hidden]{display:none}
.draw-instructions .draw-status{flex:1 1 130px}
.draw-instructions button:not([hidden]){padding-inline:6px}
.draw-reference .question-loading{padding:6px;margin:0}
.draw-palette button{touch-action:pan-x}
@media(max-width:600px){
 .skill-draw .draw-head-buttons button,.skill-draw .draw-actions button,.skill-draw .draw-zoom button{min-height:42px}
 .draw-reference .question-pictures canvas{max-height:min(20dvh,175px)}
 .draw-scroll{max-height:40dvh}
 .draw-expanded .draw-scroll{max-height:none}
}
@media(max-width:600px){
 .draw-actions :is([data-act="rotate"],[data-act="rename"],[data-act="delete"]):disabled{display:none}
}
.draw-box-control{display:flex;align-items:center;gap:5px;flex-wrap:wrap;border-left:1px solid var(--dc-border);padding-left:7px;font-size:.8rem;font-weight:700}
.draw-box-control[hidden]{display:none}
.skill-draw .draw-box-control button{min-width:44px;min-height:44px;padding:5px}
.draw-box-count{min-width:2.3em;text-align:center}
.draw-svg .draw-shape.draw-schematic{fill:transparent;stroke:transparent}
.draw-svg .draw-shape.draw-schematic.draw-selected{fill:#fff4e766;stroke:var(--dc-accent);stroke-dasharray:3 3}
.draw-svg .draw-box{stroke:#4b433e;stroke-dasharray:5 3;stroke-width:2}
.draw-svg .draw-selected.draw-box{stroke:var(--dc-accent)}
.draw-svg .draw-pin.draw-dot{fill:#262321;stroke:#262321;stroke-width:1}
.draw-svg .draw-pin.draw-dot.draw-pin-active{fill:#a63d11;stroke:#a63d11}
.draw-svg .draw-box-digit{fill:#fff}
.draw-svg .draw-wire-mark,.draw-svg .draw-cable-note{font-family:Arial,sans-serif;font-size:10.5px;font-weight:700;paint-order:stroke fill;stroke:#fcfcfa;stroke-width:3;stroke-linejoin:round}
.draw-svg .draw-cable-note{fill:#a52529;font-size:11px}
.draw-svg .draw-wire-mark[data-color="red"]{fill:#a61b22}.draw-svg .draw-wire-mark[data-color="green"]{fill:#17673a}.draw-svg .draw-wire-mark[data-color="blue"]{fill:#1b5292}

/* Schematic view: intentionally white even in dark theme, like an exam answer sheet. */
.draw-scroll{background:#fff;border-color:#d5d4d1;border-radius:3px}
.draw-svg,.draw-example svg{background:#fff}
:is(.draw-svg,.draw-example svg) text{fill:#171615;pointer-events:none}
.draw-symbol-target{fill:transparent;stroke:none}
.draw-symbol-target.draw-selected{stroke:#aa4a24;stroke-width:1.5;stroke-dasharray:4 4;fill:#f7e1cf35}
.draw-sign-path,.draw-sign-frame{stroke:#181716;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.draw-sign-path{fill:none}.draw-sign-frame{fill:#fff}.draw-earth-sign{stroke:#217745}.draw-symbol-black{fill:#181716;pointer-events:none}
.draw-symbol-label{font-size:16px;font-weight:650;text-anchor:middle}.draw-letter-large{font-size:27px}.draw-symbol-tag{font-size:16px;font-weight:750}
.draw-source-label{font-size:16px;font-weight:700;paint-order:stroke fill;stroke:#fff;stroke-width:3}.draw-source-label tspan{font-size:12px;font-weight:550}
.draw-box-edge{fill:#f0f0eeaa;stroke:#444;stroke-width:2;stroke-dasharray:5 5;pointer-events:none}
.draw-box-edge.draw-selected{stroke:#a4471d;stroke-width:2.7}
.draw-box-target{fill:transparent;stroke:transparent;stroke-width:10;cursor:grab}
.draw-wire-path{fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.draw-wire-bracket{fill:none;stroke:#252321;stroke-width:2;pointer-events:none}
:is(.draw-svg,.draw-example svg) .draw-wire-mark,
:is(.draw-svg,.draw-example svg) .draw-cable-note{font:700 15px Arial,sans-serif;paint-order:stroke fill;stroke:#fff;stroke-width:3;stroke-linejoin:round}
:is(.draw-svg,.draw-example svg) .draw-cable-note{font-size:14px;font-weight:600}
:is(.draw-svg,.draw-example svg) .draw-wire-mark[data-color="white"]{fill:#68625e}
:is(.draw-svg,.draw-example svg) .draw-wire-mark[data-color="red"]{fill:#a61b22}
:is(.draw-svg,.draw-example svg) .draw-wire-mark[data-color="green"]{fill:#17673a}
:is(.draw-svg,.draw-example svg) .draw-wire-mark[data-color="blue"]{fill:#1b5292}
.draw-example .draw-dot{fill:#231f1c}
.draw-example{width:min(94vw,760px);max-height:86dvh;margin:auto;padding:12px;border:1px solid #ddd;background:#fff;color:#201f1e;border-radius:10px;box-shadow:0 20px 80px #100c0833}
.draw-example::backdrop{background:#15120ca8}.draw-example-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.draw-example-head h3{margin:0;font-size:1.03rem}.draw-example>p{margin:6px 0;font-size:.78rem}
.draw-example-scroll{overflow:auto;max-height:min(67dvh,570px)}
.draw-example svg{display:block;width:100%;height:auto;min-width:440px}
.draw-svg [data-bend]{cursor:move}
@media(max-width:600px){.draw-scroll{max-height:54dvh}.draw-expanded .draw-scroll{max-height:none}.draw-example{padding:9px}}
.draw-example-actions{display:flex;gap:5px}
.draw-example svg{min-width:0}
.draw-example-scroll.is-magnified svg{min-width:740px;width:125%}
.draw-example .draw-pin:not(.draw-dot){fill:#fff;stroke:#231f1c;stroke-width:2}
:is(.draw-svg,.draw-example svg) text{font-family:system-ui,Arial,sans-serif}
.draw-parts-panel[hidden]{display:none}
.draw-secondary{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.draw-lead-label{font-size:15px}
@media(max-width:520px){.draw-view{align-items:flex-start}.draw-secondary small{width:100%}}
.draw-port-label{font-size:10px;font-weight:650}
.draw-port-title{font-size:12px;font-weight:700}
.draw-svg [data-symbol-family="practical-terminal"] .draw-sign-frame{stroke-width:1.85}
.draw-svg .draw-symbol-tag{paint-order:stroke fill;stroke:#fff;stroke-width:2}
.draw-switch-mark{font-size:12px;font-weight:650}
.draw-omission-outline{fill:none;stroke:#292522;stroke-width:1.3;stroke-dasharray:15 4 2 4;pointer-events:none}
.draw-omission-lead{stroke-dasharray:3 4}
.draw-omission-label{font-size:11px;paint-order:stroke;stroke:#fff;stroke-width:2}

/* Drawing controls: a stable touch toolbar and separate contextual actions. */
.draw-tools-primary{gap:4px 8px;margin:8px 0 4px}
.draw-history{display:flex;align-items:center;gap:2px}
.skill-draw .draw-history button{font-size:1.22rem;min-width:40px;border-color:transparent;background:transparent;padding:0}
.skill-draw .draw-history button:not(:disabled):hover{background:#f5f2ed}
.draw-color-label{display:flex;align-items:center;gap:4px;font-size:.78rem;margin:0}
.skill-draw .draw-color-label select{width:auto;min-width:0;max-width:86px}
.skill-draw .draw-add-box{white-space:nowrap;margin-inline-start:auto}
.draw-context{padding:3px 0}.draw-context[hidden]{display:none}
.draw-readout{border-top:1px solid #eeeae4;padding-top:8px;margin-top:8px;gap:6px}
.skill-draw .draw-readout [data-act=answer]{border-color:transparent}
.draw-more{margin-top:4px}.draw-more summary{display:list-item;cursor:pointer;font-size:.8rem;min-height:42px;line-height:42px;color:#524942}
.draw-more .draw-view{justify-content:flex-start;gap:8px;margin:0 0 4px}
.draw-save{display:block;font-size:.72rem;color:#655f59}.draw-save:empty{display:none}
@media(max-width:360px){.draw-tools-primary{gap:4px}.draw-color-label span{display:none}}
.skill-draw :is(button,select,.draw-more summary){touch-action:manipulation}
