@font-face {
            font-family: "Ebook Nastaliq";
            src: url("../fonts/ebook/NotoNastaliqUrdu.woff2") format("woff2");
            font-style: normal;
            font-weight: 400 700;
            font-display: swap;
        }

        @font-face {
            font-family: "Ebook Naskh";
            src: url("../fonts/ebook/NotoNaskhArabic.woff2") format("woff2");
            font-style: normal;
            font-weight: 400 700;
            font-display: swap;
        }

        :root {
            --reader-green: #17251d;
            --reader-gold: #c9a257;
            --reader-paper: #fffaf0;
            --reader-wash: #efe7d8;
            --reader-ink: #1f211a;
            --reader-muted: #6f6757;
        }

        * { box-sizing: border-box; }

        body {
            margin: 0;
            background: var(--reader-wash);
            color: var(--reader-ink);
            font-family: "Ebook Nastaliq", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", Tahoma, Arial, sans-serif;
            direction: rtl;
            text-align: right;
        }

        a:hover { text-decoration: none; }

        .reader-page {
            min-height: 100vh;
            display: grid;
            grid-template-columns: 370px minmax(0, 1fr);
            background:
                radial-gradient(circle at 14% 8%, rgba(201, 162, 87, .14), transparent 28rem),
                linear-gradient(135deg, #f4ead8 0%, #efe7d8 48%, #f9f3e7 100%);
        }

        .chapter-rail {
            position: sticky;
            top: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            padding: 28px 24px 0;
            background: var(--reader-green);
            color: #fff5df;
            border-left: 1px solid rgba(201, 162, 87, .28);
        }

        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 30px;
            color: #dec88d;
            font-weight: 900;
        }

        .reader-title span {
            display: block;
            color: var(--reader-gold);
            font-size: .84rem;
            font-weight: 900;
            line-height: 1.7;
        }

        .reader-title h1 {
            margin: 8px 0 8px;
            color: #fff8e8;
            font-size: 1.65rem;
            font-weight: 900;
            line-height: 1.45;
        }

        .reader-title p {
            margin: 0 0 22px;
            color: #f0dfb5;
            font-size: .94rem;
            font-weight: 700;
            line-height: 1.9;
        }

        .reader-search {
            height: 48px;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 18px;
            padding: 0 14px;
            border: 1px solid rgba(255, 255, 255, .11);
            border-radius: 8px;
            background: rgba(255, 255, 255, .06);
        }

        .reader-search i { color: var(--reader-gold); }

        .reader-search input {
            min-width: 0;
            width: 100%;
            border: 0;
            outline: 0;
            background: transparent;
            color: #fff8e8;
            font: inherit;
            font-size: .9rem;
            font-weight: 800;
        }

        .reader-search input::placeholder { color: rgba(255, 245, 223, .58); }

        .toc-count {
            display: block;
            margin: 0 0 12px;
            color: #dec88d;
            font-size: .8rem;
            font-weight: 900;
        }

        .toc-list {
            display: grid;
            flex: 1;
            min-height: 0;
            align-content: start;
            grid-auto-rows: max-content;
            gap: 8px;
            padding-bottom: 24px;
            overflow-y: auto;
            scrollbar-color: #c9a257 rgba(255, 255, 255, .05);
            scrollbar-width: thin;
        }

        .toc-list::-webkit-scrollbar,
        .quran-modal-panel::-webkit-scrollbar {
            width: 9px;
        }

        .toc-list::-webkit-scrollbar-track {
            border-radius: 999px;
            background: rgba(255, 255, 255, .06);
        }

        .toc-list::-webkit-scrollbar-thumb,
        .quran-modal-panel::-webkit-scrollbar-thumb {
            min-height: 46px;
            border: 2px solid transparent;
            border-radius: 999px;
            background: linear-gradient(180deg, #d7b66f, #b98b39) padding-box;
        }

        .toc-list::-webkit-scrollbar-thumb:hover,
        .quran-modal-panel::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #e2c682, #c79a45) padding-box;
        }

        .toc-list::-webkit-scrollbar-button,
        .quran-modal-panel::-webkit-scrollbar-button {
            width: 0;
            height: 0;
            display: none;
        }

        .chapter-btn {
            width: 100%;
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            align-items: start;
            min-height: 54px;
            border: 1px solid rgba(255, 255, 255, .08);
            border-radius: 8px;
            background: rgba(255, 255, 255, .04);
            color: #f6eddc;
            cursor: pointer;
            padding: 11px 12px;
            text-align: right;
            transition: background .16s ease, color .16s ease, transform .16s ease;
        }

        .chapter-btn:hover {
            transform: translateY(-1px);
            background: rgba(255, 255, 255, .075);
        }

        .chapter-btn.active {
            background: #f5e5bd;
            color: #18261d;
        }

        .chapter-btn strong {
            min-width: 0;
            font-size: .92rem;
            font-weight: 900;
            line-height: 1.55;
        }

        .reading-panel {
            min-width: 0;
            padding: 28px min(5vw, 76px);
        }

        .page-tools {
            max-width: 900px;
            height: auto;
            min-height: 66px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 14px;
            margin: 0 auto 22px;
            padding: 10px 14px;
            border: 1px solid rgba(31, 42, 31, .1);
            border-radius: 8px;
            background: rgba(255, 250, 240, .84);
            box-shadow: 0 14px 36px rgba(48, 39, 25, .08);
        }

        .page-tools h2 {
            min-width: 0;
            margin: 0;
            color: var(--reader-green);
            font-size: 1.15rem;
            font-weight: 900;
            line-height: 1.55;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .tool-actions {
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }

        .tool-btn {
            min-height: 42px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 0 13px;
            border: 1px solid #dfd2bf;
            border-radius: 6px;
            background: #fffaf0;
            color: #293d30;
            font-size: .84rem;
            font-weight: 900;
            white-space: nowrap;
        }

        .quran-ebook .page-tools {
            position: sticky;
            top: 12px;
            z-index: 35;
            min-height: 78px;
            justify-content: flex-start;
            overflow: visible;
            padding-block: 7px;
            background: rgba(255, 250, 240, .94);
            backdrop-filter: blur(16px);
        }

        .quran-ebook .page-tools h2 {
            flex: 1 1 auto;
            display: flex;
            align-items: center;
            gap: 11px;
            overflow: visible;
            padding: 5px 4px 11px;
            font-size: 1.2rem;
            line-height: 2.05;
            text-overflow: clip;
        }

        .quran-ebook .current-surah-name {
            min-width: 0;
        }

        .quran-ebook .current-surah-number {
            width: 38px;
            height: 38px;
            display: inline-flex;
            flex: 0 0 38px;
            align-items: center;
            justify-content: center;
            border: 1px solid #d4ad5d;
            border-radius: 50%;
            background: radial-gradient(circle at 34% 28%, #fff7db 0, #f4dfaa 58%, #e7c77d 100%);
            box-shadow: 0 0 0 3px rgba(201, 162, 87, .14), inset 0 1px 0 rgba(255, 255, 255, .8);
            color: #594214;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", serif;
            font-size: .83rem;
            font-weight: 800;
            line-height: 1;
        }

        .quran-view-actions {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            margin-right: 12px;
            direction: ltr;
        }

        .quran-view-btn {
            min-height: 34px;
            padding: 5px 10px;
            border: 1px solid #d8c9af;
            border-radius: 6px;
            background: #fffaf0;
            color: #34443a;
            cursor: pointer;
            font-family: Arial, sans-serif;
            font-size: .72rem;
            font-weight: 700;
            line-height: 1.2;
            white-space: nowrap;
        }

        .quran-view-btn.active {
            border-color: #b88b37;
            background: var(--reader-green);
            color: #fff5df;
        }

        .quran-view-btn:disabled { cursor: wait; opacity: .62; }

        .quran-view-loader[hidden] { display: none; }
        .quran-view-loader {
            position: fixed;
            inset: 0 370px 0 0;
            z-index: 90;
            display: grid;
            place-items: center;
            padding: 24px;
            background:
                radial-gradient(circle at center, rgba(255, 250, 240, .98), rgba(239, 231, 216, .92)),
                rgba(239, 231, 216, .94);
            backdrop-filter: blur(8px);
        }

        .quran-loader-card {
            min-width: min(360px, 90vw);
            padding: 30px 34px 26px;
            border: 1px solid #dec586;
            border-radius: 14px;
            background: rgba(255, 250, 240, .97);
            box-shadow: 0 28px 80px rgba(34, 27, 17, .2);
            color: #17372a;
            text-align: center;
        }

        .quran-loader-emblem {
            position: relative;
            width: 76px;
            height: 76px;
            display: grid;
            place-items: center;
            margin: 0 auto 18px;
            border: 2px solid rgba(201, 162, 87, .28);
            border-radius: 50%;
            background: #f8eac8;
            color: #17372a;
            font-size: 1.5rem;
        }

        .quran-loader-emblem::before {
            content: "";
            position: absolute;
            inset: -7px;
            border: 3px solid transparent;
            border-top-color: #b9872d;
            border-right-color: #d6b466;
            border-radius: 50%;
            animation: quran-loader-spin .85s linear infinite;
        }

        .quran-loader-card strong {
            display: block;
            font-family: "Ebook Nastaliq", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
            font-size: 1.18rem;
            line-height: 2.2;
        }

        .quran-loader-dots {
            display: flex;
            justify-content: center;
            gap: 7px;
            margin-top: 14px;
        }

        .quran-loader-dots i {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #b9872d;
            animation: quran-loader-pulse .9s ease-in-out infinite alternate;
        }

        .quran-loader-dots i:nth-child(2) { animation-delay: .16s; }
        .quran-loader-dots i:nth-child(3) { animation-delay: .32s; }

        @keyframes quran-loader-spin { to { transform: rotate(360deg); } }
        @keyframes quran-loader-pulse { to { transform: translateY(-7px); opacity: .35; } }

        .page-sheet {
            max-width: 900px;
            min-width: 0;
            width: 100%;
            min-height: calc(100vh - 118px);
            display: flex;
            flex-direction: column;
            margin: 0 auto;
            padding: clamp(28px, 6vw, 76px);
            border: 1px solid #eadfc9;
            border-radius: 8px;
            background: var(--reader-paper);
            box-shadow: 0 28px 80px rgba(38, 31, 20, .18);
        }

        .page-sheet h1 {
            margin: 0 0 26px;
            color: #17251d;
            font-size: clamp(2rem, 4.8vw, 3.8rem);
            font-weight: 900;
            line-height: 1.45;
        }

        .book-content {
            min-width: 0;
            overflow-wrap: anywhere;
            color: #34372d;
            font-size: 1.22rem;
            font-weight: 500;
            line-height: 2.7;
        }

        .pdf-page-stack {
            display: grid;
            gap: 18px;
            margin-bottom: 34px;
        }

        .pdf-page-frame {
            overflow: hidden;
            border: 1px solid #e0d1b8;
            border-radius: 8px;
            background: #f8f0df;
            box-shadow: 0 14px 36px rgba(48, 39, 25, .12);
        }

        .pdf-page-frame canvas {
            width: 100%;
            height: auto;
            display: block;
            background: #fff;
        }

        .pdf-loading {
            margin: 0;
            padding: 22px;
            color: #6f5526;
            font-weight: 900;
            text-align: center;
        }

        .source-page-reader { padding: clamp(12px, 3vw, 30px); }
        .source-page-reader .pdf-page-stack { gap: 14px; margin: 0; }
        .source-page-reader .pdf-page-frame { width: 100%; border: 0; border-radius: 0; background: #fff; }
        .source-page-reader .pdf-page-frame.loaded { aspect-ratio: auto !important; }
        .source-page-reader .pdf-page-frame canvas { width: 100%; height: auto; }
        .chapter-title-image { display: block; min-width: 0; width: 100%; overflow: hidden; }
        .chapter-title-image canvas { display: block; width: 100%; height: auto; filter: invert(1); mix-blend-mode: screen; }
        .chapter-btn.active .chapter-title-image canvas { filter: none; mix-blend-mode: normal; }
        .chapter-title-image > span { font-size: .9rem; font-weight: 800; }

        .book-content p {
            margin: 0 0 20px;
            white-space: pre-line;
        }

        .html-ebook .page-sheet { padding: clamp(28px, 5vw, 64px); }
        .html-ebook .ebook-chapter {
            min-width: 0;
            padding: 48px 0 64px;
            border-bottom: 1px solid #e7dcc8;
        }
        .html-ebook .ebook-chapter:first-child { padding-top: 0; }
        .html-ebook .ebook-chapter:last-child { padding-bottom: 0; border-bottom: 0; }
        .html-ebook .ebook-chapter-title {
            margin: 0 0 30px;
            padding-right: 18px;
            border-right: 4px solid var(--reader-gold);
            color: var(--reader-green);
            font-size: 1.62rem;
            font-weight: 700;
            line-height: 2;
        }
        .html-ebook .chapter-blocks > :last-child { margin-bottom: 0; }
        .html-ebook .book-content p {
            color: #25362d;
            font-size: inherit;
            font-weight: 500;
            line-height: inherit;
        }
        .html-ebook .book-content h3 {
            margin: 32px 0 16px;
            color: var(--reader-green);
            font-size: 1.45rem;
            font-weight: 900;
            line-height: 1.8;
        }
        .html-ebook .ayat-block {
            margin: 30px 0;
            padding: 20px 24px;
            border-right: 4px solid var(--reader-gold);
            border-radius: 8px;
            background: #f5ecd8;
        }
        .html-ebook .hadith-block { background: #f3f0e8; border-right-color: #66836b; }
        .html-ebook .ayat-arabic {
            color: #203329;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
            font-size: 1.55rem;
            font-weight: 400;
            line-height: 2.2;
        }
        .html-ebook .ayat-reference {
            margin-top: 12px;
            border-top: 1px solid #dccba9;
            padding-top: 10px;
            color: #80612c;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", serif;
            font-size: .9rem;
            font-weight: 800;
        }
        .html-ebook .ayat-translation { margin-top: 14px; border-top: 1px solid #dccba9; padding-top: 12px; }
        .html-ebook .translation-line { border-right: 3px solid var(--reader-gold); padding-right: 16px; }
        .html-ebook .inline-arabic {
            font-family: "Ebook Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
            font-size: 1.08em;
        }
        .html-ebook .durood-mark {
            display: inline-block;
            margin: 0 .08em;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
            font-size: .81em;
            font-weight: 500;
            line-height: 1;
            vertical-align: .22em;
            white-space: nowrap;
        }
        .quran-ebook .quran-surah-title {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .quran-ebook .surah-number,
        .quran-ebook .toc-surah-number {
            display: inline-flex;
            flex: 0 0 auto;
            align-items: center;
            justify-content: center;
            border: 1px solid rgba(201, 162, 87, .62);
            border-radius: 50%;
            background: #f5e5bd;
            color: #17372a;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", serif;
        }
        .quran-ebook .surah-number { width: 46px; height: 46px; font-size: 1rem; }
        .quran-ebook .surah-basmala {
            position: relative;
            margin: 0 0 30px;
            padding: 22px 58px;
            border-top: 1px solid #dfc98f;
            border-bottom: 1px solid #dfc98f;
            background: linear-gradient(90deg, transparent, rgba(245, 229, 189, .55), transparent);
            text-align: center;
        }
        .quran-ebook .surah-basmala .ayah-code { top: 14px; left: 12px; }
        .quran-ebook .basmala-arabic {
            color: #17372a;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
            font-size: clamp(1.55rem, 2.15vw, 1.95rem);
            font-weight: 500;
            line-height: 2.2;
        }
        .quran-ebook .basmala-translation {
            margin-top: 10px;
            color: #4d493d;
            font-family: "Ebook Nastaliq", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
            font-size: 1rem;
            line-height: 2.25;
        }
        .quran-ebook .quran-ayat-list { display: grid; gap: 22px; }
        .quran-ebook .quran-flow-text {
            padding: 28px 30px;
            border: 1px solid #e3d4b6;
            border-right: 5px solid var(--reader-gold);
            border-radius: 12px;
            background:
                radial-gradient(circle at 8% 8%, rgba(201, 162, 87, .1), transparent 12rem),
                #fffaf0;
            color: #17372a;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
            font-size: clamp(1.65rem, 2.35vw, 2.08rem);
            font-weight: 500;
            line-height: 2.65;
            text-align: justify;
        }
        .quran-ebook .quran-flow-ayah {
            cursor: pointer;
            border-radius: 5px;
            transition: background .15s ease, color .15s ease;
        }
        .quran-ebook .quran-flow-ayah:hover,
        .quran-ebook .quran-flow-ayah:focus-visible {
            outline: none;
            background: rgba(201, 162, 87, .17);
        }
        .quran-ebook .flow-ayah-marker {
            width: 1.9em;
            height: 1.9em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin: 0 .2em;
            border: 1px solid #c99b42;
            border-radius: 50%;
            background: #f7e8c0;
            color: #5e491e;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", serif;
            font-size: .55em;
            font-weight: 800;
            line-height: 1;
            vertical-align: .25em;
        }
        .quran-ebook .quran-ayah-card {
            position: relative;
            overflow: hidden;
            padding: 30px 30px 26px;
            border: 1px solid #e3d4b6;
            border-right: 5px solid var(--reader-gold);
            border-radius: 12px;
            background:
                radial-gradient(circle at 8% 8%, rgba(201, 162, 87, .12), transparent 9rem),
                #fffaf0;
            box-shadow: 0 12px 30px rgba(48, 37, 20, .07);
        }
        .quran-ebook .ayah-code {
            position: absolute;
            top: 14px;
            left: 16px;
            min-width: 42px;
            padding: 3px 9px;
            border: 1px solid #dcc58f;
            border-radius: 999px;
            background: #f6e9c9;
            color: #725721;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", serif;
            font-size: .78rem;
            font-weight: 800;
            direction: ltr;
            text-align: center;
        }
        .quran-ebook .quran-arabic {
            padding: 12px 0 22px;
            color: #17372a;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
            font-size: clamp(1.55rem, 2.2vw, 2rem);
            font-weight: 500;
            line-height: 2.35;
            text-align: center;
        }
        .quran-ebook .quran-translation {
            border-top: 1px solid #e3d4b6;
            padding-top: 18px;
            color: #29372f;
            font-family: "Ebook Nastaliq", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
            font-size: 1.08rem;
            font-weight: 500;
            line-height: 2.45;
            text-align: right;
        }
        .quran-ebook .quran-toc-btn {
            grid-template-columns: 34px minmax(0, 1fr) auto;
            align-items: center;
            gap: 9px;
        }
        .quran-ebook .toc-surah-number { width: 30px; height: 30px; font-size: .72rem; }
        .quran-ebook .quran-toc-btn small { color: #d7c28d; font-size: .7rem; white-space: nowrap; }
        .quran-ebook .quran-toc-btn.active small { color: #5e532f; }
        .quran-source-notice {
            margin-top: 54px;
            padding: 22px;
            border: 1px solid #e3d4b6;
            border-radius: 8px;
            background: #f8f1e4;
            color: #625a4c;
        }
        .quran-source-notice pre { margin: 0; overflow-x: auto; white-space: pre-wrap; font: .72rem/1.7 monospace; }
        .quran-source-notice a { color: #6f521e; text-decoration: underline; }

        .quran-ayah-modal[hidden] { display: none; }
        .quran-ayah-modal {
            position: fixed;
            inset: 0;
            z-index: 100;
            display: grid;
            place-items: center;
            padding: 20px;
            background: rgba(8, 18, 13, .7);
            backdrop-filter: blur(7px);
        }
        .quran-modal-panel {
            position: relative;
            width: min(760px, 100%);
            max-height: min(86vh, 760px);
            overflow-y: auto;
            padding: 36px 34px 30px;
            border: 1px solid #dfc98f;
            border-right: 5px solid var(--reader-gold);
            border-radius: 12px;
            background: #fffaf0;
            box-shadow: 0 34px 90px rgba(0, 0, 0, .35);
            scrollbar-color: #c9a257 #f2e8d6;
            scrollbar-width: thin;
        }
        .quran-modal-panel::-webkit-scrollbar-track {
            border-radius: 999px;
            background: #f2e8d6;
        }
        .quran-modal-header {
            display: grid;
            grid-template-columns: 36px minmax(0, 1fr) 36px;
            align-items: center;
            margin-bottom: 16px;
            direction: rtl;
        }
        .quran-modal-close {
            width: 34px;
            height: 34px;
            grid-column: 1;
            display: grid;
            place-items: center;
            justify-self: center;
            padding: 0;
            border: 1px solid #d8c9af;
            border-radius: 50%;
            background: #f7e8c0;
            color: #26392e;
            cursor: pointer;
            font-size: 1.05rem;
            line-height: 1;
        }
        .quran-modal-close i {
            display: block;
            width: 1em;
            height: 1em;
            line-height: 1;
            text-align: center;
        }
        .quran-modal-code {
            display: inline-flex;
            grid-column: 2;
            justify-self: center;
            margin: 0;
            padding: 3px 10px;
            border: 1px solid #dcc58f;
            border-radius: 999px;
            background: #f6e9c9;
            color: #725721;
            font: 800 .8rem/1.5 "Ebook Naskh", "Noto Naskh Arabic", serif;
            direction: ltr;
        }
        .quran-modal-arabic {
            padding: 8px 8px 24px;
            color: #17372a;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
            font-size: clamp(1.55rem, 3.4vw, 2.15rem);
            font-weight: 500;
            line-height: 2.35;
            text-align: center;
        }
        .quran-modal-translation {
            border-top: 1px solid #e3d4b6;
            padding: 20px 8px 0;
            color: #29372f;
            font-family: "Ebook Nastaliq", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
            font-size: 1.12rem;
            line-height: 2.5;
            text-align: right;
        }
        body.quran-modal-open { overflow: hidden; }
        .html-ebook .footnote-ref {
            display: inline-flex;
            min-width: 1.45em;
            height: 1.45em;
            align-items: center;
            justify-content: center;
            margin: 0 .18em;
            border-radius: 50%;
            background: #e7d3a8;
            color: #5d451a;
            font-family: "Ebook Naskh", serif;
            font-size: .65em;
            font-weight: 800;
            line-height: 1;
            vertical-align: super;
            cursor: help;
        }
        .html-ebook .chapter-divider {
            margin: 30px auto;
            color: #b88d3f;
            font-family: "Ebook Naskh", serif;
            font-size: 1.05rem;
            letter-spacing: .7rem;
            text-align: center;
        }
        .html-ebook .chapter-footnotes {
            margin-top: 34px;
            padding: 20px 24px 12px;
            border-top: 1px solid #dccba9;
            border-radius: 8px;
            background: #faf4e8;
            color: #5a625c;
            font-family: "Ebook Naskh", "Noto Naskh Arabic", serif;
            font-size: .9rem;
            line-height: 2;
        }
        .html-ebook .chapter-footnotes ol { margin: 0; padding-right: 1.5rem; }
        .html-ebook .chapter-footnotes li { padding-right: .35rem; }

        .book-content .bullet-line {
            position: relative;
            padding-right: 1.45rem;
            font-weight: 650;
        }

        .book-content .bullet-line::before {
            content: "•";
            position: absolute;
            right: 0;
            color: #a77727;
            font-weight: 900;
        }

        .book-content blockquote {
            margin: 24px 0;
            padding: 18px 22px;
            border-right: 4px solid var(--reader-gold);
            border-radius: 8px;
            background: #f4ead3;
            color: #26342f;
            font-weight: 700;
        }

        .html-ebook .book-content .poetry-stanza {
            box-sizing: border-box;
            width: min(100%, 760px);
            margin: 32px auto;
            padding: 20px 28px 24px;
            border: 1px solid #dfc995;
            border-radius: 12px;
            background: linear-gradient(135deg, #fff9ed, #f7ecd5);
            box-shadow: 0 8px 24px rgba(112, 83, 35, .06);
            color: #25362d;
            text-align: center;
        }

        .html-ebook .book-content .poetry-stanza::before,
        .html-ebook .book-content .poetry-stanza::after {
            content: "";
            display: block;
            width: 54px;
            height: 1px;
            margin: 0 auto 12px;
            background: var(--reader-gold);
        }

        .html-ebook .book-content .poetry-stanza::after {
            margin: 14px auto 0;
        }

        .html-ebook .book-content .poetry-line {
            font-size: 1.22em;
            font-weight: 650;
            line-height: 2.35;
            overflow-wrap: anywhere;
        }

        .html-ebook .book-content .poetry-line + .poetry-line {
            margin-top: 4px;
        }

        .empty-state {
            color: var(--reader-muted);
            font-size: 1rem;
            font-weight: 800;
        }

        .mobile-reader-bar,
        .drawer-close {
            display: none;
        }

        @media (max-width: 1080px) {
            .reader-page { display: block; }

            .chapter-rail {
                position: fixed;
                inset: 0 0 0 auto;
                z-index: 60;
                width: min(90vw, 370px);
                max-width: 100vw;
                transform: translateX(105%);
                transition: transform .24s ease;
                box-shadow: -28px 0 70px rgba(14, 20, 16, .34);
            }

            .chapter-rail.open { transform: translateX(0); }

            .drawer-close {
                position: absolute;
                top: 18px;
                left: 18px;
                width: 40px;
                height: 40px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                border: 1px solid rgba(255, 255, 255, .1);
                border-radius: 8px;
                background: rgba(255, 255, 255, .06);
                color: #f7ead0;
            }

            .mobile-reader-bar {
                position: sticky;
                top: 0;
                z-index: 30;
                display: grid;
                grid-template-columns: 44px minmax(0, 1fr) 44px;
                gap: 10px;
                align-items: center;
                margin: -14px -14px 14px;
                padding: 10px 14px;
                background: rgba(239, 231, 216, .94);
                border-bottom: 1px solid rgba(31, 42, 31, .08);
                backdrop-filter: blur(16px);
            }

            .mobile-reader-bar a,
            .mobile-reader-bar button {
                width: 44px;
                height: 44px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                border: 0;
                border-radius: 8px;
                background: var(--reader-green);
                color: #fff7e8;
                font-size: 1.1rem;
            }

            .mobile-reader-bar strong {
                min-width: 0;
                color: var(--reader-green);
                font-size: .96rem;
                font-weight: 900;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .quran-mobile-actions {
                grid-column: 1 / -1;
                display: flex;
                justify-content: center;
                gap: 7px;
                direction: ltr;
            }

            .quran-mobile-actions .quran-view-btn { flex: 1; max-width: 180px; }
            .quran-mobile-actions .quran-view-btn {
                width: auto;
                height: auto;
                min-height: 34px;
                border: 1px solid #d8c9af;
                border-radius: 6px;
                background: #fffaf0;
                color: #34443a;
                font-size: .7rem;
            }
            .quran-mobile-actions .quran-view-btn.active {
                border-color: #b88b37;
                background: var(--reader-green);
                color: #fff5df;
            }

            .quran-ebook .mobile-reader-bar strong {
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 8px;
                overflow: visible;
                padding: 2px 0 7px;
                line-height: 1.9;
                text-overflow: clip;
            }

            .quran-ebook .mobile-reader-bar .current-surah-number {
                width: 30px;
                height: 30px;
                flex-basis: 30px;
                font-size: .72rem;
            }

            .quran-view-loader { inset: 0; }

            .reading-panel {
                padding: 14px;
            }

            .page-tools {
                display: none;
            }

            .page-sheet {
                min-height: calc(100vh - 82px);
                padding: 28px 18px 36px;
            }

            .book-content {
                font-size: 1.05rem;
                line-height: 2.65;
            }
        }

        @media (max-width: 520px) {
            .page-sheet h1 { font-size: 1.7rem; }
            .chapter-rail { padding: 24px 18px; }
            .tool-actions { display: none; }
            .html-ebook .book-content .poetry-stanza { padding: 16px 14px 20px; }
            .html-ebook .book-content .poetry-line { font-size: 1.08em; }
            .html-ebook .chapter-footnotes { padding: 16px 14px 8px; }
            .quran-ebook .surah-basmala { padding: 18px 44px; }
            .quran-ebook .quran-ayah-card { padding-top: 42px; }
            .quran-ebook .quran-ayah-card .ayah-code { line-height: 1.35; }
            .quran-ebook .quran-flow-text { padding: 22px 18px; font-size: 1.48rem; line-height: 2.55; }
            .quran-modal-panel { padding: 34px 18px 24px; }
        }
