/* ================================================================
   CIRCUIT-LAB v1.1.0 — feuille de style (préfixes .cl- et .mm-)
   Trois colonnes : Circuit · Palette · Instruments + Multimètre.
   ================================================================ */
.circuit-lab-widget{
  --cl-accent:#2b7bbb; --cl-wire:#222; --cl-node:#b9c4cf;
  --mm-body:#f2b705; --mm-body-edge:#c99503; --mm-lcd:#c7d3b0; --mm-lcd-edge:#3a4a2f;
  --mm-digit:#1c241a; --mm-knob:#2a2f36; --mm-knob-edge:#12151a; --mm-pointer:#f2b705;
  --mm-term:#d7dde3; --mm-term-edge:#9aa6b2; --mm-term-on:#2e9e5b; --mm-err:#d1495b;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:#1d2733;
}
.cl-layout{display:flex;gap:20px;flex-wrap:wrap;align-items:flex-start}
.cl-col{flex:0 1 auto}
.cl-col:nth-child(1){flex:1 1 420px;min-width:320px}   /* circuit */
.cl-col:nth-child(2){flex:0 0 190px}                    /* palette */
.cl-col:nth-child(3){flex:0 0 300px}                    /* mesure  */
.cl-h{margin:0 0 8px;font-size:12px;color:#5a6b7b;font-weight:700;text-transform:uppercase;letter-spacing:.03em}
.cl-h-meter{margin-top:18px}

/* ---- constructeur ---- */
.cl-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:8px}
.cl-tool{border:1px solid #cdd7e1;background:#fff;border-radius:8px;padding:5px 10px;font-size:12px;color:#000;cursor:pointer;user-select:none;text-transform: none;font-weight: normal;}
.cl-tool:not([aria-pressed="true"]):hover{background:#f0f3f6;border-color:#aebdca}
.cl-tool[aria-pressed="true"]{background:var(--cl-accent);border-color:var(--cl-accent);color:#fff}
.cl-tool-vider{margin-left:auto;color:#a23b4a;border-color:#e6c2c8}
.cl-tool-vider:hover{background:#fbeef0}
.cl-board{position:relative;background:#fafcff;border:1px solid #dce4ec;border-radius:12px;touch-action:none}
.cl-board svg{display:block;width:100%;height:auto}
.cl-svg-grid circle{fill:var(--cl-node)}
.cl-wire-line{stroke:var(--cl-wire);stroke-width:3;stroke-linecap:round}
.cl-preview{stroke:var(--cl-accent);stroke-width:3;stroke-dasharray:5 5;stroke-linecap:round;opacity:.7}
.cl-current-layer{pointer-events:none}
.cl-current-arrow polygon{fill:var(--cl-accent)}
.cl-sym-bg{fill:#fafcff}
.cl-sym-mark{stroke:var(--cl-wire);stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}
.cl-sym-fill{fill:var(--cl-wire)}
.cl-sym-text{font:700 16px system-ui,sans-serif;fill:var(--cl-wire)}
.cl-sym-sign{font:700 13px system-ui,sans-serif;fill:var(--cl-wire)}
.cl-sym-wire{stroke:var(--cl-wire);stroke-width:3;stroke-linecap:round}
.cl-symbol.is-moving .cl-sym-mark,.cl-symbol.is-moving .cl-sym-wire{stroke:var(--cl-accent)}
.cl-symbol.is-moving .cl-sym-bg{stroke:var(--cl-accent);stroke-width:2;fill:#e8f3fb}
/* repère COM (toujours en repère écran, jamais miroir) */
.cl-com-dot{fill:#111}
.cl-com-label{font:700 8px system-ui,sans-serif;fill:#111}
/* annotations unifiées (tension, L1, R1 + valeur) : bleu, sans-serif */
.cl-annot{font:700 11px system-ui,-apple-system,"Segoe UI",sans-serif;fill:#2b7bbb}
/* halo jaune autour de l'appareil de mesure actif */
.cl-symbol.cl-active{filter:drop-shadow(0 0 4px #f4c20d) drop-shadow(0 0 8px #f4c20d)}
.cl-symbol.cl-active .cl-sym-bg{fill:#fff7d6}

/* palette */
.cl-palette{display:flex;flex-direction:column;gap:4px;padding:10px;border:1px solid #dce4ec;border-radius:12px;background:#fff}
.cl-pal-group h5{margin:6px 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.03em;color:#8493a1;font-weight:700}
.cl-pal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.cl-sym{display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center;border:1px solid #cdd7e1;border-radius:8px;padding:6px 4px;cursor:grab;background:#fff;user-select:none;touch-action:none;color:inherit;font:inherit}
.cl-sym:not(.is-selected):hover{background:#f0f3f6;border-color:#aebdca;box-shadow:0 2px 6px rgba(15,76,92,.12)}
.cl-sym.is-selected{background:#e8f4f7;border-color:#147e99;color:#0f4c5c;box-shadow:0 0 0 2px rgba(20,126,153,.18)}
.cl-sym span{font-size:11px;line-height:1.1}
.cl-ghost{position:fixed;pointer-events:none;z-index:9999;opacity:.85;transform:translate(-50%,-50%)}

/* ---- multimètre = façade SVG fournie ; on n'ajoute que ces surcouches ---- */
.mm-device{max-width:250px}
.mm-svg{display:block;width:100%;height:auto;touch-action:none}
/* écran 7 segments */
.mm-seg-on{fill:#12180f}
.mm-seg-off{fill:rgba(30,40,26,.07)}
.mm-lcd7.mm-err .mm-seg-on{fill:#c0392b}
.mm-lcd-unit{font-family:system-ui,sans-serif;font-weight:700;font-size:26px;fill:#12180f}
/* bornes : hover discret + sélection nette */
.mm-term-hit{fill:transparent;stroke:transparent;stroke-width:5;cursor:pointer;transition:stroke .12s}
.mm-term-hit:hover{stroke:rgba(46,158,91,.35)}
.mm-term-hit.mm-sel{stroke:#2e9e5b;stroke-width:5}
.mm-dial-hit{cursor:grab}

/* aide dynamique sous le multimètre (style feedback : ✗ rouge) */
.cl-mm-hint{margin-top:10px;display:flex;flex-direction:column;gap:5px}
.cl-mm-hint-row{display:flex;align-items:center;gap:7px;font-size:13px;color:#5a6b7b}
.cl-mm-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:#fbeef0;color:#d1495b;font-weight:800;font-size:12px;flex:0 0 auto}

/* liste d'instruments */
.mm-sources{display:flex;flex-direction:column;gap:6px}
.mm-source{display:flex;align-items:center;gap:8px;text-align:left;border:1px solid #cdd7e1;border-radius:8px;padding:8px 10px;background:#fff;cursor:pointer;font:inherit;color:inherit;user-select:none}
.mm-source:hover{background:#f0f3f6;border-color:#aebdca}
.mm-source.mm-active{background:#e8f4f7;border-color:#147e99;box-shadow:0 0 0 2px rgba(20,126,153,.18)}
.mm-source .mm-source-name{font-weight:600;font-size:13px}

/* ---- mobile : colonnes empilées ---- */
@media (max-width:820px){
  .cl-layout{gap:16px}
  .cl-col:nth-child(1),.cl-col:nth-child(2),.cl-col:nth-child(3){flex:1 1 100%;min-width:0}
  .cl-palette{flex-direction:row;flex-wrap:wrap}
  .cl-pal-group{flex:1 1 140px}
  .mm-device{max-width:260px;margin:0 auto}
}