/* Total Engineering · Arduino virtual (panel dentro de Engineering Lab) */
.lab .ard-panel{padding:0;margin:0;max-width:none;width:auto}
.ard-panel{flex:0 0 clamp(220px,36vh,360px);min-height:0;display:flex;flex-direction:column;background:#061321;border-top:1px solid #17324a;overflow:hidden}
.ard-panel[hidden]{display:none}
.ard-head{flex:0 0 auto;display:flex;align-items:center;gap:7px;padding:6px 10px;border-bottom:1px solid #17324a;background:#081a2a;min-width:0;flex-wrap:wrap}
.ard-title{color:#5fd0dc;font-size:13px;letter-spacing:.02em;margin-right:4px}
.ard-head select{min-width:0;max-width:220px;padding:7px 8px;border-radius:9px;border:1px solid #25465e;background:#07131f;color:#dceaf5;font-size:12px}
.ard-head .btn{padding:7px 10px;font-size:12px;min-height:32px}
.ard-head .btn:disabled{opacity:.45;cursor:not-allowed}
.ard-state{font:11px ui-monospace,Consolas,monospace;padding:4px 8px;border-radius:999px;border:1px solid #2b4d66;color:#a9bfd0;background:#0a1d2d}
.ard-state[data-state="running"]{color:#7dff87;border-color:#2f7a4a;background:#0c2a1c}
.ard-state[data-state="error"]{color:#ff9aa4;border-color:#7a2f39;background:#2a0c12}
.ard-clock{font:11px ui-monospace,Consolas,monospace;color:#8fa9be}
.ard-close{margin-left:auto}
.ard-body{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)}
.ard-editor{min-width:0;min-height:0;display:flex;background:#040d16;border-right:1px solid #17324a}
.ard-gutter{flex:0 0 auto;width:38px;padding:8px 6px 8px 0;overflow:hidden;white-space:pre;text-align:right;color:#4d6a80;font:12px/18px ui-monospace,Consolas,"Cascadia Mono",monospace;background:#061321;border-right:1px solid #12293c;user-select:none}
.ard-gutter .err{display:inline-block;width:100%;color:#fff;background:#b3263a;border-radius:3px}
.ard-editor textarea{flex:1 1 auto;min-width:0;min-height:0;margin:0;border:0;outline:0;resize:none;padding:8px 10px;background:transparent;color:#dceaf5;font:12px/18px ui-monospace,Consolas,"Cascadia Mono",monospace;white-space:pre;overflow:auto;tab-size:2;caret-color:#5eead4}
.ard-editor textarea:focus-visible{box-shadow:inset 0 0 0 1px #39d4c3}
.ard-side{min-width:0;min-height:0;display:flex;flex-direction:column}
.ard-msg{flex:0 1 auto;max-height:42%;overflow:auto;padding:7px 10px;font-size:12px;line-height:1.45;color:#b7c9d7;border-bottom:1px solid #17324a}
.ard-msg[data-kind="err"]{color:#ffd0d5;background:#22090f}
.ard-msg[data-kind="ok"]{color:#c9f7da}
.ard-msg kbd{font:11px ui-monospace,Consolas,monospace;border:1px solid #2b4d66;border-radius:4px;padding:0 4px;background:#0a1d2d}
.ard-warn{margin-top:4px;color:#ffd789}
.ard-serial-head{flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:5px 10px;font-size:12px;color:#a9bfd0}
.ard-serial-head b{color:#cfe1ef}
.ard-serial-head label{display:flex;align-items:center;gap:4px;margin-left:auto}
.ard-serial-head button,.ard-send button{border:1px solid #25465e;background:#0d2436;color:#dbeaf6;border-radius:8px;padding:5px 9px;cursor:pointer;font-size:12px}
.ard-serial{flex:1 1 auto;min-height:60px;margin:0 10px;padding:7px 9px;overflow:auto;background:#020a12;border:1px solid #17324a;border-radius:9px;color:#9ff5c9;font:12px/1.45 ui-monospace,Consolas,monospace;white-space:pre-wrap;word-break:break-word}
.ard-send{flex:0 0 auto;display:flex;gap:6px;align-items:center;padding:6px 10px 8px}
.ard-send input[type="text"],.ard-send input:not([type]){flex:1 1 auto;min-width:0;padding:6px 8px;border-radius:8px;border:1px solid #25465e;background:#07131f;color:#dceaf5;font:12px ui-monospace,Consolas,monospace}
.ard-nl{display:flex;align-items:center;gap:3px;font:11px ui-monospace,Consolas,monospace;color:#8fa9be}
.workspace-toolbar .ard-toggle{border-color:#2a7770;color:#88f2e3}
.workspace-toolbar .ard-toggle.active{background:#143a39;border-color:#5fd0dc}
.center.ard-open .scope-wrap{flex-basis:96px;height:96px;min-height:80px}
.center.ard-open .canvas-wrap{min-height:200px}
.ard-card .quick button{border-color:#2a7770}
.ard-autotest{position:fixed;left:-9999px;top:0;width:1px;height:1px;overflow:hidden}
@media(max-width:1100px) and (min-width:761px){.ard-body{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}}
@media(max-width:760px){
 .ard-panel{flex:none;height:auto;overflow:visible}
 .ard-body{display:block}
 .ard-editor{height:300px;border-right:0;border-bottom:1px solid #17324a}
 .ard-msg{max-height:none}
 .ard-serial{height:170px;flex:none}
 .ard-head select{max-width:none;flex:1 1 140px}
 .ard-clock{display:none}
 .center.ard-open{min-height:0}
 .center.ard-open .scope-wrap{height:150px}
}
/* V51 · tema claro */
html[data-theme="light"] .ard-panel{background:#fffaf4;border-top-color:#eadfce}
html[data-theme="light"] .ard-head{background:#fff3e8;border-bottom-color:#eadfce}
html[data-theme="light"] .ard-title{color:#b23a1d}
html[data-theme="light"] .ard-head select{background:#fff;border-color:#e3d6c3;color:#1f2933}
html[data-theme="light"] .ard-state{background:#fff;border-color:#e3d6c3;color:#5f6b7a}
html[data-theme="light"] .ard-state[data-state="running"]{color:#0f7a3f;border-color:#8fd3ab;background:#ecfaf1}
html[data-theme="light"] .ard-state[data-state="error"]{color:#b4232f;border-color:#f0a8ae;background:#fdeef0}
html[data-theme="light"] .ard-state[data-state="reset"]{color:#a35b00;border-color:#f3c98a;background:#fff6e5}
html[data-theme="light"] .ard-clock{color:#6b7684}
html[data-theme="light"] .ard-editor{background:#fff;border-right-color:#eadfce}
html[data-theme="light"] .ard-gutter{background:#fbf5ec;border-right-color:#efe3d2;color:#a3927f}
html[data-theme="light"] .ard-editor textarea{color:#1f2933;caret-color:#e84b28}
html[data-theme="light"] .ard-editor textarea:focus-visible{box-shadow:inset 0 0 0 1px #f0a58c}
html[data-theme="light"] .ard-msg{color:#3d4652;border-bottom-color:#eadfce}
html[data-theme="light"] .ard-msg[data-kind="err"]{color:#8a1621;background:#fdeef0}
html[data-theme="light"] .ard-msg[data-kind="ok"]{color:#0f6a3a}
html[data-theme="light"] .ard-msg kbd{background:#fff;border-color:#e3d6c3}
html[data-theme="light"] .ard-warn{color:#9a5b00}
html[data-theme="light"] .ard-serial-head{color:#5f6b7a}
html[data-theme="light"] .ard-serial-head b{color:#1f2933}
html[data-theme="light"] .ard-serial-head button,html[data-theme="light"] .ard-send button{background:#fff;border-color:#e3d6c3;color:#2b3440}
html[data-theme="light"] .ard-serial{background:#1d2530;border-color:#1d2530;color:#a7f3c9}
html[data-theme="light"] .ard-send input:not([type="checkbox"]){background:#fff;border-color:#e3d6c3;color:#1f2933}
html[data-theme="light"] .ard-nl{color:#6b7684}
html[data-theme="light"] .workspace-toolbar .ard-toggle{border-color:#f0b9a5;color:#b23a1d}
html[data-theme="light"] .workspace-toolbar .ard-toggle.active{background:#fdeee6;border-color:#e84b28}
html[data-theme="light"] .ard-card .quick button{border-color:#f0b9a5}
#ardBoard{max-width:170px}
@media(max-width:760px){#ardBoard{max-width:none;flex:1 1 140px}}
