/* Anatomy figures inherit the portfolio's charcoal, warm ink and amber palette. */
.scene[data-machine]{min-height:420px;aspect-ratio:580/500;background:var(--panel);cursor:default}
.scene[data-machine]>.scene-top,.scene[data-machine]>svg,.scene[data-machine]>.scene-replay,.scene[data-machine]>.scene-agent{display:none!important}
.engineering-machine.iso{--anatomy-paper:#171719;--anatomy-face:#242426;--anatomy-top:#28282b;--anatomy-shade-0:#101012;--anatomy-shade-1:#18181b;--anatomy-shade-2:#202023;--anatomy-shade-3:#29292c;--anatomy-hi:#cac6bc;--anatomy-mid:#85827b;--anatomy-lo:#54535a;--anatomy-faint:#37363d;--anatomy-lit:var(--amber);--anatomy-lit-top:#62432d;--anatomy-lit-shade:#35281e;--anatomy-dot:#d3c8b6;--anatomy-weight:.65px;--anatomy-mono:var(--mono);position:absolute;inset:0;display:flex;flex-direction:column;padding:20px;color:var(--copy);font-family:var(--mono)}
.machine-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:24px;font-size:9px;letter-spacing:.08em}
.engineering-machine button{font:inherit;color:var(--copy);background:transparent;border:0;cursor:pointer;padding:7px 0;text-underline-offset:5px}
.engineering-machine button:hover{color:var(--ink)}
.engineering-machine button:focus-visible{outline:2px solid var(--amber);outline-offset:5px}
.machine-heading button{text-decoration:underline;font-size:11px;white-space:nowrap}
.machine-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);align-items:center}
.machine-drawing{min-width:0;min-height:0;display:flex;align-items:center;justify-content:center}
.machine-drawing>svg{width:100%;height:100%;max-height:100%;overflow:visible}
.machine-instructions{display:none}.machine-bottom{position:relative;display:flex;flex-direction:column;gap:12px;padding-top:10px}
.machine-bottom p{margin:0}.machine-hint,.machine-readouts,.machine-disclaimer{display:none}
.machine-idea{font-size:11px;line-height:1.6;max-width:50ch;color:var(--copy)}
.machine-open{align-self:flex-end;text-decoration:underline;font-size:10px!important}
[data-part][data-active=true] .iso-edge,[data-part][data-active=true] .iso-line{stroke:var(--amber)}
.machine-flow-signal{fill:none;stroke:var(--amber);stroke-width:1.8;stroke-linecap:round;stroke-dasharray:2 18;opacity:0;pointer-events:none}
[data-flow][data-active=true]>.machine-flow-signal{opacity:1}

.scene[data-machine-expanded]{position:fixed!important;inset:0!important;z-index:100;width:100%!important;height:100dvh!important;max-width:none!important;min-height:0!important;aspect-ratio:auto!important;margin:0!important;border:0!important;border-radius:0!important;background:var(--bg)!important;overflow:hidden!important}
[data-machine-expanded] .engineering-machine{padding:28px 36px;max-width:1440px;margin:0 auto}
[data-machine-expanded] .machine-number{font-size:10px}
[data-machine-expanded] .machine-body{grid-template-columns:230px minmax(0,1fr);gap:40px}
[data-machine-expanded] .machine-instructions{display:block;align-self:center}
.machine-instructions h3{font-family:var(--sans);font-size:27px;font-weight:400;line-height:1.15;letter-spacing:-.8px;color:var(--ink);margin:0 0 30px;max-width:11ch}
.machine-steps{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.machine-steps button{display:flex;align-items:center;gap:13px;width:100%;text-align:left;font-size:11px;line-height:1.5;padding:12px 0;border-bottom:1px solid var(--line)}
.machine-step-number{display:grid;place-items:center;flex-shrink:0;width:24px;height:24px;border:1px solid var(--line);border-radius:50%;font-size:10px}
.machine-steps button:disabled{cursor:default;color:var(--muted);opacity:.5}
.machine-steps button[aria-current=step]{opacity:1;color:var(--amber)}
.machine-steps button[aria-current=step] .machine-step-number{border-color:var(--amber)}
.machine-steps button[data-done=true]{opacity:.7}.machine-steps button:not(:disabled){color:var(--ink)}
.machine-playback{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:24px;font-size:10px}
.machine-playback button{text-decoration:underline}.machine-playback button:disabled{opacity:.35;cursor:default}
[data-machine-expanded] .machine-bottom{padding:18px 0 0 270px;gap:15px}
[data-machine-expanded] .machine-hint{display:block;max-width:72ch;font-family:var(--sans);font-size:16px;line-height:1.55;color:var(--ink);min-height:3.1em}
[data-machine-expanded] .machine-readouts{display:flex;flex-wrap:wrap;gap:10px 20px;font-size:10px}
.machine-readouts strong{font-weight:400;color:var(--ink)}
[data-machine-expanded] .machine-idea{font-size:12px;color:var(--amber)}
[data-machine-expanded] .machine-disclaimer{display:block;font-size:9px;color:var(--muted)}
[data-machine-expanded] .machine-open{display:none}
.engineering-machine [hidden]{display:none!important}
@media(max-width:800px){[data-machine-expanded] .engineering-machine{padding:18px 20px}[data-machine-expanded] .machine-body{grid-template-columns:180px minmax(0,1fr);gap:15px}[data-machine-expanded] .machine-bottom{padding-left:195px}.machine-instructions h3{font-size:23px}}
@media(max-width:600px){.scene[data-machine]{min-height:340px;aspect-ratio:350/350}.engineering-machine{padding:15px}.machine-number{font-size:8px}.machine-idea{font-size:10px}[data-machine-expanded] .engineering-machine{padding:14px 18px;overflow:auto}[data-machine-expanded] .machine-heading{position:relative;flex-shrink:0}[data-machine-expanded] .machine-body{display:flex;flex-direction:column-reverse;gap:0;flex:0 0 auto}[data-machine-expanded] .machine-drawing{width:100%;height:min(42dvh,340px);flex-shrink:0}[data-machine-expanded] .machine-instructions{align-self:stretch}[data-machine-expanded] .machine-instructions h3{font-size:22px;max-width:none;margin:0 0 12px}.machine-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 14px}.machine-steps button{padding:8px 0;font-size:10px;gap:8px}.machine-step-number{width:20px;height:20px;font-size:9px}.machine-playback{margin-top:10px;font-size:10px}[data-machine-expanded] .machine-bottom{padding:16px 0 0;gap:10px}[data-machine-expanded] .machine-hint{font-size:14px;min-height:0}[data-machine-expanded] .machine-readouts{font-size:9px;gap:8px 14px}[data-machine-expanded] .machine-idea{font-size:11px}}
@media(prefers-reduced-motion:reduce){.engineering-machine *{animation:none!important;transition:none!important}}

@media(prefers-reduced-motion:reduce){.machine-flow-signal{display:none}}

/* Fault and recovery states stay attached to the affected hardware. */
.machine-component-badge rect{fill:var(--panel);stroke:var(--anatomy-mid);stroke-width:.8}
.machine-component-badge text{fill:var(--ink)}
[data-component][data-component-state=offline],[data-component][data-component-state=failed]{--anatomy-lit:var(--red);--anatomy-lit-top:var(--anatomy-shade-1);--anatomy-lit-shade:var(--anatomy-shade-0)}
[data-component][data-component-state=offline] .iso-edge,[data-component][data-component-state=failed] .iso-edge{stroke:var(--red);stroke-width:1.1}
[data-component][data-component-state=offline] .iso-face-text,[data-component][data-component-state=failed] [data-field]{fill:var(--red)}
[data-component][data-component-state=active] .iso-edge,[data-component][data-component-state=safe] .iso-edge,[data-component][data-component-state=passed] .iso-edge{stroke:var(--green)}
.machine-component-badge[data-status=offline] rect{stroke:var(--red);stroke-width:1.3}
.machine-component-badge[data-status=offline] text{fill:var(--red);font-weight:700}
.machine-component-badge[data-status=active] rect,.machine-component-badge[data-status=safe] rect{stroke:var(--green);stroke-width:1.1}
.machine-component-badge[data-status=active] text,.machine-component-badge[data-status=safe] text{fill:var(--green)}
[data-component][data-component-state=passed] [data-field],[data-component][data-component-state=resolved] [data-field]{fill:var(--green)}
[data-flow][data-connection-state=offline]>.iso-line{stroke:var(--red);stroke-width:1.2;stroke-dasharray:4 5}
[data-flow][data-connection-state=failed]>.iso-line,[data-flow][data-connection-state=failed]>.machine-flow-signal{stroke:var(--red)}
.machine-event{display:none}
[data-machine-expanded] .machine-event{display:block;border-left:3px solid currentColor;padding:7px 0 7px 12px;color:var(--ink);font:13px/1.5 var(--mono);max-width:75ch}
[data-machine-expanded] .machine-event[data-tone=error]{color:var(--red)}
[data-machine-expanded] .machine-event[data-tone=success]{color:var(--green)}
[data-machine-expanded] .machine-event[data-tone=warning]{color:var(--amber)}
.engineering-machine[data-event-tone=error] .machine-steps button[aria-current=step]{color:var(--red)}
.engineering-machine[data-event-tone=error] .machine-steps button[aria-current=step] .machine-step-number{border-color:var(--red)}
@media(max-width:600px){[data-machine-expanded] .machine-event{font-size:11px;padding-left:9px}}

/* Request flow must read at a glance, not only in the rack's tiny LEDs. */
[data-machine] .machine-flow-signal{stroke-width:4;stroke-dasharray:7 15}
[data-machine] [data-flow][data-active=true]>.iso-line{stroke:var(--amber);stroke-width:1.1}
[data-machine] [data-component-state=working] .iso-edge{stroke:var(--amber);stroke-width:1.15}
[data-machine] [data-component-state=working] .iso-top{fill:var(--anatomy-lit-shade)}
[data-machine] .machine-body{position:relative}
[data-machine] .machine-readouts{display:flex;justify-content:space-between;gap:12px;font-size:10px;padding:12px 0;border-bottom:1px solid var(--line)}
[data-machine] .machine-readouts>span{display:flex;flex-direction:column;gap:5px}
[data-machine] .machine-readouts strong{font-family:var(--sans);font-size:24px;color:var(--amber)}
[data-machine][data-machine-expanded] .machine-body{grid-template-rows:auto minmax(0,1fr);align-content:center}
[data-machine][data-machine-expanded] .machine-instructions{grid-row:1/3}
[data-machine][data-machine-expanded] .machine-readouts{grid-column:2;grid-row:1;font-size:12px;justify-content:space-around}
[data-machine][data-machine-expanded] .machine-readouts strong{font-size:36px}
[data-machine][data-machine-expanded] .machine-drawing{grid-column:2;grid-row:2;height:100%}
@media(max-width:600px){[data-machine][data-machine-expanded] .machine-body{display:grid;grid-template-columns:1fr;grid-template-rows:auto auto auto}[data-machine][data-machine-expanded] .machine-readouts{grid-column:1;grid-row:1;font-size:10px}[data-machine][data-machine-expanded] .machine-readouts strong{font-size:28px}[data-machine][data-machine-expanded] .machine-drawing{grid-column:1;grid-row:2;height:min(42dvh,340px)}[data-machine][data-machine-expanded] .machine-instructions{grid-column:1;grid-row:3}}

[data-part][data-active=true] .iso-edge{stroke-width:1.2}
[data-part][data-active=true] .iso-top{fill:var(--anatomy-lit-shade)}
[data-part][data-active=true] [data-meter]{height:3px}
[data-component][data-component-state=offline] .iso-top,[data-component][data-component-state=failed] .iso-top{fill:#392323}
[data-component][data-component-state=active] .iso-top,[data-component][data-component-state=safe] .iso-top,[data-component][data-component-state=passed] .iso-top{fill:#23342c}

@media(max-width:600px){[data-machine] .machine-drawing{overflow:hidden}[data-machine] .machine-drawing>svg{width:125%;max-width:none;height:auto;flex-shrink:0;max-height:none}[data-machine][data-machine-expanded] .machine-drawing{height:min(36dvh,300px)}}

@media(max-width:600px){[data-machine] .machine-readouts,[data-machine][data-machine-expanded] .machine-readouts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;font-size:8px}[data-machine] .machine-readouts strong,[data-machine][data-machine-expanded] .machine-readouts strong{font-size:18px;line-height:1.4}}
