:root {
    --saffron: #e8924a;
    --saffron-dim: rgba(232, 146, 74, 0.15);
    --saffron-glow: rgba(232, 146, 74, 0.35);
    --bg: #0f0f1a;
    --bg-surface: #16162a;
    --bg-raised: #1e1e35;
    --bg-card: #191930;
    --border: #2a2a45;
    --text: #ddd8cc;
    --text-muted: #6b6880;
    --text-dim: #9994a8;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(232, 146, 74, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 80% 90%, rgba(120, 80, 200, 0.07) 0%, transparent 60%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Header ───────────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 2.2rem 1rem 1rem;
    width: 100%;
}
header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--saffron);
    letter-spacing: 0.01em;
}
header p {
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}
.header-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem auto 0;
    width: 100%;
    max-width: 200px;
}
.header-divider-line { flex: 1; height: 1px; }
.header-divider-line.left  { background: linear-gradient(to right, transparent, rgba(232,146,74,0.35)); }
.header-divider-line.right { background: linear-gradient(to left,  transparent, rgba(232,146,74,0.35)); }
.header-divider-gem { font-size: 0.65rem; color: rgba(232,146,74,0.6); }

/* ── Chat area ────────────────────────────────────────────────── */
#chat {
    flex: 1;
    width: 100%;
    max-width: 620px;
    padding: 1rem 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* ── Messages ─────────────────────────────────────────────────── */
.msg {
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    max-width: 88%;
    line-height: 1.65;
    animation: fadeUp 0.25s ease both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msg.user {
    background: var(--bg-raised);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-size: 0.93rem;
    color: #c8c4d8;
    border: 1px solid var(--border);
}
.msg.assistant {
    background: var(--bg-card);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--saffron);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}
.msg-footer {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.msg-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: normal;
}
.msg-actions { display: flex; align-items: center; gap: 0.4rem; }

/* ── Empty state ──────────────────────────────────────────────── */
#empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 1.5rem 1.5rem 0;
    text-align: center;
    gap: 1.5rem;
}
.empty-quote { max-width: 340px; }
.empty-quote blockquote {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.7;
}
.empty-quote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: normal;
    letter-spacing: 0.04em;
}
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 400px;
}
.suggestion-chip {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    cursor: default;
    line-height: 1.4;
    transition: border-color 0.15s, color 0.15s;
}
.suggestion-chip:hover { border-color: var(--saffron); color: var(--text); }
.suggestion-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

/* ── Controls ─────────────────────────────────────────────────── */
#controls { padding: 1.2rem 1rem 2rem; text-align: center; width: 100%; }
.mic-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mic-ring {
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid var(--saffron);
    opacity: 0;
    pointer-events: none;
}
.recording .mic-ring { animation: ring-pulse 1.2s ease-out infinite; }
@keyframes ring-pulse {
    0%   { transform: scale(1);    opacity: 0.6; }
    100% { transform: scale(1.55); opacity: 0; }
}
#mic-btn {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #f0a060, #d4783a);
    color: #fff;
    font-size: 1.7rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px var(--saffron-glow);
}
#mic-btn:hover:not(:disabled) { transform: scale(1.07); box-shadow: 0 6px 28px var(--saffron-glow); }
#mic-btn.recording { background: linear-gradient(145deg, #f07050, #c0442a); box-shadow: 0 4px 20px rgba(192,68,42,0.5); }
#mic-btn:disabled { background: #2e2e48; color: #555; cursor: not-allowed; box-shadow: none; }
#status { margin-top: 0.7rem; font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.04em; min-height: 1.2em; }

/* ── Shloka cards ─────────────────────────────────────────────── */
.shlokas { align-self: flex-start; max-width: 88%; animation: fadeUp 0.25s ease both; }
.shlokas-toggle {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: var(--saffron);
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    padding: 0.15rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.03em;
    opacity: 0.85;
}
.shlokas-toggle:hover { opacity: 1; }
.shlokas-toggle .arrow { transition: transform 0.2s; display: inline-block; font-style: normal; }
.shlokas-toggle.open .arrow { transform: rotate(90deg); }
.shlokas-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.45rem; }
.shlokas-list.hidden { display: none; }
.shloka-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.shloka-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.85rem;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}
.shloka-ref { font-size: 0.68rem; font-weight: 600; color: var(--saffron); text-transform: uppercase; letter-spacing: 0.07em; }
.shloka-expand-btn { font-size: 0.65rem; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 0; transition: color 0.15s; }
.shloka-expand-btn:hover { color: var(--text-dim); }
.shloka-card-body { padding: 0.65rem 0.85rem; }
.shloka-sanskrit { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 0.82rem; color: #b8895a; line-height: 1.55; margin-bottom: 0.45rem; }
.shloka-translation { font-size: 0.78rem; color: var(--text-dim); line-height: 1.55; }
.shloka-translation.hidden { display: none; }

/* ── Buttons ──────────────────────────────────────────────────── */
.wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: #000;
    text-decoration: none;
    background: #25D366;
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-weight: 500;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.wa-btn:hover { opacity: 1; }
.share-btn {
    background: #7248c9;
    border: 1px solid #8b5cf6;
    border-radius: 6px;
    color: #fff;
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.share-btn:hover { background: #6236b8; box-shadow: 0 2px 10px rgba(114,72,201,0.4); }

/* ── Upsell ───────────────────────────────────────────────────── */
#upsell {
    display: none;
    margin: 1.5rem auto;
    max-width: 360px;
    width: calc(100% - 2rem);
    background: linear-gradient(160deg, #1e1208, #251510);
    border: 1px solid rgba(232, 146, 74, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    animation: fadeUp 0.3s ease both;
}
#upsell h2 { font-family: 'Playfair Display', Georgia, serif; color: var(--saffron); font-size: 1.15rem; margin-bottom: 0.5rem; }
#upsell p { color: #b0a898; font-size: 0.88rem; margin-bottom: 1.1rem; line-height: 1.5; }
#upsell .upsell-note { margin-top: 0.9rem; font-size: 0.88rem; color: #b0a898; }

/* ── Feedback flow ────────────────────────────────────────────── */
.feedback-step { display: none; animation: fadeUp 0.2s ease both; }
.feedback-step.active { display: block; }
.reaction-btns { display: flex; justify-content: center; gap: 0.6rem; margin-top: 0.9rem; }
.reaction-btn {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.reaction-btn span { font-size: 0.75rem; color: #b0a898; }
.reaction-btn:hover { border-color: var(--saffron); background: var(--saffron-dim); }
.reaction-btn.selected { border-color: var(--saffron); background: var(--saffron-dim); }
.feedback-label { font-size: 0.88rem; color: #b0a898; margin-bottom: 0.5rem; text-align: left; }
.feedback-textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    padding: 0.6rem 0.75rem;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
    line-height: 1.5;
}
.feedback-textarea:focus { border-color: var(--saffron); }
.feedback-textarea::placeholder { color: var(--text-muted); }
.feedback-submit {
    margin-top: 0.6rem;
    width: 100%;
    background: var(--saffron);
    border: none;
    border-radius: 8px;
    color: #1a1a2e;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.feedback-submit:hover { opacity: 0.88; }
.feedback-thankyou { font-family: 'Playfair Display', Georgia, serif; font-size: 1.05rem; color: var(--saffron); margin-top: 0.5rem; }

/* ── Timings (dev only) ───────────────────────────────────────── */
.timings {
    font-size: 0.7rem; color: #555; margin-top: 0.3rem;
    padding: 0.4rem 0.7rem; background: #0d0d1a;
    border-radius: 6px; max-width: 88%;
    align-self: flex-start; font-family: monospace;
    border: 1px solid #1e1e32;
}

/* ── Share row ────────────────────────────────────────────────── */
.share-row { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; }

/* ── Lucide icons ─────────────────────────────────────────────── */
#mic-btn svg { width: 28px; height: 28px; stroke: currentColor; }
.share-btn svg, .wa-btn svg { width: 13px; height: 13px; stroke: currentColor; vertical-align: middle; }
.wa-btn svg { stroke: none; fill: currentColor; }
