/* Simulador didáctico: interruptor termomagnético por dentro (publicación 109). Prefijo tmg-. */
.tmg { 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; }
.tmg * { box-sizing: border-box; }
.tmg-head { display: flex; flex-direction: column; gap: 2px; }
.tmg-head strong { font-size: 1.1rem; color: var(--navy, #0b1f33); }
.tmg-head span { color: var(--muted, #4a5d70); font-size: .92rem; line-height: 1.5; }
.tmg-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); grid-template-areas: "main side" "extra side" "expl side"; gap: 16px; align-items: start; align-content: start; grid-template-rows: min-content min-content min-content; }
.tmg-main { grid-area: main; } .tmg-side { grid-area: side; } .tmg-extra { grid-area: extra; } .tmg-expl-wrap { grid-area: expl; }
@media (max-width: 860px) { .tmg-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side" "extra" "expl"; grid-template-rows: auto; } }
.tmg-main, .tmg-side, .tmg-extra, .tmg-expl-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tmg-card { border: 1px solid var(--line-soft, #e1e8ef); border-radius: 6px; background: #fff; padding: 10px; min-width: 0; color: #0b1f33; }
.tmg-ct { font-size: .88rem; font-weight: 700; color: var(--navy, #0b1f33); margin-bottom: 6px; }
.tmg-card .tmg-ct { color: #0b1f33; }
.tmg svg { display: block; width: 100%; height: auto; max-width: 100%; font-family: inherit; }
.tmg-motor { max-width: 420px; margin: 0 auto; }
.tmg-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: #4a5d70; }
.tmg-legend li { display: inline-flex; align-items: center; gap: 5px; }
.tmg-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.tmg-legend i.ln { width: 20px; height: 4px; border-radius: 2px; }
.tmg-legend i.dash { height: 0; background: none; border-top: 3px dashed; border-radius: 0; }
.tmg-legend i.pole { width: 18px; height: 18px; border-radius: 50%; color: #fff; font-style: normal; font-weight: 700; font-size: .68rem; line-height: 18px; text-align: center; }
.tmg-legend i.pole.n { background: #c0392b; } .tmg-legend i.pole.s { background: #1e6bb8; margin-left: -8px; }
.tmg-status { padding: 10px 12px; border-radius: 4px; font-size: .92rem; font-weight: 600; line-height: 1.5; border-left: 4px solid #7d8fa2; background: #eef2f6; color: #0b1f33; }
.tmg-status.ok { background: #effaf2; border-color: #1a7f4b; color: #14532d; }
.tmg-status.warn { background: #fff6e0; border-color: #b7791f; color: #6b4b00; }
.tmg-status.bad { background: #fdecec; border-color: #b42318; color: #721c24; }
.tmg-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tmg button { font: inherit; font-weight: 600; font-size: .9rem; padding: 9px 14px; border-radius: 4px; border: 1px solid var(--navy, #0b1f33); background: var(--navy, #0b1f33); color: #fff; cursor: pointer; min-height: 40px; }
.tmg button.ghost { background: transparent; color: var(--navy, #0b1f33); }
.tmg button.warn { background: #b42318; border-color: #b42318; }
.tmg button:disabled { opacity: .45; cursor: not-allowed; }
.tmg button[hidden] { display: none; }
.tmg input:focus-visible, .tmg button:focus-visible, .tmg select:focus-visible { outline: 3px solid var(--accent, #e0731a); outline-offset: 2px; }
.tmg fieldset { border: 1px solid var(--line, #cfdae6); border-radius: 6px; margin: 0; padding: 6px 12px 8px; min-width: 0; }
.tmg legend { font-size: .85rem; font-weight: 700; color: var(--navy, #0b1f33); padding: 0 6px; }
.tmg-row { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.tmg-row label { font-size: .86rem; font-weight: 600; color: var(--navy, #0b1f33); }
.tmg-in { display: flex; align-items: center; gap: 10px; }
.tmg-in input[type=range] { flex: 1 1 auto; min-width: 0; height: 30px; accent-color: var(--accent, #e0731a); }
.tmg-in output { flex: 0 0 auto; min-width: 6.2em; text-align: right; font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; font-weight: 600; color: var(--navy, #0b1f33); }
.tmg select { font: inherit; font-size: .9rem; padding: 7px 8px; border: 1px solid var(--line, #cfdae6); border-radius: 4px; background: #fff; color: #0b1f33; width: 100%; max-width: 100%; min-height: 40px; }
.tmg-chk { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; padding: 6px 0 2px; color: var(--navy, #0b1f33); }
.tmg-chk input { width: 18px; height: 18px; accent-color: var(--accent, #e0731a); }
.tmg-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; border: 1px solid var(--line, #cfdae6); border-left: 4px solid var(--accent, #e0731a); border-radius: 4px; padding: 10px 12px; background: #fff7ef; color: #0b1f33; }
.tmg-read div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tmg-read div.wide { grid-column: 1 / -1; }
.tmg-read span { font-size: .74rem; color: #4a5d70; }
.tmg-read b { font-size: .92rem; color: #0b1f33; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tmg-heat i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #b42318 var(--h, 0%), #e3e9f0 var(--h, 0%)); border: 1px solid #cfdae6; margin: 2px 0; }
.tmg-boxtxt { font-size: .82rem; line-height: 1.5; color: #4a5d70; margin-top: 4px; }
.tmg-boxtxt b { color: #0b1f33; } .tmg-boxtxt span { display: block; }
.tmg-expl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tmg-expl li { padding: 9px 12px; border-radius: 4px; border-left: 4px solid #2a6fb0; background: #eef5fc; color: #0b1f33; font-size: .9rem; line-height: 1.55; }
.tmg-expl li.ok { border-color: #1a7f4b; background: #effaf2; color: #14532d; }
.tmg-expl li.warn { border-color: #b7791f; background: #fff6e0; color: #6b4b00; }
.tmg-expl li.bad { border-color: #b42318; background: #fdecec; color: #721c24; }
@media (prefers-reduced-motion: reduce) { .tmg * { animation: none !important; transition: none !important; } }

.tmg-grid { grid-template-areas: "main side" "main extra" "expl expl"; }
.tmg-grid { grid-template-rows: auto; }
.tmg-svg { max-width: 420px; margin: 0 auto; }
.tmg-chart { max-width: 560px; }
.tmg-legend { counter-reset: none; }
ol.tmg-legend { list-style: none; }
ol.tmg-legend li b { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; background: #0b1f33; color: #fff; font-size: .72rem; }
.tmg-legend i.sw { width: 16px; height: 12px; border: 1px solid #9fb1c3; }
.tmg-legend i.sw.th { background: #eaf3fc; } .tmg-legend i.sw.mag { background: #fdecec; }
.tmg-legend i.sw.unc { background: repeating-linear-gradient(45deg, #fff1d6, #fff1d6 3px, #e0a53a 3px, #e0a53a 5px); }
.tmg-legend i.ln { width: 20px; height: 4px; background: #0b1f33; border-radius: 2px; }
.tmg-legend i.ln.cab { background: repeating-linear-gradient(90deg, #b42318, #b42318 6px, transparent 6px, transparent 9px); }
.tmg-scen { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 4px; align-items: center; }
.tmg-scen .tmg-sl { flex: 1 0 100%; font-size: .85rem; font-weight: 700; color: var(--navy, #0b1f33); }
.tmg-scen button { font-size: .82rem; padding: 7px 10px; min-height: 38px; }
.tmg-cardbar .tmg-boxtxt { margin-top: 6px; }
.tmg-h { margin: 0 0 6px; }
.tmg-expl-wrap { min-width: 0; }
@media (max-width: 860px) { .tmg-grid { grid-template-areas: "main" "side" "extra" "expl"; } }
