/* ============================================================
   Target Ortho Discover
   Landing: light split layout | Chat: dark
   ============================================================ */

:root {
    /* Blue accent (landing — matches Target Ortho support) */
    --teal:        #2563eb;
    --teal-dark:   #1d4ed8;
    --teal-light:  #eff6ff;
    --teal-grad:   linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);

    /* Dark theme (chat) */
    --primary: #2563eb;
    --purple:  #7c3aed;
    --grad:    linear-gradient(135deg, #2563eb, #7c3aed);
    --grad-text: linear-gradient(135deg, #60a5fa, #a78bfa);

    --bg:           #0f172a;
    --bg-card:      rgba(255,255,255,0.04);
    --bg-card-hover:rgba(255,255,255,0.07);
    --border:       rgba(255,255,255,0.08);
    --border-focus: rgba(37,99,235,0.6);

    --text:      #f8fafc;
    --text-muted:#94a3b8;
    --text-dim:  #475569;

    --radius:    18px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow:    0 8px 32px rgba(0,0,0,0.4);
    --transition:all 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: clip;   /* prevent horizontal overflow WITHOUT creating a scroll container (keeps vertical scroll working on mobile) */
}

/* ── Gradient text ─────────────────────────────────────────── */
.grad-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* orbs hidden on landing (light theme), only used in chat dark bg */
.orb { display: none; }

/* ── Landing Page — centered category layout ────────────────── */
#landing {
    min-height: 100vh;
    background: #ffffff;
    display: flex;
    justify-content: center;
}

.landing-inner {
    width: 100%;
    max-width: 880px;
    padding: 108px 32px 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Category grid */
.landing-cats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
    margin: 28px 0 36px;
}

.lcat {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 18px 18px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.lcat:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 18px rgba(37,99,235,0.12);
    transform: translateY(-2px);
}
.lcat-icon { font-size: 26px; line-height: 1; margin-bottom: 2px; }
.lcat-name { font-size: 15px; font-weight: 700; color: #0f172a; }
.lcat-meta { font-size: 12px; color: #64748b; line-height: 1.4; }

/* Search section */
.landing-search-section {
    width: 100%;
    max-width: 600px;
}
.landing-search-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
}

/* ── Top logo bar ───────────────────────────────────────────── */
.topbar-landing {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 18px 40px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #f1f5f9;
}

/* ── What's New ticker ─────────────────────────────────────────── */
.whats-new-ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto 22px;
    background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(124,58,237,0.08));
    border: 1px solid rgba(37,99,235,0.18);
    border-radius: 999px;
    padding: 8px 8px 8px 16px;
    overflow: hidden;
}
.whats-new-ticker .wn-label {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
    color: #2563eb;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.whats-new-ticker .wn-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.whats-new-ticker .wn-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: wnScroll 26s linear infinite;
}
.whats-new-ticker:hover .wn-track { animation-play-state: paused; }
.whats-new-ticker .wn-item {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
    padding: 0 22px;
    position: relative;
}
.whats-new-ticker .wn-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #94a3b8;
}
@keyframes wnScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }   /* half, because items are duplicated */
}
@media (prefers-reduced-motion: reduce) {
    .whats-new-ticker .wn-track { animation: none; }
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-mark {
    width: 36px; height: 36px;
    background: var(--teal-grad);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 900; color: white;
    letter-spacing: -0.03em;
}
.logo-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: fit-content;
    letter-spacing: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.landing-headline {
    font-size: clamp(34px, 4vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: #0f172a;
}

.landing-headline .grad-text {
    background: var(--teal-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-sub {
    font-size: 16px;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 0;
    max-width: 560px;
}

/* ── Search bar ─────────────────────────────────────────────── */
.search-wrap {
    width: 100%;
    position: relative;
    margin-bottom: 0;
}

.search-input {
    width: 100%;
    padding: 18px 58px 18px 50px;
    font-size: 15px;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    outline: none;
    color: #0f172a;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.search-input::placeholder { color: #94a3b8; }
.search-input:focus {
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12), 0 2px 12px rgba(0,0,0,0.06);
}

.search-icon {
    position: absolute;
    left: 18px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
}

.search-send {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    background: var(--teal-grad);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 17px;
    box-shadow: 0 3px 12px rgba(13,148,136,0.35);
    transition: var(--transition);
    flex-shrink: 0;
}
.search-send:hover { transform: translateY(-50%) scale(1.07); }
.search-send:disabled { opacity: 0.5; cursor: not-allowed; transform: translateY(-50%); }

/* ── Suggestion chips ───────────────────────────────────────── */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.chips-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-right: 4px;
    display: flex;
    align-items: center;
}

.chip {
    padding: 6px 14px;
    border-radius: 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.chip:hover {
    background: rgba(13,148,136,0.08);
    border-color: rgba(13,148,136,0.3);
    color: var(--teal-dark);
}

/* ── Stats row ──────────────────────────────────────────────── */
.stats-row {
    display: flex;
    align-items: center;
    margin-bottom: 36px;
}
.stat {
    text-align: left;
    padding: 0 24px 0 0;
}
.stat:first-child { padding-left: 0; }
.stat-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--teal);
    line-height: 1;
}
.stat-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    white-space: nowrap;
    font-weight: 500;
}
.stat-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
    margin-right: 24px;
    flex-shrink: 0;
}

/* ── CTA block ───────────────────────────────────────────────── */
.landing-cta-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

/* ── Landing CTA (lives inside secondary-actions now) ───────── */
.cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 22px;
    background: var(--teal-grad);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 3px 14px rgba(37,99,235,0.3);
    white-space: nowrap;
}
.cta-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cta-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
    display: block;
}

/* RIGHT — removed (doctor image no longer used) */
.landing-right { display: none; }
.doctor-img    { display: none; }

/* ── Missing content — fixed top bar ─────────────────────────── */
.missing-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: none;
}
.missing-bar.visible { display: block; }

.missing-bar-inner {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}
.missing-bar-text {
    font-size: 13.5px;
    color: #475569;
    flex: 1;
}
.missing-bar-btn {
    padding: 7px 16px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.missing-bar-btn:hover { opacity: 0.85; }
.missing-bar-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    transition: color 0.15s;
}
.missing-bar-close:hover { color: #1e293b; }

/* ── Missing content popover ─────────────────────────────────── */
.missing-popover {
    position: fixed;
    top: 64px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 100%;
    max-width: 420px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 22px 24px;
    z-index: 201;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.missing-popover.open {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.missing-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.missing-popover-head strong {
    font-size: 15px;
    color: var(--text);
}
.missing-popover-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.15s;
}
.missing-popover-close:hover { color: var(--text); }

.missing-popover-sub {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.5;
}

.missing-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.missing-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.missing-input:focus { border-color: rgba(37,99,235,0.5); }
.missing-input::placeholder { color: var(--text-dim); }

.missing-btn {
    padding: 10px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.missing-btn:hover { opacity: 0.85; }
.missing-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.missing-success {
    font-size: 13px;
    color: #34d399;
    padding: 8px 0;
    text-align: center;
}

/* Chat lead card — missing content variant */
.lead-card-missing {
    border-color: rgba(124,58,237,0.25);
    background: rgba(124,58,237,0.06);
}

/* ── Chat page ──────────────────────────────────────────────── */
#chat-page {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
    z-index: 1;
}
#chat-page.active { display: flex; }

/* Sticky top bar — logo only */
.chat-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-logo {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    cursor: pointer;
    background: var(--teal-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Bottom input bar */
.chat-input-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #e2e8f0;
    padding: 14px 24px 18px;
    display: none;
}

.chat-input-bar.active { display: block; }

.topbar-search-wrap {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
}
.topbar-search {
    width: 100%;
    padding: 13px 50px 13px 18px;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-size: 15px;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.topbar-search::placeholder { color: #94a3b8; }
.topbar-search:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.topbar-send {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    background: var(--teal-grad);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.topbar-send:hover { opacity: 0.85; }
.topbar-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Chat messages */
.chat-messages {
    padding: 32px 24px 140px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg-user {
    background: var(--teal-grad);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 14px 20px;
    font-size: 15px;
    line-height: 1.6;
    align-self: flex-end;
    max-width: 80%;
    box-shadow: 0 4px 16px rgba(37,99,235,0.2);
}

.msg-ai {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px 18px 18px 18px;
    padding: 18px 22px;
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
    max-width: 92%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.msg-ai strong { color: #0f172a; }
.msg-ai p { margin: 0 0 8px 0; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai .ai-section {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 14px 0 6px;
}
.msg-ai .ai-section:first-child { margin-top: 0; }
.msg-ai .ai-heading {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px;
}
.msg-ai .ai-list {
    margin: 0 0 8px 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msg-ai .ai-list li { color: #475569; }
.msg-ai .ai-gap { height: 6px; }

.msg-ai-label {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px 18px 18px 18px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.typing-dot {
    width: 7px; height: 7px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); background: #cbd5e1; }
    30% { transform: translateY(-6px); background: #2563eb; }
}

/* ── Ticket card ────────────────────────────────────────────── */
.ticket-card {
    background: linear-gradient(135deg, rgba(245,158,11,0.07), rgba(239,68,68,0.05));
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 4px;
    max-width: 92%;
}
.ticket-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #d97706;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.ticket-card-sub {
    font-size: 14px;
    color: #475569;
    margin-bottom: 16px;
}

/* ── Feedback ───────────────────────────────────────────────── */
.feedback-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.feedback-label {
    font-size: 12px;
    color: #94a3b8;
    flex: 1;
}
.feedback-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.feedback-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.feedback-thanks {
    font-size: 12px;
    color: #64748b;
}
.feedback-picker {
    margin-top: 10px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.feedback-picker-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}
.feedback-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.feedback-reason-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}
.feedback-reason-btn:hover { border-color: #2563eb; color: #2563eb; }
.feedback-reason-btn.selected {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 600;
}
.feedback-text {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #334155;
    resize: none;
    margin-bottom: 8px;
    font-family: inherit;
    outline: none;
}
.feedback-text:focus { border-color: #2563eb; }
.feedback-submit-btn {
    background: var(--teal-grad);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.feedback-submit-btn:hover { opacity: 0.85; }

/* ── Offer card ─────────────────────────────────────────────── */
.offer-card {
    background: linear-gradient(135deg, rgba(37,99,235,0.07), rgba(124,58,237,0.07));
    border: 1px solid rgba(37,99,235,0.25);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 4px;
    max-width: 92%;
}
.offer-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.offer-card-text {
    font-size: 15px;
    color: #334155;
    margin-bottom: 14px;
    line-height: 1.6;
}
.offer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(37,99,235,0.4);
}
.offer-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Lead capture card ──────────────────────────────────────── */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-top: 4px;
    max-width: 92%;
    backdrop-filter: blur(10px);
}
.lead-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.lead-card-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}
.lead-form { display: flex; flex-direction: column; gap: 10px; }
.lead-input {
    padding: 11px 14px;
    border-radius: var(--radius-xs);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
}
.lead-input::placeholder { color: #94a3b8; }
.lead-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.lead-submit {
    padding: 12px;
    background: var(--grad);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.lead-submit:hover { opacity: 0.9; }
.lead-success {
    display: none;
    font-size: 14px;
    color: #34d399;
    padding: 12px;
    background: rgba(52,211,153,0.1);
    border: 1px solid rgba(52,211,153,0.25);
    border-radius: var(--radius-xs);
    text-align: center;
}

/* ── Chat bottom input (mobile) ─────────────────────────────── */
.chat-bottom {
    position: sticky;
    bottom: 0;
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 14px 24px 20px;
    display: none; /* shown only on mobile */
}
@media (max-width: 640px) {
    .chat-messages { padding: 20px 16px 110px; }
    .chat-input-bar { padding: 12px 16px 16px; }
}

/* ── Welcome message bubble ─────────────────────────────────── */
.msg-welcome {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: #1d4ed8;
    margin-bottom: 8px;
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Landing responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .landing-inner { padding: 92px 24px 56px; }
    .landing-cats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 640px) {
    .landing-inner { padding: 84px 16px 48px; }
    .landing-headline { font-size: 30px; }
    .landing-sub { font-size: 15px; }
    .landing-cats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .lcat { padding: 16px 14px; }
    .lcat-icon { font-size: 22px; }
    .lcat-name { font-size: 14px; }
    .chat-messages { padding: 20px 16px 110px; }
    .chat-input-bar { padding: 12px 16px 16px; }

    /* Compact top bar so it doesn't overflow the viewport */
    .topbar-landing { padding: 12px 14px; }
    .landing-logo { gap: 6px; }
    .logo-mark { width: 30px; height: 30px; font-size: 14px; }
    .logo-name { font-size: 16px; }
    .topbar-landing-right { gap: 8px; }
    .browse-btn, .back-to-main { font-size: 12px; padding: 6px 11px; }
}

/* Very narrow phones: drop the secondary "back to main site" link so the
   primary Browse button always fits without overflow. */
@media (max-width: 400px) {
    .back-to-main { display: none; }
}

/* 4.13 — iOS safe-area-inset: keep input bar above the home indicator notch */
.chat-input-bar {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
@supports not (padding: env(safe-area-inset-bottom)) {
    .chat-input-bar { padding-bottom: 18px; }
}

/* 4.12 — respect user's reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .typing-dot { animation: none !important; opacity: 0.5; }
}

/* ── Top bar: flex layout ────────────────────────────────────── */
.topbar-landing {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-landing-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Back to main site link ─────────────────────────────────── */
.back-to-main {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: var(--transition);
    white-space: nowrap;
}
.back-to-main:hover {
    color: var(--teal);
    border-color: #bfdbfe;
    background: #eff6ff;
}

/* Chat topbar right group (new-chat + back link) */
.chat-topbar {
    justify-content: space-between;
}
.chat-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.back-to-main-chat {
    font-size: 12px;
    padding: 6px 12px;
}
.new-chat-btn {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.new-chat-btn:hover {
    color: var(--teal);
    border-color: #bfdbfe;
    background: #eff6ff;
}

/* ── Subscriber check card ───────────────────────────────────── */
.subscriber-check {
    margin-top: 24px;
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 480px;
}
.sc-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
.sc-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.sc-btn {
    padding: 9px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid;
    font-family: inherit;
    transition: var(--transition);
}
.sc-yes {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.sc-yes:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.sc-no {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}
.sc-no:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

/* ── Browse modules button (lives in topbar) ─────────────────── */
.browse-btn {
    padding: 7px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    white-space: nowrap;
}
.browse-btn:hover {
    border-color: #bfdbfe;
    color: var(--teal);
    background: #eff6ff;
}

/* ── Browse panel overlay ────────────────────────────────────── */
.browse-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 300;
    align-items: flex-end;
    justify-content: center;
}
.browse-overlay.open {
    display: flex;
}

.browse-panel {
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 24px 24px 40px;
    width: 100%;
    max-width: 640px;
    max-height: 78vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.browse-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.browse-head strong {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.browse-close {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 16px;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.browse-close:hover { background: #e2e8f0; color: #1e293b; }

.browse-sub {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 18px;
}
.browse-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}
.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.browse-item {
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: var(--transition);
    line-height: 1.4;
}
.browse-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--teal);
}

/* ── Progressive typing text ─────────────────────────────────── */
.typing-text {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
    animation: fadeInOut 0.4s ease;
}
@keyframes fadeInOut {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}
.typing-indicator {
    gap: 10px;
}

/* ── Streaming message bubble ────────────────────────────────── */
.msg-ai.streaming {
    border-color: #bfdbfe;
    background: #fafcff;
    min-height: 48px;
    display: flex;
    align-items: center;
}
.ai-thinking-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 2px 0;
}
.ai-thinking-dots span {
    width: 8px;
    height: 8px;
    background: #93c5fd;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}
.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
/* Fade in the response text once streaming is done */
.msg-ai:not(.streaming) {
    animation: fadeInMsg 0.2s ease;
}
@keyframes fadeInMsg {
    from { opacity: 0.4; }
    to   { opacity: 1; }
}

/* ── Fair-usage email gate ───────────────────────────────────── */
.email-gate .gate-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.email-gate .gate-email {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}
.email-gate .gate-email:focus {
    border-color: #2563eb;
}
.email-gate .gate-submit {
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.email-gate .gate-submit:hover { background: #1d4ed8; }
.email-gate .gate-submit:disabled { opacity: 0.6; cursor: default; }
.email-gate .gate-msg {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

/* ── Offer code row ──────────────────────────────────────────── */
.offer-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 14px;
    flex-wrap: wrap;
}
.offer-code-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.offer-code {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #7c3aed;
    background: rgba(124,58,237,0.08);
    border: 1px dashed rgba(124,58,237,0.3);
    padding: 4px 12px;
    border-radius: 6px;
    letter-spacing: 0.08em;
}
.copy-code-btn {
    padding: 5px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.copy-code-btn:hover {
    background: #f1f5f9;
    color: #334155;
}
.copy-code-btn.copied {
    color: #16a34a;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

/* ── Form privacy line ───────────────────────────────────────── */
.form-privacy {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.5;
    text-align: center;
    margin-top: 4px;
}

/* ── Error / retry message ───────────────────────────────────── */
.msg-error {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 4px 18px 18px 18px;
    padding: 14px 18px;
    font-size: 14px;
    color: #92400e;
    max-width: 92%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.retry-btn {
    align-self: flex-start;
    padding: 7px 16px;
    background: transparent;
    border: 1.5px solid #f97316;
    border-radius: 20px;
    color: #ea580c;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.retry-btn:hover {
    background: #fff7ed;
    border-color: #ea580c;
}

/* Budget-exceeded card */
.budget-card {
    background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(239,68,68,0.04));
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 4px 18px 18px 18px;
    padding: 14px 18px;
    font-size: 14px;
    color: #92400e;
    max-width: 92%;
    line-height: 1.6;
}

/* ── AI disclaimer ───────────────────────────────────────────── */
.ai-disclaimer {
    text-align: center;
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 8px;
    line-height: 1.4;
}

/* ── Mobile adjustments for new elements ────────────────────── */
@media (max-width: 640px) {
    .browse-panel {
        padding: 20px 16px 36px;
        max-height: 85vh;
    }
    .browse-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
    }
    .subscriber-check {
        max-width: 100%;
    }
    .sc-btns {
        flex-direction: column;
    }
    .sc-btn {
        width: 100%;
        text-align: center;
    }
    .browse-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    .topbar-landing-right {
        gap: 6px;
    }
    .back-to-main {
        font-size: 12px;
        padding: 6px 10px;
    }
    .offer-code-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ════════════════════════════════════════════════════════════
   BROWSE PAGE — full-screen content library
════════════════════════════════════════════════════════════ */

.browse-pg {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.browse-pg.open { transform: translateX(0); }

/* ── Header ──────────────────────────────────────────────── */
.bpg-hd {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}
.bpg-back {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    font-family: inherit;
    white-space: nowrap;
    transition: color 0.15s;
    flex-shrink: 0;
}
.bpg-back:hover { color: var(--teal); }

.bpg-hd-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.bpg-hd-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.bpg-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.bpg-stat {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}
.bpg-stat-dot { color: #cbd5e1; font-size: 14px; }

/* ── Tab bar ─────────────────────────────────────────────── */
.bpg-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px;
}
.bpg-tabs::-webkit-scrollbar { display: none; }

.bpg-tab {
    flex-shrink: 0;
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-bottom: -1px;
}
.bpg-tab em {
    font-style: normal;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 10px;
}
.bpg-tab:hover { color: var(--teal); }
.bpg-tab.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}
.bpg-tab.active em {
    background: #eff6ff;
    color: var(--teal);
}

/* ── Panel body ──────────────────────────────────────────── */
.bpg-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.bpg-panel { display: none; padding: 28px 28px 48px; }
.bpg-panel.active { display: block; }

.bpg-intro {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 680px;
}

/* ── Module grid ─────────────────────────────────────────── */
.bpg-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.bpg-mc {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 18px 14px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
}
.bpg-mc:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 20px rgba(37,99,235,0.1);
    transform: translateY(-2px);
}

/* Number badge */
.bpg-mc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0;
    flex-shrink: 0;
}
.bpg-mc--blue   .bpg-mc-num { background: linear-gradient(135deg,#2563eb,#3b82f6); }
.bpg-mc--green  .bpg-mc-num { background: linear-gradient(135deg,#059669,#34d399); }
.bpg-mc--purple .bpg-mc-num { background: linear-gradient(135deg,#7c3aed,#a78bfa); }
.bpg-mc--orange .bpg-mc-num { background: linear-gradient(135deg,#ea580c,#fb923c); }
.bpg-mc--red    .bpg-mc-num { background: linear-gradient(135deg,#dc2626,#f87171); }
.bpg-mc--teal   .bpg-mc-num { background: linear-gradient(135deg,#0891b2,#22d3ee); }
.bpg-mc--amber  .bpg-mc-num { background: linear-gradient(135deg,#d97706,#fbbf24); }
.bpg-mc--pink   .bpg-mc-num { background: linear-gradient(135deg,#db2777,#f472b6); }

.bpg-mc-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.bpg-mc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}
.bpg-mc-tags span {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.bpg-mc-cta {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 4px;
    transition: color 0.15s;
}
.bpg-mc:hover .bpg-mc-cta { color: var(--teal); }

/* ── DNB year groups ─────────────────────────────────────── */
.bpg-year-group { margin-bottom: 28px; }
.bpg-year-label {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}
.bpg-papers-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.bpg-paper {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 130px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bpg-paper:hover {
    border-color: #93c5fd;
    box-shadow: 0 3px 12px rgba(37,99,235,0.1);
}
.bpg-paper--dim {
    background: #f8fafc;
    opacity: 0.7;
    cursor: default;
    pointer-events: auto;
}
.bpg-paper--dim:hover {
    opacity: 0.7;
    border-color: #e2e8f0;
    box-shadow: none;
}

.bpg-paper-label {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.bpg-paper-ref {
    font-size: 11px;
    color: #2563eb;
    font-weight: 600;
}
.bpg-paper-status {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}
.bpg-paper-status--up   { color: #16a34a; }
.bpg-paper-status--wip  { color: #d97706; }
.bpg-paper-status--miss { color: #dc2626; }
.bpg-paper-status--none { color: #94a3b8; }

/* Chevron and active state on uploaded papers */
.bpg-paper-chevron {
    font-size: 16px;
    color: #cbd5e1;
    line-height: 1;
    margin-top: 2px;
    transition: transform 0.2s, color 0.2s;
    align-self: flex-end;
}
.bpg-paper.active {
    border-color: #2563eb;
    background: #eff6ff;
}
.bpg-paper.active .bpg-paper-label { color: #1d4ed8; }
.bpg-paper.active .bpg-paper-chevron {
    transform: rotate(90deg);
    color: #2563eb;
}

/* Year detail accordion panel */
.bpg-year-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1);
}
.bpg-year-detail.open {
    max-height: 480px;
}
.bpg-yd-inner {
    margin-top: 10px;
    padding: 18px 20px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.bpg-yd-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.bpg-yd-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.bpg-yd-title em {
    font-weight: 400;
    color: #64748b;
    font-style: normal;
    font-size: 13px;
}
.bpg-yd-badge {
    font-size: 10px;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    border-radius: 20px;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.bpg-yd-list {
    margin: 0 0 16px 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 6px 20px;
    list-style: none;
}
.bpg-yd-list li {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    padding-left: 14px;
    position: relative;
}
.bpg-yd-list li::before {
    content: '·';
    position: absolute;
    left: 4px;
    color: #2563eb;
    font-weight: 700;
}
.bpg-yd-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}
.bpg-yd-note {
    font-size: 12px;
    color: #94a3b8;
}
.bpg-yd-chat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s, transform 0.15s;
}
.bpg-yd-chat:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── FNB grid ────────────────────────────────────────────── */
.bpg-fnb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.bpg-fnb-card {
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.bpg-fnb-card:hover {
    border-color: #818cf8;
    box-shadow: 0 4px 16px rgba(99,102,241,0.15);
    transform: translateY(-2px);
}
.bpg-fnb-year {
    font-size: 20px;
    font-weight: 800;
    color: #3730a3;
    line-height: 1;
}
.bpg-fnb-ref {
    font-size: 11px;
    font-weight: 600;
    color: #6366f1;
}
.bpg-fnb-label {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}
.bpg-fnb-note {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}
.bpg-fnb-note strong { color: #92400e; }

/* ── MCQ subject grid ────────────────────────────────────── */
.bpg-mcq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.bpg-mcq-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 18px 14px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.bpg-mcq-card:hover {
    border-color: #6ee7b7;
    box-shadow: 0 4px 16px rgba(16,185,129,0.1);
    transform: translateY(-2px);
}
.bpg-mcq-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.bpg-mcq-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.bpg-mcq-tags span {
    font-size: 11px;
    color: #475569;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.bpg-mcq-cta {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 2px;
    transition: color 0.15s;
}
.bpg-mcq-card:hover .bpg-mcq-cta { color: #059669; }

/* ── eBook cards ─────────────────────────────────────────── */
.bpg-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    align-items: start;
}
.bpg-book {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 22px 18px;
}
.bpg-book--soon {
    background: #fafafa;
    border-style: dashed;
}
.bpg-book-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.bpg-book-badge--live  { background:#dcfce7; color:#16a34a; }
.bpg-book-badge--soon  { background:#fef9c3; color:#92400e; }

.bpg-book-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
    line-height: 1.2;
}
.bpg-book-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 16px;
}
.bpg-book-chapters {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bpg-ch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
}
.bpg-ch-num {
    width: 22px; height: 22px;
    background: var(--teal-grad);
    color: white;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bpg-ch-title {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
}
.bpg-book-soon-note {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: 8px;
}

/* ── Notes hero ──────────────────────────────────────────── */
.bpg-notes-hero {
    max-width: 560px;
    margin: 20px auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.bpg-notes-icon { font-size: 48px; }
.bpg-notes-hero h3 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}
.bpg-notes-hero p {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
}
.bpg-notes-cards {
    display: flex;
    gap: 14px;
    width: 100%;
}
.bpg-notes-card {
    flex: 1;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.bpg-notes-card-icon { font-size: 28px; }
.bpg-notes-card strong { font-size: 14px; color: #0f172a; }
.bpg-notes-card span  { font-size: 13px; color: #64748b; line-height: 1.4; }
.bpg-notes-access {
    font-size: 14px;
    color: #334155;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px 18px;
    line-height: 1.6;
    width: 100%;
    text-align: left;
}
.bpg-notes-cta {
    padding: 12px 28px;
    background: var(--teal-grad);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
    transition: opacity 0.2s, transform 0.15s;
}
.bpg-notes-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Detail panel (pre-written module content) ──────────── */
.bpg-detail {
    position: absolute;
    inset: 0;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 20;
    overflow: hidden;
}
.bpg-detail.open { transform: translateX(0); }

.bpg-detail-hd {
    flex-shrink: 0;
    padding: 14px 28px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}
.bpg-detail-back-btn {
    font-size: 14px;
}

.bpg-detail-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 32px 36px 64px;
    max-width: 760px;
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
}
.bpg-detail-body strong { color: #0f172a; }
.bpg-detail-body p { margin: 0 0 10px 0; }
.bpg-detail-body p:last-child { margin-bottom: 0; }
.bpg-detail-body .ai-section {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 18px 0 6px;
}
.bpg-detail-body .ai-section:first-child { margin-top: 0; }
.bpg-detail-body .ai-list {
    margin: 0 0 10px 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.bpg-detail-body .ai-list li { color: #475569; }
.bpg-detail-body .ai-gap { height: 8px; }
@media (max-width: 768px) {
    .bpg-detail-body { padding: 24px 20px 48px; }
}

/* ── Browse page responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .bpg-hd { padding: 12px 18px; gap: 12px; }
    .bpg-stats { display: none; }
    .bpg-panel { padding: 20px 16px 40px; }
    .bpg-modules-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .bpg-books-grid { grid-template-columns: 1fr; }
    .bpg-notes-cards { flex-direction: column; }
    .bpg-fnb-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
    .bpg-mcq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .bpg-hd-title { font-size: 16px; }
    .bpg-tab { padding: 11px 14px; font-size: 13px; }
    .bpg-modules-grid { grid-template-columns: repeat(2, 1fr); }
    .bpg-mc { padding: 14px 14px 12px; }
    .bpg-mc-name { font-size: 13px; }
}
