/* The factory is a working scene; historical case evidence lives in its hover viewport. */
body[data-view="factory"]{background:#060e17}
body[data-view="factory"] .header{background:#070f18f5;border-color:#203340}
body[data-view="factory"] .hero{background:radial-gradient(ellipse at 50% 55%,#123f4e59,transparent 65%),linear-gradient(145deg,#07131c,#071016 65%,#0b1c24)}
body[data-view="factory"] .hero-copy{padding:15px 3.4% 15px}
body[data-view="factory"] .hero-headline h1{font-size:29px;letter-spacing:-.6px}
body[data-view="factory"] .factory{padding:0 2.5% 9px}
body[data-view="factory"] .factory-topline{padding:11px 8px 6px;border-color:#29444e}
body[data-view="factory"] .factory-layout{display:block;position:relative;isolation:isolate}
body[data-view="factory"] .scene{height:100%;min-height:0}
body[data-view="factory"] .scene-grid{opacity:.45;background-size:65px 65px}
body[data-view="factory"] .scene-coordinate,body[data-view="factory"] .scene-legend{display:none}
body[data-view="factory"] .scene-glow{background:radial-gradient(ellipse at 48% 45%,#4acdb119,transparent 68%)}
.factory-floor{stroke:#315b61;stroke-width:.6;stroke-opacity:.22}
.floor-labels{font:7px monospace;letter-spacing:1.2px;fill:#4a727a}
.belt-edge{fill:none;stroke:#37616a;stroke-width:27;stroke-linejoin:round}
.belt-bed{fill:none;stroke:#0c2029;stroke-width:24;stroke-linejoin:round}
.belt-rollers{fill:none;stroke:#315959;stroke-width:17;stroke-dasharray:2 10;stroke-linejoin:round;opacity:.9}
.belt-signal{fill:none;stroke:#9cf9d8;stroke-width:1.5;stroke-dasharray:9 75;animation:belt-run 5.4s linear infinite;filter:drop-shadow(0 0 4px #78ebcb)}
.cargo-packet{offset-rotate:0deg;animation:cargo-move 5.4s linear infinite;filter:drop-shadow(0 3px 5px #000a)}
.cargo-packet path:first-child{fill:#e5c78f;stroke:#fce1ae;stroke-width:.7}
.cargo-packet path:nth-of-type(2){fill:#b18c57;stroke:#e4c388;stroke-width:.7}
.factory-plinth{fill:url(#plinth);stroke:#577c83;stroke-width:1}
.factory-plinth-side{fill:#0b242e;stroke:#335963;stroke-width:.8}
.plinth-light{fill:none;stroke:#67cbb3;stroke-width:1.5;opacity:.5}
.station.active .factory-plinth,.station:hover .factory-plinth,.station:focus-visible .factory-plinth{stroke:#a8ffe8;fill:#235754}
.station.active .plinth-light,.station:hover .plinth-light{opacity:1;filter:drop-shadow(0 0 5px #8afcce)}
.machine-back{fill:#12333e;stroke:#4b7888;stroke-width:.8}
.machine-roof{fill:#395e68;stroke:#86b5ba;stroke-width:.8}
.machine-frame{fill:none;stroke:#81b6bd;stroke-width:3}
.machine-side{fill:#17323d;stroke:#507985;stroke-width:1}
.machine-pane{fill:url(#machine-glass);stroke:#477884;stroke-width:.8}
.station .icon-line{stroke:#b8eae8;stroke-width:2;opacity:.9}
.station .icon-fill{stroke:#7cb4b7;fill:#254b56;stroke-width:1.5}
.control-console path{stroke:#7ba3af;stroke-width:.8;fill:#254550}
.control-console path.console-screen{fill:#7fe7ce;stroke:#a0ffe0;opacity:.85}
.robot-base ellipse{fill:#16333c;stroke:#6e9a9f;stroke-width:1}
.robot-base>path{fill:#6d9497;stroke:#a8c7c3;stroke-width:1}
.robot-arm path{fill:none;stroke:#d1c4a4;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}
.robot-arm path:last-child{stroke:#add7d3;stroke-width:2}
.robot-arm circle{fill:#d1c4a4;stroke:#557979;stroke-width:1.2}
.robot-arm{transform-origin:65px 10px;animation:robot-work 2.2s ease-in-out infinite}
.station[data-phase="receive"] .robot-arm,.station[data-phase="handoff"] .robot-arm{animation-duration:3.3s}
.ai-chip{fill:#0c2933;stroke:#76bfbb;stroke-width:.6}
.ai-chip-text{fill:#b6fbdf;font:7px monospace;letter-spacing:.7px}
.machine-led{fill:#9bffcf;filter:drop-shadow(0 0 3px #91ffcb);animation:status-led 1.1s steps(2) infinite}
.machine-led.secondary{fill:#d7bf82;animation-delay:.5s}
.scan-line{fill:#a5ffea;filter:drop-shadow(0 0 5px #8af4db);animation:scan-machine 2.1s ease-in-out infinite}
.laser-plane{fill:#72f2d0;opacity:.09;stroke:#97fede;stroke-width:.6;animation:laser-volume 2.1s ease-in-out infinite}
.station[data-phase="handoff"] .scan-line,.station[data-phase="receive"] .scan-line{opacity:.2;animation-play-state:paused}
.station[data-phase="handoff"] .laser-plane,.station[data-phase="receive"] .laser-plane{opacity:.03;animation-play-state:paused}
.station[data-phase="handoff"] .ai-chip{fill:#294638;stroke:#d3d09c}
.station .station-label{font-size:20px!important;fill:#dbebea;letter-spacing:.6px}
.station-id{fill:#547e8a;font:8px monospace;letter-spacing:.5px}
.phase-label{fill:#80aaac;font:8px monospace;letter-spacing:.3px}
.station[data-phase="process"] .phase-label{fill:#9df3df}
.station[data-phase="handoff"] .phase-label{fill:#d4c68f}
.work-badge rect{fill:#0c202a;stroke:#315662;stroke-width:.6}
.work-badge .work-action{fill:#8bbabb;font:11px -apple-system,"PingFang SC",sans-serif;letter-spacing:.4px}
.station[data-phase="process"] .work-badge rect{fill:#123a3a;stroke:#559c92}
.station[data-phase="process"] .work-action{fill:#b9fce9}
.station[data-phase="handoff"] .work-action{fill:#dbcba0}
.work-progress-track{fill:#233d48}
.work-progress{fill:#85e6c6;filter:drop-shadow(0 0 2px #85e6c6)}
.station[data-phase="handoff"] .work-progress{fill:#e0c384}
body[data-view="factory"] .factory-bottom{border-color:#28424b;padding:13px 8px}
body[data-view="factory"] .factory-bottom small{font-size:10px;color:#81a7ac;display:block}
body[data-view="factory"] .inspector{display:none;position:fixed;z-index:25;top:max(112px,15svh);right:24px;width:min(820px,60vw);max-height:calc(100svh - 145px);margin:0;overflow:auto;background:#0d1b24f7;border:1px solid #75c7bc;border-radius:8px;backdrop-filter:blur(22px);box-shadow:0 25px 120px #000b,0 0 35px #65e7cc14;align-self:auto;animation:peek-in .16s ease}
body[data-view="factory"] .inspector.peek-open{display:block}
body[data-view="factory"] .inspector[data-side="left"]{right:auto;left:24px}
.inspector.peek-open .inspector-head{padding:12px 16px;font-size:9px;border-bottom:1px solid #2a4449}
.peek-head-actions{display:flex;align-items:center;gap:15px}
.peek-head-actions button{font-size:21px;line-height:1;color:#c2dedb;background:transparent;padding:0 3px}
.inspector.peek-open .inspector-media{height:min(52svh,470px);margin:10px 12px 0;background:#091015;border:1px solid #2d454a;border-radius:3px;overflow:hidden}
.inspector.peek-open .inspector-media img{width:100%;height:100%;object-fit:contain;animation:none;image-rendering:auto}
.inspector.peek-open .media-tag{font-size:9px;bottom:8px;left:8px;padding:6px 9px;background:#081713e6}
.inspector.peek-open .inspector-body{padding:13px 17px 15px}
.inspector.peek-open .inspector-body h3{font-size:18px;margin-bottom:5px}
.inspector.peek-open .inspector-body p{font-size:10px;line-height:1.8;max-width:650px}
.inspector.peek-open .inspector-footer{margin-top:11px;justify-content:flex-end;gap:20px}
.inspector.peek-open .inspector-open{font-size:11px}
.inspector.peek-open .inspector-date{font-size:9px}
.peek-zoom{background:transparent;color:#a0e7d2;padding:0;font-size:10px;margin-right:auto}
.inspector.peek-open .inspector-switches{margin-top:12px}
.inspector.peek-open .inspector-switches button{width:23px;height:4px}
@keyframes cargo-move{from{offset-distance:0%}to{offset-distance:100%}}
@keyframes belt-run{to{stroke-dashoffset:-168}}
@keyframes robot-work{0%,100%{transform:rotate(-5deg)}45%{transform:rotate(11deg)}65%{transform:rotate(7deg)}}
@keyframes scan-machine{0%,100%{transform:translateY(0);opacity:.3}50%{transform:translateY(49px);opacity:1}}
@keyframes laser-volume{0%,100%{transform:translateY(-5px);opacity:.04}50%{transform:translateY(15px);opacity:.2}}
@keyframes status-led{50%{opacity:.25}}
@keyframes peek-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:1150px) and (min-width:851px){body[data-view="factory"] .inspector{width:min(740px,70vw)}.factory-caption small{font-size:9px}.scene-note{font-size:8px}}
@media(max-width:850px){body[data-view="factory"] .inspector{display:none!important}body[data-view="factory"] .scene{height:470px}.factory-caption small{font-size:9px}.scene-note{font-size:8px}.factory-bottom #current-action{max-width:250px;font-size:9px}}
@media(max-width:600px){body[data-view="factory"] .scene{height:760px}body[data-view="factory"] .hero-headline h1{font-size:22px}.factory-caption small{display:none}.scene-note{font-size:7px}.factory-bottom #current-action{display:none!important}.station .station-label{font-size:21px!important}.work-badge .work-action{font-size:12px}.phase-label{font-size:9px}.floor-labels{font-size:6px}}
@media(prefers-reduced-motion:reduce){.cargo-packet,.belt-signal,.robot-arm,.machine-led,.scan-line,.laser-plane{animation:none!important}.cargo-packet{offset-distance:50%}.scan-line{transform:translateY(24px)}.laser-plane{opacity:.08}}

/* A transformed entrance wrapper must not become the fixed preview viewport. */
body[data-view="factory"] .factory{animation:none!important;transform:none!important}
body[data-view="factory"] .inspector{background:#0d1b24;max-height:calc(100svh - 132px);top:112px;width:min(880px,65vw)}
.inspector.peek-open .inspector-media{height:min(54svh,490px)}
.inspector.peek-open .inspector-body h3{font-size:17px}
.inspector.peek-open .inspector-body p{font-size:10px}

.cargo-label{font:8px -apple-system,"PingFang SC",sans-serif;fill:#a0b9b7;paint-order:stroke;stroke:#0b1e29;stroke-width:3px;stroke-linejoin:round}
body.motion-paused #inspector.peek-open{animation:none!important;opacity:1}

/* Evidence labels remain visible when a screenshot is enlarged. */
#lightbox-caption{position:sticky;bottom:0;margin:0;padding:12px 42px 12px 18px;background:#101c23;color:#d7e6e4;font-size:12px;line-height:1.6;text-align:center}#image-dialog[data-mode="simulated"] #lightbox-caption{color:#f2cd93;background:#302719}#image-dialog img{max-height:calc(90svh - 65px)}
