/* Intelevo chat: interfaz limpia, usable en móvil y accesible. */
.ia-toggle {
  position:fixed;z-index:1010;right:20px;bottom:20px;
  display:inline-flex;align-items:center;justify-content:center;
  border:0;border-radius:999px;background:#c8f36b;color:#122239;
  box-shadow:0 10px 28px rgba(12,28,47,.24);
  font:700 14px/1.2 system-ui,-apple-system,sans-serif;
  padding:15px 20px;cursor:pointer;
}
.ia-toggle[aria-expanded="true"]{display:none}
.ia-backdrop{position:fixed;inset:0;background:rgba(9,23,40,.55);z-index:998}
.ia-backdrop[hidden],.ia-panel[hidden],.ia-suggestions[hidden]{display:none!important}
body.ia-chat-open{overflow:hidden}
.ia-panel,.ia-panel *{box-sizing:border-box}
.ia-panel{
  position:fixed;z-index:1000;right:20px;bottom:20px;
  width:min(400px,calc(100vw - 32px));
  height:min(590px,calc(100dvh - 40px));
  display:flex;flex-direction:column;
  background:#fff;color:#17263c;
  border:1px solid rgba(209,217,225,.85);
  border-radius:20px;overflow:hidden;
  box-shadow:0 24px 80px rgba(0,15,34,.32);
  font:14px/1.45 system-ui,-apple-system,sans-serif;
}
.ia-header{
  flex:0 0 auto;min-height:64px;display:flex;align-items:center;
  justify-content:space-between;gap:8px;padding:11px 14px 11px 17px;
  background:#122239;color:white;
}
.ia-header strong{font-size:16px;letter-spacing:-.25px;line-height:1.25;font-weight:750}
.ia-header small{display:block;font-size:11px;font-weight:500;color:#cfdae8;margin-top:3px}
.ia-header-actions{display:flex;align-items:center;gap:3px}
.ia-header-actions button{
  display:grid;place-items:center;width:37px;height:37px;
  border:0;border-radius:10px;background:transparent;color:#eef4ff;
  font:26px/1 system-ui,-apple-system,sans-serif;cursor:pointer;
}
.ia-header-actions button:hover,.ia-header-actions button:focus-visible{background:rgba(255,255,255,.14)}
.ia-reset{font-size:22px!important}
.ia-messages{
  flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;
  display:flex;flex-direction:column;align-items:stretch;
  gap:11px;padding:16px 13px 13px;
  scrollbar-width:thin;scrollbar-color:#bcc6d1 transparent;
  overscroll-behavior:contain;scroll-padding-bottom:12px;
  background:linear-gradient(180deg,#f9fbfd,#fff 18%);
}
.ia-message{
  max-width:91%;width:fit-content;padding:11px 13px;
  border-radius:16px;white-space:pre-wrap;overflow-wrap:anywhere;
  font-size:14px;line-height:1.5;
}
.ia-assistant{align-self:flex-start;background:#eff3f7;border-bottom-left-radius:5px}
.ia-user{align-self:flex-end;background:#ddf4a5;border-bottom-right-radius:5px}
.ia-message.ia-pending{color:#566476}
.ia-suggestions{
  flex:0 0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;margin:0;padding:3px 0 0;
}
.ia-suggestions button{
  min-width:0;min-height:40px;
  border:1px solid #cbd5df;border-radius:11px;
  padding:8px 10px;background:#fff;color:#17304e;
  font:600 12px/1.3 system-ui,-apple-system,sans-serif;
  text-align:left;white-space:normal;overflow-wrap:anywhere;cursor:pointer;
}
.ia-suggestions button:last-child:nth-child(odd){grid-column:1 / -1}
.ia-suggestions button:hover,.ia-suggestions button:focus-visible{background:#eef7d5;border-color:#9bbf63}
.ia-form{
  flex:0 0 auto;display:flex;align-items:stretch;gap:8px;
  margin:0;padding:11px 12px 7px;border-top:1px solid #e4e9ef;background:#fff;
}
.ia-form input{
  min-width:0;min-height:43px;flex:1;border:1.5px solid #c5ced8;
  border-radius:12px;padding:10px 12px;background:#fff;color:#17263c;
  font:14px/1.3 system-ui,-apple-system,sans-serif;
}
.ia-form input:focus{outline:2px solid #a9cf6c;outline-offset:1px}
.ia-form button{
  min-width:72px;min-height:43px;padding:0 12px;border:0;border-radius:12px;
  background:#122239;color:#fff;font:700 13px system-ui,-apple-system,sans-serif;
  cursor:pointer;
}
.ia-form button:disabled{opacity:.55;cursor:wait}
.ia-footer{
  flex:0 0 auto;margin:0;padding:2px 10px 10px;background:#fff;
  color:#697584;text-align:center;font:11px/1.35 system-ui,-apple-system,sans-serif;
}
.ia-footer a{color:#174267;text-decoration:underline;text-underline-offset:2px}
@media(max-width:500px){
  .ia-toggle{right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));padding:14px 17px}
  .ia-panel{
    left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px));
    width:auto;height:min(610px,calc(100dvh - 25px - env(safe-area-inset-bottom,0px)));
    border-radius:18px;
  }
  .ia-header{min-height:60px;padding:9px 10px 9px 14px}
  .ia-messages{padding:12px 11px}
  .ia-message{font-size:14px;padding:10px 12px}
  .ia-form{padding:9px 10px 4px}
  .ia-footer{padding:2px 8px 8px}
}
@media(max-height:480px){
  .ia-panel{height:calc(100dvh - 12px);bottom:6px}
  .ia-header{min-height:52px}
}
@media(prefers-reduced-motion:no-preference){
  .ia-panel:not([hidden]){animation:ia-appear .16s ease-out both}
  @keyframes ia-appear{from{transform:translateY(7px);opacity:.5}to{transform:none;opacity:1}}
}

/* Inicio compacto: se expande cuando el visitante comienza a conversar. */
.ia-panel.ia-welcome{height:auto;max-height:calc(100dvh - 35px)}
.ia-panel.ia-welcome .ia-messages{flex:0 1 auto}
