/* Simulador "Arranque con paro de emergencia y relé de seguridad" (Ejemplo 18, publicación 154). Prefijo ej18- */
.ej18 { background: #ffffff; color: #0b1f33; border: 1px solid #cfdae6; border-radius: 8px; padding: 16px; margin: 26px 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ej18 * { box-sizing: border-box; }
.ej18-head { display: flex; flex-direction: column; gap: 2px; }
.ej18-head strong { font-size: 1.1rem; color: #0b1f33; }
.ej18-head span { color: #4a5d70; font-size: .92rem; line-height: 1.5; }
.ej18 button { font: inherit; font-weight: 600; font-size: .9rem; padding: 9px 12px; border-radius: 4px; border: 1px solid #0b1f33; background: #0b1f33; color: #ffffff; cursor: pointer; min-height: 42px; line-height: 1.25; touch-action: manipulation; }
.ej18 button.ghost { background: #ffffff; color: #0b1f33; }
.ej18 button:disabled { opacity: .45; cursor: not-allowed; }
.ej18 [hidden] { display: none !important; }
.ej18 button:focus-visible, .ej18 input:focus-visible, .ej18 select:focus-visible, .ej18 summary:focus-visible { outline: 3px solid #e0731a; outline-offset: 2px; }
.ej18-now { border: 1px solid #cfdae6; border-left: 5px solid #e0731a; border-radius: 4px; background: #fff7ef; color: #0b1f33; padding: 10px 14px; }
.ej18-ct { font-size: .78rem; font-weight: 700; color: #7a3d08; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ej18-now-main { margin: 0; font-size: 1rem; line-height: 1.55; font-weight: 600; color: #0b1f33; min-height: 4.7em; }
.ej18-now-last { margin: 6px 0 0; font-size: .84rem; color: #4a5d70; min-height: 1.2em; }
.ej18-demo { display: flex; flex-direction: column; gap: 8px; }
.ej18-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ej18 .ej18-demo-b, .ej18 .ej18-next { background: #1a7f4b; border-color: #1a7f4b; color: #ffffff; }
.ej18 .ej18-go { background: #1a7f4b; border-color: #1a7f4b; }
.ej18 .ej18-stop { background: #c0392b; border-color: #c0392b; }
.ej18-demostep { margin: 0; padding: 10px 14px; border-radius: 4px; background: #eaf3fc; border-left: 5px solid #2a6fb0; color: #0b1f33; font-size: .95rem; line-height: 1.55; }
.ej18-hl { outline: 4px solid #e0731a; outline-offset: 3px; border-radius: 4px; animation: ej18-pulse 1.1s ease-in-out infinite; }
@keyframes ej18-pulse { 50% { outline-color: #f6c28b; } }
@media (prefers-reduced-motion: reduce) { .ej18-hl { animation: none; } }
.ej18-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ej18-tabs button { background: #eef2f6; color: #0b1f33; border-color: #cfdae6; font-size: .86rem; }
.ej18-tabs button[aria-pressed="true"] { background: #0b1f33; color: #ffffff; border-color: #0b1f33; }
.ej18-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 16px; align-items: start; }
@media (max-width: 1400px) { .ej18-grid { grid-template-columns: minmax(0, 1fr); } }
.ej18-left, .ej18-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ej18-grp { border: 1px solid #cfdae6; border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; background: #ffffff; }
.ej18-gt { font-size: .86rem; font-weight: 700; color: #0b1f33; }
.ej18-hint { margin: 0; font-size: .84rem; color: #4a5d70; line-height: 1.45; }
.ej18 select { font: inherit; font-size: .92rem; padding: 8px; border: 1px solid #9fb4c8; border-radius: 4px; background: #ffffff; color: #0b1f33; width: 100%; min-height: 42px; }
.ej18-adv { border: 1px solid #cfdae6; border-radius: 6px; padding: 8px 12px; background: #ffffff; }
.ej18-adv summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: #0b1f33; padding: 4px 0; }
.ej18-advb { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.ej18-chk, .ej18-rng { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: #0b1f33; }
.ej18-chk { flex-direction: row; align-items: center; gap: 6px; }
.ej18-rng input { width: 100%; }
.ej18-svg { display: block; width: 100%; height: auto; max-width: 100%; border: 1px solid #cfdae6; border-radius: 6px; background: #ffffff; }
.ej18-pile { font-size: .84rem; color: #4a5d70; }
.ej18 .ej18-seta { background: #c0392b; border-color: #7a1f16; color: #ffffff; border-radius: 22px; font-weight: 700; }
.ej18 .ej18-seta[aria-pressed="true"] { background: #7a1f16; box-shadow: inset 0 0 0 3px #ffd0cb; }
.ej18-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ej18-kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ej18-kpi div { border: 1px solid #cfdae6; border-radius: 6px; padding: 6px 8px; background: #f7fafc; font-size: .8rem; color: #4a5d70; line-height: 1.35; }
.ej18-kpi b { display: block; font-size: 1rem; color: #0b1f33; }
@media (max-width: 480px) { .ej18 { padding: 12px; } .ej18-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
