/* Generated from css/quran.css by tools/rtl/gen.js (rtlcss) — do not edit */
/* ═══════════════════════════════════════════
   Holy Qur'an — Themed Reading Experience
   Theme variables are now in css/theme.css
   ═══════════════════════════════════════════ */

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

.quran-page {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--q-bg);
    color: var(--q-text);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    transition: background 0.5s, color 0.5s;
}

.hidden { display: none !important; }

/* ─── Custom Scrollbar ─── */
.modern-scroll::-webkit-scrollbar { width: 4px; }
.modern-scroll::-webkit-scrollbar-track { background: transparent; }
.modern-scroll::-webkit-scrollbar-thumb { background: var(--q-scroll-thumb); border-radius: 10px; }

/* ═══════════════════════════════════════════
   TOP NAVIGATION
   ═══════════════════════════════════════════ */

.q-topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 64px;
    border-bottom: 1px solid var(--q-border);
    background: var(--q-bg);
    z-index: 50;
    flex-shrink: 0;
    transition: background 0.5s, border-color 0.5s;
    position: relative;
}

.q-topnav-left, .q-topnav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.q-topnav-brand {
    flex-shrink: 0;
}

.q-nav-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--q-border);
    border-radius: 14px;
    color: var(--q-text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    opacity: 0.8;
}
.q-nav-btn:hover {
    background: var(--q-hover);
    opacity: 1;
}
.q-nav-btn.active {
    background: var(--q-card);
    color: var(--q-accent);
    opacity: 1;
}

/* Breadcrumb */
.q-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.q-breadcrumb-root {
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--q-border);
    border-radius: 14px;
    color: var(--q-text);
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}
.q-breadcrumb-root:hover {
    background: var(--q-hover);
    opacity: 1;
}
.q-breadcrumb-sep { opacity: 0.2; color: var(--q-text); }
.q-breadcrumb-name { font-weight: 600; }

/* Theme Switcher — now in css/theme.css */

/* ═══════════════════════════════════════════
   TYPOGRAPHY POPUP
   ═══════════════════════════════════════════ */

.q-type-popup {
    position: absolute;
    top: calc(100% + 12px);
    left: 60px;
    width: 280px;
    background: var(--q-sidebar-bg);
    border: 1px solid var(--q-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    z-index: 55;
    animation: popupFadeIn 0.2s ease;
}

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

.q-type-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.q-type-popup-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.5;
}
.q-type-popup-close {
    background: none;
    border: none;
    color: var(--q-text);
    opacity: 0.4;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s;
}
.q-type-popup-close:hover { opacity: 1; }

.q-type-control { margin-bottom: 20px; }
.q-type-control:last-child { margin-bottom: 0; }
.q-type-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
    opacity: 0.7;
}

/* Range slider */
.q-type-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--q-progress-bg);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.q-type-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--q-accent);
    cursor: pointer;
    border: none;
}
.q-type-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--q-accent);
    cursor: pointer;
    border: none;
}

/* ═══════════════════════════════════════════
   SIDEBARS
   ═══════════════════════════════════════════ */

.q-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: 340px;
    background: var(--q-sidebar-bg);
    border-color: var(--q-border);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s, border-color 0.5s;
}
.q-sidebar-left {
    right: 0;
    border-left: 1px solid var(--q-border);
    transform: translateX(100%);
}
.q-sidebar-left.open { transform: translateX(0); }
.q-sidebar-right {
    left: 0;
    width: 380px;
    border-right: 1px solid var(--q-border);
    transform: translateX(-100%);
}
.q-sidebar-right.open { transform: translateX(0); }

.q-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 32px;
}

.q-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.q-sidebar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    opacity: 0.4;
    color: var(--q-text);
}
.q-sidebar-label svg { color: var(--q-accent); }
.q-sidebar-close {
    background: none;
    border: none;
    color: var(--q-text);
    opacity: 0.3;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.2s;
}
.q-sidebar-close:hover { opacity: 1; }

.q-sidebar-search {
    position: relative;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.q-sidebar-search svg {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    color: var(--q-text);
}
.q-sidebar-search input {
    width: 100%;
    background: var(--q-input-bg);
    border: 1px solid var(--q-border);
    border-radius: 16px;
    padding: 12px 42px 12px 16px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--q-text);
    outline: none;
    transition: border-color 0.2s;
}
.q-sidebar-search input::placeholder { color: var(--q-text); opacity: 0.3; }
.q-sidebar-search input:focus { border-color: var(--q-accent); }

.q-sidebar-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Surah items in left sidebar */
.q-surah-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 2px;
}
.q-surah-item:hover { background: var(--q-hover); }
.q-surah-item.active {
    background: var(--q-card);
    border-color: var(--q-border);
}
.q-surah-item-num {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.3;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.q-surah-item-info { display: flex; flex-direction: column; }
.q-surah-item-name {
    font-size: 13px;
    font-weight: 600;
}
.q-surah-item-meta {
    font-size: 9px;
    text-transform: uppercase;
    opacity: 0.3;
    margin-top: 2px;
}

/* Sidebar toggle tabs (Surahs / Juz) */
/* Sidebar tabs row: tabs + bookmark icon */
.q-sidebar-tabs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.q-sidebar-tabs {
    display: flex;
    flex: 1;
    padding: 3px;
    border-radius: 16px;
    background: var(--q-input-bg);
    border: 1px solid var(--q-border);
}
.q-sidebar-tab-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--q-input-bg);
    border: 1px solid var(--q-border);
    color: var(--q-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.q-sidebar-tab-icon:hover {
    color: var(--q-text);
    background: var(--q-hover);
}
.q-sidebar-tab-icon.active {
    background: var(--q-card);
    color: var(--q-accent);
    border-color: var(--q-accent);
    box-shadow: var(--q-highlight-shadow);
}
.q-sidebar-tab {
    flex: 1;
    padding: 10px 0;
    border-radius: 13px;
    background: none;
    border: 1px solid transparent;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    color: var(--q-text-secondary);
    transition: all 0.2s;
}
.q-sidebar-tab:hover {
    color: var(--q-text);
}
.q-sidebar-tab.active {
    background: var(--q-card);
    color: var(--q-text);
    border-color: var(--q-border);
    box-shadow: var(--q-highlight-shadow);
}

/* Juz items in left sidebar */
.q-juz-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 2px;
}
.q-juz-item:hover { 
    background: var(--q-hover); 
}
.q-juz-item-num {
    font-size: 12px;
    font-weight: 800;
    color: var(--q-accent);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(var(--q-accent-rgb), 0.1);
    flex-shrink: 0;
}
.q-juz-item-info { 
    display: flex; 
    flex-direction: column; 
}
.q-juz-item-name {
    font-size: 13px;
    font-weight: 600;
    font-family: 'Amiri', serif;
}
.q-juz-item-meta {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 2px;
}

/* Settings tabs */
.q-settings-tabs {
    display: flex;
    padding: 3px;
    border-radius: 16px;
    background: var(--q-input-bg);
    border: 1px solid var(--q-border);
    margin-bottom: 20px;
    flex-shrink: 0;
}
.q-settings-tab {
    flex: 1;
    padding: 10px 0;
    border-radius: 13px;
    background: none;
    border: 1px solid transparent;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--q-text);
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.25s;
    font-family: 'Inter', sans-serif;
}
.q-settings-tab:hover { opacity: 0.7; }
.q-settings-tab.active {
    background: var(--q-card);
    border-color: var(--q-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 1;
}

/* Reciter/translation items */
.qp-reciter-item, .qp-trans-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 2px;
}
.qp-reciter-item:hover, .qp-trans-item:hover { background: var(--q-hover); }
.qp-reciter-item.active, .qp-trans-item.active {
    background: var(--q-card);
    border-color: var(--q-border);
}
.qp-reciter-item input, .qp-trans-item input[type="checkbox"] { display: none; }
.qp-reciter-name, .qp-trans-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--q-text);
}
.qp-reciter-lang {
    font-size: 9px;
    font-weight: 600;
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--q-text);
}
.q-check-icon { color: var(--q-accent); flex-shrink: 0; }

.qp-trans-group { margin-bottom: 4px; }
.qp-trans-lang-header {
    padding: 10px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--q-accent);
    opacity: 0.7;
}

/* Shared sidebar/header theme overrides — now in css/theme.css */

/* Footer text */
.quran-page #sidebar-footer-text {
    color: var(--q-text-secondary);
}

/* Account for mini sidebar rail on right side */
@media (min-width: 769px) {
    .quran-page.sidebar-mini .q-topnav {
        padding-left: 96px;
    }
    .quran-page.sidebar-mini .q-sidebar-right {
        left: 80px;
    }
    .quran-page.sidebar-mini .q-type-popup {
        left: 140px;
    }
}

/* Backdrop */
.q-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    z-index: 55;
    animation: backdropFade 0.3s ease;
}
@keyframes backdropFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════════════════════════════════════════
   MAIN READING AREA
   ═══════════════════════════════════════════ */

.q-main {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.q-main-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 40px 200px;
    width: 100%;
}

.quran-page .q-main > #site-footer {
    margin-top: 24px;
}

/* Welcome / Surah list view */
.q-welcome-header {
    margin-bottom: 28px;
}

/* Index tabs */
.q-index-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--q-border);
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.q-index-tabs::-webkit-scrollbar { display: none; }
.q-index-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 13px;
    font-weight: 600;
    color: var(--q-text-secondary);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    border-radius: 0;
    white-space: nowrap;
    flex: 0 0 auto;
}
.q-index-tab:hover { color: var(--q-text); }
.q-index-tab.active {
    color: var(--q-accent);
    border-bottom-color: var(--q-accent);
}
.q-welcome-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.q-welcome-subtitle {
    font-size: 14px;
    color: var(--q-text-secondary);
    line-height: 1.6;
    max-width: 540px;
}

.q-continue-card {
    border: 1px solid var(--q-border);
    background: var(--q-card);
    border-radius: 20px;
    padding: 24px 26px;
    margin-bottom: 16px;
}

.q-continue-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.q-continue-info { flex: 1; }

.q-continue-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--q-accent);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.q-continue-label svg {
    width: 14px;
    height: 14px;
}

.q-continue-surah {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.5rem, 3.8vw, 2.05rem);
    line-height: 1.16;
    margin: 0 0 6px;
}

.q-continue-meta {
    margin: 0;
    font-size: 14px;
    color: var(--q-text-secondary);
}

.q-continue-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.q-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 11px;
    background: var(--q-input-bg);
    border: 1px solid var(--q-border);
    color: var(--q-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.q-stat-badge svg {
    width: 16px;
    height: 16px;
}

.q-stat-label {
    color: var(--q-text-secondary);
    font-weight: 500;
}

.q-play-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.q-play-glow {
    position: absolute;
    inset: 12px;
    background: var(--q-accent);
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.2;
}

.q-play-ring {
    position: absolute;
    inset: 0;
    transform: rotate(90deg);
}

.q-play-btn {
    position: absolute;
    inset: 8px;
    border: none;
    border-radius: 50%;
    background: var(--q-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.q-play-btn svg {
    width: 26px;
    height: 26px;
    margin-right: 2px;
}

.q-play-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 50%;
    transform: translateX(50%);
    background: rgba(0, 0, 0, 0.86);
    color: #fff;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    padding: 6px 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 10;
}

.q-play-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.86);
}

.q-play-wrap:hover .q-play-tooltip { opacity: 1; }

.q-search-wrap {
    position: relative;
    margin-bottom: 24px;
}
.q-search-wrap svg {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--q-text);
    opacity: 0.3;
}
.q-search-wrap input {
    width: 100%;
    padding: 14px 46px 14px 16px;
    border: 1px solid var(--q-border);
    border-radius: 16px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: var(--q-card);
    color: var(--q-text);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.q-search-wrap input::placeholder { color: var(--q-text); opacity: 0.35; }
.q-search-wrap input:focus {
    border-color: var(--q-accent);
    box-shadow: 0 0 0 3px rgba(var(--q-accent-rgb), 0.08);
}

.q-popular-searches {
    position: absolute;
    right: 0;
    left: 0;
    top: calc(100% + 8px);
    z-index: 16;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--q-border);
    background: var(--q-card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.q-popular-chip {
    appearance: none;
    border: 1px solid var(--q-border);
    background: var(--q-input-bg);
    color: var(--q-text);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.q-popular-chip:hover {
    border-color: var(--q-accent);
    background: var(--q-highlight-bg);
}

/* Surah Grid (list) */
.surah-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}
.surah-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.surah-card:hover {
    background: var(--q-highlight-bg);
    border-color: var(--q-highlight-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.surah-card:active { transform: scale(0.995); }

.surah-card-num {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--q-input-bg);
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--q-accent);
    flex-shrink: 0;
}
.surah-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.surah-card-en {
    font-size: 14px;
    font-weight: 600;
}
.surah-card-translation {
    font-size: 12px;
    color: var(--q-text-secondary);
    opacity: 0.6;
}
.surah-card-right {
    text-align: left;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.surah-card-ar {
    font-family: 'Amiri', serif;
    font-size: 20px;
    line-height: 1.2;
}
.surah-card-ayahs {
    font-size: 11px;
    color: var(--q-text-secondary);
    opacity: 0.5;
}

/* ─── Index: empty state ─── */
.q-index-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 20px;
    text-align: center;
    gap: 8px;
}
.q-index-empty p {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.45;
    margin: 0;
}
.q-index-empty span {
    font-size: 12px;
    opacity: 0.3;
}

/* ─── Index: download list ─── */
/* link to the separate MP3 download page */
.qx-pref-dl { text-decoration: none; }
.q-download-link { align-items: center; text-decoration: none; color: inherit; transition: border-color .2s, transform .15s; }
.q-download-link:hover { border-color: rgba(var(--q-accent-rgb), .45); }
.q-download-link .q-download-all-btn { flex: none; pointer-events: none; }
@media (max-width: 640px) { .q-download-link { flex-direction: column; align-items: stretch; } }
@media (max-width: 520px) { .qx-pref-dl { flex: none !important; } .qx-pref-dl .qx-pref-v { display: none; } .qx-pref-dl::after { content: 'MP3'; } }

.q-download-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px;
    background: linear-gradient(-135deg, rgba(var(--q-accent-rgb), 0.12), rgba(var(--q-accent-rgb), 0.04));
    border: 1px solid rgba(var(--q-accent-rgb), 0.16);
    border-radius: 20px;
}
.q-download-kicker {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--q-accent);
    margin-bottom: 10px;
}
.q-download-head-copy h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-family: 'Poppins', sans-serif;
}
.q-download-head-copy p {
    margin: 0;
    max-width: 560px;
    color: var(--q-text-secondary);
    line-height: 1.6;
    font-size: 14px;
}
.q-download-head-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 250px;
}
.q-download-reciter-btn,
.q-download-all-btn,
.q-download-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--q-border);
    background: var(--q-card);
    color: var(--q-text);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s, background 0.2s, color 0.2s;
    font-family: 'Inter', sans-serif;
}
.q-download-reciter-btn:hover,
.q-download-all-btn:hover,
.q-download-inline-btn:hover {
    border-color: var(--q-accent);
    color: var(--q-accent);
    transform: translateY(-1px);
}
.q-download-reciter-btn:disabled,
.q-download-all-btn:disabled,
.q-download-inline-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
.q-download-reciter-btn {
    align-items: flex-start;
    flex-direction: column;
    text-align: right;
}
.q-download-reciter-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--q-text-secondary);
}
.q-download-reciter-btn strong {
    font-size: 14px;
    line-height: 1.4;
}
.q-download-all-btn {
    background: var(--q-accent);
    border-color: var(--q-accent);
    color: #fff;
    font-weight: 700;
}
.q-download-all-btn:hover {
    color: #fff;
    filter: brightness(1.02);
}
.q-download-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.q-download-summary {
    font-size: 13px;
    color: var(--q-text-secondary);
}
.q-download-status {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(var(--q-accent-rgb), 0.08);
    color: var(--q-accent);
    font-size: 12px;
    font-weight: 600;
}
.q-download-status.is-error {
    background: rgba(214, 82, 82, 0.12);
    color: #c33b3b;
}
.q-download-status.is-success {
    background: rgba(39, 140, 92, 0.12);
    color: #21724c;
}
.q-download-list {
    display: grid;
    gap: 8px;
}
.q-download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 18px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.q-download-card:hover {
    background: var(--q-highlight-bg);
    border-color: var(--q-highlight-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.q-download-card.is-unavailable {
    opacity: 0.6;
}
.q-download-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.q-download-card-num {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(var(--q-accent-rgb), 0.1);
    color: var(--q-accent);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.q-download-card-copy {
    min-width: 0;
}
.q-download-card-topline {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.q-download-card-topline strong {
    font-size: 15px;
}
.q-download-card-topline span {
    font-family: 'Amiri', serif;
    font-size: 20px;
    line-height: 1.1;
}
.q-download-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--q-text-secondary);
}
.q-download-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    min-width: 118px;
    border-radius: 14px;
    border: 1px solid rgba(var(--q-accent-rgb), 0.18);
    background: rgba(var(--q-accent-rgb), 0.08);
    color: var(--q-accent);
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.q-download-action:hover {
    background: rgba(var(--q-accent-rgb), 0.14);
    border-color: rgba(var(--q-accent-rgb), 0.3);
    transform: translateY(-1px);
}
.q-download-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

/* ─── Index: Juz grid ─── */
.index-juz-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.index-juz-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.index-juz-card:hover {
    background: var(--q-highlight-bg);
    border-color: var(--q-highlight-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.index-juz-card-num {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--q-accent-rgb), 0.1);
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--q-accent);
    flex-shrink: 0;
}
.index-juz-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.index-juz-card-label {
    font-size: 13px;
    font-weight: 700;
}
.index-juz-card-surah {
    font-size: 11px;
    color: var(--q-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.index-juz-card-ayah {
    font-size: 10px;
    opacity: 0.4;
}
.index-juz-card-ar {
    font-family: 'Amiri', serif;
    font-size: 16px;
    opacity: 0.45;
    flex-shrink: 0;
}

/* ─── Index: Bookmarks grid ─── */
.index-bookmark-grid {
    display: flex;
    flex-direction: column;
}
.index-bookmark-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--q-border);
    transition: opacity 0.2s;
}
.index-bookmark-card:last-child {
    border-bottom: none;
}
.index-bookmark-card:hover {
    opacity: 0.75;
}
.index-bookmark-card-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--q-accent-rgb), 0.1);
    border-radius: 10px;
    color: var(--q-accent);
    flex-shrink: 0;
}
.index-bookmark-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.index-bookmark-card-surah {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.index-bookmark-card-ayah {
    font-size: 11px;
    color: var(--q-text-secondary);
    opacity: 0.6;
}
.index-bookmark-card-ar {
    font-family: 'Amiri', serif;
    font-size: 16px;
    opacity: 0.45;
    flex-shrink: 0;
}
.index-bookmark-remove {
    background: none;
    border: none;
    color: var(--q-text);
    opacity: 0.2;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity 0.2s, color 0.2s;
    margin-right: auto;
}
.index-bookmark-remove:hover {
    opacity: 0.8;
    color: #e74c3c;
}

/* ═══════════════════════════════════════════
   SURAH READER
   ═══════════════════════════════════════════ */

/* Surah Header */
.q-surah-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 60px;
    padding-top: 20px;
    animation: fadeSlideUp 0.7s ease both;
}

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

.q-surah-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 24px;
    border-radius: 100px;
    border: 1px solid var(--q-border);
    background: var(--q-card);
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.q-surah-badge span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.6;
}
.q-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--q-accent);
    opacity: 0.5;
}

.q-surah-title-ar {
    margin-top: 0;
    font-family: 'Amiri', serif;
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.3;
}
.q-surah-title-en {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0.9;
    margin-bottom: 6px;
}
.q-surah-title-translation {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-weight: 700;
    color: var(--q-text-secondary);
    opacity: 0.6;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.q-surah-title-t-sep {
    opacity: 0.5;
}

/* View Mode Toggle */
.q-view-toggle {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 12px;
    padding: 4px;
}
.q-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--q-text);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.2s;
}
.q-view-btn:hover {
    opacity: 0.8;
}
.q-view-btn.active {
    background: var(--q-accent);
    color: #fff;
    opacity: 1;
}
.q-view-btn svg {
    width: 16px;
    height: 16px;
}

/* Bismillah */
.q-bismillah {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 20px;
}
.q-bismillah-line {
    height: 1px;
    width: 120px;
    background: var(--q-accent);
    opacity: 0.2;
    margin: 0 auto 40px;
}
.q-bismillah-line:last-child {
    margin: 40px auto 0;
}
.q-bismillah-text {
    font-family: 'Amiri', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.8;
    opacity: 0.9;
}

/* ═══════════════════════════════════════════
   AYAH BLOCKS
   ═══════════════════════════════════════════ */

.q-ayahs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ayah-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.5s ease;
}

/* Active ayah highlight (glow) */
.ayah-block.ayah-active {
    background: var(--q-highlight-bg);
    border-color: var(--q-highlight-border);
    box-shadow: var(--q-highlight-shadow);
}

/* Ayah Header Row */
.ayah-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ayah-number {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    border: 1px solid var(--q-border);
    opacity: 0.5;
    transition: all 0.5s;
    flex-shrink: 0;
    cursor: pointer;
}
.ayah-number:hover {
    opacity: 0.8;
    border-color: var(--q-accent);
}
.ayah-active .ayah-number {
    background: var(--q-accent);
    color: #fff;
    border-color: transparent;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(var(--q-accent-rgb), 0.3);
    transform: scale(1.1);
}

/* Ayah info popup */
.ayah-info-popup {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%);
    background-color: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    min-width: 120px;
    animation: popupFadeIn 0.2s ease;
    /* Force opaque background */
    isolation: isolate;
}
/* Theme-specific solid backgrounds */
[data-theme="sepia"] .ayah-info-popup { background-color: #ebe3cf; }
[data-theme="silver"] .ayah-info-popup { background-color: #f1f5f9; }
[data-theme="emerald"] .ayah-info-popup { background-color: #0a231e; }
[data-theme="midnight"] .ayah-info-popup { background-color: #1e293b; }

.ayah-info-popup::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--q-border);
}
.ayah-info-popup::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--q-card);
    margin-left: -1px;
}
[data-theme="sepia"] .ayah-info-popup::after { border-left-color: #ebe3cf; }
[data-theme="silver"] .ayah-info-popup::after { border-left-color: #f1f5f9; }
[data-theme="emerald"] .ayah-info-popup::after { border-left-color: #0a231e; }
[data-theme="midnight"] .ayah-info-popup::after { border-left-color: #1e293b; }

@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(-50%) translateX(4px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}
.ayah-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--q-text);
    border-bottom: 1px solid var(--q-border);
}
.ayah-info-row:last-child {
    border-bottom: none;
}
.ayah-info-row span {
    opacity: 0.6;
}
.ayah-info-row strong {
    font-weight: 600;
}
.ayah-info-sajdah {
    justify-content: center;
    color: #c83232;
    font-weight: 600;
}
.ayah-info-sajdah span {
    opacity: 1;
}

/* Action buttons - horizontal row */
.ayah-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ayah-actions .ayah-action-btn {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s, color 0.2s, background 0.2s;
}
.ayah-block:hover .ayah-actions .ayah-action-btn,
.ayah-active .ayah-actions .ayah-action-btn {
    visibility: visible;
    opacity: 0.4;
}
.ayah-block:hover .ayah-actions .ayah-action-btn:hover,
.ayah-active .ayah-actions .ayah-action-btn:hover {
    opacity: 1;
}
/* Always show bookmarked icon */
.ayah-actions .ayah-bookmark-btn.bookmarked {
    visibility: visible;
    opacity: 1;
}

.ayah-action-btn {
    background: none;
    border: none;
    color: var(--q-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: opacity 0.2s, color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ayah-action-btn:hover {
    opacity: 1;
    color: var(--q-accent);
    background: var(--q-hover);
}

/* Bookmark active state */
.ayah-bookmark-btn.bookmarked {
    opacity: 1;
    color: var(--q-accent);
}
.ayah-bookmark-btn.bookmarked svg {
    fill: var(--q-accent);
}

/* Bookmark sidebar items */
.q-bookmark-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 2px;
}
.q-bookmark-item:hover {
    background: var(--q-hover);
}
.q-bookmark-item-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--q-accent);
    background: rgba(var(--q-accent-rgb), 0.1);
}
.q-bookmark-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.q-bookmark-item-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.q-bookmark-item-meta {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 2px;
}
.q-bookmark-item-ar {
    font-family: 'Amiri', serif;
    font-size: 13px;
    opacity: 0.5;
    flex-shrink: 0;
}
.q-bookmark-item-remove {
    background: none;
    border: none;
    color: var(--q-text);
    opacity: 0.25;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.q-bookmark-item-remove:hover {
    opacity: 0.8;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}
.q-bookmark-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    gap: 8px;
}
.q-bookmark-empty p {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.5;
    margin: 0;
}
.q-bookmark-empty span {
    font-size: 11px;
    opacity: 0.3;
}

/* Ayah Content */
.ayah-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ayah-arabic {
    font-family: 'Amiri', serif;
    font-size: 38px;
    line-height: 2.4;
    text-align: left;
    direction: ltr;
    word-spacing: 4px;
    transition: opacity 0.5s;
    margin: 0;
}
.ayah-active .ayah-arabic { opacity: 1; }

/* End of ayah marker with Arabic numeral */
.ayah-end-marker {
    font-family: 'Amiri', serif;
    color: var(--q-accent);
    opacity: 0.7;
    margin-left: 4px;
    font-size: 0.9em;
    white-space: nowrap;
}

.ayah-translations {
    border-top: 1px solid var(--q-border);
    padding-top: 16px;
    transition: border-color 0.5s;
}
.ayah-active .ayah-translations {
    border-top-color: var(--q-border);
}

.ayah-translation {
    margin: 0;
    line-height: 1.8;
    font-size: 18px;
    color: var(--q-text);
    opacity: 0.8;
    transition: opacity 0.5s;
}
.ayah-active .ayah-translation { opacity: 0.9; }

.ayah-translation + .ayah-translation {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--q-border);
}

.ayah-tr-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 8px;
    font-weight: 700;
    color: var(--q-text-secondary);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-top: 6px;
    opacity: 0.4;
}
.ayah-tr-label::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--q-border);
}

/* ═══════════════════════════════════════════
   MUSHAF VIEW (Reading Mode)
   ═══════════════════════════════════════════ */

.mushaf-page {
    margin-bottom: 40px;
}

.mushaf-text {
    font-family: 'Amiri', 'Scheherazade New', serif;
    font-size: var(--q-arabic-size, 32px);
    line-height: 2.2;
    text-align: justify;
    text-justify: inter-word;
    color: var(--q-text);
    padding: 0 10px;
}

.mushaf-ayah {
    cursor: default;
    transition: background-color 0.3s, color 0.3s;
    padding: 2px 4px;
    border-radius: 4px;
}

.mushaf-ayah-active {
    background: rgba(var(--q-accent-rgb), 0.2);
    box-shadow: 0 0 0 2px rgba(var(--q-accent-rgb), 0.15);
}

.mushaf-ayah-num {
    font-family: 'Amiri', serif;
    color: var(--q-accent);
    font-size: 0.85em;
    padding: 0 2px;
    opacity: 0.8;
}

.mushaf-page-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--q-border);
}

.mushaf-page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: var(--q-text);
    opacity: 0.6;
}

/* ═══════════════════════════════════════════
   TRANSLATION VIEW (Translation Only Mode)
   ═══════════════════════════════════════════ */

.translation-header {
    text-align: center;
    padding: 16px 20px;
    margin-bottom: 30px;
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 12px;
    font-size: 14px;
    color: var(--q-text);
}
.translation-header-label {
    font-weight: 600;
    opacity: 0.6;
    margin-left: 6px;
}

.translation-page {
    margin-bottom: 40px;
}

.translation-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 0;
    transition: background-color 0.3s;
    cursor: default;
}

.translation-row-num {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    color: var(--q-accent);
    opacity: 0.7;
}
.translation-row-num::after {
    content: '';
    display: block;
    width: 15px;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
}

.translation-row-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.translation-row-text p {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: var(--q-text);
}

.translation-row-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--q-text-secondary);
    opacity: 0.5;
}

/* Highlight active verse in translation mode */
.translation-row-active {
    background: rgba(var(--q-accent-rgb), 0.08);
    border-radius: 12px;
    padding: 20px 16px;
    margin: 0 -16px;
}
.translation-row-active .translation-row-num {
    opacity: 1;
}

/* Loading */
.q-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 0;
    color: var(--q-text-secondary);
    font-size: 14px;
}
.q-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--q-border);
    border-top-color: var(--q-accent);
    border-radius: 50%;
    animation: qSpin 0.8s linear infinite;
}
@keyframes qSpin { to { transform: rotate(-360deg); } }

/* Error */
.quran-error {
    text-align: center;
    color: #ef4444;
    padding: 40px 0;
    font-size: 14px;
}

/* ═══════════════════════════════════════════
   SURAH NAVIGATION (round 129): two quiet cards — the neighbouring surah's name, number, ayahs and Arabic name
   ═══════════════════════════════════════════ */
.q-surah-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 40px 0 28px; padding-top: 28px; border-top: 1px solid var(--q-border); }
.q-surah-nav-btn { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 16px 18px; background: var(--q-card); border: 1px solid var(--q-border); border-radius: 16px; color: var(--q-text); font-family: 'Inter', system-ui, sans-serif; text-align: start; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
.q-surah-nav-btn[hidden] { display: none; }
.q-surah-nav-next { grid-column: 2; flex-direction: row-reverse; text-align: end; }
.q-surah-nav-btn:hover { border-color: rgba(var(--q-accent-rgb), .55); box-shadow: 0 10px 28px -18px rgba(var(--q-accent-rgb), .9); transform: translateY(-1px); }
.q-surah-nav-btn:focus-visible { outline: 2px solid var(--q-accent); outline-offset: 2px; }
.q-snav-arrow { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(var(--q-accent-rgb), .1); color: var(--q-accent); transition: background .2s, color .2s, transform .2s; }
.q-surah-nav-btn:hover .q-snav-arrow { background: var(--q-accent); color: #fff; }
.q-surah-nav-prev:hover .q-snav-arrow { transform: translateX(3px); }
.q-surah-nav-next:hover .q-snav-arrow { transform: translateX(-3px); }
.q-snav-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.q-snav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--q-text-secondary); }
.q-snav-name { font-size: 17px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-snav-meta { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--q-text-secondary); }
.q-surah-nav-next .q-snav-meta { justify-content: flex-end; }
.q-snav-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.q-snav-ar { flex: none; font-family: 'Amiri', serif; font-size: 24px; line-height: 1; color: var(--q-accent); opacity: .75; }
@media (max-width: 768px) {
    .q-surah-nav { gap: 10px; margin: 28px 0 20px; padding-top: 20px; }
    .q-surah-nav-btn { gap: 10px; padding: 12px; border-radius: 14px; }
    .q-snav-arrow { width: 30px; height: 30px; }
    .q-snav-arrow svg { width: 16px; height: 16px; }
    .q-snav-name { font-size: 15px; }
    .q-snav-label { font-size: 10px; }
    .q-snav-meta { font-size: 11.5px; }
    .q-snav-ar { display: none; }
}
.q-snav-arrow svg { transform: scaleX(-1); }

/* ═══════════════════════════════════════════
   AUDIO PLAYER BAR
   ═══════════════════════════════════════════ */

.q-player {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 50;
    background: var(--q-player-bg);
    border-top: 1px solid var(--q-border);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.08);
    transition: background 0.5s, border-color 0.5s, left 0.3s;
}

@media (min-width: 768px) {
    body.sidebar-mini:not(.sidebar-open) .q-player {
        left: 80px;
    }
}

/* Progress */
.q-player-progress {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--q-progress-bg);
    cursor: pointer;
}
.q-player-progress-fill {
    height: 100%;
    background: var(--q-accent);
    width: 0%;
    transition: width 0.15s linear;
    position: relative;
}
.q-player-progress-dot {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--q-accent);
    box-shadow: 0 0 8px rgba(var(--q-accent-rgb), 0.4);
}

/* Player content */
.q-player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    max-width: 1280px;
    margin: 0 auto;
    gap: 24px;
}

.q-player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.q-player-surah {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.q-player-ayah {
    font-size: 12px;
    color: var(--q-text-secondary);
    opacity: 0.7;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s, opacity 0.2s;
}
.q-player-ayah:hover {
    background: rgba(var(--q-accent-rgb), 0.1);
    opacity: 1;
}

/* Go to ayah popup */
.q-goto-wrap { position: relative; }

.q-goto-popup {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    background: var(--q-sidebar-bg);
    border: 1px solid var(--q-border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 70;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .q-goto-popup {
        position: fixed;
        bottom: auto;
        top: 50%;
        right: 50%;
        transform: translate(50%, -50%);
    }
}

.q-goto-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.5;
    margin-bottom: 12px;
    text-align: center;
}

.q-goto-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.q-goto-input-wrap input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--q-border);
    border-radius: 10px;
    background: var(--q-bg);
    color: var(--q-text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}
.q-goto-input-wrap input:focus {
    border-color: var(--q-accent);
}
.q-goto-input-wrap input::placeholder {
    opacity: 0.4;
}
/* Hide number input spinners */
.q-goto-input-wrap input::-webkit-outer-spin-button,
.q-goto-input-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.q-goto-input-wrap input[type=number] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.q-goto-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: var(--q-accent);
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
}
.q-goto-btn:hover {
    opacity: 0.85;
}
.q-goto-btn:active {
    transform: scale(0.95);
}

.q-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.q-player-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--q-text);
    border-radius: 50%;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    padding: 0;
    opacity: 0.6;
}
.q-player-btn:hover {
    opacity: 1;
    background: var(--q-hover);
}

.q-player-play {
    width: 52px;
    height: 52px;
    background: var(--q-accent);
    color: #fff;
    opacity: 1;
    margin: 0 4px;
    box-shadow: 0 4px 16px rgba(var(--q-accent-rgb), 0.3);
}
.q-player-play:hover {
    opacity: 1;
    background: var(--q-accent);
    transform: scale(1.05);
}
.q-player-play:active { transform: scale(0.95); }
.q-player-play svg { margin-right: 2px; }

.q-player-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--q-text);
    opacity: 0.6;
    flex-shrink: 0;
    min-width: 70px;
    justify-content: flex-end;
}
.q-player-time-sep { opacity: 0.4; }

/* ═══════════════════════════════════════════
   REPEAT POPUP
   ═══════════════════════════════════════════ */

.q-repeat-wrap { position: relative; }

.q-repeat-trigger.q-repeat-active {
    color: var(--q-accent);
    background: rgba(var(--q-accent-rgb), 0.1);
    opacity: 1;
}

.q-repeat-popup {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 0;
    width: 260px;
    background: var(--q-sidebar-bg);
    border: 1px solid var(--q-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    z-index: 70;
    animation: repeatIn 0.2s ease;
}
@keyframes repeatIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.q-repeat-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.5;
    margin-bottom: 20px;
}

.q-repeat-section { margin-bottom: 18px; }
.q-repeat-section:last-child { margin-bottom: 0; }
.q-repeat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 8px;
}

.q-repeat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.q-ropt {
    padding: 6px 12px;
    border: 1px solid var(--q-border);
    border-radius: 12px;
    background: none;
    color: var(--q-text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}
.q-ropt:hover {
    border-color: var(--q-accent);
    color: var(--q-accent);
    opacity: 1;
}
.q-ropt.active {
    background: var(--q-card);
    border-color: var(--q-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    opacity: 1;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    .q-topnav { padding: 0 16px 0 64px; height: 56px; }
    .q-topnav-left, .q-topnav-right { gap: 8px; }
    .q-nav-btn { width: 38px; height: 38px; border-radius: 10px; }
    .q-breadcrumb-root { width: 38px; height: 38px; border-radius: 10px; }
    .q-breadcrumb { font-size: 13px; }

    /* Enable global sidebar toggle on mobile for Quran app */
    .quran-page.sidebar-mini #menu-toggle {
        display: flex;
        position: fixed;
        top: 9px;
        left: 16px;
        width: 38px;
        height: 38px;
        z-index: 100;
        border-radius: 10px;
        padding: 0;
        gap: 4px;
    }
    .quran-page.sidebar-mini #menu-toggle .bar {
        width: 18px;
        height: 2px;
    }
    .quran-page.sidebar-mini #menu-toggle.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(-45deg);
    }
    .quran-page.sidebar-mini #menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(45deg);
    }

    .q-theme-switcher { margin-bottom: 0; justify-content: center; }

    /* Mobile toolbar row in settings */
    #mobile-toolbar-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--q-border);
        position: relative;
    }
    #mobile-toolbar-wrapper .q-nav-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: var(--q-input-bg);
        border: 1px solid var(--q-border);
    }
    #mobile-toolbar-wrapper .q-type-popup {
        position: absolute;
        top: calc(100% + 10px);
        right: 50%;
        transform: translateX(50%);
        left: auto;
        width: calc(100% - 20px);
        max-width: 300px;
        z-index: 200;
        animation: mobilePopupIn 0.15s ease;
    }
    @keyframes mobilePopupIn {
        from { opacity: 0; transform: translateX(50%) translateY(-6px); }
        to { opacity: 1; transform: translateX(50%) translateY(0); }
    }

    /* Larger close buttons on mobile for sidebars */
    .q-sidebar-close {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: var(--q-input-bg);
        opacity: 0.7;
    }
    .q-sidebar-close:hover,
    .q-sidebar-close:active { opacity: 1; }

    .q-sidebar { width: 300px; }
    .q-sidebar-right { width: 320px; }
    .q-sidebar-inner { padding: 20px; }

    .q-main-inner { padding: 24px 16px 200px; }

    .q-continue-card { padding: 18px 16px; border-radius: 16px; }
    .q-continue-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .q-play-wrap {
        width: 80px;
        height: 80px;
    }

    .q-download-head,
    .q-download-summary-row,
    .q-download-card {
        flex-direction: column;
        align-items: stretch;
    }
    .q-download-head-actions {
        width: 100%;
        min-width: 0;
    }
    .q-download-action {
        width: 100%;
        min-width: 0;
    }

    .q-surah-title-ar { font-size: 2.5rem; }
    .q-surah-title-en { font-size: 1.3rem; }

    .ayah-block {
        gap: 12px;
        padding: 16px 14px;
        border-radius: 16px;
    }
    .ayah-number { width: 32px; height: 32px; font-size: 11px; }
    .ayah-arabic { line-height: 2.2; }
    .ayah-actions .ayah-action-btn {
        visibility: visible;
        opacity: 0.4;
    }
    .ayah-actions .ayah-bookmark-btn.bookmarked { opacity: 1; }
    .ayah-action-btn { padding: 6px; }

    .q-player-content { padding: 10px 16px; gap: 12px; }
    .q-player-play { width: 44px; height: 44px; }
    .q-player-play svg { width: 18px; height: 18px; }
    .q-player-time { min-width: 60px; font-size: 11px; }

    .q-type-popup {
        left: 8px;
        width: 260px;
    }
    .q-repeat-popup {
        left: -40px;
        width: 240px;
    }

    /* View Toggle mobile */
    .q-view-toggle {
        padding: 3px;
        gap: 2px;
    }
    .q-view-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    .q-view-btn span {
        display: none;
    }
    .q-view-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Mushaf mobile */
    .mushaf-text {
        line-height: 2;
        padding: 0;
    }
    .mushaf-page-num {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    /* Translation mobile */
    .translation-row {
        gap: 6px;
        padding: 12px;
    }
    .translation-row-num {
        font-size: 12px;
    }
    .translation-row-text p {
        font-size: 15px;
        line-height: 1.7;
    }
    .translation-header {
        padding: 12px 16px;
        font-size: 13px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .q-sidebar { width: 100%; }
    .q-sidebar-right { width: 100%; }

    .q-surah-header { margin-bottom: 40px; }
    .q-bismillah { margin-bottom: 40px; }
    .q-bismillah-line { width: 60px; margin-bottom: 24px; }
    .q-bismillah-line:last-child { margin-top: 24px; }

    .q-player-controls { gap: 4px; }
    .q-player-btn { width: 36px; height: 36px; }

    /* Mushaf very small screens */
    .mushaf-text {
        line-height: 1.9;
    }
    
    /* Translation very small screens */
    .translation-row {
        gap: 5px;
        padding: 10px;
    }
    .translation-row-num {
        font-size: 11px;
    }
    .translation-row-text p {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* ─── Index: wider screens ─── */
@media (min-width: 900px) {
    .surah-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .index-juz-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1280px) {
    .surah-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .index-juz-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ─── Index: small screens ─── */
@media (max-width: 480px) {
    .q-index-tab {
        font-size: 11px;
        padding: 9px 12px;
        gap: 5px;
    }
    .q-download-card-left {
        align-items: flex-start;
    }
    .q-download-card-meta {
        gap: 8px;
    }
    .index-juz-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════
   SEMANTIC SEARCH MODAL
═══════════════════════════════════════════════════════════ */
.q-search-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}
.q-search-modal.hidden { display: none; }

.q-search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(3px);
}

.q-search-modal-box {
    position: relative;
    z-index: 1;
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 100px);
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Head */
.q-search-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--q-border);
    flex-shrink: 0;
}
.q-search-modal-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--q-text);
}
.q-search-modal-label svg { color: var(--q-accent); }

.q-search-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--q-input-bg);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--q-text-secondary);
    transition: background .15s, color .15s;
}
.q-search-modal-close:hover { background: var(--q-hover); color: var(--q-text); }

/* Input row */
.q-search-modal-input-row {
    display: flex;
    gap: 8px;
    padding: 16px 20px 6px;
    flex-shrink: 0;
}
.q-search-modal-input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid var(--q-border);
    border-radius: 10px;
    background: var(--q-input-bg);
    color: var(--q-text);
    font-size: 15px;
    outline: none;
    transition: border-color .15s;
}
.q-search-modal-input:focus { border-color: var(--q-accent); }

.q-search-modal-submit {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: var(--q-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .15s;
}
.q-search-modal-submit:hover { opacity: .85; }

/* Hint text */
.q-search-modal-hint {
    margin: 4px 20px 10px;
    font-size: 12px;
    color: var(--q-text-secondary);
    opacity: .75;
    flex-shrink: 0;
}

/* Status bar */
.q-search-modal-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    font-size: 12px;
    color: var(--q-text-secondary);
    flex-shrink: 0;
}
.q-search-modal-status.hidden { display: none; }

.q-search-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--q-border);
    border-top-color: var(--q-accent);
    border-radius: 50%;
    animation: q-spin .6s linear infinite;
    flex-shrink: 0;
}

/* Results */
.q-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.q-search-no-results,
.q-search-error {
    text-align: center;
    padding: 32px 16px;
    color: var(--q-text-secondary);
    font-size: 14px;
}
.q-search-error { color: #e57373; }

/* Result card */
.q-search-result-card {
    background: var(--q-input-bg);
    border: 1px solid var(--q-border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.q-search-result-card:hover {
    border-color: var(--q-accent);
    background: var(--q-hover);
}

.q-src-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.q-src-ref {
    font-size: 11px;
    font-weight: 700;
    color: var(--q-accent);
    background: rgba(var(--q-accent-rgb), .12);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.q-src-surah {
    flex: 1;
    font-size: 12px;
    color: var(--q-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.q-src-open {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--q-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.q-src-open:hover { background: var(--q-accent); color: #fff; }

.q-src-arabic {
    font-family: 'Amiri', serif;
    font-size: 22px;
    line-height: 1.8;
    color: var(--q-text);
    margin: 0 0 8px;
    text-align: left;
}
.q-src-trans {
    font-size: 13px;
    line-height: 1.6;
    color: var(--q-text-secondary);
    margin: 0;
    font-style: italic;
}

@media (max-width: 600px) {
    .q-search-modal { padding-top: 16px; }
    .q-search-modal-box {
        max-height: calc(100vh - 32px);
        border-radius: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════
   AI SEARCH — inline index panel
═══════════════════════════════════════════════════════════ */
.q-ai-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.q-ai-search-bar input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--q-border);
    border-radius: 12px;
    background: var(--q-input-bg);
    color: var(--q-text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}
.q-ai-search-bar input:focus { border-color: var(--q-accent); }
.q-ai-search-bar button {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    background: var(--q-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .15s;
}
.q-ai-search-bar button:hover { opacity: .85; }

.q-ai-search-hint {
    font-size: 12px;
    color: var(--q-text-secondary);
    margin: 0 0 12px;
    opacity: .75;
}

.q-ai-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

/* Translation attribution label under each result */
.q-src-trans-item { margin-top: 8px; }
.q-src-trans-name {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--q-accent);
    opacity: .65;
    margin-bottom: 2px;
}

/* ── AI Search: load more ───────────────────────────────────── */
.q-ai-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 4px 0 16px;
}
.q-ai-load-more-wrap--modal {
    padding: 4px 20px 16px;
    flex-shrink: 0;
}
.q-ai-load-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: 1.5px solid var(--q-border);
    border-radius: 20px;
    background: var(--q-input-bg);
    color: var(--q-text-secondary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.q-ai-load-more:hover {
    border-color: var(--q-accent);
    color: var(--q-accent);
    background: var(--q-hover);
}
.q-ai-load-more--loading {
    pointer-events: none;
    opacity: .7;
}
.q-ai-load-more--loading::before {
    content: '';
    width: 13px;
    height: 13px;
    border: 2px solid var(--q-border);
    border-top-color: var(--q-accent);
    border-radius: 50%;
    animation: q-spin .6s linear infinite;
    flex-shrink: 0;
}
.q-ai-load-more--loading svg { display: none; }
.q-ai-load-more-count {
    background: rgba(var(--q-accent-rgb), .12);
    color: var(--q-accent);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
}
@media (min-width: 768px) {
    /* keep the page's own scrollbar left of the icon rail, not under it */
    body.sidebar-mini:not(.sidebar-open) main {
        margin-left: 80px !important;
    }
}

/* surah index on /quran (static, crawlable) */
.qs-index { max-width: 1100px; margin: 48px auto 0; padding: 0 24px 40px; }
.qs-index h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; margin: 0 0 16px; }
.qs-index ol { columns: 4 200px; column-gap: 24px; padding-right: 0; list-style: none; margin: 0; }
.qs-index li { padding: 4px 0; font-size: 14px; break-inside: avoid; }
.qs-index a { color: inherit; text-decoration: none; }
.qs-index a:hover { color: var(--q-accent, var(--t-accent)); }
.qs-index small { opacity: .6; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* Surah cards are links (crawlable, open in a new tab with Ctrl/⌘) */
a.surah-card { color: inherit; text-decoration: none; }
a.surah-card:focus-visible { outline: 2px solid var(--q-accent, var(--t-accent)); outline-offset: 2px; }

/* ═══════════════════════════════════════════
   Qur'an index (js/quran-index.js, inc/quran-index.php)
   ═══════════════════════════════════════════ */
.qx .qx-head { margin-bottom: 20px; }
.qx .q-welcome-title { font-size: clamp(1.6rem, 3vw, 2rem); }

/* One search */
.qx-search { position: relative; display: flex; align-items: center; z-index: 30; }
.qx-search-icon { position: absolute; right: 18px; color: var(--q-text-secondary); pointer-events: none; }
.qx-search input {
    width: 100%; height: 56px; padding: 0 50px 0 92px;
    font: inherit; font-size: 16px; color: var(--q-text);
    background: var(--q-card); border: 1px solid var(--q-border); border-radius: 18px;
    box-shadow: 0 6px 24px rgba(60, 40, 10, 0.06);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.qx-search input::placeholder { color: var(--q-text-secondary); opacity: .75; }
.qx-search input:focus { outline: none; border-color: var(--q-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--q-accent) 16%, transparent), 0 6px 24px rgba(60, 40, 10, 0.06); }
.qx-kbd { position: absolute; left: 16px; min-width: 24px; height: 24px; display: grid; place-items: center; font: 600 12px/1 'Inter', sans-serif; color: var(--q-text-secondary); border: 1px solid var(--q-border); border-bottom-width: 2px; border-radius: 7px; background: var(--q-input-bg); pointer-events: none; }
.qx-search input:focus ~ .qx-kbd, .qx-search input:not(:placeholder-shown) ~ .qx-kbd { display: none; }
.qx-clear { position: absolute; left: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--q-text-secondary); cursor: pointer; }
.qx-clear:hover { background: var(--q-input-bg); color: var(--q-text); }
.qx-suggest {
    position: absolute; top: calc(100% + 8px); right: 0; left: 0; margin: 0; padding: 6px; list-style: none;
    background: var(--q-sidebar-bg, var(--q-card)); border: 1px solid var(--q-border); border-radius: 18px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16); max-height: min(60vh, 420px); overflow-y: auto;
}
.qx-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.qx-opt.is-active { background: var(--q-highlight-bg, var(--q-input-bg)); }
.qx-opt-ic { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; background: var(--q-input-bg); color: var(--q-accent); }
.qx-opt-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qx-ic-ai { background: var(--q-accent); color: #fff; }
.qx-opt-t { display: flex; flex-direction: column; min-width: 0; }
.qx-opt-t strong { font-size: 14px; font-weight: 600; color: var(--q-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qx-opt-t small { font-size: 12px; color: var(--q-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Quick chips */
.qx-chips { display: flex; gap: 8px; margin: 12px 0 22px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.qx-chips::-webkit-scrollbar { display: none; }
.qx-chip { flex: 0 0 auto; font: 600 13px/1 'Inter', sans-serif; color: var(--q-text); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--q-border); background: transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.qx-chip:hover { background: var(--q-card); border-color: var(--q-accent); color: var(--q-accent); }

/* Smart bar */
.qx-smart { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 26px; }
.qx-smart.has-two { grid-template-columns: 1.25fr 1fr; }
.qx-sc { display: flex; align-items: center; gap: 14px; width: 100%; text-align: right; font: inherit; color: var(--q-text); padding: 14px 16px; border-radius: 18px; border: 1px solid var(--q-border); background: var(--q-card); cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; min-width: 0; }
.qx-sc:hover { border-color: var(--q-accent); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); transform: translateY(-1px); }
.qx-sc-play, .qx-sc-ic { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 50%; background: var(--q-accent); color: #fff; }
.qx-sc-play svg { width: 18px; height: 18px; margin-right: 2px; }
.qx-sc-ic { border-radius: 14px; background: var(--q-input-bg); color: var(--q-accent); }
.qx-sc-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.qx-sc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.qx-sc-body small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--q-accent); }
.qx-sc-body strong { font-family: 'Poppins', sans-serif; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qx-sc-sub { font-size: 12px; color: var(--q-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qx-sc-bar { display: block; height: 4px; border-radius: 4px; background: var(--q-input-bg); margin-top: 6px; overflow: hidden; }
.qx-sc-bar span { display: block; height: 100%; background: var(--q-accent); border-radius: 4px; }
.qx-sc-go { font-size: 18px; color: var(--q-text-secondary); transition: transform .15s; }
.qx-sc:hover .qx-sc-go { transform: translateX(-3px); color: var(--q-accent); }

/* AI results */
.qx-ai { margin: -6px 0 26px; padding: 18px; border-radius: 20px; border: 1px solid var(--q-border); background: var(--q-card); scroll-margin-top: 90px; }
.qx-ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qx-ai-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--q-accent); flex: 0 0 auto; }
.qx-ai-q { font-size: 15px; font-weight: 600; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qx-ai-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--q-input-bg); color: var(--q-text); cursor: pointer; flex: 0 0 auto; }

/* Tabs + reading settings */
.qx-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--q-border); margin-bottom: 16px; }
.qx-bar .q-index-tabs { border-bottom: 0; margin-bottom: 0; flex: 0 1 auto; min-width: 0; }
.qx-prefs { display: flex; gap: 8px; padding-bottom: 8px; min-width: 0; }
.qx-pref { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; min-width: 0; padding: 7px 12px 7px 10px; font: 600 12px/1.2 'Inter', sans-serif; color: var(--q-text); background: var(--q-card); border: 1px solid var(--q-border); border-radius: 999px; cursor: pointer; transition: border-color .15s; }
.qx-pref:hover { border-color: var(--q-accent); }
.qx-pref > svg:first-child { color: var(--q-accent); flex: 0 0 auto; }
.qx-pref > svg:last-child { opacity: .55; flex: 0 0 auto; }
.qx-pref-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Filters */
.qx-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.qx-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--q-input-bg); border: 1px solid var(--q-border); }
.qx-f { font: 600 12px/1 'Inter', sans-serif; color: var(--q-text-secondary); padding: 8px 12px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; }
.qx-f.active { background: var(--q-card); color: var(--q-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.qx-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--q-text-secondary); }
.qx-sort select { font: 600 12px 'Inter', sans-serif; color: var(--q-text); background: var(--q-card); border: 1px solid var(--q-border); border-radius: 10px; padding: 7px 10px 7px 28px; cursor: pointer; }

/* Surah rows */
.qx-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qx-row { position: relative; display: flex; align-items: stretch; border: 1px solid var(--q-border); border-radius: 16px; background: var(--q-card); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.qx-row[hidden] { display: none; }
.qx-row:hover { border-color: var(--q-highlight-border, var(--q-accent)); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); }
.qx-row .surah-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: none; border: 0; border-radius: 16px; box-shadow: none; color: inherit; text-decoration: none; transform: none; }
.qx-row .surah-card:hover { background: none; box-shadow: none; }
.qx-row .surah-card:focus-visible { outline: 2px solid var(--q-accent); outline-offset: -2px; }
.qx-num { position: relative; width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: var(--q-input-bg); font: 600 13px 'Poppins', sans-serif; color: var(--q-accent); }
.qx-row { --p: 0; }
.qx-row.is-partial .qx-num { background: conic-gradient(color-mix(in srgb, var(--q-accent) 32%, var(--q-input-bg)) calc(var(--p) * 1%), var(--q-input-bg) 0); }
.qx-row.is-done .qx-num { background: var(--q-accent); color: #fff; }
.qx-names { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.qx-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qx-mean { font-size: 12px; color: var(--q-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qx-right { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; gap: 1px; }
.qx-ar { font-family: 'Amiri', serif; font-size: 20px; line-height: 1.25; color: var(--q-text); }
.qx-meta { font-size: 11px; color: var(--q-text-secondary); white-space: nowrap; }
.qx-acts { display: flex; align-items: center; gap: 2px; padding-left: 8px; }
.qx-act { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--q-text-secondary); cursor: pointer; opacity: .55; transition: opacity .15s, background .15s, color .15s; }
.qx-act svg { width: 16px; height: 16px; }
.qx-row:hover .qx-act, .qx-act:focus-visible { opacity: 1; }
.qx-act:hover { background: var(--q-input-bg); color: var(--q-accent); }
.qx-act.is-busy { opacity: 1; color: var(--q-accent); pointer-events: none; }
.qx-act.is-busy svg { animation: qxPulse 1s ease-in-out infinite; }
@keyframes qxPulse { 50% { transform: translateY(2px); opacity: .5; } }
.qx-empty { padding: 28px 16px; text-align: center; color: var(--q-text-secondary); border: 1px dashed var(--q-border); border-radius: 16px; margin-bottom: 12px; }
.qx-empty p { margin: 0 0 12px; }
.qx-empty-ai { display: inline-flex; align-items: center; gap: 8px; font: 600 13px 'Inter', sans-serif; color: #fff; background: var(--q-accent); border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; }
.qx-empty-ai svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Juz */
.qx-juz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.qx-juz { display: flex; gap: 12px; align-items: flex-start; text-align: right; font: inherit; color: var(--q-text); padding: 14px; border: 1px solid var(--q-border); border-radius: 16px; background: var(--q-card); cursor: pointer; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.qx-juz:hover { border-color: var(--q-accent); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); }
.qx-juz-n { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 12px; background: var(--q-input-bg); color: var(--q-accent); font: 700 15px 'Poppins', sans-serif; }
.qx-juz-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.qx-juz-body strong { font-size: 14px; }
.qx-juz-range { font-size: 12px; color: var(--q-text-secondary); }
.qx-juz-surahs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.qx-juz-surahs span { font-size: 11px; padding: 3px 7px; border-radius: 6px; background: var(--q-input-bg); color: var(--q-text-secondary); }
.qx-juz-surahs .qx-juz-more { font-weight: 700; }
.qx-juz-bar { display: block; height: 3px; border-radius: 3px; background: var(--q-input-bg); margin-top: 6px; overflow: hidden; }
.qx-juz-bar span { display: block; height: 100%; background: var(--q-accent); }

/* My Qur'an */
.qx-stats { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 14px 0 26px; }
.qx-stat { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--q-border); border-radius: 16px; background: var(--q-card); }
.qx-stat-k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--q-text-secondary); }
.qx-stat-v { font-size: 13px; color: var(--q-text-secondary); }
.qx-stat-big { font-size: 13px; color: var(--q-text-secondary); }
.qx-stat-big strong { font: 700 26px 'Poppins', sans-serif; color: var(--q-text); }
.qx-progress { height: 8px; border-radius: 8px; background: var(--q-input-bg); overflow: hidden; }
.qx-progress span { display: block; height: 100%; width: 0; background: var(--q-accent); border-radius: 8px; transition: width .4s; }
.qx-h2 { font: 600 1.05rem 'Poppins', sans-serif; margin: 6px 0 12px; scroll-margin-top: 90px; }
#index-panel-mine .index-bookmark-grid { margin-bottom: 26px; }

/* Toast */
.qx-toast { position: fixed; right: 50%; bottom: 28px; transform: translate(50%, 20px); opacity: 0; pointer-events: none; z-index: 400; padding: 12px 18px; border-radius: 14px; background: #2c2318; color: #fff; font: 600 13px 'Inter', sans-serif; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.qx-toast.is-on { opacity: 1; transform: translate(50%, 0); }
.qx-toast.is-error { background: #9b2c2c; }

/* Text size inside the settings panel */
.qx-typo-slot:empty { display: none; }
.qx-typo-slot { margin-bottom: 14px; }
.q-type-popup.qx-typo-inline { position: static; width: auto; max-width: none; transform: none; box-shadow: none; animation: none; padding: 16px 18px; border-radius: 16px; background: var(--q-input-bg); z-index: auto; }
.qx-typo-inline .q-type-popup-close { display: none; }
.qx-typo-inline .q-type-popup-head { margin-bottom: 12px; }
.qx-typo-inline .q-type-control { margin-bottom: 12px; }

@media (max-width: 860px) {
    .qx-list { grid-template-columns: 1fr; }
    .qx-bar { flex-direction: column; align-items: stretch; gap: 0; }
    .qx-prefs { padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
    .qx-pref { max-width: 60%; flex: 0 1 auto; }
}
@media (max-width: 640px) {
    .qx-smart.has-two { grid-template-columns: 1fr; }
    .qx-search input { height: 52px; font-size: 16px; padding-left: 52px; }
    .qx-kbd { display: none; }
    .qx-stats { grid-template-columns: 1fr; }
    .qx-filters { flex-direction: column; align-items: stretch; }
    .qx-seg { justify-content: space-between; }
    .qx-f { flex: 1; padding: 9px 6px; }
    .qx-sort { justify-content: space-between; }
    .qx-acts { padding-left: 4px; }
    .qx-act { opacity: .8; }
    .qx-row .surah-card { padding: 10px; gap: 10px; }
    .qx-index-tab, .qx-tabs .q-index-tab { padding: 10px 12px; }
}
.qx-clear[hidden] { display: none; }
.qx-smart.is-off { display: none; }

/* ── index layout (round 55): a wider page, AI badge in the search, popular surahs under the list ── */
.q-main-inner:has(> #surah-list-view:not(.hidden)) { max-width: 1240px; }
.qx .qx-head { margin-bottom: 22px; }
.qx-ai-badge { position: absolute; left: 12px; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px;
    background: color-mix(in srgb, var(--q-accent) 14%, transparent); color: var(--q-accent); font: 700 12px/1 'Inter', sans-serif; letter-spacing: .04em; cursor: pointer; transition: background .15s, color .15s; }
.qx-ai-badge:hover { background: var(--q-accent); color: #fff; }
.qx-ai-badge svg { flex: none; }
.qx-search input:not(:placeholder-shown) ~ .qx-ai-badge { display: none; }
.qx-search input#qx-q { padding-inline-end: 84px; }
.qx-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: end; gap: 16px 32px; margin-bottom: 22px; }
.qx-top .qx-head { margin-bottom: 0; }
.qx-top .qx-smart { margin: 0; grid-template-columns: 1fr; }
.qx-top:not(:has(.qx-smart:not([hidden]))) { grid-template-columns: 1fr; }
@media (max-width: 860px) { .qx-top { grid-template-columns: 1fr; } }
.qx-search { margin-bottom: 26px; }
.qx-smart:empty { display: none; }
.qx-popular { margin-top: 36px; }
.qx-popular .qx-chips { flex-wrap: wrap; overflow: visible; margin: 0; }
.qx-popular .qx-chip { padding: 10px 16px; background: var(--q-card); }
@media (min-width: 1180px) { .qx-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* reciter photos in the settings sidebar + link to the reciters page */
.qp-reciter-item { justify-content: flex-start; gap: 12px; padding: 10px 14px; }
.qp-reciter-item .qp-reciter-name { flex: 1; min-width: 0; }
.qp-reciter-av { flex: none; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--q-input-bg); }
.qp-reciter-av.is-ini { display: grid; place-items: center; background: hsl(var(--h) 38% 46%); color: #fff; font: 700 12px/1 'Inter', sans-serif; }
.qp-reciter-item.active .qp-reciter-av { box-shadow: 0 0 0 2px var(--q-accent); }
.qp-reciters-all { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 4px 4px; padding: 11px 14px; border-radius: 14px; border: 1px dashed var(--q-border); color: var(--q-accent); font: 600 13px 'Inter', sans-serif; text-decoration: none; }
.qp-reciters-all svg { transform: scaleX(-1); }
.qp-reciters-all:hover { border-style: solid; border-color: var(--q-accent); }

/* ── index hero + feature cards (round 57) ── */
.qx-hero { position: relative; z-index: 20; margin: 0 0 18px; padding: 34px 28px 28px; border-radius: 28px; text-align: center; border: 1px solid var(--q-border);
    background:
        radial-gradient(circle at 50% -30%, color-mix(in srgb, var(--q-accent) 22%, transparent), transparent 65%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23a07a4a' stroke-opacity='.16' stroke-width='1'%3E%3Crect x='16' y='16' width='24' height='24'/%3E%3Crect x='16' y='16' width='24' height='24' transform='rotate(45 28 28)'/%3E%3Ccircle cx='28' cy='28' r='5'/%3E%3C/g%3E%3C/svg%3E"),
        var(--q-card); }
.qx-hero-star { display: block; width: 52px; height: 52px; margin: 0 auto 6px; color: var(--q-accent); }
.qx-hero .qx-head { margin: 0 auto 22px; max-width: 680px; text-align: center; }
.qx-hero-ar { margin: 0 0 2px; font: 400 20px/1.4 'Amiri', 'Noto Naskh Arabic', serif; color: var(--q-accent); text-align: center; }
.qx-hero .q-welcome-title { margin: 0; }
.qx-hero .q-welcome-subtitle { margin: 8px auto 0; max-width: 560px; }
.qx-hero .qx-search { max-width: 760px; margin: 0 auto; text-align: start; }
.qx-hero .qx-search input { background: var(--q-bg, var(--q-input-bg)); }

.qx-feats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 34px; }
.qx-fc { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px; border-radius: 20px; border: 1px solid var(--q-border); background: var(--q-card);
    color: var(--q-text); font: inherit; text-align: start; text-decoration: none; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.qx-fc:hover { border-color: var(--q-accent); transform: translateY(-2px); box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .35); }
.qx-fc:not(.qx-fc-cont) { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qx-fc:not(.qx-fc-cont) .qx-fc-go { display: block; }
.qx-fc-cont { grid-column: span 2; background: color-mix(in srgb, var(--q-card) 82%, var(--q-accent) 18%); }
.qx-fc-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.qx-fc-t small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--q-accent); }
.qx-fc-t strong { font: 600 15px/1.25 'Poppins', sans-serif; }
.qx-fc-cont .qx-fc-t strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qx-fc-sub { font-size: 12px; line-height: 1.35; color: var(--q-text-secondary); }
.qx-fc-bar { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: color-mix(in srgb, var(--q-accent) 18%, transparent); overflow: hidden; }
.qx-fc-bar[hidden] { display: none; }
.qx-fc-bar span { display: block; height: 100%; border-radius: 4px; background: var(--q-accent); }
.qx-fc-play { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--q-accent); color: #fff; }
.qx-fc-play svg { width: 20px; height: 20px; fill: currentColor; }
.qx-fc-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--q-input-bg); color: var(--q-accent); }
.qx-fc-ic svg { width: 20px; height: 20px; }
.qx-fc-avs { flex: none; display: flex; }
.qx-fc-avs img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--q-card); }
.qx-fc-avs img + img { margin-inline-start: -12px; }
.qx-fc-go { position: absolute; top: 12px; inset-inline-end: 12px; display: none; }
.qx-fc-go svg { transform: scaleX(-1); width: 14px; height: 14px; color: var(--q-text-secondary); }
@media (max-width: 1180px) {
    .qx-feats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .qx-fc-cont { grid-column: span 3; }
}
@media (max-width: 640px) {
    .qx-hero { padding: 24px 14px 16px; border-radius: 22px; }
    .qx-hero-star { width: 40px; height: 40px; }
    .qx-feats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .qx-fc-cont { grid-column: span 2; }
    .qx-fc { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
    .qx-fc-cont { flex-direction: row; align-items: center; }
    .qx-fc:not(.qx-fc-cont) .qx-fc-sub { display: none; }
    .qx-fc-go { display: block; }
}
/* Arabic page: the title is already "القرآن الكريم" */
html[lang="ar"] .qx-hero-ar { display: none; }

/* ── facts + FAQ under the list (round 59) ── */
.qx-info { margin: 48px 0 0; padding-top: 32px; border-top: 1px solid var(--q-border); }
.qx-info-h { margin: 0 0 16px; font: 600 1.35rem 'Poppins', sans-serif; color: var(--q-text); }
.qx-facts { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.qx-facts li { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px; border-radius: 18px; border: 1px solid var(--q-border); background: var(--q-card); }
.qx-facts b { font: 700 1.9rem/1 'Space Grotesk', 'Poppins', sans-serif; color: var(--q-accent); font-variant-numeric: tabular-nums; }
.qx-facts span { font-size: 13px; line-height: 1.4; color: var(--q-text-secondary); }
.qx-faq { display: grid; gap: 10px; max-width: 900px; }
.qx-faq details { border-radius: 16px; border: 1px solid var(--q-border); background: var(--q-card); }
.qx-faq summary { position: relative; padding: 16px 18px 16px 48px; font-weight: 600; font-size: 15px; color: var(--q-text); cursor: pointer; list-style: none; }
.qx-faq summary::-webkit-details-marker { display: none; }
.qx-faq summary::after { content: '+'; position: absolute; top: 50%; left: 18px; transform: translateY(-50%); font-size: 20px; font-weight: 400; color: var(--q-accent); transition: transform .2s; }
.qx-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.qx-faq p { margin: 0; padding: 0 18px 18px; font-size: 14.5px; line-height: 1.7; color: var(--q-text-secondary); }
@media (max-width: 1180px) { .qx-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .qx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qx-facts b { font-size: 1.6rem; } }

/* surah list: the whole page scrolls (scrollbar at the window edge, as on every page); the surah reader keeps its own scroll area */
body.quran-page.qx-doc { height: auto; min-height: 100dvh; overflow-x: clip; overflow-y: visible; }
body.qx-doc .q-topnav { position: sticky; top: 0; }
body.qx-doc .q-main { flex: none; overflow: visible; }
@media (min-width: 768px) {
    body.qx-doc.sidebar-mini:not(.sidebar-open) main { margin-left: 0 !important; padding-left: 75px !important; }
}

/* round 122: the platform's header (fixed, 64px) instead of the old top bar; no left surah panel */
body.quran-page .q-main { padding-top: 64px; }
html:has(body.quran-page) { scroll-padding-top: 84px; }
body.quran-page .q-ayah, body.quran-page [id^="ayah-"] { scroll-margin-top: 84px; }
#surah-sidebar, #quran-topnav { display: none !important; }
#mobile-toolbar-wrapper .q-theme-switcher { display: none !important; }
.q-reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 18px; }
.q-reader-back, .q-reader-set { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--t-border, rgba(0,0,0,.12)); background: transparent; color: var(--t-text, #1e293b); font: 600 13.5px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.q-reader-back:hover, .q-reader-set:hover { border-color: var(--t-accent, #8c7355); color: var(--t-accent, #8c7355); }
.q-reader-back svg, .q-reader-set svg { flex: none; }
[dir="rtl"] .q-reader-back svg { transform: scaleX(-1); }
@media (max-width: 560px) { .q-reader-set span { display: none; } .q-reader-set { width: 38px; padding: 0; justify-content: center; } }
body.quran-page .q-sidebar { z-index: 1300; } body.quran-page .q-backdrop { z-index: 1250; }
body.quran-page .q-sidebar:not(.open) { visibility: hidden; transition: transform .3s, visibility 0s .3s; }
body.quran-page .q-sidebar-right { left: 0 !important; }

/* round 126: a compact surah header — the bar: All surahs · view modes · settings; the title block below it */
.q-reader-bar { position: relative; margin: 0 0 22px; }
.q-reader-bar .q-view-toggle { margin: 0; gap: 2px; padding: 3px; border-radius: 12px; }
.q-reader-bar .q-view-btn { padding: 7px 12px; font-size: 13px; }
.q-reader-bar .q-view-btn svg { width: 15px; height: 15px; }
.q-reader-set { width: 38px; padding: 0 !important; justify-content: center; }
.q-reader-set span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.q-surah-header { margin-bottom: 26px; padding-top: 0; }
.q-surah-header .q-surah-title-ar { order: 1; font-size: clamp(2.4rem, 6vw, 3.2rem); line-height: 1.25; margin: 0 0 4px; }
.q-surah-header .q-surah-title-en { order: 2; font-size: clamp(1.15rem, 3vw, 1.4rem); margin: 0; letter-spacing: 0; }
.q-surah-header .q-surah-title-translation { order: 3; margin: 2px 0 0; font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 500; opacity: .75; }
.q-surah-header .q-surah-badge { order: 4; margin: 10px 0 0; padding: 0; border: 0; background: none; box-shadow: none; gap: 10px; }
.q-surah-header .q-surah-badge span { font-size: 11px; letter-spacing: .14em; opacity: .55; }
.q-surah-header .q-badge-dot { width: 4px; height: 4px; }
.q-bismillah { margin-bottom: 36px; }
.q-bismillah-line { margin-bottom: 22px; }
@media (max-width: 560px) {
    .q-reader-bar { flex-wrap: wrap; row-gap: 12px; }
    .q-reader-bar .q-view-toggle { order: 3; width: 100%; }
    .q-reader-bar .q-view-btn { flex: 1; justify-content: center; padding: 8px 6px; }
}
@media (max-width: 560px) { .q-reader-bar .q-view-btn span { display: inline !important; } }

/* round 127: the view modes — quiet text tabs, right next to the settings button */
.q-reader-bar .q-view-toggle { margin-inline-start: auto; background: none; border: 0; padding: 0; gap: 2px; box-shadow: none; }
.q-reader-bar .q-view-btn { height: 36px; padding: 0 13px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--q-text-secondary, #8c7355); opacity: 1; }
.q-reader-bar .q-view-btn svg { display: none; }
.q-reader-bar .q-view-btn:hover { background: color-mix(in srgb, var(--q-accent, #8c7355) 8%, transparent); color: var(--q-text, #433422); }
.q-reader-bar .q-view-btn.active { background: color-mix(in srgb, var(--q-accent, #8c7355) 14%, transparent); color: var(--q-accent, #8c7355); font-weight: 650; }
.q-reader-bar .q-reader-set { margin-inline-start: 6px; }
@media (max-width: 560px) {
    .q-reader-bar .q-view-toggle { margin-inline-start: 0; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--q-text, #433422) 5%, transparent); }
    .q-reader-bar .q-view-btn { height: 34px; }
}

/* round 128: the view mode as a drop-down (current mode + icon; the three modes in a small menu) */
.q-reader-bar .q-view-dd { position: relative; margin-inline-start: auto; }
.q-view-dd-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--t-border, rgba(0,0,0,.12)); background: transparent; color: var(--q-text, #433422); font: 600 13.5px Inter, system-ui, sans-serif; cursor: pointer; }
.q-view-dd-btn:hover, .q-view-dd.is-open .q-view-dd-btn { border-color: var(--q-accent, #8c7355); color: var(--q-accent, #8c7355); }
.q-view-dd-btn svg { width: 16px; height: 16px; flex: none; }
.q-view-dd-btn .q-view-dd-chev { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
.q-view-dd.is-open .q-view-dd-chev { transform: rotate(180deg); }
.q-reader-bar .q-view-dd .q-view-toggle { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 40; display: flex; flex-direction: column; gap: 2px; min-width: 190px; margin: 0; padding: 6px; border-radius: 14px; background: var(--q-card, #fff); border: 1px solid var(--q-border, rgba(0,0,0,.1)); box-shadow: 0 14px 34px -14px rgba(0,0,0,.35); }
.q-reader-bar .q-view-dd .q-view-toggle[hidden] { display: none; }
.q-reader-bar .q-view-dd .q-view-btn { width: 100%; height: 38px; justify-content: flex-start; gap: 10px; padding: 0 12px; border-radius: 9px; font-size: 14px; }
.q-reader-bar .q-view-dd .q-view-btn svg { display: inline-block !important; width: 16px; height: 16px; }
.q-reader-bar .q-view-dd .q-view-btn span { display: inline !important; }
@media (max-width: 560px) {
    .q-reader-bar { flex-wrap: nowrap; }
    .q-reader-bar .q-view-dd .q-view-toggle { order: 0; width: auto; background: var(--q-card, #fff); padding: 6px; }
    .q-reader-bar .q-view-dd .q-view-btn { flex: none; }
}

/* reader: link to the surah's own page (round 158) */
.q-surah-header .q-surah-page { order: 4; display: inline-flex; align-items: center; gap: 6px; margin: 8px auto 0; font-size: 12.5px; font-weight: 500; color: var(--t-text-secondary); text-decoration: none; opacity: .85; }
.q-surah-header .q-surah-page::before { content: 'i'; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1.3px solid currentColor; font: 700 10px/1 Georgia, serif; }
.q-surah-header .q-surah-page:hover { text-decoration: underline; }
.q-surah-header .q-surah-page[hidden] { display: none; }
