/* ============================================================
   OneGod — Sacred Text Reader
   Design based on the Golden Ratio (1.618)
   Base unit: 8px
   Scale: 8, 13, 21, 34, 55, 89, 144
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Golden Ratio Scale */
    --phi: 1.618;
    --sp-xs: 5px;
    --sp-sm: 8px;
    --sp-md: 13px;
    --sp-lg: 21px;
    --sp-xl: 34px;
    --sp-2xl: 55px;
    --sp-3xl: 89px;
    --sp-4xl: 144px;

    /* Font Sizes — Golden Ratio Scale */
    --font-size: 18px;
    --font-size-sm: 13px;
    --font-size-base: var(--font-size);
    --font-size-lg: 21px;
    --font-size-xl: 29px;  /* ~18 * 1.618 */
    --font-size-2xl: 34px;
    --font-size-3xl: 47px; /* ~29 * 1.618 */

    /* Line Height */
    --line-height: 1.618;

    /* Transitions */
    --transition: 0.3s ease;
    --transition-fast: 0.18s ease;

    /* Layout */
    --header-height: 55px;
    --nav-height: 55px;
    --card-radius: 13px;
    --card-padding: 21px;
    --card-gap: 13px;
    --touch-min: 44px;

    /* Light Theme (Default — Warm Parchment) */
    --bg-primary: #FDF6E3;
    --bg-secondary: #F5EDD6;
    --bg-card: #FFFBF0;
    --bg-card-hover: #FFF8E7;
    --text-primary: #3E2723;
    --text-secondary: #5D4037;
    --text-tertiary: #8D6E63;
    --text-muted: #A1887F;
    --accent: #D4A574;
    --accent-soft: rgba(212, 165, 116, 0.15);
    --border: rgba(62, 39, 35, 0.08);
    --border-strong: rgba(62, 39, 35, 0.15);
    --shadow: 0 2px 8px rgba(62, 39, 35, 0.06);
    --shadow-lg: 0 5px 21px rgba(62, 39, 35, 0.1);
    --verse-number-bg: rgba(212, 165, 116, 0.18);
    --verse-number-text: #A1887F;
    --splash-bg: #F5EDD6;
    --nav-bg: #FFFBF0;
    --nav-border: rgba(62, 39, 35, 0.06);
    --nav-active: #D4A574;
    --nav-inactive: #A1887F;
    --favorite-color: #D4A574;
    --slider-track: #E0D5C0;
    --slider-thumb: #D4A574;
}

/* Sepia Theme */
[data-theme="sepia"] {
    --bg-primary: #F5E6C8;
    --bg-secondary: #EAD9B5;
    --bg-card: #FFF0D6;
    --bg-card-hover: #FFECC6;
    --text-primary: #5D4037;
    --text-secondary: #6D4C41;
    --text-tertiary: #8D6E63;
    --text-muted: #A1887F;
    --accent: #C49A6C;
    --accent-soft: rgba(196, 154, 108, 0.18);
    --border: rgba(93, 64, 55, 0.1);
    --border-strong: rgba(93, 64, 55, 0.18);
    --shadow: 0 2px 8px rgba(93, 64, 55, 0.08);
    --shadow-lg: 0 5px 21px rgba(93, 64, 55, 0.12);
    --verse-number-bg: rgba(196, 154, 108, 0.2);
    --verse-number-text: #A1887F;
    --splash-bg: #EAD9B5;
    --nav-bg: #FFF0D6;
    --nav-border: rgba(93, 64, 55, 0.08);
    --nav-active: #C49A6C;
    --nav-inactive: #A1887F;
    --slider-track: #D4C4A8;
    --slider-thumb: #C49A6C;
}

/* Night Theme */
[data-theme="night"] {
    --bg-primary: #1A1A2E;
    --bg-secondary: #16213E;
    --bg-card: #1F1F38;
    --bg-card-hover: #25254A;
    --text-primary: #D4AF37;
    --text-secondary: #C9A84C;
    --text-tertiary: #8B7A3E;
    --text-muted: #6B5E30;
    --accent: #D4AF37;
    --accent-soft: rgba(212, 175, 55, 0.12);
    --border: rgba(212, 175, 55, 0.08);
    --border-strong: rgba(212, 175, 55, 0.15);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 5px 21px rgba(0, 0, 0, 0.4);
    --verse-number-bg: rgba(212, 175, 55, 0.12);
    --verse-number-text: #8B7A3E;
    --splash-bg: #16213E;
    --nav-bg: #1F1F38;
    --nav-border: rgba(212, 175, 55, 0.06);
    --nav-active: #D4AF37;
    --nav-inactive: #6B5E30;
    --favorite-color: #D4AF37;
    --slider-track: #2A2A4A;
    --slider-thumb: #D4AF37;
}

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

html {
    font-size: var(--font-size);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family:
        'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Hebrew',
        -apple-system, BlinkMacSystemFont, 'Segoe UI',
        'Helvetica Neue', Arial,
        'Noto Naskh Arabic', 'Scheherazade New', 'Amiri',
        'Frank Ruhl Libre', 'David Libre', 'SBL Hebrew',
        sans-serif;
    line-height: var(--line-height);
    color: var(--text-primary);
    background: var(--bg-primary);
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* --- Splash Screen --- */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--splash-bg);
    transition: opacity 0.8s ease;
}

.splash-screen.splash-fade {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    padding: var(--sp-xl);
}

.splash-logo {
    width: 300px;
    height: 300px;
    border-radius: 34px;
    object-fit: contain;
    margin-bottom: 0;
    animation: splashMsgFadeIn 0.8s ease both;
}

.splash-bismillah {
    font-size: var(--sp-xl);
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', serif;
    color: var(--text-primary);
    direction: rtl;
    margin-bottom: var(--sp-xs);
    opacity: 0.9;
}

.splash-title {
    font-size: var(--font-size-3xl);
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 3px;
    margin-bottom: var(--sp-sm);
}

.splash-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    letter-spacing: 1px;
    margin-bottom: var(--sp-xl);
}

/* Splash welcome message */
.splash-message {
    margin-bottom: var(--sp-xl);
    animation: splashMsgFadeIn 1.2s ease 0.4s both;
}

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

.splash-msg-line1 {
    font-size: var(--font-size-xl);
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    line-height: 1.4;
    margin-bottom: var(--sp-xs);
}

.splash-msg-line2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
    line-height: 1.3;
    margin-bottom: var(--sp-sm);
}

.splash-msg-line3 {
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    line-height: 1.5;
    margin-bottom: var(--sp-md);
}

.splash-msg-line4 {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-tertiary);
    font-style: italic;
    letter-spacing: 0.3px;
    line-height: var(--line-height);
}

.splash-loader {
    width: 89px;
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.splash-loader-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    animation: splash-load 2.3s ease forwards;
}

@keyframes splash-load {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* --- App Layout --- */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* --- Header --- */
.app-header {
    height: var(--header-height);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-lg);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.header-btn {
    width: var(--touch-min);
    height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.header-btn:active {
    background: var(--accent-soft);
}

.header-title {
    flex: 1;
    font-size: var(--font-size-lg);
    font-weight: 400;
    text-align: center;
    letter-spacing: 1px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    height: 42px;
    width: auto;
    border-radius: 10px;
    object-fit: contain;
}

.header-spacer {
    width: var(--touch-min);
    flex-shrink: 0;
}

/* --- Screens Container --- */
.screens {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.screen {
    display: none;
    padding: var(--sp-lg);
    padding-bottom: var(--sp-xl);
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

.screen-home.active {
    padding: 0 var(--sp-lg) var(--sp-xl) var(--sp-lg) !important;
    margin-top: 0 !important;
}

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

/* --- Home Screen --- */
.home-welcome {
    text-align: center;
    padding: 0;
    margin: 0;
}

.home-logo {
    display: block;
    width: 240px;
    height: 240px;
    border-radius: 34px;
    object-fit: contain;
    margin: 0 auto -5px auto;
}

.home-bismillah {
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', serif;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.8;
    margin-top: -5px;
    margin-bottom: 5px;
}

.home-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 8px;
}

/* Continue Reading Banner */
.continue-reading {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--sp-md) var(--sp-lg);
    margin-bottom: var(--sp-lg);
    cursor: pointer;
    transition: all var(--transition);
}

.continue-reading:active {
    transform: scale(0.98);
}

.continue-label {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.continue-info {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    font-weight: 500;
}

/* Section Labels */
.home-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--sp-xs);
    margin-top: var(--sp-md);
    padding-left: 2px;
}

/* Category Cards */
.home-categories {
    display: flex;
    flex-direction: column;
    gap: var(--card-gap);
    margin-bottom: var(--sp-sm);
}

.category-card {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    min-height: var(--touch-min);
    position: relative;
}

.category-card:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-lg);
}

.category-date {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 9px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.category-icon {
    width: var(--sp-2xl);
    height: var(--sp-2xl);
    min-width: var(--sp-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

.category-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-text h2 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.3;
}

.category-text p {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* --- Library Screen --- */
.library-header {
    margin-bottom: var(--sp-lg);
}

.library-header h2 {
    font-size: var(--font-size-xl);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--sp-xs);
}

.library-header p {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.book-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.book-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--sp-md) var(--sp-lg);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    min-height: var(--touch-min);
}

.book-card:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.book-card-info h3 {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.book-card-info .book-lang {
    font-size: 12px;
    color: var(--text-muted);
}

.book-card-right {
    flex-shrink: 0;
    margin-left: auto;
    text-align: right;
}

.book-card-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.book-card-date {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    margin-top: 2px;
}

/* --- Reader Screen --- */
.reader-controls {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-lg);
    flex-wrap: wrap;
}

.chapter-selector {
    flex: 1;
    min-width: 0;
}

.chapter-selector select {
    width: 100%;
    padding: var(--sp-sm) var(--sp-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--sp-sm);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238D6E63' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-sm) center;
    padding-right: var(--sp-xl);
    cursor: pointer;
    min-height: var(--touch-min);
    font-family: inherit;
}

.reader-book-title {
    text-align: center;
    margin-bottom: var(--sp-md);
}

.reader-book-title h2 {
    font-size: var(--font-size-lg);
    font-weight: 400;
    color: var(--text-primary);
}

.reader-book-title .reader-chapter-name {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Verse Display */
.verses-container {
    padding-bottom: var(--sp-xl);
}

.verse {
    display: flex;
    gap: var(--sp-sm);
    padding: var(--sp-sm) 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-fast);
    align-items: flex-start;
}

.verse:last-child {
    border-bottom: none;
}

.verse:active {
    background: var(--accent-soft);
    border-radius: var(--sp-sm);
}

.verse.favorited {
    background: var(--accent-soft);
    border-radius: var(--sp-sm);
    padding-left: var(--sp-sm);
    padding-right: var(--sp-sm);
}

.verse-number {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--verse-number-bg);
    color: var(--verse-number-text);
    border-radius: 50%;
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 3px;
    font-weight: 500;
}

.verse-text {
    flex: 1;
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* RTL Support for Arabic and Hebrew */
.rtl .verse {
    direction: rtl;
    text-align: right;
}

.rtl .verse-text {
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New',
                 'Frank Ruhl Libre', 'David Libre', 'SBL Hebrew',
                 serif;
    font-size: calc(var(--font-size-base) + 2px);
    line-height: 2;
}

/* Arabic-specific */
.arabic-text .verse-text {
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', serif;
    font-size: calc(var(--font-size-base) + 4px);
    line-height: 2.2;
    letter-spacing: 0;
}

/* Hebrew-specific */
.hebrew-text .verse-text {
    font-family: 'Frank Ruhl Libre', 'David Libre', 'SBL Hebrew',
                 'Noto Sans Hebrew', serif;
    font-size: calc(var(--font-size-base) + 2px);
    line-height: 2;
}

/* Navigation between chapters */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-lg) 0;
    gap: var(--sp-md);
}

.chapter-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: var(--sp-sm) var(--sp-md);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--sp-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition);
    min-height: var(--touch-min);
    font-family: inherit;
}

.chapter-nav-btn:active {
    background: var(--accent-soft);
    transform: scale(0.97);
}

.chapter-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.chapter-nav-btn:disabled:active {
    background: var(--bg-card);
    transform: none;
}

/* Verse Action Modal */
.verse-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.verse-modal {
    background: var(--bg-card);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    padding: var(--sp-lg);
    width: 100%;
    max-width: 600px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.verse-modal-ref {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: var(--sp-sm);
    text-align: center;
}

.verse-modal-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height);
    padding: var(--sp-md);
    background: var(--bg-secondary);
    border-radius: var(--sp-sm);
    margin-bottom: var(--sp-xs);
    max-height: 150px;
    overflow-y: auto;
}

.verse-modal-text.rtl-modal {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Frank Ruhl Libre', serif;
    font-size: calc(var(--font-size-sm) * 1.15);
}

.verse-modal-translation {
    font-style: italic;
    color: var(--text-muted);
    font-size: calc(var(--font-size-sm) * 0.9);
}

.verse-modal-sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--sp-xs) 0;
}

.verse-modal-actions {
    display: flex;
    gap: var(--sp-sm);
}

.verse-modal-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--sp-md);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--sp-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    min-height: var(--touch-min);
}

.verse-modal-btn:active {
    background: var(--accent-soft);
}

.verse-modal-btn .btn-icon {
    font-size: 20px;
}

/* --- Favorites Screen --- */
.favorites-empty {
    text-align: center;
    padding: var(--sp-3xl) var(--sp-lg);
    color: var(--text-muted);
}

.favorites-empty .empty-icon {
    font-size: 55px;
    margin-bottom: var(--sp-md);
    opacity: 0.4;
}

.favorites-empty p {
    font-size: var(--font-size-sm);
    line-height: var(--line-height);
}

.favorite-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--sp-md) var(--sp-lg);
    margin-bottom: var(--sp-sm);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.favorite-item:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.favorite-ref {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.favorite-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.favorite-text.rtl-text {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Frank Ruhl Libre', serif;
}

.favorite-group {
    border-left: 3px solid var(--accent);
}

.favorite-group-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    padding: 1px 7px;
    border-radius: 10px;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: 0;
}

.favorite-verse-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}

.favorite-text-original {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: var(--line-height);
    margin-bottom: 4px;
}

.favorite-text-original.rtl-text {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Frank Ruhl Libre', serif;
}

.favorite-text-translation {
    font-size: calc(var(--font-size-sm) * 0.9);
    color: var(--text-muted);
    font-style: italic;
    line-height: var(--line-height);
    margin-bottom: 8px;
    padding-left: 30px;
}

.favorite-verse-sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.favorite-remove {
    display: inline-block;
    margin-top: var(--sp-xs);
    font-size: 12px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}

.favorite-remove:active {
    color: var(--text-primary);
}

/* --- Settings Screen --- */
.settings-section {
    margin-bottom: var(--sp-xl);
}

.settings-section-title {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--sp-md);
    font-weight: 500;
}

.setting-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--sp-md) var(--sp-lg);
    margin-bottom: var(--sp-sm);
}

.setting-label {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    margin-bottom: var(--sp-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-value {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

/* Font Size Slider */
.font-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--slider-track);
    border-radius: 4px;
    outline: none;
    margin-top: var(--sp-sm);
}

.font-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--slider-thumb);
    cursor: pointer;
    border: 3px solid var(--bg-card);
    box-shadow: var(--shadow);
}

.font-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--slider-thumb);
    cursor: pointer;
    border: 3px solid var(--bg-card);
    box-shadow: var(--shadow);
}

.font-preview {
    margin-top: var(--sp-sm);
    padding: var(--sp-md);
    background: var(--bg-secondary);
    border-radius: var(--sp-sm);
    text-align: center;
    color: var(--text-secondary);
    line-height: var(--line-height);
}

/* Theme Selector */
.theme-options {
    display: flex;
    gap: var(--sp-sm);
    margin-top: var(--sp-sm);
}

.theme-btn {
    flex: 1;
    padding: var(--sp-md);
    border-radius: var(--sp-sm);
    border: 2px solid var(--border);
    cursor: pointer;
    text-align: center;
    font-size: var(--font-size-sm);
    transition: all var(--transition);
    min-height: var(--touch-min);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.theme-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.theme-btn:active {
    transform: scale(0.96);
}

.theme-swatch {
    width: 34px;
    height: 21px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.theme-swatch-light { background: #FDF6E3; }
.theme-swatch-sepia { background: #F5E6C8; }
.theme-swatch-night { background: #1A1A2E; }

/* DND Toggle */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--slider-track);
    border-radius: 34px;
    transition: var(--transition);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.dnd-message {
    margin-top: var(--sp-sm);
    padding: var(--sp-md);
    background: var(--accent-soft);
    border-radius: var(--sp-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height);
    display: none;
}

.dnd-message.visible {
    display: block;
}

/* --- Bottom Navigation --- */
.bottom-nav {
    height: var(--nav-height);
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--nav-bg);
    border-top: 1px solid var(--nav-border);
    padding-bottom: env(safe-area-inset-bottom);
    position: relative;
    z-index: 10;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--nav-inactive);
    font-size: 11px;
    cursor: pointer;
    padding: var(--sp-xs) var(--sp-sm);
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    transition: color var(--transition-fast);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn.active {
    color: var(--nav-active);
}

.nav-btn svg {
    transition: transform var(--transition-fast);
}

.nav-btn:active svg {
    transform: scale(0.9);
}

/* --- Swipe Hint --- */
.swipe-hint {
    text-align: center;
    padding: var(--sp-md) 0;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* --- Scrollbar --- */
.screens::-webkit-scrollbar {
    width: 4px;
}

.screens::-webkit-scrollbar-track {
    background: transparent;
}

.screens::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

/* --- Bilingual Display --- */

/* Toggle buttons in reader controls */
.reader-toggles {
    display: flex;
    gap: var(--sp-xs);
    flex-shrink: 0;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--sp-xs) var(--sp-sm);
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--sp-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    justify-content: center;
}

.toggle-btn:active {
    transform: scale(0.95);
}

.toggle-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.toggle-btn-label {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Chronological toggle */
.chrono-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-top: var(--sp-sm);
}

.chrono-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.chrono-tabs {
    display: flex;
    border-radius: var(--sp-sm);
    overflow: hidden;
    border: 1px solid var(--border-strong);
}

.chrono-tab {
    flex: 1;
    padding: 10px var(--sp-sm);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: var(--touch-min);
}

.chrono-tab:first-child {
    border-right: 1px solid var(--border-strong);
}

.chrono-tab-active {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.chrono-info {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-align: center;
}

/* Select mode */
.select-banner {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: var(--sp-xs) var(--sp-sm);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--sp-sm);
    margin-bottom: var(--sp-sm);
}

.select-banner-text {
    flex: 1;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

.select-count {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    padding: 2px 8px;
    border-radius: 21px;
    min-width: 22px;
    text-align: center;
}

.select-banner-cancel {
    padding: 4px 10px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.verse-selected {
    background: var(--accent-soft) !important;
    border-left: 3px solid var(--accent) !important;
}

.selection-bar {
    position: fixed;
    bottom: 55px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: var(--sp-sm) var(--sp-md);
    background: var(--bg-card);
    border-top: 1px solid var(--accent);
    box-shadow: 0 -4px 21px rgba(0,0,0,0.15);
    z-index: 90;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.selection-bar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--sp-sm);
    min-height: var(--touch-min);
    border: 1px solid var(--accent);
    border-radius: var(--sp-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.selection-bar-btn:active {
    transform: scale(0.95);
}

.selection-bar-cancel {
    flex: 0;
    width: var(--touch-min);
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-muted);
    font-size: 16px;
}

/* Verse bilingual layout */
.verse-bilingual {
    flex-direction: row;
    align-items: flex-start;
}

.verse-content {
    flex: 1;
    min-width: 0;
}

/* Original text styling */
.verse-original {
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.verse-original.rtl {
    direction: rtl;
    text-align: right;
}

.verse-original-arabic {
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', serif;
    font-size: calc(var(--font-size-base) + 4px);
    line-height: 2.2;
    letter-spacing: 0;
}

.verse-original-hebrew {
    font-family: 'Frank Ruhl Libre', 'David Libre', 'SBL Hebrew',
                 'Noto Sans Hebrew', serif;
    font-size: calc(var(--font-size-base) + 2px);
    line-height: 2;
}

/* Separator between original and translation */
.verse-separator {
    height: 1px;
    background: var(--border);
    margin: var(--sp-sm) 0;
    opacity: 0.6;
}

/* Translation text styling */
.verse-translation {
    font-size: calc(var(--font-size-base) - 1px);
    line-height: var(--line-height);
    color: var(--text-secondary);
    font-style: italic;
    direction: ltr;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* When only original is shown, give it full prominence */
.verse-content > .verse-original:only-child {
    font-size: var(--font-size-base);
}

/* When only translation is shown, give it full prominence */
.verse-content > .verse-translation:only-child {
    font-size: var(--font-size-base);
    font-style: normal;
    color: var(--text-primary);
}

/* Transliteration (phonetic) text styling */
.verse-transliteration {
    font-size: calc(var(--font-size-base) * 0.85);
    color: var(--text-muted, var(--text-secondary));
    font-style: italic;
    line-height: 1.5;
    margin-top: 4px;
    direction: ltr;
    text-align: left;
    font-family: 'Inter', sans-serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Language selector in settings */
.lang-selector {
    width: 100%;
    padding: var(--sp-sm) var(--sp-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--sp-sm);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238D6E63' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-sm) center;
    padding-right: var(--sp-xl);
    cursor: pointer;
    min-height: var(--touch-min);
    font-family: inherit;
    margin-top: var(--sp-sm);
}

/* --- Section texts without verses (single text blocks) --- */
.text-block {
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    padding: var(--sp-md) 0;
    white-space: pre-line;
}

/* Q passages */
.passage {
    padding: var(--sp-md) 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.passage:last-child {
    border-bottom: none;
}

.passage:active {
    background: var(--accent-soft);
    border-radius: var(--sp-sm);
}

.passage-ref {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
}

.passage-text {
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
}

/* --- Religion Icon Badge --- */
.religion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 6px;
    vertical-align: middle;
    line-height: 1;
}

/* --- Book Info Box (collapsible) --- */
.book-info-box {
    margin-bottom: var(--sp-md);
}

.book-info-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    width: 100%;
    padding: var(--sp-sm) var(--sp-md);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--sp-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.book-info-toggle:active {
    background: var(--bg-card-hover);
}

.book-info-toggle-icon {
    font-size: 14px;
    line-height: 1;
}

.book-info-toggle-arrow {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.book-info-content {
    display: none;
    padding: var(--sp-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--sp-sm) var(--sp-sm);
}

.book-info-content.open {
    display: block;
    animation: fadeIn 0.2s ease;
}

.book-info-row {
    display: flex;
    gap: var(--sp-sm);
    padding: var(--sp-xs) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.book-info-row:last-child {
    border-bottom: none;
}

.book-info-label {
    flex-shrink: 0;
    width: 110px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-top: 1px;
}

.book-info-value {
    flex: 1;
    color: var(--text-secondary);
    white-space: pre-line;
}

.book-info-history {
    margin-top: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-md);
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--sp-sm);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

.book-info-tahrif {
    margin-top: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-md);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--sp-sm);
    font-size: 11px;
    color: #b45309;
    line-height: 1.6;
    white-space: pre-line;
}

.book-info-contradictions {
    margin-top: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-md);
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--sp-sm);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

.book-info-disputed {
    margin-top: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-md);
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--sp-sm);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

.book-info-preservation {
    margin-top: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-md);
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--sp-sm);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

.info-quran-ref {
    color: var(--accent);
    text-decoration: underline dotted;
    cursor: pointer;
    font-weight: 600;
}
.info-quran-ref:active { opacity: 0.7; }

.book-info-subsection-header {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    padding: var(--sp-sm) 0 var(--sp-xs) 0;
    margin-top: var(--sp-sm);
    border-top: 1px solid var(--border-strong);
    letter-spacing: 0.3px;
}

/* --- Loading State --- */
.loading-indicator {
    text-align: center;
    padding: var(--sp-3xl);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* --- Responsive --- */
@media (min-width: 601px) {
    .app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

/* --- Safe Areas for iOS --- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }
}

/* --- 6-button bottom nav (tighter spacing) --- */
.nav-btn {
    padding: 3px 2px;
    min-width: 32px;
    font-size: 9px;
}

.nav-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
    display: block;
}

/* ============================================================
   Lexicon Screen
   ============================================================ */

/* Search bar */
.lexicon-search {
    margin-bottom: var(--sp-md);
}

.lexicon-search-input {
    width: 100%;
    padding: var(--sp-sm) var(--sp-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--sp-sm);
    outline: none;
    min-height: var(--touch-min);
    transition: border-color var(--transition-fast);
}

.lexicon-search-input:focus {
    border-color: var(--accent);
}

.lexicon-search-input::placeholder {
    color: var(--text-muted);
}

/* Tabs */
.lexicon-tabs {
    display: flex;
    gap: 0;
    margin-bottom: var(--sp-md);
    border-radius: var(--sp-sm);
    overflow: hidden;
    border: 1px solid var(--border-strong);
}

.lexicon-tab-btn {
    flex: 1;
    padding: var(--sp-sm) var(--sp-xs);
    font-size: var(--font-size-sm);
    font-family: inherit;
    font-weight: 500;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: var(--touch-min);
    text-align: center;
}

.lexicon-tab-btn:not(:last-child) {
    border-right: 1px solid var(--border-strong);
}

.lexicon-tab-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

/* Lexicon list */
.lexicon-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.lexicon-empty {
    text-align: center;
    padding: var(--sp-xl);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Lexicon entry */
.lexicon-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition-fast);
}

.lexicon-entry-header {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-md) var(--sp-lg);
    cursor: pointer;
    min-height: var(--touch-min);
}

.lexicon-entry-header:active {
    background: var(--bg-card-hover);
}

.lexicon-entry-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.lexicon-entry-name {
    flex: 1;
    min-width: 0;
}

.lexicon-name-fr {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.lexicon-name-ar {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    font-family: 'Noto Naskh Arabic', 'Amiri', serif;
    direction: rtl;
    line-height: 1.5;
}

.lexicon-entry-arrow {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.lexicon-entry-brief {
    padding: 0 var(--sp-lg) var(--sp-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Expanded state */
.lexicon-entry-expanded .lexicon-entry-brief {
    -webkit-line-clamp: unset;
    display: block;
}

.lexicon-entry-details {
    display: none;
    padding: 0 var(--sp-lg) var(--sp-md);
}

.lexicon-entry-expanded .lexicon-entry-details {
    display: block;
    animation: fadeIn 0.2s ease;
}

.lexicon-detail-row {
    display: flex;
    gap: var(--sp-sm);
    padding: var(--sp-xs) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.lexicon-detail-row:last-child {
    border-bottom: none;
}

.lexicon-detail-label {
    flex-shrink: 0;
    width: 100px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-top: 1px;
}

.lexicon-detail-value {
    flex: 1;
    color: var(--text-secondary);
    word-wrap: break-word;
}

/* ============================================================
   Family Tree Screen
   ============================================================ */

.tree-title {
    text-align: center;
    padding: var(--sp-lg) 0 var(--sp-xl);
}

.tree-title h2 {
    font-size: var(--font-size-xl);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--sp-xs);
}

.tree-title p {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    font-style: italic;
}

.tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: var(--sp-xl);
}

/* Tree node */
.tree-node {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: var(--sp-sm) var(--sp-lg);
    min-width: 120px;
    max-width: 200px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow);
}

.tree-node:active {
    transform: scale(0.97);
    background: var(--bg-card-hover);
}

.tree-node-prophet {
    border-color: var(--accent);
    border-width: 2px;
    background: var(--accent-soft);
}

.tree-node-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tree-node-ar {
    font-family: 'Noto Naskh Arabic', 'Amiri', serif;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.5;
}

.tree-node-fr {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.tree-node-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Non-prophet nodes are smaller */
.tree-node:not(.tree-node-prophet) {
    padding: var(--sp-xs) var(--sp-md);
    min-width: 80px;
    max-width: 140px;
    opacity: 0.8;
}

.tree-node:not(.tree-node-prophet) .tree-node-ar {
    font-size: var(--font-size-sm);
}

.tree-node:not(.tree-node-prophet) .tree-node-fr {
    font-size: 12px;
}

/* Connector line */
.tree-connector {
    width: 2px;
    height: 21px;
    background: var(--accent);
    opacity: 0.4;
    flex-shrink: 0;
}

/* Branch split at Ibrahim */
.tree-split {
    display: flex;
    gap: var(--sp-md);
    width: 100%;
    max-width: 100%;
    margin-top: var(--sp-sm);
    position: relative;
}

.tree-split::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--accent);
    opacity: 0.4;
}

.tree-branch-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.tree-branch-label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--sp-sm);
    padding-top: var(--sp-sm);
    letter-spacing: 0.3px;
}

/* Tree popup details */
.tree-popup-details {
    padding: var(--sp-sm) 0;
}

/* ============================================================
   Lexicon Hypertext Links in Reader
   ============================================================ */

.lexicon-link {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.lexicon-link:active {
    opacity: 0.7;
}

/* Lexicon popup / tooltip */
.lexicon-popup {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--card-radius);
    padding: var(--sp-md);
    box-shadow: var(--shadow-lg);
    max-width: 300px;
    min-width: 200px;
    animation: fadeIn 0.15s ease;
}

.lexicon-popup-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--accent);
    margin-bottom: var(--sp-xs);
    line-height: 1.4;
}

.lexicon-popup-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: var(--line-height);
    margin-bottom: var(--sp-sm);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lexicon-popup-refs {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--sp-sm);
}

.lexicon-popup-more {
    display: block;
    width: 100%;
    padding: var(--sp-xs) var(--sp-sm);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--sp-sm);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    min-height: 34px;
}

.lexicon-popup-more:active {
    background: var(--accent);
    color: #fff;
}

/* --- Ruqya Shield Icon & Popup --- */
.ruqya-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
    padding: 4px;
    opacity: 0.55;
    transition: all 0.2s;
}
.ruqya-icon:active { opacity: 1; transform: scale(1.15); }

/* --- Gospel Interpolation Warning --- */
.verse-interpolation {
    background: rgba(245, 158, 11, 0.08) !important;
    border-left: 3px solid #f59e0b !important;
}

.verse-disputed {
    background: rgba(245, 158, 11, 0.08) !important;
    border-left: 3px solid #f59e0b !important;
}

.interpolation-icon {
    display: flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
    padding: 4px;
    opacity: 0.7;
    transition: all 0.2s;
}
.interpolation-icon:active { opacity: 1; transform: scale(1.15); }

.interpolation-popup {
    position: fixed;
    bottom: 60px;
    left: 8px;
    right: 8px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 2px solid #f59e0b;
    border-radius: 13px;
    padding: 16px;
    box-shadow: 0 -4px 21px rgba(0,0,0,0.2);
    z-index: 150;
    animation: slideUp 0.2s ease;
}

.interpolation-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 10px;
}

.interpolation-popup-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.interpolation-popup-manuscripts {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 8px;
}

.interpolation-popup-source {
    display: inline-block;
    color: #f59e0b;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    margin-bottom: 10px;
}

.interpolation-popup-close {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

/* --- Maat-Quran Cross-Reference Icon & Popup --- */
.maat-quran-icon {
    display: flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
    padding: 4px;
    opacity: 0.55;
    transition: all 0.2s;
}
.maat-quran-icon:active { opacity: 1; transform: scale(1.15); }

.maat-quran-popup {
    position: fixed;
    bottom: 60px;
    left: 8px;
    right: 8px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 2px solid #6d8b74;
    border-radius: 13px;
    padding: 16px;
    box-shadow: 0 -4px 21px rgba(0,0,0,0.2);
    z-index: 150;
    animation: slideUp 0.2s ease;
}

.maat-quran-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #6d8b74;
    margin-bottom: 6px;
}

.maat-quran-popup-theme {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.maat-quran-popup-section {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(109, 139, 116, 0.06);
    border-radius: 8px;
}

.maat-quran-popup-label {
    font-size: 12px;
    font-weight: 600;
    color: #6d8b74;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.maat-quran-popup-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.maat-quran-popup-go {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #6d8b74;
    border-radius: 8px;
    background: rgba(109, 139, 116, 0.1);
    color: #6d8b74;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.2s;
}
.maat-quran-popup-go:active { background: rgba(109, 139, 116, 0.2); }

.maat-quran-popup-close {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.ruqya-icon-title {
    display: inline-flex;
    font-size: 20px;
    margin-left: 10px;
    opacity: 0.7;
    vertical-align: middle;
}

.ruqya-popup {
    position: fixed;
    bottom: 60px;
    left: 8px;
    right: 8px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 13px;
    padding: 13px;
    box-shadow: 0 -4px 21px rgba(0,0,0,0.2);
    z-index: 150;
    animation: slideUp 0.2s ease;
}

.ruqya-popup-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.ruqya-popup-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.ruqya-popup-item:last-of-type { border-bottom: none; }

.ruqya-popup-effect {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ruqya-popup-context {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 4px;
}

.ruqya-popup-times {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

.ruqya-popup-cat {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}

.ruqya-popup-close {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

/* ============================================================
   Global Search
   ============================================================ */
.search-container { padding: 0 var(--sp-md); margin-bottom: var(--sp-md); }

.search-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: var(--sp-xs) var(--sp-sm);
    transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); }

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

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    outline: none;
    padding: var(--sp-xs) 0;
    min-width: 0;
}
.search-bar input::placeholder { color: var(--text-tertiary); }

.search-clear-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.search-clear-btn:active { opacity: 0.7; }

.search-filter-btn {
    flex-shrink: 0;
    padding: var(--sp-xs) var(--sp-sm);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.search-filter-btn:active { opacity: 0.7; }

.search-filter-dropdown {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 13px;
    margin-top: var(--sp-xs);
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    position: relative;
}

.search-filter-item {
    padding: var(--sp-xs) var(--sp-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
}
.search-filter-item:active { background: var(--accent-soft); }
.search-filter-item.active { color: var(--accent); font-weight: 600; }

.search-filter-header {
    padding: var(--sp-xs) var(--sp-md);
    padding-top: var(--sp-sm);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-results {
    margin-top: var(--sp-sm);
    max-height: 60vh;
    overflow-y: auto;
    padding-bottom: var(--sp-lg);
}
.search-results-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--sp-sm);
}
.search-results-loading {
    font-size: 12px;
    color: var(--text-muted);
    padding: var(--sp-md) 0;
    text-align: center;
}
.search-result-item {
    padding: var(--sp-sm) 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.search-result-item:active { opacity: 0.7; }
.search-result-ref {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.search-result-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}
.search-highlight {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    padding: 0 2px;
    border-radius: 3px;
}

.home-categories.search-active { display: none; }
.continue-reading.search-active { display: none !important; }

/* --- Book Scientifique: Sources & Quran Refs --- */
.source-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    padding: 2px 8px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    margin: 2px 0;
}
.source-link:active { opacity: 0.7; }

.book-sources {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
    border-top: 1px solid var(--border);
    padding-top: var(--sp-sm);
    margin-top: var(--sp-sm);
}

.verse-quran-ref {
    color: var(--accent);
    text-decoration: underline dotted;
    cursor: pointer;
    font-weight: 600;
}
.verse-quran-ref:active { opacity: 0.7; }

.reader-back-book {
    display: block;
    width: 100%;
    padding: var(--sp-xs) var(--sp-sm);
    margin-bottom: var(--sp-sm);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
}

/* --- Tree Search Bar --- */
.tree-search {
    padding: 0 var(--sp-md);
    margin-bottom: var(--sp-md);
}
.tree-search-input {
    width: 100%;
    padding: var(--sp-sm) var(--sp-md);
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.tree-search-input:focus { border-color: var(--accent); }
.tree-node-highlight {
    border: 2px solid var(--accent) !important;
    background: var(--accent-soft) !important;
    box-shadow: 0 0 10px rgba(212,165,116,0.3);
}

/* --- Tree Person Links in Reader --- */
.tree-person-link {
    color: var(--accent);
    text-decoration: underline dotted;
    cursor: pointer;
}

.tree-person-popup {
    position: fixed;
    bottom: 60px;
    left: 8px;
    right: 8px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 13px;
    padding: 13px;
    box-shadow: 0 -4px 21px rgba(0,0,0,0.2);
    z-index: 150;
    animation: slideUp 0.2s ease;
}

.tree-person-popup-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.tree-person-popup-names {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: var(--accent-soft);
    border-radius: 6px;
}

.tree-person-popup-bio {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.tree-person-popup-btn {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    margin-bottom: 6px;
}

.tree-person-popup-close {
    display: block;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
}

/* --- Audio Controls --- */
.verse-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.verse-audio-btn {
    font-size: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 3px;
    line-height: 1;
}
.verse-audio-btn:active { opacity: 1; }

.verse-playing {
    background: rgba(59, 130, 246, 0.08) !important;
    border-left: 3px solid #3b82f6 !important;
}

/* Audio Mini Player */
/* ── Audio Player Dock ── */
.audio-player {
    position: fixed;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    animation: slideUp 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.audio-dock {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 251, 240, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(212, 165, 116, 0.25);
    border-radius: 100px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                inset 0 0 16px rgba(212, 165, 116, 0.08);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

[data-theme="sepia"] .audio-dock {
    background: rgba(255, 240, 214, 0.8);
}

[data-theme="dark"] .audio-dock {
    background: rgba(31, 31, 56, 0.75);
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35),
                inset 0 0 16px rgba(212, 175, 55, 0.06);
}

.audio-dock-info {
    text-align: center;
    min-width: 0;
    max-width: 120px;
}

.audio-player-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.audio-player-verse {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
}

.audio-dock-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}

.audio-dock-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.08);
    color: var(--text-secondary);
    font-size: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.audio-dock-btn:hover {
    transform: translateY(-3px) scale(1.15);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px rgba(212, 165, 116, 0.4),
                0 0 40px rgba(212, 165, 116, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.audio-dock-btn:active {
    transform: scale(0.9);
}

.audio-dock-btn.active {
    background: rgba(212, 165, 116, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
}

/* Play button — bigger & highlighted */
.audio-dock-btn-play {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.audio-dock-btn-play:hover {
    background: var(--accent);
    color: #fff;
}

/* Close button — smaller & subtle */
.audio-dock-btn-close {
    width: 32px;
    height: 32px;
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
}

.audio-dock-btn-close:hover {
    background: rgba(180, 60, 60, 0.15);
    color: #c44;
    box-shadow: none;
}

[data-theme="dark"] .audio-dock-btn {
    background: rgba(212, 175, 55, 0.08);
}

[data-theme="dark"] .audio-dock-btn:hover {
    background: var(--accent);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4),
                0 0 40px rgba(212, 175, 55, 0.15);
}

[data-theme="dark"] .audio-dock-btn.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .audio-dock-btn-play {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* SVG inside dock buttons */
.audio-dock-btn svg {
    display: block;
}

/* Tooltip labels */
.audio-dock-label {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 4px 12px;
    background: var(--text-primary);
    color: var(--bg-card);
    font-weight: 700;
    font-size: 10px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.audio-dock-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
}

.audio-dock-btn:hover .audio-dock-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.settings-select {
    width: 100%;
    padding: var(--sp-sm);
    border: 1px solid var(--border);
    border-radius: var(--sp-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    margin-top: var(--sp-xs);
}

/* ─── Install App Button & Popup ─── */
.install-app-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 20px;
    border: 2px solid var(--accent);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(212,165,116,0.1), rgba(212,165,116,0.05));
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.install-app-btn:hover {
    background: rgba(212,165,116,0.15);
    transform: translateY(-1px);
}
.install-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.install-popup {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 400px;
    width: 100%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}
.install-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.install-popup h3 {
    text-align: center;
    color: var(--accent);
    font-size: 1.2rem;
    margin: 0 0 20px 0;
}
.install-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.install-step:last-child {
    border-bottom: none;
}
.install-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.install-step-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}
.install-step-text strong {
    color: var(--accent);
}
.install-note {
    margin-top: 16px;
    padding: 12px;
    background: rgba(212,165,116,0.08);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}
