/* Simulador "Relé de interfaz" (publicación 119). Prefijo rif- */
.rif { background: var(--card, #fff); color: var(--navy, #0b1f33); border: 1px solid var(--line, #cfdae6); border-radius: 8px; padding: 16px; margin: 26px 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rif * { box-sizing: border-box; }
.rif-head { display: flex; flex-direction: column; gap: 2px; }
.rif-head strong { font-size: 1.1rem; color: var(--navy, #0b1f33); }
.rif-head span { color: var(--muted, #4a5d70); font-size: .92rem; line-height: 1.5; }
.rif-say { border: 1px solid #cfdae6; border-left: 6px solid #2a6fb0; border-radius: 6px; background: #eef5fc; color: #0b1f33; padding: 10px 14px; }
.rif-say.ok { border-left-color: #1a7f4b; background: #effaf2; color: #14532d; }
.rif-say.warn { border-left-color: #b7791f; background: #fff6e0; color: #5a3d00; }
.rif-say.bad { border-left-color: #b42318; background: #fdecec; color: #721c24; }
.rif-say-t { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.rif-say p { margin: 4px 0 8px; font-size: .98rem; line-height: 1.55; font-weight: 600; }
.rif-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rif-chips li { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #fff; border: 1px solid #cfdae6; color: #0b1f33; }
.rif-chips li.ok { background: #dcf5e5; border-color: #1a7f4b; color: #14532d; }
.rif-chips li.warn { background: #fff0cc; border-color: #b7791f; color: #5a3d00; }
.rif-chips li.bad { background: #fbdada; border-color: #b42318; color: #721c24; }
.rif-chips li.iso { background: #f3e9ff; border-color: #7b4bb3; color: #3b1e63; }
.rif-demobar { border: 2px solid #e0731a; border-radius: 6px; background: #fff7ef; color: #0b1f33; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.rif-demobar[hidden] { display: none; }
.rif-demotx { font-size: .95rem; line-height: 1.5; } .rif-demotx b { color: #a14f0b; }
.rif-demobtn, .rif-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.rif button { font: inherit; font-weight: 600; font-size: .9rem; padding: 9px 14px; border-radius: 4px; border: 1px solid #0b1f33; background: #0b1f33; color: #fff; cursor: pointer; min-height: 42px; }
.rif button.ghost { background: #fff; color: #0b1f33; }
.rif button.rif-big { background: #1a7f4b; border-color: #1a7f4b; font-size: 1rem; flex: 1 1 220px; }
.rif button.rif-big.on { background: #b42318; border-color: #b42318; }
.rif button.ghost.on { background: #e0731a; border-color: #e0731a; color: #fff; }
.rif button:disabled { opacity: .45; cursor: not-allowed; }
.rif button:focus-visible, .rif select:focus-visible, .rif input:focus-visible, .rif summary:focus-visible { outline: 3px solid #e0731a; outline-offset: 2px; }
.rif-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .rif-grid { grid-template-columns: minmax(0, 1fr); } }
.rif-main, .rif-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rif-card { border: 1px solid #e1e8ef; border-radius: 6px; background: #fff; padding: 8px; min-width: 0; color: #0b1f33; }
.rif svg { display: block; width: 100%; height: auto; max-width: 100%; font-family: inherit; }
.rif-ct { font-size: .9rem; font-weight: 700; margin: 2px 4px 6px; color: #0b1f33; }
.rif-cs { font-size: .8rem; font-weight: 700; color: #4a5d70; margin: 6px 4px 2px; }
.rif-note { font-size: .82rem; line-height: 1.5; color: #4a5d70; margin: 6px 4px 2px; }
.rif-dis .rif-cs { display: none; }
.rif-w { fill: none; stroke: #7d8fa2; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.rif-w.c.on { stroke: #2a6fb0; stroke-dasharray: 9 7; animation: rifflow .7s linear infinite; }
.rif-w.l.on { stroke: #e0731a; stroke-dasharray: 9 7; animation: rifflow .45s linear infinite; }
.rif-w.nc { stroke: #b6c3cf; stroke-dasharray: 4 6; }
.rif-w.nc.idle { stroke: #7d8fa2; }
@keyframes rifflow { to { stroke-dashoffset: -16; } }
.rif-fx { animation: rifflow 1s linear infinite; }
.rif fieldset { border: 1px solid #cfdae6; border-radius: 6px; margin: 0; padding: 6px 12px 10px; min-width: 0; }
.rif legend { font-size: .85rem; font-weight: 700; padding: 0 6px; color: #0b1f33; }
.rif-row { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; }
.rif-row label { font-size: .86rem; font-weight: 600; color: #0b1f33; }
.rif select { font: inherit; font-size: .9rem; padding: 7px 8px; border: 1px solid #cfdae6; border-radius: 4px; background: #fff; color: #0b1f33; width: 100%; max-width: 100%; min-height: 42px; }
.rif-chk { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; padding: 8px 0 4px; color: #0b1f33; }
.rif-chk input { width: 20px; height: 20px; accent-color: #e0731a; flex: 0 0 auto; }
.rif-adv { border: 1px dashed #9fb0c0; border-radius: 6px; padding: 8px 12px; background: #f8fafc; color: #0b1f33; }
.rif-adv summary { cursor: pointer; font-weight: 700; font-size: .9rem; min-height: 32px; }
.rif-adv button { margin-top: 8px; }
.rif-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; border: 1px solid #cfdae6; border-left: 4px solid #e0731a; border-radius: 4px; padding: 10px 12px; background: #fff7ef; color: #0b1f33; }
.rif-read div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rif-read div.wide { grid-column: 1 / -1; }
.rif-read span { font-size: .74rem; color: #4a5d70; }
.rif-read b { font-size: .9rem; color: #0b1f33; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rif-read b.n { font-weight: 500; font-size: .84rem; line-height: 1.45; }
.rif-model { font-size: .8rem; color: #4a5d70; line-height: 1.5; }
.rif-hl { outline: 4px solid #e0731a; outline-offset: 3px; border-radius: 6px; animation: rifpulse 1.2s ease-in-out infinite; }
@keyframes rifpulse { 50% { outline-color: rgba(224,115,26,.35); } }
@media (prefers-reduced-motion: reduce) { .rif *, .rif-hl { animation: none !important; transition: none !important; } }
@media (max-width: 480px) { .rif { padding: 10px; } .rif button { flex: 1 1 45%; } .rif button.rif-big { flex-basis: 100%; } }
