#paiver-chat-root{--p-black:#171717;--p-gray:#f3f3f3;--p-line:#e4e4e4;--p-mid:#747474;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;position:relative;z-index:2147483000}
#paiver-chat-launcher{position:fixed;right:28px;bottom:28px;width:230px;min-height:74px;border:1px solid #dedede;border-radius:24px;background:#fff;color:#171717;box-shadow:0 14px 45px rgba(0,0,0,.18);display:flex;align-items:center;gap:12px;padding:9px 16px 9px 9px;cursor:pointer;z-index:2147483001;text-align:left;transition:.2s ease}
#paiver-chat-launcher:hover{transform:translateY(-2px);box-shadow:0 18px 52px rgba(0,0,0,.23)}
#paiver-chat-launcher img{width:56px;height:56px;border-radius:18px;object-fit:cover;background:#eee}
#paiver-chat-launcher span{display:flex;flex-direction:column;line-height:1.15}#paiver-chat-launcher strong{font-size:16px;font-weight:700}#paiver-chat-launcher small{font-size:12px;color:#747474;margin-top:5px}
#paiver-chat-panel{position:fixed;right:28px;bottom:28px;width:min(420px,calc(100vw - 32px));height:min(720px,calc(100vh - 56px));background:#fff;border:1px solid #dedede;border-radius:26px;box-shadow:0 22px 70px rgba(0,0,0,.22);overflow:hidden;display:none;grid-template-rows:auto auto minmax(0,1fr) auto auto auto auto;z-index:2147483002}
#paiver-chat-panel.open{display:grid;animation:paiverIn .22s ease-out}@keyframes paiverIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.paiver-chat-header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--p-line);background:#fff}.paiver-agent{display:flex;align-items:center;gap:11px}.paiver-agent img{width:48px;height:48px;border-radius:15px;object-fit:cover}.paiver-agent div{display:flex;flex-direction:column}.paiver-agent strong{font-size:15px}.paiver-agent small{font-size:12px;color:#707070;margin-top:4px}.paiver-agent i{display:inline-block;width:7px;height:7px;background:#222;border-radius:50%;margin-right:4px}#paiver-chat-close{border:0;background:#f2f2f2;width:36px;height:36px;border-radius:50%;font-size:24px;line-height:1;cursor:pointer;color:#222}
#paiver-chat-messages{min-height:0;overflow-y:auto;padding:20px 16px 10px;background:#fafafa;scroll-behavior:auto}.paiver-msg{max-width:86%;padding:11px 14px;border-radius:18px;margin:0 0 10px;font-size:14px;line-height:1.45;white-space:pre-wrap}.paiver-msg.bot{background:#eee;color:#171717;border-bottom-left-radius:6px}.paiver-msg.user{background:#222;color:#fff;margin-left:auto;border-bottom-right-radius:6px}.paiver-typing{display:inline-flex;gap:4px;align-items:center}.paiver-typing b{width:5px;height:5px;background:#777;border-radius:50%;animation:paiverDot 1s infinite}.paiver-typing b:nth-child(2){animation-delay:.15s}.paiver-typing b:nth-child(3){animation-delay:.3s}@keyframes paiverDot{50%{opacity:.3}}
#paiver-chat-actions{padding:8px 16px 10px;background:#fafafa;display:flex;flex-wrap:wrap;gap:7px;max-height:145px;overflow-y:auto}.paiver-action{border:1px solid #d5d5d5;background:#fff;color:#222;border-radius:999px;padding:9px 13px;font-size:13px;cursor:pointer;transition:.15s}.paiver-action:hover{background:#222;color:#fff;border-color:#222}.paiver-action.primary{background:#222;color:#fff;border-color:#222}
.paiver-chat-inputbar{border-top:1px solid var(--p-line);padding:10px 12px;display:flex;align-items:flex-end;gap:8px;background:#fff}.paiver-chat-inputbar button{border:0;background:#222;color:#fff;width:40px;height:40px;border-radius:50%;cursor:pointer;font-size:18px}
#paiver-direct-advisor{margin:0 12px 8px;border:0;background:transparent;color:#333;text-decoration:underline;font-size:12px;cursor:pointer;padding:3px}.paiver-chat-privacy{font-size:9px;color:#666;text-align:center;padding:0 16px 10px;background:#fff;line-height:1.3}
@media(max-width:600px){#paiver-chat-launcher{right:14px;bottom:18px;width:210px;min-height:68px;border-radius:22px}#paiver-chat-panel{right:8px;bottom:8px;width:calc(100vw - 16px);height:calc(100dvh - 16px);border-radius:22px}#paiver-chat-messages{padding-top:16px}.paiver-msg{max-width:90%}}

/* Navegación integrada */
#paiver-chat-home{appearance:none;border:0;border-bottom:1px solid var(--p-line);background:#fff;color:#333;width:100%;min-height:48px;padding:10px 16px;display:flex;align-items:center;justify-content:center;gap:7px;font:600 13px/1.2 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;letter-spacing:.01em;cursor:pointer;transition:background .15s ease,color .15s ease}
#paiver-chat-home span{width:24px;height:24px;border-radius:50%;background:#f2f2f2;display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:1}
#paiver-chat-home:hover,#paiver-chat-home:focus-visible{background:#f7f7f7;color:#111;text-decoration:underline;outline:0}
#paiver-chat-home:hover span{background:#e8e8e8}

/* v1.7 - Aislamiento del asistente frente a estilos globales del tema */
#paiver-chat-root,
#paiver-chat-root *{
  box-sizing:border-box;
}
#paiver-chat-root button,
#paiver-chat-root input,
#paiver-chat-root a{
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
#paiver-chat-root button{
  -webkit-appearance:none;
  appearance:none;
  text-transform:none;
  letter-spacing:normal;
}
#paiver-chat-root .paiver-chat-inputbar{
  position:relative !important;
  min-height:60px !important;
  padding:10px 12px !important;
  display:flex !important;
  align-items:flex-end !important;
  gap:8px !important;
  background:#ffffff !important;
  border-top:1px solid var(--p-line) !important;
  visibility:visible !important;
  opacity:1 !important;
  z-index:20 !important;
}

/* El selector incluye el ID real y el tipo real del campo para ganar a reglas del tema. */
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"],
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:hover,
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:active,
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:valid{
  box-sizing:border-box !important;
  display:block !important;
  position:relative !important;
  flex:1 1 0 !important;
  width:1% !important;
  min-width:0 !important;
  height:42px !important;
  min-height:42px !important;
  max-height:42px !important;
  margin:0 !important;
  padding:0 14px !important;
  border:1px solid #d8d8d8 !important;
  border-radius:21px !important;
  outline:none !important;
  outline-offset:0 !important;
  box-shadow:none !important;
  background:#f4f4f4 !important;
  background-color:#f4f4f4 !important;
  background-image:none !important;
  color:#111111 !important;
  -webkit-text-fill-color:#111111 !important;
  caret-color:#111111 !important;
  opacity:1 !important;
  visibility:visible !important;
  font:400 16px/42px Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif !important;
  text-indent:0 !important;
  text-shadow:none !important;
  -webkit-appearance:none !important;
  appearance:none !important;
  transition:border-color .15s ease !important;
}
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:focus,
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:focus-visible{
  color:#111111 !important;
  -webkit-text-fill-color:#111111 !important;
  caret-color:#111111 !important;
  background:#f4f4f4 !important;
  background-color:#f4f4f4 !important;
  background-image:none !important;
  border:1px solid #222222 !important;
  outline:none !important;
  box-shadow:none !important;
  opacity:1 !important;
}
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]::placeholder{
  color:#666666 !important;
  -webkit-text-fill-color:#666666 !important;
  opacity:1 !important;
}
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]::-webkit-input-placeholder{
  color:#666666 !important;
  -webkit-text-fill-color:#666666 !important;
  opacity:1 !important;
}
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:-webkit-autofill,
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:-webkit-autofill:hover,
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:-webkit-autofill:focus,
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]:-webkit-autofill:active{
  color:#111111 !important;
  -webkit-text-fill-color:#111111 !important;
  caret-color:#111111 !important;
  border:1px solid #222222 !important;
  outline:none !important;
  box-shadow:0 0 0 1000px #f4f4f4 inset !important;
  -webkit-box-shadow:0 0 0 1000px #f4f4f4 inset !important;
  background-color:#f4f4f4 !important;
  opacity:1 !important;
}
#paiver-chat-root .paiver-chat-inputbar > input#paiver-chat-input[type="text"]::selection{
  background:#d9d9d9 !important;
  color:#111111 !important;
  -webkit-text-fill-color:#111111 !important;
}
#paiver-chat-root #paiver-chat-send{
  flex:0 0 40px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  visibility:visible !important;
  opacity:1 !important;
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
  background:#222222 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

/* v1.8.2: mantener el historial y el campo dentro del área visible. */
#paiver-chat-root #paiver-chat-messages{overflow-wrap:anywhere;overscroll-behavior:contain}
@media(max-width:600px){
  #paiver-chat-root #paiver-chat-panel{top:calc(var(--paiver-viewport-top,0px) + 8px);bottom:auto;height:calc(var(--paiver-viewport-height,100dvh) - 16px)}
  #paiver-chat-root #paiver-chat-actions{max-height:min(145px,20vh);max-height:min(145px,calc(var(--paiver-viewport-height,100dvh) * .2));min-height:0}
}
/* External service handoff. */
#paiver-chat-root .paiver-action-link{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}

@media(prefers-reduced-motion:reduce){#paiver-chat-panel.open,.paiver-typing b{animation:none}#paiver-chat-launcher,.paiver-action{transition:none}}
