/* INNOVA AI Command Center — Operations Center UI
   Design language: an engineering drawing sheet (ink on drafting film) for the chrome, and
   IEC 60073 indicator-lamp colours for state. Colour means state; nothing else is coloured.
   Line weight encodes hierarchy: 2px ink = region boundary, 1px rule = separation,
   dashed = not executed / not yet happened. */

@font-face { font-family: "INNOVA Condensed"; src: url("../fonts/heroscn-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "INNOVA Condensed"; src: url("../fonts/heroscn-700.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-600.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
  --paper: #eef1ee;        /* drafting film */
  --sheet: #f8faf8;        /* working surface */
  --ink: #18232e;          /* technical pen */
  --ink-2: #4a5866;
  --ink-3: #6d7a85;
  --rule: #c3cbc6;
  --rule-soft: #dbe1dc;
  --hover: #e4e9e5;
  --green: #1f8a4c;  --green-text: #17643a;  --green-tint: #ddefe3;
  --amber: #d99a06;  --amber-text: #7a5200;  --amber-tint: #f7ebc8;
  --red: #cc3428;    --red-text: #a3241b;    --red-tint: #f6deda;
  --blue: #2457c5;   --blue-text: #1c47a6;   --blue-tint: #dfe7f8;
  --white-lamp: #ffffff; --white-text: #59656f; --white-tint: #e6eae7;
  --focus: #2457c5;
  --cond: "INNOVA Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "DejaVu Sans Mono", "Cascadia Mono", Consolas, monospace;
  --s-1: 12px; --s0: 14px; --s1: 15px; --s2: 19px; --s3: 24px; --s4: 30px; --s5: 46px;
  --rail: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10161c; --sheet: #161e26; --ink: #d9e1e6; --ink-2: #a3b0ba; --ink-3: #7f8d98;
    --rule: #2f3b46; --rule-soft: #232e38; --hover: #1d2731;
    --green: #3cc173; --green-text: #6fd99a; --green-tint: #15301f;
    --amber: #f2b32c; --amber-text: #f5c75e; --amber-tint: #3a2e10;
    --red: #f0564a; --red-text: #ff8a80; --red-tint: #3d1a17;
    --blue: #5b8cf0; --blue-text: #8fb0ff; --blue-tint: #18264a;
    --white-lamp: #e8eef2; --white-text: #a3b0ba; --white-tint: #1f2933; --focus: #8fb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10161c; --sheet: #161e26; --ink: #d9e1e6; --ink-2: #a3b0ba; --ink-3: #7f8d98;
  --rule: #2f3b46; --rule-soft: #232e38; --hover: #1d2731;
  --green: #3cc173; --green-text: #6fd99a; --green-tint: #15301f;
  --amber: #f2b32c; --amber-text: #f5c75e; --amber-tint: #3a2e10;
  --red: #f0564a; --red-text: #ff8a80; --red-tint: #3d1a17;
  --blue: #5b8cf0; --blue-text: #8fb0ff; --blue-tint: #18264a;
  --white-lamp: #e8eef2; --white-text: #a3b0ba; --white-tint: #1f2933; --focus: #8fb0ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 400 var(--s1)/1.5 var(--sans); font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--cond); font-weight: 700; letter-spacing: 0.01em; margin: 0; line-height: 1.15; }
h1 { font-size: var(--s4); }
h2 { font-size: var(--s2); }
h3 { font-size: var(--s1); }
p { margin: 0 0 0.75em; max-width: 72ch; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--sheet) calc(var(--rail) - 2px), var(--ink) calc(var(--rail) - 2px), var(--ink) var(--rail), transparent var(--rail)); }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sheet);
  border-right: 2px solid var(--ink); display: flex; flex-direction: column; padding: 18px 0 12px; }
.wordmark { padding: 0 20px 18px; border-bottom: 1px solid var(--rule); display: block; text-decoration: none; }
.wordmark b { display: block; font: 700 26px/1 var(--cond); letter-spacing: 0.04em; }
.wordmark span { display: block; font: 400 var(--s0)/1.3 var(--cond); color: var(--ink-2); margin-top: 4px; }
.nav { padding: 10px 10px 0; flex: 1; }
.nav-group { margin: 12px 0 4px; padding: 0 10px; font: 400 var(--s-1)/1.2 var(--cond); color: var(--ink-3); letter-spacing: 0.03em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 3px; text-decoration: none;
  color: var(--ink-2); font-weight: 500; font-size: var(--s0); border-left: 3px solid transparent; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--hover); border-left-color: var(--ink); }
.nav a .count { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--s-1); color: var(--blue-text); }
.rail-foot { padding: 12px 20px 0; border-top: 1px solid var(--rule); font-size: var(--s-1); color: var(--ink-3); }
.rail-foot button { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 28px; border-bottom: 1px solid var(--rule);
  background: var(--paper); position: sticky; top: 0; z-index: 5; min-height: 52px; }
.topbar .menu-btn { display: none; }
.topbar .spacer { flex: 1; }
.env-tag { display: inline-flex; align-items: center; gap: 8px; font-size: var(--s-1); color: var(--ink-2); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: var(--s0); }
.user-chip .role { color: var(--ink-3); font-size: var(--s-1); }
.page { padding: 26px 28px 60px; max-width: 1440px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 22px; }
.page-head .lede { color: var(--ink-2); margin: 6px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: var(--s0); color: var(--ink-3); margin-bottom: 6px; }
.crumb a { color: var(--ink-2); }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--ink); border-radius: 3px; background: var(--ink); color: var(--paper); font-weight: 500;
  font-size: var(--s0); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--hover); filter: none; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-2); padding-inline: 8px; }
.btn.quiet:hover { background: var(--hover); color: var(--ink); filter: none; }
.btn.approve { background: var(--green-text); border-color: var(--green-text); color: #fff; }
.btn.reject { background: transparent; color: var(--red-text); border-color: var(--red-text); }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: var(--s-1); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; filter: none; }
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field > span { font-weight: 500; font-size: var(--s0); }
.field small { color: var(--ink-3); font-size: var(--s-1); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink-2); border-radius: 3px 3px 0 0;
  background: var(--sheet); min-height: 38px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--focus); outline: none; box-shadow: 0 2px 0 var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: var(--s0); }
.check input { margin-top: 4px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline .field { margin: 0; min-width: 160px; flex: 1; }
.error-text { color: var(--red-text); font-size: var(--s0); margin: 4px 0 10px; }

/* ---------------------------------------------------------------- IEC 60073 lamps and state words */
.lamp { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; background: var(--white-lamp);
  box-shadow: inset 0 0 0 1.5px var(--ink-3); vertical-align: -1px; }
.lamp[data-c="green"] { background: var(--green); box-shadow: 0 0 0 2px var(--green-tint); }
.lamp[data-c="amber"] { background: var(--amber); box-shadow: 0 0 0 2px var(--amber-tint); }
.lamp[data-c="red"] { background: var(--red); box-shadow: 0 0 0 2px var(--red-tint); }
.lamp[data-c="blue"] { background: var(--blue); box-shadow: 0 0 0 2px var(--blue-tint); }
.lamp[data-c="live"] { background: var(--green); box-shadow: 0 0 0 2px var(--green-tint); animation: lamp-live 1.6s ease-in-out infinite; }
@keyframes lamp-live { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .lamp[data-c="live"] { animation: none; } }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: var(--s0); white-space: nowrap; }
.state[data-c="green"] { color: var(--green-text); }
.state[data-c="live"] { color: var(--green-text); }
.state[data-c="amber"] { color: var(--amber-text); }
.state[data-c="red"] { color: var(--red-text); }
.state[data-c="blue"] { color: var(--blue-text); font-weight: 500; }
.state[data-c="white"] { color: var(--white-text); }
.sim { display: inline-block; font-size: var(--s-1); padding: 0 6px; border: 1px dashed var(--ink-3); border-radius: 2px;
  color: var(--ink-2); white-space: nowrap; }

/* ---------------------------------------------------------------- regions */
.panel { border: 1px solid var(--rule); background: var(--sheet); border-radius: 3px; margin-bottom: 22px; min-width: 0; }
.panel > header { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px 10px; border-bottom: 1px solid var(--rule); }
.panel > header .meta { color: var(--ink-3); font-size: var(--s-1); }
.panel > header .tools { margin-left: auto; display: flex; gap: 8px; }
.panel > .body { padding: 14px 16px; }
.panel.framed { border: 2px solid var(--ink); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0 22px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: var(--s0); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.empty { padding: 26px 16px; color: var(--ink-2); border: 1px dashed var(--rule); border-radius: 3px; text-align: left; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; font-weight: 600; }
.notice { padding: 10px 14px; border-left: 3px solid var(--amber); background: var(--amber-tint); color: var(--ink); margin-bottom: 16px; font-size: var(--s0); }
.notice.info { border-color: var(--blue); background: var(--blue-tint); }
.notice.bad { border-color: var(--red); background: var(--red-tint); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: var(--s0); }
table.data th { text-align: left; font: 400 var(--s0)/1.2 var(--cond); color: var(--ink-3); padding: 8px 12px;
  border-bottom: 2px solid var(--ink); white-space: nowrap; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--hover); }
table.data td.num, table.data th.num { text-align: right; }
table.data td .sub { display: block; color: var(--ink-3); font-size: var(--s-1); margin-top: 2px; }
.truncate { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id { font-family: var(--mono); font-size: var(--s-1); color: var(--ink-2); cursor: copy; background: none; border: 0; padding: 0; }

/* ---------------------------------------------------------------- single-line diagram (the pipeline) */
.mimic { position: relative; padding: 18px 22px 20px; background-image:
  linear-gradient(var(--rule-soft) 1px, transparent 1px), linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px; }
.mimic-intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 12px; }
.mimic-intro p { margin: 0; color: var(--ink-2); font-size: var(--s0); }
.bus { position: relative; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0; }
.bus::before { content: ""; position: absolute; left: 4%; right: 4%; top: 64px; height: 4px; background: var(--ink); border-radius: 2px; }
.bus-node { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 4px;
  text-decoration: none; color: inherit; }
.bus-node .n { font: 700 var(--s5)/1 var(--cond); height: 48px; display: flex; align-items: flex-end; }
.bus-node .n.zero { color: var(--ink-3); font-weight: 400; }
.bus-node .drop { width: 2px; height: 14px; background: var(--ink); margin-top: 2px; }
.bus-node .breaker { width: 18px; height: 18px; border: 2px solid var(--ink); background: var(--sheet); margin-top: 4px;
  display: grid; place-items: center; position: relative; z-index: 1; }
.bus-node .breaker .lamp { width: 9px; height: 9px; box-shadow: none; }
.bus-node .label { font: 400 var(--s0)/1.2 var(--cond); margin-top: 8px; color: var(--ink-2); }
.bus-node[data-active="1"] .label { color: var(--ink); font-weight: 700; }
.bus-node .items { margin-top: 6px; font-size: var(--s-1); color: var(--ink-3); max-width: 16ch; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bus-node:hover .label { text-decoration: underline; }
.trips { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--rule);
  font-size: var(--s0); color: var(--ink-2); }

/* ---------------------------------------------------------------- annunciator */
.annunciator { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.ann { padding: 12px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-height: 74px; }
.ann .t { display: flex; align-items: center; gap: 8px; font: 700 var(--s1)/1.2 var(--cond); }
.ann .d { font-size: var(--s-1); color: var(--ink-2); margin-top: 5px; }
.ann[data-c="red"] { background: var(--red-tint); }
.ann[data-c="amber"] { background: var(--amber-tint); }
.ann[data-c="blue"] { background: var(--blue-tint); }

/* ---------------------------------------------------------------- title block (provenance) */
.titleblock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--ink); background: var(--sheet);
  margin-bottom: 22px; }
.titleblock > div { padding: 8px 12px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); min-width: 0; }
.titleblock > div:nth-child(4n) { border-right: 0; }
.titleblock .k { font: 400 var(--s-1)/1.2 var(--cond); color: var(--ink-3); }
.titleblock .v { font-size: var(--s0); margin-top: 3px; overflow-wrap: anywhere; }
.titleblock .wide { grid-column: span 4; border-right: 0; }
.titleblock .wide .v { font: 700 var(--s2)/1.25 var(--cond); }

/* ---------------------------------------------------------------- phases / steps (true sequences) */
.phases { list-style: none; margin: 0; padding: 0; counter-reset: ph; }
.phases li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.phases li::before { counter-increment: ph; content: counter(ph); font: 700 var(--s3)/1 var(--cond); color: var(--ink-3); }
.phases li .what { min-width: 0; }
.phases li .what b { font-weight: 600; }
.phases li .checks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.stage-strip { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 18px; padding: 0; list-style: none; }
.stage-strip li { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 0; font: 400 var(--s0)/1 var(--cond); color: var(--ink-3); }
.stage-strip li::after { content: ""; width: 22px; height: 2px; background: var(--rule); margin-left: 6px; }
.stage-strip li:last-child::after { display: none; }
.stage-strip li[data-done="1"] { color: var(--ink-2); }
.stage-strip li[data-done="1"]::after { background: var(--ink); }
.stage-strip li[data-current="1"] { color: var(--ink); font-weight: 700; }

/* ---------------------------------------------------------------- content */
.md { font-size: var(--s1); line-height: 1.6; max-width: 80ch; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { margin: 1.1em 0 0.4em; }
.md h1 { font-size: var(--s3); }
.md ul, .md ol { padding-left: 1.4em; }
.md pre { background: var(--paper); border: 1px solid var(--rule); padding: 10px 12px; overflow-x: auto; font-size: var(--s-1); }
.md blockquote { margin: 0.8em 0; padding: 4px 12px; border-left: 3px solid var(--rule); color: var(--ink-2); }
.md table { border-collapse: collapse; font-size: var(--s-1); display: block; overflow-x: auto; }
.md td, .md th { border: 1px solid var(--rule); padding: 4px 8px; text-align: left; }
.log { margin: 0; padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule); font: var(--s-1)/1.45 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
details { border-bottom: 1px solid var(--rule-soft); }
details > summary { cursor: pointer; padding: 9px 0; list-style-position: outside; }
details[open] > summary { font-weight: 500; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 14px; font: 400 var(--s1)/1.2 var(--cond); color: var(--ink-2); cursor: pointer;
  border-radius: 3px 3px 0 0; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.bar { height: 8px; background: var(--rule-soft); border-radius: 1px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--ink-2); }
.bar[data-c="amber"] > span { background: var(--amber); }
.bar[data-c="red"] > span { background: var(--red); }

/* ---------------------------------------------------------------- overlays */
.scrim { position: fixed; inset: 0; background: rgba(16, 22, 28, 0.42); z-index: 40; display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--sheet); border: 2px solid var(--ink); border-radius: 3px; width: min(640px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; }
.dialog > header { padding: 14px 18px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 12px; }
.dialog > header .x { margin-left: auto; }
.dialog > .content { padding: 16px 18px; overflow-y: auto; }
.dialog > footer { padding: 12px 18px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.drawer-scrim { place-items: stretch end; padding: 0; }
.drawer { background: var(--sheet); border-left: 2px solid var(--ink); width: min(820px, 100%); height: 100vh; display: flex; flex-direction: column; }
.drawer > header { padding: 14px 18px; border-bottom: 1px solid var(--rule); display: flex; gap: 12px; align-items: flex-start; }
.drawer > header .x { margin-left: auto; }
.drawer > .content { padding: 16px 18px 40px; overflow-y: auto; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 3px; font-size: var(--s0); border-left: 4px solid var(--green); }
.toast[data-c="red"] { border-left-color: var(--red); }

/* ---------------------------------------------------------------- sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-sheet { width: min(460px, 100%); border: 2px solid var(--ink); background: var(--sheet); }
.auth-sheet .head { padding: 22px 24px 16px; border-bottom: 1px solid var(--ink); }
.auth-sheet .head b { font: 700 34px/1 var(--cond); letter-spacing: 0.04em; display: block; }
.auth-sheet .head span { color: var(--ink-2); font-family: var(--cond); }
.auth-sheet form { padding: 20px 24px 8px; }
.auth-sheet .foot { padding: 10px 24px 14px; border-top: 1px solid var(--rule); font-size: var(--s-1); color: var(--ink-3); }
.auth-sheet .sso { padding: 0 24px 18px; display: grid; gap: 8px; }
.auth-sheet .sso .btn { width: 100%; justify-content: center; text-align: center; text-decoration: none; }
.auth-sheet .sso .or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  color: var(--ink-3); font-family: var(--cond); }
.auth-sheet .sso .or::before, .auth-sheet .sso .or::after { content: ""; border-top: 1px solid var(--rule); }
.picklist { display: grid; gap: 6px; margin: 10px 0; max-height: 50vh; overflow: auto; }
.picklist label { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 8px 10px;
  border: 1px solid var(--rule); background: var(--sheet); }
.picklist label[data-off] { opacity: 0.55; }
.match { font: 600 var(--s-1)/1 var(--cond); padding: 2px 6px; border: 1px solid var(--ink-3); margin-left: 6px; }
.secret-key { font: 600 var(--s2)/1.4 var(--mono); letter-spacing: 0.06em; padding: 10px 12px; background: var(--paper); border: 1px dashed var(--ink-3); word-break: break-all; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .titleblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titleblock > div:nth-child(4n) { border-right: 1px solid var(--ink); }
  .titleblock > div:nth-child(2n) { border-right: 0; }
  .titleblock .wide { grid-column: span 2; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .annunciator { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail { position: fixed; left: 0; top: 0; width: min(280px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform 0.2s ease; }
  .rail[data-open="1"] { transform: none; box-shadow: 0 0 0 100vmax rgba(16, 22, 28, 0.35); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .bus { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bus::before { left: 77px; right: auto; top: 12px; bottom: 12px; width: 4px; height: auto; }
  .bus-node { flex-direction: row; text-align: left; gap: 10px; padding: 4px 0; align-items: center; }
  .bus-node .n { font-size: var(--s3); width: 46px; height: auto; justify-content: flex-end; }
  .bus-node .drop { width: 12px; height: 2px; margin: 0; }
  .bus-node .breaker { margin: 0; }
  .bus-node .label { margin: 0; }
  .bus-node .items { margin: 0 0 0 auto; text-align: right; }
  .phases li { grid-template-columns: 28px minmax(0, 1fr); }
  .phases li > :last-child { grid-column: 2; }
  .user-chip .role, .env-tag span { display: none; }
}
@media (max-width: 520px) {
  h1 { font-size: var(--s3); }
  .titleblock { grid-template-columns: minmax(0, 1fr); }
  .titleblock > div { border-right: 0 !important; }
  .titleblock .wide { grid-column: span 1; }
}
