/* ==========================================================================
   DAVAR STUDY SUITE · SISTEMA DE DISEÑO Y ESTILOS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES Y TEMAS (Sincronizados con Davar)
   -------------------------------------------------------------------------- */
:root {
    /* Base Tema Sepia / Papiro Cálido (Por Defecto) */
    --bg-body: #e4d8bf;
    --bg-surface: #fdf9ed;
    --bg-card: rgba(247, 241, 227, 0.92);
    --bg-card-hover: rgba(255, 252, 244, 0.98);
    --glass-bg: rgba(247, 240, 226, 0.94);
    --glass-border: rgba(140, 80, 20, 0.18);
    --text-primary: #2b1b0e;
    --text-secondary: #6e5843;
    --text-muted: #8c735d;
    --accent-primary: #9e3b1e;       /* Terracota / Bermellón Códice */
    --accent-primary-hover: #7d2e16;
    --accent-secondary: #b45309;     /* Ámbar Cálido */
    --accent-success: #2d6a4f;       /* Verde Salvia / Oliva */
    --accent-success-bg: rgba(45, 106, 79, 0.12);
    --accent-info: #1d4ed8;          /* Azul Lapislázuli */
    --accent-info-bg: rgba(29, 78, 216, 0.08);
    --accent-alert: #b91c1c;         /* Rojo Alerta */
    --accent-alert-bg: rgba(185, 28, 28, 0.08);
    --lab-bg: rgba(237, 227, 205, 0.65);
    --lab-border: rgba(158, 59, 30, 0.25);
    --input-bg: #f5eddc;
    --shadow-sm: 0 2px 8px rgba(100, 60, 20, 0.08);
    --shadow-md: 0 8px 24px rgba(100, 60, 20, 0.12);
    --shadow-lg: 0 16px 40px rgba(100, 60, 20, 0.16);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 9999px;
    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-reading: 'Cardo', Georgia, 'Times New Roman', serif;
    --font-hebrew: 'SBL Hebrew', 'Cardo', 'Times New Roman', serif;
    --font-greek: 'Cardo', 'Times New Roman', serif;
}

/* Tema Sepia / Papiro Cálido (Explícito) */
body.theme-sepia,
:root[data-theme="sepia"] body {
    --bg-body: #e4d8bf;
    --bg-surface: #fdf9ed;
    --bg-card: rgba(247, 241, 227, 0.92);
    --bg-card-hover: rgba(255, 252, 244, 0.98);
    --glass-bg: rgba(247, 240, 226, 0.94);
    --glass-border: rgba(140, 80, 20, 0.18);
    --text-primary: #2b1b0e;
    --text-secondary: #6e5843;
    --text-muted: #8c735d;
    --accent-primary: #9e3b1e;
    --accent-primary-hover: #7d2e16;
    --accent-secondary: #b45309;
    --accent-success: #2d6a4f;
    --accent-success-bg: rgba(45, 106, 79, 0.12);
    --accent-info: #1d4ed8;
    --accent-info-bg: rgba(29, 78, 216, 0.08);
    --accent-alert: #b91c1c;
    --accent-alert-bg: rgba(185, 28, 28, 0.08);
    --lab-bg: rgba(237, 227, 205, 0.65);
    --lab-border: rgba(158, 59, 30, 0.25);
    --input-bg: #f5eddc;
}

/* Tema Noche Marina / Oscuro */
body.theme-dark,
:root[data-theme="dark"] body {
    --bg-body: #0a0f1d;
    --bg-surface: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.85);
    --bg-card-hover: rgba(38, 52, 75, 0.95);
    --glass-bg: rgba(15, 23, 42, 0.88);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #38bdf8;       /* Celeste Cielo */
    --accent-primary-hover: #0284c7;
    --accent-secondary: #f59e0b;
    --accent-success: #34d399;
    --accent-success-bg: rgba(52, 211, 153, 0.12);
    --accent-info: #60a5fa;
    --accent-info-bg: rgba(96, 165, 250, 0.12);
    --accent-alert: #f87171;
    --accent-alert-bg: rgba(248, 113, 113, 0.12);
    --lab-bg: rgba(15, 23, 42, 0.7);
    --lab-border: rgba(56, 189, 248, 0.25);
    --input-bg: rgba(15, 23, 42, 0.85);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Tema Gracia / Claro Moderno */
body.theme-light,
body.theme-gracia,
:root[data-theme="light"] body {
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-primary: #0284c7;       /* Azul Océano */
    --accent-primary-hover: #0369a1;
    --accent-secondary: #d97706;
    --accent-success: #15803d;
    --accent-success-bg: rgba(21, 128, 61, 0.1);
    --accent-info: #2563eb;
    --accent-info-bg: rgba(37, 99, 235, 0.08);
    --accent-alert: #dc2626;
    --accent-alert-bg: rgba(220, 38, 38, 0.08);
    --lab-bg: #f8fafc;
    --lab-border: rgba(2, 132, 199, 0.2);
    --input-bg: #f8fafc;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.08);
}

/* Tema Océano / Turquesa Profundo (Sincronizado con Davar) */
body.theme-ocean,
:root[data-theme="ocean"] body {
    --bg-body: #012b3d;
    --bg-surface: #06262d;
    --bg-card: rgba(8, 63, 77, 0.78);
    --bg-card-hover: rgba(11, 79, 92, 0.92);
    --glass-bg: rgba(6, 38, 45, 0.92);
    --glass-border: rgba(45, 212, 191, 0.22);
    --text-primary: #f0fdfa;
    --text-secondary: #99f6e4;
    --text-muted: #5eead4;
    --accent-primary: #2dd4bf;       /* Turquesa Océano */
    --accent-primary-hover: #14b8a6;
    --accent-secondary: #38bdf8;     /* Celeste Océano */
    --accent-success: #34d399;
    --accent-success-bg: rgba(52, 211, 153, 0.15);
    --accent-info: #2dd4bf;
    --accent-info-bg: rgba(45, 212, 191, 0.12);
    --accent-alert: #f87171;
    --accent-alert-bg: rgba(248, 113, 113, 0.14);
    --lab-bg: rgba(6, 38, 45, 0.85);
    --lab-border: rgba(45, 212, 191, 0.3);
    --input-bg: rgba(6, 38, 45, 0.9);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
}

body.theme-ocean .theme-pill-btn.active {
    background: var(--accent-primary);
    color: #04212a;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   2. RESET Y TIPOGRAFÍA BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   3. CABECERA Y NAVEGACIÓN SUPERIOR
   -------------------------------------------------------------------------- */
.study-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.study-header.header-hidden {
    transform: translateY(-100%) !important;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.brand-icon-svg {
    width: 38px;
    height: 38px;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(43, 27, 14, 0.25));
    flex-shrink: 0;
}

.hebrew-brand {
    font-family: 'SBL Hebrew', 'Taamey Frank CLM', 'Times New Roman', 'Cardo', 'David', serif;
    font-size: 0.95em;
    color: var(--accent-secondary);
    font-weight: 600;
    margin-left: 6px;
    direction: rtl;
    display: inline-block;
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.brand-text p {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.theme-pill-group {
    display: flex;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    padding: 2px;
}

.theme-pill-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.theme-pill-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.btn-davar-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
}

.btn-davar-back:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Botón del Visor Bíblico en la cabecera: mismo lenguaje visual que los
   botones de idioma, con el sello de Davar como distintivo. */
.header-actions .btn-davar-back {
    gap: 0.45rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--accent-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.header-actions .btn-davar-back::before {
    content: "";
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    border-radius: 5px;
    background: url("davar-mark.png") center / contain no-repeat;
}

.header-actions .btn-davar-back span:last-child {
    transition: transform 0.2s ease;
}

.header-actions .btn-davar-back:hover {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.header-actions .btn-davar-back:hover::before {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.header-actions .btn-davar-back:hover span:last-child {
    transform: translateX(2px);
}

body.theme-sepia .header-actions .btn-davar-back {
    color: #9e3b1e;
    background: rgba(158, 59, 30, 0.08);
    border-color: #9e3b1e;
    box-shadow: 0 1px 3px rgba(100, 60, 20, 0.14), 0 0 0 3px rgba(158, 59, 30, 0.08);
}

body.theme-sepia .header-actions .btn-davar-back:hover {
    color: #fdf9ed;
    background: #9e3b1e;
    box-shadow: 0 3px 8px rgba(100, 60, 20, 0.24);
}

body.theme-dark .header-actions .btn-davar-back {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: #38bdf8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(56, 189, 248, 0.1);
}

body.theme-dark .header-actions .btn-davar-back:hover {
    color: #ffffff;
    background: #0284c7;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

body.theme-light .header-actions .btn-davar-back,
body.theme-gracia .header-actions .btn-davar-back {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
    border-color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(2, 132, 199, 0.08);
}

body.theme-light .header-actions .btn-davar-back:hover,
body.theme-gracia .header-actions .btn-davar-back:hover {
    color: #ffffff;
    background: #0284c7;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.28);
}

body.theme-ocean .header-actions .btn-davar-back {
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.12);
    border-color: #2dd4bf;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(45, 212, 191, 0.1);
}

body.theme-ocean .header-actions .btn-davar-back:hover {
    color: #04212a;
    background: #2dd4bf;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.btn-save-notes {
    color: var(--accent-primary, #c9933b);
    border-color: rgba(201, 147, 59, 0.4);
    cursor: pointer;
}

.btn-save-notes:hover {
    background: rgba(201, 147, 59, 0.12);
    border-color: var(--accent-primary, #c9933b);
    color: var(--accent-primary, #c9933b);
}

.btn-save-notes.saved {
    background: rgba(46, 125, 50, 0.15) !important;
    border-color: #2e7d32 !important;
    color: #2e7d32 !important;
}


/* --------------------------------------------------------------------------
   4. LAYOUT PRINCIPAL Y CONTENEDORES
   -------------------------------------------------------------------------- */
.study-main {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    width: 100%;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span.separator {
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
   5. BANNER HERO Y BARRA DE PROGRESO
   -------------------------------------------------------------------------- */
.study-hero {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-info-bg);
    color: var(--accent-info);
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin-bottom: 1.5rem;
    font-family: var(--font-reading);
    font-size: 1.15rem;
}

.progress-banner {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.progress-header span.label {
    color: var(--text-secondary);
}

.progress-header span.value {
    color: var(--accent-primary);
    font-weight: 700;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}

body.theme-dark .progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-pill);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* --------------------------------------------------------------------------
   6. TARJETAS DEL PORTAL / HUB (ÍNDICE GENERAL)
   -------------------------------------------------------------------------- */
.curriculum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.step-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-info-bg);
    color: var(--accent-info);
}

.step-card.step-completed .step-badge {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.step-icon-large {
    font-size: 2rem;
    line-height: 1;
}

.step-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.step-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.step-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.step-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   7. MÓDULOS Y TARJETAS DE LECCIÓN DETALLADA
   -------------------------------------------------------------------------- */
.lesson-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.lesson-card.lesson-completed {
    border-color: var(--accent-success);
    box-shadow: 0 4px 20px var(--accent-success-bg);
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.lesson-title-box {
    flex: 1;
    min-width: 260px;
}

.lesson-num-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    margin-bottom: 0.35rem;
}

.lesson-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.lesson-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: var(--input-bg);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.lesson-card.lesson-completed .lesson-status-pill {
    background: var(--accent-success-bg);
    color: var(--accent-success);
    border-color: var(--accent-success);
}

/* Fases de la Lección */
.lesson-phase {
    margin-bottom: 1.75rem;
}

.phase-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-secondary);
    margin-bottom: 0.85rem;
}

/* FASE 1: Pasajes en Foco */
.passage-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.chip-passage {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.chip-passage:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--card-bg);
    transform: translateY(-1px);
}

.chip-passage span.icon {
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.ecos-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* FASE 2: Clave Doctrinal y Redentora */
.doctrinal-content {
    font-family: var(--font-reading);
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-primary);
}

.doctrinal-content p {
    margin-bottom: 0.9rem;
}

.doctrinal-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.doctrinal-content li {
    margin-bottom: 0.5rem;
}

.scripture-quote {
    background: var(--lab-bg);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.85rem 1.25rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-primary);
}

/* FASE 3: Consola Laboratorio Davar */
.workbench-console {
    background: var(--lab-bg);
    border: 1px solid var(--lab-border);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
    margin-top: 0.5rem;
}

.workbench-console h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.workbench-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.workbench-steps li {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.workbench-steps li span.step-bullet {
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.term-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 3px;
}

.term-badge.hebrew {
    font-family: var(--font-hebrew);
    font-size: 1.1rem;
    direction: rtl;
}

.term-badge.greek {
    font-family: var(--font-greek);
    font-size: 1rem;
}

.term-badge span.strong {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-family: var(--font-ui);
    direction: ltr;
}

/* FASE 4: Asimilación y Registro Personal */
.assimilation-box {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
}

.reflection-questions {
    margin-bottom: 1.25rem;
}

.reflection-questions li {
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.student-notes-area {
    width: 100%;
    min-height: 100px;
    padding: 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0.75rem;
}

.student-notes-area:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-info-bg);
}

.notes-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checklist-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
}

.check-label input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-complete-lesson {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-complete-lesson:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-complete-lesson.is-completed {
    background: var(--accent-success);
}

/* --------------------------------------------------------------------------
   8. CASOS PRÁCTICOS DE CLARIFICACIÓN HERMENÉUTICA
   -------------------------------------------------------------------------- */
.case-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.case-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .case-split-grid {
        grid-template-columns: 1fr;
    }
}

.case-box {
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    font-size: 0.92rem;
    line-height: 1.6;
}

.case-box.error {
    background: var(--accent-alert-bg);
    border: 1px solid var(--accent-alert);
}

.case-box.error h4 {
    color: var(--accent-alert);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.case-box.truth {
    background: var(--accent-success-bg);
    border: 1px solid var(--accent-success);
}

.case-box.truth h4 {
    color: var(--accent-success);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Lista de contexto de los casos del módulo transversal */
.case-box.truth ul {
    margin: 0.35rem 0 0 1.1rem;
}

.case-box.truth li {
    margin-bottom: 0.5rem;
}

.case-box.truth li:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. PIE DE PÁGINA
   -------------------------------------------------------------------------- */
.study-footer {
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--accent-primary);
}

.study-footer p {
    margin: 0.35rem 0;
}

.study-footer .footer-license {
    font-size: 0.78rem;
    max-width: 860px;
    margin: 0.6rem auto 0 auto;
    opacity: 0.85;
    line-height: 1.5;
}

.study-footer .footer-license a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Toast de Notificaciones */
.study-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent-primary);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.study-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   GATEKEEPER & IDENTIFICACIÓN · BET DAVAR
   ========================================================================== */
.efeso-gatekeeper-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
}

.efeso-gatekeeper-card {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    max-width: 580px;
    width: 100%;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gatekeeper-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--bg-card, rgba(255, 255, 255, 0.65));
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    transition: all 0.15s ease;
}

.gatekeeper-close-btn:hover,
.gatekeeper-close-btn:focus-visible {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

.gatekeeper-close-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.gatekeeper-shield {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}

.gatekeeper-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.gatekeeper-tag {
    display: inline-block;
    background: rgba(158, 59, 30, 0.12);
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 1rem;
    border: 1px solid rgba(158, 59, 30, 0.2);
}

.gatekeeper-scripture {
    font-family: var(--font-reading);
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--lab-bg);
    border-left: 3px solid var(--accent-secondary);
    border-radius: var(--radius-sm);
}

.gatekeeper-scripture span {
    font-weight: 700;
    font-style: normal;
    color: var(--accent-secondary);
    font-size: 0.85rem;
}

.gatekeeper-body p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.gatekeeper-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.gatekeeper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-ui);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gatekeeper-btn.primary {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(158, 59, 30, 0.25);
}

.gatekeeper-btn.primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(158, 59, 30, 0.35);
}

.gatekeeper-btn.secondary {
    background: var(--lab-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.gatekeeper-btn.secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.gatekeeper-btn.outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--glass-border);
    font-weight: 600;
}

.gatekeeper-btn.outline:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.gatekeeper-prompt-container {
    background: var(--lab-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.gatekeeper-prompt-container.hidden {
    display: none;
}

.gatekeeper-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
}

.gatekeeper-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(158, 59, 30, 0.2);
}

.prompt-btn-row {
    display: flex;
    gap: 0.5rem;
}

.gatekeeper-submit-btn {
    flex: 1;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.6rem 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-ui);
}

.gatekeeper-cancel-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-family: var(--font-ui);
}

.gatekeeper-msg {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.gatekeeper-msg.error {
    color: var(--accent-alert);
}

.gatekeeper-msg.success {
    color: var(--accent-success);
}

.gatekeeper-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

.gatekeeper-back-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.gatekeeper-back-link:hover {
    color: var(--accent-primary);
}

.gatekeeper-login-form {
    text-align: left;
    margin-bottom: 1.25rem;
}

.gatekeeper-form-group {
    margin-bottom: 0.85rem;
}

.gatekeeper-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.gatekeeper-links-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    flex-wrap: wrap;
}

.gatekeeper-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.gatekeeper-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.gatekeeper-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 1.25rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gatekeeper-divider::before,
.gatekeeper-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.gatekeeper-divider:not(:empty)::before {
    margin-right: 0.75em;
}

.gatekeeper-divider:not(:empty)::after {
    margin-left: 0.75em;
}

/* Badge de Autenticación en la Cabecera de Teaching */
.student-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-secondary);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.01em;
}

.student-auth-badge.superadmin {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.35);
}

.student-auth-badge.student {
    background: var(--accent-success-bg);
    color: var(--accent-success);
    border-color: rgba(45, 106, 79, 0.35);
}

.auth-logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.auth-logout-btn:hover {
    color: var(--accent-alert);
    background: rgba(220, 38, 38, 0.08);
}

/* Botón Selector de Idioma en la Cabecera (Botón Real con Relieve y Paletas de Tema) */
.lang-switcher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 13px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--accent-primary);
    background: var(--bg-surface);
    color: var(--accent-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    user-select: none;
}

.lang-switcher-btn:hover {
    background: var(--accent-primary);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
    border-color: var(--accent-primary);
}

.lang-switcher-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.flag-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.flag-ico svg {
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
}

body.theme-sepia .lang-switcher-btn {
    background: #fdf9ed;
    border-color: #9e3b1e;
    color: #9e3b1e;
    box-shadow: 0 1px 3px rgba(100, 60, 20, 0.12);
}

body.theme-sepia .lang-switcher-btn:hover {
    background: #9e3b1e;
    color: #fdf9ed !important;
    box-shadow: 0 3px 8px rgba(100, 60, 20, 0.2);
}

body.theme-dark .lang-switcher-btn {
    background: #0f172a;
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

body.theme-dark .lang-switcher-btn:hover {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff !important;
}

body.theme-light .lang-switcher-btn,
body.theme-gracia .lang-switcher-btn {
    background: #ffffff;
    border-color: #0284c7;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.theme-light .lang-switcher-btn:hover,
body.theme-gracia .lang-switcher-btn:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff !important;
}

/* ==========================================================================
   SELECTORES DESPLEGABLES MÓVILES (IDIOMAS Y TEMAS)
   ========================================================================== */
.mobile-header-dropdowns {
    display: none; /* Oculto en pantallas de escritorio (> 768px) */
    align-items: center;
    gap: 0.4rem;
}

.header-dropdown {
    position: relative;
    display: inline-block;
}

.header-dropdown-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 11px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--accent-primary);
    background: var(--bg-surface, var(--card-bg));
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.header-dropdown-btn:hover,
.header-dropdown.open .header-dropdown-btn {
    background: var(--accent-primary);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.header-dropdown-btn .dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    display: inline-block;
    opacity: 0.85;
}

.header-dropdown.open .header-dropdown-btn .dropdown-arrow {
    transform: rotate(180deg);
}

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 175px;
    max-width: calc(100vw - 24px);
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.32), 0 4px 10px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 6px;
    z-index: 1050;
    flex-direction: column;
    gap: 3px;
}

.header-dropdown.open .header-dropdown-menu {
    display: flex;
    animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.header-dropdown-item:hover {
    background: rgba(158, 59, 30, 0.08);
    color: var(--accent-primary);
}

.header-dropdown-item.active {
    background: rgba(158, 59, 30, 0.12);
    color: var(--accent-primary);
    font-weight: 700;
}

.dropdown-item-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dropdown-check {
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0;
    color: var(--accent-primary);
}

.header-dropdown-item.active .dropdown-check {
    opacity: 1;
}

/* Indicadores circulares para selector de tema */
.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    display: inline-block;
    flex-shrink: 0;
}
.theme-dot-sepia {
    background: #e8d8be;
}
.theme-dot-dark {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.2);
}
.theme-dot-light {
    background: #ffffff;
    border-color: #cbd5e1;
}
.theme-dot-ocean {
    background: #0a192f;
    border-color: rgba(20, 184, 166, 0.4);
}

/* Adaptación a Paletas de Tema para los Dropdowns */
body.theme-sepia .header-dropdown-btn {
    background: #fdf9ed;
    border-color: #9e3b1e;
    color: #9e3b1e;
    box-shadow: 0 1px 3px rgba(100, 60, 20, 0.12);
}
body.theme-sepia .header-dropdown-btn:hover,
body.theme-sepia .header-dropdown.open .header-dropdown-btn {
    background: #9e3b1e;
    color: #fdf9ed !important;
}
body.theme-sepia .header-dropdown-item:hover {
    background: rgba(158, 59, 30, 0.08);
    color: #9e3b1e;
}
body.theme-sepia .header-dropdown-item.active {
    background: rgba(158, 59, 30, 0.12);
    color: #9e3b1e;
}

body.theme-dark .header-dropdown-btn {
    background: #0f172a;
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
body.theme-dark .header-dropdown-btn:hover,
body.theme-dark .header-dropdown.open .header-dropdown-btn {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff !important;
}
body.theme-dark .header-dropdown-item:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}
body.theme-dark .header-dropdown-item.active {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}
body.theme-dark .header-dropdown-item.active .dropdown-check {
    color: #38bdf8;
}

body.theme-light .header-dropdown-btn,
body.theme-gracia .header-dropdown-btn {
    background: #ffffff;
    border-color: #0284c7;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
body.theme-light .header-dropdown-btn:hover,
body.theme-light .header-dropdown.open .header-dropdown-btn,
body.theme-gracia .header-dropdown-btn:hover,
body.theme-gracia .header-dropdown.open .header-dropdown-btn {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff !important;
}
body.theme-light .header-dropdown-item:hover,
body.theme-gracia .header-dropdown-item:hover {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
}
body.theme-light .header-dropdown-item.active,
body.theme-gracia .header-dropdown-item.active {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
}
body.theme-light .header-dropdown-item.active .dropdown-check,
body.theme-gracia .header-dropdown-item.active .dropdown-check {
    color: #0284c7;
}

body.theme-ocean .header-dropdown-btn {
    background: #08202b;
    border-color: #14b8a6;
    color: #14b8a6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
body.theme-ocean .header-dropdown-btn:hover,
body.theme-ocean .header-dropdown.open .header-dropdown-btn {
    background: #0f766e;
    border-color: #14b8a6;
    color: #ffffff !important;
}
body.theme-ocean .header-dropdown-item:hover {
    background: rgba(20, 184, 166, 0.12);
    color: #2dd4bf;
}
body.theme-ocean .header-dropdown-item.active {
    background: rgba(20, 184, 166, 0.18);
    color: #2dd4bf;
}
body.theme-ocean .header-dropdown-item.active .dropdown-check {
    color: #2dd4bf;
}


/* Barra de Navegación Rápida entre Pasos y Hub */
.quick-step-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2.25rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    scrollbar-width: thin;
}

.quick-step-nav .chip-passage.nav-hub-link {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.quick-step-nav .chip-passage.nav-hub-link:hover {
    background: var(--accent-primary);
    color: #ffffff;
}

.quick-step-nav .chip-passage.active-step {
    border-color: var(--accent-primary);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--accent-primary);
}

/* --------------------------------------------------------------------------
   MODAL BET DAVAR (Selector y Hub)
   -------------------------------------------------------------------------- */
:root {
    --accent-blue: #0284c7;
    --card-bg: var(--bg-card);
}
body.theme-dark {
    --accent-blue: #38bdf8;
    --card-bg: var(--bg-card);
}
body.theme-sepia {
    --accent-blue: #9e3b1e;
    --card-bg: var(--bg-card);
}

.davar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 1rem;
    box-sizing: border-box;
}

.davar-modal.hidden {
    display: none !important;
}

.davar-modal-content {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    max-width: 960px;
    width: 95%;
    max-height: 88vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
}

.davar-modal .close-btn {
    cursor: pointer;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.davar-modal .close-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.08);
}

body.theme-dark .davar-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.nav-action-btn:hover {
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .davar-modal-content {
        padding: 1.25rem 1rem;
        max-height: 94vh;
        max-height: calc(100dvh - 20px);
        border-radius: var(--radius-md);
    }

    .efeso-gatekeeper-overlay {
        padding: 10px;
        align-items: flex-start;
    }

    .efeso-gatekeeper-card {
        padding: 1rem 1.1rem 1.5rem;
        border-radius: var(--radius-md);
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .gatekeeper-close-btn {
        position: sticky;
        top: 0;
        margin-left: auto;
        margin-bottom: 4px;
        width: 44px;
        height: 44px;
        background: var(--bg-surface);
    }
}

/* --------------------------------------------------------------------------
   BET DAVAR: SELECTOR DE ITINERARIO (AUTODIDACTA vs GUIADA)
   -------------------------------------------------------------------------- */
.track-selector-section {
    margin: 1.5rem 0 2rem 0;
}

.track-selector-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.track-card {
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.track-card.active {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-sm);
}

.track-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.track-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: rgba(158, 59, 30, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(158, 59, 30, 0.2);
}

.track-card.active .track-badge {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.track-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.track-desc {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 0.85rem;
}

.track-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.track-features li {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* BARRA DE MODO DE ESTUDIO EN LECCIÓN (AUTODIDACTA / ALUMNO / MAESTRO) */
.study-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.study-mode-selector {
    display: flex;
    gap: 6px;
    background: var(--input-bg);
    padding: 3px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
}

.study-mode-chip {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.study-mode-chip.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* BLOQUE DE AUTOCOMPROBACIÓN INDUCTIVA (SELF-CHECK SPOILER) */
.self-check-details {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-info, #38bdf8);
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.self-check-details[open] {
    border-color: var(--accent-info, #38bdf8);
    box-shadow: var(--shadow-sm);
}

.self-check-summary {
    cursor: pointer;
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--accent-info, #38bdf8);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    list-style: none;
}

.self-check-summary::-webkit-details-marker {
    display: none;
}

.self-check-content {
    padding: 0 1.15rem 1rem 1.15rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-primary);
    border-top: 1px dashed var(--glass-border);
    padding-top: 0.85rem;
}

/* BLOQUE DE GUÍA DEL FACILITADOR (TEACHER GUIDE) */
.teacher-guide-details {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 4px solid var(--accent-secondary, #f59e0b);
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    overflow: hidden;
}

.teacher-guide-summary {
    cursor: pointer;
    padding: 0.85rem 1.15rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--accent-secondary, #f59e0b);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    list-style: none;
}

.teacher-guide-summary::-webkit-details-marker {
    display: none;
}

.teacher-guide-content {
    padding: 0 1.15rem 1rem 1.15rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-primary);
    border-top: 1px dashed rgba(245, 158, 11, 0.2);
    padding-top: 0.85rem;
}

.session-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.82rem;
}

.session-schedule-table th,
.session-schedule-table td {
    padding: 6px 10px;
    border: 1px solid var(--glass-border);
    text-align: left;
}

.session-schedule-table th {
    background: rgba(0, 0, 0, 0.05);
    font-weight: 700;
}

/* ==========================================================================
   19. BANNER DE INSTALACIÓN PWA (BET DAVAR APP) · DISEÑO ERGONÓMICO MÓVIL
   ========================================================================== */
.install-banner {
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 10000;
    width: min(560px, calc(100vw - 28px));
    padding: 16px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    color: var(--text-primary);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32), 0 0 0 1px var(--glass-border);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
    animation: pwaBannerFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.install-banner.banner-closing {
    opacity: 0;
    transform: translate(-50%, 24px) scale(0.96);
}

.install-banner[hidden] {
    display: none !important;
}

@keyframes pwaBannerFadeUp {
    from {
        opacity: 0;
        transform: translate(-50%, 28px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.install-banner-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.install-banner-close {
    position: absolute;
    top: -6px;
    right: -8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.install-banner-close:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.08);
}

.install-banner-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 28px;
}

.install-banner-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

.install-banner-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.install-banner-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-primary);
    display: inline-block;
    margin-bottom: 1px;
}

.install-banner-text strong {
    color: var(--accent-primary);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.install-banner-text p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.35;
    margin: 0;
}

.install-banner-ios-box {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.ios-box-title {
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 6px;
    font-size: 0.82rem;
}

.ios-box-steps {
    margin: 0;
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ios-box-steps li {
    line-height: 1.4;
}

.ios-key-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 0 4px;
    font-size: 0.85rem;
    line-height: 1.2;
    margin-left: 2px;
}

.install-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.install-btn,
.install-later {
    border-radius: var(--radius-pill);
    padding: 9px 18px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.install-btn {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.install-btn:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
}

.install-btn:active {
    transform: translateY(1px);
}

.install-later {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-muted);
}

.install-later:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
}

.install-btn-secondary {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

@media (max-width: 620px) {
    .install-banner {
        width: calc(100vw - 20px);
        max-width: none;
        bottom: max(10px, env(safe-area-inset-bottom));
        padding: 14px 14px 12px 14px;
        border-radius: 16px;
    }
    
    .install-banner-header {
        gap: 10px;
    }

    .install-banner-icon {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
    }

    .install-banner-text strong {
        font-size: 0.94rem;
    }

    .install-banner-text p {
        font-size: 0.78rem;
    }

    .install-banner-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .install-btn,
    .install-later {
        flex: 1 1 0;
        min-height: 42px;
        padding: 8px 12px;
        font-size: 0.82rem;
        text-align: center;
    }
}

/* ==========================================================================
   20. OPTIMIZACIÓN RESPONSIVA GLOBAL PARA MÓVILES (PWA MOBILE POLISH)
   ========================================================================== */
@media (max-width: 768px) {
    .study-header {
        position: sticky;
        top: 0;
    }

    .header-container {
        padding: 0.45rem 0.85rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .header-brand {
        gap: 0.5rem;
    }

    .brand-icon-svg {
        width: 32px;
        height: 32px;
    }

    .brand-text h1 {
        font-size: 1.05rem;
    }

    .brand-text p {
        display: none !important;
    }

    .header-actions {
        gap: 0.4rem;
    }

    .desktop-lang-btn,
    .desktop-theme-pills {
        display: none !important;
    }

    .mobile-header-dropdowns {
        display: inline-flex !important;
        align-items: center;
        gap: 0.4rem;
    }

    .theme-pill-btn {
        padding: 3px 7px;
        font-size: 0.74rem;
    }

    .lang-switcher-btn,
    .btn-davar-back {
        padding: 5px 9px;
        font-size: 0.76rem;
    }

    .study-hero {
        padding: 1.5rem 1rem;
    }

    .hero-title {
        font-size: 1.45rem;
        line-height: 1.25;
    }

    .hero-subtitle {
        font-size: 0.88rem;
        line-height: 1.5;
    }

    .progress-banner {
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.4rem 0.6rem;
        justify-content: space-between;
    }

    .hebrew-brand {
        display: none;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 0.35rem;
        margin-top: 2px;
    }

    .mobile-header-dropdowns {
        gap: 0.3rem;
    }

    .header-dropdown-btn {
        padding: 4px 8px;
        font-size: 0.74rem;
    }

    .theme-pill-group {
        flex: 1 1 auto;
        justify-content: space-around;
    }

    .theme-pill-btn {
        padding: 3px 5px;
        font-size: 0.72rem;
    }

    .btn-davar-back span:last-child {
        display: none;
    }
}





/* ==========================================================================
   CUADERNO DE NOTAS DEL ESTUDIANTE (STUDENT NOTEBOOK MODAL & BUTTON)
   SPEC-108: Visor centralizado de notas, reflexiones exegéticas y cuaderno de estudio.
   ========================================================================== */

/* Botón de acceso en la cabecera */
.student-notes-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid var(--accent-primary, #9e3b1e);
    background: var(--input-bg, rgba(0, 0, 0, 0.04));
    color: var(--accent-primary, #9e3b1e);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    user-select: none;
}

.student-notes-btn:hover {
    background: var(--accent-primary, #9e3b1e);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.15));
}

.student-notes-btn:active {
    transform: translateY(0);
}

.student-notes-btn .notes-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 999px;
    background: var(--accent-primary, #9e3b1e);
    color: #ffffff;
    box-sizing: border-box;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.student-notes-btn:hover .notes-count-badge {
    background: #ffffff;
    color: var(--accent-primary, #9e3b1e);
}

.student-notes-btn .notes-count-badge.hidden {
    display: none !important;
}

/* Modal del Cuaderno */
.student-notes-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-radius: 16px;
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #1e293b);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Cabecera del Cuaderno */
.student-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.08));
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.student-notes-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-notes-icon {
    font-size: 1.8rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.student-notes-title-box h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary, #9e3b1e);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.student-notes-subtitle {
    margin: 3px 0 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
}

/* Barra de herramientas */
.student-notes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.student-notes-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.student-notes-search-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    pointer-events: none;
    font-size: 0.85rem;
}

.student-notes-search-wrap input[type="search"] {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.15));
    background: var(--input-bg, rgba(0,0,0,0.03));
    color: var(--text-primary, #1e293b);
    font-size: 0.84rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.student-notes-search-wrap input[type="search"]:focus {
    outline: none;
    border-color: var(--accent-primary, #9e3b1e);
    box-shadow: 0 0 0 3px rgba(158, 59, 30, 0.15);
    background: var(--bg-surface, #ffffff);
}

.student-notes-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.notes-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.15));
    background: var(--input-bg, rgba(0,0,0,0.03));
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notes-action-pill:hover {
    background: var(--bg-hover, rgba(0,0,0,0.08));
    color: var(--text-primary, #1e293b);
    border-color: var(--accent-primary, #9e3b1e);
}

/* Filtros por paso */
.student-notes-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 0.85rem;
    scrollbar-width: thin;
    flex-shrink: 0;
}

.notes-filter-pill {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.12));
    background: transparent;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.notes-filter-pill:hover {
    color: var(--accent-primary, #9e3b1e);
    border-color: var(--accent-primary, #9e3b1e);
}

.notes-filter-pill.active {
    background: var(--accent-primary, #9e3b1e);
    color: #ffffff;
    border-color: var(--accent-primary, #9e3b1e);
}

/* Lista de tarjetas de notas */
.student-notes-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
}

.notebook-card {
    background: var(--bg-card, rgba(0,0,0,0.02));
    border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notebook-card:hover {
    border-color: rgba(158, 59, 30, 0.35);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.notebook-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.notebook-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.notebook-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(158, 59, 30, 0.1);
    color: var(--accent-primary, #9e3b1e);
    letter-spacing: 0.03em;
}

.notebook-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.notebook-card-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-notebook-tool {
    padding: 4px 9px;
    font-size: 0.73rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--glass-border, rgba(0,0,0,0.12));
    background: var(--input-bg, transparent);
    color: var(--text-secondary, #475569);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-notebook-tool:hover {
    color: var(--accent-primary, #9e3b1e);
    border-color: var(--accent-primary, #9e3b1e);
    background: var(--bg-hover, rgba(0,0,0,0.04));
}

.btn-notebook-tool.primary {
    color: var(--accent-primary, #9e3b1e);
    font-weight: 700;
}

.notebook-card-body {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.08));
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-primary, #334155);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
}

/* Área de edición en la propia tarjeta */
.notebook-edit-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notebook-edit-textarea {
    width: 100%;
    min-height: 110px;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    border: 1.5px solid var(--accent-primary, #9e3b1e);
    background: var(--input-bg, #ffffff);
    color: var(--text-primary, #1e293b);
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.5;
    box-sizing: border-box;
    resize: vertical;
}

.notebook-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-notebook-save {
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    background: var(--accent-primary, #9e3b1e);
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-notebook-cancel {
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--glass-border, rgba(0,0,0,0.15));
    background: transparent;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
}

/* Estado vacío */
.notebook-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary, #64748b);
}

.notebook-empty-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.notebook-empty-state h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary, #1e293b);
}

.notebook-empty-state p {
    margin: 0;
    font-size: 0.88rem;
    max-width: 460px;
    line-height: 1.5;
}

/* Modos Oscuro y Océano */
body.theme-dark .student-notes-modal-content,
body.theme-ocean .student-notes-modal-content {
    background: var(--bg-surface, #0f172a);
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark .notebook-card,
body.theme-ocean .notebook-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .notebook-card-body,
body.theme-ocean .notebook-card-body {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

/* Estilos de impresión */
@media print {
    body * {
        visibility: hidden !important;
    }
    #student-notes-modal,
    #student-notes-modal * {
        visibility: visible !important;
    }
    #student-notes-modal {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        padding: 0 !important;
    }
    .student-notes-modal-content {
        max-width: 100% !important;
        width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
    .student-notes-toolbar,
    .student-notes-filters,
    .close-btn,
    .notebook-card-tools {
        display: none !important;
    }
    .notebook-card {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
        margin-bottom: 1.5rem !important;
        box-shadow: none !important;
    }
}


/* Tarjeta de Cuaderno de Estudio en Hero/Dashboard (SPEC-108) */
.student-notes-hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding: 1rem 1.4rem;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--accent-primary, #9e3b1e);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.06));
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: inherit;
}

.student-notes-hero-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,0.12));
    border-color: var(--accent-hover, #7a2d16);
    background: var(--input-bg, rgba(158, 59, 30, 0.03));
}

.hero-card-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-card-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.hero-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-primary, #9e3b1e);
    margin: 0 0 0.25rem 0;
}

.hero-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary, #475569);
    margin: 0;
    line-height: 1.4;
}

.hero-card-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.hero-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(158, 59, 30, 0.1);
    color: var(--accent-primary, #9e3b1e);
    white-space: nowrap;
}

.hero-card-arrow {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary, #9e3b1e);
    transition: transform 0.2s ease;
}

.student-notes-hero-card:hover .hero-card-arrow {
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .student-notes-hero-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        padding: 1rem;
    }
    .hero-card-right {
        width: 100%;
        justify-content: space-between;
    }
}
