/* Simulador "Motor monofásico por dentro" — prefijo mm- */
.mm {
  --mm-main: #2a6fb0; --mm-main-d: #1c4f82; --mm-aux: #e0731a; --mm-aux-d: #a84f08;
  --mm-field: #1a7f4b; --mm-field-f: #1a7f4b; --mm-red: #b42318; --mm-ink: #0b1f33; --mm-mut: #4a5d70;
  --mm-line: #8aa0b5; --mm-yoke: #dfe7ef; --mm-bore: #ffffff; --mm-pole: #b9c7d6; --mm-rotor: #cfd9e3; --mm-bar: #8aa0b5; --mm-shaft: #5d7288;
  --mm-plot: #ffffff; --mm-grid: #dbe4ec; --mm-curve-k: #6b7c8d;
  background: var(--card, #fff); color: var(--navy, #0b1f33); border: 1px solid var(--line, #cfdae6); border-radius: 8px;
  padding: 18px; margin: 26px 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; color-scheme: light;
}
.mm * { box-sizing: border-box; }
.mm [hidden] { display: none !important; }
.mm-head { display: flex; flex-direction: column; gap: 2px; }
.mm-head strong { font-size: 1.1rem; color: var(--navy, #0b1f33); }
.mm-head span { color: var(--muted, #4a5d70); font-size: .92rem; line-height: 1.5; }
.mm-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mm-lab { font-size: .85rem; font-weight: 600; color: var(--muted, #4a5d70); }
.mm-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
.mm-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mm-f label { font-size: .84rem; font-weight: 600; color: var(--navy, #0b1f33); }
.mm-f b { font-variant-numeric: tabular-nums; color: var(--accent-ink, #a84f08); }
.mm select { font: inherit; font-size: .9rem; padding: 8px; border: 1px solid var(--line, #cfdae6); border-radius: 4px; background: #fff; color: var(--navy, #0b1f33); max-width: 100%; min-height: 40px; }
.mm input[type=range] { width: 100%; min-height: 32px; accent-color: #2a6fb0; }
.mm select:focus-visible, .mm input:focus-visible, .mm button:focus-visible { outline: 3px solid var(--accent, #e0731a); outline-offset: 2px; }
.mm-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-b { font: inherit; font-weight: 600; font-size: .9rem; padding: 10px 14px; min-height: 44px; border-radius: 4px; border: 1px solid var(--navy, #0b1f33); background: #fff; color: var(--navy, #0b1f33); cursor: pointer; }
.mm-b.main { background: var(--navy, #0b1f33); color: #fff; }
.mm-b.ghost { border-color: var(--line, #cfdae6); color: var(--muted, #4a5d70); }
.mm-b.on { background: #fff6e0; border-color: #b7791f; color: #6b4b00; }
.mm-b.chip { font-weight: 500; font-size: .85rem; padding: 8px 12px; min-height: 40px; border-color: #b4c4d4; }
.mm-b:hover { filter: brightness(.96); }
.mm-scrub label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 600; max-width: 420px; }
.mm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mm-panel { border: 1px solid var(--line-soft, #e1e8ef); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; background: #fff; }
.mm-panel.wide { grid-column: 1 / -1; }
.mm-panel h4 { margin: 0; font-size: .95rem; color: var(--navy, #0b1f33); }
@media (max-width: 860px) { .mm-grid { grid-template-columns: minmax(0, 1fr); } }
.mm-svgwrap { width: 100%; min-width: 0; border-radius: 4px; overflow: hidden; background: #fff; }
.mm-svgwrap svg { display: block; width: 100%; height: auto; max-width: 100%; font-family: inherit; }
.mm-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; align-items: start; }
@media (max-width: 700px) { .mm-two { grid-template-columns: minmax(0, 1fr); } .mm-svgwrap.small { max-width: 260px; margin: 0 auto; } }
.mm-legend { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted, #4a5d70); line-height: 1.4; }
.mm-legend i { display: inline-block; width: 18px; height: 5px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.mm-legend i.b { background: #2a6fb0; } .mm-legend i.o { background: #e0731a; } .mm-legend i.g { background: #1a7f4b; } .mm-legend i.k { background: #6b7c8d; } .mm-legend i.r { background: #b42318; }
.mm-fieldinfo, .mm-sub { margin: 0; font-size: .85rem; color: var(--navy, #0b1f33); line-height: 1.5; }
.mm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.mm-chip { border: 1px solid var(--line, #cfdae6); border-radius: 6px; padding: 7px 10px; background: #fff; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mm-chip i { font-style: normal; font-size: .72rem; color: var(--muted, #4a5d70); }
.mm-chip b { font-size: .98rem; font-variant-numeric: tabular-nums; color: var(--navy, #0b1f33); overflow-wrap: anywhere; }
.mm-chip.warn { border-color: #b7791f; background: #fff6e0; }
.mm-bar { display: block; height: 12px; border: 1px solid var(--line, #cfdae6); border-radius: 6px; background: #eef2f6; overflow: hidden; margin-top: 3px; }
.mm-bar span { display: block; height: 100%; background: #1a7f4b; }
.mm-bar span.hot { background: #b42318; }
.mm-expl { min-height: 3.2em; }
.mm-ex { padding: 10px 12px; border-left: 4px solid var(--accent, #e0731a); background: #fff7ef; border-radius: 4px; font-size: .92rem; line-height: 1.55; color: var(--navy, #0b1f33); }
.mm-ex.bad { border-left-color: #b42318; background: #fdecec; color: #4a1015; }
.mm-fault { border-top: 1px solid var(--line-soft, #e1e8ef); padding-top: 10px; }
.mm-fault h4 { margin: 0 0 8px; font-size: .98rem; }
.mm-fcard { border-radius: 6px; padding: 10px 12px; font-size: .9rem; line-height: 1.55; border-left: 4px solid #1a7f4b; background: #effaf2; color: #14532d; }
.mm-fcard.bad { border-left-color: #b42318; background: #fdf3f3; color: #4a1015; }
.mm-fcard p { margin: 0 0 6px; }
.mm-fcard p:last-child { margin: 0; }
.mm-tbl { overflow-x: auto; margin-top: 10px; }
.mm-tbl table { border-collapse: collapse; width: 100%; font-size: .85rem; color: var(--navy, #0b1f33); }
.mm-tbl th, .mm-tbl td { border: 1px solid var(--line, #cfdae6); padding: 6px 9px; text-align: left; vertical-align: top; background: #fff; }
.mm-tbl thead th { background: #eef2f6; }
.mm-tbl tbody th { font-weight: 600; background: #f6f8fa; }
.mm-tbl tr.bad td:last-child { background: #fdecec; color: #721c24; font-weight: 700; }
.mm-note { margin: 0; font-size: .8rem; color: var(--muted, #4a5d70); line-height: 1.5; }

/* circuito */
.mm .mm-bus { stroke: #0b1f33; stroke-width: 3; }
.mm .mm-w { stroke: #7d8fa1; stroke-width: 3; fill: none; stroke-linecap: round; }
.mm .mm-w.off { stroke: #7d8fa1; }
.mm .mm-w.idle { stroke: #9fb0c0; }
.mm .mm-w.on1 { stroke: #2a6fb0; stroke-width: 3; stroke-dasharray: 7 6; animation: mm-flow .9s linear infinite; }
.mm .mm-w.on2 { stroke: #2a6fb0; stroke-width: 4.5; stroke-dasharray: 8 6; animation: mm-flow .6s linear infinite; }
.mm .mm-w.on3 { stroke: #2a6fb0; stroke-width: 6; stroke-dasharray: 9 6; animation: mm-flow .4s linear infinite; }
.mm .mm-w.aux.on1, .mm .mm-w.aux.on2, .mm .mm-w.aux.on3 { stroke: #e0731a; }
.mm .mm-w.on-bad { stroke: #b42318; stroke-width: 3; }
@keyframes mm-flow { to { stroke-dashoffset: -26; } }
.mm .mm-coil { fill: none; stroke-width: 3.5; stroke-linecap: round; }
.mm .mm-coil.m { stroke: #2a6fb0; } .mm .mm-coil.a { stroke: #e0731a; }
.mm .mm-plate { stroke: #0b1f33; stroke-width: 3; }
.mm .mm-dot { fill: #0b1f33; }
.mm .mm-tx { font-size: 10px; fill: #0b1f33; }
.mm .mm-tx.b { font-weight: 700; font-size: 11px; }
.mm .mm-tx.rev { fill: #a84f08; font-weight: 700; }
.mm .mm-x circle { fill: #b42318; stroke: #fff; stroke-width: 1.5; }
.mm .mm-x path { stroke: #fff; stroke-width: 2.2; fill: none; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) { .mm * { animation: none !important; transition: none !important; } }
@media (prefers-color-scheme: dark) { .mm { color-scheme: light; } }
