/* Chat de mensajes en la página publicada. Colores de la página, mobile first. */
.lp-chat-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.lp-chat-fab > * { pointer-events: auto; }

.lp-chat-open {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--lp-btn, #7c3aed);
  color: var(--lp-btn-text, #fff);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.16s ease;
}
.lp-chat-open:hover { transform: scale(1.06); }

/* Plain text next to the button: no box, only a soft halo so it stays readable over any background. */
.lp-chat-hint {
  min-width: 0;
  max-width: 220px;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: none;
  color: var(--lp-text, #fff);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 0 8px var(--lp-bg, #0f0f0f), 0 0 3px var(--lp-bg, #0f0f0f);
  cursor: pointer;
  transition: max-width 0.3s ease, opacity 0.2s ease;
}
/* Once the visitor has seen it (or after a few seconds on small screens) only the round button remains. */
.lp-chat-fab.is-compact .lp-chat-hint { max-width: 0; opacity: 0; pointer-events: none; }
.lp-chat-fab.is-compact { gap: 0; }

.lp-chat dialog {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0;
  width: 100%;
  max-width: none;
  height: min(88dvh, 640px);
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--lp-bg, #0f0f0f);
  color: var(--lp-text, #fff);
  overflow: hidden;
}
.lp-chat dialog[open] { display: flex; flex-direction: column; animation: lpChatIn 0.22s ease-out; }
.lp-chat dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

@media (min-width: 640px) {
  .lp-chat dialog { inset: auto 24px 24px auto; width: 400px; border-radius: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }
}

@keyframes lpChatIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.lp-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lp-btn-border, rgba(255, 255, 255, 0.12));
}
.lp-chat-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--lp-card, #1c1c1c); flex: none; }
.lp-chat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lp-chat-close {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--lp-card, #1c1c1c); color: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}

.lp-chat-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; overflow-y: auto; }
.lp-bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.lp-bubble.is-theirs { align-self: flex-start; background: var(--lp-card, #1c1c1c); border-bottom-left-radius: 6px; }
.lp-bubble.is-mine { align-self: flex-end; background: var(--lp-btn, #7c3aed); color: var(--lp-btn-text, #fff); border-bottom-right-radius: 6px; }

.lp-chat-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--lp-btn-border, rgba(255, 255, 255, 0.12)); }
.lp-chat-composer { display: flex; align-items: flex-end; gap: 8px; }
.lp-chat-input, .lp-chat-email-input {
  flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--lp-btn-border, rgba(255, 255, 255, 0.2));
  border-radius: 16px; background: var(--lp-card, #1c1c1c); color: inherit; font: inherit; font-size: 16px; line-height: 1.4; resize: none;
}
.lp-chat-input { min-height: 48px; max-height: 120px; overflow-y: hidden; }
.lp-chat-send, .lp-chat-confirm {
  flex: none; min-width: 48px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 24px;
  background: var(--lp-btn, #7c3aed); color: var(--lp-btn-text, #fff); font: inherit; font-weight: 600; cursor: pointer;
}
.lp-chat-send:disabled, .lp-chat-confirm:disabled { opacity: 0.6; cursor: wait; }
.lp-chat-email { display: grid; gap: 10px; }
.lp-chat-email[hidden], .lp-chat-composer[hidden], .lp-chat-status[hidden] { display: none; }
.lp-chat-email-title { margin: 0; font-weight: 600; text-align: center; }
.lp-chat-confirm { width: 100%; }
.lp-chat-legal { margin: 0; font-size: 12px; text-align: center; color: var(--lp-desc, #aaa); }
.lp-chat-status { margin: 8px 0 0; font-size: 13px; color: #ff8a8a; text-align: center; }
.lp-chat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
