.libra-chat {
  position: fixed;
  right: 20px;
  bottom: 88px; /* Situado justo encima del botón flotante de WhatsApp */
  z-index: 9990;
  font-family: inherit;
}

.libra-chat__toggle {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #eab932;
  background: #162447;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(22, 36, 71, 0.32);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.libra-chat__toggle:hover {
  transform: scale(1.06);
  background: #1f3263;
}

.libra-chat__toggle-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #eab932;
  color: #162447;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 999px;
  line-height: 1;
}

.libra-chat__window {
  position: fixed;
  right: 20px;
  bottom: 152px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 490px;
  max-height: calc(100vh - 180px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9995;
}

.libra-chat__window[hidden] {
  display: none;
}

.libra-chat__header {
  background: #162447;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #eab932;
}

.libra-chat__header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.libra-chat__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}

.libra-chat__title {
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.libra-chat__subtitle {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.libra-chat__close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.85;
}

.libra-chat__close:hover {
  opacity: 1;
}

.libra-chat__messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.libra-chat__msg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.libra-chat__msg--bot {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.libra-chat__msg--user {
  align-self: flex-end;
  background: #162447;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.libra-chat__msg--typing {
  font-style: italic;
  color: #64748b;
}

.libra-chat__quick {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  overflow-x: auto;
  scrollbar-width: none;
}

.libra-chat__quick::-webkit-scrollbar {
  display: none;
}

.libra-chat__chip {
  white-space: nowrap;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.libra-chat__chip:hover {
  background: #e2e8f0;
}

.libra-chat__chip--alert {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.libra-chat__chip--gps {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.libra-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.libra-chat__input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  outline: none;
}

.libra-chat__input:focus {
  border-color: #162447;
}

.libra-chat__send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #eab932;
  color: #162447;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.libra-chat__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .libra-chat {
    right: 14px;
    bottom: 82px;
  }
  .libra-chat__window {
    right: 12px;
    left: 12px;
    bottom: 144px;
    width: auto;
    max-width: none;
    height: 62vh;
  }
}