/* Herramienta de diagnóstico de fallas en engranajes */
.egf { background: var(--card, #fff); border: 1px solid var(--line, #cfdae6); border-radius: 8px; padding: 18px; margin: 26px 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.egf * { box-sizing: border-box; }
.egf-head { display: flex; flex-direction: column; gap: 2px; }
.egf-head strong { font-size: 1.1rem; color: var(--navy, #0b1f33); }
.egf-head span { color: var(--muted, #4a5d70); font-size: .92rem; line-height: 1.5; }
.egf-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--navy, #0b1f33); }
.egf-tab { font: inherit; font-size: .92rem; font-weight: 600; padding: 9px 14px; border: 1px solid var(--line, #cfdae6); border-bottom: 0; border-radius: 6px 6px 0 0; background: #f3f6f9; color: var(--muted, #4a5d70); cursor: pointer; }
.egf-tab.on { background: var(--navy, #0b1f33); color: #fff; border-color: var(--navy, #0b1f33); }
.egf button:focus-visible, .egf input:focus-visible, .egf select:focus-visible, .egf-fb:focus-visible, .egf-info h4:focus-visible { outline: 3px solid var(--accent, #e0731a); outline-offset: 2px; }
.egf-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.egf-panel[hidden] { display: none; }
.egf-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.egf-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.egf-f label { font-size: .85rem; font-weight: 600; color: var(--navy, #0b1f33); }
.egf select { font: inherit; font-size: .95rem; padding: 9px 10px; border: 1px solid var(--line, #cfdae6); border-radius: 4px; background: #fff; color: var(--navy, #0b1f33); width: 100%; }
.egf-rr { display: flex; align-items: center; gap: 10px; }
.egf-rr input { flex: 1 1 auto; min-width: 0; accent-color: var(--accent, #e0731a); height: 28px; }
.egf-rr output { min-width: 5.5em; font-weight: 700; font-size: .9rem; color: var(--navy, #0b1f33); }
.egf-pats { border: 1px solid var(--line, #cfdae6); border-radius: 6px; padding: 8px 12px 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.egf-pats legend { font-size: .85rem; font-weight: 600; color: var(--navy, #0b1f33); padding: 0 6px; }
.egf-pill { position: relative; display: inline-flex; }
.egf-pill input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.egf-pill span { font-size: .88rem; padding: 8px 12px; border: 1px solid var(--line, #cfdae6); border-radius: 999px; background: #fff; color: var(--navy, #0b1f33); cursor: pointer; }
.egf-pill input:checked + span { background: var(--navy, #0b1f33); color: #fff; border-color: var(--navy, #0b1f33); font-weight: 600; }
.egf-pill input:focus-visible + span { outline: 3px solid var(--accent, #e0731a); outline-offset: 2px; }
.egf-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .egf-grid { grid-template-columns: minmax(0, 1fr); } }
.egf-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.egf-viz { border: 1px solid var(--line-soft, #e1e8ef); border-radius: 6px; background: #fff; overflow: hidden; }
.egf-svg { display: block; width: 100%; height: auto; }
.egf-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted, #4a5d70); margin: 0; }
.egf-leg span { display: inline-flex; align-items: center; gap: 5px; }
.egf-leg i { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.egf-leg .lg-p { height: 0; border-top: 2px dashed #e0731a; } .egf-leg .lg-g { background: rgba(31,157,85,.5); border: 1px solid #1f9d55; } .egf-leg .lg-r { background: rgba(214,69,69,.5); border: 1px solid #d64545; }
.egf-info { font-size: .92rem; line-height: 1.55; color: var(--navy, #0b1f33); min-width: 0; }
.egf-info h4 { margin: 14px 0 4px; font-size: 1rem; color: var(--navy, #0b1f33); }
.egf-info h4:first-child { margin-top: 0; }
.egf-info p { margin: 0 0 8px; }
.egf-info .egf-h2 { font-weight: 700; margin: 8px 0 2px; }
.egf-info ul, .egf-info ol { margin: 0 0 8px; padding-left: 1.3em; }
.egf-info li { margin-bottom: 3px; }
.egf-comb { margin-top: 10px; padding: 10px 12px; border-left: 4px solid var(--accent, #e0731a); background: #fff7ef; border-radius: 4px; }
.egf-score { margin: 0; padding: 8px 12px; background: #f3f6f9; border-radius: 4px; font-weight: 600; font-size: .9rem; color: var(--navy, #0b1f33); }
.egf-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 8px 0; }
.egf-opt { font: inherit; font-weight: 600; font-size: .92rem; padding: 11px 12px; border-radius: 6px; border: 2px solid var(--line, #cfdae6); background: #fff; color: var(--navy, #0b1f33); cursor: pointer; text-align: left; }
.egf-opt:hover:not(:disabled) { border-color: var(--navy, #0b1f33); }
.egf-opt:disabled { cursor: default; opacity: .75; }
.egf-opt.right { border-color: #15803d; background: #effaf2; opacity: 1; }
.egf-opt.right::after { content: ' ✔'; color: #15803d; }
.egf-opt.wrong { border-color: #b91c1c; background: #fdecec; opacity: 1; }
.egf-opt.wrong::after { content: ' ✖'; color: #b91c1c; }
.egf-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.egf-b { font: inherit; font-weight: 600; font-size: .92rem; padding: 9px 14px; border-radius: 4px; border: 1px solid var(--navy, #0b1f33); background: var(--navy, #0b1f33); color: #fff; cursor: pointer; }
.egf-b.ghost { background: transparent; color: var(--navy, #0b1f33); }
.egf-b:disabled { opacity: .45; cursor: not-allowed; }
.egf-b[hidden], .egf-opt[hidden] { display: none; }
.egf-fb { border-radius: 4px; }
.egf-fb p { margin: 0 0 6px; }
.egf-fb.ok, .egf-fb.bad, .egf-fb.hint { padding: 10px 12px; margin-top: 6px; }
.egf-fb.ok { background: #effaf2; color: #155724; } .egf-fb.bad { background: #fdecec; color: #721c24; } .egf-fb.hint { background: #fff6e0; color: #6b4b00; }
.egf-big { font-size: 1.4rem; font-weight: 800; color: var(--accent-ink, #a84f08); }
.egf-note { font-size: .82rem; color: var(--muted, #4a5d70); margin: 0; line-height: 1.5; }
@media (max-width: 520px) { .egf { padding: 12px; } .egf-tab { flex: 1 1 auto; } }

.egf-viz:empty { display: none; }
