/* ============================================================
   Tafsir & Sura Intent Styles
   ============================================================
   Shared CSS for scholarly tafsir content across the dashboard:
   - Sura intent ribbons (feed header, transition cards)
   - Thematic tafsir tabs (Juz wheel page)
   - /meanings page
   - Today's Reflection widget
   - Verse card sura context

   Sources:
     "Qur'an Intensive" by Asif Uddin
     "Qur'an 30 for 30" by Dr. Omar Suleiman & Sh. Ismail Kamdar
   ============================================================ */


/* ============================================================
   1. SURA INTENT RIBBON (used in feed header + transition cards)
   ============================================================ */

.sura-intent-ribbon {
    padding: 10px 16px;
    margin: 6px 0 10px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.04) 0%, rgba(13, 92, 58, 0.03) 100%);
    border-left: 3px solid #0d5c3a;
    border-radius: 0 10px 10px 0;
    font-size: 0.88rem;
    line-height: 1.65;
    color: #4a3f35;
    font-style: italic;
    position: relative;
}

.sura-intent-ribbon::before {
    content: '\201C'; /* opening quote */
    position: absolute;
    top: 2px;
    left: 8px;
    font-size: 1.8rem;
    color: rgba(201, 168, 76, 0.25);
    font-family: 'Georgia', serif;
    line-height: 1;
}

.sura-intent-ribbon .intent-text {
    padding-left: 14px;
}

.sura-intent-source {
    display: block;
    margin-top: 6px;
    font-size: 0.68rem;
    color: #8B7355;
    font-style: normal;
    text-align: right;
}


/* ============================================================
   2. TAFSIR TABS (Juz wheel page — 4 scholarly perspectives)
   ============================================================ */

.tafsir-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid rgba(201, 168, 76, 0.2);
}

.tafsir-section-title {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.5rem;
    color: #0d5c3a;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tafsir-section-title i {
    color: #c9a84c;
    font-size: 1.1rem;
}

/* Tab bar */
.tafsir-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(180, 160, 120, 0.15);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tafsir-tab {
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #8B7355;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tafsir-tab:hover {
    color: #5a4a3a;
    background: rgba(201, 168, 76, 0.04);
}

.tafsir-tab.active {
    color: #0d5c3a;
    border-bottom-color: #0d5c3a;
}

/* Tab icons */
.tafsir-tab i {
    margin-right: 6px;
    font-size: 0.75rem;
}

/* Tab content area */
.tafsir-content {
    padding: 0 4px;
    max-width: 680px;
}

/* Key insight (bold opening summary) */
.tafsir-key-insight {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0d5c3a;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(13, 92, 58, 0.03);
    border-radius: 10px;
    border-left: 3px solid #0d5c3a;
}

/* Prose body */
.tafsir-prose {
    font-size: 0.92rem;
    line-height: 1.85;
    color: #3d3428;
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.tafsir-prose p {
    margin-bottom: 14px;
}

/* Pull-quote (large italic) */
.tafsir-pullquote {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.65;
    color: #0d5c3a;
    padding: 20px 24px;
    margin: 20px 0;
    background: linear-gradient(135deg, rgba(13, 92, 58, 0.03) 0%, rgba(201, 168, 76, 0.04) 100%);
    border-left: 4px solid #c9a84c;
    border-radius: 0 12px 12px 0;
    position: relative;
}

.tafsir-pullquote::before {
    content: '\201C';
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 2.5rem;
    color: rgba(201, 168, 76, 0.2);
    font-family: 'Georgia', serif;
    line-height: 1;
}

/* Verse citation pill (clickable) */
.tafsir-citation {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #0d5c3a;
    background: rgba(13, 92, 58, 0.06);
    border: 1px solid rgba(13, 92, 58, 0.15);
    text-decoration: none;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    cursor: pointer;
    vertical-align: middle;
}

.tafsir-citation:hover {
    background: rgba(13, 92, 58, 0.12);
    border-color: #0d5c3a;
    color: #0d5c3a;
    text-decoration: none;
}

.tafsir-citation i {
    font-size: 0.6rem;
}

/* Quranic verse quote (italic, indented) */
.tafsir-verse-quote {
    font-style: italic;
    color: #4a3f35;
    padding: 8px 16px;
    margin: 10px 0;
    border-left: 2px solid rgba(201, 168, 76, 0.3);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* Attribution footer */
.tafsir-attribution {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid rgba(180, 160, 120, 0.15);
    font-size: 0.72rem;
    color: #8B7355;
    text-align: right;
    font-style: italic;
}

.tafsir-attribution strong {
    color: #5a4a3a;
    font-style: normal;
}


/* ============================================================
   3. TODAY'S REFLECTION WIDGET (dashboard overview)
   ============================================================ */

.todays-reflection {
    background: linear-gradient(135deg, #0d5c3a 0%, #0a4e32 60%, #083d28 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(13, 92, 58, 0.2);
}

.todays-reflection::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: rgba(201, 168, 76, 0.08);
    border-radius: 50%;
}

.todays-reflection-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(201, 168, 76, 0.8);
    font-weight: 600;
    margin-bottom: 8px;
}

.todays-reflection-sura {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.todays-reflection-arabic {
    font-family: 'Amiri Quran', 'Amiri', serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.todays-reflection-intent {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 2px solid rgba(201, 168, 76, 0.4);
}

.todays-reflection-quote {
    font-family: 'Amiri', serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #c9a84c;
    font-style: italic;
    margin-bottom: 16px;
}

.todays-reflection-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: #c9a84c;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.todays-reflection-cta:hover {
    background: rgba(201, 168, 76, 0.25);
    border-color: #c9a84c;
    color: #fff;
    text-decoration: none;
}


/* ============================================================
   4. MEANINGS PAGE (/meanings)
   ============================================================ */

.meanings-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 20px 16px 80px;
}

.meanings-header {
    text-align: center;
    margin-bottom: 32px;
}

.meanings-title {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 2rem;
    color: #0d5c3a;
    font-weight: 700;
    margin-bottom: 4px;
}

.meanings-subtitle {
    font-size: 0.88rem;
    color: #8B7355;
    font-style: italic;
}

/* Filter bar */
.meanings-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.meanings-search {
    flex: 1;
    min-width: 200px;
}

.meanings-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(180, 160, 120, 0.3);
    background: transparent;
    color: #8B7355;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.meanings-filter-pill.active {
    background: #0d5c3a;
    color: #fff;
    border-color: #0d5c3a;
}

.meanings-filter-pill:hover {
    border-color: #c9a84c;
}

/* Juz section header */
.meanings-juz-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.meanings-juz-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0d5c3a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.meanings-juz-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #5a4a3a;
}

/* Sura intent card */
.meanings-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(180, 160, 120, 0.12);
    margin-bottom: 8px;
    cursor: pointer;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.meanings-card:hover {
    border-color: rgba(201, 168, 76, 0.35);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.meanings-card-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #c9a84c;
    background: rgba(201, 168, 76, 0.06);
    color: #c9a84c;
    font-family: 'Amiri', serif;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.meanings-card-body {
    flex: 1;
    min-width: 0;
}

.meanings-card-names {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.meanings-card-arabic {
    font-family: 'Amiri', serif;
    font-size: 1rem;
    color: #8E44AD;
}

.meanings-card-english {
    font-size: 0.88rem;
    font-weight: 600;
    color: #5a4a3a;
}

.meanings-card-translation {
    font-size: 0.72rem;
    color: #8B7355;
}

.meanings-card-rev {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.meanings-card-intent {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #4a3f35;
    margin-top: 4px;
}

/* Verse count chip */
.meanings-card-meta {
    font-size: 0.68rem;
    color: #8B7355;
    margin-top: 4px;
}


/* ============================================================
   5. RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .sura-intent-ribbon {
        padding: 8px 12px;
        font-size: 0.82rem;
        margin: 4px 0 8px;
    }

    .tafsir-section-title {
        font-size: 1.2rem;
    }

    .tafsir-tab {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .tafsir-pullquote {
        font-size: 1.05rem;
        padding: 16px 18px;
    }

    .tafsir-prose {
        font-size: 0.88rem;
        text-align: left;
    }

    .todays-reflection {
        padding: 18px 20px;
        border-radius: 12px;
    }

    .todays-reflection-sura {
        font-size: 1.25rem;
    }

    .meanings-page {
        padding: 12px 10px 80px;
    }

    .meanings-title {
        font-size: 1.5rem;
    }

    .meanings-card {
        padding: 12px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .sura-intent-ribbon {
        padding: 6px 10px;
        font-size: 0.78rem;
        margin: 3px 0 6px;
    }

    .sura-intent-ribbon::before {
        font-size: 1.4rem;
    }

    .tafsir-tabs {
        gap: 0;
    }

    .tafsir-tab {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .tafsir-tab i {
        display: none;
    }

    .tafsir-pullquote {
        font-size: 0.95rem;
        padding: 12px 14px;
        margin: 12px 0;
    }

    .todays-reflection {
        padding: 14px 16px;
    }

    .todays-reflection-sura {
        font-size: 1.1rem;
    }

    .todays-reflection-intent {
        font-size: 0.82rem;
    }

    .meanings-card-num {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }

    .meanings-card-intent {
        font-size: 0.78rem;
    }
}

@media print {
    .tafsir-tabs, .meanings-filters, .todays-reflection-cta {
        display: none !important;
    }
}


/* ============================================================================
   INTERACTIVE TAFSIR READER — Smart Segments, Slideout, Companion
   Added for the "Smart Interactive Tafsir Reader" phase.
   ========================================================================== */


/* ────────────────────────────────────────────────────────────────
   1. SEGMENT BASE
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment {
    margin: 0 0 22px;
    line-height: 1.85;
    color: #3a2f22;
    font-size: 1.02rem;
    position: relative;
}

.tafsir-segment.active-segment {
    /* Applied by tafsir.js when this segment is the most visible in viewport */
}

.tafsir-segment a.tafsir-inline-citation {
    display: inline-block;
    margin: 0 2px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0d5c3a;
    background: rgba(13, 92, 58, 0.06);
    border: 1px solid rgba(13, 92, 58, 0.18);
    text-decoration: none;
    transition: all 0.15s;
    vertical-align: baseline;
    cursor: pointer;
}

.tafsir-segment a.tafsir-inline-citation:hover {
    background: rgba(13, 92, 58, 0.15);
    border-color: #0d5c3a;
    text-decoration: none;
}

.tafsir-segment a.tafsir-inline-surah {
    color: #c9a84c;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted rgba(201, 168, 76, 0.5);
    cursor: pointer;
    transition: color 0.15s;
}

.tafsir-segment a.tafsir-inline-surah:hover {
    color: #8B6914;
    border-bottom-color: #c9a84c;
    text-decoration: none;
}


/* ────────────────────────────────────────────────────────────────
   2. PARAGRAPH + DROP CAP
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment-paragraph {
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
    max-width: 72ch;
}

.tafsir-drop-cap {
    float: left;
    font-family: "Amiri", "Playfair Display", Georgia, serif;
    font-size: 3.6rem;
    line-height: 0.85;
    margin: 0.2rem 0.5rem 0 0;
    padding: 0;
    color: #c9a84c;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(201, 168, 76, 0.15);
}


/* ────────────────────────────────────────────────────────────────
   3. VERSE QUOTE SEGMENT
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment-verse-quote {
    display: block;
    background: linear-gradient(135deg, rgba(13, 92, 58, 0.04) 0%, rgba(13, 92, 58, 0.08) 100%);
    border-left: 4px solid #0d5c3a;
    border-radius: 0 10px 10px 0;
    padding: 16px 20px 12px 22px;
    margin: 24px 0;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.tafsir-segment-verse-quote:hover {
    box-shadow: 0 4px 14px rgba(13, 92, 58, 0.12);
    transform: translateX(2px);
}

.tafsir-vq-body {
    display: flex;
    gap: 10px;
}

.tafsir-vq-icon {
    color: rgba(13, 92, 58, 0.35);
    font-size: 1.4rem;
    flex-shrink: 0;
    padding-top: 2px;
}

.tafsir-vq-text {
    font-family: "Amiri", Georgia, serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2d2416;
}

.tafsir-vq-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 8px;
    padding-left: 30px;
}

.tafsir-vq-cite {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0d5c3a;
    text-decoration: none;
    font-style: normal;
}

.tafsir-vq-cite:hover {
    text-decoration: underline;
}

.tafsir-vq-expand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid rgba(13, 92, 58, 0.25);
    background: rgba(255, 255, 255, 0.7);
    color: #0d5c3a;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tafsir-vq-expand:hover {
    background: #0d5c3a;
    color: #fff;
    border-color: #0d5c3a;
}

.tafsir-vq-expand i {
    font-size: 0.7rem;
}


/* ────────────────────────────────────────────────────────────────
   4. STORY BLOCK
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment-story {
    border-left: 3px solid #c9a84c;
    padding: 14px 18px;
    margin: 24px 0;
    background: rgba(253, 248, 240, 0.6);
    border-radius: 0 8px 8px 0;
}

.tafsir-story-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.tafsir-story-icon {
    color: #c9a84c;
    font-size: 1rem;
}

.tafsir-story-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #8B6914;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tafsir-story-about {
    margin-left: auto;
    font-family: "Amiri", Georgia, serif;
    font-size: 0.95rem;
    color: #5a4a3a;
    font-weight: 600;
    font-style: italic;
}

.tafsir-story-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #3d3428;
    font-style: italic;
}


/* ────────────────────────────────────────────────────────────────
   5. QUESTION BLOCK (reflection prompt)
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment-question {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 18px;
    margin: 24px 0;
    background: rgba(201, 168, 76, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(201, 168, 76, 0.2);
}

.tafsir-question-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c 0%, #d4b559 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}

.tafsir-question-body {
    flex: 1;
}

.tafsir-question-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #8B6914;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.tafsir-question-text {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.7;
    color: #3a2f22;
}


/* ────────────────────────────────────────────────────────────────
   6. PRINCIPLE (Worldview numbered)
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment-principle {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    margin: 22px 0;
    background: linear-gradient(135deg, #fdfaf3 0%, #faf4e8 100%);
    border-radius: 12px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.tafsir-principle-badge {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c 0%, #d4b559 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Amiri", Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(201, 168, 76, 0.3);
}

.tafsir-principle-body {
    flex: 1;
}

.tafsir-principle-text {
    font-size: 1.02rem;
    line-height: 1.7;
    color: #2d2416;
    font-weight: 500;
}

.tafsir-principle-cite {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(13, 92, 58, 0.06);
    border: 1px solid rgba(13, 92, 58, 0.15);
    color: #0d5c3a;
    font-size: 0.78rem;
    text-decoration: none;
    font-weight: 600;
}


/* ────────────────────────────────────────────────────────────────
   7. CHRONOLOGY MARKER (timeline indicator)
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment-chronology {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 32px 0;
    color: #8B7355;
}

.tafsir-chrono-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.4), transparent);
}

.tafsir-chrono-marker {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.25);
    flex-shrink: 0;
}

.tafsir-chrono-icon {
    color: #c9a84c;
    font-size: 0.8rem;
}

.tafsir-chrono-text {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    font-weight: 500;
    text-transform: uppercase;
    font-family: "Playfair Display", Georgia, serif;
    font-variant: small-caps;
}


/* ────────────────────────────────────────────────────────────────
   8. CONTRAST BLOCK
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment-contrast {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    margin: 24px 0;
    background: rgba(142, 68, 173, 0.04);
    border-radius: 10px;
    border-left: 3px solid #8E44AD;
}

.tafsir-contrast-icon {
    color: #8E44AD;
    font-size: 1.1rem;
    flex-shrink: 0;
    padding-top: 4px;
}

.tafsir-contrast-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.75;
    color: #3d3428;
}


/* ────────────────────────────────────────────────────────────────
   9. PULLQUOTE HERO (top of each tab)
   ──────────────────────────────────────────────────────────────── */

.tafsir-pullquote-hero {
    position: relative;
    padding: 28px 32px;
    margin: 0 0 32px;
    background: linear-gradient(135deg, #fdf8f0 0%, #f5ede0 100%);
    border-radius: 16px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 4px 18px rgba(201, 168, 76, 0.08);
}

.tafsir-pq-quote-mark {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 1.8rem;
    color: rgba(201, 168, 76, 0.3);
}

.tafsir-pq-text {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.65;
    color: #1d3a2a;
    margin: 0;
    padding-left: 28px;
    border: none;
    font-weight: 500;
}


/* ────────────────────────────────────────────────────────────────
   10. SECTION TOC (top strip)
   ──────────────────────────────────────────────────────────────── */

.tafsir-section-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 10px 14px;
    margin: 0 0 20px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 10px;
    border: 1px solid rgba(180, 160, 120, 0.15);
    font-size: 0.78rem;
    color: #8B7355;
}

.tafsir-toc-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.tafsir-toc-item i {
    color: #c9a84c;
    font-size: 0.7rem;
}

.tafsir-toc-sep {
    opacity: 0.5;
    font-weight: 600;
}


/* ────────────────────────────────────────────────────────────────
   11. READING TIME + CONCEPT CLOUD
   ──────────────────────────────────────────────────────────────── */

.tafsir-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(13, 92, 58, 0.06);
    color: #0d5c3a;
    font-size: 0.78rem;
    font-weight: 600;
}

.tafsir-reading-time i {
    font-size: 0.7rem;
}

.tafsir-concept-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.tafsir-concept-tag {
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(201, 168, 76, 0.08);
    color: #8B6914;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid rgba(201, 168, 76, 0.15);
}


/* ────────────────────────────────────────────────────────────────
   12. CHARACTER & SURAH CHIPS
   ──────────────────────────────────────────────────────────────── */

.tafsir-character-row,
.tafsir-sura-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.tafsir-character-avatar-chip,
.tafsir-sura-mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 0.74rem;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.12s, background 0.12s;
    cursor: pointer;
}

.tafsir-character-avatar-chip:hover,
.tafsir-sura-mention-chip:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.tafsir-sura-mention-chip {
    border-color: rgba(13, 92, 58, 0.25);
    color: #0d5c3a;
    background: rgba(13, 92, 58, 0.04);
}

.tafsir-sura-mention-chip:hover {
    background: rgba(13, 92, 58, 0.1);
}

.tafsir-sura-mention-chip i {
    font-size: 0.65rem;
}


/* ────────────────────────────────────────────────────────────────
   13. NEXT TAB CTA
   ──────────────────────────────────────────────────────────────── */

.tafsir-next-tab-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin: 32px 0 16px;
    background: linear-gradient(135deg, #0d5c3a 0%, #0a4e32 100%);
    color: #fff;
    border-radius: 14px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    border: none;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

.tafsir-next-tab-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(13, 92, 58, 0.3);
    color: #fff;
    text-decoration: none;
}

.tafsir-next-tab-cta .tafsir-cta-icon {
    font-size: 1.3rem;
    color: #c9a84c;
}

.tafsir-next-tab-cta .tafsir-cta-content {
    flex: 1;
}

.tafsir-cta-up {
    font-size: 0.7rem;
    opacity: 0.7;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.tafsir-cta-label {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: "Amiri", Georgia, serif;
}

.tafsir-cta-arrow {
    font-size: 1.1rem;
    transition: transform 0.15s;
}

.tafsir-next-tab-cta:hover .tafsir-cta-arrow {
    transform: translateX(4px);
}

.tafsir-cta-final {
    background: linear-gradient(135deg, #c9a84c 0%, #b09033 100%);
}


/* ────────────────────────────────────────────────────────────────
   14. CITATION SLIDEOUT PANEL
   ──────────────────────────────────────────────────────────────── */

.tafsir-slideout {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
}

.tafsir-slideout[data-open="true"] {
    pointer-events: auto;
    visibility: visible;
}

.tafsir-slideout-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 20, 10, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: pointer;
}

.tafsir-slideout[data-open="true"] .tafsir-slideout-backdrop {
    opacity: 1;
}

.tafsir-slideout-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 100%;
    background: #fdf8f0;
    box-shadow: -12px 0 34px rgba(0, 0, 0, 0.18);
    transform: translateX(105%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.tafsir-slideout[data-open="true"] .tafsir-slideout-panel {
    transform: translateX(0);
}

.tafsir-slideout-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0d5c3a 0%, #0a4e32 100%);
    color: #fff;
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
}

.tafsir-slideout-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tafsir-slideout-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.tafsir-slideout-ref {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #c9a84c;
}

.tafsir-slideout-nav {
    display: flex;
    gap: 4px;
}

.tafsir-slideout-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s, transform 0.15s;
}

.tafsir-slideout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.tafsir-slideout-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.tafsir-slideout-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tafsir-slideout-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: #8B7355;
    font-size: 0.88rem;
}

.tafsir-slideout-loading i {
    font-size: 1.3rem;
    color: #c9a84c;
}

.tafsir-slideout-footer {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid rgba(180, 160, 120, 0.2);
    background: #f5ede0;
}

.tafsir-slideout-footer-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(180, 160, 120, 0.35);
    background: #fdf8f0;
    color: #5a4a3a;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tafsir-slideout-footer-btn:hover {
    background: rgba(201, 168, 76, 0.08);
    border-color: #c9a84c;
    text-decoration: none;
    color: #5a4a3a;
}

.tafsir-slideout-footer-btn.tafsir-slideout-footer-primary {
    background: #0d5c3a;
    color: #fff;
    border-color: #0d5c3a;
}

.tafsir-slideout-footer-btn.tafsir-slideout-footer-primary:hover {
    background: #0a4e32;
    color: #fff;
}


/* ────────────────────────────────────────────────────────────────
   15. READING COMPANION (sticky right rail / mobile bottom sheet)
   ──────────────────────────────────────────────────────────────── */

.tafsir-reading-companion {
    position: fixed;
    top: 80px;
    right: 18px;
    width: 280px;
    max-height: calc(100vh - 110px);
    z-index: 990;
    pointer-events: none;
}

.tafsir-companion-panel {
    background: #fdf8f0;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.2);
    overflow: hidden;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.tafsir-companion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #0d5c3a 0%, #0a4e32 100%);
    color: #fff;
}

.tafsir-comp-header-icon {
    color: #c9a84c;
    font-size: 0.95rem;
}

.tafsir-comp-header-title {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.tafsir-companion-close,
.tafsir-companion-icon-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.78rem;
    transition: color 0.12s;
}

.tafsir-companion-close:hover,
.tafsir-companion-icon-btn:hover {
    color: #c9a84c;
}

.tafsir-companion-icon-btn {
    margin-left: 2px;
}

.tafsir-companion-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px 14px;
}

.tafsir-companion-section {
    padding: 10px 0;
    border-bottom: 1px solid rgba(180, 160, 120, 0.12);
}

.tafsir-companion-section:last-child {
    border-bottom: none;
}

.tafsir-comp-label {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8B7355;
    margin-bottom: 6px;
}

.tafsir-comp-progress-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.74rem;
    color: #5a4a3a;
    font-weight: 600;
}

.tafsir-comp-progress-row i {
    color: #c9a84c;
}

.tafsir-comp-pct {
    margin-left: auto;
    color: #0d5c3a;
    font-weight: 700;
}

.tafsir-companion-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(201, 168, 76, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.tafsir-companion-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c9a84c 0%, #0d5c3a 100%);
    border-radius: 2px;
    transition: width 0.18s ease;
}

.tafsir-comp-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.tafsir-comp-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 6px;
    border-radius: 8px;
    background: rgba(180, 160, 120, 0.08);
    border: 1px solid transparent;
    color: #5a4a3a;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
}

.tafsir-comp-tab:hover {
    background: rgba(201, 168, 76, 0.12);
}

.tafsir-comp-tab.active {
    background: #0d5c3a;
    color: #fff;
    border-color: #0d5c3a;
    font-weight: 600;
}

.tafsir-comp-tab i {
    font-size: 0.65rem;
}

.tafsir-comp-counts {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
}

.tafsir-comp-counts li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    color: #4a3f35;
}

.tafsir-comp-counts li i {
    color: #c9a84c;
    font-size: 0.7rem;
    width: 12px;
    text-align: center;
}

.tafsir-comp-verses {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.tafsir-comp-verse-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(180, 160, 120, 0.12);
    transition: background 0.12s;
}

.tafsir-comp-verse-row:hover {
    background: rgba(201, 168, 76, 0.08);
}

.tafsir-comp-verse-ref {
    font-weight: 700;
    color: #0d5c3a;
    font-size: 0.78rem;
    text-decoration: none;
    font-family: "Amiri", Georgia, serif;
}

.tafsir-comp-verse-ref:hover {
    text-decoration: underline;
}

.tafsir-comp-verse-preview {
    font-size: 0.7rem;
    color: #7a6d5e;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tafsir-comp-verse-play {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    background: #0d5c3a;
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    cursor: pointer;
    transition: background 0.12s;
}

.tafsir-comp-verse-play:hover {
    background: #c9a84c;
}

.tafsir-comp-chars,
.tafsir-comp-surahs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tafsir-comp-char-chip,
.tafsir-comp-surah-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 0.68rem;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.1s;
}

.tafsir-comp-char-chip:hover,
.tafsir-comp-surah-chip:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.tafsir-comp-surah-chip {
    border-color: rgba(13, 92, 58, 0.25);
    color: #0d5c3a;
    background: rgba(13, 92, 58, 0.04);
}

.tafsir-comp-themes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tafsir-comp-theme-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(201, 168, 76, 0.04);
    border: 1px solid rgba(201, 168, 76, 0.12);
    text-decoration: none;
    transition: background 0.12s;
}

.tafsir-comp-theme-row:hover {
    background: rgba(201, 168, 76, 0.12);
    text-decoration: none;
}

.tafsir-comp-theme-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.tafsir-comp-theme-title {
    font-size: 0.76rem;
    color: #4a3f35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tafsir-comp-bookmarks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tafsir-comp-empty {
    font-size: 0.72rem;
    color: #a89478;
    font-style: italic;
}

.tafsir-companion-cta-wrap {
    padding-top: 8px;
    border-bottom: none;
}

.tafsir-companion-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #c9a84c 0%, #b09033 100%);
    color: #fff;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: transform 0.12s, box-shadow 0.12s;
}

.tafsir-companion-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(201, 168, 76, 0.4);
    color: #fff;
    text-decoration: none;
}

.tafsir-companion-cta i:first-child {
    font-size: 1rem;
}

.tafsir-companion-cta > div {
    flex: 1;
    text-align: left;
}

.tafsir-comp-cta-up {
    font-size: 0.62rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tafsir-comp-cta-down {
    font-size: 0.82rem;
    font-weight: 700;
}

.tafsir-comp-cta-arrow {
    font-size: 0.8rem;
}


/* Mobile: FAB + bottom sheet */
.tafsir-companion-fab {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 14px;
    z-index: 991;
    width: auto;
    padding: 10px 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, #c9a84c 0%, #b09033 100%);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    align-items: center;
    gap: 6px;
}

@media (max-width: 1200px) {
    .tafsir-reading-companion {
        pointer-events: auto;
    }
    .tafsir-reading-companion .tafsir-companion-panel {
        display: none;
    }
    .tafsir-reading-companion[data-open="true"] .tafsir-companion-panel {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        max-height: 72vh;
        border-radius: 16px 16px 0 0;
        z-index: 9998;
    }
    .tafsir-companion-fab {
        display: inline-flex;
    }
    .tafsir-reading-companion[data-open="true"] .tafsir-companion-fab {
        display: none;
    }
}


/* ────────────────────────────────────────────────────────────────
   16. INLINE TAFSIR SHARE BUTTON (for text selection)
   ──────────────────────────────────────────────────────────────── */

.tafsir-share-float {
    position: absolute;
    display: none;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 16px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.tafsir-share-float.visible {
    display: inline-flex;
}

.tafsir-share-float i {
    color: #c9a84c;
}


/* ────────────────────────────────────────────────────────────────
   17. IMMERSIVE READING MODE
   ──────────────────────────────────────────────────────────────── */

body.tafsir-immersive .tafsir-reading-companion,
body.tafsir-immersive .tafsir-companion-fab,
body.tafsir-immersive nav.navbar,
body.tafsir-immersive .sidebar-main,
body.tafsir-immersive .audio-player,
body.tafsir-immersive .verse-controller-bar,
body.tafsir-immersive footer {
    display: none !important;
}

body.tafsir-immersive .tafsir-section {
    max-width: 740px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

body.tafsir-immersive .tafsir-segment-paragraph {
    font-size: 1.12rem;
    line-height: 2;
}

.tafsir-immersive-exit {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.tafsir-immersive .tafsir-immersive-exit {
    display: inline-flex;
}


/* ────────────────────────────────────────────────────────────────
   18. BOOKMARK BUTTON (inline on segment hover)
   ──────────────────────────────────────────────────────────────── */

.tafsir-segment:hover .tafsir-bookmark-btn {
    opacity: 0.7;
}

.tafsir-bookmark-btn {
    position: absolute;
    top: 4px;
    right: -28px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    color: #8B7355;
    border: none;
    opacity: 0;
    cursor: pointer;
    font-size: 0.8rem;
    transition: opacity 0.12s, color 0.12s, background 0.12s;
}

.tafsir-bookmark-btn:hover {
    opacity: 1 !important;
    color: #c9a84c;
    background: rgba(201, 168, 76, 0.1);
}

.tafsir-bookmark-btn.bookmarked {
    opacity: 1;
    color: #c9a84c;
}


/* ────────────────────────────────────────────────────────────────
   19. ESCHATOLOGICAL VOCAB / GLOSSARY TOOLTIP
   ──────────────────────────────────────────────────────────────── */

.tafsir-glossary-term {
    position: relative;
    border-bottom: 1px dashed rgba(201, 168, 76, 0.5);
    cursor: help;
    font-weight: 600;
    color: #8B6914;
}

.tafsir-glossary-popover {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: min(260px, calc(100vw - 24px));
    max-width: 260px;
    padding: 10px 14px;
    margin-bottom: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 500;
    box-sizing: border-box;
}

/* On very narrow viewports, popovers near the edge need to anchor differently.
   JS can toggle a `.edge-left` / `.edge-right` class; CSS fallback below. */
@media (max-width: 479.98px) {
    .tafsir-glossary-popover {
        width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
        transform: none;
        /* Avoid wrap in narrow layouts that would cover content */
        max-width: none;
    }
}

.tafsir-glossary-popover strong {
    color: #c9a84c;
    display: block;
    margin-bottom: 3px;
    font-size: 0.82rem;
}

.tafsir-glossary-term:hover .tafsir-glossary-popover,
.tafsir-glossary-term:focus-visible .tafsir-glossary-popover {
    opacity: 1;
    pointer-events: auto;
}


/* ────────────────────────────────────────────────────────────────
   19b. JUDGMENT DAY ATMOSPHERE PANEL
   ──────────────────────────────────────────────────────────────── */

.tafsir-atmosphere-panel {
    margin: 0 0 24px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.tafsir-atmo-hero {
    display: flex;
    gap: 20px;
    padding: 24px 26px;
    color: #fff;
}

.tafsir-atmo-big-icon {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    margin-top: 4px;
}

.tafsir-atmo-hero-text { flex: 1; }

.tafsir-atmo-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 4px;
}

.tafsir-atmo-mood-title {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
}

.tafsir-atmo-meta {
    font-size: 0.78rem;
    opacity: 0.85;
    margin-top: 2px;
}

.tafsir-atmo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 14px 20px;
    background: #fdf8f0;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
}

.tafsir-atmo-col-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8B7355;
    margin-bottom: 6px;
}

.tafsir-atmo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tafsir-atmo-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    border-radius: 11px;
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.25);
    color: #5a4a3a;
    font-size: 0.72rem;
    font-weight: 500;
}

.tafsir-atmo-chip.tafsir-atmo-chip-env {
    background: rgba(13, 92, 58, 0.06);
    border-color: rgba(13, 92, 58, 0.2);
    color: #0d5c3a;
}

.tafsir-atmo-chip i { font-size: 0.65rem; }

.tafsir-atmo-chip-count {
    opacity: 0.6;
    font-size: 0.65rem;
}

.tafsir-atmo-sounds {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 20px 14px;
    background: #fdf8f0;
    font-style: italic;
    color: #5a4a3a;
    font-size: 0.82rem;
    border-top: 1px dashed rgba(201, 168, 76, 0.25);
}

.tafsir-atmo-sounds-icon {
    color: #c9a84c;
    padding-top: 2px;
}


/* ────────────────────────────────────────────────────────────────
   19c. ESCHATOLOGY GLOSSARY
   ──────────────────────────────────────────────────────────────── */

.tafsir-eschatology-glossary {
    margin: 20px 0;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.04) 0%, rgba(142, 68, 173, 0.08) 100%);
    border-radius: 12px;
    border: 1px solid rgba(142, 68, 173, 0.15);
}

.tafsir-gloss-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(142, 68, 173, 0.15);
    color: #6C3483;
}

.tafsir-gloss-header i { font-size: 0.9rem; }

.tafsir-gloss-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.tafsir-gloss-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
}

.tafsir-gloss-row {
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(142, 68, 173, 0.1);
}

.tafsir-gloss-term {
    font-family: "Amiri", Georgia, serif;
    font-weight: 700;
    color: #6C3483;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.tafsir-gloss-def {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #4a3f35;
}


/* ────────────────────────────────────────────────────────────────
   19d. SEERAH HEADER + TIMELINE
   ──────────────────────────────────────────────────────────────── */

.tafsir-seerah-header {
    margin: 0 0 24px;
}

.tafsir-seerah-banner {
    padding: 18px 22px;
    background: linear-gradient(135deg, #1a5490 0%, #134572 100%);
    border-radius: 14px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 84, 144, 0.15);
}

.tafsir-seerah-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.tafsir-seerah-icon {
    font-size: 1.3rem;
    color: #c9a84c;
}

.tafsir-seerah-title {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tafsir-seerah-banner-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tafsir-seerah-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.tafsir-seerah-meta {
    font-size: 0.78rem;
    opacity: 0.85;
}

.tafsir-seerah-timeline {
    margin-top: 14px;
    padding: 16px 18px;
    background: #fdf8f0;
    border-radius: 12px;
    border: 1px solid rgba(201, 168, 76, 0.2);
}

.tafsir-timeline-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8B7355;
    margin-bottom: 12px;
}

.tafsir-timeline-inner {
    position: relative;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.tafsir-timeline-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 32px;
    height: 2px;
    background: linear-gradient(90deg, rgba(201,168,76,0.3), rgba(13,92,58,0.3));
}

.tafsir-timeline-items {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    min-width: max-content;
}

.tafsir-timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 140px;
    flex-shrink: 0;
}

.tafsir-timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #c9a84c;
    border: 3px solid #fdf8f0;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.5), 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
    position: relative;
}

.tafsir-timeline-card {
    margin-top: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    width: 100%;
}

.tafsir-timeline-year {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #c9a84c;
}

.tafsir-timeline-title {
    font-family: "Amiri", Georgia, serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2d2416;
    line-height: 1.3;
    margin: 2px 0;
}

.tafsir-timeline-period {
    font-size: 0.66rem;
    color: #8B7355;
    font-style: italic;
}


/* ────────────────────────────────────────────────────────────────
   19e. WORLDVIEW PRINCIPLES PANEL
   ──────────────────────────────────────────────────────────────── */

.tafsir-principles-panel {
    margin: 0 0 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #fdfaf3 0%, #faf4e8 100%);
    border-radius: 14px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.08);
}

.tafsir-princ-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: #8B6914;
}

.tafsir-princ-header i { font-size: 1rem; color: #c9a84c; }

.tafsir-princ-title {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.tafsir-princ-count {
    font-size: 0.76rem;
    opacity: 0.7;
    font-weight: 500;
}

.tafsir-princ-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.tafsir-princ-card {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    transition: box-shadow 0.12s, transform 0.12s;
    cursor: pointer;
}

.tafsir-princ-card:hover {
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.18);
    transform: translateY(-1px);
}

.tafsir-princ-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c 0%, #b09033 100%);
    color: #fff;
    font-family: "Amiri", Georgia, serif;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(201, 168, 76, 0.3);
}

.tafsir-princ-snippet {
    font-size: 0.82rem;
    line-height: 1.5;
    color: #2d2416;
    font-weight: 500;
}

.tafsir-princ-hint {
    margin: 10px 0 0;
    font-size: 0.72rem;
    color: #8B7355;
    font-style: italic;
    text-align: center;
}


/* ────────────────────────────────────────────────────────────────
   19f. CROSS-REFERENCES ("See also" pills)
   ──────────────────────────────────────────────────────────────── */

.tafsir-xref-panel {
    margin: 0 0 20px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(13, 92, 58, 0.03) 0%, rgba(201, 168, 76, 0.04) 100%);
    border-radius: 10px;
    border: 1px dashed rgba(201, 168, 76, 0.3);
}

.tafsir-xref-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.tafsir-xref-row:last-child { margin-bottom: 0; }

.tafsir-xref-rowlabel {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8B7355;
    flex-shrink: 0;
}

.tafsir-xref-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tafsir-xref-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s, background 0.12s;
    background: #fff;
}

.tafsir-xref-pill:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.tafsir-xref-pill i { font-size: 0.62rem; }

.tafsir-xref-tab {
    border-color: rgba(13, 92, 58, 0.3);
    color: #0d5c3a;
}

.tafsir-xref-tab:hover {
    background: rgba(13, 92, 58, 0.08);
    color: #0d5c3a;
}

.tafsir-xref-juz {
    border-color: rgba(201, 168, 76, 0.4);
    color: #8B6914;
}

.tafsir-xref-juz:hover {
    background: rgba(201, 168, 76, 0.1);
    color: #8B6914;
}


/* ────────────────────────────────────────────────────────────────
   19g. INLINE SEARCH BAR
   ──────────────────────────────────────────────────────────────── */

.tafsir-search-bar {
    position: sticky;
    top: 12px;
    z-index: 100;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 0 0 14px;
    background: #fff;
    border: 2px solid #c9a84c;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tafsir-search-bar.visible { display: flex; }

.tafsir-search-bar i { color: #c9a84c; flex-shrink: 0; }

.tafsir-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    color: #2d2416;
    min-width: 0;
}

.tafsir-search-counts {
    font-size: 0.72rem;
    color: #8B7355;
    font-weight: 600;
    flex-shrink: 0;
}

.tafsir-search-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(180, 160, 120, 0.15);
    color: #5a4a3a;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
}

.tafsir-search-close:hover {
    background: rgba(180, 160, 120, 0.3);
}

.tafsir-search-highlight {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 2px;
    padding: 0 1px;
}

.tafsir-search-highlight.current {
    background: #c9a84c;
    color: #fff;
}


/* ────────────────────────────────────────────────────────────────
   19h. READING PREFERENCES PANEL
   ──────────────────────────────────────────────────────────────── */

.tafsir-prefs-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 10000;
    width: 360px;
    max-width: 92vw;
    max-height: 80vh;
    background: #fdf8f0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(201, 168, 76, 0.3);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s, transform 0.22s;
}

.tafsir-prefs-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.tafsir-prefs-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(30, 20, 10, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s;
}

.tafsir-prefs-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.tafsir-prefs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    background: linear-gradient(135deg, #0d5c3a 0%, #0a4e32 100%);
    color: #fff;
}

.tafsir-prefs-header i { color: #c9a84c; }

.tafsir-prefs-title {
    flex: 1;
    font-family: "Amiri", Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.tafsir-prefs-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    cursor: pointer;
}

.tafsir-prefs-body {
    padding: 14px 18px;
}

.tafsir-prefs-group {
    margin-bottom: 14px;
}

.tafsir-prefs-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8B7355;
    margin-bottom: 6px;
}

.tafsir-prefs-options {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tafsir-prefs-option {
    flex: 1;
    min-width: 60px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(180, 160, 120, 0.08);
    border: 1px solid rgba(180, 160, 120, 0.2);
    color: #5a4a3a;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s;
}

.tafsir-prefs-option:hover {
    background: rgba(201, 168, 76, 0.12);
}

.tafsir-prefs-option.active {
    background: #0d5c3a;
    color: #fff;
    border-color: #0d5c3a;
    font-weight: 600;
}

.tafsir-prefs-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
}

.tafsir-prefs-check input { cursor: pointer; }

.tafsir-prefs-footer {
    padding: 10px 18px;
    border-top: 1px solid rgba(201, 168, 76, 0.15);
    text-align: right;
}

.tafsir-prefs-reset {
    font-size: 0.74rem;
    background: none;
    border: none;
    color: #8B7355;
    cursor: pointer;
    text-decoration: underline;
}

/* Reading preference body classes — dynamically applied by JS */
body.tafsir-pref-font-s .tafsir-segment-paragraph { font-size: 0.95rem; }
body.tafsir-pref-font-m .tafsir-segment-paragraph { font-size: 1.02rem; }
body.tafsir-pref-font-l .tafsir-segment-paragraph { font-size: 1.12rem; }
body.tafsir-pref-font-xl .tafsir-segment-paragraph { font-size: 1.25rem; }

body.tafsir-pref-leading-compact .tafsir-segment-paragraph { line-height: 1.6; }
body.tafsir-pref-leading-normal .tafsir-segment-paragraph { line-height: 1.85; }
body.tafsir-pref-leading-relaxed .tafsir-segment-paragraph { line-height: 2.1; }

body.tafsir-pref-font-serif .tafsir-segment-paragraph {
    font-family: "Amiri", Georgia, "Times New Roman", serif;
}
body.tafsir-pref-font-sans .tafsir-segment-paragraph {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.tafsir-pref-theme-sepia .tafsir-section {
    filter: sepia(0.15) hue-rotate(-10deg);
}
body.tafsir-pref-theme-night {
    background: #1a1a1a;
}
body.tafsir-pref-theme-night .tafsir-section,
body.tafsir-pref-theme-night .tafsir-segment,
body.tafsir-pref-theme-night .tafsir-segment-paragraph {
    background: #1a1a1a;
    color: #e6d8c8;
}
body.tafsir-pref-theme-night .tafsir-segment-verse-quote {
    background: #2d2416;
    color: #f0e4d2;
}

body.tafsir-pref-nodropcap .tafsir-drop-cap {
    display: none;
}


/* ────────────────────────────────────────────────────────────────
   19i. READING ANALYTICS WIDGET (dashboard overview)
   ──────────────────────────────────────────────────────────────── */

.tafsir-analytics-card {
    margin: 16px auto;
    max-width: 900px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #fdfaf3 0%, #f3ead8 100%);
    border-radius: 16px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 4px 18px rgba(201, 168, 76, 0.08);
}

.tafsir-analytics-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #0d5c3a;
}

.tafsir-analytics-header i { font-size: 1rem; color: #c9a84c; }

.tafsir-analytics-title {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.tafsir-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.tafsir-analytics-cell {
    padding: 12px 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(180, 160, 120, 0.15);
    text-align: left;
}

.tafsir-analytics-icon {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.tafsir-analytics-value {
    font-family: "Amiri", Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d2416;
    line-height: 1;
}

.tafsir-analytics-label {
    font-size: 0.72rem;
    color: #8B7355;
    margin-top: 3px;
}

.tafsir-analytics-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #0d5c3a;
    color: #fff;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s, transform 0.12s;
}

.tafsir-analytics-cta:hover {
    background: #0a4e32;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.tafsir-analytics-cta i:last-child {
    margin-left: 4px;
}


/* ────────────────────────────────────────────────────────────────
   20. RESPONSIVE CARRY-OVER
   ──────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .tafsir-segment-paragraph {
        text-align: left;
        font-size: 0.98rem;
        max-width: 100%;
    }

    .tafsir-drop-cap {
        font-size: 2.8rem;
    }

    .tafsir-pullquote-hero {
        padding: 20px 18px;
    }

    .tafsir-pq-text {
        font-size: 1.1rem;
        padding-left: 10px;
    }

    .tafsir-next-tab-cta {
        padding: 12px 14px;
    }

    .tafsir-slideout-panel {
        width: 100%;
    }

    .tafsir-segment-verse-quote {
        padding: 12px 14px;
    }

    .tafsir-vq-text {
        font-size: 0.98rem;
    }
}


/* ────────────────────────────────────────────────────────────────
   21. PRINT
   ──────────────────────────────────────────────────────────────── */

@media print {
    .tafsir-reading-companion,
    .tafsir-companion-fab,
    .tafsir-slideout,
    .tafsir-next-tab-cta,
    .tafsir-share-float,
    .tafsir-bookmark-btn,
    .tafsir-vq-expand {
        display: none !important;
    }

    .tafsir-section,
    .tafsir-segment {
        max-width: 100%;
        color: #000;
    }

    .tafsir-pullquote-hero {
        border: 1px solid #ccc;
        box-shadow: none;
        background: none;
    }

    .tafsir-segment-verse-quote {
        box-shadow: none;
        background: none;
        border-left: 3px solid #333;
        page-break-inside: avoid;
    }

    .tafsir-inline-citation,
    .tafsir-inline-surah {
        background: none !important;
        border: none !important;
        color: #000 !important;
        text-decoration: underline !important;
    }
}
