/* ════════════════════════════════════════════════════════════════════
   v9.9 — Phase 1 Feature Styles
   ════════════════════════════════════════════════════════════════════ */

/* ── Toast (used by copy/share/error feedback) ── */
.app-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-sidebar);
    color: var(--text-primary);
    padding: 11px 22px;
    border-radius: 99px;
    border: 1px solid var(--accent);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-ui);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s;
    max-width: 80vw;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.app-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Account for bottom nav on mobile */
@media (max-width: 900px) {
    .app-toast { bottom: 75px; }
}

/* ── Last-read banner ── */
.last-read-banner {
    background: var(--accent-trace);
    border-bottom: 1px solid var(--accent-faint);
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-family: var(--font-ui);
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.lrb-icon { font-size: 16px; flex-shrink: 0; }
.lrb-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lrb-text strong { color: var(--accent); font-weight: 600; }
.lrb-go {
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 99px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
}
.lrb-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    width: auto;
    flex-shrink: 0;
}
.lrb-close:hover { color: var(--accent); }

/* ── Skeleton loaders ── */
.skeleton-wrap { padding: 24px; }
.skeleton-line {
    height: 18px;
    background: linear-gradient(90deg, var(--accent-trace) 0%, var(--accent-faint) 50%, var(--accent-trace) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    margin: 8px 0;
}
.skeleton-title { height: 28px; width: 50%; margin-bottom: 24px; }
.skeleton-verse { padding: 14px 0; border-bottom: 1px solid var(--border); }
.skeleton-ar { height: 28px; width: 90%; }
.skeleton-tr { height: 16px; width: 70%; }
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Error states ── */
.error-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-primary);
}
.error-icon { font-size: 48px; opacity: 0.5; margin-bottom: 16px; }
.error-msg {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.85;
}
.error-retry {
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 99px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
}

/* ── Keyboard shortcuts overlay ── */
.shortcuts-help {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 800;
    backdrop-filter: blur(4px);
}
.shortcuts-help.show { display: flex; }
.shortcuts-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    padding: 20px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.shortcuts-header h3 {
    font-size: 17px;
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--accent);
    font-weight: 600;
}
.shortcuts-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    width: auto;
}
.shortcut-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
    font-family: var(--font-ui);
}
.shortcut-row kbd {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 12px;
    color: var(--accent);
    font-family: monospace;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1);
}
.shortcut-row span:not(kbd) {
    flex: 1;
    opacity: 0.85;
}

/* ── Focus mode ── */
body.focus-mode header,
body.focus-mode .sidebar1,
body.focus-mode .bottom-nav,
body.focus-mode footer,
body.focus-mode #verseNavFab,
body.focus-mode #lastReadBanner,
body.focus-mode #tocContainer {
    display: none !important;
}
body.focus-mode .textContainer,
body.focus-mode .sura-contexte {
    padding: 40px 60px !important;
}
@media (max-width: 600px) {
    body.focus-mode .textContainer,
    body.focus-mode .sura-contexte {
        padding: 24px 18px !important;
    }
}
/* Subtle exit hint in focus mode */
body.focus-mode::after {
    content: 'F or Esc to exit';
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-ui);
    opacity: 0.5;
    pointer-events: none;
    z-index: 9;
}
@media (max-width: 900px) {
    body.focus-mode::after {
        content: 'Tap anywhere to exit';
    }
}

/* ── Verse navigation FAB ── */
.verse-nav-fab {
    position: fixed;
    right: 16px;
    /* v10.12: Vertically centered on right edge (desktop) — was bottom-corner */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 40;
    opacity: 0.7;
    transition: opacity 0.2s;
    cursor: grab;
    touch-action: none;
}
.verse-nav-fab:hover { opacity: 1; }
.verse-nav-fab:active { cursor: grabbing; }
.vnav-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--bg-sidebar);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: var(--font-ui);
    transition: background 0.15s, transform 0.1s;
}
.vnav-btn:hover { background: var(--accent-trace); }
.vnav-btn:active { transform: scale(0.92); }
.vnav-jump { font-size: 16px; font-weight: 700; }

@media (max-width: 900px) {
    /* Mobile: revert to bottom-corner (no right space available) */
    .verse-nav-fab {
        bottom: 70px;
        right: 10px;
        top: auto;
        transform: none;
        gap: 6px;
    }
    .vnav-btn { width: 38px; height: 38px; font-size: 19px; }
}

@media (max-width: 600px) {
    .verse-nav-fab {
        bottom: 70px;
        flex-direction: column;
        right: 8px;
    }
}

/* ── Pull-to-refresh indicator ── */
.pull-indicator {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translate(-50%, 0);
    background: var(--accent-trace);
    color: var(--accent);
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-ui);
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    border: 1px solid var(--accent-faint);
}

/* ── Feature toggles in settings ── */
.feature-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-family: var(--font-ui);
}
.feature-toggle-row:last-child { border-bottom: none; }
.feature-toggle-lbl {
    font-size: 16px;
    color: var(--text-primary);
    flex: 1;
    padding-right: 12px;
    opacity: 0.92;
}

/* iOS-style toggle switch */
.feature-toggle-sw {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.feature-toggle-sw input {
    opacity: 0;
    width: 0;
    height: 0;
}
.feature-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-mid);
    border-radius: 99px;
    cursor: pointer;
    transition: background 0.2s;
}
.feature-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.feature-toggle-sw input:checked + .feature-toggle-slider {
    background: var(--accent);
}
.feature-toggle-sw input:checked + .feature-toggle-slider::before {
    transform: translateX(20px);
}

.feature-sub-row {
    padding: 12px 0 8px;
    border-top: 1px dashed var(--border);
    margin-top: 8px;
}
.feature-sub-lbl {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 6px;
    opacity: 0.85;
}

/* ── Khatm heatmap ── */
.khatm-heatmap {
    padding: 4px 0 10px;
}
.khatm-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.khatm-completions {
    background: var(--accent-trace);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}
.khatm-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}
.khatm-cell {
    aspect-ratio: 1;
    background: var(--accent-trace);
    border-radius: 2px;
    transition: background 0.15s;
}
.khatm-cell[data-level="1"] { background: var(--accent-faint); }
.khatm-cell[data-level="2"] { background: var(--accent-dim); }
.khatm-cell[data-level="3"] { background: var(--accent); opacity: 0.7; }
.khatm-cell[data-level="4"] { background: var(--accent); }
.khatm-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    font-size: 10px;
    color: var(--text-muted);
}
.khatm-legend .kl {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: var(--accent-trace);
    display: inline-block;
}
.khatm-legend .kl[data-level="1"] { background: var(--accent-faint); }
.khatm-legend .kl[data-level="2"] { background: var(--accent-dim); }
.khatm-legend .kl[data-level="3"] { background: var(--accent); opacity: 0.7; }
.khatm-legend .kl[data-level="4"] { background: var(--accent); }

/* ── Landscape layout adjustments ── */
/* ════════════════════════════════════════════════════════════════════
   v10.9 — Landscape mode for phones (proper space optimization)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    /* Hide install banner in landscape — saves precious vertical space */
    .header-install-btn { display: none !important; }

    /* Compact header */
    header {
        min-height: 0;
        padding: 4px 12px;
    }

    /* Slimmer bottom nav so verse area has more room */
    .bottom-nav .bnav-btn { padding: 3px 2px 5px; }
    .bnav-ico { font-size: 16px; line-height: 1; }
    .bnav-lbl { font-size: 9px; }
    .bottom-nav { height: 42px; }

    /* Sticky title becomes a thin bar */
    .sura-sticky-title {
        padding: 5px 10px !important;
        font-size: 13px !important;
    }
    .sura-streak-pill,
    .sura-print-pill,
    .sura-focus-pill {
        padding: 2px 7px !important;
        font-size: 11px !important;
    }

    /* Verse cards: less vertical padding, slightly tighter line-height */
    .verse {
        padding: 8px 14px 6px !important;
        margin-bottom: 6px !important;
        line-height: 1.75 !important;
    }
    .secondary-verse {
        margin-top: 4px !important;
        line-height: 1.55 !important;
    }

    /* Bismillah panel slimmer */
    .bismillah-panel { margin: 8px 0 12px !important; }
    .bismillah-text { padding: 8px 4px !important; font-size: 1.1rem !important; }

    /* Last-read banner */
    .last-read-banner { padding: 5px 12px !important; }
    .lrb-text { font-size: 11px !important; }

    /* Bottom sheet adapts to short height — show more list at once */
    .mob-sheet { max-height: 95vh; }
    .mob-sheet-header { padding: 8px 14px !important; }

    /* Continue Reading card (desktop sidebar style) — compact in landscape */
    .continue-reading-card,
    .last-read-banner { margin-bottom: 6px; }

    /* Reading container claims more vertical space */
    .textContainer {
        padding: 6px 14px !important;
    }

    /* Audio mini-player — slim it */
    .audio-mini-player {
        padding: 6px 10px !important;
        bottom: 50px !important;
    }
    .amp-verse-line { font-size: 12px; }
    .amp-reciter-line { font-size: 10px; }
}

/* ════════════════════════════════════════════════════════════════════
   v9.10 — Mobile search clear button
   ════════════════════════════════════════════════════════════════════ */
.mob-search-clear {
    background: var(--bg-sidebar);
    color: var(--text-muted);
    border: 1px solid var(--border-btn);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.mob-search-clear:hover, .mob-search-clear:active {
    color: var(--accent);
    background: var(--accent-trace);
}

/* ════════════════════════════════════════════════════════════════════
   v9.10 — Feature toggle subtitle (explains what each toggle does)
   ════════════════════════════════════════════════════════════════════ */
.feature-toggle-lbl-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    padding-right: 12px;
    min-width: 0;
}
.feature-toggle-sub {
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.78;
    font-weight: 400;
    line-height: 1.4;
}

/* ════════════════════════════════════════════════════════════════════
   v9.12 — Desktop Features modal
   ════════════════════════════════════════════════════════════════════ */

#featuresBtn {
    width: 100%;
    padding: 11px 12px;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    color: var(--text-btn);
    text-align: left;
    font-size: 21px;
    font-family: var(--font-ui);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
#featuresBtn:hover {
    background: var(--bg-btn-hover);
    color: var(--text-primary);
}

.features-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 800;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.features-modal-overlay.show { display: flex; }

.features-modal-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    width: 560px;
    max-width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    overflow: hidden;
}

.features-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.features-modal-title {
    font-size: 22px;
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--accent);
    font-weight: 600;
}

.features-modal-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 14px;
    padding: 5px 12px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
}
.features-modal-close:hover { background: var(--accent-faint); }

.features-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

/* Inside modal, .mob-settings-section gets desktop-friendly padding + clear visual divider */
.features-modal-body .mob-settings-section {
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-mid);
    position: relative;
}
.features-modal-body .mob-settings-section:last-child {
    border-bottom: none;
}
/* Section label as a clear header */
.features-modal-body .mob-settings-section .mob-settings-lbl {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--accent-faint);
}

/* Desktop: hide the modal on mobile screens (we use the sheet instead) */
@media (max-width: 900px) {
    #featuresBtn { display: none; }
    .features-modal-overlay { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
   v10 — VERSE ACTIONS (grouped Save/Share with chooser popover)
   ════════════════════════════════════════════════════════════════════ */
.verse-action-btn.verse-action-save,
.verse-action-btn.verse-action-share {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 99px;
    color: var(--accent);
    font-size: 13px;
    font-family: var(--font-ui);
    cursor: pointer;
    width: auto;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}

.verse-action-btn.verse-action-save:hover,
.verse-action-btn.verse-action-share:hover {
    background: var(--accent-faint);
    border-color: var(--accent-dim);
}

.verse-action-btn.verse-action-save.has-saved {
    background: var(--accent-faint);
    border-color: var(--accent);
}

.va-icon { font-size: 13px; line-height: 1; }
.va-label { font-size: 12px; font-weight: 500; }
.va-dot {
    position: absolute;
    top: 2px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    border: 1.5px solid var(--bg-content);
}

@media (max-width: 600px) {
    .verse-action-btn.verse-action-save,
    .verse-action-btn.verse-action-share {
        padding: 6px 14px;
        font-size: 14px;
    }
}

/* ── Verse chooser popover ── */
.verse-chooser {
    position: absolute;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    padding: 4px;
    z-index: 500;
    box-shadow: 0 8px 28px rgba(0,0,0,0.4);
    min-width: 160px;
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
.verse-chooser.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.verse-chooser-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-ui);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}

.verse-chooser-item:hover {
    background: var(--accent-trace);
}

.verse-chooser-item.active {
    background: var(--accent-trace);
    color: var(--accent);
    font-weight: 600;
}

.vci-icon { font-size: 16px; flex-shrink: 0; width: 18px; text-align: center; }
.vci-label { flex: 1; }
.vci-check { font-size: 14px; color: var(--accent); flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════
   v10 — STICKY TITLE (streak pill + focus pill)
   ════════════════════════════════════════════════════════════════════ */
.sura-sticky-title {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sura-sticky-title-text {
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.sura-streak-pill {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    line-height: 1.4;
    white-space: nowrap;
}
.sura-streak-pill:hover { background: var(--accent-faint); }
.sura-streak-pill.hidden { visibility: hidden; }
.sura-streak-pill .streak-num { font-weight: 700; }

.sura-focus-pill {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s, transform 0.1s;
    width: auto;
    height: auto;
    font-family: inherit;
}
.sura-focus-pill:hover {
    background: var(--accent-faint);
    transform: scale(1.05);
}
.sura-focus-pill:active { transform: scale(0.92); }
.sura-focus-pill.hidden { display: none; }

/* Inline heatmap (slides down under sticky title when streak tapped) */
.inline-heatmap-box {
    background: var(--bg-content);
    border-bottom: 1px solid var(--border);
    padding: 0 18px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(.4,0,.2,1);
}
.inline-heatmap-box .khatm-heatmap {
    padding: 12px 0 14px;
}

/* ════════════════════════════════════════════════════════════════════
   v10 — CONTINUE READING CARD
   ════════════════════════════════════════════════════════════════════ */
.continue-reading-card {
    margin: 10px 12px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.continue-reading-card:hover {
    background: var(--accent-faint);
    transform: translateX(2px);
}

.continue-reading-card:active {
    transform: translateX(0);
}

.crc-icon {
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.crc-text {
    flex: 1;
    min-width: 0;
}

.crc-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-ui);
    opacity: 0.85;
}

.crc-name {
    font-size: 15px;
    color: var(--accent);
    font-style: italic;
    font-weight: 600;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crc-verse {
    font-size: 11px;
    color: var(--text-primary);
    margin-top: 2px;
    opacity: 0.78;
    font-family: var(--font-ui);
}

.crc-arrow {
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
    font-family: var(--font-ui);
}

/* Desktop variant — narrower, less margin */
.continue-reading-card-desktop {
    margin: 8px 6px 10px;
    padding: 9px 11px;
}
.continue-reading-card-desktop .crc-icon { font-size: 16px; }
.continue-reading-card-desktop .crc-name { font-size: 13px; }
.continue-reading-card-desktop .crc-verse { font-size: 10px; }
.continue-reading-card-desktop .crc-label { font-size: 9px; }

/* ════════════════════════════════════════════════════════════════════
   v10 — THEME BUTTONS (with swatches and dual labels)
   ════════════════════════════════════════════════════════════════════ */
#themeSwitcher .theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 10px 8px;
    background: transparent;
    border: 1px solid var(--border-btn);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    width: auto;
    min-width: 88px;
    line-height: 1.2;
}

#themeSwitcher .theme-btn:hover {
    background: var(--accent-trace);
    border-color: var(--accent-faint);
}

#themeSwitcher .theme-btn.active {
    background: var(--accent-trace);
    border-color: var(--accent);
}

.theme-swatch {
    width: 100%;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.15);
    margin-bottom: 4px;
}
.theme-swatch-manuscript { background: linear-gradient(135deg, #1a1208 0%, #3a2818 100%); }
.theme-swatch-minimal    { background: linear-gradient(135deg, #f8f7f4 0%, #e8e6df 100%); }
.theme-swatch-scholar    { background: linear-gradient(135deg, #0d1117 0%, #1f2937 100%); }

.theme-name-primary {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.theme-name-aesthetic {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0.78;
    white-space: nowrap;
}

/* Desktop theme button: stack swatch + labels vertically */
#themeSwitcher .theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 14px;
    min-width: 80px;
}

#themeSwitcher .theme-btn.active {
    box-shadow: inset 0 0 0 2px var(--accent);
}

#themeSwitcher .theme-btn.active .theme-name-primary { color: var(--accent); }
#themeSwitcher .theme-btn.active .theme-name-aesthetic { color: var(--accent); opacity: 1; }

@media (max-width: 600px) {
    #themeSwitcher .theme-btn {
        min-width: 0;
        padding: 6px 6px 7px;
    }
    .theme-name-primary { font-size: 12px; }
    .theme-name-aesthetic { font-size: 11px; }
}

/* Mobile theme chips (in settings sheet) */
.mob-theme-chip {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 6px 9px !important;
    line-height: 1.2;
}
.mob-theme-swatch {
    width: 100%;
    height: 24px;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.15);
    margin-bottom: 3px;
}
.mob-theme-swatch-manuscript { background: linear-gradient(135deg, #1a1208 0%, #3a2818 100%); }
.mob-theme-swatch-minimal    { background: linear-gradient(135deg, #f8f7f4 0%, #e8e6df 100%); }
.mob-theme-swatch-scholar    { background: linear-gradient(135deg, #0d1117 0%, #1f2937 100%); }
.mob-theme-primary {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.mob-theme-chip.active .mob-theme-primary {
    color: var(--accent);
}
.mob-theme-aesthetic {
    font-size: 10px;
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0.78;
}
.mob-theme-chip.active .mob-theme-aesthetic {
    color: var(--accent);
    opacity: 1;
}

/* ════════════════════════════════════════════════════════════════════
   v10 — SIDEBAR COLLAPSIBLE GROUPS
   ════════════════════════════════════════════════════════════════════ */
.side-group {
    border-top: 1px solid var(--border);
    padding: 0;
    margin-top: 6px;
}

.side-group:first-of-type {
    border-top: none;
    margin-top: 10px;
}

.side-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 18px;
    color: var(--accent);
    text-align: left;
    border-radius: 5px;
    transition: background 0.15s;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.side-group-header:hover {
    background: var(--accent-trace);
}

.side-group-arrow {
    display: inline-block;
    font-size: 9px;
    color: var(--text-secondary);
    transition: transform 0.18s ease-out;
    width: 12px;
    text-align: center;
    opacity: 0.7;
}

.side-group.side-group-open .side-group-arrow {
    transform: rotate(90deg);
    color: var(--accent);
    opacity: 1;
}

.side-group-label {
    flex: 1;
}

.side-group-body {
    display: none;
    padding: 4px 2px 8px;
}

.side-group.side-group-open .side-group-body {
    display: block;
    animation: side-group-fade-in 0.2s ease-out;
}

@keyframes side-group-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* When inside a collapsible group, font/lang sections lose their old top borders */
.side-group-body #fontSizeSection,
.side-group-body #firstLanguage,
.side-group-body #multiLanguage,
.side-group-body #toggleButtons {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Search controls inside collapsible group — remove redundant border */
#searchControls {
    margin-top: 2px;
    padding-bottom: 4px;
    margin-bottom: 2px;
}

/* Hide collapsible groups when on mobile (sidebar drawer reuses these) */
@media (max-width: 600px) {
    .side-group-header { font-size: 14px; padding: 11px 4px; }
}

/* ════════════════════════════════════════════════════════════════════
   v10.1 — DAILY READING PLAN
   ════════════════════════════════════════════════════════════════════ */
.reading-plan-card {
    margin: 10px 14px 0;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.rpc-icon {
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
    line-height: 1;
}

.rpc-text {
    flex: 1;
    min-width: 0;
}

.rpc-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-ui);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rpc-detail {
    font-size: 11px;
    color: var(--text-primary);
    opacity: 0.78;
    font-family: var(--font-ui);
    margin-top: 3px;
}

.rpc-progress {
    margin: 6px 0 4px;
    height: 4px;
    background: var(--accent-faint);
    border-radius: 99px;
    overflow: hidden;
}

.rpc-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.3s;
}

.rpc-action {
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 99px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
    font-family: var(--font-ui);
    transition: transform 0.1s, opacity 0.15s;
}

.rpc-action:hover { opacity: 0.9; }
.rpc-action:active { transform: scale(0.96); }

.rpc-done-badge {
    background: var(--accent-faint);
    color: var(--accent);
    padding: 6px 11px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-ui);
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .reading-plan-card { margin: 8px 12px 0; padding: 9px 11px; }
    .rpc-label { font-size: 12px; }
    .rpc-detail { font-size: 10px; }
}

/* Plan picker (in settings) */
.rp-preset-btn {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px !important;
    text-align: left !important;
}

.rpb-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-ui);
}

.rpb-desc {
    font-size: 11px;
    color: var(--text-primary);
    opacity: 0.7;
    font-family: var(--font-ui);
}

.rp-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 4px;
    border-top: 1px dashed var(--border);
    margin-top: 6px;
}

.rp-custom-row .rpb-label {
    flex-shrink: 0;
}

.rp-custom-row input {
    width: 70px;
    background: var(--bg-input, var(--accent-trace));
    border: 1px solid var(--accent-faint);
    border-radius: 6px;
    padding: 6px 9px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: var(--font-ui);
}

.rp-custom-go {
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 99px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
    flex-shrink: 0;
    margin-left: auto;
}

/* Active plan info display */
.reading-plan-active {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 7px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-family: var(--font-ui);
}

.rpa-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
}

.rpa-key {
    color: var(--text-primary);
    opacity: 0.8;
}

.rpa-val {
    color: var(--text-primary);
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════
   v10.1 — PWA update notification bar
   ════════════════════════════════════════════════════════════════════ */
.pwa-update-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-page);
    padding: 14px 22px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 28px rgba(0,0,0,0.5);
    max-width: 92vw;
    animation: pwa-bar-in 0.3s cubic-bezier(.4,0,.2,1);
}

@keyframes pwa-bar-in {
    from { transform: translateX(-50%) translateY(80px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.pwa-update-btn {
    background: var(--bg-page);
    color: var(--accent);
    border: none;
    border-radius: 99px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
}

.pwa-update-dismiss {
    background: transparent;
    border: none;
    color: var(--bg-page);
    font-size: 18px;
    cursor: pointer;
    padding: 3px 8px;
    width: auto;
    opacity: 0.8;
}
.pwa-update-dismiss:hover { opacity: 1; }

@media (max-width: 600px) {
    .pwa-update-bar { bottom: 75px; font-size: 14px; padding: 12px 18px; }
    .pwa-update-btn { padding: 6px 14px; font-size: 13px; }
}

/* ════════════════════════════════════════════════════════════════════
   v10.2 — AUDIO MINI-PLAYER
   ════════════════════════════════════════════════════════════════════ */

/* Audio play button inline on each verse */
.verse-audio-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    background: var(--accent-trace) !important;
    border: 1px solid var(--accent-faint) !important;
    border-radius: 50% !important;
    color: var(--accent) !important;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.verse-audio-btn:hover {
    background: var(--accent-faint) !important;
    transform: scale(1.05);
}
.verse-audio-btn:active { transform: scale(0.92); }
.verse-audio-btn.playing {
    background: var(--accent) !important;
    color: var(--bg-page) !important;
    border-color: var(--accent) !important;
    animation: audio-pulse 1.5s ease-in-out infinite;
}
@keyframes audio-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-faint); }
    50%      { box-shadow: 0 0 0 6px transparent; }
}

/* Active verse highlight while audio plays */
.verse.playing-now {
    background: var(--accent-trace) !important;
    border-left: 3px solid var(--accent) !important;
    padding-left: 9px !important;
    transition: background 0.3s, padding 0.2s;
}

/* Mini-player bar */
.audio-mini-player {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 70px;      /* above mobile bottom nav */
    background: var(--bg-sidebar);
    border: 1px solid var(--accent-faint);
    border-radius: 12px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 700;
    font-family: var(--font-ui);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: mini-player-slide-in 0.25s cubic-bezier(.4,0,.2,1);
}

@keyframes mini-player-slide-in {
    from { transform: translateY(120px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@media (min-width: 901px) {
    .audio-mini-player {
        left: auto;
        right: 16px;
        bottom: 16px;
        width: 380px;
        max-width: calc(100vw - 32px);
    }
}

.amp-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.amp-verse-line {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amp-reciter-line {
    font-size: 11px;
    color: var(--text-primary);
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amp-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.amp-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 7px;
    width: auto;
    line-height: 1;
    transition: background 0.12s;
    font-family: var(--font-ui);
}
.amp-btn:hover { background: var(--accent-trace); }
.amp-btn:active { transform: scale(0.92); }

.amp-play {
    font-size: 20px;
    background: var(--accent-trace);
}

.amp-speed {
    font-size: 12px !important;
    font-weight: 700;
    padding: 5px 8px !important;
    min-width: 36px;
}

.amp-close {
    color: var(--text-primary) !important;
    opacity: 0.6;
    font-size: 14px !important;
    margin-left: 2px;
}
.amp-close:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════
   v10.2 — TAFSIR MODAL
   ════════════════════════════════════════════════════════════════════ */
.tafsir-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 850;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.tafsir-modal-overlay.show { opacity: 1; }

.tafsir-modal-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    width: 600px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}
.tafsir-modal-overlay.show .tafsir-modal-box {
    transform: scale(1);
}

.tafsir-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 10px;
}

.tafsir-modal-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.tafsir-modal-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1.1;
}

.tafsir-modal-title-text {
    flex: 1;
    min-width: 0;
}

.tafsir-modal-verse {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-heading);
    font-style: italic;
    line-height: 1.3;
}

.tafsir-modal-source {
    font-size: 12px;
    color: var(--text-primary);
    opacity: 0.7;
    margin-top: 2px;
    font-family: var(--font-ui);
}

.tafsir-modal-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 14px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
    font-family: var(--font-ui);
}
.tafsir-modal-close:hover { background: var(--accent-faint); }

.tafsir-modal-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--accent-trace);
    flex-shrink: 0;
}

.tafsir-modal-picker label {
    font-size: 12px;
    color: var(--text-primary);
    opacity: 0.78;
    font-family: var(--font-ui);
    flex-shrink: 0;
}

.tafsir-modal-picker select {
    flex: 1;
    background: var(--bg-input, var(--bg-sidebar));
    border: 1px solid var(--accent-faint);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    cursor: pointer;
}

.tafsir-modal-verse-preview {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-arabic);
    font-size: 1.4rem;
    line-height: 2;
    color: var(--text-verse, var(--text-primary));
    background: var(--bg-content);
    flex-shrink: 0;
    max-height: 30vh;
    overflow-y: auto;
}
.tafsir-modal-verse-preview[dir="rtl"] {
    text-align: right;
}

.tafsir-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 20px;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}
.tafsir-modal-body[dir="rtl"] {
    font-family: var(--font-arabic);
    font-size: 16px;
    line-height: 2;
    text-align: right;
}

/* Tafsir content styling (HTML returned from API may contain various tags) */
.tafsir-modal-body p { margin: 0 0 12px; }
.tafsir-modal-body h1, .tafsir-modal-body h2, .tafsir-modal-body h3, .tafsir-modal-body h4 {
    margin: 16px 0 8px;
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 600;
}
.tafsir-modal-body em, .tafsir-modal-body i { font-style: italic; opacity: 0.92; }
.tafsir-modal-body strong, .tafsir-modal-body b { font-weight: 700; color: var(--accent); }
.tafsir-modal-body sup { font-size: 0.8em; opacity: 0.7; }
.tafsir-modal-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
}
.tafsir-modal-body blockquote {
    margin: 12px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--accent);
    background: var(--accent-trace);
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

/* Loading & error states inside tafsir modal */
.tafsir-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-primary);
    opacity: 0.7;
}

.tafsir-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 14px;
    border: 3px solid var(--accent-faint);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tafsir-spin 0.9s linear infinite;
}
@keyframes tafsir-spin {
    to { transform: rotate(360deg); }
}

.tafsir-error {
    text-align: center;
    padding: 40px 20px;
}
.tafsir-error-icon {
    font-size: 36px;
    opacity: 0.6;
    margin-bottom: 12px;
}
.tafsir-error-msg {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 600;
}
.tafsir-error-detail {
    font-size: 12px;
    color: var(--text-primary);
    opacity: 0.65;
    margin-bottom: 16px;
}
.tafsir-retry-btn {
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
}

/* Mobile tweaks */
@media (max-width: 600px) {
    .tafsir-modal-overlay { padding: 8px; }
    .tafsir-modal-box { max-height: 94vh; }
    .tafsir-modal-header { padding: 12px 14px; }
    .tafsir-modal-picker { padding: 9px 14px; }
    .tafsir-modal-verse-preview { padding: 12px 14px; font-size: 1.25rem; max-height: 25vh; }
    .tafsir-modal-body { padding: 14px 16px; font-size: 13px; }
}

/* ════════════════════════════════════════════════════════════════════
   v10.3 — MODERN REVERENT REDESIGN
   Muted scholarly gold · on-tap actions · refined editorial feel
   ════════════════════════════════════════════════════════════════════ */

/* Color refinement: muted gold replaces the bright gold app-wide */
:root {
    --accent-warm: #c89a4a; /* warm streak amber */
}
[data-theme="manuscript"] {
    --accent:       #b8985a;
    --accent-dim:   #98794a;
    --accent-faint: #b8985a40;
    --accent-trace: #b8985a18;
}
[data-theme="scholar"] {
    --accent:       #d0b070;
    --accent-dim:   #b09060;
    --accent-faint: #d0b07040;
    --accent-trace: #d0b07018;
}
[data-theme="minimal"] {
    --accent:       #8b6e3a;
    --accent-dim:   #6e5630;
    --accent-faint: #8b6e3a30;
    --accent-trace: #8b6e3a12;
}

/* Refined header — Bismillah/intro moved away, just theme switcher + spacing */
header {
    min-height: 60px;
    padding: 8px 16px !important;
}
#header-center {
    flex: 1;
    min-height: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Bismillah panel (top of each surah, except 1 and 9) ── */
.bismillah-panel {
    margin: 18px auto 26px;
    max-width: 560px;
    padding: 0 20px;
    text-align: center;
    position: relative;
}
.bismillah-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-faint) 20%, var(--accent) 50%, var(--accent-faint) 80%, transparent 100%);
    opacity: 0.7;
}
.bismillah-text {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--accent);
    padding: 18px 12px;
    letter-spacing: 0.5px;
    font-weight: 400;
    line-height: 1.6;
}
@media (max-width: 600px) {
    .bismillah-panel { margin: 14px 0 22px; padding: 0 12px; }
    .bismillah-text { font-size: 1.25rem; padding: 14px 6px; }
}

/* ── Streak pill: warm amber tint ── */
.sura-streak-pill {
    background: rgba(200, 154, 74, 0.12) !important;
    border-color: rgba(200, 154, 74, 0.42) !important;
    color: var(--accent-warm) !important;
}
.sura-streak-pill:hover {
    background: rgba(200, 154, 74, 0.22) !important;
}

/* ── Install pill in sticky title ── */
.sura-install-pill {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s, transform 0.1s;
    width: auto;
    height: auto;
    font-family: inherit;
    margin-right: 4px;
}
.sura-install-pill:hover {
    background: var(--accent-faint);
    transform: scale(1.05);
}
.sura-install-pill:active { transform: scale(0.92); }

/* ── Verse actions: hidden by default, appear on verse tap/focus ── */
.verse-actions {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.18s ease, max-height 0.22s ease, margin-top 0.18s ease;
    margin-top: 0;
    pointer-events: none;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.verse.verse-actions-open .verse-actions,
.verse:hover .verse-actions {
    opacity: 1;
    max-height: 80px;
    margin-top: 10px;
    pointer-events: auto;
}
/* Always show on mobile when verse is tapped; hover won't work on touch */
@media (hover: none) {
    .verse:hover .verse-actions {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
        pointer-events: none;
    }
    .verse.verse-actions-open .verse-actions {
        opacity: 1;
        max-height: 80px;
        margin-top: 10px;
        pointer-events: auto;
    }
}

/* Verse number circle: filled when saved */
.verse-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0.5px solid var(--accent-faint);
    background: transparent;
    color: var(--accent-dim) !important;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 11px !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.verse-has-saved .verse-icon {
    background: var(--accent);
    color: var(--bg-content) !important;
    border-color: var(--accent);
}
.verse-icon .icon-number {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

/* Refined verse action pill — Tafsir uses same style as Save/Share */
.verse-action-btn.verse-action-tafsir {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 99px;
    color: var(--accent);
    font-size: 13px;
    font-family: var(--font-ui);
    cursor: pointer;
    width: auto;
    transition: background 0.15s, border-color 0.15s;
}
.verse-action-btn.verse-action-tafsir:hover {
    background: var(--accent-faint);
    border-color: var(--accent-dim);
}

/* Refined translation: flush-left (no 30px indent), subtle prefix */
.secondary-verse {
    margin-top: 8px;
    padding-left: 0 !important;
    color: var(--text-secondary, var(--accent));
    font-style: italic;
    font-size: var(--trans-font-size, 0.95rem);
    line-height: 1.7;
    opacity: 0.95;
}
.secondary-verse::before {
    content: "· ";
    color: var(--accent-faint);
    font-style: normal;
    margin-right: 4px;
}

/* ── Settings meditation banner (Option B: spacious frontispiece) ── */
.settings-meditation {
    margin: 0 0 16px;
    padding: 22px 24px 18px;
    text-align: center;
    border-top: 1px solid var(--accent-faint);
    border-bottom: 1px solid var(--accent-faint);
    background: var(--accent-trace);
    position: relative;
}
.med-ornament {
    color: var(--accent);
    font-size: 13px;
    opacity: 0.65;
    margin-bottom: 12px;
    letter-spacing: 8px;
}
.med-arabic {
    font-family: var(--font-arabic);
    font-size: 1.45rem;
    color: var(--accent);
    line-height: 1.85;
    padding: 0 4px;
    font-weight: 400;
}
.med-translation {
    margin-top: 14px;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-primary);
    opacity: 0.88;
    line-height: 1.55;
    padding: 0 8px;
}
.med-citation {
    margin-top: 12px;
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.78;
}
@media (max-width: 600px) {
    .settings-meditation { padding: 18px 16px 14px; }
    .med-arabic { font-size: 1.25rem; }
    .med-translation { font-size: 0.95rem; }
}
/* In the desktop Features modal (which uses .features-modal-body), banner spans full width */
.features-modal-body .settings-meditation {
    margin: -4px 0 8px;
    border-top: none;
}

/* Active bottom nav indicator dot */
.bottom-nav .bnav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}
.bottom-nav .bnav-btn { position: relative; }

/* ════════════════════════════════════════════════════════════════════
   v10.4 — Bug fixes + Frame A (hairline cards) + calendar
   ════════════════════════════════════════════════════════════════════ */

/* ── Verse number circle: stays neutral always (no gold fill) ── */
.verse-has-saved .verse-icon {
    background: transparent !important;
    color: var(--accent-dim) !important;
    border-color: var(--accent-faint) !important;
}

/* ── Save button stays visible when verse has any save action ── */
.verse-has-saved .verse-action-save {
    opacity: 1 !important;
    pointer-events: auto !important;
}
.verse-has-saved .verse-actions {
    opacity: 1;
    max-height: 80px;
    margin-top: 10px;
    pointer-events: auto;
}
.verse-has-saved .verse-action-share,
.verse-has-saved .verse-action-tafsir,
.verse-has-saved .verse-audio-btn {
    opacity: 0.55;
    transition: opacity 0.2s;
}
.verse-has-saved:hover .verse-action-share,
.verse-has-saved:hover .verse-action-tafsir,
.verse-has-saved:hover .verse-audio-btn,
.verse-has-saved.verse-actions-open .verse-action-share,
.verse-has-saved.verse-actions-open .verse-action-tafsir,
.verse-has-saved.verse-actions-open .verse-audio-btn {
    opacity: 1;
}

/* ── Frame A: Hairline card around each verse ── */
.verse {
    background: rgba(184, 152, 90, 0.025);
    border: 0.5px solid rgba(184, 152, 90, 0.18);
    border-radius: 10px;
    padding: 14px 16px 12px !important;
    margin-bottom: 10px;
    transition: background 0.2s, border-color 0.2s;
}
.verse:hover {
    background: rgba(184, 152, 90, 0.045);
    border-color: rgba(184, 152, 90, 0.28);
}
.verse.verse-has-saved {
    background: rgba(184, 152, 90, 0.07);
    border-color: rgba(184, 152, 90, 0.35);
}
.verse.verse-highlighted {
    background: rgba(184, 152, 90, 0.10) !important;
    border-color: rgba(184, 152, 90, 0.45) !important;
}
.verse:last-of-type::after { display: none; }
.verse:last-of-type { border-bottom: 0.5px solid rgba(184, 152, 90, 0.18); }
.verse.verse-has-saved:last-of-type { border-bottom-color: rgba(184, 152, 90, 0.35); }

/* Scholar theme — slightly more visible cards on dark navy */
[data-theme="scholar"] .verse {
    background: rgba(208, 176, 112, 0.03);
    border-color: rgba(208, 176, 112, 0.2);
}
[data-theme="scholar"] .verse:hover {
    background: rgba(208, 176, 112, 0.05);
    border-color: rgba(208, 176, 112, 0.3);
}
[data-theme="scholar"] .verse.verse-has-saved {
    background: rgba(208, 176, 112, 0.08);
    border-color: rgba(208, 176, 112, 0.4);
}

/* Minimal theme — softer cards on white */
[data-theme="minimal"] .verse {
    background: rgba(139, 110, 58, 0.02);
    border-color: rgba(139, 110, 58, 0.15);
}
[data-theme="minimal"] .verse:hover {
    background: rgba(139, 110, 58, 0.04);
    border-color: rgba(139, 110, 58, 0.22);
}
[data-theme="minimal"] .verse.verse-has-saved {
    background: rgba(139, 110, 58, 0.05);
    border-color: rgba(139, 110, 58, 0.3);
}

/* ── Header install banner (v10.6: download icon, single label) ── */
.header-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 14px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 99px;
    color: var(--accent);
    font-family: var(--font-ui);
    cursor: pointer;
    width: auto;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
}
.header-install-btn:hover {
    background: var(--accent-faint);
    border-color: var(--accent-dim);
}
.header-install-btn:active { transform: scale(0.98); }

.hib-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--accent);
}
.hib-icon svg { display: block; }

.hib-text {
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.hib-close {
    margin-left: 4px;
    padding: 2px 8px;
    color: var(--text-primary);
    opacity: 0.5;
    font-size: 13px;
    border-radius: 99px;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
    font-weight: 400;
}
.hib-close:hover {
    opacity: 1;
    background: rgba(0,0,0,0.08);
}

@media (max-width: 600px) {
    .header-install-btn {
        padding: 7px 14px 7px 12px;
        gap: 8px;
        font-size: 14px;
    }
    .hib-icon svg { width: 20px; height: 20px; }
}

/* ── Khatm calendar (replaces flat grid) ── */
.khatm-calendar { padding: 4px 0 10px; }

.khatm-months {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 10px 0;
}

.khatm-month {
    padding: 8px 0 4px;
}

.khatm-month-label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font-ui);
    margin-bottom: 6px;
}

.khatm-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-align: center;
    font-family: var(--font-ui);
    opacity: 0.7;
    font-weight: 600;
}

.khatm-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0;
}

.khatm-cell {
    aspect-ratio: 1;
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
    min-height: 24px;
}

.khatm-cell.khatm-pad {
    background: transparent;
    border: none;
    cursor: default;
}

.khatm-cell.khatm-future {
    opacity: 0.4;
    cursor: default;
}

.khatm-cell[data-level="0"] {
    background: var(--accent-trace);
    color: var(--text-secondary);
}
.khatm-cell[data-level="1"] {
    background: var(--accent-faint);
    color: var(--accent-dim);
    font-weight: 600;
}
.khatm-cell[data-level="2"] {
    background: var(--accent-dim);
    color: var(--bg-content);
    font-weight: 600;
    border-color: var(--accent-dim);
}
.khatm-cell[data-level="3"] {
    background: var(--accent);
    opacity: 0.82;
    color: var(--bg-content);
    font-weight: 600;
    border-color: var(--accent);
}
.khatm-cell[data-level="4"] {
    background: var(--accent);
    color: var(--bg-content);
    font-weight: 700;
    border-color: var(--accent);
}

.khatm-cell.khatm-today {
    box-shadow: 0 0 0 1.5px var(--accent);
    z-index: 1;
}
.khatm-cell.khatm-selected {
    box-shadow: 0 0 0 2px var(--text-primary);
    z-index: 2;
    transform: scale(1.05);
}
.khatm-cell:not(.khatm-pad):not(.khatm-future):active {
    transform: scale(0.94);
}

/* Detail banner (shows date + count on tap) */
.khatm-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    border-radius: 7px;
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-primary);
    min-height: 32px;
}
.khatm-detail-icon { font-size: 13px; flex-shrink: 0; }
.khatm-detail-text { line-height: 1.4; flex: 1; }

/* Legend with contrasting boxes that are visible in all themes */
.khatm-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    font-size: 10px;
    color: var(--text-primary);
    opacity: 0.85;
    margin-top: 10px;
    font-family: var(--font-ui);
}
.khatm-legend-label { font-size: 10px; }
.khatm-legend .kl {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    display: inline-block;
    border: 0.5px solid var(--accent-faint);
}
.khatm-legend .kl[data-level="0"] { background: var(--accent-trace); }
.khatm-legend .kl[data-level="1"] { background: var(--accent-faint); }
.khatm-legend .kl[data-level="2"] { background: var(--accent-dim); border-color: var(--accent-dim); }
.khatm-legend .kl[data-level="3"] { background: var(--accent); opacity: 0.82; border-color: var(--accent); }
.khatm-legend .kl[data-level="4"] { background: var(--accent); border-color: var(--accent); }

/* ── Tafsir error alternatives (quick-pick) ── */
.tafsir-error-alts {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 0.5px solid var(--border);
}
.tafsir-error-alts-label {
    font-size: 12px;
    color: var(--text-primary);
    opacity: 0.75;
    margin-bottom: 8px;
    font-family: var(--font-ui);
}
.tafsir-alt-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    color: var(--text-primary);
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: background 0.15s, border-color 0.15s;
}
.tafsir-alt-btn:hover {
    background: var(--accent-faint);
    border-color: var(--accent-dim);
}
.tafsir-alt-lang {
    font-size: 11px;
    color: var(--accent);
    opacity: 0.75;
    margin-left: 6px;
}

/* ════════════════════════════════════════════════════════════════════
   v10.5 — Readability fixes (feature hints, translation in light mode)
   ════════════════════════════════════════════════════════════════════ */

/* Feature toggle subtitle — readable in all themes */
.feature-toggle-sub {
    font-size: 15px !important;
    color: var(--text-secondary) !important;
    opacity: 1 !important;
    font-weight: 400;
    line-height: 1.55;
}
/* Per-theme contrast boost for feature descriptions */
[data-theme="manuscript"] .feature-toggle-sub { color: #c9b88a !important; }
[data-theme="minimal"] .feature-toggle-sub { color: #5c4d32 !important; }
[data-theme="scholar"] .feature-toggle-sub { color: #9eafc5 !important; }

/* Translation color in Minimal — muted warm brown, distinct from black Arabic */
[data-theme="minimal"] .secondary-verse {
    color: #6e5b3e !important;
}
[data-theme="minimal"] .secondary-verse::before {
    color: #b8a37a !important;
}

/* Minimal install banner — accessible contrast */
[data-theme="minimal"] .header-install-btn {
    background: #f5f1e7;
    border-color: #d0c4a8;
    color: #5a4525;
}
[data-theme="minimal"] .header-install-btn:hover {
    background: #ebe3d0;
}
[data-theme="minimal"] .hib-icon { color: #8b6e3a; }

/* Settings hints — readable size in all themes */
.mob-settings-section div[style*="opacity:0.78"],
.mob-settings-section div[style*="opacity:0.85"],
.mob-settings-section div[style*="opacity:0.7"] {
    opacity: 1 !important;
    font-size: 14px !important;
    color: var(--text-secondary) !important;
    line-height: 1.5 !important;
}

/* Mobile sheet: visible divider between settings sections */
.mob-sheet-body .mob-settings-section {
    border-top: 2px solid var(--border-mid);
    padding-top: 14px;
    margin-top: 4px;
}
.mob-sheet-body .mob-settings-section:first-child {
    border-top: none;
    margin-top: 0;
}

/* ── Install instructions modal (v10.5) ── */
.install-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.install-modal-overlay.show { opacity: 1; }

.install-modal-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.install-modal-overlay.show .install-modal-box { transform: scale(1); }

.install-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.install-modal-icon {
    font-size: 22px;
    line-height: 1;
}
.install-modal-title {
    flex: 1;
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    font-size: 17px;
}
.install-modal-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 14px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
}
.install-modal-close:hover { background: var(--accent-faint); }

.install-modal-body {
    padding: 16px 22px 18px;
    overflow-y: auto;
    max-height: 70vh;
}

.install-steps {
    margin: 0 0 16px;
    padding-left: 22px;
    list-style: decimal;
}
.install-steps li {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: var(--font-ui);
}
.install-steps li strong {
    color: var(--accent);
    font-weight: 600;
}

.install-benefits {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.install-benefit {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 3px 0;
    font-family: var(--font-ui);
}

/* ════════════════════════════════════════════════════════════════════
   v10.7 — Eight new features
   ════════════════════════════════════════════════════════════════════ */

/* Verse flash animation (used by topics + daily verse) */
@keyframes verse-flash {
    0%, 100% { background: transparent; }
    50% { background: var(--accent-faint); box-shadow: 0 0 0 2px var(--accent); }
}
.verse-flash {
    animation: verse-flash 1.5s ease-in-out;
}

/* ── Generic modal overlay base (shared by Topics, Daily Verse, Reflection, Compare) ── */
.topics-modal-overlay, .daily-verse-overlay, .reflection-overlay, .tafsir-compare-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.topics-modal-overlay.show,
.daily-verse-overlay.show,
.reflection-overlay.show,
.tafsir-compare-overlay.show { opacity: 1; }

/* ── Topics modal ── */
.topics-modal-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    max-width: 500px;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.topics-modal-overlay.show .topics-modal-box { transform: scale(1); }

.topics-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.topics-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    font-size: 17px;
}
.topics-modal-icon { font-size: 20px; }
.topics-modal-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 13px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
}
.topics-modal-close:hover { background: var(--accent-faint); }
.topics-modal-subtitle {
    padding: 10px 18px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-ui);
}
.topics-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.topic-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--font-ui);
    text-align: left;
    font-size: 14px;
    transition: background 0.15s;
}
.topic-item:hover { background: var(--accent-trace); }
.topic-icon { font-size: 20px; flex-shrink: 0; }
.topic-name { flex: 1; font-weight: 500; }
.topic-count {
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-trace);
    padding: 2px 9px;
    border-radius: 99px;
    border: 0.5px solid var(--accent-faint);
}
.topic-back {
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: var(--font-ui);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    margin-bottom: 6px;
    text-align: left;
    width: auto;
}
.topic-back:hover { text-decoration: underline; }
.topic-detail-title {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 18px;
    color: var(--accent);
    padding: 6px 14px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.topic-verse-card {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: background 0.15s, border-color 0.15s;
}
.topic-verse-card:hover {
    background: var(--accent-faint);
    border-color: var(--accent-dim);
}
.tvc-ref {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}
.tvc-text {
    font-family: var(--font-arabic);
    font-size: 1rem;
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.7;
}

/* ── Daily verse modal ── */
.daily-verse-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--accent-faint);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.daily-verse-overlay.show .daily-verse-box { transform: scale(1); }

.daily-verse-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
}
.dv-ornament {
    color: var(--accent);
    opacity: 0.6;
    font-size: 12px;
    letter-spacing: 4px;
}
.dv-label {
    font-family: var(--font-ui);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    font-weight: 600;
}
.daily-verse-text {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--accent);
    line-height: 2;
    padding: 0 8px;
    margin-bottom: 16px;
}
.daily-verse-ref {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 14px;
    color: var(--accent);
    opacity: 0.85;
    margin-bottom: 20px;
}
.daily-verse-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.dv-btn-secondary, .dv-btn-primary {
    padding: 9px 18px;
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    width: auto;
}
.dv-btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-faint);
    color: var(--accent);
}
.dv-btn-secondary:hover { background: var(--accent-trace); }
.dv-btn-primary {
    background: var(--accent);
    color: var(--bg-content);
    border: 1px solid var(--accent);
}
.dv-btn-primary:hover { background: var(--accent-dim); }
@media (max-width: 600px) {
    .daily-verse-box { padding: 22px 18px 16px; }
    .daily-verse-text { font-size: 1.25rem; line-height: 1.85; }
}

/* ── Reflection modal ── */
.reflection-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.reflection-overlay.show .reflection-box { transform: scale(1); }

.reflection-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.reflection-icon { font-size: 18px; }
.reflection-label {
    flex: 1;
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    font-size: 15px;
}
.reflection-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 13px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
}
.reflection-question {
    padding: 16px 18px 12px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-style: italic;
    line-height: 1.5;
}
.reflection-textarea {
    width: calc(100% - 32px);
    margin: 0 16px;
    min-height: 100px;
    padding: 12px;
    background: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}
.reflection-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px 16px;
}
.reflection-skip, .reflection-save {
    padding: 8px 16px;
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    width: auto;
}
.reflection-skip {
    background: transparent;
    border: 1px solid var(--accent-faint);
    color: var(--text-primary);
}
.reflection-save {
    background: var(--accent);
    color: var(--bg-content);
    border: 1px solid var(--accent);
}
.reflection-save:hover { background: var(--accent-dim); }

/* ── Hijri badge in meditation banner ── */
.hijri-badge {
    margin-top: 14px;
    padding: 8px 14px;
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
}
.hijri-badge-special {
    background: var(--accent-faint);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.hijri-icon { font-size: 14px; }

/* ── Tafsir comparison modal ── */
.tafsir-compare-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    width: 100%;
    max-width: 900px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
}
.tafsir-compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.tafsir-compare-title {
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    font-size: 15px;
}
.tafsir-compare-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 13px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
}
.tafsir-compare-verse {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    color: var(--accent);
    line-height: 1.9;
    background: var(--accent-trace);
}
.tafsir-compare-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 901px) {
    .tafsir-compare-body { grid-template-columns: 1fr 1fr; }
}
.tafsir-compare-card {
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    border-radius: 10px;
    padding: 12px 14px;
}
.tcc-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 0.5px solid var(--accent-faint);
}
.tcc-name {
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    font-size: 13px;
}
.tcc-lang {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.tcc-content {
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-primary);
    min-height: 60px;
}
.tcc-content[dir="rtl"] {
    font-family: var(--font-arabic);
    font-size: 15px;
    line-height: 1.9;
}
.tcc-error {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 12px;
}
.tafsir-spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent-faint);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tafsir-spin 0.9s linear infinite;
}
.tafsir-compare-btn {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 12px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
    margin-right: 6px;
    font-weight: 600;
}
.tafsir-compare-btn:hover { background: var(--accent-faint); }

/* ── Reading time sidebar widget (laptop) ── */
.trt-widget {
    margin: 0 14px 14px;
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    border-radius: 8px;
    padding: 10px 14px 8px;
}
.trt-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.trt-widget-title {
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--accent);
    font-family: var(--font-heading);
}
.trt-widget-x {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    line-height: 1;
}
.trt-widget-x:hover { color: var(--accent); }
/* Two-column stat layout — physically cannot overlap */
.trt-stats {
    display: flex;
    align-items: center;
    margin: 6px 0 4px;
    gap: 0;
}
.trt-stat {
    flex: 1;
    text-align: center;
    padding: 4px 0;
}
.trt-stat-lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    margin-bottom: 4px;
    white-space: nowrap;
}
.trt-stat-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-ui);
    white-space: nowrap;
    line-height: 1.1;
}
.trt-stat-sep {
    width: 1px;
    height: 40px;
    background: var(--accent-faint);
    flex-shrink: 0;
    margin: 0 4px;
}
.trt-widget-foot {
    margin-top: 8px;
    text-align: right;
}
.trt-widget-reset {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-family: var(--font-ui);
}
.trt-widget-reset:hover { color: #e08585; }

/* ── Reading time summary (settings box) ── */
.reading-time-box {
    background: var(--accent-trace);
    border: 0.5px solid var(--accent-faint);
    border-radius: 8px;
    padding: 12px 14px;
}
.rt-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-family: var(--font-ui);
    font-size: 13px;
}
.rt-key { color: var(--text-secondary); }
.rt-val { color: var(--accent); font-weight: 600; }

/* ── Voice search button ── */
.voice-search-btn {
    margin-left: 6px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}
.voice-search-btn:hover { background: var(--accent-faint); }
.voice-search-btn.voice-listening {
    background: var(--accent);
    color: var(--bg-content);
    animation: voice-pulse 1s ease-in-out infinite;
}
@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-faint); }
    50%      { box-shadow: 0 0 0 6px transparent; }
}

/* ── Print / PDF export ── */
@media print {
    /* Hide everything except the surah by default */
    header, footer, aside, nav, .bottom-nav, .mob-sheet, .mob-sheet-overlay,
    #sidebar, #sidebarOverlay, .sura-sticky-title, .verse-actions,
    .verse-audio-btn, .audio-mini-player, #verseNavFab, .install-modal-overlay,
    .topics-modal-overlay, .daily-verse-overlay, .reflection-overlay,
    .tafsir-modal-overlay, .tafsir-compare-overlay, .features-modal-overlay,
    .header-install-btn, #burgerMenu, .lastread-banner, .update-banner,
    .toast-host, .surah-progress-bar, .mob-drawer, .mob-drawer-overlay,
    .phone-settings-btn {
        display: none !important;
    }
    body { background: white !important; color: black !important; }
    .verse {
        background: white !important;
        border: 0.5px solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 8px !important;
    }
    .verse, .secondary-verse, #suraTitle {
        color: black !important;
    }
    .bismillah-panel, .bismillah-text {
        color: #555 !important;
    }
    main, #quranContainer, .textContainer {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
        height: auto !important;
    }
    /* Print-only notes panel */
    .print-only-block {
        display: block !important;
        margin-top: 24px;
        padding: 14px;
        border-top: 1px solid #999;
        font-family: serif;
    }
    .print-only-block h3 { font-size: 14px; margin-bottom: 8px; }
    .print-reflection, .print-note {
        padding: 6px 0;
        font-size: 12px;
        page-break-inside: avoid;
    }
}
.print-only-block { display: none; }

/* ════════════════════════════════════════════════════════════════════
   v10.8 — Bug fixes + reactive feature gating + new top access bar
   ════════════════════════════════════════════════════════════════════ */

/* ── Reactive feature gating via body classes ── */
body.feature-off-savetools .verse-action-save { display: none !important; }
body.feature-off-share .verse-action-share { display: none !important; }
body.feature-off-tafsir .verse-action-tafsir { display: none !important; }
body.feature-off-audio .verse-audio-btn { display: none !important; }
body.feature-off-audio .audio-mini-player { display: none !important; }
body.feature-off-focusmode .sura-focus-pill { display: none !important; }
body.feature-off-voice .voice-search-btn { display: none !important; }
body.feature-off-topics .top-access-btn,
body.feature-off-topics #topTopicsBtn { display: none !important; }
body.feature-off-print .sura-print-pill { display: none !important; }
body.feature-off-readingtime #topReadingTime { display: none !important; }
body.feature-off-hijri .hijri-badge { display: none !important; }

/* When savetools is off but other actions remain, the verse-actions strip can become empty */
body.feature-off-savetools.feature-off-share.feature-off-tafsir .verse-actions {
    display: none !important;
}

/* ── Search button active state (bug 5 UI) ── */
#searchbutton.search-active,
#searchButtonSourats.search-active {
    background: var(--accent) !important;
    color: var(--bg-content) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent) inset;
}

/* ── Top access bar (Topics + reading-time, above search) ── */
#topAccessBar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0;
}

.top-access-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 99px;
    color: var(--accent);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.top-access-btn:hover {
    background: var(--accent-faint);
    border-color: var(--accent-dim);
}
.top-access-btn:active { transform: scale(0.97); }
.top-access-btn .tab-icon { font-size: 16px; line-height: 1; }


/* ── Print pill in sticky title ── v10.11: bigger + visible PDF label ── */
.sura-print-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    padding: 6px 13px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.15s, transform 0.1s, border-color 0.15s;
    width: auto;
    height: auto;
    margin-right: 6px;
}
.sura-print-pill .spp-svg { display: block; }
.sura-print-pill .spp-lbl { letter-spacing: 0.04em; }
.sura-print-pill:hover {
    background: var(--accent-faint);
    border-color: var(--accent-dim);
    transform: scale(1.04);
}
.sura-print-pill:active { transform: scale(0.94); }

/* Mobile: keep it comfortable to tap */
@media (max-width: 900px) {
    .sura-print-pill { padding: 7px 14px; font-size: 14px; gap: 6px; }
}
@media (max-width: 600px) {
    .sura-print-pill { padding: 7px 12px; font-size: 14px; gap: 5px; }
    .sura-print-pill .spp-svg { width: 14px; height: 14px; }
}

/* ════════════════════════════════════════════════════════════════════
   v10.10 — Reading plan pill + modal, 4-tab saved hub, reading-time reset link
   ════════════════════════════════════════════════════════════════════ */

/* ── Reading plan floating pill ── */
.reading-plan-pill {
    position: fixed;
    top: 70px;
    right: 18px;
    z-index: 800;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px 8px 14px;
    background: var(--accent);
    color: var(--bg-content);
    border: none;
    border-radius: 99px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    width: auto;
    height: auto;
}
.reading-plan-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.reading-plan-pill:active { transform: scale(0.97); }
.rpp-ico { font-size: 14px; line-height: 1; }
.rpp-lbl { letter-spacing: 0.02em; }
.rpp-x {
    margin-left: 2px;
    padding: 1px 7px;
    border-radius: 99px;
    background: rgba(0,0,0,0.15);
    font-size: 11px;
    opacity: 0.85;
    transition: opacity 0.15s, background 0.15s;
}
.rpp-x:hover { background: rgba(0,0,0,0.3); opacity: 1; }

@media (max-width: 900px) {
    /* Mobile: place pill above the bottom nav, near right edge but not in the corner */
    .reading-plan-pill {
        top: auto;
        bottom: 70px;
        right: 12px;
        padding: 9px 13px 9px 15px;
        font-size: 13px;
    }
}

/* ── Reading plan modal ── */
.reading-plan-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.reading-plan-modal-overlay.show { opacity: 1; }

.reading-plan-modal-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--accent-faint);
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.reading-plan-modal-overlay.show .reading-plan-modal-box { transform: scale(1); }

.rpm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.rpm-title {
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    font-size: 17px;
}
.rpm-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 13px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
}
.rpm-close:hover { background: var(--accent-faint); }

.rpm-body {
    padding: 22px 20px 18px;
    text-align: center;
}
.rpm-icon-big {
    font-size: 38px;
    margin-bottom: 8px;
}
.rpm-status {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 16px;
    color: var(--accent);
    margin-bottom: 6px;
}
.rpm-day {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 19px;
    color: var(--accent);
    margin-bottom: 6px;
}
.rpm-today {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 18px;
    line-height: 1.5;
}
.rpm-progress {
    height: 8px;
    background: var(--accent-trace);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
.rpm-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 0.3s;
}
.rpm-progress-text {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.rpm-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.rpm-btn-primary {
    background: var(--accent);
    color: var(--bg-content);
    border: 1px solid var(--accent);
    padding: 10px 22px;
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    width: auto;
}
.rpm-btn-primary:hover { background: var(--accent-dim); }
.rpm-done-badge {
    display: inline-block;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 99px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
}
.rpm-footer {
    padding: 10px 18px 14px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    font-family: var(--font-ui);
    opacity: 0.85;
}

/* ── 4-tab saved hub (desktop) ── */
.saved-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--text-secondary);
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    width: auto;
}
.saved-tab:hover {
    background: var(--accent-faint);
    color: var(--accent);
}
.saved-tab.active {
    background: var(--accent);
    color: var(--bg-content);
    border-color: var(--accent);
    font-weight: 600;
}
.saved-tab .st-ico { font-size: 13px; line-height: 1; }
.saved-tab .st-lbl { letter-spacing: 0.02em; }
#saved-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

/* ── 4-tab saved hub (mobile) ── */
.mob-saved-tabs {
    display: flex;
    gap: 5px;
    padding: 8px 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-sidebar);
    flex-shrink: 0;
}
.mob-saved-tabs::-webkit-scrollbar { display: none; }
.mob-saved-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--text-secondary);
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    width: auto;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mob-saved-tab.active {
    background: var(--accent);
    color: var(--bg-content);
    border-color: var(--accent);
    font-weight: 600;
}
.mob-saved-tab .mst-ico { font-size: 13px; line-height: 1; }
.mob-saved-tab .mst-lbl { letter-spacing: 0.02em; }
.mob-saved-tab .mst-count {
    margin-left: 5px;
    font-size: 11px;
    background: var(--accent);
    color: var(--bg-content);
    padding: 1px 7px;
    border-radius: 99px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}
.mob-saved-tab.active .mst-count {
    background: var(--bg-content);
    color: var(--accent);
}

/* On very narrow screens, hide tab labels — icons + count stay */
@media (max-width: 400px) {
    .mob-saved-tab .mst-lbl { display: none; }
    .mob-saved-tab { padding: 9px 12px; }
    .mob-saved-tab .mst-ico { font-size: 16px; }
}

/* Mobile reflection items use the same .mob-bm-note-text styling as notes */
.mob-bm-note-text {
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    font-family: var(--font-ui);
}

/* ── Reading-time reset link (inside the box, subtle) ── */
.rt-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 0.5px solid var(--accent-faint);
    text-align: right;
}
.rt-reset-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 99px;
    width: auto;
    transition: color 0.15s, background 0.15s;
}
.rt-reset-link:hover {
    color: #e08585;
    background: rgba(217, 112, 112, 0.08);
}

/* Hide the legacy inline reading-plan-card if any old code references it */
.reading-plan-card { display: none !important; }

/* ════════════════════════════════════════════════════════════════════
   v10.11 — Khatm sidebar button + modal, polish remaining items
   ════════════════════════════════════════════════════════════════════ */

/* Hide the Khatm sidebar button when feature is off */
body.feature-off-khatm .khatm-sidebar-btn {
    display: none !important;
}

/* Hide the Khatm Settings section when feature is off (cleaner reactive UI) */
body.feature-off-khatm .khatm-heatmap,
body.feature-off-khatm .khatm-calendar { display: none; }

/* Khatm sidebar button styling (matches other side tools) */
.khatm-sidebar-btn {
    /* inherits #toggleButtons button styles */
}

/* Khatm modal */
.khatm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.khatm-modal-overlay.show { opacity: 1; }

.khatm-modal-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.khatm-modal-overlay.show .khatm-modal-box { transform: scale(1); }

.khatm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.khatm-modal-title {
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 600;
    color: var(--accent);
    font-size: 18px;
}
.khatm-modal-close {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--accent);
    font-size: 13px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
}
.khatm-modal-close:hover { background: var(--accent-faint); }

.khatm-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

/* Inside the modal, the Khatm section label is redundant — hide */
.khatm-modal-body .mob-settings-section > .mob-settings-lbl:first-child {
    display: none;
}

/* ════════════════════════════════════════════════════════════════════
   v10.12 — Khatm Settings section hidden on desktop (use sidebar button)
   ════════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {
    /* Desktop only: the Features modal's Khatm section is redundant
       since the sidebar button opens a dedicated modal */
    .features-modal-body .khatm-calendar,
    .features-modal-body .khatm-heatmap {
        display: none;
    }
}

/* Khatm modal header actions container */
.khatm-modal-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.khatm-modal-reset {
    background: transparent;
    border: 1px solid var(--accent-faint);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    width: auto;
    font-family: var(--font-ui);
}
.khatm-modal-reset:hover {
    color: #e08585;
    border-color: #d9707040;
    background: rgba(217, 112, 112, 0.08);
}

/* ════════════════════════════════════════════════════════════════════
   v10.12 — Mobile Surahs sheet TOC tabs (4-tab nav at top)
   ════════════════════════════════════════════════════════════════════ */
.mob-toc-tabs {
    display: flex;
    gap: 5px;
    padding: 8px 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg-sidebar);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}
.mob-toc-tabs::-webkit-scrollbar { display: none; }

.mob-toc-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 16px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--text-secondary);
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
    width: auto;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.mob-toc-tab:hover {
    background: var(--accent-faint);
    color: var(--accent);
}
.mob-toc-tab.active {
    background: var(--accent);
    color: var(--bg-content);
    border-color: var(--accent);
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════
   v10.13 — New version available notification banner
   ════════════════════════════════════════════════════════════════════ */
.update-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent);
    color: var(--bg-content);
    padding: 10px 16px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.update-banner.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.update-banner-btn {
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.4);
    color: inherit;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-ui);
    width: auto;
    white-space: nowrap;
}
.update-banner-btn:hover { background: rgba(255,255,255,0.38); }
.update-banner-close {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    width: auto;
    line-height: 1;
}
.update-banner-close:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════
   v10.13 — Theme tab cards in Read panel (Group B)
   ════════════════════════════════════════════════════════════════════ */
.mob-theme-cards {
    display: flex;
    gap: 10px;
    padding: 16px 14px 8px;
    flex-shrink: 0;
}

.mob-theme-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 8px 14px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    min-height: 100px;
    transition: border-color 0.2s, transform 0.15s;
    font-family: var(--font-ui);
    /* background and borderColor set inline via JS */
}

.mob-theme-card:active { transform: scale(0.97); }

.mob-tc-icon {
    font-size: 22px;
    line-height: 1;
}

.mob-tc-label {
    font-size: 15px;
    font-weight: 700;
    /* color set inline via JS */
}

.mob-tc-bar {
    width: 32px;
    height: 3px;
    border-radius: 99px;
    /* background set inline via JS */
}

.mob-tc-active {
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 7px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-ui);
    /* background and color set inline via JS */
}

/* ════════════════════════════════════════════════════════════════════
   Phone info overlay — Reading Time, Hijri Calendar, Help screens
   ════════════════════════════════════════════════════════════════════ */
.mob-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    padding-bottom: 0;
}
.mob-info-overlay.show { opacity: 1; }
.mob-info-overlay.show .mob-info-box { transform: translateY(0); }

.mob-info-box {
    background: var(--bg-sidebar);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(60px);
    transition: transform 0.28s ease;
    font-family: var(--font-ui);
}
.mob-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.mob-info-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}
.mob-info-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-trace);
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.mob-info-body {
    overflow-y: auto;
    padding: 20px;
    flex: 1;
}

/* Reading Time stats */
.mob-stat-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.mob-stat-row:last-child { border-bottom: none; }
.mob-stat-val {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    min-width: 90px;
}
.mob-stat-unit { font-size: 16px; font-weight: 400; color: var(--text-muted); }
.mob-stat-lbl { font-size: 14px; color: var(--text-secondary); }

/* Hijri Calendar — today card */
.mob-hijri-today-card {
    text-align: center;
    padding: 28px 20px 22px;
    background: var(--accent-trace);
    border-bottom: 1px solid var(--border);
}
/* Line 1 — Arabic-script Hijri date, large and elegant */
.mob-hijri-date-arabic {
    font-family: var(--font-arabic);
    font-size: 42px;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 10px;
    unicode-bidi: isolate;
}
/* Line 2 — Gregorian in second language */
.mob-hijri-date-second {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}
/* Legacy class kept */
.mob-hijri-today-hijri {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    font-family: var(--font-arabic, var(--font-ui));
}
.mob-hijri-today-greg {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.mob-hijri-today-special {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--accent-faint);
    border-radius: 8px;
    padding: 6px 12px;
    display: inline-block;
    margin-top: 4px;
}
/* Scrollable wrapper inside the box */
.mob-hijri-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
/* Events list */
.mob-hijri-events-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 16px 16px 8px;
}
.mob-hijri-events-list {
    padding: 0 0 16px;
    overflow-y: auto;
}
.mob-hijri-event {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-verse);
}
.mob-hijri-event-today {
    background: var(--accent-trace);
}
.mob-hijri-event-ico {
    font-size: 26px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}
.mob-hijri-event-info { flex: 1; }
.mob-hijri-event-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.mob-hijri-event-date-ar {
    font-family: var(--font-arabic);
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    unicode-bidi: isolate;
    margin-bottom: 2px;
}
.mob-hijri-event-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.mob-hijri-today-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--bg-page);
    background: var(--accent);
    border-radius: 99px;
    padding: 3px 9px;
    flex-shrink: 0;
}
/* Legacy classes kept for safety */
.mob-hijri-body { text-align: center; padding: 30px 20px; }
.mob-hijri-date { font-size: 26px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.mob-hijri-greg { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }
.mob-hijri-special { font-size: 15px; color: var(--text-secondary); background: var(--accent-trace); border: 1px solid var(--accent-faint); border-radius: 10px; padding: 12px 16px; margin-top: 8px; }

/* ════════════════════════════════════════════════════════════════════
   v10.15 — Audio Resume Banner
   ════════════════════════════════════════════════════════════════════ */
.audio-resume-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-sidebar);
    border: 1px solid var(--accent-faint);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    z-index: 750;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.audio-resume-banner.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.arb-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.arb-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.arb-btn {
    font-family: var(--font-ui);
    border: none;
    cursor: pointer;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    width: auto;
    line-height: 1.5;
    transition: opacity 0.12s;
}
.arb-play {
    background: var(--accent);
    color: var(--bg-content);
}
.arb-play:hover { opacity: 0.88; }
.arb-dismiss {
    background: transparent;
    color: var(--text-primary);
    opacity: 0.55;
    font-size: 15px;
    padding: 4px 6px;
}
.arb-dismiss:hover { opacity: 1; }
@media (max-width: 768px) {
    .audio-resume-banner { bottom: 140px; }
}

/* ════════════════════════════════════════════════════════════════════
   v10.15 — YouTube section (French per-surah link)
   ════════════════════════════════════════════════════════════════════ */
.yt-fr-section {
    margin: 0 0 14px 0;
}
.yt-fr-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--accent-faint);
    background: var(--bg-sidebar);
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.12s, border-color 0.12s;
}
.yt-fr-link:hover {
    background: var(--accent-trace);
    border-color: var(--accent);
}
.yt-fr-icon {
    width: 26px;
    height: 26px;
    background: #ff0000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}

/* Channel link in Settings */
.yt-channel-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--accent-faint);
    background: var(--bg-content);
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.12s;
}
.yt-channel-link:hover { background: var(--accent-trace); }
.yt-channel-logo {
    width: 28px;
    height: 28px;
    background: #ff0000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}
.yt-channel-text { flex: 1; }
.yt-channel-arr { opacity: 0.5; font-size: 14px; }

/* ════════════════════════════════════════════════════════════════════
   v10.15.8 — Surah completion confetti celebration
   Pieces fall from the top with rotation + horizontal drift.
   ════════════════════════════════════════════════════════════════════ */
@keyframes confetti-drop {
    0%   { transform: translateX(0)               translateY(-20px) rotate(0deg)            scaleX(1);   opacity: 1; }
    15%  { opacity: 1; }
    85%  { opacity: 0.9; }
    100% { transform: translateX(var(--cdrift,0)) translateY(110vh) rotate(var(--crot,360deg)) scaleX(var(--cflip,1)); opacity: 0; }
}
.confetti-piece {
    position: fixed;
    pointer-events: none;
    z-index: 8000;
    animation: confetti-drop var(--cdur, 2s) ease-in forwards;
}

/* ════════════════════════════════════════════════════════════════════
   v10.15.7 — Sidebar daily reading streak badge
   ════════════════════════════════════════════════════════════════════ */
.sidebar-streak-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 8px 0 0;
    padding: 4px 12px 4px 10px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 99px;
    font-family: var(--font-ui);
    width: fit-content;
    cursor: default;
    user-select: none;
}
.ssb-flame { font-size: 14px; line-height: 1; }
.ssb-num   { font-size: 15px; font-weight: 700; color: var(--accent); line-height: 1; }
.ssb-label { font-size: 11px; color: var(--text-muted); line-height: 1; }

/* ════════════════════════════════════════════════════════════════════
   v10.15.4 — Feature spotlight animation
   Lens: transparent window with huge box-shadow that dims the rest.
   Pulse: golden glow on the target, visible through the lens.
   ════════════════════════════════════════════════════════════════════ */
@keyframes feature-spotlight-pulse {
    0%   { outline: 0px solid var(--accent); outline-offset: 0px;  box-shadow: none; }
    15%  { outline: 3px solid var(--accent); outline-offset: 6px;  box-shadow: 0 0 0 10px var(--accent-trace); }
    50%  { outline: 3px solid var(--accent); outline-offset: 4px;  box-shadow: 0 0 0 6px var(--accent-trace); }
    85%  { outline: 3px solid var(--accent); outline-offset: 6px;  box-shadow: 0 0 0 10px var(--accent-trace); }
    100% { outline: 0px solid var(--accent); outline-offset: 0px;  box-shadow: none; }
}
.feature-highlighted {
    animation: feature-spotlight-pulse 0.9s ease-in-out 3;
    border-radius: 8px;
    position: relative;
    z-index: 5;
}
/* Spotlight lens: transparent rectangle, everything outside dimmed + blurred */
.feature-spotlight-lens {
    position: fixed;
    border-radius: 10px;
    pointer-events: none;
    z-index: 9001;
    background: transparent;
    /* huge shadow dims all outside the window; accent ring + glow frame the feature */
    box-shadow:
        0 0 0 9999px rgba(0,0,0,0.70),
        0 0 0 2px var(--accent),
        0 0 28px 10px var(--accent-dim);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.feature-spotlight-lens.show { opacity: 1; }
/* Keep old backdrop class intact in case any call still references it */
.feature-spotlight-backdrop { display: none; }

/* ════════════════════════════════════════════════════════════════════
   v10.15.2 — Desktop Support buttons
   ════════════════════════════════════════════════════════════════════ */
#desktopSupportBtns {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}
#desktopSupportBtns button {
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: 8px;
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
#desktopSupportBtns button:hover {
    background: var(--accent-faint);
    border-color: var(--accent);
    color: var(--accent);
}

/* ════════════════════════════════════════════════════════════════════
   v10.15.2 — Help & Tutorial modal
   ════════════════════════════════════════════════════════════════════ */
.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9800;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.help-overlay.show { opacity: 1; }
.help-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--accent-faint);
    border-radius: 16px;
    width: 92vw;
    max-width: 820px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: translateY(16px);
    transition: transform 0.25s;
}
.help-overlay.show .help-box { transform: translateY(0); }
.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--accent-faint);
    flex-shrink: 0;
}
.help-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.help-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    width: auto;
    line-height: 1;
    transition: color 0.12s, background 0.12s;
}
.help-close:hover { color: var(--accent); background: var(--accent-trace); }
.help-body {
    overflow-y: auto;
    padding: 20px 22px 28px;
    flex: 1;
}
/* Intro banner */
.help-intro {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 22px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.75;
}
[dir="rtl"] .help-intro {
    font-family: var(--font-arabic);
    font-size: 16px;
    line-height: 1.9;
}
[dir="rtl"] .help-title {
    font-family: var(--font-arabic);
    font-size: 22px;
}
/* Feature cards grid */
.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) {
    .help-grid { grid-template-columns: 1fr; }
    .help-box { border-radius: 0; width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; }
    .help-overlay { align-items: flex-end; }
    .help-body { padding: 16px 16px 24px; }
    .help-header { padding: 14px 16px 12px; }
}
.help-card {
    background: var(--bg-content);
    border: 1px solid var(--accent-faint);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s;
}
.help-card:hover { border-color: var(--accent); }
.help-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.help-card-icon {
    font-size: 30px;
    line-height: 1;
    flex-shrink: 0;
}
.help-card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.01em;
}
.help-card-desc {
    font-family: var(--font-ui);
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.75;
}
[dir="rtl"] .help-card-desc {
    font-family: var(--font-arabic);
    font-size: 15px;
    line-height: 1.9;
}
[dir="rtl"] .help-card-title {
    font-family: var(--font-arabic);
    font-size: 17px;
}
/* .help-card-showme pill removed — click-to-navigate disabled pending rework */
/* Mini UI mockups inside cards */
.help-mock {
    margin-top: 6px;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--accent-faint);
    font-family: var(--font-ui);
    font-size: 11px;
}
.help-mock-tabs {
    display: flex;
    background: var(--bg-page);
}
.help-mock-tab {
    flex: 1;
    text-align: center;
    padding: 5px 2px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.help-mock-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
}
.help-mock-player {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-sidebar);
    padding: 6px 10px;
    font-size: 11px;
}
.help-mock-play-btn {
    color: var(--accent);
    font-size: 14px;
}
.help-mock-verse-info { flex: 1; color: var(--text-secondary); }
.help-mock-kbd {
    display: inline-block;
    background: var(--bg-page);
    border: 1px solid var(--accent-faint);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    color: var(--text-primary);
    font-family: monospace;
    margin: 1px;
}
.help-mock-verse {
    padding: 8px 10px;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 11px;
    line-height: 1.5;
}
.help-mock-actions {
    display: flex;
    gap: 6px;
    padding: 4px 10px 6px;
    background: var(--bg-page);
}
.help-mock-action-btn {
    background: var(--accent-trace);
    border: 1px solid var(--accent-faint);
    border-radius: 99px;
    padding: 2px 7px;
    color: var(--accent);
    font-size: 10px;
}
.help-mock-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-page);
    color: var(--text-muted);
    font-size: 11px;
    border-bottom: 1px solid var(--accent-faint);
}
.help-mock-list-item {
    padding: 5px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--accent-faint);
    display: flex;
    align-items: center;
    gap: 6px;
}
.help-mock-badge {
    background: var(--accent);
    color: var(--bg-content);
    border-radius: 99px;
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 700;
}
.help-mock-theme-row {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-page);
}
.help-mock-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--accent-faint);
}
.help-mock-swatch.active { border-color: var(--accent); }
/* Section heading inside help */
.help-section-heading {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--accent-faint);
}
.help-section-heading:first-child { margin-top: 0; }

/* ════════════════════════════════════════════════════════════════════
   Desktop Hijri Calendar modal
   ════════════════════════════════════════════════════════════════════ */
.hijri-desktop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
}
.hijri-desktop-overlay.show { opacity: 1; }
.hijri-desktop-box {
    background: var(--bg-sidebar);
    border-radius: 16px;
    width: 440px;
    max-width: 94vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s ease, opacity 0.25s;
}
.hijri-desktop-overlay.show .hijri-desktop-box {
    transform: translateY(0) scale(1);
}
.hijri-desktop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.hijri-desktop-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-ui);
}
.hijri-desktop-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-trace);
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.hijri-desktop-body {
    overflow-y: auto;
    flex: 1;
}
/* Make #hijriMonth look clickable on desktop */
#hijriMonth {
    cursor: default;
}
@media (min-width: 768px) {
    #hijriMonth {
        cursor: pointer;
        border-radius: 6px;
        padding: 2px 4px;
        margin: -2px -4px;
        transition: background 0.15s;
    }
    #hijriMonth:hover {
        background: var(--accent-trace);
    }
}

/* ════════════════════════════════════════════════════════════════════
   24-hour Islamic event alert popup
   ════════════════════════════════════════════════════════════════════ */
.hijri-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.hijri-alert-overlay.show { opacity: 1; }
.hijri-alert-box {
    background: var(--bg-sidebar);
    border-radius: 20px;
    padding: 32px 28px 24px;
    width: 320px;
    max-width: 92vw;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    border: 1px solid var(--accent-faint);
    transform: scale(0.88);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.hijri-alert-overlay.show .hijri-alert-box { transform: scale(1); }
.hijri-alert-timing {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 16px;
}
.hijri-alert-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
}
.hijri-alert-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
    margin-bottom: 8px;
    line-height: 1.2;
}
.hijri-alert-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.hijri-alert-close {
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 10px;
    padding: 11px 32px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    width: 100%;
    transition: opacity 0.15s;
}
.hijri-alert-close:hover { opacity: 0.85; }

/* Help screen */
.mob-help-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.mob-help-item:last-child { border-bottom: none; }
.mob-help-ico { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
