:root{
  --bg:#05101b;--panel:#0a1a2b;--text:#eff8ff;--muted:#92abc0;
  --cyan:#31c5f4;--green:#42dc94;--purple:#ad83ff;--pink:#ff79bd;--gold:#ffc65c;--blue:#1689da;
  --inactive-node-opacity:.48;--inactive-edge-opacity:.30;--active-opacity:1;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;overflow-x:hidden;background:radial-gradient(circle at 18% 0,#133557 0,transparent 31%),linear-gradient(145deg,#07131f,#02070d 72%);color:var(--text);font-family:Inter,Segoe UI,system-ui,sans-serif}
button{font:inherit}.topbar,.tabs,main{width:min(1560px,100%);margin:auto}
.topbar{padding:18px 24px 10px;display:flex;justify-content:space-between;align-items:center;gap:20px}.eyebrow{display:block;color:#68dafd;font-size:.68rem;font-weight:850;letter-spacing:.17em;margin-bottom:5px}.topbar h1{margin:0;font-size:1.55rem}.topbar-actions{display:flex;align-items:center;gap:10px}.topbar-note,.text-btn{border:1px solid #9cc5dd25;background:#ffffff06;color:#9db4c8;border-radius:999px;padding:7px 11px;font-size:.7rem}.text-btn{cursor:pointer;color:white}
.tabs{display:flex;gap:8px;padding:8px 24px 16px;overflow-x:auto}.tab{white-space:nowrap;display:flex;align-items:center;gap:9px;border:1px solid #9cc5dd25;background:#ffffff07;color:#a8bed0;padding:10px 14px;border-radius:12px;cursor:pointer}.tab small{font-size:.6rem;padding:3px 6px;border-radius:99px;background:#ffffff0c}.tab.active{color:white;border-color:#35c8f066;background:#29b8e718}.tab-panel{display:none}.tab-panel.active{display:block}main{padding:0 24px 46px}
.runtime{border:1px solid #99c7df24;border-radius:22px;background:#06131fdd;box-shadow:0 25px 70px #0008;overflow:hidden}.runtime.maximized{position:fixed;inset:0;z-index:1000;border:0;border-radius:0;overflow:hidden;background:#06131f}
.runtime-head{display:grid;grid-template-columns:40px minmax(190px,1fr) auto minmax(170px,.75fr) 40px;align-items:center;gap:10px;padding:10px 14px}.runtime-title{min-width:0}.runtime-title .eyebrow{margin-bottom:2px}.runtime-title h2{margin:2px 0 0;font-size:1.08rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.runtime-controls{display:flex;justify-content:center;align-items:center;gap:6px;padding:0;white-space:nowrap}.status{display:flex;justify-content:flex-end;align-items:center;gap:8px;color:#a6bfd0;font-size:.73rem;min-width:0}.status span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status i{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:var(--green);box-shadow:0 0 13px var(--green)}
.icon-btn,.speed-btn{height:34px;min-width:36px;border:1px solid #9cc5dd2a;background:#ffffff08;color:#dff6ff;border-radius:10px;cursor:pointer;display:grid;place-items:center}.icon-btn:hover,.speed-btn:hover{border-color:#43d0f777;background:#31c5f418}.icon-btn.primary{border-color:#36c8f56b;background:#26b9eb1c}.icon-btn:disabled{opacity:.3;cursor:not-allowed}.icon-btn svg{width:17px;height:17px;display:block;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.icon-btn .fill-icon{fill:currentColor;stroke:none}.maximize-btn svg{width:18px;height:18px}.layout-reset-btn{justify-self:end;border-color:#ffc65c55;color:#ffe1a1}.layout-reset-btn:hover{border-color:#ffc65c;background:#ffc65c18}.control-separator{width:1px;height:24px;background:#ffffff17;margin:0 2px}.speed-btn{min-width:50px;font-weight:800}.progress{height:3px;background:#ffffff0a;margin:0 14px}.progress span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--cyan),var(--purple),var(--pink));transition:width .25s ease}
.runtime-body{padding:0 14px 14px}.runtime.maximized .runtime-body{height:calc(100vh - 58px);display:grid;grid-template-rows:minmax(0,1fr) auto auto;overflow:hidden}.diagram-scroll{width:100%;overflow:hidden;display:flex;justify-content:center;align-items:flex-start;overscroll-behavior:contain;padding:8px 0 10px}.stage-frame{position:relative;flex:0 0 auto}.stage{position:absolute;left:0;top:0;transform-origin:top left;background-image:linear-gradient(#ffffff05 1px,transparent 1px),linear-gradient(90deg,#ffffff05 1px,transparent 1px);background-size:48px 48px;border:1px solid #9fc8e51a;border-radius:18px;overflow:hidden}.zone{position:absolute;border:1px dashed #36c7ef65;border-radius:17px;background:#06131f70;color:#7adfff;padding:13px;text-transform:uppercase;font-size:.68rem;letter-spacing:.1em;pointer-events:none;transition:left .22s ease,top .22s ease,width .22s ease,height .22s ease}.zone small{display:block;color:#7fa3b9;font-size:.55rem;margin-top:3px}.wires,.tokens,#nodes,#zones{position:absolute;inset:0}.wires{width:100%;height:100%;overflow:visible}.wires defs{pointer-events:none}
.wire{fill:none;stroke-width:2.1;stroke-dasharray:7 7;stroke-linecap:round;stroke-linejoin:round;opacity:var(--inactive-edge-opacity);vector-effect:non-scaling-stroke;transition:opacity .28s ease,stroke-width .28s ease,filter .28s ease}.wire.main{stroke:var(--cyan)}.wire.parallel{stroke:var(--purple)}.wire.secret{stroke:var(--gold)}.wire.async{stroke:var(--pink);stroke-dasharray:3 7}.wire.step-active,.wire.live,.wire.completed-all{opacity:var(--active-opacity)}.wire.step-active{stroke-width:3}.wire.live{stroke-width:4;filter:drop-shadow(0 0 5px currentColor)}.wire.completed-all{stroke-width:2.3;filter:drop-shadow(0 0 1.5px currentColor)}.wire-hit{fill:none;stroke:transparent;stroke-width:18;cursor:move;pointer-events:stroke}.wire-handle{fill:#06131f;stroke:#d7f6ff;stroke-width:1.5;opacity:0;pointer-events:none;filter:drop-shadow(0 0 5px #b8edff)}.edge-group:hover .wire-handle,.edge-group.dragging .wire-handle{opacity:.95}.edge-port{stroke:#06131f;stroke-width:2;opacity:var(--inactive-edge-opacity);pointer-events:none;transition:opacity .28s ease}.edge-port.out{fill:#06131f;stroke-width:2.5}.edge-port.in{stroke:#e8fbff;stroke-width:1.2}.edge-port.main{fill:var(--cyan)}.edge-port.parallel{fill:var(--purple)}.edge-port.secret{fill:var(--gold)}.edge-port.async{fill:var(--pink)}.edge-port.out.main{stroke:var(--cyan)}.edge-port.out.parallel{stroke:var(--purple)}.edge-port.out.secret{stroke:var(--gold)}.edge-port.out.async{stroke:var(--pink)}.edge-port.step-active,.edge-port.live,.edge-port.completed-all{opacity:1}.packet{position:absolute;width:11px;height:11px;border-radius:50%;transform:translate(-50%,-50%);z-index:8;box-shadow:0 0 18px currentColor}.packet.main{background:var(--cyan);color:var(--cyan)}.packet.parallel{background:var(--purple);color:var(--purple)}.packet.secret{background:var(--gold);color:var(--gold)}.packet.async{background:var(--pink);color:var(--pink)}
.node{position:absolute;padding:13px 13px 12px 44px;border:1px solid #2b8dbf;background:linear-gradient(145deg,#0c2337,#081726);border-radius:14px;opacity:var(--inactive-node-opacity);transition:opacity .28s ease,box-shadow .28s ease,border-color .28s ease,left .16s ease,top .16s ease;user-select:none;touch-action:none;cursor:grab}.node:active{cursor:grabbing}.node.dragging{transition:opacity .28s ease,box-shadow .28s ease,border-color .28s ease;z-index:7}.node.step-active,.node.live,.node.completed-all{opacity:var(--active-opacity)}.node.step-active,.node.live{box-shadow:0 0 28px #31c5f455;border-color:#75e1ff}.node.completed-all{box-shadow:0 0 12px #31c5f422}.node.drag-invalid{border-color:#ff6b7b;box-shadow:0 0 0 2px #ff6b7b55}.node .glyph{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:21px;height:21px;display:grid;place-items:center;color:#dff7ff}.node .glyph svg{width:20px;height:20px;display:block;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.node strong{display:block;padding-right:25px;font-size:.77rem;line-height:1.15}.node small{display:block;padding-right:24px;color:#9eb8ca;font-size:.61rem;margin-top:5px}.node .code{position:absolute;right:7px;top:7px;width:27px;height:20px;padding:0;display:grid;place-items:center;border:1px solid #63dfff85;background:#08253a;color:#9beaff;border-radius:7px;cursor:pointer;font:800 .57rem/1 ui-monospace,SFMono-Regular,Consolas,monospace;box-shadow:0 0 0 1px #03101a}.node .code:hover{background:#0d3854;border-color:#8ceaff;color:#fff}.node .info{position:absolute;right:8px;bottom:7px;width:21px;height:21px;border:1px solid #7edfff78;background:#071b2b;color:#9aeaff;border-radius:50%;padding:0;display:grid;place-items:center;cursor:pointer;z-index:3}.node .info svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.node .info:hover{background:#0c3b57;color:#fff;border-color:#a7efff}.node.external{border-color:#a879ef}.node.secret{border-color:#d59c28}.node.data{border-color:#2ca98d}
.inspector{display:grid;grid-template-columns:1.2fr 1fr .9fr;gap:12px;margin-top:10px}.event,.meta,pre{border:1px solid #9cc5dd20;background:#081826;border-radius:14px;min-height:96px}.event{display:flex;gap:14px;padding:16px}.event>span{font-size:1.8rem;font-weight:900;color:#4ad7ff}.event small,.meta small{color:#83a4bb}.event h3{margin:4px 0;font-size:.92rem}.event p{margin:0;color:#9bb1c2;font-size:.76rem;line-height:1.45}.meta{display:grid;grid-template-columns:repeat(3,1fr);padding:16px;gap:12px}.meta div{display:grid;align-content:start;gap:7px}.meta strong{font-size:.72rem}pre{margin:0;padding:15px;color:#99def5;font-size:.67rem;overflow:auto}.legend{display:flex;align-items:center;gap:17px;flex-wrap:wrap;color:#8aa6b9;font-size:.65rem;padding:11px 1px 0}.legend i{display:inline-block;width:18px;height:2px;border-top:2px dashed currentColor;margin-right:6px;vertical-align:middle}.legend .main{color:var(--cyan)}.legend .parallel{color:var(--purple)}.legend .secret{color:var(--gold)}.legend .async{color:var(--pink)}.legend b{font-weight:500}.drag-help{margin-left:auto}
.engineering-footprint{margin-top:16px;border:1px solid #9cc5dd22;background:#081826c9;border-radius:17px;padding:20px;display:grid;grid-template-columns:1.25fr 1fr;gap:22px;align-items:center}.footprint-copy h2{font-size:1.25rem;margin:4px 0 8px}.footprint-copy p{margin:0;color:#97afc1;line-height:1.55;font-size:.83rem}.footprint-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.metric{border:1px solid #9cc5dd24;background:#ffffff06;color:white;border-radius:12px;padding:12px 7px}.metric span{display:block;font-size:1.35rem;color:#65ddff;font-weight:850}.metric small{color:#9cb3c4}.page-actions{display:flex;justify-content:flex-end;padding-top:12px}.print-btn{border:1px solid #8ac8e055;background:#0b2135;color:white;border-radius:11px;padding:9px 14px;cursor:pointer}
.drawer{position:fixed;inset:0;z-index:1500;pointer-events:none}.drawer.open{pointer-events:auto}.drawer-backdrop{position:absolute;inset:0;border:0;background:#0008;opacity:0;transition:.2s}.drawer.open .drawer-backdrop{opacity:1}.drawer-panel{position:absolute;right:0;top:0;width:min(540px,94vw);height:100%;background:#081724;border-left:1px solid #9cc5dd2a;transform:translateX(100%);transition:.25s;overflow-y:auto}.drawer.open .drawer-panel{transform:none}.drawer-panel header{padding:20px;border-bottom:1px solid #9cc5dd20;display:flex;justify-content:space-between}.drawer-panel h2{margin:10px 0 3px}.drawer-panel header p{margin:0;color:#8ba6b9}.close{border:0;background:transparent;color:white;font-size:1.5rem;cursor:pointer}.drawer-body{padding:20px}.drawer-description{color:#b3c6d4;line-height:1.6}.facts{display:grid;grid-template-columns:1fr 1fr;gap:9px}.facts div{background:#ffffff05;border-radius:10px;padding:10px}.facts dt{font-size:.67rem;color:#7f9caf}.facts dd{margin:4px 0 0;font-size:.8rem}.drawer-section{border-top:1px solid #9cc5dd1e;margin-top:18px;padding-top:16px}.drawer-section h3{font-size:.86rem}.technology-list{display:flex;flex-wrap:wrap;gap:7px}.technology-chip{padding:6px 9px;border:1px solid #3abfe04f;border-radius:8px;background:#2aaed314;color:#a8ebff;font-size:.68rem}.repo-path{font-family:ui-monospace,monospace;color:#70dfff;font-size:.75rem}
.wip{min-height:60vh;display:none;place-items:center}.wip.active{display:grid}.wip-card{text-align:center;border:1px solid #9cc5dd25;background:#081826;padding:50px;border-radius:20px}.wip-card span{color:#ffc65c;font-size:.7rem;letter-spacing:.17em}.wip-card h2{font-size:2rem}
@media(max-width:1120px){.runtime-head{grid-template-columns:38px minmax(150px,1fr) auto 40px}.status{display:none}.runtime-controls{justify-content:flex-end}}
@media(max-width:900px){main{padding:0 10px 30px}.topbar,.tabs{padding-left:12px;padding-right:12px}.runtime-head{grid-template-columns:36px minmax(130px,1fr) minmax(280px,auto) 38px;gap:7px}.runtime-title .eyebrow{display:none}.runtime-title h2{font-size:.92rem}.inspector{grid-template-columns:1fr}.engineering-footprint{grid-template-columns:1fr}.footprint-metrics{grid-template-columns:repeat(2,1fr)}.drag-help{width:100%;margin-left:0}}
@media(max-width:680px){.runtime-head{grid-template-columns:34px 1fr 34px}.runtime-controls{grid-column:1/-1;grid-row:2;justify-content:center;overflow-x:auto}.layout-reset-btn{grid-column:3;grid-row:1}.runtime-title h2{white-space:normal}.control-separator{display:none}}
@media print{body{background:white;color:#111}.topbar,.tabs,.runtime-controls,.layout-reset-btn,.page-actions,.legend,.drawer{display:none!important}.runtime,.engineering-footprint,.event,.meta,pre{box-shadow:none;background:white;border-color:#aaa}.runtime-head{color:#111}.diagram-scroll{overflow:visible}.stage{background:white}.node{opacity:1;color:#111;background:white}.wire,.edge-port{opacity:1}.zone{background:white}.inspector{break-inside:avoid}}

/* Geometry and legibility refinements */
:root{--inactive-node-opacity:.68;--inactive-edge-opacity:.42;--active-opacity:1}
.runtime-head{grid-template-columns:40px minmax(210px,1fr) auto minmax(190px,.7fr) 42px}
.layout-reset-btn{justify-self:end;border-color:#8eb5ca42;color:#dff6ff}
.layout-reset-btn:hover{border-color:#62d6f4;background:#31c5f418}
.diagram-scroll{overflow:hidden;justify-content:center;align-items:flex-start;padding:12px 0 14px}
.stage-frame{margin-inline:auto}
.runtime.maximized .diagram-scroll{overflow:hidden;min-height:0}
.zone{padding:14px 16px;overflow:visible;background:#06131f8c}
.wire{stroke-width:2.15;stroke-dasharray:6 7;opacity:var(--inactive-edge-opacity);transition:opacity .3s ease,stroke-width .3s ease,filter .3s ease}
.wire.async{stroke-dasharray:3 7}
.wire.route-failed{stroke:#ff6b7b!important;stroke-dasharray:2 5!important}
.edge-port{opacity:calc(var(--inactive-edge-opacity) + .16);transition:opacity .3s ease}
.edge-port.out{stroke-width:2.8}.edge-port.in{fill:#06131f;stroke-width:2}
.node{opacity:var(--inactive-node-opacity);transition:opacity .3s ease,box-shadow .3s ease,border-color .3s ease,left .16s ease,top .16s ease}
.node strong,.node small,.node .glyph,.node .code,.node .info{opacity:.96}
.node.step-active,.node.live,.node.completed-all{opacity:1}
@media(max-width:1120px){.runtime-head{grid-template-columns:38px minmax(160px,1fr) auto 40px}.status{display:none}}
@media(max-width:680px){.runtime-head{grid-template-columns:34px 1fr 34px}.runtime-controls{grid-column:1/-1;grid-row:2;justify-content:center}.layout-reset-btn{grid-column:3;grid-row:1}}

/* Compact single-flow shell and interaction refinements */
body{min-height:100vh}
main{width:100%;max-width:none;padding:12px}
.tab-panel.active{display:block}
.runtime{width:100%}
.runtime-head{position:relative;display:grid;grid-template-columns:minmax(270px,1fr) auto minmax(380px,1fr);align-items:center;gap:16px;padding:10px 18px}
.runtime-left,.runtime-right{display:flex;align-items:center;gap:10px;min-width:0}
.runtime-right{justify-content:flex-end}
.runtime-controls{justify-self:center}
.runtime-title h2{font-size:1.02rem}
.status{max-width:520px;justify-content:flex-end}
.status span{white-space:normal;text-align:right;line-height:1.3}
.runtime-language{height:34px;min-width:40px;padding:0 9px;border-radius:10px}
.engineering-btn{color:#9feaff}
.runtime-body{padding:0 14px 12px}
.diagram-scroll{overflow:auto;scrollbar-width:none;justify-content:flex-start;align-items:flex-start;cursor:default}
.diagram-scroll::-webkit-scrollbar{display:none}
.stage-frame{margin-inline:auto}
.runtime.maximized .runtime-body{height:calc(100vh - 62px);display:block;overflow:hidden}
.runtime.maximized .diagram-scroll{height:calc(100vh - 104px);overflow:auto;scrollbar-width:none}
.node{transition:opacity .3s ease,box-shadow .3s ease,border-color .3s ease;will-change:left,top}
.node.dragging{transition:none!important;cursor:grabbing;box-shadow:0 0 30px #31c5f444}
.legend{padding-bottom:2px}
.engineering-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}
.engineering-list article{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid #9cc5dd22;background:#ffffff05;border-radius:12px}
.engineering-list strong{font-size:1.45rem;color:#65ddff;min-width:34px}
.engineering-list span{font-size:.78rem;color:#b8cbd8}
.drawer-print{width:100%;margin-top:20px;padding:11px 14px}
@media(max-width:1100px){.runtime-head{grid-template-columns:1fr auto}.runtime-controls{grid-column:1/-1;grid-row:2}.runtime-right{min-width:0}.status{display:flex;max-width:380px}}
@media(max-width:720px){main{padding:4px}.runtime-head{grid-template-columns:1fr}.runtime-left,.runtime-right{justify-content:center}.runtime-controls{grid-column:1;grid-row:auto;overflow-x:auto}.status{display:none}.runtime-right{flex-wrap:wrap}}
@media print{.engineering-btn,.runtime-language{display:none!important}}

/* Canvas navigation */
.diagram-scroll{cursor:default;scrollbar-width:thin;outline:none}
.diagram-scroll.panning{cursor:grabbing!important;user-select:none}
.diagram-scroll.panning *{cursor:grabbing!important}
.runtime.maximized .diagram-scroll{overflow:auto}
@media print{html,body{overflow:visible!important}.stage-frame{break-inside:avoid;page-break-inside:avoid}}

/* Unified header actions and centered current step */
.runtime-head{grid-template-columns:minmax(250px,1fr) minmax(320px,1.15fr) auto;gap:14px}
.runtime-head>.status{justify-self:center;width:100%;max-width:620px;justify-content:center;text-align:center}
.runtime-head>.status span{text-align:center}
.runtime-right{gap:7px}
.runtime-controls{display:flex;gap:7px;justify-content:flex-end}
.runtime-right .icon-btn,.runtime-right .speed-btn,.runtime-controls .icon-btn{width:36px;height:36px;min-width:36px;padding:0;border-radius:10px;display:inline-flex;align-items:center;justify-content:center}
.runtime-language{font-size:.72rem;font-weight:800;letter-spacing:.02em}
.speed-btn{font-size:.76rem;font-weight:800}
.inventory-list{display:grid;gap:8px}
.inventory-item{padding:10px 11px;border:1px solid #9cc5dd22;background:#ffffff05;border-radius:10px}
.inventory-item strong{display:block;color:#e9f6ff;font-size:.78rem;margin-bottom:3px}
.inventory-item span{display:block;color:#9fb8c8;font-size:.7rem;line-height:1.35}
@media(max-width:1250px){.runtime-head{grid-template-columns:minmax(220px,.8fr) minmax(260px,1fr) auto}.runtime-right{overflow-x:auto;scrollbar-width:none}.runtime-right::-webkit-scrollbar{display:none}}
@media(max-width:900px){.runtime-head{grid-template-columns:1fr}.runtime-left,.runtime-head>.status,.runtime-right{justify-self:center}.runtime-right{justify-content:center;max-width:100%}}

/* Expanded architecture detail drawer */
.function-list{margin:0;padding:0;list-style:none;display:grid;gap:8px}
.function-list li{position:relative;padding:10px 12px 10px 31px;border:1px solid #9cc5dd22;background:#ffffff05;border-radius:10px;color:#b9cedb;font-size:.76rem;line-height:1.48}
.function-list li::before{content:"";position:absolute;left:12px;top:16px;width:7px;height:7px;border-radius:50%;background:#19a3fc;box-shadow:0 0 0 4px #19a3fc20}
.operational-list{display:grid;gap:9px}
.operational-item{padding:12px 13px;border:1px solid #19a3fc2d;background:linear-gradient(135deg,#19a3fc0c,#ffffff04);border-radius:11px}
.operational-item strong{display:block;color:#dff5ff;font-size:.75rem;margin-bottom:5px}
.operational-item span{display:block;color:#9fb8c8;font-size:.72rem;line-height:1.5}
.drawer-panel header{position:sticky;top:0;z-index:2;background:#081724f2;backdrop-filter:blur(12px)}
.drawer-description{font-size:.82rem}
@media (max-width:640px){.drawer-panel{width:100vw}.facts{grid-template-columns:1fr}.drawer-body{padding:18px}}

/* Home navigation */
.home-btn{flex:0 0 36px;text-decoration:none;color:#dff6ff}
.runtime-left{gap:8px}
@media print{.home-btn{display:none!important}}

/* Shared light/dark mode */
.theme-btn{color:#ffd979}
:root[data-theme="light"]{--bg:#eef5fa;--panel:#fff;--text:#142738;--muted:#5e7485;--cyan:#0781af;--green:#159765;--purple:#7254c7;--pink:#c53f86;--gold:#a86e00;--blue:#176ca3;--inactive-node-opacity:.74;--inactive-edge-opacity:.34;--active-opacity:1}
:root[data-theme="light"] body{background:radial-gradient(circle at 18% 0,#b7e4f5 0,transparent 31%),linear-gradient(145deg,#f8fbfd,#e8f0f5 72%);color:var(--text)}
:root[data-theme="light"] .runtime{background:#f8fbfddd;border-color:#275b7625;box-shadow:0 25px 60px #35596b25}
:root[data-theme="light"] .runtime.maximized{background:#f5f9fc}
:root[data-theme="light"] .icon-btn,:root[data-theme="light"] .speed-btn{background:#fff;color:#173a4e;border-color:#2a668526;box-shadow:0 3px 12px #31586a12}
:root[data-theme="light"] .icon-btn:hover,:root[data-theme="light"] .speed-btn:hover{border-color:#1187b45e;background:#e8f7fc}
:root[data-theme="light"] .icon-btn.primary{background:#dff4fb;border-color:#0781af55}
:root[data-theme="light"] .theme-btn{color:#7355bf}
:root[data-theme="light"] .progress{background:#17384a0a}
:root[data-theme="light"] .stage{background-color:#edf5f9;background-image:linear-gradient(#17384a0a 1px,transparent 1px),linear-gradient(90deg,#17384a0a 1px,transparent 1px);border-color:#31586a20}
:root[data-theme="light"] .zone{background:#f6fbfdcf;border-color:#0781af70;color:#087ca7}
:root[data-theme="light"] .zone small{color:#667f90}
:root[data-theme="light"] .node{background:linear-gradient(145deg,#fff,#edf5f9);color:#152d3d;border-color:#2785ac;box-shadow:0 6px 16px #31586a12}
:root[data-theme="light"] .node small{color:#647d8d}
:root[data-theme="light"] .node .glyph{color:#1d5d7b}
:root[data-theme="light"] .node .info,:root[data-theme="light"] .node .code{background:#eff8fb;color:#147da7;border-color:#1684ae61}
:root[data-theme="light"] .legend{color:#577183}
:root[data-theme="light"] .drawer-panel{background:#f7fbfd;border-color:#31586a25;color:#17384a}
:root[data-theme="light"] .drawer-panel header{background:#f7fbfdf2;border-color:#31586a1c}
:root[data-theme="light"] .drawer-panel header p,:root[data-theme="light"] .drawer-description{color:#5f7889}
:root[data-theme="light"] .close{color:#17384a}
:root[data-theme="light"] .facts div,:root[data-theme="light"] .inventory-item,:root[data-theme="light"] .function-list li,:root[data-theme="light"] .engineering-list article{background:#eef5f8;border-color:#31586a18;color:#365769}
:root[data-theme="light"] .operational-item{background:linear-gradient(135deg,#1684ae0c,#fff);border-color:#1684ae26}
:root[data-theme="light"] .operational-item strong{color:#17384a}
:root[data-theme="light"] .operational-item span{color:#5f7889}
:root[data-theme="light"] .technology-chip{background:#dff3fa;color:#126d91;border-color:#1684ae35}
:root[data-theme="light"] .repo-path{color:#087ca7}
:root[data-theme="light"] .edge-port.in{fill:#edf5f9;stroke:#234f64}
:root[data-theme="light"] .wire-handle{fill:#edf5f9;stroke:#234f64}

/* Readable step summary and bounded node copy */
.runtime-head{grid-template-columns:minmax(220px,.7fr) minmax(500px,1.75fr) auto}
.runtime-head>.status{max-width:none;padding-inline:10px}
.runtime-head>.status span{font-size:.82rem;line-height:1.38;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.node strong,.node small{overflow:hidden;overflow-wrap:anywhere;word-break:normal;display:-webkit-box;-webkit-box-orient:vertical}
.node strong{-webkit-line-clamp:2;max-height:2.3em}
.node small{-webkit-line-clamp:2;max-height:2.65em;line-height:1.3}
.node.node-copy-compact strong{font-size:.74rem}
.node.node-copy-compact small{font-size:.59rem}
@media(max-width:1250px){.runtime-head{grid-template-columns:minmax(205px,.62fr) minmax(380px,1.3fr) auto}.runtime-head>.status span{font-size:.79rem}}
@media(max-width:900px){.runtime-head>.status{max-width:min(760px,100%)}.runtime-head>.status span{font-size:.8rem}}

/* Give the current-step description its own full-width header row */
.runtime-head{grid-template-columns:minmax(220px,1fr) auto;grid-template-rows:auto auto;column-gap:16px;row-gap:5px}
.runtime-head>.runtime-left{grid-column:1;grid-row:1}
.runtime-head>.runtime-right{grid-column:2;grid-row:1}
.runtime-head>.status{grid-column:1/-1;grid-row:2;width:100%;max-width:none;min-height:22px;justify-content:center;padding:0 16px 2px}
.runtime-head>.status span{width:100%;max-width:1120px;text-align:center}
@media(max-width:900px){.runtime-head{grid-template-columns:1fr}.runtime-head>.runtime-left{grid-column:1;grid-row:1}.runtime-head>.runtime-right{grid-column:1;grid-row:2}.runtime-head>.status{grid-column:1;grid-row:3}}
@media(max-width:720px){.runtime-head>.status{display:none}}
.engineering-btn[hidden]{display:none!important}

/* Maximized: measure the chrome instead of guessing it. The header grew to two rows, so the
   old `100vh - 62px` pushed the legend below the fold and `overflow:hidden` cut it off. */
.runtime.maximized{display:flex;flex-direction:column}
.runtime.maximized>.runtime-head,.runtime.maximized>.progress{flex:0 0 auto}
.runtime.maximized .runtime-body{flex:1 1 auto;min-height:0;height:auto;display:flex;flex-direction:column;overflow:hidden}
.runtime.maximized .diagram-scroll{flex:1 1 auto;min-height:0;height:auto;overflow:auto}
.runtime.maximized .legend{flex:0 0 auto}
