:root {
    --rq-green: #0d5f46;
    --rq-gold: #c9a24d;
    --rq-ink: #15211c;
    --rq-muted: #66746e;
    --rq-soft: #f5f8f4;
    --rq-line: #dfe9e3;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--rq-ink);
    background: #fff;
}

.rq-nav {
    border-bottom: 1px solid rgba(13, 95, 70, 0.12);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--rq-green);
    border-radius: 8px;
}

.nav-link {
    color: #24332e;
    font-weight: 700;
    font-size: 0.94rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--rq-green);
}

.section-pad {
    padding: 4.5rem 0;
}

.soft-band {
    background: var(--rq-soft);
}

.lead {
    color: var(--rq-muted);
    line-height: 1.72;
}

.search-shell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 54px;
    padding: 0 1rem;
    border: 1px solid var(--rq-line);
    border-radius: 8px;
    background: #fff;
}

.search-shell input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    font: inherit;
    background: transparent;
}

.index-meta {
    color: var(--rq-muted);
    font-weight: 700;
}

.surah-card,
.reader-panel {
    border: 1px solid var(--rq-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(21, 33, 28, 0.06);
}

.surah-card {
    padding: 1.1rem;
    transition: transform 180ms ease, border-color 180ms ease;
}

.surah-card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 95, 70, 0.4);
}

.surah-card.active {
    border-color: rgba(13, 95, 70, 0.55);
    box-shadow: inset 4px 0 0 var(--rq-green), 0 18px 48px rgba(21, 33, 28, 0.06);
}

.side-list .surah-card.active {
    box-shadow: inset 4px 0 0 var(--rq-green);
}

.surah-number {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--rq-soft);
    color: var(--rq-green);
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    flex: 0 0 auto;
}

.quick-link {
    color: var(--rq-green);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
}

.quick-link:hover {
    color: #084936;
    text-decoration: underline;
}

.quran-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.quran-mode-tabs .btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(21, 33, 28, 0.05);
}

.quran-mode-tabs .btn-rq,
.quran-mode-tabs .btn-rq:hover,
.quran-mode-tabs .btn-rq:focus {
    color: #fff;
    background: var(--rq-green);
    border-color: var(--rq-green);
}

.quran-mode-tabs .btn-outline-rq,
.quran-mode-tabs .btn-outline-rq:hover,
.quran-mode-tabs .btn-outline-rq:focus {
    color: var(--rq-green);
    background: #fff;
    border-color: rgba(13, 95, 70, 0.35);
}

.juz-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.juz-card {
    min-height: 156px;
    color: var(--rq-ink);
    text-decoration: none;
}

.juz-card:hover {
    color: var(--rq-ink);
}

.juz-card.khatam-card {
    background: linear-gradient(135deg, #fff, #f7fbf6);
    border-color: rgba(201, 162, 77, 0.45);
}

.juz-label {
    color: var(--rq-green);
    font-size: 0.95rem;
    font-weight: 900;
}

.juz-name {
    color: var(--rq-green);
    font-size: 1.15rem;
    font-weight: 800;
}

.juz-range {
    color: var(--rq-muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.juz-surah-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin: 1.25rem 0 0.5rem;
    border: 1px solid var(--rq-line);
    border-radius: 8px;
    background: var(--rq-soft);
}

.btn-rq {
    --bs-btn-bg: var(--rq-green);
    --bs-btn-border-color: var(--rq-green);
    --bs-btn-hover-bg: #084936;
    --bs-btn-hover-border-color: #084936;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    font-weight: 800;
}

.btn-outline-rq {
    --bs-btn-color: var(--rq-green);
    --bs-btn-border-color: rgba(13, 95, 70, 0.35);
    --bs-btn-hover-bg: var(--rq-green);
    --bs-btn-hover-border-color: var(--rq-green);
    --bs-btn-hover-color: #fff;
    font-weight: 800;
}

.load-sentinel,
.empty-state {
    border: 1px dashed rgba(13, 95, 70, 0.25);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    color: var(--rq-muted);
    background: rgba(255, 255, 255, 0.74);
}

.side-list {
    max-height: 560px;
    overflow: auto;
    display: grid;
    gap: 0.75rem;
    padding-right: 0.35rem;
    padding-bottom: 3rem;
    scrollbar-color: rgba(13, 95, 70, 0.45) rgba(13, 95, 70, 0.08);
    scrollbar-width: thin;
}

.side-list::-webkit-scrollbar {
    width: 8px;
}

.side-list::-webkit-scrollbar-track {
    background: rgba(13, 95, 70, 0.08);
    border-radius: 999px;
}

.side-list::-webkit-scrollbar-thumb {
    background: rgba(13, 95, 70, 0.45);
    border-radius: 999px;
}

.side-list-wrap {
    position: relative;
}

.scroll-list-note {
    position: sticky;
    top: 84px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    margin: 0 0 0.75rem;
    padding: 0.45rem 0.7rem;
    color: var(--rq-green);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(13, 95, 70, 0.2);
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(21, 33, 28, 0.08);
    font-size: 0.86rem;
    font-weight: 800;
}

.side-list-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0.4rem;
    bottom: 0;
    height: 74px;
    pointer-events: none;
    border-radius: 0 0 8px 8px;
    background: linear-gradient(to bottom, rgba(245, 248, 244, 0), #f5f8f4 84%);
    opacity: 1;
    transition: opacity 180ms ease;
}

.side-list-wrap:not(.is-scrollable)::after,
.side-list-wrap.is-scroll-end::after {
    opacity: 0;
}

.side-list .surah-card {
    box-shadow: none;
}

.label {
    color: var(--rq-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.verse {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 1rem;
    border-top: 1px solid var(--rq-line);
    padding: 1.55rem 0;
}

.verse:first-child {
    border-top: 0;
    padding-top: 0;
}

.verse-ref {
    color: var(--rq-gold);
    font-weight: 800;
}

.verse-topline {
    grid-column: 1 / -1;
}

.verse-body {
    grid-column: 1 / -1;
}

.bookmarks-page-list {
    display: grid;
    gap: 1rem;
}

.bookmark-page-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem;
    color: var(--rq-ink);
    text-decoration: none;
    border: 1px solid var(--rq-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(21, 33, 28, 0.06);
}

.bookmark-page-item:hover {
    color: var(--rq-ink);
    border-color: rgba(13, 95, 70, 0.35);
}

.bookmark-page-ref {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    color: var(--rq-green);
    background: var(--rq-soft);
    border-radius: 8px;
    font-weight: 800;
}

.bookmark-page-arabic {
    color: var(--rq-green);
    font-family: "Amiri", "Times New Roman", serif;
    direction: rtl;
    text-align: right;
    font-size: clamp(1.8rem, 3vw, 2.75rem);
    line-height: 1.65;
}

.bookmark-button.is-bookmarked {
    color: #fff;
    background: var(--rq-green);
    border-color: var(--rq-green);
}

.bookmark-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    border-radius: 8px;
    color: #fff;
    background: var(--rq-green);
    padding: 0.75rem 1rem;
    box-shadow: 0 18px 48px rgba(21, 33, 28, 0.16);
}

.arabic {
    font-family: "Amiri", "Times New Roman", serif;
    direction: rtl;
    text-align: right;
    color: var(--rq-green);
    font-size: clamp(2.1rem, 4vw, 4rem);
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.tafsir-introduction,
.tafsir-commentary {
    border: 1px solid rgba(13, 95, 70, 0.14);
    border-radius: 8px;
    background: var(--rq-soft);
}

.tafsir-ayah {
    border-top: 1px solid var(--rq-line);
    padding: 2rem 0;
}

.tafsir-ayah:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.tafsir-arabic {
    font-size: clamp(2rem, 3.5vw, 3.25rem);
}

.tafsir-translation {
    color: #26352f;
    font-size: 1.05rem;
    line-height: 1.75;
}

.tafsir-copy {
    color: #26352f;
    line-height: 1.78;
}

.tafsir-copy p:last-child {
    margin-bottom: 0;
}

.is-hidden-layer {
    display: none;
}

.scroll-target {
    scroll-margin-top: 96px;
}

@media (max-width: 767.98px) {
    .section-pad {
        padding: 2.75rem 0;
    }

    .juz-grid {
        grid-template-columns: 1fr;
    }

    .juz-card.khatam-card {
        grid-column: auto;
    }

    .juz-surah-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .reader-panel {
        padding: 1rem !important;
    }

    .verse {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .arabic {
        font-size: 2.15rem;
    }
}
