/* SIMULADOR V4 — diseño técnico legible y sin superposición */
:root{--v4-card:#f4f4ef;--v4-edge:#8d918b;--v4-ink:#171b1f;--v4-label:#f8f8f4}
.workspace{min-height:820px;overflow:hidden;background-size:24px 24px,100% 100%}
.din-rail-1{top:240px}.din-label-1{top:220px}.din-rail-2{top:540px}.din-label-2{top:520px}
.component{width:180px;min-height:220px;background:linear-gradient(160deg,#faf9f3,#dfdfd7);border:1px solid var(--v4-edge);border-radius:7px;overflow:visible;box-shadow:0 10px 22px rgba(22,30,36,.2),inset 0 0 0 1px rgba(255,255,255,.72)}
.component .title{min-height:46px;padding:8px 10px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:12px;line-height:1.15;font-weight:850;white-space:normal;overflow-wrap:anywhere;background:linear-gradient(#fff,#e7e8e2);border-bottom:1px solid #a8aaa4;border-radius:6px 6px 0 0}
.component .state{height:28px;padding:7px 6px 4px;font-size:9px;line-height:1;text-align:center;font-weight:800;letter-spacing:.04em;color:#4c565d;white-space:nowrap}
.device-face.v4-face{height:108px;margin:8px 12px 4px;padding:0;display:block;position:relative;overflow:hidden;border-radius:5px}
.terminals{min-height:41px;padding:8px 12px 19px;display:flex;align-items:center;justify-content:space-around;gap:12px;border-top:1px solid rgba(116,121,118,.25);background:linear-gradient(#f5f5ef,#e5e5df);border-radius:0 0 6px 6px}
.terminal{flex:0 0 22px;width:22px;height:22px;border:3px solid #f2f2eb;box-shadow:0 0 0 2px #4a4e4c,inset 0 0 0 3px rgba(0,0,0,.15)}
.terminal::after{content:attr(data-label);position:absolute;top:27px;bottom:auto;left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;height:18px;min-width:28px;padding:0 6px;box-sizing:border-box;font-size:9px;line-height:1;font-weight:900;text-align:center;border:1px solid #a5aaa5;border-radius:4px;background:#fff;color:#252b30;white-space:nowrap;box-shadow:0 1px 2px rgba(0,0,0,.08)}
/* Dimensiones por equipo */
.component[data-type="source"]{width:190px;min-height:224px}.component[data-type="breaker"]{width:180px;min-height:224px}.component[data-type="differential"]{width:220px;min-height:230px}.component[data-type="switch"]{width:180px;min-height:232px}.component[data-type="lamp"]{width:175px;min-height:232px}.component[data-type="outlet"]{width:185px;min-height:232px}.component[data-type="neutralbar"],.component[data-type="earthbar"]{width:230px;min-height:180px}.component[data-type="junction"]{width:185px;min-height:225px}.component[data-type="voltmeter"]{width:220px;min-height:255px;background:#2b3032;border-color:#131617;color:#fff}
.component[data-type="voltmeter"] .title{min-height:43px;background:#202526;color:#f3da4f;border-color:#101213}.component[data-type="voltmeter"] .state{color:#e8e8e8;background:#282d2e}
/* Fuente */
.device-source{border:1px solid #7a8185;background:linear-gradient(160deg,#eef1f1,#c4cbcc);padding:9px!important;text-align:center;display:grid!important;grid-template-rows:auto 1fr auto;gap:5px}
.source-nameplate{display:flex;justify-content:space-between;align-items:center;font-size:8px;color:#343a3d}.source-nameplate b{font-size:9px}.source-display{display:flex;align-items:center;justify-content:center;background:#1f2529;color:#75f49d;border:2px inset #4a5358;border-radius:4px;font:900 24px/1 Consolas,monospace;letter-spacing:.03em;text-shadow:0 0 5px rgba(83,245,132,.45)}.source-display small{font-size:12px;margin-left:6px}.source-status{display:flex;align-items:center;justify-content:center;gap:7px;font-size:8px;font-weight:800}.source-status i{width:10px;height:10px;border-radius:50%;background:#657076;box-shadow:0 0 0 2px #3b4246}.component.energized .source-status i{background:#4fee81;box-shadow:0 0 10px #4fee81,0 0 0 2px #2d4133}
/* Protección modular: zonas completamente separadas */
.device-breaker,.device-differential{background:linear-gradient(90deg,#e9e8e1,#fff 47%,#deddd5);border:1px solid #999b96;padding:9px!important;color:var(--v4-ink)}
.device-grid{height:100%;display:grid;align-items:stretch}.breaker-grid{grid-template-columns:1fr 62px;gap:8px}.diff-grid{grid-template-columns:1fr 43px 62px;gap:7px}
.nameplate{display:flex;min-width:0;flex-direction:column;justify-content:center;align-items:flex-start;border-right:1px solid #d1d2cc;padding-right:7px}.nameplate span{font-size:8px;font-weight:900;letter-spacing:.08em;color:#3b4144}.nameplate b{font-size:25px;line-height:1.05;margin:4px 0;color:#101416}.nameplate small{font-size:7px;line-height:1.25;font-weight:750;color:#42494d;white-space:normal}
.control-zone{display:grid;grid-template-rows:13px 1fr 13px;align-items:center;justify-items:center;min-width:0}.io-mark{font-size:8px;font-weight:900;color:#636a6d}.lever{width:44px;height:47px;margin:0!important;border:2px solid #15191b;border-radius:4px;background:linear-gradient(#555d61,#202426);box-shadow:inset 0 7px 7px rgba(255,255,255,.14),0 2px 4px rgba(0,0,0,.25);transition:.12s transform}.component[data-closed="false"] .lever{transform:translateY(7px)}.component[data-closed="true"] .lever{transform:translateY(-2px)}
.test-zone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border-right:1px solid #d1d2cc}.test-zone span{font-size:6px;font-weight:900;color:#555}.test-button{width:27px;height:27px;border-radius:4px;border:1px solid #355b88;background:#628aba;color:#fff;font-weight:900;pointer-events:none}
/* Interruptor */
.device-switch{text-align:center;display:grid!important;grid-template-rows:1fr 20px;gap:3px}.wall-frame{width:79px;height:79px;margin:auto;border-radius:9px;background:linear-gradient(145deg,#fff,#d7d5ce);border:1px solid #b1b0aa;box-shadow:0 4px 8px rgba(0,0,0,.16),inset 0 0 0 5px #f0efea;display:flex;align-items:center;justify-content:center}.rocker{width:49px;height:59px;margin:0;border-radius:5px;background:linear-gradient(#f7f6f1,#cac8c0);border:1px solid #aaa8a0;box-shadow:inset 0 -10px 14px rgba(0,0,0,.08);display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:7px 0;box-sizing:border-box}.rocker span{position:static;display:flex;align-items:center;justify-content:center;width:100%;height:16px;font-size:10px;line-height:1;font-weight:900;color:#666;text-align:center}.component[data-type="switch"][data-closed="true"] .rocker{box-shadow:inset 0 10px 14px rgba(0,0,0,.1)}
.face-spec{font-size:8px;line-height:1.2;font-weight:750;color:#555b5f;text-align:center;white-space:normal}
/* Lámpara */
.device-lamp{display:grid!important;grid-template-rows:1fr 21px;align-items:center;justify-items:center;overflow:visible!important}.bulb{width:62px;height:64px;margin:0;border-radius:50% 50% 43% 43%;background:radial-gradient(circle at 35% 30%,#fff,#d8dad2 72%);border:2px solid #969b96;position:relative;z-index:2}.lamp-base{position:absolute;width:38px;height:25px;top:67px;left:50%;transform:translateX(-50%);background:repeating-linear-gradient(0deg,#9ba0a0 0 3px,#686e6e 3px 5px);border-radius:3px;z-index:1}.component.energized .bulb{background:radial-gradient(circle,#fffdec 0,#ffe66d 48%,#f1bb29 75%,#ddd8bd 100%);box-shadow:0 0 30px 8px rgba(255,216,57,.72)}
/* Toma */
.device-outlet{display:grid!important;grid-template-rows:1fr 20px;align-items:center;justify-items:center;text-align:center}.outlet-frame{width:82px;height:80px;margin:0;border-radius:11px;background:linear-gradient(145deg,#fff,#d6d6d0);border:1px solid #abadA8;box-shadow:0 3px 8px rgba(0,0,0,.15),inset 0 0 0 5px #ededE8;display:flex;align-items:center;justify-content:center}.socket{width:53px;height:53px;border-radius:50%;background:#f1f0ec;border:2px solid #a4a7a3;position:relative}.socket i{position:absolute;width:8px;height:18px;border-radius:4px;background:#303334;top:15px}.socket i:nth-child(1){left:10px}.socket i:nth-child(2){right:10px}.socket-earth{position:absolute;left:0;right:0;bottom:2px;font-size:12px;color:#2b8050;font-weight:900}
/* Barras */
.device-busbar{height:78px!important;margin:7px 12px 0!important;display:grid!important;grid-template-columns:42px 1fr;grid-template-rows:1fr 18px;gap:7px;background:#dfe1dc!important;border:1px solid #969a96!important;padding:9px!important;overflow:visible!important}.bus-caption{grid-row:1;width:38px;height:38px;align-self:center;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:900;border-radius:4px;color:#fff}.bus-metal{grid-column:2;height:33px;align-self:center;background:linear-gradient(#c78d55,#e0ad78 40%,#a96832 60%,#ca8d50);border:1px solid #875527;display:flex;justify-content:space-around;align-items:center}.bus-metal i{width:15px;height:15px;border-radius:50%;background:radial-gradient(circle,#35312d 0 24%,#91806c 27% 45%,#d1b28d 48%);border:1px solid #6d4f31}.device-busbar .face-spec{grid-column:1/-1}.neutral-bus .bus-caption{background:#2b6eaf}.earth-bus .bus-caption{background:linear-gradient(90deg,#378d57 0 43%,#e6ca3d 43% 57%,#378d57 57%)}
/* Caja */
.device-junction{display:flex!important;align-items:center;justify-content:center}.junction-lid{width:100px;height:82px;margin:0;background:linear-gradient(145deg,#f8f8f4,#d4d6d1);border:2px solid #999e9b;border-radius:9px;position:relative;box-shadow:0 3px 8px rgba(0,0,0,.14)}.junction-lid span{position:absolute;top:27px;left:6px;right:6px;text-align:center;font-size:8px;font-weight:900;color:#696e6b}.junction-lid small{position:absolute;left:0;right:0;top:43px;text-align:center;font-size:8px;color:#777}.junction-lid i{position:absolute;width:9px;height:9px;background:#9ba09d;border-radius:50%}.junction-lid i:nth-of-type(1){left:9px;top:9px}.junction-lid i:nth-of-type(2){right:9px;top:9px}.junction-lid i:nth-of-type(3){left:9px;bottom:9px}.junction-lid i:nth-of-type(4){right:9px;bottom:9px}
/* Multímetro grande, legible */
.device-voltmeter{height:135px!important;margin:8px 14px 5px!important;border:3px solid #0e1112!important;border-radius:17px!important;background:linear-gradient(145deg,#373d3f,#1e2223)!important;padding:8px 11px!important;color:#fff;overflow:hidden!important}.meter-brandline{height:14px;text-align:center;font-size:7px;line-height:14px;font-weight:900;letter-spacing:.12em;color:#f2d54a}.device-voltmeter .vm-screen{height:40px!important;padding:5px 7px;background:#aebaa4!important;border:3px inset #686f66!important;border-radius:4px!important;font:900 18px/24px Consolas,monospace!important;color:#152015!important;text-align:right!important;overflow:hidden}.vm-body{height:51px;margin:4px 0 0!important;display:flex!important;align-items:center;justify-content:center;gap:14px}.device-voltmeter .vm-dial{flex:0 0 42px;width:42px!important;height:42px!important;margin:0!important;border-radius:50%;border:3px solid #090b0b!important;background:radial-gradient(circle,#4b5052 0 45%,#1c2021 47%)!important;display:flex!important;align-items:center;justify-content:center;font-size:10px!important;font-weight:900;color:#fff}.vm-range{display:grid;grid-template-columns:auto auto;column-gap:7px;row-gap:2px;font-size:7px;line-height:1.1;color:#ddd}.vm-range b{grid-column:1/-1;color:#f0d54b}.device-voltmeter .vm-jacks{position:absolute!important;bottom:5px!important;left:11px!important;right:11px!important;display:flex!important;justify-content:space-between;font-size:7px!important;font-weight:900}.device-voltmeter .vm-com{color:#fff!important}.device-voltmeter .vm-v{color:#ff646c!important}
/* Cableado */
.wire-shadow{stroke-width:10}.wire{stroke-width:6.5}.wire:hover{stroke-width:9}
@media(max-width:1200px){.component{transform:scale(.93);transform-origin:top left}.workspace{min-height:800px}}
