/* Wiring diagrams (static/wiring.js): tool bar, below it the drawing on the left and on the right «Elemente» and the properties of the sheet or
   the selection, as in the HMI (user 26 Oct «gebäudeplan r&i und verdrahtungsplan gleich anordnen wie hmi. plan links … rechts. planbild immer
   a4 quer»); printout (wiring_print.html). The drawing is always A4 landscape (297 : 210, the proportions of the A3 sheet), as large as the
   window allows – at most the height down to the bottom of the window (--wr-reserved, wrHeightUpdate), at least 340 px stay for the right column,
   which takes the rest of the width; the page does not scroll: only the right column scrolls, the drawing zooms (user 26 Oct «palnfenster nicht
   scrollbar, immer maxhöhe») */
main:has(.wr-editor, .wr-pages, .hmi-main) { padding-bottom: 0; }  /* the HMI as well: it reserves its margin itself (wrFillHeight) */
.wr-editor { display: grid; grid-template-columns: minmax(0, max(540px, calc((100vh - var(--wr-reserved, 230px)) * 297 / 210))) minmax(340px, 1fr); gap: 10px; align-items: start; }
.wr-side { min-width: 0; align-self: stretch; contain: size; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; }  /* as high as the drawing */
.wr-palette > .wr-sec { margin: 0; background: var(--card); }
.wr-palette .wr-sec .wr-sec { margin-bottom: 6px; }  /* the groups inside «Elemente» */
.wr-palette .wr-sec .wr-sec > summary { font-size: 12px; padding: 5px 8px; }
.wr-palette .wr-sec .wr-sec-body { margin: 6px 4px 4px; }
.wr-pal-items { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 4px; justify-content: start; }
.wr details.howto[open] > .howto-body { max-height: 35vh; overflow-y: auto; overscroll-behavior: contain; }  /* scrolls in itself: the page stays put */
.wr-pal-btn { position: relative; width: 40px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-items: center; }
.wr-pal-btn:hover { border-color: var(--axis); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.wr-pal-btn.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.wr-pal-n { position: absolute; right: 1px; bottom: 0; font-size: 9px; line-height: 1; color: var(--muted); }
.wr-pal-icon { display: block; }
.wr-pal-icon line, .wr-pal-icon circle, .wr-pal-icon ellipse, .wr-pal-icon rect, .wr-pal-icon path { vector-effect: non-scaling-stroke; stroke-width: 1.2px; }
.wr-pal-icon .wr-pal-pin { fill: #d03b3b; stroke: none; }
.btn.pi .wr-pi-n { font-size: 11px; color: var(--ink-2); }  /* «Aus Anlage»: how many fields would come, beside the symbol */
/* The tool bar of an editor (wiring diagram, P&ID, HMI, InView) is ALWAYS one row (user 30 Oct «bearbeitungsbereich im header muss immer auf
   eine zeile passen»): it never wraps; as it gets narrower, first the words «Ansicht»/«Bearbeiten»/«Variante» go (the tips keep them), then the
   words of the HMI buttons (only the icon; the tools of wiring and P&ID are symbols anyway, user 22 Nov 2026), then the zoom steps (the wheel zooms), and the drop-downs get narrower – on a phone the row scrolls
   sideways instead of wrapping */
/* margins like every settings card (building plan): also with the hints switched off (no «So funktioniert es» above it) the card starts at the
   same height, user 27 Oct «header bei gp zu anderen plänen immernoch unterschiedlich in höhe» */
.wr-toolbar.cfg-card { display: block; margin: 0 0 5px; padding-block: 1px; container-type: inline-size; }  /* compact like the head (style.css .cfg-line) */
.wr-toolbar .cfg-row, .wr-toolbar .wr-bar-sec, .wr-toolbar .wr-group { flex-wrap: nowrap; }
.wr-toolbar .cfg-row > *, .wr-toolbar .wr-bar-sec > *, .wr-toolbar .wr-group > * { flex-shrink: 0; }
.wr-toolbar .cfg-row > .wr-bar-sec, .wr-toolbar .wr-bar-sec > .wr-group { flex-shrink: 1; min-width: 0; }
.wr-toolbar :is(.wr-view-sel, .wr-split > select, .wr-variants select) { flex-shrink: 1; min-width: 72px; }
.wr-toolbar .wr-variants { flex-shrink: 1; min-width: 0; }
/* the groups of symbols (piGroup, user 22 Nov 2026 «symbole anstatt texte»): a group gets narrower with its drop-downs as the sections do, its
   buttons keep their size */
.wr-toolbar .wr-bar-sec > .pi-grp { flex-shrink: 1; min-width: 0; }
.wr-toolbar .pi-row { max-width: 100%; min-width: 0; }
.wr-toolbar .pi-row > * { flex-shrink: 0; }
.wr-toolbar .pi-row > :is(.wr-view-sel, .wr-variants) { flex-shrink: 1; }
.wr-toolbar .cfg-row .btn.pi { padding-inline: 5px; }  /* as compact as elsewhere (style.css .btn.pi) – .cfg-row .btn.small would widen it */
@container (max-width: 1500px) { .wr-toolbar .cfg-head, .wr-toolbar .wr-variants .bar-txt { display: none; } }
@container (max-width: 1250px) { .wr-toolbar .bar-txt { display: none; } }
@container (max-width: 1000px) { .wr-toolbar .wr-zoom-ed > :not(:last-child) { display: none; } }
/* narrow (small window, phone): without ‹ › (the drop-down steps too) and «fit», narrower drop-downs; what still does not fit scrolls sideways –
   nothing shrinks over its neighbour (the legend of the HMI opens below the row, it would be cut off – hence only here) */
@container (max-width: 760px) {
  .wr-toolbar .cfg-row { overflow-x: auto; overscroll-behavior-x: contain; }
  .wr-toolbar .cfg-row > .wr-bar-sec, .wr-toolbar .wr-bar-sec > :is(.wr-group, .pi-grp) { flex-shrink: 0; }
  .wr-toolbar :is(.wr-group, .pi-row) > .nav, .wr-toolbar .wr-zoom-grp { display: none; }
  .wr-toolbar :is(.wr-view-sel, .wr-split > select, .wr-variants select, .wr-grid-sel) { min-width: 0; width: 9ch; }
}
.wr-toolbar .cfg-row { gap: 8px; }
.wr-toolbar .cfg-head { padding-top: 0; }
.wr-bar-sec { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wr-bar-sec + .wr-bar-sec { margin-inline-start: 10px; }
.wr-group { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wr-view-sel { max-width: 190px; }
.wr-split { display: inline-flex; }
.wr-split > .btn { border-start-end-radius: 0; border-end-end-radius: 0; }
.wr-split > select { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; max-width: 140px; }
.wr-bar-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.wr-bar-field { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--ink-2); }
.wr-bar-field select { font-size: 12px; padding: 3px 4px; max-width: 220px; }
.wr-variants select { max-width: 160px; }
.wr-undo, .wr-zoom { display: inline-flex; gap: 4px; }
.wr-zoom-val { font-size: 12px; min-width: 44px; text-align: center; color: var(--ink-2); align-self: center; }
.wr-canvas { position: relative; padding: 0; overflow: hidden; width: 100%; aspect-ratio: 297 / 210; background: #d9d9d4; outline: none; touch-action: none; }
.wr-canvas.wr-kbd:focus { box-shadow: 0 0 0 2px var(--accent); }  /* only when reached with Tab (class set in wrEditor) */
.wr-canvas.wr-on-pin, .wr-canvas.wr-on-pin .wr-svg, .wr-canvas.wr-on-pin .wr-svg * { cursor: crosshair; }  /* over a pin: before «move» of the symbol and «grab» of the wire */
.wr-canvas.wr-panning, .wr-canvas.wr-panning .wr-svg, .wr-canvas.wr-panning .wr-svg * { cursor: grabbing; }
.wr-svg { width: 100%; height: 100%; display: block; user-select: none; }
.wr-svg.wr-placing { cursor: crosshair; }
.wr-svg .wd-sym { cursor: move; }
.wr-svg .wd-wire { cursor: grab; }
.wr-svg .wd-hit { pointer-events: all; }
.wr-svg .wd-wire > .wd-hit, .wr-svg .wd-cmark > .wd-hit, .wr-svg .wd-strip > .wd-hit { stroke-width: var(--wd-hit, 2.4); pointer-events: stroke; }  /* WD_HIT_PX screen pixels at the zoom now (wrHitWidth); the stroke only – «all» took the area a bent wire encloses as well */
/* «HMI-Zeichen» of a P&ID (wrHmiDraw): what the level «Teilanlage» leaves out faded, a mark of the HMI dragged at its item */
.wr-svg .wr-hmi-out { opacity: .22; }
.wr-svg .wr-hmi-marks [data-mark] { cursor: move; }
.wr-svg .wr-hmi-marks [data-mark], .wr-svg .wr-hmi-marks [data-mark] * { pointer-events: all; }
.wr-svg .wr-hmi-halos, .wr-svg .wr-hmi-halos * { pointer-events: none; }
.wr-sel-box { fill: color-mix(in srgb, #2a78d6 8%, transparent); stroke: #2a78d6; stroke-width: 0.35; stroke-dasharray: 1.2 0.8; pointer-events: none; }
.wr-img-handle { fill: #fff; stroke: #2a78d6; stroke-width: 0.35; pointer-events: none; }  /* the size of a picture of a camera (static/wiring.js) */
.wr-sel-wire { fill: none; stroke: #2a78d6; stroke-width: 0.9; stroke-opacity: .55; pointer-events: none; stroke-linejoin: round; }
.wr-pin { fill: #fff; stroke: #d03b3b; stroke-width: 0.25; pointer-events: none; }
.wr-pin-hover { fill: color-mix(in srgb, #d03b3b 25%, transparent); stroke: #d03b3b; stroke-width: 0.35; pointer-events: none; }
.wr-via { fill: #2a78d6; pointer-events: none; }
.wr-loose { fill: none; stroke: #d03b3b; stroke-width: 0.5; pointer-events: none; }
.wr-draft { fill: none; stroke: #2a78d6; stroke-width: 0.45; stroke-dasharray: 1.5 1; pointer-events: none; }
.wr-ghost { opacity: .45; pointer-events: none; }
.wr-frame-sel { fill: color-mix(in srgb, #2a78d6 10%, transparent); stroke: #2a78d6; stroke-width: 0.3; pointer-events: none; }
.wr-svg .wd-cmark { cursor: move; }  /* cable mark: dragged along its connections */
.wr-svg .wd-strip { cursor: move; }  /* frame of a terminal strip: grabbed on its line or tag, moves its terminals */
.wr-strip-draft { stroke: #2a78d6; stroke-width: 0.45; stroke-dasharray: 1.5 1; pointer-events: none; }
.wr-strip-no { fill: none; stroke: #d03b3b; stroke-width: 0.4; pointer-events: none; }  /* crossed, but no room for a terminal there */
.wr-cores { width: 100%; }
.wr-cores td, .wr-cores th { padding: 2px 4px; }
.wr-core-chip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.wr-core-chip i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); display: inline-block; }
.wr-checks li.wr-chk-error::marker { color: #d03b3b; }
.wr-checks li.wr-chk-error a { color: #b02525; }
.wr-checks li.wr-chk-warn::marker { color: #d98a00; }
.wr-checks li.wr-chk-info a { color: var(--ink-2); }
.wr-dialog .wr-in-s { width: 96px; }
.wr-dialog .wr-in-m { width: 110px; }
.wr-dialog .wr-in-cores { min-width: 220px; }
.wr-ctypes td, .wr-ctypes th { padding: 3px 4px; }
.wr-preset-sel { max-width: 320px; }
.wr-panel { display: flex; flex-direction: column; gap: 8px; }
.wr-panel .wr-sec { margin: 0; background: var(--card); }
.wr-sec-body { padding-bottom: 6px; }
.wr-sec-body .field { margin-bottom: 8px; }
.wr-sec-part { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.wr-panel input, .wr-panel select, .wr-panel textarea, .wr-dialog input, .wr-dialog select, .wr-dialog textarea { width: 100%; box-sizing: border-box; }
.wr-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.wr-row select { flex: 1; min-width: 0; width: auto; }
.wr-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wr-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.wr-list-small { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }
.wr-list-small li { margin: 2px 0; }
.wr-data-fields li.on > a { font-weight: 600; }  /* the field opened below */
.wr-canvas .wd-data-row { cursor: pointer; }  /* a row of the box «Maschinendaten»: a click opens that field */
.wr-sec.wr-sub { margin: 0 0 6px; }  /* sub-sections of an item (wrSub): Allgemein, Verknüpfungen */
.wr-sec.wr-sub > summary { font-size: 12px; padding: 4px 8px; }
.wr-sub-set { font-weight: 400; color: var(--muted); }
.wr-plan { width: 100%; }
.wr-plan td, .wr-plan th { padding: 3px 4px; }
.wr-plan .wr-pins-in { width: 70px; }
.wr-plan select { min-width: 0; }
.wr-pages { overflow: auto; height: calc(100vh - var(--wr-reserved, 280px)); min-height: 360px; padding: 10px; background: #d9d9d4; }
.wr-pages.wr-panning { cursor: grabbing; }
.wr-pages-inner { width: calc(100% * var(--wr-zoom, 1)); display: flex; flex-direction: column; gap: 12px; margin: 0 auto; }
.wr-page-box { background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .2); }
.wr-page-box .wd-page { width: 100%; height: auto; display: block; }
.wr-import-group { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 10px; padding: 6px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 12px; }
.wr-import-group legend { font-weight: 600; padding: 0 4px; }
.wr-import-group .check { display: flex; gap: 6px; align-items: center; }
.wr-dialog { min-width: min(640px, 80vw); }
/* symbol editor: the window keeps its height and does not scroll, the drawing takes the room left (zoom instead of scrolling) */
dialog.modal.wr-se-dlg { height: min(calc(100dvh - 48px), 900px); }
dialog.modal.wr-se-dlg > .modal-body { flex: 1; min-height: 0; overflow: hidden; display: flex; padding: 16px 18px; }
dialog.modal.wr-se-dlg > .modal-body::before, dialog.modal.wr-se-dlg > .modal-body::after { content: none; }  /* does not scroll: padding as before */
.wr-se { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); gap: 14px; }
.wr-se-props { min-width: 0; min-height: 0; overflow-y: auto; }
.wr-se-props .wr-sec { margin: 0 0 6px; background: var(--card); }  /* sections of the symbol editor (Symbol, Texte, Kontaktplan or the selection) – compact */
.wr-se-props .wr-sec > summary { font-size: 12px; padding: 4px 8px; }
.wr-se-props .wr-sec-body { margin: 4px 6px 0; padding-bottom: 2px; }
.wr-se-props .wr-sec-body .field { margin-bottom: 5px; }
.wr-se-props .wr-sec .wr-se-texts { margin-bottom: 5px; }
/* «Ansicht» of the symbol editor in a state of the HMI (static/hmi.js hmiPreview): the canvas takes the background and colours of the HMI (class
   hmi), not inverted in the dark; the symbol and its marks are drawn by the HMI itself, the drawing of the editor lies over it unseen (only what is
   selected shows) and is picked as before; the marks are picked by their place (hmiHit) */
.wr-sym-canvas.hmi { background: var(--hmi-bg); filter: none !important; }
.wr-sym-canvas.hmi .wr-se-content > :is([data-g], .wr-se-pin):not(.wr-se-sel), .wr-sym-canvas.hmi .wr-se-preview > :not(.wr-se-sel) { opacity: 0; }
.wr-sym-canvas .wr-se-hmiview, .wr-sym-canvas .wr-se-hmiview * { pointer-events: none; }
/* the texts in a view of the HMI as the editor draws them – their formats, never example values (user 17 Nov «beispielwerte im editor nicht zeigen.
   unnötig»): the texts the HMI draws left out, those of the editor (tag, data, cross-reference, designations, text fields of the drawing) shown in
   the colour of the HMI; one switched off faded in «Alle Zeichen und Texte» (user 16 Nov «auch alle texte», 17 Nov «ausgegraut wenn nicht
   angehakt»), left out in a state as in the HMI */
.wr-sym-canvas.hmi .wr-se-hmi-back .wd-sym > [data-t] { display: none; }
.wr-sym-canvas.hmi :is(.wr-se-preview > *, .wr-se-content > text[data-g]):not(.wr-se-off) { opacity: 1; }
.wr-sym-canvas.hmi.hmi-all :is(.wr-se-preview > *, .wr-se-content > text[data-g]).wr-se-off { opacity: .35; }
/* the pins in «Alle Zeichen und Texte» as in the plan (user 17 Nov «anschlüsse auch zeigen im editor bei alle»): the red handle around one drawn
   invisibly, the mark of the others; left out in a state as in the HMI */
.wr-sym-canvas.hmi.hmi-all .wr-se-content > .wr-se-pin { opacity: 1; }
.wr-sym-canvas.hmi :is(.wr-se-preview :is(.wr-se-t, .wr-se-tfix), .wr-se-content > text[data-g]),
  .wr-sym-canvas.hmi :is(.wr-se-preview :is(.wr-se-t, .wr-se-tfix), .wr-se-content > text[data-g]) text { fill: var(--hmi-text); }
/* its grid faint on the background of the HMI (the light lines of the white editor, not inverted here, were a bright net – user 15 Nov «wieso
   sieht editor so scheisse aus»): the mm lines barely, the 5 mm lines a little more, no 0.1 mm lines; the border as the cards */
.wr-sym-canvas.hmi .wr-se-grid { stroke: color-mix(in srgb, var(--hmi-norm) 22%, transparent); }
.wr-sym-canvas.hmi .wr-se-grid5 { stroke: color-mix(in srgb, var(--hmi-norm) 55%, transparent); }
.wr-sym-canvas.hmi .wr-se-grid01 { display: none; }
:root .wr-sym-canvas.hmi { border-color: var(--line); }
.wr-se-hmi-marks { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; }
.wr-se-hmi-mark { display: inline-flex; align-items: center; gap: 4px; }
.wr-se-hmi-vals { flex-wrap: wrap; gap: 4px 8px; }
.wr-se-hmi-f { display: inline-flex; flex-direction: column; gap: 1px; }
.wr-se-hmi-f .wr-se-num { width: 62px; }
input[type=color].wr-hmi-std { opacity: .45; }  /* a colour of a state not set: the built-in one, faded */
.wr-se-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 8px; }
.wr-se-row3 > * { min-width: 0; }
.wr-se-row3 select, .wr-se-row3 input { width: 100%; }
.wr-se-left { min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.wr-se-left > .wr-row { margin: 0; }
/* the window as wide as the 3D editor (wider than .wide), the tool row one row (user 22 Nov 2026): the steps of app.js cfgFit – fit1 the tools
   and «Drehen» only as sign, without «Raster», fit2 narrower drop-downs, fit3 without − and + (⤢ stays), fit4 the row scrolls sideways */
dialog.modal.wide.wr-se-dlg { width: min(1600px, 96vw); max-width: 96vw; }
.wr-se-left > .wr-se-tools { flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.wr-se-tools > *, .wr-row.wr-se-tools select { flex: none; }
.wr-se-tools.fit1 .bar-txt, .wr-se-tools.fit3 .wr-zoom > :not(:last-child) { display: none; }
.wr-se-tools.fit2 select { max-width: 11ch; }
.wr-se-tools.fit4 { overflow-x: auto; overscroll-behavior-x: contain; }
.wr-se-vars { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wr-se-vars:empty { display: none; }
.wr-sym-canvas { flex: 1 1 0; min-height: 0; width: 100%; display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: crosshair; touch-action: none; }
.wr-sym-canvas.wr-panning { cursor: grabbing; }
.wr-sym-canvas:focus { outline: none; }
.wr-sym-canvas .wr-frame-sel { stroke-width: 1px; vector-effect: non-scaling-stroke; }
.wr-se-grid { stroke: #eef0f0; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wr-se-grid5 { stroke: #d5dada; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wr-se-grid01 { stroke: #f6f7f7; stroke-width: 1; vector-effect: non-scaling-stroke; }  /* 0.1 mm lines, zoomed in far */
.wr-se-handle { fill: #fff; stroke: #2a78d6; stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: crosshair; pointer-events: all; }  /* corner, end, radius of the element selected */
.wr-se-props .wr-se-geo input.wr-se-num { width: 62px; }
.wr-se-origin { stroke: #2a78d6; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.wr-se-pin { fill: none; stroke: #d03b3b; stroke-width: 0.3; }  /* handle around the pin: its mark (wdPinMark) shows through */
.wr-se-preview { pointer-events: none; }  /* every text as in the diagram, example values (wrSePreview) */
.wr-se-preview [data-t] { pointer-events: all; cursor: move; }
.wr-se-t, .wr-se-t text { fill: #2a78d6; }  /* placed by dragging */
.wr-se-t line { stroke: #2a78d6; }
.wr-se-tfix, .wr-se-tfix text { fill: #8a8f96; cursor: pointer; }  /* texts placed by themselves (connection designations drag as .wr-se-t since 25 Oct) */
.wr-se-off { opacity: .35; }  /* switched off: drawn faded so that it can be switched on again */
.wr-se-preview .wr-se-sel, .wr-se-preview .wr-se-sel text { fill: #e0457b !important; stroke: none !important; }
.wr-se-texts { width: 100%; border-collapse: collapse; font-size: 12px; }
.wr-se-texts th { font-weight: 500; color: var(--ink-2); text-align: left; padding: 0 3px; }
.wr-se-texts td { padding: 1px 3px; }
.wr-se-props .wr-se-texts input.wr-se-num { width: 54px; }
.wr-se-props input.wr-se-pins, .wr-settings input.wr-se-pins { width: 76px; }
.wr-se-style { display: flex; flex-direction: column; gap: 4px; }  /* format of a text: alignment, style, colour, turning */
.wr-se-style .wr-row { gap: 4px; align-items: center; flex-wrap: wrap; }
.wr-se-mark { gap: 4px; align-items: center; flex-wrap: nowrap; }  /* mark of the pins: shape, diameter, colour in one row */
.wr-se-props .wr-se-mark select { flex: 1; width: auto; min-width: 0; }
.wr-se-props .wr-se-mark input.wr-se-num { width: 64px; flex: none; }
.wr-se-style input[type=color], .wr-se-props .wr-se-mark input[type=color] { width: 34px; height: 26px; padding: 1px; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; }
/* Controls of the editors stand out from their cards (user 15 Nov 2026 «bedienelemente buttons etc im editor mehr abheben für optik»): a button
   has a shade of its own, a firmer edge and a slight shadow, a field or drop-down the firmer edge – mixed from the ink, so light and dark alike;
   a chosen one (primary) keeps its colour */
:where(.wr-toolbar, .wr-editor, .wr-se, .wr-se-dlg) .btn:not(.primary, .danger-solid) { background: color-mix(in srgb, var(--ink) 7%, var(--card));
  border-color: color-mix(in srgb, var(--ink) 30%, var(--card)); box-shadow: 0 1px 2px rgba(0, 0, 0, .16); }
:where(.wr-toolbar, .wr-editor, .wr-se, .wr-se-dlg) .btn:not(.primary, .danger-solid):hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 14%, var(--card));
  border-color: color-mix(in srgb, var(--ink) 48%, var(--card)); }
:where(.wr-toolbar, .wr-editor, .wr-se, .wr-se-dlg) :is(select, textarea, input:not([type=checkbox], [type=radio], [type=color], [type=range])) {
  border-color: color-mix(in srgb, var(--ink) 30%, var(--card)); }
/* several selected with different values (user 20 Nov 2026): a toggle or colour field dashed – «verschieden», the tooltip says so */
.wr-se-props .wr-se-mixed { border-style: dashed !important; }
.wr-se-row-all td { border-bottom: 1px solid var(--line); }
.wr-se-row-sel td { background: color-mix(in srgb, #e0457b 12%, transparent); }
.wr-se-help { text-decoration: underline dotted; cursor: help; }
.wr-settings h3 { margin: 14px 0 4px; font-size: 15px; }
.wr-set-fmt input { width: 100%; }
.wr-set-fmt code { white-space: nowrap; }
.wr-set-preset { border-top: 1px solid var(--line); padding: 6px 0; }
.wr-set-preset .wr-set-pname { max-width: 260px; }
.wr-set-contact { display: inline-flex; gap: 4px; align-items: center; margin-right: 8px; }
.wr-el-list { max-height: 62vh; overflow: auto; }
.wr-el-table td { padding: 2px 6px; vertical-align: middle; }
.wr-el-table td.actions { white-space: nowrap; }
.wr-el-hidden { opacity: .55; }
.wr-el-sub td:nth-child(2) { padding-left: 28px; }  /* one of several equal symbols, unfolded under their row */
.wr-el-open { min-width: 44px; margin-right: 6px; }
.wr-se-sel { stroke: #2a78d6 !important; fill-opacity: .9; }
text.wr-se-sel, text.wr-se-sel tspan { stroke: none !important; fill: #2a78d6 !important; }  /* a selected text of the drawing: blue, no outline (1 mm stroke made it a blot) */
.wr-se-props .field { margin-bottom: 6px; }
.wr-se-props p { margin: 4px 0; }
.wr-se-props input, .wr-se-props select { width: 100%; box-sizing: border-box; }
.wr-lib { min-width: min(900px, 88vw); }
.wr-lib-q { flex: 1; min-width: 240px; }
.wr-lib-results { max-height: 52vh; overflow: auto; display: grid; gap: 4px; }
.wr-lib-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.wr-lib-prev { display: flex; gap: 8px; align-items: center; font-size: 12px; min-height: 46px; }
.wr-lib-prev .wr-pal-icon { background: #fff; border: 1px solid var(--line); border-radius: 4px; flex: none; }
.wr-lib-path { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 1100px) {  /* narrow: the drawing over the whole width (still A4 landscape), the right column below it, the page scrolls */
  main:has(.wr-editor) { padding-bottom: 40px; }
  .wr-editor { grid-template-columns: minmax(0, 1fr); }
  .wr-side { contain: none; overflow: visible; }
  .wr-se { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); }
}

/* dark mode: the drawings dark with light lines (user 25 Oct: «vp in darkmode auch schwarz», then «nicht ganz schwarz»: dark grey like the cards) – the SVGs
   draw with fixed colours (paper #fff, lines #000), a filter turns them round to 90 % (paper about #1a1a1a, lines #e6e6e6) and keeps the hues of the wire
   colours; the printout (wiring_print.html, without .wr-canvas …) stays white. Out of invert(.9): 229.5 - 0.8 × value per channel – borders inside
   a filtered element are given in the colour that comes out as the dark line colour (#e8e8e8 → about #2c2c2c) */
@media screen {
  :root[data-theme="dark"] :is(.wr-canvas .wr-svg, .wr-page-box, .wr-pal-icon, .wr-sym-canvas) { filter: invert(.9) hue-rotate(180deg); }
  :root[data-theme="dark"] :is(.wr-canvas, .wr-pages) { background: var(--bg); }
  :root[data-theme="dark"] .wr-pal-btn { background: #1a1a1a; }
  :root[data-theme="dark"] :is(.wr-sym-canvas, .wr-lib-prev .wr-pal-icon) { border-color: #e8e8e8; }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.wr-canvas .wr-svg, .wr-page-box, .wr-pal-icon, .wr-sym-canvas) { filter: invert(.9) hue-rotate(180deg); }
  :root:not([data-theme="light"]) :is(.wr-canvas, .wr-pages) { background: var(--bg); }
  :root:not([data-theme="light"]) .wr-pal-btn { background: #1a1a1a; }
  :root:not([data-theme="light"]) :is(.wr-sym-canvas, .wr-lib-prev .wr-pal-icon) { border-color: #e8e8e8; }
}

/* printout: one SVG page per A3 sheet */
.wr-print { margin: 0; background: #7a7a76; font-family: Arial, Helvetica, sans-serif; }
.wr-print .wr-print-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 12px; align-items: center; padding: 8px 16px; background: #1d1d1b; color: #fff; }
.wr-print .wr-print-bar button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 0; background: #1baf7a; color: #fff; cursor: pointer; }
.wr-print .wd-page { display: block; width: 420mm; height: 297mm; margin: 10mm auto; background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
@page { size: 420mm 297mm; margin: 0; }
@media print {
  .wr-print { background: none; }
  .wr-print .wr-print-bar { display: none; }
  .wr-print .wd-page { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .wr-print .wd-page:last-child { break-after: auto; page-break-after: auto; }
}
/* «Diese Ansicht» of the print button in the editor (wrPrintParts): the sheet or a report page on A4 landscape, below the print head */
@media print { .print-part > svg.wd-page { display: block; width: 100%; height: auto; max-height: 172mm; } }
/* report pages in the editor: fields to fill in (wdEditBox) – a box over the cell, missing values marked in GreenState green (user 25 Oct
   «hässliche farbe. greenstate grün?» – was orange; the page is inverted in dark mode, so a light green there becomes a dark one) */
.wr-page-box .wd-edit { cursor: pointer; }
.wr-page-box .wd-dbl, .wr-page-box .wd-dbl-t { cursor: pointer; }
.wr-page-box .wd-dbl:hover { fill: rgba(96, 185, 70, .12); }
/* the row a double click led to (wrShowDevices) */
.wr-devices tr.wr-mark > td { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.wr-devices .wr-dbl { cursor: pointer; }
.wr-page-box .wd-edit:hover { fill: rgba(96, 185, 70, .22); }
.wr-page-box .wd-edit.wd-missing { stroke: #60b946; stroke-width: .3; }
/* variables of a format with what they stand for («Formate & Vorlagen», symbol editor) */
.wr-vars { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.wr-vars code { cursor: help; }
.wr-vars code { color: var(--ink); }
/* pins in the symbol editor (user 26 Oct «wie anschluss darstellung gestalten im editor»): drawn as in the diagram (wdPinMark in the preview);
   the red handle around one drawn invisibly, around one with a mark only while the pointer is on it or it is selected */
.wr-se-pin { pointer-events: all; }
.wr-se-pin.wr-se-pin-on { stroke-opacity: 0; }
.wr-se-pin.wr-se-pin-on:hover, .wr-se-pin.wr-se-pin-on.wr-se-sel { stroke-opacity: 1; }
/* «Formate & Vorlagen»: sections like those of the symbol editor; the look in rows of labelled fields */
.wr-settings .wr-sec { margin: 0 0 8px; }
.wr-settings .wr-sec-body { margin: 8px 10px 4px; }
.wr-set-look, .wr-set-vals { gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 6px; }  /* vals: sheet and routing (PR 8) */
.wr-set-look-f { display: flex; flex-direction: column; gap: 2px; }
.wr-set-look-n { min-width: 64px; align-self: center; font-size: 13px; }
.wr-settings input.wr-se-num { width: 70px; }
.wr-settings input[type=color] { width: 34px; height: 26px; padding: 1px; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; }
.wr-set-texts td, .wr-set-texts th { padding: 2px 6px; }

/* HMI of the hall (static/hmi.js, round 5): high-performance look after ISA-101 – grey picture, colour only for what is abnormal (alarm
   indicator: 1 red square, 2 yellow triangle, 3 orange diamond; NE 107: F red, C orange, S yellow, M blue), live values dark blue,
   running/open filled green (since 26 Oct, every item coloured by its state, see below). The picture follows the appearance (user 26 Oct «hmi auch theme übernehmen dark hell»): light grey, in the dark
   theme dark grey with light lines, light blue values and running/open filled light – light-dark() after the color-scheme of the page (the
   printout light); the alarm colours stay the same in both. Dark: background almost black, lines almost white (user 26 Oct «hmi hintergrund
   dunkler und linien heller»). */
.hmi { --hmi-bg: light-dark(#dcdcdc, #161615); --hmi-paper: light-dark(#fff, #1d1d1c); --hmi-box: light-dark(#f2f2f2, #232322);
  --hmi-box-stale: light-dark(#e6e6e6, #272726); --hmi-line: light-dark(#5f5f5f, #d4d4d0); --hmi-text: light-dark(#3a3a3a, #e4e4df);
  --hmi-ink: light-dark(#222, #f0f0ec); --hmi-on: light-dark(#1a7a35, #60b946); --hmi-on-ink: light-dark(#005417, #b4eb03);
  --hmi-on-line: light-dark(#1a7a35, #7fd05f); --hmi-off: light-dark(#c4c4c4, #3d3d3b); --hmi-cmd: light-dark(#0b7fd4, #4fb0ff);
  --hmi-pv: light-dark(#1f3a93, #8fb0ff); --hmi-stale: light-dark(#8a8a8a, #7c7c78); --hmi-norm: light-dark(#b9b9b9, #4a4a48);
  --hmi-p1: #e0201b; --hmi-p2: #ec8629; --hmi-p3: #f5c400; --hmi-ne-s: light-dark(#b08b00, #d9b200); --hmi-ne-m: light-dark(#2f6fd1, #6f9ff0);
  --hmi-fault-ink: light-dark(#c4161c, #ff6b63);
  /* each state in a colour of its own (static/hmi.js HMI_COLOR_VARS – Formate & Vorlagen › HMI-Anzeige sets them, user 14 Nov 2026 «sichtbar +
     einstellbar»); built in F as priority 1, C as 2, S as 3, value in order and selection the colour of the values */
  --hmi-F: var(--hmi-p1); --hmi-C: var(--hmi-p2); --hmi-S: var(--hmi-p3); --hmi-p3-line: var(--hmi-ne-s); --hmi-S-line: var(--hmi-p3-line);
  --hmi-M: var(--hmi-ne-m); --hmi-ok: var(--hmi-pv); --hmi-sel: var(--hmi-pv);
  /* running in the GreenState colours (user 31 Oct «greenstate stil, hintergrund nicht ändern»): brand green #60b946 / logo greens #1a7a35,
     #005417, lime #b4eb03 on forest green #042e0c; the background of the picture stays */
  --hmi-on-text: light-dark(#042e0c, #d9f5c6); --hmi-on-bg: light-dark(#eff8ed, #042e0c); --hmi-on-edge: light-dark(#60b946, #1a7a35);
  --hmi-fault-bg: light-dark(#fdecec, #2a0f0e); --hmi-fault-edge: light-dark(#e8a5a2, #7a2422); }
/* picture on the left, always A4 landscape like the drawings (user 26 Oct), the faceplate column on the right takes the rest of the width */
.hmi-main { display: grid; grid-template-columns: minmax(0, max(540px, calc((100vh - var(--wr-reserved, 230px)) * 297 / 210))) minmax(330px, 1fr); gap: 10px; align-items: start; }
.hmi-canvas { position: relative; padding: 0; overflow: hidden; width: 100%; aspect-ratio: 297 / 210; background: var(--hmi-bg); cursor: grab; touch-action: none; }
.hmi-svg { width: 100%; height: 100%; display: block; }
.hmi-side { min-width: 0; align-self: stretch; contain: size; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; }
.hmi-svg [stroke="#000"], .hmi-svg [stroke="#000000"] { stroke: var(--hmi-line); }
.hmi-svg [fill="#000"], .hmi-svg [fill="#000000"] { fill: var(--hmi-line); }
.hmi-svg [fill="#fff"], .hmi-svg [fill="#ffffff"] { fill: var(--hmi-paper); }
.hmi-svg text { fill: var(--hmi-text); }
.hmi-svg .wd-dot { fill: var(--hmi-line); }
.hmi-bridges line { stroke: var(--hmi-line); stroke-width: 0.6; }
.hmi-svg .hmi-item { cursor: pointer; }
.hmi-svg .hmi-item * { pointer-events: all; }  /* the whole area of an item can be clicked, also where it is not filled (pump off) */
.hmi-svg .hmi-jump, .hmi-svg .hmi-jump * { cursor: pointer; pointer-events: all; }  /* an arrow or connection with a counterpart: a click goes there (hmiJump) */
.hmi-svg .hmi-flash { animation: hmi-pulse .5s ease-in-out 4; }  /* the counterpart just jumped to */
@media (prefers-reduced-motion: reduce) { .hmi-svg .hmi-flash { animation: none; } }
.hmi-svg .hmi-live > g:first-child > * { stroke-width: 0.45; }
/* Glass (user 14 Nov 2026 «glas anwenden», chosen from 30 designs; then «B verbessern. dunkel nicht schön da zu hell» – «b1 umsetzen»): the
   closed bodies of the symbols – circles, rectangles, ellipses, closed paths; not the lines, not what is filled black – are tinted glass in the
   colour of their state: clear without a state, grey stopped/closed, green running/open, red, orange, yellow, blue for alarm and NE 107 – the
   strong colour stays in the lines. Above each body a copy of its shape carries the sheen (hmiGlassLayer in static/hmi.js, turned along with
   the symbol): white on the upper half, cut off sharply, a light edge at the bottom. Light: a soft shadow below each symbol; dark: smoky glass,
   the sheen half as strong, no shadow. Until then running was filled light green, stopped grey, and every path was filled, also an open one. */
.hmi-svg { --hmi-gl-clear: light-dark(rgb(200 210 198 / 0.28), rgb(150 160 150 / 0.14)); --hmi-gl-off: light-dark(rgb(140 150 140 / 0.38), rgb(110 118 110 / 0.28));
  --hmi-gl-on: light-dark(rgb(95 185 10 / 0.32), rgb(95 185 10 / 0.3)); --hmi-gl-p1: light-dark(rgb(224 57 43 / 0.28), rgb(224 57 43 / 0.3));
  --hmi-gl-p2: light-dark(rgb(236 134 41 / 0.3), rgb(236 134 41 / 0.3)); --hmi-gl-p3: light-dark(rgb(245 196 0 / 0.32), rgb(245 196 0 / 0.28));
  --hmi-gl-m: light-dark(rgb(47 111 209 / 0.26), rgb(47 111 209 / 0.3)); --hmi-gl-sh: url(#hmi-gl-sh-0);
  --hmi-gl-F: var(--hmi-gl-p1); --hmi-gl-C: var(--hmi-gl-p2); --hmi-gl-S: var(--hmi-gl-p3); }  /* F, C, S tinted as priority 1, 2, 3 unless set (HMI-Anzeige) */
#hmi-glass .hmi-gl-s0 { stop-color: light-dark(rgb(255 255 255 / 0.85), rgb(255 255 255 / 0.38)); }
#hmi-glass .hmi-gl-s1 { stop-color: light-dark(rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.06)); }
#hmi-glass :is(.hmi-gl-s2, .hmi-gl-s3) { stop-color: rgb(255 255 255 / 0); }
#hmi-glass .hmi-gl-s4 { stop-color: light-dark(rgb(255 255 255 / 0.35), rgb(255 255 255 / 0.14)); }
#hmi-glass .hmi-gl-shade { flood-color: light-dark(rgb(11 42 18 / 0.18), transparent); }
.hmi-svg .wd-sym > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-clear); }
.hmi-svg .wd-sym > g:first-child > .hmi-gl-sh { fill: var(--hmi-gl-sh); stroke: none; pointer-events: none; }
.hmi-svg .wd-sym > g:first-child { filter: url(#hmi-gl-shadow); }
.hmi-svg .hmi-on > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-on); }
.hmi-svg .hmi-on > text { fill: var(--hmi-on-text); }
.hmi-svg .hmi-unknown > g:first-child > :is(circle, rect, path, ellipse) { stroke-dasharray: 0.8 0.6; }
.hmi-svg .hmi-sel > g:first-child { filter: drop-shadow(0 0 0.6px var(--hmi-sel)); }
/* Colour of the state (hmiState in static/hmi.js; user 26 Oct «hmi graphiken farblich markieren nach zustand. versch. farben, blinken etc
   für verschiedene zustände»): the lines of the symbol in the colour of its state and, for what needs attention, a coloured frame behind
   it – alarm by priority (blinking 1 Hz while unacknowledged, hollow and blinking slowly once returned, steady once acknowledged), failure F
   red dashed, command running blue pulsing, C orange, S yellow, M blue, each dashed; running/open filled green, stopped grey, unknown dashed,
   measured value in order blue, not current grey. «Reduce motion» stops the blinking, colour and shape stay. */
.hmi-svg .hmi-st-p1 > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-p1); }
.hmi-svg .hmi-st-F > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-F); }
.hmi-svg .hmi-st-p2 > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-p2); }
.hmi-svg .hmi-st-C > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-C); }
.hmi-svg .hmi-st-p3 > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-p3-line); }
.hmi-svg .hmi-st-S > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-S-line); }
.hmi-svg .hmi-st-M > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-M); }
.hmi-svg .hmi-st-cmd > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-cmd); }
.hmi-svg .hmi-st-on > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-on-line); }
/* the symbol itself tinted in the colour of its state (user 31 Oct «darstellung hässlich. schöner gestalten farblich»: no more full green or red
   surfaces with light writing on them – a light tint, the strong colour in the lines; since 14 Nov 2026 as glass, see above); running keeps its green */
.hmi-svg .hmi-st-p1:not(.hmi-on) > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-p1); }
.hmi-svg .hmi-st-F:not(.hmi-on) > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-F); }
.hmi-svg .hmi-st-p2:not(.hmi-on) > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-p2); }
.hmi-svg .hmi-st-C:not(.hmi-on) > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-C); }
.hmi-svg .hmi-st-p3:not(.hmi-on) > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-p3); }
.hmi-svg .hmi-st-S:not(.hmi-on) > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-S); }
.hmi-svg .hmi-st-M:not(.hmi-on) > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-m); }
.hmi-svg .hmi-st-off > g:first-child > :is(circle, rect, ellipse, path[d$="Z" i])[fill="none"] { fill: var(--hmi-gl-off); }
.hmi-svg .hmi-st-ok > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-ok); }
.hmi-svg :is(.hmi-st-stale, .hmi-st-unknown) > g:first-child > :is(circle, rect, path, ellipse, line, polyline, polygon) { stroke: var(--hmi-stale); stroke-dasharray: 0.8 0.6; }
.hmi-halo { stroke-width: 0.5; fill-opacity: 0.4; pointer-events: none; }
.hmi-h-p1 { fill: var(--hmi-p1); stroke: var(--hmi-p1); }
.hmi-h-p2 { fill: var(--hmi-p2); stroke: var(--hmi-p2); }
.hmi-h-p3 { fill: var(--hmi-p3); stroke: var(--hmi-p3-line); }
.hmi-h-cmd { fill: var(--hmi-cmd); stroke: var(--hmi-cmd); }
.hmi-h-F { fill: var(--hmi-F); stroke: var(--hmi-F); }
.hmi-h-C { fill: var(--hmi-C); stroke: var(--hmi-C); }
.hmi-h-S { fill: var(--hmi-S); stroke: var(--hmi-S-line); }
.hmi-h-M { fill: var(--hmi-M); stroke: var(--hmi-M); }
.hmi-halo:is(.hmi-h-F, .hmi-h-C, .hmi-h-S, .hmi-h-M) { fill-opacity: 0.1; stroke-width: 0.3; stroke-dasharray: 0.9 0.5; }
.hmi-halo.hmi-h-back { fill: none; stroke-width: 0.7; }
.hmi-selbox { fill: none; stroke: var(--hmi-sel); stroke-width: 0.25; stroke-opacity: 0.8; pointer-events: none; }
.hmi-svg text.hmi-state-on { fill: var(--hmi-on-line); }
.hmi-svg text.hmi-state-fault { fill: var(--hmi-fault-ink); }
.hmi-valbox:is(.hmi-vb-p1, .hmi-vb-F, .hmi-vb-p2, .hmi-vb-C, .hmi-vb-p3, .hmi-vb-S, .hmi-vb-M) { stroke-width: 0.45; }
.hmi-valbox.hmi-vb-p1 { stroke: var(--hmi-p1); } .hmi-valbox.hmi-vb-F { stroke: var(--hmi-F); }
.hmi-valbox.hmi-vb-p2 { stroke: var(--hmi-p2); } .hmi-valbox.hmi-vb-C { stroke: var(--hmi-C); }
.hmi-valbox.hmi-vb-p3 { stroke: var(--hmi-p3-line); } .hmi-valbox.hmi-vb-S { stroke: var(--hmi-S-line); }
.hmi-valbox.hmi-vb-M { stroke: var(--hmi-M); }
.hmi-blink-slow { animation: alarm-blink 2s steps(2, jump-none) infinite; }
.hmi-pulse { animation: hmi-pulse 2s ease-in-out infinite; }
@keyframes hmi-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { :is(.hmi-blink-slow, .hmi-pulse, .hmi-ib-blink) { animation: none; } }
/* «Farben» in the tool bar: the states with a small picture each, opened below the button */
.hmi-legend { position: relative; display: inline-block; }
/* the sheet choice sits in the group «Ebene» (piGroup, 22 Nov 2026): the group and its row give way too */
.hmi-bar .pi-grp:has(.wr-group), .hmi-bar .pi-grp:has(.wr-group) > .pi-row, .hmi-bar .pi-row > .wr-group { flex: 0 1 auto; min-width: 0; }
.hmi-bar .wr-group > select { flex-shrink: 1; min-width: 90px; max-width: 280px; text-overflow: ellipsis; }  /* the sheet title gives way, the buttons keep their place */
.hmi-legend > summary { list-style: none; }
.hmi-legend > summary::-webkit-details-marker { display: none; }
.hmi-legend-body { position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline-start: 0; width: max-content; max-width: min(440px, 80vw); padding: 8px 10px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .25); }
.hmi-legend-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.hmi-legend-body li { display: flex; align-items: center; gap: 8px; }
.hmi-svg.hmi-legend-pic { width: 32px; height: 24px; flex: none; background: var(--hmi-bg); border-radius: 4px; }
.hmi-state { font-weight: bold; }
.hmi-valbox { fill: var(--hmi-box); stroke: var(--hmi-line); stroke-width: 0.15; }
.hmi-svg .hmi-value { fill: var(--hmi-pv); font-weight: bold; }
.hmi-svg .hmi-stale, .hmi-val.hmi-stale { fill: var(--hmi-stale); color: var(--hmi-stale); font-style: italic; }
.hmi-valbox.hmi-stale { fill: var(--hmi-box-stale); stroke-dasharray: 0.6 0.4; }
.hmi-bar-bg { fill: var(--hmi-box); stroke: var(--hmi-line); stroke-width: 0.12; }
.hmi-bar-norm { fill: var(--hmi-norm); }
.hmi-bar-lim { stroke: var(--hmi-line); stroke-width: 0.2; }
.hmi-bar-trip { stroke: var(--hmi-ink); stroke-width: 0.35; }
.hmi-bar-pv { fill: var(--hmi-ink); stroke: var(--hmi-ink); stroke-width: 0.35; }
.hmi-bar-pv.hmi-out { fill: var(--hmi-p1); stroke: var(--hmi-p1); }
.hmi-prio { overflow: visible; vertical-align: middle; }
.hmi-prio :is(rect, path) { stroke: #000; }  /* its width in proportion to the size: hmiPrioShape */
.hmi-prio text { fill: #000; font-weight: bold; font-family: Arial, Helvetica, sans-serif; }
.hmi-p1 :is(rect, path) { fill: var(--hmi-p1); }
.hmi-p1 text { fill: #fff; }
.hmi-p2 :is(rect, path) { fill: var(--hmi-p2); }
.hmi-p3 :is(rect, path) { fill: var(--hmi-p3); }
.hmi-prio.hmi-back :is(rect, path) { fill: var(--hmi-paper); stroke: var(--hmi-ink); }
.hmi-prio.hmi-back text { fill: var(--hmi-ink); }
.hmi-blink { animation: alarm-blink 1s steps(2, jump-none) infinite; }
@media (prefers-reduced-motion: reduce) { .hmi-blink { animation: none; } }
/* the NE 107 mark as a small filled badge, the letter dark or white on it (user 31 Oct «schöner gestalten farblich») */
.hmi-ne rect { stroke: none; }
.hmi-svg .hmi-ne text { font-weight: bold; fill: #fff; }
.hmi-ne-F rect { fill: var(--hmi-F); }
.hmi-ne-C rect { fill: var(--hmi-C); } .hmi-svg .hmi-ne-C text { fill: #1a1a1a; }
.hmi-ne-S rect { fill: var(--hmi-S); } .hmi-svg .hmi-ne-S text { fill: #1a1a1a; }
.hmi-ne-M rect { fill: var(--hmi-M); }
/* the letter of a message (A, E, L, I) in the colour of the priority of its alarm */
.hmi-ne-p1 rect { fill: var(--hmi-p1); }
.hmi-ne-p2 rect { fill: var(--hmi-p2); } .hmi-svg .hmi-ne-p2 text { fill: #1a1a1a; }
.hmi-ne-p3 rect { fill: var(--hmi-p3); } .hmi-svg .hmi-ne-p3 text { fill: #1a1a1a; }
span.hmi-ne { display: inline-block; min-width: 1.4em; text-align: center; font-weight: bold; border-radius: 3px; padding: 0 4px; font-size: 12px; color: #fff; }
span.hmi-ne-F { background: var(--hmi-F); } span.hmi-ne-C { background: var(--hmi-C); color: #1a1a1a; } span.hmi-ne-S { background: var(--hmi-S); color: #1a1a1a; } span.hmi-ne-M { background: var(--hmi-M); }
span.hmi-ne-p1 { background: var(--hmi-p1); } span.hmi-ne-p2 { background: var(--hmi-p2); color: #1a1a1a; } span.hmi-ne-p3 { background: var(--hmi-p3); color: #1a1a1a; }
.hmi-counts { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.hmi-count { display: inline-flex; gap: 4px; align-items: center; }
.hmi-val { color: var(--hmi-pv); font-weight: bold; white-space: nowrap; }
.hmi-bar-inline { display: block; }
/* The values of the controller of a machine as a list (hmiListSvg): a light box, the head with the machine, per row tag, name and the value in
   its box (coloured like the frame of its state); the whole row can be clicked */
.hmi-list-box { fill: var(--hmi-paper); stroke: var(--hmi-line); stroke-width: 0.15; }
/* the picture of a camera (static/wiring_draw.js wdImageBox, static/hmi.js hmiCamsStart): grey until its picture comes – without a live sensor
   it stays so; the tag on a dark band above the picture */
.hmi-svg .wd-image-box { fill: var(--hmi-box-stale); stroke: var(--hmi-line); stroke-width: 0.15; }
.hmi-svg .wd-image-cam { stroke: var(--hmi-stale); }
.hmi-svg .wd-image-lblbg { fill: rgba(0, 0, 0, .55); }
.hmi-svg text.wd-image-lbl { fill: #fff; }
.hmi-svg .wd-sym:has(.hmi-cam) { cursor: pointer; }
.hmi-svg .hmi-list-head text { fill: var(--hmi-ink); }
.hmi-svg .hmi-list-tag { fill: var(--hmi-stale); }
.hmi-list-hit { fill: transparent; stroke: none; }
.hmi-svg .hmi-list-row:hover .hmi-list-hit { fill: var(--hmi-box); }
/* The state of the links in the bar (hmiStatus, user 30 Oct «zustand sps fms etc auch darstellen grün etc»): a dot in the colour of the
   state – green in order, yellow late or maintenance, red fault, grey unknown or off – and the word beside it (.bar-txt: it goes first when
   the bar gets narrow, the tip keeps it) */
.hmi-status { display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; font-size: 13px; }
.hmi-cst { display: inline-flex; gap: 4px; align-items: center; }
.hmi-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--hmi-stale); box-shadow: 0 0 0 1px rgb(0 0 0 / .25); }
.hmi-cs-ok .hmi-dot { background: var(--hmi-on); }
.hmi-cs-warn .hmi-dot { background: var(--hmi-p3); }
.hmi-cs-fault .hmi-dot { background: var(--hmi-p1); animation: alarm-blink 1s steps(2, jump-none) infinite; }
@media (prefers-reduced-motion: reduce) { .hmi-cs-fault .hmi-dot { animation: none; } }
.hmi-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hmi-item-btn { display: flex; width: 100%; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 4px 6px; cursor: pointer; text-align: start; font-size: 13px; }
.hmi-item-btn .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hmi-noalarm { display: inline-block; width: 12px; }
/* the state as a pill like the other badges of the FMS: running lime on forest green with a green dot, a fault red on dark red */
.hmi-badge-on { background: var(--hmi-on-bg); color: var(--hmi-on-ink); border-color: var(--hmi-on-edge); }
.hmi-badge-on::before { background: var(--hmi-on); }
.hmi-big { font-size: 30px; font-weight: bold; color: var(--hmi-pv); line-height: 1.1; }
.hmi-big.hmi-big-fault { color: var(--hmi-p1); }
.hmi-big small { font-size: 15px; font-weight: normal; }
.hmi-limits th, .hmi-limits td { text-align: center; padding: 2px 6px; }
.hmi-spark { background: var(--card-2); border-radius: 4px; }
.hmi-spark-line { stroke: var(--hmi-pv); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.hmi-state-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hmi-state-box { font-weight: bold; border: 1px solid var(--line); border-radius: 4px; padding: 2px 10px; }
.hmi-alarm-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hmi-fp-head { font-size: 15px; }
/* the same colours as a bar at the start of the rows on the right (list of the items, head of the faceplate) */
.hmi-item-btn, .hmi-fp-top { border-inline-start: 5px solid transparent; }
.hmi-fp-top { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line);
  border-radius: 6px; background: var(--card); font-size: 15px; }
.hmi-fp-top .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.hmi-fp-top strong { white-space: nowrap; }  /* the tag never breaks at its hyphen («=KM-» / «HS1102»), the description gives way */
.hmi-ib-p1 { border-inline-start-color: var(--hmi-p1); } .hmi-ib-F { border-inline-start-color: var(--hmi-F); }
.hmi-ib-p2 { border-inline-start-color: var(--hmi-p2); } .hmi-ib-C { border-inline-start-color: var(--hmi-C); }
.hmi-ib-p3 { border-inline-start-color: var(--hmi-p3); } .hmi-ib-S { border-inline-start-color: var(--hmi-S); }
.hmi-ib-M { border-inline-start-color: var(--hmi-M); }
.hmi-ib-cmd { border-inline-start-color: var(--hmi-cmd); }
.hmi-ib-on { border-inline-start-color: var(--hmi-on); }
.hmi-ib-off { border-inline-start-color: var(--hmi-off); }
.hmi-ib-ok { border-inline-start-color: var(--hmi-ok); }
:is(.hmi-ib-stale, .hmi-ib-unknown) { border-inline-start-color: var(--hmi-stale); border-inline-start-style: dashed; }
.hmi-ib-blink { animation: hmi-edge 1s steps(2, jump-none) infinite; }
@keyframes hmi-edge { to { border-inline-start-color: transparent; } }
@media (max-width: 900px) { .hmi-main { grid-template-columns: minmax(0, 1fr); } .hmi-side { contain: none; overflow: visible; } }
/* «Steuerung» (hmiPlant): the commands of the plant the item sets, one row each – name on the left, the control on the right */
.hmi-ctl { display: grid; gap: 2px; margin-top: 4px; }
.hmi-ctl-lock { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--ink-2); }
.hmi-ctl-lock.hmi-ctl-open .hmi-ctl-state { color: var(--hmi-on-line); font-weight: 600; }
.hmi-ctl-unit { margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.hmi-ctl-row { display: flex; align-items: center; gap: 6px; min-height: 26px; font-size: 13px; }
.hmi-ctl-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hmi-ctl-row select { width: auto; max-width: 140px; padding: 2px 4px; font-size: 13px; }
.hmi-ctl-num { display: inline-flex; align-items: center; gap: 4px; }
.hmi-ctl-num input { width: 72px; padding: 2px 4px; font-size: 13px; }
.hmi-ctl-sw { display: inline-flex; gap: 3px; }
.hmi-ctl-sw .btn { min-width: 42px; }
:is(.hmi-badge-fault, .hmi-ib-F .badge) { background: var(--hmi-fault-bg); color: var(--hmi-fault-ink); border-color: var(--hmi-fault-edge); }
:is(.hmi-badge-fault, .hmi-ib-F .badge)::before { background: var(--hmi-p1); }
/* Fullscreen (hmiFull, class on <html>): the HMI fills the window – in the browser's fullscreen the screen –, the bar with sheet and level above
   the picture, the popup instead of the column on the right. Below the hint (#tip), the notifications and dialogs (as html.fp-3d-full) */
@media screen {
  html.hmi-full { overflow: hidden; }
  html.hmi-full .wr.hmi { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; gap: 6px; padding: 6px; box-sizing: border-box; background: var(--bg); }
  html.hmi-full .wr.hmi > :not(.hmi-bar, .hmi-main) { display: none; }
  html.hmi-full .wr.hmi > .hmi-bar { margin: 0; flex: none; }
  html.hmi-full .hmi-main { flex: 1; min-height: 0; display: block; position: relative; }
  html.hmi-full .hmi-canvas { height: 100%; aspect-ratio: auto; margin: 0; }
  html.hmi-full .hmi-side { display: none; }
}
/* Popups of the fullscreen (hmiPops), one per item: as high as their content, at most the picture (then the content scrolls); dragged by
   the head, which carries the colour of the state like the faceplate; ▾ folds to the head */
.hmi-pop { position: absolute; z-index: 5; width: min(320px, calc(100% - 12px)); max-height: calc(100% - 4px); display: flex; flex-direction: column; margin: 0; padding: 0;
  overflow: hidden; box-shadow: 0 6px 22px rgb(0 0 0 / .3); }
.hmi-pop-head { display: flex; align-items: center; gap: 5px; padding: 3px 4px 3px 4px; cursor: move; touch-action: none; user-select: none; background: var(--card-2);
  border-inline-start: 5px solid transparent; font-size: 13px; flex: none; }
.hmi-pop-fold { border: 0; background: none; padding: 0 2px; color: var(--ink-2); font-size: 13px; line-height: 1; cursor: pointer; }
.hmi-pop-head strong { white-space: nowrap; }  /* the tag never breaks at its hyphen, the description gives way */
.hmi-pop-desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.hmi-pop-x { padding: 0 6px; line-height: 1.3; }
.hmi-pop-in { display: grid; gap: 3px; padding: 4px 8px 6px; font-size: 13px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.hmi-pop-in .hmi-state-line { gap: 4px; }
.hmi-pop-in .hmi-cmds { margin: 0 0 0 auto; gap: 3px; }
.hmi-pop-line { display: flex; align-items: center; gap: 8px; }
.hmi-pop-plan { display: grid; gap: 3px; }  /* the time plan in a popup (static/hmi.js hmiPopControl): the times narrower, the popup is 320 px */
.hmi-pop-plan table.iv-plan input.iv-plan-time { width: 5.6em; }
/* More about the item in its popup (static/hmi.js hmiPopMore, 4 Nov 2026): sections as in the faceplate, the trend as in the window of the
   sensor but 300 wide, a chip per sensor, the period as a segmented button; the row of buttons at the foot stays in sight when it scrolls
   (sticky keeps to the content box: bottom = - the padding of .hmi-pop-in, so that it lies on the very edge) */
.hmi-pop-sec { margin: 0; }
.hmi-pop-sec > .wr-sec-body { display: grid; gap: 4px; }
.hmi-pop-sec p { margin: 0; }
.hmi-pop-tools { display: flex; align-items: center; gap: 6px; }
.hmi-pop-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.hmi-pop-chips .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; }
.hmi-pop svg.timeline { margin: 0; max-height: 150px; }
.hmi-pop-stats { text-align: end; }
.hmi-pop-alarms li { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hmi-pop-alarm-text { flex: 1 1 150px; min-width: 0; }
.hmi-pop-kv { margin: 0; font-size: 12px; }
.hmi-pop-foot { position: sticky; bottom: -6px; display: flex; gap: 4px; justify-content: flex-end; margin: 3px -8px -6px; padding: 5px 8px 6px;
  background: var(--card); border-top: 1px solid var(--line); }
.hmi-pop-foot .btn { white-space: nowrap; }
.hmi-cmds .seg { flex-wrap: nowrap; }

/* ---------------------------------------------------------------- Anlage InView (static/inview.js): Kameras (Seite «Kameras» im HMI) und
   Zeitplan-Block im Faceplate – die eigene Seite der Anlage ist seit 2.11.2026 weg. Der Messwert ist das einzige Blau. */
.iv-day { position: relative; height: 16px; border-radius: 4px; background: var(--card-2); overflow: hidden; }
.iv-win { position: absolute; top: 0; bottom: 0; background: var(--hmi-pv); }
.iv-day-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; }
table.iv-plan { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
table.iv-plan td, table.iv-plan th { padding: 2px 6px; text-align: left; border-bottom: 1px solid var(--line); }
table.iv-plan th { font-weight: 500; color: var(--muted); }
/* the time plan being changed (static/inview.js ivPlanBlock): fields as narrow as the times, a changed row marked */
table.iv-plan input.iv-plan-time { width: 6.5em; padding: 1px 4px; font: inherit; }
table.iv-plan tr.iv-plan-dirty td { background: color-mix(in srgb, var(--hmi-pv) 14%, transparent); }
table.iv-plan tr.iv-plan-dirty.muted { opacity: 1; }
.iv-plan-btns { margin-top: 6px; }
.iv-plan-changes { margin: 0 0 8px; padding-left: 18px; }
/* one camera: picture on the left (stays in view), its settings on the right */
dialog.modal.wide.iv-camdlg-modal { width: min(1280px, calc(100vw - 32px)); }
.iv-camdlg { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 14px; align-items: start; }
.iv-camdlg-left { position: sticky; top: 0; }
.iv-camdlg-pic { position: relative; aspect-ratio: 16 / 9; background: #161616; border-radius: var(--radius); overflow: hidden; }
.iv-camdlg-pic { touch-action: none; user-select: none; cursor: zoom-in; }
.iv-camdlg-pic.iv-zoomed { cursor: grab; }
.iv-camdlg-pic.iv-zoomed:active { cursor: grabbing; }
.iv-camdlg-pic:focus-visible { outline: 2px solid var(--accent, #4b7bff); outline-offset: 2px; }
.iv-camdlg-pic:fullscreen { aspect-ratio: auto; border-radius: 0; }
.iv-camdlg-img { position: absolute; display: block; max-width: none; transform-origin: center; pointer-events: none; }
.iv-camdlg-tools { position: absolute; right: 6px; top: 6px; display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 8px;
  background: rgba(0, 0, 0, .55); cursor: default; }
.iv-camdlg-tools .btn { min-width: 30px; }
.iv-camdlg-level { min-width: 44px; text-align: center; color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.iv-camdlg-info { margin-top: 6px; }
.iv-camdlg-set { min-width: 0; }
.iv-camf-grid { display: grid; gap: 4px; padding-bottom: 8px; }
.iv-camf-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.iv-camf { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1.4fr); align-items: center; gap: 8px; font-size: 13px; }
.iv-camf-bool { display: flex; gap: 8px; }
.iv-camf-in { display: flex; align-items: center; gap: 6px; min-width: 0; }
.iv-camf-in > input, .iv-camf-in > select { flex: 1; min-width: 0; }
.iv-camf-val { min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.iv-camf :disabled { cursor: not-allowed; opacity: .7; }
.iv-camf-foot { display: flex; justify-content: flex-end; padding-bottom: 8px; }
@media (max-width: 800px) { .iv-camdlg { grid-template-columns: 1fr; } .iv-camdlg-left { position: static; } }
.iv-cam-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 12px; text-align: center; padding: 12px; }
