/* ── "Chat with your website" demo (templates/website_chat.html) ── */
body { padding-top: 72px; background: var(--bg); }
.wc-page { min-height: 100vh; padding: 48px 0 100px; }
.wc-container { max-width: 1040px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 20px; }

.wc-hero { text-align: center; margin-bottom: 8px; }
.wc-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .6px; color: var(--purple-lt);
  background: var(--purple-bg); border: 1px solid var(--border-p); border-radius: 999px; padding: 5px 12px; margin-bottom: 14px;
}
.wc-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(30px, 5vw, 46px); color: var(--text); margin: 0 0 12px; }
.wc-hero p { color: var(--text-2); font-size: 15.5px; max-width: 600px; margin: 0 auto; line-height: 1.7; }

.wc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; }
.wc-label { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); font-weight: 700; margin-bottom: 10px; }
.wc-input {
  width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 13px 16px; font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.wc-input:focus { outline: none; border-color: var(--border-p); box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.wc-input::placeholder { color: var(--text-3); }
.wc-url-row { display: flex; gap: 10px; }
.wc-btn {
  flex-shrink: 0; background: var(--purple); color: #0A0A0C; border: none; border-radius: 10px; padding: 13px 24px;
  font: inherit; font-size: 14.5px; font-weight: 800; cursor: pointer; transition: var(--trans); white-space: nowrap;
}
.wc-btn:hover:not(:disabled) { background: var(--purple-lt); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(56,189,248,.3); }
.wc-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.wc-btn:focus-visible, .wc-ghost:focus-visible, .wc-chip:focus-visible { outline: 2px solid var(--purple-lt); outline-offset: 2px; }
.wc-ghost {
  background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 7px 12px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: var(--trans);
}
.wc-ghost:hover { border-color: var(--border-p); color: var(--text); }
.wc-fine { font-size: 12px; color: var(--text-3); margin: 10px 0 0; line-height: 1.5; }
.wc-error { margin: 12px 0 0; font-size: 13.5px; color: #F87171; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.35); border-radius: 8px; padding: 10px 12px; }

/* Progress */
.wc-progress-head { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text); }
.wc-count { margin-left: auto; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.wc-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--purple); animation: wcSpin .8s linear infinite; flex-shrink: 0; }
.wc-progress.done .wc-spinner { animation: none; border-color: var(--success); }
@keyframes wcSpin { to { transform: rotate(360deg); } }
.wc-bar { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin: 14px 0; }
.wc-bar span { display: block; height: 100%; width: 3%; background: linear-gradient(90deg, var(--purple-dk), var(--purple)); border-radius: 999px; transition: width .4s ease; }
.wc-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.wc-pages li { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--text-2); animation: wcIn .3s ease both; }
.wc-pages li::before { content: '✓'; color: var(--success); font-weight: 800; }
.wc-pages li span { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@keyframes wcIn { from { opacity: 0; transform: translateY(4px); } }

/* Chat */
.wc-chat-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.wc-chat { background: var(--bg-card); border: 1px solid var(--border-p); border-radius: var(--r); display: flex; flex-direction: column; height: min(620px, 78vh); overflow: hidden; box-shadow: var(--shadow-p); }
.wc-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.wc-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #0A0A0C; background: linear-gradient(135deg, #7DD3FC, #38BDF8); flex-shrink: 0; text-transform: uppercase; }
.wc-chat-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wc-chat-title strong { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-chat-title > span { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.wc-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.wc-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.wc-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; animation: wcIn .25s ease both; }
.wc-msg.bot { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.wc-msg.user { align-self: flex-end; background: var(--purple); color: #0A0A0C; font-weight: 600; border-bottom-right-radius: 4px; }
.wc-msg.error { color: #FCA5A5; border-color: rgba(239,68,68,.35); }
.wc-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.wc-sources a { font-size: 11.5px; color: var(--purple-lt); background: var(--purple-bg); border: 1px solid var(--border-p); border-radius: 999px; padding: 2px 9px; text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-sources a:hover { text-decoration: underline; }
.wc-typing { display: inline-flex; gap: 4px; }
.wc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: wcDot 1s infinite ease-in-out; }
.wc-typing i:nth-child(2) { animation-delay: .15s; } .wc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wcDot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.wc-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.wc-chip { background: none; border: 1px solid var(--border-p); color: var(--purple-lt); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; transition: var(--trans); }
.wc-chip:hover { background: var(--purple-bg); }
.wc-ask { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--bg-2); }

/* CTA */
.wc-cta h2 { font-size: 18px; color: var(--text); margin: 0 0 12px; line-height: 1.35; }
.wc-cta h2 span { color: var(--purple-lt); word-break: break-all; }
.wc-cta ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wc-cta li { font-size: 13.5px; color: var(--text-2); padding-left: 22px; position: relative; line-height: 1.5; }
.wc-cta li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.wc-lead { display: flex; flex-direction: column; gap: 10px; }
.wc-lead .wc-input { font-size: 14px; padding: 11px 14px; }
.wc-lead.sent .wc-input, .wc-lead.sent .wc-btn { display: none; }
.wc-lead.sent .wc-fine { color: var(--success); font-size: 14px; }

/* How it works */
.wc-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; }
.wc-how div { border: 1px dashed var(--border); border-radius: var(--r); padding: 18px; }
.wc-how span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--purple-bg); color: var(--purple-lt); font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.wc-how strong { display: block; color: var(--text); margin-bottom: 4px; }
.wc-how p { font-size: 13px; color: var(--text-3); line-height: 1.55; margin: 0; }

@media (max-width: 860px) {
  .wc-chat-wrap { grid-template-columns: 1fr; }
  .wc-chat { height: min(560px, 75vh); }
}
@media (max-width: 600px) {
  .wc-container { padding: 0 16px; }
  .wc-page { padding-top: 28px; }
  .wc-url-row { flex-direction: column; }
  .wc-how { grid-template-columns: 1fr; }
  .wc-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .wc-spinner, .wc-typing i, .wc-pages li, .wc-msg { animation: none; }
  .wc-bar span { transition: none; }
}

/* `hidden` must win over the display rules above (the chat grid was showing before a bot existed). */
.wc-page [hidden] { display: none !important; }

/* Light theme: the sky-blue accent text is too faint on a light background. */
[data-theme="light"] .wc-eyebrow,
[data-theme="light"] .wc-chip,
[data-theme="light"] .wc-sources a,
[data-theme="light"] .wc-cta h2 span,
[data-theme="light"] .wc-how span { color: var(--purple-dk); }
[data-theme="light"] .wc-chip { border-color: rgba(2,132,199,.45); }
[data-theme="light"] .wc-msg.error { color: #B91C1C; }
[data-theme="light"] .wc-error { color: #B91C1C; }
