:root{color:#1c2430;--line:#d5dbe3;--on:#1f8a4c;--off:#8a94a3;--focus:#1a5fd0;--ink:#1c2430;--soft:#f6f8fb;--sun:#fff3c4;background:#e9eef4;font-family:system-ui,Segoe UI,Roboto,Noto Sans,sans-serif;font-size:15px}*,:before,:after{box-sizing:border-box}html,body,#root{height:100%;margin:0}h1,h2,h3,h4,p,figure{margin:0}h2{font-size:1.2rem;line-height:1.3}button,select{font:inherit;color:inherit}.button,select{border:1px solid var(--line);cursor:pointer;background:#fff;border-radius:8px;min-height:38px;padding:6px 12px}.button.primary{background:var(--ink);border-color:var(--ink);color:#fff}.button.chosen{border-color:var(--focus);box-shadow:inset 0 0 0 2px var(--focus)}.button:disabled,.switch:disabled,.link-button:disabled{opacity:.45;cursor:not-allowed}.link-button{color:var(--focus);cursor:pointer;background:0 0;border:none;padding:4px;text-decoration:underline}:focus-visible,.button:focus-within{outline:3px solid var(--focus);outline-offset:2px}.switch{border:1px solid var(--line);text-align:left;cursor:pointer;background:#fff;border-radius:8px;align-items:center;gap:8px;min-height:42px;padding:6px 10px;display:flex}.switch.on{border-color:var(--on);box-shadow:inset 4px 0 0 var(--on);background:#f1f9f4}.signal-name{flex:1;font-weight:600}.signal-meaning{color:#5b6573;font-size:.75rem}.signal-value{font:700 1.15rem ui-monospace,monospace}.points{margin:0 0 6px;padding-left:20px;line-height:1.55}.points.small{font-size:.9rem;line-height:1.45}.points.big{font-size:1.08rem;line-height:1.75}.stage{letter-spacing:.05em;text-transform:uppercase;color:#40536b;margin:0 0 4px;font-size:.72rem;font-weight:700}.badge{color:#1a4fa8;text-transform:uppercase;background:#e6eefc;border-radius:999px;padding:1px 8px;font-size:.72rem;font-weight:700;display:inline-block}.muted{color:#5b6573}.tiny{font-size:.8rem}.nav-row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.truth-table{border-collapse:collapse;font-family:ui-monospace,monospace}.truth-table th,.truth-table td{border:1px solid var(--line);text-align:center;white-space:nowrap;padding:4px 10px}.truth-table.compact th,.truth-table.compact td{padding:2px 8px;font-size:.85rem}.truth-table .output-col{background:#eef6f1}.truth-table td.high{color:var(--on);font-weight:700}.truth-table tr.current-row td{background:var(--sun);font-weight:700}.visually-hidden{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.app{flex-direction:column;max-width:1320px;height:100dvh;margin:0 auto;padding:8px 14px 12px;display:flex}.app-header{align-items:center;gap:10px;padding:2px 4px 8px;display:flex}.app-header h1{font-size:1.35rem}.logo{fill:#fff;width:34px;height:24px;stroke:var(--ink);stroke-width:3px}.tag{border:1px solid var(--line);background:#fff;border-radius:999px;padding:2px 10px;font-size:.75rem}.tab-container{flex-direction:column;flex:1;min-height:0;display:flex}.tab-strip{gap:4px;padding-left:8px;display:flex}.tab{border:1px solid var(--line);color:#3a4452;cursor:pointer;background:#dfe5ec;border-bottom:none;border-radius:12px 12px 0 0;align-items:center;gap:8px;padding:9px 18px;font-weight:600;display:flex;position:relative}.tab.active{color:var(--ink);box-shadow:inset 0 3px 0 var(--focus);background:#fff;top:1px}.tab-short{display:none}.tab-body{border:1px solid var(--line);background:#fff;border-radius:12px;flex:1;min-height:0;padding:14px 16px;overflow:auto;box-shadow:0 2px 10px #1c24300f}.view{height:100%;min-height:0}@media (max-width:760px){:root{font-size:14px}.app{padding:4px 6px 6px}.app-header{padding-bottom:4px}.app-header .tag{display:none}.tab-strip{padding-left:0}.tab{flex:1;justify-content:center;padding:8px 6px}.tab-long{display:none}.tab-short{display:inline}.tab-body{border-radius:0 0 12px 12px;padding:10px}}.slides{grid-template-rows:auto minmax(0,1fr) auto;gap:10px;display:grid}.chip-row{scrollbar-width:thin;gap:6px;padding-bottom:2px;display:flex;overflow-x:auto}.chip{border:1px solid var(--line);cursor:pointer;background:#fff;border-radius:999px;flex:none;padding:4px 12px;font-size:.85rem}.chip.done{background:#eef6f1;border-color:#b9dcc7}.chip.active{background:var(--ink);border-color:var(--ink);color:#fff}.slide-body{min-height:0;overflow:auto}.slide{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-content:start;gap:18px;height:100%;display:grid}.slide-col{flex-direction:column;gap:8px;min-width:0;display:flex}.intro-slide{align-content:center;align-items:center}.intro-slide h2{font-size:1.5rem}.scene-frame{background:var(--soft);border:1px solid var(--line);border-radius:12px;justify-content:center;padding:6px;display:flex}.scene-frame svg{width:100%;height:auto;max-height:min(42vh,330px)}.gate-slide .scene-frame svg{max-height:min(31vh,240px)}.toggle-row{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.toggle-row .switch{flex:170px}.result-pill{background:var(--sun);border-radius:8px;flex:100%;padding:6px 10px;font-size:.95rem}.rule-row{align-items:flex-start;gap:12px;display:flex}.rule-row .gate-symbol{flex:none}.rule{border-left:4px solid var(--focus);background:#eef3fb;border-radius:4px;margin-bottom:6px;padding:6px 10px;font-weight:700}.table-check{grid-template-columns:auto minmax(0,1fr);gap:16px;display:grid}.question{margin-bottom:6px;font-weight:600}.option-row{flex-wrap:wrap;gap:6px;display:flex}.feedback{border-radius:8px;margin-top:8px;padding:8px 10px;font-size:.9rem;line-height:1.45}.feedback.good{background:#e8f6ee;border:1px solid #a9d8bb}.feedback.try{background:#fff4e5;border:1px solid #f0c98a}.how-to{background:var(--soft);border-radius:8px;margin-top:8px;padding:8px 12px}.slide-nav{border-top:1px solid var(--line);justify-content:space-between;align-items:center;gap:8px;padding-top:8px;display:flex}@media (max-width:760px){.slide{grid-template-columns:minmax(0,1fr);gap:10px;height:auto}.intro-slide h2{font-size:1.2rem}.scene-frame svg,.gate-slide .scene-frame svg{max-height:26vh}.points.big{font-size:1rem;line-height:1.6}.rule-row .gate-symbol{width:90px;height:62px}}.experiment{grid-template-columns:minmax(290px,370px) minmax(0,1fr);gap:16px;display:grid}.exp-left,.exp-right{flex-direction:column;gap:10px;min-height:0;display:flex}.exp-left{padding-right:4px;overflow:auto}.picker{flex-direction:column;display:flex}.picker select{width:100%}.step-panel{flex-direction:column;gap:6px;display:flex}.progress{align-items:center;gap:5px;display:flex}.dot{background:var(--line);border-radius:3px;width:22px;height:6px}.dot.done{background:var(--on)}.dot.active{background:var(--focus)}.story{background:var(--sun);border-radius:8px;padding:6px 10px 6px 26px}.predict{background:#fff8e6;border:1px solid #f0d58a;border-radius:8px;flex-wrap:wrap;align-items:center;gap:6px;padding:8px 10px;display:flex}.predict p{flex-basis:100%;font-weight:600}.controls{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.controls .switch{flex:150px}.visual-row{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:12px;display:grid}.visual-card{flex-direction:column;gap:4px;min-width:0;display:flex}.visual-card .scene-frame{flex:1;align-items:center}.visual-card .scene-frame svg{max-height:min(34vh,250px)}.gate-diagram{border:1px solid var(--line);background:#fff;border-radius:12px;width:100%;height:auto;max-height:min(34vh,250px)}.impact{border:2px solid var(--line);background:#fff;border-radius:10px;padding:10px 14px}.impact h3{margin-bottom:6px;font-size:1rem}.impact h4{margin-bottom:2px;font-size:.88rem}.impact ul{margin:0;padding-left:18px;font-size:.92rem;line-height:1.5}.impact.done{border-color:var(--on);background:#f3faf6}.impact.waiting{border-style:dashed}.impact-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.table-compare{flex-wrap:wrap;gap:24px;padding:8px 4px;display:flex}.summary{border:2px solid var(--on);background:#f3faf6;border-radius:10px;flex-direction:column;gap:8px;padding:12px;display:flex}@media (max-width:1000px){.impact-grid{grid-template-columns:minmax(0,1fr);gap:4px}}@media (max-width:760px){.experiment{flex-direction:column;gap:10px;height:auto;display:flex}.exp-left,.exp-right{display:contents}.picker{order:1}.step-panel,.summary{order:2}.visual-row,.table-compare{order:3}.impact{order:4}.obs{order:5}.visual-row{grid-template-columns:minmax(0,1fr)}.visual-card .scene-frame svg,.gate-diagram{max-height:24vh}.sticky-nav{z-index:2;border-top:1px solid var(--line);background:#fff;order:10;padding:8px 0;position:sticky;bottom:-10px}.sticky-nav .button.primary{flex:1}}.lab{grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:8px;display:grid}.lab-bar{flex-wrap:wrap;align-items:center;gap:8px 12px;display:flex}.starter{align-items:center;gap:8px;font-weight:600;display:flex}.file-actions{gap:8px;display:flex}.status{color:#3a4452;margin-left:auto;font-size:.85rem}.lab-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-height:0;display:grid;overflow:auto}.panel{border:1px solid var(--line);background:#fff;border-radius:10px;min-width:0;padding:10px 14px}.panel h2{margin-bottom:8px;font-size:1rem}.signal-list{gap:8px;margin:0;padding:0;list-style:none;display:grid}.signal-list .switch,.indicator{width:100%}.indicator{border:1px solid var(--line);border-radius:8px;align-items:center;gap:10px;min-height:42px;padding:6px 10px;display:flex}.lamp{border:2px solid var(--off);border-radius:50%;width:18px;height:18px}.indicator.on .lamp{background:#f5c518;border-color:#b38a00}.diagnostics{max-height:96px;margin:0;padding-left:18px;font-size:.85rem;overflow:auto}.diag.error strong{color:#b42318}.diag.warning strong{color:#9a6700}:is(.lab .panel:has(.diagnostics),.lab .panel:has([data-testid=diagnostics-empty])){padding:6px 14px}@media (max-width:760px){.lab{flex-direction:column;display:flex}.lab-grid{grid-template-columns:minmax(0,1fr);overflow:visible}.status{flex-basis:100%;margin-left:0}}.gate-symbol{width:120px;height:82px}.gate-shape path,.gate-shape circle{fill:#fff;stroke:var(--ink);stroke-width:3px}.gate-name{text-anchor:middle;fill:var(--ink);font-size:13px;font-weight:700}.stub{stroke:var(--ink);stroke-width:3px}.wire{stroke-width:3px}.wire.on{stroke:var(--on);stroke-width:5px}.wire.off,.wire.unknown{stroke:var(--off);stroke-dasharray:7 5}.wire-value{fill:var(--ink);font:700 14px ui-monospace,monospace}.input-box rect{fill:#fff;stroke:var(--off);stroke-width:2px}.input-box.on rect{fill:#eef6f1;stroke:var(--on);stroke-width:3px}.box-label{font-size:13px;font-weight:700}.box-value{fill:#3a4452;font-size:12px}.lamp-big{fill:#fff;stroke:var(--off);stroke-width:3px}.lamp-big.on{fill:#f5c518;stroke:#b38a00}.lamp-value,.lamp-label,.lamp-meaning{text-anchor:middle}.lamp-value{font:700 18px ui-monospace,monospace}.lamp-label{font-size:13px;font-weight:700}.lamp-meaning{fill:#3a4452;font-size:12px}.locker-frame{fill:#6b7480;stroke:#3d4550;stroke-width:2px}.locker-door{stroke:#4b5563;stroke-width:2px}.locker-inside{fill:#1f2630}.number-plate{fill:#e2c15f;stroke:#8a6d0b}.number-text{text-anchor:middle;fill:#3d2f05;font:700 10px ui-monospace,monospace}.locker-handle,.hinge{fill:#2f3640}.escutcheon{fill:#d9b23c;stroke:#8a6d0b;stroke-width:1.5px}.slot circle,.slot rect{fill:#1f2630}.key rect,.key circle{fill:#e8c547;stroke:#8a6d0b;stroke-width:1.5px}.key .key-hole{fill:#b4bcc6}.locker-key-label{text-anchor:middle;fill:#1f2630;font-size:10px;font-weight:700}.deposit-box{fill:#9aa3ad;stroke:#4b5563}.gold{fill:#f2c230;stroke:#a07800}.scene text{font-family:system-ui,Segoe UI,sans-serif}.scene-label,.scene-title,.scene-shout,.big-digit,.gate-box-text,.quiet-text,.answer-text,.table-head,.table-cell{text-anchor:middle}.scene-label{fill:#1f2630;font-size:11px;font-weight:700}.scene-label.start,.scene-shout.start{text-anchor:start}.scene-title{fill:#1f2630;font-size:18px;font-weight:800}.scene-shout{fill:#c2410c;font-size:13px;font-weight:800}.scene-wall,.paper{fill:#f6f8fb}.sky-day{fill:#cfe8fb}.sky-night{fill:#1e2a4a}.ground{fill:#9bc77a}.road{fill:#4b5563}.fence,.post{fill:#b07a45}.roof{fill:#c2410c}.wall{fill:#fde7c3;stroke:#b07a45}.window{fill:#bfe0f5;stroke:#6b7480}.door{fill:#8b5a2b}.knob{fill:#f2c230}.push{fill:#e5e7eb;stroke:#4b5563;stroke-width:2px}.push.on{fill:#ef4444;stroke:#991b1b}.bell path,.bell circle{fill:#c9a227;stroke:#7a5f0d}.bell.ringing path{fill:#f2c230}.waves path{fill:none;stroke:#c2410c;stroke-width:2.5px;stroke-linecap:round}.sun circle,.sun rect{fill:#f5b301}.moon circle{fill:#f4f1d0}.moon .sky-night{fill:#1e2a4a}.star{fill:#fff}.pole,.arm{fill:#4b5563;stroke:#4b5563;stroke-width:4px}.arm{fill:none}.lamp-head{fill:#6b7480}.lamp-head.on{fill:#fde047}.beam{fill:#fde04773}.sensor{fill:#e5e7eb;stroke:#4b5563}.sensor-eye{fill:#6b7480}.sensor-eye.on{fill:#f5b301}.car-inside,.classroom{fill:#eef2f6}.dashboard{fill:#2f3640}.warning circle{fill:#6b7480}.warning.on circle{fill:#dc2626}.warning .icon{fill:#fff}.warning .icon-line{stroke:#fff;stroke-width:3px}.dash-text{font-size:13px;font-weight:800}.dash-text.warn{fill:#fca5a5}.dash-text.safe{fill:#86efac}.scene-label.on-dark{fill:#fff}.seat{fill:#64748b}.skin{fill:#c68b59}.shirt{fill:#2563eb}.belt{stroke:#9ca3af;stroke-width:6px;stroke-linecap:round}.belt.on{stroke:#111827}.arm-line{stroke:#c68b59;stroke-width:6px;stroke-linecap:round}.desk{fill:#a16207}.quiet{fill:#9ca3af}.quiet.on{fill:#16a34a}.quiet-text{fill:#fff;font-size:14px;font-weight:800}.room-lit{fill:#fff7d6}.room-dark{fill:#3b4252}.stairs{fill:#b08968;stroke:#7f5539}.bulb-wire{stroke:#4b5563;stroke-width:2px}.bulb{fill:#e5e7eb;stroke:#6b7480;stroke-width:2px}.bulb.on{fill:#fde047;stroke:#b38a00}.bulb-glow{fill:#fde04759}.bulb-base{fill:#6b7480}.big-digit{fill:#1f2630;font:800 28px ui-monospace,monospace}.switch-plate{fill:#f8fafc;stroke:#6b7480}.switch-knob{fill:#1f2630}.room-dark .scene-label,.room-dark~g .scene-label{fill:#fff}.card{fill:#fff;stroke:#cbd5e1}.answer.yes{fill:#16a34a}.answer.no{fill:#ea580c}.answer-text{fill:#fff;font-size:18px;font-weight:800}.bubble{fill:#fff;stroke:#cbd5e1}.tick{fill:#d1d5db}.tick.on{fill:#16a34a}.tick-mark{fill:none;stroke:#fff;stroke-width:5px;stroke-linecap:round;stroke-linejoin:round}.toggle{fill:#e5e7eb;stroke:#6b7480}.toggle.on{fill:#bbf7d0;stroke:var(--on)}.toggle-knob{fill:var(--on)}.gate-box{fill:#fff;stroke:var(--ink);stroke-width:3px}.gate-box-text{fill:var(--ink);font-size:15px;font-weight:800}.device{fill:#e5e7eb;stroke:#4b5563;stroke-width:2px}.device-dark{fill:#2f3640}.screen{fill:#93c5fd;stroke:#4b5563}.slot-dark{fill:#1f2630}.cash{fill:#86efac}.signal-red{fill:#ef4444}.signal-off{fill:#6b7480}.lift-gap,.lift-arrow{stroke:#4b5563;stroke-width:2px;fill:none}.tag-in{fill:#dbeafe}.tag-out{fill:#dcfce7}.table-head{font-size:13px;font-weight:800}.table-cell{font:700 14px ui-monospace,monospace}.table-line{stroke:#94a3b8;stroke-width:1.5px}.row-highlight{fill:var(--sun)}
