/* chat.css — live-chat UI layer. Sits on theme.css variables:
   --bg-0 (deep bordeaux), --gold, --rose, --ink. Mobile-first, single column. */

.chat-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- header ---- */
.chat-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(18, 5, 9, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(231, 181, 60, 0.25);
}
.chat-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold, #e7b53c);
}
.chat-head strong {
  display: block;
  font-family: "Cormorant Garamond", "Cinzel", serif; font-size: 1.15rem;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--ink, #f4ecd8);
}
.chat-status {
  font-size: 0.78rem;
  color: rgba(216, 201, 180, 0.65);
}
.chat-status.is-online::before,
.chat-status.is-typing::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #59d98c;
  margin-right: 6px;
  box-shadow: 0 0 6px rgba(89, 217, 140, 0.8);
}
.chat-status.is-connecting::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #a8957e;
  margin-right: 6px;
  animation: chatPulse 1.2s ease-in-out infinite;
}
@keyframes chatPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---- log ---- */
.chat-log {
  flex: 1;
  padding: 18px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: none; /* auto-scrolled chat: bar only flickers in during bubble overflow */
}
.chat-log::-webkit-scrollbar { display: none; }
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: bubbleIn 0.35s ease;
}
.chat-row.no-anim { animation: none; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-mini-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(231, 181, 60, 0.5);
}
.chat-bubble {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink, #f4ecd8);
  overflow-wrap: anywhere;
}
.from-seer .chat-bubble {
  background: rgba(61, 16, 32, 0.85);
  border: 1px solid rgba(231, 181, 60, 0.22);
  border-bottom-left-radius: 4px;
}
.from-seer .chat-bubble em { color: var(--gold, #e7b53c); font-style: italic; }
.from-seer .chat-bubble strong { color: var(--gold, #e7b53c); }
.from-user {
  justify-content: flex-end;
}
.from-user .chat-bubble {
  background: linear-gradient(135deg, rgba(231, 181, 60, 0.92), rgba(212, 158, 47, 0.92));
  color: #2a0a14;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

/* typing indicator */
.is-typing .chat-bubble, .chat-row.is-typing .chat-bubble { padding: 14px 16px; }
.chat-bubble .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(216, 201, 180, 0.7);
  margin: 0 2px;
  animation: dotBounce 1.2s infinite;
}
.chat-bubble .dot:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* card embeds + the offer card are styled in cards.css (.card-bubble, .offer-bubble) */
.chat-rate { margin-left: auto; font-size: .72rem; color: var(--ink-faint, #a8957e); white-space: nowrap; }
.chat-avatar-fallback { display: grid; place-items: center; background: linear-gradient(160deg, #4a1020, #2a0a14); color: #e7b53c; font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; }

/* ---- input dock ---- */
.chat-dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(18, 5, 9, 0) 0%, rgba(18, 5, 9, 0.95) 30%);
}
.chat-dock:empty { padding: 6px; }

.chat-input-form {
  display: flex;
  gap: 8px;
}
.chat-input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 24px;
  border: 1px solid rgba(231, 181, 60, 0.45);
  background: rgba(61, 16, 32, 0.9);
  color: var(--ink, #f4ecd8);
  font-size: 1rem;
  outline: none;
}
.chat-input:focus { border-color: var(--gold, #e7b53c); }
.chat-input.is-bad { border-color: #e0607a; }
.chat-input-hint {
  display: none;
  font-size: 0.82rem;
  color: #e8a0b0;
  padding: 0 6px 8px;
}
.chat-input-hint.show { display: block; }
.chat-send {
  padding: 0 22px;
  border: none;
  border-radius: 24px;
  background: var(--gold, #e7b53c);
  color: #2a0a14;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
}

.chat-choices {
  display: grid;
  gap: 8px;
}
.chat-choices.two-up { grid-template-columns: 1fr 1fr; }
.chat-choice {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(231, 181, 60, 0.5);
  background: rgba(61, 16, 32, 0.92);
  color: var(--ink, #f4ecd8);
  font-size: 0.96rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.chat-choice:active { transform: scale(0.98); }
.chat-choice:hover { border-color: var(--gold, #e7b53c); }
.choice-label { display: block; font-weight: 600; }
.choice-sub { display: block; font-size: 0.8rem; color: rgba(216, 201, 180, 0.65); margin-top: 2px; }

.chat-cta {
  display: block;
  text-align: center;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e7b53c, #c99f4b);
  color: #2a0a14 !important;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(231, 181, 60, 0.35);
  animation: ctaGlow 2s ease-in-out infinite;
}
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 6px 24px rgba(231, 181, 60, 0.35); }
  50% { box-shadow: 0 6px 34px rgba(231, 181, 60, 0.6); }
}

/* ---- lander helpers ---- */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  margin-bottom: 10px;
}
.lead { font-size: 1.05rem; line-height: 1.6; }

/* ---- lander helpers (the ceremony itself is styled in cards.css) ---- */
.gen-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
