.andes-chat-widget {
  --andes-chat-acento: #aeed11;
  --andes-chat-carbon: #171714;
  --andes-chat-lino: #f4f1ec;
  --andes-chat-superficie: #fffdf8;
  --andes-chat-borde: #d6cfc4;
  --andes-chat-texto: #1a1a1a;
  --andes-chat-mute: #69655d;
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 99999;
  color: var(--andes-chat-texto);
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.andes-chat-widget__boton {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  gap: .7rem;
  padding: .72rem 1.05rem;
  border: 1px solid rgba(174, 237, 17, .48);
  border-radius: 999px;
  background: var(--andes-chat-carbon);
  color: var(--andes-chat-lino);
  box-shadow: 0 16px 38px rgba(17, 17, 15, .28);
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s ease, border-color .25s ease;
}
.andes-chat-widget__boton:hover { transform: translateY(-2px); border-color: var(--andes-chat-acento); box-shadow: 0 20px 44px rgba(17, 17, 15, .34); }
.andes-chat-widget__boton:focus-visible,
.andes-chat-widget__cerrar:focus-visible,
.andes-chat-widget__adjuntar:focus-visible,
.andes-chat-widget__enviar:focus-visible,
.andes-chat-widget__form input:focus-visible { outline: 3px solid var(--andes-chat-acento); outline-offset: 3px; }
.andes-chat-widget__boton svg { width: 1.1rem; height: 1.1rem; flex: none; color: var(--andes-chat-acento); }

.andes-chat-widget__panel {
  display: none;
  flex-direction: column;
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(400px, calc(100vw - 24px));
  max-height: min(74svh, 620px);
  overflow: hidden;
  border: 1px solid rgba(23, 23, 20, .18);
  border-radius: 20px;
  background: var(--andes-chat-superficie);
  box-shadow: 0 30px 90px rgba(17, 17, 15, .32);
  transform-origin: right bottom;
}
.andes-chat-widget--abierto .andes-chat-widget__panel { display: flex; animation: andes-chat-entra .32s cubic-bezier(.22, 1, .36, 1) both; }
.andes-chat-widget--abierto .andes-chat-widget__boton { display: none; }

.andes-chat-widget__header {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem .9rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: var(--andes-chat-carbon);
  color: var(--andes-chat-lino);
}
.andes-chat-widget__identity { display: grid; gap: .18rem; min-width: 0; }
.andes-chat-widget__identity strong { overflow: hidden; font-size: .88rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.andes-chat-widget__identity small { color: #bfc2b5; font-size: .68rem; line-height: 1.35; }
.andes-chat-widget__identity small::before {
  content: ""; display: inline-block; width: .46rem; height: .46rem; margin-right: .42rem;
  border-radius: 50%; background: var(--andes-chat-acento); box-shadow: 0 0 0 .2rem rgba(174, 237, 17, .13);
}
.andes-chat-widget__cerrar {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.andes-chat-widget__cerrar:hover { border-color: var(--andes-chat-acento); color: var(--andes-chat-acento); }

.andes-chat-widget__mensajes {
  display: flex;
  min-height: 210px;
  flex: 1;
  flex-direction: column;
  gap: .72rem;
  overflow-y: auto;
  padding: 1.15rem;
  background:
    linear-gradient(rgba(23, 23, 20, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 20, .025) 1px, transparent 1px),
    var(--andes-chat-lino);
  background-size: 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: #8f8a80 transparent;
}
.andes-chat-widget__msg {
  max-width: 86%;
  padding: .72rem .9rem;
  border: 1px solid transparent;
  font-size: .82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.andes-chat-widget__msg--taller {
  align-self: flex-start;
  border-color: var(--andes-chat-borde);
  border-radius: 16px 16px 16px 4px;
  background: var(--andes-chat-superficie);
  color: var(--andes-chat-texto);
  box-shadow: 0 8px 22px rgba(30, 24, 18, .06);
}
.andes-chat-widget__msg--visitante {
  align-self: flex-end;
  border-color: var(--andes-chat-carbon);
  border-radius: 16px 16px 4px 16px;
  background: var(--andes-chat-carbon);
  color: var(--andes-chat-lino);
}
.andes-chat-widget__msg--sistema {
  align-self: center;
  max-width: 94%;
  padding: .5rem .7rem;
  border-color: #d8bd82;
  border-radius: 8px;
  background: #fff5dc;
  color: #5c4319;
  font-size: .7rem;
  text-align: center;
}

.andes-chat-widget__cta {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  align-self: flex-start;
  margin-top: -.2rem;
  padding: .65rem .9rem;
  border-radius: 999px;
  background: var(--andes-chat-acento);
  color: #17120c;
  font-size: .75rem;
  font-weight: 900;
  text-decoration: none;
}

.andes-chat-widget__form {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) 2.7rem;
  align-items: center;
  gap: .45rem;
  padding: .75rem;
  border-top: 1px solid var(--andes-chat-borde);
  background: var(--andes-chat-superficie);
}
.andes-chat-widget__form input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 2.7rem;
  box-sizing: border-box;
  padding: .65rem .85rem;
  border: 1px solid var(--andes-chat-borde);
  border-radius: 999px;
  background: white;
  color: var(--andes-chat-texto);
  font: inherit;
  font-size: .8rem;
}
.andes-chat-widget__form input[type="text"]::placeholder { color: #817c73; }
.andes-chat-widget__adjuntar,
.andes-chat-widget__enviar {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}
.andes-chat-widget__adjuntar { border-color: var(--andes-chat-borde); background: transparent; color: var(--andes-chat-mute); }
.andes-chat-widget__adjuntar:hover { border-color: var(--andes-chat-carbon); color: var(--andes-chat-carbon); }
.andes-chat-widget__enviar { background: var(--andes-chat-acento); color: #17120c; }
.andes-chat-widget__enviar:hover { background: #c0ff24; }
.andes-chat-widget__enviar:disabled { opacity: .45; cursor: default; }
.andes-chat-widget__adjunto-info {
  padding: .6rem 1rem 0;
  background: var(--andes-chat-superficie);
  color: var(--andes-chat-mute);
  font-size: .68rem;
}
.andes-chat-widget__adjunto-info:empty { display: none; }

@keyframes andes-chat-entra {
  from { opacity: 0; transform: translate3d(0, .8rem, 0) scale(.97); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@media (max-width: 520px) {
  .andes-chat-widget { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .andes-chat-widget__panel {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-height: min(72svh, 610px);
    border-radius: 18px;
  }
  .andes-chat-widget__mensajes { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .andes-chat-widget--abierto .andes-chat-widget__panel { animation: none; }
  .andes-chat-widget__boton { transition: none; }
}
