/* ═════════ 4 · CONEXIONES ═════════
   Una pieza memorable: el celular y Tally en espejo, con los mismos mensajes cayendo en los dos.
   Todo lo demás se queda quieto. El HTML trae el estado final; el JS sólo lo reproduce. */
.cx{padding:clamp(96px,11vw,150px) 0 clamp(72px,8vw,120px);position:relative}
.cx-cab .h2{max-width:none;font-size:clamp(34px,5vw,70px)}
.cx-cab .sec-p{max-width:56ch}
.cx-fuera{margin-top:clamp(40px,5vw,64px)}

/* ── lienzo oscuro ── */
.cx-lienzo{--lab:34px;position:relative;isolation:isolate;border-radius:32px;padding:clamp(20px,3.4vw,44px);color:#fff;overflow:hidden;
  background:radial-gradient(55% 70% at 100% 0%,rgba(166,82,255,.38),transparent 70%),radial-gradient(60% 70% at 0% 100%,rgba(22,112,249,.42),transparent 70%),linear-gradient(160deg,#0E0577,#090055 55%);
  box-shadow:0 50px 90px -40px rgba(9,0,85,.55)}
.cx-fondo{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
.cx-fondo img{position:absolute;right:-6%;bottom:-24%;width:min(820px,80%);opacity:.05;transform:rotate(-8deg)}
.cx-ejemplo{position:absolute;top:18px;right:20px;z-index:3;font:600 12px/1 'Albert Sans';padding:6px 10px;border-radius:8px;background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.16)}
.cx-escena{position:relative;display:grid;grid-template-columns:250px minmax(120px,1fr) minmax(0,730px);justify-content:center;align-items:stretch}
.cx-mundo{display:flex;flex-direction:column;min-width:0}
.cx-rotulo{height:var(--lab);display:flex;align-items:center;font:600 13.5px/1 'Albert Sans';color:rgba(255,255,255,.72);margin:0}
.cx-m-tally .cx-rotulo{padding-left:2px}

/* ── celular ── */
.cx-cel{position:relative;width:250px;height:520px;border-radius:42px;background:#0E0B3D;padding:10px;display:flex;flex-direction:column;z-index:2;
  box-shadow:0 40px 70px -28px rgba(0,0,0,.6),inset 0 0 0 2px #2A2560,0 0 0 1px rgba(255,255,255,.08)}
.cx-isla{position:absolute;left:50%;top:18px;width:74px;height:20px;margin-left:-37px;border-radius:12px;background:#000;z-index:3}
.cx-cel-cab{display:flex;align-items:center;gap:9px;padding:40px 14px 10px;background:#F4F1EC;border-radius:33px 33px 0 0;border-bottom:1px solid #E6E1D8;color:#0E0B3D}
.cx-cel-cab img{width:32px;height:32px;border-radius:50%}
.cx-cel-cab b{display:block;font-size:13.5px}
.cx-cel-cab small{display:block;font-size:11px;color:#5E6E62}
.cx-cel-msgs{flex:1;background:#ECE5DD;padding:12px 10px;display:flex;flex-direction:column;justify-content:flex-end;gap:6px;overflow:hidden;min-height:0}
.cx-cb{max-width:84%;font-size:12.5px;line-height:1.35;padding:7px 10px;border-radius:12px;box-shadow:0 1px 1px rgba(0,0,0,.08);color:#0E0B3D;flex:none}
.cx-cb-ent{align-self:flex-start;background:#fff;border-top-left-radius:4px}
.cx-cb-sal{align-self:flex-end;background:#D9FDD3;border-top-right-radius:4px;display:flex;align-items:flex-end;gap:5px}
.cx-cb-sal i .i{width:14px;height:14px;color:#2F8FBF}
.cx-cel-caja{display:flex;align-items:center;gap:6px;background:#ECE5DD;padding:8px 8px 14px;border-radius:0 0 33px 33px}
.cx-cel-caja>span{flex:1;min-width:0;background:#fff;border-radius:18px;padding:8px 12px;font-size:12.5px;min-height:34px;white-space:nowrap;overflow:hidden;display:flex;align-items:center;color:#0E0B3D}
.cx-cel-caja em{font-style:normal}
.cx-cel-caja em:empty::before{content:"Mensaje";color:#5F6F63}
.cx-cursor{width:1.5px;height:16px;background:#00A884;margin-left:1px;flex:none;opacity:0}
.cx-cel-caja b{margin-left:auto;width:34px;height:34px;border-radius:50%;background:#00A884;color:#fff;display:grid;place-items:center;flex:none}
.cx-cel-caja b .i{width:16px;height:16px}

/* ── puente ── */
.cx-puente{padding-top:var(--lab);display:flex;min-width:0}
.cx-puente-in{position:relative;flex:1;height:520px}
.cx-cable{position:absolute;left:-14px;right:-14px;top:50%;height:2px;margin-top:-1px;border-radius:2px;z-index:0;
  background:repeating-linear-gradient(90deg,rgba(255,255,255,.5) 0 6px,transparent 6px 14px);background-size:14px 2px;opacity:.7}
.cx-hub{position:absolute;left:50%;top:50%;width:68px;height:68px;margin:-34px 0 0 -34px;z-index:2;display:grid;place-items:center}
.cx-hub-nucleo{position:relative;width:68px;height:68px;border-radius:50%;background:#fff;color:var(--wa);display:grid;place-items:center;box-shadow:0 0 0 6px rgba(255,255,255,.12),0 18px 40px -10px rgba(22,112,249,.7)}
.cx-hub-nucleo svg{width:36px;height:36px}
.cx-onda{position:absolute;inset:0;border-radius:50%;border:2px solid rgba(255,255,255,.55);opacity:0}
.cx-hub-txt{position:absolute;left:0;right:0;top:calc(50% + 46px);text-align:center;font:600 12px/1.25 'Albert Sans';color:rgba(255,255,255,.7)}
.cx-bola{position:absolute;left:0;top:0;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 0 0 4px rgba(22,112,249,.45),0 0 18px 4px rgba(141,180,255,.9);opacity:0;z-index:5;pointer-events:none}
.cx-vivo .cx-cable{animation:cx-marcha 1.1s linear infinite}
.cx-vivo .cx-onda{animation:cx-onda 3s var(--curva) infinite}
.cx-vivo .cx-onda2{animation-delay:1.5s}
.cx-vivo .cx-cursor{animation:parpadea 1s steps(1) infinite}
@keyframes cx-marcha{to{background-position:14px 0}}
@keyframes cx-onda{0%{transform:scale(1);opacity:.6}100%{transform:scale(2.4);opacity:0}}

/* ── ventana de Tally ── */
.cx-win{height:520px;background:#fff;border-radius:20px;box-shadow:var(--sombra-flota),0 0 0 1px rgba(255,255,255,.1);overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);color:var(--texto);position:relative;z-index:2}
.cx-win-cab{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:11px 14px;border-bottom:1px solid var(--linea);background:#fff}
.cx-win-cab>img{border-radius:8px}
.cx-win-cab>b{font:700 16px Gabarito,sans-serif;letter-spacing:-.01em;color:var(--tinta)}
.cx-nums{display:flex;flex-wrap:wrap;gap:6px;margin-left:auto}
.cx-num{display:inline-flex;align-items:center;gap:6px;font:600 12px/1 'Albert Sans';color:var(--texto-2);padding:6px 9px;border-radius:20px;background:var(--gris);box-shadow:inset 0 0 0 1px var(--linea);white-space:nowrap}
.cx-g{width:14px;height:14px;flex:none}
.cx-g-wa{color:#1FA855}.cx-g-ig{color:#D62976}.cx-g-ms{color:#0866FF}
.cx-win-cuerpo{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:0}
.cx-lista{border-right:1px solid var(--linea);padding:6px;display:flex;flex-direction:column;overflow:hidden;min-height:0}
.cx-fila{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:0 10px;padding:9px;border-radius:12px;align-items:start;flex:none}
.cx-fila-on{background:var(--gris)}
.cx-av{border-radius:11px;flex:none}
.cx-fila .cx-av{grid-row:span 3}
.cx-fila h4{font:600 13.5px 'Albert Sans';white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cx-fila time{font-size:11px;color:var(--texto-3);justify-self:end;font-variant-numeric:tabular-nums}
.cx-fila p{grid-column:2/4;color:var(--texto-2);font-size:12.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cx-via{grid-column:2/4;display:flex;align-items:center;gap:5px;margin-top:3px;font:600 11px/1.2 'Albert Sans';color:var(--texto-3);white-space:nowrap;overflow:hidden}
.cx-punto{margin-left:auto;width:9px;height:9px;border-radius:50%;background:var(--azul);flex:none;opacity:0}
.cx-hilo{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative;background:linear-gradient(180deg,#fff,#F9FAFD)}
.cx-hilo-cab{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--linea);background:#fff}
.cx-hilo-cab>div{min-width:0}
.cx-hilo-cab h4{font:600 14.5px 'Albert Sans';white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cx-hilo-cab small{display:flex;align-items:center;gap:5px;color:var(--texto-3);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cx-msgs{flex:1;min-height:0;padding:10px 14px;display:flex;flex-direction:column;justify-content:flex-end;gap:5px;overflow:hidden}
.cx-msgs>*{flex:none}
.cx-msgs .dia{margin:0}
.cx-msgs .b{max-width:84%}
.cx-desde{display:inline-flex;align-items:center;gap:3px;font-weight:600;color:#c9d6ff;background:rgba(255,255,255,.14);padding:2px 6px;border-radius:6px;margin-right:2px}
.cx-desde .i{width:11px;height:11px;color:currentColor}
.cx-hilo-pie{display:flex;align-items:center;gap:8px;padding:10px 14px 12px;border-top:1px solid var(--linea);background:#fff;position:relative;min-height:50px}
.cx-ia{margin-left:auto}
.cx-hist-carga{position:absolute;left:14px;right:112px;top:50%;transform:translateY(-50%);display:none;flex-direction:column;gap:5px;font:600 11.5px/1 'Albert Sans';color:var(--texto-2)}
.cx-barra{display:block;height:5px;border-radius:5px;background:var(--azul-p);overflow:hidden}
.cx-barra i{display:block;height:100%;background:var(--azul);border-radius:5px;transform-origin:0 50%}
.cx-toast{position:absolute;left:12px;right:12px;top:58px;z-index:4;display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:12px;background:var(--tinta);color:#fff;font-size:12.5px;line-height:1.35;box-shadow:var(--sombra-flota);opacity:0;visibility:hidden}
.cx-toast b{color:#fff}
.cx-toast img{border-radius:8px;flex:none}

/* ── hechos ── */
.cx-hechos{margin-top:clamp(28px,3.4vw,44px);padding-top:clamp(22px,2.6vw,32px);border-top:1px solid rgba(255,255,255,.14);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px clamp(24px,3vw,48px)}
.cx-hechos li{display:grid;grid-template-columns:44px minmax(0,1fr);gap:14px;align-items:start;font-size:14.5px;line-height:1.5;color:rgba(255,255,255,.74)}
.cx-hechos b{display:block;font:700 18px/1.2 Gabarito,sans-serif;letter-spacing:-.01em;color:#fff;margin-bottom:4px}
.cx-hecho-i{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;background:rgba(255,255,255,.1);box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);color:#fff}
.cx-hecho-i .i{width:22px;height:22px}
.cx-aviso{margin-top:22px;font-size:12px;color:rgba(255,255,255,.5);text-align:right}

/* ── formas de conectar ── */
.cx-formas{margin-top:clamp(56px,6vw,88px)}
.cx-formas-cab{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:6px 24px;margin-bottom:22px}
.cx-formas-cab h3{font:700 clamp(26px,2.6vw,36px)/1.1 Gabarito,sans-serif;letter-spacing:-.02em;color:var(--tinta)}
.cx-formas-cab p{color:var(--texto-2);font-size:16px}
.cx-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.cx-card{position:relative;display:flex;flex-direction:column;gap:10px;background:#fff;border-radius:22px;padding:24px 24px 26px;box-shadow:0 0 0 1px var(--linea),0 18px 40px -30px rgba(9,0,85,.3)}
.cx-card h4{font:700 21px/1.15 Gabarito,sans-serif;letter-spacing:-.015em;color:var(--tinta);margin-top:6px}
.cx-card p{font-size:15px;line-height:1.5;color:var(--texto-2);max-width:56ch}
.cx-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:48px}
.cx-logo{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;color:#fff;flex:none}
.cx-logo svg{width:26px;height:26px}
.cx-l-wa{background:#25D366}
.cx-l-ig{background:radial-gradient(circle at 30% 107%,#FEDA75 0,#FA7E1E 28%,#D62976 55%,#962FBF 78%,#4F5BD5 100%)}
.cx-l-ms{background:linear-gradient(135deg,#00B2FF,#006AFF 60%,#A033FF)}
.cx-l-qr{background:var(--tinta)}
.cx-tag{font:600 12px/1 'Albert Sans';padding:7px 10px;border-radius:8px;white-space:nowrap}
.cx-tag-ver{background:var(--verde-p);color:#1F6F2E}
.cx-tag-az{background:var(--azul-p);color:#1257C8}
.cx-tag-oro{background:var(--dorado-p);color:#8A4F05}
.cx-card-rec{grid-column:span 2;padding:28px 30px 30px;box-shadow:0 0 0 2px transparent,0 30px 60px -34px rgba(22,112,249,.55);
  background:linear-gradient(#fff,#fff) padding-box,linear-gradient(135deg,var(--azul),var(--morado)) border-box;border:2px solid transparent}
.cx-card-rec h4{font-size:clamp(24px,2.4vw,30px)}
.cx-card-rec p{max-width:48ch}
.cx-pal{display:flex;flex-direction:column;gap:7px;margin-top:6px;font-size:14.5px;font-weight:500;color:var(--texto)}
.cx-pal li{display:flex;align-items:center;gap:9px}
.cx-pal .i{width:18px;height:18px;padding:3px;border-radius:50%;background:var(--verde-p);color:#1F7A30;stroke-width:2.6}
.cx-par{position:absolute;right:34px;top:50%;transform:translateY(-50%);display:flex;align-items:center}
.cx-par-n{display:flex;flex-direction:column;align-items:center;gap:8px}
.cx-par-n small{font:600 12.5px/1 'Albert Sans';color:var(--texto-2)}
.cx-par-n>.i,.cx-par-n>img{width:64px;height:64px;padding:16px;border-radius:19px;background:var(--gris);box-shadow:inset 0 0 0 1px var(--linea);color:var(--tinta)}
.cx-par-n>img{padding:15px}
.cx-par-hilo{width:64px;height:2px;margin:0 -2px 22px;background:repeating-linear-gradient(90deg,var(--azul) 0 5px,transparent 5px 10px)}
.cx-pal-nota{color:var(--texto-2)}
.cx-pal-nota b{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--azul-p);color:var(--azul);font:800 11px/1 'Albert Sans';flex:none}
.cx-pal-ojo{color:#8A4F05}
.cx-pal-ojo b{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--dorado-p);color:#8A4F05;font:800 11px/1 'Albert Sans';box-shadow:inset 0 0 0 1px #F5D9A3;flex:none}

/* ── responsivo ── */
@media (max-width:1100px){
  .cx-lienzo{padding-top:clamp(52px,6vw,60px)}
  .cx-escena{grid-template-columns:minmax(0,1fr);justify-items:center;row-gap:0}
  .cx-m-cel{align-items:center}
  .cx-m-tally{width:100%;max-width:760px}
  .cx-puente{padding-top:0;width:100%;justify-content:center}
  .cx-puente-in{flex:none;width:100%;height:132px}
  .cx-cable{left:50%;right:auto;top:-8px;bottom:-8px;width:2px;height:auto;margin:0 0 0 -1px;
    background:repeating-linear-gradient(180deg,rgba(255,255,255,.5) 0 6px,transparent 6px 14px);background-size:2px 14px}
  .cx-vivo .cx-cable{animation-name:cx-marcha-v}
  .cx-hub-txt{left:calc(50% + 46px);right:auto;top:50%;transform:translateY(-50%);text-align:left;width:auto;white-space:nowrap}
  .cx-hechos{grid-template-columns:1fr}
}
@keyframes cx-marcha-v{to{background-position:0 14px}}
@media (max-width:1180px){
  .cx-par{position:static;transform:none;margin-top:12px;justify-content:flex-start}
}
@media (max-width:980px){
  .cx-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cx-card-rec{grid-column:1/-1}
}
@media (max-width:700px){
  .cx-lienzo{border-radius:24px;padding:16px 14px 20px}
  .cx-ejemplo{top:14px;right:14px}
  .cx-lienzo{padding-top:54px}
  .cx-rotulo{justify-content:center}
  .cx-rotulo{font-size:13px}
  .cx-win{height:auto;min-height:440px}
  .cx-win-cuerpo{grid-template-columns:minmax(0,1fr)}
  .cx-lista{display:none}
  .cx-hilo{min-height:340px}
  .cx-nums{margin-left:0;width:100%}
  .cx-num{font-size:11.5px;padding:6px 8px}
  .cx-puente-in{height:104px}
  .cx-cards{grid-template-columns:1fr}
  .cx-card{padding:22px 20px 24px}
  .cx-card-rec{padding:24px 20px 26px}
  .cx-par{position:static;transform:none;margin-top:10px;justify-content:flex-start}
  .cx-formas-cab{flex-direction:column;align-items:flex-start}
  .cx-hechos li{grid-template-columns:40px minmax(0,1fr);gap:12px}
  .cx-hecho-i{width:40px;height:40px;border-radius:12px}
  .cx-aviso{text-align:left}
}
@media (max-width:380px){
  .cx-cel{width:232px;height:468px;border-radius:38px}
  .cx-cb{font-size:12px}
}
@media (prefers-reduced-motion:reduce){
  .cx-vivo .cx-cable,.cx-vivo .cx-onda,.cx-vivo .cx-cursor{animation:none}
}
