:root{
  --rcx-blue:#0E3659;
  --rcx-yellow:#D97A1A;
  --rcx-white:rgba(255,255,255,.92);
  --rcx-muted:rgba(255,255,255,.75);
  --rcx-border:rgba(255,255,255,.14);
  --rcx-pre: rgba(90,140,255,.95);
  --rcx-ret: rgba(120,255,200,.75);
  --rcx-warn: rgba(255,110,110,.95);
  --rcx-ok: rgba(120,255,200,.95);
}

.rcx{
  border-radius:18px;
  overflow:hidden;
  background:
    radial-gradient(1200px 700px at 25% 0%, rgba(90,140,255,.18), transparent 60%),
    radial-gradient(1000px 600px at 85% 55%, rgba(120,255,200,.10), transparent 55%),
    var(--rcx-blue);
  color:var(--rcx-white);
  font-family: inherit;
}

.rcx__wrap{ max-width:1220px; margin:0 auto; padding:22px 18px 26px; }

.rcx__head{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:16px; flex-wrap:wrap; margin-bottom:14px;
}

.rcx__tag{
  display:inline-block; font-size:12px; letter-spacing:.22em;
  font-weight:900; color:var(--rcx-yellow); text-transform:uppercase; margin-bottom:8px;
}

.rcx__h2{
  margin:0 0 6px; font-size:clamp(20px,2.2vw,32px);
  letter-spacing:.02em; text-transform:uppercase; transform:skewX(-10deg);
}

.rcx__p{ margin:0; max-width:760px; color:var(--rcx-muted); line-height:1.38; }

.rcx__panel{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.rcx__status{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  border:1px solid var(--rcx-border);
  background:rgba(255,255,255,.06);
  padding:10px 12px; border-radius:14px;
  box-shadow:0 16px 55px rgba(0,0,0,.35);
}

.rcx__dot{ width:10px; height:10px; border-radius:999px; display:inline-block; }
.rcx__dot--warn{ background:var(--rcx-warn); box-shadow:0 0 18px rgba(255,110,110,.35); }
.rcx__dot--ok{ background:var(--rcx-ok); box-shadow:0 0 18px rgba(120,255,200,.28); }

.rcx__pill{
  font-size:12px; padding:3px 9px; border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.24); color:rgba(255,255,255,.82);
  white-space: nowrap;
}
.rcx__pill--dp{ border-color: rgba(217,122,26,.22); }

.rcx__btn{
  border:1px solid rgba(217,122,26,.35);
  background:rgba(217,122,26,.10);
  color:var(--rcx-white);
  border-radius:14px; padding:10px 12px;
  cursor:pointer; font-weight:900; letter-spacing:.02em;
}
.rcx__btn:hover{ background:rgba(217,122,26,.16); }

.rcx__circuit{
  position:relative;
  border-radius:18px;
  border:1px solid var(--rcx-border);
  background:
    radial-gradient(1000px 420px at 25% 0%, rgba(255,255,255,.07), transparent 60%),
    radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size:auto, 10px 10px;
  box-shadow:0 22px 70px rgba(0,0,0,.45);
  overflow:hidden;
  padding:10px;
  min-height: 520px;
}

.rcx__svg{ width:100%; height:auto; display:block; color:rgba(255,255,255,.72); position: relative; z-index: 1; }
.rcx__halo, .rcx__contam, .rcx__hint, .rcxCart{ position:absolute; z-index: 5; }
.rcx__legend{ position:absolute; z-index: 6; }
.rcx__backdrop{ position:absolute; z-index: 20; }
.rcx__drawer{ position:absolute; z-index: 30; }

.rcx__legend{
  left: 14px; bottom: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  border-radius: 14px;
  padding: 10px 12px;
  width: 220px;
  box-shadow: 0 16px 55px rgba(0,0,0,.35);
  color: rgba(255,255,255,.86);
}
.rcx__legendTitle{ font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; margin-bottom: 6px; color: var(--rcx-yellow); }
.rcx__legendRow{ display:flex; gap:8px; align-items:center; font-size: 13px; margin: 4px 0; }
.rcx__legendHint{ margin-top: 6px; opacity: .9; }
.rcx__swatch{ width: 16px; height: 8px; border-radius: 999px; display:inline-block; }
.rcx__swatch--pre{ background: var(--rcx-pre); }
.rcx__swatch--ret{ background: var(--rcx-ret); }

.rcx__svgLabel{ fill:rgba(255,255,255,.78); font-size:16px; }
.rcx__cap{ fill:rgba(255,255,255,.74); font-size:14px; }
.rcx__line{ fill:none; stroke-width:12; stroke-linecap:round; filter:url(#rcxGlow); }
.rcx__thinLine{ stroke-width:7; opacity:.75; }
.rcx__pre{ stroke:var(--rcx-pre); }
.rcx__ret{ stroke:var(--rcx-ret); }
.rcx__sym{ fill:rgba(255,255,255,.05); stroke:rgba(255,255,255,.22); stroke-width:3; }
.rcx__tank{ fill:rgba(255,255,255,.04); stroke:rgba(255,255,255,.20); stroke-width:3; }
.rcx__filter{ fill:rgba(90,140,255,.10); stroke:rgba(90,140,255,.38); stroke-width:3; transition:.25s ease; }
.rcx__filter.rcx__filter--hot{ stroke:rgba(217,122,26,.65); fill:rgba(217,122,26,.10); }
.rcx__thin{ fill:none; stroke:rgba(255,255,255,.55); stroke-width:3; stroke-linecap:round; }
.rcx__thick{ fill:none; stroke:rgba(255,255,255,.40); stroke-width:7; stroke-linecap:round; }
.rcx__thinFill{ fill:rgba(255,255,255,.08); stroke:rgba(255,255,255,.24); stroke-width:3; }
.rcx__fill{ fill:rgba(255,255,255,.65); }

.rcx__plate{ fill: rgba(0,0,0,.28); stroke: rgba(255,255,255,.16); stroke-width: 1; }
.rcx__plateText{ fill: rgba(255,255,255,.88); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.rcx__gaugeText{ fill: rgba(255,255,255,.90); font-size: 12px; font-weight: 900; letter-spacing: .04em; }

.rcx__needle{ stroke: var(--rcx-yellow); stroke-width: 3.2; stroke-linecap: round; }
.rcx__needleHub{ fill: var(--rcx-yellow); }

.rcx__flow{
  fill:none; stroke-linecap:round; stroke-width:6;
  stroke-dasharray:14 12;
  filter:url(#rcxGlow);
  opacity: var(--flowOpacity, .85);
  animation: rcxDash var(--flowSpeed, 1.05s) linear infinite;
}
.rcx__flow--pre{ stroke: rgba(255,255,255,.78); }
.rcx__flow--ret{ stroke: rgba(255,255,255,.58); animation-duration: var(--flowSpeedRet, 1.35s); opacity: var(--flowOpacityRet, .75); }
@keyframes rcxDash{ to{ stroke-dashoffset:-26; } }

.rcx--clogged{ --flowOpacity:.22; --flowOpacityRet:.18; --flowSpeed:2.4s; --flowSpeedRet:3.0s; }
.rcx--stutter .rcx__flow{ animation-play-state: paused; opacity: .10; }
.rcx--stutter .rcx__flow--ret{ opacity: .08; }
.rcx--flush{ --flowOpacity:.95; --flowOpacityRet:.80; --flowSpeed:.55s; --flowSpeedRet:.75s; }
.rcx--clean{ --flowOpacity:.78; --flowOpacityRet:.60; --flowSpeed:1.0s; --flowSpeedRet:1.25s; }

.rcx__halo{
  border-radius:18px;
  border:2px dashed rgba(217,122,26,.55);
  box-shadow:0 0 0 6px rgba(217,122,26,.08);
  opacity:0; transform:scale(1.02);
  transition:opacity .2s ease, transform .2s ease;
  pointer-events:none;
}
.rcx__halo.rcx__halo--show{ opacity:1; }
.rcx__halo.rcx__halo--near{ transform:scale(1.00); border-style:solid; }

.rcx__contam{
  width:160px; height:110px;
  pointer-events:none; opacity:1; transition:opacity .55s ease;
  background:
    radial-gradient(circle at 15% 40%, rgba(255,190,80,.95) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 60%, rgba(255,190,80,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 60% 45%, rgba(255,190,80,.85) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 62%, rgba(255,190,80,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 52% 25%, rgba(255,190,80,.85) 0 2px, transparent 3px),
    radial-gradient(circle at 25% 20%, rgba(255,190,80,.8) 0 2px, transparent 3px);
  animation: rcxFloat 1.3s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes rcxFloat{ from{ transform: translateY(-2px);} to{ transform: translateY(3px);} }

.rcx__hint{
  right:14px; top:14px;
  padding:10px 12px; border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:rgba(255,255,255,.84);
  max-width:270px;
  box-shadow:0 16px 55px rgba(0,0,0,.35);
  transition:.3s ease;
  pointer-events:none;
}
.rcx__hint.rcx__hint--hide{ opacity:0; transform: translateY(-6px); }

.rcxCart{
  left: 18px; top: 92px;
  width: 150px; height: 200px;
  user-select:none; touch-action:none;
  cursor: grab;
  filter: drop-shadow(0 18px 35px rgba(0,0,0,.55));
}
.rcxCart:active{ cursor: grabbing; }
.rcxCart__cap{
  height: 38px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  position: relative;
  overflow: hidden;
}
.rcxCart__cap::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  opacity:.55;
  transform: translateX(-40%);
}
.rcxCart__cap--top{ border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.rcxCart__cap--bot{ border-top-left-radius: 12px; border-top-right-radius: 12px; margin-top: 6px; }
.rcxCart__hole{
  width: 18px; height: 18px; border-radius: 999px;
  position:absolute; left:50%; top:50%;
  transform: translate(-50%,-50%);
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.20);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.06);
}
.rcxCart__bolt{
  width: 10px; height: 10px; border-radius: 3px;
  position:absolute; left: 14px; top: 14px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.18);
}
.rcxCart__pleats{
  height: 118px;
  margin: 6px 8px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(140px 80px at 30% 20%, rgba(255,255,255,.18), transparent 55%),
    radial-gradient(140px 80px at 70% 70%, rgba(0,0,0,.18), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.30) 0 3px, rgba(255,255,255,.10) 3px 8px),
    linear-gradient(90deg, rgba(0,0,0,.20), transparent 30%, transparent 70%, rgba(0,0,0,.24));
}
.rcxCart__ring{
  height: 8px;
  margin: 0 18px 6px;
  border-radius: 999px;
  background: rgba(217,122,26,.22);
  border: 1px solid rgba(217,122,26,.35);
}
.rcxCart__label{
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: left;
}
.rcxCart__label b{ display:block; }
.rcxCart__label small{ display:block; color: rgba(255,255,255,.74); }

.rcx__backdrop{
  inset:0;
  background: rgba(0,0,0,.40);
  opacity:0; pointer-events:none;
  transition: .25s ease;
}
.rcx__backdrop.is-open{ opacity:1; pointer-events:auto; }

.rcx__drawer{
  top: 10px; right: 10px; bottom: 10px;
  width: min(440px, calc(100% - 20px));
  border-radius: 16px;
  border: 1px solid rgba(217,122,26,.22);
  background:
    radial-gradient(700px 300px at 20% 0%, rgba(217,122,26,.10), transparent 60%),
    rgba(19, 43, 64, .92);
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  padding: 14px;
  transform: translateX(110%);
  opacity: 0;
  transition: .35s ease;
  pointer-events:none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rcx__drawer.is-open{
  transform: translateX(0);
  opacity: 1;
  pointer-events:auto;
}
.rcx__drawerTop{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.rcx__drawerTag{ font-size:12px; letter-spacing:.22em; font-weight:900; color: var(--rcx-yellow); text-transform:uppercase; }
.rcx__drawerTitle{ margin:4px 0 2px; font-size:22px; text-transform:uppercase; transform:skewX(-10deg); }
.rcx__drawerSub{ margin:0; color: var(--rcx-muted); }
.rcx__drawerClose{
  border:1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
  color: var(--rcx-white); border-radius:12px; padding:8px 10px; cursor:pointer;
  min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center;
  -webkit-tap-highlight-color: transparent;
}

.rcx__kpis{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
@media (max-width: 980px){
  .rcx__drawer{ left: 10px; width: auto; }
  .rcx__kpis{ grid-template-columns: 1fr; }
  .rcx__legend{ width: 200px; }
}

@media (max-width: 640px){
  .rcx__circuit{ min-height: 440px; }

  .rcxCart{
    width: 110px;
    height: 152px;
    left: 12px;
    top: 78px;
    transform: none;
  }

  .rcxCart__label{ padding: 6px 8px; }
  .rcxCart__label small{ font-size: 11px; }

  .rcx__legend{ width: 190px; }

  .rcx__drawer{
    left: 10px;
    right: 10px;
    width: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE XS (≤ 479px): modo tab — SVG demasiado pequeño, usamos tap
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 479px) {

  .rcx__wrap { padding: 16px 12px 20px; }
  .rcx__head { flex-direction: column; gap: 10px; margin-bottom: 10px; }
  .rcx__h2   { font-size: clamp(15px, 5.5vw, 20px); }


  /* Ocultar descripción larga ("Arrastra el cartucho...") y mostrar texto mobile */
  .rcx__p {
    font-size: 0;  /* Ocultar el texto original */
    margin: 0;
  }
  .rcx__p::before {
    content: "Toca el cartucho para instalar y ver los resultados.";
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,.75);
    line-height: 1.45;
  }

  /* Panel: columna en xs */
  .rcx__panel { flex-direction: column; align-items: stretch; width: 100%; }

  /* Status pills: scroll horizontal suave */
  .rcx__status {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding: 8px 10px;
    scrollbar-width: none;  /* Ocultar scrollbar en Firefox */
  }
  .rcx__status::-webkit-scrollbar { display: none; } /* Chrome/Safari */

  /* Botón reiniciar: ancho completo */
  .rcx__btn { min-height: 44px; padding: 10px 14px; width: 100%; }

  /* Circuito: layout flex vertical + sin overflow clipping (drawer necesita escapar) */
  .rcx__circuit {
    min-height: auto;
    overflow: visible; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 12px 24px;
  }

  /* OCULTAR el SVG — demasiado pequeño para interactuar con dedo */
  .rcx__circuit > .rcx__svg,
  .rcx__halo, .rcx__contam, .rcx__hint, .rcx__legend { display: none !important; }

  /* Cartucho: botón tap centrado con bounce */
  .rcxCart {
    position: relative;
    left: auto;
    top: auto;
    width: 140px;
    height: auto;
    min-height: 200px;
    margin: 8px auto;
    cursor: pointer;
    touch-action: auto;
    animation: rcxBounce 1.8s ease-in-out infinite;
    -webkit-tap-highlight-color: transparent;
  }
  @keyframes rcxBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
  }
  .rcxCart.is-installed {
    animation: none; opacity: 0.4; pointer-events: none;
  }
  .rcxCart__label {
    padding: 10px 12px; text-align: center;
    background: rgba(217,122,26,.18);
    border-color: rgba(217,122,26,.40);
  }
  .rcxCart__label b    { font-size: 14px; }
  .rcxCart__label small{ font-size: 11px; color: rgba(255,255,255,.85); }
  /* Cambiar texto de instruccion a 'toca' */
  .rcxCart__label small { font-size: 0; }
  .rcxCart__label small::before {
    content: "Toca para instalar";
    font-size: 11px;
    display: block;
  }

  /* Backdrop → fixed para cubrir toda la pantalla, no solo el circuito */
  .rcx__backdrop {
    position: fixed;
    inset: 0;
    z-index: 9990;
  }

  /* Drawer → bottom-sheet FIXED (escapa overflow:hidden del circuito) */
  .rcx__drawer {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 85vh;
    z-index: 9991;
    border-radius: 22px 22px 0 0;
    transform: translateY(110%);
    opacity: 0;
    transition: transform .38s cubic-bezier(.32,.72,0,1), opacity .3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  /* Handle visual (drag indicator) */
  .rcx__drawer::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
    margin: 0 auto 16px;
  }
  .rcx__drawer.is-open {
    transform: translateY(0);
    opacity: 1;
  }

  /* KPIs: 1 columna en xs (3 col eran demasiado apretadas en 360px) */
  .rcx__kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .rcx__kpi  { padding: 8px 10px; display: flex; align-items: center; gap: 10px; }
  .rcx__kpi b{ font-size: 20px; min-width: 52px; }
  .rcx__kpi span{ font-size: 12px; line-height: 1.3; }

  .rcx__drawerTitle { font-size: 17px; }
  .rcx__bItem { padding: 8px 10px; font-size: 13px; }

  /* CTA: touch target */
  .rcx__cta { min-height: 52px; font-size: 14px; border-radius: 16px; }
}

.rcx__kpi{ border:1px solid var(--rcx-border); background: rgba(255,255,255,.06); border-radius:14px; padding:10px 12px; }
.rcx__kpi b{ display:block; font-size:18px; color: var(--rcx-yellow); }
.rcx__kpi span{ color: var(--rcx-muted); font-size:13px; }

.rcx__benefitList{ display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.rcx__bItem{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: .35s ease;
  transition-delay: calc(var(--d) * 90ms);
}
.rcx__drawer.is-open .rcx__bItem{ opacity:1; transform: translateY(0); }
.rcx__bItem span{ color: var(--rcx-muted); }

.rcx__cta{
  display:inline-flex; width: 100%;
  align-items:center; justify-content:center;
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(217,122,26,.55);
  background: rgba(217,122,26,.16);
  color: var(--rcx-white);
  font-weight: 900;
  text-decoration:none;
}
.rcx__cta:hover{ background: rgba(217,122,26,.22); }

