:root {
  --rlc-primary: #E74833;
  --rlc-bg: #F5F2F5;
  --rlc-text: #000000;
}

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

.rlc-chatbot-root {
  position: fixed;
  z-index: 999999;
  right: 22px;
  bottom: 22px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--rlc-text);
}

.rlc-chatbot-root.rlc-left {
  left: 22px;
  right: auto;
}

.rlc-chatbot-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--rlc-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.rlc-chatbot-button:hover {
  filter: brightness(.95);
}

.rlc-chatbot-button-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.rlc-chatbot-panel {
  width: min(390px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 96px));
  position: absolute;
  right: 0;
  bottom: 64px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}

.rlc-left .rlc-chatbot-panel {
  left: 0;
  right: auto;
}

.rlc-open .rlc-chatbot-panel {
  display: flex;
}

.rlc-chatbot-header {
  padding: 12px 14px;
  background: var(--rlc-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rlc-chatbot-header strong {
  display: block;
  font-size: 14px;
}

.rlc-chatbot-header small {
  display: block;
  margin-top: 2px;
  opacity: .88;
  font-size: 11px;
  line-height: 1.2;
}

.rlc-chatbot-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.rlc-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--rlc-bg);
}

.rlc-message {
  display: flex;
  margin-bottom: 9px;
}

.rlc-message-user {
  justify-content: flex-end;
}

.rlc-bubble {
  max-width: 90%;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.36;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.rlc-message-user .rlc-bubble {
  background: var(--rlc-primary);
  color: #fff;
  border-color: transparent;
}

.rlc-message-bot .rlc-bubble {
  border-top-left-radius: 6px;
}

.rlc-message-user .rlc-bubble {
  border-top-right-radius: 6px;
}

.rlc-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.rlc-choice-button {
  border: 1px solid color-mix(in srgb, var(--rlc-primary) 45%, #ffffff);
  border-radius: 999px;
  padding: 2px 4px;
  background: #fff;
  color: var(--rlc-primary);
  font-size: 6.5px;
  font-weight: 800;
  line-height: 1;
  min-height: 0;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}

.rlc-choice-button:hover {
  background: var(--rlc-primary);
  color: #fff;
  transform: translateY(-1px);
}

.rlc-choice-button:disabled {
  opacity: .45;
  cursor: default;
  transform: none;
}

.rlc-chatbot-lead {
  padding: 7px 10px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.08);
  display: none;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 96px;
  overflow-y: auto;
}

.rlc-lead-visible .rlc-chatbot-lead {
  display: grid;
}

.rlc-chatbot-lead input,
.rlc-chatbot-lead select {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 9px;
  font-size: 11.5px;
}

.rlc-chatbot-lead select {
  background: #fff;
  font-family: inherit;
  color: var(--rlc-text);
}

.rlc-chatbot-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  padding: 9px 10px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.08);
}

.rlc-chatbot-input {
  width: 100%;
  min-height: 36px;
  max-height: 82px;
  resize: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.14);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.rlc-chatbot-input:focus,
.rlc-chatbot-lead input:focus,
.rlc-chatbot-lead select:focus {
  border-color: var(--rlc-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rlc-primary) 18%, transparent);
}

.rlc-chatbot-send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--rlc-primary);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.rlc-chatbot-send:disabled {
  opacity: .55;
  cursor: not-allowed;
}


.rlc-chatbot-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  margin-right: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--rlc-primary);
  border: 1px solid color-mix(in srgb, var(--rlc-primary) 55%, #ffffff);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 800;
}

.rlc-chatbot-page-link:hover {
  background: var(--rlc-primary);
  color: #fff;
}

.rlc-chatbot-whatsapp {
  display: inline-flex;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--rlc-primary);
  color: #fff !important;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 800;
}

.rlc-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.rlc-typing span {
  width: 6px;
  height: 6px;
  background: rgba(0,0,0,.38);
  border-radius: 999px;
  display: block;
  animation: rlcTyping 1s infinite ease-in-out;
}

.rlc-typing span:nth-child(2) { animation-delay: .14s; }
.rlc-typing span:nth-child(3) { animation-delay: .28s; }

@keyframes rlcTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 520px) {
  .rlc-chatbot-root {
    right: 12px;
    bottom: 12px;
  }
  .rlc-chatbot-root.rlc-left {
    left: 12px;
  }
  .rlc-chatbot-panel {
    width: calc(100vw - 24px);
    height: min(650px, calc(100vh - 86px));
    bottom: 60px;
    border-radius: 18px;
  }
  .rlc-chatbot-button {
    padding: 10px 12px;
    font-size: 12px;
  }
  .rlc-bubble {
    max-width: 92%;
    font-size: 12.2px;
  }
}

.rlc-chatbot-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
}

.rlc-send-transcript-whatsapp {
  border: 1px solid color-mix(in srgb, var(--rlc-primary) 42%, #ffffff);
  border-radius: 999px;
  background: #fff;
  color: var(--rlc-primary);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  cursor: pointer;
}

.rlc-send-transcript-whatsapp:hover {
  background: var(--rlc-primary);
  color: #fff;
}

/* Contacto desde el inicio: campo Empresa en ancho completo */
.rlc-chatbot-lead .rlc-lead-company {
  grid-column: 1 / -1;
}
