/* Rediseño 2026-11-30 (rbf-cpfp.html): cabecera animada «la cola del mempool».
   Tu transacción espera bajo el corte del próximo bloque; RBF la sustituye por una versión que paga
   más y CPFP la sube tirando de ella con un hijo. Además: secciones con más profundidad (diagramas
   que se dibujan al entrar, calculadora con área = comisión, tabla, pasos en línea de tiempo). */

/* ── Cabecera ── */
html body .page-hero.rc-hero { grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr); max-width:1240px; }
html body .page-hero.rc-hero::before { right:-2%; top:4%; width:64%; height:94%; background:radial-gradient(closest-side,rgba(247,147,26,.17),transparent 72%), linear-gradient(rgba(255,255,255,.028) 1px,transparent 1px) 0 0/48px 48px, linear-gradient(90deg,rgba(255,255,255,.028) 1px,transparent 1px) 0 0/48px 48px; -webkit-mask-image:radial-gradient(closest-side,#000 40%,transparent); mask-image:radial-gradient(closest-side,#000 40%,transparent); }
html body .page-hero.rc-hero h1 { background:linear-gradient(180deg,#fff 40%,#F7931A 170%); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
html body .page-hero.rc-hero h1 span { -webkit-text-fill-color:#F7931A; }
.rh-sr { position:absolute!important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

.rh-rig { margin:0; border-radius:24px; border:1px solid rgba(255,255,255,.1); background:linear-gradient(160deg,rgba(255,255,255,.06),rgba(255,255,255,.01) 55%),#050505; box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 34px 70px -26px rgba(0,0,0,.95),0 0 70px -22px rgba(247,147,26,.4); overflow:hidden; text-align:left; transition:border-color .5s,box-shadow .5s; }
.rh-rig[data-ph="3"] { border-color:rgba(74,222,128,.45); box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 34px 70px -26px rgba(0,0,0,.95),0 0 80px -16px rgba(74,222,128,.35); }
.rh-bar { display:flex; align-items:center; gap:10px; padding:11px 14px 11px 18px; border-bottom:1px solid rgba(255,255,255,.08); font:500 .74rem/1 'JetBrains Mono',monospace; color:#A1A1A6; }
.rh-led { width:8px; height:8px; border-radius:50%; background:#F7931A; box-shadow:0 0 8px #F7931A; flex:none; animation:rhBlink 1.1s steps(2,jump-none) infinite; }
.rh-rig[data-ph="3"] .rh-led { background:#4ADE80; box-shadow:0 0 8px #4ADE80; animation:none; }
.rh-rig.paused .rh-led { animation:none; opacity:.5; }
@keyframes rhBlink { 50% { opacity:.25; } }
.rh-bar-t { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; letter-spacing:.03em; min-width:0; }
.rh-tabs { margin-left:auto; display:inline-flex; padding:3px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.03); flex:none; }
.rh-tab { appearance:none; border:0; background:transparent; color:#C9C9CE; font:600 .74rem/1 'JetBrains Mono',monospace; letter-spacing:.04em; padding:8px 13px; min-height:30px; border-radius:999px; cursor:pointer; transition:background .3s,color .3s; }
.rh-tab:hover { color:#fff; }
.rh-tab[aria-pressed="true"] { background:#F7931A; color:#000; }
.rh-play { appearance:none; flex:none; width:32px; height:32px; display:grid; place-items:center; border-radius:50%; border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.03); color:#D0D0D3; cursor:pointer; transition:border-color .3s; }
.rh-play:hover { border-color:#F7931A; }
.rh-play svg path { fill:currentColor; }
.rh-play .i-pl, .rh-rig.paused .rh-play .i-pa { display:none; }
.rh-rig.paused .rh-play .i-pl { display:inline; }
.rh-rig.rh-still .rh-play { display:none; }
.rh-tab:focus-visible, .rh-play:focus-visible { outline:2px solid #F7931A; outline-offset:2px; }

.rh-stage { padding:8px 12px 2px; }
.rh-svg { display:block; width:100%; height:auto; overflow:visible; }
.rh-svg text { font-family:'JetBrains Mono',monospace; font-size:12px; }
.rh-svg .ax { fill:#A1A1A6; font-size:11px; }
.rh-svg .grid path { stroke:rgba(255,255,255,.06); stroke-width:1; }
.rh-svg .tick text { fill:#8E8E94; text-anchor:end; }
.rh-svg .blk .frame { fill:url(#rhBlk); stroke:rgba(247,147,26,.5); stroke-width:1.5; stroke-dasharray:7 5; transition:stroke .5s,stroke-dasharray .5s; }
.rh-svg .blk .lbl { fill:#F5C58A; font-family:'Archivo',sans-serif; font-size:13px; font-weight:700; }
.rh-svg .blk .cap { fill:#A1A1A6; font-size:11px; text-anchor:end; transition:opacity .4s; }
.rh-svg .blk .txs rect { fill:rgba(247,147,26,.36); }
.rh-svg .blk .slot { fill:none; stroke:rgba(247,147,26,.5); stroke-width:1.2; stroke-dasharray:4 4; opacity:0; transition:opacity .4s; }
.rh-svg .blk .ok { opacity:0; transform:translateY(-6px); transition:opacity .45s .5s,transform .6s .5s cubic-bezier(.2,1.4,.4,1); }
.rh-svg .blk .ok rect { fill:#4ADE80; }
.rh-svg .blk .ok text { fill:#000; font-family:'Archivo',sans-serif; font-size:12px; font-weight:700; text-anchor:middle; }
.rh-svg .cut { stroke:#F7931A; stroke-width:2; stroke-dasharray:6 5; }
.rh-svg .cut-t { fill:#F7931A; font-weight:600; text-anchor:end; }
.rh-svg .pool rect { fill:rgba(255,255,255,.1); animation:rhPool 3.2s ease-in-out infinite; }
.rh-svg .pool rect:nth-child(2n) { animation-delay:-1.1s; } .rh-svg .pool rect:nth-child(3n) { animation-delay:-2.2s; }
@keyframes rhPool { 50% { fill:rgba(255,255,255,.16); } }

/* Tu transacción y sus piezas */
.rh-svg .mover { transition:transform 1.25s cubic-bezier(.55,0,.2,1); }
.rh-svg .me { animation:rhBob 2.2s ease-in-out infinite; }
@keyframes rhBob { 50% { transform:translateY(3px); } }
.rh-svg .me rect { fill:rgba(247,147,26,.12); stroke:#F7931A; stroke-width:1.5; transition:fill .5s; }
.rh-svg .me text { fill:#F7931A; font-weight:600; text-anchor:middle; transition:opacity .35s; }
.rh-svg .me .t1 { opacity:0; }
.rh-svg .me-t { fill:#D0D0D3; font-family:'Archivo',sans-serif; font-size:12.5px; font-weight:700; text-anchor:end; transition:opacity .4s; }
.rh-svg .ghost { opacity:0; transition:opacity .5s,transform .7s cubic-bezier(.3,0,.2,1); }
.rh-svg .ghost rect { fill:#0d0d0d; stroke:rgba(255,255,255,.3); stroke-width:1.2; }
.rh-svg .ghost text { fill:#A1A1A6; text-anchor:middle; }
.rh-svg .ghost .x { stroke:#F87171; stroke-width:2; stroke-dasharray:80; stroke-dashoffset:80; transition:stroke-dashoffset .5s .35s; }
.rh-svg .kid, .rh-svg .pack, .rh-svg .tag, .rh-svg .pack-t { opacity:0; transition:opacity .45s; }
.rh-svg .kid rect { fill:#F7931A; filter:url(#rhGlow); }
.rh-svg .kid text { fill:#000; font-weight:700; text-anchor:middle; }
.rh-svg .kid .lnk { stroke:#F7931A; stroke-width:2; }
.rh-svg .pack { fill:rgba(247,147,26,.05); stroke:#F7931A; stroke-width:1.3; stroke-dasharray:5 4; }
.rh-svg .tag { fill:#C9C9CE; font-family:'Archivo',sans-serif; font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.rh-svg .pack-t { fill:#F5C58A; font-size:11.5px; text-anchor:middle; }
.rh-svg .trail { stroke:url(#rhRise); stroke-width:10; stroke-linecap:round; opacity:0; stroke-dasharray:120; stroke-dashoffset:120; }

/* Fase 1: reemplazo (RBF) o hijo (CPFP) */
.rh-rig:not([data-ph="0"]) .rh-svg .me { animation:none; }
.rh-rig[data-mode="rbf"]:not([data-ph="0"]) .rh-svg .me rect { fill:#F7931A; filter:url(#rhGlow); }
.rh-rig[data-mode="rbf"]:not([data-ph="0"]) .rh-svg .me text { fill:#000; }
.rh-rig[data-mode="rbf"]:not([data-ph="0"]) .rh-svg .me .t0 { opacity:0; }
.rh-rig[data-mode="rbf"]:not([data-ph="0"]) .rh-svg .me .t1 { opacity:1; }
.rh-rig[data-mode="rbf"][data-ph="1"] .rh-svg .ghost { opacity:.75; transform:translateY(30px); }
.rh-rig[data-mode="rbf"][data-ph="1"] .rh-svg .ghost .x,
.rh-rig[data-mode="rbf"][data-ph="2"] .rh-svg .ghost .x { stroke-dashoffset:0; }
.rh-rig[data-mode="rbf"][data-ph="2"] .rh-svg .ghost { opacity:0; transform:translateY(38px); }
.rh-rig[data-mode="cpfp"]:not([data-ph="0"]) .rh-svg .kid { opacity:1; }
.rh-rig[data-mode="cpfp"][data-ph="1"] .rh-svg .pack,
.rh-rig[data-mode="cpfp"][data-ph="2"] .rh-svg .pack,
.rh-rig[data-mode="cpfp"][data-ph="1"] .rh-svg .tag,
.rh-rig[data-mode="cpfp"][data-ph="1"] .rh-svg .pack-t { opacity:1; }
.rh-rig[data-ph="1"] .rh-svg .blk .slot, .rh-rig[data-ph="2"] .rh-svg .blk .slot { opacity:1; }
/* Fase 2: sube al bloque · fase 3: confirmada */
.rh-rig[data-ph="2"] .rh-svg .mover, .rh-rig[data-ph="3"] .rh-svg .mover { transform:translateY(-162px); }
.rh-rig[data-ph="2"] .rh-svg .me-t, .rh-rig[data-ph="3"] .rh-svg .me-t { opacity:0; }
.rh-rig[data-ph="2"] .rh-svg .trail { opacity:1; stroke-dashoffset:0; transition:stroke-dashoffset 1.1s ease-out,opacity .3s; }
.rh-rig[data-ph="3"] .rh-svg .trail { opacity:0; transition:opacity .6s; }
.rh-rig[data-ph="3"] .rh-svg .blk .frame { stroke:#4ADE80; stroke-dasharray:none; }
.rh-rig[data-ph="3"] .rh-svg .blk .cap { opacity:0; }
.rh-rig[data-ph="3"] .rh-svg .blk .ok { opacity:1; transform:none; }
.rh-rig.rh-reset *, .rh-rig.rh-reset .rh-svg * { transition:none!important; }

/* Lecturas */
.rh-read { margin:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-top:1px solid rgba(255,255,255,.08); }
.rh-read > div { padding:12px 16px; min-width:0; border-right:1px solid rgba(255,255,255,.07); }
.rh-read > div:last-child { border-right:0; }
.rh-read dt { font-size:.7rem; letter-spacing:.06em; text-transform:uppercase; color:#A1A1A6; margin-bottom:5px; white-space:nowrap; }
.rh-read dd { margin:0; font:600 .95rem/1.3 'JetBrains Mono',monospace; color:#F5F5F7; font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rh-read dd#rhRate { color:#F7931A; }
.rh-state { font-family:'Archivo',sans-serif!important; }
.rh-rig[data-ph="3"] .rh-state { color:#4ADE80; }
.rh-note { margin:0; padding:12px 18px 15px; border-top:1px solid rgba(255,255,255,.08); font-size:.8rem; line-height:1.55; color:#A1A1A6; }

/* ── Secciones con más profundidad ── */
@media (hover:hover) { html body .hal.rc-main .hal-block { transition:border-color .35s,box-shadow .35s; } html body .hal.rc-main .hal-block:hover { border-color:rgba(247,147,26,.28); box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 22px 44px -16px rgba(0,0,0,.95),0 0 32px -10px rgba(247,147,26,.22); } }

/* Diagramas RBF/CPFP: se dibujan al entrar en pantalla */
.rc-fig { position:relative; overflow:hidden; transition:border-color .35s,transform .35s; }
.rc-fig::before { content:''; position:absolute; inset:-1px -1px auto; height:2px; background:linear-gradient(90deg,transparent,#F7931A,transparent); opacity:.6; }
@media (hover:hover) { .rc-fig:hover { border-color:rgba(247,147,26,.35); transform:translateY(-2px); } }
.rc-dia .d-x { stroke-dasharray:180; stroke-dashoffset:180; }
.rc-dia .d-ln:not(.dim) { stroke-dasharray:6 6; }
.visible .rc-dia .d-x { stroke-dashoffset:0; transition:stroke-dashoffset .9s .5s ease-out; }
.visible .rc-dia .d-ln:not(.dim) { animation:rcFlow 1.2s linear infinite; }
.visible .rc-dia .d-new rect { animation:rcGlow 2.6s ease-in-out infinite; }
@keyframes rcFlow { to { stroke-dashoffset:-12; } }
@keyframes rcGlow { 50% { fill:rgba(247,147,26,.18); } }

/* Fórmula */
html body .rc-main .rc-formula { border-color:rgba(247,147,26,.4); background:linear-gradient(90deg,rgba(247,147,26,.12),rgba(247,147,26,.03)); box-shadow:inset 3px 0 0 #F7931A; }

/* Pasos como línea de tiempo */
html body .rc-main .rc-steps { position:relative; gap:12px; }
html body .rc-main .rc-steps::before { content:''; position:absolute; left:26px; top:22px; bottom:22px; width:2px; background:linear-gradient(#F7931A,rgba(247,147,26,.08)); }
html body .rc-main .rc-steps li { background:linear-gradient(160deg,rgba(255,255,255,.04),rgba(255,255,255,0) 60%),#080808; transition:border-color .3s,transform .3s; }
html body .rc-main .rc-steps li::before { z-index:1; background:radial-gradient(circle at 35% 30%,#FFB347,#F7931A 55%,#B86400); color:#000; box-shadow:0 0 0 4px #080808,0 0 16px -2px rgba(247,147,26,.7); }
@media (hover:hover) { html body .rc-main .rc-steps li:hover { border-color:rgba(247,147,26,.35); transform:translateX(3px); } }

/* Calculadora */
html body .rc-main .rc-calc { border-color:rgba(247,147,26,.25); background:radial-gradient(120% 120% at 100% 0%,rgba(247,147,26,.09),transparent 55%),#070707; box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 24px 50px -30px rgba(0,0,0,.9); }
html body .rc-main .rc-f input { background:#0d0d0d; border-color:rgba(255,255,255,.14); transition:border-color .25s,box-shadow .25s; }
html body .rc-main .rc-f input:focus { box-shadow:0 0 0 3px rgba(247,147,26,.2); }
html body .rc-main .rc-f span { color:#A1A1A6; }
.rc-viz { margin:0 0 12px; padding:16px 16px 12px; border:1px solid rgba(255,255,255,.09); border-radius:16px; background:linear-gradient(160deg,rgba(255,255,255,.04),rgba(255,255,255,0) 60%),#060606; }
.rc-viz[hidden] { display:none; }
.rc-viz-svg { display:block; width:100%; height:auto; }
.rc-viz-svg text { font-family:'JetBrains Mono',monospace; font-size:12px; text-anchor:middle; fill:#C9C9CE; }
.rc-viz-svg .v-base { stroke:rgba(255,255,255,.25); }
.rc-viz-svg .v-par { fill:rgba(255,255,255,.16); stroke:rgba(255,255,255,.4); }
.rc-viz-svg .v-kid { fill:#F7931A; fill-opacity:.85; }
.rc-viz-svg .v-gap { fill:rgba(247,147,26,.08); }
.rc-viz-svg .v-tg { stroke:#F5F5F7; stroke-width:1.5; stroke-dasharray:6 5; }
.rc-viz-svg .v-tgt { text-anchor:start; fill:#F5F5F7; font-family:'Archivo',sans-serif; font-weight:600; }
.rc-viz-svg .v-r { font-weight:600; fill:#E0E0E3; } .rc-viz-svg .v-r.o, .rc-viz-svg .v-f.o { fill:#F7931A; }
.rc-viz-svg .v-n { fill:#A1A1A6; font-family:'Archivo',sans-serif; }
.rc-viz-svg .v-f { font-weight:600; fill:#E0E0E3; }
.rc-viz figcaption { margin-top:8px; font-size:.82rem; line-height:1.5; color:#A1A1A6; }

/* Tabla comparativa */
html body .rc-main .rc-cmp { border-collapse:separate; border-spacing:0; }
html body .rc-main .rc-cmp thead th:not(:first-child) { color:#F7931A; font:600 .85rem/1 'JetBrains Mono',monospace; letter-spacing:.06em; border-bottom:2px solid #F7931A; }
html body .rc-main .rc-cmp tbody tr { transition:background .25s; }
html body .rc-main .rc-cmp tbody tr:hover { background:rgba(247,147,26,.05); }
html body .rc-main .rc-cmp td { color:#C9C9CE; }

/* Wallets */
html body .rc-main .rc-w { transition:border-color .3s,transform .3s; }
@media (hover:hover) { html body .rc-main .rc-w:hover { border-color:rgba(247,147,26,.4); transform:translateY(-2px); } }

/* Errores comunes: marca roja en vez del punto */
html body .rc-main .rc-err li::before { content:'✕'; width:auto; height:auto; top:.12em; left:0; background:none; color:#F87171; font:700 .85rem/1.7 'JetBrains Mono',monospace; }

@media (max-width:900px) {
  html body .page-hero.rc-hero { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:600px) {
  .rh-bar { padding:9px 10px 9px 14px; gap:8px; }
  .rh-bar-t { display:none; }
  .rh-stage { padding:6px 4px 0; }
  .rh-svg text, .rh-svg .cut-t { font-size:13px; }
  .rh-svg .blk .lbl { font-size:14px; }
  .rh-svg .tag { font-size:11px; }
  .rh-svg .pack-t { font-size:12px; }
  .rh-read { grid-template-columns:1fr 1fr; }
  .rh-read > div { padding:10px 14px; }
  .rh-read > div:nth-child(2) { border-right:0; }
  .rh-read > div:last-child { grid-column:1/-1; border-top:1px solid rgba(255,255,255,.07); }
  .rh-note { padding:11px 14px 14px; }
  html body .rc-main .rc-steps::before { left:24px; }
  .rc-viz { padding:12px 8px 10px; }
}
@media (prefers-reduced-motion:reduce) {
  .rh-led, .rh-svg .pool rect, .rh-svg .me, .visible .rc-dia .d-ln:not(.dim), .visible .rc-dia .d-new rect { animation:none!important; }
  .rh-rig, .rh-rig *, .rh-svg *, .rc-fig, .visible .rc-dia .d-x, html body .rc-main .rc-steps li, html body .rc-main .rc-w, html body .hal.rc-main .hal-block { transition:none!important; }
  .rc-fig:hover, html body .rc-main .rc-steps li:hover, html body .rc-main .rc-w:hover { transform:none; }
}
