/* Profen Kavento — operator UI. High-performance HMI conventions: neutral greys for normal state,
   colour reserved for running equipment, alarms and data-quality problems. */
:root {
  --bg: #111418; --panel: #191d23; --panel2: #20252c; --line: #2b313a; --line2: #37404b;
  --text: #e6e9ed; --muted: #97a1ad; --dim: #6c7682;
  --accent: #3fb6a8; --accent-ink: #062521;
  --run: #5fbf7a; --stop: #8b95a1;
  --p-critical: #ff5a52; --p-high: #ff8a3d; --p-medium: #f2c84b; --p-low: #7fb2ff;
  --bad: #ff6b63; --q-bg: #2a2f36; --q-line: #4a525d;
  --s1: #6cc6ff; --s2: #f2c84b; --s3: #c99bff; --s4: #7ad9a1;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef0f3; --panel: #ffffff; --panel2: #f5f6f8; --line: #dde1e6; --line2: #c9cfd6;
    --text: #1b2027; --muted: #5d6773; --dim: #7d8691; --accent: #127e72; --accent-ink: #fff;
    --run: #23864a; --stop: #77818c; --q-bg: #e7e9ec; --q-line: #b9c0c8;
    --s1: #1f78c8; --s2: #b8860b; --s3: #7d4fc4; --s4: #1f8f55;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0; font-weight: 600; }
h2 { font-size: 13px; margin: 0; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
h3 { font-size: 13px; margin: 14px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); }
.empty { color: var(--dim); padding: 10px 0; margin: 0; }
.boot { padding: 40px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons and inputs */
.btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 9px; }
.btn:disabled { opacity: .55; cursor: default; }
input, select { background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding: 7px 9px; width: 100%; }
label { display: block; color: var(--muted); font-size: 12.5px; margin: 10px 0 4px; }
label.inline { display: inline-flex; align-items: center; gap: 5px; margin: 0 10px 0 0; color: var(--text); }
label.inline input { width: auto; }
.err { color: var(--bad); min-height: 18px; margin: 8px 0; font-size: 13px; }

/* sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.auth-card h1 { margin: 14px 0 2px; font-size: 18px; }
.auth-card .foot { text-align: center; margin: 14px 0 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.brand.big { font-size: 18px; }
.logo-path { fill: var(--accent); }

/* shell */
.topbar { display: flex; align-items: center; gap: 18px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topnav { display: flex; gap: 4px; }
.topnav a { text-decoration: none; padding: 6px 12px; border-radius: 6px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.topnav a:hover { color: var(--text); background: var(--panel2); }
.topnav a[aria-current="page"] { color: var(--text); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
.count { background: var(--line2); color: var(--text); border-radius: 9px; padding: 0 7px; font-size: 12px; font-weight: 600; }
.count.unacked { background: var(--p-high); color: #1b0d00; }
.conn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-left: auto; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.conn.open .dot { background: var(--run); }
.conn.closed .dot { background: var(--bad); } .conn.closed { color: var(--bad); }
.user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.menu-btn { display: none; }
.sim-banner { background: repeating-linear-gradient(135deg, #3a3216 0 10px, #332c13 10px 20px); color: #f3d77a; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .06em; padding: 3px; }
.layout { display: grid; grid-template-columns: var(--side-w, 260px) 1fr; min-height: calc(100vh - var(--chrome-h, 52px)); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 8px; overflow: auto; position: relative; }
.side-title { padding: 0 8px 8px; }
main#view { padding: 18px 22px 40px; min-width: 0; }

/* system browser */
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 14px; }
.tree li[aria-expanded="false"] > ul { display: none; }
.tn { display: flex; align-items: center; gap: 2px; border-radius: 5px; }
.tn a { flex: 1; display: flex; align-items: center; gap: 7px; text-decoration: none; padding: 4px 6px; border-radius: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn a:hover { background: var(--panel2); }
.tn a[aria-current="page"] { background: var(--panel2); box-shadow: inset 2px 0 0 var(--accent); }
.tw, .tw-sp { width: 18px; height: 18px; flex: none; }
.tw { background: none; border: 0; cursor: pointer; padding: 0; color: var(--muted); }
.tw::before { content: "▾"; }
li[aria-expanded="false"] > .tn .tw::before { content: "▸"; }
.ico { width: 9px; height: 9px; border: 1.5px solid var(--muted); border-radius: 2px; flex: none; }
.ico-chw_pump, .ico-ahu { border-radius: 50%; }
.ico-chiller { border-radius: 1px; background: var(--line2); }
.mark { font-size: 11px; font-weight: 700; border-radius: 8px; padding: 0 6px; margin-right: 4px; }
.mark.q-mark { background: var(--q-bg); border: 1px dashed var(--q-line); color: var(--muted); }
.mark.prio-critical { background: var(--p-critical); color: #200; } .mark.prio-high { background: var(--p-high); color: #1b0d00; }
.mark.prio-medium { background: var(--p-medium); color: #1d1600; } .mark.prio-low { background: var(--p-low); color: #001833; }
@media (prefers-reduced-motion: no-preference) { .blink { animation: blink 1.2s steps(2, start) infinite; } }
@keyframes blink { 50% { opacity: .35; } }

/* page */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.page-head h1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.crumbs { flex-basis: 100%; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs > *:not(:last-child)::after { content: " /"; color: var(--dim); }
.chip-status { font-size: 12px; border-radius: 12px; padding: 2px 10px; border: 1px solid var(--line2); white-space: nowrap; }
.chip-status.ok { color: var(--run); border-color: color-mix(in srgb, var(--run) 45%, transparent); }
.chip-status.bad { color: var(--bad); border-color: var(--bad); }
.chip-status.off { color: var(--dim); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin-right: auto; }
.eq-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.points td:last-child { text-align: right; }
.grid .num { text-align: right; white-space: nowrap; }
.grid .ts { color: var(--muted); white-space: nowrap; font-size: 12.5px; }
.grid tr.off td { color: var(--dim); }
.points .val { font-weight: 600; }
.points tr.bad td { background: repeating-linear-gradient(135deg, var(--q-bg) 0 6px, transparent 6px 12px); }
.points tr.bad .val { color: var(--muted); }
.tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.qual { font-size: 12px; white-space: nowrap; color: var(--muted); }
.qual.q-stale, .qual.q-comm_failure, .qual.q-invalid, .qual.q-out_of_range, .qual.q-uncertain { color: var(--text); background: var(--q-bg); border: 1px dashed var(--q-line); border-radius: 4px; padding: 0 5px; font-weight: 600; }
.qual.q-comm_failure { border-color: var(--bad); color: var(--bad); }
.badge { font-size: 11.5px; font-weight: 600; border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--run) 20%, transparent); color: var(--run); }
.badge.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.badge.pending { background: var(--panel2); color: var(--muted); }
.prio { font-size: 11px; font-weight: 700; text-transform: uppercase; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.prio-critical { background: var(--p-critical); color: #200; } .prio-high { background: var(--p-high); color: #1b0d00; }
.prio-medium { background: var(--p-medium); color: #1d1600; } .prio-low { background: var(--p-low); color: #001833; }
.alarms tr.st-active_unacked .al-msg { font-weight: 600; }
.alarms.compact td { font-size: 12.5px; }
.alarms.compact td:nth-child(4) { display: none; }
.alarms tr.st-cleared td { color: var(--dim); }

/* graphics */
.graphic { width: 100%; height: auto; display: block; max-height: 340px; }
.pipe { fill: none; stroke: var(--line2); stroke-width: 10; stroke-linecap: round; }
.pipe-supply { stroke: color-mix(in srgb, var(--s1) 55%, var(--line2)); }
.pipe-return { stroke: color-mix(in srgb, var(--s1) 25%, var(--line2)); }
.duct { fill: none; stroke: var(--line2); stroke-width: 26; }
.refrigerant { stroke: var(--line2); stroke-width: 4; }
.equip-body { fill: var(--panel2); stroke: var(--stop); stroke-width: 2; }
.equip-sub { opacity: .8; }
.coil { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.equip-mark { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linejoin: round; }
.equip-mark.thin { stroke-width: 1.5; }
.equip[data-state="running"] .equip-body { stroke: var(--run); }
.equip-pump[data-state="running"] .equip-body, .equip-ahu[data-state="running"] .fan .equip-body { fill: color-mix(in srgb, var(--run) 22%, var(--panel2)); }
.equip-pump[data-state="running"] .equip-mark, .equip-ahu[data-state="running"] .fan .equip-mark { stroke: var(--run); }
.equip-chiller[data-state="running"] .equip-body:first-child { fill: color-mix(in srgb, var(--run) 14%, var(--panel2)); }
.equip[data-state="fault"] .equip-body { stroke: var(--bad); fill: color-mix(in srgb, var(--bad) 18%, var(--panel2)); }
.equip[data-state="unknown"] .equip-body { stroke-dasharray: 6 5; }
.g-caption, .g-inner { fill: var(--muted); font-size: 13px; }
.g-flowlabel { fill: var(--dim); font-size: 11.5px; }
.gv-box { fill: var(--bg); stroke: var(--line2); }
.gv-label { fill: var(--muted); font-size: 10.5px; }
.gv-value { fill: var(--text); font-size: 14px; font-weight: 600; }
.gv-q { fill: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .03em; }
.gv-bad .gv-box { fill: var(--q-bg); stroke: var(--q-line); stroke-dasharray: 4 3; }
.gv-bad .gv-value { fill: var(--muted); }
.gv-bad.q-comm_failure .gv-box { stroke: var(--bad); } .gv-bad.q-comm_failure .gv-q { fill: var(--bad); }

/* trend */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button[aria-pressed="true"] { background: var(--panel2); color: var(--text); }
.trend-chart { margin-top: 6px; }
.trend-svg { display: block; width: 100%; height: auto; }
.trend-svg .grid { stroke: var(--line); }
.trend-svg .tick { fill: var(--dim); font-size: 10.5px; }
.trend-svg .unit { fill: var(--muted); }
.trend-svg .line { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.line.s1 { stroke: var(--s1); } .line.s2 { stroke: var(--s2); } .line.s3 { stroke: var(--s3); } .line.s4 { stroke: var(--s4); }
.hatch-bg { fill: var(--q-bg); } .hatch-line { stroke: var(--q-line); stroke-width: 2; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); } .sw.s4 { background: var(--s4); }
.sw-gap { height: 10px; background: repeating-linear-gradient(135deg, var(--q-line) 0 2px, var(--q-bg) 2px 5px); }
.legend { font-size: 12px; color: var(--dim); margin: 8px 0 0; }

/* commands */
.cmd-dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 20px; width: min(460px, calc(100vw - 32px)); }
.cmd-dialog::backdrop { background: rgb(0 0 0 / .55); }
.cmd-dialog h2 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
.cmd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr auto; gap: 2px 8px; align-items: center; padding: 3px 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line2); }
.timeline .done .tl-dot { background: var(--accent); border-color: var(--accent); }
.timeline .fail .tl-dot { background: var(--bad); border-color: var(--bad); }
.timeline .fail .tl-name { color: var(--bad); font-weight: 600; }
.timeline .todo { color: var(--dim); }
.tl-time { color: var(--muted); font-size: 12px; }
.tl-note { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.cmd-item { border-bottom: 1px solid var(--line); padding: 6px 0; }
.cmd-item summary { display: flex; gap: 8px; align-items: center; cursor: pointer; flex-wrap: wrap; }
.cmd-item summary .muted { margin-left: auto; font-size: 12px; }
.cmd-item p { margin: 6px 0 0; font-size: 12.5px; }

/* node view, energy */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.card { display: block; text-decoration: none; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; }
.card:hover { border-color: var(--accent); }
.card-title { font-weight: 600; }
.card-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.card.comms-fault { border-style: dashed; }
main#view > section.panel + section.panel { margin-top: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.kpi { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; }
.kpi summary { cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; list-style: none; }
.kpi summary::-webkit-details-marker { display: none; }
.kpi-name { color: var(--muted); font-size: 12.5px; grid-column: 1 / 3; }
.kpi-value { font-size: 22px; font-weight: 600; }
.kpi .qual { align-self: center; }
.kpi.bad { border-style: dashed; } .kpi.bad .kpi-value { color: var(--muted); }
.formula { font-family: var(--mono); font-size: 12.5px; background: var(--bg); border-radius: 4px; padding: 6px 8px; margin: 10px 0 6px; }
.grid.inputs td { font-size: 12.5px; padding: 3px 4px; }

/* system pages */
.tabs { display: flex; gap: 4px; }
.tabs a { text-decoration: none; padding: 5px 12px; border-radius: 6px; color: var(--muted); }
.tabs a[aria-current="page"] { background: var(--panel2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.formgrid { max-width: 460px; }
.formgrid .btn { margin-top: 12px; }
.sim { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.audit td { font-size: 12.5px; }
.audit .mono { max-width: 260px; overflow-wrap: anywhere; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 9px 16px; transition: .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { border-color: var(--bad); }

@media (max-width: 1100px) { .eq-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 52px 0 0 0; z-index: 4; }
  body.side-open .side { display: block; }
  .menu-btn { display: inline-block; }
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px; }
  .topbar .brand span { display: none; }
  .user span { display: none; }
  .conn { margin-left: auto; }
  .topnav { order: 5; flex-basis: 100%; overflow-x: auto; }
  main#view { padding: 14px 16px 40px; }
}
.q .ts { color: var(--muted); margin-top: 2px; }

/* Gate 3: trends, schedules, alarms tabs, notifications */
.trends-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.sched-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.picker { max-height: 70vh; overflow: auto; }
.picker fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 8px 0; }
.picker legend { font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 0; }
.picker .pick { display: flex; margin: 4px 0; font-size: 13px; }
.range-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.range-row input, .range-row select { width: auto; }
.trend-table { max-height: 420px; overflow: auto; }
.trend-table th { position: sticky; top: 0; background: var(--panel); }
.acts { white-space: nowrap; text-align: right; }
.acts .btn + .btn { margin-left: 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; }
.inline-form h3 { flex-basis: 100%; margin: 4px 0 0; }
.formgrid.wide { max-width: 640px; display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: 6px 12px; align-items: center; }
.formgrid.wide label { margin: 0; }
.formgrid.wide > div { grid-column: 1 / -1; }
.sched-list { list-style: none; margin: 0; padding: 0; }
.sched-list a { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; text-decoration: none; padding: 8px; border-radius: 6px; }
.sched-list a .muted { grid-column: 1; }
.sched-list a .badge { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.sched-list a:hover, .sched-list a[aria-current="page"] { background: var(--panel2); }
.sched-list a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); }
.sched-preview { width: 100%; height: auto; display: block; margin-top: 8px; }
.sched-preview .grid { stroke: var(--line); }
.sched-preview .tick { fill: var(--dim); font-size: 11px; }
.sched-preview .tick.day { fill: var(--muted); font-size: 12px; }
.sched-preview .special { fill: var(--p-medium); }
.sched-off { fill: var(--panel2); }
.sched-on { fill: color-mix(in srgb, var(--run) 55%, var(--panel2)); }
.sw.sched-sw-on { height: 10px; background: color-mix(in srgb, var(--run) 55%, var(--panel2)); }
.sw.sched-sw-off { height: 10px; background: var(--panel2); border: 1px solid var(--line2); }
.week-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 12px; align-items: center; max-width: 620px; margin-bottom: 10px; }
.week-grid label { margin: 0; color: var(--text); }
.cal { border-top: 1px solid var(--line); padding-top: 4px; }
.cal-days { list-style: none; margin: 0; padding: 0; }
.cal-days li { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 13px; }
@media (max-width: 1100px) { .trends-layout, .sched-layout { grid-template-columns: 1fr; } .picker { max-height: 260px; } }
@media (max-width: 760px) { .formgrid.wide, .week-grid { grid-template-columns: 1fr; } .topnav a { padding: 6px 9px; } }

/* Gate 4: field devices */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 6px 0 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 8px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.formgrid.wide .row-actions { justify-content: flex-start; }
.formgrid.wide.sub { max-width: none; margin: 0; }
.formgrid.wide textarea { width: 100%; font-size: 12.5px; }
.formgrid.wide .inline { display: flex; gap: 8px; flex-wrap: wrap; }
.whois { margin: 8px 0; }
.whois summary { cursor: pointer; color: var(--accent); }
.probe-out { min-height: 22px; }
#demo-table td.small { max-width: 420px; }

/* ---- Gate 5: isometric (2.5D) graphics ---------------------------------------------------- */
.graphic.iso { max-height: 560px; }
.graphic.iso-plant { max-height: 820px; }
.iso { --st-t: #4a5360; --st-l: #353c46; --st-r: #2b313a; --water: #4aa8e0; --hot: #ff9a4a; --cool: #5cc4ff; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .iso { --st-t: #d9dee4; --st-l: #b7bfc8; --st-r: #a3acb7; --water: #1f84c6; --hot: #e06a10; --cool: #1690d8; } }
.iso .face { stroke: rgb(0 0 0 / .35); stroke-width: .8; stroke-linejoin: round; }
.iso-ground { fill: color-mix(in srgb, var(--panel2) 80%, var(--bg)); stroke: var(--line); }
.m-steel .t { fill: var(--st-t); } .m-steel .l { fill: var(--st-l); } .m-steel .r { fill: var(--st-r); }
.m-concrete .t { fill: color-mix(in srgb, var(--st-t) 70%, #8a8173); } .m-concrete .l { fill: color-mix(in srgb, var(--st-l) 70%, #6f685c); } .m-concrete .r { fill: color-mix(in srgb, var(--st-r) 70%, #5f584d); }
.m-bldg .t { fill: color-mix(in srgb, var(--st-t) 85%, var(--accent)); } .m-bldg .l { fill: var(--st-l); } .m-bldg .r { fill: var(--st-r); }
.m-unit .t { fill: #8f99a6; } .m-unit .l { fill: #6d7682; } .m-unit .r { fill: #5d6570; }
.m-trough .t { fill: #3d4a57; } .m-trough .l { fill: #2c3742; } .m-trough .r { fill: #25303a; }
.m-pad .t { fill: #c9b37a; } .m-pad .l { fill: url(#iso-pad); } .m-pad .r { fill: #9c8756; }
.pad-bg { fill: #b59d63; } .pad-line { stroke: #8f7a49; stroke-width: 3; }
.m-pump .t { fill: #3f6f9c; } .m-pump .l { fill: #2f5578; } .m-pump .r { fill: #284a69; }
.m-motor .t { fill: #5a6b7d; } .m-motor .l { fill: #46535f; } .m-motor .r { fill: #3b4652; }
.m-panel .t { fill: #c7cdd4; } .m-panel .l { fill: #aeb6bf; } .m-panel .r { fill: #949da7; }
.m-shell .t { fill: #6a7d92; } .m-shell .l { fill: #556678; } .m-shell .r { fill: #4a5969; }
.m-shell-evap .t { fill: #5f86a8; } .m-shell-evap .l { fill: #4b6d8b; } .m-shell-evap .r { fill: #405e78; }
.m-coil .t { fill: #6b8f86; } .m-coil .l { fill: #557269; } .m-coil .r { fill: #4a6560; }
.coil-fin { stroke: rgb(0 0 0 / .28); stroke-width: 1.2; }
.fan-shroud { fill: #2a3038; stroke: #59626e; stroke-width: 2; }
.fan-ring { fill: #1d2228; stroke: #6b7480; stroke-width: 1.5; }
.fan-blade { fill: #9aa4b0; } .fan-hub { fill: #c3cad2; }
.motor-top { fill: #46535f; }
.on .fan-blade, .on.roof-unit .fan-blade { fill: var(--run); }
.spin { transform-box: fill-box; transform-origin: center; animation: iso-spin .9s linear infinite paused; }
.on .spin { animation-play-state: running; }
@keyframes iso-spin { to { transform: rotate(360deg); } }
.pipe-iso { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.water-pipe { stroke: color-mix(in srgb, var(--water) 45%, #59626e); }
.drain-pipe { stroke: #6e6252; }
.chw-pipe { stroke: color-mix(in srgb, var(--s1) 45%, #59626e); }
.chw-pipe.supply { stroke: color-mix(in srgb, var(--s1) 70%, #59626e); }
.hw-pipe { stroke: #59626e; stroke-dasharray: 6 5; stroke-width: 4; }
.flow-line { stroke-dasharray: 10 12; animation: iso-flow 1s linear infinite paused; }
.on .flow-line, .flow-line.on { animation-play-state: running; stroke: var(--water); }
.drain-pipe.flow-line { stroke: #6e6252; }
.on .drain-pipe.flow-line { stroke: #b08a55; }
@keyframes iso-flow { to { stroke-dashoffset: -44; } }
.sump-water { fill: color-mix(in srgb, var(--water) 55%, #1d2833); opacity: .85; }
.trickle { stroke: var(--water); stroke-width: 2; stroke-dasharray: 5 9; opacity: 0; }
.on .trickle { opacity: .85; animation: iso-trickle .7s linear infinite; }
@keyframes iso-trickle { to { stroke-dashoffset: 14; } }
.nozzle { fill: #9aa4b0; }
.drop { fill: var(--water); opacity: 0; }
.on .drop { animation: iso-drop .9s ease-in infinite; }
.on .drop.d1 { animation-delay: .3s; } .on .drop.d2 { animation-delay: .6s; }
@keyframes iso-drop { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
.air { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 10 10; opacity: .25; }
.air.hot, .air-head.hot { stroke: var(--hot); } .air.cool { stroke: var(--cool); }
.air-head { fill: none; stroke-width: 2.5; opacity: .25; }
.airflow.on .air, .airflow.on .air-head { opacity: .9; }
.airflow.on .air { animation: iso-air .8s linear infinite; }
.airflow.on:not(.cooled) .air.cool { stroke: var(--hot); }
@keyframes iso-air { to { stroke-dashoffset: -20; } }
.valve { fill: #59626e; stroke: #8b95a1; stroke-width: 1.2; }
.on .valve { fill: var(--run); }
.hw-dev { fill: none; stroke: #8b95a1; stroke-dasharray: 3 3; }
.hw-label, .led-label, .iso-label { fill: var(--muted); font-size: 10.5px; }
.site-sub { fill: var(--muted); font-size: 12px; }
.site-label { fill: var(--text); font-size: 16px; font-weight: 700; }
.logo-screen { fill: #9fc79a; stroke: #4b5a48; }
.led-dot { fill: #59626e; stroke: rgb(0 0 0 / .4); }
.led.on .led-dot { fill: var(--run); } .led.bad .led-dot { fill: var(--bad); animation: iso-blink 1s steps(2) infinite; } .led.unk .led-dot { fill: none; stroke: var(--q-line); stroke-dasharray: 2 2; }
@keyframes iso-blink { 50% { opacity: .25; } }
.iso-banner .banner-box { fill: var(--bg); stroke: var(--line2); }
.iso-banner .banner-text { fill: var(--text); font-size: 13px; font-weight: 600; }
.iso-banner .banner-dot { fill: var(--stop); }
.iso-banner.lvl-ok .banner-dot { fill: var(--run); } .iso-banner.lvl-ok .banner-box { stroke: var(--run); }
.iso-banner.lvl-warn .banner-dot { fill: var(--p-medium); }
.iso-banner.lvl-alarm .banner-dot { fill: var(--bad); animation: iso-blink 1s steps(2) infinite; } .iso-banner.lvl-alarm .banner-box { stroke: var(--bad); }
.iso-banner.lvl-unknown .banner-box { stroke: var(--q-line); stroke-dasharray: 4 3; }
.trip .m-pump .l, .trip .m-pump .r { fill: color-mix(in srgb, var(--bad) 60%, #2f5578); }
.site-bldg { cursor: pointer; }
.site-bldg:hover .face, .site-bldg:focus .face { stroke: var(--accent); stroke-width: 1.6; }
.site-bldg:focus { outline: none; }
.site-bldg.st-alarm .m-bldg .t { fill: color-mix(in srgb, var(--bad) 35%, var(--st-t)); }
.roof-unit.st-run .m-unit .t { fill: color-mix(in srgb, var(--run) 50%, #8f99a6); }
.roof-unit.st-alarm .m-unit .t { fill: var(--bad); }
.roof-unit.st-nodata .m-unit .t { fill: var(--q-bg); }
.roof-unit.st-off .m-unit .t { fill: #59626e; }
@media (prefers-reduced-motion: reduce) { .iso *, .iso { animation: none !important; } .on .trickle, .on .drop { opacity: .8; } }
.iso-site { max-height: 620px; }
.site-tag { cursor: pointer; }
.site-tag.st-run .site-sub { fill: var(--run); } .site-tag.st-alarm .site-sub { fill: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend .lg::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: #8f99a6; }
.legend .lg.run::before { background: color-mix(in srgb, var(--run) 60%, #8f99a6); } .legend .lg.alarm::before { background: var(--bad); }
.legend .lg.nodata::before { background: var(--q-bg); border: 1px dashed var(--q-line); } .legend .lg.off::before { background: #59626e; }
.eq-grid.wide-graphic { grid-template-columns: 1fr; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.client-card { display: block; text-decoration: none; }
.client-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 6px; font-size: 13px; color: var(--muted); align-items: center; }
.client-stats b { color: var(--text); font-size: 15px; }
.client-stats.big b { font-size: 22px; }
.proj-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.kv.info { grid-template-columns: minmax(110px, max-content) 1fr; }
.row-btns { white-space: nowrap; display: flex; gap: 6px; }
.steps { margin: 0; padding-left: 20px; line-height: 1.6; }
details > summary { cursor: pointer; color: var(--accent); margin: 10px 0 6px; }
textarea { background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding: 7px 9px; width: 100%; font: inherit; color: inherit; }

/* ---- Gate 6 ---------------------------------------------------------------------------------- */
.btn.danger { border-color: color-mix(in srgb, var(--bad) 60%, var(--line2)); color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 15%, var(--panel2)); }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.page-head { flex-wrap: wrap; }
.wide-dialog { width: min(640px, calc(100vw - 32px)); }
.conn-group { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 6px 10px; }
.conn-group > summary { display: flex; gap: 8px; align-items: center; color: var(--text); margin: 4px 0; }
.conn-group > summary .btn { margin-left: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.filters select, .filters input { width: auto; flex: 1 1 160px; }
.cell-sel { padding: 3px 5px; font-size: 12.5px; min-width: 70px; width: auto; max-width: 150px; }
.two-col { align-items: start; }
.unit-sel { max-width: 120px; }
.cell-sel.saving { border-color: var(--p-medium); } .cell-sel.saved { border-color: var(--run); }
.points-map td { vertical-align: middle; }
.points-map tr.prov td { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--q-bg) 60%, transparent) 8px 10px); }
.center { text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); border-radius: 12px; padding: 2px 9px; font-size: 12.5px; background: var(--panel2); }
.chip.mine { border-color: var(--accent); }
.chip.off { opacity: .6; text-decoration: line-through; }
.chip-src { color: var(--muted); font-size: 11px; }
.chip-x { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 13px; }
.chip-x:hover { color: var(--bad); }
.lib-cat > summary, details.panel > summary { list-style: none; }
.inline-h { display: inline; }
.reveal { border: 1px solid var(--accent); border-radius: 8px; padding: 10px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
code.key { background: var(--bg); padding: 4px 8px; border-radius: 4px; user-select: all; word-break: break-all; }
pre.code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow: auto; font: 12.5px/1.5 var(--mono); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 24px; font-weight: 650; margin: 4px 0 2px; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.kpi.good { border-color: color-mix(in srgb, var(--run) 60%, var(--line)); } .kpi.good .kpi-value { color: var(--run); }
.kpi.warn { border-color: color-mix(in srgb, var(--p-medium) 60%, var(--line)); } .kpi.bad { border-color: var(--bad); } .kpi.bad .kpi-value { color: var(--bad); }
.chart { width: 100%; height: auto; }
.chart .grid-line { stroke: var(--line); } .chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--accent); } .chart .bar:hover { fill: var(--s1); } .chart .bar-missing { fill: var(--line2); }
.hbars { display: grid; gap: 8px; margin: 6px 0 10px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 130px; gap: 8px; align-items: center; font-size: 13px; }
.hbar-track { height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.hbar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.tips { display: grid; gap: 10px; }
.tip { border: 1px solid var(--line); border-left: 4px solid var(--line2); border-radius: 6px; padding: 10px 12px; background: var(--panel2); }
.tip.sev-high { border-left-color: var(--bad); } .tip.sev-medium { border-left-color: var(--p-medium); } .tip.sev-low { border-left-color: var(--p-low); }
.tip-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.tip-head h3 { margin: 0; font-size: 14px; flex-basis: 100%; }
.tip p { margin: 6px 0; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; border-radius: 4px; padding: 1px 6px; background: var(--panel); }
.sev-high .sev, .sev.sev-high { color: var(--bad); } .sev.sev-medium { color: var(--p-medium); } .sev.sev-low { color: var(--p-low); } .sev.sev-info { color: var(--muted); }
.tip-cat { color: var(--muted); font-size: 12px; }
.tip-save { margin-top: 6px; }
.m-ct .t { fill: #6f8790; } .m-ct .l { fill: #566b73; } .m-ct .r { fill: #4a5d64; }
.m-header .t { fill: color-mix(in srgb, var(--s1) 60%, #59626e); } .m-header .l, .m-header .r { fill: color-mix(in srgb, var(--s1) 40%, #3b4652); }
.m-header.ret .t { fill: color-mix(in srgb, var(--s1) 25%, #59626e); }
.cw-pipe { stroke: color-mix(in srgb, #4fbf8f 45%, #59626e); }
.on .cw-pipe.flow-line, .cw-pipe.flow-line.on { stroke: #4fbf8f; }
.plant-unit { cursor: pointer; }
.plant-unit:hover .face, .plant-unit:focus .face { stroke: var(--accent); stroke-width: 1.5; }
.plant-unit:focus { outline: none; }
.plant-unit.st-alarm .face.t { fill: color-mix(in srgb, var(--bad) 55%, #59626e); }
.plant-unit.st-off { opacity: .55; }
.plant-unit.st-bypass .face.t { fill: color-mix(in srgb, var(--p-medium) 50%, #59626e); }
.plant-tag.st-run .site-sub { fill: var(--run); } .plant-tag.st-alarm .site-sub { fill: var(--bad); } .plant-tag.st-bypass .site-sub { fill: var(--p-medium); }
.site-label.small { font-size: 12.5px; }
.row-label { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.legend .lg.bypass::before { background: var(--p-medium); }

.hbar-fill.w0 { width: 0%; }
.hbar-fill.w1 { width: 5%; }
.hbar-fill.w2 { width: 10%; }
.hbar-fill.w3 { width: 15%; }
.hbar-fill.w4 { width: 20%; }
.hbar-fill.w5 { width: 25%; }
.hbar-fill.w6 { width: 30%; }
.hbar-fill.w7 { width: 35%; }
.hbar-fill.w8 { width: 40%; }
.hbar-fill.w9 { width: 45%; }
.hbar-fill.w10 { width: 50%; }
.hbar-fill.w11 { width: 55%; }
.hbar-fill.w12 { width: 60%; }
.hbar-fill.w13 { width: 65%; }
.hbar-fill.w14 { width: 70%; }
.hbar-fill.w15 { width: 75%; }
.hbar-fill.w16 { width: 80%; }
.hbar-fill.w17 { width: 85%; }
.hbar-fill.w18 { width: 90%; }
.hbar-fill.w19 { width: 95%; }
.hbar-fill.w20 { width: 100%; }

/* ===================== Gate 7 ===================== */
.appfoot { grid-column: 1 / -1; padding: 6px 16px; font-size: 11.5px; color: var(--dim); border-top: 1px solid var(--line); background: var(--panel); }
.appfoot a { color: var(--muted); }
.check-row { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-size: 13px; } .check-row input { margin-top: 3px; }
.auth-card .foot a { color: var(--muted); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side select#tree-cat { width: calc(100% - 16px); margin: 0 8px 8px; padding: 4px 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; }
body.side-hidden .side { display: none; } body.side-hidden .layout { grid-template-columns: 1fr; }
.side-hide { padding: 2px 8px; }
.group-row td { background: var(--panel2); font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.gpages-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cat-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); font-size: 12.5px; }
.cat-card.warn { border-color: var(--p-medium); } .cat-card.bad { border-color: var(--bad); }
.cat-card .bad, span.bad { color: var(--bad); } span.warn, .warn.small { color: var(--p-medium); }
.keybox { margin-top: 12px; padding: 12px; border: 1px dashed var(--accent); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.keybox code { word-break: break-all; font-size: 13px; }

/* Log Viewer */
.log-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .log-layout { grid-template-columns: 1fr; } }
.grid.logs td { vertical-align: top; } .grid.logs tr { cursor: pointer; } .grid.logs tr:hover td { background: var(--panel2); }
.nowrap { white-space: nowrap; }
.kind-tag { font-size: 11.5px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line2); white-space: nowrap; }
.kind-on { border-color: var(--run); color: var(--run); } .kind-trip, .kind-comm_fail, .kind-alarm { border-color: var(--bad); color: var(--bad); }
.kind-fault { border-color: var(--p-medium); color: var(--p-medium); } .kind-delete { border-color: var(--p-high); color: var(--p-high); }
.kind-add { border-color: var(--accent); color: var(--accent); } .kind-comm_ok { border-color: var(--run); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sev-row-critical td:first-child { box-shadow: inset 3px 0 var(--bad); } .sev-row-warning td:first-child { box-shadow: inset 3px 0 var(--p-medium); }
.log-detail pre.json { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: 11.5px/1.4 var(--mono); max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; font-size: 13px; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.small-kpis .kpi { padding: 8px 12px; } .small-kpis .kpi-value { font-size: 18px; }

/* About / terms */
.about-brand { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; } .about-product { font-size: 22px; }
.terms { max-height: 70vh; overflow: auto; padding-right: 8px; font-size: 13.5px; line-height: 1.55; }
.terms h1 { font-size: 18px; } .terms h2 { margin-top: 20px; } .terms table { border-collapse: collapse; width: 100%; } .terms th, .terms td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.terms .box { border: 1px solid var(--line2); background: var(--panel2); padding: 8px 12px; border-radius: 6px; } .terms .meta { color: var(--muted); font-size: 12px; }
.terms-dialog { width: min(900px, 94vw); }

/* Graphics: symbol materials (2.5D) */
.sym-art, .lib-art, .pal-item svg { overflow: visible; }
.sym .b { fill: #5c6878; } .sym .bt { fill: #7d8a9b; } .sym .bs { fill: #46505d; }
.sym .m { fill: #8f9aa6; } .sym .mt { fill: #b5bec8; } .sym .ms { fill: #6d7782; }
.sym .d { fill: #2c323a; } .sym .w { fill: #3b8fd0; } .sym .wt { fill: #64aee6; } .sym .ws { fill: #2c6fa3; }
.sym .g { fill: #20323f; stroke: #4b6478; stroke-width: 1; } .sym .gt, .sym .gs { fill: #2a4152; }
.sym .a { fill: #c7d0da; } .sym .y { fill: #f2c84b; } .sym .r { fill: #e0574f; } .sym .dt { fill: #3a414a; } .sym .ds { fill: #23282f; }
.sym .pad { fill: #b08a55; } .sym .pad-line { stroke: #8a6a3e; stroke-width: 1.2; }
.sym .d-line, .sym .w-line, .sym .m-line, .sym .y-line, .sym .r-line, .sym .a-line { stroke-width: 1.6; fill: none; stroke-linecap: round; }
.sym .d-line { stroke: #2c323a; } .sym .w-line { stroke: #3b8fd0; } .sym .m-line { stroke: #8f9aa6; stroke-width: 3; } .sym .y-line { stroke: #f2c84b; } .sym .r-line { stroke: #e0574f; } .sym .a-line { stroke: var(--accent); stroke-width: 3; }
.sym .sym-t { fill: #e6e9ed; font: 600 12px var(--sans); }
.sym .pipe { stroke-width: 6; stroke-linecap: round; } .sym .w-pipe { stroke: #2c6fa3; } .sym .r-pipe { stroke: #b54a3a; }
.sym .flow { stroke: #9fd3ff; stroke-width: 2; stroke-dasharray: 4 6; fill: none; opacity: 0; }
.sym .flow.thin { stroke-width: 1.4; } .sym .flow.air { stroke: #c9d6e2; stroke-dasharray: 3 7; stroke-width: 1.6; }
.sym .spray { stroke: #8cc8ff; stroke-width: 1.5; stroke-dasharray: 2 3; opacity: 0; } .sym .spray.flame { fill: #ff9a4a; stroke: none; }
.sym .mist ellipse, .sym .mist path { fill: #cfe7ff; opacity: 0; stroke: none; } .sym .mist path.sig { fill: none; stroke: #ff6b63; }
.sym .sig { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.sym .lamp { fill: #4a525d; stroke: #1a1e23; stroke-width: 1; }
.sym .open { fill: #4a525d; } .sym.s-open .open { fill: var(--run); }
.sym .light { fill: #6b737d; } .sym .beam { fill: #ffe9a8; opacity: 0; }
.sym .blade { transform-box: fill-box; transform-origin: center; transition: transform .6s; }
.sym.s-open .blade { transform: scaleY(.25); }
/* states */
.sym.s-run .lamp { fill: var(--run); }
.sym.s-run .spin { animation-play-state: running; }
.sym.s-run .flow { opacity: .95; animation: iso-flow 1.4s linear infinite; }
.sym.s-run .spray { opacity: .9; animation: iso-trickle .7s linear infinite; }
.sym.s-run .mist ellipse { animation: mist 2.4s ease-in-out infinite; }
.sym.s-run .beam { opacity: .35; } .sym.s-run .light { fill: #ffe08a; }
.sym.sp1 .spin { animation-duration: 2.4s; } .sym.sp2 .spin { animation-duration: 1.4s; } .sym.sp3 .spin { animation-duration: .9s; } .sym.sp4 .spin { animation-duration: .5s; }
.sym.s-stop .lamp { fill: #8b95a1; }
.sym.s-trip .lamp, .sym.s-alarm-on .lamp { fill: var(--bad); animation: blink 1s steps(2) infinite; }
.sym.s-trip > svg { filter: drop-shadow(0 0 4px var(--bad)); animation: blink 1.2s steps(2) infinite; }
.sym.s-fault .lamp { fill: var(--p-medium); animation: blink 1.4s steps(2) infinite; }
.sym.s-comm { opacity: .45; filter: grayscale(1); } .sym.s-nodata { opacity: .7; }
@keyframes mist { 0% { opacity: 0; transform: translateY(0) scale(.8); } 40% { opacity: .75; } 100% { opacity: 0; transform: translateY(10px) scale(1.25); } }
.sym .mist ellipse { transform-box: fill-box; transform-origin: center; }

/* graphic pages */
.gpage-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.gpage { width: 100%; height: auto; display: block; min-width: 900px; }
.gpage-bg { fill: var(--panel); }
.gpage.bg-grid .gpage-bg { fill: var(--panel); } .gpage.bg-dark .gpage-bg { fill: #0d1014; } .gpage.bg-blueprint .gpage-bg { fill: #0f2236; }
.gpage.bg-grid { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 40px 40px; }
.gpage.bg-grid .gpage-bg { fill: transparent; }
.gel.clickable { cursor: pointer; } .gel.clickable:hover .sym-hit { stroke: var(--accent); stroke-width: 2; }
.sym-hit { fill: transparent; stroke: none; rx: 8; }
.sym-label { fill: var(--text); font-size: 13px; font-weight: 600; }
.sym-badge { fill: var(--bad); font: 700 12px var(--sans); }
.glabel { fill: var(--text); font-weight: 600; } .glabel.c-muted { fill: var(--muted); } .glabel.c-accent { fill: var(--accent); } .glabel.c-water { fill: #4aa8e0; } .glabel.c-hot { fill: #ff9a4a; } .glabel.c-warn { fill: var(--p-medium); }
.gvalue-box { fill: var(--bg); stroke: var(--line2); } .gvalue { fill: var(--text); font-weight: 700; font-family: var(--mono); } .gvalue-cap { fill: var(--muted); font-size: 10px; }
.gel-value.q-bad .gvalue { fill: var(--dim); } .gel-value.s-alarm-on .gvalue-box { stroke: var(--bad); stroke-width: 2; }
.gpipe { stroke: #2c6fa3; stroke-linecap: round; } .gpipe.p-hot { stroke: #b54a3a; } .gpipe.p-muted { stroke: var(--line2); } .gpipe.p-accent { stroke: var(--accent); } .gpipe.p-water { stroke: #2c6fa3; } .gpipe.p-warn { stroke: var(--p-medium); }
.gflow { stroke: #9fd3ff; stroke-width: 2.4; stroke-dasharray: 6 10; opacity: 0; fill: none; }
.gel-pipe.s-run .gflow, .gflow.always { opacity: .9; animation: iso-flow 1.4s linear infinite; }
.gbox { fill: color-mix(in srgb, var(--panel2) 60%, transparent); stroke: var(--line2); stroke-dasharray: 6 4; } .gbox-t { fill: var(--muted); font-size: 13px; font-weight: 600; }
.gel-box.s-alarm-on .gbox { stroke: var(--bad); stroke-dasharray: none; }
.gbtn, .glink { fill: var(--panel2); stroke: var(--accent); } .gbtn { fill: var(--accent); } .gbtn-t { fill: var(--text); font-size: 13px; font-weight: 600; }
.gel-button .gbtn-t { fill: var(--accent-ink); }

/* editor */
.ged { display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
@media (max-width: 1200px) { .ged { grid-template-columns: 200px minmax(0, 1fr); } .ged-side { grid-column: 1 / -1; } }
.ged-pal, .ged-side { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: calc(100vh - 170px); overflow: auto; }
.ged-pal h3 { margin-top: 0; } .ged-pal h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 6px; }
.ged-pal input[type=search] { width: 100%; padding: 5px 8px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; }
.pal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pal-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; cursor: grab; font-size: 10.5px; line-height: 1.2; text-align: center; color: var(--muted); }
.pal-item:hover { border-color: var(--accent); color: var(--text); }
.pal-basic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--bg); font-weight: 700; color: var(--accent); }
.ged-canvas { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: calc(100vh - 170px); }
.ged-canvas .gpage { min-width: 1000px; }
.gpage.editing .gel { cursor: move; } .gpage.editing .sym-hit { stroke: var(--line2); stroke-dasharray: 3 3; }
.gpage.editing .gel.selected .sym-hit, .gpage.editing .gel.selected rect:first-child { stroke: var(--accent); stroke-width: 2; stroke-dasharray: none; }
.ged-handle { fill: var(--accent); cursor: nwse-resize; }
.ged-side h3:first-child { margin-top: 0; }
.formgrid.tight { grid-template-columns: 110px 1fr; gap: 6px 8px; } .formgrid.tight input, .formgrid.tight select { width: 100%; }
.ged-bind { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.ged-bind-h { font-size: 12px; font-weight: 600; } .ged-bind-r { display: flex; gap: 4px; } .ged-bind-r select { flex: 1; min-width: 0; } .ged-bind-r .op { flex: 0 0 110px; }
.cell-in { width: 80px; padding: 3px 5px; font-size: 12.5px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* library gallery */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.lib-card { margin: 0; padding: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.lib-card .lib-art { width: 110px; height: 110px; } .lib-card figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.sev { font-size: 11px; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; font-weight: 700; }
.sev.sev-high { background: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }
.sev.sev-medium { background: color-mix(in srgb, var(--p-medium) 25%, transparent); color: var(--p-medium); }
.sev.sev-low { background: color-mix(in srgb, var(--p-low) 20%, transparent); color: var(--p-low); }
.picker .filters { position: sticky; top: 0; background: var(--panel); padding-bottom: 6px; z-index: 1; }
textarea { font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 6px 8px; width: 100%; }
[hidden] { display: none !important; }
.inline-form select, .inline-form input { max-width: 100%; }
.auth-card .check-row input { width: auto; flex: 0 0 auto; margin: 3px 0 0; } .auth-card .check-row label { flex: 1; margin: 0; }

/* ---- 0.7.1: equipment graphics on pages, uploaded images, show-when, schedule time pickers ---- */
.gpage .gel.ghost { opacity: .35; }
.gpage svg.gtpl { overflow: visible; }
.gpage.editing .gel-template .sym-hit, .gpage.editing .gel-image .sym-hit { fill: transparent; }
.gel-image .gimg-wrap { transform-box: fill-box; transform-origin: center; }
.gel-image.s-trip .gimg-wrap { filter: drop-shadow(0 0 6px var(--bad)); animation: g-blink 1s steps(2) infinite; }
.gel-image.s-alarm-on .gimg-wrap { filter: drop-shadow(0 0 5px var(--bad)); }
.gel-image.q-bad .gimg-wrap { filter: grayscale(1) opacity(.6); }
.gimg-wrap.anim-spin.on { animation: g-spin 2s linear infinite; }
.gimg-wrap.anim-pulse.on { animation: g-pulse 1.4s ease-in-out infinite; }
.gimg-wrap.anim-blink.on { animation: g-blink 1s steps(2) infinite; }
.gimg-wrap.anim-bounce.on { animation: g-bounce 1.2s ease-in-out infinite; }
.gimg-wrap.anim-shake.on { animation: g-shake .35s linear infinite; }
.gimg-wrap.anim-glow.on { animation: g-glow 1.6s ease-in-out infinite; }
@keyframes g-spin { to { transform: rotate(360deg); } }
@keyframes g-pulse { 50% { transform: scale(1.08); } }
@keyframes g-blink { 50% { opacity: .25; } }
@keyframes g-bounce { 50% { transform: translateY(-8%); } }
@keyframes g-shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes g-glow { 50% { filter: drop-shadow(0 0 8px var(--ok, #3fb950)); } }
@media (prefers-reduced-motion: reduce) { .gimg-wrap.on { animation: none !important; } }
.pal-upload { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pal-img { object-fit: contain; border-radius: 4px; background: var(--bg); }
.pal-tpl { pointer-events: none; }
.ged-cap { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; margin: 3px 0; }
.ged-bind.bound .ged-bind-h { color: var(--accent); }
.graphic-panel .gpage { min-width: 0; }
.graphic-panel .gpage-wrap { border: 0; }
.siteplan-switch { display: inline-flex; gap: 4px; }
.periods { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.period { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; }
.period input[type="time"] { width: 7.2em; padding: 2px 4px; }
.period .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 4px; }
.period .x:hover { color: var(--bad); }
.periods .off-note { color: var(--muted); font-size: 12px; }
.month-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }

/* Schedule time pickers */
.week-grid { max-width: 760px; }
.pe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 4px 0; }
.pe-rows { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-row { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2, var(--bg)); }
.pe-row input[type=time] { width: auto; min-width: 108px; padding: 4px 6px; }
.pe-tools { display: inline-flex; gap: 6px; }
.pe-off { font-style: italic; }
.pe-month { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.pe-month select { width: auto; }
.stack.tight { gap: 4px; }
.row-actions.left { justify-content: flex-start; margin: 0 0 10px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); }
.inline-form .pe { flex: 1 1 auto; }
/* text on dark page backgrounds */
.gpage.bg-dark .glabel, .gpage.bg-blueprint .glabel, .gpage.bg-dark .sym-label, .gpage.bg-blueprint .sym-label { fill: #e3eaf2; }
.gpage.bg-dark .gbox, .gpage.bg-blueprint .gbox { fill: rgba(120, 160, 200, .10); stroke: #4d6c8c; }
.gpage.bg-dark .gbox-t, .gpage.bg-blueprint .gbox-t { fill: #a9c1d9; }
.gpage.bg-dark .glabel.c-muted, .gpage.bg-blueprint .glabel.c-muted { fill: #9fb3c8; }

/* Client → Project → Equipment picker */
.cpe { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cpe-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cpe-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cpe-row label { margin: 0; }
.cpe-row select, .cpe-new select, .cpe-new input { width: 100%; min-width: 0; }
.cpe-new { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr); gap: 8px; align-items: center; }
@media (max-width: 760px) { .cpe-row, .cpe-new { grid-template-columns: 1fr; } }

/* lines, pipes, ducts and cables on graphic pages */
.gline-hit { fill: none; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; }
.gline { fill: none; stroke: var(--text); stroke-linecap: round; stroke-linejoin: round; }
.gel-line.k-dash .gline { stroke-dasharray: 8 6; stroke: var(--muted); }
.gel-line.k-chws .gline { stroke: #1f6fc0; } .gel-line.k-chwr .gline { stroke: #5fb2ec; }
.gel-line.k-cws .gline { stroke: #2e9a63; } .gel-line.k-cwr .gline { stroke: #78c99a; }
.gel-line.k-hws .gline { stroke: #c8432f; } .gel-line.k-hwr .gline { stroke: #e98a5a; }
.gel-line.k-water .gline { stroke: #3aa0c9; } .gel-line.k-mist .gline { stroke: #7fd6f0; }
.gel-line.k-drain .gline { stroke: #8a6a3e; stroke-dasharray: 10 5; } .gel-line.k-refrig .gline { stroke: #8f6bd6; }
.gel-line.k-power .gline { stroke: #e08a1e; } .gel-line.k-signal .gline { stroke: #a77fe0; stroke-dasharray: 6 4; } .gel-line.k-bus .gline { stroke: #3fb27f; stroke-dasharray: 10 4 2 4; }
.gline.c-muted { stroke: var(--muted); } .gline.c-accent { stroke: var(--accent); } .gline.c-water { stroke: #2c6fa3; } .gline.c-hot { stroke: #b54a3a; } .gline.c-warn { stroke: var(--p-medium); }
.gduct-o { fill: none; stroke: #7d8a97; stroke-linejoin: miter; stroke-linecap: butt; }
.gduct-i { fill: none; stroke-linejoin: miter; stroke-linecap: butt; }
.gel-line.k-duct_sa .gduct-i { stroke: #a9cde8; } .gel-line.k-duct_ra .gduct-i { stroke: #b9d6c4; }
.gel-line.k-duct_oa .gduct-i { stroke: #c7e3a6; } .gel-line.k-duct_ea .gduct-i { stroke: #cbbba6; }
.gel-line .gflow { stroke-linecap: round; stroke-linejoin: round; }
.gel-line .gflow.air { stroke: #ffffff; stroke-dasharray: 3 9; }
.gel-line.s-run .gflow, .gel-line .gflow.always { opacity: .9; animation: iso-flow 1.4s linear infinite; }
.gel-line.s-alarm-on .gline, .gel-line.s-alarm-on .gduct-o { stroke: var(--bad); }
.gel-line.q-bad { opacity: .45; }
.garrow { fill: var(--text); }
.gline-t { fill: var(--text); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.gpage.bg-dark .gline-t, .gpage.bg-blueprint .gline-t { fill: #e3eaf2; stroke: #0f2236; }
.gpage.bg-dark .gel-line.k-line .gline, .gpage.bg-blueprint .gel-line.k-line .gline { stroke: #c9d6e2; }
.gpage.editing .gel-line.selected .gline-hit { stroke: color-mix(in srgb, var(--accent) 30%, transparent); }
.gel-line.clickable { cursor: pointer; }

/* graphic editor: toolbar, advanced tools, layers, line handles, full screen */
.ged-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ged-toolbar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.ged-tb-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ged-tb-group .btn.sm { padding: 3px 8px; min-width: 28px; }
.ged-tb-group select.cell-sel { width: auto; padding: 3px 6px; }
.ged-sep { width: 1px; align-self: stretch; background: var(--line2); margin: 0 4px; }
.ged-zoom { min-width: 46px; text-align: center; font-family: var(--mono); }
.ged-advlbl { font-weight: 600; margin-right: 6px; }
.ged-hint { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.ged-canvas { max-height: calc(100vh - 230px); }
.ged-canvas .gpage { min-width: 0; }
.ged-canvas.drawing .gpage { cursor: crosshair; }
.ged-canvas.can-connect .gpage { cursor: copy; }
.ged-canvas.show-grid .gpage { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); }
.ged-canvas.show-grid .gpage .gpage-bg { fill-opacity: .55; }
.ged-vtx { fill: var(--panel); stroke: var(--accent); stroke-width: 2.5; cursor: move; }
.ged-vtx.end { fill: var(--accent); } .ged-vtx.attached { fill: var(--run, #3fb950); stroke: #fff; }
.ged-selbox { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
.ged-selbox.locked { stroke: var(--muted); }
.ged-band { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: var(--accent); stroke-dasharray: 4 3; pointer-events: none; }
.gpage.editing .gel.locked { cursor: not-allowed; }
.pal-item.active { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); }
.pal-line { background: var(--panel2); border-radius: 6px; }
.ged-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.ged-tab { flex: 1; padding: 5px 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); border-radius: 6px; font-weight: 600; cursor: pointer; }
.ged-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ged-layer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ged-layer-list li { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.ged-layer-list li:hover { background: var(--panel2); }
.ged-layer-list li.on { background: color-mix(in srgb, var(--accent) 20%, var(--panel2)); }
.ged-layer-list li.off .ged-ln { opacity: .45; text-decoration: line-through; }
.ged-lt { width: 16px; text-align: center; color: var(--muted); } .ged-ln { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ged-lb { color: var(--accent); font-size: 9px; }
.ged-ico { background: none; border: 0; padding: 0 2px; cursor: pointer; font-size: 12px; color: var(--text); }
.ged-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 8px 0; }
.ged-end { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.ged-end select { width: auto; }
/* full screen editing: only the editor, nothing around it */
body.ged-focus .topbar, body.ged-focus .side, body.ged-focus .appfoot { display: none !important; }
body.ged-focus .layout { display: block; }
body.ged-focus #view { padding: 8px 10px; max-width: none; }
body.ged-focus #view > .page-head { margin-bottom: 6px; }
body.ged-focus .ged { grid-template-columns: 230px minmax(0, 1fr) 320px; }
body.ged-focus .ged-pal, body.ged-focus .ged-side { max-height: calc(100vh - 80px); }
body.ged-focus .ged-canvas { max-height: calc(100vh - 140px); }
.ged-canvas .gpage, .ged-canvas .gpage text { user-select: none; -webkit-user-select: none; }
.pal-line { width: 44px; height: 44px; flex: none; }

/* project: Home Page / Plant Overview / Equipment */
.proj-tabs { margin-left: 8px; }
.eq-group { margin-bottom: 14px; } .eq-group h3 { margin: 6px 0 8px; font-size: 14px; }
.eq-card { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.eq-card .card-link { color: inherit; text-decoration: none; } .eq-card .card-link:hover .card-title { color: var(--accent); }
.eq-card .card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sub-tabs { margin: -4px 0 10px; flex-wrap: wrap; }
.sub-tabs a { font-size: 13px; }
.cmd-dialog.wide-dialog { width: min(620px, calc(100vw - 32px)); }
.cmd-dialog.wide-dialog .formgrid.wide { grid-template-columns: 180px minmax(0, 1fr); }
.cmd-dialog.wide-dialog select, .cmd-dialog.wide-dialog input { width: 100%; }
@media (max-width: 760px) { .cmd-dialog.wide-dialog .formgrid.wide { grid-template-columns: 1fr; } }
.proj-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.proj-pick .check-row { margin: 0; font-size: 13px; }
/* client → project pickers */
.pp { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pp select { width: auto; max-width: 260px; padding: 4px 8px; }
.pp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 10px; }
.inline-form.wrap { flex-wrap: wrap; }
.lib-details { margin-top: 12px; } .lib-details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }

.side-grip { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; touch-action: none; }
.side-grip:hover, .side-grip:active { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.side-tools { display: flex; gap: 4px; margin: 6px 0; }
@media (max-width: 760px) { .side-grip { display: none; } }
.alarm-cfg select { min-width: 104px; width: auto; } .alarm-cfg .cell-in { width: 84px; } .alarm-cfg td { vertical-align: middle; }
.proj-pick label.check-row { display: flex; grid-template-columns: none; align-items: flex-start; justify-content: flex-start; gap: 6px; text-align: left; width: auto; padding: 2px 0; }
.proj-pick label.check-row input { width: auto; margin: 2px 0 0; flex: none; }
.export-btns { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
/* adiabatic pre-cooler: running (wet, dark pads) / stopped (dry, pale pads, plate) / no data */
.iso [data-part="wetwalls"].on .m-pad { filter: saturate(1.15) brightness(.88); }
.iso [data-part="wetwalls"].stopped .m-pad { filter: saturate(.35) brightness(1.18); }
.iso [data-part="wetwalls"].stopped .water-pipe, .iso [data-part="wetwalls"].nodata .water-pipe { stroke: #8f98a3; }
.iso [data-part="wetwalls"].nodata { opacity: .55; filter: grayscale(.8); }
.iso .stop-plate { display: none; }
.iso [data-part="wetwalls"].stopped .stop-plate, .iso [data-part="wetwalls"].nodata .stop-plate { display: inline; }
.iso .stop-plate rect { fill: rgba(30, 36, 44, .86); stroke: #f2c84b; stroke-width: 1.5; }
.iso .stop-plate text { fill: #f2c84b; font: 700 13px var(--sans); letter-spacing: .06em; }
.iso [data-part="wetwalls"].nodata .stop-plate rect { stroke: #9aa3ad; } .iso [data-part="wetwalls"].nodata .stop-plate text { fill: #e3e7ec; }
/* library symbol: wet pads darken while running, stay pale when stopped */
.sym.s-stop .pad, .sym.s-idle .pad { fill: #d3c29a; } .sym.s-run .pad { fill: #9a7a48; }

.lib-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 4px 0 8px; }
.lib-tools input[type=search] { flex: 1 1 260px; min-width: 0; }

/* ===================================================================================================
   Kavento visual refinement (Oct 2026)
   Control-room restraint after ISA-101: graphite neutrals for normal state, colour only for running,
   alarms and bad data. The instrument layer (brand, menus, headings, values, table heads) is set in
   DIN (Bahnschrift on Windows) like plant signage; reading text stays in Segoe UI.
   =================================================================================================== */
:root {
  --bg: #0e1315; --panel: #141b1e; --panel2: #1a2327; --line: #232e33; --line2: #31404a;
  --text: #e4e9ea; --muted: #8b999f; --dim: #64737a;
  --accent: #35b5a2; --accent-ink: #04211c;
  --din: "Bahnschrift", "DIN Alternate", "DIN 2014", "Barlow", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --r-panel: 10px; --r-ctl: 6px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #edf0f1; --panel: #ffffff; --panel2: #f4f6f7; --line: #dde3e5; --line2: #c8d0d4;
    --text: #172024; --muted: #5a676d; --dim: #7c888e; --accent: #0e7a6c; --accent-ink: #ffffff;
  }
}
body { font: 14px/1.5 var(--sans); }
h1, h2, h3, .topnav a, .tabs a, .brand, .kpi-value, .grid th, .badge, .chip-status, .btn, .count, .ged-tab { font-family: var(--din); }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.005em; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
h3 { font-size: 14px; font-weight: 600; }
.panel { border-radius: var(--r-panel); padding: 16px 18px; }
.panel-head { gap: 10px 12px; margin-bottom: 12px; }
.panel-head input[type=search], .panel-head select { width: auto; min-width: 150px; }
.btn, input, select, textarea { border-radius: var(--r-ctl); }
.btn { font-weight: 500; letter-spacing: 0.01em; }
.grid th { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }
.grid td { padding: 8px; }
.grid.compact td { padding: 6px 8px; }
.grid tbody tr:hover td { background: color-mix(in srgb, var(--panel2) 70%, transparent); }
.grid tr.unmapped td { color: var(--muted); }
.kpi-value { font-weight: 500; letter-spacing: -0.01em; }

/* top bar: the wordmark is the one bold element */
.topbar { padding: 10px 18px; gap: 22px; }
.brand .wordmark { font-family: var(--din); font-weight: 700; font-size: 21px; letter-spacing: 0.02em; }
.topnav a { font-size: 14.5px; padding: 6px 12px; }
.topnav a[aria-current="page"] { background: transparent; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.tabs a[aria-current="page"] { background: transparent; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.appfoot { font-size: 12px; }

/* licence and simulation banners */
.licence-banner { padding: 6px 18px; font-size: 13px; text-align: center; border-bottom: 1px solid var(--line); }
.licence-banner.warn { background: color-mix(in srgb, var(--p-medium) 14%, var(--panel)); color: var(--text); }
.licence-banner.expired { background: color-mix(in srgb, var(--p-critical) 18%, var(--panel)); color: var(--text); font-weight: 600; }

/* System Browser: a visible handle to bring it back when hidden */
.side-show { display: none; }
body.side-hidden .side-show { display: inline-flex; position: fixed; left: 0; top: 50%; z-index: 4; transform: translateY(-50%); writing-mode: vertical-rl; gap: 6px; align-items: center;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line2); border-left: 0; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; padding: 12px 5px; cursor: pointer; font: 500 12.5px var(--din); }
body.side-hidden .side-show:hover { color: var(--text); border-color: var(--accent); }
body.side-hidden .side-show span:first-child { writing-mode: horizontal-tb; }

/* toolbars and helpers */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; }
.toolbar .inline { display: inline-flex; align-items: center; gap: 6px; }
.toolbar select { width: auto; }
.toolbar-gap { flex: 1; }
.eq-search { flex: 1 1 220px; }
.after-save { margin-left: 4px; }
.back-btn { margin-right: 4px; }
.ok-text { color: var(--run); font-weight: 600; } .bad-text { color: var(--bad); font-weight: 600; }
.box { border: 1px solid var(--line2); background: var(--panel2); padding: 10px 12px; border-radius: var(--r-ctl); margin: 10px 0; }
.about-lead { font-family: var(--din); font-size: 16px; margin: 6px 0 12px; }
.keybox textarea { width: 100%; word-break: break-all; font-size: 12px; }
.badge.warn { background: color-mix(in srgb, var(--p-medium) 22%, transparent); color: var(--p-medium); }

/* commissioning */
.howto summary { cursor: pointer; font-family: var(--din); font-weight: 600; }
.howto { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 12px 18px; }
.howto .steps li { margin: 6px 0; }
.small-kpis { margin: 0; }
.conn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.conn-card { border: 1px solid var(--line2); border-radius: var(--r-ctl); padding: 10px 12px; display: grid; gap: 6px; background: var(--panel2); }
.conn-card.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--line2)); }
.conn-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.conn-card-head a { text-decoration: none; }
.conn-card-stats { display: flex; gap: 14px; font-size: 13px; }

/* equipment electrical & water data */
details.specs > summary { display: flex; align-items: baseline; gap: 6px; cursor: pointer; list-style: none; }
details.specs > summary::-webkit-details-marker { display: none; }
details.specs > summary h2 { display: inline; }
.inrush { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.inrush > div { display: grid; gap: 2px; padding: 10px 12px; background: var(--panel2); border-radius: var(--r-ctl); border: 1px solid var(--line); }
.inrush strong { font-family: var(--din); font-size: 22px; font-weight: 500; }
.sim-params { margin-top: 12px; } .sim-params summary { cursor: pointer; font-family: var(--din); font-weight: 600; }

/* graphic editor: Points tab */
.ged-pts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.ged-pt { width: 100%; display: flex; justify-content: space-between; gap: 8px; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 6px 8px; cursor: pointer; }
.ged-pt:hover { border-color: var(--accent); }
.gpages-bar .btn.ghost { border-style: dashed; }

.conn-card { min-width: 0; }
.conn-card .row-btns { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
.conn-card-head strong { overflow-wrap: anywhere; }
.conn-card-head .badge { flex: none; }
.conn-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.more-row { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
details.specs > summary::before { content: '▸'; color: var(--muted); margin-right: 6px; } details.specs[open] > summary::before { content: '▾'; }

/* Help (Super Admin) */
.help-search { margin: 0 0 14px; max-width: 520px; }
.help-search input { width: 100%; }
.help-area + .help-area { margin-top: 18px; }
.help-area h3 { margin: 0 0 4px; }
.help-table td:first-child { white-space: nowrap; font-weight: 600; }
.help-table td:last-child { color: var(--muted); min-width: 140px; }
.help-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.help-step { border: 1px solid var(--line2); border-radius: 8px; padding: 12px 14px; background: var(--panel2); }
.help-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.help-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; flex: none; }
.help-step ul { margin: 6px 0; padding-left: 20px; }
.help-step li { margin: 2px 0; }
.help-where { color: var(--muted); }
.help-check { margin: 4px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.src-pick { border: 1px solid var(--line2); border-radius: 8px; padding: 8px 12px; margin: 0; display: grid; gap: 4px; }
.src-pick legend { padding: 0 4px; font-weight: 600; }
#mp-from { width: 100%; min-height: 160px; }
.cmd-dialog .check-row { margin: 4px 0; justify-content: flex-start; text-align: left; }
.cmd-dialog .check-row input { width: auto; flex: 0 0 auto; margin: 3px 0 0; }
.cmd-dialog .check-row label { flex: 1; margin: 0; text-align: left; }
/* plant overview: labels stay readable over pipes and equipment */
.iso-plant .plant-tag text, .iso-plant .row-label { paint-order: stroke; stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round; }
.rc-usage { max-height: 260px; overflow: auto; }
.perm-pick { display: grid; gap: 8px; }
.perm-group { border: 1px solid var(--line2); border-radius: 8px; padding: 6px 12px; margin: 0; }
.perm-group legend { font-weight: 600; padding: 0 4px; }
.perm-group .check-row { margin: 3px 0; }
.perm-group .check-row input { width: auto; flex: none; }
.role-chip { display: inline-block; font-weight: 600; margin-right: 6px; }
.group-row td { background: var(--panel2); }
.hand-tag { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 1px 8px; border-radius: 4px; background: color-mix(in srgb, var(--p-medium) 22%, transparent); color: var(--p-medium); font-weight: 700; font-size: 12px; }
.hand-tag.big { font-size: 13px; padding: 3px 10px; }
.hand-box { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--p-medium); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: color-mix(in srgb, var(--p-medium) 10%, transparent); }
.hand-sign { font-size: 28px; line-height: 1; }
.mode-chip { font-size: 12px; font-weight: 700; border-radius: 4px; padding: 2px 8px; border: 1px solid var(--line2); }
.mode-chip.auto { color: var(--run); border-color: color-mix(in srgb, var(--run) 50%, transparent); }
.mode-chip.manual { color: var(--p-medium); border-color: var(--p-medium); }
.sp-list { max-height: 360px; overflow: auto; display: grid; gap: 2px; margin: 8px 0; }
/* client and project of the current page */
.ctx-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 18px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.ctx-item { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; color: inherit; }
.ctx-k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ctx-v { font-size: 15px; color: var(--accent); letter-spacing: .01em; }
.ctx-sep { color: var(--muted); font-size: 16px; }

/* Equipment page on one screen (desktop): graphic + tabs on the left; on the right the control panel with two pages */
.eq-screen { display: grid; grid-template-columns: minmax(0, 1fr) var(--eq-side-w, minmax(340px, 34%)); gap: 10px; min-height: 420px; }
.eq-screen.side-folded { grid-template-columns: minmax(0, 1fr) 0; gap: 0; }
.eq-screen.side-folded .eq-side { visibility: hidden; overflow: hidden; }
.eq-screen > * { min-height: 0; }
.eq-main { display: flex; flex-direction: column; min-height: 0; margin: 0; }
.eq-main > .panel-head { margin-bottom: 6px; }
.eq-tabs { display: flex; gap: 4px; margin-right: auto; }
.eq-tabs .tab-btn { background: none; border: 0; border-bottom: 2px solid transparent; padding: 4px 10px; color: var(--muted); font: inherit; cursor: pointer; }
.eq-tabs .tab-btn[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.eq-pane { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.eq-pane-graphic { overflow: hidden; align-items: stretch; justify-content: center; }
.eq-pane-graphic > .graphic, .eq-pane-graphic > svg { flex: 1; width: 100%; height: 100%; max-height: none; min-height: 0; }
.eq-pane-graphic > .gpage-wrap { flex: 1; min-height: 0; overflow: auto; }
.eq-pane-graphic .gpage-wrap svg { width: 100%; height: 100%; }
.eq-pane > .panel, .eq-pane > details.panel { border: 0; box-shadow: none; padding: 0; margin: 0; background: transparent; }
.eq-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.eq-box { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; margin: 0; }
.eq-box-big { flex: 2 1 0; }
.eq-box > .panel-head { margin-bottom: 6px; }
.eq-scroll { flex: 1; min-height: 0; overflow: auto; }
.eq-export { padding-top: 6px; }
.eq-screen ~ * { display: none; }
/* control panel pages: 1 override & setpoints · 2 open alarms & recent commands */
.eq-sidetabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex: none; }
.eq-stab { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 7px 8px; font: inherit; font-family: var(--din); color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
.eq-stab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.eq-stab .count { font-size: 11px; }
.eq-page[hidden] { display: none !important; }
.eq-side > .eq-page { flex: 1 1 0; min-height: 0; }
.eq-page-log { display: flex; flex-direction: column; gap: 10px; }
.eq-page-log > .eq-box { flex: 1 1 0; }
.split-grip.bottom { top: -9px; bottom: auto; left: 0; right: 0; width: auto; height: 8px; cursor: row-resize; }
.split-grip.bottom::after { top: 3px; left: 50%; width: 40px; height: 2px; margin: 0 0 0 -20px; }
body.splitting-v, body.splitting-v * { cursor: row-resize !important; user-select: none !important; }
@media (max-width: 1100px) {
  .eq-screen { grid-template-columns: 1fr; height: auto !important; }
  .split-grip.right, .split-grip.left { display: none; }
  .eq-main { min-height: 360px; }
  .eq-box, .eq-box-big { flex: none; }
  .eq-scroll { max-height: 320px; }
}
.eq-head { margin-bottom: 10px; row-gap: 4px; }
.eq-crumbline { display: flex; align-items: center; gap: 12px; width: 100%; }
.eq-crumbline .crumbs { margin: 0; }
.eq-side .alarm-row, .eq-side .alarm { flex-wrap: wrap; }
.hist-nav { display: inline-flex; gap: 4px; }
.hist-btn { min-width: 34px; font-size: 15px; line-height: 1; padding: 4px 8px; }
/* top bar fits with the history buttons */
.topbar { gap: 14px; }
.topnav { flex-wrap: wrap; min-width: 0; }
.topnav a { padding: 6px 9px; }
@media (max-width: 1500px) { .topbar .user > span .muted { display: none; } }
/* alarms in the narrow equipment side column: one block per alarm */
.eq-side table tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.eq-side table thead { display: none; }
.eq-side table td { border: 0; padding: 0; }
.eq-side .points tr { display: table-row; } .eq-side .points thead { display: table-header-group; } .eq-side .points td { padding: 8px; border-bottom: 1px solid var(--line); }
.eq-side tr.al td:nth-child(5) { display: none; }
.eq-side tr.al td:nth-child(3) { grid-column: 1 / 2; color: var(--muted); font-size: 12px; }
.eq-side tr.al td.ts { grid-column: 2 / 3; color: var(--muted); font-size: 12px; }
.eq-side tr.al td.acts { grid-column: 1 / -1; display: flex; gap: 6px; }
.eq-side tr.al td.acts:empty { display: none; }
.eq-side .eq-box:last-child { flex: 0.8 1 0; }
.src-pick .check-row { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin: 3px 0; text-align: left; }
.src-pick .check-row input { width: auto; flex: none; margin: 0; }
.src-pick .check-row label { flex: 1; margin: 0; text-align: left; }
/* ultrasonic level sensor: pulses travel down to the water while the sensor is healthy */
.sym .usw { fill: none; stroke: #7cc4ff; stroke-width: 2.2; stroke-linecap: round; opacity: 0; }
.sym .usonic .usw { animation: us-pulse 1.5s linear infinite; } .sym .usonic .u2 { animation-delay: .3s; } .sym .usonic .u3 { animation-delay: .6s; }
.sym.s-fault .usw, .sym.s-comm .usw, .sym.s-nodata .usw { animation: none; opacity: 0; }
@keyframes us-pulse { 0% { opacity: 0; } 20% { opacity: .95; } 100% { opacity: 0; } }
/* hooter: sound waves while sounding */
.sym .snd { fill: none; stroke: #ff8a3d; stroke-width: 2.2; stroke-linecap: round; opacity: 0; }
.sym.s-run .snd, .sym.s-alarm-on .snd, .sym.s-trip .snd { animation: snd 0.9s ease-out infinite; } .sym .snd.s2 { animation-delay: .15s; } .sym .snd.s3 { animation-delay: .3s; }
@keyframes snd { 0% { opacity: 0; transform: translateX(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateX(4px); } }
.sym .sound path { transform-box: fill-box; }
/* indication lamp: lens colour by state */
.sym .pilot { fill: #3a2f2a; stroke: #1a1e23; stroke-width: 1; } .sym .pilot-glow { fill: none; stroke: none; } .sym .pilot-hi { fill: #ffffff; opacity: .25; }
.sym.s-run .pilot { fill: #3fd27a; } .sym.s-run .pilot-glow { fill: #3fd27a; opacity: .22; }
.sym.s-trip .pilot, .sym.s-alarm-on .pilot { fill: #ff4b42; animation: blink 1s steps(2) infinite; } .sym.s-trip .pilot-glow, .sym.s-alarm-on .pilot-glow { fill: #ff4b42; opacity: .25; animation: blink 1s steps(2) infinite; }
.sym.s-fault .pilot { fill: #f2b23b; } .sym.s-fault .pilot-glow { fill: #f2b23b; opacity: .22; }
/* signal tower */
.sym .tower { stroke: #1a1e23; stroke-width: 1; } .sym .t-g { fill: #24452f; } .sym .t-a { fill: #4d3d1d; } .sym .t-r { fill: #4a2523; }
.sym.s-run .t-g { fill: #3fd27a; } .sym.s-fault .t-a { fill: #f2b23b; animation: blink 1.2s steps(2) infinite; }
.sym.s-trip .t-r, .sym.s-alarm-on .t-r { fill: #ff4b42; animation: blink .8s steps(2) infinite; }
.sym .sym-mark { fill: #f2c84b; font: 700 7px var(--sans); }
/* HMI backgrounds: dark control room uses the dark-page text colours; light ones use dark text */
.gpage.bg-hmi-dark .gpage-bg { fill: #10151b; } .gpage.bg-hmi-light .gpage-bg, .gpage.bg-iso-floor .gpage-bg { fill: #e6e9ec; }
.gpage.bg-hmi-dark .glabel, .gpage.bg-hmi-dark .sym-label, .gpage.bg-hmi-dark .gline-t { fill: #e3eaf2; }
.gpage.bg-hmi-dark .gbox { fill: rgba(120, 160, 200, .10); stroke: #4d6c8c; } .gpage.bg-hmi-dark .gbox-t { fill: #a9c1d9; } .gpage.bg-hmi-dark .glabel.c-muted { fill: #9fb3c8; }
.gpage.bg-hmi-dark .gel-line.k-line .gline { stroke: #c9d6e2; }
.gpage.bg-hmi-light .glabel, .gpage.bg-iso-floor .glabel, .gpage.bg-hmi-light .sym-label, .gpage.bg-iso-floor .sym-label { fill: #1f262e; }
.gpage.bg-hmi-light .glabel.c-muted, .gpage.bg-iso-floor .glabel.c-muted { fill: #5b6672; }
.gpage.bg-hmi-light .gbox, .gpage.bg-iso-floor .gbox { fill: rgba(255, 255, 255, .55); stroke: #b4bcc5; } .gpage.bg-hmi-light .gbox-t, .gpage.bg-iso-floor .gbox-t { fill: #3d4752; }
.gpage-deco { pointer-events: none; }
/* client backgrounds: light ones use dark text, dark ones light text */
.gpage.bg-elegant-pearl .gpage-bg { fill: #f3f3f2; } .gpage.bg-elegant-sand .gpage-bg { fill: #f3e9d6; } .gpage.bg-elegant-midnight .gpage-bg { fill: #0b111a; } .gpage.bg-elegant-skyline .gpage-bg { fill: #0f2233; }
.gpage.bg-elegant-pearl .glabel, .gpage.bg-elegant-sand .glabel, .gpage.bg-elegant-pearl .sym-label, .gpage.bg-elegant-sand .sym-label { fill: #232a31; }
.gpage.bg-elegant-pearl .glabel.c-muted, .gpage.bg-elegant-sand .glabel.c-muted { fill: #6b6457; }
.gpage.bg-elegant-pearl .gbox, .gpage.bg-elegant-sand .gbox { fill: rgba(255, 255, 255, .55); stroke: #cbbd9f; } .gpage.bg-elegant-pearl .gbox-t, .gpage.bg-elegant-sand .gbox-t { fill: #5a4f3d; }
.gpage.bg-elegant-midnight .glabel, .gpage.bg-elegant-skyline .glabel, .gpage.bg-elegant-midnight .sym-label, .gpage.bg-elegant-skyline .sym-label, .gpage.bg-elegant-midnight .gline-t, .gpage.bg-elegant-skyline .gline-t { fill: #eef3f8; }
.gpage.bg-elegant-midnight .glabel.c-muted, .gpage.bg-elegant-skyline .glabel.c-muted { fill: #a9bccd; }
.gpage.bg-elegant-midnight .gbox, .gpage.bg-elegant-skyline .gbox { fill: rgba(255, 255, 255, .06); stroke: rgba(200, 225, 240, .28); } .gpage.bg-elegant-midnight .gbox-t, .gpage.bg-elegant-skyline .gbox-t { fill: #c7d7e4; }
.gpage.bg-elegant-midnight .gel-line.k-line .gline, .gpage.bg-elegant-skyline .gel-line.k-line .gline { stroke: #c9d6e2; }
/* graphic pages fit the screen: the drawing scales inside the wrapper, keeping its proportions */
.gpage-wrap.fit { overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gpage-wrap.fit > svg { width: 100%; height: 100%; min-width: 0; max-height: none; }
.page-hint { margin: 6px 0 0; }
/* remote sites (GSM / VPN) */
.rs-bar { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; max-width: 420px; }
.rs-bar > span { display: block; height: 100%; background: var(--run); }
.rs-bar.over > span { background: var(--bad); }
.rs-pick { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.rs-card .row { display: flex; gap: 8px; flex-wrap: wrap; }
/* pre-cooler water side: tank (cut-away), submersible pumps, solenoid valves, sensors */
.m-tank .face { fill-opacity: .28; stroke: #8b95a1; stroke-width: 1.2; }
.m-tank .t { fill: #9aa4b0; fill-opacity: .12; } .m-tank .l { fill: #6d7682; } .m-tank .r { fill: #5d6570; }
.m-water .face { stroke: none; } .m-water .t { fill: color-mix(in srgb, var(--water) 75%, #1d2833); opacity: .9; }
.m-water .l, .m-water .r { fill: color-mix(in srgb, var(--water) 45%, #1d2833); opacity: .55; }
.nolevel .m-water .face { opacity: .3; }
.subpump .m-motor .t, .subpump .m-motor .l, .subpump .m-motor .r { fill-opacity: 1; }
.iso-leader { stroke: var(--muted); stroke-width: .8; opacity: .7; }
.sv-stem { stroke: #8b95a1; stroke-width: 1.5; }
.sv-coil { fill: #46535f; stroke: #8b95a1; stroke-width: 1; }
.sv.on .sv-coil { fill: var(--run); }
.sensor-stem { stroke: #8b95a1; stroke-width: 2; stroke-dasharray: 3 2; }
.sensor-post { stroke: #6d7682; stroke-width: 3; }
.sensor-head { fill: #d4d9df; stroke: #6d7682; stroke-width: 1; }
.sensor-tip { fill: var(--cool); stroke: #2b313a; stroke-width: 1; }
.shield-disc { fill: #e3e7ec; stroke: #8b95a1; stroke-width: 1; }
.sensor.bad .sensor-head, .sensor.bad .shield-disc { fill: var(--q-bg); stroke: var(--q-line); stroke-dasharray: 2 2; }
.iso-precooler .iso-label { paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.iso-cmd { cursor: pointer; }
.iso-cmd:hover .face, .iso-cmd:focus .face, .iso-cmd:hover .valve, .iso-cmd:focus .valve { stroke: var(--accent); stroke-width: 2; }
.iso-cmd:focus { outline: none; }
/* site plan by project type */
.site-kind { fill: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.m-plaza .t { fill: color-mix(in srgb, #c9b98f 55%, var(--st-t)); } .m-plaza .l { fill: color-mix(in srgb, #a8986e 55%, var(--st-l)); } .m-plaza .r { fill: color-mix(in srgb, #978860 55%, var(--st-r)); }
.m-hotel .t { fill: color-mix(in srgb, var(--st-t) 85%, #c9a86a); } .m-hotel .l { fill: color-mix(in srgb, var(--st-l) 90%, #c9a86a); } .m-hotel .r { fill: color-mix(in srgb, var(--st-r) 90%, #c9a86a); }
.m-tank-site .t { fill: color-mix(in srgb, var(--water) 55%, #8f99a6); } .m-tank-site .l { fill: color-mix(in srgb, var(--water) 35%, #6d7682); } .m-tank-site .r { fill: color-mix(in srgb, var(--water) 30%, #5d6570); }
.pergola-post { stroke: #8a6e4b; stroke-width: 3; }
.pergola-beam { fill: none; stroke: #8a6e4b; stroke-width: 3.5; stroke-linejoin: round; }
.pergola-slat { stroke: #a88a63; stroke-width: 2; opacity: .8; }
.mist-pipe { stroke: #9aa4b0; stroke-width: 2; }
.mist-puff { fill: var(--cool); opacity: 0; }
.mist-unit.on .mist-puff { animation: site-mist 1.6s ease-out infinite; }
.mist-unit.on .mist-puff.p1 { animation-delay: .5s; } .mist-unit.on .mist-puff.p2 { animation-delay: 1s; }
@keyframes site-mist { 0% { opacity: 0; transform: translateY(-6px) scale(.6); } 35% { opacity: .55; } 100% { opacity: 0; transform: translateY(10px) scale(1.4); } }
.mist-puff { transform-box: fill-box; transform-origin: center; }
.mist-unit.st-alarm .mist-pipe { stroke: var(--bad); }
.room-win { fill: #3b4652; stroke: rgb(0 0 0 / .3); stroke-width: .6; }
.room.st-run .room-win { fill: #f2c46d; }
.room.st-alarm .room-win { fill: var(--bad); animation: iso-blink 1s steps(2) infinite; }
.room.st-nodata .room-win { fill: var(--q-bg); }
.room { cursor: pointer; }
.pole-mast { stroke: #6d7682; stroke-width: 2.5; }
.lamp-head { fill: #59626e; stroke: #2b313a; stroke-width: 1; }
.lamp-glow { fill: #f7d77a; opacity: 0; }
.pole.st-run .lamp-head { fill: #ffe08a; } .pole.st-run .lamp-glow { opacity: .35; }
.pole.st-alarm .lamp-head { fill: var(--bad); }
.door-frame { fill: #2b313a; } .door-leaf { fill: #59626e; } .door-reader { fill: #8b95a1; }
.door.st-run .door-leaf { fill: var(--run); opacity: .75; } .door.st-alarm .door-leaf { fill: var(--bad); animation: iso-blink 1s steps(2) infinite; }
.door.st-run .door-reader { fill: var(--run); }
.cam-fov { fill: var(--accent); opacity: .08; stroke: var(--accent); stroke-opacity: .25; }
.cam.on .cam-fov { opacity: .2; transform-box: fill-box; transform-origin: 0 0; }
.cam-led { fill: #59626e; } .cam.on .cam-led { fill: var(--bad); animation: iso-blink 1.2s steps(2) infinite; }
.cam.st-alarm .cam-fov { fill: var(--bad); opacity: .25; }
.site-adiabatic .roof-unit.on .fan-blade { fill: var(--run); }
.iso-site .site-label, .iso-site .site-sub { paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
/* water tank (level monitoring) */
.seam { stroke: #8b95a1; stroke-width: 1; opacity: .55; }
.mark { stroke-width: 1.6; stroke-dasharray: 6 4; }
.mark-overflow { stroke: var(--bad); fill: var(--bad); } .mark-high { stroke: var(--p-medium); fill: var(--p-medium); } .mark-low { stroke: var(--p-medium); fill: var(--p-medium); }
.mark-label { stroke: none; font-size: 10.5px; font-weight: 700; }
.us-beam { stroke: var(--cool); stroke-width: 2; stroke-dasharray: 3 5; fill: none; opacity: .25; }
.us-echo { fill: none; stroke: var(--cool); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.on > .us-beam { opacity: .9; animation: iso-flow 1s linear infinite; }
.on > .us-echo { animation: tank-echo 1.4s ease-out infinite; }
@keyframes tank-echo { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }
.bad > .us-beam { stroke: var(--bad); opacity: .6; }
.float-cable { stroke: #8b95a1; stroke-width: 1.2; }
.float-body { fill: #d4d9df; stroke: #6d7682; stroke-width: 1; }
.float.act .float-body { fill: var(--p-medium); stroke: #8a5a00; }
.float.unk .float-body { fill: none; stroke: var(--q-line); stroke-dasharray: 2 2; }
.lvl-high .mark.mark-high, .lvl-overflow .mark.mark-overflow, .lvl-low .mark.mark-low { stroke-width: 3.5; stroke-dasharray: none; animation: iso-blink 1s steps(2) infinite; }
.lvl-unknown .m-water .face { opacity: .25; }
.from-floats .m-water .face { opacity: .55; }
.stand { stroke: #6d7682; stroke-width: 4; }
.lamp-lens { fill: #7a2d2d; stroke: #2b313a; stroke-width: 1; }
.tank-lamp.on .lamp-lens { fill: #ff4d4d; } .tank-lamp.on .lamp-glow { fill: #ff6b6b; opacity: .35; }
.tank-lamp.flash .lamp-lens, .tank-lamp.flash .lamp-glow { animation: iso-blink .8s steps(2) infinite; }
.pb-ring { fill: #2b313a; } .pb-cap { fill: #2fa35a; } .reset-pb.on .pb-cap { fill: #7dd99c; }
.horn { fill: #c7cdd4; stroke: #6d7682; stroke-width: 1; } .horn-body { fill: #8b95a1; }
.sound { fill: none; stroke: var(--bad); stroke-width: 2; opacity: 0; }
.hooter.on .sound { animation: tank-sound 1s ease-out infinite; } .hooter.on .sound.w1 { animation-delay: .2s; } .hooter.on .sound.w2 { animation-delay: .4s; }
@keyframes tank-sound { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: 0; } }
.antenna { stroke: #2b313a; stroke-width: 2.5; }
.sig { fill: none; stroke: #8b95a1; stroke-width: 1.6; opacity: .4; }
.gsm.on .sig { stroke: var(--run); opacity: .9; } .gsm.bad .sig { stroke: var(--bad); opacity: .9; }
.iso-tank .iso-label { paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.tank-pct { fill: var(--text); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.tank-unit.st-alarm .m-tank .face { stroke: var(--bad); stroke-width: 2; }
.tank-unit.st-alarm .tank-pct { fill: var(--bad); }
.tank-unit.st-nodata .m-water .face { opacity: .25; }
.yard-lamp { fill: #7a2d2d; } .yard-lamp.on { fill: #ff4d4d; animation: iso-blink .8s steps(2) infinite; }
.tank-unit.st-off .m-water .face { opacity: .25; }
.formgrid .check-row { grid-column: 1 / -1; justify-content: flex-start; margin: 4px 0; }
.formgrid .check-row input { width: auto; flex: 0 0 auto; margin: 3px 0 0; }
.formgrid .check-row label { flex: 1; margin: 0; text-align: left; }
/* Beckhoff CX tool: equipment picker */
.cx-eq { max-height: 18rem; overflow: auto; border: 1px solid var(--line, #d0d5dd); border-radius: 6px; padding: .4rem .6rem; display: grid; gap: .2rem; }
.cx-eq .cx-row { display: flex; gap: .5rem; align-items: baseline; justify-content: flex-start; text-align: left; margin: 0; }
.cx-eq .cx-row input { flex: none; width: auto; }
.table-scroll { overflow-x: auto; }
.cx-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cx-actions input[type=search] { flex: 1 1 18rem; }
/* water tank: command buttons on the graphic */
.iso-cmdbar .cmd-btn { cursor: pointer; }
.iso-cmdbar .cmd-btn rect { fill: #0f766e; stroke: #0b5d57; stroke-width: 1; }
.iso-cmdbar .cmd-btn text { fill: #fff; font-size: 13px; font-weight: 600; pointer-events: none; }
.iso-cmdbar .cmd-btn.reset rect { fill: #b45309; stroke: #92400e; }
.iso-cmdbar .cmd-btn:hover rect, .iso-cmdbar .cmd-btn:focus-visible rect { filter: brightness(1.15); stroke-width: 2; }
/* WireGuard: hub, demo walk-through and live tunnel picture */
.wg-key { font-size: .8rem; word-break: break-all; }
.wg-cmd { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .3rem 0; }
.wg-cmd code { font-size: .8rem; word-break: break-all; padding: .25rem .4rem; border-radius: 4px; background: var(--panel2); }
.wg-steps ol { display: grid; gap: .45rem; padding-left: 1.2rem; }
.wg-log { display: grid; gap: .5rem; padding-left: 1.3rem; }
.wg-log li { animation: wg-in .35s ease-out both; }
.wg-detail { word-break: break-all; }
@keyframes wg-in { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.wg-conf { max-height: 22rem; overflow: auto; font-size: .8rem; padding: .7rem; border-radius: 6px; background: var(--panel2); white-space: pre; }
.wg-flow { display: flex; align-items: stretch; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }
.wg-node { display: grid; gap: .15rem; padding: .6rem .8rem; border: 1px solid var(--line, #c9d1d9); border-radius: 8px; min-width: 10rem; flex: 0 1 auto; }
.wg-node.hub { border-color: #0f766e; }
.wg-pipe, .wg-wire { flex: 1 1 10rem; display: grid; align-content: center; justify-items: center; gap: .2rem; position: relative; min-height: 4rem; text-align: center; }
.wg-pipe::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 3px dashed #94a3b8; z-index: 0; }
.wg-wire { flex: 0 1 5rem; }
.wg-wire::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid #94a3b8; z-index: 0; }
.wg-pipe strong, .wg-pipe .small, .wg-wire .small { position: relative; z-index: 1; background: var(--panel); padding: 0 .3rem; }
.wg-pkt { z-index: 2; position: absolute; top: calc(50% - 5px); left: 0; width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; opacity: 0; }
.wg-live.up .wg-pipe::before { border-top-color: #0f766e; }
.wg-live.up .wg-pkt { background: #0f766e; opacity: 1; animation: wg-pkt 2.4s linear infinite; }
@keyframes wg-pkt { from { left: 0; } to { left: calc(100% - 10px); } }
@media (prefers-reduced-motion: reduce) { .wg-live.up .wg-pkt, .wg-log li { animation: none; } }
@media (max-width: 700px) { .wg-flow { flex-direction: column; } .wg-pipe, .wg-wire { min-height: 3rem; } }
.btn.warn { background: #b45309; border-color: #92400e; color: #fff; }
.btn.warn:hover { filter: brightness(1.1); }
/* Security checks */
.chip-status.warn { color: var(--stop); border-color: color-mix(in srgb, var(--stop) 55%, transparent); }
.sec-group h3 { margin: 14px 0 6px; font-size: 14px; }
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sec-list li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.sec-list li > span { text-align: center; }
.sec-list li.sec-bad { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.sec-fix { margin-top: 3px; }
/* Quick onboarding */
.ob-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ob-head > input { flex: 1 1 14rem; width: auto; }
.ob-head > select { flex: 2 1 18rem; width: auto; }
.ob-check { display: inline-flex; gap: 6px; align-items: center; margin: 0; white-space: nowrap; }
.ob-check input { width: auto; }
/* ---------------- Profen Logic (controller programming) ---------------- */
.lg { display: grid; grid-template-rows: auto minmax(0, 1fr) var(--lg-bot-h, 200px); gap: 6px; height: calc(100vh - 140px); min-height: 560px; }
.lg.no-bottom { grid-template-rows: auto minmax(0, 1fr) 0; }
.lg.no-bottom .lg-bottom { display: none; }
.lg-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.lg-bar select.sm { padding: 3px 6px; font-size: 12px; }
.lg-title { font-size: 15px; }
.lg-sp { flex: 1; }
.lg-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.lg-mid { display: grid; grid-template-columns: var(--lg-pal-w, 158px) minmax(0, 1fr) var(--lg-side-w, 236px); gap: 6px; min-height: 0; }
.lg.no-pal .lg-mid { grid-template-columns: 0 minmax(0, 1fr) var(--lg-side-w, 236px); }
.lg.no-side .lg-mid { grid-template-columns: var(--lg-pal-w, 158px) minmax(0, 1fr) 0; }
.lg.no-pal.no-side .lg-mid { grid-template-columns: 0 minmax(0, 1fr) 0; }
.lg.no-pal .lg-pal, .lg.no-side .lg-side { display: none; }
.lg-folds { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; z-index: 2; }
.lg-fold { font-size: 11px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel2); color: var(--muted); cursor: pointer; }
.lg-fold[aria-pressed=true] { color: var(--text); border-color: var(--accent); }
.lg-bar { padding: 4px 6px !important; gap: 4px !important; }
.lg-bar .btn, .lg-bar select { padding: 3px 8px; font-size: 12.5px; min-height: 0; }
.lg-proj-fixed { padding: 4px 0; }
.lg-pal, .lg-side { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; overflow: auto; overflow-x: hidden; min-height: 0; font-size: 12.5px; }
.lg-side h3 { font-size: 13px !important; }
.lg-side .formgrid { gap: 3px 6px; }
.lg-side input:not([type=checkbox]), .lg-side select, .lg-side textarea { padding: 3px 6px; font-size: 12.5px; }
.lg-pal input[type=search] { padding: 3px 6px; font-size: 12px; }
.lg-pal input[type=search] { width: 100%; }
.lg-pal h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 2px; }
.lg-palitem { display: flex; justify-content: space-between; gap: 4px; align-items: center; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 2px; cursor: grab; font-size: 11.5px; background: var(--panel2); white-space: nowrap; overflow: hidden; }
.lg-palitem > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.lg-palitem:hover, .lg-palitem:focus-visible { border-color: var(--accent); outline: none; }
.lg-palitem code { font-size: 10px; color: var(--muted); }
.lg-canvas { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-height: 0; position: relative; }
.lg-svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
.lg-svg:focus { outline: none; }
.lg-bg { fill: url(#lg-grid); }
.lg-gridline { fill: none; stroke: var(--line); stroke-width: .6; }
.lg-blk { cursor: move; }
.lg-body { fill: var(--panel2); stroke: var(--line2); stroke-width: 1.2; }
.lg-head { fill: color-mix(in srgb, var(--accent) 18%, var(--panel2)); }
.lg-blk.cat-variables .lg-head { fill: color-mix(in srgb, #2563eb 22%, var(--panel2)); }
.lg-blk.cat-timers .lg-head { fill: color-mix(in srgb, #b45309 22%, var(--panel2)); }
.lg-blk.cat-control .lg-head { fill: color-mix(in srgb, #7c3aed 22%, var(--panel2)); }
.lg-blk.cat-code .lg-head { fill: color-mix(in srgb, #be185d 22%, var(--panel2)); }
.lg-blk.cat-compare .lg-head, .lg-blk.cat-math .lg-head { fill: color-mix(in srgb, #0891b2 20%, var(--panel2)); }
.lg-blk.sel .lg-body { stroke: var(--accent); stroke-width: 2.5; }
.lg-blk.bad .lg-body { stroke: var(--bad); stroke-width: 2.5; stroke-dasharray: 5 3; }
.lg-htext { font-size: 12px; font-weight: 600; fill: var(--text); }
.lg-ord { font-size: 9px; fill: var(--muted); }
.lg-ptext { font-size: 10.5px; fill: var(--text); }
.lg-sub { font-size: 9.5px; fill: var(--muted); }
.lg-kval { font-size: 10px; fill: var(--muted); font-family: var(--mono); }
.lg-val { font-size: 10.5px; font-family: var(--mono); fill: var(--accent); }
.lg-val.on { fill: var(--run); font-weight: 700; } .lg-val.off { fill: var(--dim); }
.lg-pin { stroke: var(--panel); stroke-width: 1.5; cursor: crosshair; }
.lg-pin.t-BOOL { fill: #16a34a; } .lg-pin.t-REAL { fill: #2563eb; } .lg-pin.t-INT { fill: #0891b2; } .lg-pin.t-TIME { fill: #b45309; }
.lg-pin:hover { stroke: var(--text); stroke-width: 2.5; }
.lg-wire { fill: none; stroke-width: 2; stroke: #64748b; }
.lg-wire.t-BOOL { stroke: #16a34a; } .lg-wire.t-REAL { stroke: #2563eb; } .lg-wire.t-INT { stroke: #0891b2; } .lg-wire.t-TIME { stroke: #b45309; }
.lg-wire.live.t-BOOL { stroke: #94a3b8; } .lg-wire.live.t-BOOL.on { stroke: #16a34a; stroke-width: 3.5; }
.lg-wire.sel { stroke-width: 4; stroke-dasharray: 6 3; }
.lg-wire.temp { stroke: var(--accent); stroke-dasharray: 5 4; }
.lg-wirehit { fill: none; stroke: transparent; stroke-width: 10; cursor: pointer; }
.lg-note { fill: color-mix(in srgb, #facc15 22%, var(--panel2)); stroke: color-mix(in srgb, #ca8a04 60%, var(--line)); }
.lg-notetext { font-size: 11.5px; color: var(--text); line-height: 1.35; overflow: hidden; height: 100%; }
.lg-band { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: var(--accent); stroke-dasharray: 4 3; }
.lg-side h3 { margin: 4px 0 6px; font-size: 14px; }
.lg-side .formgrid { grid-template-columns: 1fr; }
.lg-side textarea, .lg-side input:not([type=checkbox]), .lg-side select { width: 100%; }
.lg-vars input, .lg-vars select { font-size: 12px; padding: 2px 4px; }
.lg-vname { min-width: 90px; } .lg-vinit { width: 70px !important; } .lg-vlink { min-width: 180px; } .lg-vpt { min-width: 240px; }
.lg-pinname { flex: 1; }
.lg-code { font-family: var(--mono); font-size: 12px; line-height: 1.45; tab-size: 2; width: 100%; white-space: pre; }
.lg-issues { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; }
.lg-issues li { padding: 4px 8px; border-radius: 5px; font-size: 12.5px; cursor: pointer; }
.lg-issues li.error { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.lg-issues li.warning { background: color-mix(in srgb, var(--stop) 14%, transparent); }
.lg-bottom { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.lg-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 4px 6px 0; }
.lg-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 5px 10px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.lg-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.lg-tabbody { overflow: auto; padding: 8px; min-height: 0; }
.lg-pre { font-family: var(--mono); font-size: 11.5px; white-space: pre; overflow: auto; background: var(--panel2); padding: 8px; border-radius: 6px; margin: 6px 0 0; }
.lg-trend { width: 100%; height: 180px; display: block; }
.lg-chk { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; margin-right: 10px; }
.lg-chk input { width: auto; }
.lg-testgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.lg-test { padding: 5px 8px; border-radius: 5px; border: 1px solid var(--line); }
.lg-test.ok { border-color: color-mix(in srgb, var(--run) 50%, var(--line)); } .lg-test.bad { border-color: var(--bad); }
.small.ok { color: var(--run); } .small.bad { color: var(--bad); }
@media (max-width: 1100px) { .lg-mid { grid-template-columns: 170px minmax(0, 1fr) 280px; } }
.lg select, .lg input:not([type=checkbox]):not([type=search]) { width: auto; }
.lg-side select, .lg-side input:not([type=checkbox]), .lg-side textarea, .lg-pal input[type=search] { width: 100%; }
.lg-side .row input:not([type=checkbox]), .lg-side .row select { width: auto; flex: 1 1 0; min-width: 0; }
.lg-side .lg-vars input, .lg-side .lg-vars select { width: 100%; min-width: 56px; }
.lg-bar select, .lg-bar .btn { height: 28px; }
.lg-tabbody .row { flex-wrap: nowrap; align-items: center; }
.lg-tabbody select, .lg-tabbody input { max-width: 160px; }
.lg-fit { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; }
.lg-tabbody .lg-vars input, .lg-tabbody .lg-vars select { max-width: none; width: 100%; }
.lg-tabbody .lg-vars { min-width: 820px; }
.lg .btn { white-space: nowrap; }

/* ---- Cameras (live view only) ---- */


/* project systems and modules (several per project) */
.pt-field { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0; min-width: 0; }
.pt-field legend { padding: 0 4px; }
.pt-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; }
.pt-modules { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.pt-row { display: flex; align-items: flex-start; gap: 8px; }
.pt-row input[type=checkbox] { width: auto; flex: none; margin-top: 3px; }
.pt-row label { text-align: left; font-weight: normal; margin: 0; }
.lg-newrow { gap: 6px; } .lg-newrow .lg-newvar { width: 100%; } .lg-newrow .row select { width: auto; flex: 1; min-width: 0; }
.lg-tabbody .lg-vars input.lg-vpt { max-width: none; min-width: 240px; } .lg-tabbody .lg-vars input.lg-vlink { max-width: none; min-width: 180px; }
.lg-side select, .lg-side input, .lg-side textarea { max-width: 100%; box-sizing: border-box; } .lg-side .formgrid > * { min-width: 0; }

/* System → Access → Local network access */
.lan-list { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 6px; }
.lan-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lan-list a { font-size: 1.05rem; }
.lan-checks { list-style: none; padding: 0; display: grid; gap: 6px; }
.lan-checks .badge { margin-right: 4px; }
.lan-cmd { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 10px; }
.lan-cmd pre { flex: 1; margin: 0; padding: 8px 10px; background: var(--panel-2, rgba(127,127,127,.08)); border-radius: 6px; white-space: pre-wrap; word-break: break-all; }

/* offline page of the installed app */
.offline { max-width: 520px; margin: 12vh auto; padding: 0 16px; text-align: center; }
.offline img { border-radius: 16px; }
.offline ul { text-align: left; display: inline-block; }
/* About → Use as an app */
.install-steps { margin: 6px 0 0; padding-left: 18px; }

/* maintenance pages */
.linkish { background: none; border: 0; padding: 0; color: var(--accent, #2a8f84); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.appfoot .linkish { color: inherit; }
.maint-dialog { width: min(980px, 96vw); max-height: 90vh; overflow: auto; }
.warn-box { border-left: 4px solid var(--warn, #c98a00); }
.pre-line { white-space: pre-line; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.file-list { list-style: none; padding: 0; display: grid; gap: 4px; }
.bug-shot { max-width: 100%; max-height: 50vh; border: 1px solid var(--line2, #ccc); border-radius: 6px; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover { background: rgba(127,127,127,.08); }
pre.diff { font-size: 12px; line-height: 1.45; overflow: auto; max-height: 60vh; border: 1px solid var(--line2, #ccc); border-radius: 6px; padding: 4px 0; margin: 0; }
pre.diff > div { white-space: pre; padding: 0 8px; }
pre.diff .ln { display: inline-block; min-width: 3.5em; color: var(--muted, #888); user-select: none; }
pre.diff .op { display: inline-block; width: 1.2em; user-select: none; }
pre.diff .add { background: rgba(46, 160, 67, .16); }
pre.diff .del { background: rgba(248, 81, 73, .16); }
pre.diff .skip { color: var(--muted, #888); font-style: italic; }
.diff-add-n { color: #2ea043; font-weight: 600; } .diff-del-n { color: #e5534b; font-weight: 600; }
table.modules input:not([type=checkbox]) { width: 100%; max-width: 220px; }
/* code editor */
.ce-grid { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 12px; min-height: 60vh; }
.ce-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ce-files { list-style: none; padding: 0; margin: 0; overflow: auto; max-height: 64vh; border: 1px solid var(--line2, #ccc); border-radius: 6px; }
.ce-files li button { display: block; width: 100%; text-align: left; padding: 3px 8px; text-decoration: none; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-files li button.on { background: rgba(63,182,168,.18); }
.ce-files li button.mod::after { content: ' ●'; color: var(--warn, #c98a00); }
.ce-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ce-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.ce-tab { border: 1px solid var(--line2, #ccc); border-radius: 6px; padding: 2px 6px; display: inline-flex; gap: 6px; }
.ce-tab.on { border-color: var(--accent, #2a8f84); }
.ce-tab .linkish { text-decoration: none; color: inherit; }
.ce-edit { display: flex; border: 1px solid var(--line2, #ccc); border-radius: 6px; overflow: hidden; height: 64vh; }
.ce-gutter { margin: 0; padding: 8px 6px; text-align: right; color: var(--muted, #888); background: rgba(127,127,127,.06); overflow: hidden; user-select: none; font-size: 12.5px; line-height: 1.5; min-width: 3.2em; }
.ce-text { flex: 1; border: 0; resize: none; padding: 8px; font-size: 12.5px; line-height: 1.5; tab-size: 2; white-space: pre; overflow: auto; background: transparent; color: inherit; outline: none; }
@media (max-width: 800px) { .ce-grid { grid-template-columns: 1fr; } .ce-files { max-height: 30vh; } }

/* ✋ forced by hand (any command held until released to auto) */
.gel.forced .sym-badge, .gel.forced .gimg-badge { fill: var(--p-medium, #d97706); font-weight: 700; }
.gel.forced > .sym, .gel.forced .gimg-wrap { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--p-medium, #d97706) 80%, transparent)); }
.gel-value.forced .gvalue { fill: var(--p-medium, #d97706); font-weight: 700; }
.hand-box.quiet { border-style: dashed; background: transparent; }
.hand-box.quiet .hand-sign { opacity: .55; font-size: 22px; }
.forced-chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--p-medium, #d97706) 20%, transparent); color: var(--p-medium, #d97706); font-weight: 700; font-size: 12px; border: 0; cursor: pointer; }

/* resizable side panels (all users): grip on the panel edge, fold button */
.split-panel { position: relative; }
.split-grip { position: absolute; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; touch-action: none; }
.split-grip.right { left: 0; } .split-grip.left { right: 0; }
.split-grip::after { content: ''; position: absolute; top: 50%; left: 3px; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--line2); opacity: .6; }
.split-grip:hover::after, .split-grip:focus-visible::after { background: var(--accent); opacity: 1; }
body.splitting, body.splitting * { cursor: col-resize !important; user-select: none !important; }
.split-fold { border: 1px solid var(--line); background: var(--panel2); color: var(--muted); border-radius: 5px; font-size: 11px; line-height: 1; padding: 3px 6px; cursor: pointer; }
.split-fold:hover { color: var(--text); border-color: var(--accent); }
/* full page graphic view: the graphic gets the whole window; override and setpoints below it */
.full-bar { display: none; }
body.gfx-full .full-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.full-bar .full-title { font-weight: 600; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.full-bar .grow { flex: 1; }
.hist-nav .full-btn { margin-left: 4px; padding: 2px 9px; }
body.gfx-full .topbar, body.gfx-full .side, body.gfx-full .side-show, body.gfx-full .ctx-bar, body.gfx-full .terms-banner, body.gfx-full .appfoot,
body.gfx-full #view > .page-head { display: none !important; }
body.gfx-full .layout { grid-template-columns: 1fr !important; }
/* only the graphic: panels below it (project details, reports, files …) wait for the normal view */
body.gfx-full #view > .below-fold, body.gfx-full #view > section.panel:not(:has(.gpage-wrap, .eq-screen)), body.gfx-full #view > .two-col { display: none !important; }
body.gfx-full #view { padding: 6px 8px; max-width: none; }
body.gfx-full .eq-export { display: none !important; }
/* long tab rows (System) wrap instead of running off the page */
.page-head .tabs { flex-wrap: wrap; row-gap: 2px; }
.page-head .tabs a { white-space: nowrap; padding: 5px 9px; }
/* the file picker sits behind its button */
#upd-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cmd-dialog .dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.cmd-dialog .dialog-head h2 { margin: 0; }

/* ← → beside the page heading */
.has-hist { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.has-hist > .hist-nav { order: -1; }
main > .hist-nav { margin-bottom: 8px; }
.hist-nav .hist-btn { min-width: 30px; padding: 2px 7px; font-size: 14px; }
.lg-bar > .hist-nav { margin-right: 2px; }

/* ===== one-line top bar: every menu item stays on the top line (scrolls sideways only on very narrow windows) ===== */
.topbar { flex-wrap: nowrap; gap: 12px; padding: 8px 14px; }
.topbar .brand { flex: none; }
.topbar .brand .wordmark { font-size: 19px; }
.topnav { flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; gap: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { padding: 6px 8px; font-size: 14px; white-space: nowrap; flex: none; }
.topbar .conn, .topbar .forced-chip, .topbar .user { flex: none; }
.topbar .conn { margin-left: 0; }
.topbar .user { gap: 6px; }
@media (max-width: 1600px) { .topnav a { padding: 6px 6px; font-size: 13.5px; } .topbar .user > span .muted { display: none; } }
@media (max-width: 1360px) { .topbar .user > span { display: none; } .topbar .conn-text { display: none; } .topbar .brand .wordmark { font-size: 17px; } }

/* ===== background: a faint engineering grid with a soft accent glow — panels stay solid for legibility ===== */
:root { --grid-line: rgba(255, 255, 255, 0.035); --grid-major: rgba(255, 255, 255, 0.06); --glow: color-mix(in srgb, var(--accent) 11%, transparent); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --grid-line: rgba(14, 60, 70, 0.045); --grid-major: rgba(14, 60, 70, 0.07); --glow: color-mix(in srgb, var(--accent) 9%, transparent); }
}
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 88% -8%, var(--glow), transparent 62%),
    radial-gradient(900px 560px at -6% 108%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-attachment: fixed;
}
.topbar {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--accent) 8%), var(--panel));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 10%, transparent), 0 6px 18px -12px rgba(0, 0, 0, 0.35);
}
.side { background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(2px); }
.panel { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -18px rgba(0, 0, 0, 0.35); }
#view { background: transparent; }
/* the plant legend items share the class name "lg" with the Logic editor layout — keep them small inline items */
.legend .lg { display: inline-flex; align-items: center; height: auto; min-height: 0; grid-template-rows: none; gap: 0; }
/* Logic → Manual test: inputs set by hand on the left, the outputs they produce on the right */
.io-panel { display: flex; flex-direction: column; gap: 8px; }
.io-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.io-head .small { flex: 1 1 320px; }
.io-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.io-grid h3 { margin: 2px 0 6px; font-size: 13px; }
.io-grid .io-sub { margin-top: 12px; color: var(--muted); }
.lg-tabbody .io-ins td { vertical-align: middle; }
.io-ins tr.io-held td { background: color-mix(in srgb, var(--p-medium) 9%, transparent); }
.io-src { max-width: 260px; }
.io-cur { font-weight: 600; min-width: 60px; }
.io-bool, .io-numrow { display: inline-flex; gap: 4px; align-items: center; }
.lg-tabbody .io-num { width: 90px; max-width: 90px; }
.io-bool .io-on.on { background: var(--run); border-color: var(--run); color: #fff; }
.io-bool .io-off.on { background: var(--stop); border-color: var(--stop); color: #fff; }
.io-outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.io-out { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); min-width: 0; }
.io-out .io-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.io-out .io-val { font-family: var(--din); font-weight: 600; font-size: 16px; }
.io-out .io-lamp { width: 12px; height: 12px; border-radius: 50%; background: var(--q-bg); border: 1px solid var(--line2); flex: none; }
.io-out.is-on .io-lamp { background: var(--run); border-color: var(--run); box-shadow: 0 0 8px color-mix(in srgb, var(--run) 70%, transparent); }
.io-out.is-on { border-color: color-mix(in srgb, var(--run) 55%, var(--line)); }
.io-out.is-off .io-lamp { background: var(--stop); }
.io-out.is-num .io-lamp { border-radius: 3px; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.small-outs .io-out { padding: 5px 8px; } .small-outs .io-val { font-size: 13px; }
@media (max-width: 1100px) { .io-grid { grid-template-columns: 1fr; } }
/* manual test: outputs stay in view while scrolling the inputs; compact rows */
.io-grid > section:last-child { position: sticky; top: 0; }
.lg-tabbody .io-panel { gap: 6px; }
.lg-tabbody .io-ins td { padding: 3px 6px; }
.lg-tabbody .io-ins .btn.sm { padding: 2px 8px; }
.lg-tabbody .io-ins td strong { font-size: 13px; }
.lg-tabbody .io-ins td .small.muted { display: inline; margin-left: 6px; }
.lg-tabbody .io-head .small.muted { font-size: 11.5px; }
/* Logic editor: bar over the selected block, and the block menu (right-click or ⋯) */
.lg-blkbar { position: absolute; z-index: 6; display: flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 8px; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .4); }
.lg-blkbar[hidden] { display: none; }
.lg-bb { border: 0; background: none; color: var(--text); min-width: 26px; height: 24px; border-radius: 5px; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 5px; }
.lg-bb:hover, .lg-bb:focus-visible { background: var(--panel2); color: var(--accent); }
.lg-bb.danger:hover { color: var(--bad); }
.lg-menu { position: fixed; z-index: 50; min-width: 230px; padding: 4px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45); display: flex; flex-direction: column; }
.lg-menu button { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; color: var(--text); padding: 6px 10px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.lg-menu button:hover, .lg-menu button:focus-visible { background: var(--panel2); outline: none; }
.lg-menu button.danger { color: var(--bad); }
.lg-menu-ico { width: 18px; text-align: center; color: var(--muted); }
.lg-menu-sep { height: 1px; background: var(--line); margin: 3px 4px; }
/* Logic editor: each panel keeps its own column, so hiding the block list never pushes the drawing into its 0-wide column */
.lg-mid > .lg-pal { grid-column: 1; grid-row: 1; }
.lg-mid > .lg-canvas { grid-column: 2; grid-row: 1; }
.lg-mid > .lg-side { grid-column: 3; grid-row: 1; }
.lg.no-pal .lg-mid, .lg.no-side .lg-mid, .lg.no-pal.no-side .lg-mid { column-gap: 0; }
.lg.no-pal .lg-canvas { margin-left: 0; } .lg.no-side:not(.no-pal) .lg-canvas { margin-right: 0; }
.lg.no-pal:not(.no-side) .lg-side { margin-left: 6px; } .lg.no-side:not(.no-pal) .lg-pal { margin-right: 6px; }
.formgrid .span-all { grid-column: 1 / -1; margin: 0; }
.rs-advice { color: var(--p-high); background: color-mix(in srgb, var(--p-medium) 10%, transparent); border-radius: 6px; padding: 6px 10px; }
/* applying an update: steps with a progress bar */
.upd-dialog { width: min(560px, 94vw); }
.upd-bar { height: 8px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 12px; }
.upd-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.upd-steps { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.upd-step { display: flex; gap: 10px; align-items: baseline; }
.upd-ico { width: 18px; text-align: center; font-weight: 700; color: var(--dim); flex: none; }
.upd-step.s-ok .upd-ico { color: var(--run); } .upd-step.s-bad .upd-ico, .upd-step.s-bad strong { color: var(--bad); }
.upd-step.s-run .upd-ico { color: var(--accent); display: inline-block; animation: upd-spin 1s linear infinite; }
.upd-step.s-wait strong, .upd-step.s-skip strong { color: var(--muted); font-weight: 500; }
@keyframes upd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upd-step.s-run .upd-ico { animation: none; } .upd-bar > span { transition: none; } }
/* the control panel on the right: when it is narrow the quality column goes (bad quality still colours the row) */
.eq-side { container-type: inline-size; }
.eq-side .points { width: 100%; }
.eq-side .points tr.group-row td { text-align: left; white-space: normal; }
@container (max-width: 470px) { .points th.q, .points td.q { display: none; } .points td .btn.sm { white-space: nowrap; } }

/* ===== light-blue graphics across the application =====================================================
   Decoration only, in pale blue: a sky wash, an engineering grid, soft air-flow lines in the corner, a light
   top bar and System Browser, and a thin blue edge on panels. Status colours (run, alarm, quality) are unchanged. */
:root {
  --sky-1: #eef6fd; --sky-2: #dcecfa; --sky-3: #b9d9f4; --sky-4: #7fb7e6; --sky-ink: #2a74b5;
  --grid-line: rgba(42, 116, 181, 0.05); --grid-major: rgba(42, 116, 181, 0.085);
  --deco: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='760' height='420' viewBox='0 0 760 420' fill='none' stroke='%237fb7e6' stroke-linecap='round'%3E%3Cpath d='M0 330 C120 290 200 370 330 330 S540 280 760 320' stroke-width='2' opacity='.55'/%3E%3Cpath d='M0 362 C140 322 230 402 360 362 S560 312 760 352' stroke-width='1.5' opacity='.4'/%3E%3Cpath d='M0 392 C160 352 260 432 390 392 S580 342 760 382' stroke-width='1' opacity='.3'/%3E%3Cpath d='M420 120 l60 -34 l60 34 l-60 34 z M420 120 v70 l60 34 v-70 M540 120 v70 l-60 34' stroke-width='1.4' opacity='.45'/%3E%3Cpath d='M560 160 l44 -25 l44 25 l-44 25 z M560 160 v52 l44 25 v-52 M648 160 v52 l-44 25' stroke-width='1.2' opacity='.35'/%3E%3Ccircle cx='600' cy='70' r='3' fill='%237fb7e6' stroke='none' opacity='.5'/%3E%3Ccircle cx='660' cy='96' r='2' fill='%237fb7e6' stroke='none' opacity='.4'/%3E%3Ccircle cx='700' cy='60' r='2.5' fill='%237fb7e6' stroke='none' opacity='.35'/%3E%3Cpath d='M600 70 L660 96 L700 60' stroke-width='1' stroke-dasharray='3 4' opacity='.4'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sky-1: #12202b; --sky-2: #17293a; --sky-3: #1f3a52; --sky-4: #3f7fb5; --sky-ink: #8cc4f2; --grid-line: rgba(140, 196, 242, 0.04); --grid-major: rgba(140, 196, 242, 0.065); }
}
:root[data-theme="dark"] { --sky-1: #12202b; --sky-2: #17293a; --sky-3: #1f3a52; --sky-4: #3f7fb5; --sky-ink: #8cc4f2; --grid-line: rgba(140, 196, 242, 0.04); --grid-major: rgba(140, 196, 242, 0.065); }
body {
  background-color: var(--bg);
  background-image:
    var(--deco),
    radial-gradient(1200px 640px at 90% -10%, color-mix(in srgb, var(--sky-3) 55%, transparent), transparent 62%),
    radial-gradient(900px 560px at -8% 105%, color-mix(in srgb, var(--sky-2) 70%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--sky-1) 70%, var(--bg)), var(--bg) 420px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 760px 420px, auto, auto, auto, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: right -40px bottom -30px, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, repeat;
  background-attachment: fixed;
}
.topbar {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 80%, var(--sky-2)), color-mix(in srgb, var(--panel) 94%, var(--sky-1)));
  border-bottom: 1px solid color-mix(in srgb, var(--sky-4) 40%, var(--line));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--sky-3) 50%, transparent), 0 8px 22px -14px color-mix(in srgb, var(--sky-ink) 45%, transparent);
}
.topnav a:hover { background: color-mix(in srgb, var(--sky-2) 70%, transparent); color: var(--text); }
.side { background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, var(--sky-1)), color-mix(in srgb, var(--panel) 96%, var(--sky-2))); border-right-color: color-mix(in srgb, var(--sky-3) 45%, var(--line)); }
.panel { border-color: color-mix(in srgb, var(--sky-3) 40%, var(--line)); box-shadow: inset 0 2px 0 color-mix(in srgb, var(--sky-3) 70%, transparent), 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 26px -20px color-mix(in srgb, var(--sky-ink) 55%, transparent); }
.ctx-bar { background: linear-gradient(90deg, color-mix(in srgb, var(--sky-1) 85%, var(--panel)), color-mix(in srgb, var(--accent) 10%, var(--panel))); border-bottom-color: color-mix(in srgb, var(--sky-3) 55%, transparent); }
.appfoot { background: color-mix(in srgb, var(--panel) 88%, var(--sky-1)); border-top: 1px solid color-mix(in srgb, var(--sky-3) 45%, var(--line)); }
.tabs a:hover, .eq-tabs .tab-btn:hover, .eq-stab:hover, .lg-tabs button:hover { background: color-mix(in srgb, var(--sky-2) 55%, transparent); border-radius: 6px 6px 0 0; }
.btn:hover { border-color: color-mix(in srgb, var(--sky-4) 60%, var(--line2)); }
.grid thead th { background: color-mix(in srgb, var(--sky-1) 75%, transparent); }
.page-head h1 { background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--sky-ink) 55%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head h1 .sub { -webkit-text-fill-color: var(--muted); color: var(--muted); }
.full-bar { background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, var(--sky-2)), var(--panel)); border-bottom-color: color-mix(in srgb, var(--sky-4) 40%, var(--line)); }
@media print { body { background: #fff !important; } }
.eq-side .points { table-layout: auto; }
.eq-side .points td, .eq-side .points th { white-space: normal; }
.eq-side .points td:last-child { width: 1%; white-space: nowrap; text-align: right; }
.eq-side .points td .btn.sm { white-space: nowrap; }
.eq-side .points td .hand-tag { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.eq-side .points td.val { white-space: nowrap; }
.upd-dialog .demo-note { margin: 0 0 6px; padding: 6px 10px; border-radius: 6px; background: color-mix(in srgb, var(--sky-2, #dcecfa) 70%, transparent); color: var(--text); }
/* graphic view bar (engineers and admins): Page / Drawing / Fill, saved for everyone */
.gview-label { font-size: 11px; color: var(--muted); padding: 0 4px 0 6px; }
.gview-host { position: relative; }
.gview-bar { position: absolute; right: 8px; bottom: 8px; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid color-mix(in srgb, var(--sky-3, #b9d9f4) 60%, var(--line)); box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .35); opacity: .78; transition: opacity .15s; }
.gview-host:hover .gview-bar, .gview-bar:focus-within { opacity: 1; }
.gview-btn { border: 0; background: none; color: var(--text); font: inherit; font-size: 12px; font-family: var(--din); padding: 3px 8px; border-radius: 5px; cursor: pointer; min-width: 24px; }
.gview-btn:hover { background: color-mix(in srgb, var(--sky-2, #dcecfa) 70%, transparent); }
.gview-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
@media print { .gview-bar { display: none; } }
/* command dialog: the hand override is required for manual commands */
.hand-box.required { border-color: color-mix(in srgb, var(--p-medium) 70%, var(--line)); background: color-mix(in srgb, var(--p-medium) 12%, var(--panel)); }
.hand-box .req { color: var(--p-high); font-weight: 600; }
.hand-box .hand-signal { color: var(--sky-ink, #2a74b5); }
.cmd-dialog button[type=submit][disabled] { opacity: .55; cursor: not-allowed; }
/* tick boxes on list lines, Select all in the header, and the actions bar for the ticked lines */
th.sel-col, td.sel-col { width: 28px; padding-left: 6px !important; padding-right: 2px !important; text-align: center; }
.sel-col input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
tr.sel-on > td { background: color-mix(in srgb, var(--sky-2, #dcecfa) 55%, transparent) !important; }
.sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; margin: 4px 0 8px; border-radius: 8px;
  background: color-mix(in srgb, var(--sky-1, #eef6fd) 80%, var(--panel)); border: 1px solid color-mix(in srgb, var(--sky-3, #b9d9f4) 70%, var(--line)); }
.sel-bar[hidden] { display: none; }
.sel-bar .sel-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.sel-bar strong { font-size: 13px; }
.lg-tabbody .bulk-num, .cmd-dialog .bulk-num { width: 100px; }
.cmd-dialog .bulk-res { min-width: 110px; }
.dup-box .dup-list { display: grid; gap: 8px; margin-top: 8px; }
.dup-box .dup-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 8px; background: var(--panel); border-radius: 6px; border: 1px solid var(--line); }
.dup-box .dup-opt { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; cursor: pointer; width: auto; margin: 0; white-space: nowrap; }
.dup-box .dup-opt input[type=radio] { width: auto; margin: 0 4px 0 0; flex: none; }

/* Add a point: the same point entered twice */
.dup-warn { padding: 8px 10px; border-left: 4px solid var(--warn, #c98a00); background: color-mix(in srgb, var(--warn, #c98a00) 10%, var(--panel)); border-radius: 6px; font-size: .92em; }
.client-stats .cs-export { margin-left: auto; }
.points-map .cell-sel { min-width: 0; max-width: 9.5rem; }
/* Add a remote site: tick its PLC connections (box beside the name) */
.rs-pick label, label[for=rsn-prof] { display: flex; align-items: center; gap: 8px; text-align: left; margin: 2px 0; }
.rs-pick label input[type=checkbox], label[for=rsn-prof] input[type=checkbox] { width: auto; flex: none; margin: 0; }

/* Graphic editor: text editor for labels */
.tx-editor { display: grid; gap: 8px; margin: 6px 0 10px; }
.tx-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tx-tools .btn[aria-pressed=true] { background: var(--accent); color: #fff; border-color: var(--accent); }
.tx-tools .tx-bold { font-weight: 800; } .tx-tools .tx-italic { font-style: italic; } .tx-tools .tx-underline { text-decoration: underline; }
.tx-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.sw-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sw-label { width: 100%; font-size: .85em; color: var(--muted); }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); padding: 0; cursor: pointer; }
.sw[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-none { background: var(--panel); color: var(--muted); font-size: 12px; line-height: 1; }
.tx-editor input.sw-pick { width: 30px; min-width: 0; height: 24px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; }
#el-text { resize: vertical; min-height: 3.2em; font: inherit; }
.sw-custom { display: inline-flex; align-items: center; gap: 4px; font-size: .85em; color: var(--muted); margin: 0 0 0 4px; cursor: pointer; }
.tx-editor .tx-fit { justify-self: start; }

/* page area grown to every object: the editor marks the page edge and warns about objects outside it */
.gpage-edge { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 8 6; pointer-events: none; vector-effect: non-scaling-stroke; }
.gpage.editing .gpage-beyond { fill-opacity: .5; }
.ged-outside { margin: 0 0 8px; padding: 8px 10px; border-left: 4px solid var(--warn, #c98a00); background: color-mix(in srgb, var(--warn, #c98a00) 10%, var(--panel)); border-radius: 6px; font-size: .92em; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tx-editor input.tx-size { width: 58px; min-width: 0; flex: none; padding: 4px 6px; text-align: center; }

/* compact properties panel in the graphic editor: label beside the field, small fields, position in two rows */
.ged-side { font-size: 12.5px; padding: 8px; }
.ged-side h3 { font-size: 13px; margin: 10px 0 4px; }
.ged-side .formgrid.tight { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 4px 6px; align-items: center; max-width: none; }
.ged-side .formgrid.tight > label { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.2; }
.ged-side .formgrid.tight input:not([type=checkbox]):not([type=radio]):not([type=color]), .ged-side .formgrid.tight select, .ged-side .formgrid.tight textarea { width: 100%; min-width: 0; padding: 3px 6px; font-size: 12.5px; min-height: 0; height: 28px; margin: 0; }
.ged-side .formgrid.tight textarea { height: auto; }
.ged-side .formgrid.tight .span-all { grid-column: 1 / -1; }
.ged-xywh { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; align-items: end; }
.ged-xywh > label { font-size: 10.5px; color: var(--muted); margin: 0; grid-row: 1; }
.ged-xywh > input { grid-row: 2; }
.ged-xywh .ged-flip { grid-row: 2; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; white-space: nowrap; }
.ged-xywh .ged-flip input { width: auto !important; height: auto !important; }
.ged-side .tx-editor { gap: 5px; margin: 2px 0 4px; }
.ged-side .tx-tools .btn.sm { padding: 2px 7px; min-height: 0; font-size: 12px; }
.ged-side .tx-editor input.tx-size { width: 46px !important; height: 24px !important; }
.ged-side .sw { width: 18px; height: 18px; }
.ged-side .sw-row { gap: 3px; }
.ged-side .sw-label { font-size: 11px; }
.ged-side .row, .ged-side .ged-row-sm { gap: 4px; margin: 6px 0; }
.ged-side .row .btn.sm, .ged-side .ged-btn-grid .btn { padding: 3px 8px; font-size: 12px; }
.ged-side .ged-btn-grid { gap: 4px; }
.ged-side .formgrid .btn { margin-top: 0; }
/* Schedules: the new-schedule form keeps inside its panel */
.sched-layout { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
.sched-layout > .stack, .sched-layout .panel { min-width: 0; }
.sched-new { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; margin: 6px 0 8px; }
.sched-new > label { font-size: .88em; color: var(--muted); margin: 0; }
.sched-new select, .sched-new input { width: 100%; min-width: 0; max-width: 100%; margin: 0; text-overflow: ellipsis; }
.sched-times { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.sched-layout .inline-form { flex-wrap: wrap; min-width: 0; }
.sched-layout .inline-form > input, .sched-layout .inline-form > select { min-width: 0; max-width: 100%; }
/* Modules: links between Points, Graphics, Logic and Engineering; where a point is used */
.mod-links { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.mod-link { font-size: 12.5px; padding: 3px 9px; border: 1px solid var(--line2); border-radius: 999px; text-decoration: none; color: var(--muted); background: var(--panel); }
.mod-link:hover { color: var(--accent); border-color: var(--accent); }
.used-in { display: flex; flex-wrap: wrap; gap: 3px; }
.use-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; text-decoration: none; border: 1px solid var(--line2); background: var(--panel); max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.use-chip.use-graphic { border-color: color-mix(in srgb, #4aa8e0 55%, var(--line2)); }
.use-chip.use-logic { border-color: color-mix(in srgb, #7b4fd6 55%, var(--line2)); }
.use-k { font-size: 10px; opacity: .8; }
/* Engineering → Points: its own row of tabs (Hardware I/O, Software points …) under the Engineering tabs */
.pts-areas { margin: -6px 0 6px; font-weight: 600; }
.pts-areas + .stack > nav.sub-tabs { font-size: .95em; }
/* Add hardware points: I/O schedule table (AI, AO, DI, DO, UI) */
.hw-table td.hw-io, .hw-table th.center { text-align: center; width: 44px; }
.hw-table td.hw-io input { width: auto; margin: 0; }
.hw-table .cell-in { width: 100%; min-width: 12rem; }
.hw-table .hw-ch { min-width: 5rem; width: 6.5rem; }
.hw-table tfoot th { background: var(--panel2); font-weight: 700; }
.hw-table tr.hw-dup .cell-in { border-color: var(--p-medium, #c98a00); }
.hw-warn { display: block; color: var(--p-medium, #c98a00); }
.hw-warn:empty { display: none; }
.hw-paste textarea { width: 100%; margin: 6px 0; }
/* Cameras: one-address search and the help when nothing answers */
/* graphic elements with a camera: a small play mark; click opens the live preview */
/* point list: equipment groups and the row action menu */
tr.eq-group td { background: var(--panel2, rgba(0,0,0,.03)); font-weight: 600; cursor: pointer; padding: 7px 10px; }
tr.eq-group .eq-tog { border: 0; background: none; font-size: 13px; width: 1.6em; cursor: pointer; color: var(--accent); padding: 0; }
tr.eq-group .eq-sum { font-weight: normal; margin-left: 10px; color: var(--muted); }
tr.in-group > td:nth-child(2) { padding-left: 22px; }
td.row-act { width: 1%; white-space: nowrap; text-align: right; }
details.row-menu { position: relative; display: inline-block; }
details.row-menu > summary { list-style: none; cursor: pointer; border: 1px solid var(--line2); border-radius: 6px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; background: var(--panel); white-space: nowrap; }
details.row-menu > summary::-webkit-details-marker { display: none; }
details.row-menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 210px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; display: flex; flex-direction: column; text-align: left; }
.row-menu-list > button, .row-menu-list > a { all: unset; display: block; padding: 7px 10px; border-radius: 5px; font-size: 13px; cursor: pointer; color: var(--text); }
.row-menu-list > button:hover, .row-menu-list > a:hover, .row-menu-list > button:focus-visible, .row-menu-list > a:focus-visible { background: var(--panel2, rgba(0,0,0,.05)); color: var(--accent); }
.scope-pp { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* Logic: ladder diagram */
.ld-host { display: none; position: absolute; inset: 0; overflow: auto; padding: 10px 14px 60px; }
.lg.ladder .ld-host { display: block; }
.lg.ladder .lg-svg, .lg.ladder .lg-fit, .lg.ladder .lg-pal, .lg.ladder .lg-side, .lg.ladder .lg-folds { display: none; }
.lg.ladder .lg-mid { grid-template-columns: 0 minmax(0, 1fr) 0; column-gap: 0; }
.ld-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; top: -10px; background: var(--panel); padding: 6px 0 8px; z-index: 3; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.ld-sp { flex: 1; }
.ld-rungs { display: flex; flex-direction: column; gap: 14px; min-width: max-content; }
.ld-rung { border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.ld-head { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ld-comment { flex: 1; min-width: 12rem; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; padding: 2px 4px; }
.ld-comment:focus { background: var(--panel); color: var(--text); outline: 1px solid var(--accent); }
.ld-acts { display: inline-flex; gap: 2px; }
.ld-row { display: flex; align-items: stretch; padding: 12px 0; --ld: var(--line2); }
.ld-row.powered .ld-coils .ld-w { border-color: var(--run, #3fb950); }
.ld-rail { flex: 0 0 4px; background: var(--text); border-radius: 2px; margin: -4px 0; opacity: .75; }
.ld-series { display: flex; align-items: center; flex: 1; min-width: 0; }
.ld-w { flex: 0 0 14px; border-top: 2px solid var(--ld); height: 0; }
.ld-w.grow { flex: 1 1 14px; min-width: 14px; }
.ld-el { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 6px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel); min-width: 92px; }
.ld-el.unset { border-style: dashed; border-color: var(--p-medium, #d29922); }
.ld-el.on { border-color: var(--run, #3fb950); box-shadow: 0 0 0 2px color-mix(in srgb, var(--run, #3fb950) 30%, transparent); }
.ld-el.on .ld-sym { color: var(--run, #3fb950); }
.ld-sym { border: 0; background: none; color: var(--text); font: 700 17px/1.1 var(--mono); letter-spacing: -1px; cursor: pointer; padding: 0 4px; white-space: pre; }
.ld-sym:disabled { cursor: default; }
.ld-coil .ld-sym { letter-spacing: 0; }
.ld-var, .ld-fn, .ld-op { border: 0; background: transparent; color: var(--text); font-size: 12px; font-weight: 600; max-width: 150px; padding: 1px 2px; width: auto; }
.ld-num { width: 64px; font-size: 12px; padding: 1px 4px; }
.ld-cap { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.ld-x { position: absolute; top: -8px; right: -8px; width: 17px; height: 17px; line-height: 14px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel); color: var(--muted); font-size: 12px; padding: 0; cursor: pointer; opacity: 0; }
.ld-x.in { position: static; opacity: .5; margin-left: 2px; flex: none; }
.ld-el:hover > .ld-x, .ld-x:focus-visible, .ld-branch:hover > .ld-x.in { opacity: 1; }
.ld-x:hover { color: var(--bad); border-color: var(--bad); }
.ld-add { width: 26px; height: 22px; padding: 0; border-radius: 50%; border: 1px dashed var(--line2); background: var(--panel); color: var(--accent); font-weight: 700; text-align: center; appearance: none; -webkit-appearance: none; cursor: pointer; text-align-last: center; }
.ld-add:hover, .ld-add:focus { border-style: solid; border-color: var(--accent); }
.ld-par { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--ld); border-right: 2px solid var(--ld); padding: 4px 0; }
.ld-branch { display: flex; align-items: center; }
.ld-branch .ld-series { flex: 1; }
.ld-addbr { align-self: center; border: 0; background: none; color: var(--accent); font-size: 11.5px; cursor: pointer; padding: 0 6px; }
.ld-addbr:hover { text-decoration: underline; }
.ld-coils { display: flex; flex-direction: column; gap: 6px; justify-content: center; border-left: 2px solid var(--ld); padding: 2px 0; }
.ld-coilrow { display: flex; align-items: center; }
.ld-coil { border-radius: 14px; }
.ld-coil.on { background: color-mix(in srgb, var(--run, #3fb950) 16%, var(--panel)); }
.ld-host select.ld-add { width: 26px; flex: 0 0 26px; min-width: 0; }
.ld-host select.ld-add.sm { width: 20px; flex-basis: 20px; height: 18px; font-size: 11px; }
.ld-host input.ld-num { width: 64px; flex: none; }
.ld-host select.ld-var, .ld-host select.ld-fn, .ld-host select.ld-op { width: auto; }
.ld-host input.ld-comment { width: auto; }
.ld-host input.ld-num { width: 64px !important; min-width: 0; }
.ld-host select.ld-add.sm { opacity: 0; transition: opacity .12s; }
.ld-row:hover select.ld-add.sm, .ld-host select.ld-add.sm:focus { opacity: 1; }
/* ladder: function block boxes */
.ld-fb { align-items: stretch; padding: 0; min-width: 250px; border-radius: 4px; border-width: 2px; }
.ld-fbh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 3px 8px; border-bottom: 1px solid var(--line2); font-size: 12.5px; background: var(--panel2); }
.ld-fbh code { font-size: 10.5px; color: var(--muted); }
.ld-fbb { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 5px 0; }
.ld-pins { display: flex; flex-direction: column; gap: 3px; }
.ld-pin { display: flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 0 6px; }
.ld-pin.out { justify-content: flex-end; }
.ld-pn { font-family: var(--mono); font-weight: 700; color: var(--muted); }
.ld-host input.ld-pinv { width: 96px !important; font-size: 11.5px; padding: 1px 4px; min-width: 0; }
.ld-pwr { font-size: 11px; color: var(--accent); font-weight: 600; width: 96px; }
.ld-pwrbtn { border: 0; background: none; cursor: pointer; padding: 0 1px; font-size: 11px; opacity: .3; filter: grayscale(1); }
.ld-pwrbtn.on, .ld-pwrbtn:hover { opacity: 1; filter: none; }
.ld-pval { font: 600 11px var(--mono); color: var(--muted); min-width: 0; } .ld-pval.on { color: var(--run, #3fb950); }
.ld-fb .ld-var { max-width: 110px; font-weight: 500; font-size: 11.5px; }
.ld-params { border-top: 1px solid var(--line); padding: 2px 8px 4px; font-size: 11.5px; }
.ld-params summary { cursor: pointer; color: var(--accent); }
.ld-param { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; }
.ld-host .ld-param input[type=number], .ld-host .ld-param select { width: 90px !important; font-size: 11.5px; padding: 1px 4px; }
.ld-host .ld-param input[type=checkbox] { width: auto !important; }
/* Logic: controller transfer */
.cmd-dialog.wide-dialog.lg-xfer { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.xfer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .xfer-grid { grid-template-columns: 1fr; } }
.xfer-col h3 { margin: 0 0 8px; }
.xfer-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel2); }
.xfer-card p { margin: 4px 0 8px; }
.cmd-dialog.wide-dialog.lg-xfer select { width: auto; }
.xfer-connect { margin-bottom: 14px; }
.xfer-conn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.xfer-conn .row-btns { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.xfer-conn > .small { flex-basis: 100%; }
.xfer-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cmd-dialog.wide-dialog.lg-xfer .xfer-pick input { width: auto; }
.xfer-new { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.xfer-new summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.cmd-dialog.wide-dialog.lg-xfer .xfer-new select, .cmd-dialog.wide-dialog.lg-xfer .xfer-new input { width: 100%; }
.row-menu-sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px 2px; border-top: 1px solid var(--line); margin-top: 3px; }
.row-menu-list > .row-menu-sep:first-child { border-top: 0; margin-top: 0; }
.rel-menu .row-menu-list { min-width: 270px; max-height: 70vh; overflow: auto; }
.page-head .rel-menu > summary, .rel-menu > summary { padding: 4px 10px; font-size: 13px; }
.used-by dd { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
/* Engineering: project set-up steps */
.setup-strip { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 12px; }
.setup-head { display: flex; align-items: baseline; gap: 10px; }
.setup-fold { margin-left: auto; border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 12px; }
.setup-strip.folded .setup-steps { display: none; }
.setup-steps { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(260px, 1.7fr); gap: 8px; margin-top: 8px; }
@media (max-width: 1250px) { .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .setup-step.rest { grid-column: 1 / -1; } }
.setup-step { display: flex; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--panel2); position: relative; }
.setup-step.next { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.setup-step.locked { opacity: .55; }
.setup-n { flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--line2); color: var(--text); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; }
.setup-step.done .setup-n { background: var(--run, #3fb950); color: #fff; }
.setup-step.next .setup-n { background: var(--accent); color: #fff; }
.setup-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.setup-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.setup-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.setup-chip { border: 1px solid var(--line2); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--text); text-decoration: none; background: var(--panel); }
.setup-chip.has { border-color: color-mix(in srgb, var(--run, #3fb950) 60%, var(--line2)); }
.setup-chip:hover { border-color: var(--accent); color: var(--accent); }
/* System Browser: function entries (engineering / operation layouts) */
.side select#tree-mode { width: calc(100% - 16px); margin: 0 8px 6px; padding: 4px 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; }
.side-mode { padding: 0 8px 4px; }
.tree .tn-fn { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; color: var(--text); text-decoration: none; background: none; border: 0; padding: 2px 4px; font: inherit; text-align: left; cursor: pointer; border-radius: 5px; }
.tree .tn-fn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tree .tn-fn[aria-current="page"] { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 600; }
.tree .ico-t { flex: 0 0 16px; text-align: center; color: var(--accent); font-size: 12px; }
.tree .tn-count { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--line2); border-radius: 999px; padding: 0 6px; }
/* ⓘ on logic blocks → Help · Logic block reference */
.bh-i { flex: none; width: 15px; height: 15px; line-height: 13px; border-radius: 50%; border: 1px solid var(--accent); background: var(--panel); color: var(--accent); font: italic 700 10px/13px Georgia, serif; padding: 0; cursor: help; text-align: center; }
.bh-i:hover, .bh-i:focus-visible { background: var(--accent); color: #fff; outline: none; }
.ld-el > .bh-i.ld-i, .ld-par > .bh-i.ld-i { position: absolute; top: -8px; left: -8px; z-index: 1; }
.ld-par { position: relative; }
.ld-fbh .bh-i.in { align-self: center; }
.lg-palitem .bh-i { margin-left: 2px; }
.lg-info { cursor: help; }
.lg-info circle { fill: var(--panel); stroke: var(--accent); stroke-width: 1; }
.lg-info text { font: italic 700 10px Georgia, serif; fill: var(--accent); pointer-events: none; }
.lg-info:hover circle, .lg-info:focus-visible circle { fill: var(--accent); } .lg-info:hover text, .lg-info:focus-visible text { fill: #fff; }
.bh-search input { width: min(520px, 100%); margin-bottom: 10px; }
.bh-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .bh-layout { grid-template-columns: 1fr; } .bh-index { position: static !important; max-height: 220px !important; } }
.bh-index { position: sticky; top: 8px; max-height: calc(100vh - 150px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel); font-size: 12.5px; }
.bh-index h4 { margin: 8px 0 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bh-index a { display: block; padding: 1px 0; text-decoration: none; color: var(--text); }
.bh-index a:hover { color: var(--accent); }
.bh-sec { margin: 14px 0 8px; font-size: 15px; }
.bh-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: var(--panel); scroll-margin-top: 10px; }
.bh-card.open { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); }
.bh-card header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bh-card h3 { margin: 0; font-size: 15px; }
.bh-card header code { color: var(--muted); }
.bh-card p { margin: 6px 0; }
.bh-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.bh-pins h4 { margin: 8px 0 3px; font-size: 12px; color: var(--muted); }
.bh-ex { border-left: 3px solid var(--accent); background: var(--panel2); border-radius: 0 6px 6px 0; padding: 6px 10px; margin-top: 8px; }
.bh-ex p { margin: 2px 0 0; }
.bh-tip { color: var(--muted); }
/* adding several items at once; own categories */
.multi-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
textarea.multi-names { width: 100%; resize: vertical; font: inherit; min-height: 44px; }
.cat-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cat-own { margin-left: 6px; font-size: 10px; font-weight: 500; }
.cat-assign { max-height: 55vh; overflow: auto; }
/* Engineering → Alarm configuration → SMS alerts of the project */
.sms-sum { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 2px 0; flex-wrap: wrap; }
.sms-form { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.sms-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; }
.sms-form legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.sms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; }
.sms-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sms-row[hidden] { display: none; }
.sms-row.wide { grid-column: span 2; }
@media (max-width: 700px) { .sms-row.wide { grid-column: auto; } }
.sms-row label { font-size: 12px; color: var(--muted); }
.sms-row input, .sms-row select, .sms-row textarea { width: 100%; font: inherit; }
.sms-adv { margin-top: 8px; } .sms-adv > summary { cursor: pointer; color: var(--accent); font-size: 12.5px; margin-bottom: 6px; }
.sms-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sms-on { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sms-test { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.sms-test input { width: 170px; }
.sms-on { white-space: nowrap; } .sms-on input { width: auto !important; flex: none; margin: 0; }
.alarm-cfg .cell-in.wide-in { width: min(100%, 420px); min-width: 260px; } td.row-btns { white-space: nowrap; } td.row-btns .btn + .btn { margin-left: 4px; }
.pp-bar.pp-top { margin: 0 0 10px; }
/* project set-up: on the project page (3 steps) and on the client page (projects table) */
.setup-steps { grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(260px, 1.7fr); }
.setup-new { margin-left: auto; }
.client-setup .setup-table { margin-top: 8px; }
.client-setup .setup-chip { white-space: nowrap; }
/* Service: requests, overview, usage; remote-command policy; site in hand */
.badge.svc-open { border-color: var(--accent); color: var(--accent); } .badge.svc-assigned, .badge.svc-in_progress { border-color: var(--p-medium); color: var(--p-medium); }
.badge.svc-done { border-color: var(--run, #3fb950); color: var(--run, #3fb950); } .badge.svc-closed { opacity: .6; }
.svc-desc { white-space: pre-wrap; background: var(--panel2); border-radius: 8px; padding: 8px 12px; }
.svc-notes { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.svc-note { border-left: 3px solid var(--line2); padding: 4px 10px; white-space: pre-wrap; }
.svc-note.visit { border-left-color: var(--accent); } .svc-note.status { color: var(--muted); font-size: 12.5px; } .svc-note.internal { background: color-mix(in srgb, var(--p-medium) 10%, transparent); }
.svc-noteopts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; } .svc-noteopts input[type=checkbox] { width: auto; }
.svc-visit { display: inline-flex; gap: 6px; align-items: center; } .svc-visit[hidden] { display: none; } .svc-visit input { width: auto; }
.svc-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.svc-dot.ok::before { background: var(--run, #3fb950); } .svc-dot.bad::before { background: var(--bad); } .svc-dot.warn::before { background: var(--p-medium); }
.svc-dot.bad { color: var(--bad); font-weight: 600; }
tr.svc-att td:first-child { box-shadow: inset 3px 0 0 var(--p-medium); }
.cmd-policy { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; } .cmd-policy h3 { margin: 0 0 6px; font-size: 13.5px; }
.inhand-panel.on { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 20%, transparent); }
/* Clients (home level): summary tiles and rich client cards; client workspace */
.cc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cc-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(160deg, var(--panel), var(--panel2)); text-decoration: none; color: var(--text); }
.cc-tile b { font-size: 26px; line-height: 1.1; font-weight: 700; } .cc-tile span { font-size: 12px; color: var(--muted); }
.cc-tile.ok b { color: var(--run, #3fb950); } .cc-tile.warn b { color: var(--p-medium); } .cc-tile.bad b { color: var(--bad); }
a.cc-tile:hover { border-color: var(--accent); }
.cc-bar { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; } .cc-find { width: min(360px, 100%); } .cc-bar input[type=checkbox] { width: auto; }
.client-grid.rich { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.client-card.rich { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 14px; text-decoration: none; color: var(--text); border: 1px solid var(--line); background: var(--panel); transition: transform .12s, box-shadow .12s, border-color .12s; }
.client-card.rich:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 16%, transparent); }
.client-card.rich.att { border-left: 4px solid var(--p-medium); }
.cc-head { display: flex; align-items: center; gap: 10px; } .cc-name { flex: 1; min-width: 0; } .cc-name .card-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-logo { flex: none; width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #1b3a57)); letter-spacing: .02em; }
.cc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cc-stats span { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); background: var(--panel2); border-radius: 8px; padding: 6px 8px; }
.cc-stats b { font-size: 17px; color: var(--text); }
.cc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cc-chip { font-size: 11.5px; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line2); background: var(--panel); white-space: nowrap; }
.cc-chip.ok { border-color: color-mix(in srgb, var(--run, #3fb950) 55%, var(--line2)); } .cc-chip.warn { border-color: var(--p-medium); color: var(--p-medium); }
.cc-chip.bad { border-color: var(--bad); color: var(--bad); font-weight: 600; } .cc-chip.off { color: var(--muted); }
.client-card.rich .proj-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.cc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--line2); } .cc-dot.ok { background: var(--run, #3fb950); } .cc-dot.bad { background: var(--p-medium); }
.cc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.cc-att { color: var(--p-medium); } .cc-open { color: var(--accent); font-weight: 600; font-size: 13px; }
.topnav a.nav-back { color: var(--muted); border-right: 1px solid var(--line); padding-right: 12px; margin-right: 4px; }
.topnav a[hidden] { display: none; }
body.in-client .ctx-bar { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--panel)); }

.cc-activity { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.cc-activity .cc-projstatus { grid-column: 1 / -1; }
.cc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cc-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cc-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cc-pcard { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--text); text-decoration: none; }
.cc-pcard:hover { border-color: var(--accent, #0e7c6b); }

/* ---- control-room widgets: gauge, bars, lamp, KPI strip, table, tabs (dashwidgets.ts) ---- */
.gpage.bg-command-teal .gpage-bg { fill: #1f5f6e; }
.gpage.bg-command-teal .glabel { fill: #eaf4f5; } .gpage.bg-command-teal .glabel.c-muted { fill: #a8c9cf; }
.gpage.bg-command-teal .sym-label, .gpage.bg-command-teal .gline-t { fill: #eaf4f5; }
.gpage.bg-command-teal .gbox { fill: rgba(10, 45, 56, .55); stroke: #9fd0d6; stroke-dasharray: none; stroke-width: 1.5; } .gpage.bg-command-teal .gbox-t { fill: #eaf4f5; }
.gpage.bg-command-teal .gvalue-box { fill: #0e3440; stroke: #5aa4ae; } .gpage.bg-command-teal .gvalue { fill: #5df08c; } .gpage.bg-command-teal .gvalue-cap { fill: #bfe0e4; }
.gpage.bg-command-teal .gbtn, .gpage.bg-command-teal .glink { fill: #f2f6f6; stroke: #123c48; } .gpage.bg-command-teal .gbtn-t { fill: #123c48; }
.wd-title { fill: #eaf4f5; font-size: 12px; font-weight: 700; letter-spacing: .02em; } .wd-title.big { font-size: 15px; }
.wd-track { stroke: rgba(235, 245, 246, .88); } .wd-arc { stroke: #31c45c; stroke-linecap: butt; transition: stroke-dasharray .6s ease, stroke .3s; }
.gel-gauge.lv-warn .wd-arc { stroke: #ff8a1f; } .gel-gauge.lv-crit .wd-arc { stroke: #e8452c; } .gel-gauge.lv-none .wd-arc { stroke: #7d8f94; }
.wd-readbox { fill: #0e3440; stroke: #123c48; stroke-width: 2; } .wd-read { fill: #5df08c; font-weight: 800; font-family: var(--mono); }
.wd-unit { fill: #1d3a44; font-size: 15px; font-weight: 600; } .gel-gauge .wd-unit { fill: #123c48; }
.gel-gauge.q-bad .wd-read, .gel-bars.q-bad .wd-cur { fill: #9aa7ab; }
.wd-card { fill: rgba(231, 242, 244, .18); stroke: rgba(255, 255, 255, .45); stroke-width: 1.5; }
.wd-bartrack { fill: rgba(220, 226, 228, .85); } .wd-barfill { fill: #31c45c; transition: y .6s ease, height .6s ease; } .wd-tick { stroke: rgba(255, 255, 255, .85); stroke-width: 1.5; }
.wd-scale { fill: #ffe76a; font-size: 11px; font-weight: 700; } .wd-cur { fill: #ffe76a; font-size: 12px; font-weight: 800; font-family: var(--mono); }
.wd-barname { fill: #eaf4f5; font-size: 10px; font-weight: 800; letter-spacing: .05em; } .wd-barunit { fill: #bfe0e4; font-size: 10px; font-weight: 700; }
.wd-lamp { fill: #6f7d82; transition: fill .25s; } .wd-lamp-rim { fill: none; stroke: rgba(0, 0, 0, .45); stroke-width: 1.5; } .wd-lamptext { fill: var(--text); font-size: 13px; font-weight: 600; }
.gpage.bg-command-teal .wd-lamptext { fill: #eaf4f5; }
.gel-lamp.lamp-on .wd-lamp, .wd-lamp.lamp-on { fill: #2fd45e; filter: drop-shadow(0 0 4px #2fd45e); }
.gel-lamp.lamp-trip .wd-lamp { fill: #f03a2a; animation: gv-blink 1s steps(2) infinite; } .gel-lamp.lamp-fault .wd-lamp { fill: #f2a516; } .gel-lamp.lamp-bad .wd-lamp { fill: #4b5559; }
.wd-lamp.lamp-off, .gel-lamp.lamp-off .wd-lamp { fill: #5d6b70; } .wd-lamp.lamp-bad { fill: #4b5559; }
@keyframes gv-blink { 50% { opacity: .35; } }
.wd-stripbg { fill: rgba(10, 45, 56, .55); } .wd-striplabel { fill: #eaf4f5; font-weight: 800; } .wd-stripcell { fill: #f2f6f6; stroke: #123c48; stroke-width: 1; } .wd-stripval { fill: #123c48; font-weight: 700; font-family: var(--mono); }
.wd-stripcell.st-bad { fill: #c7cdd0; } .wd-stripcell.st-on { fill: #d7f5df; } .wd-stripcell.st-off { fill: #f2f6f6; }
.wd-thead { fill: #14424f; stroke: #8fc3ca; stroke-width: 1; } .wd-rowhead { fill: #14424f; stroke: #8fc3ca; stroke-width: 1; } .wd-rowlabel { fill: #eaf4f5; font-weight: 800; }
.wd-cell { fill: #f2f6f6; stroke: #123c48; stroke-width: 1; } .wd-celltext { fill: #123c48; font-weight: 700; font-family: var(--mono); }
.wd-cell.st-on { fill: #d2f4db; } .wd-cell.st-bad { fill: #c7cdd0; } .wd-cell.st-static { fill: #14424f; stroke: #8fc3ca; } .wd-cell.st-static + .wd-celltext { fill: #eaf4f5; }
.wd-tab rect:not(.wd-gloss) { fill: #f2f6f6; stroke: #123c48; stroke-width: 1.5; } .wd-tab text { fill: #123c48; font-weight: 700; } .wd-tab.active rect:not(.wd-gloss) { fill: #0e2f3a; } .wd-tab.active text { fill: #fff; }
.wd-tab.clickable { cursor: pointer; } .wd-tab.clickable:hover rect:not(.wd-gloss) { fill: #dff0f2; } .wd-tab.active.clickable:hover rect:not(.wd-gloss) { fill: #0e2f3a; }
.gel-gauge .wd-title, .gel-table .wd-title { fill: #eaf4f5; }
.gpage:not(.bg-command-teal) .gel-gauge .wd-title, .gpage.bg-hmi-light .gel-bars .wd-title, .gpage.bg-hmi-light .gel-gauge .wd-title { fill: var(--text); }
.gpage.bg-hmi-light .wd-barname, .gpage.bg-hmi-light .wd-barunit { fill: #3d4752; } .gpage.bg-hmi-light .wd-scale, .gpage.bg-hmi-light .wd-cur { fill: #8a6a00; }
.gpage.bg-hmi-light .wd-card { fill: rgba(255, 255, 255, .7); stroke: #b4bcc5; }
.wd-hub { fill: #f2f6f6; stroke: #123c48; stroke-width: 2; } .gel-gauge .wd-unit { fill: #123c48; }
.ged-colhead { min-width: 4.5em; } .db-eq { max-height: 220px; overflow: auto; border: 1px solid var(--line); padding: 6px; border-radius: 6px; } .db-eq label { display: block; }
.db-eq label { display: flex; align-items: center; gap: 8px; padding: 2px 0; } .db-eq input[type=checkbox] { width: auto; flex: none; }

/* ---- glossy finish: highlight on boxes, buttons, cells and lamps; specular bevel on symbols and 3D equipment ---- */
.kv-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wd-gloss { fill: url(#kv-gloss); pointer-events: none; }
.wd-lamp-hi { fill: url(#kv-gloss-r); pointer-events: none; }
.wd-cyl { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1; pointer-events: none; }
.gel-symbol .sym, svg.graphic.iso .part, .gel-template .gtpl .box { filter: url(#kv-gloss-fx); }
.gel-gauge .wd-arc, .gel-bars .wd-barfill { filter: url(#kv-gloss-fx); }
@media (prefers-reduced-motion: reduce) { .gel-symbol .sym, svg.graphic.iso .part { filter: none; } }
.wd-tab .wd-gloss { fill: url(#kv-gloss); stroke: none; }

/* ---- 3D shapes (box, cylinder, tank, cone, pipe, duct): live states, caption, flow ---- */
.gel-solid .sd-edge { stroke: rgba(255, 255, 255, .6); stroke-width: 1; stroke-linecap: round; pointer-events: none; }
.gel-solid .sd-cap { font-size: 12px; font-weight: 600; fill: var(--gtext, #2a3b44); paint-order: stroke; stroke: rgba(255, 255, 255, .8); stroke-width: 3px; pointer-events: none; }
.gel-solid .sd-flow { stroke: rgba(255, 255, 255, .85); stroke-width: 2.5; stroke-dasharray: 4 9; stroke-linecap: round; opacity: 0; pointer-events: none; }
.gel-solid.s-run .sd-flow { opacity: 1; animation: iso-flow 1.2s linear infinite; }
.gel-solid.s-run .sd-face.sd-t { filter: brightness(1.18); }
.gel-solid.s-trip .sd-face { fill: #c9302c; }
.gel-solid.s-trip .sd-o { stroke: #7a1b19; }
.gel-solid.s-alarm-on .sd-face, .gel-solid.s-alarm-on .sd-o { stroke: #e5484d; stroke-width: 2; }
.gel-solid.q-bad { opacity: .55; }
.pal-item { position: relative; }
.pal-x { position: absolute; top: 1px; right: 3px; font-size: 15px; line-height: 1; color: var(--muted, #6b7782); cursor: pointer; }
.pal-x:hover { color: #c9302c; }
.pal-comp-r { fill: rgba(127, 166, 201, .35); stroke: #7fa6c9; }
.pal-solid, .pal-comp { overflow: visible; }
.pp-bar:has(.pp-none) { display: none; }

/* Remote sites: Verify connection */
.rs-verdict{font-weight:600;margin:.2rem 0}
.rs-verdict.ok{color:var(--ok,#1b7f3b)} .rs-verdict.warn{color:var(--warn,#9a6700)} .rs-verdict.fail{color:var(--bad,#b3261e)}
.rs-ctl{border-top:1px solid var(--line,#d8dee6);padding-top:.6rem;margin-top:.4rem}
.rs-ctl h3{margin:.1rem 0 .3rem}
.rs-steps{list-style:none;margin:.2rem 0 .5rem;padding:0}
.rs-step{padding:.15rem 0}
.rs-mark{display:inline-block;width:1.2em;text-align:center;font-weight:700}
.rs-step.ok .rs-mark{color:var(--ok,#1b7f3b)} .rs-step.fail .rs-mark{color:var(--bad,#b3261e)} .rs-step.warn .rs-mark{color:var(--warn,#9a6700)}
.rs-ctl th[scope=row]{text-align:left;font-weight:500;width:14rem}
.err-dialog{border-color:var(--bad)} .err-dialog h2{color:var(--bad)} .err-msgs p{margin:.3rem 0;overflow-wrap:anywhere} .err-actions{margin-top:.8rem;display:flex;gap:.5rem;justify-content:flex-end}
.rs-conn{border:1px solid var(--line,#d8dee6);border-radius:8px;padding:.6rem .8rem;margin:.6rem 0}
.rs-conn.bad{border-color:var(--bad,#b3261e)}
.rs-conn-head{display:flex;flex-wrap:wrap;gap:.4rem .6rem;align-items:center}
.rs-conn-right{margin-left:auto;display:flex;gap:.5rem;align-items:center}
.rs-warn{padding:.4rem .6rem;border-radius:6px;margin:.4rem 0;font-weight:600}
.rs-warn.ok{background:rgb(27 127 59/.12);color:var(--ok,#1b7f3b)} .rs-warn.warn{background:rgb(154 103 0/.14);color:var(--warn,#9a6700)} .rs-warn.fail{background:rgb(179 38 30/.12);color:var(--bad,#b3261e)}
.rs-vbox{margin:.3rem 0} .rs-pts{width:100%} .rs-badrow td{color:var(--bad,#b3261e)}
.rs-xfer th[scope=row]{text-align:left;font-weight:500;width:14rem}
.rs-site-sum{background:var(--panel2,#eef2f6);border-radius:6px;padding:.4rem .6rem;margin:.4rem 0}
.rs-conn-sum{margin:.2rem 0;font-weight:600}
.rs-stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:.3rem .8rem;margin:.4rem 0}
.rs-stat{display:flex;flex-direction:column;border-left:3px solid var(--line,#d8dee6);padding-left:.5rem}
.rs-k{font-size:.75rem;color:var(--muted,#667)} .rs-v{overflow-wrap:anywhere}
.rs-note{margin:0 0 .3rem;font-weight:600}.rs-note.ok{color:var(--ok,#1b7f3b)}.rs-note.fail{color:var(--bad,#b3261e)}
.rs-finds{list-style:none;margin:.3rem 0;padding:0} .rs-find{padding:.2rem 0}
.rs-find.fail{color:var(--bad,#b3261e)} .rs-find.warn{color:var(--warn,#9a6700)} .rs-find.security{color:var(--text,#223)}
.rs-fix{margin-left:.6rem;padding:.1rem .6rem}

/* home dashboard (Profen staff) */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin-bottom: 18px; }
.dash-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px 14px; min-width: 0; }
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dash-head h2 { font-size: 14px; margin: 0; }
.dash-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 13px; min-width: 0; }
.dash-row:first-of-type { border-top: 0; }
a.dash-row:hover { background: var(--panel2); }
.dash-main { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-note { flex: 0 1 auto; text-align: right; max-width: 55%; }
.dash-empty { margin: 4px 0; }
.dash-clients { font-size: 16px; margin: 6px 0 10px; }
@media (max-width: 760px) { .dash-note { max-width: 45%; white-space: normal; } }
.utilnav { display: flex; align-items: center; gap: 2px; margin-right: 4px; padding-right: 8px; border-right: 1px solid var(--line); }
.utilnav a[aria-current="page"] { color: var(--text); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 760px) { .utilnav { margin-right: 0; padding-right: 0; border-right: 0; } }
@media (max-width: 760px) { .topbar .user { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; white-space: normal; } .topbar .user > span:first-child { display: none; } }
/* Profen staff on the home page (no client open): no System Browser */
body.home-level .side, body.home-level .side-show, body.home-level .menu-btn { display: none !important; }
body.home-level .layout { grid-template-columns: 1fr; }
