/* Modern desktop-workbench styling. Editing, hit areas and simulation stay unchanged. */
body.cm-open .masthead{height:68px;max-width:none;background:#fff}
body.cm-open .main-nav{max-width:none;overflow:auto;gap:24px;background:#fff}
body.cm-open main{max-width:none;padding:22px 22px 30px;background:#f3f6fa}
body.cm-open .site-footer{max-width:none;background:#f3f6fa}
.cm-app{--cm-green:#147d68;--cm-edge:#d9e2e9;--cm-soft:#edf5f3;--cm-ink:#22324a;--cm-muted:#607086;color:var(--cm-ink);font-feature-settings:"tnum"}
.cm-app button,.cm-app input,.cm-app select{font-size:13px;min-height:40px}
.cm-app button{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--cm-edge);background:#fff;color:var(--cm-ink);border-radius:7px;padding:8px 12px;font-weight:600;line-height:1.3;transition:background .12s,border-color .12s,box-shadow .12s}
.cm-app button:hover:not(:disabled){background:#f1f6f8;border-color:#9baebb;box-shadow:0 1px 3px #22324a0a}
.cm-app button.active,.cm-app .cm-primary{color:#fff;background:var(--cm-green);border-color:var(--cm-green)}
.cm-app button.active:hover:not(:disabled),.cm-app .cm-primary:hover:not(:disabled){background:#106c59;border-color:#106c59}
.cm-app button:disabled{opacity:.4}
.cm-app button:focus-visible,.cm-app input:focus-visible,.cm-app select:focus-visible,.cm-app summary:focus-visible{outline:3px solid #327bc5;outline-offset:3px}
.cm-app input,.cm-app select{border:1px solid var(--cm-edge);background:#fff;border-radius:7px;padding:8px 10px;color:var(--cm-ink);max-width:100%}
.cm-app a{color:var(--cm-green)}
.cm-icon{display:inline-block;width:16px;height:16px;flex:0 0 16px;vertical-align:-3px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.cm-head{display:flex;justify-content:space-between;flex-wrap:wrap;gap:16px;align-items:center;margin-bottom:14px}
.cm-head>div:first-child{flex:0 0 auto}
.cm-head h1{font-family:inherit;font-size:29px;font-weight:700;letter-spacing:-.9px;line-height:1.2}
.cm-head .eyebrow{margin:0 0 5px;font-size:10px;letter-spacing:1.2px;color:#61748a}
.cm-head p{font-size:13px;color:var(--cm-muted);margin-top:5px}
.cm-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end;flex:0 0 auto}
.cm-badge{display:inline-flex;align-items:center;gap:7px;font-size:12px;background:#e7f3ed;color:#236349;padding:8px 11px;border:1px solid #cfe6d8;border-radius:7px;font-weight:650;white-space:nowrap}
.cm-badge i{width:7px;height:7px;border-radius:50%;background:#258c60;box-shadow:0 0 0 3px #258c6012}
.cm-badge[data-state="pause"]{background:#fff5e5;border-color:#ead7b1;color:#86611d}
.cm-badge[data-state="pause"] i{background:#b88322;box-shadow:none}
.cm-badge[data-state="stop"]{background:#eef2f6;border-color:#d5dee7;color:#5d6f81}
.cm-badge[data-state="stop"] i{background:#7b8d9d;box-shadow:none}
.cm-commandbar{display:flex;flex:1;align-items:center;justify-content:flex-end;gap:12px 18px;flex-wrap:wrap;min-width:0;padding:0;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.cm-file-actions,.cm-exercise-actions{display:flex;align-items:center;flex-wrap:wrap;gap:7px;min-width:0}
.cm-command-label{font-size:11px;letter-spacing:.6px;text-transform:uppercase;font-weight:700;color:#697b8c;margin-right:5px}
.cm-app .cm-commandbar button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:35px;font-size:12px;padding:7px 9px}
.cm-live-bar{display:grid;grid-template-columns:1fr 1fr .9fr 1.45fr;gap:12px;margin-bottom:18px}
.cm-input-card,.cm-result-card,.cm-mode-card{border:1px solid var(--cm-edge);background:#fff;border-radius:10px;padding:13px 15px;min-width:0;box-shadow:0 2px 5px #22324a03}
.cm-card-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.cm-card-top label,.cm-card-top>span,.cm-mode-card>span,.cm-result-title{font-size:10px;letter-spacing:.8px;text-transform:uppercase;color:#5c7084;font-weight:750}
.cm-input-card select{width:136px;min-height:34px;font-size:12px;padding:5px 7px}
.cm-bit-row{display:flex;gap:5px;align-items:center;margin-top:11px}
.cm-bit-row button{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;width:32px;min-height:32px;padding:4px;border-color:#d5e0e7;font-size:15px;background:#f8fafc;color:#51667d}
.cm-bit-row .bit-one{background:#e2f3ec;color:#146448;border-color:#aed7c4}
.cm-bit-row .cm-hex-read{margin-left:auto;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:27px;font-weight:700;color:#203c56}
.cm-bit-row small{font-size:10px;color:#728196}
.cm-mode-buttons{display:flex;gap:5px;margin:12px 0 8px}
.cm-mode-buttons button{flex:1;padding:7px 9px;min-height:34px;font-size:12px;white-space:nowrap}
.cm-mode-card small{font-size:11px;color:var(--cm-muted);line-height:1.4}
.cm-result-card{border-top:3px solid #3b8e7c;padding-top:11px}
.cm-result-body{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:9px;flex-wrap:wrap}
.cm-result-number{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:28px;font-weight:700;letter-spacing:2px;color:#1d3c52;font-variant-numeric:tabular-nums}
.cm-result-meta{font-size:12px;line-height:1.55;color:#586b80}
.cm-overflow{font-size:11px;font-weight:750;border-radius:6px;padding:8px 10px;background:#edf4f0;color:#3e6554;white-space:nowrap}
.cm-overflow.on{background:#fff0d8;color:#985608}
.cm-overflow.unknown{background:#f7eddd;color:#8a631e}
.cm-overflow:before{content:'●';margin-right:6px}
.cm-result-notice{font-size:11px;margin-top:8px;color:#86551d;line-height:1.5}
.cm-workspace{display:grid;grid-template-columns:190px minmax(280px,1fr) 290px;gap:14px;align-items:start}
.cm-palette,.cm-guide{border:1px solid var(--cm-edge);border-radius:10px;background:#fff;overflow:hidden;box-shadow:0 2px 6px #22324a04}
.cm-panel-label{padding:16px 14px 12px;font-size:13px;letter-spacing:0;font-weight:750;color:#304660}
.cm-palette-search{margin:0 11px 10px;width:calc(100% - 22px);font-size:12px!important;min-height:36px!important;background:#f8fafc!important}
.cm-palette-group{font-size:10px;color:#65788c;text-transform:uppercase;letter-spacing:.9px;font-weight:700;padding:13px 14px 5px}
.cm-app .cm-palette-item{display:flex;align-items:center;justify-content:flex-start;gap:9px;text-align:left;width:calc(100% - 12px);margin:3px 6px;min-height:46px!important;background:transparent!important;border-color:transparent!important;touch-action:none;padding:7px 8px!important}
.cm-palette-item:hover,.cm-palette-item.active{background:#eaf5f0!important;color:var(--cm-green)!important;border-color:#c6e0d4!important;box-shadow:none!important}
.cm-part-icon{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border:1px solid #d6e1e8;border-radius:7px;background:#f7f9fc;font-family:ui-monospace,monospace;font-size:14px;color:#36536b}
.cm-palette-item span:last-child{font-size:12px;line-height:1.35}
.cm-palette-hint{font-size:11px;line-height:1.6;padding:15px 14px;color:var(--cm-muted);border-top:1px solid #e9eef3;margin-top:12px;background:#fafbfd}
.cm-center{min-width:0}
.cm-sheet-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 15px;border:1px solid var(--cm-edge);border-bottom:0;border-radius:10px 10px 0 0;background:#fff;color:#304660;font-size:13px;font-weight:700}
.cm-sheet-heading span:last-child{color:#708194;font-size:11px;font-weight:500}
.cm-toolbar{display:flex;flex-direction:column;gap:0;padding:0 10px;border:1px solid var(--cm-edge);background:#f8fafc;min-height:54px}
.cm-toolbar-row{display:flex;align-items:center;flex-wrap:wrap;gap:7px;padding:8px 0;min-width:0}
.cm-toolbar-row+.cm-toolbar-row{border-top:1px solid #e2e9ef}
.cm-tool-group{display:flex;align-items:center;gap:5px;flex-wrap:wrap;min-width:0}
.cm-trace-group,.cm-view-tools{margin-left:auto}
.cm-tool-label{font-size:10px;letter-spacing:.6px;text-transform:uppercase;font-weight:700;color:#667b8e;margin:0 5px 0 1px}
.cm-app .cm-toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:5px;background:#fff;border:1px solid #d9e2e9;color:#354b62;min-height:35px;padding:6px 9px;font-size:12px;border-radius:6px}
.cm-app .cm-toolbar button:hover:not(:disabled){background:#edf3f7;border-color:#a4b6c3}
.cm-app .cm-toolbar button.active{background:#e1f0ea;border-color:#a9d1c0;color:#15654e;box-shadow:inset 0 0 0 1px #147d6810}
.cm-app .cm-toolbar .cm-run{background:var(--cm-green);border-color:var(--cm-green);color:#fff}
.cm-app .cm-toolbar .cm-run:hover:not(:disabled){background:#106b58;border-color:#106b58}
.cm-toolbar .cm-divider{height:22px;border-left:1px solid #d9e2e9;margin:0 3px}
.cm-toolbar .cm-spacer{flex:1}
.cm-stage{height:590px;position:relative;background:#fbfcfe;border:1px solid #ccd8e2;border-top:0;overflow:hidden;touch-action:none}
.cm-stage svg{display:block;width:100%;height:100%;touch-action:none;user-select:none}
.cm-sheet-background{fill:#fbfcfe}
.cm-sheet-grid,.cm-sheet-grid circle{fill:#d5dfe7}
.cm-stage[data-tool="pan"]{cursor:grab}
.cm-stage[data-tool="wire"]{cursor:crosshair}
.cm-stage[data-tool="part"]{cursor:copy}
.cm-empty{position:absolute;top:40%;left:10%;right:10%;text-align:center;pointer-events:none;color:#62768d;font-size:14px;line-height:1.8}
.cm-wire-hit{stroke:transparent;stroke-width:16;fill:none;cursor:pointer}
.cm-wire-line{stroke:#627b8d;stroke-width:2;fill:none;pointer-events:none;stroke-linejoin:round}
.cm-wire.high .cm-wire-line{stroke:#16805d}
.cm-wire.low .cm-wire-line{stroke:#3478bd}
.cm-wire.x .cm-wire-line{stroke:#a56912;stroke-dasharray:5 5}
.cm-wire.plain .cm-wire-line{stroke:#64788d}
.cm-wire.selected .cm-wire-line,.cm-wire.focus .cm-wire-line{stroke-width:3.6}
.cm-wire.selected .cm-wire-line{stroke:#bc7311;filter:drop-shadow(0 0 3px #d79c3d40)}
.cm-part{cursor:move}
.cm-part-body{fill:#fff;stroke:#8397a7;stroke-width:1.5}
.cm-part.selected .cm-part-body{stroke:#b77511;stroke-width:3}
.cm-part.lesson-focus .cm-part-body{stroke:#25846a;stroke-width:2.5;filter:drop-shadow(0 0 3px #25846a18)}
.cm-part.source .cm-part-body{fill:#eef8f4}
.cm-pin{cursor:crosshair}
.cm-pin-hit{fill:transparent}
.cm-pin-dot{fill:#fff;stroke:#657f93;stroke-width:2}
.cm-pin.high .cm-pin-dot{fill:#16805d;stroke:#11664b}
.cm-pin.low .cm-pin-dot{fill:#3478bd;stroke:#255e96}
.cm-pin.x .cm-pin-dot{fill:#c28c36;stroke:#93621b}
.cm-pin.armed .cm-pin-dot{fill:#fff5d9;stroke:#ad7010;stroke-width:4}
.cm-pin:hover .cm-pin-dot{stroke:#172e45;stroke-width:3}
.cm-pin-label{fill:#344f64;font:10px ui-monospace,monospace;pointer-events:none}
.cm-pin-value{fill:#3f6476;font:10px ui-monospace,monospace;pointer-events:none}
.cm-chip-id,.cm-part-title{fill:#2c4a60;font:10px system-ui,sans-serif;font-weight:650;pointer-events:none}
.cm-chip-type{fill:#284458;font:17px ui-monospace,monospace;letter-spacing:1px;pointer-events:none}
.cm-chip-divider{stroke:#d0dde6;stroke-width:1}
.cm-chip-plus{fill:#7993a2;font:27px ui-monospace,monospace;pointer-events:none}
.cm-gate-symbol{fill:#f6f9fc;stroke:#38566a;stroke-width:2;pointer-events:none}
.cm-gate-label{fill:#29485b;font:11px system-ui,sans-serif;pointer-events:none}
.cm-hex-glyph{fill:#176c53;font:42px ui-monospace,monospace;pointer-events:none}
.cm-word{fill:#315c59;font:12px ui-monospace,monospace;letter-spacing:2px;pointer-events:none}
.cm-signed{fill:#5f7887;font:10px system-ui,sans-serif;pointer-events:none}
.cm-switch-track{fill:#dbece4;stroke:#8eafa2}
.cm-switch-knob{fill:#147d68}
.cm-switch-knob.sub{fill:#bc7b16}
.cm-led.off{fill:#edf3f1;stroke:#709787;stroke-width:2}
.cm-led.on{fill:#efa936;stroke:#a96c11;stroke-width:2;filter:drop-shadow(0 0 5px #dfa02f45)}
.cm-led.unknown{fill:#c1a06a;stroke:#8b672b}
.cm-led-value{fill:#375363;font:22px ui-monospace,monospace}
.cm-drop-ghost{stroke:#168365;stroke-width:3;stroke-dasharray:8 5;fill:#16836515;pointer-events:none}
.cm-status{border-radius:0 0 10px 10px;background:#f7f9fc;border:1px solid #ccd8e2;border-top:0;display:flex;justify-content:space-between;gap:10px;padding:11px 13px;font-size:11px;color:#5c7287;line-height:1.5}
.cm-legend{display:flex;gap:12px;flex-wrap:wrap;margin:10px 2px;font-size:11px;color:#63778b}
.cm-legend i{width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:5px}
.cm-legend .high{background:#16805d}
.cm-legend .low{background:#3478bd}
.cm-legend .x{background:#a56912}
.cm-guide-tabs{display:flex;border-bottom:1px solid var(--cm-edge);background:#fafbfd}
.cm-app .cm-guide-tabs button{flex:1;border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;color:#64788d;font-size:12px;min-height:46px;padding:10px 8px}
.cm-app .cm-guide-tabs button.active{border-color:var(--cm-green);color:#146a55;background:#fff}
.cm-guide-content{padding:17px}
.cm-step-top{display:flex;flex-direction:column;gap:8px;align-items:stretch;font-size:10px;letter-spacing:.5px;color:#6b7e91;margin-bottom:12px}
.cm-guide-step-select{width:100%;max-width:100%!important;font-size:12px!important;min-height:36px!important;letter-spacing:0}
.cm-step-track{display:flex;gap:4px;margin-bottom:18px}
.cm-step-track span{height:4px;background:#e2eaf0;flex:1;border-radius:3px}
.cm-step-track span.done{background:#349579}
.cm-guide h2{font-size:19px;line-height:1.35;margin-bottom:15px;letter-spacing:-.4px;color:#253f55}
.cm-guide p{font-size:13px;line-height:1.7;margin-bottom:15px;color:#536a7e}
.cm-guide .cm-do{color:#275a4c;font-weight:600}
.cm-guide-label{font-size:10px;text-transform:uppercase;letter-spacing:.8px;font-weight:750;color:#688092;display:block;margin-bottom:6px}
.cm-guide-callout{background:#f0f7f5;border:1px solid #d9e9e3;border-radius:8px;padding:12px;margin-bottom:15px}
.cm-guide-callout p:last-child{margin-bottom:0}
.cm-guide details{font-size:12px;color:#526c80;margin-top:14px}
.cm-guide details summary{cursor:pointer;line-height:1.5;font-weight:600;padding:9px 0;min-height:38px}
.cm-guide details p{font-size:12px;padding-top:7px}
.cm-guide-actions{display:flex;gap:7px;flex-wrap:wrap}
.cm-guide-actions button{flex:1;font-size:12px;min-height:40px}
.cm-guide-nav{display:flex;justify-content:space-between;gap:8px;margin-top:20px;padding-top:16px;border-top:1px solid #e6edf2}
.cm-guide-nav button{min-width:82px}
.cm-connections{max-height:240px;overflow:auto;border-top:1px solid var(--cm-edge);margin:12px 0;font:11px ui-monospace,monospace}
.cm-connection{padding:9px 2px;border-bottom:1px solid #e5edf3;display:flex;justify-content:space-between;align-items:center;gap:7px;line-height:1.6}
.cm-connection button{min-height:30px!important;min-width:30px;font-size:13px!important;padding:3px 6px!important}
.cm-inspector-label{display:block;font-size:12px;font-weight:600;margin:16px 0 6px;color:#4f687e}
.cm-inspector-input{width:100%}
.cm-keypad{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:11px 0}
.cm-keypad button{font-family:ui-monospace,monospace}
.cm-inspector-actions{display:flex;gap:8px;margin-top:16px}
.cm-help-empty{font-size:13px;line-height:1.8;color:var(--cm-muted)}
.cm-exercises{margin-top:20px;border:1px solid var(--cm-edge);border-radius:11px;background:#fff;padding:22px;box-shadow:0 2px 6px #22324a03}
.cm-ex-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.cm-ex-head h2{font-size:20px;color:#294359;letter-spacing:-.4px}
.cm-ex-head p{font-size:12px;color:var(--cm-muted);margin-top:6px}
.cm-ex-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}
.cm-ex-buttons button{flex:1;white-space:nowrap;min-width:108px;min-height:43px;font-size:13px}
.cm-ex-buttons button small{font-size:10px;opacity:.65;margin-right:7px}
.cm-working{display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:22px;border-top:1px solid var(--cm-edge);padding-top:20px}
.cm-working h3{font-size:13px;line-height:1.5;margin-bottom:10px;color:#314b63}
.cm-working p{font-size:12px;line-height:1.7;color:#60748a}
.cm-word-work{font-family:ui-monospace,monospace;font-size:14px;line-height:1.9;background:#f1f5f8;border:1px solid #e2eaf1;border-radius:8px;padding:12px 14px;color:#35546b;white-space:pre;overflow:auto}
.cm-carry-table{border-collapse:collapse;width:100%;font:11px ui-monospace,monospace}
.cm-carry-table td,.cm-carry-table th{text-align:center;padding:9px 4px;border-bottom:1px solid #dfe8ef}
.cm-carry-table th{background:#f2f6f9;color:#4b647c}
.cm-checks{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.cm-check-chip{background:#e8f4ee;color:#27664d;border-radius:6px;padding:8px 11px;font-size:11px}
.cm-check-chip.fail{background:#fff0e0;color:#925315}
.cm-model-note{display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap;font-size:11px;color:#6a7e91;line-height:1.7;margin-top:18px}
.cm-toast{padding:11px 14px;border:1px solid #cfe1d9;border-radius:8px;background:#edf7f2;color:#315c4e;font-size:13px;line-height:1.5;margin-bottom:14px}
.cm-toast:empty{display:none}
.cm-mobile-actions{display:none!important}
.cm-workspace-hide-palette{grid-template-columns:minmax(280px,1fr) 290px}
.cm-workspace-hide-palette .cm-palette{display:none}
.cm-app [hidden]{display:none!important}
.cm-pin-label,.cm-pin-value{pointer-events:auto;cursor:crosshair}
@media(min-width:1700px){.cm-stage{height:710px}.cm-workspace{grid-template-columns:210px minmax(280px,1fr) 320px}}
@media(max-width:1100px){
 .cm-app button,.cm-app input,.cm-app select{min-height:44px}
 .cm-app .cm-toolbar button,.cm-app .cm-commandbar button,.cm-app .cm-mode-buttons button,.cm-app .cm-input-card button,.cm-app .cm-input-card select,.cm-app .cm-guide-actions button,.cm-app .cm-guide-nav button{min-height:44px}
 .cm-app .cm-guide-step-select,.cm-app .cm-palette-search,.cm-app .cm-connection button{min-height:44px!important}
 .cm-head>div:first-child{order:1}
 .cm-head-actions{order:2;margin-left:auto}
 .cm-commandbar{order:3;flex:1 1 100%;justify-content:space-between}
 .cm-workspace{grid-template-columns:minmax(280px,1fr) 285px}
 .cm-palette{display:none}
 .cm-palette.show{display:block;grid-column:1/-1}
 .cm-palette.show .cm-palette-list{display:flex;flex-wrap:wrap;padding:6px}
 .cm-palette.show .cm-palette-item{width:160px;margin:3px}
 .cm-palette-group{display:none}
 .cm-palette-hint{margin-top:8px}
 .cm-mobile-actions{display:inline-flex!important}
 .cm-stage{height:590px}
 .cm-live-bar{grid-template-columns:1fr 1fr 1fr}
 .cm-result-card{grid-column:1/-1}
 .cm-result-body{justify-content:flex-start;gap:25px}
 .cm-result-notice{margin-top:7px}
 .cm-working{grid-template-columns:1fr 1fr}
 .cm-working>div:last-child{grid-column:1/-1}
}
@media(max-width:740px){
 body.cm-open main{padding:18px 12px}
 .cm-head{align-items:center;gap:12px;margin-bottom:14px}
 .cm-head h1{font-size:26px}
 .cm-head .eyebrow{font-size:9px;letter-spacing:.6px;max-width:240px}
 .cm-head p{font-size:12px}
 .cm-badge{font-size:10px;padding:7px 8px;gap:6px}
 .cm-commandbar{align-items:flex-start;gap:10px;padding:0;margin:0}
 .cm-file-actions,.cm-exercise-actions{gap:6px;flex:1 1 100%}
 .cm-command-label{width:100%;font-size:10px;margin-bottom:1px}
 .cm-app .cm-commandbar button{min-height:44px;padding:8px 9px;font-size:12px;flex:1}
 .cm-live-bar{gap:9px;grid-template-columns:1fr 1fr;margin-bottom:14px}
 .cm-input-card,.cm-mode-card,.cm-result-card{padding:12px}
 .cm-card-top{display:block}
 .cm-input-card select{width:100%;margin-top:7px;min-height:44px;font-size:12px}
 .cm-bit-row{gap:4px}
 .cm-app .cm-input-card button{min-height:44px;width:29px;font-size:14px}
 .cm-bit-row .cm-hex-read{font-size:23px}
 .cm-mode-card{grid-column:1/-1;display:flex;align-items:center;gap:10px}
 .cm-mode-buttons{margin:0;flex:1}
 .cm-mode-buttons button{min-height:44px}
 .cm-mode-card small{display:none}
 .cm-workspace{grid-template-columns:1fr;gap:14px}
 .cm-workspace>.cm-guide{grid-row:auto}
 .cm-stage{height:480px}
 .cm-sheet-heading{padding:11px 12px}
 .cm-toolbar{padding:0 8px}
 .cm-toolbar-row{gap:6px;padding:8px 0}
 .cm-toolbar .cm-tool-group{gap:5px}
 .cm-toolbar .cm-tool-label{font-size:9px;margin-right:3px}
 .cm-app .cm-toolbar button{min-height:44px;padding:8px 9px;font-size:12px}
 .cm-toolbar .cm-spacer{display:none}
 .cm-toolbar .cm-divider{margin:0 1px}
 .cm-guide-content{padding:18px}
 .cm-guide p{font-size:13px}
 .cm-guide-actions button,.cm-guide-nav button,.cm-keypad button{min-height:44px}
 .cm-guide-step-select{min-height:44px!important}
 .cm-guide details summary{min-height:44px}
 .cm-connection button{min-height:44px!important;min-width:36px}
 .cm-working{grid-template-columns:1fr}
 .cm-working>div:last-child{grid-column:auto}
 .cm-exercises{padding:17px}
 .cm-ex-buttons button{min-width:100px;flex:1;font-size:12px;min-height:44px}
 .cm-ex-head h2{font-size:18px}
 .cm-result-number{font-size:27px}
 .cm-result-body{gap:12px}
 .cm-result-notice{display:block;margin-left:0}
 .cm-status{display:block;font-size:11px}
 .cm-status span{display:block}
 .cm-status span+span{margin-top:4px}
 .cm-legend{gap:9px;font-size:11px}
}
@media(max-width:380px){
 .cm-head{align-items:flex-start}
 .cm-head-actions{padding-top:5px}
 .cm-badge{font-size:9px;padding:6px}
 .cm-bit-row{gap:3px;flex-wrap:wrap}
 .cm-bit-row .cm-hex-read{font-size:21px}
 .cm-app .cm-input-card button{width:25px;min-height:44px}
 .cm-result-meta{font-size:11px}
 .cm-toolbar .cm-tool-label{width:100%;margin-bottom:2px}
 .cm-palette.show .cm-palette-item{width:calc(50% - 6px)}
 .cm-palette-item span:last-child{font-size:11px}
}
@media(prefers-reduced-motion:reduce){.cm-app button{transition:none}}
@media(max-width:1100px){.cm-app .cm-toolbar button{min-width:44px}}

/* Project files are the main save/open workflow; browser storage is recovery. */
.cm-primary-files{padding:0 0 13px;margin:0;gap:8px}
.cm-app .cm-primary-files button{min-height:44px;padding:10px 16px}
.cm-file-help{font-size:12px;line-height:1.6;color:#52687d;margin:0 0 12px}
.cm-download-retry{padding:10px 13px;margin:0 0 12px;border:1px solid #cfe1d9;border-radius:8px;background:#edf7f2;color:#315c4e;font-size:12px;line-height:1.65;overflow-wrap:anywhere}
.cm-download-retry a{color:#145f50;text-decoration:underline;font-weight:650}
.cm-download-retry a:focus-visible{outline:3px solid #247e69;outline-offset:3px}
.cm-project-strip{display:flex;align-items:center;gap:20px;flex-wrap:wrap;padding:12px 15px;margin-bottom:12px;background:#fff;border:1px solid var(--cm-edge);border-radius:9px}
.cm-project-strip label{display:flex;align-items:center;gap:10px;font-size:12px;font-weight:650;color:#52687d;min-width:0;flex:1 1 340px}
.cm-project-strip input{min-width:0;width:100%;flex:1;min-height:44px;font-weight:600}
.cm-project-strip>div{display:flex;flex-direction:column;gap:4px;flex:1 1 300px;font-size:12px;color:#607086}
.cm-project-strip strong{font-size:12px;color:#36566c}
.cm-app .cm-commandbar button{min-height:44px}
.cm-replace-panel{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;padding:15px;margin-bottom:12px;border:1px solid #dec798;border-radius:9px;background:#fff8e9;color:#654c24}
.cm-replace-panel>div:first-child{flex:1 1 420px}
.cm-replace-panel strong{font-size:14px}
.cm-replace-panel p{font-size:12px;line-height:1.65;margin-top:6px;max-width:880px}
.cm-replace-panel>div:last-child{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.cm-replace-panel button{min-height:44px}
.cm-build-note{font-size:13px;line-height:1.7;padding:12px 15px;margin-bottom:14px;border:1px solid #d7e7e3;border-radius:8px;background:#edf6f2;color:#3d6258}
.cm-reading-pending{padding:10px;border:1px solid #e5d4af;border-radius:7px;background:#fff7e7;color:#6d542a!important;font-size:12px!important;line-height:1.6}
@media(max-width:700px){.cm-project-strip{gap:12px;padding:12px}.cm-project-strip label{display:block;flex-basis:100%}.cm-project-strip input{display:block;margin-top:6px}.cm-project-strip>div{flex-basis:100%}.cm-replace-panel{padding:13px;gap:12px}.cm-replace-panel>div:last-child{width:100%}.cm-replace-panel button{flex:1}}
@media(max-width:700px){.cm-primary-files{width:100%;gap:7px}.cm-app .cm-primary-files button{flex:1 1 auto;padding:10px 12px}}
