:root {
  --bg: #070c16;
  --bg2: #0b1220;
  --panel: #0e1626;
  --panel2: #111c30;
  --line: #1c2a44;
  --line2: #2b3d63;
  --txt: #dce7f5;
  --mut: #7d93b3;
  --dim: #45597b;
  --cyan: #38bdf8;
  --teal: #2dd4bf;
  --grn: #34d399;
  --amb: #fbbf24;
  --red: #f87171;
  --vio: #a78bfa;
}

body.light {
  --bg: #eef2f8;
  --bg2: #e2e9f4;
  --panel: #ffffff;
  --panel2: #f4f7fc;
  --line: #c6d3e6;
  --line2: #9fb3d1;
  --txt: #16233a;
  --mut: #4a6076;
  --dim: #8296ad;
  --cyan: #0284c7;
  --teal: #0d9488;
  --grn: #059669;
  --amb: #b45309;
  --red: #dc2626;
  --vio: #7c3aed;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
}
.mono, .code-chip, .facility-svg text { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }
.eyebrow { color: var(--teal); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 56px; line-height: 1.02; }
h2 { font-size: 46px; line-height: 1.05; margin-bottom: 24px; }

.landing { display: grid; place-items: center; padding: 24px; overflow: auto; }
.landing-card { width: min(780px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 34px; position: relative; z-index: 1; }
.landing-card p { color: var(--mut); font-size: 22px; line-height: 1.4; }
.landing-card .title-byline { color: var(--dim); font-size: 16px; line-height: 1.2; margin-top: -14px; }
.landing-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 28px 0; }
.landing-actions a, .links-row a {
  color: var(--txt);
  text-decoration: none;
  text-align: center;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
  font-weight: 700;
}
.landing-actions a:hover, .links-row a:hover { border-color: var(--line2); color: var(--cyan); }
.status-strip { color: var(--dim); border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; }

.deck-header, .deck-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  height: 54px;
  background: var(--bg2);
  border-color: var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}
.deck-header { top: 0; border-bottom: 1px solid var(--line); }
.deck-footer { bottom: 0; border-top: 1px solid var(--line); gap: 14px; }
.footer-tele { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn {
  flex: 0 0 auto;
  min-width: 84px;
  height: 34px;
  background: var(--panel2);
  color: var(--txt);
  border: 1px solid var(--line2);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}
.nav-btn:hover { border-color: var(--teal); color: var(--teal); }
.nav-btn:active { transform: scale(.97); }
.brand { font-size: 13px; letter-spacing: .08em; }
.header-right { display: flex; align-items: center; gap: 10px; }
.join-url { color: var(--mut); font-size: 13px; }
.unified-strip {
  position: fixed;
  top: 54px;
  left: 0;
  right: 0;
  height: 28px;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  z-index: 19;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.unified-strip span { display: grid; place-items: center; color: var(--dim); font-size: 12px; border-right: 1px solid var(--line); }
.unified-strip span.active { color: var(--teal); background: var(--panel2); }
body.show-strip .unified-strip { display: grid; }
body.show-strip .slides { padding-top: 82px; }
body.show-strip .slide { height: calc(100vh - 356px); }
body.show-strip.map-focus .slide { height: calc(100vh - 136px); }
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--grn);
  filter: drop-shadow(0 0 4px var(--grn));
  animation: pulse 2s infinite;
}
.code-chip {
  color: var(--amb);
  background: #2a1f08;
  border: 1px solid #5c4308;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.footer-right { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 11px; }
#footerLine { color: var(--dim); font-size: 11px; }
.progress { width: 150px; height: 2px; background: var(--line); display: inline-block; }
.progress span { display: block; height: 100%; background: var(--teal); width: 0; transition: width 240ms ease; }

.slides { position: relative; z-index: 1; height: 100vh; padding: 54px 0; }
.slide {
  display: none;
  height: calc(100vh - 108px);
  padding: 28px 34px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms ease, transform 240ms ease;
}
.slide.active { display: block; opacity: 1; transform: translateY(0); }
.two-col { display: grid; grid-template-columns: minmax(0, 68fr) minmax(330px, 32fr); gap: 18px; height: calc(100% - 78px); }
.diagram-panel {
  width: 100%;
  height: 100%;
  min-height: 320px;
  background: #13213a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  overflow: hidden;
}
body[data-mode="console"] .slides { padding-bottom: 290px; }
body[data-mode="console"] .slide { height: calc(100vh - 344px); }
body[data-mode="console"] .console-hud { display: grid; }
body[data-mode="card"] .console-hud { display: none; }
body.map-focus .console-hud { display: none; }
body.map-focus .slides { padding-bottom: 54px; }
body.map-focus .slide { height: calc(100vh - 108px); }
.console-hud {
  position: fixed;
  left: 34px;
  right: 34px;
  bottom: 54px;
  height: 236px;
  z-index: 18;
  grid-template-columns: 38fr 62fr;
  gap: 12px;
  display: none;
}
.live-status, .live-log { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow: hidden; }
.live-status h3, .live-log h3 { margin: 0 0 8px; color: var(--mut); font-size: 13px; letter-spacing: .08em; }
#statusRows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#statusRows div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; animation: statusJitter 2.7s infinite; }
#statusRows span { color: var(--mut); }
#statusRows b { color: var(--mut); font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }
#statusRows [data-severity="good"] b { color: var(--grn); }
#statusRows [data-severity="warn"] b { color: var(--amb); }
#statusRows [data-severity="bad"] b { color: var(--red); }
#scriptedLog { height: 184px; overflow: hidden auto; font-size: 13px; line-height: 1.5; color: var(--mut); }
#scriptedLog span { color: var(--dim); }
#scriptedLog em { color: var(--txt); font-style: normal; }
#scriptedLog b { border: 1px solid var(--line2); border-radius: 6px; padding: 1px 5px; color: var(--cyan); font-weight: 700; }
#scriptedLog b.broadcast { color: var(--amb); }
#scriptedLog b.multicast { color: var(--vio); }
#scriptedLog b.hardwire { color: var(--red); }
#scriptedLog b.policy { color: var(--grn); }
.diagram-slot { height: 100%; min-height: 360px; }
.bg-diagram { position: absolute; inset: 54px 0; opacity: .86; filter: saturate(.9); z-index: -2; }
.title-scrim { position: absolute; inset: 54px 0; z-index: -1; background: transparent; pointer-events: none; }
.title-block, .join-card { position: relative; z-index: 2; max-width: 900px; margin: 13vh auto 0; text-align: center; }
.title-block p { color: var(--mut); font-size: 24px; }
.title-slide .title-block { max-width: 1100px; margin: 1.2vh auto 0; }
.title-slide h1 { font-size: 44px; line-height: 1.04; margin: 0 auto 8px; max-width: 1050px; white-space: nowrap; }
.title-slide .title-subtitle { max-width: 920px; margin: 0 auto 8px; color: var(--mut); font-size: 20px; }
.title-slide .title-byline { margin: 0; color: var(--dim); font-size: 16px; letter-spacing: .02em; }
.title-slide .title-block { transform: translateY(-28px); }
.title-slide .pm-sense, .title-slide .rel-sense { display: none; }
.title-slide .bg-diagram, .title-slide .title-scrim { inset: 24px 0 54px; }
.title-slide .bg-diagram { transform: translateY(30px); }

@media (min-width: 1600px) and (min-height: 900px) {
  h1 { font-size: 64px; }
  h2 { font-size: 52px; margin-bottom: 28px; }
  .slide { padding: 36px 48px; }
  .title-slide .title-block { max-width: 1240px; }
  .title-slide h1 { font-size: 58px; max-width: 1240px; }
  .title-slide .title-subtitle { font-size: 24px; max-width: 1100px; }
  .title-slide .title-byline { font-size: 18px; }
  .two-col, .ts-layout { gap: 24px; }
  .event-log, .ladder, .path-list, .ts-panel { padding: 24px; }
  .event-log div, .ladder div, .path-list div { font-size: 22px; line-height: 1.45; }
  .reveal-punch, .punch { font-size: 30px; }
  .ladder p { font-size: 23px; }
  .personality-grid, .role-grid, .stack-grid, .media-grid { gap: 20px; }
  .personality-grid article, .role-grid article, .stack-grid article, .media-grid article { padding: 22px; }
  .card-name { font-size: 28px; }
  .personality-grid p { font-size: 25px; }
  .role-grid h3, .stack-grid h3, .media-grid h3 { font-size: 28px; }
  .role-grid p, .stack-grid li, .media-grid p { font-size: 23px; }
  .device-grid { gap: 16px; margin-top: 24px; }
  .device-grid span { padding: 20px; font-size: 22px; }
  .protocol-grid { gap: 20px; }
  .protocol-card { padding: 20px; }
  .protocol-card h3 { font-size: 25px; }
  .protocol-card p { font-size: 20px; }
  .proto-anim { height: 200px; }
  .topology-grid { gap: 16px; }
  .topology-grid article { padding: 18px; min-height: 420px; }
  .topology-grid h3 { font-size: 24px; }
  .topology-grid p { font-size: 20px; }
  .topo-line span { min-height: 46px; font-size: 14px; }
  .packet-circuit-layout { gap: 24px; }
  .packet-captions { gap: 16px; }
  .packet-captions p { padding: 20px; font-size: 28px; }
  .conduit-table { font-size: 20px; }
  .conduit-table div { padding: 12px; }
  .parts-board div { grid-template-columns: 150px 1fr; padding: 12px; font-size: 20px; }
  .symptom { padding: 18px 22px; font-size: 28px; }
  .choice-stack button { min-height: 60px; font-size: 19px; }
  .findings { font-size: 18px; }
  .takeaway { font-size: 23px; }
  .rules { gap: 18px; }
  .rules div { gap: 20px; font-size: 36px; padding: 22px; }
  .rules span { padding: 9px 14px; font-size: 30px; }
  .final-prompt { font-size: 34px; }
  .url { font-size: 40px; }
  .qr { width: 220px; height: 220px; }
}

.event-log, .ladder, .path-list, .ts-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.event-log div, .ladder div, .path-list div { display: none; font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 19px; line-height: 1.55; }
.event-log .shown, .ladder .shown, .path-list .shown, [data-at].shown { display: block; }
.red { color: var(--red); }
.amb { color: var(--amb); }
.grn { color: var(--grn); }
.cyan { color: var(--cyan); }
.dim { color: var(--dim); }
.big { font-size: 22px !important; }
.badge { border: 1px solid var(--line2); border-radius: 6px; padding: 1px 5px; font-size: 12px; }
.badge.unicast { color: var(--cyan); }
.badge.broadcast { color: var(--amb); }
.badge.multicast { color: var(--vio); }
.badge.hardwire { color: var(--red); }
.badge.policy { color: var(--grn); }
.reveal-punch, .punch { color: var(--txt); font-size: 26px; line-height: 1.3; margin-top: 18px; }
.ladder p { color: var(--mut); font-size: 20px; line-height: 1.4; margin-top: 22px; }

.personality-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.personality-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; border-left-width: 3px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.edge-cyan { border-left-color: var(--cyan) !important; }
.edge-amb { border-left-color: var(--amb) !important; }
.edge-teal { border-left-color: var(--teal) !important; }
.card-name { font-size: 24px; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chips span, .pill { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 13px; }
.bars div { margin: 12px 0; }
.bars span { display: block; font-size: 16px; color: var(--mut); margin-bottom: 5px; }
.bars b { display: block; height: 6px; background: var(--line); }
.bars i { display: block; height: 100%; background: var(--teal); }
.personality-grid p { font-size: 22px; color: var(--mut); }
.role-grid, .stack-grid, .media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stack-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.role-grid article, .stack-grid article, .media-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.role-grid h3, .stack-grid h3, .media-grid h3 { color: var(--teal); font-size: 24px; margin: 0 0 12px; }
.role-grid p, .stack-grid li, .media-grid p { color: var(--mut); font-size: 21px; line-height: 1.35; }
.stack-grid .noip { color: var(--red); font-weight: 700; }
.device-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.device-grid span { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; font-size: 19px; color: var(--txt); text-align: center; }
.protocol-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.protocol-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.protocol-card h3 { color: var(--teal); font-size: 20px; margin: 0 0 10px; }
.protocol-card p { color: var(--mut); font-size: 17px; line-height: 1.35; margin: 10px 0 0; }
.proto-anim { width: 100%; height: 150px; background: #13213a; border: 1px solid var(--line); border-radius: 8px; display: block; }
.proto-anim .box { fill: #1b2b49; stroke: #5f78ad; stroke-width: 1.8; rx: 6; }
.proto-anim .lbl { fill: #f3f8ff; font-size: 13px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.proto-anim .wire { fill: none; stroke: #5f78ad; stroke-width: 3; }
.proto-anim .ring { fill: none; stroke: #3a5180; stroke-width: 3; }
.proto-anim .pulse { fill: #38bdf8; filter: drop-shadow(0 0 6px currentColor); }
.proto-anim .chip { fill: #b7c8e7; font-size: 11px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #13213a; stroke-width: 4; opacity: .8; }
.modbus-anim .resp-pulse { fill: #34d399; }
.token-anim .token-pulse { fill: #fbbf24; }
.token-anim .box { animation: protoFlash 4s infinite; }
.token-anim .tok-a .box { animation-delay: 0s; }
.token-anim .tok-b .box { animation-delay: 1s; }
.token-anim .tok-c .box { animation-delay: 2s; }
.token-anim .tok-d .box { animation-delay: 3s; }
.ethercat-anim .return-pulse { fill: #34d399; }
.ethercat-anim .ec-return { stroke-dasharray: 4 4; }
.ethercat-anim .box { animation: protoFlash 2.6s infinite; }
.ethercat-anim .ec-master .box { animation-delay: 0s; }
.ethercat-anim .ec-d1 .box { animation-delay: .5s; }
.ethercat-anim .ec-d2 .box { animation-delay: 1.3s; }
.ethercat-anim .ec-d3 .box { animation-delay: 2.1s; }
.opcua-anim .notify-wire { stroke-dasharray: 4 4; opacity: .6; }
.opcua-anim .notify-pulse, .opcua-anim .notify-pulse-2 { fill: #34d399; }
.opcua-anim .value-dot { fill: #5f78ad; animation: valueChange 6s infinite; }
@keyframes protoFlash { 0%, 85%, 100% { stroke: #5f78ad; } 8% { stroke: #34d399; } }
@keyframes valueChange { 0%, 28%, 65%, 100% { fill: #5f78ad; } 33%, 70% { fill: #fbbf24; } }
.proto-anim .xmark { fill: none; stroke: #f87171; stroke-width: 3; stroke-linecap: round; }
.traffic-grid article, .rolemap-grid article { padding-bottom: 14px; }
.traffic-anim .wire.lit { stroke: #38bdf8; stroke-width: 4; }
.traffic-anim .recv.dim .box, .traffic-anim .recv.not-subbed .box { opacity: .4; stroke: #3a5180; }
.traffic-anim .recv.dim .lbl, .traffic-anim .recv.not-subbed .lbl { opacity: .5; }
.pollevent-anim .poll-pulse-1, .pollevent-anim .poll-pulse-2, .pollevent-anim .poll-pulse-3 { fill: #38bdf8; }
.pollevent-anim .event-pulse { fill: #fbbf24; }
.pollevent-anim .event-wire { opacity: .5; }
.clientserver-anim .resp-pulse { fill: #34d399; }
.clientserver-anim .blocked-chip { fill: #f87171; opacity: .85; }
.masterslave-anim .bus-line { stroke-width: 4; }
.masterslave-anim .token-pulse { fill: #fbbf24; }
.p2p-anim .read-pulse { animation: p2pShowA 4s infinite; }
.p2p-anim .resp-pulse { fill: #34d399; animation: p2pShowB 4s infinite; }
.pubsub-anim .topic-node .box { stroke: #fbbf24; }
@keyframes p2pShowA { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes p2pShowB { 0%, 49% { opacity: 0; } 50%, 99% { opacity: 1; } 100% { opacity: 0; } }
.topology-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.topology-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-height: 340px; display: flex; flex-direction: column; }
.topology-grid h3 { color: var(--teal); font-size: 20px; margin: 0 0 12px; }
.topology-grid p { color: var(--mut); font-size: 17px; line-height: 1.34; margin: 14px 0 0; }
.topo-line { display: grid; gap: 7px; align-content: start; flex: 1; }
.topo-line span { min-height: 38px; display: grid; place-items: center; border: 1px solid var(--line2); border-radius: 6px; background: #13213a; color: var(--txt); font-size: 12px; text-align: center; padding: 5px; }
.topo-line i { width: 2px; height: 15px; background: var(--cyan); justify-self: center; opacity: .85; }
.topology-demo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.topology-demo { min-width: 0; height: 304px; background: rgba(14, 22, 38, .84); border: 1px solid var(--line); border-radius: 10px; padding: 11px; overflow: hidden; }
.demo-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--teal); font: 700 11px Consolas, "Cascadia Mono", ui-monospace, monospace; letter-spacing: .04em; }
.demo-heading b { color: var(--amb); border: 1px solid #5c4308; border-radius: 5px; padding: 3px 5px; font-size: 9px; white-space: nowrap; }
.demo-stage { position: relative; height: 177px; overflow: hidden; background: #0b1425; border: 1px solid var(--line); border-radius: 7px; }
.demo-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(56, 189, 248, .035), transparent 45%); }
.demo-node { position: absolute; z-index: 2; height: 34px; display: grid; place-items: center; align-content: center; padding: 3px 4px; background: #162642; border: 1px solid #5f78ad; border-radius: 5px; color: var(--txt); font: 700 10px Consolas, "Cascadia Mono", ui-monospace, monospace; text-align: center; line-height: 1.1; box-shadow: 4px 4px 0 rgba(6, 11, 21, .3); }
.demo-node small { display: block; color: var(--mut); font: 500 8px Consolas, "Cascadia Mono", ui-monospace, monospace; white-space: nowrap; }
.demo-wire { position: absolute; z-index: 1; background: #5f78ad; opacity: .9; }
.demo-wire-h { height: 2px; }
.demo-wire-v { width: 2px; }
.demo-packet { position: absolute; z-index: 3; display: block; width: 7px; height: 7px; border-radius: 50%; top: 50%; left: 0; transform: translate(-50%, -50%); filter: drop-shadow(0 0 6px currentColor); color: var(--cyan); background: currentColor; animation: demoTravelH 2.8s linear infinite; }
.demo-wire-v .demo-packet { top: 0; left: 50%; animation-name: demoTravelV; }
.demo-packet.second { animation-delay: 1.35s; }
.packet-cyan { color: var(--cyan); }
.packet-green { color: var(--grn); animation-name: demoTravelHBack; }
.packet-amber { color: var(--amb); }
.packet-violet { color: var(--vio); }
.demo-chip, .demo-label { position: absolute; z-index: 4; color: var(--mut); font: 700 8px Consolas, "Cascadia Mono", ui-monospace, monospace; text-align: center; letter-spacing: .02em; }
.demo-chip { left: 5%; right: 5%; bottom: 8px; border: 1px solid var(--line2); border-radius: 4px; padding: 4px; background: rgba(11, 20, 37, .88); }
.demo-label { left: 5%; right: 5%; bottom: 8px; }
.demo-caption { min-height: 55px; margin: 8px 1px 0; color: var(--mut); font-size: 12px; line-height: 1.28; }
.demo-caption b { color: var(--txt); }

.flat-supervisor { left: 3%; top: 25px; width: 29%; }
.flat-switch { left: 36%; top: 25px; width: 28%; }
.flat-controller-a { left: 70%; top: 8px; width: 27%; }
.flat-controller-b { left: 70%; top: 105px; width: 27%; }
.flat-link-a { left: 32%; top: 42px; width: 4%; }
.flat-link-b { left: 64%; top: 42px; width: 7%; }
.flat-branch { left: 84%; top: 25px; height: 97px; }
.flat-branch-a { left: 84%; top: 25px; width: 3%; }
.flat-branch-b { left: 84%; top: 122px; width: 3%; }

.routed-supervisor, .routed-bbmd-a, .routed-router, .routed-bbmd-b, .routed-controller { top: 54px; width: 17%; }
.routed-supervisor { left: 1%; }
.routed-bbmd-a { left: 21%; }
.routed-router { left: 41%; }
.routed-bbmd-b { left: 61%; }
.routed-controller { left: 81%; }
.routed-link-a, .routed-link-b, .routed-link-c, .routed-link-d { top: 70px; width: 3%; }
.routed-link-a { left: 18%; }
.routed-link-b { left: 38%; }
.routed-link-c { left: 58%; }
.routed-link-d { left: 78%; }
.routed-link-d .demo-packet { animation-name: demoTravelHBack; }
.routed-chip { bottom: 8px; }

.mstp-supervisor { left: 3%; top: 13px; width: 30%; }
.mstp-router { left: 37%; top: 13px; width: 30%; }
.mstp-ip-link { left: 33%; top: 30px; width: 4%; }
.mstp-bus { left: 16%; top: 91px; width: 68%; height: 3px; }
.mstp-controller-a, .mstp-controller-b, .mstp-controller-c { top: 112px; width: 25%; }
.mstp-controller-a { left: 3%; }
.mstp-controller-b { left: 37%; }
.mstp-controller-c { left: 71%; }
.mstp-bus::before, .mstp-bus::after { content: ""; position: absolute; top: 0; width: 2px; height: 21px; background: #5f78ad; }
.mstp-bus::before { left: 10%; }
.mstp-bus::after { right: 10%; }
.mstp-bus .second { animation-delay: 1.1s; }
.mstp-label { bottom: 8px; }

.ethernet-supervisor { left: 3%; top: 70px; width: 29%; }
.ethernet-segment { left: 32%; top: 87px; width: 6%; height: 3px; }
.ethernet-segment-box { left: 38%; top: 70px; width: 28%; }
.ethernet-device-a, .ethernet-device-b { left: 72%; width: 25%; }
.ethernet-device-a { top: 35px; }
.ethernet-device-b { top: 109px; }
.ethernet-trunk { left: 68%; top: 52px; height: 74px; }
.ethernet-branch-a, .ethernet-branch-b { left: 68%; width: 4%; }
.ethernet-branch-a { top: 52px; }
.ethernet-branch-b { top: 126px; }
.ethernet-segment .second { animation-delay: 1.2s; }
.ethernet-chip { bottom: 8px; }

.mixed-supervisor { left: 3%; top: 13px; width: 28%; }
.mixed-switch { left: 36%; top: 13px; width: 28%; }
.mixed-router { left: 36%; top: 91px; width: 28%; }
.mixed-link-a { left: 31%; top: 30px; width: 5%; }
.mixed-link-b { left: 50%; top: 47px; height: 44px; }
.mixed-bus { left: 16%; top: 142px; width: 68%; height: 3px; }
.mixed-device-a, .mixed-device-b { top: 119px; width: 25%; }
.mixed-device-a { left: 3%; }
.mixed-device-b { left: 72%; }
.mixed-bus::before, .mixed-bus::after { content: ""; position: absolute; top: 0; width: 2px; height: 21px; background: #5f78ad; }
.mixed-bus::before { left: 10%; }
.mixed-bus::after { right: 10%; }
.mixed-label { bottom: 8px; }

@keyframes demoTravelH { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes demoTravelHBack { 0% { left: 100%; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { left: 0; opacity: 0; } }
@keyframes demoTravelV { 0% { top: 0; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.packet-circuit-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(360px, .85fr); gap: 18px; height: calc(100% - 78px); }
.packet-circuit { width: 100%; height: 100%; min-height: 360px; background: #13213a; border: 1px solid var(--line); border-radius: 10px; }
.packet-circuit .frame { fill: #13213a; stroke: #3a5180; }
.packet-circuit .box { fill: #1b2b49; stroke: #5f78ad; stroke-width: 2; rx: 6; }
.packet-circuit .lbl { fill: #f3f8ff; font-size: 22px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.packet-circuit .sub { fill: #b7c8e7; font-size: 13px; text-anchor: middle; }
.packet-circuit .wire { fill: none; stroke: #5f78ad; stroke-width: 5; }
.packet-circuit .wire-out { stroke: #38bdf8; }
.packet-circuit .wire-back { stroke: #5f78ad; opacity: .55; }
.packet-circuit .arrow-head { fill: none; stroke: #38bdf8; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.packet-circuit .arrow-head.back { stroke: #5f78ad; opacity: .55; }
.packet-circuit .field-tags text { opacity: 0; fill: #fbbf24; font-size: 13px; font-weight: 700; paint-order: stroke; stroke: #13213a; stroke-width: 4; }
.packet-circuit .pulse { display: none; fill: #38bdf8; filter: drop-shadow(0 0 8px currentColor); }
.packet-circuit .udp-pulse, .packet-circuit .timeout-pulse { color: #fbbf24; fill: #fbbf24; }
.packet-circuit .tcp-synack { color: #34d399; fill: #34d399; }
.packet-circuit .tcp-data { color: #38bdf8; fill: #38bdf8; }
.packet-circuit .chip { display: none; fill: #fbbf24; font-size: 15px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #13213a; stroke-width: 5; }
.packet-circuit .timeout { fill: #f87171; animation: blinkFast .9s infinite; }
.packet-circuit .timeout-ring { display: none; fill: none; stroke: #f87171; stroke-width: 4; filter: drop-shadow(0 0 6px #f87171); }
.packet-circuit.step-2 .field-tags text { opacity: 1; }
.packet-circuit.step-3 .udp-pulse { display: block; }
.packet-circuit.step-4 .tcp-syn, .packet-circuit.step-4 .tcp-synack, .packet-circuit.step-4 .tcp-ack, .packet-circuit.step-4 .tcp-data { display: block; }
.packet-circuit.step-4 .wire-back { stroke: #34d399; opacity: 1; }
.packet-circuit.step-4 .arrow-head.back { stroke: #34d399; opacity: 1; }
.packet-circuit.step-4 .syn, .packet-circuit.step-4 .synack, .packet-circuit.step-4 .ack, .packet-circuit.step-4 .data { display: block; }
.packet-circuit.step-5 .timeout-pulse, .packet-circuit.step-5 .timeout, .packet-circuit.step-5 .timeout-ring { display: block; }
.packet-circuit.step-5 .wire-back, .packet-circuit.step-5 .arrow-head.back { stroke: #f87171; opacity: .2; }
.packet-captions { display: grid; align-content: center; gap: 12px; }
.packet-captions p { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: var(--txt); font-size: 23px; line-height: 1.3; }
.packet-captions p.shown { display: block; }
.conduit-table { display: grid; gap: 8px; font-size: 16px; }
.conduit-table div { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.conduit-table div[data-at] { display: none; }
.conduit-table div[data-at].shown { display: grid; }
.conduit-table b { color: var(--teal); }
.conduit-table span { color: var(--txt); }
.parts-board { display: grid; gap: 8px; }
.parts-board div { display: none; grid-template-columns: 120px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 9px; }
.parts-board div.shown { display: grid; }
.parts-board b { color: var(--teal); }
.parts-board span { color: var(--txt); }
.strap { margin-top: 24px; font-size: 24px; color: var(--txt); }
.strap.small { font-size: 22px; }
.pill.grn { color: var(--grn); }
.pill.cyan { color: var(--cyan); }
.pill.dim { color: var(--dim); }
.pill.red { color: var(--red); }
.final-prompt { color: var(--txt); font-size: 28px; text-align: center; margin: 18px auto 24px; max-width: 900px; }

.symptom {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amb);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 24px;
  margin-bottom: 14px;
}
.ts-layout { display: grid; grid-template-columns: minmax(0, 62fr) minmax(330px, 38fr); gap: 18px; height: calc(100% - 74px); }
.choice-stack { display: grid; gap: 10px; }
.choice-stack button {
  min-height: 50px;
  text-align: left;
  background: var(--panel2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
  font-size: 16px;
}
.choice-stack button span { color: var(--teal); margin-right: 10px; }
.choice-stack button.picked { border-color: var(--line2); }
.choice-stack button.root { border-color: var(--grn); color: var(--grn); }
.findings { margin-top: 14px; min-height: 110px; color: var(--mut); font-size: 16px; line-height: 1.45; }
.findings .root { color: var(--grn); }
.findings .danger { color: var(--red); }
.takeaway { display: none; color: var(--teal); font-size: 20px; line-height: 1.35; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.takeaway.shown { display: block; }

.counter { position: absolute; right: 40px; top: 104px; z-index: 3; color: var(--amb); background: #2a1f08; border: 1px solid #5c4308; border-radius: 6px; padding: 8px 10px; }
.rules { display: grid; gap: 14px; }
.rules div { display: none; align-items: center; gap: 16px; font-size: 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.rules div.shown { display: flex; }
.rules span { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; background: var(--teal); color: #071016; padding: 7px 12px; border-radius: 6px; font-size: 24px; }
.join-card { display: grid; place-items: center; gap: 20px; }
.url { font-size: 34px; color: var(--cyan); }
.qr { width: 180px; height: 180px; border: 1px solid var(--line2); display: grid; place-items: center; color: var(--dim); position: relative; }
.qr img { width: 100%; height: 100%; object-fit: contain; opacity: .18; grid-area: 1 / 1; }
.qr span { grid-area: 1 / 1; }
.blank { position: fixed; inset: 0; background: #000; z-index: 100; }
.countdown-ring {
  --pct: 0deg;
  position: fixed;
  right: 34px;
  bottom: 272px;
  width: 104px;
  height: 104px;
  z-index: 31;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) var(--pct), var(--line) 0);
}
.countdown-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel); }
.countdown-ring span { position: relative; font-size: 26px; color: var(--txt); }

.facility-svg { width: 100%; height: 100%; display: block; background: #13213a; }
.facility-svg .frame { fill: #13213a; stroke: #3a5180; }
.facility-svg .node, .facility-svg .switch, .facility-svg .enode { isolation: isolate; }
.facility-svg .box-shadow { fill: rgba(4, 10, 20, 0.18); }
.facility-svg .box-top { fill: #20324f; opacity: 0.78; }
.facility-svg .box-side { fill: #15243a; opacity: 0.82; }
.facility-svg .box { fill: #1b2b49; stroke: #738ab8; stroke-width: 1.8; rx: 6; filter: drop-shadow(0 3px 5px rgba(3, 7, 16, 0.16)); }
.facility-svg .lbl { fill: #f3f8ff; font-size: 15px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.facility-svg .sub, .facility-svg .tiny { fill: #b7c8e7; font-size: 11px; text-anchor: middle; }
.facility-svg .dot { fill: #34d399; animation: pulse 2s infinite; filter: drop-shadow(0 0 7px currentColor); color: #34d399; }
.facility-svg .lnk, .facility-svg .eline { fill: none; stroke: #5f78ad; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.facility-svg .electrical-links { opacity: .72; }
.facility-svg .feeder-line { stroke: #c7d7ef; stroke-width: 2.2; stroke-dasharray: 9 5; }
.facility-svg .pm-sense, .facility-svg .rel-sense { stroke: #38bdf8; stroke-width: 2.2; }
.facility-svg .epms-backbone { stroke: #38bdf8; stroke-width: 2.5; }
.facility-svg .bus { fill: #c7d7ef; }
.facility-svg .breaker { fill: #1b2b49; stroke: #c7d7ef; stroke-width: 2.3; }
.facility-svg .zone { fill: rgba(27, 43, 73, .22); stroke: #6f8ac1; stroke-dasharray: 6 6; stroke-width: 1.8; rx: 10; filter: drop-shadow(0 4px 10px rgba(4, 10, 20, 0.14)); }
.facility-svg .subzone { fill: rgba(19, 33, 58, .42); stroke: #7c95ca; stroke-dasharray: 3 5; stroke-width: 1.2; rx: 8; }
.facility-svg .zone-label { fill: #c7d7ef; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.facility-svg .proto-label { fill: #8fa7d2; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-anchor: end; }
.facility-svg .sense { fill: none; stroke: #8da3cf; stroke-dasharray: 4 4; stroke-width: 1.8; }
.facility-svg .chip { display: none; fill: #fbbf24; font-size: 11px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #13213a; stroke-width: 4; }
.facility-svg .xmark { display: none; fill: none; stroke: #f87171; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 5px #f87171); }
.facility-svg .pkt { display: none; fill: #38bdf8; filter: drop-shadow(0 0 8px currentColor); }
.facility-svg .pkt-feeder { fill: #c7d7ef; }
.facility-svg .pkt-feeder-return { fill: #a7f3d0; }
.facility-svg .pkt-modbus-return, .facility-svg .pkt-modbus-sense, .facility-svg .pkt-modbus-sense-return { fill: #67e8f9; }
.facility-svg .pkt-bacnet-return, .facility-svg .pkt-bbmd-return { fill: #60a5fa; }
.facility-svg .pkt-rio-return { fill: #fcd34d; }
.facility-svg .pkt-hmi-return { fill: #7dd3fc; }
.facility-svg .pkt-hist-return { fill: #cbd5e1; }
.facility-svg .node-icon { pointer-events: none; opacity: 0.6; }
.facility-svg .icon-panel { fill: rgba(7, 15, 28, 0.48); stroke: rgba(151, 176, 219, 0.22); stroke-width: 1; }
.facility-svg .icon-line { stroke: rgba(210, 226, 252, 0.54); stroke-width: 1.2; stroke-linecap: round; }
.facility-svg .icon-accent { stroke: #f59e0b; stroke-width: 2.2; stroke-linecap: round; }
.facility-svg .icon-port { fill: rgba(10, 18, 32, 0.62); stroke: rgba(197, 215, 239, 0.28); stroke-width: 1; }
.facility-svg .icon-led { fill: #34d399; filter: drop-shadow(0 0 3px rgba(52, 211, 153, 0.45)); }
.facility-svg .icon-led-warn { fill: #fbbf24; filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.45)); }
.facility-svg .icon-screen { fill: rgba(10, 20, 36, 0.62); stroke: rgba(180, 204, 240, 0.36); stroke-width: 1.1; }
.facility-svg .icon-stand { stroke: rgba(197, 215, 239, 0.56); stroke-width: 1.3; stroke-linecap: round; }
.facility-svg .icon-cylinder-top { fill: rgba(87, 130, 196, 0.24); stroke: rgba(197, 215, 239, 0.3); stroke-width: 1; }
.facility-svg .icon-cylinder-body { fill: rgba(14, 26, 44, 0.22); stroke: rgba(197, 215, 239, 0.24); stroke-width: 1; }
.facility-svg .icon-cylinder-mid { fill: none; stroke: rgba(197, 215, 239, 0.18); stroke-width: 1; }
.facility-svg .icon-meter-ring { fill: none; stroke: rgba(197, 215, 239, 0.5); stroke-width: 1.3; }
.facility-svg .pkt-rio { fill: #fbbf24; }
.facility-svg .pkt-purple { fill: #a78bfa; color: #a78bfa; }
.facility-svg .pkt-purple-return { fill: #c4b5fd; color: #c4b5fd; }
.facility-svg .pkt-bcast { fill: #a78bfa; }
.facility-svg .pkt-bbmd { fill: #38bdf8; }
.facility-svg .pkt-hist { fill: #9fb3d1; }
.facility-svg .vnd, .facility-svg .vnd-line, .facility-svg .ntp-lines { display: none; }
.facility-svg.st-normal .pkt-feeder, .facility-svg.st-normal .pkt-feeder-return,
.facility-svg.st-normal .pkt-modbus, .facility-svg.st-normal .pkt-modbus-return,
.facility-svg.st-normal .pkt-modbus-sense, .facility-svg.st-normal .pkt-modbus-sense-return,
.facility-svg.st-normal .pkt-bacnet, .facility-svg.st-normal .pkt-bacnet-return,
.facility-svg.st-normal .pkt-bcast, .facility-svg.st-normal .pkt-bbmd, .facility-svg.st-normal .pkt-bbmd-return,
.facility-svg.st-normal .pkt-purple, .facility-svg.st-normal .pkt-purple-return,
.facility-svg.st-normal .pkt-rio, .facility-svg.st-normal .pkt-rio-return,
.facility-svg.st-normal .pkt-hmi, .facility-svg.st-normal .pkt-hmi-return,
.facility-svg.st-normal .pkt-hist, .facility-svg.st-normal .pkt-hist-return { display: block; }
.facility-svg.st-feeder.step-1 #n-rel07 .box, .facility-svg.st-feeder.step-1 .rel-sense { stroke: #f87171; animation: blinkFast .9s infinite; }
.facility-svg.st-feeder.step-2 #n-bkr-b, .facility-svg.st-feeder.step-2 #n-util-b .box, .facility-svg.st-feeder.step-2 .l-util-b { stroke: #f87171; opacity: .8; animation: blinkFast .9s infinite; }
.facility-svg.st-feeder.step-3 #n-epms01 .box, .facility-svg.st-feeder.step-3 #n-gw02 .box { stroke: #fbbf24; animation: blinkAmb 1.4s infinite; }
.facility-svg.st-feeder.step-3 .alarm14 { display: block; }
.facility-svg.st-feeder.step-4 #n-plc04 .box, .facility-svg.st-feeder.step-4 #n-gen .box, .facility-svg.st-feeder.step-4 #n-ats { stroke: #fbbf24; animation: blinkAmb 1.4s infinite; }
.facility-svg.st-feeder.step-4 .pkt-rio { display: block; }
.facility-svg.st-feeder.step-5 #n-bms01 .box { stroke: #fbbf24; animation: blinkAmb 1.4s infinite; }
.facility-svg.st-feeder.step-5 .alarm23 { display: block; }
.facility-svg.st-feeder-good .node .box, .facility-svg.st-feeder-good .lnk { stroke: #34d399; }
.facility-svg.st-feeder-good .node .dot { fill: #34d399; }
.facility-svg.st-feeder-good #n-bkr-b { stroke: #f87171; }
.facility-svg.st-feeder-good #n-gen .box, .facility-svg.st-feeder-good #n-ats { stroke: #34d399; animation: pulse 2s infinite; }
.facility-svg.st-modbus .node:not(#n-epms01):not(#n-sw-epms):not(#n-gw02):not(#n-pm21):not(#n-fw), .facility-svg.st-modbus .lnk:not(.epms-chain) { opacity: .46; }
.facility-svg.st-modbus .epms-chain, .facility-svg.st-modbus .fw-core { stroke: #38bdf8; }
.facility-svg.st-modbus .pkt-modbus, .facility-svg.st-modbus .pkt-modbus-return,
.facility-svg.st-modbus .pkt-modbus-sense, .facility-svg.st-modbus .pkt-modbus-sense-return { display: block; }
.facility-svg.st-bacnet .node:not(#n-bms01):not(#n-bbmd):not(#n-sw-bms):not(#n-b12):not(#n-core), .facility-svg.st-bacnet .lnk:not(.bms-chain):not(.core-bus) { opacity: .46; }
.facility-svg.st-bacnet .bms-chain, .facility-svg.st-bacnet .core-bus { stroke: #38bdf8; }
.facility-svg.st-bacnet .pkt-bacnet, .facility-svg.st-bacnet .pkt-bacnet-return, .facility-svg.st-bacnet .pkt-bcast { display: block; }
.facility-svg.st-bcast-wall .node:not(#n-bms01):not(#n-bbmd):not(#n-core):not(#n-sw-bms), .facility-svg.st-bcast-wall .lnk:not(.bms-chain):not(.core-bus) { opacity: .46; }
.facility-svg.st-bcast-wall .pkt-bcast, .facility-svg.st-bcast-wall .xmark, .facility-svg.st-bcast-wall .bcastdrop { display: block; }
.facility-svg.st-bcast-wall .bms-chain, .facility-svg.st-bcast-wall .core-bus { stroke: #fbbf24; }
.facility-svg.st-bbmd .pkt-bcast, .facility-svg.st-bbmd .pkt-bbmd, .facility-svg.st-bbmd .pkt-bbmd-return { display: block; }
.facility-svg.st-bbmd.step-1 .bms-chain { stroke: #fbbf24; }
.facility-svg.st-bbmd.step-2 .xmark, .facility-svg.st-bbmd.step-2 .bcastdrop { display: block; }
.facility-svg.st-bbmd.step-3 .bbmd-forward { stroke: #38bdf8; stroke-width: 3; }
.facility-svg.st-bbmd.step-3 .xmark, .facility-svg.st-bbmd.step-4 .xmark, .facility-svg.st-bbmd.step-5 .xmark { display: none; }
.facility-svg.st-bbmd.step-4 #n-bbmd2 .box, .facility-svg.st-bbmd.step-4 #n-bacrtr .box, .facility-svg.st-bbmd.step-4 #n-b12 .box, .facility-svg.st-bbmd.step-4 .bbmd2-router, .facility-svg.st-bbmd.step-4 .router-b12 { stroke: #34d399; }
.facility-svg.st-bbmd.step-5 .bms-chain, .facility-svg.st-bbmd.step-5 .bbmd-forward, .facility-svg.st-bbmd.step-5 .bbmd2-router, .facility-svg.st-bbmd.step-5 .router-b12 { stroke: #34d399; }
.facility-svg.st-bbmd-fail #n-bbmd2 .box { stroke: #8da3cf; fill: #13213a; }
.facility-svg.st-bbmd-fail .bbmdfail { display: block; fill: #fbbf24; }
.facility-svg.st-arp #n-bms01 .box, .facility-svg.st-arp #n-b12 .box { stroke: #fbbf24; }
.facility-svg.st-goose #n-rel07 .box, .facility-svg.st-goose .rel-sense { stroke: #a78bfa; }
.facility-svg.st-plcpaths .node:not(#n-plc04):not(#n-rio04):not(#n-hmi04):not(#n-hist01):not(#n-sw-plc), .facility-svg.st-plcpaths .lnk:not(.plc-chain):not(.hmi-hist):not(.lnk-control):not(.hmi-link) { opacity: .46; }
.facility-svg.st-plcpaths .lnk-control { stroke: #34d399; stroke-width: 3.5; }
.facility-svg.st-plcpaths .hmi-link, .facility-svg.st-plcpaths .hmi-hist { stroke: #38bdf8; }
.facility-svg.st-plcpaths .pkt-rio, .facility-svg.st-plcpaths .pkt-rio-return,
.facility-svg.st-plcpaths .pkt-hmi, .facility-svg.st-plcpaths .pkt-hmi-return,
.facility-svg.st-plcpaths .pkt-hist, .facility-svg.st-plcpaths .pkt-hist-return { display: block; }
.facility-svg.st-ts1 #n-bms01 .box { stroke: #fbbf24; animation: blinkAmb 1.4s infinite; }
.facility-svg.st-ts1 .pkt-bcast, .facility-svg.st-ts1 .xmark, .facility-svg.st-ts1 .bcastdrop { display: block; }
.facility-svg.st-ts2 #n-epms01 .box, .facility-svg.st-ts2 #n-gw02 .box { stroke: #fbbf24; animation: blinkAmb 1.4s infinite; }
.facility-svg.st-ts2 .stale-epms, .facility-svg.st-ts2 .x-gw { display: block; }
.facility-svg.st-ts3 #n-hmi04 .box, .facility-svg.st-ts3 #n-hmi04 text { stroke: #9fb3d1; fill: #9fb3d1; }
.facility-svg.st-ts3 .hmi-link { stroke: #f87171; animation: blinkFast .9s infinite; }
.facility-svg.st-ts3 .stale-hmi, .facility-svg.st-ts3 .x-hmi, .facility-svg.st-ts3 .pkt-rio { display: block; }
.facility-svg.st-ts4 .ntp-lines, .facility-svg.st-ts4 .timechip { display: block; }
.facility-svg.st-ts4 #n-epms01 .box, .facility-svg.st-ts4 #n-bms01 .box, .facility-svg.st-ts4 #n-hist01 .box { stroke: #fbbf24; }
.facility-svg.resolved .xmark, .facility-svg.resolved .chip, .facility-svg.resolved .ntp-lines { display: none !important; }
.facility-svg.resolved .box { stroke: #34d399 !important; animation: none !important; }
.facility-svg.st-flat .zone, .facility-svg.st-flat .zone-label { display: none; }
.facility-svg.st-flat .vnd, .facility-svg.st-flat .vnd-line, .facility-svg.st-seg .vnd, .facility-svg.st-seg .vnd-line { display: block; }
.facility-svg.st-flat #n-fw .box { stroke: #9fb3d1; }
.facility-svg.st-flat #n-fw .lbl { fill: #9fb3d1; }
.facility-svg.st-flat.attack .node .box, .facility-svg.st-flat.attack .lnk { animation: infect .4s forwards; }
.facility-svg.st-flat.attack #n-vnd .box { animation-delay: 0s; }
.facility-svg.st-flat.attack #n-ent .box { animation-delay: .3s; }
.facility-svg.st-flat.attack #n-core .box { animation-delay: .8s; }
.facility-svg.st-flat.attack .switch .box { animation-delay: 1.2s; }
.facility-svg.st-flat.attack .zone-links .lnk { animation-delay: 1.4s; }
.facility-svg.st-flat.attack #n-bms01 .box, .facility-svg.st-flat.attack #n-bbmd .box, .facility-svg.st-flat.attack #n-b12 .box, .facility-svg.st-flat.attack #n-plc04 .box, .facility-svg.st-flat.attack #n-rio04 .box, .facility-svg.st-flat.attack #n-hmi04 .box, .facility-svg.st-flat.attack #n-hist01 .box, .facility-svg.st-flat.attack #n-epms01 .box, .facility-svg.st-flat.attack #n-gw02 .box, .facility-svg.st-flat.attack #n-pm21 .box, .facility-svg.st-flat.attack #n-rel07 .box { animation-delay: 1.8s; }
.facility-svg.st-seg .zone { stroke: #2dd4bf; stroke-width: 2; }
.facility-svg.st-seg.attack #n-vnd .box, .facility-svg.st-seg.attack #n-ent .box, .facility-svg.st-seg.attack #n-dmz .box { animation: infect .4s forwards; }
.facility-svg.st-seg.attack #n-fw .box { stroke: #34d399; animation: pulse 2s infinite; }
.facility-svg.st-seg.attack .blocked { display: block; }
.facility-svg.st-seg.attack .dmz-fw { stroke: #f87171; }
.facility-svg.st-conduit .lnk { opacity: .45; }
.facility-svg.st-conduit.step-1 .bms-chain, .facility-svg.st-conduit.step-2 .epms-chain, .facility-svg.st-conduit.step-3 .lnk-control, .facility-svg.st-conduit.step-4 .dmz-fw { opacity: 1; stroke: #34d399; stroke-width: 3; }
.facility-svg.booting .node { opacity: 0; animation: bootNode .45s forwards; }
.facility-svg.booting .node:nth-of-type(2) { animation-delay: .06s; }
.facility-svg.booting .node:nth-of-type(3) { animation-delay: .12s; }
.facility-svg.booting .node:nth-of-type(4) { animation-delay: .18s; }
.facility-svg.booting .node:nth-of-type(5) { animation-delay: .24s; }

.audience { overflow: auto; }
.audience-main { position: relative; z-index: 1; padding: 76px 14px 76px; max-width: 980px; margin: 0 auto; }
.instruction { color: var(--mut); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.scenario-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scenario-grid button {
  min-height: 56px;
  background: var(--panel2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  padding: 10px;
}
.scenario-grid button.active { border-color: var(--teal); color: var(--teal); }
.scenario-grid .lab-code-button { border-color: var(--teal); }
.scenario-grid span { display: block; font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-weight: 700; }
.scenario-grid small { color: var(--mut); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tabbar {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 56px;
  background: var(--bg2);
  border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; color: var(--mut); border: 0; border-top: 2px solid transparent; font-weight: 700; }
.tabbar button b { font-size: 13px; letter-spacing: .04em; }
.tabbar button small { font-size: 9px; font-weight: 400; color: var(--dim); letter-spacing: .02em; }
.tabbar button.active { color: var(--teal); background: var(--panel2); border-top-color: var(--teal); }
.tabbar button.active small { color: var(--teal); }
.now-blurb, .explore-help { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; color: var(--mut); }
.now-blurb b { display: block; color: var(--txt); margin-bottom: 4px; }
.ref-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 10px 0; }
.ref-strip span { padding: 10px; text-align: center; background: var(--panel); color: var(--mut); }
.ref-strip span.active { color: var(--teal); background: var(--panel2); }
.audience-diagram { height: min(72vw, 560px); margin: 14px 0; }
.reference-grid { display: grid; gap: 10px; }
.reference-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.reference-grid h2 { font-size: 18px; color: var(--teal); margin-bottom: 6px; }
.reference-grid p { color: var(--mut); font-size: 15px; line-height: 1.35; margin: 0; }
.links-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.pcap-cards { display: grid; gap: 10px; }
.legend-grid { display: grid; gap: 8px; margin: 10px 0; }
.legend-grid div { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.legend-grid span { color: var(--mut); font-size: 12px; }
.pcap-cards article, .lab-card, .lab-list { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.pcap-cards h2, .lab-card h2 { font-size: 20px; color: var(--teal); margin: 0 0 8px; }
.pcap-cards pre { white-space: pre-wrap; color: var(--cyan); font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; border: 1px solid var(--line); padding: 8px; border-radius: 6px; }
.lab-code { color: var(--teal); font-size: 13px; }
.lab-card p { color: var(--mut); line-height: 1.35; }
.lab-options { display: grid; gap: 8px; }
.mini-topology { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; background: #13213a; overflow: hidden; }
.topology-line { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.topology-line span { min-width: 48px; min-height: 38px; display: grid; place-items: center; border: 1px solid var(--line2); border-radius: 6px; color: var(--txt); font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 11px; text-align: center; padding: 4px; }
.topology-line i { flex: 1; height: 2px; background: var(--cyan); min-width: 12px; }
.design-x, .design-ok { position: absolute; inset: 0; display: none; place-items: center; font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 96px; font-weight: 700; pointer-events: none; }
.design-x { color: var(--red); background: rgba(42, 18, 21, .46); }
.design-ok { color: var(--grn); opacity: .3; }
.mini-topology.has-error .design-x { display: grid; }
.mini-topology.has-good .design-ok { display: grid; }
.lab-options button, .lab-list button, .show-me {
  min-height: 48px;
  text-align: left;
  background: var(--panel2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
.lab-options button.right { border-color: var(--grn); color: var(--grn); }
.lab-options button.wrong { border-color: var(--amb); color: var(--amb); }
.delivery-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.delivery-row b { font-size: 13px; color: var(--txt); }
.delivery-row span { display: grid; grid-template-columns: repeat(4, 38px); gap: 5px; }
.delivery-row button { min-height: 36px; text-align: center; padding: 4px; }
.lab-feedback, .lab-score { margin-top: 10px; color: var(--mut); }
.lab-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lab-list button { min-height: 44px; text-align: center; font-size: 12px; }
.lab-list button.active { border-color: var(--teal); color: var(--teal); }
.graph-builder { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(0, 1.8fr); gap: 12px; margin: 14px 0; }
.graph-palette, .graph-workspace { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #13213a; padding: 10px; }
.graph-palette { display: grid; align-content: start; gap: 7px; }
.graph-palette h3, .graph-workspace h3 { margin: 0; color: var(--mut); font-size: 12px; letter-spacing: .08em; }
.graph-group-label { margin-top: 4px; color: var(--dim); font-size: 10px; letter-spacing: .12em; }
.graph-part { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 52px; padding: 7px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel2); color: var(--txt); text-align: left; }
.graph-part:hover { border-color: var(--cyan); }
.graph-part.used { opacity: .34; border-color: var(--line); }
.graph-part-icon { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line2); border-radius: 5px; color: var(--cyan); font: 700 11px Consolas, "Cascadia Mono", ui-monospace, monospace; }
.graph-part-copy { min-width: 0; }
.graph-part-copy b, .graph-part-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-part-copy b { font: 700 11px Consolas, "Cascadia Mono", ui-monospace, monospace; }
.graph-part-copy small { margin-top: 3px; color: var(--mut); font-size: 9px; }
.graph-part-add { color: var(--dim); font-size: 9px; }
.graph-workspace { padding: 0; overflow: hidden; }
.graph-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.graph-workspace-head small { display: block; margin-top: 4px; color: var(--dim); font-size: 10px; }
.graph-workspace-actions { display: flex; align-items: center; gap: 7px; }
.graph-mode { color: var(--teal); border: 1px solid var(--line2); border-radius: 5px; padding: 4px 6px; font-size: 9px; }
.graph-reset, .graph-check { border: 1px solid var(--line2); border-radius: 5px; background: var(--panel2); color: var(--txt); padding: 6px 9px; font: 700 10px Consolas, "Cascadia Mono", ui-monospace, monospace; }
.graph-reset:hover, .graph-check:hover { border-color: var(--teal); color: var(--teal); }
.graph-canvas { position: relative; min-height: 390px; overflow: hidden; background-color: #0b1425; background-image: linear-gradient(rgba(43, 61, 99, .28) 1px, transparent 1px), linear-gradient(90deg, rgba(43, 61, 99, .28) 1px, transparent 1px); background-size: 28px 28px; touch-action: none; }
.graph-canvas-label { position: absolute; left: 12px; top: 10px; z-index: 5; color: var(--dim); font-size: 9px; letter-spacing: .08em; }
.graph-empty { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(125, 147, 179, .42); font-size: 11px; letter-spacing: .12em; pointer-events: none; }
.graph-links, .graph-packet-layer, .graph-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.graph-links { z-index: 1; pointer-events: none; }
.graph-link { stroke: #5f78ad; stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: .92; }
.graph-nodes { z-index: 3; pointer-events: none; }
.graph-node { position: absolute; width: 132px; min-height: 58px; transform: translate(-50%, -50%); display: grid; align-content: center; gap: 2px; padding: 7px; border: 1px solid #5f78ad; border-radius: 7px; background: #162642; color: var(--txt); box-shadow: 5px 5px 0 rgba(6, 11, 21, .35); text-align: center; pointer-events: auto; touch-action: none; cursor: grab; }
.graph-node:active, .graph-node.dragging { cursor: grabbing; }
.graph-node.selected { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(56, 189, 248, .2), 5px 5px 0 rgba(6, 11, 21, .35); }
.graph-node strong { font: 700 12px Consolas, "Cascadia Mono", ui-monospace, monospace; }
.graph-node small, .graph-node em { display: block; font: 700 9px Consolas, "Cascadia Mono", ui-monospace, monospace; font-style: normal; }
.graph-node small { color: var(--mut); }
.graph-node em { color: var(--dim); font-size: 8px; }
.graph-packet-layer { z-index: 4; pointer-events: none; }
.graph-packet { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px currentColor; color: var(--cyan); }
.graph-packet-return { background: var(--grn); color: var(--grn); }
.graph-controls { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 10px; }
.graph-tally { color: var(--txt); font-size: 11px; }
.graph-status { overflow: hidden; color: var(--dim); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.graph-check { min-width: 92px; color: var(--teal); border-color: var(--teal); }
.graph-detail { margin-top: 9px; color: var(--mut); font-size: 10px; line-height: 1.35; }
.graph-result { margin-top: 10px; padding: 11px; border: 1px solid var(--line2); border-radius: 7px; background: var(--panel2); }
.graph-result strong { display: block; font: 700 12px Consolas, "Cascadia Mono", ui-monospace, monospace; }
.graph-result p, .graph-result small { display: block; margin: 5px 0 0; color: var(--mut); font-size: 12px; line-height: 1.35; }
.graph-result small { color: var(--teal); }
.graph-result.correct { border-color: var(--grn); }
.graph-result.correct strong { color: var(--grn); }
.graph-result.incorrect { border-color: var(--amb); }
.graph-result.incorrect strong { color: var(--amb); }
.shape-board { display: grid; grid-template-columns: minmax(118px, .9fr) minmax(0, 1.35fr); gap: 10px; margin: 12px 0; }
.parts-palette, .network-canvas { border: 1px solid var(--line); border-radius: 10px; background: #13213a; padding: 10px; }
.parts-palette h3, .network-canvas h3 { margin: 0 0 8px; color: var(--mut); font-size: 12px; letter-spacing: .08em; }
.parts-palette { display: grid; gap: 7px; align-content: start; }
.part-shape, .network-slot {
  min-height: 46px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: var(--panel2);
  color: var(--txt);
  font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
  font-size: 12px;
  text-align: center;
  padding: 8px;
}
.part-shape.selected { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 0 2px rgba(56, 189, 248, .16); }
.part-shape.used { opacity: .38; color: var(--dim); }
.network-canvas { position: relative; overflow: hidden; min-height: 230px; }
.network-canvas::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: .45;
}
.slot-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.network-slot { display: grid; place-items: center; gap: 3px; min-height: 68px; background: rgba(17, 28, 48, .92); }
.network-slot span { color: var(--mut); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.network-slot b { color: var(--dim); font-size: 12px; font-weight: 600; }
.network-slot.filled { border-color: var(--grn); background: rgba(18, 46, 38, .86); }
.network-slot.filled b { color: var(--grn); }
.network-slot.slot-error { border-color: var(--red); background: rgba(42, 18, 21, .88); animation: blinkFast .45s 2; }
.network-canvas.has-error .design-x { display: grid; }
.network-canvas.has-good .design-ok { display: grid; }
.sheet-shade { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.device-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow: auto; background: var(--panel); border-top: 1px solid var(--line); border-radius: 10px 10px 0 0; padding: 18px; z-index: 41; }
.device-sheet h2 { font-size: 22px; }
.device-sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.device-sheet th, .device-sheet td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.device-sheet th { color: var(--mut); width: 34%; font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }
.sheet-close { position: absolute; right: 12px; top: 10px; background: transparent; color: var(--txt); border: 0; font-size: 28px; }
.control-pill { margin-top: 12px; color: var(--grn); font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }

@keyframes pulse { 50% { opacity: .55; } }
@keyframes blinkAmb { 50% { opacity: .35; } }
@keyframes blinkFast { 50% { opacity: .25; } }
@keyframes infect { to { fill: #2a1215; stroke: #f87171; } }
@keyframes statusJitter { 50% { transform: translateX(.6px); } }
@keyframes bootNode { to { opacity: 1; } }

@media (max-width: 760px) {
  body { overflow: auto; }
  .deck-header { height: auto; min-height: 54px; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; }
  .deck-footer { display: none; }
  .slides { padding-top: 82px; height: auto; }
  .slide { height: auto; min-height: calc(100vh - 82px); padding: 18px 14px; }
  h1 { font-size: 38px; }
  h2 { font-size: 32px; }
  .two-col, .ts-layout, .personality-grid { grid-template-columns: 1fr; height: auto; }
  .protocol-grid, .device-grid, .media-grid { grid-template-columns: 1fr; }
  .packet-circuit-layout { grid-template-columns: 1fr; height: auto; }
  .diagram-slot { min-height: 300px; }
  .choice-stack button { font-size: 14px; }
  .graph-builder { grid-template-columns: 1fr; }
  .graph-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .graph-palette h3, .graph-group-label { grid-column: 1 / -1; }
  .graph-node { width: 112px; min-height: 54px; }
  .graph-canvas { min-height: 430px; }
  .graph-controls { grid-template-columns: 1fr 1fr; }
  .graph-status { grid-column: 1 / -1; grid-row: 1; }
  .graph-check { grid-column: 1 / -1; }
  .shape-board { grid-template-columns: 1fr; }
  .parts-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parts-palette h3 { grid-column: 1 / -1; }
  .lab-list { grid-template-columns: repeat(3, 1fr); }
}
