#plcWorkshop{padding:26px;background:#f3f7fa;color:#0b2740;min-height:100vh}
.plc32-title{display:flex;justify-content:space-between;gap:24px;align-items:center;margin-bottom:18px}.plc32-title h1{font-size:clamp(28px,4vw,46px);margin:2px 0 6px}.plc32-title p{margin:0;color:#587086}.plc32-title>span{background:#e6faf4;color:#087d62;border:1px solid #a8e4d4;border-radius:999px;padding:10px 16px;font-weight:800;white-space:nowrap}
.plc32-actions,.plc32-toolbar,.plc32-project-buttons{display:flex;flex-wrap:wrap;gap:9px}.plc32-actions{margin-bottom:14px}.plc32-actions button,.plc32-project-buttons button,.plc32-add-rung,.plc32-rung header button,.plc32-inspector button{border:1px solid #bfd0dd;background:white;color:#18344c;border-radius:9px;padding:10px 14px;font-weight:800;cursor:pointer}.plc32-actions .primary{background:#079c77;color:white;border-color:#079c77}.plc32-actions>span{margin-left:auto;background:#e8eff4;border-radius:99px;padding:10px 15px;font-weight:800;font-size:13px}.plc32-running .plc32-toolbar,.plc32-running .plc32-project-buttons,.plc32-running .plc32-add-rung,.plc32-running .plc32-rung header div{pointer-events:none;opacity:.45}
.plc32-help{display:flex;align-items:center;gap:12px;background:white;border:1px solid #d2e0e9;border-radius:13px;padding:14px 18px;margin-bottom:16px;box-shadow:0 5px 18px #173b5810}.plc32-help span{background:#eef5f8;border-radius:8px;padding:7px 10px}.plc32-help i{color:#169d7e}
.plc32-shell{display:grid;grid-template-columns:230px minmax(600px,1fr) 230px;gap:14px;align-items:start}.plc32-panel,.plc32-work,.plc32-status{background:white;border:1px solid #d2e0e9;border-radius:14px;box-shadow:0 8px 24px #1938500e}.plc32-panel{padding:15px;position:sticky;top:12px}.plc32-panel header,.plc32-status header{border-bottom:1px solid #e0e8ee;padding-bottom:10px;margin-bottom:12px}.plc32-panel h2,.plc32-status h2{font-size:17px;margin:0}.plc32-panel header small{color:#6b7f90}.plc32-panel>div>p{color:#718494;font-size:13px}
.plc32-work{padding:14px;min-width:0;overflow:hidden}.plc32-toolbar{background:#0d3045;border-radius:12px;padding:10px;margin-bottom:10px}.plc32-toolbar button{min-width:90px;min-height:58px;border:1px solid #31556b;border-radius:8px;background:#173f56;color:white;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer}.plc32-toolbar button b{font-family:Consolas,monospace;color:#c5eaf5;font-size:18px}.plc32-toolbar button span{font-size:11px}.plc32-toolbar button.active{background:#0aa67e;border-color:#70e5c6;box-shadow:0 0 0 3px #12c69a35}.plc32-project-buttons{margin:9px 0}.plc32-project-buttons button{padding:8px 11px;font-size:12px}
.plc32-inspector{min-height:48px;background:#eef5f8;border:1px solid #cbdce6;border-radius:10px;padding:9px 12px;margin:10px 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px}.plc32-inspector label{display:flex;align-items:center;gap:6px;font-weight:700}.plc32-inspector select,.plc32-inspector input{background:white;border:1px solid #afc6d5;border-radius:7px;padding:7px;color:#0b2740}.plc32-inspector .danger,.plc32-rung .danger{color:#b23030;border-color:#e6b6b6}
.plc32-rung{border:1px solid #c8d9e4;border-radius:12px;margin:12px 0;overflow:hidden;background:#fbfdfe}.plc32-rung>header{height:auto;min-height:42px;background:#edf4f7;display:flex;align-items:center;gap:12px;padding:7px 10px}.plc32-rung>header>b{font-size:15px}.plc32-rung>header>span{color:#687d8d;font-size:12px}.plc32-rung>header>div{margin-left:auto;display:flex;gap:5px}.plc32-rung>header button{padding:5px 8px;font-size:12px}.plc32-grid{display:block;width:100%;min-width:780px;height:auto;background-color:#fff;background-image:radial-gradient(#c4d4de 1px,transparent 1px);background-size:23px 23px;touch-action:none}.plc32-rung{overflow-x:auto}.plc32-grid .rail{stroke:#16394f;stroke-width:7}.plc32-grid .wire,.plc32-grid .contact,.plc32-grid .coil{stroke:#18384d;stroke-width:4;fill:none;stroke-linecap:round}.plc32-grid .wire.live,.plc32-grid .contact.live,.plc32-grid .coil.live{stroke:#08b783;filter:drop-shadow(0 0 3px #29e9af)}.plc32-grid .empty{stroke:#d5e1e8;stroke-width:2;stroke-dasharray:5 6}.plc32-grid .plus{fill:#9fb3c0;font-size:15px;font-weight:900;text-anchor:middle;pointer-events:none}.plc32-grid .hit{fill:transparent;cursor:crosshair}.plc32-grid .slot:hover .empty{stroke:#30b697;stroke-width:3}.plc32-grid .slot.selected .hit{fill:#13b98c16;stroke:#12a77f;stroke-width:2}.plc32-grid .node{fill:#abc0cc}.plc32-grid .node.live{fill:#08b783}.plc32-grid .tag{fill:#0d3045;font-size:13px;font-weight:800;text-anchor:middle}.plc32-grid .coil-letter{fill:#0d3045;font-size:13px;font-weight:900;text-anchor:middle}.plc32-add-rung{width:100%;border-style:dashed;margin-top:4px;background:#edf9f5;color:#087d62}
.plc32-io{display:grid;grid-template-columns:40px 1fr 28px;gap:8px;align-items:center;border:1px solid #d5e1e8;border-radius:10px;padding:9px;margin:8px 0;background:#f8fbfc}.plc32-io>button,.plc32-io>i{width:30px;height:30px;border-radius:50%;border:3px solid #aec1cc;background:#dfe8ed;box-shadow:inset 0 0 0 4px white}.plc32-io>button{cursor:pointer}.plc32-io span{display:flex;flex-direction:column}.plc32-io small{color:#6d8292}.plc32-io>strong{text-align:center}.plc32-io.on{background:#e4faf3;border-color:#69d5b9}.plc32-io.on>button,.plc32-io.on>i{background:#0bbb86;border-color:#087e61;box-shadow:0 0 9px #0bbb86}.plc32-motor{margin-top:14px;border-radius:12px;background:#e8eef2;padding:16px;text-align:center}.plc32-motor i{display:block;font-style:normal;font-size:42px}.plc32-motor.on{background:#dcf8ee;color:#087d62}.plc32-motor.on i{animation:plcSpin .8s linear infinite}@keyframes plcSpin{to{transform:rotate(360deg)}}
.plc32-status{margin-top:16px;padding:16px}.plc32-status header{display:flex;justify-content:space-between}.plc32-status p{margin:5px 0}.plc32-status .bad{color:#aa2626}.plc32-status .warn{color:#875b05}
@media(max-width:1450px){.plc32-shell{grid-template-columns:190px minmax(560px,1fr)}.plc32-shell>.plc32-panel:last-child{grid-column:1/-1;position:static}.plc32-shell>.plc32-panel:last-child #plc32Bits{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}}
@media(max-width:1000px){#plcWorkshop{padding:14px 10px 96px}.plc32-title{align-items:flex-start;flex-direction:column}.plc32-title>span{white-space:normal}.plc32-actions>span{margin-left:0}.plc32-help{align-items:flex-start;overflow-x:auto}.plc32-help span,.plc32-help i{white-space:nowrap}.plc32-shell{display:flex;flex-direction:column}.plc32-panel,.plc32-work{width:100%;position:static}.plc32-panel:first-child{order:1}.plc32-work{order:2}.plc32-panel:last-child{order:3}.plc32-toolbar{flex-wrap:nowrap;overflow-x:auto}.plc32-toolbar button{flex:0 0 88px}.plc32-rung>header{align-items:flex-start;flex-wrap:wrap}.plc32-rung>header>div{width:100%;margin-left:0}.plc32-status header{display:block}}

/* v0.34: compact rungs, persistent tool palette and explicit run/stop state. */
.plc32-actions .primary.stop{background:#b52f3a;border-color:#b52f3a}
.plc32-work{overflow:visible}
.plc32-toolbar{position:sticky;top:12px;z-index:20;box-shadow:0 8px 20px #0822342b}
.plc32-grid{min-width:620px}
@media(max-width:1000px){.plc32-toolbar{position:sticky;top:8px}.plc32-work{overflow:visible}}

/* v0.35: værktøjslinje og valgt komponent følger samlet med gennem alle rungs. */
.plc32-sticky-tools{position:sticky;top:8px;z-index:20;background:#fff;border-radius:12px;padding-bottom:1px;box-shadow:0 9px 22px #08223426}
.plc32-sticky-tools .plc32-toolbar{position:static;box-shadow:none}
.plc32-sticky-tools .plc32-inspector{margin:8px 10px 10px}
.plc32-actions button:disabled{cursor:default;opacity:.82}
@media(max-width:1000px){.plc32-sticky-tools{top:6px}.plc32-sticky-tools .plc32-toolbar{position:static}}

/* v0.36: kontakter viser deres faktiske åbne/lukkede tilstand. */
.plc32-grid .contact-open{stroke:#c46a22;stroke-width:4}
.plc32-grid .contact-bridge{stroke-width:5}
.plc32-grid .contact-state{font-size:9px;font-weight:900;text-anchor:middle;letter-spacing:.45px}
.plc32-grid .contact-state.open{fill:#b54e18}
.plc32-grid .contact-state.closed{fill:#087f62}

/* v0.37: faste IEC-symboler og udvidede undervisningsblokke. */
.plc32-grid .contact-mark{fill:#17384d;font-size:16px;font-weight:900;text-anchor:middle;pointer-events:none}
.plc32-grid .plc32-block{fill:#edf5f8;stroke:#17384d;stroke-width:3}
.plc32-grid .plc32-block.live{fill:#d9f8ec;stroke:#08b783}
.plc32-grid .block-kind{fill:#0d3045;font-size:11px;font-weight:900;text-anchor:middle;pointer-events:none}
.plc32-grid .block-value{fill:#476477;font-size:8px;font-weight:700;text-anchor:middle;pointer-events:none}
.plc32-io select{max-width:112px;margin-top:5px;border:1px solid #bfd0dd;border-radius:6px;background:#fff;color:#17384d;font-size:10px;padding:3px}
.plc32-toolbar{max-height:158px;overflow:auto}
