/**
 * SCRIPTURE LAB — DESIGN SYSTEM
 * Tone: Modern, scholarly, calm, trustworthy, distinctly Christian, highly readable.
 * Pure CSS3 with CSS Variables — No build steps, no npm.
 */

:root {
    /* Color Palette: Restrained, Scholarly, Warm */
    --color-bg-page: #fbf9f5;
    --color-bg-surface: #ffffff;
    --color-bg-subtle: #f5f1e8;
    --color-bg-card: #ffffff;

    /* Text & Ink */
    --color-text-primary: #1c232b;
    --color-text-secondary: #57626d;
    --color-text-muted: #828c96;
    --color-border: #e6e0d4;
    --color-border-light: #f0ebe1;

    /* Primary Accent: Deep Scholarly Navy & Dark Forest */
    --color-primary: #183344;
    --color-primary-light: #24465c;
    --color-primary-dark: #0f222e;
    --color-primary-forest: #16362a;

    /* Accent: Refined Antique Gold */
    --color-gold: #b5892f;
    --color-gold-hover: #9c7324;
    --color-gold-bg: #fdf8eb;
    --color-gold-border: #e8d7ad;

    /* Status & Alerts */
    --color-success: #28724d;
    --color-success-bg: #eef7f2;
    --color-warning: #9e6409;
    --color-warning-bg: #fef7ec;
    --color-info: #1b5e82;
    --color-info-bg: #edf6fb;

    /* Typography */
    --font-serif: "Charter", "Bitstream Charter", "Iowan Old Style", "Georgia", "Cambria", "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Shadows & Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-subtle: 0 1px 3px rgba(24, 35, 43, 0.05), 0 1px 2px rgba(24, 35, 43, 0.03);
    --shadow-card: 0 4px 12px rgba(24, 35, 43, 0.06), 0 1px 3px rgba(24, 35, 43, 0.04);
    --shadow-elevated: 0 10px 25px rgba(24, 35, 43, 0.08);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--color-bg-page);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary-dark);
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.scripture-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.85;
    color: var(--color-text-primary);
}

/* --------------------------------------------------------------------------
   Layout Containers
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container-narrow {
    max-width: 860px;
}

/* --------------------------------------------------------------------------
   Site Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
    background-color: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-subtle);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.brand-symbol {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-forest) 100%);
    color: var(--color-gold-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(181, 137, 47, 0.4);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary-dark);
    text-transform: uppercase;
}

.brand-tagline-subtle {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--color-gold);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-gold);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
    padding: var(--space-16) 0 var(--space-12) 0;
    text-align: center;
    background: radial-gradient(circle at 50% 10%, #ffffff 0%, var(--color-bg-page) 75%);
    border-bottom: 1px solid var(--color-border-light);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-4);
    background-color: var(--color-gold-bg);
    border: 1px solid var(--color-gold-border);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-gold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: var(--space-6);
}

.hero-title {
    font-size: 3.25rem;
    margin-bottom: var(--space-4);
    color: var(--color-primary-dark);
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    max-width: 680px;
    margin: 0 auto var(--space-6) auto;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 640px;
    margin: 0 auto var(--space-8) auto;
}

/* --------------------------------------------------------------------------
   Buttons & Links
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    line-height: 1.25;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(24, 51, 68, 0.25);
}

.btn-gold {
    background-color: var(--color-gold);
    color: #ffffff;
}

.btn-gold:hover {
    background-color: var(--color-gold-hover);
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: var(--color-bg-surface);
}

/* --------------------------------------------------------------------------
   Cards & Grids
   -------------------------------------------------------------------------- */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

.card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-2);
    color: var(--color-primary);
}

.card-text {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Study Lab Workflow Visualizer
   -------------------------------------------------------------------------- */
.study-flow-section {
    padding: var(--space-12) 0;
    background-color: var(--color-bg-subtle);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.section-title {
    font-size: 2rem;
    margin-bottom: var(--space-2);
}

.section-subtitle {
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.workflow-stepper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin: var(--space-8) 0;
}

.step-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
}

.step-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background-color: var(--color-gold-bg);
    color: var(--color-gold);
    padding: 2px 6px;
    border-radius: 4px;
}

.step-arrow {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Status Indicators & Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(40, 114, 77, 0.2);
}

.badge-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(158, 100, 9, 0.2);
}

.badge-gold {
    background-color: var(--color-gold-bg);
    color: var(--color-gold);
    border: 1px solid var(--color-gold-border);
}

.status-box {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-8) 0;
    box-shadow: var(--shadow-subtle);
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
}

.status-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    list-style: none;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background-color: var(--color-bg-page);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: auto;
    background-color: var(--color-primary-dark);
    color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-12) 0 var(--space-6) 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-brand h4 {
    color: #ffffff;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    margin-bottom: var(--space-2);
}

.footer-brand p {
    color: #94a3b8;
    font-size: 0.9375rem;
    max-width: 360px;
}

.footer-col h5 {
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

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

.footer-bottom {
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: #64748b;
}

/* --------------------------------------------------------------------------
   Forms & Authentication Cards
   -------------------------------------------------------------------------- */
.auth-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-card);
    max-width: 520px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-title {
    font-size: 1.85rem;
    margin-bottom: var(--space-2);
    color: var(--color-primary-dark);
}

.auth-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-light);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: var(--space-5);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    background-color: #ffffff;
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(24, 51, 68, 0.12);
}

.form-input.is-invalid {
    border-color: #b32d2e;
    box-shadow: 0 0 0 2px rgba(179, 45, 46, 0.15);
}

.form-error {
    color: #b32d2e;
    font-size: 0.8125rem;
    font-weight: 500;
}

.form-hint {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   Alert Banners
   -------------------------------------------------------------------------- */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: 0.9375rem;
    line-height: 1.4;
}

.alert-danger {
    background-color: #fdf2f2;
    border: 1px solid #f8b4b4;
    color: #9b1c1c;
}

.alert-success {
    background-color: #edf7ee;
    border: 1px solid #b7e4c7;
    color: #1e5e3a;
}

.alert-info {
    background-color: #edf6fb;
    border: 1px solid #bee3f8;
    color: #1b5e82;
}

.alert-warning {
    background-color: #fef7ec;
    border: 1px solid #fbd38d;
    color: #9e6409;
}

/* --------------------------------------------------------------------------
   Bible Reader Component & Typography
   -------------------------------------------------------------------------- */
.reader-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-subtle);
}

.reader-selectors-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.selector-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.selector-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.selector-select {
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 140px;
    background-color: var(--color-bg-page);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.reader-nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.reader-nav-btn {
    font-size: 0.85rem;
    padding: 0.55rem 1rem;
    white-space: nowrap;
}

.reader-nav-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Scripture Reading Surface */
.reader-surface {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    max-width: 840px;
    margin: 0 auto;
    padding: 3.5rem 4rem;
}

.reader-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--color-border-light);
}

.reader-meta-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.reader-passage-title {
    font-size: 2.75rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.35rem;
}

.reader-passage-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

/* Scripture Typography */
.scripture-container {
    line-height: 2.0;
    color: var(--color-text-primary);
    text-rendering: optimizeLegibility;
}

.scripture-container.font-serif {
    font-family: var(--font-serif);
}

.scripture-container.font-sans {
    font-family: var(--font-sans);
}

.scripture-container.size-small {
    font-size: 1.05rem;
    line-height: 1.85;
}

.scripture-container.size-medium {
    font-size: 1.25rem;
    line-height: 2.05;
}

.scripture-container.size-large {
    font-size: 1.45rem;
    line-height: 2.25;
}

/* Interactive Verse Elements */
.verse-item {
    display: inline;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.verse-item:hover {
    background-color: rgba(181, 137, 47, 0.12);
}

.verse-item:focus-visible {
    outline: 2px solid var(--color-primary);
    background-color: rgba(181, 137, 47, 0.15);
}

.verse-item.is-selected {
    background-color: #fef3c7;
    box-shadow: 0 0 0 2px #fde68a;
    border-radius: 4px;
}

.verse-num {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-gold);
    vertical-align: super;
    margin-right: 4px;
    user-select: none;
    letter-spacing: -0.02em;
}

.empty-passage-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-secondary);
}

.reader-chapter-footer {
    margin-top: 3.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--color-border-light);
}

/* --------------------------------------------------------------------------
   Floating Verse Action Bar
   -------------------------------------------------------------------------- */
.verse-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background-color: var(--color-primary-dark);
    color: #ffffff;
    border-radius: 9999px;
    box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(255, 255, 255, 0.12);
    padding: 0.6rem 1.25rem;
    max-width: 92%;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.action-bar-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: nowrap;
}

.action-bar-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.action-ref-badge {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-gold-bg);
}

.action-count-text {
    font-size: 0.75rem;
    color: #94a3b8;
    background-color: rgba(255, 255, 255, 0.12);
    padding: 2px 8px;
    border-radius: 9999px;
}

.action-bar-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    border-radius: 9999px;
}

.verse-action-bar .btn-outline {
    border-color: rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
}

.verse-action-bar .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.action-future {
    opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Search Experience Styles
   -------------------------------------------------------------------------- */
.search-form-container {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background-color: var(--color-bg-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.5rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    margin-bottom: var(--space-4);
}

.search-input-wrapper:focus-within {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(181, 137, 47, 0.15);
}

.search-icon {
    color: var(--color-text-muted);
    margin-left: var(--space-3);
    flex-shrink: 0;
}

.search-main-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: var(--space-3);
    font-size: 1.05rem;
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    outline: none;
    min-width: 0;
}

.search-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    margin-right: var(--space-2);
    text-decoration: none;
}

.search-clear-btn:hover {
    background: var(--color-border-light);
    color: var(--color-text-primary);
}

.search-submit-btn {
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.search-filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.filter-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.filter-select {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
}

.search-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.9375rem;
}

.search-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--color-text-secondary);
}

.search-summary strong {
    color: var(--color-text-primary);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.search-result-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
    position: relative;
}

.search-result-card:hover {
    border-left-color: var(--color-gold);
    box-shadow: var(--shadow-md);
}

.search-result-card.is-selected {
    border-left-color: var(--color-primary);
    border-color: var(--color-primary-light);
    background-color: rgba(24, 51, 68, 0.03);
    box-shadow: 0 0 0 2px rgba(24, 51, 68, 0.15);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.result-citation-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.result-citation-link {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.result-citation-link:hover {
    color: var(--color-gold);
    text-decoration: underline;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.result-verse-text {
    font-size: 1.1rem;
    line-height: 1.75;
    color: #1e293b;
}

.result-verse-text .verse-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-gold);
    margin-right: 0.35rem;
    vertical-align: super;
}

.search-highlight {
    background-color: #fef08a;
    border-bottom: 2px solid var(--color-gold);
    border-radius: 2px;
    padding: 1px 3px;
    color: #111827;
    font-weight: 600;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border-light);
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    text-decoration: none;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-primary);
    background: var(--color-bg-card);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination-num:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.pagination-num.is-active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    font-weight: 700;
}

.pagination-ellipsis {
    color: var(--color-text-muted);
    padding: 0 0.25rem;
}

.search-empty-card {
    background: var(--color-bg-card);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-10) var(--space-6);
    text-align: center;
    margin-top: var(--space-6);
}

.empty-icon {
    font-size: 2.75rem;
    margin-bottom: var(--space-3);
    opacity: 0.7;
}

.search-tips {
    max-width: 480px;
    margin: var(--space-6) auto 0;
    text-align: left;
    background-color: var(--color-bg-page);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-6);
    font-size: 0.875rem;
}

.search-tips ul {
    margin: var(--space-2) 0 0 1.25rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.search-discovery-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    margin-top: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.search-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.search-chip:hover {
    border-color: var(--color-gold);
    background-color: #fff9ed;
    color: var(--color-gold-dark, #875c13);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.chip-type {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(24, 51, 68, 0.08);
    color: var(--color-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .site-nav {
        flex-direction: column;
        height: auto;
        padding: var(--space-4) 0;
        gap: var(--space-4);
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    .workflow-stepper {
        flex-direction: column;
        align-items: stretch;
    }

    .step-arrow {
        display: none;
    }

    .search-input-wrapper {
        flex-wrap: wrap;
        padding: var(--space-2);
        gap: var(--space-2);
    }

    .search-submit-btn {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .result-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .highlight-card-header,
    .bookmark-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .highlight-card-actions,
    .bookmark-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .picker-categories-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Phase 5: Personal Study Tools Styles (Highlights, Bookmarks, Notes)
   -------------------------------------------------------------------------- */

/* Highlight Categories */
.verse-item.highlight-observation {
    background-color: rgba(254, 240, 138, 0.45);
    border-bottom: 2px solid #facc15;
}
.verse-item.highlight-promise {
    background-color: rgba(187, 247, 208, 0.45);
    border-bottom: 2px solid #4ade80;
}
.verse-item.highlight-command {
    background-color: rgba(186, 230, 253, 0.45);
    border-bottom: 2px solid #38bdf8;
}
.verse-item.highlight-prayer {
    background-color: rgba(221, 214, 254, 0.45);
    border-bottom: 2px solid #a78bfa;
}
.verse-item.highlight-question {
    background-color: rgba(254, 215, 170, 0.45);
    border-bottom: 2px solid #fb923c;
}
.verse-item.highlight-important {
    background-color: rgba(254, 205, 211, 0.45);
    border-bottom: 2px solid #f43f5e;
}

/* Markers on Verse Items in Reader */
.verse-marker-bookmark {
    display: inline-block;
    font-size: 0.75rem;
    vertical-align: super;
    margin-right: 2px;
}

.verse-marker-note {
    display: inline-block;
    font-size: 0.75rem;
    vertical-align: super;
    margin-right: 2px;
}

/* Highlight Popover in Reader */
.highlight-picker-popover {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    padding: 12px;
    width: 280px;
    z-index: 1001;
    color: var(--color-text-primary);
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}

.picker-close-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0 4px;
}

.picker-close-btn:hover {
    color: var(--color-text-primary);
}

.picker-categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-pick-category {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.btn-pick-category:hover {
    transform: scale(1.03);
    filter: brightness(0.95);
}

.picker-footer {
    padding-top: 6px;
    border-top: 1px solid var(--color-border-light);
}

/* Modals */
.sl-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--space-4);
    animation: fadeIn 0.2s ease-out;
}

.sl-modal-dialog {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    width: 100%;
    max-width: 540px;
    overflow: hidden;
    animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border-light);
}

.sl-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
}

.sl-modal-close:hover {
    color: var(--color-text-primary);
}

.sl-modal-body {
    padding: var(--space-6);
}

.sl-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border-light);
    background-color: var(--color-bg-page);
}

/* Highlights Manager */
.category-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.cat-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.cat-pill.is-active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.cat-pill.is-active-cat {
    box-shadow: 0 0 0 2px var(--color-primary);
}

.highlights-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.highlight-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-left: 5px solid var(--color-gold);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.highlight-card:hover {
    box-shadow: var(--shadow-md);
}

.highlight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.highlight-citation-link {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.highlight-citation-link:hover {
    color: var(--color-gold);
    text-decoration: underline;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.highlight-verse-quote {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    line-height: 1.7;
    color: #1e293b;
    margin-bottom: var(--space-3);
}

.highlight-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Bookmarks Manager */
.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.bookmark-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.bookmark-card:hover {
    box-shadow: var(--shadow-md);
}

.bookmark-card-main {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    flex: 1;
    min-width: 260px;
}

.bookmark-ribbon {
    font-size: 1.5rem;
    line-height: 1;
}

.bookmark-citation-link {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.bookmark-citation-link:hover {
    color: var(--color-gold);
    text-decoration: underline;
}

.bookmark-verse-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.bookmark-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.bookmark-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Notes Manager */
.notes-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.note-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.note-card:hover {
    box-shadow: var(--shadow-md);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.note-card-title {
    font-size: 1.2rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.note-citation-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gold);
    text-decoration: none;
}

.note-citation-link:hover {
    text-decoration: underline;
}

.note-verse-snippet {
    padding: var(--space-2) var(--space-4);
    background-color: var(--color-bg-page);
    border-left: 3px solid var(--color-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: var(--space-4);
}

.note-content-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--space-3);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.note-tags-list {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.note-tag-badge {
    background: rgba(24, 51, 68, 0.08);
    color: var(--color-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none;
}

.note-tag-badge:hover {
    background: var(--color-primary);
    color: #ffffff;
}

.btn-delete-danger {
    color: var(--color-danger);
    border-color: rgba(179, 45, 46, 0.3);
}

.btn-delete-danger:hover {
    background-color: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   STUDY LAB — SYSTEMATIC INDUCTIVE WORKSPACE STYLES
   -------------------------------------------------------------------------- */
.study-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 960px) {
    .study-layout {
        grid-template-columns: 1fr;
    }
}

/* Scripture Sidebar (Biblical Text) */
.study-scripture-panel {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-primary-dark);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.study-scripture-header {
    padding: var(--space-4);
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.study-scripture-body {
    padding: var(--space-5);
    overflow-y: auto;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.85;
    color: #24292e;
}

.study-scripture-verse {
    margin-bottom: var(--space-3);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.study-scripture-verse:hover {
    background-color: rgba(181, 137, 47, 0.08);
}

.study-scripture-vnum {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-gold);
    vertical-align: super;
    margin-right: 0.35rem;
    user-select: none;
}

/* Step Progress Tracker */
.study-step-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: var(--space-2) 0;
    margin-bottom: var(--space-4);
    scrollbar-width: thin;
}

.study-step-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.study-step-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.study-step-tab.active {
    background: var(--color-primary-dark);
    color: #ffffff;
    border-color: var(--color-primary-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.study-step-tab.completed-step {
    border-color: var(--color-success);
    color: var(--color-success);
}

.study-step-tab.completed-step.active {
    background: var(--color-primary-dark);
    color: #ffffff;
}

/* Study Workspace Cards & Visual Separation */
.study-pane {
    display: none;
}

.study-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.study-card-observation {
    border-left: 4px solid #f59e0b;
}

.study-card-context {
    border-left: 4px solid #6366f1;
}

.study-card-crossref {
    border-left: 4px solid #0ea5e9;
}

.study-card-wordstudy {
    border-left: 4px solid #14b8a6;
}

.study-card-interpretation {
    border-left: 4px solid #8b5cf6;
}

.study-card-questions {
    border-left: 4px solid #f43f5e;
}

.study-card-application {
    border-left: 4px solid #10b981;
}

.study-card-notes {
    border-left: 4px solid #ea580c;
}

/* Guidance Callout */
.study-guidance {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.study-guidance strong {
    color: var(--color-primary-dark);
}

/* Dynamic Question Items */
.study-question-box {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    position: relative;
}

/* Bottom Action Bar */
.study-action-bar {
    background: #ffffff;
    border-top: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-top: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* Mobile View Switcher */
.study-mobile-nav {
    display: none;
    margin-bottom: var(--space-3);
}

@media (max-width: 960px) {
    .study-mobile-nav {
        display: flex;
        gap: 0.5rem;
        background: #ffffff;
        padding: 0.5rem;
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
    }
    
    .study-mobile-nav button {
        flex: 1;
        padding: 0.5rem;
        border-radius: var(--radius-sm);
        border: none;
        background: transparent;
        font-weight: 600;
        font-size: 0.875rem;
        cursor: pointer;
        color: var(--color-text-secondary);
    }

    .study-mobile-nav button.active {
        background: var(--color-primary-dark);
        color: #ffffff;
    }

    .study-scripture-panel.mobile-hidden {
        display: none !important;
    }

    .study-workspace-panel.mobile-hidden {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   DARK MODE SYSTEM PALETTE & COMPONENT OVERRIDES
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
    --color-bg-page: #0a0f14;
    --color-bg-surface: #111922;
    --color-bg-subtle: #16222d;
    --color-bg-card: #111922;
    --color-text-primary: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-border: #223242;
    --color-border-light: #1b2835;

    --color-primary: #38bdf8;
    --color-primary-light: #7dd3fc;
    --color-primary-dark: #0284c7;

    --color-gold: #fbbf24;
    --color-gold-hover: #f59e0b;
    --color-gold-bg: rgba(245, 158, 11, 0.12);
    --color-gold-border: rgba(245, 158, 11, 0.3);

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
    background-color: var(--color-bg-page);
    color: var(--color-text-primary);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .site-footer,
[data-theme="dark"] .reader-surface,
[data-theme="dark"] .reader-controls-bar,
[data-theme="dark"] .card,
[data-theme="dark"] .study-scripture-panel,
[data-theme="dark"] .study-action-bar,
[data-theme="dark"] .study-mobile-nav,
[data-theme="dark"] .sl-sidebar,
[data-theme="dark"] .sl-bottom-nav,
[data-theme="dark"] .sl-modal-dialog {
    background-color: var(--color-bg-surface);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] select.form-input,
[data-theme="dark"] textarea.form-input {
    background-color: var(--color-bg-subtle);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

[data-theme="dark"] .study-scripture-body {
    color: #e2e8f0;
}

[data-theme="dark"] .verse-text {
    color: #e2e8f0;
}

[data-theme="dark"] .btn-outline {
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

[data-theme="dark"] .btn-outline:hover {
    background-color: var(--color-bg-subtle);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

[data-theme="dark"] .study-step-tab {
    background: var(--color-bg-surface);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .study-question-box,
[data-theme="dark"] .study-guidance,
[data-theme="dark"] .reader-header,
[data-theme="dark"] .study-scripture-header {
    background-color: var(--color-bg-subtle);
    border-color: var(--color-border);
}

/* --------------------------------------------------------------------------
   PREMIUM SAAS APPLICATION SHELL & SIDEBAR NAVIGATION
   -------------------------------------------------------------------------- */
.sl-app-shell {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sl-sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--color-border);
    padding: var(--space-4) 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sl-sidebar-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    padding: var(--space-3) var(--space-5) var(--space-1);
}

.sl-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--space-3);
    list-style: none;
}

.sl-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.sl-sidebar-link:hover {
    background: var(--color-bg-subtle);
    color: var(--color-primary-dark);
}

.sl-sidebar-link.active {
    background: rgba(14, 116, 144, 0.1);
    color: var(--color-primary-dark);
    font-weight: 600;
}

[data-theme="dark"] .sl-sidebar-link.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--color-primary-light);
}

.sl-sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sl-main-canvas {
    flex: 1;
    min-width: 0;
    padding: var(--space-6) var(--space-6) 6rem;
}

/* Mobile Bottom Navigation Bar (Screens < 860px) */
.sl-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--color-border);
    z-index: 900;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.sl-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    padding: 0.4rem 0;
    list-style: none;
}

.sl-bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.35rem;
}

.sl-bottom-nav-link.active {
    color: var(--color-primary-dark);
}

[data-theme="dark"] .sl-bottom-nav-link.active {
    color: var(--color-primary-light);
}

@media (max-width: 860px) {
    .sl-sidebar {
        display: none;
    }
    .sl-bottom-nav {
        display: block;
    }
    .sl-main-canvas {
        padding: var(--space-4) var(--space-4) 5rem;
    }
}

/* --------------------------------------------------------------------------
   MODULE STYLES: TOPICS, WORD STUDY, READING PLANS, AI ASSISTANT
   -------------------------------------------------------------------------- */
/* Topic Card */
.topic-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--color-primary);
}

/* Lexicon Word Study Card */
.lexicon-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-subtle);
}

.lexicon-original {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.lexicon-strongs {
    background: rgba(181, 137, 47, 0.12);
    color: var(--color-gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

/* Reading Plan Item Row */
.plan-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}

.plan-item-row:hover {
    background: var(--color-bg-subtle);
}

.plan-item-row.is-completed {
    opacity: 0.65;
    background: rgba(40, 114, 77, 0.04);
}

.plan-item-row.is-completed .plan-item-ref {
    text-decoration: line-through;
}

/* AI Assistant Bubble & Disclaimer */
.ai-disclaimer {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-bubble {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    line-height: 1.7;
}

.ai-bubble-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   MOBILE NAVIGATION DRAWER & THEME TOGGLES
   -------------------------------------------------------------------------- */
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 10000;
    backdrop-filter: blur(3px);
    display: none;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    background: var(--color-bg-card, #ffffff);
    z-index: 10001;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
}

.mobile-nav-drawer.is-open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.drawer-body {
    padding: var(--space-4) var(--space-5);
    flex: 1;
}

.drawer-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin: var(--space-4) 0 var(--space-2);
}

.drawer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.drawer-links a:hover {
    background: var(--color-bg-subtle);
    color: var(--color-primary-dark);
}

/* Theme Toggle Button */
.btn-theme-toggle {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    line-height: 1;
}

.btn-theme-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    background: var(--color-bg-subtle);
}

/* Reader Typography Controls Bar */
.reader-font-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
}

.btn-font-size {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-secondary);
}

.btn-font-size:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Cross References Visual Links */
.cross-ref-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 9999px;
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(14, 165, 233, 0.25);
    transition: all var(--transition-fast);
}

.cross-ref-badge:hover {
    background: #0284c7;
    color: #ffffff;
}

[data-theme="dark"] .cross-ref-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

/* Relationship Badge */
.relationship-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
}

@media (max-width: 980px) {
    .site-nav .nav-links {
        display: none;
    }
    #btnMobileMenuToggle {
        display: inline-flex !important;
    }
}




