:root {
    --color-bg: #06060c;
    --color-bg-subtle: #0a0a16;
    --color-surface: rgba(12, 12, 26, 0.75);
    --color-surface-solid: #0c0c1a;
    --color-surface-hover: rgba(18, 18, 38, 0.85);
    --color-border: rgba(201, 162, 39, 0.1);
    --color-border-strong: rgba(201, 162, 39, 0.22);
    --color-gold: #C9A227;
    --color-gold-light: #DBBA4A;
    --color-gold-dim: rgba(201, 162, 39, 0.55);
    --color-gold-glow: rgba(201, 162, 39, 0.12);
    --color-indigo: #1a1740;
    --color-indigo-light: #282466;
    --color-text: #ece8dc;
    --color-text-muted: #b3ada5;
    --color-text-dim: #8a857e;
    --color-user-bubble: rgba(26, 24, 60, 0.6);
    --color-ai-bubble: rgba(12, 12, 24, 0.5);
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-lg: 24px;
    --max-width: 800px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Premium Divider ─────────────────────── */

.premium-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-dim), transparent);
    border: none;
    margin: 0;
}

/* ── Brand Mark ──────────────────────────── */

.brand-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(6, 6, 12, 0.95) 0%, transparent 100%);
    pointer-events: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.brand-monogram {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 0.06em;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 10px;
    background: rgba(201, 162, 39, 0.06);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
}

/* ── Hero ─────────────────────────────────── */

.hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 0 80px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.hero-glow {
    position: absolute;
    top: -25%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    max-width: 200vw;
    height: 900px;
    background: radial-gradient(
        ellipse at center,
        rgba(201, 162, 39, 0.05) 0%,
        rgba(26, 23, 64, 0.2) 30%,
        rgba(26, 23, 64, 0.05) 55%,
        transparent 75%
    );
    pointer-events: none;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-gold);
    border: 1px solid rgba(201, 162, 39, 0.15);
    padding: 8px 24px;
    border-radius: 100px;
    margin-bottom: 40px;
    background: rgba(201, 162, 39, 0.03);
    animation: fadeInDown 0.8s ease-out;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 600;
    line-height: 1.05;
    color: var(--color-text);
    margin-bottom: 32px;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    color: var(--color-text-muted);
    max-width: 520px;
    margin: 0 auto 52px;
    font-weight: 400;
    line-height: 1.85;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-cta-group .google-signin-btn {
    margin-bottom: 0;
    max-width: none;
    width: auto;
    padding: 14px 40px;
}

.hero-supporting-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-questions {
    max-width: 520px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-questions p {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--color-gold-dim);
    margin-bottom: 10px;
    line-height: 1.5;
}

.hero-body {
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 560px;
    margin: 0 auto 48px;
    line-height: 1.85;
    font-weight: 400;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ── CTA Buttons ─────────────────────────── */

.cta-button {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--color-bg);
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    padding: 16px 48px;
    border-radius: 100px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    box-shadow: 0 2px 16px rgba(201, 162, 39, 0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 162, 39, 0.3), 0 0 60px rgba(201, 162, 39, 0.1);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(201, 162, 39, 0.2);
}

.cta-button-secondary {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px 40px;
    border-radius: 100px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.cta-button-secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cta-button-secondary:active {
    transform: translateY(0);
}

/* ── Features (legacy – chat page) ───────── */

.features {
    padding: 88px 0;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-subtle) 100%);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.feature-card {
    background: var(--color-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 26px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.feature-card:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-hover);
    box-shadow: 0 4px 24px rgba(201, 162, 39, 0.06);
}

.feature-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-gold);
}

.feature-card p {
    font-size: 0.93rem;
    color: var(--color-text-muted);
    line-height: 1.65;
}

/* ── App Mockup Section ─────────────────── */

.app-mockup-section {
    padding: 40px 0 80px;
    background: var(--color-bg);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.app-mockup {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    border-radius: 20px;
    border: 1px solid rgba(201, 162, 39, 0.1);
    background: rgba(8, 6, 18, 0.9);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(201, 162, 39, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out both;
}

.mockup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mockup-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-gold-dim);
}

.mockup-dot-spacer {
    flex: 1;
}

.mockup-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
}

.mockup-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mockup-message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.65;
}

.mockup-message p {
    margin: 0;
}

.mockup-user {
    align-self: flex-end;
    max-width: 80%;
    background: rgba(26, 24, 60, 0.5);
    border: 1px solid rgba(49, 46, 129, 0.25);
    color: var(--color-text);
}

.mockup-ai {
    align-self: flex-start;
    max-width: 88%;
    background: rgba(12, 12, 24, 0.4);
    border: 1px solid rgba(201, 162, 39, 0.08);
    color: var(--color-text-muted);
}

.mockup-input-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(6, 6, 12, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 6px;
}

.mockup-input-text {
    font-size: 0.82rem;
    color: var(--color-text-dim);
}

.mockup-send-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    border-radius: 50%;
    color: var(--color-bg);
}

/* ── Reflective Questions ────────────────── */

.reflective-questions-section {
    padding: 60px 0;
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.reflective-question {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--color-gold-dim);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 16px;
}

.reflective-question:last-child {
    margin-bottom: 0;
}

/* ── Features Section (Landing) ──────────── */

.features-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-subtle) 50%, var(--color-bg) 100%);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.features-grid-new {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 880px;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .features-grid-new {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card-new {
    background: rgba(12, 12, 26, 0.6);
    border: 1px solid rgba(201, 162, 39, 0.08);
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.feature-card-new:hover {
    border-color: rgba(201, 162, 39, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 40px rgba(201, 162, 39, 0.04);
    transform: translateY(-3px);
}

.feature-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(201, 162, 39, 0.06);
    border: 1px solid rgba(201, 162, 39, 0.1);
    color: var(--color-gold);
    margin-bottom: 20px;
}

.feature-card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 10px;
    letter-spacing: 0;
}

.feature-card-desc {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    font-weight: 400;
}

/* ── Trust Section ──────────────────────── */

.trust-section {
    padding: 60px 0;
    border-top: 1px solid rgba(201, 162, 39, 0.06);
    border-bottom: 1px solid rgba(201, 162, 39, 0.06);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 40px;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .trust-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 800px;
        gap: 20px;
    }
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.trust-item svg {
    color: var(--color-gold-dim);
}

.trust-item span {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* ── Book Section (Landing) ──────────────── */

.book-section-new {
    padding: 100px 0;
    background: var(--color-bg);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.book-section-header {
    text-align: center;
    margin-bottom: 56px;
}

.book-section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.book-section-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 400;
    line-height: 1.7;
}

.book-covers-new {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.book-cover-card-new {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: transform 0.4s var(--ease);
}

.book-cover-card-new:hover {
    transform: translateY(-6px);
}

.book-cover-img-new {
    width: 180px;
    max-width: 100%;
    height: auto;
    border-radius: 4px 12px 12px 4px;
    border: 1px solid rgba(201, 162, 39, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(201, 162, 39, 0.04);
    transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.book-cover-card-new:hover .book-cover-img-new {
    border-color: rgba(201, 162, 39, 0.25);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(201, 162, 39, 0.08);
}

.book-cover-label-new {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-gold-dim);
    letter-spacing: 0.02em;
    transition: color 0.3s var(--ease);
}

.book-cover-card-new:hover .book-cover-label-new {
    color: var(--color-gold);
}

/* ── Quote ─────────────────────────────────── */

.quote-section {
    padding: 72px 0;
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.quote-section::before,
.quote-section::after {
    content: '';
    display: block;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-dim), transparent);
    margin: 0 auto;
}

.quote-section::before {
    margin-bottom: 40px;
}

.quote-section::after {
    margin-top: 40px;
}

.quote p {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    color: var(--color-gold);
    line-height: 1.6;
    max-width: 580px;
    margin: 0 auto;
    border: none;
    padding: 0;
}

/* ── Chat Page Layout ────────────────────── */

.chat-page {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #05030d;
    overflow: hidden;
    overscroll-behavior: none;
}

[data-page="chat"] {
    overflow: hidden;
    overscroll-behavior: none;
}

body.keyboard-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.chat-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 56px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-header-monogram {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 0.06em;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    background: rgba(201, 162, 39, 0.06);
}

.chat-header-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 600;
    text-align: center;
    margin-bottom: 14px;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-align: center;
    max-width: 500px;
    margin: 0 auto 44px;
    font-weight: 400;
    line-height: 1.7;
}

/* Chat Messages */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* Starter Prompts */

.starter-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
}

.starter-prompts.hidden {
    display: none;
}

.starter-prompt {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--color-gold);
    background: rgba(201, 162, 39, 0.04);
    border: 1px solid var(--color-border-strong);
    padding: 9px 20px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    text-align: left;
    letter-spacing: 0.01em;
}

.starter-prompt:hover {
    background: rgba(201, 162, 39, 0.1);
    border-color: var(--color-gold);
    color: var(--color-gold-light);
    box-shadow: 0 0 20px rgba(201, 162, 39, 0.08);
}

.starter-prompt.selected {
    background: rgba(201, 162, 39, 0.12);
    border-color: var(--color-gold);
    color: var(--color-gold-light);
}

/* Message Bubbles */

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1.7;
    animation: messageIn 0.35s var(--ease);
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background: var(--color-user-bubble);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(49, 46, 129, 0.35);
    color: var(--color-text);
    white-space: pre-wrap;
}

.assistant-message {
    align-self: flex-start;
    background: var(--color-ai-bubble);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    white-space: normal;
    scroll-margin-top: 8px;
}

.assistant-message p {
    margin: 0 0 0.75em;
    line-height: 1.7;
}

.assistant-message p:last-child {
    margin-bottom: 0;
}

.assistant-message strong {
    color: var(--color-text);
    font-weight: 600;
}

.assistant-message em {
    font-style: italic;
}

.assistant-message ul,
.assistant-message ol {
    margin: 0.5em 0 0.75em 1.4em;
    padding: 0;
}

.assistant-message li {
    margin-bottom: 0.3em;
    line-height: 1.6;
}

.assistant-message h1,
.assistant-message h2,
.assistant-message h3,
.assistant-message h4 {
    font-family: var(--font-heading);
    color: var(--color-text);
    margin: 0.75em 0 0.4em;
    line-height: 1.3;
}

.assistant-message h1:first-child,
.assistant-message h2:first-child,
.assistant-message h3:first-child,
.assistant-message h4:first-child {
    margin-top: 0;
}

.assistant-message h3 {
    font-size: 1.1em;
}

.assistant-message h4 {
    font-size: 1em;
}

.assistant-message code {
    background: rgba(201, 162, 39, 0.08);
    border-radius: 4px;
    padding: 0.15em 0.4em;
    font-size: 0.88em;
}

.assistant-message pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    margin: 0.5em 0 0.75em;
}

.assistant-message pre code {
    background: none;
    padding: 0;
    font-size: 0.88em;
}

.assistant-message blockquote {
    border-left: 2px solid var(--color-gold-dim);
    padding-left: 14px;
    margin: 0.5em 0 0.75em;
    color: var(--color-text-muted);
    font-style: italic;
}

.assistant-message hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0.75em 0;
}

.assistant-message a {
    color: var(--color-gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.error-message {
    align-self: center;
    background: rgba(139, 50, 50, 0.12);
    border: 1px solid rgba(180, 80, 80, 0.25);
    color: #d4a0a0;
    font-size: 0.88rem;
    text-align: center;
}

/* Typing Indicator */

.typing-indicator {
    display: none;
    padding: 4px 16px 8px;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
}

.typing-indicator.visible {
    display: flex;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--color-gold-dim);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Subscription Banner */

.subscription-banner {
    display: none;
    flex-shrink: 0;
    padding: 16px;
}

.subscription-banner.visible {
    display: block;
}

.subscription-banner-inner {
    text-align: center;
    background: linear-gradient(160deg, rgba(26, 23, 64, 0.4) 0%, rgba(12, 10, 28, 0.7) 50%, rgba(26, 23, 64, 0.3) 100%);
    border: 1px solid rgba(201, 162, 39, 0.18);
    border-radius: 16px;
    padding: 32px 24px 28px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.3), 0 0 80px rgba(201, 162, 39, 0.04);
    position: relative;
    overflow: hidden;
}

.subscription-banner-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-dim), transparent);
}

.premium-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-gold);
    border: 1px solid rgba(201, 162, 39, 0.25);
    padding: 6px 22px;
    border-radius: 100px;
    margin-bottom: 20px;
    background: rgba(201, 162, 39, 0.06);
}

.subscription-banner-inner h3 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.premium-subtext {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.premium-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 24px;
    max-width: 380px;
    text-align: left;
}

.premium-benefits-list li {
    font-size: 0.86rem;
    color: var(--color-text-muted);
    padding: 6px 0;
    line-height: 1.5;
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(201, 162, 39, 0.06);
}

.premium-benefits-list li:last-child {
    border-bottom: none;
}

.premium-usage-note {
    font-size: 0.76rem;
    color: var(--color-text-dim);
    margin-top: 14px;
    margin-bottom: 0;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.premium-pricing-detail {
    font-size: 0.82rem;
    color: var(--color-text-dim);
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-align: center;
}

.premium-divider-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-dim), transparent);
    margin: 18px auto;
}

.subscription-banner-inner .restore-link-text {
    margin-bottom: 4px;
}

.subscription-banner-inner .restore-link-text:last-of-type {
    margin-bottom: 16px;
}

.subscription-banner-cta {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-bg);
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    padding: 14px 40px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.3), 0 0 40px rgba(201, 162, 39, 0.08);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    letter-spacing: 0.02em;
}

.subscription-banner-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(201, 162, 39, 0.4), 0 0 60px rgba(201, 162, 39, 0.1);
}

.subscription-banner-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.subscription-banner-book-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 4px;
}

.subscription-banner-book-links a {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-gold);
    text-decoration: none;
    border: 1px solid var(--color-border-strong);
    padding: 7px 18px;
    border-radius: 100px;
    background: rgba(201, 162, 39, 0.04);
    transition: all 0.3s var(--ease);
}

.subscription-banner-book-links a:hover {
    background: rgba(201, 162, 39, 0.1);
    border-color: var(--color-gold);
}

/* Usage Limit Banner */

.usage-limit-banner {
    flex-shrink: 0;
    padding: 12px 16px;
}

.usage-limit-banner-inner {
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 23, 64, 0.35), rgba(16, 16, 32, 0.55));
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    padding: 20px 16px;
}

.usage-limit-banner-inner h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.usage-limit-banner-inner p {
    font-size: 0.86rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    line-height: 1.6;
}

.topup-offer {
    color: var(--color-gold-dim) !important;
    font-style: italic;
    margin-bottom: 14px !important;
}

.topup-expiry-note {
    font-size: 0.72rem !important;
    color: var(--color-text-dim) !important;
    margin-top: 10px !important;
    margin-bottom: 0 !important;
}

/* Usage Warning */

.usage-warning {
    flex-shrink: 0;
    padding: 6px 16px;
    text-align: center;
}

.usage-warning p {
    font-size: 0.78rem;
    color: var(--color-gold-dim);
    margin: 0;
    padding: 8px 14px;
    background: rgba(201, 162, 39, 0.06);
    border: 1px solid rgba(201, 162, 39, 0.12);
    border-radius: 8px;
    line-height: 1.4;
}

/* Account Toggle */

.account-toggle {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dim);
    cursor: pointer;
    transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.account-toggle:hover {
    border-color: var(--color-border-strong);
    color: var(--color-gold-dim);
}

/* Journal button in the chat header (sits beside the settings cog) */

.chat-header-journal {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-dim);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.chat-header-journal:hover {
    border-color: var(--color-border-strong);
    color: var(--color-gold-dim);
}

.chat-header-journal svg {
    flex-shrink: 0;
}

.chat-header-journal-label {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* When the journal button is present, it owns the right-alignment so the
   cog tucks in beside it with the header's gap between them. */
.chat-header-journal + .account-toggle {
    margin-left: 0;
}

/* Journal Sign-In Prompt (logged-out tap on Journal) */

.journal-signin-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.journal-signin-modal[hidden] {
    display: none;
}

.journal-signin-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.journal-signin-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 340px;
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 23, 64, 0.45), rgba(16, 16, 32, 0.7));
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px 20px;
}

.journal-signin-dialog h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-gold);
    margin: 0 0 8px;
}

.journal-signin-dialog p {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0 0 16px;
}

.journal-signin-dialog .google-signin-btn {
    width: 100%;
    justify-content: center;
}

.journal-signin-dialog .restore-cancel-btn {
    margin-top: 12px;
    font-size: 0.8rem;
    padding: 6px 16px;
}

/* Account Panel */

.account-panel {
    flex-shrink: 0;
    padding: 8px 16px;
}

.account-panel-inner {
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 23, 64, 0.25), rgba(16, 16, 32, 0.4));
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
}

.account-panel-inner h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 8px;
}

.account-usage p {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 4px 0;
    line-height: 1.5;
}

.account-panel-inner .restore-cancel-btn {
    margin-top: 10px;
    font-size: 0.78rem;
    padding: 6px 16px;
}

/* Chat Input */

.restore-link-text {
    font-size: 0.82rem;
    color: var(--color-text-dim);
    margin-top: 10px;
    margin-bottom: 0;
}

.restore-link-text a {
    color: var(--color-gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.restore-link-text a:hover {
    color: var(--color-gold-light);
}

.restore-panel {
    flex-shrink: 0;
    padding: 12px 16px;
}

.restore-panel-inner {
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 23, 64, 0.35), rgba(16, 16, 32, 0.55));
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    padding: 20px 16px;
}

.restore-panel-inner h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.restore-panel-inner > p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.restore-email-input {
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 0 auto 12px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s var(--ease);
}

.restore-email-input:focus {
    border-color: var(--color-gold-dim);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.06);
}

.restore-email-input::placeholder {
    color: var(--color-text-dim);
}

.restore-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.restore-submit-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-bg);
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    padding: 10px 24px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(201, 162, 39, 0.2);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.restore-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
}

.restore-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.restore-cancel-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-dim);
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 10px 20px;
    border-radius: 100px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.restore-cancel-btn:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text-muted);
}

.restore-message {
    font-size: 0.82rem;
    line-height: 1.5;
    min-height: 1.2em;
    margin: 0;
}

.restore-error {
    color: #d4a0a0;
}

.restore-success {
    color: #a0d4a0;
}

/* ── Auth Panel ──────────────────────────── */

.google-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #3c4043;
    background: #ffffff;
    border: 1px solid #dadce0;
    padding: 12px 28px;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
    margin-bottom: 12px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.google-signin-btn:hover {
    background: #f8f9fa;
    border-color: #c6c9cd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.google-signin-btn:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.google-signin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.google-signin-btn .google-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.google-signin-status {
    font-size: 0.82rem;
    color: var(--color-gold-dim);
    margin: 4px 0 10px;
    line-height: 1.4;
}

.google-signin-status.auth-error,
.auth-google-status.auth-error {
    color: #d4a0a0;
}

.auth-google-status {
    font-size: 0.82rem;
    color: var(--color-gold-dim);
    margin: 4px 0 10px;
    line-height: 1.4;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
}

.auth-divider span {
    font-size: 0.78rem;
    color: var(--color-text-dim);
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

.auth-panel {
    flex-shrink: 0;
    padding: 12px 16px;
}

.auth-panel-inner {
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 23, 64, 0.35), rgba(16, 16, 32, 0.55));
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    padding: 20px 16px;
}

.auth-panel-inner h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.auth-panel-inner > div > p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.auth-input {
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 0 auto 10px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s var(--ease);
}

.auth-input:focus {
    border-color: var(--color-gold-dim);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.06);
}

.auth-input::placeholder {
    color: var(--color-text-dim);
}

.auth-input[readonly] {
    opacity: 0.7;
    cursor: default;
}

.auth-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
    margin-top: 4px;
}

.auth-submit-btn {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-bg);
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    padding: 10px 24px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(201, 162, 39, 0.2);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-link-text {
    font-size: 0.82rem;
    margin-top: 10px;
    margin-bottom: 4px;
}

.auth-link-text a {
    color: var(--color-gold);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.auth-link-text a:hover {
    color: var(--color-gold-light);
}

.auth-message {
    font-size: 0.82rem;
    line-height: 1.5;
    min-height: 1.2em;
    margin: 0;
    margin-top: 6px;
}

.auth-error {
    color: #d4a0a0;
}

.auth-success {
    color: #a0d4a0;
}

.chat-input {
    flex-shrink: 0;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: #0b0815;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.free-questions-counter {
    text-align: center;
    font-size: 0.78rem;
    color: var(--color-text-dim);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.chat-input textarea {
    flex: 1;
    width: 100%;
    min-height: 48px;
    max-height: 120px;
    border-radius: 16px;
    padding: 12px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    resize: none;
    outline: none;
    line-height: 1.5;
    -webkit-appearance: none;
    transition: border-color 0.3s var(--ease);
}

.chat-input textarea::placeholder {
    color: var(--color-text-dim);
}

.chat-input textarea:focus {
    border-color: var(--color-gold-dim);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.06);
}

.chat-input textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input #send-button {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    color: var(--color-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease);
    box-shadow: 0 2px 12px rgba(201, 162, 39, 0.2);
}

.chat-input #send-button:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.3);
}

.chat-input #send-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Book CTA Section ─────────────────────── */

.book-section {
    padding: 88px 0;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-subtle) 100%);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.book-covers {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 48px;
}

.book-cover-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: transform 0.4s var(--ease);
}

.book-cover-card:hover {
    transform: translateY(-6px);
}

.book-cover-img {
    width: 200px;
    max-width: 100%;
    height: auto;
    border-radius: 4px 12px 12px 4px;
    border: 1px solid var(--color-border-strong);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(201, 162, 39, 0.06);
    transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.book-cover-card:hover .book-cover-img {
    border-color: var(--color-gold-dim);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(201, 162, 39, 0.12),
        0 0 120px rgba(201, 162, 39, 0.06);
}

.book-cover-label {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-gold);
    letter-spacing: 0.02em;
    transition: color 0.3s var(--ease);
}

.book-cover-card:hover .book-cover-label {
    color: var(--color-gold-light);
}

/* ── Footer ───────────────────────────────── */

.site-footer {
    padding: 52px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.footer-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 300;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
    margin: 28px 0 24px;
}

.footer-business {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    line-height: 1.8;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.footer-business-name {
    margin-bottom: 2px;
}

.footer-business-brands {
    margin-bottom: 2px;
    color: var(--color-text-dim);
}

.footer-business-contact {
    margin-top: 4px;
}

.footer-business-contact a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.footer-business-contact a:hover {
    color: var(--color-gold);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.3s var(--ease);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.footer-links a:hover {
    color: var(--color-gold);
}

/* ── Legal Pages ─────────────────────────── */

.legal-page {
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    padding: 0 20px;
}

.legal-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 0 20px;
    border-bottom: 1px solid var(--color-border);
}

.legal-back {
    font-size: 0.85rem;
    color: var(--color-gold-dim);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.legal-back:hover {
    color: var(--color-gold);
}

.legal-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 0 80px;
}

.legal-content h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.legal-content .legal-updated {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}

.legal-content h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 36px 0 12px;
}

.legal-content p,
.legal-content li {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    font-weight: 400;
}

.legal-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 16px;
}

.legal-content li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 6px;
}

.legal-content li::before {
    content: '·';
    position: absolute;
    left: 6px;
    color: var(--color-gold-dim);
}

.legal-content a {
    color: var(--color-gold-dim);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.legal-content a:hover {
    color: var(--color-gold);
}

/* ── Chat Intro (dedicated chat page) ────── */

[data-page="chat"] .chat-header {
    padding-top: 16px;
}

.chat-intro {
    text-align: center;
    padding: 24px 8px 8px;
}

.chat-intro-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 10px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.chat-intro-subtitle {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    max-width: 420px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.6;
}

/* ── Scrollbar ────────────────────────────── */

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: 10px;
}

/* ── Animations ───────────────────────────── */

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30%           { opacity: 1;   transform: scale(1); }
}

/* ── PWA Install Banner ──────────────────── */

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(135deg, rgba(12, 12, 26, 0.97), rgba(6, 6, 12, 0.98));
    border-top: 1px solid var(--color-border-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
    pointer-events: none;
}

.pwa-install-banner.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-install-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    flex: 1;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-accept {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-bg);
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    border: none;
    padding: 8px 20px;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
    box-shadow: 0 2px 12px rgba(201, 162, 39, 0.2);
}

.pwa-install-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
}

.pwa-install-dismiss {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--color-text-dim);
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 8px 16px;
    border-radius: 100px;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.pwa-install-dismiss:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text-muted);
}

/* ── Standalone PWA adjustments ──────────── */

@media (display-mode: standalone) {
    .brand-bar {
        padding-top: calc(18px + env(safe-area-inset-top));
    }

    .chat-header {
        padding-top: calc(56px + env(safe-area-inset-top));
    }

    [data-page="chat"] .chat-header {
        padding-top: calc(16px + env(safe-area-inset-top));
    }

    .hero {
        padding-top: calc(120px + env(safe-area-inset-top));
    }
}

@media (display-mode: standalone) and (max-width: 480px) {
    .brand-bar {
        padding-top: calc(14px + env(safe-area-inset-top));
    }

    .chat-header {
        padding-top: calc(48px + env(safe-area-inset-top));
    }

    [data-page="chat"] .chat-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    .hero {
        padding-top: calc(90px + env(safe-area-inset-top));
    }
}

/* ── Responsive ───────────────────────────── */

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 90px 0 56px;
    }

    .brand-bar {
        padding: 14px 16px;
    }

    .brand-name {
        display: none;
    }

    .hero-badge {
        font-size: 0.65rem;
        padding: 6px 16px;
        margin-bottom: 28px;
    }

    .hero-title {
        font-size: clamp(2.6rem, 10vw, 3.4rem);
        margin-bottom: 24px;
    }

    .hero-subtitle {
        margin-bottom: 36px;
        font-size: 0.95rem;
    }

    .hero-cta-group {
        gap: 12px;
        margin-bottom: 16px;
    }

    .cta-button {
        padding: 14px 36px;
        font-size: 0.93rem;
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .cta-button-secondary {
        padding: 12px 32px;
        font-size: 0.88rem;
        width: 100%;
        max-width: 280px;
    }

    .hero-cta-group .google-signin-btn {
        padding: 12px 32px;
        font-size: 0.88rem;
        width: 100%;
        max-width: 280px;
    }

    .app-mockup-section {
        padding: 20px 0 60px;
    }

    .app-mockup {
        border-radius: 16px;
    }

    .mockup-body {
        padding: 16px;
        gap: 12px;
    }

    .mockup-message {
        font-size: 0.82rem;
        padding: 10px 14px;
    }

    .reflective-questions-section {
        padding: 44px 0;
    }

    .reflective-question {
        font-size: 1.05rem;
    }

    .features-section {
        padding: 56px 0;
    }

    .feature-card-new {
        padding: 28px 22px;
    }

    .trust-section {
        padding: 44px 0;
    }

    .trust-grid {
        gap: 20px 24px;
    }

    .book-section-new {
        padding: 64px 0;
    }

    .book-covers-new {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .book-cover-img-new {
        width: 160px;
    }

    .features {
        padding: 52px 0;
    }

    .feature-card {
        padding: 18px;
    }

    .book-section {
        padding: 52px 0;
    }

    .chat-header {
        padding-top: 48px;
    }

    [data-page="chat"] .chat-header {
        padding-top: 12px;
    }

    /* Keep both header icons tappable without crowding the title on mobile. */
    .chat-header-journal-label {
        display: none;
    }

    .chat-header-journal {
        padding: 0;
        width: 32px;
        justify-content: center;
    }

    .starter-prompt {
        font-size: 0.78rem;
        padding: 7px 14px;
    }

    .message {
        max-width: 92%;
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .book-covers {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .book-cover-img {
        width: 180px;
    }

    .subscription-banner.visible {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .subscription-banner-inner {
        padding: 24px 20px calc(80px + env(safe-area-inset-bottom));
    }

    .premium-badge {
        margin-bottom: 14px;
        padding: 5px 18px;
        font-size: 0.65rem;
    }

    .subscription-banner-inner h3 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .premium-subtext {
        margin-bottom: 14px;
        font-size: 0.84rem;
    }

    .premium-benefits-list {
        margin-bottom: 16px;
    }

    .premium-benefits-list li {
        padding: 4px 0;
        font-size: 0.83rem;
    }

    .subscription-banner-cta {
        padding: 12px 32px;
        font-size: 0.88rem;
    }

    .premium-usage-note {
        margin-top: 10px;
        font-size: 0.73rem;
    }

    .premium-pricing-detail {
        margin-top: 8px;
        font-size: 0.78rem;
    }

    .premium-divider-line {
        margin: 12px auto;
    }

    .subscription-banner-inner .restore-link-text {
        font-size: 0.79rem;
        margin-top: 6px;
    }
}

/* ── Desktop readability enhancements ────── */

@media (min-width: 1024px) {
    .footer-links a {
        font-size: 0.84rem;
    }

    .footer-business {
        font-size: 0.78rem;
        line-height: 1.9;
    }

    .trust-item span {
        font-size: 0.82rem;
    }

    .feature-card-desc {
        font-size: 0.9rem;
    }

    .legal-content p,
    .legal-content li {
        font-size: 0.92rem;
    }
}

/* ── Reflection Path Screen ──────────────── */

.path-screen {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.path-screen .container {
    position: relative;
    z-index: 1;
}

.path-back {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--color-text-dim);
    text-decoration: none;
    margin-bottom: 36px;
    transition: color 0.3s var(--ease);
}

.path-back:hover {
    color: var(--color-gold);
}

.path-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: 600;
    line-height: 1.1;
    color: var(--color-text);
    margin-bottom: 18px;
    letter-spacing: -0.01em;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.path-subtitle {
    font-size: clamp(0.98rem, 2.2vw, 1.1rem);
    color: var(--color-text-muted);
    max-width: 480px;
    margin: 0 auto 48px;
    font-weight: 400;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.path-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.path-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 110px;
    padding: 24px 18px;
    background: rgba(12, 12, 26, 0.6);
    border: 1px solid rgba(201, 162, 39, 0.1);
    border-radius: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}

.path-card:hover {
    border-color: rgba(201, 162, 39, 0.28);
    background: var(--color-surface-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 40px rgba(201, 162, 39, 0.05);
    transform: translateY(-3px);
}

.path-card:active {
    transform: translateY(-1px);
}

.path-card-label {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .path-screen {
        padding: 100px 0 60px;
    }

    .path-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .path-card {
        min-height: 96px;
        padding: 20px 14px;
    }

    .path-card-label {
        font-size: 1.1rem;
    }
}

@media (max-width: 380px) {
    .path-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Brand Nav (Journal navigation) ──────── */

.brand-bar.has-nav {
    justify-content: space-between;
    gap: 16px;
}

.brand-nav {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    pointer-events: auto;
}

.brand-nav-link {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

.brand-nav-link:hover {
    color: var(--color-gold);
}

.brand-nav-link.is-active {
    color: var(--color-gold);
}

/* ── Journal Page ────────────────────────── */

.journal-page {
    min-height: 100dvh;
    padding: 120px 0 80px;
    width: 100%;
}

.journal-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: 600;
    line-height: 1.1;
    color: var(--color-text);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.journal-subtitle {
    font-size: clamp(0.98rem, 2.2vw, 1.1rem);
    color: var(--color-text-muted);
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 36px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.journal-actions {
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.journal-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    animation: fadeInUp 0.5s ease-out both;
}

.journal-field {
    margin-bottom: 22px;
    text-align: left;
}

.journal-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-gold-dim);
    margin-bottom: 8px;
}

.journal-input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.journal-input:focus {
    border-color: var(--color-gold-dim);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.06);
}

.journal-input::placeholder {
    color: var(--color-text-dim);
}

.journal-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b3ada5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.journal-textarea {
    resize: vertical;
    min-height: 160px;
    line-height: 1.6;
}

.journal-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

.journal-form-note {
    margin-top: 16px;
    font-size: 0.88rem;
    color: var(--color-gold-dim);
    min-height: 1.2em;
}

.journal-entries {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.journal-empty {
    color: var(--color-text-dim);
    font-size: 0.95rem;
}

.journal-entry {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    animation: fadeInUp 0.5s ease-out both;
}

.journal-entry-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.journal-entry-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
    margin: 0;
}

.journal-entry-mood {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-gold-dim);
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    padding: 4px 12px;
    white-space: nowrap;
}

.journal-entry-date {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.journal-entry-text {
    margin-top: 14px;
    color: var(--color-text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.journal-form-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 20px;
    text-align: left;
}

.journal-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.journal-entry-btn {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    padding: 7px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.journal-entry-btn:hover {
    color: var(--color-gold-dim);
    border-color: var(--color-gold-dim);
}

.journal-entry-btn-danger:hover {
    color: #e0a0a0;
    border-color: #e0a0a0;
}

@media (max-width: 480px) {
    .journal-page {
        padding: 96px 0 56px;
    }

    .journal-form {
        padding: 22px 18px;
    }

    .journal-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .journal-form-actions .cta-button,
    .journal-form-actions .cta-button-secondary {
        width: 100%;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }

    .brand-bar.has-nav .brand-name {
        display: none;
    }
}
