/* Engineering workspace. Final, shared geometry for all Ladder conductors. */
:root{--wire:#37455a;--wire-on:#15954c;--wire-width:2px}
.workspace{background:#dfe2e7}.view{padding:12px}.work-header h2{font-size:20px}.work-header p{font-size:12px}.work-header{margin-bottom:12px}
.block-editor-meta,.ladder-editor,.table-card{border-radius:0;box-shadow:none}.block-editor-meta{margin-bottom:8px}.editor-toolbar{height:30px;min-height:30px;border-radius:0;background:#d5d8df;font:12px Tahoma,sans-serif;padding:3px 10px}
.block-meta-fields{padding:4px 10px}.block-meta-fields input{height:25px}.ladder-quickbar{min-height:32px;padding:3px 8px}.ladder-layout{gap:8px;grid-template-columns:minmax(0,1fr) 226px}.instruction-palette{grid-column:2;grid-row:1;max-height:calc(100vh - 205px);overflow:auto;border:1px solid #9aa4b0;border-radius:0;background:#f1f1f1;padding:0}.ladder-editor{grid-column:1;grid-row:1;min-width:0;border:1px solid #a0a8b6;background:#f4f5f7}.palette-search{padding:7px;background:#dedfe3}.palette-search input{width:175px}.instruction-palette p{font:11px/1.5 Tahoma,sans-serif;padding:8px;margin:0}
.instruction-group{border-bottom:1px solid #bfc4ce}.instruction-group summary{padding:7px 8px;background:#dfe1e6;cursor:pointer;font:700 12px Tahoma,sans-serif;color:#233d63}.instruction-group button{display:flex;width:100%;align-items:center;gap:8px;min-height:37px;padding:5px 10px;background:#f8f8fa;border:0;border-bottom:1px solid #e3e5e9;border-radius:0;color:#202c41;cursor:grab;text-align:left}.instruction-group button b{min-width:65px;font:12px Consolas,monospace}.instruction-group button small{font:10px/1.3 Tahoma,sans-serif}.instruction-group button:hover{background:#dbeaff}
.ladder-section{border-radius:0;margin:0 0 10px;border:0;border-bottom:1px solid #a7afbc}.section-header{min-height:38px;background:#d6d9e0;padding:4px 12px}.section-header input{font:700 13px Tahoma,sans-serif}.section-header>div>span{font-size:9px}.section-comment{height:29px;padding:3px 38px}.rungs{padding:0;overflow:auto}.rung{padding:24px 20px 8px 28px!important;min-height:130px;background:#fff;border-radius:0;overflow:visible;box-sizing:border-box}.rung-number{top:6px;font:10px Tahoma,sans-serif}.rung-circuit{position:relative;display:grid!important;grid-template-columns:2px minmax(var(--logic-min),1fr) 152px!important;gap:0!important;align-items:start!important;min-width:calc(var(--logic-min) + 154px);height:var(--row-height)!important;padding:0!important;margin:0!important;overflow:visible!important}
.rung-circuit>.power-rail{height:calc(var(--row-height) - 32px)!important;width:2px!important;margin:0!important;align-self:start!important;background:var(--wire)!important;box-shadow:none!important;border:0!important;border-radius:0}
.logic-area{position:relative!important;display:block!important;min-height:var(--row-height)!important;padding:0!important;margin:0!important;overflow:visible!important;min-width:0}
.main-path,.parallel-row,.output-path{position:relative;display:flex!important;flex-wrap:nowrap!important;align-items:start!important;height:64px!important;min-height:64px!important;margin:0!important;padding:0!important;border:0!important;gap:0!important;overflow:visible!important;box-sizing:border-box}
.parallel-row{position:absolute!important;min-width:0!important;max-width:none!important;margin:0!important;align-self:auto!important}.parallel-row:before,.parallel-row:after,.main-path:before{display:none!important}.parallel-row .branch-select-target{top:22px;bottom:auto;left:-7px;height:20px;width:14px}.branch-node-rail{top:31px!important;width:2px!important;margin:0!important;background:var(--wire)!important;box-shadow:none!important;z-index:2}
.ladder-element{flex:0 0 118px!important;width:118px!important;min-width:118px!important;max-width:118px!important;height:64px!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#fff!important;align-self:start!important;box-shadow:none!important;position:relative!important}
.contact-drop{position:relative!important;flex:0 0 34px!important;width:34px!important;min-width:34px!important;max-width:34px!important;height:64px!important;margin:0!important;padding:0!important;align-self:start!important}
.contact-drop:before,.coil-drop:before{top:31px!important;height:2px!important;background:var(--wire)!important;box-shadow:none!important}.contact-drop .insert-hint{top:32px!important}.parallel-row.closed>.contact-drop:last-of-type{width:34px!important;min-width:34px!important}
.element-symbol{top:16px!important;left:0!important;right:0!important;height:32px!important;width:118px!important;padding:0!important;background:#fff!important;border:0!important;box-shadow:none!important}.element-address{top:0!important;height:16px!important;font:10px/16px Consolas,monospace;color:#247b9b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.element-name{top:48px!important;height:16px!important;font:11px/16px Consolas,monospace}.variable-label{font:11px/16px Consolas,monospace!important;padding:0!important;height:16px;border:0!important;background:transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:116px!important}.variable-picker{width:116px!important;height:23px!important;font:11px Consolas,monospace}
.ladder-svg,.coil-element .coil-svg{width:118px!important;min-width:118px!important;height:32px!important;overflow:visible;shape-rendering:geometricPrecision}.ladder-svg path{stroke:var(--wire)!important;stroke-width:2!important;vector-effect:non-scaling-stroke;stroke-linecap:butt;filter:none!important}.ladder-svg text{font:10px Consolas,monospace;text-anchor:middle;fill:var(--wire)}
.path-wire,.branch-wire,.output-wire,.open-tail{flex:1 1 auto!important;min-width:0!important;height:2px!important;margin:31px 0 0!important;align-self:start!important;background:var(--wire)!important;box-shadow:none!important;border:0!important}.path-wire{min-width:0!important}.branch-wire{min-width:0!important}.close-branch{margin:18px 0 0!important;flex:0 0 24px!important;position:absolute!important;right:-24px;top:0}
.output-area{position:relative!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:start!important;margin:0!important;padding:0!important;min-height:64px;height:auto!important;align-self:start!important}.output-path{width:152px!important}.output-path .output-wire{flex:0 0 34px!important;width:34px!important}.output-area.parallel-outputs:before{top:31px!important;bottom:33px!important;width:2px!important;background:var(--wire)!important}.output-area.has-outputs>.coil-drop{position:absolute!important;top:0;left:0;width:24px!important;height:64px!important;min-height:64px!important;opacity:0!important;z-index:3}.output-area.has-outputs>.coil-drop:last-child{top:calc(100% - 18px);height:36px!important;min-height:36px!important;width:100%!important}.output-area.has-outputs>.coil-drop:before{display:none!important}.output-area:not(.has-outputs)>.coil-drop{height:64px!important;min-height:64px!important}.output-area.has-outputs>.coil-drop:hover,body.dragging-coil .output-area.has-outputs>.coil-drop{opacity:1!important;height:36px!important;min-height:36px!important}.output-area.has-outputs>.coil-drop:hover span{opacity:1}
.ladder-element.selected-element .element-symbol{outline:1px solid #1478dd!important;outline-offset:2px;border-radius:2px}.ladder-element.active .ladder-svg path{stroke:var(--wire-on)!important;filter:none!important}.ladder-element.active .element-address,.ladder-element.active .variable-label{color:#087e36!important;text-shadow:none!important}.power-rail.powered,.path-wire.powered,.output-wire.powered,.branch-node-rail.powered,.parallel-row.powered .branch-wire{background:var(--wire-on)!important;box-shadow:none!important}.contact-drop.powered:before,.parallel-row.powered .contact-drop:before{background:var(--wire-on)!important;box-shadow:none!important}.ladder-element.active{background:#fff!important}.instruction-element .element-name{color:#36507d}
.device-tree{margin:0;background:#e5e5e5;border-bottom:1px solid #fff;font:12px Tahoma,sans-serif}.device-tree>summary{padding:4px 4px 4px 21px;cursor:pointer;color:#152d54}.device-tree>summary #miniMode{float:right;font:10px Consolas,monospace;padding:2px 6px;background:#ccd0d5}.device-links{display:grid;padding-left:40px}.device-links button{border:0;background:transparent;text-align:left;font:11px Tahoma,sans-serif;padding:3px;cursor:pointer}.device-links button:hover{background:#bed6f5}.mini-plc{margin:5px 12px 8px 26px;border:1px solid #3e4a54;background:#566976;color:#fff;padding:8px;box-shadow:inset 0 0 0 3px #75848d}.mini-plc header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:10px}.mini-plc button{cursor:pointer}.mini-plc header button{border:0;background:#d4dee5;color:#1d3850;width:22px}.mini-status{display:flex;gap:7px;align-items:center;font:10px Consolas,monospace}.mini-status i{width:8px;height:8px;background:#edb73e;border-radius:50%}.mini-status i.on{background:#52f35b;box-shadow:0 0 5px #27ed50}.mini-plc>label{display:block;font-size:8px;margin:10px 0 3px;color:#dfebf3}.mini-io{display:grid;grid-template-columns:repeat(8,1fr);gap:4px}.mini-channel{padding:1px!important;border:0;background:transparent;color:white;display:grid;justify-items:center;gap:2px;min-width:0}.mini-channel i{width:7px;height:7px;background:#33434b;border:1px solid #a7b4bc;display:block}.mini-channel.on i{background:#63f348;box-shadow:0 0 5px #53ea37}.mini-channel small{font:8px Consolas,monospace}.mini-plc footer{display:flex;gap:4px;margin-top:10px}.mini-plc footer button{font:9px Tahoma,sans-serif;padding:3px 5px;border:1px solid #899ba7;background:#dce4e9;color:#19324b}.mini-plc footer button:disabled{opacity:.4}.device-tree:not([open]) .mini-plc{display:none}.tree-static:has(+.device-tree){cursor:pointer}
#variableTables .tree-row{padding-left:17px;font-size:11px}.engineering-title{background:#2f3850;color:white;padding:6px 10px;font:12px Tahoma,sans-serif}.engineering-tabs{display:flex;gap:3px;align-items:center;background:#c9cbd2;border-bottom:1px solid #999;padding:4px 6px 0}.engineering-tabs button{border:1px solid #939aa4;border-bottom:0;background:#ddd;padding:4px 12px;font:12px Tahoma,sans-serif;cursor:pointer}.engineering-tabs button.selected{background:#f7f7f7;font-weight:bold}.engineering-tabs span{margin-left:auto;font:11px Tahoma,sans-serif;padding:0 8px 4px}.tag-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:7px;background:#dedee1;border-bottom:1px solid #a0a3aa;font:11px Tahoma,sans-serif}.tag-tools button{padding:4px 8px;border:1px solid #9fa9b6;background:#f7f7fa;cursor:pointer}.tag-tools input,.tag-tools select{border:1px solid #9ca5af;background:white;padding:3px;font:11px Tahoma,sans-serif}.tag-tools>span{margin-left:auto}.tag-table-scroll{overflow:auto;min-height:250px;max-height:calc(100vh - 380px);background:#eceef0}.tag-table{border-collapse:collapse;table-layout:auto;width:100%;min-width:1260px;font:11px Tahoma,sans-serif;background:#f1f2f4}.tag-table th{position:sticky;top:0;z-index:3;background:linear-gradient(#f4f4f4,#c9cbd0);color:#222;font-weight:normal;text-align:left;white-space:nowrap;height:24px;padding:3px 5px;border:1px solid #aeb4be}.tag-table td{border:1px solid #d2d6de;padding:0 3px;height:25px!important;min-height:25px!important}.tag-table tr.selected-tag{background:#d7e6ff}.tag-table input:not([type=checkbox]),.tag-table select{width:100%;min-width:65px;max-width:220px;height:23px;padding:1px 3px;border:1px solid transparent;border-radius:0;background:transparent;color:#14243c;font:11px Tahoma,sans-serif;outline:none}.tag-table input:focus,.tag-table select:focus{background:white;border-color:#467cc2}.tag-table td:first-child{width:26px;color:#798493;text-align:center}.tag-table input[type=checkbox]{display:block;width:13px;height:13px;margin:auto;accent-color:#1478aa}.tag-table .key-binding{font:10px Tahoma,sans-serif;min-width:66px;height:20px;padding:1px 4px;border:1px solid #a7b5c6;border-radius:0;background:#f2f5fa;color:#284766}.tag-table .value-switch{display:flex!important;align-items:center;gap:5px;width:76px!important;min-width:76px;height:21px!important;background:#e0e3e7;border:1px solid #abb3bf;border-radius:0;padding:2px 4px!important;position:relative}.tag-table .value-switch i{position:static!important;display:block;width:10px;height:10px;transform:none!important;background:#7c8c9d;border-radius:50%;box-shadow:none}.tag-table .value-switch.on i{background:#27bd44}.tag-table .value-switch span{font:10px Consolas,monospace}.tag-table .value-switch.on{background:#e8f6e9}.tag-table .value-switch:disabled{opacity:1}.tag-table .delete-row{font-size:14px;border:0;background:transparent;cursor:pointer}.tag-properties{margin-top:6px;border:1px solid #a5abb5;background:#e6e7eb;min-height:160px}.tag-properties #tagProperties{padding:12px 20px;font:12px Tahoma,sans-serif}.tag-properties dl{display:grid;grid-template-columns:100px 1fr;gap:5px 12px;padding-top:8px}.tag-properties dt{color:#566477}.tag-properties dd{margin:0;background:#fafafa;border:1px solid #c4cad2;padding:2px 6px}
.plc-dialog{width:70vw;max-width:95vw;max-height:93vh;overflow:auto;resize:both}.plc-zoom{display:flex;align-items:center;gap:6px}.plc-zoom input{width:100px}.plc-zoom output{min-width:32px}.io-channel{touch-action:none}.io-channel b{font:9px Tahoma,sans-serif}.plc-dialog .plc-console>footer{flex-wrap:wrap;gap:10px}.plc-dialog .io-grid{grid-template-columns:repeat(6,minmax(30px,1fr))}.instruction-dialog,.diagnostic-dialog{border:1px solid #828d9e;border-radius:0;padding:0;max-width:550px;width:95vw;background:#eef0f3}.instruction-dialog header{display:flex;align-items:center;justify-content:space-between;background:#ccd2dd;padding:10px 16px}.instruction-dialog #instructionFields{display:grid;gap:9px;padding:16px}.instruction-dialog label{display:grid;grid-template-columns:170px 1fr;align-items:center;font:12px Tahoma,sans-serif}.instruction-dialog input,.instruction-dialog select{min-width:0;padding:6px;border:1px solid #aab6c8;background:white}.instruction-dialog p{font:11px/1.5 Tahoma,sans-serif;padding:0 16px 10px;color:#53647b}.instruction-dialog footer{display:flex;justify-content:end;gap:8px;padding:12px;background:#dfe2e9}.instruction-dialog button,.diagnostic-dialog button{padding:5px 12px;border:1px solid #a0abbd;background:#f9fafc;cursor:pointer}.diagnostic-dialog form{padding:20px}.diagnostic-dialog li{margin:8px 0;font:12px/1.5 Tahoma,sans-serif}.diagnostic-dialog h2{font-size:17px}
.mini-plc{display:block!important;width:auto!important;height:auto!important;grid-template-columns:none!important;border-radius:0!important}.output-area.has-outputs>.coil-drop{pointer-events:none!important}.output-area.has-outputs>.coil-drop:last-child{top:calc(100% + 4px)!important}body.dragging-coil .output-area.has-outputs>.coil-drop{pointer-events:auto!important}
.device-tree>summary{display:flex;align-items:center;gap:5px;list-style:none}.device-tree>summary:before{content:'▾';font-size:10px}.device-tree:not([open])>summary:before{content:'▸'}.device-tree>summary .tree-icon{display:inline-grid;flex:none}.device-tree>summary #miniMode{margin-left:auto;float:none}.mini-plc .mini-channel:not(.on) i{background:#33434b;box-shadow:none}.mini-plc .mini-status i:not(.on){background:#edb73e;box-shadow:none}.instruction-palette[hidden]{display:none!important}
.workbench-actions{display:flex;gap:4px;align-items:center;margin-left:auto;white-space:nowrap}.workbench-actions button{font:11px Tahoma,sans-serif;min-width:25px}.catalog-dialog{width:min(1000px,95vw);max-height:85vh;overflow:auto;padding:20px;border:1px solid #8f99aa;border-radius:0;background:#f1f2f5}.catalog-dialog header{display:flex;gap:10px;align-items:center}.catalog-dialog header input{flex:1;padding:6px}.catalog-dialog table{width:100%;font:11px Tahoma,sans-serif;border-collapse:collapse}.catalog-dialog td,.catalog-dialog th{padding:5px;border:1px solid #c8ced8;text-align:left}.catalog-dialog th{background:#d7dce5}.catalog-dialog p{font:12px/1.5 Tahoma,sans-serif}.cpu-running .tag-table input[data-field=value]{opacity:1}
#compileProgram{display:inline-flex;gap:4px;align-items:center}
@media(max-width:1050px){.ladder-layout{grid-template-columns:minmax(0,1fr) 185px}.palette-search input{width:135px}.instruction-group button{display:block}.instruction-group button small{display:block}.app-shell{grid-template-columns:255px minmax(0,1fr)}}
@media(max-width:720px){.app-shell{grid-template-columns:1fr}.ladder-layout{grid-template-columns:minmax(0,1fr)}.instruction-palette{grid-column:1;grid-row:2;max-height:220px}.instruction-group button{display:inline-block;width:145px}.view{padding:5px}.block-meta-fields{grid-template-columns:1fr}.plc-dialog{width:94vw!important}.tag-properties dl{grid-template-columns:80px 1fr}.tag-table-scroll{max-height:55vh}}
@media(max-width:720px){.project-nav{z-index:200!important;top:68px!important;bottom:22px!important;box-shadow:none}.project-nav:not(.open){transform:translateX(-105%)!important}.project-nav.open{transform:translateX(0)!important;box-shadow:10px 0 30px #17223866}.project-nav .panel-heading{display:flex;padding:4px 10px}.project-nav .panel-heading>div{display:none}.close-tree{margin-left:auto;background:#ccd3de;color:#152a4b}.top-menu{min-width:0;overflow-x:auto;overflow-y:hidden}.topbar{min-width:0;max-width:100vw}.top-actions{overflow-x:auto;max-width:100vw}.classic-toolbar .tool-label{display:none!important}.top-actions .mobile-tree{position:fixed;right:3px;top:44px;width:27px;height:23px;border-radius:0;z-index:110}.app-shell{overflow:hidden;height:100dvh;min-height:0}.workspace{min-width:0;overflow:auto}.instruction-palette{display:block}.block-editor-meta{z-index:5}.workbench-actions{flex-wrap:wrap}.ladder-quickbar{flex-wrap:wrap}}
