.chatbot-sie,
.chatbot-sie * {
  box-sizing: border-box;
}

.chatbot-sie {
  --chatbot-azul: #003b50;
  --chatbot-azul-claro: #e8f4f6;
  --chatbot-rosa: #dca6a0;
  --chatbot-crema: #fffaf3;
  --chatbot-texto: #173844;
  position: fixed;
  right: 14px;
  bottom: 88px;
  z-index: 90;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--chatbot-texto);
}

.chatbot-lanzador {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  background: var(--chatbot-azul);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0, 40, 55, .3);
  font: inherit;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
}

.chatbot-lanzador:hover { transform: translateY(-1px); }
.chatbot-lanzador:focus-visible,
.chatbot-cerrar:focus-visible,
.chatbot-enviar:focus-visible,
.chatbot-sugerencia:focus-visible,
.chatbot-accion:focus-visible,
.chatbot-campo:focus-visible {
  outline: 3px solid #f2c15f;
  outline-offset: 2px;
}

.chatbot-lanzador-icono {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--chatbot-azul);
  font-size: 1.05rem;
}

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100dvh - 170px));
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 59, 80, .16);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 31, 44, .34);
  transform-origin: right bottom;
  animation: chatbot-abrir .2s ease-out;
}

.chatbot-panel[hidden] { display: none; }

@keyframes chatbot-abrir {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.chatbot-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 17px;
  background: var(--chatbot-azul);
  color: #fff;
}

.chatbot-cabecera-texto strong,
.chatbot-cabecera-texto span { display: block; }
.chatbot-cabecera-texto strong { font-size: 1rem; }
.chatbot-cabecera-texto span { margin-top: 3px; color: #d8eaef; font-size: .76rem; }

.chatbot-cerrar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.chatbot-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 17px;
  background: linear-gradient(180deg, var(--chatbot-crema), #f6fbfc);
  scroll-behavior: smooth;
}

.chatbot-mensaje {
  max-width: 88%;
  margin: 0 0 11px;
  padding: 11px 13px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .9rem;
  line-height: 1.45;
}

.chatbot-mensaje-asistente {
  margin-right: auto;
  border-bottom-left-radius: 5px;
  background: #fff;
  border: 1px solid #dce9ec;
}

.chatbot-mensaje-usuario {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  background: var(--chatbot-azul);
  color: #fff;
}

.chatbot-mensaje-error {
  border-color: #ecc7c0;
  background: #fff1ee;
  color: #78372e;
}

.chatbot-accion {
  width: fit-content;
  min-height: 38px;
  margin-top: 10px;
  padding: 8px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--chatbot-azul);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: normal;
}

.chatbot-accion:hover { background: #075c75; }

.chatbot-escribiendo { color: #64818b; font-style: italic; }

.chatbot-sugerencias {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 13px 3px;
  background: #fff;
  scrollbar-width: thin;
}

.chatbot-sugerencia {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid #b7d2d8;
  border-radius: 999px;
  background: #fff;
  color: var(--chatbot-azul);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}

.chatbot-formulario {
  display: flex;
  gap: 8px;
  padding: 10px 13px 7px;
  background: #fff;
}

.chatbot-campo {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 10px 13px;
  border: 1px solid #b9cdd2;
  border-radius: 14px;
  color: #153844;
  background: #fff;
  font: inherit;
  font-size: .88rem;
}

.chatbot-campo::placeholder { color: #6d858d; }
.chatbot-campo:disabled { background: #eef3f4; }

.chatbot-enviar {
  min-width: 72px;
  border: 0;
  border-radius: 14px;
  background: var(--chatbot-rosa);
  color: #382b2a;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}

.chatbot-enviar:disabled { opacity: .55; cursor: wait; }

.chatbot-aviso {
  margin: 0;
  padding: 0 14px 11px;
  background: #fff;
  color: #667e86;
  font-size: .68rem;
  line-height: 1.35;
}

@media (min-width: 800px) {
  .chatbot-sie { right: 24px; bottom: 24px; }
  .chatbot-panel { height: min(620px, calc(100dvh - 110px)); }
}

@media (max-width: 390px) {
  .chatbot-lanzador-texto { display: none; }
  .chatbot-lanzador { width: 54px; height: 54px; justify-content: center; padding: 8px; }
  .chatbot-panel { right: -2px; min-height: 390px; }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-panel { animation: none; }
  .chatbot-mensajes { scroll-behavior: auto; }
}
