#sld{font-family:Inter,Segoe UI,Arial,sans-serif;color:#203247;background:#f2f5f8;font-size:13px}#sld *{box-sizing:border-box}#sld{margin:0}#sld .sld-heading{min-height:100px;background:#fff;border-bottom:1px solid #dce4ed;padding:18px 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}#sld .brand{font-size:11px;color:#177b73;letter-spacing:2px;font-weight:800}#sld h1{font-size:23px;margin:5px 0}#sld .subtitle,#sld .hint{color:#6c7d8e;font-size:12px}#sld .hint{line-height:1.65}#sld h2{font-size:12px;text-transform:uppercase;letter-spacing:1px;margin:22px 0 12px}#sld h2:first-child{margin-top:0}#sld button,#sld input,#sld select{font:inherit}#sld button{background:#fff;border:1px solid #ccd7e2;border-radius:6px;padding:8px 11px;color:#30475b;cursor:pointer}#sld button:hover{background:#edf6f5;border-color:#429f95}#sld button:disabled{opacity:.45;cursor:default}#sld .primary{background:#137e72;color:white;border-color:#137e72}#sld .actions{display:flex;gap:7px;flex-wrap:wrap}#sld .sld-layout{display:grid;grid-template-columns:230px minmax(400px,1fr) 278px;height:calc(100vh - 101px);min-height:600px}#sld .sld-side{background:white;padding:18px;overflow:auto}#sld .library{border-right:1px solid #dce4ed}#sld .properties{border-left:1px solid #dce4ed}#sld input:not([type=checkbox]),#sld select{padding:7px;border:1px solid #ccd7e2;border-radius:5px;max-width:100%;background:white;color:#203247}#sld .library input{width:100%;margin-bottom:10px}#sld .equipment{display:flex;align-items:center;border:1px solid #e0e7ee;border-radius:6px;margin-bottom:6px;padding:5px 7px;gap:8px;cursor:grab}#sld .equipment svg{width:35px;height:35px;flex-shrink:0}#sld .equipment span{flex:1}#sld .equipment button{padding:2px 7px}#sld .device{padding:10px 8px;border-bottom:1px solid #edf0f4;cursor:grab}#sld .device small{display:block;color:#76879b;margin-top:5px}#sld .device.assigned{background:#eff8f6}#sld .workspace{display:flex;flex-direction:column;min-width:0}#sld .toolbar{padding:12px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:white;border-bottom:1px solid #dce4ed}#sld .toolbar label{font-size:12px}#sld .pill{color:#137e72;background:#e4f4ef;padding:5px 9px;border-radius:15px;font-size:11px}#sld .canvas-scroll{overflow:auto;flex:1;background:#f8fafc}#sld #sld-canvas{display:block;touch-action:none;user-select:none}#sld .layer-bg{fill:transparent;stroke:#e1e8ef;stroke-dasharray:4 6}#sld .layer-bg.active{fill:#e4f4ef;fill-opacity:.4}#sld .layer-label{fill:#718398;font-size:12px;font-weight:600;letter-spacing:1px}#sld .node{cursor:move}#sld .node .selection{fill:white;fill-opacity:.85;stroke:transparent}#sld .node.selected .selection{stroke:#169384;stroke-dasharray:4 3;fill:#f0faf7}#sld .symbol{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#sld .symbol text{fill:currentColor;stroke:none;font:10px Segoe UI,Arial,sans-serif}#sld .node-label{font-size:12px;fill:#263e53;font-weight:600}#sld .node-value{font-size:11px;fill:#61758b}#sld .terminal{fill:white;stroke:#218e81;stroke-width:1.6;cursor:crosshair}#sld .terminal.pending{fill:#f3ad36}#sld .edge{fill:none;stroke:#344b61;stroke-width:2;cursor:pointer}#sld .edge.control{stroke:#805bc5;stroke-dasharray:7 5}#sld .edge.metering{stroke:#397da5;stroke-dasharray:2 5}#sld .edge.selected{stroke:#e69b23;stroke-width:3}#sld .edge-hit{fill:none;stroke:transparent;stroke-width:15;cursor:pointer}#sld footer{padding:10px 14px;background:white;display:flex;justify-content:space-between;border-top:1px solid #dce4ed;font-size:11px;gap:12px}#sld .field{display:block;margin:13px 0}#sld .field>span{display:block;font-size:12px;color:#61758b;margin-bottom:6px}#sld .field input:not([type=checkbox]),#sld .field select{width:100%}#sld .check{display:block;margin:9px 0;font-size:12px}#sld .stack{display:grid;gap:7px}#sld .danger{color:#b63743}#sld #sld-issues{padding-left:17px;font-size:12px;line-height:1.7;color:#836323}#sld .empty{padding:15px 0;color:#718398;line-height:1.7}#sld a{color:#137e72}@media(max-width:1050px){#sld .sld-layout{grid-template-columns:190px minmax(320px,1fr) 240px}#sld .sld-heading{align-items:flex-start;padding:15px}#sld .actions{max-width:340px}}@media(max-width:750px){#sld .sld-layout{grid-template-columns:165px minmax(320px,1fr);height:auto}#sld .workspace{height:800px}#sld .properties{grid-column:1/-1;border-top:1px solid #dce4ed}#sld .sld-heading{flex-direction:column}#sld .actions{max-width:none}}

#sld[hidden]{display:none}#sld .sld-layout{height:75vh;min-height:650px}#sld .sld-side{position:static;width:auto;display:block;min-width:0}#sld .sld-heading{position:static}#sld label{display:block;margin:0}#sld .toolbar label{display:flex;align-items:center;gap:5px}#sld input[type=checkbox]{width:auto}#sld .brand{display:none}#sld .node{color:#203247}

#sld .sld-parts-toolbar,#sld .sld-part-settings{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:white;padding:12px;border-bottom:1px solid #dce4ed}
#sld .sld-parts{display:flex;gap:6px;overflow:auto;flex:1;min-width:180px}#sld .sld-parts button{white-space:nowrap}#sld .sld-parts button.active{background:#137e72;color:white}
#sld .sld-part-settings label{display:flex;align-items:center;gap:6px}
#sld .node-timestamp{font-size:10px;fill:#61758b}#sld .freshness-dot[data-freshness=green]{fill:#16803c}#sld .freshness-dot[data-freshness=orange]{fill:#c76a00}#sld .freshness-dot[data-freshness=red]{fill:#c62828}
#sld .sld-extra-properties{border-top:1px solid #dce4ed;margin-top:16px;padding-top:10px}
.freshness-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px;background:white;border:1px solid #dce4ed;border-radius:7px;margin-top:12px}.freshness-controls label{display:flex;align-items:center;gap:8px;margin:0}.freshness-controls input{width:95px}.freshness-legend{display:inline-flex;align-items:center;gap:8px;font-size:12px}
.timestamp-indicator,.freshness-legend i{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;flex-shrink:0;background:#c62828}.timestamp-indicator[data-freshness=green],.freshness-legend i[data-freshness=green]{background:#16803c}.timestamp-indicator[data-freshness=orange],.freshness-legend i[data-freshness=orange]{background:#c76a00}
.live-device-name[data-freshness=green]{color:#16803c}.live-device-name[data-freshness=orange]{color:#c76a00}.live-device-name[data-freshness=red]{color:#c62828}

#sld .sld-zoom-controls{display:inline-flex;align-items:center;gap:7px;flex-shrink:0}#sld .sld-zoom-controls label{display:flex;align-items:center;gap:6px;white-space:nowrap}#sld #sld-zoom{width:85px}#sld #sld-zoom-value{min-width:38px;font-variant-numeric:tabular-nums}#sld #sld-canvas{max-width:none;min-width:0;flex-shrink:0}
#sld .layer-boundary{cursor:row-resize}#sld .boundary-hit{fill:transparent;pointer-events:all}#sld .boundary-line{fill:none;stroke:transparent;stroke-width:3;pointer-events:none}#sld .layer-boundary:hover .boundary-line,#sld .layer-boundary:focus .boundary-line,#sld .layer-boundary.resizing .boundary-line{stroke:#169384}#sld.sld-resizing,#sld.sld-resizing *{cursor:row-resize!important}

#sld.sld-monitor .sld-heading,#sld.sld-monitor .sld-part-settings,#sld.sld-monitor .sld-zoom-controls,#sld.sld-monitor #sld-add-part,#sld.sld-monitor .sld-side,#sld.sld-monitor .workspace>.toolbar,#sld.sld-monitor footer{display:none!important}
#sld.sld-monitor .sld-layout{display:block;height:var(--sld-monitor-height,75vh);min-height:0;margin:0;padding:0}#sld.sld-monitor .workspace{height:100%;min-height:0;margin:0;padding:0;border:0}#sld.sld-monitor .canvas-scroll{width:100%;height:100%;min-height:0;background:#fff;border:0;padding:0}#sld.sld-monitor .sld-parts-toolbar{padding:4px 0;gap:6px;border:0;background:transparent}#sld.sld-monitor .sld-parts{gap:4px;min-width:0}#sld.sld-monitor .sld-parts button{padding:6px 10px;font-size:12px}#sld.sld-monitor .selection{display:none}#sld.sld-monitor .node{cursor:default}#sld.sld-monitor .linked-node{cursor:pointer}#sld.sld-monitor .edge,#sld.sld-monitor .edge-hit{cursor:default;pointer-events:none}#sld #sld-monitor-exit[hidden]{display:none!important}#sld #sld-monitor-exit{padding:6px 10px;font-size:12px;white-space:nowrap}

/* Plant structure: device list grouped by block. */
#sld .device-block-heading{margin:12px 0 2px;font-size:11px;letter-spacing:1px;text-transform:uppercase;color:#137e72}
html[data-content-theme=dark] #sld .device-block-heading{color:#5eead4}
/* Sections from plant structure (sld_generate.py) */
#sld #sld-generate[hidden]{display:none!important}#sld #sld-generate{white-space:nowrap}
.sld-generate-dialog{width:min(620px,92vw);border-radius:10px;padding:20px}.sld-generate-dialog::backdrop{background:#0007}.sld-generate-dialog h2{margin-top:0}.sld-generate-dialog .actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.sld-generate-preview{margin:12px 0;max-height:46vh;overflow:auto}.sld-generate-preview ul{margin:4px 0 10px;padding-left:20px}.sld-generate-preview h3{font-size:14px;margin:10px 0 4px}.sld-generate-preview .sld-generate-error,.sld-generate-preview .sld-generate-attention{padding:8px 12px;border-left:5px solid #d97706;background:rgba(217,119,6,.12)}
/* uifit: between 750 and 900 px the three columns fit the page; the library items keep their + buttons inside the column. */
@media(min-width:751px) and (max-width:900px){#sld .sld-layout{grid-template-columns:190px minmax(260px,1fr) 220px}}
@media(max-width:750px){#sld .sld-layout{grid-template-columns:175px minmax(320px,1fr)}}
@media(max-width:1050px){#sld .sld-side{padding:12px}#sld .equipment{gap:5px;padding:4px 5px}#sld .equipment svg{width:26px;height:26px}}
