/* Load after the original dashboard styles. The SVG diagrams use the same tokens. */
:root {
  color-scheme: light;
  --bg0: #dce7ee;
  --bg1: #f2f7fa;
  --panel: #fff;
  --sunk: #edf4f7;
  --panel-s: #f7fbfd;
  --shadow: rgb(39 69 88 / 14%);
  --line: #b5c8d3;
  --line-s: #d2dfe6;
  --line-h: #839eaf;
  --grid: rgb(53 91 117 / 4%);
  --halo-a: rgb(230 244 250 / 65%);
  --halo-b: rgb(255 255 255 / 60%);

  --text: #152e41;
  --text-d: #304a5b;
  --muted: #40596b;
  --muted-d: #4e6473;
  --steel: #45657c;
  --steel-s: #9bb2bf;
  --steel-t: #e2edf3;
  --off: #475866;
  --off-m: #778d9b;
  --off-t: #e8eef2;

  --live: #006175;
  --live-m: #739eaa;
  --live-t: #e1f1f3;
  --live-g: rgb(0 97 117 / 13%);
  --cold: #145c8c;
  --cold-m: #86acc3;
  --cold-t: #e6f1f8;
  --cold-g: rgb(20 92 140 / 12%);
  --hot: #96450d;
  --hot-m: #ce9a6e;
  --hot-t: #ffeddd;
  --hot-g: rgb(150 69 13 / 12%);
  --pack: #495787;
  --pack-m: #9ba8c5;
  --pack-t: #e9edf7;
  --pack-g: rgb(73 87 135 / 12%);
  --warn: #912342;
  --warn-m: #be8092;
  --warn-t: #f8e6ec;
  --warn-f: rgb(145 35 66 / 4%);
  --warn-g: rgb(145 35 66 / 12%);
}

/* Only the hard-coded pale lettering needs replacing on the original brand mark. */
#top .logo text[fill="#e8eefb"] { fill: var(--text); }
#top .logo text[fill="#8b9bbd"] { fill: var(--muted); }

#ov, #dp, .cc {
  box-shadow: 0 2px 6px rgb(39 69 88 / 8%);
}
/* The live renderer fills both strips directly, without the original lit animation. */
#stage:has(.live-card) #ov:has(.tile),
#stage:has(.live-card) #ccp:has(.cc) {
  opacity: 1;
}
#top .clk .h, .prod b, .tile .v span, .ring .rt b, .cc .cv span {
  text-shadow: none;
}

/* Keep the equipment silhouettes and floor structure legible during the spotlight cycle. */
#psvg { --steel: #4f6b7e; }
.flabel, .nd > .nfig, .uchip, .pnas u, .stepbar .sg.done, .cell.off,
.nd.k-na.lit, .nd.k-man.lit, #plant.spotting .nd.lit,
#plant.spotting .nd.k-na.lit, #plant.spotting .nd.k-man.lit {
  opacity: 1;
}
.nd .nfig .ic { stroke-width: 2.6; }
.nd .nfig [fill="currentColor"] { fill-opacity: .13; }
.cell.off { background: var(--off-t); }
.nd.spot {
  border-color: var(--live);
  box-shadow: 0 0 0 2px var(--live), 0 3px 9px var(--shadow);
}
.nd.alarmed.spot { border-color: var(--warn); }
.mtx .mc.on { background: var(--pack-m); border-color: var(--pack); }
.stepbar .sg.cur { border-color: var(--hot); box-shadow: inset 0 -2px var(--hot); }

/* Live cards retain their process colour. Offline equipment gets a dashed edge and a hollow lamp. */
.live-card:has(.st.idle:not([hidden])) { border-style: dashed; border-color: var(--off-m); }
.live-card .st.idle i { background: var(--off-t); box-shadow: inset 0 0 0 1.5px var(--off); }
.live-card .nst.idle .sw { color: var(--off); }
#bdg-link[style*="0.65"] {
  opacity: 1 !important; /* The feed sets opacity inline when unavailable. */
  color: var(--off);
  border-style: dashed;
  background: var(--off-t);
}
#bdg-link[style*="0.65"] b { color: var(--off); }
#bdg-link[style*="0.65"] i { background: var(--off); box-shadow: none; animation: none; }

#stage :focus-visible {
  outline: 3px solid var(--cold);
  outline-offset: 2px;
}
#stage :is(button, select, input) {
  color: var(--text);
  background-color: var(--panel);
  border-color: var(--steel-s);
}
#stage :is(:disabled, [aria-disabled="true"]) {
  color: var(--off);
  background-color: var(--off-t);
  border-color: var(--off-m);
  opacity: 1;
}
