/* Chat del sitio Rapivan — aspecto. Todo cuelga de .rchat; !important donde el tema (Astra) pinta botones. */
.rchat,.rchat *{box-sizing:border-box}
.rchat{position:fixed;right:18px;bottom:18px;z-index:99990;font-family:inherit;font-size:14px;line-height:1.45}
.rchat[hidden]{display:none!important}

/* La burbuja */
.rchat-bur{width:56px;height:56px;border-radius:50%;border:0!important;background:#512F86!important;color:#fff!important;
  box-shadow:0 10px 24px rgba(42,23,71,.32);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0!important}
.rchat-bur:hover,.rchat-bur:focus{background:#3f2369!important;color:#fff!important}
.rchat-bur[hidden]{display:none!important}
.rchat-bur svg{width:26px;height:26px;fill:currentColor}
.rchat-pin{position:absolute;top:-3px;right:-3px;min-width:20px;height:20px;border-radius:999px;background:#e53935;color:#fff;
  font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 6px}
.rchat-pin[hidden]{display:none!important}

/* El panel */
.rchat-panel{width:340px;max-width:calc(100vw - 24px);background:#2a1747;border-radius:14px;overflow:hidden;
  box-shadow:0 18px 44px rgba(42,23,71,.34);display:flex;flex-direction:column;max-height:min(620px,calc(100vh - 40px))}
.rchat-panel[hidden]{display:none!important}
/* El fondo del panel es el del encabezado: si fuera blanco, se asoma como filo claro en las esquinas redondeadas. */
.rchat-pie{background:#F8F6FB}
.rchat-top{background:#2a1747;color:#fff;padding:12px 14px;display:flex;align-items:center;gap:10px}
.rchat-av{width:30px;height:30px;border-radius:50%;background:#7a52b8;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}
.rchat-top b{font-size:14px;display:block;line-height:1.2}
.rchat-top span{font-size:11.5px;opacity:.85;display:block}
.rchat-punto{width:7px;height:7px;border-radius:50%;background:#20c463;display:inline-block;margin-right:5px;vertical-align:1px}
.rchat-punto.gris{background:#9aa7b4}
.rchat-x{margin-left:auto;background:transparent!important;border:0!important;color:#fff!important;font-size:20px;line-height:1;cursor:pointer;padding:0 2px!important}
.rchat-x:hover,.rchat-x:focus{background:transparent!important;color:#fff!important}

.rchat-cuerpo{padding:12px;background:#F8F6FB;overflow-y:auto;flex:1;min-height:150px}
.rchat-m{max-width:88%;padding:9px 12px;border-radius:12px;margin-bottom:8px;font-size:13.5px;white-space:pre-wrap;word-wrap:break-word}
.rchat-m.ellos{background:#fff;border:1px solid #E2DCEB;border-bottom-left-radius:4px;color:#323232}
.rchat-m.yo{background:#512F86;color:#fff;margin-left:auto;border-bottom-right-radius:4px}
.rchat-m.sis{background:#FFF4DC;border:1px solid #f0dcb4;color:#5a3d00;max-width:100%;font-size:12.5px}
.rchat-m a{color:inherit;text-decoration:underline}
.rchat-quien{font-size:11px;color:#6B6080;margin:0 0 3px 2px}
.rchat-adj{display:block;margin-top:4px;font-size:12px;opacity:.9}
.rchat-img{display:block;max-width:100%;max-height:220px;border-radius:8px}

.rchat-campos{padding:0 12px 12px;background:#F8F6FB}
.rchat-campos label{display:block;font-size:11.5px;color:#6B6080;margin:0 0 3px}
.rchat-campos input,.rchat-campos textarea{width:100%;border:1px solid #E2DCEB;border-radius:8px;padding:9px 11px;font-size:13.5px;
  margin-bottom:9px;background:#fff;color:#323232;font-family:inherit}
.rchat-campos input:focus,.rchat-campos textarea:focus{outline:2px solid #512F86;outline-offset:-1px}
.rchat-btn{width:100%;border:1px solid #512F86!important;background:#512F86!important;color:#fff!important;border-radius:8px;
  padding:10px!important;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit}
.rchat-btn:hover,.rchat-btn:focus{background:#3f2369!important;color:#fff!important;border-color:#3f2369!important}
.rchat-btn.wa{background:#25D366!important;border-color:#25D366!important}
.rchat-btn.wa:hover,.rchat-btn.wa:focus{background:#1fb457!important;border-color:#1fb457!important}
.rchat-legal{font-size:11px;color:#6B6080;text-align:center;padding:0 14px 12px;background:#F8F6FB}
.rchat-legal a{color:#512F86}
.rchat-mal{font-size:12px;color:#A32B20;margin:-4px 0 8px}

.rchat-entrada{display:flex;gap:8px;align-items:center;padding:10px 12px;border-top:1px solid #E2DCEB;background:#fff}
.rchat-entrada textarea{flex:1;border:1px solid #E2DCEB;border-radius:18px;padding:8px 12px;font-size:13.5px;resize:none;
  height:38px;max-height:96px;font-family:inherit;color:#323232;background:#fff}
.rchat-ico{width:34px;height:34px;flex:none;border-radius:50%;border:0!important;background:#EFEBF5!important;color:#2a1747!important;
  cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0!important}
.rchat-ico.env{background:#512F86!important;color:#fff!important}
.rchat-ico:hover,.rchat-ico:focus{background:#e3dcef!important;color:#2a1747!important}
.rchat-ico.env:hover,.rchat-ico.env:focus{background:#3f2369!important;color:#fff!important}
.rchat-ico svg{width:17px;height:17px;fill:currentColor}

/* En el celular ocupa la pantalla: un panel de 340 px sobre un teclado abierto no se puede usar. */
@media (max-width:560px){
  .rchat{right:12px;bottom:12px}
  .rchat-panel{position:fixed;inset:0;width:100%;max-width:none;max-height:none;border-radius:0}
}
@media (prefers-reduced-motion:no-preference){
  .rchat-panel{animation:rchat-sube .18s ease-out}
  @keyframes rchat-sube{from{transform:translateY(8px);opacity:.4}to{transform:none;opacity:1}}
}
