.tb-group{display:flex;align-items:center;gap:2px}.tb-group:empty{display:none}.tb-btn{min-width:2rem;height:2rem;padding:0 .5rem;border-radius:.375rem;border:1px solid #cbd5e1;background:#fff;color:#0f172a;font-size:1rem;line-height:1;cursor:pointer}.tb-btn:hover:not(:disabled){background:#f1f5f9}.tb-btn:disabled{opacity:.4;cursor:default}.tb-btn[aria-pressed=true]{background:#0f172a;color:#fff;border-color:#0f172a}.tb-btn:focus-visible,.play-btn:focus-visible,.stop-btn:focus-visible,.picker-item:focus-visible{outline:2px solid #2563eb;outline-offset:1px}@media(prefers-color-scheme:dark){.tb-btn{background:#1e293b;color:#e2e8f0;border-color:#475569}.tb-btn:hover:not(:disabled){background:#334155}.tb-btn[aria-pressed=true]{background:#e2e8f0;color:#0f172a;border-color:#e2e8f0}}.play-btn,.stop-btn{height:2rem;padding:0 .9rem;border-radius:.375rem;font-weight:600;font-size:.875rem;cursor:pointer;border:1px solid transparent}.play-btn{background:#15803d;color:#fff}.play-btn:hover{background:#166534}.stop-btn{background:#b91c1c;color:#fff}.stop-btn:hover{background:#991b1b}.mode-badge{font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#b91c1c;border:1px solid #fecaca;background:#fef2f2;padding:.15rem .5rem;border-radius:999px}[hidden]{display:none!important}.sparked-canvas-host{overflow:hidden;background:#fff}.sparked-canvas{display:block;width:100%;height:100%;touch-action:none;user-select:none;-webkit-user-select:none;color:#111;outline:none;cursor:default}.sparked-canvas:focus-visible{box-shadow:inset 0 0 0 2px #93c5fd}.sparked-canvas text{user-select:none;-webkit-user-select:none}.sparked-canvas .layer-rungs,.sparked-canvas .layer-faults,.sparked-canvas .junction,.sparked-canvas .marquee{pointer-events:none}.mode-build .comp .body-hit{cursor:move}.mode-build .term-hit,.is-wiring,.is-placing{cursor:crosshair}.mode-build .wire-hit{cursor:pointer}.mode-build .waypoint{cursor:move}.can-pan,.can-pan *{cursor:grab!important}.is-panning,.is-panning *{cursor:grabbing!important}.wire.selected .wire-line{stroke:#2563eb;stroke-width:2.5}.rail-hit{cursor:crosshair}.canvas-status{position:absolute;left:.75rem;bottom:.75rem;max-width:calc(100% - 1.5rem);pointer-events:none;font-size:.8125rem;color:#0f172a;background:#ffffffeb;border:1px solid #cbd5e1;border-radius:.375rem;padding:.25rem .6rem;opacity:0;transition:opacity .12s}.canvas-status.has-notice{opacity:1}.status-text:empty{display:none}.props-panel{position:absolute;z-index:20;width:248px;padding:.6rem .7rem .7rem;font-size:.8125rem;background:#fff;color:#0f172a;border:1px solid #cbd5e1;border-radius:.5rem;box-shadow:0 8px 24px #0f172a2e}.props-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.4rem}.props-close{border:0;background:none;font-size:1.1rem;line-height:1;cursor:pointer;color:#475569;padding:0 .2rem}.props-row{display:grid;grid-template-columns:86px 1fr;align-items:center;gap:.25rem .5rem;margin:.35rem 0}.props-label{color:#475569}.props-hint{grid-column:2;font-size:.7rem;color:#64748b}.props-row input,.props-row select{width:100%;min-width:0;border:1px solid #cbd5e1;border-radius:.3rem;padding:.2rem .35rem;background:#fff;color:#0f172a}.props-inline{display:flex;align-items:center;gap:.3rem}.props-inline input{flex:1}.props-inline select{width:auto}.picker{display:flex;flex-direction:column;gap:2px}.picker-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.3rem .4rem;border-radius:.375rem;border:1px solid transparent;background:none;text-align:left;font-size:.8125rem;cursor:pointer;color:inherit}.picker-item:hover{background:#f1f5f9;border-color:#e2e8f0}.picker-icon{display:inline-flex;width:52px;justify-content:center;flex-shrink:0;background:#fff;border-radius:.25rem;color:#111}.picker-icon svg{max-width:52px;height:auto}@media(prefers-color-scheme:dark){.picker-item:hover{background:#334155;border-color:#475569}}.mode-simulate .wire.sim-dead .wire-line{stroke:#a8b0bb;stroke-width:1.75}.mode-simulate .wire.sim-live .wire-line{stroke:#d97706;stroke-width:2.5}.mode-simulate .wire.sim-current .wire-line{stroke:#dc2626;stroke-width:3.75}.mode-simulate .comp{color:#5b6470}.mode-simulate .comp.sim-live{color:#b45309}.mode-simulate .comp.sim-current{color:#dc2626}.mode-simulate .comp.sim-on .body{fill:#fee2e2;stroke-width:2.5}.mode-simulate .comp.t-lamp.sim-on{color:#b45309}.mode-simulate .comp.t-lamp.sim-on .body{fill:#fde047;filter:drop-shadow(0 0 5px rgba(250,204,21,.95))}.mode-simulate .comp.t-motor_1ph.sim-on .body,.mode-simulate .comp.t-motor_3ph.sim-on .body{fill:#fecaca}.mode-simulate .comp.sim-tripped{color:#dc2626}.mode-simulate .comp.sim-tripped .body{fill:#fee2e2}.mode-simulate .comp.sim-timing .delay-box{fill:#fef3c7}.mode-simulate .sim-operable .body-hit{cursor:pointer}.mode-simulate .sim-operable:focus{outline:none}.mode-simulate .sim-operable:focus-visible .body-hit{stroke:#2563eb;stroke-width:1.5;stroke-dasharray:3 2}.mode-simulate .comp.sim-pressed .actuator{stroke:#2563eb;stroke-width:2.5}.mode-simulate .junction{fill:#6b7280}.mode-simulate .term-hit,.mode-simulate .wire-hit{cursor:default}.sim-panel{flex:1 1 18rem}.fault-list{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:.15rem}.fault-list li{color:#b91c1c}.fault-list li:before{content:"⚠ "}.fault-list li.ok{color:#15803d}.fault-list li.ok:before{content:""}.play-errors{flex:1 1 100%;color:#b91c1c}.play-errors ul{margin:.2rem 0 0 1rem;list-style:disc}.views[data-view=control] .power-pane,.views[data-view=power] #control-view{display:none}.views[data-view=split] .view-pane{display:block}.power-pane{overflow:auto}.power-pane .pv-head{position:sticky;top:0;padding:.4rem .7rem;font-size:.75rem;color:#475569;background:#f8fafc;border-bottom:1px solid #e2e8f0}.power-pane svg{display:block;margin:.5rem auto;color:#111}.pv-on .pv-line,.pv-on.pv-line{stroke:#dc2626;stroke-width:3.5}.pv-dead.pv-line{stroke:#a8b0bb}.pv-motor.pv-on .body{fill:#fecaca;stroke:#dc2626}.pv-tripped .body{fill:#fee2e2;stroke:#dc2626}#toolbar-file{position:relative}.storage-pop{position:absolute;top:calc(100% + 6px);left:0;z-index:40;width:16rem;padding:.75rem;border:1px solid #cbd5e1;border-radius:.5rem;background:#fff;color:#0f172a;box-shadow:0 8px 24px #0f172a26}.storage-list{display:flex;flex-direction:column;gap:.25rem;max-height:16rem;overflow-y:auto}.storage-list li{display:flex;gap:.25rem}.storage-open{flex:1;text-align:left;font-size:.8rem;padding:.25rem .5rem;border-radius:.25rem}.storage-open:hover,.storage-open:focus-visible{background:#fef3c7}.storage-del{font-size:.75rem;padding:0 .4rem;color:#64748b;border-radius:.25rem}.storage-del:hover,.storage-del:focus-visible{color:#b91c1c;background:#fee2e2}.palette-heading{margin:.5rem 0 .25rem;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#475569}.picker-item.is-locked{opacity:.55;cursor:not-allowed}.palette-ceiling{margin-top:.5rem;padding:.5rem;font-size:.75rem;border-radius:.375rem;background:#fef3c7;color:#78350f}.palette-ceiling a{display:inline-block;margin-top:.25rem;font-weight:600;text-decoration:underline}#ai-drawer{background:#fff;color:#0f172a}.ai-drawer{padding:.9rem;font-size:.85rem;display:flex;flex-direction:column;gap:.75rem}.ai-drawer h2{font-size:1rem;font-weight:700}.ai-drawer h3{font-size:.8rem;font-weight:700;margin-top:.5rem}.ai-drawer form{display:flex;flex-direction:column;gap:.4rem;padding:.6rem;border:1px solid #e2e8f0;border-radius:.5rem}.ai-drawer label{font-weight:600}.ai-drawer textarea{width:100%;border:1px solid #cbd5e1;border-radius:.375rem;padding:.4rem;font:inherit}.ai-drawer input[type=file]{font-size:.75rem;max-width:100%}.ai-drawer button{align-self:flex-start;padding:.35rem .8rem;border-radius:.375rem;background:#0f172a;color:#fff;font-weight:600}.ai-drawer button:disabled{opacity:.45;cursor:not-allowed}.ai-drawer [data-ai=discard]{background:#e2e8f0;color:#0f172a;margin-top:.25rem}.ai-drawer [data-ai=demo-label],.ai-drawer [data-ai=gate]{padding:.5rem;border-radius:.375rem;background:#fef3c7;color:#78350f;font-weight:600}.ai-drawer [data-ai=status]:empty{display:none}.ai-drawer ul{list-style:disc;padding-left:1.2rem;max-height:10rem;overflow-y:auto;font-size:.75rem}.ai-drawer [data-ai=reviewed]{margin-right:.35rem}@media(max-width:640px){.toolbar,.tb-group[aria-label=Zoom]{flex-shrink:0}#btn-zoom-out,#btn-zoom-in,#btn-fit{min-width:44px;height:44px}#palette{width:4.25rem;padding:.25rem}#palette .picker-label,#palette .palette-heading{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}#palette .palette-ceiling{font-size:.65rem;padding:.3rem}#ai-drawer{position:absolute;inset:0 0 0 auto;width:min(20rem,100%);z-index:30}}
