*{box-sizing:border-box}body{margin:0;background:#101827;color:#eef4ff;font:15px/1.55 system-ui,sans-serif}header{background:#101827;padding:12px max(12px,env(safe-area-inset-left));padding-top:max(12px,env(safe-area-inset-top));position:sticky;top:0;z-index:3;border-bottom:1px solid #43536b}header>b{font-size:23px}header>div,small,.muted{color:#a8b8ce;font-size:13px}main{max-width:760px;margin:auto;padding:10px 10px max(24px,env(safe-area-inset-bottom))}nav,.bar{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}nav button,.bar button{flex:1}button,select{font:700 14px system-ui;color:#eef4ff;background:#263449;border:1px solid #52647a;border-radius:8px;min-height:44px;padding:7px;touch-action:manipulation;cursor:pointer}button:active{filter:brightness(1.4)}button:disabled{opacity:.4}.blue,.active{background:#037da9}.green{background:#168b43}.red{background:#b91c1c}.wide{width:100%}article{background:#1e293b;border:1px solid #41536a;border-radius:12px;margin:9px 0;padding:12px}h2{font-size:17px;color:#38c4ef;margin:0 0 9px}p{white-space:pre-wrap}.body{background:#cbd5e1;border-radius:12px;padding:9px}.lcd{background:#a0b58a;color:#192a12;border:3px solid #435344;border-radius:8px;padding:9px;font:bold 15px/1.8 monospace}.lcdhead{display:flex;justify-content:space-between;border-bottom:1px solid #526842}#lines{min-height:145px}#lines div{white-space:pre-wrap;overflow-wrap:anywhere;cursor:pointer}.sel{background:#192813;color:#c6d7b0}#cmd{border-top:1px solid #526842;overflow-wrap:anywhere}.keys{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;margin:8px 0}.keys button{padding:2px 0;border:0;border-bottom:3px solid #0005;color:#43c8fa;font-size:clamp(11px,3.4vw,15px)}.keys .num{background:#f8fafc;color:#142033}.keys .dev{background:#287975;color:white}.keys .math{background:#37318c;color:#ffe477}.keys .green{color:white}.io{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.unit{background:#080e1b;border:1px solid #45536a;border-radius:9px;padding:9px;text-align:center}.lamp,.switch{width:44px;height:44px;border:3px solid #64748b;border-radius:50%;background:#263346;margin:8px auto;display:block}.lamp.on{background:#facc15;box-shadow:0 0 12px #facc1577}.switch{background:#17673b}.switch.on{background:#32cf73}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.65 monospace}textarea{width:100%;height:210px;background:#a0b58a;color:#192a12;font:16px monospace} .diagram{overflow:auto}.diagram svg{display:block;background:#f1f5f9;border-radius:6px;margin:6px 0}.step{border-bottom:1px solid #41536a;padding:7px 0}.step code{color:#a7e6b0}[hidden]{display:none!important}
.cfg{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:8px 0}.cfg input:not([type=color]){width:45%;min-width:100px}input,select{font:inherit;color:#eef4ff;background:#263449;border:1px solid #52647a;border-radius:6px;padding:8px;max-width:100%}#custom label,#library label{display:block;margin:9px 0}#custom textarea{display:block;width:100%;height:100px;background:#101827;color:white}#custom input{display:block;width:100%}.motor{font-size:30px;line-height:36px;color:white}.spin{animation:spin61 1s linear infinite}.spin.reverse{animation-direction:reverse}@keyframes spin61{to{transform:rotate(360deg)}}nav{flex-wrap:wrap}#wave svg{display:block}
.plant76row,.plant76card{border:1px solid #475569;border-radius:8px;padding:10px;margin:8px 0;background:#142034}.plant76row label{display:block;margin:6px 0}.plant76grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}.plant76card small{display:block;color:#a8b8ce;margin:5px 0}.plant76visual{height:18px;background:#080e1b;border-radius:5px;overflow:hidden;margin:12px 0}.plant76fill{height:100%;background:#38bdf8;transition:width .08s linear}.plant76card .plant76warn{color:#fbbf24}.plant76card button{width:100%;margin-top:7px}

@media(max-width:600px){header{position:static}nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}nav button{font-size:12px;min-width:0;overflow-wrap:anywhere}.bar>*{min-width:0}article{overflow-wrap:anywhere}}
.homeGrid80{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.homeGrid80 button{min-width:0;min-height:44px}.guideRow80{border-bottom:1px solid #475569;padding:10px 0}.guideRow80 p{margin:5px 0}.guideRow80 button{min-height:40px}#homeSearch80{width:100%;box-sizing:border-box}#home li{margin:8px 0}#homeTestResult80{white-space:pre-wrap;overflow-wrap:anywhere}

@media(max-height:500px) and (orientation:landscape){header{position:static}}
main,article,.unit{min-width:0} .io{grid-template-columns:repeat(3,minmax(0,1fr))} .unit{overflow-wrap:anywhere} @media(max-width:340px){article{padding:8px}.io{gap:4px}.unit{padding:4px}}
/* Compact touch ladder canvas */
