* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #2f2f2f;
    font-family: 'yekan', Tahoma, sans-serif;
    overscroll-behavior: none;
}

body {
    direction: rtl;
    position: fixed;
    inset: 0;
}

@font-face {
    font-family: 'yekan';
    src: url('https://psoftnet.ir/public/fonts/yekan/yekan.woff2') format('woff2'),
    url('https://psoftnet.ir/public/fonts/yekan/yekan.woff') format('woff'),
    url('https://psoftnet.ir/public/fonts/yekan/yekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

#loading-info {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 14px;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#loading-info.hidden {
    opacity: 0;
    visibility: hidden;
}

#canvas-wrapper {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: fixed;
    inset: 0;
    background: #2f2f2f;
    direction: ltr !important;
    touch-action: none;
}

#my-book {
    visibility: hidden;
    transform: scaleX(-1);
    transform-origin: center center;
    max-width: 100%;
    max-height: 100%;
}

.page {
    width: 100%;
    height: 100%;
    background: transparent !important;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

/* =========================================================
   مهم: معکوس‌سازی مجدد محتوای تمام صفحات (عکس، ویدیو، صوت، متن)
   جهت خنثی کردن اثر آینه‌ای کتابخانه و درست نشان دادن محتوا
   ========================================================= */
/* خنثی‌سازی عمومی برای تمام محتویات داخل هر صفحه */
#my-book .page > *,
#my-book .page .page-content,
#my-book .page .minisite-scrollable,
#my-book .page .contact-page-content,
#my-book .page .contact-form-page {
    transform: scaleX(-1) !important;
    transform-origin: center center !important;
    direction: rtl !important;
    text-align: right !important;
}

/* تصاویر و مدیاهایی که فرزند صفحه هستند */
/* جلوگیری از آینه شدن مجدد تصاویر و ویدیوها درون مینی‌سایت و فرم تماس */
#my-book .page .minisite-scrollable img,
#my-book .page .minisite-scrollable video,
#my-book .page .contact-page-content img,
#my-book .page .page-content img,
#my-book .page .page-content video {
    transform: none !important;
}


/* جلوگیری از آینه شدن مجدد تصاویر درون متون یا مینی‌سایت */
#my-book .page .minisite-scrollable img,
#my-book .page .contact-page-content img,
#my-book .page .page-content img {
    transform: none !important;
}


.page img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
    cursor: zoom-in;
    background: #2f2f2f;
    touch-action: none;
}

.page-ui {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    direction: ltr;
    transform: scaleX(-1);
    transform-origin: center center;
    pointer-events: auto;
}

.page-ui.hidden {
    display: none;
}

.home-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.home-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.home-btn svg {
    width: 18px;
    height: 18px;
    fill: #222;
}

.page-number {
    font-size: 13px;
    color: #222;
    font-weight: bold;
    min-width: 36px;
    text-align: center;
}

#mobile-page-ui {
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 2147483647;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    direction: ltr;
    pointer-events: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

#mobile-page-ui .home-btn {
    width: 28px;
    height: 28px;
}

#mobile-page-ui .home-btn svg {
    width: 16px;
    height: 16px;
}

#mobile-page-ui .page-number {
    font-size: 12px;
    min-width: 28px;
}

#flip-hint {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 99998;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#flip-hint.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
}

.flip-hint-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #1f1f1f;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(5px);
    animation: hintPulse 1.4s ease-in-out infinite;
}

.flip-hint-card svg {
    width: 22px;
    height: 22px;
    fill: #1f1f1f;
    flex: 0 0 auto;
}

.flip-hint-card span {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

@keyframes hintPulse {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

#zoom-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(0, 0, 0, 0.96);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    direction: ltr;
}

#zoom-overlay.active {
    display: flex;
    pointer-events: auto;
}

#zoom-overlay img {
    max-width: 96vw;
    max-height: 96vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.18s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
}

#zoom-overlay img.dragging {
    cursor: grabbing;
}

#zoom-close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 2147483647;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    font-size: 28px;
    line-height: 42px;
    cursor: pointer;
    pointer-events: auto;
}

/* =========================================================
   بخش فرم تماس و عناصر داخلی
   ========================================================= */
.contact-form-page {
    background-color: #fcf8f2;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.form-container {
    width: 100%;
    max-width: 400px;
}

.form-header h1 {
    color: #b71c1c;
    font-size: 24px;
    margin: 10px 0;
}

.form-header h2 {
    color: #333;
    font-size: 16px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border-radius: 50px;
    border: 1px solid #e0e0e0;
    background: #fff;
    text-align: right;
    direction: rtl;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
}

.divider {
    margin: 20px 0;
    font-size: 14px;
    color: #555;
    position: relative;
}

.page.contact-page {
    width: 100%;
    height: 100%;
    background: #f8f0e2 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    direction: rtl;
    touch-action: pan-y;
}

.contact-unmirror {
    width: 100%;
    height: 100%;
    padding: 22px;
    background: #f8f0e2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    direction: rtl;
    text-align: center;
    position: relative;
    z-index: 5;
    touch-action: pan-y;
}

.contact-unmirror * {
    direction: rtl;
}

.contact-unmirror h2 {
    color: #bb1f25;
    font-size: 28px;
    font-weight: 800;
    margin: 10px 0 22px;
    text-align: center;
}

.contact-unmirror form {
    width: min(100%, 420px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-unmirror input,
.contact-unmirror textarea {
    width: 100%;
    border: 1px solid rgba(214, 198, 177, 0.9);
    outline: none;
    background: rgba(255, 255, 255, 0.82);
    color: #4b4b4b;
    font-family: inherit;
    font-size: 16px;
    direction: rtl;
    text-align: right;
    box-shadow: 0 10px 26px rgba(152, 108, 60, 0.12);
}

.contact-unmirror input {
    height: 58px;
    border-radius: 22px;
    padding: 0 18px;
}

.contact-unmirror textarea {
    min-height: 105px;
    border-radius: 22px;
    padding: 16px 18px;
    resize: none;
    line-height: 1.8;
}

.contact-unmirror input::placeholder,
.contact-unmirror textarea::placeholder {
    color: #5f5b57;
    opacity: 1;
}

.contact-unmirror button[type="submit"] {
    width: 100%;
    height: 58px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(180deg, #de2026 0%, #b6181f 100%);
    color: #fff;
    font-family: inherit;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(183, 24, 31, 0.28);
    cursor: pointer;
}

.contact-unmirror button[type="submit"]:active {
    transform: scale(0.99);
}

.contact-page img,
.contact-page .contact-logo {
    width: 82px !important;
    height: auto !important;
    max-width: 40% !important;
    display: block;
    object-fit: contain !important;
    margin: 0 auto 10px !important;
    background: transparent !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    box-shadow: none !important;
    cursor: default !important;
    pointer-events: none !important;
    user-select: none;
    -webkit-user-drag: none;
}

.contact-card {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18px 18px 16px;
    background: #f8f0e2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.contact-top {
    position: relative;
    z-index: 3;
    width: 100%;
    text-align: center;
    padding-top: 6px;
}

.contact-logo {
    width: 82px;
    display: block;
    margin: 0 auto 8px;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.contact-subtitle {
    font-size: 18px;
    color: #bb1f25;
    margin-bottom: 3px;
    line-height: 1.4;
}

.contact-mini {
    font-size: 17px;
    color: #bb1f25;
    margin-bottom: 12px;
    line-height: 1.4;
}

.contact-title {
    color: #bb1f25;
    font-weight: 800;
    line-height: 1.05;
    font-size: 40px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #6c6058;
    font-size: 16px;
    margin-bottom: 18px;
}

.contact-note-line {
    width: 52px;
    height: 1px;
    background: #d6c6b1;
    display: inline-block;
}

.contact-form {
    position: relative;
    z-index: 3;
    width: min(100%, 470px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.contact-field {
    height: 74px;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    box-shadow: 0 10px 26px rgba(152, 108, 60, 0.12);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
}

.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f2e6d6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #bb1f25;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.contact-field input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    height: 100%;
    font-size: 18px;
    color: #4b4b4b;
    text-align: right;
    direction: rtl;
}

.contact-field input::placeholder {
    color: #5f5b57;
    opacity: 1;
}

.contact-btn {
    width: 100%;
    height: 74px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(180deg, #de2026 0%, #b6181f 100%);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(183, 24, 31, 0.28);
    cursor: pointer;
    margin-top: 8px;
}

.contact-btn:active {
    transform: scale(0.99);
}

.contact-deco {
    position: absolute;
    z-index: 1;
    background: linear-gradient(180deg, #d72a2a 0%, #b4181e 100%);
    opacity: 1;
}

.contact-deco-tl {
    top: -36px;
    left: -36px;
    width: 150px;
    height: 150px;
    border-radius: 30px;
    transform: rotate(45deg);
}

.contact-deco-br {
    right: -42px;
    bottom: 110px;
    width: 98px;
    height: 180px;
    border-radius: 28px;
    transform: rotate(45deg);
}

.contact-dots {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
    background-image: radial-gradient(circle, #d7c7b4 2px, transparent 2px);
    background-size: 16px 16px;
}

.contact-dots-left {
    left: 10px;
    top: 172px;
    width: 52px;
    height: 120px;
}

.contact-dots-bottom {
    left: 50%;
    bottom: 26px;
    width: 72px;
    height: 72px;
    transform: translateX(-50%);
}

.contact-rings {
    position: absolute;
    z-index: 1;
    left: -35px;
    bottom: -25px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    border: 1px solid rgba(220, 192, 165, 0.8);
    box-shadow:
            0 0 0 18px rgba(0, 0, 0, 0),
            0 0 0 34px rgba(220, 192, 165, 0.45),
            0 0 0 52px rgba(220, 192, 165, 0.28),
            0 0 0 70px rgba(220, 192, 165, 0.18);
    opacity: 0.8;
}

/* =========================================================
   مدیریت سایز صفحات و مدیا
   ========================================================= */
#my-book .page {
    width: 600px;
    height: 900px;
    overflow: hidden;
}

#my-book .empty-page {
    width: 100%;
    height: 100%;
    background: #fff;
}

#my-book .blank-page {
    background: #fff !important;
}

#my-book .contact-page {
    width: 600px;
    height: 900px;
    overflow: hidden;
    background: #f5f7f8;
}

.contact-page-content {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 72px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    direction: rtl;
    color: #172126;
    background: linear-gradient(180deg, #ffffff 0%, #f2f5f4 100%);
}

.contact-header {
    margin-bottom: 36px;
}

.contact-header h2 {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 0;
}

.contact-header p {
    margin: 0;
    font-size: 17px;
    line-height: 1.9;
    color: #5a676d;
}

#catalog-contact-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 15px;
    font-weight: 700;
    color: #28353b;
}

.form-field input {
    box-sizing: border-box;
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #cbd3d6;
    border-radius: 6px;
    outline: none;
    background: #ffffff;
    color: #172126;
    font: inherit;
}

.form-field input:focus {
    border-color: #147d64;
    box-shadow: 0 0 0 3px rgba(20, 125, 100, 0.12);
}

.contact-submit-btn {
    min-height: 52px;
    padding: 12px 20px;
    border: 0;
    border-radius: 6px;
    background: #147d64;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.contact-submit-btn:hover {
    background: #106b55;
}

.contact-message {
    min-height: 24px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.audio-page-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-page-container audio {
    width: 85%;
}

/* اصلاح جهت متن‌ها و اینپوت‌ها */
.contact-page-content input,
.contact-page-content label,
.contact-page-content button,
.contact-page-content p,
.contact-page-content h2,
.form-field,
#catalog-contact-form {
    direction: rtl !important;
    text-align: right !important;
}

/* اینپوت شماره تماس یا انگلیسی */
.contact-page-content input[type="tel"] {
    direction: ltr !important;
    text-align: left !important;
}

/* =========================================================
   تنظیمات ریسپانسیو و موبایل
   ========================================================= */
@media (max-width: 992px) {
    #canvas-wrapper {
        padding: 8px;
    }

    .page-ui {
        right: 10px;
        bottom: 10px;
    }
}

@media (max-width: 768px) {
    html,
    body {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
        background: #2f2f2f;
    }

    body {
        position: fixed;
        inset: 0;
    }

    #canvas-wrapper {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        background: #2f2f2f !important;
    }

    #my-book {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        transform: scaleX(-1) !important;
        transform-origin: center center !important;
    }

    .stf__parent,
    .stf__wrapper,
    .stf__block,
    .stf__item,
    .stf__page {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        min-width: 100vw !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #2f2f2f !important;
    }

    .page {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #2f2f2f !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .page img {
        width: 100% !important;
        height: 100% !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        display: block !important;
        object-fit: contain !important;
        object-position: center center !important;
        background: #2f2f2f !important;
    }

    .page-ui {
        display: none !important;
    }

    #mobile-page-ui {
        display: flex;
    }

    #flip-hint {
        bottom: 12px;
    }

    .flip-hint-card {
        padding: 8px 12px;
        gap: 8px;
    }

    .flip-hint-card svg {
        width: 20px;
        height: 20px;
    }

    .flip-hint-card span {
        font-size: 13px;
    }

    .page.contact-page {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #f8f0e2 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .contact-unmirror {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        padding: 16px;
        justify-content: center;
        background: #f8f0e2 !important;
    }

    .contact-unmirror h2 {
        font-size: 22px;
        margin: 8px 0 16px;
    }

    .contact-unmirror form {
        width: 100%;
        gap: 10px;
    }

    .contact-unmirror input {
        height: 52px;
        border-radius: 18px;
        padding: 0 14px;
        font-size: 14px;
    }

    .contact-unmirror textarea {
        min-height: 90px;
        border-radius: 18px;
        padding: 12px 14px;
        font-size: 14px;
    }

    .contact-unmirror button[type="submit"] {
        height: 52px;
        border-radius: 18px;
        font-size: 15px;
    }

    .contact-page img,
    .contact-page .contact-logo {
        width: 66px !important;
        height: auto !important;
        max-width: 40% !important;
        margin-bottom: 8px !important;
        object-fit: contain !important;
        background: transparent !important;
    }

    .contact-card {
        width: 100%;
        height: 100%;
        padding: 14px 14px 12px;
    }

    .contact-logo {
        width: 66px;
        margin-bottom: 6px;
    }

    .contact-subtitle {
        font-size: 15px;
    }

    .contact-mini {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .contact-title {
        font-size: 26px;
        gap: 4px;
        margin-bottom: 10px;
    }

    .contact-note {
        font-size: 13px;
        gap: 8px;
        margin-bottom: 14px;
    }

    .contact-note-line {
        width: 30px;
    }

    .contact-form {
        gap: 10px;
        width: 100%;
    }

    .contact-field {
        height: 58px;
        border-radius: 18px;
        padding: 0 12px;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
    }

    .contact-icon svg {
        width: 20px;
        height: 20px;
    }

    .contact-field input {
        font-size: 15px;
    }

    .contact-btn {
        height: 58px;
        border-radius: 18px;
        font-size: 16px;
        margin-top: 4px;
    }

    .contact-deco-tl {
        width: 120px;
        height: 120px;
    }

    .contact-deco-br {
        width: 80px;
        height: 150px;
        bottom: 85px;
    }

    .contact-rings {
        left: -55px;
        bottom: -50px;
        width: 170px;
        height: 170px;
    }
}

/* حل مشکل تداخل نوار کنترل ویدیو با دکمه شماره صفحه */
.page:has(video) .page-ui {
    bottom: 80px !important;
}

/* برای مرورگرهایی که از :has پشتیبانی نمی‌کنند یا برای اطمینان بیشتر */
.page video {
    pointer-events: auto;
}


/* =========================================================
   اعمال فونت یکان به تمام اجزا
   ========================================================= */
button,
input,
textarea,
select,
.page-number,
.flip-hint-card span,
.contact-title,
.contact-subtitle,
.contact-btn,
.contact-submit-btn,
.form-field label,
.form-field input,
.contact-unmirror input,
.contact-unmirror textarea,
.contact-unmirror button {
    font-family: 'yekan', Tahoma, sans-serif !important;
}

/* استایل‌های اختصاصی مینی‌سایت داخل کاتالوگ */
.minisite-page {
    background: #ffffff !important;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.minisite-scrollable {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 24px 18px 80px 18px;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}
.ms-header {
    text-align: center;
    margin-bottom: 20px;
}
.ms-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 0 auto 10px auto;
    display: block;
}
.ms-brand-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 6px 0;
}
.ms-brand-ad {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}
.ms-slider-container {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    background: #000;
}
.ms-slider-track {
    display: flex;
    transition: transform 0.4s ease;
    width: 100%;
    flex-direction: row;     /* جلوگیری از معکوس شدن در RTL والد */
}
.ms-slide {
    min-width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    direction: rtl;          /* محتوای داخل هر اسلاید همچنان فارسی/RTL */
}
.ms-slide img, .ms-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ms-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 5;
}
.ms-slider-prev { right: 8px; }
.ms-slider-next { left: 8px; }
.ms-slider-dots {
    position: absolute;
    bottom: 8px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 5;
}
.ms-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}
.ms-dot.active {
    background: #3b82f6;
    width: 16px;
    border-radius: 4px;
}
.ms-section {
    background: #f8fafc;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}
.ms-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ms-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #3b82f6;
    border-radius: 2px;
}
.ms-about-content {
    font-size: 13px;
    line-height: 1.9;
    color: #334155;
    text-align: justify;
}
.ms-about-content p {
    margin: 0 0 8px 0;
}
.ms-audio-player {
    width: 100%;
    margin-top: 4px;
    height: 38px;
}
.ms-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
    line-height: 1.6;
}
.ms-contact-item:last-child {
    margin-bottom: 0;
}
.ms-contact-link {
    color: #2563eb;
    text-decoration: none;
    direction: ltr;
}

/* =========================================================
   صفحه فهرست مطالب (TOC) — سازگار با ساختار scaleX(-1)
   ========================================================= */
.page.toc-page {
    background: #0f172a !important;
    overflow: hidden;
}

.toc-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #0f172a;
    /* این یک لایه سطح اول است و با مقیاس قرآن صفحه دوبار آینه میشود */
}

.toc-wrapper > .toc-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    padding: 18px;
    transform: scaleX(-1);   /* آینه مجدد برای خنثی کردن آینه والد */
    transform-origin: center center !important;
}

/* پسزمینه جلد (محو) */
.toc-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.22;
    filter: blur(6px);
    transform: none !important;
    pointer-events: none;
    z-index: 1;
}

.toc-card {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    padding: 16px 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
}

.toc-header {
    flex-shrink: 0;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(15, 23, 42, 0.08);
}

.toc-header h2 {
    font-family: 'yekan', Tahoma, sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 3px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.toc-header span {
    font-family: 'yekan', Tahoma, sans-serif;
    font-size: 10px;
    color: #64748b;
}

.toc-list-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-left: 2px;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'yekan', Tahoma, sans-serif;
    font-size: 11px;
    color: #334155;
    padding: 6px 9px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toc-item:hover {
    background: #fff7ed;
    border-color: #fdba74;
}

.toc-item-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.toc-item-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.toc-item-badge {
    font-family: 'yekan', Tahoma, sans-serif;
    font-size: 10px;
    font-weight: 800;
    color: #ea580c;
    background: #ffedd5;
    padding: 1px 6px;
    border-radius: 6px;
    flex-shrink: 0;
}
