/* Loi d'Ohm et puissance : styles propres à l'outil. */
.o-loi-ohm [hidden] { display: none !important; }
.o-loi-ohm .lo-securite { margin: 0 0 12px; padding: 10px 14px; border-left: 4px solid var(--erreur-texte); border-radius: var(--rayon-petit); background: var(--erreur-fond); color: var(--erreur-texte); font-size: .92rem; }
.o-loi-ohm .lo-onglets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 12px 0; border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord); }
.o-loi-ohm .lo-onglets .btn { flex: 1 1 auto; min-height: 44px; font-size: .98rem; font-weight: 600; }
.atelier .o-loi-ohm .lo-onglets .btn[aria-selected="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }
.o-loi-ohm .reglages { align-items: end; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.o-loi-ohm .lo-saisie { display: flex; min-width: 0; }
.o-loi-ohm .lo-saisie input { flex: 1 1 auto; min-width: 0; width: 100%; font: 600 1.1rem var(--mono); }
.o-loi-ohm .lo-saisie input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.o-loi-ohm .lo-saisie select { flex: 0 0 auto; width: auto; min-width: 4.4em; min-height: 42px; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.o-loi-ohm input[aria-invalid="true"] { border-color: var(--erreur-texte); outline: 1px solid var(--erreur-texte); }
.o-loi-ohm input:focus-visible, .o-loi-ohm select:focus-visible, .o-loi-ohm .btn:focus-visible { outline: 3px solid var(--marque); outline-offset: 1px; position: relative; z-index: 1; }
.o-loi-ohm .lo-note { margin: 8px 0; color: var(--texte-2); font-size: .9rem; }
.o-loi-ohm .lo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.o-loi-ohm .lo-erreur { margin: 12px 0 0; color: var(--erreur-texte); }
.o-loi-ohm .lo-erreur:empty { display: none; }
.o-loi-ohm .lo-resultat { display: block; margin-top: 14px; }
.o-loi-ohm .lo-resultat:empty { display: none; }
.o-loi-ohm .lo-table { width: 100%; border-collapse: collapse; border-radius: var(--rayon-petit); overflow: hidden; background: var(--ok-fond); color: var(--ok-texte); }
.o-loi-ohm .lo-table th, .o-loi-ohm .lo-table td { padding: 8px 12px; font-weight: 400; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.o-loi-ohm .lo-table th { text-align: left; overflow-wrap: anywhere; }
.o-loi-ohm .lo-table td { text-align: right; font: 600 1rem var(--mono); overflow-wrap: anywhere; }
.o-loi-ohm .lo-table tr:last-child th, .o-loi-ohm .lo-table tr:last-child td { border-bottom: 0; }
.o-loi-ohm .lo-table tr.lo-fort th, .o-loi-ohm .lo-table tr.lo-fort td { font-weight: 700; font-size: 1.08rem; }
.o-loi-ohm .lo-calcul { margin-top: 14px; padding: 12px 14px; border-radius: var(--rayon-petit); background: var(--surface-2); }
.o-loi-ohm .lo-calcul strong { display: block; margin-bottom: 4px; font-size: .88rem; font-weight: 600; color: var(--texte-2); }
.o-loi-ohm .lo-formules { display: block; min-height: 1.6em; font: 500 .95rem/1.7 var(--mono); overflow-wrap: anywhere; }
.o-loi-ohm .lo-formules span { display: block; }

/* Loi d'Ohm : saisie à gauche, roue à droite */
.o-loi-ohm .lo-ohm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 20px; align-items: start; }
.o-loi-ohm .lo-quatre { grid-template-columns: 1fr 1fr; }
.o-loi-ohm .lo-roue { margin: 0; text-align: center; }
.o-loi-ohm .lo-roue svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
.o-loi-ohm .lo-roue figcaption { margin-top: 6px; font-size: .85rem; color: var(--texte-2); }
.o-loi-ohm .lo-roue text { text-anchor: middle; dominant-baseline: central; font: 600 12.5px var(--mono); fill: var(--texte); }
.o-loi-ohm .lo-roue .lo-lettre { font: 700 26px var(--police); }
.o-loi-ohm .lo-seg path { fill: var(--surface-2); stroke: var(--bord); stroke-width: 1; transition: fill .2s; }
.o-loi-ohm .lo-q path { fill: var(--surface); stroke: var(--bord); stroke-width: 1; transition: fill .2s; }
.o-loi-ohm .lo-q.donnee path { fill: var(--ok-fond); }
.o-loi-ohm .lo-q.donnee text { fill: var(--ok-texte); }
.o-loi-ohm .lo-q.calculee path, .o-loi-ohm .lo-seg.actif path { fill: var(--marque); stroke: var(--marque-fort); }
.o-loi-ohm .lo-q.calculee text, .o-loi-ohm .lo-seg.actif text { fill: var(--sur-marque); }

/* Résistances */
.o-loi-ohm .lo-lignes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.o-loi-ohm .lo-ligne { display: flex; align-items: end; gap: 6px; }
.o-loi-ohm .lo-ligne label { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .88rem; color: var(--texte-2); }
.o-loi-ohm .lo-retirer { min-height: 42px; min-width: 42px; padding: 0; font-size: 1.2rem; }

@media (max-width: 760px) {
  .o-loi-ohm .lo-ohm { grid-template-columns: 1fr; }
  .o-loi-ohm .lo-roue svg { max-width: 290px; }
}
@media (max-width: 640px) {
  .o-loi-ohm .lo-onglets .btn { flex: 1 1 45%; font-size: .92rem; }
  .o-loi-ohm .reglages { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .o-loi-ohm .lo-table th, .o-loi-ohm .lo-table td { padding: 7px 8px; }
  .o-loi-ohm .lo-table td { font-size: .92rem; }
}
@media (max-width: 420px) {
  .o-loi-ohm .reglages, .o-loi-ohm .lo-quatre { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .o-loi-ohm * { transition: none !important; } }
