:root{font-family:system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:#183653;background:#eaf2fa;font-synthesis:none}*{box-sizing:border-box}body{margin:0}.app{height:100dvh;min-height:620px;max-width:1600px;margin:auto;display:flex;flex-direction:column;padding:12px;gap:10px}.top{display:flex;justify-content:space-between;gap:16px;align-items:center;background:linear-gradient(110deg,#102c4d,#17659b);color:white;padding:14px 20px;border-radius:15px;box-shadow:0 6px 20px #17436b25}.brand{font-size:18px;font-weight:900;letter-spacing:.05em}.brand span{color:#ffbf62}.brand small{font-size:12px;letter-spacing:0;color:#deecf9}.top h1{font-size:clamp(17px,2vw,25px);line-height:1.15;margin:6px 0}.top p{margin:0;color:#dfedfb;font-size:12px}.chip{text-align:center;padding:10px 12px;border:1px solid #85b4d8;border-radius:10px;font-weight:800;white-space:nowrap}.chip small{font-size:10px;font-weight:400}.tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.tabs button{font-weight:900;display:flex;gap:7px;justify-content:center;align-items:center;background:#fff;border:2px solid #c5d9eb;color:#244e6c;border-radius:11px;padding:10px;cursor:pointer;min-height:48px}.tabs button span{font-size:12px;font-weight:650}.tabs button.active{background:#095fa4;border-color:#095fa4;color:white;box-shadow:0 3px 0 #064274}.workspace{display:grid;grid-template-columns:minmax(0,1.62fr) minmax(295px,1fr);gap:10px;min-height:0;flex:1}.left,.right{min-height:0;background:white;border:1px solid #d1e1ed;border-radius:14px;box-shadow:0 3px 14px #1b527312}.left{display:flex;flex-direction:column;padding:12px}.panel-title{display:flex;justify-content:space-between;align-items:center;gap:8px}.panel-title h2{font-size:16px;margin:0 0 8px;color:#103f66}.panel-title span{font-size:11px;color:#57738a}.visual{flex:1;min-height:0;overflow:auto;border-radius:10px;background:linear-gradient(140deg,#f4f9fd,#eaf3fb);padding:12px;display:flex;flex-direction:column}.right{display:flex;flex-direction:column;gap:9px;padding:12px;overflow:auto}.state{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#4a6880}.status{border-radius:50px;background:#e7f0f8;color:#174c75;padding:7px 13px;font-size:11px;font-weight:900;letter-spacing:.06em}.status.running{background:#d8f4e7;color:#086d3e}.status.paused{background:#fff0d6;color:#a15b08}.status.done{background:#e7e0fc;color:#5e399b}.controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.controls button,.mini,.choice{min-height:43px;border-radius:10px;background:white;border:1px solid #adc9dc;color:#164d78;font-size:12px;font-weight:800;cursor:pointer;touch-action:manipulation}.controls button.primary{background:#1174c1;color:#fff;border-color:#1174c1}.controls button.reset{background:#fff2e6;color:#9c4202;border-color:#f7c695}.controls button:disabled{opacity:.42;cursor:not-allowed}.inputs{display:flex;flex-direction:column;gap:8px}.controlrow{background:#f1f7fc;border:1px solid #d9e6f2;padding:8px 10px;border-radius:10px}.controlrow label{display:flex;justify-content:space-between;gap:8px;font-size:12px;font-weight:750}.controlrow input[type=range]{width:100%;accent-color:#f18c1b;height:27px;cursor:pointer}.controlrow select,.controlrow input[type=number]{width:100%;min-height:34px;border:1px solid #9bbbd2;border-radius:7px;background:#fff;color:#163c5c;font-size:14px}.inlineChoices{display:flex;gap:7px;flex-wrap:wrap}.choice{flex:1;background:#f4f9fc;padding:6px 9px}.choice.selected{background:#d9eeff;border-color:#1174c1}.explain,.trace{border-top:1px solid #d7e4ee;padding-top:7px}.explain h3,.trace h3{font-size:12px;letter-spacing:.04em;color:#1b5c8b;margin:0 0 5px}.explain p{font-size:12px;line-height:1.5;margin:0;color:#3c5567}.trace{flex:1;min-height:75px}.trace #readout{font:12px/1.55 ui-monospace,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;color:#173e5b}.diagram{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-content:center;flex:1}.block{border-radius:11px;min-height:58px;padding:10px 7px;background:#fff;border:2px solid #9fc6de;color:#17496f;font-weight:900;font-size:13px;text-align:center;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px}.block small{font-weight:500;font-size:10px}.block.on{border-color:#ef8420;background:#fff2e0;box-shadow:0 0 0 2px #fed7a9}.block.cpu{background:#d9ebfa}.block.flash{border-style:dashed;border-color:#367dbd}.block.ram{border-color:#2c9c86}.block.signal{border-color:#d38b2b}.legend{font-size:11px;color:#476e89;line-height:1.6;padding:6px}.program{display:flex;flex-direction:column;gap:8px;margin:auto 0}.codebox{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.instr{padding:9px 7px;border:2px solid #c7d9e7;border-radius:10px;background:#fff;font:12px/1.5 ui-monospace,monospace;text-align:center}.instr.highlight{border-color:#eb8b26;background:#fff2de}.phasebar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}.phasebar div{border-radius:7px;background:#d8e6f1;color:#345875;text-align:center;padding:8px 2px;font-size:10px;font-weight:700}.phasebar div.hot{color:white;background:#146bab}.registers{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.reg{background:#fff;padding:12px 3px;border:1px solid #c0d6e7;border-radius:8px;text-align:center;font:13px ui-monospace,monospace}.reg b{display:block;font-size:18px;color:#086ca7}.memorygrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:auto 0}.memcard{background:white;border:2px solid #bfd5e6;border-radius:12px;padding:14px 10px;min-width:0}.memcard h3{margin:0 0 8px;color:#115788;font-size:16px}.memcard strong{display:block;font-size:22px}.memcard p{font-size:12px;margin:8px 0;line-height:1.5}.memcard .val{font:16px ui-monospace,monospace;color:#b25c0d}.memcard button{margin-top:8px;width:100%}.wave{display:flex;gap:7px;align-items:flex-end;min-height:110px;background:white;border-radius:10px;padding:12px;overflow:hidden}.wave span{flex:1;min-width:8px;border-radius:3px 3px 0 0;background:#d9e5ed;height:18px}.wave span.high{height:80px;background:#177abb}.wave span.led{background:#ed8b22}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}.stat{border:1px solid #c8deeb;border-radius:10px;padding:10px;background:#fff;text-align:center;font-size:11px}.stat b{display:block;font-size:16px;color:#125e95}.lamp{width:90px;height:90px;border-radius:50%;background:#d2dce4;border:9px solid #b8c9d5;margin:18px auto;box-shadow:inset 0 0 16px #869ca7}.lamp.lit{background:#ffdd4d;border-color:#f2ae2d;box-shadow:0 0 42px #ffc73e,inset 0 0 17px #ffea8a}.embedded{display:flex;flex-direction:column;justify-content:center;gap:10px;flex:1}.chain{display:flex;gap:6px;align-items:center}.chain div{background:white;border:2px solid #99c5df;border-radius:9px;flex:1;text-align:center;padding:15px 3px;font-size:12px;font-weight:800}.chain span{color:#1174a5;font-size:19px}footer{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#567186;padding:0 6px}.key{display:inline-block;width:14px;height:4px;margin:0 4px;vertical-align:middle}.instruction{background:#367dbd}.data{background:#2c9c86}.signal{background:#d38b2b}:focus-visible{outline:3px solid #ea8b20;outline-offset:2px}@media(max-width:850px){.app{height:auto;min-height:100dvh}.workspace{grid-template-columns:1fr}.visual{min-height:310px}.right{overflow:visible}.top .chip{display:none}footer{flex-wrap:wrap}}@media(max-width:530px){.app{padding:7px;gap:7px}.top{padding:13px}.tabs{gap:4px}.tabs button{flex-direction:column;gap:1px;padding:7px 2px;font-size:16px}.tabs button span{font-size:9px}.workspace{gap:7px}.left,.right{padding:9px}.visual{padding:8px;min-height:350px}.diagram{gap:5px}.block{min-height:52px;padding:5px 2px;font-size:11px}.block small{font-size:9px}.memorygrid{grid-template-columns:1fr}.memcard{padding:8px}.memcard strong{font-size:17px}.codebox{grid-template-columns:1fr}.registers{grid-template-columns:repeat(2,1fr)}.chain div{font-size:10px;padding:12px 2px}.panel-title h2{font-size:14px}}
