/* Intake chat. Uses the shared variables; each client's theme.css sets the look. */
body.chat-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }

/* Photo band at the top of the chat */
.chat-hero { position: relative; overflow: hidden; background: var(--ink) var(--chat-image, none) center 35% / cover no-repeat; color: var(--on-ink); }
.chat-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 94%, transparent) 0%, color-mix(in srgb, var(--ink) 78%, transparent) 45%, color-mix(in srgb, var(--ink) 35%, transparent) 100%); }
.chat-hero-inner { position: relative; width: min(760px, 100%); margin: 0 auto; padding: clamp(36px, 6vw, 64px) 16px clamp(30px, 5vw, 52px); }
.chat-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.035em; margin: 0 0 14px; }
.chat-hero .eyebrow { margin-bottom: 14px; }
.chat-hero-text { margin: 0; max-width: 540px; color: var(--on-ink-muted); font-size: 1.05rem; }
.chat-hero .tag { background: var(--accent); color: var(--ink); font-weight: 600; }


.chat-progress { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; gap: clamp(8px, 3vw, 36px); padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.chat-step { display: flex; align-items: center; gap: 8px; }
.chat-step span { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--muted); }
.chat-step.on { color: var(--text); font-weight: 600; }
.chat-step.on span { background: var(--accent); border-color: var(--accent); }
.chat-step.done span { background: var(--text); border-color: var(--text); }

.chat-main { flex: 1; width: min(760px, 100%); margin: 0 auto; padding: 36px 16px 45vh; }
.chat-log { display: flex; flex-direction: column; gap: 14px; }

.msg { display: flex; gap: 12px; align-items: flex-start; animation: msg-in .3s ease-out both; }
.msg-user { justify-content: flex-end; }
.chat-avatar { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: .85rem; font-weight: 700; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--accent); }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bubble { padding: 14px 18px; line-height: 1.6; border-radius: 16px; max-width: min(600px, 85%); }
.msg-host .bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg-user .bubble { background: var(--ink); color: var(--on-ink); border-top-right-radius: 4px; white-space: pre-wrap; }
.msg-user .bubble.skipped { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-style: italic; }

/* Question bubble: text + field inside */
.q-bubble { flex: 1; max-width: 640px; padding: 20px 22px; border-left: 3px solid var(--accent) !important; box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 6%, transparent); }
.q-bubble.q-compact, .q-bubble.review { box-shadow: none; }
.q-field { margin-top: 14px; }
.q-field:first-child { margin-top: 0; }
.q-label { display: block; margin: 0 0 6px; font-size: .95rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.u-line { display: block; }
.u-line + .u-line { margin-top: 8px; }
.u-label { display: block; font-size: .75rem; opacity: .65; }
.q-kicker { margin: 0 0 4px; font-size: .75rem; font-weight: 700; color: var(--accent); }
.q-intro { margin: 0 0 12px; color: var(--muted); }
.q-text { margin: 0; font-size: 1.08rem; }
.q-form { margin-top: 16px; }
.q-input { margin: 0; background: var(--paper); }
textarea.q-input { resize: vertical; min-height: 110px; }
.q-hint { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.q-actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.q-send { width: auto; padding: 11px 22px; }
.q-link { display: inline-block; text-decoration: none; background: var(--button); color: var(--button-text); border-radius: var(--radius); font-weight: 600; }
.q-save { width: 100%; padding: 15px; }
.q-skip { width: auto; padding: 4px 0; background: none; color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: underline; }
.q-err { margin: 8px 0 0; color: #9b2c24; font-size: .85rem; }
.q-err:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { width: auto; padding: 10px 16px; background: var(--paper); color: var(--text); border: 1px solid var(--line); border-radius: 999px; font-weight: 500; }
.chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.typing { display: flex; gap: 5px; padding: 17px 19px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Saved card (first arrival in the space) */
.saved-card .saved-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 4px 0 10px; }
.saved-meta { margin: 0 0 4px; }

/* Review */
.review-note { margin: 12px 0 4px; padding: 12px 16px; background: var(--paper); border-left: 3px solid var(--accent); white-space: pre-wrap; }
.review h3 { font-size: 1.15rem; margin: 20px 0 6px; }
.review dl { margin: 0; }
.review dt { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 10px; }
.review dd { margin: 2px 0 0; white-space: pre-wrap; }
.review dd.empty { color: var(--muted); }
.review .edit { width: auto; padding: 0; background: none; color: var(--accent); font-size: .8rem; font-weight: 600; text-decoration: underline; }
.review .q-form { margin-top: 22px; }

@media (max-width: 560px) {
  .chat-step { font-size: 0; gap: 0; }
  .chat-step span { width: 10px; height: 10px; }
  .chat-avatar { flex-basis: 32px; width: 32px; height: 32px; }
  .bubble, .q-bubble { max-width: 100%; }
}

/* Chat inside the slide-in panel */
.chat-embed .chat-progress { padding: 10px 12px; }
.chat-embed .chat-main { padding: 20px 14px 40vh; }
.chat-embed .q-bubble { padding: 16px 16px; }
.chat-embed .chat-avatar { flex-basis: 34px; width: 34px; height: 34px; }

/* Consent checkbox in the chat */
.q-consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; line-height: 1.5; text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; }
.q-consent input { width: 18px; height: 18px; margin: 3px 0 0; flex: 0 0 18px; }
.q-consent a { color: var(--accent); }
