/* Fixed Point Control System
   Colours, type, and the header lockup match the Fixed Point jobs app
   (navy #13294B, amber #E8A33D, paper #f5f3ee, system-ui, ui-monospace).
   The plant page is a dark HMI built from those tokens. */

:root {
  --navy: #13294b;
  --navy-2: #1c3966;
  --amber: #e8a33d;
  --amber-ink: #8a5a0f;
  --paper: #f5f3ee;
  --white: #fff;
  --text: #181b20;
  --muted: #5b616c;
  --line: #e2ded4;
  --ok: #1d7a46;
  --ok-bg: #e3f3e9;
  --warn-bg: #fdf1dc;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 12px;
  --hmi: #0d1b33;
  --hmi-card: #13294b;
  --hmi-raise: #1c3966;
  --hmi-line: #2c4a73;
  --hmi-text: var(--paper);
  --hmi-muted: #c5cdd8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--text);
}
body.paper { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body.eng { font-family: Inter, var(--sans); }
body.noauth { padding-bottom: 0; min-height: 100vh; min-height: 100dvh; }
img { max-width: 100%; }
a { color: var(--navy); }
button, input { font: inherit; }
h1 { font-size: 1.35rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: 1rem; margin: 0; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.top-left { display: flex; align-items: center; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 34px; height: 34px; display: block; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand b { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.brand small {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  color: var(--amber);
  font-weight: 400;
}
.desk { display: none; }
.who { flex: none; }
.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 99px;
  background: #eef1f6;
  color: var(--navy);
  white-space: nowrap;
}
.pill.example {
  background: var(--warn-bg);
  color: var(--amber-ink);
  border: 1px dashed #e0b56a;
}
.pill.complete, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad, .pill.cancelled { background: var(--bad-bg); color: var(--bad); }
.pill.neutral { background: #eef1f6; color: var(--navy); }

.tabs {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1;
  text-align: center;
  padding: 9px 4px 8px;
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}
.tabs a svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--navy); font-weight: 650; }
.tabs a.on svg { stroke: var(--navy); }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin: 0 0 10px;
}
.meta { color: var(--muted); font-size: 0.86rem; margin: 0; }
.group {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-ink);
  margin: 18px 2px 8px;
}
.group:first-child { margin-top: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.banner {
  background: var(--warn-bg);
  border: 1px dashed #e0b56a;
  color: var(--amber-ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin: 0 0 12px;
}
.btn[hidden], #graphicEdit[hidden], #graphicEdited[hidden], #graphicPending[hidden], #graphicBack[hidden] { display: none !important; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.btn.sec { background: #fff; color: var(--navy); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #1a1205; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.hint { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }
.err {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
}
label { display: block; font-size: 0.85rem; font-weight: 600; margin: 12px 0 4px; }
input[type="number"], input[type="text"] {
  width: 100%;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid #cfcabd;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
input:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.login { max-width: 380px; margin: 8vh auto 0; padding: 0 20px 40px; }
.logo { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; color: var(--text); }
.logo img { width: 52px; height: 52px; display: block; flex: none; }
.logo b { display: block; font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1.05; }
.logo small {
  font-family: var(--mono);
  letter-spacing: 0.32em;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
}
.links { text-align: center; margin: 14px 0 0; }

.swatch { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.swatch i { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); display: block; flex: none; }
.swatch b { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 0.93rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Plant HMI */
body.hmi {
  background: var(--hmi);
  color: var(--hmi-text);
  padding-bottom: 0;
}
body.hmi h1, body.hmi h2, body.hmi h3 { color: var(--hmi-text); }
body.hmi .meta, body.hmi .hint, body.hmi label { color: var(--hmi-muted); }
body.hmi .group { color: var(--amber); }
body.hmi .wrap { max-width: 1100px; }
body.hmi .sub { margin: 0 0 12px; color: var(--hmi-muted); font-size: 0.9rem; }

.runbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  margin: 0 0 12px;
  font-size: 0.92rem;
}
.runbar strong { font-weight: 650; }

.safety { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.chip {
  background: var(--hmi-card);
  border: 1px solid var(--hmi-line);
  border-radius: var(--r);
  padding: 8px 8px 10px;
  min-width: 0;
}
.chip .k {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hmi-muted);
  margin-bottom: 6px;
  line-height: 1.2;
}
.case, .panel, .mod, .ret, .ha, .tools {
  background: var(--hmi-card);
  border: 1px solid var(--hmi-line);
  border-radius: var(--r);
}
.case, .panel { padding: 12px; margin: 0 0 12px; }
.flow { display: grid; gap: 8px; }
.mod { padding: 10px; border-top: 2px solid transparent; min-width: 0; }
.mod.is-on { border-top-color: var(--amber); }
.mod.is-alarm { border-top-color: var(--bad); }
.mod .k {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hmi-muted);
}
.mod .v, .ret .v, .ha-val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.mod .v { font-size: 1.45rem; line-height: 1.15; margin: 2px 0; }
.mod .v small, .unit { font-size: 0.75rem; color: var(--hmi-muted); margin-left: 2px; font-weight: 400; }
.pair { display: flex; gap: 14px; margin: 4px 0; }
.pair span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pair i { font-style: normal; font-size: 0.75rem; color: var(--hmi-muted); }
body.hmi b.bad { color: #f0b4ae; }
body.hmi b.ok { color: #b7e4c7; }
.sym { width: 100%; height: 36px; margin-bottom: 4px; color: var(--hmi-muted); }
.mod.is-on .sym { color: var(--amber); }
.mod.is-alarm .sym { color: var(--bad); }
.sym svg { width: 72px; height: 36px; display: block; }
.return { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ret { padding: 10px; min-width: 0; }
.ret .k { display: block; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hmi-muted); }
.ret .v { font-size: 1.15rem; }

.alarm { padding: 2px 0 10px; border-bottom: 1px solid var(--hmi-line); margin-bottom: 10px; }
.alarm:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.alarm h3 { margin: 8px 0 2px; }
.empty { color: var(--hmi-muted); margin: 8px 0; }

.spin { display: flex; gap: 8px; align-items: center; }
.spin input { max-width: 7rem; text-align: right; font-family: var(--mono); }
body.hmi .spin input {
  background: var(--hmi);
  color: var(--hmi-text);
  border-color: var(--hmi-line);
}
.seg {
  display: flex;
  background: #0c1730;
  border-radius: 10px;
  padding: 3px;
  margin: 0;
  gap: 0;
}
.seg button {
  flex: 1;
  text-align: center;
  padding: 7px 6px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--hmi-muted);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  min-height: 34px;
}
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--navy); }

.hand-grid { display: grid; gap: 8px; }
.ha {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name val" "seg seg" "hand hand";
  gap: 6px 8px;
  align-items: center;
}
.ha-name { grid-area: name; font-weight: 650; font-size: 0.92rem; }
.ha-val { grid-area: val; justify-self: end; font-size: 1rem; }
.ha .seg { grid-area: seg; }
.hand-row { grid-area: hand; display: none; }
.ha[data-mode="hand"] .hand-row { display: block; }
.ha .force { display: none; font-style: normal; margin-left: 6px; color: var(--amber); font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.ha.forced .force { display: inline; }
.ha.forced .ha-val b { color: var(--amber); }
input[type="range"] { width: 100%; accent-color: var(--amber); }

.tools { padding: 0; margin: 0 0 12px; }
.tools summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 650;
  color: var(--amber);
  list-style: none;
}
.tools summary::-webkit-details-marker { display: none; }
.tools summary::before { content: "▸ "; font-family: var(--mono); }
.tools[open] summary::before { content: "▾ "; }
.tools .inner { padding: 0 12px 12px; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body.hmi .tool-grid .btn.sec { background: transparent; color: var(--paper); border-color: var(--hmi-line); }
.note { min-height: 1.2em; margin: 8px 0 0; color: var(--amber); font-size: 0.85rem; }

.foot {
  color: var(--hmi-muted);
  font-size: 0.75rem;
  margin: 4px 2px 8px;
}

@media (min-width: 1100px) {
  .desk { display: flex; gap: 16px; margin-left: 22px; align-items: center; }
  .desk a { color: #fff; text-decoration: none; font-size: 0.92rem; opacity: 0.78; }
  .desk a[aria-current="page"] { opacity: 1; font-weight: 650; box-shadow: inset 0 -2px 0 var(--amber); padding-bottom: 2px; }
  .tabs { display: none; }
  body.paper { padding-bottom: 28px; }
  body.paper .wrap { max-width: 980px; }
  .about-grid, .guide-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 12px; align-items: start; }
  .safety { gap: 8px; }
  .chip { padding: 8px 10px; }
  .chip .k { font-size: 0.72rem; }
  .case, .panel { padding: 10px; margin-bottom: 8px; }
  .mod { padding: 8px; }
  .mod .v { font-size: 1.25rem; }
  .sym { height: 28px; }
  .sym svg { height: 28px; }
  .ha { padding: 8px; gap: 4px; }
  .seg button { min-height: 30px; padding: 4px 4px; font-size: 0.78rem; }
  .stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .return { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
  html.shot body.hmi { height: 100vh; overflow: hidden; }
  html.shot body.hmi .wrap {
    height: calc(100vh - 54px);
    max-width: none;
    display: flex;
    flex-direction: column;
    padding: 12px 16px 10px;
    overflow: hidden;
  }
  html.shot .stage { flex: 1; min-height: 0; }
  html.shot .case { margin-bottom: 0; }
  html.shot .side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
  html.shot .side .panel { margin: 0; }
  html.shot .side .panel.alarms { flex: 1; overflow: auto; }
  html.shot .hand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.shot .tools, html.shot .foot, html.shot .tabs { display: none; }
}

@media (max-width: 420px) {
  .brand small { letter-spacing: 0.22em; }
  .who .pill { font-size: 0.65rem; padding: 2px 6px; }
}
html.shot .top, html.shot .tabs { position: static; }
.graphic-nav { display: flex; gap: 8px; overflow: auto; margin: 8px 0 12px; }
.graphic-nav .chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy, #13294B); text-decoration: none; white-space: nowrap; }
.graphic-nav .chip.on { background: #13294B; color: #fff; border-color: #13294B; }
body.graphics .wrap { max-width: none; }
.stage-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: #f7f5f0; }
#stage, #stageFit { position: relative; }
#stage { background: transparent; }
.schematic { position: relative; min-height: 280px; }
.room { position: absolute; border: 1px dashed #9aa3b2; border-radius: 12px; padding: 10px 12px; color: #5b616c; font-size: 15px; }
.schematic-bar { position: absolute; border-radius: 99px; }
.schematic-bar.duct { background: #c5cedd; }
.schematic-bar.pipe { background: #8aa0bd; }
.symbol-node { position: absolute; width: 112px; height: 164px; touch-action: none; }
.symbol-node svg { width: 112px; height: 112px; display: block; }
.symbol-caption { display: block; width: 112px; text-align: center; font-size: 14px; line-height: 1.25; color: #13294B; margin-top: 4px; font-weight: 600; overflow-wrap: anywhere; }
.symbol-node.is-selected { outline: 2px solid #E8A33D; border-radius: 8px; }
.symbol-node.is-alarm { outline: 2px solid #b42318; border-radius: 8px; }
.symbol-node.is-running .symbol-caption { color: #1d7a46; }
.symbol-node.is-off { opacity: 0.55; }
.symbol-node.is-alarm .fpcs-value { fill: #b42318; }
.symbol-picks { display: flex; gap: 8px; overflow: auto; padding-bottom: 8px; }
.symbol-pick { min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 12px; white-space: nowrap; }
#graphicEdit { margin-top: 12px; }
#graphicEdit label { display: grid; gap: 4px; margin: 8px 0; }
#graphicEdit input, #graphicEdit select { min-height: 44px; font-size: 16px; }
html[data-theme="dark"] .stage-scroll { background: #151b27; }
html[data-theme="dark"] .symbol-caption { color: #f4f6fa; }
html[data-theme="dark"] .graphic-nav .chip { background: #1c2433; color: #f5f3ee; }

.table-scroll { overflow: auto; }
table.io { width: 100%; border-collapse: collapse; font-size: 13px; }
table.io tr.held td { background: #fdf1dc; }
table.io th, table.io td { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
table.io input, table.io select { min-height: 44px; width: 100%; font-size: 16px; }
#sign { width: 100%; max-width: 420px; height: 120px; border: 1px solid var(--line); border-radius: 12px; background: #fff; touch-action: none; }
#sheetEditor .fields { display: grid; gap: 8px; }
@media (min-width: 800px) { #sheetEditor .fields { grid-template-columns: 1fr 1fr 1fr; } }
#sheetEditor .check { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; margin: 6px 0; }
#sheetEditor .notice { padding: 10px 12px; border: 1px solid #E8A33D; background: #fff7e9; border-radius: 12px; }

.site-grid { display: grid; gap: 12px; }
@media (min-width: 800px) { .site-grid { grid-template-columns: 1fr 1fr; } }
.site-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.site-card h2 { margin: 4px 0; }
.site-card.comms-fail { border-left: 4px solid #b42318; }
html[data-theme="dark"] .site-card { background: #1c2433; }

.diary { width: 100%; border-collapse: collapse; }
.diary th, .diary td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.diary input[type="time"] { min-height: 44px; width: 7.2rem; margin-right: 4px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-name, .cal-day { min-height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-variant-numeric: tabular-nums; }
.cal-name { color: var(--muted); font-size: 12px; min-height: 24px; }
.cal-day.closed { background: #13294B; color: #fff; }
.cal-day.reduced { background: #f3d7a4; color: #13294B; }
html[data-theme="dark"] .cal-day.reduced { background: #8a5a0f; color: #fff; }
.holiday-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.holiday-add input { min-height: 44px; }
#scheduleRoot { display: grid; gap: 12px; }
@media (min-width: 800px) { #scheduleRoot { grid-template-columns: 1.4fr 1fr; } #scheduleRoot .notify-card:first-child { grid-column: 1 / -1; } }

.notify-grid { display: grid; gap: 12px; margin-top: 16px; }
.notify-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.notify-card h2 { margin: 0 0 8px; font-size: 16px; }
.notify-card form { display: grid; gap: 8px; }
.notify-card .check { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.notify-card input { min-height: 44px; }
.history { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.history span { font-variant-numeric: tabular-nums; color: var(--muted); }
html[data-theme="dark"] .notify-card { background: #1c2433; }
@media (min-width: 800px) { .notify-grid { grid-template-columns: 1.2fr 1fr; } .notify-grid .notify-card:first-child { grid-row: span 2; } }

html.shot * { animation: none !important; transition: none !important; }

.who { display: flex; align-items: center; gap: 8px; }
.menu-btn {
  appearance: none;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  min-height: 28px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
}
.menu-sheet {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(320px, 100vw);
  max-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #fff;
  color: var(--text);
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  padding-right: calc(12px + env(safe-area-inset-right));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 8px;
  align-content: start;
}
body.menu-open { overflow: hidden; }
.menu-sheet[hidden] { display: none !important; }
.menu-sheet .btn { min-height: 42px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 550; margin: 14px 0 4px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.login input[type="password"],
.login input[type="text"] {
  width: 100%;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid #cfcabd;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.mono { font-family: var(--mono); }

.coach { position: fixed; inset: 0; z-index: 40; }
.coach-hole {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(8, 14, 28, 0.72);
  outline: 2px solid var(--amber);
  pointer-events: none;
}
.coach-card {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  margin: 0 auto;
  max-width: 440px;
  max-height: 48vh;
  overflow: auto;
  background: var(--paper);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.coach-logo { margin: 0 0 8px; }
.coach-logo img { width: 36px; height: 36px; }
.coach-logo b { font-size: 1.05rem; }
body.hmi .coach-card h2,
.coach-card h2 { font-size: 1.12rem; color: var(--text); }
body.hmi .coach-card,
body.hmi .coach-card p { color: var(--text); }
.coach-card p { margin: 6px 0 0; font-size: 0.95rem; }
.dots { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 12px 0; }
.dots button {
  width: 8px;
  height: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #d5cfc3;
  cursor: pointer;
}
.dots button[aria-current="true"] { width: 18px; background: var(--navy); }
.coach-actions { display: flex; justify-content: space-between; gap: 8px; }
.coach-actions .btn { min-height: 44px; min-width: 108px; }
body.coaching .tabs { display: none; }

.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 0.9rem; margin: 0 0 8px; }
body.hmi .back { color: var(--hmi-muted); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.summary a {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 6px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}
.summary .n {
  display: block;
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 650;
  color: var(--navy);
  line-height: 1.1;
}
.summary .fault .n { color: var(--bad); }
.alarm-head { margin: 4px 0 6px; }
.alarm-head h2 { font-size: 1rem; }
.alarm-roll { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.alarm-roll a { text-decoration: none; }
.safety-ok { margin: 0 0 12px; color: var(--ok); font-weight: 650; }
.safety-banner[hidden] { display: none !important; }
.safety-banner {
  display: block;
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: var(--r);
  padding: 12px;
  margin: 0 0 12px;
  font-weight: 650;
}
.safety-banner ul { margin: 8px 0 0; padding-left: 18px; }
.safety-banner a { color: var(--bad); }
.sys-grid { display: grid; gap: 10px; }
.sys { display: block; text-decoration: none; color: inherit; }
.sys h2 { font-size: 1.05rem; }
.sys .alarm-line { margin: 8px 0 0; font-size: 0.86rem; font-weight: 650; color: var(--navy); }
.vals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 8px; }
.vals span { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.vals b { font-family: var(--mono); font-size: 1.05rem; font-weight: 650; }
.vals small { display: block; color: var(--muted); font-size: 0.75rem; }
body.hmi .vals span, body.hmi .vals small { color: var(--hmi-muted); }
body.hmi .vals b { color: var(--hmi-text); }
.safety.mini { margin-bottom: 12px; }
.tools-lite { margin-top: 12px; }
.tools-lite summary { cursor: pointer; font-weight: 650; }
.alarm-row { border-left: 4px solid var(--bad); }
.alarm-row.unacked { background: #fff8f6; }
.alarm-row h2 { margin: 8px 0 2px; font-size: 1rem; }
@media (min-width: 800px) {
  .sys-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  body.home .wrap { max-width: 960px; }
  body.home .sys-grid { grid-template-columns: 1fr 1fr; }
}
.eng-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.eng-app { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: calc(100vh - 58px); }
.eng-app.has-check { grid-template-columns: 200px minmax(0, 1fr) 260px; }
.eng-check { background: #fff; border-left: 1px solid var(--line); padding: 12px; overflow: auto; }
.eng-check h2 { font-size: 0.95rem; margin: 0 0 8px; }
.eng-check .btn { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; min-height: 36px; }
.wizard-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.guide-grid .wide { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.guide-grid .wide .check { margin: 0; }
.more { margin-top: 10px; }
.more summary { cursor: pointer; font-weight: 650; color: var(--navy); }
.check-lines { margin: 8px 0 12px; padding-left: 18px; }
.check-lines li { margin: 0 0 4px; }
.eng-nav { background: #fff; border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.eng-nav a { text-decoration: none; color: var(--navy); font-weight: 650; padding: 8px 10px; border-radius: 8px; }
.eng-nav a[aria-current="page"] { background: var(--navy); color: #fff; }
.eng-main { padding: 16px 18px 32px; min-width: 0; }
#fpcsCheck {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  width: min(420px, calc(100% - 32px));
  max-height: 46vh;
  overflow: auto;
  margin: 0;
  box-shadow: 0 12px 32px rgba(19, 41, 75, 0.16);
}
#fpcsCheck[hidden] { display: none; }
#fpcsCheck ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
#fpcsCheck li .btn { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; }
.eng-main h1 { margin-bottom: 6px; }
.eng-main label { font-size: 0.82rem; }
.eng-main input, .eng-main select, .eng-main textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #cfcabd; border-radius: 10px; background: #fff; color: var(--text);
}
.eng-main .check input { width: 22px; height: 22px; padding: 0; flex: none; }
.eng-main textarea { min-height: 72px; }
.stack { display: grid; gap: 8px; margin-top: 10px; }
.guide ol { margin: 8px 0 0; padding-left: 18px; }
.table-wrap { overflow-x: auto; }
.eng-main table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.eng-main th, .eng-main td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.channels { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.channels span { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 0.75rem; }
.channels .used { background: var(--navy); color: #fff; }
.channels .free { background: #eef1f6; color: var(--muted); }
.device { margin: 0 0 14px; }
.device.comms-fail { border-left: 3px solid var(--bad); padding-left: 10px; }
.bacnet-exp h1 { margin: 0 0 4px; font-size: 1.35rem; }
.bacnet-exp details > summary { cursor: pointer; margin: 6px 0; }
.bacnet-exp .drop-point { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; color: var(--muted); margin-top: 8px; }
.block-pick { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0 0 6px; cursor: pointer; }
.block-pick.on { border-color: var(--navy); box-shadow: inset 3px 0 0 var(--amber); }
.block-pick span { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.test-banner { background: var(--warn-bg); border: 1px dashed #e0b56a; color: var(--amber-ink); border-radius: 10px; padding: 10px 12px; font-weight: 700; }
.trend { width: 100%; height: 140px; background: #fff; border-radius: 8px; }
@media (max-width: 900px) {
  .eng-split { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .eng-app.has-check, body.logic-fill .eng-app.has-check { grid-template-columns: 200px minmax(0, 1fr); }
  .eng-check { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); max-height: 220px; }
}
@media (max-width: 800px) {
  .eng-app, .eng-app.has-check { grid-template-columns: 1fr; }
  .eng-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .eng-main { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.eng-main:has(.sheet) { padding: 0; }
body.logic-fill { overflow: hidden; }
body.logic-fill .eng-app {
  height: calc(100vh - var(--fpcs-top, 58px));
  height: calc(100dvh - var(--fpcs-top, 58px));
  min-height: 0;
  max-width: 100%;
}
body.logic-fill .eng-nav { min-width: 0; max-width: 100%; }
body.logic-fill .eng-main { height: 100%; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
body.logic-fill #sheetRoot { flex: 1; min-height: 0; display: flex; }
.sheet { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 0; min-width: 0; max-width: 100%; padding: 8px 10px 10px; background: var(--paper, #f6f4ef); }
.sheet:fullscreen, .sheet:-webkit-full-screen { width: 100%; height: 100%; padding: 8px; background: #f6f4ef; }
.sheet:fullscreen .panel-toggle, .sheet.is-fullscreen .panel-toggle { background: #13294B; color: #fff; font-weight: 700; }
.sheet-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: nowrap; flex: 0 0 auto; min-width: 0; overflow: visible; }
.sheet-title { flex: 0 1 auto; min-width: 88px; max-width: 28%; overflow: hidden; }
.sheet-title h1 { margin: 0; white-space: nowrap; line-height: 1.05; }
.sheet-title .meta { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-tools { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 4px; min-width: 0; flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; }
.sheet-tools .btn { flex: none; white-space: nowrap; height: 30px; min-height: 30px; padding: 0 8px; font-size: 0.78rem; line-height: 1; }
.sheet-tools .btn.on { background: var(--navy); color: #fff; }
.sheet-tools .icon-btn { width: 30px; min-width: 30px; padding: 0; }
.sheet-tools #sheetZoomLabel { flex: none; white-space: nowrap; min-width: 40px; text-align: center; }
.sheet-test { position: relative; flex: none; }
.sheet-test summary { list-style: none; }
.sheet-test summary::-webkit-details-marker { display: none; }
.sheet-test div { display: none; }
.sheet-test[open] div { position: absolute; z-index: 8; top: calc(100% + 4px); right: 0; display: grid; gap: 4px; min-width: 148px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 20px rgba(19, 41, 75, 0.12); }
.sheet:fullscreen .sheet-body,
.sheet:fullscreen .sheet-body.palette-off,
.sheet:fullscreen .sheet-body.inspector-off,
.sheet:fullscreen .sheet-body.palette-off.inspector-off,
.sheet.is-fullscreen .sheet-body,
.sheet.is-fullscreen .sheet-body.palette-off,
.sheet.is-fullscreen .sheet-body.inspector-off,
.sheet.is-fullscreen .sheet-body.palette-off.inspector-off { grid-template-columns: minmax(0, 1fr); position: relative; }
.sheet:fullscreen .palette, .sheet:fullscreen .inspector,
.sheet.is-fullscreen .palette, .sheet.is-fullscreen .inspector { position: absolute; z-index: 6; top: 0; bottom: 0; width: min(300px, 42vw); max-height: none; background: #fff; }
.sheet:fullscreen .palette, .sheet.is-fullscreen .palette { left: 0; }
.sheet:fullscreen .inspector, .sheet.is-fullscreen .inspector { right: 0; }
.sheet:fullscreen .sheet-body.palette-off .palette,
.sheet:fullscreen .sheet-body.inspector-off .inspector,
.sheet.is-fullscreen .sheet-body.palette-off .palette,
.sheet.is-fullscreen .sheet-body.inspector-off .inspector { display: none; }
.sheet-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr) 280px; gap: 8px; }
.sheet-body.palette-off { grid-template-columns: minmax(0, 1fr) 300px; }
.sheet-body.inspector-off { grid-template-columns: 240px minmax(0, 1fr); }
.sheet-body.palette-off.inspector-off { grid-template-columns: minmax(0, 1fr); }
.sheet-body.palette-off .palette, .sheet-body.inspector-off .inspector { display: none; }
.palette, .inspector { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; padding: 8px; min-height: 0; }
.palette details { margin: 0 0 8px; }
.palette summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 4px 2px; }
.palette, .palette .chip { user-select: none; -webkit-user-select: none; }
.palette .chip, .sheet-ghost {
  display: block; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; margin: 4px 0 0; cursor: grab; color: var(--text);
}
.palette .chip b, .palette .chip span { display: block; }
.palette .chip span { color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.sheet-ghost { position: absolute; z-index: 30; width: auto; pointer-events: none; background: #fff; box-shadow: 0 8px 20px rgba(19, 41, 75, 0.18); }
.viewport { position: relative; overflow: hidden; background: #fff; border: 0; border-radius: 0; touch-action: none; min-height: 0; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; background-color: #fff; background-image: linear-gradient(to right, rgba(0, 0, 0, 0.06) 1px, transparent 1px), linear-gradient(to bottom, rgba(0, 0, 0, 0.06) 1px, transparent 1px), linear-gradient(to right, rgba(0, 0, 0, 0.16) 1px, transparent 1px), linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 1px, transparent 1px); background-size: 10px 10px, 10px 10px, 50px 50px, 50px 50px; }
.wires { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.blocks { position: absolute; inset: 0; }
.wire { fill: none; stroke: #111; stroke-width: 1.35; }
.logic-workspace.is-traced .fb { opacity: 0.28; }
.logic-workspace.is-traced .fb.traced { opacity: 1; box-shadow: inset 0 0 0 3px #c2410c; }
.logic-workspace.is-traced .wire { opacity: 0.18; }
.logic-workspace.is-traced .wire.traced { opacity: 1; stroke: #c2410c; stroke-width: 2.6; }
@media print {
  .logic-workspace.is-traced .fb, .logic-workspace.is-traced .wire { opacity: 1 !important; box-shadow: none !important; stroke: #111 !important; }
}
.wire.digital { stroke: #111; }
.wire.digital.lit { stroke: #111; stroke-width: 2.2; }
.wire.trip { stroke: #b42318; stroke-width: 2.2; }
.wire.sel { stroke-dasharray: 5 4; }
.wire.temp { stroke-dasharray: 4 4; opacity: 0.85; }
.wire-val { font: 14px ui-monospace, monospace; fill: #13294B; paint-order: stroke; stroke: #fff; stroke-width: 4; }
.fb { position: absolute; background: #fff; border: 1px solid #d9d3c6; border-radius: 10px; box-shadow: 0 1px 0 rgba(19, 41, 75, 0.04); }
.fb.on { border-color: var(--navy); box-shadow: inset 3px 0 0 var(--amber); }
.fb.active { box-shadow: inset 3px 0 0 var(--amber), 0 0 0 2px rgba(232, 163, 61, 0.45); }
.fb.trip { border-color: var(--bad); background: #fff6f4; box-shadow: inset 3px 0 0 var(--bad); }
.fb header { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; padding: 6px 8px 0; }
.fb { overflow: visible; }
.fb header { align-items: flex-start; }
.fb header b { font-size: 14px; line-height: 1.25; white-space: normal; }
.fb header .live { font-family: var(--mono); font-size: 14px; color: var(--navy); }
.fb-sub { margin: 0; padding: 0 8px 4px; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: visible; }
.fb-row { display: grid; grid-template-columns: 1fr 10px 1fr; min-height: 36px; align-items: center; }
.fb-row.single { display: flex; min-height: 36px; }
.fb-row.single .port { flex: 1; }
.port { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0 6px; min-height: 32px; min-width: 0; cursor: crosshair; color: var(--text); font: inherit; font-size: 14px; line-height: 1.2; }
.port span { min-width: 0; white-space: nowrap; overflow: visible; }
.port.out { flex-direction: row-reverse; }
.port i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #13294B; background: #fff; flex: none; }
.port.digital i { border-color: #E8A33D; background: #fff8ec; }
.port i { width: 14px; height: 14px; }
.fb.strat .port { min-height: 32px; }
.port.wire-ok { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--ok); }
.port.wire-no { background: #fde8e8; box-shadow: inset 0 0 0 2px #b42318; }
.port.wire-no { opacity: 0.28; }
.palette .chip em { display: block; font-style: normal; font-size: 0.68rem; letter-spacing: 0.04em; color: var(--muted); }
.story p { margin: 0 0 8px; }
.port em { font-style: normal; font-family: var(--mono); font-size: 14px; color: var(--navy); }
.inspector h2 { font-size: 1rem; margin: 4px 0; }
.inspector form { display: grid; gap: 8px; }
.bind { display: grid; gap: 4px; }
.bind > span { font-size: 0.82rem; }
.bind-open, .bind-menu button {
  width: 100%; text-align: left; min-height: 44px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 16px; cursor: pointer;
}
.bind-menu { display: grid; gap: 4px; max-height: 240px; overflow: auto; padding: 4px 0 0; }
.bind-menu[hidden], .bind-menu button[hidden] { display: none !important; }
.bind-menu input { width: 100%; font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.bind-menu p { margin: 6px 2px 0; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bind-menu button { border: 0; background: transparent; border-radius: 8px; text-align: left; }
.bind-menu button span { display: block; color: var(--muted); font-size: 12px; font-weight: 450; }
.bind-menu button.on { background: #f3f1eb; font-weight: 650; }
@media (max-width: 1024px) {
  .sheet-body, .sheet-body.palette-off, .sheet-body.inspector-off, .sheet-body.palette-off.inspector-off { grid-template-columns: minmax(0, 1fr); position: relative; }
  .palette, .inspector { position: absolute; z-index: 6; top: 0; bottom: 0; width: min(300px, 86vw); max-height: none; display: block; }
  .palette { left: 0; }
  .inspector { right: 0; }
  .sheet-body.palette-off .palette, .sheet-body.inspector-off .inspector { display: none; }
  .viewport { min-height: 0; }
}

.sheet-frame { min-width: 0; min-height: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: 22px minmax(0, 1fr) auto; background: #fff; border: 1px solid #1c1c1c; }
.ruler-corner { background: #f3f3f3; border-right: 1px solid #b5b5b5; border-bottom: 1px solid #b5b5b5; }
.ruler { position: relative; overflow: hidden; background: #f7f7f7; color: #333; font: 10px ui-monospace, monospace; }
.ruler-x { border-bottom: 1px solid #b5b5b5; }
.ruler-y { border-right: 1px solid #b5b5b5; }
.ruler span { position: absolute; }
.ruler-x span { top: 4px; transform: translateX(-50%); }
.ruler-y span { left: 2px; transform: translateY(-50%); }
.sheet-frame .viewport { grid-column: 2; grid-row: 2; }
.titleblock { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(88px, 1.8fr) minmax(0, 0.45fr) minmax(0, 0.75fr) minmax(0, 1fr) minmax(72px, 0.95fr) minmax(0, 0.5fr); border-top: 1px solid #1c1c1c; background: #fff; }
.titleblock > div { min-width: 0; padding: 3px 5px 4px; border-right: 1px solid #1c1c1c; overflow: visible; }
.titleblock > div:last-child { border-right: 0; }
.titleblock span { display: block; font-size: 8px; letter-spacing: 0.02em; text-transform: uppercase; color: #666; line-height: 1.15; white-space: normal; }
.titleblock b { display: block; margin-top: 1px; font-size: 10px; font-weight: 650; color: #13294B; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
.tb-brand { display: flex; align-items: flex-start; gap: 4px; }
.tb-brand img { flex: none; width: 20px; height: 20px; }
.tb-brand b { margin: 0; white-space: normal; line-height: 1.15; font-size: 10px; }
.bind-select { width: 100%; margin-top: 4px; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; }
.strat-status { display: flex; gap: 14px; align-items: center; min-height: 28px; padding: 2px 4px 0; color: #333; font-size: 12px; }
.strat-status #sheetStatus { margin-left: auto; color: var(--muted); }
.sheet-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 3; width: min(420px, 90%); padding: 18px; text-align: center; background: rgba(255, 255, 255, 0.94); border: 1px solid #1c1c1c; }
.sheet-empty p { margin: 0 0 12px; font-size: 1rem; }
.sheet-empty .row { justify-content: center; }
.sheet-empty .btn { min-height: 44px; }
.lib-title { margin: 2px 2px 8px; font-size: 0.95rem; }
.page-tree { border-bottom: 1px solid var(--line); margin: -2px -2px 8px; padding: 0 2px 8px; }
.page-tree h2 { margin: 2px 0 6px; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.page-tree ul { list-style: none; margin: 0 0 6px; padding: 0 0 0 10px; border-left: 1px solid #c8c8c8; }
.page-tree button[data-page] { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; font: inherit; }
.page-tree button[data-page].on { background: #13294B; color: #fff; }
.wire-cap { fill: #fff; stroke: #111; stroke-width: 1; }
.wire-join { fill: #111; }
.fb.strat { border: 1px solid #111; border-radius: 2px; box-shadow: none; background: #fff; padding-top: 8px; }
.fb.strat .mod-tab { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); min-width: 22px; height: 16px; padding: 0 5px; background: #fff; border: 1px solid #111; border-bottom: 0; text-align: center; font: 700 11px ui-monospace, monospace; line-height: 15px; }
.fb.strat header { padding: 2px 8px 0; }
.fb.strat header b { font-size: 12px; letter-spacing: 0.01em; }
.fb.strat .code { font-family: ui-monospace, monospace; margin-right: 4px; }
.fb.strat .sym { width: 22px; height: 22px; flex: none; }
.fb.strat .fb-sub { font-size: 11px; padding-bottom: 2px; }
.fb.strat .pin-row { display: grid; grid-template-columns: 1fr 1fr; min-height: 26px; align-items: center; }
.fb.strat .pin-gap { min-height: 26px; }
.fb.strat .port { min-height: 32px; font-size: 12px; padding: 0 4px; }
.fb.found { outline: 3px solid #E8A33D; }
.fb.strat .port .pn { font-style: normal; font-family: ui-monospace, monospace; font-size: 10px; color: #666; margin-right: 3px; }
.fb.strat .port i { width: 8px; height: 8px; border-radius: 1px; border: 1px solid #111; background: #fff; }
.fb.strat .port.out i { position: relative; }
.fb.strat .port.out i::after { content: ""; position: absolute; left: 8px; top: -1px; border: 4px solid transparent; border-left: 5px solid #111; }
.fb.strat .param { display: flex; justify-content: space-between; gap: 8px; padding: 0 8px; font-size: 10px; color: #444; }
.fb.strat .param b { font-weight: 650; }
@media (max-width: 800px) {
  .titleblock { grid-template-columns: 1fr 1fr 1fr; }
  .titleblock b { font-size: 10px; }
  .strat-status { flex-wrap: wrap; }
  .strat-status #sheetStatus { margin-left: 0; }
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 560;
  font-display: swap;
  src: url("../fonts/inter-560.woff2") format("woff2");
}
body.estate {
  background: #f3f1eb;
  font-family: Inter, var(--sans);
  color: #1c2128;
}
body.estate .top { background: #13294b; box-shadow: none; }
body.estate .who .pill.example {
  background: transparent;
  border: 0;
  color: rgba(247, 244, 238, 0.62);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0;
  font-size: 0.72rem;
}
.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.estate .wrap { padding: 0 16px 28px; }
body.estate .hero {
  background: linear-gradient(180deg, #13294b 0%, #10233f 100%);
  color: #f7f4ee;
  margin: 0 -16px;
  padding: 8px 22px 52px;
}
.hero-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eyebrow { margin: 0; color: rgba(247, 244, 238, 0.62); font-size: 0.78rem; letter-spacing: 0.01em; }
body.estate .hero h1 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 6vw, 2.7rem);
  font-weight: 560;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: #f7f4ee;
}
.hero-status {
  margin: 8px 0 0;
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  color: #f7f4ee;
}
.hero-status.bad { color: #ffd2cb; }
.hero-facts {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  color: rgba(247, 244, 238, 0.78);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.hero-facts b { font-weight: 560; color: #f7f4ee; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: rgba(247, 244, 238, 0.45); }
.tag-example {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 8px;
  font-weight: 560;
  white-space: nowrap;
}
.hero .tag-example { color: rgba(247, 244, 238, 0.66); border-color: rgba(247, 244, 238, 0.22); }
.tag-example.inline { margin: 0 0 12px; }
body.estate #plant-overview { margin-top: -28px; }
body.estate .status-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(19, 41, 75, 0.08);
  padding: 14px 16px 12px;
}
body.estate .status-strip { display: flex; align-items: center; gap: 4px 14px; }
.ring { width: 44px; height: 44px; flex: none; }
.ring circle { fill: none; stroke: rgba(19, 41, 75, 0.1); stroke-width: 3; }
.ring .arc { stroke: var(--ok); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 21px 21px; }
.ring.bad .arc { stroke: var(--bad); }
body.estate .status-strip a { text-decoration: none; color: inherit; min-width: 58px; }
body.estate .status-strip b {
  display: block;
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
body.estate .status-strip span { color: var(--muted); font-size: 0.72rem; }
body.estate .status-strip .fault.hot b { color: var(--bad); }
body.estate .prio {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ece8e0;
  font-size: 0.8rem;
  color: var(--muted);
}
body.estate .prio a, body.estate .prio span { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: 6px; }
body.estate .prio i { width: 7px; height: 7px; border-radius: 50%; background: #d5cfc3; display: inline-block; }
body.estate .prio .critical.live i { background: var(--bad); }
body.estate .prio .high.live i { background: var(--amber); }
body.estate .prio .medium.live i { background: #8d93a0; }
body.estate .prio .unack.live { color: var(--text); font-weight: 560; }
body.estate .safety-ok { display: none; }
body.estate .safety-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: #fff;
  color: var(--text);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(180, 35, 24, 0.08);
  padding: 14px 16px 14px 18px;
  margin: 12px 0 0;
  font-weight: 500;
  position: relative;
}
body.estate .safety-banner::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--bad);
}
body.estate .safety-banner strong { font-weight: 560; letter-spacing: -0.02em; padding-left: 8px; }
body.estate .safety-banner a { color: var(--bad); text-decoration: none; font-weight: 560; padding-left: 8px; }
body.estate .section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; }
body.estate .section-head h2 { font-size: 0.95rem; font-weight: 560; letter-spacing: -0.02em; }
body.estate .section-head a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
body.estate .sys-grid { gap: 12px; }
body.estate .sys {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 0;
  border-radius: 22px;
  padding: 14px 14px 12px;
  margin: 0;
  box-shadow: 0 10px 28px rgba(19, 41, 75, 0.06);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: estate-in 0.45s ease both;
}
body.estate .sys:nth-child(2) { animation-delay: 0.04s; }
body.estate .sys:nth-child(3) { animation-delay: 0.08s; }
body.estate .sys:nth-child(4) { animation-delay: 0.12s; }
body.estate .sys:nth-child(5) { animation-delay: 0.16s; }
body.estate .sys:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(19, 41, 75, 0.1); }
@keyframes estate-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sys-top { display: flex; gap: 10px; align-items: flex-start; }
.ico {
  width: 36px; height: 36px; border-radius: 12px; background: #f3f1eb; color: var(--navy);
  display: grid; place-items: center; flex: none;
}
.ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sys-top h2, .sys-hero h1 { letter-spacing: -0.03em; }
.sys-top h2 { font-size: 1rem; font-weight: 560; }
.sys-top p, .sys-hero p { margin: 1px 0 0; color: var(--muted); font-size: 0.75rem; }
.stat { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 560; color: var(--muted); white-space: nowrap; }
.stat i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; flex: none; }
.stat.running { color: var(--ok); }
.stat.tripped, .stat.fault, .stat.alarm { color: var(--bad); }
.stat.hand { color: var(--amber-ink); }
.stat i.pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: estate-pulse 2.2s ease-out infinite;
}
@keyframes estate-pulse {
  0% { opacity: 0.65; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.9); }
}
.sys-main, .value-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sys-main { margin-top: 14px; }
.num { font-size: 2rem; font-weight: 560; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; line-height: 0.95; }
.sys-main > span, .value-hero > span { color: var(--muted); font-size: 0.8rem; text-align: right; }
.sys-main em, .value-hero em { font-style: normal; display: block; color: var(--text); }
.sys-foot { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.sys-foot span { white-space: nowrap; }
.spark { margin-left: auto; width: 96px; height: 28px; flex: none; }
.spark polyline { fill: none; stroke: #1c3c6e; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.estate .alarm-line { margin: 10px 0 0; font-size: 0.78rem; font-weight: 500; color: var(--amber-ink); }
body.estate .tools-lite { background: transparent; border: 0; box-shadow: none; padding: 4px 2px; }
body.estate .tools-lite summary { font-weight: 500; color: var(--muted); }
.page-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-kicker h1, .sys-hero h1 { font-size: clamp(1.7rem, 4vw, 2.1rem); font-weight: 560; letter-spacing: -0.04em; margin: 0; }
.lead { margin: 4px 0 16px; }
.sys-hero { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 12px; }
.sys-hero .eyebrow { color: var(--muted); }
body.estate .value-hero, body.estate .soft, body.estate .safe-row div {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(19, 41, 75, 0.06);
}
body.estate .value-hero { padding: 16px; margin: 0 0 12px; }
body.estate .value-hero .num { font-size: 2.6rem; }
body.estate .soft { padding: 14px 16px; margin: 0 0 12px; }
body.estate .soft h2 { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 560; margin: 0 0 8px; }
body.estate .vals b { font-family: Inter, var(--sans); font-variant-numeric: tabular-nums; font-weight: 560; }
.safe-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.safe-row div { padding: 10px 12px; }
.safe-row span { display: block; color: var(--muted); font-size: 0.75rem; }
.safe-row b { font-weight: 560; }
.safe-row .on b { color: var(--bad); }
body.estate #alarmGroups h2 { margin: 18px 2px 8px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 560; }
body.estate .alarm-row {
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(19, 41, 75, 0.06);
  padding: 14px;
}
body.estate .alarm-row.unacked { background: #fff; box-shadow: inset 3px 0 0 var(--bad), 0 10px 28px rgba(19, 41, 75, 0.06); }
.alarm-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.75rem; }
ul.plain { margin: 0 0 10px; padding-left: 18px; }
body.estate .back { color: var(--muted); }
@media (min-width: 800px) {
  body.estate .wrap { max-width: 960px; }
  body.graphics.estate .wrap { max-width: 1360px; }
  body.estate .sys-grid { grid-template-columns: 1fr 1fr; }
  body.estate .hero { padding: 12px 28px 56px; border-radius: 0 0 28px 28px; }
}
html[data-theme="dark"] body.estate { background: #0c1118; color: #eef1f6; }
html[data-theme="dark"] body.estate .status-card,
html[data-theme="dark"] body.estate .sys,
html[data-theme="dark"] body.estate .soft,
html[data-theme="dark"] body.estate .value-hero,
html[data-theme="dark"] body.estate .safe-row div,
html[data-theme="dark"] body.estate .alarm-row,
html[data-theme="dark"] body.estate .tabs { background: #171d28; color: #eef1f6; }
html[data-theme="dark"] body.estate .ico { background: #242b38; color: #e8edf5; }
html[data-theme="dark"] body.estate .prio { border-top-color: #2c3442; }
html[data-theme="dark"] body.estate .tag-example,
html[data-theme="dark"] body.estate .eyebrow,
html[data-theme="dark"] body.estate .sys-top p,
html[data-theme="dark"] body.estate .sys-foot,
html[data-theme="dark"] body.estate .lead,
html[data-theme="dark"] body.estate .meta { color: #a7b0bd; }
html[data-theme="dark"] body.estate .hero .tag-example { color: rgba(247, 244, 238, 0.66); }
html[data-theme="dark"] body.estate .safety-banner { background: #24181a; color: #f6eeec; }
html[data-theme="dark"] body.estate .prio .unack.live,
html[data-theme="dark"] body.estate .status-strip b,
html[data-theme="dark"] body.estate .hero-facts b { color: #f4f6fa; }
html[data-theme="dark"] body.estate .spark polyline { stroke: #d5dbe6; }
html[data-theme="dark"] body.estate .ring circle { stroke: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] body.estate .tabs { border-top-color: #2c3442; }
html[data-theme="dark"] body.estate .tabs a.on { color: #f7f4ee; }
html[data-theme="dark"] body.estate .sys-main em,
html[data-theme="dark"] body.estate .value-hero em,
html[data-theme="dark"] body.estate .num,
html[data-theme="dark"] body.estate h1,
html[data-theme="dark"] body.estate h2 { color: #f4f6fa; }
body.estate a.sys-open, body.estate a.sys-main, body.estate a.value-hero { color: inherit; text-decoration: none; }
body.estate a.value-hero { display: flex; }
body.hmi .trend-hit { color: inherit; text-decoration: none; }
body.trends .trend-ranges { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
body.trends .trend-ranges button, body.trends .trend-views button {
  border: 0; background: #fff; color: var(--navy); border-radius: 999px; padding: 8px 12px;
  font: inherit; font-size: 0.85rem; font-weight: 560; cursor: pointer;
  box-shadow: 0 6px 16px rgba(19, 41, 75, 0.05);
}
body.trends .trend-ranges button.on { background: var(--navy); color: #fff; }
.custom-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 12px; }
.custom-range[hidden] { display: none !important; }
.custom-range label { font-size: 0.75rem; color: var(--muted); }
.custom-range input, body.trends #trendSearch, body.trends .save-view input {
  font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; color: var(--text);
}
body.trends #trendSearch, body.trends .save-view { width: 100%; margin: 8px 0 12px; }
body.trends .save-view { display: flex; gap: 8px; }
body.trends .save-view input { flex: 1; }
.trend-card { position: relative; background: #fff; border-radius: 22px; box-shadow: 0 12px 32px rgba(19, 41, 75, 0.07); padding: 8px 8px 12px; margin: 0 0 12px; }
#trendChart { width: 100%; height: 280px; touch-action: none; }
.trend-tip {
  position: absolute; z-index: 2; max-width: 220px; background: #13294b; color: #f7f4ee;
  border-radius: 12px; padding: 8px 10px; font-size: 0.75rem; pointer-events: none;
  display: grid; gap: 3px;
}
.trend-tip[hidden] { display: none !important; }
.trend-tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 6px 0; }
.trend-legend button { border: 0; background: transparent; font: inherit; font-size: 0.78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.trend-legend button.on { color: var(--text); font-weight: 560; }
.trend-legend i { width: 10px; height: 3px; border-radius: 2px; }
.trend-actions { display: flex; gap: 8px; margin: 0 0 16px; }
.trend-views { display: flex; flex-wrap: wrap; gap: 8px; }
body.trends h2.quiet { margin: 8px 2px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 560; }
.trend-list section { margin: 0 0 12px; }
.trend-list h2 { font-size: 0.85rem; margin: 0 0 6px; }
.trend-list .point { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 8px 10px; margin: 0 0 6px; box-shadow: 0 4px 12px rgba(19, 41, 75, 0.04); }
.trend-list em { font-style: normal; color: var(--muted); }
.trend-list .record { margin-left: auto; border: 0; background: #f3f1eb; border-radius: 999px; padding: 4px 8px; font: inherit; font-size: 0.72rem; cursor: pointer; }
.trend-list .record.on { background: #e3f3e9; color: var(--ok); }
.section-links { display: flex; gap: 14px; }
.section-links a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
body.estate .vals a { text-decoration: none; color: inherit; }
@media (min-width: 800px) {
  #trendChart { height: 360px; }
}
html[data-theme="dark"] body.trends .trend-card,
html[data-theme="dark"] body.trends .trend-ranges button,
html[data-theme="dark"] body.trends .trend-list .point,
html[data-theme="dark"] .custom-range input,
html[data-theme="dark"] body.trends #trendSearch,
html[data-theme="dark"] body.trends .save-view input { background: #171d28; color: #eef1f6; border-color: #2c3442; }
html[data-theme="dark"] body.trends .trend-ranges button.on { background: #f4f6fa; color: #13294b; }

/* Compact holidays card (8 Nov 2026) */
@media (min-width: 800px) { #scheduleRoot { align-items: start; } }
.hol-card { font-size: 14px; }
.hol-summary { margin: 0 0 12px; color: var(--muted); display: block; line-height: 1.45; position: static; clear: both; }
.hol-summary b { color: inherit; }
.hol-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hol-list li { display: grid; grid-template-columns: 64px 1fr auto auto; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); min-height: 36px; }
.hol-list li:last-child { border-bottom: 0; }
.hol-when { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hol-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hol-tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.hol-tag.off { background: #fdecc8; color: #8a5a00; }
.hol-tag.reduced { background: #e3ecfa; color: #1d4e9e; }
.hol-tag.open { background: #dcf3e4; color: #1b6b3a; }
.hol-open { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); min-height: 32px; }
.notify-card .hol-open input { min-height: 0; width: 16px; height: 16px; }
.hol-x { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.hol-x:hover { background: rgba(180,35,24,.1); color: #b42318; }
.hol-more { margin-top: 8px; }
.hol-more > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--accent, #1d4e9e); padding: 6px 0; list-style: none; }
.hol-more > summary::-webkit-details-marker { display: none; }
.hol-more > summary::before { content: "▸ "; }
.hol-more[open] > summary::before { content: "▾ "; }
.hol-add > summary::before, .hol-add[open] > summary::before { content: ""; }
.hol-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hol-card .holiday-add { margin-top: 4px; }
html[data-theme="dark"] .hol-tag.off { background: #4a3a12; color: #ffd98a; }
html[data-theme="dark"] .hol-tag.reduced { background: #1d3355; color: #a9c8ff; }
html[data-theme="dark"] .hol-tag.open { background: #173a26; color: #9fe0b5; }
.hol-card .hol-list li { padding: 3px 0; min-height: 0; }
.hol-card .hol-open, .hol-card .hol-list label { min-height: 0; margin: 0; padding: 0; display: flex; }
.hol-card .hol-x { height: 26px; width: 26px; }
.hol-card .hol-more { margin-top: 4px; }
.hol-card .hol-more > summary { padding: 3px 0; }
/* Compact calendar beside holidays (8 Nov 2026) */
@media (min-width: 800px) {
  #scheduleRoot { grid-template-columns: 1fr 1fr; align-items: stretch; }
  #scheduleRoot .notify-card:last-child { grid-column: 1 / -1; }
}
.cal-card .cal { gap: 2px; }
.cal-card .cal-day { min-height: 26px; font-size: 13px; border-radius: 6px; }
.cal-card .cal-name { min-height: 18px; font-size: 11px; }
.cal-key { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.cal-key .k { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-key .k.closed { background: #13294B; }
.cal-key .k.reduced { background: #f3d7a4; margin-left: 8px; }

/* Client experience (8 Nov 2026): four screens, no drawer, no plant links */
.client-home { display: none; }
html.role-client .client-home { display: grid; gap: 16px; margin: 26px 0 24px; }
html.role-client body.home .status-card,
html.role-client body.home #floorPlan,
html.role-client body.home .section-head,
html.role-client body.home #systems,
html.role-client body.home .tools-lite,
html.role-client .section-links { display: none !important; }
html.role-client .safety-banner a { pointer-events: none; }
.client-home h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #5b616c); margin: 0 0 10px; }
.client-temps { display: grid; gap: 12px; }
.temp-card { background: #fff; color: #13294B; border: 1px solid var(--line, #e2ddd2); border-radius: 18px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; box-shadow: 0 8px 18px rgba(19, 41, 75, .05); }
.temp-head h3 { margin: 0; font-size: 18px; }
.temp-head p { margin: 2px 0 0; color: #5b616c; font-size: 13px; }
.temp-now { text-align: right; }
.temp-now span, .temp-sp span { display: block; font-size: 12px; color: #5b616c; font-weight: 600; }
.temp-now b { font-size: 30px; font-variant-numeric: tabular-nums; }
.temp-set { grid-column: 1 / -1; display: grid; grid-template-columns: 64px 1fr 64px; gap: 12px; align-items: center; }
.temp-sp { text-align: center; }
.temp-sp b { font-size: 34px; font-variant-numeric: tabular-nums; }
.temp-btn { height: 64px; border-radius: 16px; border: 0; background: #13294B; color: #fff; font-size: 34px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation; }
.temp-btn:disabled { background: #cfd5de; color: #fff; cursor: not-allowed; }
.temp-btn:focus-visible { outline: 3px solid #E8A33D; outline-offset: 2px; }
.temp-limit { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: #5b616c; }
.status-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line, #e2ddd2); border-radius: 18px; }
.status-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line, #e2ddd2); color: #13294B; }
.status-list li:last-child { border-bottom: 0; }
.status-name { font-weight: 600; }
.status-word { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: #1d7a46; text-align: right; }
.status-word i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.status-list li.bad .status-word { color: #b42318; }
@media (min-width: 800px) {
  html.role-client .client-home { grid-template-columns: 1.2fr 1fr; align-items: start; }
}
html.role-client body.home { overflow-x: hidden; }
.client-plant { display: none; }
html.role-client .client-plant { display: grid; gap: 12px; grid-column: 1 / -1; min-width: 0; max-width: 100%; }
.plant-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.plant-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid #d5deea; background: #fff; color: #13294B; font-weight: 700; cursor: pointer; }
.plant-tabs .tab-dot { width: 10px; height: 10px; border-radius: 50%; background: #1d7a46; flex: none; }
.plant-tabs button.bad .tab-dot { background: #b42318; }
.plant-tabs button[aria-selected="true"] { background: #13294B; color: #fff; border-color: #13294B; }
.plant-tabs button[aria-selected="true"] .tab-dot { box-shadow: 0 0 0 2px #fff; }
.plant-tabs button:focus-visible { outline: 3px solid #E8A33D; outline-offset: 2px; }
.client-scroll { width: 100%; max-width: 100%; min-width: 0; }
.client-drawing { max-width: 100%; min-width: 0; border-radius: 18px; }
.client-drawing .plant-svg { width: 100%; max-width: 100%; height: auto; display: block; }
.client-plant .sp-tags { margin: 0; }
.plant-enlarge-btn { display: none; justify-self: start; min-height: 44px; }
.plant-enlarge { position: fixed; inset: 0; z-index: 80; background: #121820; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 20px; }
.plant-enlarge[hidden] { display: none !important; }
.plant-enlarge .client-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.plant-enlarge .btn { align-self: flex-start; }
body.enlarge-open { overflow: hidden; }
@media (max-width: 800px) {
  html.role-client .client-home { grid-template-columns: minmax(0, 1fr); }
  .client-plant .temp-btn { height: 56px; }
  .plant-enlarge-btn { display: inline-flex; }
  .client-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }
  .client-scroll .client-drawing,
  .client-scroll .plant-drawing {
    width: max-content;
    min-width: 100%;
    background: #1a2433;
  }
  .client-scroll .plant-svg { display: block; background: #1a2433; }
}
.logout-btn { white-space: nowrap; }
.project-chip { color: #fff; font-size: 0.82rem; font-weight: 650; max-width: min(280px, 34vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.system-card { display: flex; flex-direction: column; gap: 6px; min-height: 132px; padding: 16px; background: #fff; color: #13294B; border: 1px solid var(--line, #e2ddd2); border-radius: 18px; text-decoration: none; box-shadow: 0 8px 18px rgba(19, 41, 75, .05); }
.system-card h2 { margin: 0; font-size: 1.2rem; }
.system-card .meta { margin: 0; }
.system-status { display: flex; justify-content: space-between; align-items: center; margin-top: auto; font-weight: 650; }
.system-card.bad .status-word { color: #b42318; }
.system-card.ok .status-word { color: #1d7a46; }
.plant-frame, .plant-drawing { position: relative; }
.plant-drawing { background: #1a2433; border-radius: 18px; }
.sp-on-drawing { position: absolute; z-index: 2; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; gap: 6px; align-items: center; width: 280px; padding: 8px; background: #121820; color: #f4f6fa; border: 1px solid #E8A33D; border-radius: 14px; box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.sp-on-drawing[data-place="cylinder"] { left: 39%; top: 42%; }
.sp-on-drawing[data-place="flow"] { left: auto; right: 3%; top: auto; bottom: 8%; }
.sp-on-drawing[data-place="zone"] { left: auto; right: 3%; top: auto; bottom: 7%; }
html.role-client .energy-engineer { display: none; }
.utility-stack { display: grid; gap: 12px; margin-top: -28px; }
.utility-card { background: #fff; color: #1c2128; border-radius: 22px; box-shadow: 0 16px 40px rgba(19, 41, 75, 0.08); padding: 16px 16px 14px; }
.utility-card h2 { margin: 0 0 12px; font-size: 1.45rem; font-weight: 560; letter-spacing: -0.03em; }
.utility-periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.utility-periods span { display: block; color: var(--muted); font-size: 0.75rem; }
.utility-periods b { display: block; margin-top: 2px; font-size: 1.2rem; font-weight: 560; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.utility-periods small { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.utility-trend-label { margin: 0 0 8px; color: var(--muted); font-size: 0.75rem; }
.utility-trend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 72px; }
.utility-trend i { display: block; width: 100%; background: #13294b; border-radius: 6px 6px 3px 3px; min-height: 6px; }
.utility-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 6px 0 0; color: var(--muted); font-size: 0.68rem; text-align: center; }
@media (max-width: 700px) {
  #energyRoot .hero { padding-bottom: 36px; }
  .utility-periods b { font-size: 1.05rem; }
  .utility-card { padding: 12px 14px 10px; }
  .utility-card h2 { margin-bottom: 8px; font-size: 1.25rem; }
  .utility-periods { margin-bottom: 8px; }
  .utility-trend { height: 36px; }
  .utility-trend-label { margin-bottom: 6px; }
  .utility-stack { margin-top: -18px; gap: 8px; }
}
.sp-on-drawing span, .sp-on-drawing small { display: block; font-size: 11px; color: #b7c0cc; }
.sp-on-drawing b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sp-on-drawing button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; border: 0; border-radius: 10px; background: #13294B; color: #fff; font-size: 22px; font-weight: 700; cursor: pointer; }
.sp-on-drawing button:disabled { background: #3a4556; color: #8a93a3; }
.plant-drawing .plant-svg { width: 100%; height: auto; }
.plant-drawing .ahu-shell { fill: #1b2636; stroke: #d5deea; }
.plant-drawing .name-ink, .plant-drawing .px-head { fill: #f4f6fa; }
.plant-drawing .px-sub, .plant-drawing .px-pipe-label { fill: #b7c0cc; }
.plant-drawing .px-part { fill: #243246; stroke: #8aa0b8; }
.plant-drawing .px-tag rect { fill: #121820; stroke: #3a4b66; }
.plant-drawing .px-tag .k { fill: #a9b4c4; }
.plant-drawing .px-tag .v { fill: #f4f6fa; }
.plant-drawing .px-tag.run .v { fill: #8ddeaf; }
.plant-drawing .px-tag.off .v { fill: #8a93a3; }
.plant-drawing .px-tag.alarm .v { fill: #ff8a80; }
.plant-drawing .px-sensor circle { fill: #1b2636; stroke: #d5deea; }
.plant-drawing .px-sensor text { fill: #f4f6fa; }
.plant-drawing .px-valve { fill: #1b2636; stroke: #d5deea; }
.plant-drawing .px-act { fill: #d5deea; }
.plant-drawing .px-line { stroke: #d5deea; }
.px-tag.alarm .v, .alarm-flash:not([hidden]) { animation: pid-flash 0.9s steps(2) infinite; }
.px-tag.not-linked .v, .px-tag .link-badge { fill: #E8A33D; }
.px-tag .link-badge { font-size: 10px; }
.px-pump.run circle, .px-pump.run .pump-rotor { stroke: #1d7a46; }
.px-pump.off { opacity: 0.55; }
.px-pump.fault circle, .px-pump.fault .pump-rotor, .px-pump .fault-badge { stroke: #b42318; fill: #b42318; }
.px-pump .fault-badge { font-size: 12px; font-weight: 700; }
.px-pump.run .pump-rotor { animation: spin 1.15s linear infinite; }
.px-valve-g.open .valve-fill { fill: #d4652f; }
.px-valve-g.closed .valve-fill { fill: none; }
.pipe-flow.is-live { stroke-width: 5; }
.hoa-banner { margin: 0 0 8px; padding: 8px 12px; background: #c2410c; color: #fff; font-weight: 700; letter-spacing: 0.04em; border-radius: 10px; }
.safety-override { margin: 0 0 8px; padding: 8px 12px; background: #b42318; color: #fff; font-weight: 700; border-radius: 10px; }
.schedule-tag { margin: 0 0 8px; color: #d5deea; }
.schedule-tag.not-linked b, .alarm-flash { color: #E8A33D; }
a.alarm-flash[data-sim-alarm] { display: block; margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: #b42318; color: #fff; font-weight: 700; text-decoration: none; animation: none; }
.eng-gates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.eng-gates button, .eng-gates a, .eng-gates label { background: #13294B; color: #fff; border-radius: 8px; padding: 8px 10px; text-decoration: none; }
.eng-gates select, .eng-gates input { color: #13294B; }
@media (prefers-reduced-motion: reduce) {
  .px-pump.run .pump-rotor { animation: none; }
}
.px-tag.off .v { fill: #8a8175; }
.px-tag.run .v { fill: #1d7a46; }
@keyframes pid-flash { 50% { opacity: 0.25; } }
.sp-tags { display: grid; gap: 12px; margin: 12px 0; }
.sp-tag { background: #fff; color: #13294B; border: 1px solid var(--line, #e2ddd2); border-radius: 18px; padding: 16px; display: grid; gap: 8px; }
.sp-tag h2 { margin: 0; font-size: 1.05rem; }
.sp-tag .temp-set { grid-template-columns: 64px minmax(0, 1fr) 64px; }
.sp-tag .btn { justify-self: start; min-height: 44px; }
@media (max-width: 640px) {
  .system-grid { grid-template-columns: 1fr; }
  .sp-tag .temp-btn { height: 56px; }
}
@media (max-width: 800px) {
  html.role-client header.top .who .pill.example { font-size: 11px; }
}

/* Engineer workspace nav (8 Nov 2026): no sidebar on the projects list; inside a project a back link, the name, then one flat list */
.eng-app.no-side { grid-template-columns: minmax(0, 1fr); }
.eng-app.no-side .eng-nav { display: none; }
.eng-nav .eng-back { font-weight: 600; font-size: 13px; color: #5b616c; padding: 4px 2px; border-radius: 6px; }
.eng-nav .eng-back:hover { color: var(--navy); text-decoration: underline; background: none; }
.eng-proj { margin: 6px 2px 8px; font-size: 15px; font-weight: 800; color: var(--navy); line-height: 1.25; }
.eng-sections { display: flex; flex-direction: column; gap: 2px; }
.eng-sections a { text-decoration: none; color: var(--navy); font-weight: 650; padding: 8px 10px; border-radius: 8px; border-left: 3px solid transparent; }
.eng-sections a:hover { background: #eef2f7; }
.eng-sections a[aria-current="page"] { background: var(--navy); color: #fff; border-left-color: #E8A33D; }
@media (max-width: 800px) {
  .eng-nav { flex-direction: column; gap: 2px; overflow: visible; padding: 10px 12px 0; }
  .eng-proj { margin: 2px 2px 6px; }
  .eng-sections { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .eng-sections::-webkit-scrollbar { display: none; }
  .eng-sections a { white-space: nowrap; flex: none; border-left: 0; border-bottom: 3px solid transparent; background: #eef2f7; border-radius: 999px; padding: 8px 14px; }
  .eng-sections a[aria-current="page"] { border-bottom-color: transparent; }
}

/* Logic editor: outputs lists, start/stop steps, trip sense (8 Nov 2026) */
.palette .pal-empty, .bind-menu .pal-empty { margin: 4px 2px; font-size: 12.5px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.palette .pal-new { display: grid; gap: 4px; margin-top: 4px; }
.palette .chip.new, .bind-menu button.new { border: 1px dashed #9aabbf; background: #f7f9fc; color: var(--navy); font-weight: 650; }
.seq-ed, .trip-ed { margin: 10px 0; display: grid; gap: 8px; }
.seq-ed h3, .trip-ed h3 { margin: 6px 0 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.seq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.seq-step { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; display: grid; gap: 6px; }
.seq-top { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center; }
.seq-top b { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; display: grid; place-items: center; }
.seq-top select { min-width: 0; }
.seq-move { display: inline-flex; gap: 2px; }
.seq-move button { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.seq-move button:disabled { opacity: .35; cursor: default; }
.seq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seq-grid label { font-size: 12px; display: grid; gap: 2px; }
.seq-grid label.wide { grid-column: 1 / -1; }
.sense { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.sense input { width: 80px; }
.toggle { border: 1px solid #13294B; background: #fff; color: #13294B; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 12.5px; cursor: pointer; min-height: 30px; }
.toggle.nc, .toggle:hover { background: #13294B; color: #fff; }
.seq-test { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
.seq-grid .sense { grid-column: 1 / -1; justify-content: flex-start; }
.seq-grid .sense span { min-width: 92px; font-size: 12px; }
.seq-grid select, .seq-grid input { width: 100%; min-width: 0; }
