:root{--blue:#1f6feb;--blue-dark:#12407f;--blue-soft:#e7f0ff;--green:#1f9d55;--green-soft:#e3f7ea;--yellow:#ffc83d;--yellow-soft:#fff6d6;--red:#c62828;--ink:#14213d;--muted:#52607a;--line:#d4deee;--bg:#f5f8fd;color:var(--ink);background:var(--bg);font-family:Nunito,Segoe UI,system-ui,-apple-system,sans-serif;font-size:17px;line-height:1.45}*{box-sizing:border-box}body{margin:0}h1,h2,h3,h4{margin:0 0 .4em;line-height:1.2}h2{color:var(--blue-dark);font-size:1.1rem}button,select,input{font:inherit}.app{flex-direction:column;min-height:100vh;display:flex}.header{background:linear-gradient(90deg, var(--blue) 0%, #2b8de0 60%, var(--green) 100%);color:#fff;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px 20px;padding:14px 24px;display:flex}.brand{align-items:center;gap:14px;min-width:0;display:flex}.brand h1{overflow-wrap:anywhere}.lang-picker{align-items:center;gap:8px;font-weight:800;display:flex}.lang-picker select{min-height:44px;color:var(--blue-dark);background:#fff;border:2px solid #fff;border-radius:12px;padding:6px 10px;font-weight:800}.btn,.tab{overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto;text-align:center}.terminal-text,.comp-label{-webkit-hyphens:none;hyphens:none}.brand-mark{background:var(--yellow);width:48px;height:48px;color:var(--blue-dark);border-radius:14px;place-items:center;font-size:22px;font-weight:900;display:grid}.header h1{letter-spacing:.3px;margin:0;font-size:1.6rem}.tagline{opacity:.92;margin:0}.nav{border-bottom:1px solid var(--line);background:#fff;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 24px;display:flex}.nav-group{color:var(--muted);font-weight:700}.tab{border:2px solid var(--line);cursor:pointer;min-height:44px;color:var(--blue-dark);background:#fff;border-radius:999px;padding:8px 16px;font-weight:700}.tab.active{background:var(--blue);border-color:var(--blue);color:#fff}.nav-future{color:var(--muted);margin-left:auto;font-size:.85rem}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;padding:10px 24px;display:flex}.sep{background:var(--line);width:1px;height:28px}.btn{border:2px solid var(--line);min-width:44px;min-height:44px;color:var(--ink);cursor:pointer;background:#fff;border-radius:12px;padding:8px 14px;font-weight:700}.btn:hover:not(:disabled){border-color:var(--blue)}.btn:focus-visible,.tab:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid var(--yellow);outline-offset:2px}.btn:disabled{opacity:.45;cursor:not-allowed}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.accent{background:var(--yellow);color:var(--ink);border-color:#e0a800}.btn.danger{color:var(--red);border-color:#f2b8b8}.btn.ghost{background:0 0}.panel-toggle{display:none}.toast{background:var(--yellow-soft);border:2px solid var(--yellow);word-break:break-all;border-radius:12px;margin:0 24px 8px;padding:10px 14px}.layout{flex:1;grid-template-columns:240px minmax(0,1fr) 300px;align-items:start;gap:16px;padding:0 24px 16px;display:grid}.panel{border:1px solid var(--line);background:#fff;border-radius:18px;max-height:calc(100vh - 230px);padding:16px;overflow:auto}.panel[hidden]{display:none}.bench-wrap{border:1px solid var(--line);aspect-ratio:1000/640;background:#fff;border-radius:18px;overflow:hidden}.bench{touch-action:none;-webkit-user-select:none;user-select:none;background:#fbfdff;width:100%;height:100%;display:block}.tray{gap:12px;margin:0;padding:0;list-style:none;display:grid}.tray-item{border:2px solid var(--line);border-radius:14px;padding:10px}.tray-row{align-items:center;gap:10px;margin-bottom:8px;display:flex}.tray-actions{flex-wrap:wrap;gap:8px;display:flex}.tray-info{background:var(--blue-soft);border-radius:10px;margin:8px 0 0;padding:8px 10px}.tick{color:var(--green);margin-left:auto;font-weight:900}.tray-icon{border-radius:6px;width:34px;height:24px;display:inline-block}.icon-supply{background:linear-gradient(90deg,#e63946 35%,#1d3557 35%)}.icon-resistor{background:repeating-linear-gradient(90deg,#e9c46a 0 6px,#ff8c00 6px 10px)}.icon-led{background:radial-gradient(circle,#ff3b30 45%,#0000 50%)}.icon-switch{background:linear-gradient(160deg,#0000 45%,#2a9d8f 45% 60%,#0000 60%);border-bottom:3px solid #333}.comp-body{cursor:grab}.comp-outline{fill:#0000;stroke:#0000;stroke-width:3px}.comp.selected .comp-outline{fill:#1f6feb0f;stroke:var(--blue);stroke-dasharray:6 4}.comp.fault .comp-outline{stroke:#f08c00;stroke-width:4px;stroke-dasharray:8 5}.lead{stroke:#6b7280;stroke-width:5px;stroke-linecap:round}.comp-text{font-size:18px;font-weight:800}.comp-text.light{fill:#fff}.comp-label{text-anchor:middle;fill:var(--muted);pointer-events:none;font-size:18px;font-weight:700}.terminal{cursor:crosshair}.terminal-hit{fill:#0000}.terminal-dot{fill:#fff;stroke:#4b5563;stroke-width:4px}.terminal.plus .terminal-dot{stroke:#d62828}.terminal.minus .terminal-dot{stroke:#111}.terminal:hover .terminal-dot,.terminal:focus .terminal-dot{fill:var(--yellow)}.terminal.pending .terminal-dot{fill:var(--yellow);stroke:var(--blue);stroke-width:6px}.terminal.fault .terminal-dot{fill:#ffe8cc;stroke:#f08c00;stroke-width:6px}.terminal-text{text-anchor:middle;fill:var(--ink);pointer-events:none;font-size:16px;font-weight:800}.wire{cursor:pointer}.wire-hit{fill:none;stroke:#0000;stroke-width:22px}.wire-line{fill:none;stroke:#2563eb;stroke-width:5px;stroke-linecap:round;pointer-events:none}.wire.selected .wire-line{stroke:var(--yellow);stroke-width:7px}.wire.fault .wire-line{stroke:#f08c00;stroke-dasharray:10 6}.wire-line.drafting{stroke-dasharray:8 6;stroke:var(--green)}.lesson .progress{background:var(--blue-soft);border-radius:99px;height:12px;margin:8px 0 12px;overflow:hidden}.progress-bar{background:linear-gradient(90deg, var(--green), var(--yellow));height:100%;transition:width .3s}.current-step{background:var(--yellow-soft);border:2px solid var(--yellow);border-radius:14px;padding:12px}.current-step.done{background:var(--green-soft);border-color:var(--green)}.step-count{color:var(--muted);margin:0;font-size:.85rem;font-weight:800}.hint{background:#fff;border-radius:10px;padding:8px}.success{background:var(--green-soft);color:#11603a;border-radius:10px;padding:8px 10px}.steps{color:var(--muted);padding-left:22px}.steps li.done{color:var(--green);text-decoration:line-through}.steps li.current{color:var(--ink);font-weight:800}.concepts summary{cursor:pointer;color:var(--blue-dark);align-items:center;min-height:44px;font-weight:800;display:flex}.concepts h4{margin-top:10px}.settings{gap:10px;display:grid}.settings select,.settings input{border:2px solid var(--line);border-radius:10px;min-height:44px;padding:6px 10px}.settings .inline{grid-template-columns:1fr auto;gap:8px;display:grid}.settings .inline label{grid-column:1/-1}.row{flex-wrap:wrap;gap:8px;display:flex}.muted{color:var(--muted)}.small{font-size:.85rem}.error{color:var(--red);margin:0}.status{border:2px solid var(--line);background:#fff;border-radius:18px;margin:0 24px 12px;padding:12px 16px}.status.tone-ok{border-color:var(--green);background:var(--green-soft)}.status.tone-warn{border-color:var(--yellow);background:var(--yellow-soft)}.status.tone-bad{background:#fff1e0;border-color:#f08c00}.status.tone-info{border-color:var(--blue);background:var(--blue-soft)}.status-main{margin:0 0 6px;font-size:1.05rem;font-weight:800}.status-extra{margin:0 0 6px;padding-left:20px}.meters{flex-wrap:wrap;gap:10px 24px;margin:0;display:flex}.meters div{gap:6px;display:flex}.meters dt{color:var(--muted)}.meters dt:after{content:":"}.meters dd{font-variant-numeric:tabular-nums;margin:0;font-weight:800}.footer{color:var(--muted);padding:8px 24px 16px;font-size:.85rem}.free-intro{background:var(--blue-soft);border-radius:12px;padding:10px}@media (width<=1180px){.panel-toggle{display:inline-block}.layout{grid-template-columns:1fr}.panel{max-height:none}.tray-panel .tray{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}.tray-panel{order:-1}.side-panel{order:1}.nav-future{flex-basis:100%;margin-left:0}}@media (width<=600px){:root{font-size:16px}.header,.nav,.toolbar{padding-left:12px;padding-right:12px}.layout{gap:10px;padding:0 8px 12px}.status,.toast{margin-left:8px;margin-right:8px}.header h1{font-size:1.25rem}.sep{display:none}.tray-panel .tray{grid-template-columns:1fr 1fr;gap:8px}.tray-item{padding:8px}.tray-actions .btn{padding:6px 8px}.terminal-text,.comp-label{font-size:30px}.toolbar .btn{padding:6px 10px}}.wago-body{fill:#ffffffbf;stroke:#8a8f98;stroke-width:3px}.wago-lever{fill:#f08c00}.wago-bar{stroke:#b7c0cc;stroke-width:4px;stroke-dasharray:4 4}.wago-bar.show{stroke:#1f9d55;stroke-width:6px;stroke-dasharray:none}.comp.selected .wago-body,.comp.selected .bb-board{stroke:var(--blue);stroke-width:4px;stroke-dasharray:8 5}.bb-board{fill:#f4f1ea;stroke:#cfc7b5;stroke-width:3px}.bb-channel{fill:#e2dccd}.bb-rail{stroke-width:3px}.bb-mark{fill:#1d4ed8;text-anchor:middle;font-size:18px;font-weight:900}.bb-mark.plus{fill:#d62828}.bb-break-label{fill:#b45309;text-anchor:middle;font-size:13px;font-weight:800}.bb-strip{fill:#1f9d552e;stroke:#1f9d55b3;stroke-width:2px;pointer-events:none}.bb-railstrip{stroke-width:2px;pointer-events:none}.bb-railstrip.p{fill:#d628281f;stroke:#d6282899}.bb-railstrip.n{fill:#1d4ed81f;stroke:#1d4ed899}.terminal.hole .terminal-dot{fill:#3f3a33;stroke:none}.terminal.hole:hover .terminal-dot,.terminal.hole.pending .terminal-dot{fill:var(--yellow);stroke:var(--blue);stroke-width:3px}.terminal.hole.peer .terminal-dot{fill:var(--green)}.terminal.hole.fault .terminal-dot{fill:#f08c00}.tree{opacity:.55}.branches{border-collapse:collapse;width:100%;margin-top:10px;font-size:.95rem}.branches caption{text-align:left;color:var(--blue-dark);font-weight:800}.branches th,.branches td{border-top:1px solid var(--line);text-align:left;padding:4px 8px}.branches .num{font-variant-numeric:tabular-nums;font-weight:800}.branches tr[data-state=reversed] td,.branches tr[data-state=missing-resistor] td{color:#b45309}.branches tr.total th,.branches tr.total td{border-top:2px solid var(--ink)}.check{align-items:center;gap:8px;min-height:44px;display:flex}.check input{width:22px;height:22px}.field{margin-top:8px;font-weight:700;display:block}.side-panel select#scene{border:2px solid var(--line);border-radius:10px;width:100%;min-height:44px;padding:6px 10px}@media (width<=600px){.branches td:nth-child(2){display:none}}.bb-handle{fill:#cfc7b5;cursor:grab}.comp.selected .bb-handle{fill:var(--blue)}.bb-handle-text{text-anchor:middle;fill:var(--ink);pointer-events:none;font-size:22px;font-weight:800}.comp.selected .bb-handle-text{fill:#fff}
