    .reader-page {
        min-height: 100vh;
        background: #05080e;
        color: #f3f3f5;
        direction: rtl;
    }

    .reader-header {
        width: 100%;
        height: 76px;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: rgba(8, 11, 16, .96);
        border-bottom: 1px solid #20252d;
        backdrop-filter: blur(14px);
    }

    .reader-header-inner {
        width: min(1400px, calc(100% - 48px));
        height: 100%;
        margin: 0 auto;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 24px;
    }

    .reader-header-actions {
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .reader-back-button, .reader-report-button {
        height: 42px;
        padding: 0 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 9px;
        font-family: inherit;
        font-size: 11px;
        text-decoration: none;
        cursor: pointer;
        transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
    }

    .reader-back-button {
        border: 1px solid #7439ad;
        background: transparent;
        color: #e2c8f5;
    }

        .reader-back-button:hover {
            background: #171020;
            border-color: #a04ce6;
            color: #fff;
        }

        .reader-back-button:active {
            transform: scale(.96);
        }

        .reader-back-button i {
            color: #a34be6;
        }

    .reader-report-button {
        border: 1px solid #59332d;
        background: #151015;
        color: #e3c6bf;
    }

        .reader-report-button:hover {
            background: #241519;
            border-color: #a84c40;
            color: #fff;
        }

        .reader-report-button:active {
            transform: scale(.96);
        }

        .reader-report-button i {
            color: #e36a58;
        }

    .reader-title {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 18px;
    }

        .reader-title h1 {
            margin: 0;
            min-width: 0;
            max-width: 600px;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 18px;
            font-weight: 700;
        }

        .reader-title > span {
            padding-right: 18px;
            border-right: 1px solid #30353e;
            color: #b5bac3;
            font-size: 12px;
        }

        .reader-title strong {
            color: #a94ef0;
            font-size: 16px;
        }

    .reader-brand {
        display: flex;
        align-items: center;
        gap: 9px;
        color: #eee;
        text-decoration: none;
    }

    .reader-brand-icon {
        width: 35px;
        height: 35px;
        display: grid;
        place-items: center;
        border: 1px solid #8b42d4;
        border-radius: 8px;
        color: #a54cec;
    }

    .reader-brand strong {
        font-size: 12px;
    }

    .reader-controls {
        width: min(1400px, calc(100% - 48px));
        margin: 90px auto 10px;
        padding: 14px 22px;
        box-sizing: border-box;
        background: #0c1017;
        border: 1px solid #252b35;
        border-radius: 12px;
    }

    .reader-width-control {
        display: grid;
        grid-template-columns: auto minmax(180px, 1fr) auto;
        align-items: center;
        gap: 20px;
    }

    .reader-control-title {
        display: flex;
        align-items: center;
        gap: 9px;
        color: #cfd2d8;
        font-size: 14px;
    }

        .reader-control-title i {
            color: #a44ce6;
        }

    .reader-width-options {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
    }

    .reader-width-preset {
        min-width: 70px;
        height: 44px;
        border: 1px solid #303641;
        border-radius: 10px;
        background: #121720;
        color: #aeb3bc;
        font-family: inherit;
        font-size: 13px;
        cursor: pointer;
        transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
    }

        .reader-width-preset:hover {
            border-color: #793fc0;
            color: #d8b9ed;
        }

        .reader-width-preset:active {
            transform: scale(.96);
        }

        .reader-width-preset.active {
            border-color: transparent;
            background: linear-gradient(100deg, #7130ce, #9b45ec);
            color: #fff;
        }

    .reader-width-slider-wrapper {
        min-width: 270px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .reader-width-button {
        width: 30px;
        height: 30px;
        flex-shrink: 0;
        border: 0;
        border-radius: 7px;
        background: #151a22;
        color: #d8dbe0;
        cursor: pointer;
        transition: background .2s ease, color .2s ease, transform .2s ease;
    }

        .reader-width-button:hover {
            background: #241532;
            color: #b75bf2;
        }

        .reader-width-button:active {
            transform: scale(.9);
        }

    .reader-width-slider {
        width: 100%;
        accent-color: #9847e5;
        cursor: pointer;
    }

    .reader-width-value {
        min-width: 110px;
        display: flex;
        flex-direction: column;
        gap: 3px;
        text-align: center;
    }

        .reader-width-value strong {
            color: #a951e8;
            font-size: 12px;
        }

        .reader-width-value span {
            color: #777e89;
            font-size: 10px;
        }

    .reader-content {
        width: 100%;
        padding: 0 0 40px;
        box-sizing: border-box;
    }

    .reader-pages {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* صفرِ مطلق: صفحات یک تصویر پیوسته‌اند، نه کارت‌های جدا. */
        gap: 0;
    }

    /* نوار وضعیت بارگذاری ترتیبی تصاویر */
    .reader-loadbar {
        width: min(760px, calc(100% - 32px));
        min-height: 40px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 14px;
        box-sizing: border-box;
        border: 1px solid #2a3140;
        border-radius: 10px;
        background: rgba(12, 16, 23, .9);
        color: #c6cad2;
        font-size: 12px;
    }

        .reader-loadbar-spinner {
            flex: 0 0 auto;
            width: 16px;
            height: 16px;
            border: 2px solid #2b3342;
            border-top-color: #9847e5;
            border-radius: 50%;
            animation: reader-spin .8s linear infinite;
        }

        .reader-loadbar-text {
            flex: 1 1 auto;
            min-width: 0;
        }

        .reader-loadbar-action {
            flex: 0 0 auto;
            height: 32px;
            padding: 0 12px;
            border: 1px solid #3b3348;
            border-radius: 8px;
            background: #14101c;
            color: #d9c6ee;
            font-family: inherit;
            font-size: 11px;
            cursor: pointer;
        }

            .reader-loadbar-action:hover {
                border-color: #a04ce6;
            }

    .reader-page-image-wrapper {
        width: var(--reader-image-width, 100%);
        max-width: 1200px;
        margin: 0;
        padding: 0;
        position: relative;
        display: flex;
        justify-content: center;
        overflow: hidden;
        background: transparent;
        transition: width .2s ease;
    }

    .reader-page-image {
        width: 100%;
        height: auto;
        display: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        vertical-align: top;
        user-select: none;
        -webkit-user-drag: none;
    }

        .reader-page-image.loaded {
            display: block;
        }

    .reader-page-status {
        width: 100%;
        min-height: 240px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 0;
        box-sizing: border-box;
        background: transparent;
        border: 0;
        border-radius: 0;
    }

        .reader-page-status.hidden {
            display: none;
        }

    .reader-page-spinner {
        width: 34px;
        height: 34px;
        border: 3px solid #252b35;
        border-top-color: #9847e5;
        border-radius: 50%;
        animation: reader-spin .8s linear infinite;
    }

    @keyframes reader-spin {
        to {
            transform: rotate(360deg);
        }
    }

    .reader-page-status-title {
        margin: 0;
        color: #d7d9df;
        font-size: 13px;
    }

    .reader-page-status-error {
        color: #e57667;
        font-size: 30px;
    }

    .reader-page-error-message {
        color: #d8b8b3;
        font-size: 12px;
        text-align: center;
    }

    .reader-retry-button {
        min-width: 110px;
        height: 38px;
        padding: 0 15px;
        border: 1px solid #a34c42;
        border-radius: 8px;
        background: #211315;
        color: #f0c5bf;
        font-family: inherit;
        font-size: 11px;
        cursor: pointer;
        transition: background .2s ease, transform .2s ease;
    }

        .reader-retry-button:hover {
            background: #321719;
        }

        .reader-retry-button:active {
            transform: scale(.96);
        }

    .reader-empty {
        width: min(600px, calc(100% - 40px));
        margin: 70px auto;
        padding: 50px 30px;
        border: 1px solid #252b34;
        border-radius: 12px;
        background: #0b0f16;
        text-align: center;
    }

        .reader-empty i {
            color: #9847e5;
            font-size: 40px;
        }

        .reader-empty h2 {
            margin: 20px 0 8px;
            font-size: 17px;
        }

    .reader-progress {
        position: fixed;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 90;
        width: 40px;
        padding: 8px 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        background: rgba(10, 14, 20, .55);
        border: 1px solid rgba(48, 54, 65, .4);
        border-radius: 20px;
        backdrop-filter: blur(4px);
        pointer-events: none;
    }

    .reader-progress-track {
        width: 3px;
        height: 90px;
        overflow: hidden;
        border-radius: 20px;
        background: rgba(36, 42, 52, .4);
    }

    .reader-progress-percent {
        color: rgba(169, 81, 232, .8);
        font-size: 8px;
        font-weight: 700;
    }

    .reader-back-to-top {
        position: fixed;
        left: 16px;
        bottom: 24px;
        width: 40px;
        height: 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: 1px solid rgba(48, 54, 65, .4);
        border-radius: 20px;
        background: rgba(16, 21, 30, .55);
        color: rgba(166, 76, 232, .8);
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
        z-index: 90;
        backdrop-filter: blur(4px);
    }

        .reader-back-to-top.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .reader-back-to-top:hover {
            background: rgba(27, 20, 36, .7);
            border-color: rgba(129, 63, 196, .5);
        }

        .reader-back-to-top i {
            font-size: 12px;
        }

        .reader-back-to-top span {
            font-family: inherit;
            font-size: 6px;
        }

    .reader-navigation {
        width: min(1200px, calc(100% - 48px));
        margin: 30px auto 40px;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 14px;
    }

    .reader-nav-button {
        min-height: 54px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border: 1px solid #7040a3;
        border-radius: 9px;
        background: #0d1119;
        color: #e0e2e7;
        text-decoration: none;
        font-family: inherit;
        font-size: 14px;
        transition: background .2s ease, border-color .2s ease, transform .2s ease;
    }

        .reader-nav-button:hover {
            background: #191224;
            border-color: #a34ce8;
            transform: translateY(-1px);
        }

        .reader-nav-button:active {
            transform: scale(.97);
        }

        .reader-nav-button i {
            color: #a34ce8;
        }

        .reader-nav-button.reader-nav-next {
            background: linear-gradient(100deg, #7130ce, #9b45ec);
            border-color: transparent;
        }

            .reader-nav-button.reader-nav-next i {
                color: #fff;
            }

        .reader-nav-button.disabled {
            opacity: .35;
            cursor: not-allowed;
            pointer-events: none;
        }

    .reader-modal {
        position: fixed;
        inset: 0;
        z-index: 500;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background: rgba(0, 0, 0, .72);
        backdrop-filter: blur(6px);
    }

        .reader-modal.visible {
            display: flex;
        }

    .reader-modal-content {
        width: min(460px, 100%);
        padding: 24px;
        box-sizing: border-box;
        background: #0d1119;
        border: 1px solid #303641;
        border-radius: 14px;
        box-shadow: 0 25px 80px rgba(0, 0, 0, .5);
    }

    .reader-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 20px;
    }

        .reader-modal-header h2 {
            margin: 0;
            font-size: 16px;
        }

    .reader-modal-close {
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 8px;
        background: #181e27;
        color: #c7cad1;
        cursor: pointer;
    }

    .reader-report-field {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 15px;
    }

        .reader-report-field label {
            color: #bfc3cb;
            font-size: 11px;
        }

        .reader-report-field textarea {
            width: 100%;
            min-height: 120px;
            resize: vertical;
            padding: 12px;
            box-sizing: border-box;
            border: 1px solid #303641;
            border-radius: 9px;
            outline: none;
            background: #090d13;
            color: #e7e8ec;
            font-family: inherit;
            font-size: 12px;
        }

            .reader-report-field textarea:focus {
                border-color: #9144d8;
            }

    .reader-report-submit {
        width: 100%;
        height: 44px;
        border: 0;
        border-radius: 9px;
        background: linear-gradient(100deg, #7130ce, #9b45ec);
        color: #fff;
        font-family: inherit;
        cursor: pointer;
    }

    .reader-report-context {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 20px;
        padding: 12px;
        background: #10151e;
        border: 1px solid #252b35;
        border-radius: 8px;
    }

        .reader-report-context span {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            background: #1a1f28;
            border-radius: 6px;
            color: #bfc3cb;
            font-size: 11px;
        }

        .reader-report-context i {
            color: #9847e5;
            font-size: 12px;
        }

    .reader-character-count {
        align-self: flex-end;
        color: #777e89;
        font-size: 10px;
    }

    .reader-report-note {
        margin: 12px 0 0;
        color: #777e89;
        font-size: 10px;
        text-align: center;
    }

        .reader-report-note i {
            color: #9847e5;
            margin-left: 4px;
        }

    .fa-spin {
        animation: fa-spin 1s linear infinite;
    }

    @keyframes fa-spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    @media (max-width: 1000px) {
        .reader-header-inner, .reader-controls, .reader-navigation {
            width: calc(100% - 32px);
        }

        .reader-title h1 {
            max-width: 300px;
        }

        .reader-width-control {
            grid-template-columns: auto 1fr;
        }

        .reader-width-value {
            display: none;
        }

        .reader-width-slider-wrapper {
            min-width: 220px;
        }

        .reader-progress {
            left: 8px;
        }

        .reader-back-to-top {
            left: 8px;
        }
    }

    @media (max-width: 700px) {
        .reader-page {
            padding-bottom: 68px;
        }

        .reader-header {
            height: 56px;
        }

        .reader-header-inner {
            width: calc(100% - 20px);
            grid-template-columns: auto minmax(0, 1fr) auto;
            gap: 7px;
        }

        .reader-header-actions {
            gap: 5px;
        }

        .reader-back-button, .reader-report-button {
            width: 38px;
            height: 38px;
            padding: 0;
        }

            .reader-back-button span, .reader-report-button span {
                display: none;
            }

        .reader-title {
            gap: 7px;
        }

            .reader-title h1 {
                max-width: 145px;
                font-size: 12px;
            }

            .reader-title > span {
                padding-right: 7px;
                font-size: 9px;
            }

            .reader-title strong {
                font-size: 11px;
            }

        .reader-brand strong {
            display: none;
        }

        .reader-brand-icon {
            width: 36px;
            height: 36px;
            border-radius: 9px;
        }

        .reader-controls {
            width: calc(100% - 20px);
            margin: 64px auto 8px;
            padding: 10px;
        }

        .reader-width-control {
            display: flex;
            flex-direction: column;
            gap: 9px;
        }

        .reader-control-title {
            width: 100%;
            justify-content: space-between;
            font-size: 11px;
        }

        .reader-width-options {
            width: 100%;
        }

        .reader-width-preset {
            flex: 1;
            min-width: 0;
            height: 36px;
            font-size: 11px;
        }

        .reader-width-slider-wrapper {
            width: 100%;
            min-width: 0;
        }

        .reader-width-value {
            display: none;
        }

        .reader-content {
            padding-bottom: 25px;
        }

        .reader-pages {
            gap: 0;
        }

        .reader-page-image-wrapper {
            width: var(--reader-image-width, 100%);
            max-width: none;
        }

        .reader-page-image {
            border-radius: 0;
            box-shadow: none;
        }

        .reader-page-status {
            min-height: 55vh;
            border-radius: 0;
        }

        .reader-progress {
            position: fixed;
            left: 8px;
            right: 8px;
            bottom: 8px;
            top: auto;
            transform: none;
            width: auto;
            height: 32px;
            padding: 0 10px;
            flex-direction: row;
            border-radius: 16px;
        }

        .reader-progress-track {
            flex: 1;
            width: auto;
            height: 3px;
            order: 2;
        }

        .reader-progress-percent {
            order: 3;
        }

        .reader-back-to-top {
            left: 8px;
            bottom: 48px;
            width: 34px;
            height: 34px;
        }

        .reader-navigation {
            width: calc(100% - 20px);
            margin: 18px auto 25px;
            grid-template-columns: 1fr 1fr;
            gap: 7px;
        }

        .reader-nav-button {
            min-height: 46px;
            font-size: 11px;
        }

        .reader-nav-center {
            grid-column: 1 / -1;
            grid-row: 1;
        }

        .reader-nav-button:first-child {
            grid-column: 1;
            grid-row: 2;
        }

        .reader-nav-button:last-child {
            grid-column: 2;
            grid-row: 2;
        }

    }


    /* ============================================================
       بازطراحی ریدر — پنل تنظیمات شناور، هدر خودکار، ادامه‌ی مطالعه
       ============================================================ */

    .reader-header {
        transition: transform .25s ease;
    }

        .reader-header.is-hidden {
            transform: translateY(-100%);
        }

    .reader-settings-button {
        height: 42px;
        padding: 0 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border: 1px solid #3b3348;
        border-radius: 9px;
        background: #14101c;
        color: #d9c6ee;
        font-family: inherit;
        font-size: 11px;
        cursor: pointer;
        transition: background .2s ease, border-color .2s ease, transform .2s ease;
    }

        .reader-settings-button:hover {
            background: #1d1529;
            border-color: #a04ce6;
        }

        .reader-settings-button:active {
            transform: scale(.96);
        }

        .reader-settings-button i {
            color: #a34be6;
        }

    /* نوار تنظیمات شناور می‌شود تا در وسط فصل هم در دسترس باشد */
    .reader-controls {
        position: fixed;
        top: 88px;
        left: 50%;
        right: auto;
        width: min(760px, calc(100% - 32px));
        margin: 0;
        z-index: 95;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(-50%) translateY(-6px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
        box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    }

        .reader-controls.is-open {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateX(-50%) translateY(0);
        }

    .reader-content {
        padding-top: 92px;
    }

    /* رزرو فضا و انتقال نرم: تصویر تا لود شدن شفاف است، نه display:none */
    .reader-page-image-wrapper {
        position: relative;
        align-items: stretch;
        min-height: 220px;
        scroll-margin-top: 92px;
    }

        .reader-page-image-wrapper.has-size {
            min-height: 0;
        }

        /* در حالت خطا تصویر حذف نمی‌شود و فضای کافی برای کارت خطا می‌ماند */
        .reader-page-image-wrapper.is-error {
            min-height: 250px;
        }

    .reader-page-image {
        display: block;
        opacity: 0;
        transition: opacity .25s ease;
    }

        .reader-page-image.loaded {
            display: block;
            opacity: 1;
        }

    .reader-page-status {
        position: absolute;
        inset: 0;
        z-index: 1;
        min-height: 0;
    }

    /* نوار پیشرفت با transform؛ resize دیگر آن را خراب نمی‌کند */
    .reader-progress-fill {
        width: 100%;
        height: 100%;
        transform: scaleY(var(--reader-progress, 0));
        transform-origin: bottom center;
        transition: transform .1s linear;
    }

    /* پیشنهاد پلاس پس از آخرین صفحه */
    .reader-plus-offer {
        width: min(760px, calc(100% - 32px));
        margin: 34px auto 10px;
        padding: 30px 24px;
        box-sizing: border-box;
        border: 1px solid rgba(190, 143, 73, .4);
        border-radius: 16px;
        background: radial-gradient(ellipse at 50% 0%, rgba(173, 112, 37, .16), transparent 65%), #0c1017;
        text-align: center;
        color: #f3f3f5;
    }

    .reader-plus-offer-badge {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 6px 12px;
        border: 1px solid rgba(230, 180, 88, .3);
        border-radius: 999px;
        background: rgba(222, 166, 63, .1);
        color: #f2c97a;
        font-size: 12px;
        font-weight: 700;
    }

    .reader-plus-offer h2 {
        margin: 16px 0 8px;
        font-size: 20px;
        line-height: 1.6;
    }

    .reader-plus-offer p {
        margin: 0;
        color: #bbc1cd;
        font-size: 13px;
        line-height: 2;
    }

    .reader-plus-offer-features {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
        margin: 20px 0;
        padding: 0;
        list-style: none;
        color: #e6d8bd;
        font-size: 12px;
        line-height: 1.8;
    }

    .reader-plus-offer-features li {
        display: inline-flex;
        align-items: center;
        gap: 7px;
    }

    .reader-plus-offer-features i { color: #e5ba6a; }

    .reader-plus-offer-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        min-height: 48px;
        max-width: 100%;
        box-sizing: border-box;
        padding: 10px 22px;
        border: 1px solid #eac675;
        border-radius: 11px;
        background: linear-gradient(110deg, #e4b45d, #f6d88c);
        color: #241a0b;
        font-size: 13px;
        font-weight: 800;
        line-height: 1.6;
        text-decoration: none;
        transition: filter .2s ease;
    }

    .reader-plus-offer-cta:hover { filter: brightness(1.08); color: #241a0b; }
    .reader-plus-offer-cta:focus-visible { outline: 2px solid #f7dc9e; outline-offset: 3px; }

    /* کارت ادامه‌ی مطالعه */
    .reader-resume {
        position: fixed;
        left: 16px;
        bottom: 78px;
        z-index: 96;
        width: min(340px, calc(100% - 32px));
        padding: 14px;
        box-sizing: border-box;
        border: 1px solid rgba(169, 78, 240, .45);
        border-radius: 13px;
        background: #10151e;
        color: #e8e9ed;
        box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
        animation: reader-resume-in .3s ease both;
    }

        .reader-resume[hidden] {
            display: none;
        }

    @keyframes reader-resume-in {
        from {
            opacity: 0;
            transform: translateY(12px);
        }
    }

    .reader-resume strong {
        display: block;
        font-size: 12px;
    }

    .reader-resume p {
        margin: 6px 0 0;
        color: #9aa1ad;
        font-size: 11px;
        line-height: 1.8;
    }

    .reader-resume-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
    }

    .reader-resume-go,
    .reader-resume-dismiss {
        min-height: 38px;
        border: 1px solid #303641;
        border-radius: 9px;
        background: #151b25;
        color: #e7e8ec;
        font-family: inherit;
        font-size: 11px;
        cursor: pointer;
    }

    .reader-resume-go {
        flex: 1;
        border-color: transparent;
        background: linear-gradient(100deg, #7130ce, #9b45ec);
        color: #fff;
    }

    .reader-resume-dismiss {
        width: 38px;
        padding: 0;
        font-size: 16px;
        line-height: 1;
    }

    body.reader-modal-open {
        overflow: hidden;
    }

    @media (max-width: 1000px) {
        .reader-content {
            padding-top: 84px;
        }

        .reader-controls {
            top: 80px;
        }
    }

    @media (max-width: 700px) {
        .reader-content {
            padding-top: 62px;
        }

        .reader-controls {
            top: 62px;
            width: calc(100% - 16px);
        }

        .reader-settings-button {
            width: 38px;
            height: 38px;
            padding: 0;
        }

            .reader-settings-button span:not(.reader-plus-badge) {
                display: none;
            }

        .reader-page-image-wrapper {
            min-height: 160px;
            scroll-margin-top: 62px;
        }

        .reader-progress-fill {
            background: linear-gradient(to left, #7130ce, #a94ef0);
            transform: scaleX(var(--reader-progress, 0));
            transform-origin: right center;
        }

        .reader-plus-offer {
            padding: 24px 16px;
            margin-top: 26px;
        }

        .reader-plus-offer h2 { font-size: 17px; }
        .reader-plus-offer-cta { width: 100%; }

        .reader-resume {
            left: 10px;
            right: 10px;
            width: auto;
            bottom: calc(58px + env(safe-area-inset-bottom));
        }
    }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            scroll-behavior: auto !important;
            animation-duration: .01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: .01ms !important;
        }
    }

    /* ============================================================
       نور شب و پرش بین قسمت‌ها — نوار بالای مطالعه
       هدر باید ثابت بماند تا این دکمه‌ها وسط فصل هم در دسترس باشند.
       ============================================================ */

    .reader-header {
        position: fixed;
        top: 0;
        box-sizing: border-box;
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(76px + env(safe-area-inset-top, 0px));
    }

    .reader-title {
        min-width: 0;
    }

    .reader-header-actions > * {
        flex-shrink: 0;
    }

    .reader-content {
        padding-top: calc(92px + env(safe-area-inset-top, 0px));
    }

    .reader-controls {
        top: calc(88px + env(safe-area-inset-top, 0px));
        z-index: 97;
        max-height: min(72vh, 560px);
        overflow: auto;
        overscroll-behavior: contain;
    }

    .reader-page-image-wrapper {
        scroll-margin-top: calc(88px + env(safe-area-inset-top, 0px));
    }

    .reader-page {
        --reader-surface-base: #000000;
        background: var(--reader-surface-base);
        background: color-mix(in srgb, var(--reader-surface-base) calc(100% - var(--reader-night, 0) * 28%), #3d2810);
    }

        .reader-page[data-reader-surface="slate"] {
            --reader-surface-base: #0b101b;
        }

    .reader-night-button.is-on {
        border-color: #c4842a;
        background: #2a1c0c;
        color: #ffd7a1;
    }

        .reader-night-button.is-on i {
            color: #ffb020;
        }

    .reader-panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .reader-panel-close {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
        border: 0;
        border-radius: 8px;
        background: #181e27;
        color: #c7cad1;
        cursor: pointer;
    }

        .reader-panel-close:hover {
            background: #241532;
            color: #fff;
        }

    .reader-control-hint {
        margin: 0;
        color: #8b929d;
        font-size: 11px;
        line-height: 1.8;
    }

        .reader-control-hint kbd {
            display: inline-block;
            min-width: 1.4em;
            padding: 0 5px;
            border: 1px solid #3a4150;
            border-radius: 5px;
            background: #151b25;
            color: #d7dbe2;
            font-family: inherit;
            font-size: 10px;
            line-height: 1.7;
            text-align: center;
        }

    .reader-night-panel,
    .reader-jump-panel {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .reader-night-value-row {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 8px;
    }

        .reader-night-value-row strong {
            color: #ffb020;
            font-size: 18px;
        }

        .reader-night-value-row span {
            color: #8b929d;
            font-size: 11px;
        }

    .reader-night-slider {
        accent-color: #e39a2b;
    }

    .reader-night-presets,
    .reader-jump-nav,
    .reader-jump-chapters {
        display: flex;
        gap: 8px;
    }

    .reader-night-preset,
    .reader-jump-step {
        flex: 1;
        min-width: 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0 8px;
        border: 1px solid #303641;
        border-radius: 10px;
        background: #121720;
        color: #d7dbe2;
        font-family: inherit;
        font-size: 12px;
        text-decoration: none;
        cursor: pointer;
    }

        .reader-night-preset:hover,
        .reader-jump-step:hover {
            border-color: #793fc0;
            color: #fff;
        }

    .reader-night-preset.active {
        border-color: transparent;
        background: linear-gradient(100deg, #b86a12, #e39a2b);
        color: #1a1206;
        font-weight: 700;
    }

    .reader-jump-step:disabled,
    .reader-jump-step.is-disabled {
        opacity: .38;
        cursor: not-allowed;
        pointer-events: none;
    }

    .reader-jump-step i {
        color: #a34ce8;
        font-size: 11px;
    }

    .reader-jump-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
        gap: 8px;
    }

    .reader-jump-section {
        min-height: 54px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px;
        border: 1px solid #303641;
        border-radius: 10px;
        background: #121720;
        color: #e7e8ec;
        font-family: inherit;
        cursor: pointer;
    }

        .reader-jump-section small {
            color: #9aa1ad;
            font-size: 10px;
        }

        .reader-jump-section:hover {
            border-color: #793fc0;
        }

        .reader-jump-section.is-current {
            border-color: transparent;
            background: linear-gradient(100deg, #7130ce, #9b45ec);
            color: #fff;
        }

            .reader-jump-section.is-current small {
                color: rgba(255, 255, 255, .82);
            }

    .reader-jump-goto {
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .reader-jump-goto label {
            color: #bfc3cb;
            font-size: 12px;
            white-space: nowrap;
        }

        .reader-jump-goto input {
            width: 84px;
            height: 40px;
            border: 1px solid #303641;
            border-radius: 9px;
            background: #121720;
            color: #f3f3f5;
            font-family: inherit;
            font-size: 14px;
            text-align: center;
        }

        .reader-jump-goto button {
            height: 40px;
            padding: 0 14px;
            border: 0;
            border-radius: 9px;
            background: linear-gradient(100deg, #7130ce, #9b45ec);
            color: #fff;
            font-family: inherit;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }

    .reader-jump-error {
        margin: 0;
        color: #e57667;
        font-size: 11px;
    }

        .reader-jump-error[hidden] {
            display: none;
        }

    .reader-jump-keys {
        margin-top: 2px;
    }

    .reader-live {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    /* پوشش گرم مثل Night Light گوشی؛ فقط وقتی درصد بالای صفر است دیده می‌شود */
    .reader-night-veil {
        position: fixed;
        inset: 0;
        z-index: 40;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        pointer-events: none;
        background: #ffb020;
        mix-blend-mode: multiply;
        opacity: calc(var(--reader-night, 0) * 0.62);
        transition: opacity .12s linear;
    }

        .reader-night-veil[hidden] {
            display: none !important;
        }

    @supports not (mix-blend-mode: multiply) {
        .reader-night-veil {
            display: none !important;
        }

        .reader-page.is-night .reader-page-image {
            filter: sepia(calc(var(--reader-night, 0) * 0.8));
        }
    }

    .reader-page.is-night .reader-page-image-wrapper,
    .reader-page.is-night .reader-page-image {
        background: #16110c;
    }

    @media (max-width: 700px) {
        .reader-header {
            height: calc(56px + env(safe-area-inset-top, 0px));
        }

        .reader-header-actions {
            max-width: calc(100vw - 96px);
            overflow-x: auto;
            scrollbar-width: none;
        }

            .reader-header-actions::-webkit-scrollbar {
                display: none;
            }

        .reader-content {
            padding-top: calc(64px + env(safe-area-inset-top, 0px));
        }

        .reader-controls {
            top: calc(64px + env(safe-area-inset-top, 0px));
            max-height: min(58vh, 480px);
        }

        .reader-page-image-wrapper {
            scroll-margin-top: calc(64px + env(safe-area-inset-top, 0px));
        }

        .reader-jump-panel.is-open {
            top: auto;
            bottom: calc(48px + env(safe-area-inset-bottom, 0px));
            max-height: 52vh;
        }

        .reader-night-presets {
            flex-wrap: wrap;
        }

            .reader-night-preset {
                flex: 1 1 calc(33% - 8px);
            }

        .reader-jump-chapters,
        .reader-jump-nav {
            flex-wrap: wrap;
        }

        .reader-jump-goto {
            flex-wrap: wrap;
        }
    }

    @media print {
        .reader-night-veil,
        .reader-jump-panel,
        .reader-night-panel,
        .reader-night-control {
            display: none !important;
        }
    }

    /* نور شب داخل تنظیمات است، نه دکمهٔ جدا در هدر. */
    .reader-night-control {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #2a3140;
    }

    .reader-plus-badge {
        display: inline-flex;
        align-items: center;
        height: 18px;
        margin-inline-start: 6px;
        padding: 0 7px;
        border-radius: 999px;
        background: linear-gradient(100deg, #8a5a12, #e0a84a);
        color: #1a1206;
        font-size: 10px;
        font-weight: 800;
        line-height: 1;
    }

    .reader-jump-button.is-plus-locked {
        position: relative;
        border-color: #c4842a;
    }

    .reader-plus-lock {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: flex-start;
        min-height: 42px;
        padding: 0 14px;
        border: 0;
        border-radius: 10px;
        background: linear-gradient(100deg, #8a5a12, #e0a84a);
        color: #1a1206;
        font-family: inherit;
        font-size: 13px;
        font-weight: 800;
        text-decoration: none;
    }

        .reader-plus-lock:hover {
            filter: brightness(1.06);
        }

    /* صفحهٔ ناموفق یک کارت فشرده با دکمهٔ خودش است، نه جای خالی به ارتفاع تصویر. */
    .reader-page-image-wrapper.is-error {
        overflow: visible;
        height: auto;
        min-height: 250px;
    }

        .reader-page-image-wrapper.is-error .reader-page-image {
            display: none;
            opacity: 0;
        }

        .reader-page-image-wrapper.is-error .reader-page-status {
            position: relative;
            inset: auto;
            z-index: 1;
            display: flex;
            min-height: 240px;
        }

    @media (max-width: 700px) {
        .reader-jump-button.is-plus-locked .reader-plus-badge {
            position: absolute;
            top: -5px;
            left: -4px;
            height: 14px;
            margin: 0;
            padding: 0 4px;
            font-size: 8px;
        }
    }

/* اسکرول خودکار در کنار سایر تنظیمات ریدر */
.reader-auto-control { display:flex; flex-direction:column; gap:12px; margin-top:16px; padding-top:16px; border-top:1px solid #2a3140; }
.reader-auto-toggle { align-self:flex-start; min-height:42px; padding:0 14px; border:1px solid #9146c5; border-radius:10px; background:#241532; color:#fff; font:inherit; cursor:pointer; }
.reader-auto-toggle[aria-pressed="true"] { background:#9146c5; }
.reader-auto-toggle:focus-visible { outline:2px solid #ffd7a1; outline-offset:3px; }
@media print { .reader-auto-control { display:none !important; } }

/* پنجرهٔ بوکمارک ریدر */
.reader-bookmark-card { max-height: min(90vh, 680px); overflow-y: auto; border-color: #40314c; border-radius: 18px; background: linear-gradient(160deg, #191222, #0d1119 50%); }
.reader-bookmark-heading { display:flex; align-items:flex-start; gap:13px; margin-bottom:22px; }
.reader-bookmark-heading > div { flex:1; min-width:0; }
.reader-bookmark-heading h2 { margin:0 0 6px; font-size:17px; color:#f6f1fa; }
.reader-bookmark-heading p { margin:0; color:#a5a0ad; font-size:12px; line-height:1.8; }
.reader-bookmark-icon { display:grid; place-items:center; width:44px; height:44px; flex-shrink:0; border-radius:13px; color:#d6a4ff; background:#382046; font-size:19px; }
.reader-bookmark-context { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.reader-bookmark-context span, .reader-bookmark-context strong { padding:7px 10px; border:1px solid #33303d; border-radius:8px; background:#15151e; color:#c5becb; font-size:11px; overflow-wrap:anywhere; }
.reader-bookmark-context strong { color:#e5baff; border-color:#613d78; }
.reader-bookmark-field label { font-size:13px; color:#e4deea; }
.reader-bookmark-field label span { color:#99909f; font-size:11px; }
.reader-bookmark-field textarea { min-height:130px; font-size:13px; line-height:1.8; }
.reader-bookmark-meta { display:flex; justify-content:space-between; gap:10px; color:#918a98; font-size:11px; }
.reader-bookmark-status { padding:10px 12px; border-radius:8px; font-size:12px; line-height:1.8; }
.reader-bookmark-status.is-success { color:#a4e1b8; background:#12291c; }
.reader-bookmark-status.is-error { color:#ffb4b4; background:#30191d; }
.reader-bookmark-actions { display:flex; gap:10px; margin-top:20px; }
.reader-bookmark-actions button { min-height:44px; border-radius:9px; padding:0 16px; font:inherit; font-size:13px; cursor:pointer; }
.reader-bookmark-cancel { border:1px solid #36323d; background:#191922; color:#ddd5e1; }
.reader-bookmark-save { flex:1; border:0; background:linear-gradient(100deg,#7130ce,#a24de6); color:#fff; }
.reader-bookmark-save:disabled { opacity:.65; cursor:wait; }
.reader-bookmark-modal :focus-visible { outline:2px solid #d6a4ff; outline-offset:3px; }
.reader-bookmark-lock-text { color:#c4bac9; font-size:13px; line-height:2; margin:0 0 16px; }
@media (max-width: 480px) { .reader-bookmark-card { padding:20px; } .reader-bookmark-actions button { padding:0 10px; } }


/* ============================================================
   مراحل ۳، ۴ و ۵: پس‌زمینه OLED، نوار شیشه‌ای، حالت مطالعه فراگیر و شیمر صفحه
   ============================================================ */

.moonbook-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* هدر شیشه‌ای کم‌صدا با احترام به فوکوس کیبورد */
.reader-header {
    background: rgba(5, 7, 12, .78);
    border-bottom: 1px solid rgba(169, 81, 232, .18);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .82);
}

    .reader-header.is-hidden:not(:focus-within),
    .reader-page.is-zen-hidden .reader-header:not(:focus-within) {
        transform: translateY(-108%);
    }

.reader-mode-button[aria-pressed="true"] {
    background: linear-gradient(135deg, rgba(113, 48, 206, .42), rgba(20, 16, 32, .94));
    border-color: #b76cff;
    color: #fff;
    box-shadow: 0 0 18px -4px rgba(169, 81, 232, .45);
}

/* تنظیمات رایگان حالت مطالعه درون پنل تنظیمات */
.reader-reading-mode-control {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #262c3a;
}

.reader-mode-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.reader-free-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(56, 189, 248, .14);
    border: 1px solid rgba(56, 189, 248, .35);
    color: #8ee2ff;
    font-size: 10px;
    font-weight: 700;
}

.reader-mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reader-mode-pill {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #303748;
    border-radius: 9px;
    background: #101520;
    color: #cbd2df;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

    .reader-mode-pill:hover {
        border-color: rgba(169, 81, 232, .55);
        color: #fff;
    }

    .reader-mode-pill.is-active,
    .reader-mode-pill[aria-pressed="true"] {
        border-color: #a951e8;
        background: rgba(151, 68, 243, .22);
        color: #f3e8ff;
        box-shadow: 0 0 14px -4px rgba(151, 68, 243, .45);
    }

    .reader-mode-pill:focus-visible,
    .reader-hud-step:focus-visible,
    .reader-next-floater-cta:focus-visible,
    .reader-next-floater-close:focus-visible {
        outline: 2px solid #d6a4ff;
        outline-offset: 2px;
    }

/* قاب بهینه مانیتور دسکتاپ */
.reader-page.is-monitor-fit .reader-page-image-wrapper {
    max-width: 780px;
    margin-inline: auto;
}

/* کپسول شناور پایین صفحه (HUD یکپارچه در دسکتاپ و موبایل) */
.reader-progress {
    position: fixed;
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 92;
    width: min(540px, calc(100% - 24px));
    height: 44px;
    padding: 0 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    background: rgba(10, 12, 18, .82);
    border: 1px solid rgba(169, 81, 232, .26);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .58), inset 0 1px 0 rgba(255, 255, 255, .06);
    pointer-events: auto;
    transition: transform .25s ease, opacity .25s ease, visibility .25s ease;
}

    .reader-progress.is-hud-hidden:not(:focus-within),
    .reader-page.is-zen-hidden .reader-progress:not(:focus-within) {
        transform: translate(-50%, calc(100% + 28px));
        opacity: 0;
        pointer-events: none;
    }

.reader-progress-track {
    flex: 1;
    width: auto;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
}

.reader-progress-fill {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(to left, #7130ce, #b86bff);
    box-shadow: 0 0 12px rgba(169, 81, 232, .62);
    transform: scaleX(var(--reader-progress, 0));
    transform-origin: right center;
    transition: transform .1s linear;
}

.reader-progress-percent {
    color: #c896ff;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: center;
}

.reader-hud-step {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(169, 81, 232, .28);
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    color: #e2d4f8;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color .2s ease, border-color .2s ease;
}

    .reader-hud-step:hover:not(:disabled) {
        background: rgba(151, 68, 243, .26);
        border-color: #b86bff;
    }

    .reader-hud-step:disabled {
        opacity: .35;
        cursor: not-allowed;
    }

    .reader-hud-step[hidden] {
        display: none !important;
    }

.reader-back-to-top {
    left: 16px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

.reader-page.is-zen-hidden .reader-back-to-top:not(:focus-within) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* اعلان هوشمند فصل بعد در >80% مطالعه */
.reader-next-floater {
    position: fixed;
    right: 18px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    z-index: 94;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 10px;
    border-radius: 14px;
    background: rgba(13, 16, 25, .88);
    border: 1px solid rgba(169, 81, 232, .42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .62), 0 0 24px -8px rgba(151, 68, 243, .45);
    color: #f2edf9;
    transition: transform .25s ease, opacity .25s ease;
}

    .reader-next-floater[hidden] {
        display: none !important;
    }

.reader-next-floater-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reader-next-floater-label {
    font-size: 10px;
    color: #c29af2;
}

.reader-next-floater-copy strong {
    font-size: 12px;
    font-weight: 700;
}

.reader-next-floater-cta {
    min-height: 36px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    background: linear-gradient(100deg, #7130ce, #a149ee);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

    .reader-next-floater-cta:hover {
        filter: brightness(1.08);
    }

.reader-next-floater-close {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: transparent;
    color: #a6adbd;
    cursor: pointer;
}

    .reader-next-floater-close:hover {
        color: #fff;
        background: rgba(255, 255, 255, .07);
    }

/* اعلان کوتاه تغییر وضعیت حالت مطالعه */
.reader-mode-toast {
    position: fixed;
    top: calc(74px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 98;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(14, 17, 26, .9);
    border: 1px solid rgba(169, 81, 232, .45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ece4f8;
    font-size: 11px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
    pointer-events: none;
}

    .reader-mode-toast[hidden] {
        display: none !important;
    }

/* حالت تک‌صفحه‌ای (Paged Mode) سازگار با مانیتور و گوشی */
.reader-page[data-reading-layout="paged"] .reader-pages {
    gap: 0;
}

    .reader-page[data-reading-layout="paged"] .reader-page-image-wrapper {
        display: none;
    }

    .reader-page[data-reading-layout="paged"] .reader-page-image-wrapper.is-active-page {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: calc(100dvh - 132px);
        margin-inline: auto;
        cursor: pointer;
    }

    .reader-page[data-reading-layout="paged"] .reader-page-image-wrapper.is-active-page .reader-page-image {
        max-height: calc(100dvh - 138px);
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }

.reader-page[data-reading-layout="webtoon"] .reader-page-image-wrapper {
    cursor: pointer;
}

/* حالت بارگذاری: بلوک تیرهٔ بدون قاب با یک اسپینر کوچک وسط آن.
   نه شمر متحرک، نه شمارهٔ صفحه — همان چیزی که در ریدرهای وب‌تون استاندارد است. */
.reader-page-image-wrapper .reader-page-status[data-status="loading"] {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
}

/* اسپینر سبک و کوچک؛ روی موبایل هم همین است */
.reader-page-image-wrapper .reader-page-spinner {
    width: 26px;
    height: 26px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, .16);
    border-top-color: #b86bff;
}

/* روی گوشی، بلوک بارگذاری به‌اندازه‌ی دید است تا بین دو تصویر یک
   اسپینر کوچک و یک فضای خالی بزرگ دیده نشود. */
@media (max-width: 700px) {
    .reader-page-image-wrapper .reader-page-status[data-status="loading"] {
        min-height: min(70vh, 620px);
    }
}

@media (max-width: 700px) {
    .reader-mode-button {
        width: 38px;
        height: 38px;
        padding: 0;
    }

        .reader-mode-button span {
            display: none;
        }

    .reader-progress {
        width: calc(100% - 16px);
        left: 50%;
        right: auto;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        height: 40px;
        padding: 0 12px;
        gap: 8px;
    }

    .reader-next-floater {
        left: 52px;
        right: 10px;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        justify-content: space-between;
    }

    .reader-back-to-top {
        left: 8px;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .reader-page-image-wrapper .reader-page-status[data-status="loading"] {
        min-height: 55vh;
        border-radius: 0;
    }
}

/* =====================================================
   نشانک شناور اسکرول خودکار (توقف/ادامه و خروج)
===================================================== */
.reader-autoscroll-pill {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 8px;
    background: rgba(18, 22, 28, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(151, 68, 243, 0.45);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(151, 68, 243, 0.25);
    transition: transform .2s ease, opacity .2s ease, border-color .2s ease;
    animation: readerPillFadeIn .3s ease-out;
}

.reader-autoscroll-pill[hidden] {
    display: none !important;
}

.reader-autoscroll-pill.is-paused {
    border-color: rgba(255, 171, 50, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 14px rgba(255, 171, 50, 0.2);
}

.reader-autoscroll-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 6px;
    outline: none;
}

.reader-autoscroll-pill-btn i {
    color: #b388ff;
    font-size: 14px;
    transition: color .2s ease, transform .15s ease;
}

.reader-autoscroll-pill.is-paused .reader-autoscroll-pill-btn i {
    color: #ffb84d;
}

.reader-autoscroll-pill-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    color: #9aa3af;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    transition: background .15s ease, color .15s ease;
}

.reader-autoscroll-pill-close:hover {
    background: rgba(255, 80, 80, 0.25);
    color: #ff6b6b;
}

@@keyframes readerPillFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@@media (max-width: 480px) {
    .reader-autoscroll-pill {
        bottom: 16px;
        right: 16px;
        padding: 5px 10px 5px 6px;
    }
    .reader-autoscroll-pill-text {
        font-size: 12px;
    }
}
