/* Simulador «Laboratorio de circuitos» (prefijo cl- / circlab). Colores explícitos para que se lean igual en modo claro y oscuro. */
.circlab { --cl-navy: var(--navy, #0b1f33); --cl-line: var(--line, #cfdae6); --cl-muted: #4a5d70; --cl-acc: var(--accent, #e0731a);
  background: var(--card, #fff); color: #0b1f33; border: 1px solid var(--cl-line); border-radius: 8px; padding: 18px; margin: 26px 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.circlab *, .circlab *::before, .circlab *::after { box-sizing: border-box; }
.cl-head { display: flex; flex-direction: column; gap: 2px; }
.cl-head strong { font-size: 1.15rem; }
.cl-head span { color: var(--cl-muted); font-size: .92rem; line-height: 1.5; }
.cl-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.cl-fld { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cl-fld label, .cl-lab { font-size: .82rem; font-weight: 700; color: #0b1f33; }
.circlab select, .circlab input[type="number"] { font: inherit; font-size: .92rem; min-height: 40px; padding: 6px 8px; border: 1px solid var(--cl-line); border-radius: 4px; background: #fff; color: #0b1f33; max-width: 100%; }
.circlab input[type="number"] { width: 6.5em; }
.circlab input[type="range"] { flex: 1 1 90px; min-width: 70px; min-height: 40px; accent-color: #e0731a; }
.circlab select:disabled, .circlab input:disabled { opacity: .55; }
.cl-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-btn, .cl-tog, .cl-chip, .cl-rtab { font: inherit; font-size: .88rem; font-weight: 600; min-height: 40px; padding: 6px 12px; border-radius: 4px; border: 1px solid #0b1f33; background: #0b1f33; color: #fff; cursor: pointer; }
.cl-btn.cl-ghost { background: #fff; color: #0b1f33; }
.cl-btn:disabled { opacity: .45; cursor: not-allowed; }
.cl-tog { background: #e7f6ec; border-color: #7bc596; color: #14532d; min-width: 9.5em; }
.cl-tog[aria-pressed="false"] { background: #f3f6f9; border-color: #8a9bad; color: #0b1f33; }
.cl-tog.cl-danger { background: #f3f6f9; border-color: #8a9bad; color: #0b1f33; }
.cl-tog.cl-danger[aria-pressed="true"] { background: #b42318; border-color: #b42318; color: #fff; }
.circlab button:focus-visible, .circlab select:focus-visible, .circlab input:focus-visible, .circlab summary:focus-visible, .circlab .cl-tblwrap:focus-visible { outline: 3px solid var(--cl-acc); outline-offset: 2px; }
.cl-svg g:focus-visible { outline: none; }
.cl-svg g:focus-visible .cl-hit { stroke: #e0731a; stroke-width: 3; }
.cl-heat { width: 90px; height: 14px; border: 1px solid #8a9bad; border-radius: 7px; background: #eef2f6; overflow: hidden; }
.cl-heat i { display: block; height: 100%; width: 0; background: #e0a800; transition: width .12s linear; }
.cl-heat.hot i { background: #b42318; }
.cl-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .cl-grid { grid-template-columns: minmax(0, 1fr); } }
.cl-left, .cl-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cl-svgbox { min-width: 0; border: 1px solid #e1e8ef; border-radius: 6px; background: #f8fafc; overflow: hidden; }
.cl-svg { display: block; width: 100%; height: auto; max-width: 100%; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.cl-svg text { font-family: Helvetica, Arial, sans-serif; }
.cl-bg { fill: #f8fafc; }
.cl-tx { font-size: 12.5px; font-weight: 700; fill: #0b1f33; }
.cl-small { font-size: 11px; font-weight: 600; fill: #3a4d60; }
.cl-name { font-size: 12.5px; fill: #0b1f33; }
.cl-v { fill: #1d5fa6; } .cl-i { fill: #a04a00; } .cl-p { fill: #14633a; }
.cl-pm { font-size: 16px; }
.cl-tx.bad, .cl-small.bad { fill: #b42318; }
.cl-wire { fill: none; stroke: #475a6e; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: butt; }
.cl-flow { fill: none; stroke: #f59e0b; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 5 12; pointer-events: none; }
.cl-wire.cl-bridge { stroke: #b42318; stroke-width: 4; }
.cl-flow.cl-bridge { stroke: #fde68a; }
@media (prefers-reduced-motion: reduce) { .cl-flow { stroke-dasharray: 2 7; } }
.cl-node { fill: #0b1f33; }
.cl-sym { fill: none; stroke: #0b1f33; stroke-width: 2.6; stroke-linecap: round; }
.cl-sym.cl-fill { fill: #fff; }
.cl-hit { fill: transparent; stroke: transparent; cursor: pointer; }
.cl-leaf:hover .cl-hit, .cl-sw:hover .cl-hit, .cl-fz:hover .cl-hit { fill: rgba(42, 111, 176, .08); }
.cl-body { fill: #fff; stroke: #0b1f33; stroke-width: 2.4; }
.cl-body.open { stroke-dasharray: 4 4; stroke: #8a9bad; }
.cl-glow { fill: #facc15; pointer-events: none; }
.cl-heatres { fill: #ef4444; pointer-events: none; }
.cl-cross { fill: none; stroke: #0b1f33; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.cl-cross.open { stroke: #b6c2cf; }
.cl-shortbar { stroke: #b42318; stroke-width: 4; stroke-linecap: round; pointer-events: none; }
.cl-gap { stroke: #b42318; stroke-width: 3; stroke-linecap: round; pointer-events: none; }
.cl-lever { fill: none; stroke: #0b1f33; stroke-width: 3.4; stroke-linecap: round; }
.cl-fzbody { fill: #fff; stroke: #0b1f33; stroke-width: 2.4; }
.cl-fzline { stroke: #0b1f33; stroke-width: 2.2; }
.cl-fz.trip .cl-fzbody { fill: #fee4e2; stroke: #b42318; }
.cl-fz.trip .cl-fzline { stroke: #b42318; }
.cl-selbox { fill: none; stroke: #2a6fb0; stroke-width: 2.4; stroke-dasharray: 7 5; pointer-events: none; }
.cl-stepbox { fill: rgba(224, 115, 26, .14); stroke: #e0731a; stroke-width: 2.4; pointer-events: none; }
.cl-drop { fill: rgba(42, 111, 176, .2); stroke: #2a6fb0; stroke-width: 2.4; pointer-events: none; }
.cl-droptx { fill: #123e6e; font-size: 13px; pointer-events: none; }
.cl-dragl { pointer-events: none; }
.cl-pal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cl-chip { background: #fff; color: #0b1f33; border: 2px dashed #2a6fb0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cl-chip:active { cursor: grabbing; }
.cl-hint { color: var(--cl-muted); font-size: .8rem; }
.cl-dragghost { position: fixed; z-index: 9999; transform: translate(-50%, -120%); padding: 6px 12px; border-radius: 6px; background: #2a6fb0; color: #fff; font: 700 14px Helvetica, Arial, sans-serif; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.cl-h3 { font-size: 1rem; margin: 0 0 4px; color: #0b1f33; }
.cl-expl { padding: 10px 12px; border-left: 4px solid var(--cl-acc); background: #fff7ef; border-radius: 4px; font-size: .92rem; line-height: 1.55; color: #0b1f33; min-height: 5em; }
.cl-expl p { margin: 0 0 8px; }
.cl-expl p:last-child { margin-bottom: 0; }
.cl-card { border: 1px solid var(--cl-line); border-radius: 6px; padding: 12px; background: #fbfcfd; min-width: 0; display: flex; flex-direction: column; gap: 8px; color: #0b1f33; }
.cl-edgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.cl-edgrid .cl-fld:nth-child(3) { grid-column: 1 / -1; }
.cl-edgrid.off { opacity: .55; }
@media (max-width: 420px) { .cl-edgrid { grid-template-columns: minmax(0, 1fr); } }
.cl-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-note { margin: 0; font-size: .86rem; line-height: 1.5; color: #3a4d60; }
.cl-status:empty { display: none; }
.cl-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cl-steps li { border: 1px solid var(--cl-line); border-radius: 4px; padding: 6px 9px; background: #fff; font-size: .88rem; line-height: 1.45; cursor: pointer; overflow-wrap: anywhere; }
.cl-steps li.past { background: #f3f6f9; color: #4a5d70; }
.cl-steps li.cur { border-color: #e0731a; background: #fff3e6; font-weight: 700; }
.cl-steps li.fin { border-color: #7bc596; background: #e7f6ec; cursor: default; font-weight: 700; }
.cl-eq { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; }
.cl-tblwrap { overflow-x: auto; max-width: 100%; }
.cl-tbl { border-collapse: collapse; width: 100%; font-size: .84rem; }
.cl-tbl th, .cl-tbl td { border: 1px solid var(--cl-line); padding: 4px 7px; text-align: right; white-space: nowrap; color: #0b1f33; background: #fff; }
.cl-tbl thead th { background: #eef2f6; }
.cl-tbl tbody th { text-align: left; background: #f3f6f9; }
.cl-tbl td:last-child { text-align: left; }
.cl-tbl tr.sel td, .cl-tbl tr.sel th { background: #e6f0fa; }
.cl-tbl tr.tot td, .cl-tbl tr.tot th { background: #eef2f6; font-weight: 700; }
.cl-rtabs { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-rtab { background: #fff; color: #0b1f33; border-color: var(--cl-line); }
.cl-rtab[aria-pressed="true"] { background: #0b1f33; color: #fff; border-color: #0b1f33; }
.cl-rtab.ok::after { content: ' ✔'; color: #1a7f4b; }
.cl-rtab.ok[aria-pressed="true"]::after { color: #9be3b8; }
.cl-rbody { display: flex; flex-direction: column; gap: 8px; }
.cl-rdesc { margin: 0; font-size: .92rem; line-height: 1.55; }
.cl-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cl-checks li { font-size: .88rem; padding: 4px 8px; border-radius: 4px; }
.cl-checks li.ok { background: #e7f6ec; color: #14532d; }
.cl-checks li.no { background: #fdeeee; color: #8a1c1c; }
.cl-win { margin: 0; font-weight: 800; color: #14532d; background: #d1f0dc; border-radius: 4px; padding: 8px 10px; }
.cl-det summary { cursor: pointer; font-weight: 700; font-size: .88rem; min-height: 32px; }
.cl-det p { margin: 6px 0 0; font-size: .88rem; line-height: 1.5; }
@media (max-width: 640px) { .cl-svgbox { overflow-x: auto; -webkit-overflow-scrolling: touch; } .cl-svg { min-width: var(--cl-minw, 460px); } .cl-svgbox::after { content: 'Desliza el esquema para verlo completo'; display: block; font-size: .72rem; color: #4a5d70; padding: 2px 8px 4px; } }
