/* Simuladores didácticos de bombas (curvas y cavitación) */
.bsim { 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; }
.bsim * { box-sizing: border-box; }
.bsim-head { display: flex; flex-direction: column; gap: 2px; }
.bsim-head strong { font-size: 1.1rem; color: var(--navy, #0b1f33); }
.bsim-head span { color: var(--muted, #4a5d70); font-size: .92rem; line-height: 1.5; }
.bsim-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .bsim-grid { grid-template-columns: minmax(0, 1fr); } }
.bsim-plots, .bsim-ctl { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bsim-chart { width: 100%; min-width: 0; border: 1px solid var(--line-soft, #e1e8ef); border-radius: 6px; background: #fff; overflow: hidden; }
.bsim-chart svg { display: block; max-width: 100%; height: auto; font-family: inherit; }
.bsim-chart canvas { display: block; width: 100%; height: auto; }
.bsim-pt, .bsim-hit { cursor: grab; touch-action: none; }
.bsim-pt:focus-visible { outline: 3px solid var(--navy, #0b1f33); outline-offset: 3px; }
.bsim-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted, #4a5d70); }
.bsim-legend li { display: inline-flex; align-items: center; gap: 6px; }
.bsim-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.bsim-legend i.dash { height: 0; border-top: 3px dashed; background: none; border-radius: 0; }
.bsim-legend i.band { height: 10px; background: rgba(26, 127, 75, .18); border: 1px solid rgba(26, 127, 75, .5); }
.bsim fieldset { border: 1px solid var(--line, #cfdae6); border-radius: 6px; margin: 0; padding: 8px 12px 10px; min-width: 0; }
.bsim legend { font-size: .85rem; font-weight: 700; color: var(--navy, #0b1f33); padding: 0 6px; }
.bsim-row { display: flex; flex-direction: column; gap: 2px; padding: 5px 0; }
.bsim-row label { font-size: .88rem; font-weight: 600; color: var(--navy, #0b1f33); }
.bsim-in { display: flex; align-items: center; gap: 10px; }
.bsim-in input[type=range] { flex: 1 1 auto; min-width: 0; height: 30px; accent-color: var(--accent, #e0731a); }
.bsim-in output { flex: 0 0 auto; min-width: 5.8em; text-align: right; font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; font-weight: 600; color: var(--navy, #0b1f33); }
.bsim input:focus-visible, .bsim button:focus-visible, .bsim summary:focus-visible, .bsim select:focus-visible { outline: 3px solid var(--accent, #e0731a); outline-offset: 2px; }
.bsim-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.bsim 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; }
.bsim button.ghost { background: transparent; color: var(--navy, #0b1f33); }
.bsim details { border: 1px solid var(--line, #cfdae6); border-radius: 6px; padding: 8px 12px; }
.bsim details[open] { display: flex; flex-direction: column; gap: 8px; }
.bsim summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--navy, #0b1f33); padding: 4px 0; }
.bsim-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; }
.bsim-read div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bsim-read div.wide { grid-column: 1 / -1; }
.bsim-read span { font-size: .76rem; color: var(--muted, #4a5d70); }
.bsim-read b { font-size: .95rem; color: var(--navy, #0b1f33); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bsim-zone { padding: 10px 12px; border-radius: 4px; font-size: .92rem; font-weight: 600; line-height: 1.5; border-left: 4px solid; }
.bsim-zone.ok { background: #effaf2; border-color: #1a7f4b; color: #14532d; }
.bsim-zone.warn { background: #fff6e0; border-color: #b7791f; color: #6b4b00; }
.bsim-zone.bad { background: #fdecec; border-color: #b42318; color: #721c24; }
.bsim-note { font-size: .82rem; color: var(--muted, #4a5d70); margin: 0; line-height: 1.5; }
.bsim-tl { display: flex; align-items: center; gap: 12px; }
.bsim-tl .lamp { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line, #cfdae6); background: #b7c3cf; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.3rem; }
.bsim-tl.ok .lamp { background: #1a7f4b; }
.bsim-tl.warn .lamp { background: #b7791f; }
.bsim-tl.bad .lamp { background: #b42318; }
.bsim-tl.worse .lamp { background: #6b0f0f; }
.bsim-tl .tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bsim-tl .tt b { font-size: 1rem; color: var(--navy, #0b1f33); }
.bsim-tl .tt span { font-size: .85rem; color: var(--muted, #4a5d70); line-height: 1.4; }
.bsim-bal { width: 100%; border-collapse: collapse; font-size: .85rem; }
.bsim-bal th, .bsim-bal td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft, #e1e8ef); text-align: right; font-variant-numeric: tabular-nums; }
.bsim-bal th:first-child, .bsim-bal td:first-child { text-align: left; }
.bsim-bal tr.tot td { font-weight: 800; border-top: 2px solid var(--navy, #0b1f33); }
.bsim select { font: inherit; font-size: .9rem; padding: 7px 8px; border: 1px solid var(--line, #cfdae6); border-radius: 4px; background: #fff; color: var(--navy, #0b1f33); max-width: 100%; }
@media (prefers-reduced-motion: reduce) { .bsim * { animation: none !important; transition: none !important; } }
