:root{--bg:#f6f7f9;--surface:#fff;--border:#e2e6eb;--text:#1a1d23;--text-muted:#6b7280;--accent:#3b6cf4;--accent-soft:#eef2fe;--success:#16a34a;--success-soft:#ecfdf3;--error:#dc2626;--error-soft:#fef2f2;--wire:#4b5563;--port:#3b6cf4;--shadow:0 1px 3px #0000000f, 0 4px 12px #0000000a;color:var(--text);background:var(--bg);font-family:Inter,system-ui,-apple-system,sans-serif;line-height:1.5}*{box-sizing:border-box;margin:0;padding:0}body,#root{min-height:100vh}button{font:inherit;cursor:pointer;background:0 0;border:none}.app{grid-template-rows:auto 1fr auto;height:100dvh;display:grid;overflow:hidden}.holo-theme{background:radial-gradient(120% 100% at 0% 0%, #1e293b 0%, #0f172a 55%, #020617 100%), var(--bg);color:#e2e8f0}.cockpit-header{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#020617b8;border-bottom:1px solid #94a3b84d;grid-template-columns:auto auto 1fr;align-items:center;gap:.85rem;padding:.65rem .9rem;display:grid}.header-brand{align-items:center;gap:.7rem;display:flex}.logo{color:#fff;background:linear-gradient(135deg,#38bdf8,#3b82f6,#7c3aed);border-radius:.65rem;place-items:center;width:2.1rem;height:2.1rem;display:grid;box-shadow:0 0 18px #38bdf873}.logo-icon{width:1.35rem;height:1.35rem}.header-brand h1{font-size:.98rem;line-height:1.1}.header-title-row{align-items:center;gap:.4rem;display:flex}.help-btn{color:#cbd5e1;background:#0f172aa6;border:1px solid #94a3b873;border-radius:999px;place-items:center;width:1.35rem;height:1.35rem;padding:0;font-size:.78rem;font-weight:700;line-height:1;display:grid}.help-btn:hover{color:#e0f2fe;border-color:#38bdf8d9}.attribution-backdrop{z-index:100;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#020617b8;place-items:center;padding:1rem;display:grid;position:fixed;inset:0}.attribution-modal{background:linear-gradient(160deg,#0f172afa,#020617f2);border:1px solid #94a3b859;border-radius:.85rem;width:min(100%,22rem);padding:1rem 1rem .9rem;position:relative;box-shadow:0 18px 48px #02061773}.attribution-modal h2{margin-bottom:.55rem;font-size:.95rem}.attribution-modal p{color:#cbd5e1;font-size:.8rem;line-height:1.5}.attribution-modal p+p{margin-top:.55rem}.attribution-modal a{color:#7dd3fc;text-underline-offset:2px;text-decoration:underline}.attribution-note{color:#94a3b8;font-size:.74rem}.attribution-close{color:#94a3b8;background:0 0;border:none;border-radius:.45rem;width:1.6rem;height:1.6rem;font-size:1.2rem;line-height:1;position:absolute;top:.45rem;right:.45rem}.attribution-close:hover{color:#e2e8f0;background:#94a3b81f}.run-status{background:#0f172a99;border:1px solid #38bdf859;border-radius:.6rem;flex-direction:column;align-items:flex-start;padding:.45rem .7rem;display:flex}.status-label{text-transform:uppercase;letter-spacing:.08em;color:#7dd3fc;font-size:.62rem}.run-status strong{font-size:1rem}.navigator{grid-template-columns:repeat(2,minmax(10.5rem,1fr));justify-self:end;gap:.5rem;width:min(100%,26rem);display:grid}.field{flex-direction:column;gap:.25rem;display:flex}.field span{color:#93c5fd;text-transform:uppercase;letter-spacing:.08em;font-size:.62rem}.field select{color:#e2e8f0;background:#0f172ad9;border:1px solid #94a3b873;border-radius:.55rem;width:100%;padding:.4rem .55rem;font-size:.82rem}.cockpit-main{grid-template-columns:minmax(0,1fr) 19.5rem;gap:.75rem;min-height:0;padding:.75rem;display:grid}.build-bay{grid-template-rows:auto auto 1fr auto;gap:.5rem;min-height:0;display:grid}.build-bay-title h2{letter-spacing:.01em;font-size:1.02rem}.eyebrow{text-transform:uppercase;letter-spacing:.08em;color:#7dd3fc;margin-bottom:.1rem;font-size:.62rem}.toolbox{background:linear-gradient(160deg,#0f172af2,#0f172aa6);border:1px solid #7dd3fc4d;border-radius:.8rem;grid-template-columns:auto 1fr auto;align-items:center;gap:.5rem;padding:.55rem .65rem;display:grid;box-shadow:inset 0 0 0 1px #0ea5e914}.toolbox-label{text-transform:uppercase;letter-spacing:.09em;color:#bae6fd;font-size:.64rem}.toolbox-items{flex-wrap:wrap;gap:.35rem;display:flex}.tool-btn{color:#cbd5e1;background:#0f172aa6;border:1px solid #94a3b873;border-radius:.6rem;align-items:center;gap:.28rem;min-height:2rem;padding:.3rem .5rem;font-size:.72rem;transition:transform .12s,border-color .12s;display:inline-flex}.tool-btn:hover{border-color:#38bdf8d9;transform:translateY(-1px)}.wire-hint{color:#94a3b8;font-size:.68rem}.wire-hint.active{color:#38bdf8;font-weight:600}.canvas-wrap{-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;background:radial-gradient(90% 120% at 0 0,#0ea5e91f,#0f172a1a),#0f172ab8;border:1px solid #38bdf847;border-radius:1rem;min-height:0;overflow:auto;box-shadow:inset 0 0 0 1px #0ea5e914}.circuit-canvas{-webkit-user-select:none;user-select:none;touch-action:pan-x pan-y;width:100%;height:100%;display:block}.wire{stroke-width:2.8px;pointer-events:none}.wire-off{stroke:#475569;filter:none}.wire-on{stroke:#fbbf24;filter:drop-shadow(0 0 4px #fbbf24bf)}.wire-flow{stroke:#fef08a;stroke-width:2px;stroke-dasharray:6 10;pointer-events:none;filter:drop-shadow(0 0 3px #fef08ae6);animation:.7s linear infinite wire-flow}@keyframes wire-flow{to{stroke-dashoffset:-16px}}.wire-hit{stroke:#0000;stroke-width:16px;cursor:pointer}.wire-pending{fill:#38bdf8;opacity:.8}.component.draggable{cursor:grab;touch-action:none}.canvas-wrap.is-dragging{touch-action:none;overflow:hidden}.comp-body{fill:#0f172af2;stroke:#94a3b8a6;stroke-width:1.4px}.gate-shape{fill:#1e3a8a57;stroke:#7dd3fc}.gate-bubble{fill:#0f172a;stroke:#7dd3fc;stroke-width:1.4px}.xor-extra{stroke:#38bdf8;stroke-width:1.4px;fill:none}.power-shape{fill:#f59e0b3d;stroke:#f59e0b}.input-shape{fill:#1e293bd1;stroke:#60a5fa;cursor:pointer}.input-shape.on{fill:#0369a173;stroke:#38bdf8;filter:drop-shadow(0 0 6px #38bdf88c)}.input-shape.off{fill:#1e293bd1;stroke:#64748b}.input-label.on{fill:#e0f2fe}.input-indicator{stroke-width:1.5px;pointer-events:none}.input-indicator.on{fill:#fbbf24;stroke:#fde68a;filter:drop-shadow(0 0 4px #fbbf24cc)}.input-indicator.off{fill:#334155;stroke:#64748b}.output-shape{fill:#10b98133;stroke:#22c55e}.comp-label{fill:#e2e8f0;letter-spacing:.03em;font-size:10px;font-weight:700}.comp-sublabel{fill:#cbd5e1;font-size:9px}.ground-rail{stroke:#64748b;stroke-width:3px;stroke-linecap:round;opacity:.55}.relay-body{fill:#0f172af2}.relay-terminal{stroke:#94a3b8;stroke-width:2px}.relay-switch{stroke-width:3px;fill:none;stroke-linecap:round}.relay-switch-closed{stroke:#fbbf24;filter:drop-shadow(0 0 3px #fbbf2499)}.relay-switch-open{stroke:#94a3b8}.relay-coil{fill:#334155cc;stroke:#64748b;stroke-width:1.2px}.relay-coil-active{fill:#f59e0b59;stroke:#fbbf24;filter:drop-shadow(0 0 5px #fbbf248c)}.relay-coil-lead{stroke:#94a3b8;stroke-width:1.5px}.relay-kind-label{fill:#94a3b8;letter-spacing:.04em;font-size:8px;font-weight:700}.component.relay_on .relay-body{stroke:#4ade8073}.component.relay_off .relay-body{stroke:#94a3b8a6}.component.relay-closed .relay-body{stroke:#fbbf248c}.port-live{fill:#422006;stroke:#fbbf24}.port-hit{fill:#0000;stroke:#0000;cursor:crosshair}.port{fill:#0f172a;stroke:#7dd3fc;stroke-width:2px;pointer-events:none}.port-active{fill:#38bdf8;stroke:#e0f2fe}.control-bar{grid-template-columns:auto 1fr;align-items:center;gap:.5rem;display:grid}.btn{letter-spacing:.02em;border-radius:.65rem;min-height:2.2rem;padding:.35rem .85rem;font-size:.78rem}.btn.primary{color:#fff;background:linear-gradient(120deg,#0ea5e9,#2563eb);border:1px solid #7dd3fcb3}.btn.secondary{color:#e2e8f0;background:#0f172aa6;border:1px solid #94a3b873}.feedback{border:1px solid #0000;border-radius:.55rem;grid-column:1/-1;padding:.42rem .55rem;font-size:.75rem}.feedback.success{color:#4ade80;background:#14532d59;border-color:#4ade8073}.feedback.error{color:#fca5a5;background:#7f1d1d59;border-color:#fca5a573}.mission-console{background:linear-gradient(160deg,#0f172aed,#020617c2);border:1px solid #94a3b859;border-radius:.9rem;grid-template-rows:auto auto 1fr;gap:.6rem;min-height:0;padding:.7rem;display:grid}.console-header h3{margin-bottom:.2rem;font-size:.9rem}.description{color:#94a3b8;font-size:.76rem;line-height:1.45}.panel-switcher{grid-template-columns:repeat(3,1fr);gap:.35rem;display:grid}.panel-tab{color:#cbd5e1;background:#0f172aa6;border:1px solid #94a3b873;border-radius:.52rem;padding:.35rem .2rem;font-size:.73rem}.panel-tab.active{color:#e0f2fe;background:#2563eb6b;border-color:#7dd3fce6}.console-content{-webkit-overflow-scrolling:touch;background:#0f172a73;border:1px solid #94a3b847;border-radius:.72rem;min-height:0;padding:.58rem;overflow:auto}.panel{gap:.4rem;display:grid}.panel h2{letter-spacing:.1em;text-transform:uppercase;color:#7dd3fc;font-size:.62rem}.truth-table-wrap{border:1px solid #94a3b847;border-radius:.5rem;overflow:hidden}.truth-table{border-collapse:collapse;width:100%;font-size:.72rem}.truth-table th,.truth-table td{text-align:center;border:1px solid #94a3b833;padding:.26rem .33rem}.truth-table th{color:#bfdbfe;background:#1e40af38;font-size:.64rem}.truth-table .active-row{background:#0e749047}.truth-table .active-row td.match{color:#4ade80;font-weight:700}.truth-table-note{color:#94a3b8;margin-top:.35rem;font-size:.67rem}.io-grid{grid-template-columns:1fr 1fr;gap:.35rem;display:grid}.bit-toggle,.output-display{border-radius:.55rem;justify-content:space-between;align-items:center;min-height:2.2rem;padding:.36rem .5rem;display:flex}.bit-toggle{color:#e2e8f0;background:#0f172aa6;border:1px solid #94a3b86b}.bit-toggle.on{background:#0369a159;border-color:#38bdf8e0}.output-display{background:#064e3b2e;border:1px dashed #34d3997a}.bit-label{font-size:.72rem}.bit-value{font-family:SF Mono,Fira Code,monospace;font-size:.88rem;font-weight:700}.output-display .bit-value.on{color:#4ade80}.hint-panel p{color:#cbd5e1;font-size:.78rem;line-height:1.45}.mobile-dock{display:none}@media (width<=1100px){.cockpit-main{grid-template-columns:minmax(0,1fr) 17rem}.navigator{grid-template-columns:repeat(2,minmax(8.5rem,1fr));width:min(100%,22rem)}}@media (width<=900px){.cockpit-header{grid-template-columns:1fr;gap:.55rem}.navigator{justify-self:stretch;width:100%}.cockpit-main{grid-template-rows:1fr;grid-template-columns:1fr;padding:.55rem}.build-bay,.mission-console{height:100%;min-height:0;overflow:hidden}.cockpit-main{overflow:hidden}.mobile-hidden{display:none}.toolbox{grid-template-columns:1fr;gap:.35rem;padding:.45rem .5rem}.toolbox-items{-webkit-overflow-scrolling:touch;flex-wrap:nowrap;padding-bottom:.15rem;overflow-x:auto}.tool-btn{flex:none}.wire-hint{font-size:.65rem}.build-bay{grid-template-rows:auto auto 1fr auto}.build-bay-title h2{font-size:.92rem}.canvas-wrap{touch-action:none;overscroll-behavior:contain;min-height:0;overflow:hidden}.circuit-canvas{aspect-ratio:640/420;touch-action:none;width:100%;min-width:0;height:auto;min-height:0}.cockpit-header{gap:.4rem;padding:.45rem .55rem}.run-status{flex-direction:row;align-items:center;gap:.45rem;padding:.35rem .55rem}.header-brand h1{font-size:.9rem}.build-bay-title .eyebrow{display:none}.control-bar{grid-template-columns:1fr 1fr;gap:.45rem;padding-bottom:.15rem}.control-bar .btn{width:100%;min-height:2.75rem;font-size:.8rem}.tool-btn{min-height:2.75rem;padding:.4rem .65rem}.dock-btn{color:#cbd5e1;background:#0f172ab8;border:1px solid #94a3b873;border-radius:.6rem;min-height:2.75rem;font-size:.72rem}.mission-console{grid-template-rows:auto auto 1fr}.mobile-dock{padding:.45rem .55rem calc(.45rem + env(safe-area-inset-bottom));padding-left:calc(.55rem + env(safe-area-inset-left));padding-right:calc(.55rem + env(safe-area-inset-right));-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#020617e6;border-top:1px solid #94a3b84d;grid-template-columns:repeat(4,1fr);gap:.4rem;display:grid}.dock-btn.active{color:#e0f2fe;background:#0369a166;border-color:#38bdf8f2}}@media (width<=900px) and (height<=700px){.run-status{display:none}.cockpit-header{gap:.35rem;padding:.35rem .5rem}.build-bay-title h2{font-size:.82rem}.toolbox{padding:.35rem .45rem}.control-bar .btn{min-height:2.5rem;font-size:.74rem}.dock-btn{min-height:2.5rem;font-size:.68rem}}
