        :root {
            --bg-primary: #fbf7ee;
            --bg-surface: #f4edd9;
            --bg-card: #ffffff;
            --text-primary: #2c221e;
            --text-secondary: #5c4d43;
            --accent: #8c2d19;
            --accent-hover: #a6361f;
            --purple: #6a1b9a;
            --purple-hover: #4a148c;
            --gold: #d4af37;
            --border: #e0d5c1;
            --shadow: 0 10px 25px -5px rgba(44, 34, 30, 0.08);
            /* رنگِ جوهرِ نام نویسنده/انتشارات و تیترهای تأکیدی. جدا از --purple
               است چون --purple در بعضی تم‌ها رنگِ «سطح» است نه رنگِ «متن». */
            --ink-accent: var(--purple);
            --card-radius: 12px;
            --font-head: 'Lalezar', cursive, sans-serif;
            --font-body: 'Vazirmatn', sans-serif;
        }

        [data-theme="dark"] {
            --bg-primary: #181412;
            --bg-surface: #241e1b;
            --bg-card: #2e2622;
            --text-primary: #f3eae1;
            --text-secondary: #c0b0a3;
            --accent: #e56b4f;
            --accent-hover: #ff7d61;
            --purple: #ab47bc;
            --purple-hover: #8e24aa;
            --gold: #e5c158;
            --border: #3d322c;
            --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            background-color: var(--bg-primary);
            color: var(--text-primary);
            font-family: var(--font-body);
            line-height: 1.6;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        header {
            background-color: var(--bg-surface);
            border-bottom: 2px solid var(--border);
            padding: 0.8rem 1rem;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: var(--shadow);
        }

        .header-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 8px;
            font-family: var(--font-head);
            font-size: 1.5rem;
            color: var(--accent);
            text-decoration: none;
        }

        .logo i {
            font-size: 1.8rem;
            color: var(--gold);
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .theme-toggle-btn, .cart-btn, .track-btn, .auth-btn, .users-panel-btn, .orders-panel-btn, .notif-btn, .btn {
            background-color: var(--bg-card);
            color: var(--text-primary);
            border: 1px solid var(--border);
            padding: 0.5rem 0.9rem;
            border-radius: 8px;
            cursor: pointer;
            font-family: var(--font-body);
            font-weight: 600;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 6px;
            position: relative;
           
            z-index: 10;
        }

        @media (max-width: 560px) {
            .track-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
        }

        .cart-badge, .notif-badge {
            background-color: var(--accent);
            color: #fff;
            font-size: 0.7rem;
            border-radius: 50%;
            padding: 2px 6px;
            font-weight: bold;
        }

        .notif-badge {
            background-color: #e74c3c;
            position: absolute;
            top: -5px;
            right: -5px;
            display: none;
        }

        .btn-accent {
            background-color: var(--accent);
            color: #fff;
            border: none;
        }

        .btn-accent:hover {
            background-color: var(--accent-hover);
        }

        .btn-purple {
            background-color: var(--purple);
            color: #fff;
            border: none;
        }

        .btn-purple:hover {
            background-color: var(--purple-hover);
        }

        .hero {
            background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
            padding: 2.5rem 1rem;
            text-align: center;
            border-bottom: 1px solid var(--border);
        }

        .hero h1 {
            font-family: var(--font-head);
            font-size: 2.2rem;
            color: var(--accent);
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .hero p {
            font-size: 0.9rem;
            color: var(--text-secondary);
            padding: 0 0.5rem;
        }

        .daisy-title-wrap {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            position: relative;
            color: var(--gold);
        }

        .daisy-flower-svg {
            width: 32px;
            height: 32px;
            vertical-align: middle;
            animation: spinFlower 20s linear infinite;
        }

        @keyframes spinFlower {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        .search-bar-container {
            max-width: 500px;
            margin: 1.2rem auto 0 auto;
            position: relative;
            padding: 0 1rem;
        }

        /* ── فیلتر بر اساس نویسنده / مترجم / انتشارات ── */
        .field-filter-bar {
            max-width: 1200px;
            margin: 0 auto 1rem;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            background: var(--bg-surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            font-size: 0.9rem;
        }
        .field-filter-bar .ff-text { color: var(--text-secondary); }
        .field-filter-bar .ff-value { color: var(--accent); font-weight: bold; }
        .field-filter-bar .ff-count { color: var(--text-secondary); font-size: 0.82rem; }
        .field-filter-bar .ff-clear {
            margin-inline-start: auto;
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text-primary);
            border-radius: 20px;
            padding: 6px 14px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.82rem;
        }
        .field-filter-bar .ff-clear:hover { background: var(--border); }
        /* ── ردیف‌های ژانری با اسکرول افقی (فقط گوشی) ── */
        /* width:100% لازم است — بدون آن، ردیفِ افقی کل صفحه را پهن می‌کند
           و مرورگر گوشی مجبور می‌شود صفحه را زوم‌اوت کند. */
        .genre-rows {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 4px;
            box-sizing: border-box;
        }
        .genre-row { margin-bottom: 26px; min-width: 0; }

        /* ═══════════════ تم مناسبتی:  روز جهانی بتمن ═══════════════
           فقط رنگ‌ها عوض می‌شوند، نه ساختار. برای همین با یک کلید
           (data-bat) روشن و خاموش می‌شود و هیچ چیز دیگری را دست نمی‌زند.

           ⚠️ نشان و نام رسمی بتمن علامت تجاری است و این‌جا استفاده نشده.
           آن‌چه می‌بینی خفاشِ واقعی، آسمان شب و نورافکن است. */
        /* پالتِ این تم پایین‌تر، در بلوکِ «روز جهانی بتمن»، تعریف شده —
           یک‌جا، تا دو تعریفِ هم‌نام روی هم نیفتند. */
        /* کمی حال‌وهوا: نور کم‌رمقِ بالای صفحه، مثل نورافکنِ دور */
        html[data-bat="on"] body::before {
            content: '';
            position: fixed;
            top: -30vh; left: 50%;
            width: 90vw; max-width: 900px; height: 70vh;
            transform: translateX(-50%);
            background: radial-gradient(ellipse at center,
                        rgba(255, 210, 48, 0.13), rgba(255, 210, 48, 0) 68%);
            pointer-events: none;
            z-index: 0;
        }
        html[data-bat="on"][data-theme="dark"] body::before { opacity: 1; }
        html[data-bat="on"] body::before { opacity: .55; }

        /* ── پرده‌ی ورود: خفاش‌ها به سمت صفحه می‌آیند ── */
        #bat-intro {
            position: fixed; inset: 0; z-index: 2147483000;
            background: radial-gradient(ellipse at 50% 18%, #1b1f2b 0%, #06070a 62%);
            display: flex; align-items: center; justify-content: center;
            overflow: hidden; cursor: pointer;
        }
        #bat-intro.gone { animation: batIntroOut .55s ease forwards; }
        @keyframes batIntroOut { to { opacity: 0; visibility: hidden; } }

        #bat-intro .beam {
            position: absolute; top: -12%; left: 50%;
            width: 70vmin; height: 92vh;
            transform: translateX(-50%);
            /* نورافکن از بالا باریک شروع می‌شود و پایین پهن می‌شود */
            clip-path: polygon(38% 0%, 62% 0%, 100% 100%, 0% 100%);
            background: linear-gradient(to bottom,
                        rgba(255,210,48,.30), rgba(255,210,48,.06) 55%, rgba(255,210,48,0));
            filter: blur(26px);
            /* لبه‌های عمودی نور را محو می‌کند تا مستطیل دیده نشود */
            -webkit-mask-image: linear-gradient(to left, transparent, #000 22%, #000 78%, transparent);
            mask-image: linear-gradient(to left, transparent, #000 22%, #000 78%, transparent);
            animation: beamPulse 2.6s ease-in-out infinite;
        }
        @keyframes beamPulse { 0%,100%{opacity:.55} 50%{opacity:1} }

        #bat-intro .halo {
            position: absolute; top: 14%; left: 50%;
            width: 34vmin; height: 34vmin; transform: translateX(-50%);
            border-radius: 50%;
            background: radial-gradient(circle, rgba(255,214,64,.34), rgba(255,214,64,0) 70%);
            filter: blur(6px);
        }

        #bat-intro .bat {
            position: absolute;
            width: 54px; height: 54px;
            /* خفاش‌ها سیاه‌اند، ولی لبه‌شان نورِ چراغ را می‌گیرد — وگرنه
               در آسمانِ تیره اصلاً دیده نمی‌شوند. */
            fill: #0a0c12;
            filter: drop-shadow(0 0 5px rgba(255, 214, 64, .55))
                    drop-shadow(0 0 14px rgba(255, 214, 64, .22));
            opacity: 0;
            will-change: transform, opacity;
            animation: batFly var(--dur, 2.4s) cubic-bezier(.45,.02,.75,.35) var(--delay, 0s) forwards;
        }
        /* از ته آسمان می‌آیند، بزرگ می‌شوند و از کنار قاب رد می‌شوند */
        @keyframes batFly {
            0%   { opacity: 0;   transform: translate(-50%,-50%) translate(var(--fx), var(--fy)) scale(.12) rotate(var(--rot)); }
            18%  { opacity: .95; }
            78%  { opacity: 1; }
            100% { opacity: 0;   transform: translate(-50%,-50%) translate(var(--tx), var(--ty)) scale(var(--ts, 3.4)) rotate(var(--rot2)); }
        }
        /* بال‌زدن: کمی فشرده و باز شدن افقی */
        #bat-intro .bat > svg {
            width: 100%; height: 100%;
            animation: batFlap .34s ease-in-out infinite;
            transform-origin: 50% 45%;
        }
        @keyframes batFlap {
            0%,100% { transform: scaleX(1)   scaleY(1); }
            50%     { transform: scaleX(.52) scaleY(1.1); }
        }

        #bat-intro .skip {
            position: absolute; bottom: 7%; left: 0; right: 0;
            text-align: center; color: #8b93a3;
            font-family: var(--font-body); font-size: .8rem;
            letter-spacing: .5px;
            animation: skipIn .5s ease 1.1s both;
        }
        @keyframes skipIn { from{opacity:0} to{opacity:.85} }

        @media (prefers-reduced-motion: reduce) {
            #bat-intro .bat, #bat-intro .bat > svg, #bat-intro .beam { animation: none; }
            #bat-intro .bat { opacity: .9; }
        }


        /* ═══════════════ تم مناسبتی: روز جهانی بتمنن ═══════════════
           طراحی اختصاصی Batcave، بت‌سیگنال آسمان و انیمیشن پرتاب هوک بتمن */
        html[data-bat="on"] {
            --bg-primary: #0b0c10;
            --bg-surface: #12141a;
            --bg-card: #1a1d26;
            --text-primary: #e9ecf3;
            --text-secondary: #a2aabb;
            /* در این تم --purple رنگِ سطحِ تیره است، پس متن باید جوهرِ خودش
               را داشته باشد وگرنه سیاه روی سیاه می‌افتد. */
            --ink-accent: #9db4ff;
            --accent: #ffd230;
            --accent-hover: #ffe04d;
            --purple: #1f2433;
            --purple-hover: #2b3247;
            --gold: #ffd230;
            --border: #313849;
            --shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.8);
        }
        html[data-bat="on"][data-theme="dark"] {
            --bg-primary: #050608;
            --bg-surface: #0a0c10;
            --bg-card: #12151d;
            --text-primary: #eaedf4;
            --text-secondary: #9aa3b5;
            --ink-accent: #a3b9ff;
            --accent: #ffd230;
            --accent-hover: #ffe04d;
            --purple: #161925;
            --purple-hover: #212638;
            --gold: #ffd230;
            --border: #2a3140;
            --shadow: 0 14px 35px -6px rgba(0, 0, 0, 0.95);
        }

        /* ═══════════════ تم مناسبتی: جشن مهرگان ═══════════════
           جشن ایزد مهر: پیمان، روشنایی پیش از برآمدن خورشید، و پاییز.
           نمادها از خودِ متن‌های کهن آمده: تاج خورشیدگونِ شاه، خوان ارغوانی،
           انار و به و انگور، برگ چنار، و مرواریدنشانِ هنر ساسانی.
           با (data-occ="mehregan") روشن و خاموش می‌شود و به تم روشن/تاریک
           سایت احترام می‌گذارد. هیچ چیزِ دیگری را دست نمی‌زند. */
        html[data-occ="mehregan"] {
            --bg-primary: #fff8ea;
            --bg-surface: #fbeccb;
            --bg-card: #fffdf7;
            --text-primary: #2f1419;
            --text-secondary: #6b4a4d;
            --accent: #a4162f;            /* انار */
            --accent-hover: #c21e3b;
            --purple: #6a2a8c;            /* ارغوانِ خوان مهرگان */
            --purple-hover: #521f6e;
            --ink-accent: #6a2a8c;
            --gold: #c98a0b;              /* زعفرانی */
            --border: #ead6ab;
            --shadow: 0 10px 25px -5px rgba(96, 40, 30, 0.14);
        }
        html[data-occ="mehregan"][data-theme="dark"] {
            --bg-primary: #16090f;
            --bg-surface: #231118;
            --bg-card: #2d1922;
            --text-primary: #fdeedd;
            --text-secondary: #d3b8b2;
            --accent: #ea5470;
            --accent-hover: #ff6b85;
            --purple: #9b45c9;
            --purple-hover: #b45fe0;
            --ink-accent: #dcaaf2;
            --gold: #f3c34f;
            --border: #4a2b36;
            --shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.7);
        }

        .occ-hero-scene {
            display: none;
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: 0;
        }
        html[data-occ="mehregan"] .occ-hero-scene { display: block; }

        /* سپیده‌دم: نوری که پیش از خورشید زمین را روشن می‌کند (مهر، نه خودِ خورشید) */
        html[data-occ="mehregan"] .hero {
            position: relative;
            overflow: hidden;
            padding-top: 9rem;
            padding-bottom: 3.2rem;
            border-bottom: 2px solid var(--gold);
            background:
                radial-gradient(ellipse 75% 95% at 50% -8%, #ffe4a0 0%, rgba(255, 210, 130, .55) 34%, transparent 72%),
                linear-gradient(180deg, #fdebc6 0%, var(--bg-surface) 100%) !important;
        }
        html[data-occ="mehregan"][data-theme="dark"] .hero {
            background:
                radial-gradient(ellipse 75% 95% at 50% -8%, rgba(230, 128, 44, .62) 0%, rgba(140, 46, 78, .38) 38%, transparent 74%),
                linear-gradient(180deg, #2f1434 0%, #1a0c14 100%) !important;
        }
        html[data-occ="mehregan"] .hero > *:not(.occ-hero-scene) {
            position: relative;
            z-index: 2;
        }

        /* مرواریدنشان — ردیف مروارید لبه‌ی هنرِ ساسانی، زیر بخش hero و زیر هدر */
        html[data-occ="mehregan"] .hero::after {
            content: '';
            position: absolute;
            left: 0; right: 0; bottom: 0;
            height: 16px;
            z-index: 1;
            pointer-events: none;
            background: radial-gradient(circle at 50% 50%, var(--gold) 0 3.4px, transparent 3.9px) 0 0 / 17px 16px repeat-x;
            opacity: .95;
        }
        html[data-occ="mehregan"] header { border-bottom-color: var(--gold); }
        html[data-occ="mehregan"] header::after {
            content: '';
            position: absolute;
            left: 0; right: 0; top: 100%;
            height: 10px;
            pointer-events: none;
            background: radial-gradient(circle at 50% 4px, var(--gold) 0 2.6px, transparent 3.1px) 0 0 / 14px 10px repeat-x;
            opacity: .9;
        }

        /* خورشیدِ مهر: تاجِ چرخان + هاله‌ی نفس‌کشنده + دکمه‌ی مرکزی که با زدن شعله‌ور می‌شود */
        .occ-sun-stage { position: absolute; left: 50%; top: 0; width: 0; height: 0; }
        .occ-sun-glow {
            position: absolute;
            width: 560px; height: 560px; left: -280px; top: -222px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(255, 244, 190, .95) 0%, rgba(255, 205, 96, .7) 22%, rgba(255, 150, 50, .32) 46%, transparent 70%);
            animation: occBreath 5s ease-in-out infinite alternate;
            transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .7s;
        }
        html[data-occ="mehregan"][data-theme="dark"] .occ-sun-glow {
            background: radial-gradient(circle, rgba(255, 214, 120, .85) 0%, rgba(255, 150, 60, .5) 24%, rgba(226, 92, 44, .22) 48%, transparent 70%);
        }
        .occ-sun-rays {
            position: absolute;
            width: 470px; height: 470px; left: -235px; top: -177px;
            filter: drop-shadow(0 0 14px rgba(255, 190, 70, .85));
            transition: transform .7s cubic-bezier(.2, .8, .2, 1), filter .7s;
        }
        .occ-sun-rays-in { width: 100%; height: 100%; animation: occSpin 120s linear infinite; }
        .occ-sun-rays svg { width: 100%; height: 100%; display: block; overflow: visible; }
        .occ-sun-core {
            position: absolute;
            width: 112px; height: 112px; left: -56px; top: 2px;
            border: 0; padding: 0; border-radius: 50%;
            background: transparent;
            cursor: pointer;
            pointer-events: auto;
            -webkit-tap-highlight-color: transparent;
        }
        .occ-sun-core:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
        .occ-sun-core::after {
            content: '';
            position: absolute; inset: -6px;
            border-radius: 50%;
            border: 2px solid rgba(255, 224, 138, .9);
            opacity: 0;
            animation: occPing 3.2s ease-out infinite;
        }
        .occ-sun-core:hover::after { animation-duration: 1.6s; }
        .occ-sun-stage:hover .occ-sun-rays { filter: drop-shadow(0 0 20px rgba(255, 190, 70, 1)) brightness(1.1); }
        .occ-sun-core.flare { animation: occFlare .9s cubic-bezier(.2, .8, .2, 1); }
        .occ-sun-stage.h1 .occ-sun-glow { transform: scale(1.18); }
        .occ-sun-stage.h1 .occ-sun-rays { transform: scale(1.1); filter: drop-shadow(0 0 26px rgba(255, 180, 60, 1)) brightness(1.18) saturate(1.2); }
        .occ-sun-stage.h2 .occ-sun-glow { transform: scale(1.4); }
        .occ-sun-stage.h2 .occ-sun-rays { transform: scale(1.22); filter: drop-shadow(0 0 40px rgba(255, 170, 40, 1)) brightness(1.35) saturate(1.35); }
        .occ-sun-stage.h3 .occ-sun-glow { transform: scale(1.75); opacity: 1; }
        .occ-sun-stage.h3 .occ-sun-rays { transform: scale(1.36); filter: drop-shadow(0 0 60px rgba(255, 160, 30, 1)) brightness(1.6) saturate(1.5); }
        @keyframes occBreath { from { opacity: .78; transform: scale(1); } to { opacity: 1; transform: scale(1.07); } }
        @keyframes occPing { 0% { transform: scale(.85); opacity: .7; } 70%, 100% { transform: scale(1.55); opacity: 0; } }
        @keyframes occFlare { 0% { transform: scale(1); } 25% { transform: scale(1.22); } 100% { transform: scale(1); } }

        /* افکتِ کلیک روی خورشید — یک لایه‌ی ثابت روی همه‌چیز که به کلیک‌ها دست نمی‌زند */
        #occ-fx { position: fixed; inset: 0; z-index: 9500; pointer-events: none; overflow: hidden; }
        .occ-wash {
            position: absolute; inset: 0;
            background: radial-gradient(circle at var(--x) var(--y), rgba(255, 236, 160, var(--a1)) 0%, rgba(255, 176, 62, var(--a2)) 34%, transparent 74%);
            animation: occWash 2.6s ease-out forwards;
        }
        html[data-theme="dark"] .occ-wash { mix-blend-mode: screen; }
        html:not([data-theme="dark"]) .occ-wash { background: radial-gradient(circle at var(--x) var(--y), rgba(255, 244, 190, var(--a1)) 0%, rgba(255, 190, 70, var(--a2)) 34%, transparent 74%); }
        .occ-flash { position: absolute; inset: 0; background: #fff6d0; animation: occFlash .8s ease-out forwards; }
        .occ-ring {
            position: absolute; left: var(--x); top: var(--y);
            width: 110px; height: 110px; margin: -55px 0 0 -55px;
            border-radius: 50%;
            border: 3px solid rgba(255, 214, 100, .95);
            box-shadow: 0 0 22px 4px rgba(255, 170, 40, .7), inset 0 0 18px rgba(255, 220, 120, .6);
            opacity: 0;
            animation: occRing 1.9s cubic-bezier(.15, .7, .3, 1) var(--d) forwards;
        }
        .occ-beams {
            position: absolute; left: var(--x); top: var(--y);
            width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2) 0 0 calc(var(--sz) / -2);
            border-radius: 50%;
            background: repeating-conic-gradient(rgba(255, 226, 140, .7) 0 3deg, transparent 3deg 15deg);
            -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 24%, transparent 62%);
            mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 24%, transparent 62%);
            opacity: 0;
            animation: occBeams 3.2s ease-out forwards;
        }
        .occ-ember {
            position: absolute; left: var(--x); top: var(--y);
            width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
            border-radius: 50%;
            background: radial-gradient(circle, #fff8d0 0%, #ffc94a 45%, #ff8a1f 100%);
            box-shadow: 0 0 8px 2px rgba(255, 170, 40, .9);
            opacity: 0;
            animation: occEmber var(--t) cubic-bezier(.2, .7, .3, 1) var(--d) forwards;
        }
        .occ-say {
            position: absolute; left: 50%; top: var(--y);
            transform: translateX(-50%);
            white-space: nowrap;
            font-size: 1.15rem; font-weight: 800;
            color: #fff8d6;
            padding: .3rem 1.2rem;
            border-radius: 999px;
            background: linear-gradient(90deg, rgba(164, 22, 47, .82), rgba(210, 100, 20, .82));
            border: 1px solid rgba(255, 224, 138, .9);
            text-shadow: 0 1px 6px rgba(80, 20, 0, .6);
            box-shadow: 0 0 26px rgba(255, 170, 40, .65);
            animation: occSay 2.5s ease-out forwards;
        }
        .occ-say.l3 { font-size: 1.4rem; box-shadow: 0 0 44px rgba(255, 190, 60, .95); }
        @keyframes occWash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
        @keyframes occFlash { 0% { opacity: 0; } 14% { opacity: .55; } 100% { opacity: 0; } }
        @keyframes occRing { 0% { opacity: 0; transform: scale(.3); } 12% { opacity: 1; } 100% { opacity: 0; transform: scale(var(--to)); } }
        @keyframes occBeams { 0% { opacity: 0; transform: rotate(0) scale(.5); } 18% { opacity: var(--o); } 100% { opacity: 0; transform: rotate(50deg) scale(1); } }
        @keyframes occEmber { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.15); } }
        @keyframes occSay { 0% { opacity: 0; transform: translate(-50%, 14px) scale(.9); } 14% { opacity: 1; transform: translate(-50%, 0) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px); } }

        /* برچسبِ «جشن مهرگان فرخنده باد» — با کلیک، داستانِ مهرگان باز می‌شود */
        .occ-greeting {
            position: absolute;
            top: 118px;
            left: 50%;
            transform: translateX(-50%);
            white-space: nowrap;
            font-family: inherit;
            font-size: .78rem;
            font-weight: 600;
            padding: 3px 14px 4px;
            border-radius: 999px;
            color: var(--accent);
            border: 1px solid var(--gold);
            background: rgba(255, 255, 255, .6);
            z-index: 3;
            pointer-events: auto;
            cursor: pointer;
            transition: background .25s, box-shadow .25s;
        }
        .occ-greeting span { opacity: .75; font-weight: 500; }
        .occ-greeting:hover { background: #fff; box-shadow: 0 4px 14px -4px rgba(164, 22, 47, .45); }
        html[data-occ="mehregan"][data-theme="dark"] .occ-greeting { background: rgba(0, 0, 0, .38); color: var(--gold); }
        html[data-occ="mehregan"][data-theme="dark"] .occ-greeting:hover { background: rgba(0, 0, 0, .6); }

        .occ-fruit {
            position: absolute;
            bottom: 12px;
            border: 0; padding: 0; background: none;
            cursor: pointer;
            pointer-events: auto;
            -webkit-tap-highlight-color: transparent;
            --r: 0deg;
            filter: drop-shadow(0 6px 8px rgba(90, 20, 30, .28));
            animation: occFloat 6.5s ease-in-out infinite alternate;
        }
        .occ-fruit svg { width: 100%; height: auto; display: block; }
        .occ-fruit:hover { filter: drop-shadow(0 6px 12px rgba(255, 170, 40, .8)); }
        .occ-fruit:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
        .occ-fruit.f1 { left: 3%;  width: 76px; --r: -14deg; }
        .occ-fruit.f2 { right: 4%; width: 70px; --r: 12deg; animation-delay: -2.2s; }
        .occ-fruit.f3 { left: 13%; width: 46px; --r: 8deg;  animation-delay: -4s; bottom: 6px; }
        .occ-fruit.f4 { right: 14%; width: 44px; --r: -10deg; animation-delay: -1.2s; bottom: 6px; }
        @keyframes occFloat {
            from { transform: translateY(0) rotate(var(--r)); }
            to   { transform: translateY(-9px) rotate(calc(var(--r) + 5deg)); }
        }
        @keyframes occSpin { to { transform: rotate(360deg); } }

        /* برگ‌های چنار — فقط transform (کارت گرافیک)، نه CPU */
        #occ-leaves {
            position: fixed;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: 60;
        }
        html:not([data-occ="mehregan"]) #occ-leaves { display: none; }
        .occ-leaf {
            position: absolute;
            top: -48px;
            will-change: transform;
            animation: occFall linear infinite;
        }
        .occ-leaf i, .occ-intro-leaf i {
            display: block;
            animation: occSway ease-in-out infinite alternate;
        }
        .occ-leaf b, .occ-intro-leaf b { display: block; }
        .occ-leaf svg, .occ-intro-leaf svg { width: 100%; height: auto; display: block; }
        @keyframes occFall {
            from { transform: translate3d(0, -6vh, 0) rotate(var(--r0)); }
            to   { transform: translate3d(var(--dx), 112vh, 0) rotate(var(--r1)); }
        }
        @keyframes occSway {
            from { transform: translateX(-20px); }
            to   { transform: translateX(20px); }
        }
        /* باد: موس (یا انگشت) که از کنار برگ رد شود، برگ کنار می‌رود، می‌چرخد و زیرِ نور برق می‌زند */
        .occ-leaf b.gust, .occ-intro-leaf b.gust {
            animation: occGust 1.15s cubic-bezier(.2, .75, .3, 1);
        }
        @keyframes occGust {
            0%   { transform: none; filter: none; }
            32%  { transform: translate(var(--gx), -16px) rotate(var(--gr)) scale(1.2);
                   filter: brightness(1.35) saturate(1.4) hue-rotate(-20deg) drop-shadow(0 0 6px rgba(255, 190, 80, .85)); }
            100% { transform: none; filter: none; }
        }

        /* کتاب‌ها در روزهای مهرگان: آرام بالا و پایین می‌روند و نورِ سپیده از رویشان رد می‌شود.
           از خاصیتِ translate استفاده شده (نه transform) تا با افکت‌های hover خودِ کارت تداخل نکند. */
        @media (prefers-reduced-motion: no-preference) {
            html[data-occ="mehregan"] .book-card { animation: occBookFloat 6s ease-in-out infinite; }
            html[data-occ="mehregan"] .book-card:nth-child(3n+2) { animation-delay: -2s; }
            html[data-occ="mehregan"] .book-card:nth-child(3n)   { animation-delay: -4s; }
            html[data-occ="mehregan"] .book-card:hover { animation-play-state: paused; }
            html[data-occ="mehregan"] .book-cover-wrap::after {
                content: '';
                position: absolute;
                top: -20%; bottom: -20%;
                left: 0;
                width: 45%;
                pointer-events: none;
                z-index: 2;
                background: linear-gradient(100deg, transparent 0%, rgba(255, 226, 150, .38) 50%, transparent 100%);
                transform: translateX(-160%) skewX(-12deg);
                animation: occSheen 9s ease-in-out infinite;
            }
            html[data-occ="mehregan"] .book-card:nth-child(3n+2) .book-cover-wrap::after { animation-delay: -3s; }
            html[data-occ="mehregan"] .book-card:nth-child(3n)   .book-cover-wrap::after { animation-delay: -6s; }
        }
        @keyframes occBookFloat {
            0%, 100% { translate: 0 0; }
            50%      { translate: 0 -5px; }
        }
        @keyframes occSheen {
            0%, 72%  { transform: translateX(-160%) skewX(-12deg); }
            100%     { transform: translateX(330%) skewX(-12deg); }
        }
        html[data-occ="mehregan"] .book-card { transition: box-shadow .35s ease, border-color .35s ease; }
        html[data-occ="mehregan"] .book-card:hover {
            border-color: var(--gold);
            box-shadow: 0 0 0 1px var(--gold), 0 16px 34px -12px rgba(201, 138, 11, .6);
        }

        /* ── شمارش معکوس تا مناسبتِ بعدی (بالای صفحه، برای همه) ── */
        #occ-countdown {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: .55rem .8rem;
            padding: .55rem 2.6rem .55rem 1rem;
            color: #fff7e0;
            font-size: .88rem;
            background: linear-gradient(90deg, #6a2a8c 0%, #a4162f 55%, #c98a0b 100%);
            box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .15);
            animation: occFadeIn .5s ease both;
        }
        #occ-countdown[data-for="gotham"] { background: linear-gradient(90deg, #0b0f1a, #1c2436 60%, #3a3f55); }
        .occ-cd-ico { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
        .occ-cd-ico svg { width: 100%; height: 100%; animation: occSpin 30s linear infinite; overflow: visible; }
        .occ-cd-txt b { color: #ffe08a; }
        .occ-cd-num { display: inline-flex; gap: 6px; direction: rtl; }
        .occ-cd-box {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            min-width: 44px;
            padding: 2px 6px 3px;
            border-radius: 6px;
            background: rgba(0, 0, 0, .22);
            border: 1px solid rgba(255, 224, 138, .35);
            line-height: 1.25;
        }
        .occ-cd-box b { font-size: 1rem; font-variant-numeric: tabular-nums; }
        .occ-cd-box small { font-size: .62rem; opacity: .8; }
        .occ-cd-more {
            font-family: inherit;
            font-size: .75rem;
            color: #2f1419;
            background: #ffe08a;
            border: none;
            border-radius: 999px;
            padding: 3px 12px;
            cursor: pointer;
        }
        .occ-cd-more:hover { background: #fff0bf; }
        .occ-cd-x {
            position: absolute;
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 26px; height: 26px;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, .2);
            color: #fff;
            font-size: 1.05rem;
            line-height: 1;
            cursor: pointer;
        }
        .occ-cd-x:hover { background: rgba(0, 0, 0, .38); }

        /* ── پرده‌ی ورود — سپیده‌دم، تاج خورشیدگون و بیتی از شاهنامه ──
           تا خودِ بازدیدکننده نزند بسته نمی‌شود. */
        #occ-intro {
            position: fixed;
            inset: 0;
            z-index: 100000;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: #fff3d6;
            cursor: pointer;
            overflow-x: hidden;
            overflow-y: auto;
            padding: 1.2rem 1rem 3rem;
            background: radial-gradient(ellipse 95% 75% at 50% 112%, #ffb347 0%, #e0562b 22%, #8a2452 50%, #2c1238 78%, #140a20 100%);
            transition: opacity .6s ease, transform .6s ease;
            animation: occFadeIn .5s ease both;
        }
        #occ-intro.gone { opacity: 0; transform: scale(1.04); pointer-events: none; }
        .occ-intro-sun {
            width: min(46vw, 230px);
            aspect-ratio: 1;
            flex-shrink: 0;
            animation: occSunRise 2.3s cubic-bezier(.2, .8, .2, 1) both;
            filter: drop-shadow(0 0 30px rgba(255, 190, 80, .65));
        }
        .occ-intro-sun svg { width: 100%; height: 100%; display: block; animation: occSpin 40s linear infinite; overflow: visible; }
        .occ-intro-title {
            font-family: var(--font-head);
            font-size: clamp(2.3rem, 9vw, 4.2rem);
            line-height: 1.25;
            margin-top: .5rem;
            background: linear-gradient(180deg, #fff6d8 0%, #ffc857 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            opacity: 0;
            animation: occFadeUp 1s .9s ease forwards;
        }
        .occ-intro-sub {
            font-size: clamp(1rem, 3.6vw, 1.3rem);
            opacity: 0;
            animation: occFadeUp 1s 1.25s ease forwards;
        }

        /* بیتِ شاهنامه: خطِ نستعلیق، دو مصراع کنارِ هم مثل نسخه‌های خطی، در جدولِ زرین */
        .occ-verse {
            max-width: 96vw;
            margin: 1.6rem 0 0;
            opacity: 0;
            animation: occFadeUp 1.2s 1.9s ease forwards;
        }
        .occ-verse-frame {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1.6em;
            padding: .35em 1.8em .55em;
            border: 1px solid rgba(243, 195, 79, .75);
            outline: 1px solid rgba(243, 195, 79, .35);
            outline-offset: 5px;
            border-radius: 3px;
            background: radial-gradient(ellipse at center, rgba(255, 200, 90, .13), rgba(255, 200, 90, 0) 72%);
        }
        .occ-verse-frame::before,
        .occ-verse-frame::after {
            content: '✦';
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            color: #f3c34f;
            font-size: .85rem;
            line-height: 1;
        }
        .occ-verse-frame::before { right: -.5em; }
        .occ-verse-frame::after  { left: -.5em; }
        .occ-misra {
            font-family: 'DaisyNastaliq', 'IranNastaliq', 'Noto Nastaliq Urdu', serif;
            font-weight: normal;
            font-size: calc(clamp(1.7rem, 5vw, 2.7rem) * var(--mz, 1));
            line-height: 1.9;
            color: #fff3d0;
            text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
            white-space: nowrap;
        }
        .occ-verse-dot { color: #f3c34f; font-size: 1rem; opacity: .8; }
        .occ-verse figcaption {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: .55rem;
            margin-top: 1.1rem;
            font-size: .85rem;
            color: #ffe2a8;
        }
        .occ-shahnameh-ico {
            height: 3em;
            width: auto;
            filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55));
            animation: occBookBob 3.6s ease-in-out infinite;
        }
        @keyframes occBookBob {
            0%, 100% { transform: translateY(0) rotate(-3deg); }
            50%      { transform: translateY(-3px) rotate(2deg); }
        }
        .occ-intro-go {
            margin-top: 1.6rem;
            font-family: inherit;
            font-size: .95rem;
            font-weight: 600;
            color: #2f1419;
            background: linear-gradient(180deg, #ffe7a3, #f3c34f);
            border: none;
            border-radius: 999px;
            padding: .55rem 1.6rem;
            cursor: pointer;
            box-shadow: 0 8px 22px -8px rgba(255, 190, 80, .8);
            opacity: 0;
            animation: occFadeUp 1s 2.6s ease forwards;
        }
        .occ-intro-go:hover { filter: brightness(1.06); }
        .occ-intro-skip {
            position: absolute;
            bottom: 14px;
            left: 0; right: 0;
            font-size: .72rem;
            opacity: .55;
        }
        @keyframes occFadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes occFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
        @keyframes occSunRise {
            from { transform: translateY(45vh) scale(.5); opacity: 0; }
            to   { transform: none; opacity: 1; }
        }
        .occ-intro-leaf {
            position: absolute;
            top: -40px;
            will-change: transform;
            animation: occFall linear forwards;
        }

        /* ── داستانِ مهرگان (پنجره‌ی «درباره‌ی مهرگان») ── */
        .occ-story {
            position: fixed;
            inset: 0;
            z-index: 100001;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            background: rgba(20, 8, 16, .62);
            animation: occFadeIn .3s ease both;
        }
        .occ-story-card {
            position: relative;
            width: min(640px, 100%);
            max-height: 88vh;
            overflow-y: auto;
            color: var(--text-primary);
            background: var(--bg-card);
            border: 1px solid var(--gold);
            border-radius: 14px;
            box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45);
        }
        .occ-story-head {
            position: relative;
            padding: 1.4rem 1.4rem 1rem;
            text-align: center;
            color: #fff3d6;
            background: radial-gradient(ellipse 90% 120% at 50% 120%, #ffb347 0%, #e0562b 30%, #8a2452 62%, #2c1238 100%);
            border-radius: 13px 13px 0 0;
        }
        .occ-story-head .occ-story-sun { width: 64px; height: 64px; margin: 0 auto .3rem; }
        .occ-story-head .occ-story-sun svg { width: 100%; height: 100%; animation: occSpin 40s linear infinite; overflow: visible; }
        .occ-story-head h3 { font-family: var(--font-head); font-size: 1.7rem; margin: 0; color: #ffe08a; }
        .occ-story-head p { margin: .2rem 0 0; font-size: .82rem; opacity: .9; }
        .occ-story-x {
            position: absolute;
            top: 10px; left: 10px;
            width: 32px; height: 32px;
            border-radius: 50%;
            border: none;
            background: rgba(0, 0, 0, .28);
            color: #fff;
            font-size: 1.2rem;
            cursor: pointer;
        }
        .occ-story-body { padding: 1.1rem 1.3rem 1.4rem; font-size: .9rem; line-height: 2; }
        .occ-story-body p { margin: 0 0 .7rem; }
        .occ-story-body h4 { margin: 1.1rem 0 .5rem; font-size: .95rem; color: var(--accent); }
        .occ-story-verse {
            margin: .9rem 0 .4rem;
            padding: .3rem .8rem .5rem;
            text-align: center;
            border-top: 1px solid var(--gold);
            border-bottom: 1px solid var(--gold);
            font-family: 'DaisyNastaliq', 'IranNastaliq', 'Noto Nastaliq Urdu', serif;
            font-size: 1.55rem;
            line-height: 2;
            color: var(--purple);
        }
        html[data-theme="dark"] .occ-story-verse { color: var(--ink-accent, #dcaaf2); }
        .occ-story-verse small {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            font-family: 'Vazirmatn', sans-serif;
            font-size: .72rem;
            line-height: 1.6;
            color: var(--text-secondary);
        }
        .occ-story-verse small img { height: 1.9em; width: auto; }
        .occ-sym-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .55rem; }
        .occ-sym {
            display: flex;
            gap: .6rem;
            align-items: flex-start;
            padding: .55rem .65rem;
            border-radius: 10px;
            background: var(--bg-surface);
            border: 1px solid var(--border);
            line-height: 1.7;
        }
        .occ-sym-ico { flex: 0 0 34px; height: 34px; font-size: 1.5rem; line-height: 34px; text-align: center; }
        .occ-sym-ico svg { width: 34px; height: 34px; display: block; }
        .occ-sym b { display: block; font-size: .86rem; color: var(--text-primary); }
        .occ-sym span { font-size: .76rem; color: var(--text-secondary); }
        .occ-sofreh { display: flex; flex-wrap: wrap; gap: .45rem; }
        .occ-sofreh span {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 12px 3px 10px;
            border-radius: 999px;
            border: 1px solid var(--gold);
            background: var(--bg-surface);
            font-size: .8rem;
        }
        .occ-sofreh svg { width: 20px; height: 20px; display: block; }

        /* ── پنل مدیر: امروز در سه تقویم ── */
        .occ-today { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .6rem 0 .3rem; }
        .occ-cal-chip {
            font-family: inherit;
            text-align: right;
            cursor: pointer;
            padding: .55rem .7rem;
            border-radius: 12px;
            color: var(--text-primary);
            background: var(--bg-card);
            border: 1px solid var(--border);
            transition: border-color .2s, box-shadow .2s;
        }
        .occ-cal-chip:hover { border-color: var(--gold); }
        .occ-cal-chip .occ-cal-k { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--text-secondary); }
        .occ-cal-chip b { display: block; font-size: .95rem; margin: .2rem 0 .05rem; }
        .occ-cal-chip small { font-size: .66rem; color: var(--text-secondary); }
        .occ-cal-chip.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: linear-gradient(160deg, rgba(243, 195, 79, .16), transparent 70%), var(--bg-card); }
        .occ-cal-chip.on .occ-cal-k { color: var(--gold); font-weight: 700; }
        .occ-cal-chip.shah .occ-cal-k i { color: #f3c34f; }
        .occ-cal-hint { font-size: .7rem; color: var(--text-secondary); margin-bottom: .7rem; }

        /* ── پنل مدیر: فهرستِ تم‌ها و پوشه‌ی آرشیو (مثل تلگرام) ── */
        .occ-archive-head { font-size: .82rem; font-weight: 700; margin: .9rem 0 .4rem; color: var(--text-primary); }
        .occ-archive-hint { font-size: .74rem; color: var(--text-secondary); margin-bottom: .6rem; }
        .occ-view.slide { animation: occSlideIn .28s ease both; }
        .occ-view.slide.back { animation-name: occSlideBack; }
        @keyframes occSlideIn   { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
        @keyframes occSlideBack { from { opacity: 0; transform: translateX(26px); }  to { opacity: 1; transform: none; } }
        .occ-folder {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            font-family: inherit;
            text-align: right;
            cursor: pointer;
            padding: .6rem .8rem;
            margin-bottom: .55rem;
            border-radius: 10px;
            color: var(--text-primary);
            background: var(--bg-card);
            border: 1px solid var(--border);
            transition: background .2s;
        }
        .occ-folder:hover { background: var(--bg-surface); }
        .occ-folder-ico {
            flex: 0 0 40px; height: 40px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 50%;
            color: #fff;
            background: linear-gradient(160deg, #9aa4b2, #6b7482);
            font-size: 1rem;
        }
        .occ-folder-body { flex: 1; min-width: 0; }
        .occ-folder-body b { display: block; font-size: .88rem; }
        .occ-folder-body small { display: block; font-size: .72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .occ-folder-n {
            min-width: 22px; height: 22px;
            padding: 0 7px;
            border-radius: 999px;
            font-size: .72rem; font-weight: 700;
            display: inline-flex; align-items: center; justify-content: center;
            color: #fff; background: #8a93a1;
        }
        .occ-arch-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: .6rem;
            font-size: .9rem;
            font-weight: 700;
        }
        .occ-arch-back {
            width: 32px; height: 32px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: var(--bg-card);
            color: var(--text-primary);
            cursor: pointer;
        }
        .occ-arch-back:hover { background: var(--bg-surface); }
        .occ-empty { font-size: .78rem; color: var(--text-secondary); padding: .8rem; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }

        .occ-card {
            display: flex;
            gap: 10px;
            align-items: flex-start;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: .7rem .8rem;
            margin-bottom: .55rem;
        }
        .occ-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
        .occ-card.arch { opacity: .92; }
        .occ-card-ico {
            flex: 0 0 38px; height: 38px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 50%;
            background: var(--bg-surface);
            color: var(--accent);
            font-size: 1rem;
        }
        .occ-card-body { flex: 1; min-width: 0; }
        .occ-card-name { font-size: .88rem; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
        .occ-card-blurb { font-size: .74rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.7; }
        .occ-card-meta { font-size: .7rem; color: var(--text-secondary); margin-top: 4px; opacity: .9; }
        .occ-card-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: .5rem; }
        .occ-pill {
            font-size: .66rem; font-weight: 700;
            padding: 1px 8px; border-radius: 999px;
            color: #1b5e20; background: #c8e6c9; border: 1px solid #a5d6a7;
        }
        [data-theme="dark"] .occ-pill { color: #a5f3b0; background: rgba(46,125,50,.22); border-color: rgba(129,199,132,.5); }
        .occ-pill.gray { color: var(--text-secondary); background: var(--bg-surface); border-color: var(--border); }

        /* آمار بازدید: ستون‌های ۱۴ روزِ اخیر */
        .occ-stats { margin-top: 6px; font-size: .7rem; color: var(--text-secondary); }
        .occ-spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; margin-top: 4px; direction: ltr; }
        .occ-spark i {
            flex: 1;
            min-height: 2px;
            border-radius: 2px 2px 0 0;
            background: var(--gold);
            opacity: .85;
        }
        .occ-spark i.z { background: var(--border); opacity: .6; }

        .occ-btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
        .occ-btn-ghost:hover { background: var(--bg-surface); }
        .occ-sched {
            margin-top: .6rem;
            padding: .6rem .7rem;
            border: 1px dashed var(--border);
            border-radius: 8px;
            background: var(--bg-surface);
        }
        .occ-sched label { font-size: .72rem; display: block; margin: .35rem 0 .15rem; color: var(--text-secondary); }
        /* انتخاب‌گرِ تاریخ با تقویمِ انتخاب‌شده (شمسی / شاهنشاهی / میلادی) */
        .occ-pk { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
        .occ-pk select {
            font-family: inherit;
            font-size: .8rem;
            padding: 5px 6px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-card);
            color: var(--text-primary);
        }
        .occ-pk .occ-pk-time { display: inline-flex; align-items: center; gap: 3px; direction: ltr; }
        .occ-pk-sep { font-size: .72rem; color: var(--text-secondary); margin: 0 4px; }
        .occ-sched .occ-lbl { font-size: .72rem; color: var(--accent); margin-top: 3px; min-height: 1em; }
        .occ-sched .occ-lbl2 { font-size: .66rem; color: var(--text-secondary); }

        @media (max-width: 640px) {
            .occ-sun-glow { width: 400px; height: 400px; left: -200px; top: -154px; }
            .occ-sun-rays { width: 340px; height: 340px; left: -170px; top: -124px; }
            .occ-sun-core { width: 88px; height: 88px; left: -44px; top: 2px; }
            html[data-occ="mehregan"] .hero { padding-top: 7.6rem; }
            .occ-greeting { top: 96px; }
            .occ-say { font-size: .95rem; }
            .occ-foot-scene .occ-orn.bl, .occ-foot-scene .occ-orn.br { display: none; }
            .occ-orn { width: 40px; height: 40px; }
            .occ-orn svg { width: 26px; height: 26px; }
            .occ-fruit.f1 { width: 54px; left: 1%; }
            .occ-fruit.f2 { width: 50px; right: 1%; }
            .occ-fruit.f3, .occ-fruit.f4 { display: none; }
            html[data-occ="mehregan"] .hero { padding-bottom: 2.6rem; }
            .occ-verse-frame { flex-direction: column; gap: 0; padding: .4em 1.1em .6em; }
            .occ-verse-dot { display: none; }
            .occ-misra { white-space: normal; }
            .occ-today { grid-template-columns: 1fr; }
            .occ-cd-txt { width: 100%; text-align: center; }
        }
        @media (prefers-reduced-motion: reduce) {
            .occ-sun-rays-in, .occ-sun-glow, .occ-sun-core::after, .occ-sun-core.flare, .occ-intro-sun svg, .occ-cd-ico svg, .occ-story-head .occ-story-sun svg, .occ-shahnameh-ico { animation: none; }
            .occ-leaf b.gust, .occ-intro-leaf b.gust { animation: none; }
        }


        /* ── مدالیون‌های نمادهای مهرگان در گوشه‌ها ── */
        .occ-orn {
            position: absolute;
            width: 46px; height: 46px;
            display: flex; align-items: center; justify-content: center;
            padding: 0;
            border-radius: 50%;
            border: 2px solid var(--gold);
            background: radial-gradient(circle at 35% 30%, #fffaf0 0%, #fdebc6 100%);
            box-shadow: 0 4px 12px -3px rgba(120, 40, 20, .45);
            cursor: pointer;
            pointer-events: auto;
            z-index: 3;
            transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
            -webkit-tap-highlight-color: transparent;
        }
        html[data-theme="dark"] .occ-orn { background: radial-gradient(circle at 35% 30%, #4a2436 0%, #2a1120 100%); box-shadow: 0 4px 14px -3px rgba(0, 0, 0, .8); }
        .occ-orn svg { width: 30px; height: 30px; display: block; }
        .occ-orn:hover, .occ-orn:focus-visible { transform: translateY(-3px) scale(1.1); box-shadow: 0 8px 18px -4px rgba(255, 170, 40, .75); outline: none; }
        .occ-orn::after {
            content: attr(data-n) "\A" attr(data-m);
            white-space: pre-line;
            position: absolute;
            top: calc(100% + 8px);
            width: max-content; max-width: 170px;
            padding: 5px 10px 6px;
            border-radius: 9px;
            background: rgba(58, 18, 30, .96);
            color: #fff2cf;
            font-size: .7rem; line-height: 1.7; font-weight: 500;
            text-align: center;
            opacity: 0; visibility: hidden;
            transform: translateY(-4px);
            transition: opacity .2s, transform .2s, visibility .2s;
            pointer-events: none;
        }
        .occ-orn.up::after { top: auto; bottom: calc(100% + 8px); }
        .occ-orn.tl::after, .occ-orn.bl::after { left: 0; }
        .occ-orn.tr::after, .occ-orn.br::after { right: 0; }
        .occ-orn:hover::after, .occ-orn:focus-visible::after { opacity: 1; visibility: visible; transform: none; }
        .occ-hero-scene > .occ-orn.tl { top: 14px; left: 3%; }
        .occ-hero-scene > .occ-orn.tr { top: 14px; right: 3%; }

        /* پاورقی: چهار نمادِ دیگر در چهار گوشه؛ دو تا روی خطِ بالا، دو تا در گوشه‌های پایین */
        html[data-occ="mehregan"] footer { position: relative; border-top: 2px solid var(--gold); }
        .occ-foot-scene { position: absolute; inset: 0; pointer-events: none; }
        .occ-foot-scene .occ-orn.tl { top: -23px; left: 3%; }
        .occ-foot-scene .occ-orn.tr { top: -23px; right: 3%; }
        .occ-foot-scene .occ-orn.bl { bottom: 12px; left: 3%; }
        .occ-foot-scene .occ-orn.br { bottom: 12px; right: 3%; }
        .occ-foot-scene .occ-orn { background: radial-gradient(circle at 35% 30%, #fffaf0 0%, #fdebc6 100%); }
        html[data-theme="dark"] .occ-foot-scene .occ-orn { background: radial-gradient(circle at 35% 30%, #4a2436 0%, #2a1120 100%); }

        /* پنجره‌ی داستان: نمادِ انتخاب‌شده از گوشه‌ها و فهرستِ خوراکی‌ها */
        .occ-sym.pick { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 6px 18px -6px rgba(255, 170, 40, .7); }
        .occ-foods { margin-top: .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-surface); padding: .1rem .8rem; }
        .occ-foods summary { cursor: pointer; padding: .55rem 0; font-size: .85rem; font-weight: 700; color: var(--accent); }
        .occ-foods h5 { margin: .7rem 0 .2rem; font-size: .82rem; color: var(--accent); }
        .occ-foods ul { margin: 0 0 .4rem; padding: 0; list-style: none; font-size: .78rem; line-height: 1.9; color: var(--text-secondary); }
        .occ-foods li b { color: var(--text-primary); }

        .occ-pk-row { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

        /* ── پنل «کمپین تخفیف» ── */
        .camp-pill-sch { color: #0d47a1; background: #bbdefb; border-color: #90caf9; }
        [data-theme="dark"] .camp-pill-sch, html[data-bat="on"] .camp-pill-sch { color: #9fd0ff; background: rgba(33,111,200,.22); border-color: rgba(100,170,255,.5); }
        .cpn { background: var(--bg-surface); padding: 1rem; border-radius: 12px; margin-bottom: 1.2rem; border: 1px solid var(--border); }
        .cpn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
        .cpn-title { display: flex; gap: .7rem; align-items: flex-start; flex: 1 1 280px; }
        .cpn-ic { flex: 0 0 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--purple, #9b45c9)); }
        .cpn-title h4 { margin: 0 0 2px; font-size: 1.02rem; color: var(--accent); }
        .cpn-title p { margin: 0; font-size: .76rem; line-height: 1.9; color: var(--text-secondary); }
        .cpn-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem 1rem; margin-bottom: .8rem; }
        .cpn-step { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: .9rem; margin-bottom: .75rem; color: var(--text-primary); }
        .cpn-step b { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; color: #fff; background: var(--accent); }
        .cpn-badge { font-size: .66rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; color: var(--accent); border: 1px solid var(--accent); }
        .cpn-badge.alt { color: var(--text-secondary); border-color: var(--border); }
        .cpn-sub { font-size: .8rem; margin-bottom: .5rem; color: var(--text-primary); }
        .cpn-sub small, .cpn-field small, .cpn-check small { color: var(--text-secondary); font-size: .7rem; font-weight: 400; }
        .cpn-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
        .cpn-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
        .cpn-field > span { font-size: .78rem; font-weight: 700; }
        .cpn-field small { line-height: 1.7; }
        .cpn-unit { position: relative; }
        .cpn-unit .form-control { width: 100%; padding-left: 2.1rem; }
        .cpn-unit em { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--text-secondary); font-size: .85rem; pointer-events: none; }
        .cpn-cals { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; font-size: .74rem; color: var(--text-secondary); }
        .cpn-cal { font-family: inherit; font-size: .74rem; padding: 4px 11px; border-radius: 999px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-primary); transition: all .2s; }
        .cpn-cal.on { background: var(--accent); border-color: var(--accent); color: #fff; }
        .cpn-when-col { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .8rem; background: var(--bg-surface); display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
        .cpn-when-h { font-weight: 800; font-size: .82rem; display: flex; align-items: center; gap: 6px; }
        .cpn-when-col.s .cpn-when-h i { color: #2e9d55; }
        .cpn-when-col.e .cpn-when-h i { color: #d0473a; }
        .cpn-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; align-self: flex-start; }
        .cpn-seg button { font-family: inherit; font-size: .75rem; padding: 5px 13px; border: 0; cursor: pointer; background: var(--bg-card); color: var(--text-secondary); }
        .cpn-seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
        .cpn-seg button:disabled { opacity: .45; cursor: not-allowed; }
        .cpn-hint { font-size: .72rem; color: var(--text-secondary); line-height: 1.8; }
        .cpn-pk .occ-pk select { font-family: inherit; }
        .cpn-pk .occ-lbl { font-size: .74rem; color: var(--accent); margin-top: 4px; }
        .cpn-pk .occ-lbl2 { font-size: .66rem; color: var(--text-secondary); }
        .cpn-presets { display: flex; gap: 5px; flex-wrap: wrap; }
        .cpn-presets button { font-family: inherit; font-size: .7rem; padding: 3px 10px; border-radius: 999px; cursor: pointer; border: 1px dashed var(--border); background: transparent; color: var(--accent); }
        .cpn-presets button:hover { background: var(--bg-card); border-style: solid; }
        .cpn-tl { display: flex; align-items: stretch; gap: 0; margin-top: .85rem; }
        .cpn-tl-n { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .74rem; padding: .55rem .7rem; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--border); position: relative; }
        .cpn-tl-n i { position: absolute; top: 12px; right: -1px; width: 4px; height: 20px; border-radius: 3px; }
        .cpn-tl-n.s i { background: #2e9d55; } .cpn-tl-n.e i { background: #d0473a; }
        .cpn-tl-n b { font-size: .7rem; color: var(--text-secondary); }
        .cpn-tl-n span { font-weight: 700; color: var(--text-primary); line-height: 1.6; }
        .cpn-tl-n em { font-style: normal; color: var(--accent); font-size: .7rem; }
        .cpn-tl-n small { color: var(--text-secondary); font-size: .64rem; }
        .cpn-tl-l { flex: 0 0 74px; display: flex; align-items: center; justify-content: center; position: relative; }
        .cpn-tl-l::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--border); }
        .cpn-tl-l em { position: relative; font-style: normal; font-size: .66rem; background: var(--bg-card); padding: 0 6px; color: var(--accent); font-weight: 700; }
        .cpn-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
        .cpn-chip { cursor: pointer; margin: 0; }
        .cpn-chip input { position: absolute; opacity: 0; pointer-events: none; }
        .cpn-chip span { display: inline-block; font-size: .78rem; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary); transition: all .2s; }
        .cpn-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
        .cpn-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
        .cpn-more { margin-top: .9rem; border: 1px dashed var(--border); border-radius: 10px; }
        .cpn-more summary { cursor: pointer; padding: .55rem .8rem; font-size: .8rem; font-weight: 700; color: var(--accent); list-style: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
        .cpn-more summary::-webkit-details-marker { display: none; }
        .cpn-more summary span { font-weight: 400; font-size: .68rem; color: var(--text-secondary); }
        .cpn-adv { padding: .3rem .8rem .9rem; }
        .cpn-rule { display: grid; gap: 6px; align-items: center; margin-bottom: 6px; }
        .cpn-rule.two { grid-template-columns: 1fr 1fr auto; }
        .cpn-rule.three { grid-template-columns: 1fr 1fr 1fr auto; }
        .cpn-rule .form-control { width: 100%; min-width: 0; }
        .cpn-x { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: #d0473a; cursor: pointer; }
        .cpn-x:hover { background: rgba(208, 71, 58, .12); }
        .cpn-btn { font-family: inherit; font-size: .76rem; padding: 6px 13px; border-radius: 9px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-primary); display: inline-flex; gap: 6px; align-items: center; }
        .cpn-btn:hover { border-color: var(--accent); color: var(--accent); }
        .cpn-btn.primary { border-color: var(--accent); color: var(--accent); }
        .cpn-search { max-width: 360px; }
        .cpn-results { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
        .cpn-hit { font-family: inherit; font-size: .76rem; text-align: right; width: 100%; max-width: 360px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; }
        .cpn-hit:hover { border-color: var(--accent); }
        .cpn-hit span { color: var(--text-secondary); }
        .cpn-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-surface); }
        .cpn-tag b { cursor: pointer; color: #d0473a; }
        .cpn-empty { font-size: .74rem; color: var(--text-secondary); margin-bottom: 6px; }
        .cpn-check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 .7rem; cursor: pointer; font-size: .82rem; }
        .cpn-check input { margin-top: 5px; }
        .cpn-code-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
        .cpn-code { width: 190px; text-align: center; letter-spacing: 1px; text-transform: uppercase; }
        .cpn-note { font-size: .72rem; color: var(--text-secondary); line-height: 1.9; margin-top: 6px; }
        .cpn-note.warn { color: #b26a00; background: rgba(255, 170, 40, .13); border: 1px solid rgba(255, 170, 40, .4); border-radius: 8px; padding: 5px 10px; }
        [data-theme="dark"] .cpn-note.warn { color: #ffcc80; }
        .cpn-preview { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); padding: .8rem 1rem; margin-bottom: .8rem; }
        .cpn-pv-h { font-weight: 800; font-size: .84rem; margin-bottom: .55rem; color: var(--text-primary); }
        .cpn-pv-h small { font-weight: 400; font-size: .68rem; color: var(--text-secondary); margin-right: 6px; }
        .cpn-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .5rem; }
        .cpn-tile { border-radius: 10px; padding: .55rem .7rem; background: var(--bg-surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
        .cpn-tile b { font-size: 1.3rem; color: var(--text-primary); }
        .cpn-tile span { font-size: .68rem; color: var(--text-secondary); line-height: 1.6; }
        .cpn-tile.hi { border-color: var(--accent); } .cpn-tile.hi b { color: var(--accent); }
        .cpn-msg { font-size: .8rem; line-height: 1.9; margin-top: .4rem; }
        .cpn-codev { color: var(--accent); }
        .cpn-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .6rem; flex-wrap: wrap; padding: .7rem 0 .2rem; background: linear-gradient(180deg, transparent, var(--bg-surface) 40%); }
        .cpn-go, .cpn-stop { font-family: inherit; font-size: .88rem; font-weight: 800; padding: .6rem 1.4rem; border-radius: 11px; border: 0; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
        .cpn-go { color: #fff; background: linear-gradient(135deg, var(--accent), var(--purple, #9b45c9)); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .4); flex: 1 1 200px; justify-content: center; }
        .cpn-stop { color: #d0473a; background: transparent; border: 1px solid #d0473a; }
        .cpn-go:disabled, .cpn-stop:disabled { opacity: .6; cursor: wait; }
        @media (max-width: 640px) {
            .cpn-grid2, .cpn-tiles { grid-template-columns: 1fr; }
            .cpn-rule.two, .cpn-rule.three { grid-template-columns: 1fr auto; }
            .cpn-rule.two .form-control, .cpn-rule.three .form-control { grid-column: 1; }
            .cpn-rule .cpn-x { grid-column: 2; grid-row: 1; }
            .cpn-tl { flex-direction: column; }
            .cpn-tl-l { flex: 0 0 30px; }
            .cpn-tl-l::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-right: 2px dashed var(--border); }
        }
        .cpn-pk .occ-pk-row { flex-basis: 100%; }
        .cpn-pick-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
        .cpn-danger { color: #d0473a; border-color: rgba(208, 71, 58, .5); }
        .cpn-danger:hover { background: rgba(208, 71, 58, .12); color: #d0473a; border-color: #d0473a; }
        .cpn-ask { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .76rem; padding: 4px 10px; border-radius: 9px; background: rgba(208, 71, 58, .1); border: 1px solid rgba(208, 71, 58, .45); }
        .cpn-ask b { color: #d0473a; }
        .cpn-ask button { font-family: inherit; font-size: .74rem; padding: 3px 12px; border-radius: 7px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-primary); }
        .cpn-ask button.yes { background: #d0473a; border-color: #d0473a; color: #fff; font-weight: 700; }

        /* ── پنل‌های مدیریت: نمایش درست روی موبایل ── */
        .modal-content { overflow-x: hidden; }
        .ord-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 15px; margin-bottom: 15px; }
        .ord-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; border-bottom: 1px solid rgba(140, 45, 25, .1); padding-bottom: 12px; }
        .ord-info { text-align: right; min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
        .ord-total { font-weight: bold; color: var(--accent); font-size: 1.1rem; white-space: nowrap; }
        .ord-row { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }
        .ord-field { flex: 1; min-width: 200px; }
        .ord-btns { display: flex; flex-direction: column; gap: 8px; min-width: 180px; flex-shrink: 0; }
        .ord-btns2 { display: flex; gap: 8px; width: 100%; }
        .trash-row { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
        .trash-row .tr-info { min-width: 0; overflow-wrap: anywhere; }
        .trash-row small { display: block; color: var(--text-secondary); font-size: .72rem; margin-top: 2px; }
        @media (max-width: 640px) {
            html .modal-overlay { padding: 0; align-items: flex-end; }
            html .modal-content { max-height: 94vh; min-height: 0 !important; border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: .9rem .8rem 1.2rem; }
            html .modal-header { position: sticky; top: -.9rem; z-index: 6; background: var(--bg-card); margin: -.9rem -.8rem .8rem; padding: .8rem .8rem .6rem; }
            html .modal-title { font-size: 1.02rem; line-height: 1.6; }
            html .admin-panel-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 4px; padding: .4rem .4rem 0; margin-bottom: 1rem; }
            html .admin-panel-tabs button { display: flex; white-space: normal; flex-direction: column; align-items: center; gap: 3px; padding: .5rem .2rem .55rem; font-size: .7rem; line-height: 1.5; text-align: center; white-space: normal; }
            html .admin-panel-tabs button i { font-size: 1.05rem; }
            html #tab-btn-users { white-space: nowrap; font-size: .68rem; }
            html .panel-content-area [style*="max-height"] { max-height: 55vh !important; }
            html #all-users-list-container > div > div, html #admins-list-container > div > div { flex-wrap: wrap; gap: 8px; }
            html #all-users-list-container > div > div > div, html #admins-list-container > div > div > div { min-width: 0; overflow-wrap: anywhere; }
            html #orders-list-admin { max-height: none !important; padding-right: 0 !important; }
            html .ord-card { padding: 12px; }
            html .ord-head { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
            html .ord-total { align-self: flex-start; }
            html .ord-field, html .ord-btns { min-width: 0; flex: 1 1 100%; }
            html .ord-btns { flex-shrink: 1; }
            html #admin-orders-top-actions { width: 100%; }
            html #admin-orders-top-actions .btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
            html #orders-manager-modal .modal-content { max-height: 96vh; }
            html .trash-row { flex-direction: column; align-items: stretch; }
            html .trash-row .btn { width: 100%; justify-content: center; }
        }


        /* ── لیبل پستی ── */
        .lbl-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
        .lbl-warn { margin-top: .8rem; font-size: .8rem; color: #b26a00; background: rgba(255, 170, 40, .13); border: 1px solid rgba(255, 170, 40, .4); border-radius: 8px; padding: 6px 10px; }
        .lbl-form { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; padding: .8rem; background: var(--bg-surface); border-radius: 10px; }
        .lbl-form label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; }
        @media (max-width: 640px) { html .lbl-form { grid-template-columns: 1fr; } html .lbl-actions .btn { flex: 1 1 calc(50% - 8px); justify-content: center; } }
        /* ═══ مهرگان — نمایشگاهِ هدر: ایزد مهر (چپ) · فروهر (بالا، وسط) · سه درفش (پایین) · سفره‌ی مهرگان (راست) ═══ */
        html[data-occ="mehregan"] .hero {
            --fh: clamp(150px, 19vw, 236px);       /* ارتفاع فروهر */
            --ffh: clamp(74px, 8vw, 104px);        /* ارتفاع درفش‌ها */
            --pad: 1.6rem;
            display: grid;
            direction: ltr;
            grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr);
            grid-template-areas:
                "mi fa si"
                "mi gr si"
                "mi ti si"
                "mi su si"
                "mi se si"
                "mi fl si";
            column-gap: 18px;
            row-gap: 6px;
            align-items: start;
            padding: var(--pad) max(1.2rem, calc((100% - 1260px) / 2)) 2.8rem;
        }
        html[data-occ="mehregan"] .hero > h1,
        html[data-occ="mehregan"] .hero > p,
        html[data-occ="mehregan"] .hero > .search-bar-container,
        html[data-occ="mehregan"] .hero > .occ-greeting { direction: rtl; }
        html[data-occ="mehregan"] .hero > h1 { grid-area: ti; margin: 0; }
        html[data-occ="mehregan"] .hero > p { grid-area: su; margin: 0; }
        html[data-occ="mehregan"] .hero > .search-bar-container { grid-area: se; width: 100%; margin: 4px auto 6px; }
        /* خورشید دقیقاً پشتِ فروهر بدرخشد (هسته‌اش زیرِ فروهر است؛ زدن روی فروهر آن را شعله‌ور می‌کند) */
        html[data-occ="mehregan"] .occ-sun-stage { top: calc(var(--pad) + var(--fh) / 2 - 58px); }

        html[data-occ="mehregan"] .hero > .occ-greeting {
            grid-area: gr; position: static; transform: none; justify-self: center; margin: -2px 0 4px;
        }

        /* فروهر: بزرگ‌ترین و کشیده‌ترین */
        .occ-fara {
            grid-area: fa; justify-self: center;
            border: 0; padding: 0; background: none; cursor: pointer; display: block;
            height: var(--fh); max-width: 100%;
            -webkit-tap-highlight-color: transparent;
        }
        .occ-fara img {
            height: 100%; width: auto; max-width: 100%; display: block; object-fit: contain;
            filter: drop-shadow(0 8px 14px rgba(70, 30, 0, .45)) drop-shadow(0 0 18px rgba(255, 190, 70, .55));
            animation: occFloat 6s ease-in-out infinite;
            transition: filter .4s, transform .4s;
        }
        .occ-fara:hover img { filter: drop-shadow(0 8px 16px rgba(70, 30, 0, .5)) drop-shadow(0 0 30px rgba(255, 190, 70, .95)); transform: scale(1.025); }
        .occ-fara:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
        @keyframes occFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

        /* ایزد مهر و سفره‌ی مهرگان: دو سوی صحنه، هم‌تراز با کفِ هدر */
        .occ-fig {
            position: relative; align-self: stretch; min-height: 0;
            border: 0; padding: 0; background: none; cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        .occ-fig.l { grid-area: mi; }
        .occ-fig.r { grid-area: si; }
        .occ-fig img {
            position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
            max-height: 100%; max-width: 100%; width: auto; height: auto; display: block;
            filter: drop-shadow(0 10px 16px rgba(70, 30, 0, .38));
            transition: filter .35s, transform .35s;
        }
        .occ-fig:hover img { filter: drop-shadow(0 10px 20px rgba(70, 30, 0, .45)) drop-shadow(0 0 22px rgba(255, 190, 70, .8)); transform: translateX(-50%) translateY(-3px); }
        .occ-fig:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 14px; }

        /* سه درفشِ متحرک */
        .occ-flags {
            grid-area: fl; direction: ltr;
            display: flex; justify-content: center; align-items: flex-end;
            gap: clamp(18px, 3.2vw, 44px); margin-top: 6px;
        }
        .occ-flag { margin: 0; text-align: center; }
        .occ-flagwrap { position: relative; display: inline-block; }
        .occ-flag canvas { display: block; width: calc(var(--ffh) * var(--ar)); height: calc(var(--ffh) + 12px); }
        .occ-flagwrap::before {          /* میله‌ی زرین */
            content: ''; position: absolute; left: -3px; top: 2px; bottom: 0; width: 4px; border-radius: 3px;
            background: linear-gradient(90deg, #8a5a00, #f5c542 45%, #8a5a00);
            box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
        }
        .occ-flagwrap::after {           /* گوی سرِ میله */
            content: ''; position: absolute; left: -5px; top: -3px; width: 8px; height: 8px; border-radius: 50%;
            background: radial-gradient(circle at 35% 30%, #fff3b0, #d9a21b 60%, #8a5a00);
        }
        .occ-flag figcaption { font-size: .68rem; color: var(--text-secondary); margin-top: 2px; direction: rtl; font-weight: 600; }

        /* کدِ تخفیف: گوشه‌ی بالا-راستِ هدر */
        html[data-occ="mehregan"] .hero { position: relative; }
        html[data-occ="mehregan"] .hero > .occ-promo {
            position: absolute; top: .8rem; right: 1rem; z-index: 6; direction: rtl;
            display: flex; align-items: center; gap: 8px; max-width: min(300px, 26vw);
            padding: 8px 12px; border-radius: 14px; cursor: pointer; text-align: right;
            font: 600 .76rem/1.7 inherit; font-family: inherit; color: var(--text-primary);
            background: color-mix(in srgb, var(--bg-surface) 88%, #d9a42a 12%);
            border: 1px dashed #c9962b; box-shadow: 0 3px 12px rgba(0,0,0,.12);
        }
        .occ-promo:hover { border-style: solid; }
        .occ-promo-ico { font-size: 1.25rem; flex: 0 0 auto; }
        .occ-promo-code { font-family: 'Courier New', monospace; letter-spacing: .06em; color: #fff; background: var(--accent); padding: 0 7px; border-radius: 6px; }
        @media (max-width: 1100px) { html[data-occ="mehregan"] .hero > .occ-promo { max-width: 240px; font-size: .7rem; } }
        @media (max-width: 900px) {
            html[data-occ="mehregan"] .hero { column-gap: 8px; }
        }
        @media (max-width: 720px) {
            html[data-occ="mehregan"] .hero {
                --fh: clamp(110px, 38vw, 170px);
                --ffh: clamp(58px, 17vw, 84px);
                --pad: 4.1rem;
                grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
                grid-template-areas: "fa fa" "gr gr" "ti ti" "su su" "se se" "fl fl" "mi si";
                padding: var(--pad) 1rem 2.4rem;
            }
            html[data-occ="mehregan"] .hero > h1 { font-size: 1.7rem; }
            html[data-occ="mehregan"] .hero > .occ-promo { left: .7rem; right: .7rem; top: .6rem; max-width: none; justify-content: center; font-size: .72rem; padding: 6px 10px; }
            .occ-fig { min-height: 190px; margin-top: 8px; }
            .occ-fig.l { justify-self: stretch; }
            .occ-flags { gap: 14px; }
            .occ-flag figcaption { font-size: .6rem; }
        }
        @media (prefers-reduced-motion: reduce) { .occ-fara img { animation: none; } }


        /* پنجره‌ی کوچکِ ایزد مهر / موبد بزرگ */
        .occ-figm-card { width: min(520px, 100%); }
        .occ-figm-head { padding: 1.2rem 1.2rem .9rem; }
        .occ-figm-img { display: block; margin: 0 auto .4rem; height: 190px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
        .occ-figm-img.sit { height: 170px; }
        .occ-figm-head h3 { font-size: 1.35rem !important; line-height: 1.7; }
        .occ-figm-list { list-style: none; margin: 0; padding: 1rem 1.25rem .4rem; font-size: .9rem; line-height: 2; text-align: right; }
        .occ-figm-list li { position: relative; padding: 0 1.1rem 0 0; margin-bottom: .6rem; }
        .occ-figm-list li::before { content: '✦'; position: absolute; right: 0; top: 0; color: var(--gold); font-size: .75rem; }
        .occ-figm-list b { color: var(--accent); }
        .occ-figm-foot { padding: .2rem 1.25rem 1.2rem; text-align: center; }
        .occ-figm-more { font-family: inherit; font-size: .8rem; font-weight: 600; padding: 5px 16px; border-radius: 999px; cursor: pointer; color: var(--accent); background: transparent; border: 1px solid var(--gold); }
        .occ-figm-more:hover { background: rgba(243, 195, 79, .18); }
        .ship-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
        .ship-row input { padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--bg-card); color:var(--text-primary); direction:ltr; text-align:left; font-family:inherit; }
        /* ── ژانر درسی دانشگاهی ── */
        #uni-sub-menu, #uni-field-menu { display:none; margin-top:-15px; background:var(--bg-surface); padding:10px; border-radius:12px; border:1px dashed var(--border); }
        #uni-field-menu { margin-top:-8px; max-height:210px; overflow-y:auto; }
        #uni-field-menu .cat-chip { font-size:.78rem; padding:.3rem .8rem; }
        details.uni-adm { background:var(--bg-surface); border:1px solid var(--border); border-radius:8px; padding:8px 10px; margin-top:10px; }
        details.uni-adm > summary { cursor:pointer; font-weight:700; font-size:.88rem; }
        details.uni-adm-area { margin:8px 0 0 0; border-top:1px dashed var(--border); padding-top:6px; }
        details.uni-adm-area > summary { cursor:pointer; font-size:.84rem; font-weight:600; }
        .uni-adm-fields { display:flex; flex-wrap:wrap; gap:6px 14px; padding:8px 4px; }
        .bv-badge { display:flex; flex-direction:column; align-items:center; gap:1px; margin-top:7px; font-size:.72rem; color:var(--text-secondary); line-height:1.25; }
        .bv-badge i { font-size:.85rem; opacity:.85; }
        .bv-badge span { font-weight:600; }
        /* ── منظره Bat-Signal و بتمن در بخش Hero ── */
        .bat-hero-scene {
            display: none;
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: 1;
        }
        html[data-bat="on"] .bat-hero-scene {
            display: block;
        }
        html[data-bat="on"] .hero {
            position: relative;
            background: radial-gradient(ellipse at 50% -20%, #1c202d 0%, var(--bg-surface) 75%) !important;
        }

        /* ── بترنگِ انفجاری ──────────────────────────────────────────────
           سه تیغه از سمت بتمنِ گوشه به دکمه پرتاب می‌شوند، چراغ قرمزشان
           با ریتمی تندشونده چشمک می‌زند و بعد منفجر می‌شوند؛ تازه بعدش
           پنل باز می‌شود. مختصات را جاواسکریپت در متغیرهای CSS می‌گذارد. */
        #barang-fx {
            position: fixed;
            inset: 0;
            z-index: 2147482500;
            pointer-events: none;
            overflow: hidden;
        }

        .barang {
            position: absolute;
            left: var(--sx, 50%);
            top: var(--sy, 50%);
            width: 54px;
            margin: -13px 0 0 -27px;
            filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.9));
            animation: barangFly var(--dur, .5s) cubic-bezier(.28, .5, .38, 1) var(--delay, 0s) forwards;
        }
        .barang svg { display: block; width: 100%; height: auto; }
        @keyframes barangFly {
            0%   { transform: translate(0, 0) rotate(0deg) scale(.5); opacity: 0; }
            10%  { opacity: 1; }
            100% { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--spin, 900deg)) scale(1); opacity: 1; }
        }

        /* چشمک‌زدنِ تندشونده: فاصله‌ها هرچه جلوتر می‌رود کوتاه‌تر می‌شود */
        #barang-fx.armed .br-core {
            animation: coreBlink 1.3s linear forwards;
        }
        #barang-fx.armed .barang {
            filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 7px rgba(255, 59, 33, 0.75));
        }
        @keyframes coreBlink {
            0%, 9%    { opacity: 1; }
            10%, 19%  { opacity: .18; }
            20%, 29%  { opacity: 1; }
            30%, 37%  { opacity: .18; }
            38%, 45%  { opacity: 1; }
            46%, 52%  { opacity: .18; }
            53%, 59%  { opacity: 1; }
            60%, 65%  { opacity: .18; }
            66%, 71%  { opacity: 1; }
            72%, 76%  { opacity: .18; }
            77%, 81%  { opacity: 1; }
            82%, 85%  { opacity: .18; }
            86%, 89%  { opacity: 1; }
            90%, 92%  { opacity: .18; }
            93%, 95%  { opacity: 1; }
            96%, 97%  { opacity: .18; }
            98%, 100% { opacity: 1; }
        }

        #barang-fx.boom .barang { opacity: 0; transition: opacity .1s linear; }

        /* گُر گرفتن */
        .barang-flash {
            position: absolute;
            left: var(--tx, 50%);
            top: var(--ty, 50%);
            width: 26px;
            height: 26px;
            margin: -13px 0 0 -13px;
            border-radius: 50%;
            background: radial-gradient(circle,
                        #ffffff 0 18%, #ffe07a 32%, #ff8a1f 52%,
                        rgba(255, 74, 20, .55) 68%, transparent 80%);
            opacity: 0;
            animation: barangFlash .55s ease-out forwards;
        }
        @keyframes barangFlash {
            0%   { opacity: 0; transform: scale(.3); }
            12%  { opacity: 1; transform: scale(4.2); }
            45%  { opacity: .75; transform: scale(6); }
            100% { opacity: 0; transform: scale(8.5); }
        }

        /* موج ضربه */
        .barang-ring {
            position: absolute;
            left: var(--tx, 50%);
            top: var(--ty, 50%);
            width: 40px;
            height: 40px;
            margin: -20px 0 0 -20px;
            border-radius: 50%;
            border: 3px solid rgba(255, 190, 90, .9);
            opacity: 0;
            animation: barangRing .6s cubic-bezier(.1, .8, .3, 1) forwards;
        }
        @keyframes barangRing {
            0%   { opacity: 0;   transform: scale(.2); border-width: 4px; }
            15%  { opacity: .95; }
            100% { opacity: 0;   transform: scale(5.5); border-width: 1px; }
        }

        /* دود */
        .barang-smoke {
            position: absolute;
            left: var(--tx, 50%);
            top: var(--ty, 50%);
            width: 46px;
            height: 46px;
            margin: -23px 0 0 -23px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(140, 146, 158, .75) 0 45%, rgba(90, 96, 108, .28) 70%, transparent 78%);
            filter: blur(3px);
            opacity: 0;
            animation: barangSmoke var(--sdur, 1.1s) ease-out var(--sdelay, 0s) forwards;
        }
        @keyframes barangSmoke {
            0%   { opacity: 0;   transform: translate(0, 0) scale(.35); }
            18%  { opacity: .8; }
            100% { opacity: 0;   transform: translate(var(--px, 0), var(--py, -40px)) scale(2.6); }
        }

        /* تکانِ صفحه هنگام انفجار — با top، نه transform:
           هر transform روی body عنصرهای fixed را به خودش می‌چسباند. */
        body.barang-shake {
            position: relative;
            animation: barangShake .42s cubic-bezier(.36, .07, .19, .97) both;
        }
        @keyframes barangShake {
            0%, 100% { top: 0; left: 0; }
            15% { top: -6px; left: 4px; }
            32% { top: 5px;  left: -4px; }
            52% { top: -4px; left: -3px; }
            72% { top: 3px;  left: 2px; }
            88% { top: -1px; left: 0; }
        }

        /* دکمه تا پایان انفجار قفل است */
        .bat-locked {
            pointer-events: none;
            opacity: .55;
            filter: saturate(.6);
        }

        @media (prefers-reduced-motion: reduce) {
            #barang-fx { display: none; }
            body.barang-shake { animation: none; }
        }

        /* ── دیوارِ شکسته ──────────────────────────────────────────────
           لحظه‌ی انفجار، صفحه مثل یک دیوارِ بتنی ترک می‌خورد و تکه‌تکه
           می‌ریزد؛ پنل از پشتش بیرون می‌آید. هر تکه یک قاچِ زاویه‌ای از
           نقطه‌ی برخورد است، پس ترک‌ها از همان‌جا باز می‌شوند. */
        .wall-shard {
            position: fixed;
            inset: 0;
            background:
                linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 44%),
                linear-gradient(200deg, #3b434f 0%, #262e3a 38%, #161d27 74%, #0b1017 100%);
            will-change: transform, opacity;
            /* هر تکه کمی روشن‌تر یا تیره‌تر از همسایه‌اش، تا مرزها پیدا باشد */
            filter: brightness(var(--b, 1));
            animation: wallBreak .95s cubic-bezier(.2, .62, .34, 1) forwards;
        }
        @keyframes wallBreak {
            0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
            16%  { transform: translate(var(--nx, 0), var(--ny, 0)) rotate(0deg) scale(1); opacity: 1; }
            100% { transform: translate(var(--fx, 0), var(--fy, 0)) rotate(var(--rot, 20deg)) scale(.93); opacity: 0; }
        }

        /* برقِ کوتاهِ ترک، روی خطِ شکستگی */
        .wall-crack {
            position: fixed;
            inset: 0;
            background: radial-gradient(circle at var(--tx, 50%) var(--ty, 50%),
                        rgba(255, 236, 190, .85) 0, rgba(255, 180, 90, .3) 7%, transparent 24%);
            opacity: 0;
            animation: wallCrackFlash .34s ease-out forwards;
        }
        @keyframes wallCrackFlash {
            0%   { opacity: 0; }
            18%  { opacity: 1; }
            100% { opacity: 0; }
        }

        @media (prefers-reduced-motion: reduce) {
            .wall-shard, .wall-crack { display: none; }
        }

        /* نشانگر وضعیت کمپین */
        .camp-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.8rem;
            font-weight: 700;
            border-radius: 20px;
            padding: 6px 14px;
            border: 1px solid var(--border);
            white-space: nowrap;
        }
        .camp-pill-on  { color: #1b5e20; background: #c8e6c9; border-color: #a5d6a7; }
        .camp-pill-off { color: var(--text-secondary); background: var(--bg-card); }
        .camp-pill-exp { color: #7f4f00; background: #ffe0b2; border-color: #ffcc80; }
        [data-theme="dark"] .camp-pill-on,
        html[data-bat="on"] .camp-pill-on  { color: #a5f3b0; background: rgba(46,125,50,.22); border-color: rgba(129,199,132,.5); }
        [data-theme="dark"] .camp-pill-exp,
        html[data-bat="on"] .camp-pill-exp { color: #ffcc80; background: rgba(191,116,0,.22); border-color: rgba(255,183,77,.5); }

        /* ── بت‌سیگنال: نورِ سفیدِ نورافکن، و خفاش به‌شکل سایه‌ی سیاه رویش ──
           همان‌طور که در فیلم‌ها و کمیک‌هاست: چراغ سفید است، و آن‌چه می‌بینی
           سایه‌ی خفاش روی نور است، نه یک نشانِ زرد. */
        .bh-signal-wrap {
            position: absolute;
            top: 5px;
            left: 5%;
            width: 130px;
            height: 130px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .bh-beam-bg {
            position: absolute;
            width: 130%;
            height: 130%;
            border-radius: 50%;
            background: radial-gradient(circle,
                        rgba(255, 255, 255, 0.55) 0%,
                        rgba(226, 240, 255, 0.22) 42%,
                        rgba(200, 224, 255, 0.06) 62%,
                        transparent 76%);
            filter: blur(12px);
        }
        /* قرصِ نورِ نورافکن */
        .bh-disc {
            position: relative;
            width: 104px;
            height: 104px;
            border-radius: 50%;
            background: radial-gradient(circle at 50% 44%,
                        #ffffff 0%, #f6faff 52%,
                        rgba(232, 243, 255, 0.82) 74%,
                        rgba(205, 226, 255, 0.28) 90%,
                        rgba(205, 226, 255, 0) 100%);
            box-shadow: 0 0 42px 14px rgba(228, 241, 255, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        /* سایه‌ی خفاش روی نور */
        .bh-bat-shadow {
            width: 74px;
            line-height: 0;
        }
        .bh-bat-shadow svg {
            display: block;
            width: 100%;
            height: auto;
            fill: #04060a;
            filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.55));
        }

        /* ── حال‌وهوای گاتهام: باران، مه، رعدوبرق و خط آسمان شهر ── */

        /* ── باران رگباری ──
           همه‌ی قطره‌ها تقریباً یک زاویه دارند (باد یکی است)، فقط چند درجه
           لرزش تصادفی. عمق را اختلافِ طول/روشنی/سرعت می‌سازد، نه زاویه.
           کل بارش داخل یک لایه‌ی چرخان است تا تُندیِ باد کم و زیاد شود. */
        .bh-rain, #page-rain {
            overflow: hidden;
            pointer-events: none;
        }
        .bh-rain { position: absolute; inset: 0; z-index: 4; }
        #page-rain { position: fixed; inset: 0; z-index: 2; opacity: 0.55; }
        html:not([data-bat="on"]) #page-rain { display: none; }

        /* لایه‌ی باد: کلِ باران را آرام کج و راست می‌کند */
        .rain-gust {
            position: absolute;
            inset: -20% -30%;
            transform-origin: 50% 0;
            animation: rainGust 7.5s ease-in-out infinite alternate;
        }
        @keyframes rainGust {
            from { transform: rotate(-1.4deg); }
            to   { transform: rotate(1.6deg); }
        }

        .rain-drop {
            position: absolute;
            top: -16vh;
            display: block;
            border-radius: 2px;
            background: linear-gradient(to bottom,
                        rgba(198, 220, 255, 0) 0%,
                        rgba(205, 226, 255, 0.5) 45%,
                        rgba(238, 246, 255, 0.98) 100%);
            will-change: transform;
            animation-name: dropFall;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
        }
        @keyframes dropFall {
            from { transform: translate3d(0, 0, 0); }
            to   { transform: translate3d(var(--dx, -17vh), 136vh, 0); }
        }

        /* ترکشِ قطره روی زمین */
        .rain-splash {
            position: absolute;
            bottom: 0;
            width: 14px;
            height: 5px;
            border-radius: 50%;
            border: 1px solid rgba(214, 232, 255, 0.5);
            border-top-color: transparent;
            opacity: 0;
            will-change: transform, opacity;
            animation-name: splashPop;
            animation-timing-function: ease-out;
            animation-iteration-count: infinite;
        }
        @keyframes splashPop {
            0%   { opacity: 0;   transform: scale(0.2) translateY(0); }
            12%  { opacity: 0.8; transform: scale(0.7) translateY(-3px); }
            45%  { opacity: 0.3; transform: scale(1.5) translateY(0); }
            100% { opacity: 0;   transform: scale(2.1) translateY(0); }
        }

        @media (max-width: 640px) {
            #page-rain { opacity: 0.34; }
        }
        @media (prefers-reduced-motion: reduce) {
            .rain-drop, .rain-splash { display: none; }
            .rain-gust { animation: none; }
        }

        /* خط آسمانِ شهر: برج آرت‌دکو با پله‌های عقب‌نشسته و دو مناره در مرکز */
        .bh-city {
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 170px;
            z-index: 2;
            pointer-events: none;
        }
        .bh-win rect {
            fill: #ffd230;
            opacity: 0.4;
        }
        .bh-win .bw-f {
            animation: winFlicker 7s steps(1, end) infinite;
        }
        @keyframes winFlicker {
            0%, 42%, 46%, 100% { opacity: 0.4; }
            43%, 45%           { opacity: 0.05; }
        }
        .bh-beacon {
            fill: #ff5a4d;
            animation: beaconBlink 2.6s ease-in-out infinite;
        }
        @keyframes beaconBlink {
            0%, 100% { opacity: 0.25; }
            50%      { opacity: 1; }
        }

        /* مهِ کفِ شهر */
        .bh-fog {
            position: absolute;
            left: -10%;
            right: -10%;
            bottom: 0;
            height: 200px;
            background: linear-gradient(to top,
                        rgba(126, 146, 186, 0.18) 0%,
                        rgba(126, 146, 186, 0.06) 45%,
                        transparent 100%);
            filter: blur(5px);
            z-index: 3;
            pointer-events: none;
            animation: fogDrift 19s ease-in-out infinite alternate;
        }
        @keyframes fogDrift {
            from { transform: translateX(-3%); opacity: 0.85; }
            to   { transform: translateX(3%);  opacity: 1; }
        }

        /* ── لایه‌های اضافیِ حال‌وهوای گاتهام ── */

        /* آسفالتِ خیس: بازتابِ لرزانِ چراغ‌ها روی زمین */
        .bh-wet {
            position: absolute;
            left: 0; right: 0; bottom: 0;
            height: 52px;
            z-index: 3;
            pointer-events: none;
            opacity: 0.8;
            background:
                linear-gradient(to top, rgba(8, 11, 18, 0.92), rgba(8, 11, 18, 0) 100%),
                repeating-linear-gradient(90deg,
                    rgba(255, 210, 48, 0.13) 0 2px, transparent 2px 24px),
                repeating-linear-gradient(90deg,
                    rgba(150, 200, 255, 0.07) 0 1px, transparent 1px 41px);
            filter: blur(1.6px);
            -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
                    mask-image: linear-gradient(to top, #000 0%, transparent 100%);
            animation: wetShimmer 9s ease-in-out infinite alternate;
        }
        @keyframes wetShimmer {
            from { background-position: 0 0, 0 0, 0 0; opacity: 0.66; }
            to   { background-position: 0 0, 7px 0, -5px 0; opacity: 0.88; }
        }

        /* ستونِ نورِ بت‌سیگنال: از کفِ شهر بالا می‌رود و به قرصِ نور می‌رسد.
           ثابت است — نه جارو می‌کند نه سوسو می‌زند؛ فقط نشان می‌دهد که
           نورافکن روشن است. پایه‌اش با همان ۵٪ِ خودِ چراغ لنگر شده، پس
           در هر عرضِ صفحه‌ای سرِ مخروط روی قرص می‌افتد. */
        .bh-sweep {
            position: absolute;
            left: 5%;
            margin-left: 35px;
            bottom: 0;
            width: 190px;
            height: 132%;
            z-index: 3;
            pointer-events: none;
            transform-origin: 50% 100%;
            transform: rotate(-14deg);
            background: linear-gradient(to top,
                        rgba(226, 240, 255, 0.05) 0%,
                        rgba(226, 240, 255, 0.20) 45%,
                        rgba(235, 245, 255, 0.30) 78%,
                        rgba(235, 245, 255, 0) 100%);
            clip-path: polygon(46% 100%, 54% 100%, 96% 0, 4% 0);
            filter: blur(8px);
            opacity: 0.6;
        }

        /* خفاش‌هایی که دور، جلوِ آسمان رد می‌شوند */
        .bh-crossbat {
            position: absolute;
            z-index: 3;
            pointer-events: none;
            line-height: 0;
            filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.85));
            animation-name: batCross;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
        }
        .bh-crossbat svg { display: block; width: 100%; height: auto; fill: #03050a; }
        .bh-crossbat i {
            display: block;
            animation: batFlapY .32s ease-in-out infinite alternate;
        }
        @keyframes batCross {
            from { transform: translateX(14vw)  translateY(0); }
            to   { transform: translateX(-125vw) translateY(-26px); }
        }
        @keyframes batFlapY {
            from { transform: scaleY(1); }
            to   { transform: scaleY(0.55); }
        }

        /* رعدوبرق، علاوه بر آسمان، لحظه‌ای خودِ شهر را هم روشن می‌کند */
        .bh-city { animation: cityFlash 13s linear infinite; }
        @keyframes cityFlash {
            0%, 100% { filter: brightness(1); }
            1.5%     { filter: brightness(2.1); }
            2.4%     { filter: brightness(1.05); }
            3.2%     { filter: brightness(1.7); }
            4.6%     { filter: brightness(1); }
            47%      { filter: brightness(1.5); }
            48.2%    { filter: brightness(1); }
        }

        @media (max-width: 640px) {
            .bh-wet   { height: 34px; }
            .bh-sweep { opacity: 0.4; width: 130px; margin-left: 12px; }
        }
        @media (prefers-reduced-motion: reduce) {
            .bh-wet, .bh-crossbat, .bh-crossbat i, .bh-city {
                animation: none !important;
            }
        }

        /* رعدوبرق دوردست */
        .bh-flash {
            position: absolute;
            inset: 0;
            background: linear-gradient(to bottom,
                        rgba(196, 220, 255, 0.55) 0%,
                        rgba(196, 220, 255, 0) 62%);
            opacity: 0;
            z-index: 5;
            pointer-events: none;
            animation: gothamFlash 13s linear infinite;
        }
        @keyframes gothamFlash {
            0%, 100%   { opacity: 0; }
            1.5%       { opacity: 0.8; }
            2.4%       { opacity: 0.05; }
            3.2%       { opacity: 0.55; }
            4.6%       { opacity: 0; }
            46%        { opacity: 0; }
            47%        { opacity: 0.4; }
            48.2%      { opacity: 0; }
        }

        /* بتمن و بت‌سیگنال باید جلوتر از شهر و مه بمانند */
        .bh-signal-wrap { z-index: 6; }
        .bh-batman {
            position: absolute;
            bottom: -5px;
            right: 4%;
            width: 80px;
            height: 120px;
            opacity: 1;
            z-index: 6;
            /* نور مهتاب پشت بتمن برای دیده شدن کامل در تاریکی */
            filter: drop-shadow(-8px -5px 15px rgba(255, 210, 48, 0.3)) drop-shadow(0 0 2px rgba(255,255,255,0.4));
        }

        /* هدر تاریک‌تر و بلندتر تا شهر جا شود */
        html[data-bat="on"] .hero {
            position: relative;
            overflow: hidden;
            padding-bottom: 7rem;
            /* هاله‌ی نارنجیِ چراغ خیابان پایین‌چپ، ته‌رنگ سبزآبیِ بیمارگونه
               پایین‌راست، و آسمانِ سرد و عمیق بالای سر */
            background:
                radial-gradient(ellipse at 16% 92%, rgba(255, 176, 60, 0.11) 0%, transparent 44%),
                radial-gradient(ellipse at 82% 96%, rgba(60, 150, 138, 0.10) 0%, transparent 42%),
                radial-gradient(ellipse at 50% -32%, #232b40 0%, #0a0d16 54%, #04060b 100%) !important;
        }
        html[data-bat="on"] .hero > *:not(.bat-hero-scene) {
            position: relative;
            z-index: 7;
        }

        @media (max-width: 640px) {
            .bh-city { height: 110px; }
            .bh-fog  { height: 130px; }
            html[data-bat="on"] .hero { padding-bottom: 5rem; }
            .bh-signal-wrap { width: 92px; height: 92px; top: 2px; left: 2%; }
            .bh-disc { width: 74px; height: 74px; }
            .bh-bat-shadow { width: 52px; }
        }

        /* احترام به تنظیم «کاهش حرکت» سیستم کاربر */
        @media (prefers-reduced-motion: reduce) {
            .bh-flash, .bh-fog, .bh-win .bw-f, .bh-beacon {
                animation: none !important;
            }
            .bh-flash { opacity: 0; }
        }

        /* ── پرده Batcave و پرواز سه‌بعدی خفاش‌ها به سمت صفحه ── */
        #bat-intro {
            position: fixed;
            inset: 0;
            z-index: 2147483000;
            background: radial-gradient(circle at center, #11151f 0%, #030406 80%);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            cursor: pointer;
            perspective: 800px;
            box-shadow: inset 0 0 150px 80px #000;
        }
        #bat-intro.gone {
            animation: batIntroOut .55s ease forwards;
        }
        @keyframes batIntroOut {
            to { opacity: 0; visibility: hidden; }
        }

        #bat-intro .beam {
            position: absolute;
            top: 20%;
            left: 50%;
            width: 50vmin;
            height: 50vmin;
            transform: translate(-50%, -50%);
            background: radial-gradient(circle, rgba(255,210,48,0.35) 0%, rgba(255,210,48,0.08) 55%, transparent 70%);
            filter: blur(20px);
            border-radius: 50%;
            animation: beamPulse 3s ease-in-out infinite;
        }
        @keyframes beamPulse {
            0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.95); }
            50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
        }

        #bat-intro .batcave-logo {
            position: absolute;
            top: 20%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 220px;
            max-width: 60vw;
            mix-blend-mode: screen;
            filter: drop-shadow(0 0 25px rgba(255, 210, 48, 0.9));
            z-index: 2;
            pointer-events: none;
        }

        #bat-intro .bat {
            position: absolute;
            width: 50px;
            height: 50px;
            fill: #050608;
            filter: drop-shadow(0 0 6px rgba(255, 210, 48, 0.6));
            opacity: 0;
            will-change: transform, opacity;
            z-index: 10;
            animation: batFlyToScreen var(--dur, 2.2s) cubic-bezier(.25, .1, .25, 1) var(--delay, 0s) forwards;
        }
        @keyframes batFlyToScreen {
            0% {
                opacity: 0;
                transform: translate3d(var(--fx), var(--fy), -500px) scale(0.08) rotate(var(--rot));
            }
            15% {
                opacity: 1;
            }
            80% {
                opacity: 1;
            }
            100% {
                opacity: 0;
                transform: translate3d(var(--tx), var(--ty), 500px) scale(var(--ts, 7)) rotate(var(--rot2));
            }
        }
        #bat-intro .bat > svg {
            width: 100%;
            height: 100%;
            animation: batFlap .22s ease-in-out infinite alternate;
            transform-origin: 50% 50%;
        }
        @keyframes batFlap {
            0% { transform: scaleY(1) scaleX(1); }
            100% { transform: scaleY(0.4) scaleX(0.85); }
        }

        #bat-intro .skip {
            position: absolute;
            bottom: 7%;
            left: 0;
            right: 0;
            text-align: center;
            color: #ffd230;
            font-family: var(--font-body);
            font-size: .85rem;
            letter-spacing: .5px;
            z-index: 20;
            text-shadow: 0 0 10px rgba(0,0,0,0.9);
        }

        /* ── قلاب، مثل انیمیشن‌ها ─────────────────────────────────────────
           ترتیب کار: بتمن تفنگِ قلاب را نشانه می‌رود → شلیک و پس‌زدنِ تفنگ →
           چنگک روی طناب پرواز می‌کند → به دکمه‌ی سبد گیر می‌کند و چنگ می‌زند →
           طناب سفت می‌شود و بتمن خودش را بالا می‌کشد.
           مبدأ، مقصد، طول و زاویه را جاواسکریپت در متغیرهای CSS می‌گذارد. */
        #hook-fx {
            position: fixed;
            inset: 0;
            z-index: 2147482000;
            pointer-events: none;
            overflow: hidden;
        }

        /* ۱) تفنگِ قلاب، در دستِ بتمن، رو به دکمه‌ی سبد */
        /* نقطه‌ی مرجعِ تفنگ، دهانه‌ی لوله است: همان‌جا که طناب از آن بیرون
           می‌زند. پس لنگرِ عنصر را صفر می‌کنیم و خودِ تفنگ را از لبه‌ی راست
           آویزان می‌کنیم تا چرخشش دقیقاً حول دهانه باشد. */
        #hook-fx .hook-gun {
            position: absolute;
            left: var(--sx, 50%);
            top: var(--sy, 50%);
            width: 0;
            height: 0;
            animation: gunGone .18s ease .62s forwards;
        }
        #hook-fx .hook-gun i {
            position: absolute;
            right: 0;
            top: -15px;
            display: block;
            width: 56px;
            transform-origin: 100% 50%;
            animation: gunRecoil .5s ease-out forwards;
            filter: drop-shadow(0 4px 7px rgba(0,0,0,0.9)) drop-shadow(0 0 3px rgba(150,170,200,0.45));
        }
        #hook-fx .hook-gun svg { display: block; width: 100%; height: auto; }
        /* وقتی هدف سمت چپ است زاویه از ۹۰ درجه می‌گذرد و چرخشِ ساده تفنگ را
           وارونه می‌کند؛ --gflip آن را آینه می‌کند تا دسته همیشه پایین بماند. */
        @keyframes gunRecoil {
            0%   { transform: rotate(var(--ang, 0deg)) scaleY(var(--gflip, 1)) translateX(0); }
            18%  { transform: rotate(var(--ang, 0deg)) scaleY(var(--gflip, 1)) translateX(-8px); }
            46%  { transform: rotate(var(--ang, 0deg)) scaleY(var(--gflip, 1)) translateX(0); }
            100% { transform: rotate(var(--ang, 0deg)) scaleY(var(--gflip, 1)) translateX(0); }
        }
        @keyframes gunGone { to { opacity: 0; } }

        /* شعله‌ی دهانه */
        #hook-fx .muzzle {
            position: absolute;
            right: -8px;
            top: 50%;
            width: 30px;
            height: 30px;
            margin-top: -15px;
            border-radius: 50%;
            background: radial-gradient(circle,
                        #ffffff 0 18%, #ffd230 34%,
                        rgba(255, 150, 40, 0.5) 56%, transparent 74%);
            opacity: 0;
            animation: muzzleFlash .24s ease-out .08s;
        }
        @keyframes muzzleFlash {
            0%   { opacity: 0;   transform: scale(.3); }
            25%  { opacity: 1;   transform: scale(1.15); }
            100% { opacity: 0;   transform: scale(1.6); }
        }

        /* ۲) طناب — دقیقاً هم‌زمان با چنگک کشیده می‌شود */
        #hook-fx .rope {
            position: absolute;
            left: var(--sx, 50%);
            top: var(--sy, 50%);
            width: var(--len, 200px);
            height: 2.5px;
            margin-top: -1.25px;
            transform-origin: 0 50%;
            transform: rotate(var(--ang, 0deg)) scaleX(0);
            background: linear-gradient(to right, rgba(210,220,235,0.35), #dfe7f3);
            box-shadow: 0 0 7px rgba(200,220,255,0.6);
            animation: ropeShoot .4s cubic-bezier(.25, .6, .35, 1) .12s forwards,
                       ropeTwang .22s ease .52s;
        }
        @keyframes ropeShoot {
            to { transform: rotate(var(--ang, 0deg)) scaleX(1); }
        }
        @keyframes ropeTwang {
            0%, 100% { filter: brightness(1); }
            40%      { filter: brightness(2.2); }
        }

        /* ۳) چنگک: پرواز تا دکمه، بعد چنگ‌زدن و ماندن */
        #hook-fx .hook-claw {
            position: absolute;
            left: var(--sx, 50%);
            top: var(--sy, 50%);
            width: 40px;
            margin: -20px 0 0 -20px;
            animation: clawFly .4s cubic-bezier(.25, .6, .35, 1) .12s forwards;
        }
        @keyframes clawFly {
            from { transform: translate(0, 0); }
            to   { transform: translate(var(--dx, 0), var(--dy, 0)); }
        }
        #hook-fx .hook-claw i {
            display: block;
            transform-origin: 50% 50%;
            animation: clawBite .3s cubic-bezier(.3, 1.6, .5, 1) .5s both;
            filter: drop-shadow(0 3px 6px rgba(0,0,0,0.8));
        }
        #hook-fx .hook-claw svg { display: block; width: 100%; height: auto; }
        @keyframes clawBite {
            0%   { transform: rotate(var(--ang, 0deg)) scale(1); }
            45%  { transform: rotate(var(--ang, 0deg)) scale(1.28); }
            100% { transform: rotate(var(--ang, 0deg)) scale(1.06); }
        }

        /* جرقه‌ی لحظه‌ی گیر کردن، روی خودِ دکمه */
        #hook-fx .hook-spark {
            position: absolute;
            left: var(--tx, 50%);
            top: var(--ty, 60px);
            width: 18px;
            height: 18px;
            margin: -9px 0 0 -9px;
            border-radius: 50%;
            background: radial-gradient(circle, #fff 0 30%, rgba(255,210,48,0.9) 44%, transparent 72%);
            opacity: 0;
            animation: hookHit .5s ease-out .5s forwards;
        }
        @keyframes hookHit {
            0%   { opacity: 0; transform: scale(.2); }
            26%  { opacity: 1; transform: scale(1.8); }
            100% { opacity: 0; transform: scale(3); }
        }

        /* ۴) بتمن خودش را بالا می‌کشد */
        #hook-fx .batman-ascend {
            position: absolute;
            left: var(--sx, 50%);
            top: var(--sy, 50%);
            width: 90px;
            height: 130px;
            margin: -34px 0 0 -45px;
            animation: batmanSwing .72s cubic-bezier(.38, 0, .22, 1) .66s forwards;
            filter: drop-shadow(0 10px 15px rgba(0,0,0,0.9));
        }
        @keyframes batmanSwing {
            0%   { transform: translate(0, 0) rotate(0deg) scale(1);   opacity: 0; }
            8%   { opacity: 1; }
            55%  { transform: translate(var(--mx), var(--my)) rotate(var(--tilt, -6deg)) scale(.88); opacity: 1; }
            88%  { opacity: 1; }
            100% { transform: translate(var(--dx), var(--dy)) rotate(var(--tilt, -6deg)) scale(.6); opacity: 0; }
        }

        /* بتمنِ گوشه‌ی هدر تا لحظه‌ی شلیک سر جایش می‌ماند، بعد کنده می‌شود */
        html[data-bat="on"] body.hook-yank .bh-batman {
            animation: heroBatOut .2s ease .6s forwards;
        }
        @keyframes heroBatOut { to { opacity: 0; } }

        /* دکمه‌ی سبد وقتی چنگک گیر می‌کند یک تکان می‌خورد */
        .cart-hooked {
            animation: cartTug .55s ease-out .5s;
        }
        @keyframes cartTug {
            0%, 100% { transform: translateY(0) scale(1);       box-shadow: 0 0 0 0 rgba(255,210,48,0); }
            28%      { transform: translateY(7px) scale(.94);   box-shadow: 0 0 0 7px rgba(255,210,48,.38); }
            62%      { transform: translateY(-3px) scale(1.05); box-shadow: 0 0 0 14px rgba(255,210,48,0); }
        }

        .hook-yank {
            position: relative;
            animation: yankScreen .55s cubic-bezier(.4, 0, .2, 1) .5s both;
        }
        @keyframes yankScreen {
            0%   { top: 0; }
            45%  { top: 30px; }
            100% { top: 0; }
        }
        .rec-emoji {
            display: inline-block;
            transform-origin: 50% 50%;
            animation: recSparkle 2.6s ease-in-out infinite;
        }
        @keyframes recSparkle {
            0%, 100% { transform: scale(1)    rotate(0deg);   filter: brightness(1); }
            15%      { transform: scale(1.22) rotate(-9deg);  filter: brightness(1.45); }
            30%      { transform: scale(0.96) rotate(6deg);   filter: brightness(1); }
            45%      { transform: scale(1.12) rotate(-3deg);  filter: brightness(1.28); }
            60%      { transform: scale(1)    rotate(0deg);   filter: brightness(1); }
        }
        @media (prefers-reduced-motion: reduce) {
            .rec-emoji { animation: none; }
        }

        /* برچسب کوچکِ «چرا این کتاب پیشنهاد شده» زیر هر کارتِ نوار پیشنهاد */
        .rec-why {
            font-size: .7rem;
            color: var(--text-secondary);
            background: var(--bg-surface);
            border: 1px dashed var(--border);
            border-radius: 8px;
            padding: 3px 7px;
            margin: 6px 6px 8px;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .genre-row-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 10px;
            margin: 0 6px 10px;
        }
        .genre-row-head h3 {
            margin: 0;
            font-size: 1.05rem;
            color: var(--accent);
        }
        .genre-row-head .grh-count { font-size: .78rem; color: var(--text-secondary); font-weight: normal; }
        .genre-row-head .grh-more {
            font-size: .82rem;
            color: var(--ink-accent);
            cursor: pointer;
            white-space: nowrap;
        }
        .genre-strip {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            overflow-y: hidden;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            padding: 4px 6px 12px;
            scrollbar-width: none;
            min-width: 0;
        }
        .genre-strip::-webkit-scrollbar { display: none; }
        /* کارت‌های داخل ردیف عمداً جمع‌وجورترند تا صفحه کوتاه بماند
           و در هر نگاه دو کتاب و نیم دیده شود. */
        .genre-strip > .book-card {
            flex: 0 0 150px;
            width: 150px;
            scroll-snap-align: start;
        }
        .genre-strip > .book-card .book-cover-wrap {
            height: 200px !important;
            min-height: 200px !important;
            padding: 8px !important;
        }
        .genre-strip > .book-card .book-info { padding: 8px 10px 10px; }
        .genre-strip > .book-card .book-desc { display: none; }
        .genre-strip > .book-card .book-title { font-size: 0.85rem; margin-bottom: 4px; }
        .genre-strip > .book-card .book-author { font-size: 0.72rem; }
        .genre-strip > .book-card .book-price { font-size: 0.82rem; }
        .genre-strip > .book-card .book-category-tag { display: none; }
        .genre-strip > .book-card .add-to-cart-btn-main {
            font-size: 0.75rem;
            padding: 7px 6px;
        }
        .genre-strip > .book-card .ff-link {
            white-space: normal;
            font-size: 0.72rem;
        }
        /* اشاره‌ی بصری که ردیف قابل کشیدن است — هر دو طرف */
        .genre-row { position: relative; }
        .genre-row::after {
            content: '';
            position: absolute;
            top: 40px; bottom: 12px; left: 0;
            width: 26px;
            pointer-events: none;
            z-index: 1;
            background: linear-gradient(to left, var(--bg-primary), transparent);
        }
        .genre-row::before {
            content: '';
            position: absolute;
            top: 40px; bottom: 12px; right: 0;
            width: 26px;
            pointer-events: none;
            z-index: 1;
            background: linear-gradient(to right, var(--bg-primary), transparent);
        }

        /* فلش‌های کلیک‌پذیر برای اسکرول نوار تخفیفِ دسکتاپ (فقط همین یک نوار؛
           موبایل نیازی ندارد چون با کشیدن انگشت اسکرول می‌شود). */
        .discount-strip-arrow {
            position: absolute;
            margin-top: -17px;
            z-index: 3;
            width: 34px; height: 34px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,0.45);
            color: #fff;
            font-size: 0.9rem;
            transition: background 0.2s;
        }
        .discount-strip-arrow:hover { background: rgba(0,0,0,0.68); }
        .discount-strip-arrow-prev { right: 2px; }
        .discount-strip-arrow-next { left: 2px; }
        @media (max-width: 768px) {
            .discount-strip-arrow { display: none; }
        }

        /* ردیف «تخفیف‌دارها» — همیشه اول، با کمی تأکید بصری (هم در ردیف‌های
           ژانریِ موبایل، هم در نوار سادهٔ تخفیف روی دسکتاپ) */
        .genre-row-discount .genre-row-head h3 { color: #e74c3c; }

        /* بج متحرک کنار قیمتِ تخفیف‌خورده — تکان ملایم و کند، نه چیز پرزرق‌وبرق.
           عمداً به‌طور کامل جدا از prefers-reduced-motion نگه داشته شده چون
           تکان بسیار خفیف است و خودِ کاربر صراحتاً همین را خواسته. */
        /* ══════════ مقایسه‌ی کتاب‌ها ══════════ */
        .cmp-btn {
            position: absolute; top: 10px; right: 10px; z-index: 4;
            width: 34px; height: 34px; border-radius: 50%;
            border: 1px solid var(--border); background: var(--bg-card);
            color: var(--text-secondary); cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.8rem; box-shadow: 0 2px 5px rgba(0,0,0,0.15);
            transition: background .15s, color .15s;
        }
        .cmp-btn:hover { background: var(--bg-surface); }
        .cmp-btn.on { background: var(--purple); color: #fff; border-color: var(--purple); }

        #compare-bar {
            position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
            background: var(--bg-card); border-top: 1px solid var(--border);
            box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
            padding: 10px 16px; display: none;
            align-items: center; gap: 12px; flex-wrap: wrap;
        }
        #compare-bar.open { display: flex; }
        #compare-bar .cmp-items { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
        #compare-bar .cmp-chip {
            position: relative; width: 42px; height: 60px; border-radius: 5px;
            overflow: hidden; border: 1px solid var(--border); flex: none;
        }
        #compare-bar .cmp-chip img { width: 100%; height: 100%; object-fit: cover; }
        #compare-bar .cmp-chip button {
            position: absolute; top: 0; left: 0; width: 16px; height: 16px;
            background: rgba(192,57,43,.92); color: #fff; border: none;
            border-bottom-right-radius: 5px; cursor: pointer; font-size: .6rem; line-height: 1; padding: 0;
        }
        #compare-bar .cmp-hint { font-size: .78rem; color: var(--text-secondary); }

        .cmp-table-wrap { overflow-x: auto; margin-top: 4px; }
        .cmp-table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .82rem; }
        .cmp-table th, .cmp-table td {
            border: 1px solid var(--border); padding: 9px 11px;
            text-align: center; vertical-align: middle;
        }
        .cmp-table th.cmp-row-label {
            text-align: right; background: var(--bg-surface);
            color: var(--text-secondary); font-weight: 600; white-space: nowrap;
        }
        .cmp-table tr:nth-child(even) td { background: rgba(128,128,128,.04); }
        .cmp-table .cmp-cover { width: 84px; height: 120px; object-fit: cover; border-radius: 6px; }
        .cmp-best { color: var(--accent); font-weight: 700; }
        .cmp-price { color: var(--accent); font-weight: 700; font-size: .88rem; }

        /* ── کد تخفیف در صفحه‌ی پرداخت ── */
        .coupon-box {
            border: 1px dashed var(--border); border-radius: 10px;
            padding: 12px; margin-top: 1rem; background: var(--bg-surface);
        }
        .coupon-row { display: flex; gap: 8px; align-items: stretch; }
        .coupon-row input { flex: 1; min-width: 0; }
        .coupon-hint { font-size: .76rem; color: var(--text-secondary); margin-top: 8px; line-height: 1.8; }
        .coupon-msg { font-size: .8rem; margin-top: 8px; line-height: 1.8; display: none; }
        .coupon-msg.ok  { display: block; color: #0a7d0a; }
        .coupon-msg.bad { display: block; color: #c0392b; }
        .coupon-applied {
            display: none; align-items: center; justify-content: space-between;
            gap: 8px; flex-wrap: wrap; margin-top: 8px;
            background: rgba(10,125,10,.10); border: 1px solid rgba(10,125,10,.35);
            border-radius: 8px; padding: 8px 10px; font-size: .82rem;
        }
        .coupon-applied.on { display: flex; }
        .coupon-applied .cp-code {
            font-weight: 700; direction: ltr; display: inline-block;
            background: var(--bg-card); border-radius: 6px; padding: 2px 8px;
        }
        .coupon-applied button {
            background: none; border: none; color: #c0392b; cursor: pointer;
            font-family: inherit; font-size: .78rem; font-weight: 600; padding: 0;
        }
        #review-discount-row { display: none; color: #0a7d0a; }

        /* نشان «چند ناشر» روی کارت کتاب */
        .edition-badge {
            display: inline-flex; align-items: center; gap: 4px;
            margin-right: 6px; padding: 1px 7px; border-radius: 999px;
            font-size: .64rem; font-weight: 700; line-height: 1.8;
            background: rgba(106, 27, 154, .12); color: var(--ink-accent);
            border: 1px solid rgba(106, 27, 154, .28); white-space: nowrap;
            vertical-align: middle;
        }
        .edition-badge i { font-size: .6rem; }

        /* ── دسته‌ی چاپ‌ها: جلدهای دیگر مثل ورق کارت پشت جلد اصلی ──
           .book-cover-wrap خودش overflow:hidden و position:relative دارد،
           پس ورق‌ها از کادر بیرون نمی‌زنند. */
        .ed-fan {
            position: absolute; inset: 0; padding: inherit;
            box-sizing: border-box;
            display: flex; align-items: center; justify-content: center;
            pointer-events: none; z-index: 0;
        }
        .ed-fan-img {
            position: absolute;
            max-width: 100%; max-height: 100%; width: auto; height: auto;
            object-fit: contain; border-radius: 4px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, .28);
            transition: transform .35s cubic-bezier(.2, .8, .3, 1);
        }
        .ed-fan-1 { transform: rotate(-7deg)  translateX(-9px)  scale(.93); }
        .ed-fan-2 { transform: rotate(6.5deg) translateX(9px)   scale(.93); }
        .book-card.has-stack:hover .ed-fan-1 { transform: rotate(-12deg) translateX(-19px) scale(.95); }
        .book-card.has-stack:hover .ed-fan-2 { transform: rotate(11deg)  translateX(19px)  scale(.95); }

        /* جلد اصلی باید روی ورق‌ها بنشیند */
        .book-card.has-stack .book-cover { position: relative; z-index: 1; }

        .book-card.is-edition { border-color: rgba(106, 27, 154, .45); }

        /* دکمه‌ی باز/بسته‌کردن دسته */
        .ed-stack-btn {
            display: inline-flex; align-items: center; gap: 6px;
            align-self: flex-start;   /* .book-info ستون فلکس است و وگرنه کش می‌آید */
            margin: 2px 0 6px; padding: 4px 11px;
            border-radius: 999px; cursor: pointer;
            font-family: inherit; font-size: .74rem; font-weight: 700;
            background: rgba(106, 27, 154, .12); color: var(--ink-accent);
            border: 1px solid rgba(106, 27, 154, .35);
            transition: background .2s;
        }
        .ed-stack-btn:hover { background: rgba(106, 27, 154, .22); }
        .ed-stack-btn.open { background: var(--purple); color: #fff; border-color: var(--purple); }

        /* دکمه‌ی «کارت بالایی» روی چاپ‌های بازشده (فقط ادمین) */
        .ed-card-actions {
            display: flex; flex-wrap: wrap; gap: 6px;
            align-items: center; margin: 2px 0 6px;
        }
        .ed-card-actions .ed-stack-btn { margin: 0; }
        .ed-primary-btn {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 4px 10px; border-radius: 999px; cursor: pointer;
            font-family: inherit; font-size: .72rem; font-weight: 700;
            background: rgba(230, 167, 0, .14); color: #a97600;
            border: 1px solid rgba(230, 167, 0, .45);
            transition: background .2s;
        }
        .ed-primary-btn:hover { background: rgba(230, 167, 0, .26); }
        .ed-primary-btn.on {
            background: #e6a700; color: #2c221e; border-color: #e6a700; cursor: default;
        }

        /* نشانِ «کارت بالایی» کنار هر چاپ در صفحه‌ی کتاب */
        .ed-primary-tag {
            display: inline-flex; align-items: center; gap: 4px;
            margin-right: 6px; padding: 1px 7px; border-radius: 999px;
            font-size: .64rem; font-weight: 700; line-height: 1.8;
            background: rgba(230, 167, 0, .16); color: #a97600;
            border: 1px solid rgba(230, 167, 0, .45); white-space: nowrap;
        }

        /* ── پنل هم‌سان‌سازی اطلاعات بین چاپ‌های یک کتاب (فرم ادمین) ──
           ⚠️ این بلوک یک‌بار سهواً موقع بازنویسی استایل «انتخاب چاپ» پاک شد و
           کل پنل به‌هم ریخت. اگر دوباره استایل‌های .ed-* را بازنویسی کردی،
           حواست باشد این بلوک وسطشان نیفتد. check.py هم نگهبانش است. */
        .work-sync-panel {
            display: none;
            border: 1px solid var(--purple);
            background: rgba(106, 27, 154, .07);
            border-radius: 10px;
            padding: 12px;
            margin-bottom: 1rem;
        }
        .work-sync-panel.on { display: block; }
        .ws-head {
            display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
            font-size: .86rem; font-weight: 700; color: var(--ink-accent);
        }
        .ws-toggle {
            margin-right: auto; background: none; border: none; cursor: pointer;
            color: var(--ink-accent); font-family: inherit; font-size: .76rem;
            font-weight: 600; text-decoration: underline; padding: 0;
        }
        .ws-fields { display: none; margin-top: 10px; }
        .ws-fields.open { display: block; }
        .ws-field {
            display: flex; align-items: flex-start; gap: 8px;
            padding: 7px 0; border-bottom: 1px dashed var(--border);
        }
        .ws-field:last-child { border-bottom: none; }
        .ws-field > input[type="checkbox"] { margin-top: 4px; flex: none; }
        .ws-field-body { display: block; min-width: 0; flex: 1 1 auto; }
        .ws-field-name { display: block; font-size: .8rem; font-weight: 600; }
        .ws-field-val {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            font-size: .72rem; color: var(--text-secondary); line-height: 1.7;
            text-align: right; margin-top: 2px;
            /* اگر مرورگری -webkit-box را نشناسد، باز هم از دو خط بیشتر نشود */
            max-height: 2.6em;
        }
        .ws-field-note { display: block; font-size: .68rem; color: #ff9800; margin-top: 2px; }
        .ws-actions {
            display: flex; align-items: center; gap: 12px;
            flex-wrap: wrap; margin-top: 10px;
        }
        .ws-push {
            display: flex; align-items: center; gap: 6px;
            font-size: .78rem; cursor: pointer; color: var(--text-primary);
        }
        .ws-msg { font-size: .78rem; margin-top: 8px; line-height: 1.8; }

        /* ── انتخاب چاپ (ناشرهای مختلف یک کتاب) ── */
        .ed-section {
            border-top: 1px solid var(--border);
            margin-top: 1.4rem; padding-top: 1.1rem;
        }
        .ed-section-title { font-size: 1.02rem; margin-bottom: .2rem; }
        .ed-section-sub {
            font-size: .77rem; color: var(--text-secondary); margin-bottom: .9rem;
        }
        .ed-list { display: flex; flex-direction: column; gap: 10px; }

        .ed-row {
            display: grid;
            grid-template-columns: 58px 1fr auto;
            gap: 14px; align-items: start;
            border: 1px solid var(--border); border-radius: 12px;
            padding: 12px; background: var(--bg-card);
        }
        .ed-row.current {
            border-color: var(--purple);
            background: rgba(106, 27, 154, .06);
        }
        .ed-cover {
            width: 58px; height: 84px; object-fit: cover; border-radius: 7px;
            border: 1px solid var(--border); cursor: pointer;
        }
        .ed-info { min-width: 0; }
        .ed-pub {
            display: flex; align-items: center; gap: 6px;
            font-weight: 700; font-size: .92rem; cursor: pointer;
            color: var(--text-primary); line-height: 1.7;
        }
        .ed-pub:hover { color: var(--accent); }
        .ed-pub i { font-size: .8rem; color: var(--accent); }
        .ed-alt-title { font-size: .76rem; color: var(--text-secondary); margin-top: 1px; }

        /* مشخصات هر چاپ: دو ستونی روی دسکتاپ، تک‌ستونی روی گوشی */
        .ed-specs {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 2px 18px; margin-top: 7px;
        }
        .ed-spec {
            display: flex; gap: 6px; font-size: .76rem; line-height: 1.9;
            border-bottom: 1px dotted var(--border);
        }
        .ed-spec > span { color: var(--text-secondary); flex: none; }
        .ed-spec > b { font-weight: 600; margin-right: auto; text-align: left; }
        .ed-nospec { font-size: .74rem; color: var(--text-secondary); }

        .ed-buy { text-align: left; min-width: 150px; }
        .ed-price-row {
            display: flex; align-items: center; gap: 6px;
            flex-wrap: wrap; justify-content: flex-end;
        }
        .ed-price { color: var(--accent); font-weight: 700; font-size: .95rem; }
        .ed-off {
            background: #e74c3c; color: #fff; border-radius: 999px;
            padding: 0 7px; font-size: .66rem; font-weight: 700; line-height: 1.9;
        }
        .ed-old {
            font-size: .75rem; color: var(--text-secondary);
            direction: rtl; unicode-bidi: isolate;
            text-decoration: line-through;
            text-decoration-thickness: 1px;
            text-decoration-color: rgba(128, 128, 128, .7);
        }
        .ed-low {
            display: block; font-size: .7rem; color: #ff9800;
            font-weight: 600; margin-top: 4px;
        }
        .ed-action { margin-top: 9px; display: flex; gap: 6px; justify-content: flex-end; }
        .ed-current {
            font-size: .74rem; font-weight: 700; color: var(--ink-accent);
            border: 1px dashed var(--purple); border-radius: 8px; padding: 6px 12px;
            white-space: nowrap; display: inline-block;
        }
        .ed-out { font-size: .74rem; color: var(--text-secondary); white-space: nowrap; }

        /* متن‌های بلند (معرفی، نکوداشت، بیوگرافی) — زیر انتخاب چاپ */
        .book-longform {
            border-top: 1px solid var(--border);
            margin-top: 1.4rem; padding-top: 1.1rem;
        }
        .bl-title { font-size: .98rem; margin: 0 0 .45rem; }
        .book-longform .bl-title:not(:first-child) { margin-top: 1.2rem; }
        .bl-text {
            font-size: .87rem; color: var(--text-secondary);
            line-height: 1.95; margin: 0;
        }

        @media (max-width: 620px) {
            .ed-row { grid-template-columns: 52px 1fr; }
            .ed-cover { width: 52px; height: 76px; }
            .ed-buy {
                grid-column: 1 / -1; text-align: right;
                border-top: 1px dashed var(--border); padding-top: 9px; min-width: 0;
            }
            .ed-price-row { justify-content: flex-start; }
            .ed-action { justify-content: stretch; margin-top: 8px; }
            .ed-action .btn { flex: 1; justify-content: center; }
        }
            .ed-action .btn { width: 100%; justify-content: center; }
        }

        /* ── پنل کدهای تخفیف ── */
        .cp-form-card {
            background: var(--bg-surface); border: 1px solid var(--border);
            border-radius: 10px; padding: 14px;
        }
        .cp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
        .cp-card {
            border: 1px solid var(--border); border-radius: 10px; padding: 12px;
            margin-bottom: 10px; background: var(--bg-card);
        }
        .cp-card.off { opacity: .6; }
        .cp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .cp-code-chip {
            font-weight: 700; direction: ltr; letter-spacing: 1px;
            background: var(--accent); color: #fff; border-radius: 6px; padding: 3px 10px; font-size: .88rem;
        }
        .cp-badge {
            font-size: .68rem; font-weight: 700; border-radius: 999px;
            padding: 2px 8px; line-height: 1.8; white-space: nowrap;
        }
        .cp-badge.on   { background: rgba(10,125,10,.15);  color: #0a7d0a; }
        .cp-badge.offb { background: rgba(128,128,128,.18); color: var(--text-secondary); }
        .cp-badge.warn { background: rgba(192,57,43,.14);  color: #c0392b; }
        .cp-meta { font-size: .76rem; color: var(--text-secondary); margin-top: 8px; line-height: 2; }
        .cp-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
        .cp-uses { margin-top: 10px; font-size: .74rem; border-top: 1px dashed var(--border); padding-top: 8px; }
        .cp-uses table { width: 100%; border-collapse: collapse; }
        .cp-uses td { padding: 4px 6px; border-bottom: 1px dashed var(--border); }
        #review-discount-row.on { display: flex; }
        .cmp-tag {
            display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 999px;
            font-size: .62rem; font-weight: 700; line-height: 1.7;
            background: var(--accent); color: #fff; white-space: nowrap;
        }
        /* خلاصه‌ی داستان در جدول مقایسه: پیش‌فرض کوتاه، با دکمه باز می‌شود */
        .cmp-table td.cmp-desc-cell { text-align: right; vertical-align: top; }
        .cmp-desc {
            font-size: .76rem; line-height: 1.85; color: var(--text-primary);
            text-align: right; max-width: 260px; margin: 0 auto;
        }
        .cmp-desc.clamped {
            display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .cmp-desc-more {
            background: none; border: none; padding: 3px 0 0; cursor: pointer;
            color: var(--accent); font-size: .72rem; font-weight: 600;
            font-family: inherit; display: block; margin-right: auto; margin-left: auto;
        }

        /* فهرست پیشنهادِ مجموعه — دستی ساخته شده، نه datalist.
           datalist در کروم یک فلش کوچک کنار فیلد می‌گذارد که با CSS
           قابل‌اعتماد حذف نمی‌شود، برای همین کلاً استفاده نشد. */
        #series-suggest-box,
        #work-suggest-box {
            display: none;
            position: absolute;
            z-index: 50;
            left: 0;
            right: 0;
            top: 100%;
            margin-top: 4px;
            max-height: 190px;
            overflow-y: auto;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
        }
        #series-suggest-box.open,
        #work-suggest-box.open { display: block; }
        #series-suggest-box .sg-item,
        #work-suggest-box .sg-item {
            padding: 9px 12px;
            font-size: 0.85rem;
            cursor: pointer;
            color: var(--text-primary);
            border-bottom: 1px solid var(--border);
        }
        #series-suggest-box .sg-item:last-child,
        #work-suggest-box .sg-item:last-child { border-bottom: none; }
        #series-suggest-box .sg-item:hover,
        #work-suggest-box .sg-item:hover { background: var(--bg-surface); }
        #series-suggest-box .sg-empty,
        #work-suggest-box .sg-empty {
            padding: 9px 12px;
            font-size: 0.78rem;
            color: var(--text-secondary);
        }

        .discount-tag-emoji {
            display: inline-block;
            margin-inline-end: 4px;
            animation: daisyDiscountWiggle 2.4s ease-in-out infinite;
            transform-origin: 60% 85%;
        }
        @keyframes daisyDiscountWiggle {
            0%, 100% { transform: rotate(0deg); }
            30% { transform: rotate(-10deg); }
            70% { transform: rotate(10deg); }
        }

        /* نام نویسنده / مترجم / انتشارات — قابل کلیک */
        .ff-link {
            cursor: pointer;
            color: var(--ink-accent);
            font-weight: 600;
            border-radius: 6px;
            padding: 1px 5px;
            margin: 0 -3px;
            background: color-mix(in srgb, var(--ink-accent) 14%, transparent);
            border-bottom: 1px solid color-mix(in srgb, var(--ink-accent) 45%, transparent);
            transition: background 0.18s, color 0.18s, border-color 0.18s;
            white-space: nowrap;
        }
        .ff-link:hover {
            color: var(--bg-card);
            background: var(--ink-accent);
            border-bottom-color: var(--ink-accent);
        }
        /* مرورگرهای قدیمی که color-mix ندارند */
        @supports not (background: color-mix(in srgb, red 8%, transparent)) {
            .ff-link { background: transparent; border-bottom: 1px dashed var(--ink-accent); }
        }

        .search-input {
            width: 100%;
            padding: 0.7rem 1rem 0.7rem 2.5rem;
            border-radius: 30px;
            border: 2px solid var(--border);
            background-color: var(--bg-card);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: 0.95rem;
        }

        .search-icon {
            position: absolute;
            left: 1.8rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
        }

        .category-filter {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin: 1.5rem 1rem;
            flex-wrap: wrap;
        }

        .cat-chip {
            padding: 0.4rem 1rem;
            border-radius: 20px;
            background-color: var(--bg-surface);
            border: 1px solid var(--border);
            cursor: pointer;
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--text-secondary);
         
        }

        .cat-chip.active {
            background-color: var(--accent);
            color: #fff;
            border-color: var(--accent);
        }

        .main-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 1rem 3rem 1rem;
            flex-grow: 1;
            width: 100%;
        }

        .book-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 1.5rem;
        }

        .book-card {
            background-color: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--card-radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            position: relative;
            cursor: pointer;
            
        }

        .grayscale-img {
            filter: grayscale(100%);
            opacity: 0.8;
        }
        .out-of-stock-badge {
            color: #c0392b;
            font-weight: bold;
            font-size: 0.95rem;
        }

       .book-cover-wrap {
            height: 330px !important; 
            min-height: 330px !important;
            background-color: var(--bg-surface) !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            overflow: hidden !important;
            position: relative !important;
            padding: 15px !important;
        }

       .book-cover {
            max-width: 100% !important;
            max-height: 100% !important;
            width: auto !important;
            height: auto !important;
            object-fit: contain !important;
            display: block !important;
            margin: 0 auto !important;
            transition: filter 0.3s;
        }

        .book-category-tag {
            position: absolute;
            top: 10px;
            right: 10px;
            background-color: rgba(44, 34, 30, 0.85);
            color: #fff;
            font-size: 0.7rem;
            padding: 3px 8px;
            border-radius: 10px;
            z-index: 2;
        }

        .book-info {
            padding: 1rem;
            display: flex;
            flex-direction: column;
            flex-grow: 1;
        }

        .book-title {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 0.2rem;
            color: var(--text-primary);
        }

        .book-author {
            color: var(--text-secondary);
            font-size: 0.85rem;
            margin-bottom: 0.6rem;
        }

        .book-desc {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .book-footer {
            margin-top: auto;
            display: flex;
            flex-direction: column;
            gap: 8px;
            border-top: 1px dashed var(--border);
            padding-top: 0.6rem;
        }

        .book-footer-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .book-price {
            font-family: var(--font-head);
            font-size: 1.1rem;
            color: var(--accent);
            display: flex;
            flex-direction: column;
        }

        .add-to-cart-btn-main {
            width: 100%;
            justify-content: center;
            padding: 0.6rem;
            font-size: 0.9rem;
            z-index: 5;
        }

        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background-color: rgba(0,0,0,0.65);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            padding: 0.5rem;
            -webkit-backdrop-filter: blur(3px);
            backdrop-filter: blur(3px);
        }

        .modal-overlay.active {
            display: flex;
        }

        /* فاکتور سفارش باید همیشه روی هر مودال دیگری (مثلاً پنل پروفایل) باز شود،
           نه پشت آن — چون از داخل پنل پروفایل باز می‌شود ولی در همان لایه‌ی مودال‌هاست. */
        #order-detail-modal {
            z-index: 10050;
        }

        .modal-content {
            background-color: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: var(--card-radius);
            max-width: 850px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            padding: 1.2rem;
            box-shadow: var(--shadow);
            position: relative;
            -webkit-overflow-scrolling: touch;
        }

        @media(min-width: 768px) {
            .modal-content {
                padding: 2rem;
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            border-bottom: 1px solid var(--border);
            padding-bottom: 0.6rem;
        }

        .modal-title {
            font-family: var(--font-head);
            font-size: 1.4rem;
            color: var(--accent);
        }

        .close-modal {
            background: none;
            border: none;
            font-size: 1.4rem;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 5px;
            
        }

        .admin-panel-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 1.5rem;
            border-bottom: 2px solid var(--border);
            background: var(--bg-surface);
            padding: 0.5rem 0.5rem 0 0.5rem;
            border-radius: 8px 8px 0 0;
        }
        .admin-panel-tabs button {
            padding: 0.6rem 1.2rem;
            border: none;
            background: none;
            font-family: var(--font-body);
            font-weight: bold;
            font-size: 0.9rem;
            color: var(--text-secondary);
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.3s;
        }
        .admin-panel-tabs button.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }
        .admin-panel-tabs button:hover:not(.active) {
            color: var(--text-primary);
        }
        @media (min-width: 641px) {
            .admin-panel-tabs { flex-wrap: wrap; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); border-radius: 12px; }
            .admin-panel-tabs button {
                display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
                padding: 0.5rem 0.95rem; font-size: 0.84rem; line-height: 1.4;
                border: 1px solid transparent; border-radius: 10px; background: transparent;
            }
            .admin-panel-tabs button i { font-size: 0.95rem; opacity: .9; }
            .admin-panel-tabs button:hover:not(.active) { background: var(--bg-card); border-color: var(--border); }
            .admin-panel-tabs button.active { background: var(--bg-card); border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
        }

        .military-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: bold;
            color: white;
        }
        .badge-general { background: linear-gradient(135deg, #d4af37, #b8860b); box-shadow: 0 2px 5px rgba(212, 175, 55, 0.4); } 
        .torob-3d-btn {
            display: flex; align-items: center; justify-content: center; gap: 10px;
            width: 100%; margin-top: 10px; padding: 8px 12px; cursor: pointer;
            font-family: inherit; font-weight: 900; font-size: 1rem; color: #0b4d1c;
            background: linear-gradient(180deg, #b6f27d 0%, #9be866 55%, #86d94f 100%);
            border: 2px solid #1f7a2e; border-radius: 16px;
            box-shadow: 0 1px 0 #d9ffb8 inset, 0 -3px 0 rgba(0,0,0,.12) inset,
                        0 6px 0 #4f9f2a, 0 7px 0 #2f6f1c, 0 14px 20px rgba(0,0,0,.45);
            text-shadow: 0 1px 0 rgba(255,255,255,.55);
            transform: translateY(0); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
            position: relative; overflow: hidden;
        }
        .torob-3d-btn::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
            background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg);
            animation: torobShine 3.2s infinite; pointer-events: none; }
        @keyframes torobShine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
        .torob-3d-btn:hover { transform: translateY(-2px); filter: brightness(1.05);
            box-shadow: 0 1px 0 #d9ffb8 inset, 0 -3px 0 rgba(0,0,0,.12) inset, 0 8px 0 #4f9f2a, 0 9px 0 #2f6f1c, 0 18px 24px rgba(0,0,0,.5); }
        .torob-3d-btn:active { transform: translateY(5px);
            box-shadow: 0 1px 0 #d9ffb8 inset, 0 -2px 0 rgba(0,0,0,.12) inset, 0 1px 0 #4f9f2a, 0 2px 0 #2f6f1c, 0 4px 8px rgba(0,0,0,.4); }
        .torob-3d-btn[disabled] { opacity: .75; cursor: wait; }
        .torob-3d-btn img { height: 44px; width: auto; border-radius: 10px; flex-shrink: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
        .torob-3d-btn .tp-txt { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
        .torob-3d-btn .tp-txt b { font-size: 1.02rem; font-weight: 900; }
        .torob-3d-btn .tp-txt small { font-size: .74rem; font-weight: 800; opacity: .9; }

        /* ═══ پشتیبانی درون‌سایتی ═══ */
        #sup-fab { position: fixed; left: 18px; bottom: 18px; z-index: 950; width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
            background: var(--accent); color: #fff; font-size: 1.5rem; box-shadow: 0 6px 18px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
        #sup-fab:hover { filter: brightness(1.08); transform: translateY(-2px); }
        #sup-fab .sup-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e53935; color: #fff; font-size: .72rem; font-weight: 800; display: none; align-items: center; justify-content: center; }
        #sup-panel { position: fixed; left: 18px; bottom: 90px; z-index: 951; width: 370px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 110px);
            background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.45); display: none; flex-direction: column; overflow: hidden; }
        #sup-panel.open { display: flex; }
        .sup-head { background: var(--accent); color: #fff; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .sup-head b { font-size: .98rem; }
        .sup-head small { display: block; opacity: .85; font-size: .72rem; margin-top: 2px; }
        .sup-head button { background: rgba(255,255,255,.18); color: #fff; border: none; border-radius: 8px; padding: 5px 9px; cursor: pointer; font-family: inherit; font-size: .78rem; }
        #sup-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-surface); }
        .sup-m { max-width: 86%; padding: 8px 11px; border-radius: 12px; font-size: .88rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
        .sup-m.user { align-self: flex-start; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
        .sup-m.bot, .sup-m.admin { align-self: flex-end; background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
        .sup-m.admin { border-color: var(--accent); }
        .sup-m .sup-who { display: block; font-size: .7rem; opacity: .75; margin-bottom: 2px; font-weight: 700; }
        .sup-album { display: grid; gap: 3px; margin-top: 6px; grid-template-columns: repeat(2, 1fr); }
        .sup-album.n1 { grid-template-columns: 1fr; }
        .sup-album.n3, .sup-album.n5, .sup-album.n6, .sup-album.n9 { grid-template-columns: repeat(3, 1fr); }
        .sup-album img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
        .sup-album.n1 img { aspect-ratio: auto; max-height: 220px; }
        .sup-status { font-size: .74rem; text-align: center; color: var(--text-secondary); padding: 4px 8px; background: var(--bg-card); border-top: 1px solid var(--border); }
        .sup-foot { border-top: 1px solid var(--border); padding: 8px; background: var(--bg-card); }
        #sup-prev { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
        #sup-prev .pv { position: relative; width: 52px; height: 52px; }
        #sup-prev .pv img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
        #sup-prev .pv span { position: absolute; top: -5px; right: -5px; background: #e53935; color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: .7rem; display: flex; align-items: center; justify-content: center; cursor: pointer; }
        .sup-row { display: flex; gap: 6px; align-items: flex-end; }
        .sup-row textarea { flex: 1; resize: none; height: 40px; max-height: 100px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-family: inherit; font-size: .88rem; background: var(--bg-surface); color: var(--text-primary, inherit); }
        .sup-ib { border: none; border-radius: 10px; width: 40px; height: 40px; cursor: pointer; background: var(--bg-surface); color: var(--text-secondary); font-size: 1.05rem; border: 1px solid var(--border); }
        .sup-ib.send { background: var(--accent); color: #fff; border-color: var(--accent); }
        .sup-ib[disabled] { opacity: .5; cursor: wait; }
        .sup-tools { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
        .sup-tools button { font-family: inherit; font-size: .76rem; border: 1px dashed var(--border); background: transparent; color: var(--text-secondary); border-radius: 8px; padding: 4px 9px; cursor: pointer; }
        #sup-lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.88); display: none; align-items: center; justify-content: center; }
        #sup-lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }
        @media (max-width: 600px) {
            #sup-panel { left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
            #sup-fab { left: 12px; bottom: 76px; width: 52px; height: 52px; }
        }
        .sup-rate { align-self: stretch; background: var(--bg-card); border: 1px solid var(--accent); border-radius: 14px; padding: 12px; text-align: center; }
        .sup-rate b { display: block; font-size: .92rem; margin-bottom: 8px; }
        .sup-stars { display: flex; justify-content: center; gap: 4px; direction: ltr; }
        .sup-stars button { background: none; border: none; cursor: pointer; font-size: 2rem; line-height: 1; color: var(--border); padding: 0 2px; transition: transform .1s, color .1s; }
        .sup-stars button.on { color: #f5b301; }
        .sup-stars button:hover { transform: scale(1.18); }
        .sup-rate-lbl { font-size: .78rem; color: var(--text-secondary); min-height: 1.2em; margin: 4px 0 8px; }
        .sup-rate textarea { width: 100%; height: 76px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 8px; font-family: inherit; font-size: .85rem; background: var(--bg-surface); color: inherit; box-sizing: border-box; }
        .sup-rate .cnt { font-size: .7rem; color: var(--text-secondary); text-align: left; margin: 2px 0 8px; }
        .sup-rate .btns { display: flex; gap: 8px; justify-content: center; }
        .sup-rate .btns button { font-family: inherit; font-size: .84rem; border-radius: 10px; padding: 7px 16px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-surface); color: inherit; }
        .sup-rate .btns button.go { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
        .sup-rate .btns button[disabled] { opacity: .5; cursor: not-allowed; }
        .sup-tk { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; cursor: pointer; }
        .sup-tk:hover { border-color: var(--accent); }
        .sup-tk.wait { border-right: 4px solid #e53935; }
        .sup-tk .t1 { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; font-weight: 800; }
        .sup-tk .t2 { font-size: .78rem; color: var(--text-secondary); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .sup-flt button { font-family: inherit; font-size: .78rem; border: 1px solid var(--border); background: var(--bg-surface); color: inherit; border-radius: 14px; padding: 4px 11px; cursor: pointer; margin: 0 0 6px 4px; }
        .sup-flt button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
        #to-footer-fab { position: fixed; right: 16px; bottom: 18px; z-index: 940; height: 48px; padding: 0 16px 0 14px; border-radius: 24px; border: 1px solid var(--border); cursor: pointer;
            background: var(--bg-card); color: var(--accent); font-family: inherit; font-weight: 800; font-size: .85rem; display: flex; align-items: center; gap: 8px;
            box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: opacity .25s, transform .25s; }
        #to-footer-fab:hover { transform: translateY(-2px); border-color: var(--accent); }
        #to-footer-fab i { font-size: 1.05rem; }
        #to-footer-fab.hide { opacity: 0; pointer-events: none; transform: translateY(12px); }
        @media (max-width: 600px) { #to-footer-fab { right: 12px; bottom: 76px; height: 44px; padding: 0 12px; } #to-footer-fab span { display: none; } }
        .badge-king { background: linear-gradient(135deg, #7b1fa2, #d4af37); box-shadow: 0 2px 8px rgba(212, 175, 55, 0.55); letter-spacing: .2px; }
        .badge-colonel { background: linear-gradient(135deg, #6a1b9a, #4a148c); box-shadow: 0 2px 5px rgba(106, 27, 154, 0.4); } 
        .badge-lieutenant { background: linear-gradient(135deg, #2c3e50, #34495e); box-shadow: 0 2px 5px rgba(44, 62, 80, 0.4); } 

        .user-number-tag {
            background: var(--purple);
            color: #fff;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .log-item {
            background: var(--bg-surface);
            border-right: 4px solid var(--accent);
            padding: 10px;
            border-radius: 6px;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.8rem;
            border: 1px solid var(--border);
        }
        .log-icon-wrap {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: var(--bg-card);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent);
            margin-left: 10px;
        }

        .product-detail-container {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }

        @media(min-width: 768px) {
            .product-detail-container {
                grid-template-columns: 240px 1fr;
            }
        }

        .product-detail-img {
            max-width: 100% !important;
            height: 380px !important;
            width: auto !important;
            object-fit: contain !important;
            background-color: var(--bg-surface) !important;
            padding: 15px !important;
            border-radius: 8px !important;
            display: block !important;
            margin: 0 auto !important;
            box-shadow: var(--shadow) !important;
            transition: filter 0.3s;
        }

        .product-meta-box {
            background: var(--bg-surface);
            padding: 0.8rem;
            border-radius: 8px;
            margin-top: 0.8rem;
            font-size: 0.85rem;
        }

        .product-meta-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.4rem;
            border-bottom: 1px dashed var(--border);
            padding-bottom: 0.3rem;
        }

        .rating-box {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--gold);
            font-weight: bold;
            margin: 0.5rem 0 0.8rem 0;
            font-size: 1rem;
        }

        .interactive-stars {
            display: inline-flex;
            flex-direction: row-reverse;
            gap: 6px;
            cursor: pointer;
            font-size: 1.3rem;
            color: #d1c7bd;
            unicode-bidi: bidi-override;
            direction: ltr;
        }

        .interactive-stars i.rated,
        .interactive-stars i:hover,
        .interactive-stars i:hover ~ i {
            color: var(--gold);
        }

        .comments-section, .endorsements-section {
            margin-top: 1.5rem;
            border-top: 2px solid var(--border);
            padding-top: 1rem;
        }

        .comment-wrapper {
            border-bottom: 1px solid var(--border);
            padding-bottom: 12px;
            margin-bottom: 12px;
            border-radius: 6px;
            padding: 8px;
            transition: background-color 0.3s;
        }
        
        .comment-wrapper:nth-child(even) {
            background-color: rgba(140, 45, 25, 0.04); 
            border: 1px solid rgba(140, 45, 25, 0.1);
        }
        [data-theme="dark"] .comment-wrapper:nth-child(even) {
            background-color: rgba(229, 107, 79, 0.06); 
            border: 1px solid rgba(229, 107, 79, 0.15);
        }

        .comment-wrapper:last-child {
            border-bottom: none;
        }

        .comment-card {
            padding: 0.4rem;
        }

        .comment-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 0.4rem;
        }

        .comment-user-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .comment-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
            border: 1px solid var(--border);
        }
        
        .reply-card {
            margin-right: 2.5rem; 
            background: var(--bg-surface);
            border-right: 3px solid var(--purple);
            padding: 0.6rem;
            border-radius: 6px 0 0 6px;
            margin-top: 0.5rem;
            font-size: 0.8rem;
        }
        
        .reply-box-container {
            margin-right: 2.5rem;
            margin-top: 0.6rem;
            display: none;
            background: var(--bg-card);
            padding: 8px;
            border-radius: 6px;
            border: 1px solid var(--border);
        }

        .endorsement-card {
            background: var(--bg-surface);
            border-radius: 8px;
            padding: 0.8rem;
            margin-bottom: 0.8rem;
            border-right: 4px solid var(--gold);
            font-size: 0.85rem;
        }

        .password-input-wrap {
            position: relative;
            display: flex;
            align-items: center;
        }

        .password-input-wrap input {
            padding-left: 2.5rem;
        }

        .pwd-toggle-icon {
            position: absolute;
            left: 0.8rem;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 1rem;
            z-index: 10;
        }

        .stepper-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            position: relative;
            padding: 0 0.5rem;
        }

        .stepper-container::before {
            content: '';
            position: absolute;
            top: 20px;
            left: 10%;
            right: 10%;
            height: 2px;
            background-color: var(--border);
            z-index: 1;
        }

        .step-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            z-index: 2;
        }

        .step-icon {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: var(--bg-surface);
            border: 2px solid var(--border);
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 1rem;
            color: var(--text-secondary);
            margin-bottom: 0.3rem;
        }

        .step-item.active .step-icon {
            background-color: var(--purple);
            border-color: var(--purple);
            color: #fff;
        }

        .step-item.completed .step-icon {
            background-color: #27ae60;
            border-color: #27ae60;
            color: #fff;
        }

        .step-label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .cart-item-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.8rem;
            border-bottom: 1px solid var(--border);
            background: var(--bg-surface);
            border-radius: 8px;
            margin-bottom: 0.6rem;
            font-size: 0.9rem;
            gap: 10px;
        }

        .cart-item-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .cart-item-thumb {
            width: 45px;
            height: 55px;
            object-fit: cover;
            border-radius: 4px;
        }

        .quantity-control {
            display: flex;
            align-items: center;
            gap: 6px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 2px 6px;
        }

        .qty-btn {
            background: none;
            border: none;
            font-size: 1rem;
            cursor: pointer;
            color: var(--ink-accent);
            font-weight: bold;
        }

        .cart-summary-box {
            background: var(--bg-surface);
            border-radius: 8px;
            padding: 1rem;
            margin-top: 1rem;
        }

        .summary-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.4rem;
            font-size: 0.9rem;
        }

        .summary-total {
            border-top: 2px dashed var(--border);
            padding-top: 0.6rem;
            margin-top: 0.6rem;
            font-weight: bold;
            font-size: 1.1rem;
            color: var(--ink-accent);
        }

        .address-form-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.8rem;
        }

        @media(min-width: 600px) {
            .address-form-grid {
                grid-template-columns: 1fr 1fr;
            }
        }

        .form-group {
            margin-bottom: 0.8rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.3rem;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .form-control {
            width: 100%;
            padding: 0.6rem 0.9rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            background-color: var(--bg-surface);
            color: var(--text-primary);
            font-family: var(--font-body);
            font-size: 0.9rem;
        }

        select.form-control option {
            background-color: var(--bg-card);
            color: var(--text-primary);
        }

        .image-mode-selector {
            display: flex;
            gap: 10px;
            margin-bottom: 0.6rem;
            flex-wrap: wrap;
        }

        .image-mode-option {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
        }

        .image-preview-container {
            margin-top: 0.6rem;
            display: none;
            text-align: center;
        }

        .image-preview-img {
            max-height: 100px;
            border-radius: 8px;
            border: 1px solid var(--border);
        }

        .auth-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 1.2rem;
            border-bottom: 2px solid var(--border);
        }

        .auth-tab-btn {
            padding: 0.6rem 1rem;
            border: none;
            background: none;
            font-family: var(--font-body);
            font-weight: bold;
            font-size: 0.9rem;
            color: var(--text-secondary);
            cursor: pointer;
            border-bottom: 3px solid transparent;
            
        }

        .auth-tab-btn.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }

        .forgot-pwd-link {
            display: inline-block;
            margin-top: 0.6rem;
            font-size: 0.8rem;
            color: var(--ink-accent);
            text-decoration: none;
            cursor: pointer;
            font-weight: 600;
        }

        .btn-sm {
            padding: 0.25rem 0.5rem;
            font-size: 0.75rem;
            border-radius: 6px;
        }

        .btn-danger {
            background-color: #c0392b;
            color: #fff;
            border: none;
        }

        .btn-warning {
            background-color: #e67e22;
            color: #fff;
            border: none;
        }

        .bookish-ribbon {
            background-color: var(--accent);
            color: #fff;
            text-align: center;
            padding: 0.3rem;
            font-size: 0.8rem;
        }

        footer {
            background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
            border-top: 2px solid var(--border);
            padding: 2.5rem 1rem 1.5rem 1rem;
            margin-top: auto;
            box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
        }

        .footer-container {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 1fr;
            gap: 2rem;
        }

        @media(min-width: 768px) {
            .footer-container {
                grid-template-columns: 1fr 1fr;
                align-items: center;
            }
        }

        .footer-col {
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
        }

        .footer-col-left {
            align-items: flex-start;
        }

        @media(min-width: 768px) {
            .footer-col-left {
                align-items: flex-end;
                text-align: left;
            }
        }

        .footer-contact-title {
            font-family: var(--font-head);
            font-size: 1.3rem;
            color: var(--accent);
            margin-bottom: 0.2rem;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .footer-lux-contact {
            display: flex;
            flex-direction: column;
            gap: 0.7rem;
        }

        .footer-lux-item {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            background: var(--bg-primary);
            padding: 0.5rem 1rem;
            border-radius: 10px;
            border: 1px solid var(--border);
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--text-primary);
            box-shadow: 0 4px 10px rgba(0,0,0,0.02);
            text-decoration: none;
            direction: ltr;
            unicode-bidi: embed;
            justify-content: flex-start;
        }

        .footer-lux-item span {
            unicode-bidi: embed;
        }

        .footer-lux-item i {
            font-size: 1rem;
            color: var(--accent);
        }

        .footer-vasl-logo {
            width: 22px;
            height: 22px;
            border-radius: 5px;
            object-fit: cover;
        }

        .footer-socials {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .rgb-border-wrap {
            position: relative;
            border-radius: 10px;
            overflow: hidden;
            padding: 2px;
            display: inline-block;
        }

        .rgb-border-wrap::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: conic-gradient(from 0deg, #ff0055, #ffae00, #00ff66, #00ffff, #7000ff, #ff0055);
            animation: rotateRgb 4s linear infinite;
        }

        @keyframes rotateRgb {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .footer-social-link {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 600;
            font-size: 0.85rem;
            background: var(--bg-card);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            direction: ltr;
            z-index: 1;
        }

        .footer-social-link span {
            unicode-bidi: embed;
        }

        .footer-bottom {
            grid-column: 1 / -1;
            text-align: center;
            border-top: 1px dashed var(--border);
            padding-top: 1.2rem;
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

       /* استایل‌های پرینت فاکتور (اصلاح شده) */
        @media print {
            body * { visibility: hidden !important; }
            #printable-invoice, #printable-invoice * { visibility: visible !important; }
            #printable-invoice { 
                position: absolute; 
                left: 0; 
                top: 0; 
                width: 100%; 
                margin: 0; 
                padding: 10px; 
                -webkit-print-color-adjust: exact !important; 
                print-color-adjust: exact !important; 
            }
            @page { size: auto; margin: 5mm; }
            .modal-overlay { position: absolute; background: transparent !important; display: block !important; }
            .modal-content { box-shadow: none !important; border: none !important; max-height: none !important; overflow: visible !important; background: transparent !important; }
            .close-modal, .btn { display: none !important; }
        }
    


/* ── حالت پیش‌فروش ─────────────────────────────────────── */
.presale-box { border:1px dashed var(--border); border-radius:10px; padding:10px 12px; margin:0 0 1rem; background:var(--bg-surface); }
.presale-toggle { display:flex; align-items:center; gap:8px; cursor:pointer; margin:0; }
.presale-toggle input { width:18px; height:18px; accent-color:#e67e22; flex:none; }
.presale-toggle small { color:var(--text-secondary); font-size:0.75rem; }
.presale-pill { display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px; background:rgba(230,126,34,0.14); border:1px solid rgba(230,126,34,0.55); color:#d35400; border-radius:999px; padding:2px 10px; font-size:0.74rem; font-weight:700; margin:0 0 0.4rem; line-height:1.7; }
.presale-pill span { font-weight:500; }
.presale-banner { background:rgba(230,126,34,0.12); border:1px solid rgba(230,126,34,0.55); color:var(--text-primary); padding:10px 12px; border-radius:10px; margin-bottom:0.8rem; font-size:0.88rem; line-height:1.9; }
.presale-banner i { color:#e67e22; }
