/* Luna chat widget */
#ll-chat-root {
  --ll-chat-primary: #0176d3;
  --ll-chat-navy: #032d60;
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 2000;
  font-family: Inter, system-ui, sans-serif;
}

#ll-chat-launcher {
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 999px;
  background: var(--ll-chat-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(1, 118, 211, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ll-chat-launcher svg {
  width: 1.5rem;
  height: 1.5rem;
}

#ll-chat-panel {
  position: absolute;
  right: 0;
  bottom: 4.25rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 6rem));
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ll-chat-panel[hidden] {
  display: none !important;
}

#ll-chat-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--ll-chat-navy);
  color: #fff;
}

.ll-chat-header__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

.ll-chat-header__title {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

#ll-chat-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

#ll-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f8fafc;
}

.ll-chat-bubble {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ll-chat-bubble--visitor {
  align-self: flex-end;
  background: var(--ll-chat-primary);
  color: #fff;
}

.ll-chat-bubble--luna,
.ll-chat-bubble--staff {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
}

.ll-chat-bubble--staff {
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.ll-chat-bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 3rem;
  padding: 0.7rem 0.95rem;
}

.ll-chat-bubble--typing span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: #94a3b8;
  animation: ll-chat-typing 1.2s infinite ease-in-out;
}

.ll-chat-bubble--typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.ll-chat-bubble--typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ll-chat-typing {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

#ll-chat-status {
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  color: #6b7280;
}

#ll-chat-email-gate,
#ll-chat-compose {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #e5e7eb;
}

#ll-chat-email-gate p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #4b5563;
}

#ll-chat-email-gate input,
#ll-chat-compose textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  margin-bottom: 0.5rem;
}

#ll-chat-compose form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

#ll-chat-compose textarea {
  flex: 1;
  resize: vertical;
  min-height: 2.5rem;
  margin-bottom: 0;
}

.ll-chat-btn {
  border: none;
  border-radius: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.ll-chat-btn--primary {
  background: var(--ll-chat-primary);
  color: #fff;
}

.ll-chat-link-card-wrap {
  align-self: flex-start;
  max-width: 92%;
}

.ll-chat-link-card {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(3, 45, 96, 0.08);
  min-width: min(100%, 260px);
  max-width: 320px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ll-chat-link-card:hover {
  border-color: var(--ll-chat-primary);
  box-shadow: 0 8px 22px rgba(1, 118, 211, 0.14);
  color: inherit;
}

.ll-chat-link-card__media {
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef5fc;
  color: var(--ll-chat-primary);
  font-size: 1.25rem;
  font-weight: 700;
}

.ll-chat-link-card__body {
  flex: 1;
  padding: 0.65rem 0.75rem 0.65rem 0;
  min-width: 0;
}

.ll-chat-link-card__name {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ll-chat-navy);
  margin-bottom: 0.15rem;
}

.ll-chat-link-card__location {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.ll-chat-link-card__cta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ll-chat-primary);
}
