:root{font-family:Inter,system-ui,"Segoe UI",sans-serif;color:#172033;background:#eef2f6;--card:#fff;--line:#dce3eb;--muted:#657184;--accent:#2764d8;--soft:#e9f0ff;--danger:#b42318}*{box-sizing:border-box}body{margin:0}.topbar{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:16px 28px;background:#172033;color:white;position:sticky;top:0;z-index:30}.topbar h1{margin:0;font-size:1.5rem}.topbar h1 span{font-size:.75rem;opacity:.65}.topbar p{margin:3px 0 0;color:#cbd5e1;font-size:.84rem}.top-actions{display:flex;gap:14px;flex-wrap:wrap}.toggle{font-size:.8rem}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 54px;gap:14px;padding:16px;max-width:1600px;margin:auto;transition:grid-template-columns .25s ease}.code-open .workspace{grid-template-columns:minmax(0,1fr) minmax(390px,34vw)}.builder-column{display:grid;gap:14px;min-width:0}.panel{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:0 4px 16px #1720330b;padding:16px}.panel-title.collapse{width:100%;border:0;background:none;padding:0;display:flex;justify-content:space-between;align-items:center;cursor:pointer;color:inherit}.panel-title span{display:flex;align-items:center;gap:9px}.panel-title b{font-size:1.08rem}.panel-title small{color:var(--muted);font-weight:400}.panel-title>i{font-style:normal;transition:.2s}.collapsed .panel-title>i{transform:rotate(180deg)}.step{display:inline-grid;place-items:center;width:27px;height:27px;border-radius:9px;background:var(--soft);color:var(--accent);font-style:normal;font-weight:800;font-size:.78rem}.panel-body{margin-top:14px}.collapsed .panel-body{display:none}.experts-list{display:grid;gap:9px}.expert-card{display:grid;grid-template-columns:44px 1fr auto;gap:12px;align-items:center;border:1px solid var(--line);border-radius:13px;padding:10px;background:#fbfcfe}.expert-card.included{border-color:#a9c4f8;background:#f7faff}.expert-card img{width:42px}.expert-card div{display:grid;gap:2px}.expert-card small{color:var(--muted)}.expert-card code{font-size:.76rem}.component-palette{display:grid;grid-template-columns:repeat(5,1fr);gap:9px;margin-bottom:13px}.component-choice{border:1px solid var(--line);background:white;border-radius:12px;padding:9px;display:grid;place-items:center;gap:3px;cursor:pointer}.component-choice:disabled{opacity:.4}.component-choice img{width:40px;height:40px}.component-choice strong{font-size:.8rem}.component-choice span{font-size:.7rem;color:var(--muted)}.component-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.component-card{display:grid;grid-template-columns:48px 1fr auto;gap:10px;align-items:start;border:1px solid var(--line);border-radius:13px;padding:10px}.component-img{width:44px}.component-main{display:grid;gap:4px;min-width:0}.description{font-size:.75rem;color:var(--muted)}.hidden{display:none!important}.power-mini{display:flex;gap:12px;font-size:.69rem;color:var(--muted)}.port-summary{display:flex;gap:7px;align-items:center;border-top:1px solid #edf1f5;padding-top:5px}.port-summary img{width:25px;height:25px}.port-summary div{display:grid}.port-summary b{font-size:.76rem}.port-summary small{font-size:.68rem;color:var(--accent)}.card-actions{display:flex}.icon-btn{border:0;border-radius:8px;background:#f1f4f8;width:30px;height:30px;cursor:pointer}.delete,.danger{color:var(--danger)!important}.section-help{margin:0 0 10px;color:var(--muted);font-size:.8rem}.data-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.data-slot{min-height:105px;border:1px dashed #bbc6d4;border-radius:12px;background:#fbfcfe;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer;padding:7px}.data-slot.filled{border-style:solid;border-color:#a6bde8;background:#f8faff}.data-slot.generated{background:#f2f6fc}.locker-icon{width:39px;height:39px}.data-slot strong{font-size:.78rem;word-break:break-word}.slot-value{font-size:.75rem;font-weight:800;color:var(--accent)}.data-slot small,.data-slot em{font-size:.65rem;color:var(--muted);text-align:center}.data-slot em{font-style:normal}.plus{font-size:1.1rem}.algorithm-placeholder{min-height:280px;border:2px dashed #cbd5e1;border-radius:14px;display:grid;place-content:center;text-align:center;padding:30px;color:var(--muted)}.algorithm-placeholder strong{color:#334155;font-size:1.1rem}.algorithm-placeholder p{max-width:520px}.code-column{padding:0;position:sticky;top:85px;height:calc(100vh - 101px);overflow:hidden;display:grid;grid-template-columns:54px minmax(0,1fr)}.code-handle{border:0;border-right:1px solid var(--line);background:#172033;color:white;display:flex;flex-direction:column;align-items:center;gap:10px;padding:12px 7px;cursor:pointer}.code-handle b{writing-mode:vertical-rl;transform:rotate(180deg);font-size:.78rem}.code-handle i{font-size:1.5rem;font-style:normal}.code-inner{padding:14px;display:none;min-width:0;flex-direction:column;gap:9px}.code-open .code-inner{display:flex}.code-open .code-handle i{transform:rotate(180deg)}.code-head{display:flex;justify-content:space-between;align-items:center}.code-head>div{display:flex;align-items:center;gap:8px}.code-head h2{font-size:1rem;margin:0}.code-actions,.code-tabs{display:flex;gap:6px;flex-wrap:wrap}.secondary,.code-tab{border:1px solid var(--line)!important;background:#f5f7fa!important;color:#243247!important;border-radius:9px;padding:7px 10px;cursor:pointer}.code-tab{font-size:.72rem}.code-tab.active{background:var(--soft)!important;color:var(--accent)!important}pre{margin:0;background:#101827;color:#e8edf5;border-radius:12px;padding:14px;overflow:auto;flex:1;font-size:.79rem;line-height:1.5}.modal{border:0;border-radius:18px;max-width:560px;width:calc(100% - 28px);padding:0;box-shadow:0 20px 70px #0005}.modal::backdrop{background:#10182799}.modal form{padding:20px;display:grid;gap:13px}.modal-head{display:flex;gap:12px;align-items:center}.modal-head h3{margin:0 0 3px}.modal-head p{margin:0;color:var(--muted);font-size:.84rem}.modal-icon{width:58px;height:58px;display:grid;place-items:center;border-radius:14px;background:var(--soft)}.modal-icon img{width:46px;height:46px}.modal label{display:grid;gap:5px;font-size:.83rem;font-weight:650}.modal input,.modal select{width:100%;border:1px solid #bec8d6;border-radius:10px;padding:9px 10px;font:inherit;background:white}.modal small{font-weight:400;color:var(--muted)}.power-box{display:flex;align-items:center;gap:16px;padding:10px;border-radius:11px;background:#f6f8fb;font-size:.8rem}.power-box span:first-of-type b{color:#334155}.power-box span:last-child b{color:#b42318}.ports-text{font-size:.82rem;margin:0;font-weight:700}.pin-fields{display:grid;gap:9px}.pin-row{display:grid;grid-template-columns:48px 1fr;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:9px}.pin-row>img{width:44px}.pin-main{display:grid;grid-template-columns:1fr 1fr;gap:6px;align-items:center}.pin-main>strong{grid-column:1/-1}.pin-main label{display:grid;grid-template-columns:auto 80px;align-items:center;gap:6px}.pin-main small{grid-column:1/-1}.servo-mode{font-size:.76rem;color:var(--accent);font-weight:700}.modal-actions{display:flex;justify-content:flex-end;gap:7px}.modal button{border:0;border-radius:10px;padding:9px 13px;background:var(--accent);color:white;font-weight:700;cursor:pointer}.error{color:var(--danger);font-size:.78rem;min-height:1em;margin:0}fieldset{border:1px solid var(--line);border-radius:11px;display:grid;gap:8px}fieldset legend{font-size:.83rem;font-weight:700}fieldset label{display:flex!important;align-items:center;gap:7px!important}fieldset input{width:auto!important}
@media(max-width:1000px){.code-open .workspace{grid-template-columns:minmax(0,1fr) minmax(340px,44vw)}.component-palette{grid-template-columns:repeat(3,1fr)}.data-grid{grid-template-columns:repeat(4,1fr)}}
@media(max-width:760px){.topbar{position:static;flex-direction:column;align-items:flex-start}.workspace,.code-open .workspace{display:block;padding:9px}.builder-column{padding-right:45px}.code-column{position:fixed;right:0;top:0;height:100vh;width:45px;z-index:50;border-radius:0;transition:width .2s}.code-open .code-column{width:min(92vw,520px)}.component-list{grid-template-columns:1fr}.data-grid{grid-template-columns:repeat(3,1fr)}.panel-title small{display:none}.pin-main{grid-template-columns:1fr}.pin-main>*{grid-column:1!important}}

/* v0.3 */
.panel-title.collapse{min-height:40px;padding:2px 0}
.collapse-icon{flex:0 0 38px;width:38px;height:38px;border:1px solid #c7d3e2;border-radius:11px;background:#f5f8fc;display:grid!important;place-items:center;transition:background .18s,border-color .18s}
.collapse-icon svg{width:22px;height:22px;fill:none;stroke:#2764d8;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s ease}
.collapse-icon.closed svg{transform:rotate(-90deg)}
.panel-title.collapse:hover .collapse-icon{background:#e9f0ff;border-color:#9eb9ed}
.data-grid{grid-template-columns:repeat(auto-fill,minmax(125px,1fr))}
.data-slot.new-data{min-height:105px;background:white;border-width:2px;color:#2764d8}
.data-slot.new-data:hover{background:#f5f8ff;border-color:#7fa3e9}
.port-summary div>span{font-size:.74rem;color:#334155}
.generated-name{grid-column:1/-1;font-size:.76rem;color:#657184;background:#f7f9fc;border-radius:8px;padding:6px 8px}
.generated-name b{color:#172033;word-break:break-word}
.pin-main label{font-weight:650}
#componentQuestion,#dataDialog label>strong{font-weight:800;color:#172033}
.power-box{margin-top:2px}

/* v0.3.1: plegado robusto de todos los paneles */
[data-panel].collapsed > .panel-body{display:none!important}
[data-panel]:not(.collapsed) > .panel-body{display:block}
[data-panel].collapsed .collapse-icon svg{transform:rotate(-90deg)}

/* v0.4 — constructor lineal del algoritmo */
.algorithm-builder{max-width:760px;margin:0 auto;padding:8px 0 18px}.algorithm-start,.algorithm-end{width:max-content;margin:0 auto;padding:9px 22px;border:2px solid #334155;border-radius:999px;font-weight:800;background:#fff}.algorithm-end{margin-top:0}.flow-arrow{text-align:center;font-size:25px;line-height:28px;color:#64748b;font-weight:800}.algorithm-list{display:flex;flex-direction:column;align-items:stretch}.algorithm-step{display:grid;grid-template-columns:52px 1fr auto;gap:12px;align-items:center;border:1px solid #cbd5e1;border-radius:14px;background:#fff;padding:12px 14px;box-shadow:0 2px 7px #0f172a0c}.algorithm-step .step-icon{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:#eef2ff;font-size:25px}.algorithm-step strong{display:block}.algorithm-step small{display:block;color:#64748b;margin-top:3px}.algorithm-step-actions{display:flex;gap:5px}.algorithm-step-actions button{width:34px;height:34px;padding:0;border-radius:9px}.algorithm-add{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:14px 0}.algorithm-add button{min-width:145px}.algorithm-empty{text-align:center;color:#64748b;padding:10px}.algorithm-note{margin:0 0 14px;color:#475569}.action-component-list{display:grid;gap:8px;margin:10px 0 16px}.action-component{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:10px;border:1px solid #cbd5e1;border-radius:12px;background:#fff}.action-component img{width:38px;height:38px}.action-component.selected{outline:2px solid #4f46e5;background:#eef2ff}.action-options{display:grid;gap:12px}.action-options.hidden{display:none}.wait-preview{font-size:14px;color:#475569}.algorithm-loop-hint{text-align:center;color:#64748b;font-size:13px;margin-top:6px}.algorithm-step.invalid{border-color:#dc2626;background:#fef2f2}

/* v0.4.1 */
.instruction-choices{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:8px}.instruction-choices.hidden{display:none}.algorithm-add{flex-direction:column;align-items:center}.algorithm-add #addInstruction{min-width:210px;font-size:.95rem}
.nested-box{margin:8px 0 14px 42px;padding:12px;border-left:3px solid var(--accent,#2563eb);background:#f8fafc;border-radius:8px}.nested-case{margin-top:14px;padding-top:12px;border-top:1px solid #dbe2ea}.step-main{min-width:0}.expr-builder{padding:10px;border:1px solid #d7dde5;border-radius:8px;margin:8px 0}.expr-row{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:end}.expr-side{display:grid;gap:6px}.instruction-choices{flex-wrap:wrap}
/* v0.7: lenguaje visual para expresiones, preguntas, sensores y módulos */
.typed-expression{border:1px solid #cbd5e1;border-left:7px solid #64748b;border-radius:12px;padding:12px;background:#fff;margin:10px 0}.calc-expression{border-left-color:#7c3aed}.question-expression{border-left-color:#cbd5e1}.typed-expression>.type-mark{font-size:20px;font-weight:800;margin-bottom:8px}.assignment-visual{display:grid;grid-template-columns:minmax(130px,auto) 42px 1fr;gap:10px;align-items:center}.assignment-target{border:2px solid #94a3b8;border-radius:10px;padding:10px;background:#f8fafc;font-weight:800}.assign-arrow{font-size:28px;text-align:center;font-weight:900}.expression-box{border:2px solid #c4b5fd;border-radius:10px;padding:10px;background:#faf5ff}.question-expression .expression-box{border-color:#99f6e4;background:#f0fdfa}.expr-row{align-items:center}.expr-side{border:1px solid #d8dee8;border-radius:9px;padding:7px;background:#fff}.expr-side .expr-row{margin-top:5px}.container-config{margin:10px 0 14px 42px;padding:12px;border-left:4px solid #0891b2;background:#ecfeff;border-radius:9px}.container-config h4{margin:0 0 8px}.module-card{border:1px solid #cbd5e1;border-radius:12px;padding:12px;margin:8px 0;background:#fff}.module-card strong{display:block}.module-card small{color:#64748b}.decision-config{display:grid;gap:10px}.decision-part{border:1px solid #cbd5e1;border-radius:10px;padding:11px;background:#f8fafc}.decision-part button{margin-top:7px}
.arduino-container{border:1px solid #d9e2ec;border-radius:14px;padding:14px;margin:10px 0 18px}.setup-container{background:#fbfcfe}.loop-container{background:#fff}.setup-add-menu{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.setup-step{display:flex;align-items:center;gap:10px;border:1px solid #d9e2ec;border-radius:10px;padding:10px;margin:8px 0}.setup-step .setup-main{flex:1}.setup-step small{display:block;color:#64748b}

/* v0.10 */
.code-inner{min-height:0;overflow:hidden}
#codeOutput{min-height:0;overflow-y:auto;overflow-x:auto}
.setup-assignment{display:grid;grid-template-columns:auto minmax(90px,1fr) auto minmax(120px,1fr);gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px}
.setup-locker{font-size:1.5rem}.servo-attach-visual{margin-top:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#f7f9fc;text-align:center}.servo-attach-visual b{font-size:1.15rem}
@media(max-width:760px){.setup-assignment{grid-template-columns:auto 1fr}.setup-assignment>b{display:none}}

/* v0.11 — interfaz minimalista */
.component-modal label{gap:6px}
.prefix-check{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;margin-top:-4px;font-weight:600}
.prefix-check input{width:auto}
.alias-preview{min-height:20px;font-size:.86rem;color:var(--muted);margin-top:-6px}
.minimal-pin{display:block!important;padding:14px 16px!important}
.minimal-pin .pin-role{display:block;font-size:1rem;margin-bottom:10px}
.pin-reservation{display:flex;align-items:center;gap:12px}
.pin-reservation>img{width:42px;height:42px}
.pin-arrow{font-size:1.5rem;font-weight:700;color:var(--muted)}
.pin-reservation label{display:flex;flex-direction:column;gap:5px;margin:0}
.pin-reservation select{min-width:108px}
.compact-port{grid-template-columns:28px 18px 1fr!important;align-items:center}
.compact-port>span{font-size:1.1rem;font-weight:700;color:var(--muted)}
.compact-port div{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.compact-port small,.power-mini,.power-box,.ports-text{display:none!important}

/* v0.12 */
.component-modal .minimal-pin .pin-reservation{display:grid!important;grid-template-columns:40px 24px minmax(110px,160px);align-items:center;gap:8px}
.component-modal .minimal-pin .pin-reservation>img{width:40px!important;height:40px!important;max-width:40px!important;min-width:40px!important;flex:0 0 40px!important;object-fit:contain}
.component-modal .minimal-pin .pin-arrow{width:24px;text-align:center}
.component-modal .minimal-pin .pin-reservation label{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:5px!important;min-width:0}
.store-metaphor{display:grid;grid-template-columns:minmax(120px,170px) 36px minmax(120px,1fr);align-items:start;gap:10px;margin:10px 0}
.store-destination{display:flex;flex-direction:column;align-items:center;gap:7px}.store-destination>img{width:48px!important;height:48px!important;object-fit:contain}.store-destination select{width:100%}.store-arrow{font-size:28px;font-weight:900;text-align:center;padding-top:9px}.store-source{font-size:42px;line-height:48px}.store-source-control .expr-side{margin:0}.hidden{display:none!important}
@media(max-width:560px){.store-metaphor{grid-template-columns:minmax(105px,1fr) 30px minmax(105px,1fr)}}
/* v0.13: casillero tridimensional y descripción opcional al final */
.component-description-field{margin-top:2px}
.component-description-field strong span{font-weight:500;color:var(--muted)}
.component-modal .minimal-pin .pin-reservation>img,.store-metaphor img,.data-slot .locker-icon,.port-summary img{object-fit:contain}

/* v0.14 — controles visuales de Actuar */
.digital-action,.servo-action,.buzzer-action{display:grid;justify-items:center;gap:12px;padding:8px 0}.digital-switch{display:grid!important;grid-template-columns:34px 76px 34px;align-items:center;gap:8px!important;background:transparent!important;color:var(--text)!important;padding:4px!important}.digital-switch>span{display:grid;justify-items:center;gap:3px;font-size:1.05rem}.digital-switch i{display:block;width:9px;height:9px;border-radius:50%;background:#94a3b8}.digital-switch .state-one i{background:#22a447}.digital-switch .state-zero i{background:#dc3c3c}.switch-track{width:76px;height:38px;border-radius:22px;background:#dbe1e8;position:relative;box-shadow:inset 0 1px 4px #0002}.switch-track b{position:absolute;top:4px;width:30px;height:30px;border-radius:50%;background:white;box-shadow:0 2px 6px #0004;transition:left .18s}.is-on .switch-track{background:#b9e6c5}.is-on .switch-track b{left:42px}.is-off .switch-track{background:#f2c5c5}.is-off .switch-track b{left:4px}.servo-gauge{width:min(360px,100%);display:grid;justify-items:center}.servo-arc{position:relative;width:250px;height:130px;border:9px solid #d7dee8;border-bottom:0;border-radius:135px 135px 0 0;background:linear-gradient(180deg,#f8fafc,#fff)}.servo-needle{position:absolute;left:50%;bottom:0;width:3px;height:104px;background:#334155;transform-origin:50% 100%;border-radius:3px}.servo-hub{position:absolute;left:calc(50% - 9px);bottom:-9px;width:18px;height:18px;border-radius:50%;background:#334155}.servo-arc .deg{position:absolute;font-size:.72rem;color:var(--muted);font-weight:700}.d0{left:-4px;bottom:-24px}.d90{left:calc(50% - 13px);top:8px}.d180{right:-12px;bottom:-24px}.servo-gauge>input[type=range]{width:250px;margin-top:20px}.servo-number{display:grid!important;grid-template-columns:auto 92px auto!important;align-items:center;gap:7px!important}.servo-number input{text-align:center}.buzzer-action .speaker-button{background:transparent!important;padding:3px!important;font-size:3.2rem;line-height:1;border-radius:50%}.speaker-button.sounding{filter:none}.speaker-button.muted{opacity:.65}.frequency-control{width:min(390px,100%);display:grid;gap:8px;transition:opacity .15s}.frequency-control.disabled{opacity:.38;pointer-events:none}.frequency-words{display:flex;justify-content:space-between;color:var(--muted);font-size:.76rem;font-weight:700}.frequency-control>input[type=range]{width:100%}.frequency-control label{display:flex!important;align-items:center;justify-content:center;gap:10px!important}.frequency-number{display:flex;align-items:center;gap:5px}.frequency-number input{width:110px!important;text-align:center}.tone-preview{justify-self:center}.action-component strong{font-size:.9rem}
/* v0.15: interfaz visual y mínima */
.alias-preview{min-height:0;display:grid;justify-items:center;gap:4px;margin:4px 0 10px}.alias-preview:empty{display:none}.alias-preview img{width:54px!important;height:64px!important;object-fit:contain}.alias-preview strong{font-size:.82rem}.pin-choice{display:grid!important;gap:6px!important;max-width:190px}.pin-choice select{min-width:110px}.component-modal .minimal-pin{display:grid!important;grid-template-columns:80px minmax(120px,190px);align-items:end;gap:12px;padding:10px 0!important}.component-modal .pin-role{align-self:center;margin:0!important}
.io-mode-picker{display:grid;grid-template-columns:repeat(3,minmax(90px,1fr));gap:10px;margin-top:14px}.io-card{display:grid!important;justify-items:center;gap:5px!important;border:1px solid var(--border);border-radius:12px;padding:12px 8px;cursor:pointer}.io-card input{position:absolute;opacity:0;pointer-events:none}.io-card:has(input:checked){outline:2px solid var(--accent);background:#eef6ff}.io-symbol{display:flex;align-items:center;gap:5px;font-size:1.55rem}.io-symbol i{font-style:normal;font-size:1.8rem}.io-card small{font-size:.7rem;color:var(--muted)}
/* apagador doméstico 3D: arriba 1, abajo 0 */
.digital-switch{display:grid!important;grid-template-columns:1fr!important;justify-items:center;gap:5px!important;background:transparent!important;padding:2px!important}.digital-switch .state-one,.digital-switch .state-zero{display:flex!important;align-items:center;gap:6px;font-weight:800}.digital-switch .state-one{order:1}.digital-switch .switch-track{order:2;width:72px;height:112px;border-radius:9px;background:linear-gradient(145deg,#f7f5ee,#cfcac0);border:1px solid #aaa49a;box-shadow:5px 7px 13px #0003,inset 2px 2px 4px #fff}.digital-switch .state-zero{order:3}.digital-switch .switch-track b{position:absolute;left:13px!important;top:17px;width:44px;height:76px;border-radius:5px;background:linear-gradient(100deg,#f8f7f2 0%,#d9d5cc 52%,#f2efe8 100%);box-shadow:2px 4px 7px #0004,-1px -1px 2px #fff;transition:clip-path .16s,transform .16s;transform-origin:center}.digital-switch.is-on .switch-track b{clip-path:polygon(0 0,100% 8%,100% 100%,0 88%);transform:perspective(150px) rotateX(-8deg)}.digital-switch.is-off .switch-track b{clip-path:polygon(0 12%,100% 0,100% 92%,0 100%);transform:perspective(150px) rotateX(8deg)}.digital-switch .state-one i{background:#22a447}.digital-switch .state-zero i{background:#dc3c3c}
@media(max-width:520px){.io-mode-picker{grid-template-columns:1fr 1fr}.component-modal .minimal-pin{grid-template-columns:1fr}}
/* v0.16 visual language */
.component-choice img,.component-img,.component-visual-option img{filter:drop-shadow(2px 4px 3px #0f172a30)}
.component-visual-picker{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:4px 0 14px}.component-visual-option{width:104px!important;min-height:118px;background:#fff!important;color:var(--text)!important;border:2px solid #d6dde7!important;border-radius:16px!important;padding:8px!important;display:flex!important;flex-direction:column;align-items:center;justify-content:space-between;gap:7px}.component-visual-option strong{font-size:.76rem;line-height:1.15;text-align:center;overflow-wrap:anywhere}.component-visual-option img{width:74px;height:68px;object-fit:contain}.component-visual-option.selected{border-color:var(--accent)!important;background:var(--soft)!important;box-shadow:0 0 0 3px #4f46e51c}
.instruction-choices{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.instruction-choices .instruction-icon-button{min-width:0!important;width:54px!important;height:72px!important;border-radius:16px!important;padding:6px!important;font-size:25px!important;background:#fff!important;color:#26364d!important;border:1px solid #cbd5e1!important;box-shadow:0 2px 7px #0f172a12}.instruction-choices .instruction-icon-button:hover{border-color:var(--accent)!important;background:var(--soft)!important}.instruction-icon-button img{width:36px;height:42px;object-fit:contain}.addInstruction{min-width:0!important;padding:8px 14px!important}.addInstruction b{font-size:1.45rem;line-height:.7;vertical-align:-2px;margin-right:3px}
.step-icon img{width:34px;height:38px}.sense-symbol{font-size:1.55rem;font-weight:900;letter-spacing:-4px}
.store-destination{display:grid!important;justify-items:center;gap:5px;min-width:135px}.store-destination>select,.store-destination>span>select{order:-2;width:135px}.store-destination img{width:54px;height:58px}.store-destination small{font-weight:800;font-size:.76rem;color:#334155}.plain-port{font-size:.78rem;font-weight:800;color:#475569;margin-top:5px}.compact-port small{display:block;font-size:.68rem;color:#64748b}
.graphical-pin{grid-template-columns:1fr!important}.arduino-header{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;padding:10px;background:#1f2937;border-radius:10px;box-shadow:inset 0 2px 5px #0007,0 2px 4px #0002}.pin-hole{min-width:0!important;padding:2px!important;background:transparent!important;color:#e5e7eb!important;border:0!important;display:grid!important;justify-items:center;gap:2px}.pin-hole span{font-size:.67rem}.pin-hole i{width:17px;height:17px;border-radius:4px;background:#080b10;border:2px solid #5b6470;box-shadow:inset 0 0 0 3px #111827}.pin-hole.selected i{border-color:#60a5fa;box-shadow:0 0 0 3px #60a5fa55,inset 0 0 0 3px #111827}.pin-hole.reserved{opacity:.3}.pin-hidden-select{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important}.pin-reservation{min-height:1px}
/* vertical household rocker: top=1, bottom=0 */
.digital-switch{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:auto 104px auto!important;width:82px!important;gap:4px!important;perspective:360px;background:#e8ebef!important;border:1px solid #aeb6c0!important;border-radius:12px!important;padding:8px!important;box-shadow:3px 5px 9px #0003,inset 1px 1px #fff!important}.digital-switch .state-one,.digital-switch .state-zero{font-weight:900}.digital-switch .state-one{color:#17853a}.digital-switch .state-zero{color:#c92d2d}.digital-switch .switch-track{grid-row:2;width:56px;height:92px;justify-self:center;border-radius:7px;background:#d4d8dd;position:relative;box-shadow:inset 0 0 0 2px #9aa2ac,0 2px 4px #0003;transform-style:preserve-3d}.digital-switch .switch-track b{position:absolute;inset:7px!important;width:auto!important;height:auto!important;border-radius:5px!important;background:linear-gradient(#f8f9fa,#c7ccd2)!important;box-shadow:0 5px 8px #0004!important;transform-origin:center center;transition:transform .16s,box-shadow .16s}.digital-switch.is-on .switch-track b{transform:rotateX(14deg)!important;box-shadow:0 8px 8px #0004!important}.digital-switch.is-off .switch-track b{transform:rotateX(-14deg)!important;box-shadow:0 -4px 8px #0004!important}.digital-switch .state-one i,.digital-switch .state-zero i{display:none}
/* v0.17 */
.arduino-header{background:#eef1f4!important;box-shadow:inset 0 1px 3px #64748b30,0 1px 3px #0f172a18!important;border:1px solid #d2d8df}.pin-hole{color:#475569!important}.pin-hole i{background:#d8dde3!important;border-color:#87919d!important;box-shadow:inset 0 0 0 4px #f7f8fa!important}.pin-hole.selected i{border-color:#3b82f6!important;box-shadow:0 0 0 3px #3b82f633,inset 0 0 0 4px #f7f8fa!important}
.data-grid{grid-template-columns:repeat(7,minmax(70px,1fr))}.data-slot.empty-locker{border-style:dashed;background:#fafbfc;color:#778395}.data-slot.empty-locker .locker-icon{opacity:.62}.data-slot.empty-locker small{font-size:.66rem}.destination-prompt{text-align:center;font-weight:700;color:#475569;margin:4px 0 8px}.component-visual-option.picker-hidden{display:none!important}.step-icon img{width:34px;height:34px;object-fit:contain}.addInstruction{background:#fff!important;color:#334155!important;border:1px solid #d7dce2!important;border-radius:999px!important;box-shadow:0 1px 2px #0f172a18,0 2px 7px #0f172a10!important;font-weight:600!important;padding:8px 16px 8px 11px!important}.addInstruction:hover{background:#f8fafc!important;box-shadow:0 2px 4px #0f172a22,0 4px 10px #0f172a12!important}.addInstruction b{display:inline-grid;place-items:center;width:27px;height:27px;border-radius:50%;font-size:1.65rem!important;color:var(--accent);font-weight:400}.instruction-icon-button img{width:40px!important;height:48px!important}.component-choice img,.component-img,.component-visual-option img{filter:drop-shadow(3px 5px 4px #0f172a38)}
@media(max-width:760px){.data-grid{grid-template-columns:repeat(4,1fr)}}

/* v0.18 */
.pin-hole.selected span{font-size:1rem!important;font-weight:900!important;color:#172033;transform:translateY(-1px)}
.addInstruction,#addExpert{border:1px solid #d7dce3!important;background:#fff!important;color:#334155!important;border-radius:999px!important;padding:8px 15px!important;box-shadow:0 1px 2px #00000012;font-weight:600!important}.addInstruction b,#addExpert::first-letter{font-size:1.25rem;color:var(--accent)}
.expert-picker{display:flex;gap:12px;flex-wrap:wrap}.expert-choice{min-width:130px!important;background:#fff!important;color:#172033!important;border:1px solid var(--line)!important;border-radius:14px!important;display:grid;place-items:center;gap:6px}.expert-choice img{width:58px;height:58px}.expert-choice.selected{border-color:var(--accent)!important;box-shadow:0 0 0 3px #2764d822}
.pin-reservation{display:flex;align-items:center;justify-content:center;gap:8px}.pin-reservation img{width:42px;height:42px}.pin-reservation div{display:flex;flex-direction:column}.pin-reservation small{order:-1;text-align:center;color:#172033;font-weight:700}.pin-reservation b{font-size:.78rem}
.locker-picker{display:grid;grid-template-columns:repeat(auto-fit,minmax(78px,1fr));gap:10px}.locker-choice{background:#fff!important;color:#172033!important;border:1px solid var(--line)!important;border-radius:12px!important;display:grid!important;place-items:center;gap:4px}.locker-choice img{width:45px;height:50px}.locker-choice small{font-weight:700!important;color:#172033!important}.visual-locker-assignment{display:flex!important;align-items:center;justify-content:center;gap:14px;margin-top:12px}.visual-locker-assignment>div{display:grid;place-items:center}.visual-locker-assignment img{width:54px}.visual-locker-assignment small{font-weight:700}.visual-locker-assignment input{width:120px!important}.selected-port-metaphor{display:grid;grid-template-columns:55px 1fr;align-items:center;justify-content:center;max-width:250px;margin:12px auto;gap:4px}.selected-port-metaphor img{width:50px;grid-row:1/3}.selected-port-metaphor small{font-weight:700;color:#172033}.selected-port-metaphor b{font-size:.8rem}.store-source-control .expr-data img,.open-locker{content:url('../img/locker-open-100.svg')}
/* v0.19 visual data-flow refinements */
.graphical-locker-picker{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}.locker-choice{min-width:82px;background:#fff;border:1px solid #d8dde5;border-radius:14px;padding:10px;display:flex;flex-direction:column;align-items:center;gap:5px}.locker-choice img{width:46px;height:58px;object-fit:contain}.locker-choice small{font-weight:700}.locker-choice.available-locker{border-style:dashed}.choose-another-locker{margin:4px 0 12px}.source-modes{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}.source-mode{background:#fff;border:1px solid #d8dde5;border-radius:12px;padding:8px 10px;display:flex;align-items:center;gap:6px}.source-mode img{width:28px;height:32px}.source-mode.selected{box-shadow:0 0 0 2px #555 inset}.source-detail{margin-top:8px}.nested-calculation{align-items:center}.calculation-assignment{display:flex;align-items:center;justify-content:center;gap:18px;margin:16px 0}.calculation-assignment>div:first-child,.calculator-ready{display:flex;flex-direction:column;align-items:center}.calculation-assignment img{width:54px;height:62px}.calculator-ready{position:relative}.calculator-ready span{position:absolute;right:-4px;top:-4px;background:#fff;border:1px solid #bbb;border-radius:50%;width:22px;height:22px;text-align:center;font-weight:800}.wait-presets{display:flex;gap:8px;margin:10px 0;flex-wrap:wrap}.wait-presets button{border:1px solid #d8dde5;background:#fff;border-radius:12px;padding:9px 12px;font-size:22px}.wait-presets small{display:block;font-size:12px}.wait-presets button.selected{box-shadow:0 0 0 2px #555 inset}.sense-modal-icon{display:block;width:64px;height:64px;margin:0 auto 10px}.sensor-action-card{text-align:center;font-weight:800;padding:18px;border:1px solid #ddd;border-radius:14px}.hidden{display:none!important}

/* v0.20 corrections */
.locker-with-name{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;min-width:68px}.locker-with-name img{width:48px!important;height:54px!important;object-fit:contain}.locker-with-name small{font-weight:700!important;text-align:center!important;color:#172033!important;line-height:1.05!important}.compact-port,.pin-reservation{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important}.compact-port>small,.pin-reservation>small{display:none!important}
.digital-switch{display:grid!important;grid-template-columns:auto 150px auto!important;grid-template-rows:auto!important;width:auto!important;min-width:260px!important;gap:10px!important;align-items:center!important;padding:12px 14px!important;perspective:500px!important}.digital-switch .state-one{grid-column:1!important}.digital-switch .switch-track{grid-column:2!important;grid-row:1!important;width:150px!important;height:70px!important;border-radius:12px!important}.digital-switch .state-zero{grid-column:3!important}.digital-switch .switch-track b{inset:7px!important;transform-origin:center center!important;background:linear-gradient(90deg,#f7f8fa,#c5cbd2)!important}.digital-switch.is-on .switch-track b{transform:rotateY(16deg)!important;box-shadow:8px 3px 9px #0004!important}.digital-switch.is-off .switch-track b{transform:rotateY(-16deg)!important;box-shadow:-8px 3px 9px #0004!important}.digital-switch .state-one,.digital-switch .state-zero{font-size:1.35rem!important}.sensor-action-choice{display:block;width:100%;margin:8px 0;background:#fff!important;color:#172033!important;border:1px solid #d8dde5!important;border-radius:12px!important;padding:13px!important}.sensor-config-list{display:grid;gap:7px;margin:10px 0}.sensor-config-row{padding:9px 11px;border:1px solid #e1e5ea;border-radius:10px;background:#fafbfc}.sensor-back{margin-top:8px}.modal-icon img{width:46px;height:46px}

/* v0.21: controles de cálculo más ligeros */
#calculationDialog button,.visual-expression-control button,.source-mode,.calculator-build-button{background:#fff!important;color:#334155!important;border:1px solid #d8dde5!important;box-shadow:0 1px 2px #0f172a12!important;font-weight:650!important}
#calculationDialog button:hover,.visual-expression-control button:hover,.source-mode:hover,.calculator-build-button:hover{background:#f7f8fa!important;border-color:#aeb8c5!important}
#calculationDialog .source-mode.selected,.visual-expression-control .source-mode.selected{background:#f4f6f8!important;box-shadow:0 0 0 2px #667085 inset!important}
#calculationDialog .modal-actions button[type=submit]{background:#f5f7fa!important;color:#243247!important;border:1px solid #cfd6df!important}
/* Accionar: dar mayor presencia al brazo robótico */
.instruction-icon-button img[src$="act.svg"],.step-icon img[src$="act.svg"]{width:48px!important;height:54px!important}

/* v0.22 */
.component-name-field{max-width:270px}.component-name-field input{width:230px!important;max-width:100%}.muted-prefix{color:#8a94a3!important;font-weight:400!important}.component-description-field>span,.normal-label>span{font-weight:400!important}.component-description-field small{font-weight:400;color:var(--muted)}
.port-summary .locker-with-name small,.pin-reservation .locker-with-name small,.selected-port-metaphor small,.visual-locker-assignment small,.locker-choice small,.data-slot strong{font-weight:400!important}.port-summary .locker-with-name{flex:0 0 auto}.port-summary{align-items:center!important}.port-summary .locker-with-name img{width:39px!important;height:39px!important}.port-summary .locker-with-name small{margin-top:2px;max-width:130px;overflow-wrap:anywhere}
.modal-prompt{margin:0;color:#334155;font-size:.86rem}.data-kind-picker{grid-template-columns:1fr 1fr;gap:10px}.data-kind-picker legend{grid-column:1/-1}.data-kind-card{position:relative!important;display:grid!important;justify-items:center;gap:6px!important;padding:10px;border:1px solid var(--line);border-radius:13px;cursor:pointer;text-align:center;font-weight:400!important}.data-kind-card input{position:absolute;opacity:0}.data-kind-card:has(input:checked){border-color:#718096;box-shadow:0 0 0 2px #71809633}.data-kind-icon{position:relative}.data-kind-icon img{width:48px;height:54px}.data-kind-icon i{position:absolute;right:-9px;top:-4px;font-style:normal;font-size:20px}.normal-label{font-weight:400!important}

/* v0.23: el casillero y su nombre son una unidad visual inseparable */
.locker-with-name,.locker-choice,.visual-locker-assignment>div:first-child,.calculation-assignment>div:first-child{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important}
.locker-with-name small,.locker-choice small,.visual-locker-assignment small,.calculation-assignment small,.selected-port-metaphor small{display:block!important;font-weight:400!important;text-align:center!important;margin-top:3px!important}
.selected-port-metaphor{display:flex!important;align-items:center!important;justify-content:center!important;gap:10px!important;max-width:none!important}
.selected-port-metaphor img{width:50px!important;height:auto!important;grid-row:auto!important}
.selected-port-metaphor small{max-width:150px;overflow-wrap:anywhere}
.setup-step .step-icon img{width:38px;height:44px;object-fit:contain}

.setup-inline-assignment{display:flex;align-items:center;gap:12px}.setup-inline-assignment .locker-with-name img{width:44px;height:50px}.setup-inline-assignment .locker-with-name small{font-weight:400}.setup-step:has(.setup-inline-assignment) .step-icon{display:none}.setup-step:has(.setup-inline-assignment){grid-template-columns:1fr auto}

/* v0.24 */
.data-name-field{max-width:290px!important}.data-name-field input{width:220px!important;max-width:100%!important}.data-kind-icon{display:grid;justify-items:center;min-width:82px}.data-kind-icon .live-locker-name{display:block;min-height:1.1em;margin-top:3px;font-size:.78rem;font-weight:400;color:var(--text);max-width:110px;overflow-wrap:anywhere}.servo-arc .d0{left:auto!important;right:-12px!important}.servo-arc .d180{right:auto!important;left:-12px!important}.sensor-config-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.sensor-remove{border:0!important;background:transparent!important;color:#7b8490!important;padding:3px 7px!important;min-width:30px!important;font-size:1.05rem!important}.sense-modal-icon{display:block;margin:0 auto 8px!important}.sensor-selected-summary .visual-locker-assignment small{font-weight:400!important}
/* v0.25 · constructores de cálculo y pregunta */
.wide-calculation-dialog{width:min(920px,94vw);max-width:920px}.calculation-expression-row{display:grid;grid-template-columns:minmax(220px,1fr) 92px minmax(220px,1fr);gap:20px;align-items:center}.calculation-operator,.center-operator{font-size:30px!important;font-weight:700!important;min-width:76px!important;min-height:58px!important;text-align:center}.operand-alternatives{justify-content:center;margin-top:10px}.compact-source-mode{min-height:38px!important;padding:6px 10px!important;font-size:13px!important}.compact-source-mode img{width:24px!important;height:27px!important}.operand-value{display:flex;flex-direction:column;align-items:center;gap:5px;font-weight:400}.operand-value span{font-weight:400}.operand-value input{max-width:150px}.operand-locker img{width:52px;height:62px}.operand-locker small{font-weight:400!important}.operand-calculation{display:flex;flex-direction:column;align-items:center;gap:7px}.operand-calculation .modify-nested{padding:6px 10px!important;min-height:36px!important}.data-locker-dialog .locker-choice img{width:48px;height:58px}
@media(max-width:700px){.calculation-expression-row{grid-template-columns:1fr;justify-items:center}.calculation-operator{width:86px}}

/* v0.26 · proyección y asistente de componentes */
#codeOutput{background:#fff!important;color:#111827!important;border:2px solid #cbd5e1!important;box-shadow:inset 0 0 0 1px #fff;font-size:.84rem!important;font-weight:600!important}
#codeOutput code{color:#111827!important}.code-inner{background:#fff}.code-handle{background:#f8fafc!important;color:#111827!important;border-right:1px solid #cbd5e1!important}
.component-modal{max-width:720px!important}.component-wizard-progress{display:grid;gap:6px}.component-wizard-progress>span{font-size:.78rem;color:#475569;font-weight:700}.component-wizard-progress>div{height:7px;border-radius:99px;background:#e2e8f0;overflow:hidden}.component-wizard-progress i{display:block;height:100%;width:0;background:#334155;transition:width .2s}
.component-connection-guide{display:grid;grid-template-columns:150px minmax(0,1fr);gap:18px;align-items:center;min-height:190px}.component-connection-guide>img{width:140px;height:140px;object-fit:contain}.connection-notes{display:grid;gap:8px}.connection-notes h4{margin:0;font-size:1.02rem}.connection-line{display:grid;grid-template-columns:110px 1fr;gap:8px;padding:8px 10px;border:1px solid #d7dee8;border-radius:10px;background:#f8fafc}.connection-line b{color:#111827}.connection-line span{color:#334155}.component-pin-step{display:grid;gap:12px}.component-pin-step .pin-row{border:0;padding:0;display:block}.component-pin-step .pin-row>img,.component-pin-step .pin-main>strong,.component-pin-step .pin-main>small{display:none}.component-pin-step .pin-main{display:block}.component-pin-step .graphical-pin{display:grid;gap:10px}.component-pin-step .graphical-pin>label{display:none!important}.component-pin-step .arduino-header{margin-top:4px}.wizard-pin-title{text-align:center;font-size:1rem;font-weight:750;color:#111827}.component-name-field,.component-description-field,.muted-prefix,#componentNamePreview{transition:none}.component-wizard-actions #componentPrev.hidden,.component-wizard-actions #componentNext.hidden{display:none!important}
.setup-other-button{margin-top:8px!important}.setup-step.other-setup .step-icon{font-size:1.35rem}
@media(max-width:600px){.component-connection-guide{grid-template-columns:1fr;justify-items:center}.connection-notes{width:100%}.connection-line{grid-template-columns:90px 1fr}}
#codeOutput .syn-key{color:#6b21a8;font-weight:800}#codeOutput .syn-const{color:#9a3412;font-weight:800}#codeOutput .syn-fn{color:#075985;font-weight:800}#codeOutput .syn-num{color:#166534;font-weight:750}#codeOutput .syn-comment{color:#374151;font-style:italic;font-weight:600}
.component-official-description{display:grid;gap:2px;padding:10px 12px;border-left:4px solid #475569;background:#f8fafc;border-radius:8px}.component-official-description small{color:#475569}.component-official-description strong{font-size:.9rem;color:#111827}

.wizard-pin-title{display:grid;gap:3px;margin-bottom:10px}.wizard-pin-title strong{font-size:1.05rem}.wizard-pin-title small{font-weight:400;color:var(--muted)}.led-series-guide{margin-top:12px;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;padding:10px;border:1px solid var(--border);border-radius:12px;background:#fff}.resistor-visual{display:inline-block;padding:5px 14px;border:2px solid #6b4f2a;border-radius:5px;background:#ead7a4;color:#211b12;font-weight:700}.led-guide-note{flex-basis:100%;text-align:center;font-size:.82rem;color:var(--muted)}

/* v0.28 */
.connection-section{display:grid;gap:7px;margin-top:9px}.connection-section h5{margin:2px 0 0;font-size:.83rem;text-transform:uppercase;letter-spacing:.04em;color:#475569}.servo-expert-notice{display:grid;gap:3px;padding:10px 12px;border:1px solid #cbd5e1;border-radius:11px;background:#f8fafc}.servo-expert-notice span{font-size:.86rem;color:#475569}.component-final-summary{grid-column:1/-1;width:100%;display:grid;gap:14px}.component-final-summary>h4{text-align:center;margin:0;font-size:1.03rem}.summary-component{display:grid;grid-template-columns:150px 1fr;gap:20px;align-items:center}.summary-component>img{width:140px;height:140px;object-fit:contain}.summary-signal{display:grid;grid-template-columns:minmax(130px,1fr) 28px 64px;align-items:center;gap:7px;padding:8px 10px;border:1px solid #d7dee8;border-radius:10px;background:#f8fafc}.summary-port{display:flex;align-items:center;justify-content:center;gap:6px;font-weight:800;font-size:1.08rem}.summary-port i{width:13px;height:13px;border:3px solid #253247;border-radius:50%;background:#fff}.setup-other-button{font-size:1.8rem!important;font-weight:400!important}.instruction-icon-button img[src$="io-port.svg"]{width:42px!important;height:42px!important}@media(max-width:600px){.summary-component{grid-template-columns:1fr;justify-items:center}.summary-component>div{width:100%}}
/* v0.29 — resumen gráfico de conexiones */
.component-final-summary{grid-column:1/-1;width:100%;max-width:none}.summary-component{display:grid;grid-template-columns:minmax(150px,210px) minmax(0,1fr);gap:28px;align-items:stretch;width:100%}.summary-device{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0}.summary-device img{width:150px;height:150px;object-fit:contain}.wiring-layout{display:grid;grid-template-columns:repeat(2,minmax(250px,1fr));gap:16px;width:100%;align-content:start}.wiring-group{display:grid;gap:9px;padding:12px;border:1px solid #d7dee8;border-radius:14px;background:#fff}.wiring-group.full{grid-column:1/-1}.wiring-group h5{margin:0 0 2px;font-size:.82rem;text-transform:uppercase;letter-spacing:.04em;color:#475569}.wire-row{display:grid;grid-template-columns:minmax(135px,auto) minmax(70px,1fr) 68px;align-items:center;gap:0;min-height:48px}.wire-origin{display:grid;line-height:1.15}.wire-origin small{margin-top:3px;color:#64748b;font-size:.75rem}.wire{height:4px;width:100%;border-radius:4px;background:#334155}.cable-red{background:#c62828}.cable-dark{background:#3f3f46}.cable-orange{background:#d97706}.cable-signal{background:#2563eb}.board-port{height:42px;min-width:62px;padding:0 8px;border:3px solid #253247;border-radius:9px;background:#f8fafc;display:flex;align-items:center;justify-content:center;font-weight:850;font-size:1rem;box-shadow:inset 0 0 0 3px #fff}.board-port.digital:before{content:'D';font-size:.72rem;margin-right:2px;color:#64748b}.board-port.power,.board-port.ground{font-size:.85rem}.series-note{padding:9px 11px;border-radius:10px;background:#f8fafc;color:#334155;text-align:center}.servo-final-notice{margin:0;text-align:center;color:#334155}.component-connection-guide{width:100%}.connection-notes{min-width:0;width:100%}
@media(max-width:760px){.summary-component{grid-template-columns:1fr}.wiring-layout{grid-template-columns:1fr}.summary-device img{width:125px;height:125px}.wire-row{grid-template-columns:minmax(120px,auto) minmax(45px,1fr) 62px}}

/* v0.30 — asistente: una señal por paso y resumen final a ancho completo */
.component-final-summary{width:100%;min-width:0;overflow:hidden}.component-final-summary .wiring-layout{grid-template-columns:repeat(2,minmax(0,1fr));width:100%;min-width:0}.component-final-summary .wiring-group{min-width:0}.component-final-summary .wire-row{grid-template-columns:minmax(105px,auto) minmax(32px,1fr) minmax(58px,72px);min-width:0}.component-final-summary .wire-origin{min-width:0}.component-final-summary .board-port{min-width:54px}.wiring-group.single-signal{align-content:center;min-height:126px}.pin-fields.single-pin-mode{display:block!important}.pin-fields.single-pin-mode>.pin-row.hidden{display:none!important}.pin-fields.single-pin-mode>.pin-row:not(.hidden){display:block!important;width:100%;min-height:0}.component-pin-step{min-height:0!important;align-content:center}.component-pin-step .graphical-pin{min-height:0!important;align-content:center}.led-final-path{display:grid;grid-template-columns:64px minmax(28px,1fr) 88px minmax(28px,1fr) 100px 48px 100px minmax(28px,1fr) 70px;align-items:center;gap:0;width:100%;min-width:0}.resistor-zigzag{display:grid;justify-items:center;line-height:1}.resistor-zigzag span{font-family:monospace;font-size:1.35rem;font-weight:900;letter-spacing:-2px}.resistor-zigzag small{margin-top:4px;color:#475569;font-weight:700}.led-terminal{display:grid;text-align:center;line-height:1.15}.led-terminal small{color:#64748b}.led-symbol-mini{display:flex;align-items:center;justify-content:center;height:38px;border:2px solid #334155;border-radius:50%;font-weight:800;background:#fff}.component-connection-guide:has(.component-final-summary){display:block;min-height:0}.component-connection-guide:has(.component-final-summary)>img{display:none!important}
@media(max-width:760px){.component-final-summary .wiring-layout{grid-template-columns:1fr}.led-final-path{grid-template-columns:58px minmax(20px,1fr) 78px minmax(20px,1fr) 84px 42px 84px minmax(20px,1fr) 64px;font-size:.82rem}.resistor-zigzag span{font-size:1.1rem}}
@media(max-width:560px){.led-final-path{grid-template-columns:1fr;gap:6px;justify-items:center}.led-final-path .wire{width:4px;height:24px}.component-final-summary .wire-row{grid-template-columns:minmax(100px,auto) minmax(24px,1fr) 60px}}
/* v0.31 */
.wiring-group.compact-final{padding:10px 14px;gap:5px}.wiring-group.compact-final .wire-row{min-height:42px}.resistor-wire{position:relative;display:flex;align-items:center;justify-content:center;background:linear-gradient(to right,#2563eb 0 27%,transparent 27% 73%,#2563eb 73% 100%)}.resistor-inline{background:#fff;padding:0 7px;font-family:monospace;font-size:1.25rem;font-weight:900;line-height:1}.resistor-wire small{position:absolute;top:27px;background:#fff;padding:0 3px;color:#475569;font-weight:700}.project-wizard{max-width:920px!important}.project-progress{height:8px;background:#e2e8f0;border-radius:99px;overflow:hidden}.project-progress i{display:block;height:100%;background:#334155;transition:width .2s}.project-wizard h4{margin:0;font-size:1.15rem}.project-wizard p{color:#475569}.board-supply-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:28px;align-items:center}.power-tabs{display:flex;gap:5px;margin:12px 0}.power-tabs button{background:#f5f7fa!important;color:#334155!important;border:1px solid #d7dee8!important}.power-tabs button.active{background:#e9f0ff!important;color:#1d4ed8!important;border-color:#9dbaf3!important}.supply-card{min-height:190px;border:1px solid #d7dee8;border-radius:16px;padding:22px;display:grid;place-items:center;gap:10px;text-align:center;background:#fbfcfe}.supply-icon{font-size:3rem}.supply-wire,.supply-lines{font-family:monospace;font-weight:800;color:#334155}.supply-lines{display:grid;gap:8px}.battery-pair{display:flex;gap:7px}.battery-pair i{font-style:normal;border:3px solid #334155;border-radius:18px;padding:24px 9px;background:#eef2f6}.arduino-sketch{height:250px;border:4px solid #1f5e91;border-radius:22px;background:#2f7fbd;color:#fff;display:grid;grid-template-columns:1fr 1fr;place-items:center;padding:25px;box-shadow:inset 0 0 0 5px #ffffff1f}.arduino-sketch strong{grid-column:1/-1;font-size:1.55rem;text-align:center}.arduino-usb{grid-column:1/-1;background:#dbe2e8;color:#172033;border:3px solid #64748b;border-radius:6px;padding:8px 24px}.arduino-sketch span{background:#172033;border-radius:7px;padding:6px 9px}.wizard-component-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.wizard-component{border:1px solid #d7dee8;border-radius:14px;padding:10px;background:#fff}.wizard-component.selected{box-shadow:0 0 0 2px #8fb2ef inset;background:#f7faff}.wizard-component label{display:grid!important;justify-items:center;text-align:center;gap:7px!important;cursor:pointer}.wizard-component label input{width:auto}.wizard-component img{width:64px;height:64px}.qty{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:8px}.qty button{width:30px;height:30px;padding:0}.wizard-stage{min-height:300px;display:grid;align-content:center;justify-items:center;text-align:center;gap:15px}.stage-flow{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}.stage-flow span{display:flex;align-items:center;gap:6px;border:1px solid #d7dee8;border-radius:12px;padding:8px 11px}.stage-flow img{width:34px;height:34px}.stage-symbol{font-size:3rem;letter-spacing:12px}.stage-code{font-family:monospace;font-size:1.4rem;font-weight:850;border:1px solid #d7dee8;border-radius:13px;padding:15px 25px;background:#f8fafc}.wizard-ready{font-weight:700}.project-wizard .modal-actions{position:sticky;bottom:0;background:#fff;padding-top:8px}@media(max-width:760px){.board-supply-layout{grid-template-columns:1fr}.arduino-sketch{height:190px}.wizard-component-grid{grid-template-columns:repeat(2,1fr)}}
/* v0.32 */
.project-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:24px 0}.project-choice-grid button{min-height:150px;display:grid;place-items:center;align-content:center;gap:8px;background:#fff!important;color:#172033!important;border:2px solid #d7dee8!important;border-radius:16px}.project-choice-grid button:hover{border-color:#8fb2ef!important;background:#f7faff!important}.project-choice-grid strong{font-size:1.15rem}.project-choice-grid small{font-weight:400;color:#64748b}.wiring-group.full.compact-final{align-content:center;min-height:0!important;height:auto}.wiring-group.full.compact-final .wire-row{min-height:40px}.hidden{display:none!important}
@media(max-width:600px){.project-choice-grid{grid-template-columns:1fr}}

/* v0.34 */
.component-palette{display:flex;gap:12px;flex-wrap:wrap;align-items:center}.add-component-main{min-height:86px;padding:18px 28px}.component-picker-title{width:100%;font-size:1.05rem;margin-bottom:4px}.data-type-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.data-type-card{border:1px solid #cbd5e1;border-radius:14px;padding:16px;display:flex;flex-direction:column;align-items:center;gap:8px;cursor:pointer}.data-type-card input{position:absolute;opacity:0}.data-type-card:has(input:checked){outline:3px solid #2f65a7}.type-icon{font-size:1.35rem;font-weight:800;border:2px solid #17365d;border-radius:8px;padding:8px;min-width:48px;text-align:center}.data-locker-preview,.data-kind-icon{display:flex;flex-direction:column;align-items:center;gap:5px}.data-locker-preview img{width:86px}.live-data-type,.data-type-label{font-size:.72rem;letter-spacing:.04em}.reserve-locker small{font-weight:700}.data-wizard-modal{max-width:760px}.project-wizard .wizard-stage{padding-left:28px;padding-right:28px}.project-wizard .modal-actions{padding-left:20px;padding-right:20px}.project-choice-grid button:before{display:block;font-size:2rem;margin-bottom:10px}.project-choice-grid button[data-choice="blank"]:before{content:"▱＋"}.project-choice-grid button[data-choice="guided"]:before{content:"●─●→"}
@media(max-width:700px){.data-type-grid{grid-template-columns:repeat(2,1fr)}}

.physical-resistor{position:relative;width:82px;height:24px;display:inline-block;border-radius:10px;background:#d8b17a;border:2px solid #8b6a42}.physical-resistor:before,.physical-resistor:after{content:"";position:absolute;top:9px;width:22px;border-top:2px solid #777}.physical-resistor:before{right:100%}.physical-resistor:after{left:100%}.physical-resistor i,.physical-resistor b,.physical-resistor em,.physical-resistor u{position:absolute;top:0;bottom:0;width:5px}.physical-resistor i{left:16px;background:#b91c1c}.physical-resistor b{left:29px;background:#b91c1c}.physical-resistor em{left:43px;background:#7c3aed}.physical-resistor u{left:58px;background:#d4a017}.compact-final{width:min(620px,92%);margin-left:auto;margin-right:auto}.choice-icon{font-size:2rem;display:block;margin-bottom:10px}.board-supply-layout{grid-template-columns:minmax(280px,.9fr) minmax(340px,1.1fr)}

/* v0.34: componentes compactos y selector modal */
#componentPalette{display:none}.component-list{display:flex;flex-wrap:wrap;align-items:stretch;gap:12px}.compact-component-card{width:250px;display:flex;flex-direction:column;gap:10px;padding:12px}.component-card-head{display:grid;grid-template-columns:46px minmax(0,1fr) auto;align-items:center;gap:8px}.component-card-head .component-img{width:44px;height:44px}.component-card-head>strong{font-size:.9rem;overflow-wrap:anywhere}.component-card-head .card-actions{gap:4px}.component-pin-link{display:grid;grid-template-columns:82px 22px 58px;justify-content:center;align-items:center;gap:5px;border-top:1px solid #edf1f5;padding-top:8px}.typed-locker{display:flex!important;flex-direction:column;align-items:center;gap:1px}.typed-locker>strong{font-size:.61rem;letter-spacing:.04em;color:#657184}.typed-locker img{width:42px;height:42px}.typed-locker small{font-size:.66rem;color:#2764d8;text-align:center;overflow-wrap:anywhere;max-width:80px}.component-pin-link>.locker-arrow{font-size:1.2rem;font-weight:800;text-align:center}.mini-board-port{width:56px;height:48px;border:2px solid #334155;border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f8fafc}.mini-board-port small{font-size:.52rem;color:#657184}.mini-board-port b{font-size:.86rem}.component-card-add{width:190px;min-height:118px;border:2px dashed #a9b8ca!important;border-radius:14px!important;background:#f8fafc!important;color:#2764d8!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:14px!important;align-self:stretch}.component-card-add span{font-size:1.65rem;line-height:1}.component-card-add:hover{background:#eef4ff!important;border-color:#2764d8!important}.component-picker-modal{max-width:720px}.component-picker-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.component-picker-options .component-choice{min-height:112px}.danger-confirm{background:#b42318!important}.deleteComponentMessage{padding:0 8px}@media(max-width:720px){.component-picker-options{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-component-card{width:min(100%,250px)}}

/* v0.35 refinements */
.component-card-head{grid-template-columns:52px minmax(0,1fr) auto!important;align-items:start!important}.component-card-copy{min-width:0;display:grid;gap:3px}.component-card-copy>strong{font-size:.92rem;color:#172033;overflow-wrap:anywhere}.component-card-copy>small{font-size:.7rem;color:#657184;line-height:1.25;overflow-wrap:anywhere}.card-actions{display:flex!important;justify-content:flex-end;align-items:center;gap:4px;margin-left:auto}.card-actions .icon-btn{width:31px!important;height:31px!important;padding:0!important;display:grid!important;place-items:center;border-radius:8px!important}
.component-picker-options .component-choice{background:#fff!important;color:#172033!important;border:1px solid #d7dee8!important;min-height:150px!important;padding:14px!important}.component-picker-options .component-choice:hover:not(:disabled){background:#fbfcfe!important;border-color:#8aa9d3!important;box-shadow:0 0 0 3px #2764d815}.component-picker-options .component-choice img{width:92px!important;height:92px!important;object-fit:contain}.component-picker-options .component-choice strong{font-size:.9rem}.component-picker-options .component-choice span{color:#657184;font-size:.72rem}
.data-type-card{background:#fff!important;min-height:132px;justify-content:center}.data-type-card:has(input:checked){border-color:#2764d8!important;outline:none!important;box-shadow:0 0 0 3px #2764d825,0 7px 20px #2764d818}.type-icon{border:0!important;border-radius:0!important;padding:0!important;min-width:78px!important;min-height:58px;display:grid!important;place-items:center;position:relative;font-style:normal!important}.type-icon b,.type-icon i,.type-icon em{font-style:normal;line-height:1}.type-integer b{font-size:2rem}.type-integer i{position:absolute;left:2px;bottom:2px;font-size:.86rem}.type-integer em{position:absolute;right:0;top:3px;font-size:.82rem}.type-decimal b{font-size:1.75rem}.type-decimal i{position:absolute;right:-3px;bottom:0;font-size:.82rem}.type-text b{font-size:2rem}.type-text i{font-size:.72rem;color:#657184}.type-bool{grid-template-columns:1fr 1fr!important;gap:10px}.type-bool b,.type-bool i{font-size:1.75rem;font-style:normal}.type-bool b{color:#2764d8}.type-bool i{color:#657184}
.data-kind-card{padding:15px 12px!important;gap:9px!important}.data-kind-title{font-size:1.02rem!important;font-weight:850!important;color:#172033}.data-kind-card:has(input:checked){border:2px solid #2764d8!important;box-shadow:0 0 0 4px #2764d825,0 8px 24px #2764d820!important;background:#f8fbff}.data-kind-icon .live-locker-name{color:#111827!important;font-weight:800!important}.data-locker-preview .live-locker-name{color:#111827!important;font-weight:800!important;font-size:.92rem!important}.reserve-locker{border:2px dashed #a9b8ca!important;background:#fbfcfe!important}.reserve-locker:hover{border-color:#2764d8!important;background:#f7faff!important}.reserve-locker-icon{display:flex;align-items:center;justify-content:center;gap:2px}.reserve-locker-icon>b{font-size:1.6rem;color:#2764d8;font-weight:500}.reserve-locker-icon img{width:58px!important;height:64px!important}
.resistor-wire small{top:-23px!important;color:#172033!important;background:#fff!important;font-weight:800!important;padding:1px 5px!important;border-radius:4px}.led-like-row{margin-top:17px}
.add-component-main,.component-card-add,.reserve-locker,#addExpert{border-style:dashed!important}
@media(max-width:720px){.data-type-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.component-picker-options .component-choice img{width:80px!important;height:80px!important}}

/* v0.39 */
.addInstruction,#addExpert,#addModule,.setup-other-button,.sensor-config-button{border:2px dashed #a9b8ca!important}
.addInstruction:hover,#addExpert:hover,#addModule:hover,.setup-other-button:hover,.sensor-config-button:hover{border-color:#2764d8!important}
.type-icon svg{width:72px;height:58px;fill:none;stroke:#17365d;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.type-bool{display:grid!important;grid-template-columns:1fr!important;gap:0!important}
.type-bool svg{width:72px;height:58px}
.instruction-icon-button.setup-other-button{border:2px dashed #a9b8ca!important}

/* v0.39 */
.board-supply-layout{display:grid!important;grid-template-columns:minmax(330px,1fr) 100px minmax(300px,.9fr)!important;gap:18px!important;align-items:center!important;margin-top:18px}.arduino-side,.supply-side{display:grid;justify-items:center;gap:10px;min-width:0}.arduino-side>strong,.supply-visual>strong{font-size:1rem}.uno-board{position:relative;width:min(100%,390px);aspect-ratio:1.45/1;background:#111827;clip-path:polygon(4% 0,94% 0,100% 8%,100% 28%,96% 34%,100% 40%,100% 92%,94% 100%,4% 100%,4% 93%,0 93%,0 19%,4% 19%);border-radius:8px;box-shadow:inset 0 0 0 4px #263244}.uno-usb{position:absolute;left:-1%;top:18%;width:17%;height:23%;background:#d9dee5;border:3px solid #77808c;border-radius:5px}.uno-jack{position:absolute;left:-2%;bottom:8%;width:20%;height:17%;background:#202938;border:3px solid #050a12;border-radius:5px}.uno-chip{position:absolute;left:42%;bottom:21%;width:39%;height:16%;background:#d8dde4;border-radius:4px;box-shadow:0 0 0 3px #f3f4f6}.uno-header{position:absolute;height:7%;background:repeating-linear-gradient(90deg,#e5e7eb 0 8%,#111827 8% 14%);border:2px solid #e5e7eb}.uno-header-top{left:29%;right:7%;top:5%}.uno-header-bottom{left:48%;right:7%;bottom:5%}.uno-mark{position:absolute;left:57%;top:20%;color:#fff;font-size:2rem}.uno-mark b{font-size:1.5rem}.uno-label{position:absolute;left:47%;top:42%;color:#f8fafc;font-size:.85rem;line-height:1.15}.uno-label strong{font-size:1.1rem}.uno-pin{position:absolute;color:#fff;background:#263244;padding:3px 6px;border-radius:5px;font-size:.62rem}.uno-pin.vin{left:27%;bottom:6%}.uno-pin.gnd{left:37%;bottom:6%}.supply-visual{min-height:220px;width:100%;display:grid;justify-items:center;align-content:center;gap:10px;padding:14px;border:1px solid #d7dee8;border-radius:16px;background:#fbfcfe}.supply-visual small{max-width:280px;text-align:center;color:#64748b}.powerbank-drawing{position:relative;width:175px;height:105px;background:#36bfd0;border:5px solid #197889;border-radius:28px 15px 28px 15px;transform:skewY(-6deg);box-shadow:inset -12px -10px 0 #2496a9}.powerbank-bolt{position:absolute;left:67px;top:16px;color:#fff;font-size:3.2rem;transform:skewY(6deg)}.powerbank-dots{position:absolute;left:22px;bottom:18px;color:#155e75;letter-spacing:4px}.powerbank-ports{position:absolute;right:12px;bottom:10px;display:flex;gap:8px}.powerbank-ports i{width:28px;height:10px;background:#e6f5f7;border:3px solid #155e75;border-radius:7px}.battery-holder{position:relative;width:185px;height:112px;border:5px solid #555;border-radius:15px;transform:skewY(-5deg);background:#f4f4f4;padding:13px;display:flex;gap:10px}.battery-cell{position:relative;flex:1;border:3px solid #777;border-radius:14px;background:linear-gradient(90deg,#d8e0e7,#f8fafc,#b8c4ce)}.battery-cell b,.battery-cell i{position:absolute;left:50%;transform:translateX(-50%);font-style:normal;font-size:1rem}.battery-cell b{top:4px}.battery-cell i{bottom:4px}.holder-rail{position:absolute;inset:7px;border:2px solid #aaa;border-radius:10px;pointer-events:none}.wall-adapter{position:relative;width:190px;height:125px}.adapter-body{position:absolute;left:12px;top:20px;width:76px;height:82px;border:4px solid #263244;border-radius:13px;background:#e9edf2}.adapter-body i{position:absolute;left:-19px;width:22px;border-top:4px solid #263244}.adapter-body i:first-child{top:25px}.adapter-body i:last-child{top:49px}.adapter-cord{position:absolute;left:88px;top:60px;width:73px;border-top:5px solid #263244}.barrel-plug{position:absolute;right:3px;top:50px;width:30px;height:20px;border:4px solid #263244;border-radius:5px;background:#cbd5e1}.connection-bridge{position:relative;height:90px}.connection-bridge:before{content:"";position:absolute;left:0;right:0;top:43px;border-top:4px solid #2764d8}.connection-bridge:after{content:"→";position:absolute;right:-3px;top:24px;font-size:2rem;color:#2764d8;font-weight:800}.power-link{display:grid;justify-items:center;gap:5px;color:#334155;font-size:.75rem;font-weight:800}.battery-link .positive{color:#b42318}.battery-link .negative{color:#334155}.power-tabs{margin-top:12px}.instruction-icon-button img[src$="init-locker.svg"]{width:48px!important;height:44px!important}.instruction-icon-button img[src$="io-port.svg"]{width:54px!important;height:44px!important}
@media(max-width:820px){.board-supply-layout{grid-template-columns:1fr!important}.connection-bridge{height:36px;width:100%}.connection-bridge:before{top:16px}.connection-bridge:after{top:-3px}.uno-board{width:min(100%,360px)}}
/* v0.39: Arduino más pequeño/claro; selector de alimentación en columna derecha */
.board-supply-layout{grid-template-columns:minmax(250px,.78fr) 82px minmax(360px,1.22fr)!important;gap:16px!important;align-items:center!important}
.arduino-side{align-self:center}
.uno-board{width:min(100%,285px)!important;aspect-ratio:1.52/1!important;background:#5aa9d6!important;clip-path:polygon(3% 0,92% 0,96% 4%,100% 4%,100% 24%,97% 28%,100% 32%,100% 91%,96% 91%,92% 100%,4% 100%,4% 95%,0 95%,0 18%,3% 18%)!important;border-radius:6px!important;box-shadow:inset 0 0 0 3px #3d8fbd!important}
.uno-header{background:repeating-linear-gradient(90deg,#263746 0 8%,#d8e1e8 8% 14%)!important;border-color:#314657!important}
.uno-chip{background:#263746!important;box-shadow:0 0 0 2px #b8c6cf!important}
.uno-label,.uno-mark{color:#f8fbfd!important}.uno-pin{background:#397fa8!important;color:#fff!important}
.uno-usb{left:-2%!important;top:19%!important;width:18%!important;height:25%!important}.uno-jack{left:-2%!important;bottom:9%!important;width:19%!important;height:18%!important}
.power-tabs{grid-column:3;display:flex!important;justify-content:center;flex-wrap:wrap;margin:0 0 10px!important}
.supply-side{grid-column:3;grid-row:2}
.arduino-side{grid-column:1;grid-row:1 / span 2}
.connection-bridge{grid-column:2;grid-row:2}
.board-supply-layout{grid-template-rows:auto 1fr}
@media(max-width:820px){.board-supply-layout{grid-template-columns:1fr!important;grid-template-rows:auto!important}.arduino-side,.power-tabs,.supply-side,.connection-bridge{grid-column:1!important;grid-row:auto!important}.uno-board{width:min(100%,275px)!important}.power-tabs{margin-top:8px!important}}

/* v0.39 */
.arduino-reference{display:block;width:min(100%,270px);height:auto;object-fit:contain}
.instruction-choices{align-items:center!important}
.instruction-choices .instruction-icon-button{align-self:center!important;margin:0!important}
.instruction-icon-button.setup-other-button{display:grid!important;place-items:center!important;height:72px!important;width:54px!important;padding:6px!important;line-height:1!important}
.instruction-icon-button img[src$="init-locker.svg"]{width:58px!important;height:48px!important}
.instruction-icon-button img[src$="io-port.svg"]{width:58px!important;height:48px!important}

/* v0.42: ajustes visuales Setup, Ejecutar acción y alimentación */
.instruction-icon-button img[src$="init-locker.svg"]{width:64px!important;height:48px!important}
.instruction-icon-button img[src$="io-port.svg"]{width:62px!important;height:44px!important}
.supply-visual{min-height:190px!important}
.powerbank-drawing{width:126px!important;height:76px!important;border-width:4px!important;border-radius:21px 12px 21px 12px!important}
.powerbank-bolt{left:48px!important;top:10px!important;font-size:2.35rem!important}
.powerbank-dots{left:16px!important;bottom:12px!important;font-size:.72rem!important}
.powerbank-ports{right:8px!important;bottom:7px!important;gap:5px!important}
.powerbank-ports i{width:20px!important;height:7px!important;border-width:2px!important}
.battery-holder{width:134px!important;height:82px!important;border-width:4px!important;padding:9px!important;gap:7px!important}
.battery-cell{border-width:2px!important;border-radius:10px!important}
.wall-adapter{width:138px!important;height:91px!important}
.adapter-body{left:10px!important;top:14px!important;width:55px!important;height:60px!important;border-width:3px!important;border-radius:9px!important}
.adapter-body i{left:-14px!important;width:16px!important;border-top-width:3px!important}
.adapter-body i:first-child{top:18px!important}.adapter-body i:last-child{top:36px!important}
.adapter-cord{left:65px!important;top:44px!important;width:52px!important;border-top-width:4px!important}
.barrel-plug{right:2px!important;top:36px!important;width:22px!important;height:15px!important;border-width:3px!important}
/* v0.42 */
.board-supply-layout{grid-template-columns:minmax(330px,1fr) minmax(300px,.9fr)!important}
.connection-bridge{display:none!important}
.power-tabs{grid-column:2!important}.supply-side{grid-column:2!important}.arduino-side{grid-column:1!important}
.guided-locker-count{max-width:420px;margin:0 auto}.guided-locker-count img{width:76px;height:64px}.guided-data-types,.guided-data-behavior{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:18px}.guided-data-types button,.guided-data-behavior button{border:1px solid #cfd9e7;border-radius:16px;background:#fff;padding:16px;display:grid;justify-items:center;gap:8px}.guided-data-types button.selected,.guided-data-behavior button.selected{border:3px solid #2764d8;box-shadow:0 0 0 3px #dbe8ff}.guided-data-types img,.guided-data-behavior img{width:68px;height:58px}.guided-data-behavior{grid-template-columns:repeat(2,minmax(0,1fr));max-width:620px;margin-left:auto;margin-right:auto}.guided-live-locker{display:grid;justify-items:center;gap:5px;margin:14px auto}.guided-live-locker img{width:92px;height:78px}.guided-live-locker b{font-size:1.05rem}.guided-data-name{max-width:440px;margin:12px auto;display:grid;gap:6px}.guided-data-name input{font-size:1.05rem;padding:11px}.guided-data-editor{max-width:760px;margin:0 auto}
@media(max-width:820px){.board-supply-layout{grid-template-columns:1fr!important}.power-tabs,.supply-side,.arduino-side{grid-column:1!important}.guided-data-types{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v0.42: guided Data reuses the normal Data visual language; Setup icons fit their cards */
.guided-data-type-card{appearance:none;font:inherit;color:inherit;width:100%}
.guided-data-type-card.selected{border-color:#2764d8!important;outline:none!important;box-shadow:0 0 0 3px #2764d825,0 7px 20px #2764d818!important}
.guided-data-kind-card{appearance:none;font:inherit;color:inherit;width:100%;background:#fff}
.guided-data-kind-card.selected{border:2px solid #2764d8!important;box-shadow:0 0 0 4px #2764d825,0 8px 24px #2764d820!important;background:#f8fbff!important}
.instruction-icon-button img[src$="io-port.svg"]{width:54px!important;height:42px!important;object-fit:contain!important;object-position:center!important}
.instruction-icon-button img[src$="init-locker.svg"]{object-fit:contain!important;object-position:center!important}

.setup-init-combo{display:flex;align-items:center;justify-content:center;gap:2px;width:62px;height:46px}
.setup-init-combo img{width:43px!important;height:43px!important;object-fit:contain}
.setup-init-combo span{font-size:1.55rem;line-height:1;color:#17365d;font-weight:500;transform:translateX(-1px)}

/* v0.43 */
.type-icon svg{width:86px;height:58px;overflow:visible}.type-integer svg,.type-decimal svg{fill:none;stroke:#17365d;stroke-width:1.8}.type-integer svg text,.type-decimal svg text{fill:#17365d;stroke:none;font:700 10px system-ui,sans-serif}.type-integer svg .set-z,.type-integer svg .set-n{font-size:9px}.type-decimal svg .decimal-fill{fill:none;stroke:#17365d;stroke-dasharray:2 2}
.setup-init-combo{width:54px!important;height:44px!important;gap:1px!important;overflow:hidden}.setup-init-combo img{width:34px!important;height:38px!important}.setup-init-combo span{font-size:1.15rem!important;transform:none!important}.instruction-icon-button .setup-init-combo{margin:auto}
.guided-algorithm-stage{display:grid;gap:14px}.guided-algorithm-stage h5{margin:2px 0 0}.guided-specials,.guided-common-instructions{display:flex;flex-wrap:wrap;gap:9px;justify-content:center}.guided-current-list{display:grid;gap:6px;padding:12px;border:1px solid #d7dee8;border-radius:12px;background:#fbfcfe}.guided-current-list div{padding:7px 9px;border-radius:8px;background:#fff;border:1px solid #e2e8f0}.guided-flow-review{display:grid;justify-items:center;gap:7px;padding:14px;border:1px solid #d7dee8;border-radius:14px}.guided-flow-review>div{min-width:240px;text-align:center;padding:8px 12px;border:1px solid #cbd5e1;border-radius:9px;background:#fff}.guided-flow-review>span{font-weight:800;color:#64748b}.guided-back-build{justify-self:center}

/* v0.44 Setup/Loop layout */
.setup-top-actions{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap;margin:0 0 12px}.setup-top-actions>.addInstruction,.setup-other-top>.addInstruction{margin:0}.setup-other-top{position:relative}.setup-other-top .instruction-choices{position:absolute;left:0;top:calc(100% + 6px);z-index:20;background:#fff;padding:8px;border:1px solid #d7dee8;border-radius:10px;box-shadow:0 8px 22px rgba(0,0,0,.12);white-space:nowrap}.setup-instructions-area{min-height:70px}.loop-instructions-area{min-height:90px;overflow:auto;padding-bottom:8px}.loop-add-dock{position:sticky;left:0;bottom:0;z-index:15;background:var(--panel,#fff);padding:8px 0 2px}.loop-add-dock .algorithm-add{margin:0;display:inline-block}

/* v0.45 — barras de herramientas permanentes de Setup y Loop */
.setup-container,.loop-container{position:relative}
#setupBuilder,#algorithmBuilder{max-width:none!important;margin:0!important;padding:0!important;display:flex;flex-direction:column;min-height:210px}
.setup-instructions-area,.loop-instructions-area{flex:1;min-height:90px;overflow:auto;padding:0 0 10px 0!important;margin:0!important}
.setup-step,.algorithm-list,.algorithm-step{margin-left:0!important}
.setup-tools-dock,.loop-tools-dock{position:sticky;bottom:0;left:0;z-index:15;background:#fff;border-top:1px solid #d9e2ec;padding:10px 0 4px;margin-top:auto;display:flex;align-items:flex-end;justify-content:flex-start;gap:10px;flex-wrap:wrap}
.setup-tool-button{border:2px dashed #a9b8ca;background:#fff;color:#334155;border-radius:12px;padding:10px 12px;font-weight:700;cursor:pointer}
.setup-tool-button:hover{border-color:#2764d8;background:#f8fafc}
.setup-other-dock{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.setup-other-dock>strong{font-size:.9rem;color:#334155;white-space:nowrap}
.setup-tools-dock .instruction-choices,.loop-tools-dock .instruction-choices{justify-content:flex-start!important;margin:0!important;gap:7px!important}
.loop-tools-dock{display:block}
@media(max-width:760px){.setup-tools-dock{align-items:flex-start}.setup-other-dock{width:100%}}

/* v0.46 — instrucciones compactas y centradas; herramientas fijas abajo */
.setup-instructions-area,.loop-instructions-area{display:flex;flex-direction:column;align-items:center!important;width:100%}
.setup-instructions-area>.algorithm-empty,.loop-instructions-area>.algorithm-empty{align-self:stretch;text-align:center}
.setup-step,.algorithm-step{width:min(760px,92%)!important;max-width:760px!important;box-sizing:border-box;margin-left:auto!important;margin-right:auto!important}
.algorithm-list{width:100%!important;display:flex;flex-direction:column;align-items:center}
.algorithm-list>.nested-box,.algorithm-list>.container-config{width:min(760px,92%)!important;box-sizing:border-box}
.flow-arrow{align-self:center}
.setup-main small{display:block;color:#64748b;font-size:.78rem;margin-top:2px}
.setup-other-dock{position:relative;display:flex;align-items:flex-end!important}
.setup-other-choices{position:absolute;left:0;bottom:calc(100% + 7px);z-index:30;background:#fff;border:1px solid #d7dee8;border-radius:10px;padding:8px;box-shadow:0 8px 22px rgba(0,0,0,.12);white-space:nowrap}
.setup-other-choices.hidden{display:none!important}
.setup-tools-dock,.loop-tools-dock{align-self:stretch}
.instruction-icon-button img,.step-icon img,#instructionIcon img{filter:grayscale(1);}

/* v0.47 — paneles compactos cuando están vacíos */
#setupBuilder,#algorithmBuilder{min-height:0!important;height:auto!important}
.setup-instructions-area,.loop-instructions-area{flex:0 1 auto!important;min-height:0!important;max-height:430px;overflow:auto;padding:0 0 8px 0!important}
.setup-instructions-area:has(> .algorithm-empty),.loop-instructions-area:has(> .algorithm-empty){min-height:0!important;overflow:visible!important;padding-bottom:2px!important}
.setup-instructions-area>.algorithm-empty,.loop-instructions-area>.algorithm-empty{padding:7px 0!important;margin:0!important}
.setup-tools-dock,.loop-tools-dock{position:sticky;bottom:0;margin-top:4px!important}

/* v0.48: metáforas de Setup, iconos de agregar y bordes rayados */
.add-component-main,.component-card-add,.reserve-locker,#addExpert,.addInstruction,#addModule,.setup-other-button,.sensor-config-button,.instruction-icon-button.setup-other-button,.setup-tool-button{border-style:dashed!important}
.add-component-main,.component-card-add,.reserve-locker,#addExpert,.addInstruction,#addModule,.setup-other-button,.sensor-config-button,.instruction-icon-button.setup-other-button,.setup-tool-button{border-width:2px!important}
.add-component-icons{display:flex;align-items:center;justify-content:center;gap:3px;height:30px}
.add-component-icons img{width:27px!important;height:27px!important;object-fit:contain;filter:grayscale(1)}
.add-component-plus{font-size:1.35rem!important;line-height:1!important}
.setup-tool-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:132px;min-height:78px}
.setup-metaphor{height:38px;display:flex;align-items:center;justify-content:center;color:#17365d}
.setup-metaphor-init{position:relative;width:58px}
.setup-metaphor-init img{width:37px;height:37px;object-fit:contain}
.setup-metaphor-init b{font-size:1.3rem;margin-left:-2px}
.setup-metaphor-ports{gap:2px;font-size:1.2rem;font-weight:800}
.setup-metaphor-ports .mini-port{display:grid;place-items:center;width:23px;height:23px;border:2px solid #334155;border-radius:5px;font-size:.8rem;background:#fff}
.setup-metaphor-ports b{font-size:1.1rem;line-height:1}
.setup-metaphor-other{gap:3px;font-size:1.45rem;font-weight:800}

/* v0.49 — claridad visual, validación y numeración */
.error{font-size:.9rem!important;font-weight:800!important;line-height:1.3}
.algorithm-step,.setup-step{border-width:2px!important;border-style:solid!important}
.instruction-number{font-weight:900;color:#334155;margin-right:3px}
.setup-other-dock>.setup-tool-button{min-width:78px!important}
.add-component-icons{gap:4px}
.add-component-icons img{width:25px!important;height:25px!important}
input[name],input[id*="Name"],input[id*="name"]{scroll-margin-top:12px}

/* v0.61 */
.setup-other-choices{display:grid!important;grid-template-columns:repeat(2,54px)!important;gap:7px!important;white-space:normal!important}
.setup-other-choices.hidden{display:none!important}
@media(max-width:520px){.setup-other-choices{grid-template-columns:54px!important}}
.prefix-check{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:wrap}
.prefix-live-preview{font-weight:800;color:#334155;background:#f1f5f9;border-radius:7px;padding:2px 7px;margin-left:3px}
.algorithm-step .step-icon,.setup-step .step-icon{border:1px solid rgba(34,197,94,.42)!important;box-shadow:0 0 0 2px rgba(34,197,94,.08),0 0 9px rgba(34,197,94,.18)!important}
.nested-instruction-dock{margin:8px 0 2px!important;display:flex!important;justify-content:center!important}
.nested-instruction-bar{display:flex!important;gap:7px!important;justify-content:center!important;flex-wrap:wrap!important;margin:0!important}
.nested-instruction-bar .instruction-icon-button{width:49px!important;height:65px!important;border-radius:14px!important;padding:5px!important;font-size:22px!important}
.nested-instruction-bar .instruction-icon-button img{width:32px!important;height:38px!important}

/* v0.61: Decidir en pestañas y estructuras anidadas */
.decision-tab-buttons{display:flex;gap:0;margin:0 0 10px;border-bottom:2px solid #d9e2ec}
.decision-tab{border:1px solid #cbd5e1!important;border-bottom:0!important;background:#f8fafc!important;color:#334155!important;border-radius:10px 10px 0 0!important;padding:8px 18px!important;font-weight:800!important;margin-right:4px}
.decision-tab.active{background:#fff!important;color:#0f172a!important;box-shadow:inset 0 3px 0 #2563eb}
.decision-pane{display:none;min-height:74px}
.decision-pane.active{display:block}
.decision-pane>.algorithm-list{margin-top:2px}

/* v0.61: producción inicial, zoom de instrucciones y realce visual */
.algorithm-step .step-icon,.setup-step .step-icon{border-color:rgba(22,163,74,.68)!important;box-shadow:0 0 0 2px rgba(34,197,94,.16),0 0 12px rgba(34,197,94,.36)!important}
.instruction-zoom-controls{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin:2px 0 6px;font-weight:800;color:#475569}
.instruction-zoom-controls .zoom-button{width:30px;height:30px;padding:0;border-radius:8px;font-size:18px;line-height:1}
.instruction-zoom-controls span{min-width:46px;text-align:center;font-size:13px}

/* Las barras de inserción viven fuera del área escalada; no cambian de tamaño. */


/* v0.61: zoom ampliado y código cromático de estructuras */
#setupBuilder.zoom-instruction-workspace>.setup-instructions-area,
#setupBuilder.zoom-instruction-workspace>.setup-tools-dock,
#algorithmBuilder.zoom-instruction-workspace>.loop-instructions-area,
#algorithmBuilder.zoom-instruction-workspace>.loop-tools-dock{zoom:var(--instruction-zoom,1)}
.structure-if{border-color:rgba(234,88,12,.72)!important;box-shadow:0 0 0 2px rgba(249,115,22,.08),0 0 12px rgba(249,115,22,.18)!important}
.structure-while{border-color:rgba(37,99,235,.68)!important;box-shadow:0 0 0 2px rgba(59,130,246,.08),0 0 12px rgba(59,130,246,.18)!important}
.structure-choice-if{border-color:rgba(234,88,12,.62)!important;box-shadow:0 0 8px rgba(249,115,22,.20)!important}
.structure-choice-while{border-color:rgba(37,99,235,.58)!important;box-shadow:0 0 8px rgba(59,130,246,.20)!important}

.structure-if-body{border-color:rgba(234,88,12,.52)!important;box-shadow:inset 0 0 0 1px rgba(249,115,22,.08),0 0 10px rgba(249,115,22,.10)!important}
.structure-while-body{border-color:rgba(37,99,235,.48)!important;box-shadow:inset 0 0 0 1px rgba(59,130,246,.08),0 0 10px rgba(59,130,246,.10)!important}

/* v0.61: color unificado de Decidir, realce estructural y Operar datos */
.decision-tab-buttons{border-bottom-color:rgba(234,88,12,.38)!important}
.decision-tab{border-color:rgba(234,88,12,.38)!important;background:#fff7ed!important;color:#9a3412!important}
.decision-tab.active{background:#ffedd5!important;color:#7c2d12!important;box-shadow:inset 0 3px 0 #ea580c,0 0 7px rgba(249,115,22,.18)!important}
.structure-choice-if{border-color:rgba(234,88,12,.82)!important;box-shadow:0 0 0 2px rgba(249,115,22,.10),0 0 12px rgba(249,115,22,.34)!important}
.structure-choice-while{border-color:rgba(37,99,235,.78)!important;box-shadow:0 0 0 2px rgba(59,130,246,.10),0 0 12px rgba(59,130,246,.32)!important}
.data-operation-dialog{max-width:430px;width:min(92vw,430px)}
.data-operation-form{text-align:center}.data-operation-options{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:18px 0}
.data-operation-options button{display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px;border:2px solid #cbd5e1;background:#fff;border-radius:14px}
.data-operation-options img{width:58px;height:58px}.data-operation-cancel{margin-top:2px}

/* v0.61: Operar datos coherente con casilleros RAGECA */
.data-operation-dialog{max-width:560px!important;width:min(94vw,560px)!important}
.data-operation-form{text-align:left!important}.data-operation-options{margin:16px 0 4px!important}
.data-operation-options button{min-height:132px;border:1px solid #cfd9e7!important;border-radius:16px!important;background:#fff!important;justify-content:center}
.data-operation-options button:hover{border-color:#2764d8!important;background:#f8fbff!important}
.data-operation-options img{width:70px!important;height:64px!important;object-fit:contain}
.inline-reserve-locker{border:2px dashed #a9b8ca!important;background:#fbfcfe!important;min-width:112px}
.quick-data-dialog{max-width:720px}.quick-data-body{display:grid;gap:14px}.quick-data-dialog .data-locker-preview{margin:10px auto}
.source-mode img[src$="locker-open-100.svg"]{width:52px!important;height:48px!important;object-fit:contain}


/* v0.61: Guardar tipado y selección auxiliar en modal secundario */
.assign-selected-destination{display:flex;align-items:center;justify-content:center;gap:18px;margin:8px 0 14px}.assign-selected-destination .locker-with-name img{width:54px;height:62px}.assign-source-card{max-width:390px;margin:0 auto;border:1px solid #cbd5e1;border-radius:14px;padding:14px;background:#fff;display:grid;gap:10px;justify-items:center}.assign-source-card>strong{justify-self:start}.assign-source-card input,.assign-source-card select{width:min(320px,72vw)}.assign-source-locker{display:flex;flex-direction:column;align-items:center}.assign-source-locker img{width:58px;height:62px}.assign-source-locker small{margin-top:4px}.assign-or{text-align:center;font-weight:900;margin:12px 0 8px}.assign-source-alternative{display:flex!important;align-items:center;justify-content:center;gap:9px;margin:0 auto}.assign-source-alternative img{width:34px;height:38px}.data-locker-dialog{max-width:560px;width:min(92vw,560px);box-shadow:0 20px 65px rgba(15,23,42,.38);border:2px solid #94a3b8}.data-locker-dialog::backdrop{background:rgba(15,23,42,.20)}
.instruction-icon-button img[src*="data-operation-100.svg"]{width:48px!important;height:42px!important;object-fit:contain}
\n/* v0.61: integración visual y composición */
.data-operation-dialog{border:1px solid var(--line)!important;border-radius:18px!important;padding:0!important;box-shadow:0 18px 55px rgba(15,23,42,.22)!important;overflow:hidden}.data-operation-dialog::backdrop{background:rgba(15,23,42,.22)}.data-operation-dialog .data-operation-form{padding:22px!important}.data-operation-dialog .modal-actions{margin-top:10px}
#instructionDialog:has(#assignChosen:not(:empty)){width:min(980px,96vw)!important;max-width:980px!important}.assign-header-back{margin-left:auto!important;align-self:center}.assign-horizontal-row{display:grid;grid-template-columns:130px 52px minmax(360px,1fr);align-items:center;justify-content:center;gap:12px;margin:22px auto 8px;max-width:800px}.assign-destination{display:grid;justify-items:center}.assign-destination img{width:72px;height:76px}.assign-arrow{font-size:34px;text-align:center}.assign-horizontal-row .assign-source-card{width:100%;max-width:none;margin:0;min-height:132px;align-content:center}.assign-horizontal-row .assign-source-card>strong{justify-self:center}.assign-or{font-size:24px}.assign-source-alternative{min-width:260px}
.setup-tools-dock,.loop-tools-dock{display:flex!important;align-items:center!important}.setup-tools-dock>.instruction-zoom-controls,.loop-tools-dock>.instruction-zoom-controls{margin-left:auto!important;flex:0 0 auto!important}.instruction-zoom-controls{margin-top:0!important;margin-bottom:0!important}
@media(max-width:760px){.assign-horizontal-row{grid-template-columns:90px 38px minmax(190px,1fr);gap:6px}.assign-destination img{width:58px;height:64px}.assign-arrow{font-size:28px}.assign-source-card{padding:10px}.setup-tools-dock,.loop-tools-dock{flex-wrap:wrap}.setup-tools-dock>.instruction-zoom-controls,.loop-tools-dock>.instruction-zoom-controls{margin-left:auto!important}}
/* v0.61: prefijo únicamente en el paso de nombre */
.prefix-check.hidden{display:none!important}
/* v0.61: Guardar compacto con modos por radio */
#instructionDialog:has(#assignChosen:not(:empty)){width:min(700px,92vw);max-width:700px}
.assign-radio-options,.operand-radio-options{display:flex;gap:18px;flex-wrap:wrap;justify-content:center;margin:8px 0 14px}
.assign-radio-options label,.operand-radio-options label{display:flex;flex-direction:row;align-items:center;gap:6px;font-weight:700;color:#334155}
.assign-radio-options input,.operand-radio-options input{width:auto!important;margin:0}
.assign-horizontal-row{display:flex;align-items:center;justify-content:center;gap:18px}
.assign-source-card{min-width:190px;max-width:260px}
/* v0.61: editor visual de cálculo */
.nested-expression-dialog{width:min(900px,94vw);max-width:900px}
.operand-detail-card{min-height:118px;border:1px solid #d7dee8;border-radius:14px;background:#fff;padding:14px;display:grid;place-items:center;gap:10px}
.operand-visual{display:grid;place-items:center;gap:6px}.operand-number{font-size:1.8rem}.operand-manual-value{max-width:150px}
.operand-calculation>img{width:58px;height:58px}.operand-locker{display:grid;place-items:center}.operand-locker img{width:54px;height:64px}.operand-locker small{font-weight:700}
.calculator-ready{display:grid;place-items:center;gap:5px}.calculator-ready .calc-view{font-size:.86rem;padding:6px 10px!important}

/* v0.61: correcciones de Operar datos, Guardar y modales auxiliares */
.data-operation-options button strong{display:block!important;color:#172033!important;font-size:1.05rem!important;font-weight:800!important;line-height:1.2!important;text-align:center!important;opacity:1!important;visibility:visible!important}
.data-operation-options button{color:#172033!important}
.data-operation-options button img{margin-bottom:6px}
#instructionDialog:has(#assignChosen:not(:empty)){width:min(760px,92vw)!important;max-width:760px!important}
#instructionDialog:has(#assignChosen:not(:empty)) #instructionFields{padding-left:8px;padding-right:8px}
.assign-horizontal-row{max-width:620px!important;margin:18px auto 8px!important;gap:14px!important}
.assign-horizontal-row .assign-source-card{width:auto!important;min-width:210px!important;max-width:300px!important;min-height:108px!important}
.assign-horizontal-row .assign-source-card input{width:180px!important;max-width:180px!important}
.assign-horizontal-row .assign-source-card select{width:190px!important;max-width:190px!important}
.assign-destination img{width:62px!important;height:68px!important}
.secondary-choice-dialog,.nested-expression-dialog{border:1px solid #aebdce!important;border-radius:18px!important;box-shadow:0 24px 70px rgba(15,23,42,.42)!important}
.secondary-choice-dialog{width:min(540px,88vw)!important;max-width:540px!important}
.secondary-choice-dialog::backdrop,.nested-expression-dialog::backdrop{background:rgba(15,23,42,.16)!important}
.nested-expression-dialog{width:min(820px,90vw)!important;max-width:820px!important;transform:translateY(14px)}
.nested-expression-dialog .modal-head{border-bottom:1px solid #e2e8f0;padding-bottom:12px}
.prefix-check.hidden{display:none!important}

/* v0.61: expresiones anidadas, vistas previas y condiciones semánticas */
.nested-expression-warning{color:#b42318!important;font-weight:900!important;font-size:1.02rem!important}
.nested-expression-depth-1{transform:translate(22px,16px)!important}
.nested-expression-depth-2{transform:translate(44px,32px)!important}
.calculation-editor-wrap{display:grid;gap:16px}
.expression-live-preview,.condition-live-preview{border-top:1px solid #d7dee8;padding:13px 12px 2px;display:grid;gap:4px;text-align:center}
.expression-live-preview small,.condition-live-preview small{font-weight:700;color:#64748b}
.expression-live-preview strong,.condition-live-preview strong{font-size:1.15rem;color:#172033}
.condition-expression{border:0!important;background:transparent!important}
.condition-expression .operand-detail-card{box-shadow:none!important}
.condition-if .operand-detail-card{border-color:#f2a45f!important;background:#fffaf5!important}
.condition-if .operand-radio-options input{accent-color:#d97706}
.condition-if .center-operator{border-color:#d97706!important;color:#9a4d00!important;background:#fff7ed!important}
.condition-if .condition-live-preview{border-color:#f2a45f}.condition-if .condition-live-preview strong{color:#9a4d00}
.condition-while .operand-detail-card{border-color:#70a8e8!important;background:#f6faff!important}
.condition-while .operand-radio-options input{accent-color:#2563eb}
.condition-while .center-operator{border-color:#2563eb!important;color:#174ea6!important;background:#eff6ff!important}
.condition-while .condition-live-preview{border-color:#70a8e8}.condition-while .condition-live-preview strong{color:#174ea6}
/* Operar datos: el SVG ocupa mejor el botón sin aumentar el botón */
.instruction-icon-button img[src*="data-operation-100.svg"]{width:58px!important;height:58px!important;object-fit:contain!important}
.data-operation-dialog .modal-icon img[src*="data-operation-100.svg"]{width:64px!important;height:64px!important}

/* v1.03: Calcular por cadena */
.chain-calculation-dialog{max-width:min(1180px,94vw)}
.chain-expression-row{display:flex;align-items:flex-start;gap:12px;overflow-x:auto;padding:8px 2px 14px}
.chain-expression-row>.visual-expression-control{min-width:210px;flex:0 0 210px}
.chain-op{flex:0 0 64px;margin-top:56px}
.chain-tools{display:flex;gap:10px;justify-content:center;margin:12px 0}
.chain-group-note{margin:10px auto;max-width:720px;padding:10px 14px;border:1px dashed #8a8a8a;border-radius:10px;text-align:center}
.chain-preview strong{font-size:1.12rem}
.chain-calc-icon{font-size:2.3rem;line-height:1}


/* v1.03 — condiciones: anchura y color semántico */
#questionDialog{
  width:min(96vw,1120px)!important;
  max-width:1120px!important;
}
#questionDialog .modal-form,
#questionDialog form{
  width:100%!important;
}
.question-expression{
  width:100%!important;
  max-width:none!important;
}
.question-expression:has(.condition-if),
.typed-expression:has(.condition-if){
  border-left-color:#d97706!important;
}
.question-expression:has(.condition-while),
.typed-expression:has(.condition-while){
  border-left-color:#2563eb!important;
}
#instructionDialog:has(.condition-if),
#instructionDialog:has(.condition-while){
  width:min(96vw,1180px)!important;
  max-width:1180px!important;
}
#instructionDialog:has(.condition-if) .question-expression{
  border-left-color:#d97706!important;
}
#instructionDialog:has(.condition-while) .question-expression{
  border-left-color:#2563eb!important;
}


/* v1.03 — Calcular oficial por cadena */
.chain-calculation-dialog{
  width:min(96vw,1180px)!important;
  max-width:1180px!important;
}
.chain-expression-row .visual-expression-control{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
}
.chain-expression-row .operand-detail-card{
  order:1!important;
  width:100%!important;
}
.chain-expression-row .operand-radio-options{
  order:2!important;
  width:100%!important;
  display:flex!important;
  justify-content:flex-start!important;
  align-items:center!important;
  gap:18px!important;
  margin:10px 0 0!important;
  text-align:left!important;
}
.chain-expression-row .operand-radio-options label{
  margin:0!important;
  justify-content:flex-start!important;
  text-align:left!important;
}


/* v1.03 — agrupación explícita de cálculo */
.chain-expression-row{
  align-items:flex-start!important;
}
.chain-unit{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  min-width:180px;
}
.grouping-mode .chain-unit{
  padding-top:34px;
}
.chain-group-check{
  position:absolute;
  top:2px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  justify-content:center;
  align-items:center;
  margin:0!important;
}
.chain-group-check input{
  width:20px;
  height:20px;
}
.grouped-chain-unit{
  min-width:190px;
}
.chain-group-visual{
  border:2px solid #94a3b8;
  border-radius:12px;
  background:#f8fafc;
  padding:18px 14px;
  min-height:92px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
}
.chain-group-visual strong{
  font-size:1.08rem;
}
.chain-group-visual small{
  font-weight:800;
  color:#64748b;
}
.chain-tools{
  flex-wrap:wrap;
}
.chain-group-error{
  min-height:1.4em;
  margin-top:8px;
}


/* v1.03 — un grupo conserva operandos y operadores editables */
.chain-group-box{
  border:2px solid #94a3b8;
  border-radius:14px;
  padding:14px 12px 12px;
  background:rgba(248,250,252,.62);
  display:flex;
  align-items:stretch;
}
.chain-group-inner{
  display:flex;
  align-items:flex-start;
  gap:10px;
}
.chain-group-box .visual-expression-control{
  min-width:180px;
}
.chain-group-box .chain-group-box{
  border-color:#64748b;
  margin:0 2px;
}
.chain-group-visual{display:none!important}


/* v1.03 — confirmación propia de Nuevo proyecto */
.new-project-confirm-dialog{
  width:min(92vw,620px)!important;
  max-width:620px!important;
}
.new-project-confirm-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:20px;
}
.new-project-confirm-actions button{
  width:100%;
  justify-content:center;
}

/* v1.03 — función Entrada / Salida del dispositivo externo */
.external-mode-stage{width:100%}
.external-mode-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}
.external-mode-options .io-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:150px}
.external-mode-options .io-card.selected{outline:3px solid currentColor;outline-offset:2px}
.external-mode-summary{text-align:center;margin:12px 0 0}
.io-mode-fixed{display:flex;flex-direction:column;align-items:center;gap:5px;padding:16px;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc}
@media(max-width:640px){.external-mode-options{grid-template-columns:1fr}}

/* v1.03 — primera simulación de la lógica RAGECA */
.simulation-launch{font-weight:800}
.simulation-dialog{width:min(96vw,1180px)!important;max-width:1180px!important;padding:0!important}
.simulation-shell{padding:20px}
.simulation-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.simulation-head h2{margin:0 0 4px}.simulation-head p{margin:0}
.simulation-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:18px;margin-top:18px}
.simulation-program,.simulation-project{border:1px solid #cbd5e1;border-radius:14px;padding:14px;background:#fff}
.sim-phase{border:1px solid #e2e8f0;border-radius:12px;padding:10px;margin-bottom:12px}
.sim-phase h4{margin:0 0 8px}
.sim-instruction{padding:7px 9px;border-radius:8px;margin:4px 0;background:#f8fafc}
.sim-component,.sim-data{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e2e8f0;border-radius:10px;padding:10px;margin:7px 0}
.sim-component label{display:flex;align-items:center;gap:8px}.sim-component input[type=range]{width:150px}
.sim-data strong{font-variant-numeric:tabular-nums}
.simulation-status{display:flex;gap:12px;align-items:center;padding:12px 14px;margin-top:16px;border-radius:12px;background:#f8fafc;border:1px solid #cbd5e1}
.simulation-status strong{min-width:80px}
.simulation-controls{display:flex;justify-content:flex-end;gap:10px;margin-top:14px;flex-wrap:wrap}
@media(max-width:800px){.simulation-grid{grid-template-columns:1fr}.simulation-dialog{width:96vw!important}}

/* v1.03 — herramientas de edición */
.duplicate-check{width:22px;height:22px;flex:0 0 auto;margin:0 8px 0 0;accent-color:currentColor}
.duplicate-mode .setup-step,.duplicate-mode .algorithm-step{cursor:pointer}
.duplicate-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-left:8px}
.duplicate-tool{white-space:nowrap}
.wait-source-mode{display:flex;gap:18px;flex-wrap:wrap;margin-bottom:14px}
.wait-source-mode label{display:flex;align-items:center;gap:7px}


.confirm-delete-instruction .modal-icon{font-size:1.6rem;font-weight:800}
.confirm-delete-instruction p{margin:.65rem 0}
.duplicate-check{width:20px;height:20px;flex:0 0 auto;margin:0 8px 0 0}
.duplicate-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* v1.04 */
.confirm-delete-instruction{padding:30px;max-width:480px;width:calc(100% - 40px)}
.confirm-delete-instruction .modal-head{gap:18px;margin-bottom:24px;align-items:flex-start}
.confirm-delete-instruction h3{margin:0 0 12px}.confirm-delete-instruction p{line-height:1.6;margin:12px 0 24px}
.confirm-delete-instruction .modal-actions{margin-top:28px;gap:16px;display:flex;flex-wrap:wrap;justify-content:flex-end}
.duplicate-actions{display:flex;flex-wrap:wrap;align-items:center;gap:14px}
.duplication-counter{display:flex;align-items:center;gap:6px}.duplication-counter input{width:64px;text-align:center;margin:0}.duplication-counter button{padding:8px 12px}
.duplicate-actions .duplicate-selected{background:#4d7fba;color:white;border:1px solid #416fa6;border-radius:9px;padding:11px 18px;font-weight:600}
.duplicate-actions .duplicate-selected:hover{background:#416fa6}.duplicate-actions .duplicate-selected:active{background:#355f91}
.data-operation-options{flex-wrap:wrap}.data-operation-options [data-op=random] span{font-size:38px}

/* v1.05: la ventana y los controles mantienen su tamaño; sólo escala el contenido. */
#setupBuilder.zoom-instruction-workspace>.setup-instructions-area,
#algorithmBuilder.zoom-instruction-workspace>.loop-instructions-area,
#setupBuilder.zoom-instruction-workspace>.setup-tools-dock,
#algorithmBuilder.zoom-instruction-workspace>.loop-tools-dock{zoom:1}
#setupBuilder.zoom-instruction-workspace>.setup-instructions-area>*,
#algorithmBuilder.zoom-instruction-workspace>.loop-instructions-area>*{zoom:var(--instruction-zoom,1)}
.save-project-dialog{width:min(440px,calc(100% - 40px));padding:28px}
.save-project-dialog .modal-head{margin-bottom:22px}.save-project-dialog label{display:grid;gap:10px}.save-project-dialog .modal-actions{margin-top:24px;gap:14px}

.setup-sensor-details{display:grid;gap:10px;margin-top:14px;font-weight:600;line-height:1.5}

.random-assignment-summary{display:flex;align-items:center;justify-content:center;gap:20px;padding:20px 12px;margin:12px 0 22px;background:#f1f6fc;border:1px solid #cbd9ea;border-radius:12px;flex-wrap:wrap}.random-assignment-summary>.locker-with-name{min-width:100px}.random-assignment-summary>.locker-with-name img{width:64px;height:70px}.random-assignment-summary>.locker-with-name small{display:block;font-size:16px;font-weight:700;overflow-wrap:anywhere}.random-assignment-summary>b{font-size:30px}.random-assignment-summary>strong{max-width:250px;line-height:1.5}

.insertion-point{display:flex;flex-direction:column;align-items:center;width:100%}
.insertion-arrow{background:transparent;border:0;border-radius:8px;padding:2px 20px;min-height:32px;color:#64748b;cursor:pointer;transition:color .15s,background .15s,text-shadow .15s}
.insertion-arrow:hover,.insertion-arrow:focus-visible,.insertion-arrow[aria-expanded=true]{color:#477cb8;background:#eaf2fc;text-shadow:1px 0 currentColor,-1px 0 currentColor}
.inline-insertion-choices{zoom:.9;display:flex;justify-content:center;flex-wrap:wrap;gap:8px;padding:10px;margin:6px 0 10px;background:#f3f7fc;border:1px solid #c9d8ec;border-radius:12px}
.inline-insertion-choices .instruction-choices{display:flex;flex-wrap:wrap;justify-content:center}
.setup-nested-instructions{grid-column:1/-1;min-width:0;padding:12px 4px}.setup-nested-instructions>div{margin:8px 0}

/* v1.10: entrada y salida como representaciones independientes. */

.code-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.code-actions>.toggle{flex-basis:100%;display:flex;align-items:center;gap:8px;font-size:13px;margin:0 0 6px}.code-actions>.toggle input{width:auto;margin:0}

/* v1.12: icono original; sólo espacio antes del segundo puerto. */
.setup-metaphor-ports>.mini-port:nth-child(3){margin-left:12px}

#saveInstruction.primary,.sensor-save-reading{background:#2563eb;color:#fff;border:1px solid #1d4ed8;border-radius:9px;padding:11px 17px;font-weight:700}#saveInstruction.primary:hover,.sensor-save-reading:hover{background:#1d4ed8}.sensor-save-reading{margin-top:12px}

/* v1.15: etiquetas sólo en la barra principal. */
.loop-tools-dock [data-main-k]{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:4px!important;height:auto!important;min-height:74px;padding-bottom:7px!important}
.loop-tools-dock [data-main-k] .main-instruction-label{display:block;color:#334155;font-size:11px;font-weight:500;line-height:1.2;white-space:nowrap}
.wait-presets button{color:#243c59!important;background:#fff!important;opacity:1!important}.wait-presets button small{color:inherit!important}.wait-presets button.selected{color:#143d7a!important;background:#e4efff!important;border-color:#2563eb!important;box-shadow:0 0 0 2px #2563eb inset}
.data-type-label,.typed-locker>strong,.live-data-type,.data-locker-preview>strong{font-size:10px!important;font-weight:400!important;line-height:1.25!important}
.data-slot.filled>small,.locker-with-name>small,.locker-choice>small,.data-locker-preview>small,.live-locker-name,.selected-port-metaphor>small,.assign-source-locker>small,.visual-locker-assignment small{font-size:15px!important;font-weight:700!important;line-height:1.3!important;overflow-wrap:anywhere}
.typed-locker small{font-size:14px!important;font-weight:700!important;max-width:100%;overflow-wrap:anywhere}.component-pin-link{grid-template-columns:minmax(90px,1fr) 22px 58px}

/* v1.16: jerarquía discreta de los casilleros. */
.data-type-label,.typed-locker>strong,.live-data-type,.data-locker-preview>strong{font-size:9px!important;font-weight:400!important;text-transform:lowercase!important;letter-spacing:0!important}
.data-slot.filled>small,.locker-with-name>small,.locker-choice>small,.data-locker-preview>small,.live-locker-name,.selected-port-metaphor>small,.assign-source-locker>small,.visual-locker-assignment small,.typed-locker small{font-size:13px!important;font-weight:700!important;line-height:1.3!important}
.loop-tools-dock [data-main-k="dataop"]>img{position:relative;left:4px}

/* v1.17: ajuste exclusivo de la barra principal de instrucciones. */
.loop-tools-dock [data-main-k="ultrasonic"]>img{position:relative;left:4px}
.loop-tools-dock [data-main-k]{height:82px!important;min-height:82px!important;max-height:82px!important;box-sizing:border-box!important;flex-shrink:0}
.loop-tools-dock [data-main-k]>img{flex-shrink:0}

/* v1.18: más espacio de trabajo. */
.topbar{position:static!important;top:auto!important}
.algorithm-step,.setup-step{min-height:56px!important;padding:6px 10px!important;margin-top:3px!important;margin-bottom:3px!important;gap:8px!important}
.algorithm-step .step-icon,.setup-step .step-icon{width:38px!important;height:38px!important;min-height:38px!important;font-size:22px!important}
.algorithm-step .step-icon img,.setup-step .step-icon img{width:32px!important;height:34px!important;object-fit:contain}
.algorithm-step .step-main small,.setup-step .setup-main>small{font-size:11px;line-height:1.2}
.algorithm-step-actions{gap:4px!important}.algorithm-step-actions button{padding:3px 7px!important;min-height:27px!important}
.flow-arrow{font-size:21px!important;line-height:22px!important}.insertion-arrow{min-height:22px!important;padding:0 14px!important}.inline-insertion-choices{margin-top:3px;margin-bottom:5px}
.loop-tools-dock [data-main-k]{display:grid!important;grid-template-rows:36px 12px!important;align-content:center!important;justify-items:center!important;gap:3px!important;height:62px!important;min-height:62px!important;max-height:62px!important;padding:4px 7px!important;line-height:1!important;font-size:26px!important}
.loop-tools-dock [data-main-k]>img{width:34px!important;height:34px!important;object-fit:contain}
.loop-tools-dock [data-main-k] .main-instruction-label{font-size:10px!important;line-height:12px!important;margin:0!important;align-self:end!important}
.setup-tools-dock>.setup-tool-button,.setup-tools-dock .setup-other-dock>.setup-tool-button{height:62px!important;min-height:62px!important;padding:5px 8px!important;gap:3px!important;font-size:11px!important}
.setup-tools-dock .setup-metaphor{height:30px!important;min-height:30px!important}.setup-tools-dock .setup-metaphor img{width:28px!important;height:28px!important}.setup-tools-dock .mini-port{width:19px!important;height:19px!important}.setup-tools-dock .setup-metaphor b{font-size:18px!important}
[data-panel="setup"],[data-panel="loop"]{position:relative}
[data-panel="setup"]>.panel-title,[data-panel="loop"]>.panel-title{padding-right:42px}
.section-fullscreen-button{position:absolute;top:11px;right:12px;width:32px;height:32px;padding:0!important;font-size:23px!important;line-height:1}
body.section-fullscreen-open{overflow:hidden!important}
#sectionFullscreen{position:fixed;inset:0;margin:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0;padding:0;background:#f5f7fb;color:#172033;overflow:auto;overscroll-behavior:contain}
#sectionFullscreen::backdrop{background:#17203399}
.section-fullscreen-head{position:sticky;top:0;z-index:25;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;background:#fff;border-bottom:1px solid #dce3eb}
.section-fullscreen-head h2{font-size:18px;margin:0}.section-fullscreen-content{padding:14px 18px 20px;overflow:visible}
#sectionFullscreen .setup-instructions-area,#sectionFullscreen .loop-instructions-area,#sectionFullscreen .decision-pane,#sectionFullscreen .nested-box,#sectionFullscreen .container-config,#sectionFullscreen .algorithm-list{max-height:none!important;overflow:visible!important;height:auto!important}
#sectionFullscreen .setup-tools-dock,#sectionFullscreen .loop-tools-dock{position:static!important;margin-top:12px!important}
@media(max-width:600px){.section-fullscreen-head{padding:10px}.section-fullscreen-head h2{font-size:15px}.section-fullscreen-content{padding:10px 6px}.algorithm-step,.setup-step{padding:5px 7px!important}}

/* v1.19: barras mínimas, subbarras al 70% y código sin espacio reservado. */
.loop-tools-dock [data-main-k]{height:50px!important;min-height:50px!important;max-height:50px!important;grid-template-rows:27px 11px!important;gap:2px!important;padding:3px 5px!important;font-size:22px!important}
.loop-tools-dock [data-main-k]>img{width:27px!important;height:27px!important}
.loop-tools-dock [data-main-k] .main-instruction-label{font-size:9px!important;line-height:11px!important}
.setup-tools-dock>.setup-tool-button,.setup-tools-dock .setup-other-dock>.setup-tool-button{height:50px!important;min-height:50px!important;max-height:50px!important;min-width:112px;padding:3px 6px!important;gap:2px!important;font-size:10px!important}
.setup-tools-dock .setup-metaphor{height:25px!important;min-height:25px!important}.setup-tools-dock .setup-metaphor img{width:24px!important;height:24px!important}.setup-tools-dock .mini-port{width:17px!important;height:17px!important}
.setup-tools-dock,.loop-tools-dock{gap:5px!important;padding-top:5px!important;padding-bottom:2px!important;margin-top:2px!important}
.loop-tools-dock>.instruction-choices{gap:5px!important}
.algorithm-add,.nested-instruction-dock,.setup-other-choices,.inline-insertion-choices{zoom:.7!important}
.algorithm-add .instruction-icon-button,.setup-other-choices .instruction-icon-button,.inline-insertion-choices .instruction-icon-button{height:50px!important;min-height:50px!important;width:46px!important;padding:3px!important}
.algorithm-add .instruction-icon-button img,.setup-other-choices .instruction-icon-button img,.inline-insertion-choices .instruction-icon-button img{width:27px!important;height:27px!important}
.algorithm-add .instruction-choices,.setup-other-choices,.inline-insertion-choices{gap:5px!important}
#codePanel{top:0!important;height:100vh!important;height:100dvh!important}
#codePanel .code-head,#codePanel .code-tabs{display:none!important}
#codePanel .code-inner{padding:8px!important;gap:6px!important}
#codePanel .code-actions{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:7px!important}
#codePanel .code-actions>.toggle{flex:0 0 auto!important;display:flex!important;align-items:center!important;gap:5px!important;white-space:nowrap;font-size:12px!important;margin:0!important}
#codePanel .code-actions>button{flex:0 0 auto;padding:5px 9px!important;min-height:30px;display:inline-flex;align-items:center;justify-content:center}
#codePanel .code-download-icon{width:33px;padding:5px!important}
#sectionFullscreen:fullscreen{width:100vw;height:100vh;max-width:none;max-height:none}

/* v1.20: restaurar barras, compactar el cuerpo y aislar la vista ampliada. */
.loop-tools-dock [data-main-k]{height:62px!important;min-height:62px!important;max-height:62px!important;grid-template-rows:36px 12px!important;gap:3px!important;padding:4px 7px!important;font-size:26px!important}
.loop-tools-dock [data-main-k]>img{width:34px!important;height:34px!important}.loop-tools-dock [data-main-k] .main-instruction-label{font-size:10px!important;line-height:12px!important}
.setup-tools-dock>.setup-tool-button,.setup-tools-dock .setup-other-dock>.setup-tool-button{height:62px!important;min-height:62px!important;max-height:62px!important;padding:5px 8px!important;gap:3px!important;font-size:11px!important}
.setup-tools-dock .setup-metaphor{height:30px!important;min-height:30px!important}.setup-tools-dock .setup-metaphor img{width:28px!important;height:28px!important}.setup-tools-dock .mini-port{width:19px!important;height:19px!important}
.setup-tools-dock,.loop-tools-dock{gap:10px!important;padding-top:10px!important;padding-bottom:4px!important;margin-top:4px!important}.loop-tools-dock>.instruction-choices{gap:8px!important}
.algorithm-add,.nested-instruction-dock,.setup-other-choices,.inline-insertion-choices{zoom:.8!important}
.algorithm-add .instruction-icon-button,.setup-other-choices .instruction-icon-button,.inline-insertion-choices .instruction-icon-button{height:62px!important;min-height:62px!important;width:54px!important;padding:4px!important}
.algorithm-add .instruction-icon-button img,.setup-other-choices .instruction-icon-button img,.inline-insertion-choices .instruction-icon-button img{width:34px!important;height:34px!important}
.algorithm-step,.setup-step{min-height:46px!important;padding:4px 9px!important;margin-top:2px!important;margin-bottom:2px!important;gap:6px!important}
.algorithm-step .step-icon,.setup-step .step-icon{width:30px!important;height:30px!important;min-height:30px!important;font-size:19px!important}
.algorithm-step .step-icon img,.setup-step .step-icon img{width:27px!important;height:28px!important}
.algorithm-step-actions button{min-height:24px!important;padding:2px 6px!important}
.insertion-point{padding:2px 0!important}.flow-arrow{font-size:17px!important;line-height:16px!important}.insertion-arrow{min-height:16px!important;height:16px!important;padding:0 12px!important;line-height:16px!important}
#dataGrid .data-slot .locker-icon{width:31.2px!important;height:31.2px!important}
#componentList .typed-locker img{width:36px!important;height:40.5px!important}
#sectionFullscreen{overflow:hidden!important}
#sectionFullscreen[open]{display:flex!important;flex-direction:column!important}
#sectionFullscreen>.section-fullscreen-head{position:relative!important;top:auto!important;flex:0 0 auto!important;z-index:100!important;background:#fff!important}
#sectionFullscreen>.section-fullscreen-content{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain}
#sectionFullscreen>.section-fullscreen-content>.algorithm-builder{width:100%!important;max-width:none!important}
.section-fullscreen-close{flex-shrink:0;position:relative;z-index:101}

.setup-tools-dock>.setup-tool-button{min-width:132px!important}.setup-tools-dock .setup-other-dock>.setup-tool-button{min-width:78px!important}

/* v1.21: reducción proporcional sobre el tamaño actual, sin acumularla por anidación. */
#setupBuilder.zoom-instruction-workspace>.setup-instructions-area>*,
#algorithmBuilder.zoom-instruction-workspace>.loop-instructions-area>*{zoom:calc(var(--instruction-zoom,1) * .85)!important}
#dataGrid>.data-slot{zoom:.85}
#componentList .component-pin-link>.typed-locker{zoom:.75}

/* v1.22: casilleros que no se estiran con la cuadrícula. */
#dataGrid{grid-template-columns:repeat(auto-fill,96px)!important;justify-content:start!important;justify-items:start!important;align-items:start!important;gap:9px!important}
#dataGrid>.data-slot{width:112px!important;min-width:0!important;max-width:112px!important;justify-self:start!important}
#expertsList .expert-card.included{min-height:39px;padding:4px 8px;grid-template-columns:28px minmax(0,1fr) auto;gap:7px;align-items:center}
#expertsList .expert-card.included img{width:28px;height:28px;object-fit:contain}
#expertsList .expert-card.included strong{font-size:12px;line-height:1.2}#expertsList .expert-card.included small{font-size:10px;line-height:1.2}
#expertsList .expert-card.included button{font-size:11px;padding:3px 8px;min-height:24px}
[data-panel="setup"]>.panel-title,[data-panel="loop"]>.panel-title{padding-right:0!important}
.setup-tools-dock>.section-fullscreen-button,.loop-tools-dock>.section-fullscreen-button{position:static!important;top:auto!important;right:auto!important;flex:0 0 30px!important;width:30px;height:30px;margin:0 0 0 5px!important;font-size:22px!important;align-self:center}
.setup-tools-dock>.duplicate-tool,.loop-tools-dock>.duplicate-tool{margin-left:4px!important;margin-right:0!important;flex:0 0 auto}
#servoRange,#genericServoRange{direction:rtl}

/* v1.23: Agregar experto compacto y código de la sección ampliada. */
#addExpert{height:32px!important;min-height:32px!important;max-height:32px!important;padding:4px 12px!important;font-size:12px!important;line-height:20px!important;margin-top:6px!important}
#addExpert b{width:20px!important;height:20px!important;font-size:20px!important}
.section-fullscreen-layout{display:flex;flex:1 1 auto;min-height:0;overflow:hidden}
#sectionFullscreen .section-fullscreen-layout>.section-fullscreen-content{flex:1 1 auto;min-width:0;min-height:0;overflow-y:auto!important;overflow-x:hidden!important}
#sectionFullscreen #codePanel{position:relative!important;top:0!important;right:auto!important;height:100%!important;width:auto!important;flex:0 0 46px;grid-template-columns:46px minmax(0,1fr);border-radius:0;border-left:1px solid #cbd5e1;z-index:1}
body.code-open #sectionFullscreen #codePanel{flex-basis:clamp(300px,35vw,520px)}
#sectionFullscreen #codePanel .code-handle{height:100%;min-height:0}
@media(max-width:600px){body.code-open #sectionFullscreen #codePanel{flex-basis:min(78vw,380px)}#sectionFullscreen .section-fullscreen-layout>.section-fullscreen-content{padding-left:4px;padding-right:4px}}

.practices-dialog{width:min(520px,calc(100% - 32px))}.practice-list{display:grid;gap:10px;margin:16px 0}.practice-list .practice-choice{display:flex;flex-direction:column;align-items:flex-start;gap:5px;text-align:left;padding:14px 16px!important;border:1px solid #cbd5e1!important;border-radius:10px!important;background:#f5f8ff!important;color:#243c59!important}.practice-choice:hover:not(:disabled){background:#e8f0ff!important;border-color:#7b9ed3!important}.practice-choice:disabled{opacity:.6;cursor:default}.practice-choice small{font-size:12px}.practice-confirm-dialog .modal-actions{flex-wrap:wrap}.practice-confirm-dialog p{line-height:1.5}

/* v1.25: espacio interior y separación en el selector de prácticas. */
.practices-dialog,.practice-confirm-dialog{padding:28px!important;box-sizing:border-box;max-height:calc(100dvh - 40px);overflow-y:auto}
.practices-dialog .modal-head,.practice-confirm-dialog .modal-head{margin:0 0 22px!important;gap:16px;align-items:flex-start}
.practices-dialog .modal-head h3,.practice-confirm-dialog .modal-head h3{margin:0 0 12px!important;line-height:1.35}
.practices-dialog .modal-head p,.practice-confirm-dialog .modal-head p{margin:0!important;line-height:1.6}
.practices-dialog .practice-list{gap:14px!important;margin:22px 0!important}
.practices-dialog .practice-list .practice-choice{padding:16px 18px!important;gap:8px!important;line-height:1.45}
.practices-dialog .modal-actions,.practice-confirm-dialog .modal-actions{margin-top:24px!important;gap:12px!important}
.practice-confirm-dialog>p{margin:0 0 20px;line-height:1.6}
.practices-dialog .practice-error:empty{display:none}
@media(max-width:480px){.practices-dialog,.practice-confirm-dialog{padding:20px!important;max-width:calc(100vw - 28px)}.practice-confirm-dialog .modal-actions{flex-wrap:wrap}}

/* v1.26: acciones superiores mediante iconos. */
.top-actions .project-icon-button{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;min-width:40px;padding:8px!important;border:1px solid #718096;border-radius:9px;background:#f1f5f9;color:#243c59;text-decoration:none;cursor:pointer;line-height:1}
.top-actions .project-icon-button:hover{background:#dce9fa;color:#183c70}.top-actions .project-icon-button:focus-visible{outline:3px solid #93c5fd;outline-offset:3px}.top-actions .project-icon-button svg{width:23px;height:23px;flex-shrink:0}

/* v1.27: identidad del documento y eliminación múltiple */
#projectDocumentName{font-size:16px;font-weight:500;overflow-wrap:anywhere;color:inherit;margin-left:10px}
.bulk-delete-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;flex-basis:100%;padding:8px}
.bulk-delete-check{width:19px;height:19px;flex-shrink:0;accent-color:#dc2626;margin-right:8px}
.bulk-delete-tool{white-space:nowrap}
.io-symbol img{width:40px;height:40px;object-fit:contain}

/* v1.29: espacio interior en confirmación de vaciar Setup/Loop */
dialog.bulk-delete-confirm-dialog{box-sizing:border-box;padding:28px;width: min(520px,calc(100vw - 32px));}
.bulk-delete-confirm-dialog>p{margin:0;line-height:1.6;}
.bulk-delete-confirm-dialog>.modal-actions{margin-top:24px;gap:12px;flex-wrap:wrap;}
@media(max-width:600px){dialog.bulk-delete-confirm-dialog{padding:20px;}}

/* v1.30: herramientas por icono y código a pantalla completa */
.duplicate-tool,.bulk-delete-tool{width:34px!important;height:34px!important;min-width:34px!important;padding:6px!important;display:inline-flex;align-items:center;justify-content:center}
#codeFullscreen{display:inline-flex;align-items:center;justify-content:center;padding:6px!important}
body.code-fullscreen-open{overflow:hidden}
#codeFullscreenDialog{position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:white;overflow:hidden;box-sizing:border-box}
#codeFullscreenDialog[open]{display:flex;flex-direction:column}
.code-fullscreen-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 16px;flex-shrink:0;border-bottom:1px solid #cbd5e1}
.code-fullscreen-content{display:flex;flex:1;min-height:0;overflow:hidden}
#codeFullscreenDialog #codePanel{position:static!important;display:flex!important;width:100%!important;max-width:none!important;height:100%!important;flex:1!important;border:0!important;margin:0!important;overflow:hidden!important;box-sizing:border-box}
#codeFullscreenDialog #codePanel .code-handle{display:none!important}
#codeFullscreenDialog #codePanel .code-inner{display:flex!important;flex:1;min-width:0;min-height:0}
#codeFullscreenDialog #codeOutput{flex:1;min-height:0;overflow:auto}
#codeFullscreenDialog #codeFullscreen{display:none!important}

/* v1.31 */
.instruction-zoom-controls{display:grid!important;grid-template-columns:30px 30px!important;gap:2px 6px!important;justify-content:center!important}
.instruction-zoom-controls>.zoom-button:first-child{grid-column:1;grid-row:1}
.instruction-zoom-controls>.zoom-button:last-child{grid-column:2;grid-row:1}
.instruction-zoom-controls>span{grid-column:1 / -1;grid-row:2;font-size:11px;line-height:1.2;text-align:center}
.module-title-row{display:flex;align-items:center;gap:7px;width:100%}
.module-title-row>strong{flex:1}.module-title-row>button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:4px}
.module-wizard-fields,.module-parameters,.module-call-arguments{display:grid;gap:12px}
.module-param-row{display:grid;grid-template-columns:minmax(95px,1fr) minmax(90px,1.5fr) 32px;gap:7px;align-items:center}
.module-parameters[hidden]{display:none}

/* v1.32: módulos gráficos y casilleros locales */
.module-graphic-choices{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0}
.module-choice{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:92px;min-height:78px;background:#f1f5f9!important;color:#243247!important;border:2px solid #cbd5e1!important;border-radius:12px;padding:10px!important}
.module-choice.selected{border-color:#2563eb!important;background:#dbeafe!important;box-shadow:0 0 0 1px #2563eb}
.module-choice>span{font-size:27px}.module-choice img{width:38px;height:38px;object-fit:contain}
.module-kind-badge{padding:10px;border-radius:9px;background:#dbeafe;font-weight:700;margin:0}
.module-call-arguments>div{padding:10px;border:1px solid #cbd5e1;border-radius:10px}
.module-local-data{padding:12px;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc;margin:8px 0;width:100%;box-sizing:border-box}
.module-local-data h4{margin:0 0 10px;font-size:13px}.local-locker-grid{display:flex;gap:9px;flex-wrap:wrap;align-items:center}
.local-locker{display:flex;flex-direction:column;align-items:center;width:96px;padding:7px;background:white;color:#243247;border:1px solid #cbd5e1;border-radius:10px}.local-locker img{width:34px;height:39px}.local-locker small{font-size:9px;font-weight:400}.local-locker strong{font-size:12px;overflow-wrap:anywhere}

/* v1.33 */
.component-picker-heading{flex-basis:100%;width:100%;margin:10px 0 4px;font-size:14px;color:#1e40af}.component-visual-option small{font-size:10px;font-weight:400}.module-return-warning{padding:10px;border:1px solid #d97706;border-radius:9px;background:#fffbeb;color:#92400e;font-size:12px}

/* v1.34: ámbitos y herramientas de módulos */
.scope-picker-heading{flex-basis:100%;width:100%;font-size:13px;margin:8px 0;color:#1e40af}
.scope-globals{width:100%;flex-basis:100%;border-top:1px solid #cbd5e1;margin-top:10px;padding-top:8px}.scope-globals summary{cursor:pointer;font-size:13px;font-weight:600;color:#1e40af;padding:8px;list-style:none}.scope-global-content{display:flex;gap:9px;flex-wrap:wrap;margin-top:8px}.scope-globals .scope-hide{display:none}.scope-globals[open] .scope-hide{display:inline}.scope-globals[open] .scope-show{display:none}
.module-tools-dock{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px}.module-tools-dock>.algorithm-add{flex:1;margin:0}.module-edit-controls{display:flex;align-items:center;gap:6px;margin-left:auto}.module-tool{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:5px!important}
.module-selection-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;width:100%;padding:8px}.module-selection-check{width:18px;height:18px;flex-shrink:0;accent-color:#2563eb}
.module-instructions-area{min-width:0}.module-instructions-area .algorithm-step{min-height:46px}
body.module-fullscreen-open{overflow:hidden}
#moduleFullscreenDialog{position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#f8fafc;overflow:hidden}
#moduleFullscreenDialog[open]{display:flex;flex-direction:column}.module-fullscreen-head{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:10px 16px;border-bottom:1px solid #cbd5e1;background:white}.module-fullscreen-content{flex:1;min-height:0;overflow:auto;padding:12px}.module-fullscreen-content>.module-card{margin:0}

/* v1.35: asistentes de llamada y selección */
.call-wizard-fields{display:grid;gap:12px}.call-progress{font-size:12px;color:#64748b}.empty-locker-message{flex-basis:100%;padding:10px;border-radius:8px;background:#f1f5f9;color:#475569;font-size:13px}

/* v1.37: repetir con contador */
.counter-fields{display:grid;gap:12px}.counter-progress{font-size:12px;color:#64748b}.counter-summary{padding:10px;border-radius:10px;background:#eff6ff;color:#1e40af}.repeat-options .module-choice{flex:1;min-width:150px}

/* v1.38: origen del ángulo del servo */
.servo-data-source{gap:12px;justify-items:center;padding:18px;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc}.servo-selected-locker{padding:10px;font-size:15px}.servo-source-toggle{margin-top:12px}

/* v1.39: lenguaje y representación del contador */
.counter-locker-preview{display:flex;flex-direction:column;align-items:center;gap:5px;margin:8px auto;max-width:220px;text-align:center}.counter-locker-preview img{width:66px;height:72px;object-fit:contain}.counter-locker-preview small{font-size:10px;font-weight:400}.counter-live-name{font-size:14px;font-weight:700;min-height:20px;overflow-wrap:anywhere}.counter-step-name{font-weight:700}

/* v1.41: selección de componente y representación del casillero */
.counter-direction-heading{display:flex;align-items:center;gap:12px;padding:12px 15px;border-radius:12px;background:#eff6ff;color:#1e40af}.counter-direction-heading strong{font-size:17px;font-weight:750;overflow-wrap:anywhere}.counter-direction-symbol{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;border:2px solid #93c5fd;border-radius:50%;font-size:29px;font-weight:800;background:white}
.servo-selected-locker{display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center}.servo-selected-locker img{width:66px;height:72px;object-fit:contain}.servo-selected-locker strong{font-size:14px;overflow-wrap:anywhere}.choose-another-component{margin:5px 0}

/* v1.42: botón de origen del ángulo centrado y con borde reforzado */
#genericActionVisual .servo-source-toggle{display:block;width:max-content;max-width:100%;margin:14px auto 0!important;border:2px solid #94a3b8!important;padding:8px 16px!important;text-align:center}

/* v1.43: cierre visual de decisiones y ciclos con su barra interna */
.structure-if-body{border-bottom:3px solid rgba(234,88,12,.52)!important;padding-bottom:12px!important}
.structure-while-body{border-bottom:3px solid rgba(37,99,235,.48)!important;padding-bottom:12px!important}
.setup-step.structure-if>.setup-nested-instructions{border-bottom:3px solid rgba(234,88,12,.72);padding-bottom:12px}
.setup-step.structure-while>.setup-nested-instructions{border-bottom:3px solid rgba(37,99,235,.68);padding-bottom:12px}
