/* Layout and components, after the approved mockup (mockups/power-view): details on the left, one
   rack large in the middle, PDU cards on the right, the room's racks along the bottom. Tokens are
   in tokens.css; the rack drawing's rules are at the end. No colour in a "color:" declaration is
   --stroke or --line: those are artwork, never text (check/contrast.js looks). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--canvas); color: var(--ink);
  font: 400 14px/1.4 var(--font); font-variant-numeric: tabular-nums;
  height: 100vh; overflow: hidden; display: grid; grid-template-rows: var(--top-h) minmax(0, 1fr);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--card-sel); color: var(--ink); padding: 6px 12px; border-radius: 18px; border: 1px solid var(--ink); }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--ink-2); }
.note { color: var(--ink-2); font-size: 12px; }
.mono { font-family: var(--font-mono); }

/* ---------- type ---------- */
.lab { font-size: 12px; color: var(--ink-2); margin: 0; }
.val { font-size: 14px; color: var(--ink); }
.sub { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
.big-id { font-weight: 300; font-size: 34px; line-height: 1.08; letter-spacing: -0.01em; margin: 2px 0 0; overflow-wrap: anywhere; }
.big-id.md { font-size: 26px; display: block; }
.card-title { font-size: 14px; font-weight: 500; margin: 0 0 10px; }

/* ---------- controls ---------- */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 14px; height: 14px; }
.cbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--stroke); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0; flex: none;
}
.cbtn:hover { background: var(--card-sel); }
.cbtn.is-on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.cbtn:disabled { opacity: .35; cursor: default; background: transparent; }
.cbtn.sm { width: 36px; height: 36px; }
.vbtn.is-on { width: auto; border-radius: 20px; padding: 0 16px 0 12px; }
.vlabel { font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill {
  height: 36px; border-radius: 18px; border: 1px solid var(--stroke); background: transparent; color: var(--ink); padding: 0 14px;
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.pill:hover { background: var(--card-sel); }
.pill.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.pill.dark { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pill.ro { cursor: default; }
.pill.ro:hover { background: transparent; }
.pill .lab { font-weight: 400; }
.pill .val { font-size: 13px; font-weight: 500; }
.pill-over { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 11px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--fc, var(--ink-2)); }
.dot.is-prob { background: var(--accent); box-shadow: 0 0 0 1px var(--ink); }
.dot.is-note { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--stroke); border-radius: 20px; padding: 3px; gap: 2px; flex: none; }
.seg button, .seg-b {
  height: 30px; min-width: 0; border: 0; border-radius: 15px; background: transparent; padding: 0 12px; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.seg button:hover { background: var(--card-sel); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.seg button[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px var(--on-ink); }
.fdot { width: 11px; height: 11px; flex: none; display: inline-block; vertical-align: -1px; overflow: visible; margin-right: 1px; }
.seg button[aria-pressed="true"] .fdot .pip { stroke: var(--on-ink); stroke-width: 1.4; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 13px;
  background: transparent; border: 1px solid var(--stroke); border-radius: 16px; white-space: nowrap; font-size: 13px; font-weight: 500;
}
.btn:hover { background: var(--card-sel); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.quiet { border-color: transparent; }
.btn.icon { width: 32px; padding: 0; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.linkish { background: none; border: 0; padding: 0; text-align: left; color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--stroke); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: var(--ink); }
.in { height: 32px; min-width: 0; width: 100%; padding: 0 10px; background: var(--card-sel); color: var(--ink); border: 1px solid var(--ink-2); border-radius: 10px; }
.in.num { text-align: right; }
select.in { padding-right: 4px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper output { min-width: 26px; text-align: center; font-weight: 500; }
/* on and off, as a rocker: the half that is pressed is filled */
.rocker { flex: none; display: inline-flex; height: 26px; padding: 0; background: var(--card-sel); border: 1px solid var(--ink-2); border-radius: 13px; overflow: hidden; font-size: 12px; }
.rocker span { display: grid; place-content: center; width: 32px; color: var(--ink-2); }
.rocker[aria-checked="true"] span:first-child, .rocker[aria-checked="false"] span:last-child { background: var(--ink); color: var(--on-ink); font-weight: 500; }
.rocker[disabled] { opacity: .45; cursor: default; }
.mark { width: 14px; height: 14px; flex: none; }

/* ---------- top bar ---------- */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-mark .ic { width: 17px; height: 17px; }
.brand-name { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; }
.views { display: flex; gap: 8px; align-items: center; }
.vsep { width: 1px; height: 24px; background: var(--stroke); margin: 0 4px; flex: none; }
.dbtn { height: 40px; border-radius: 20px; padding: 0 15px; }
.doc-actions { justify-content: space-between; }
.da-main { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; flex: 1 1 320px; min-width: 0; }
.da-main .note { margin: 0; max-width: 70ch; }
.da-print { margin-left: auto; flex: none; }
@media (max-width: 1365px) { .brand-name { display: none; } .roompill { max-width: 210px; } .dbtn { padding: 0 12px; } }
/* a tablet held sideways: the brand takes only its mark, so the room's name keeps its room in the pill */
@media (min-width: 821px) and (max-width: 1365px) { .top { grid-template-columns: auto auto minmax(0, 1fr); } .roompill { min-width: 150px; } }
.tools { justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; }
.roompill { height: 44px; max-width: 280px; border-radius: 22px; border: 1px solid var(--stroke); background: transparent; color: var(--ink); padding: 0 12px 0 5px; display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.roompill:hover { background: var(--card-sel); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--card-sel); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rp-t { display: grid; text-align: left; min-width: 0; line-height: 1.2; }
.rp-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-mode { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: fixed; inset: auto; top: 52px; right: 60px; margin: 0; width: 320px; max-height: calc(100vh - 64px); overflow-y: auto; background: var(--card-sel); color: var(--ink); border: 1px solid var(--card-edge); border-radius: 18px; padding: 6px; box-shadow: 0 8px 30px rgba(0, 0, 0, .10); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 12px; }
.menu button:hover { background: var(--card); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-room { display: grid; gap: 2px; padding: 6px 6px 8px; }
.room-name { height: 36px; padding: 0 8px; background: transparent; border: 1px solid transparent; border-radius: 10px; font-size: 16px; font-weight: 500; }
.room-name::placeholder { color: var(--ink-2); font-weight: 400; }
.room-name:hover, .room-name:focus { border-color: var(--ink-2); background: var(--card); }
.save-note { color: var(--ink-2); font-size: 12px; padding: 0 8px; }
.menu-note { padding: 8px 12px; color: var(--ink-2); font-size: 12px; border-top: 1px solid var(--line); margin-top: 6px; }

/* ---------- the regions ---------- */
.work { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--side); grid-template-rows: minmax(0, 1fr) auto; gap: 12px; padding: 0 12px 12px; min-height: 0; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
.col-left { grid-column: 1; grid-row: 1; }
.centre { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.col-right { grid-column: 3; grid-row: 1; }
.strip { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 10px; min-width: 0; height: var(--strip); overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
.card { background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--r-card); padding: 18px 20px 20px; flex: none; }
.card.is-sel { background: var(--card-sel); }

/* ---------- left: verdict, details, findings ---------- */
.verdict-line { font-size: 18px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; display: flex; gap: 8px; align-items: baseline; }
.verdict.g-down .verdict-line::before, .verdict.has-down .verdict-line::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--ink); flex: none; transform: translateY(-2px); }
.dark-line { display: grid; margin-top: 8px; }
.dl-n { font-weight: 300; font-size: 40px; line-height: 1.05; letter-spacing: -.01em; }
.verdict-sub { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.verdict-sub li + li { margin-top: 3px; }
.verdict-now, .verdict-todo { margin-top: 8px; font-weight: 500; font-size: 13px; }
.verdict .btn { margin-top: 12px; }
.why { margin-top: 8px; font-size: 13px; }
.why summary { cursor: pointer; color: var(--ink-2); }
.steps { margin: 6px 0 0; padding-left: 20px; list-style: decimal; display: grid; gap: 4px; color: var(--ink-2); }
.c-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 12px 0 2px; margin-top: 12px; border-top: 1px solid var(--line); }
.cell { display: grid; gap: 1px; min-width: 0; align-content: start; }
.cell .val { overflow-wrap: anywhere; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.kv-wide { grid-column: 1 / -1; }
.feed-link { display: inline-flex; align-items: center; gap: 6px; }
.meters { padding-top: 14px; margin-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.mrow { display: grid; gap: 4px; width: calc(100% + 16px); margin: 0 -8px; padding: 6px 8px; text-align: left; background: none; border: 0; border-radius: 12px; }
.mrow:hover, .mrow.is-sel { background: var(--card-sel); }
.mrow-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mrow-top .val { font-size: 13px; text-align: right; }
.mrow .pill-over { justify-self: start; }
.pill-over.is-hot { background: var(--accent); color: #111111; }
.dm { display: block; overflow: visible; max-width: 100%; height: auto; }
.d-cap { fill: var(--stroke); opacity: .55; }
.d-load { fill: var(--ink); }
.d-over { fill: var(--accent); stroke: var(--ink); stroke-width: 1; }
.d-tick { stroke: var(--ink-2); stroke-width: 1; }
.findings { display: grid; }
.finding { border-top: 1px solid var(--line); }
.finding:last-child { border-bottom: 1px solid var(--line); }
.finding-head { display: grid; grid-template-columns: 52px 1fr; gap: 8px; width: 100%; padding: 9px 0; background: none; border: 0; text-align: left; align-items: baseline; font-size: 13.5px; line-height: 1.35; }
.finding-head:hover .finding-title { text-decoration: underline; text-underline-offset: 3px; }
.finding-head .sev { font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.finding.sev-outage .sev, .finding.sev-risk .sev { color: var(--ink); }
.finding[data-open="1"] .finding-title { font-weight: 500; }
.finding-body { padding: 0 0 12px 20px; color: var(--ink-2); font-size: 13px; }
.finding-body dt { color: var(--ink); font-weight: 500; font-size: 12px; margin-top: 8px; }
.finding-body dt:first-child { margin-top: 0; }
.side-h { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 500; margin: 0 0 8px; }
.side-h .count { color: var(--ink-2); font-weight: 400; }
.todo { margin-bottom: 18px; }
.todo ul { display: grid; gap: 8px; }
.todo li, .plugged li { display: grid; }
.todo .muted, .plugged .muted { font-size: 12px; }
/* the details of what is selected */
.back { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 8px -6px; padding: 4px 8px; background: none; border: 0; color: var(--ink-2); border-radius: 12px; font-size: 13px; }
.back:hover { color: var(--ink); background: var(--card-sel); }
.back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.insp-over { color: var(--ink-2); font-size: 12px; }
.title-in { width: calc(100% + 8px); margin: 0 0 2px -8px; padding: 2px 7px; height: 42px; background: transparent; border: 1px solid transparent; border-radius: 12px; font-size: 24px; font-weight: 300; letter-spacing: -.01em; }
.title-in:hover, .title-in:focus { border-color: var(--ink-2); background: var(--card-sel); }
.title-static { font-size: 30px; font-weight: 300; line-height: 1.15; }
.insp-sub { color: var(--ink-2); font-size: 13px; }
.alert { margin-top: 12px; padding: 9px 12px; background: var(--card-sel); border: 1px solid var(--line); border-radius: 14px; }
.alert b { display: flex; gap: 8px; align-items: baseline; font-weight: 500; }
.alert:not(.is-warn) b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--ink); flex: none; }
.alert p { color: var(--ink-2); margin-top: 2px; font-size: 13px; }
.sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sec > h3 { font-size: 13px; font-weight: 500; }
.fld { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; }
.fld > label, .fld > .lab { color: var(--ink-2); font-size: 12px; }
.fld.stack, .fld:has(> .seg) { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.fld .seg { justify-self: start; }
.with-unit { display: flex; gap: 6px; align-items: center; min-width: 0; }
.with-unit .in { flex: 1; min-width: 0; }
.unit { color: var(--ink-2); white-space: nowrap; font-size: 12px; }
.err { grid-column: 1 / -1; color: var(--ink); font-weight: 500; font-size: 12px; display: flex; gap: 6px; align-items: baseline; }
.err::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--ink); flex: none; }
.in[aria-invalid="true"] { border-color: var(--ink); border-width: 2px; }
.cord-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.plugs { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.plug { display: inline-flex; max-width: 100%; border: 1px solid var(--stroke); border-radius: 16px; overflow: hidden; }
.plug button { height: 30px; padding: 0 10px; background: none; border: 0; white-space: nowrap; font-size: 12.5px; }
.plug button:hover { background: var(--card-sel); }
.plug-pdu { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 500; }
.plug-pdu span { overflow: hidden; text-overflow: ellipsis; }
.plug-bank { border-left: 1px solid var(--stroke) !important; color: var(--ink-2); }
.plug.is-in { border-color: var(--ink); }
.plug button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.plug button[aria-pressed="true"] .pip { stroke: var(--on-ink); stroke-width: 1; }
.seg button:focus-visible, .plug button:focus-visible { outline-offset: -3px; }
.seg button[aria-pressed="true"]:focus-visible, .plug button[aria-pressed="true"]:focus-visible { outline-color: var(--on-ink); }
.what-if { display: grid; gap: 4px; font-size: 13px; }
.what-if li { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.is-crit, .is-warn { font-weight: 500; }
.rowbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.bank-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto auto; gap: 6px; align-items: center; }
.bank-load { grid-column: 1 / -1; color: var(--ink-2); font-size: 12px; }
.bank-row .bank-load { margin-top: -2px; }
.bank-load.is-crit, .bank-load.is-warn { color: var(--ink); }
.plugged { display: grid; gap: 6px; }

/* ---------- the stage ---------- */
.stage { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; padding: 0; }
.stage:focus { outline: none; }
.stage-scroll { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.stage-scroll.is-grabbing { cursor: grabbing; }
#stage-svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.stage-label { position: absolute; top: 16px; left: 22px; margin: 0; z-index: 2; font-size: 12px; color: var(--ink-2); pointer-events: none; }
.stage-tr { position: absolute; top: 10px; right: 16px; z-index: 3; display: flex; align-items: center; gap: 8px; }
.lock-note { color: var(--ink-2); font-size: 12px; max-width: 16em; }
.edge { position: absolute; top: 50%; margin-top: -20px; z-index: 2; background: var(--card); }
.edge.prev { left: 14px; }
.edge.next { right: 14px; }
.rack .rv { overflow: visible; }
.scene-note { font-size: 12px; fill: var(--ink-2); }
.drag-chip { position: fixed; z-index: 60; pointer-events: none; padding: 5px 12px; border-radius: 14px; background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 500; transform: translate(12px, 14px); white-space: nowrap; }
.drag-chip.is-bad { background: var(--accent); color: var(--on-accent); border: 1px solid var(--ink); }
body.dragging, body.dragging * { cursor: grabbing !important; }

/* the equipment drawer, over the stage */
.drawer { position: absolute; top: 0; left: 0; bottom: 62px; width: min(320px, 100%); z-index: 5; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: 14px 0 0; background: var(--card-sel); box-shadow: 0 8px 30px rgba(0, 0, 0, .10); overflow: hidden; }
.dr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 8px 18px; }
.dr-tools { display: flex; gap: 6px; }
.pal-search { padding: 0 14px 10px; }
.pal-list { overflow-y: auto; padding: 0 0 8px; }
.pal-h { padding: 12px 18px 4px; color: var(--ink-2); font-size: 12px; font-weight: 400; }
.pal-item { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; align-items: center; width: 100%; padding: 7px 18px; background: none; border: 0; text-align: left; cursor: grab; touch-action: pan-y; user-select: none; }
.pal-item:hover { background: var(--card); }
.pal-item .size { width: 16px; height: 16px; fill: var(--ink-2); }
.pal-item b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.pal-item span span { display: block; color: var(--ink-2); font-size: 12px; }
.pal-empty { padding: 12px 18px; color: var(--ink-2); }
.tray { border-top: 1px solid var(--line); max-height: 30vh; overflow-y: auto; }
.tray:empty, .tray-hint { display: none; }
.tray .pal-item.is-sel { background: var(--card); box-shadow: inset 3px 0 0 var(--ink); }
body.dragging .tray-hint { display: block; padding: 12px 18px; color: var(--ink-2); }
.tray.is-target { background: var(--card); box-shadow: inset 0 0 0 2px var(--ink); }

/* under the stage: the scenario and the zoom, then a line of its own for the playback (D-U14):
   back, the step, forward, the caption (it wraps rather than being cut), Replay, Skip, Switch back on */
.under { flex: none; min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.u-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 auto; }
.cap { margin: 0; font-weight: 300; font-size: 16px; line-height: 1.25; color: var(--ink-2); min-width: 0; flex: 1 1 0; white-space: normal; overflow-wrap: anywhere; }
.cap.is-step { font-size: 17px; color: var(--ink); }
.cap.is-result { font-weight: 400; }
.cap.is-long { font-size: 14.5px; line-height: 1.35; }
.playback { flex: 1 1 100%; display: flex; align-items: center; gap: 12px; min-height: 44px; min-width: 0; }
.pb-acts .pill:disabled { opacity: .45; cursor: default; }
.pb-steps, .pb-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.pb-n { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pb-dots { display: flex; gap: 3px; }
.pb-dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--ink); background: transparent; }
.pb-dot.is-done { background: var(--ink-2); border-color: var(--ink-2); }
.pb-dot.is-cur { background: var(--ink); }
.zoomctl { display: flex; align-items: center; gap: 6px; flex: none; }
.zoom-range { width: 110px; accent-color: var(--ink); }
.zoomctl output { min-width: 46px; text-align: center; color: var(--ink-2); font-size: 12px; }

/* ---------- right: one card per PDU ---------- */
.pcard { position: relative; display: grid; gap: 2px; }
.pc-top { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.pc-name { background: none; border: 0; padding: 0; text-align: left; display: grid; gap: 2px; }
.pc-name:hover .big-id { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.pc-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pc-load { margin-top: 10px; font-size: 13px; }
.pc-load .val { font-weight: 500; }
.pdu-toggle .pt-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--on-ink); font-size: 11.5px; display: inline-grid; place-items: center; }
.pdu-toggle.dark .pt-n { background: var(--on-ink); color: var(--ink); }
.pc-banks { display: grid; gap: 4px; margin-top: 8px; }
.pc-banks .mrow { cursor: default; }
.pc-banks .mrow:hover { background: none; }
.fmenu { position: absolute; left: 16px; right: 16px; bottom: 54px; z-index: 6; background: var(--card-sel); border: 1px solid var(--card-edge); border-radius: 16px; padding: 6px; box-shadow: 0 8px 30px rgba(0, 0, 0, .10); display: grid; }
.fmenu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 10px; }
.fmenu button:hover { background: var(--card); }
.fmenu button[aria-checked="true"] { font-weight: 500; }
.fmenu button[aria-checked="true"]::after { content: "âœ“"; margin-left: auto; }
.empty-note { color: var(--ink-2); font-size: 13px; }

/* ---------- the strip of racks ---------- */
.rcard { flex: 0 0 150px; display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--card-edge); border-radius: 18px; padding: 9px 12px 8px; text-align: left; min-height: 0; }
.rcard:hover { background: var(--card-sel); }
.rcard.is-sel { background: var(--card-sel); border-color: var(--ink); }
.rcard.is-target { box-shadow: inset 0 0 0 2px var(--ink); }
.rc-top { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.rc-id { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-w { color: var(--ink-2); white-space: nowrap; }
.rc-fig { flex: 1 1 auto; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.thumb { display: block; height: 100%; max-height: 66px; width: auto; overflow: visible; }
.t-cab { fill: var(--hw-frame); stroke: var(--hw-frame-line); stroke-width: .8; }
.t-in { fill: var(--hw-inside); }
.t-dev { fill: var(--hw-plate); stroke: var(--hw-plate-line); stroke-width: .3; }
.t-dev.is-down { fill: var(--hw-dead-line); stroke: none; }

/* ---------- the first screen: the set-up form beside a working example ---------- */
.first-wrap { overflow-y: auto; min-height: 0; }
.first { display: grid; grid-template-columns: minmax(300px, 420px) auto; gap: 56px; justify-content: center; align-items: start; padding: 5vh 24px 24px; min-height: 100%; }
.setup h1 { font-size: 34px; font-weight: 300; line-height: 1.1; letter-spacing: -.01em; }
.setup > p { margin-top: 8px; color: var(--ink-2); }
.setup form { margin-top: 24px; display: grid; gap: 12px; }
.setup .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setup label { display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; }
.setup .in { height: 40px; font-size: 15px; }
.setup select.in { font-size: 14px; }
.setup .btn.primary { height: 44px; border-radius: 22px; margin-top: 8px; font-size: 15px; }
.setup .defs { margin-top: 16px; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.setup .defs b { color: var(--ink); font-weight: 500; }
.setup .or { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.demo { display: flex; gap: 24px; align-items: flex-start; }
/* as tall as the window allows, so its labels can be drawn at a readable size (app.js draws them
   for the scale it ends up at) */
.demo-rack svg { display: block; height: min(calc(100vh - var(--top-h) - 72px), 860px); width: auto; }
.demo-say { width: 250px; padding-top: 8vh; display: grid; gap: 12px; justify-items: start; }
.demo-say h2 { font-size: 18px; font-weight: 500; }
.feed { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 12px; border: 1px solid var(--stroke); border-radius: 20px; }
.feed-name { font-weight: 500; white-space: nowrap; }
.demo-line { color: var(--ink-2); }
.demo-line b { color: var(--ink); font-weight: 500; }

/* ---------- dialog, message, recovery ---------- */
dialog { padding: 0; border: 1px solid var(--card-edge); border-radius: var(--r-card); background: var(--card-sel); color: var(--ink); box-shadow: 0 8px 30px rgba(0, 0, 0, .12); width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(17, 17, 17, .35); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 18px; font-weight: 500; }
.dlg-body { padding: 16px 20px 20px; display: grid; gap: 12px; }
.dlg-body .fld { grid-template-columns: 1fr 130px; }
.key { display: grid; gap: 10px; }
.key li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; font-size: 13px; }
.key svg { width: 44px; height: 22px; }
.key svg.is-tall { height: 33px; }
.key-h { font-size: 14px; font-weight: 500; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.keys dt { font-weight: 500; white-space: nowrap; }
.keys dd { color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: flex; gap: 14px; align-items: center; padding: 9px 16px; background: var(--ink); color: var(--on-ink); border-radius: 18px; font-size: 13px; max-width: min(640px, calc(100vw - 32px)); }
.toast.is-err { background: var(--accent); color: var(--on-accent); border: 1px solid var(--ink); }
/* a kept room that could not be opened (EN-03): stays until dismissed; yellow behind black words, ink edge (P1) */
.kept { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 75; display: grid; gap: 10px; padding: 14px 18px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--ink); border-radius: 18px; font-size: 14px; line-height: 1.45; width: min(560px, calc(100vw - 32px)); }
.kept p { margin: 0; }
.kept-acts { display: flex; gap: 8px; flex-wrap: wrap; }
/* a room handed over from a calculator on the site: information, not trouble, so card and ink, not yellow */
.kept.is-info { background: var(--card); color: var(--ink); box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.rep-racks .rep-same { display: block; line-height: 1.45; margin: 0 0 18px; max-width: 70ch; }
.toast-undo { background: none; border: 0; padding: 0; color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.recover-wrap { overflow-y: auto; padding: 10vh 24px; }
.recover { max-width: 520px; margin: 0 auto; display: grid; gap: 12px; }
.recover h1 { font-size: 30px; font-weight: 300; line-height: 1.15; }

/* ---------- document pages (checklist, report) ---------- */
.doc { overflow-y: auto; padding: 12px 16px 64px; }
.page { max-width: 800px; margin: 0 auto; padding: 40px 48px 48px; background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--r-card); font-size: 14px; line-height: 1.55; }
.page h1 { font-size: 34px; font-weight: 300; line-height: 1.1; letter-spacing: -.01em; }
.page h2 { font-size: 19px; font-weight: 500; margin-top: 34px; }
.page h3 { font-size: 15px; font-weight: 500; margin-top: 18px; }
.page p { margin-top: 8px; max-width: 70ch; }
.page li { max-width: 70ch; }
.page .lede { color: var(--ink-2); }
.page .disclaimer { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; max-width: 800px; margin: 0 auto 14px; }
.doc-actions label { display: grid; gap: 3px; font-size: 12px; color: var(--ink-2); flex: 1 1 180px; }
.score { margin-top: 12px; font-weight: 500; }
.q { border: 0; padding: 14px 0 0; margin: 14px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.q legend { padding: 0; font-weight: 500; float: left; width: 100%; max-width: 70ch; }
.q .how { clear: both; color: var(--ink-2); font-size: 13px; padding-top: 4px; }
.q .seg { margin-top: 8px; }
.tablewrap { overflow-x: auto; margin-top: 10px; position: relative; }   /* relative: holds the .sr words inside it */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
/* D-U25c (DS-21): a column after a right-aligned figure keeps clear of it ("32 A" then "L1 (16 A)") */
th.num + th, td.num + td { padding-left: 10px; }
th { font-weight: 500; color: var(--ink-2); border-bottom-color: var(--ink-2); }
.num { text-align: right; white-space: nowrap; }
tr.row-crit td, tr.row-warn td { font-weight: 500; }
tr.row-off td { color: var(--ink-2); }
.numbered { list-style: decimal; padding-left: 22px; margin-top: 8px; }
.rep-over { color: var(--ink-2); margin: 0 !important; }
.rep-verdict { margin-top: 26px !important; font-size: 26px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.rep-feeds { margin-top: 10px; display: grid; gap: 4px; }
.rep-first { list-style: decimal; padding-left: 22px; margin-top: 10px; display: grid; gap: 8px; }
.rep-finding { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); break-inside: avoid; }
.rep-finding h3 { margin-top: 0; }
.rep-sev { margin-top: 2px !important; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.rep-finding.sev-outage .rep-sev, .rep-finding.sev-risk .rep-sev { color: var(--ink); }
.rep-finding dt { font-weight: 500; font-size: 13px; margin-top: 8px; }
.rep-finding dd, .rep-finding li { color: var(--ink-2); max-width: 70ch; }
.rep-finding.is-short { margin-top: 12px; padding-top: 10px; }
.rep-finding.is-short h3 { font-size: 15px; }
.rep-finding.is-short h3 .rep-sev { margin-left: 4px; white-space: nowrap; }
.rep-finding.is-short p { margin-top: 4px; color: var(--ink-2); }
.rep-finding.is-short b { color: var(--ink); font-weight: 500; }
/* each drawing is one unbreakable block on a shared floor line */
.rep-racks { margin-top: 12px; line-height: 0; }
.rep-racks figure { display: inline-block; vertical-align: top; margin: 0 14px 18px 0; break-inside: avoid; line-height: 1.45; }
.rep-racks figcaption { font-weight: 500; font-size: 13px; padding-left: 16px; margin-bottom: 2px; max-width: 280px; }
/* D-U25b (DS-01): the report's drawings keep the size they are drawn at (0.28 mm a unit printed: no word under 6 pt) */
.rep-racks svg, .rep-fig svg { display: block; }
.rep-key { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 11.5px; color: var(--ink-2); max-width: 300px !important; margin-top: 4px !important; }
.rep-key b { color: var(--ink); font-weight: 500; }
/* EN-02: a long report lays out and paints only the drawings and schedules near the screen; print shows all */
.report .rep-racks figure { content-visibility: auto; contain-intrinsic-size: auto 218px auto 330px; }
.report .rep-rack { content-visibility: auto; contain-intrinsic-size: auto 1200px; }
.report .rep-app .tablewrap { content-visibility: auto; contain-intrinsic-size: auto 1500px; }

/* ---- the report's page 1, schedules, loads and cabling list (D-U20) ---- */
.rep-meta { margin-top: 10px !important; font-size: 15px; color: var(--ink); }
.page .lede.rep-small, .rep-p1 .lede { font-size: 12.5px; margin-top: 2px; }
.rep-def { color: var(--ink-2); font-size: 12.5px; }
.rep-left, .rep-calm { font-weight: 500; }
.rep-worst { display: flex; flex-wrap: wrap; gap: 18px 22px; margin-top: 12px; align-items: flex-start; }
.rep-worst figure, .rep-result figure { margin: 0; min-width: 0; break-inside: avoid; }
.rep-fig figcaption { max-width: 260px; }
.rep-result { display: flex; flex-wrap: wrap; gap: 18px 32px; margin-top: 12px; align-items: flex-start; }
.rep-result .rep-todo { flex: 1 1 260px; min-width: 0; }
.rep-result .rep-todo h2 { margin-top: 0; }
.rep-fig figcaption.no-n { grid-template-columns: minmax(0, 1fr); }
.rep-worst figcaption, .rep-result figcaption { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; margin-top: 8px; font-size: 12.5px; line-height: 1.35; }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: 11.5px; font-weight: 500; }
.rep-rack, .rep-cabling { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.rep-rack h2, .rep-cabling h2 { margin-top: 2px !important; font-size: 26px !important; font-weight: 300 !important; letter-spacing: -.01em; }
.rep-rack .rep-meta { margin-top: 4px !important; font-size: 13px; color: var(--ink-2); }
.rep-rack h3 { margin-top: 22px; }
.sched, .loads, .cabtab { table-layout: fixed; font-size: 12.5px; }
.sched td, .loads td, .cabtab td { overflow-wrap: anywhere; }
.sched { min-width: 640px; } .loads { min-width: 600px; } .cabtab { min-width: 560px; }
.sched .c-u { width: 64px; } .sched .c-dev { width: 17%; } .sched .c-model { width: 13%; } .sched .c-h { width: 50px; } .sched .c-draw { width: 116px; } .sched .c-cords { width: auto; }
.sched td .dr { display: block; white-space: nowrap; }
.sched td.num .cw { display: block; }
.loads th.num, .sched th.num { white-space: normal; }
.sched td.u, .cabtab td.mono { font-size: 12px; white-space: nowrap; overflow-wrap: normal; }
.sched td .why, .loads td .why { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.cords { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.cords li { max-width: none; }
.cords .psu { font-weight: 500; }
.cords .nw { white-space: nowrap; }   /* the outlet and its state stay together */
.cords .mono { font-size: 12px; }
svg.to { width: 13px; height: 8px; margin: 0 5px 1px; vertical-align: middle; fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cw { color: var(--ink-2); font-size: 11.5px; }
/* US-17: a device whose cords protect nothing: the row says so, in black words on the problem yellow with an ink edge (P1) */
.cw-prob { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid var(--ink); border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.cw.is-open { color: var(--ink); font-weight: 500; }
.loads-head { break-inside: avoid; break-after: avoid; }
.rep-caveat { margin-top: 6px !important; padding: 8px 12px; border: 1px solid var(--ink); border-radius: 12px; font-weight: 500; max-width: none !important; }
.loads .c-circ { width: 19%; } .loads .c-feed { width: 11%; } .loads .c-rate { width: 62px; } .loads .c-on { width: 17%; } .loads .c-worst { width: 17%; } .loads .c-which { width: auto; }
.loads td:last-child, .loads th:last-child { padding-left: 8px; }
.loads tr.l-pdu td { font-weight: 500; border-top: 1px solid var(--ink-2); }
.loads tr.l-pdu .why { font-weight: 400; }
.loads tr.l-bank td:first-child { padding-left: 14px; }
.loads td.num .why { text-align: right; }
.lv { display: inline-block; padding: 0 6px; border: 1px solid transparent; border-radius: 10px; white-space: nowrap; }
.lv.is-over { border-color: var(--ink); }
.lv.is-trip { background: var(--accent); color: var(--on-accent); border-color: var(--ink); font-weight: 500; }
.rep-total { margin-top: 12px !important; font-size: 14px; max-width: none !important; }
.rep-total b { font-weight: 500; }
.cabtab .c-rack { width: 15%; } .cabtab .c-u { width: 76px; } .cabtab .c-dev { width: auto; } .cabtab .c-psu { width: 58px; } .cabtab .c-pdu { width: 15%; } .cabtab .c-bank { width: 60px; } .cabtab .c-out { width: 92px; }
.cabtab tr.is-first td { border-top: 1px solid var(--ink-2); }
.cabtab td.num .cw { font-family: var(--font); }
.cab-page .rep-meta { color: var(--ink-2); font-size: 13px; }

/* ---------- the rack drawing (draw.js, after the approved mockup) ---------- */
/* a feed's colour by slot (K-026): f1 to f4 here, c-f0 to c-f3 on cords; grey when it has none */
.f0 { --fc: var(--ink-2); } .f1 { --fc: var(--feed-a); } .f2 { --fc: var(--feed-b); } .f3 { --fc: var(--feed-c); } .f4 { --fc: var(--feed-d); }
.rv text { font-family: var(--font); }
/* level of detail, by class on the stage (app.js setDetail): .finer only from lod-hi, .fine and
   .detail dropped at lod-lo, which leaves outline and name */
.lod-lo .rv .fine, .lod-lo .rv .finer, .lod-lo .rv .detail, #stage-svg:not(.lod-hi) .rv .finer { display: none; }
.floor { stroke: var(--ink); stroke-width: 1.2; }
.ground { fill: var(--line); }
.cab-frame { fill: var(--hw-frame); stroke: var(--hw-frame-line); stroke-width: 1; }
.cab-inside { fill: var(--hw-inside); stroke: var(--hw-frame-line); stroke-width: .6; }
.cab-slot { fill: none; stroke: var(--hw-frame-line); stroke-width: 1.6; stroke-linecap: round; }
.rail { fill: var(--hw-rail); stroke: var(--hw-frame-line); stroke-width: .5; }
.rail-hole { fill: var(--hw-hole); }
.unum { font: 400 11px var(--font-mono); fill: var(--ink-2); }
.rv.is-sheet .unum { font-size: 9.5px; }
/* the first screen's example is a small picture: its finest detail is left out */
.demo-rack .rv .fine, .demo-rack .rv .finer { display: none; }
/* empty U are open rails: a slot is only somewhere to click, with no outline */
.slot { fill: transparent; cursor: cell; }
.slot:hover { fill: rgba(17, 17, 17, .06); }
.slot.is-sel { fill: rgba(17, 17, 17, .08); stroke: var(--ink); stroke-width: 1.2; }
.add { cursor: pointer; }
.add-dot { fill: #111111; }
.add-plus { stroke: #FFFFFF; stroke-width: 1.6; stroke-linecap: round; }
.add:hover .add-dot { fill: var(--ink-2); }
/* PDUs */
.pdu { cursor: pointer; }
.pdu:focus { outline: none; }
.pdu:focus-visible .pdu-case, .pdu:focus-visible .pdu-hidden, .pdu.is-sel .pdu-case { stroke: var(--ink); stroke-width: 2.4; }
.pdu-name { font-size: 11.5px; font-weight: 500; fill: var(--ink); }
.is-hidden-pdu .pdu-name { fill: var(--ink-2); }
.feedmark { fill: var(--fc); }
.input-cord { stroke: var(--fc); stroke-width: 1.6; }
.input.is-dead .input-cord { stroke-dasharray: 2.5 2; }
.input.is-dead .feedmark { fill: var(--card); stroke: var(--fc); stroke-width: 1.3; }
.pdu-case { fill: var(--hw-pdu); stroke: var(--hw-pdu-line); stroke-width: 1; }
.pdu.is-unfinished .pdu-case { stroke: var(--ink-2); stroke-dasharray: 3 2; }
.pdu-screw { fill: var(--hw-screen); }
.pdu-div { stroke: var(--hw-pdu-ink); stroke-opacity: .3; stroke-width: .75; }
.pdu-screen { fill: var(--hw-screen); }
.brk-case { fill: var(--hw-socket); }
.brk-rocker { fill: var(--hw-pdu); }
.breaker.is-tripped .brk-case { fill: var(--accent); stroke: var(--ink); stroke-width: .8; }
/* behind the equipment on the front: a thin solid line (dashed means planned, assumed or not traced) */
.pdu-hidden { fill: none; stroke: var(--line); stroke-width: 1; }
/* a PDU whose feed is off, or which has failed: flat grey like a dead device, outlets hollow */
.pdu.is-dead .pdu-case { fill: var(--hw-dead); stroke: var(--hw-dead-line); }
.pdu.is-dead .pdu-screen, .pdu.is-dead .brk-case { fill: var(--hw-dead-line); }
.pdu.is-dead .brk-rocker, .pdu.is-dead .pdu-screw { fill: var(--hw-dead); }
.bank.is-dead .o-shape { fill: none; stroke: var(--hw-dead-ink); }
.bank.is-dead .o-pins { fill: var(--hw-dead-ink); }
.bank.is-dead .bank-face { fill: var(--hw-dead-ink); }
.m-track { fill: var(--line); }
.m-fill { fill: var(--ink); }
.s-trip .m-fill { fill: var(--accent); stroke: var(--ink); stroke-width: .8; }
.m-over { fill: var(--accent); stroke: var(--ink); stroke-width: .8; }
.m-tick { stroke: var(--ink); stroke-width: 1; fill: none; }
.trip-fill { fill: var(--accent); stroke: var(--ink); stroke-width: 1; opacity: .95; }
.pat-trip { stroke: var(--ink); stroke-width: .9; fill: none; opacity: .5; }
.bank-bracket { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.bank.s-trip .bank-bracket, .bank.s-warn .bank-bracket, .bank.s-hot .bank-bracket { stroke: var(--ink); stroke-width: 1.6; }
/* over its breaker, in a playback frame before it trips: hazard yellow with an ink edge (P1, P9) */
.s-hot .m-fill { fill: var(--accent); stroke: var(--ink); stroke-width: .8; }
.bank-label.s-hot .bank-state-bg { fill: var(--accent); stroke: var(--ink); }
.bank-label.s-hot .bank-state { fill: #111111; }
.bank-face { font-size: 11px; font-weight: 500; fill: var(--hw-pdu-ink); }
.s-trip .bank-face { fill: #111111; }
.bank-name { font-size: 11px; font-weight: 500; fill: var(--ink); }
/* DS-13: the drawing's bank load only (as designed, D-U11); the PDU details' line of the same class is Lexend */
text.bank-load { font-family: var(--font-mono); font-size: 11.5px; fill: var(--ink); }
.bank-label.s-off .bank-load, .bank-label.s-none .bank-load { fill: var(--ink-2); }
.bank-state { font-size: 11px; font-weight: 500; fill: var(--ink); }
.bank-state-bg { fill: none; stroke: var(--ink); stroke-width: 1; }
.bank-label.s-trip .bank-state-bg { fill: var(--accent); stroke: var(--ink); }
.bank-label.s-trip .bank-state { fill: #111111; }
/* outlets: free ones hollow; occupied ones (Task 7) filled in the feed's colour */
.o-shape { fill: var(--hw-pdu); stroke: var(--hw-socket); stroke-width: .9; }
.o-pins { fill: var(--hw-socket); }
.outlet.is-used .o-shape { fill: var(--fc); stroke: var(--hw-pdu-ink); }
/* devices */
.dv { cursor: grab; touch-action: none; }
.dv:focus { outline: none; }
.dv:focus-visible .dv-plate { stroke: var(--ink); stroke-width: 2.4; }
.dv-plate { fill: var(--hw-plate); stroke: var(--hw-plate-line); stroke-width: 1; }
.dv:hover .dv-plate { stroke: var(--ink); stroke-width: 1.4; }
.dv-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.dv-name { fill: var(--ink); font-weight: 500; }
.dv-stat { fill: var(--ink-2); }
.dv-stat.is-todo { font-style: italic; }
.dv.is-unfinished .dv-plate { stroke-dasharray: 3 2; stroke: var(--ink-2); }
.dv.is-down .dv-plate { fill: var(--hw-dead); stroke: var(--hw-dead-line); }
.dv.is-down .detail { display: none; }
.dv.is-down .dv-name, .dv.is-down .dv-stat { fill: var(--hw-dead-ink); }
.dv.is-down .dv-stat { font-weight: 500; }
.dv.is-down .psu-case { fill: var(--hw-dead); stroke: var(--hw-dead-line); }
.dv.is-dim, .is-faded { opacity: .25; }
.is-quiet { opacity: .35; }
.dv-other-box { fill: none; stroke: var(--hw-frame-line); stroke-width: 1; }
.dv-other-label { fill: var(--ink-2); }
.vent-dot { fill: var(--hw-vent); }
.fd-line { fill: var(--hw-bay); stroke: var(--hw-detail); stroke-width: .7; }
.fd-btn { fill: none; stroke: var(--hw-detail); stroke-width: .8; }
.fd-dot, .screw, .fan-hub { fill: var(--hw-detail); }
.fan { fill: none; stroke: var(--hw-detail); stroke-width: .8; }
.ear { fill: var(--hw-ear); }
.psu-case { fill: var(--hw-psu); stroke: var(--hw-psu-line); stroke-width: .9; }
.psu-handle { fill: none; stroke: var(--hw-psu-line); stroke-width: 1.1; }
.psu-fan { fill: none; stroke: var(--hw-detail); stroke-width: .7; }
.psu-inlet { fill: var(--fc); stroke: var(--hw-psu-line); stroke-width: .5; }
.psu.is-dead .psu-inlet { fill: var(--hw-psu); stroke: var(--fc); stroke-width: 1.2; }
.psu-inlet.is-unknown { fill: none; stroke: var(--ink-2); stroke-width: .9; stroke-dasharray: 1.6 1.2; }
.psu-num { font: 400 5.5px var(--font-mono); fill: var(--ink-2); }
/* a supply's feed mark on the front: filled when live, hollow with no power, dashed when unplugged */
.pip { fill: var(--fc); stroke: var(--fc); stroke-width: 1.2; stroke-linejoin: round; }
.pip.is-dead { fill: none; }
.pip.pip-none { fill: none; stroke-dasharray: 1.6 1.2; }
.pip.pip-away { fill: none; stroke-width: 1.6; }
/* a device with no power is grey, and so are its supplies' marks, like its cords (dead and off are grey) */
.dv.is-down .pip { stroke: var(--hw-dead-ink); }
.dv.is-down .psu-inlet { stroke: var(--hw-dead-ink); }
/* a finding is about it: a notch; one cord: hazard yellow with an ink edge (P1) */
.notch.is-single { fill: var(--accent); stroke: var(--ink); stroke-width: 1; }
.notch.is-finding { fill: var(--ink); }
.drop { fill: rgba(17, 17, 17, .08); stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.drop.is-bad { fill: rgba(244, 196, 48, .55); stroke: var(--ink); }
/* cords (D-U13): the feed's colour by slot, red, blue, green, orange (K-026), and the plug end in
   the slot's shape (P7). A casing in the cabinet's colour keeps crossings readable. */
.c-f0 { --cc: var(--feed-a); } .c-f1 { --cc: var(--feed-b); } .c-f2 { --cc: var(--feed-c); } .c-f3 { --cc: var(--feed-d); } .c-fn { --cc: var(--ink-2); }
.cord { cursor: pointer; }
.c-case { fill: none; stroke: var(--hw-inside); stroke-width: 3.6; stroke-linejoin: round; stroke-linecap: round; }
.c-body { fill: none; stroke: var(--cc); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.c-core { fill: none; stroke: none; }
.c-plug { fill: var(--cc); stroke: var(--hw-psu-line); stroke-width: .6; }
.c-relief { fill: var(--cc); }
.cord-end { fill: var(--cc); stroke: var(--hw-pdu-ink); stroke-width: .7; stroke-linejoin: round; }
/* the problem, loud: false redundancy (every cord of a device in one bank, PDU or feed) is hazard
   yellow in a heavy ink casing (P1), never a feed's colour: thicker and far lighter than any feed */
.cord.is-problem .c-case { stroke: var(--ink); stroke-width: 4.4; }
.cord.is-problem .c-body { stroke: var(--accent); stroke-width: 2.4; }
.cord.is-problem .c-plug, .cord.is-problem .c-relief, .cord.is-problem .cord-end, .xtag.is-problem .cord-end { fill: var(--accent); stroke: var(--ink); stroke-width: 1; }
/* no power: hollow and grey, like its PDU and its outlets */
.cord.is-dead .c-body { stroke: var(--hw-dead-ink); stroke-width: 2.8; }
.cord.is-dead .c-core { stroke: var(--hw-dead); stroke-width: 1.2; }
.cord.is-dead .c-plug, .cord.is-dead .c-relief, .cord.is-dead .cord-end, .xtag.is-dead .cord-end { fill: var(--hw-dead); stroke: var(--hw-dead-ink); stroke-width: .9; }
/* many cords: quiet, and full strength on hover or when what they belong to is selected */
.cord.is-quiet:hover, .cord.is-quiet.is-hot { opacity: 1; }
/* the tag at the rack's edge: a cord to a PDU in another rack; it opens that rack */
.xtag { cursor: pointer; }
.xtag:focus { outline: none; }
.xt-bg { fill: var(--card-sel); stroke: var(--ink); stroke-width: 1; }
.xt-t { font-size: 11px; font-weight: 500; fill: var(--ink); }
.xtag[role="button"]:hover .xt-bg, .xtag:focus-visible .xt-bg { fill: var(--ink); }
.xtag[role="button"]:hover .xt-t, .xtag:focus-visible .xt-t { fill: var(--on-ink); }
.xtag:focus-visible .xt-bg { stroke-width: 2; }
/* every cord in one bank, PDU or feed: the device says so, black words on yellow with an ink edge */
.mp-bg { fill: var(--accent); stroke: var(--ink); stroke-width: 1; }
.mp-t { font-size: 11px; font-weight: 500; fill: #111111; }
/* the outlet editor and the key */
.outlet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-top: 6px; }
.outlet-row .in.num { width: 56px; }
.check-label { color: var(--ink); }
.is-key-warn { fill: none; stroke: var(--ink); stroke-width: 1; }

.drawer:not([hidden]) { animation: panel-in var(--panel-ms) ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* ---------- tracing at the rack (D-U16, spec 5.4) ----------
   The guide panel takes the PDU cards' place in the right column, in large type: where we are, the
   device and its PSU, the question, then the answers, each a 44 px row. On a tablet (up to 1180 px)
   the details column gives its room to the drawing and the guide. */
.tcard { display: grid; align-content: start; }
.trace-start { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.t-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 500; margin-top: 10px; }
.t-head:focus { outline: none; }
.t-ticks { display: flex; align-items: center; gap: 3px; height: 12px; margin: 8px 0 14px; }
.t-ticks .t { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.t-ticks .t.is-done { background: var(--ink-2); }
.t-ticks .t.is-skip { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-2); }
.t-ticks .t.is-cur { height: 12px; background: var(--ink); }
.tcard .big-id { font-size: 32px; }
.t-where { font-size: 17px; margin-top: 6px; }
.t-prog { font-size: 12px; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.t-ask { font-size: 17px; line-height: 1.35; font-weight: 300; margin-top: 14px; text-wrap: pretty; }
.t-say { font-size: 15px; line-height: 1.4; font-weight: 300; margin-top: 12px; }
.t-now { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.t-msg { font-size: 13px; line-height: 1.35; background: var(--card-sel); border: 1px solid var(--card-edge); padding: 8px 12px; border-radius: 12px; margin-top: 12px; }
/* a refusal: black words on hazard yellow, in an ink edge (P1) */
.t-err { font-size: 13px; line-height: 1.35; font-weight: 500; background: var(--accent); color: var(--on-accent); border: 1px solid var(--ink); padding: 8px 12px; border-radius: 12px; margin-top: 12px; }
.t-or { margin: 16px 0 6px; }
.t-list { display: grid; gap: 6px; }
.t-list.is-all { max-height: 44vh; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
.t-group { margin-top: 6px; }
.t-opt { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px; padding: 6px 14px; background: transparent; border: 1px solid var(--stroke); border-radius: 22px; font-size: 13.5px; line-height: 1.3; text-align: left; }
.t-opt:hover:not(:disabled) { background: var(--card-sel); border-color: var(--ink); }
.t-opt .mono { font-weight: 500; }
/* taken: said in words, the edge dashed; still readable (no fading below 4.5:1) */
.t-opt:disabled { cursor: default; color: var(--ink-2); border-style: dashed; }
.t-opt:disabled .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fc, var(--ink-2)); }
.t-more { justify-self: start; margin-top: 8px; font-size: 13px; }
.t-answers { display: grid; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.t-ans { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 16px; background: var(--card-sel); border: 1px solid var(--card-edge); border-radius: 22px; font-size: 14px; font-weight: 500; text-align: left; }
.t-ans:hover { border-color: var(--ink); }
kbd { font: 500 11.5px var(--font); min-width: 24px; height: 24px; padding: 0 6px; display: inline-grid; place-content: center; border: 1px solid var(--ink-2); border-radius: 7px; color: var(--ink); background: var(--card); flex: none; }
.pill kbd { height: 20px; min-width: 20px; margin-right: -4px; }
.t-foot { display: grid; justify-items: start; gap: 8px; margin-top: 16px; }
.t-foot .pill:disabled { opacity: .45; cursor: default; }
.t-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.t-yes { margin-top: 12px; }
.t-ifnot { margin-top: 8px; }
.pill.big { height: 44px; padding: 0 18px; border-radius: 22px; font-size: 14px; }
.t-q { font-size: 14px; font-weight: 500; margin-top: 16px; }
.t-note { display: grid; gap: 8px; }
.t-note .in { height: 44px; font-size: 15px; }
.tcard.is-end .t-what { margin-top: 4px; }
/* the drawing while tracing: the cord's device and PSU and the outlets at full strength, the rest
   faded (less than a selection, so the neighbours still show where you are in the rack) */
.rv.is-tracing .is-faded { opacity: .4; }
.rv.is-tracing .dv { cursor: pointer; }
.rv.is-tracing .add { display: none; }
.rv.is-tracing .slot { cursor: default; }
.rv.is-tracing .slot:hover { fill: transparent; }
/* the PSU being traced: an ink ring, and round it a pulse that grows and fades; with reduced
   motion the pulse stands still, a second ring (constraint 7) */
.trace-ring { fill: none; stroke: var(--ink); stroke-width: 2.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.trace-pulse { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; transform-box: fill-box; transform-origin: center; opacity: .45; transform: scale(1.14, 1.7); animation: trace-pulse 1.6s ease-out infinite; }
@keyframes trace-pulse { from { opacity: .85; transform: scale(1, 1); } to { opacity: 0; transform: scale(1.2, 2); } }
/* the outlet targets: invisible until pointed at or reached by the keyboard; the keyboard's ring is
   ink inside a light edge, so it shows on the dark PDU and on the light cabinet alike */
.hit { fill: transparent; cursor: pointer; outline: none; }
.hit:hover { fill: rgba(17, 17, 17, .10); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.hit:focus-visible { fill: rgba(255, 255, 255, .14); stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; outline: 2px solid var(--card-sel); outline-offset: 1px; }
@media (max-width: 1365px) {
  .work.is-trace { grid-template-columns: minmax(0, 1fr) var(--side); grid-template-rows: minmax(0, 1fr); }
  .work.is-trace .col-left { display: none; }
  .work.is-trace .centre { grid-column: 1; grid-row: 1; }
  .work.is-trace .col-right { grid-column: 2; grid-row: 1; flex-direction: column; overflow-x: hidden; overflow-y: auto; }
  .work.is-trace .col-right .card { flex: none; }
}
@media (max-width: 820px) {
  .work.is-trace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .work.is-trace .centre, .work.is-trace .col-right { grid-column: 1; grid-row: auto; }
}

/* ---------- narrower screens ---------- */
/* down to 1366 px the PDU cards keep their column beside the stage (spec 5.14) */
@media (max-width: 1499px) { :root { --side: 268px; --strip: 100px; } .big-id { font-size: 30px; } }
/* a short window: the strip of racks folds down to names and small pictures (DS-04, US-01) */
@media (max-height: 820px) { :root { --strip: 72px; } .rcard { padding: 6px 12px 5px; gap: 2px; } }
/* D-U25b, US-01: from 821 to 1365 px wide (a tablet held sideways, a small laptop) the stage keeps
   the middle and the details column its place; the PDU cards become a panel over the stage's right
   side, opened by the labelled "PDUs" button in the stage's corner (one pattern at every width in
   the range). While tracing, the guide takes the right column as it does everywhere. */
.pdu-toggle, .panel-head { display: none; }
@media (min-width: 821px) and (max-width: 1365px) {
  .work { grid-template-columns: var(--side) minmax(0, 1fr); }
  .work:not(.is-trace) .col-right {
    position: fixed; z-index: 30; top: calc(var(--top-h) + 2px); right: 12px; bottom: 12px; width: min(316px, calc(100vw - 24px));
    padding: 12px; background: var(--canvas); border: 1px solid var(--card-edge); border-radius: var(--r-card); box-shadow: 0 8px 30px rgba(0, 0, 0, .14);
    transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform var(--panel-ms) var(--ease), visibility 0s linear var(--panel-ms);
  }
  .work.show-pdus:not(.is-trace) .col-right { transform: none; visibility: visible; transition: transform var(--panel-ms) var(--ease); }
  .work:not(.is-trace) .col-right .panel-head { display: flex; }
  .pdu-toggle { display: inline-flex; }
  .first { grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 32px; justify-content: stretch; }
  .demo { flex-wrap: wrap; min-width: 0; }
  .demo-rack { min-width: 0; max-width: 100%; }
  .demo-rack svg { max-width: 100%; height: auto; max-height: calc(100vh - var(--top-h) - 72px); }
  .demo-say { padding-top: 0; }
}
.panel-head { align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 0 8px; }
.panel-head h2 { font-size: 14px; font-weight: 500; }
@media (max-width: 900px) {
  .first { grid-template-columns: minmax(0, 420px); }
  .demo { flex-wrap: wrap; }
  .demo-rack svg { height: min(80vh, 760px); }
  .demo-say { padding-top: 0; }
}
/* a phone: the page scrolls down, never sideways */
@media (max-width: 820px) {
  body { height: auto; min-height: 100vh; overflow-x: hidden; overflow-y: auto; grid-template-rows: auto auto; }
  .top { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; gap: 8px; }
  .brand-name { display: none; }
  .views { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; row-gap: 6px; }
  .vsep { display: none; }
  .dbtn { height: 36px; padding: 0 12px; }
  .tools { grid-row: 1; grid-column: 2; }
  .roompill { max-width: 150px; }
  .work { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .col-left, .centre, .col-right, .strip { grid-column: 1; grid-row: auto; }
  .col { overflow: visible; }
  .col-right { flex-direction: column; }
  .col-right .card { flex: none; }
  .stage { flex: none; height: 74vh; }
  .under, .u-left, .zoomctl { flex-wrap: wrap; }
  .zoomctl { flex: 1 1 auto; min-width: 0; }
  .cap { white-space: normal; flex-basis: 100%; }
  /* VF-07: the caption keeps its line; the buttons wrap under it */
  .stage-label { top: 10px; right: 16px; }
  .stage-tr { top: 34px; left: 16px; right: 16px; flex-wrap: wrap; justify-content: flex-end; }
  .playback { flex-wrap: wrap; }
  .cap.is-step { order: 3; }
  /* DS-02: the drawing takes the stage's width and the stage its height (app.js), so a finger on
     it scrolls the page; the result comes straight after the verdict, the details after it */
  .stage-scroll { touch-action: pan-y; }
  .c-head, .rowbtns { flex-wrap: wrap; }
  .rowbtns { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
  .col-left > .card { min-width: 0; max-width: 100%; }
  .edge { display: none; }
  .col-left { display: contents; }
  .col-left .vcard { order: 1; }
  .centre { order: 2; }
  .col-left .dcard { order: 3; }
  .col-left .fcard { order: 4; }
  .col-right { order: 5; }
  .strip { order: 6; }
  .page { padding: 22px 18px 28px; }
  .menu { right: 12px; width: min(320px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- print: the report, on white ---------- */
@media print {
  .report .rep-racks figure, .report .rep-rack, .report .rep-app .tablewrap { content-visibility: visible; }
  @page { size: A4; margin: 12mm 12mm 14mm; @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 400 8pt "Lexend", sans-serif; color: #5E5E5E; } }
  body { display: block; height: auto; overflow: visible; background: #fff; }
  .top, .work, .first-wrap, .doc-actions, .toast, .skip, .recover-wrap { display: none !important; }
  .doc { overflow: visible; padding: 0; }
  .page { border: 0; padding: 0; max-width: none; background: #fff; font-size: 10pt; line-height: 1.45; }
  .page h2 { margin-top: 24px; }
  .page h2, .page h3 { break-after: avoid; }
  .page tr, .page li { break-inside: avoid; }
  .rep-racks-head { break-inside: avoid; break-after: avoid; }
  .page th, .page td { padding: 3px 10px 3px 0; line-height: 1.3; }
  .page th.num + th, .page td.num + td { padding-left: 8px; }
  /* D-U25c (DS-21): a table of under 15 rows is not split across two pages */
  .tablewrap.is-short { break-inside: avoid; }
  .rep-finding.is-short { break-inside: auto; orphans: 2; widows: 2; }
  .page h3 { margin-top: 14px; }
  .page .disclaimer { margin-top: 16px; break-before: avoid; }
  .rep-racks figure { margin: 0 6mm 5mm 0; }
  .rep-racks figcaption { font-size: 9pt; }
  .rep-key { font-size: 7.5pt; }
  /* D-U20: page 1 stands alone; each rack's schedule, the cabling list and the appendix start a
     sheet. Header rows repeat (thead), a row never splits, a long name wraps inside its column. */
  .rep-p1 { break-after: page; }
  .rep-p1 h1 { font-size: 26pt; }
  .rep-p1 .rep-verdict { margin-top: 14px !important; font-size: 17pt; }
  .rep-p1 h2 { margin-top: 16px; }
  .rep-worst { gap: 5mm 6mm; }
  .rep-result { gap: 5mm 8mm; }
  .rep-worst figcaption, .rep-result figcaption { font-size: 8.5pt; }
  /* the steps, side by side on an A4 page of their own, turned to landscape so three readable drawings fit across (DS-01) */
  @page steps { size: A4 landscape; margin: 12mm 12mm 14mm; }
  .rep-steps { page: steps; break-after: page; }  .rep-steps h2 { margin-top: 0; }
  .rep-cabling, .rep-app { break-before: page; margin-top: 0; padding-top: 0; border-top: 0; }
  /* D-U23: a rack's schedule starts a new sheet only when it does not fit on this one */
  .rep-rack { break-inside: avoid; margin-top: 10mm; padding-top: 5mm; }
  .rep-rack .rep-over, .rep-rack h2, .rep-rack .rep-meta { break-after: avoid; }
  .rep-rack h2, .rep-cabling h2 { font-size: 20pt !important; }
  .tablewrap { overflow: visible; }
  .sched, .loads, .cabtab { min-width: 0; font-size: 8.5pt; }
  thead { display: table-header-group; }
  .sched td.u, .cabtab td.mono, .cords .mono { font-size: 8pt; }
  .cw, .sched td .why, .loads td .why { font-size: 7.5pt; }
  .rep-caveat { padding: 2mm 3mm; }
  .rep-total { font-size: 10pt; }
}

/* ---------- D-U23: the drawing sheets, A3 landscape ----------
   Each sheet is one SVG of 1500 x 1060.7 units, 0.28 mm a unit when it prints 420 mm wide. On screen
   it is a sheet of paper as wide as the page allows. Every line is 0.18 mm or more on paper
   (0.643 units): the rack drawing's finest lines are made heavier here. */
.sheets-actions { max-width: 1400px; }
.sheets-actions .note { flex: 1 1 320px; margin: 0; color: var(--ink-2); font-size: 12.5px; max-width: 70ch; }
.sheets { display: grid; gap: 20px; max-width: 1400px; margin: 0 auto; }
.sheet { background: #fff; border: 1px solid var(--card-edge); border-radius: 6px; overflow: hidden; }
.sheet-svg { display: block; width: 100%; height: auto; }
.sheet-svg text { font-family: var(--font); }
.sh-paper { fill: #fff; }
.sh-border, .tb-box { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.sh-rule, .tb-rule { stroke: var(--ink); stroke-width: .9; }
.sh-rname { font-weight: 500; fill: var(--ink); }
.sh-rsize, .sh-load-sub, .tb-label, .tb-small { fill: var(--ink-2); }
.sh-load { font-weight: 500; fill: var(--ink); }
.tb-room, .tb-title, .tb-val, .tb-caveat, .lg-h { font-weight: 500; fill: var(--ink); }
.lg-t, .key-t { fill: var(--ink); }
.bl-ring { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.bl-n { font-size: 8px; font-weight: 500; fill: var(--ink); }
.lg-inlet { fill: none; stroke: var(--ink-2); stroke-width: .9; }
.lg-dead { fill: var(--hw-dead); stroke: var(--hw-dead-line); stroke-width: 1; }
.sb-dark { fill: var(--ink); }
.sb-light { fill: #fff; stroke: var(--ink); stroke-width: .8; }
.sheet-svg .rv .cab-inside, .sheet-svg .rv .rail, .sheet-svg .rv .psu-inlet, .sheet-svg .rv .c-plug { stroke-width: .7; }
.sheet-svg .cord.is-quiet { opacity: 1; }
.rv.is-sheet .l-floor { display: none; }
/* pattern fills (the vents) would print as a page-sized bitmap: a sheet leaves them out, plates stay plain */
.rv.is-sheet .vents { display: none; }
/* D-U25b: a report drawing's names sit over the cords on a halo of their plate's colour; a break line where it is cut short */
.rv.is-sheet .dv-name.is-halo { paint-order: stroke; stroke: var(--hw-plate); stroke-width: 3px; stroke-linejoin: round; }
.rv.is-sheet .dv-name.is-halo.is-down { stroke: var(--hw-dead); fill: var(--hw-dead-ink); }
.crop-break { fill: var(--card); stroke: var(--ink); stroke-width: .9; stroke-linejoin: round; }
.crop-band { fill: var(--card); }
.crop-line { fill: none; stroke: var(--ink); stroke-width: .9; stroke-linejoin: round; }
/* ---------- D-U24: single-line diagrams ----------
   Lines in the feed's colour (--cc, from .c-f0 to .c-f3, grey .c-fn when the feed is not set);
   words always in ink. A cord is a casing in the paper's colour under its body, so a rail it passes
   over is broken there; where it joins its own rail a mark in the feed's shape sits on top. The
   problem is hazard yellow in an ink edge (P1), as the cords of the rear view. */
.sl-tree { fill: none; stroke: var(--cc); stroke-width: 1.5; stroke-linecap: square; }
.sl-rail { fill: none; stroke: var(--cc); stroke-width: 1.7; stroke-linejoin: miter; }
.sl-wire .w-case { fill: none; stroke: #fff; stroke-width: 4.6; }
.sl-wire .w-body { fill: none; stroke: var(--cc); stroke-width: 1.2; }
.sl-wire.is-dashed .w-body { stroke-dasharray: 4.2 2.6; }
.sl-wire.is-problem .w-case { stroke: var(--ink); stroke-width: 4.6; }
.sl-wire.is-problem .w-body { stroke: var(--accent); stroke-width: 2.6; }
.sl-jn .sl-mk, .sl-srcmark .sl-mk { fill: var(--cc); stroke: #fff; stroke-width: .7; }
.sl-src { fill: #fff; stroke: var(--cc); stroke-width: 1.6; }
.sl-pdu { fill: var(--ink); }
.sl-brk { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.sl-brk.is-problem { fill: var(--accent); }
.sl-brk-bar { fill: none; stroke: var(--ink); stroke-width: .9; }
.sl-dev { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.sl-term { fill: #fff; stroke: var(--ink); stroke-width: .9; }
.sl-stub, .sl-stub-end { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.sl-stub-end { stroke-width: 1.2; }
.sl-tag { fill: #fff; stroke: var(--ink); stroke-width: .9; stroke-linejoin: round; }
.sl-pill { fill: none; stroke: var(--ink); stroke-width: .9; }
.sl-pill.is-trip { fill: var(--accent); }
.sl-hrule { stroke: var(--ink-2); stroke-width: .7; fill: none; }
.sl-h, .sl-dname, .sl-rname, .sl-fig, .sl-colh { font-weight: 500; fill: var(--ink); }
.sl-t, .sl-tag-t, .sl-note, .sl-psu { fill: var(--ink); }
.sl-sub, .sl-dinfo, .sl-cont { fill: var(--ink-2); }
.sl-out { font-family: var(--font-mono); fill: var(--ink); }
.sheet-svg .sl-out { font-family: var(--font-mono); }
@media print {
  @page sheet { size: A3 landscape; margin: 0; @bottom-right { content: none; } }
  .sheets { display: block; max-width: none; }
  .sheet { page: sheet; width: 420mm; height: 297mm; border: 0; border-radius: 0; overflow: hidden; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet-svg { width: 420mm; height: 297mm; }
  #live { display: none; }   /* the live region sits after the last sheet and would start a blank one */
}

/* ---- the Room view (D-U12) ---- */
.work.is-room { grid-template-columns: var(--side) minmax(0, 1fr); }
.work.is-room .col-right { display: none; }
.room-rack { cursor: pointer; outline: none; }
.room-rack:hover .cab-frame { stroke: var(--ink); }
.room-rack:focus-visible .cab-frame { stroke: var(--ink); stroke-width: 2.5; }
.room-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.cab-frame.is-unset { stroke-dasharray: 5 3; stroke: var(--ink-2); }
.t-cab.is-unset { stroke-dasharray: 2.5 1.8; }
.rl-id { font: 500 12px var(--font); fill: var(--ink); }
.rl-size { font: 400 11px var(--font); fill: var(--ink-2); }
.cable-mgr { fill: var(--hw-rail); stroke: var(--hw-frame-line); stroke-width: .5; }
.cm-finger { fill: none; stroke: var(--hw-frame-line); stroke-width: .8; }
.rv.is-room .dv.is-dead .dv-plate { fill: var(--hw-dead); stroke: var(--hw-dead-line); }
.rv.is-room .dv.is-dead .detail { display: none; }

/* ---------- D-U15: cord states and the room's mode ---------- */
/* the room's mode over the headline; with something off, the headline itself in its place */
.vmode { font-size: 12px; color: var(--ink-2); margin: 0 0 6px; }
.vmode.vhead { color: var(--ink); font-weight: 500; }
/* the cords by state, under the feeds */
.tally { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.verdict .pill { margin-top: 12px; }
/* set-up: how the room will be used */
.mode-q { border: 0; padding: 0; margin: 4px 0 0; min-width: 0; display: grid; gap: 8px; }
.mode-q legend { font-size: 12px; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.setup .mode-opt, .mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--stroke); border-radius: 10px; background: none; color: var(--ink); font-size: 14px; text-align: left; cursor: pointer; }
.setup .mode-opt:has(input:checked), .mode-opt[aria-pressed="true"] { border-color: var(--ink); background: var(--card-sel); box-shadow: inset 0 0 0 1px var(--ink); }
.mode-q.in-dlg { margin: 0 0 14px; }
.mode-opt input { margin: 3px 0 0; accent-color: var(--ink); flex: none; }
.mode-opt > span { display: grid; gap: 2px; }
.mode-opt b { font-weight: 500; }
.mode-opt b + span { color: var(--ink-2); font-size: 12px; }
/* a cord in the details: PSU n and its state in words, then the states that are not a PDU */
.cord-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cstate { font-size: 12px; color: var(--ink-2); text-align: right; }
.cs-untraced .cstate, .cs-elsewhere .cstate { color: var(--ink); font-weight: 500; }
.cord-opts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; }
.cord-opts .linkish { font-weight: 400; min-height: 24px; }
.cord-row + .cord-row { margin-top: 6px; }
/* planned and assumed cords are dashed (spec Â§2): where a cord is meant to go, or usually goes */
.cord.is-planned .c-body, .cord.is-assumed .c-body { stroke-dasharray: 3.4 2.2; stroke-linecap: butt; }
/* a supply with nothing plugged in: its inlet struck through; to a wall socket: a plug, no cord */
.psu-inlet.is-none, .psu-inlet.is-elsewhere { fill: none; stroke: var(--ink-2); stroke-width: .9; }
.psu-strike { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; }
.psu-plug { fill: var(--ink-2); }
.psu-word { font-family: var(--font); font-weight: 500; fill: var(--ink); }
.dv.is-down .psu-word { fill: var(--hw-dead-ink); }
/* drag to plug (D-U18). Free outlets in reach: a halo round the socket. Taken ones: a cross over it. Where it
   comes from: a ring. Shape, not colour, tells them apart; the marks are light on the dark PDU and ink on a
   supply. The line follows the pointer, ink inside a light edge so it shows on the cabinet and on the PDU. */
.outlet { --pm: var(--card-sel); }
.psu { --pm: var(--ink); }
.plug-halo { fill: none; stroke: var(--pm); stroke-width: 1.5; pointer-events: none; }
.plug-x { fill: none; stroke: var(--pm); stroke-width: 1.5; stroke-linecap: round; pointer-events: none; }
.plug-from { fill: none; stroke: var(--ink); stroke-width: 2.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.outlet.is-refuse .o-shape { stroke-dasharray: 1.6 1.2; }
.outlet.is-reach { cursor: copy; }
.rv.is-plugging .outlet.is-refuse, .rv.is-plugging .psu.is-refuse { cursor: not-allowed; }
.is-plugging { cursor: crosshair; user-select: none; }
.plug-ui { pointer-events: none; }
.plug-edge { stroke: var(--card-sel); stroke-width: 5.2; stroke-linecap: round; opacity: .95; }
.plug-line { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 5 3; }
.plug-tip circle, .plug-tip path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.plug-tip circle { fill: var(--card-sel); }
.plug-tip-no { display: none; }
.plug-ui.is-no .plug-tip-no { display: inline; }
.plug-ui.is-no .plug-tip-ok { display: none; }
.plug-ui.is-no .plug-line { stroke-dasharray: 1.5 4; }
/* US-06: the outlet is chosen from a button that looks like one */
.pill.psu-pick { height: 28px; padding: 0 11px; font-size: 12.5px; margin-right: auto; }
.pill.psu-pick[aria-expanded="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.cord-head { align-items: center; }
.psu-n { flex: none; }
.plug-list { display: grid; gap: 6px; margin: 4px 0 6px; }
.plug-list .t-list.is-all { max-height: 32vh; }
@media (prefers-reduced-motion: reduce) { .plug-ui * { transition: none; animation: none; } }
.is-plugging.stage-scroll .hit:hover { fill: transparent; stroke: none; }
.plug-list .linkish { margin-top: 4px; justify-self: start; min-height: 28px; }

/* the PDU picker's form (D-U19): rated current, banks, one breaker a bank */
.pal-setup { margin-top: 10px; padding: 10px 12px; background: var(--card); border-radius: 14px; display: grid; gap: 6px; }
.pal-setup-h { margin: 0; color: var(--ink-2); font-size: 12px; }
.ps-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; align-items: center; gap: 8px; font-size: 13px; }
.pal-setup-n { margin: 0; color: var(--ink-2); font-size: 12px; }
