/* =========================================================
   تكنو-دليل | بوابة الحلول الرقمية — theme-style.css
   تنسيقات الواجهة، الوضع الليلي، الاستجابة، ولوحة الإدارة
   ========================================================= */

        .custom-modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
            display: flex; justify-content: center; align-items: center;
            z-index: 10000; opacity: 0; visibility: hidden; transition: all 0.25s ease;
        }
        .custom-modal-overlay.active { opacity: 1; visibility: visible; }
        .custom-modal-box {
            background: var(--card-bg, #1e293b); color: var(--text-main, #f8fafc);
            border: 1px solid var(--border-color, #334155); border-radius: 14px;
            padding: 25px; width: 90%; max-width: 380px;
            box-shadow: 0 15px 35px rgba(0,0,0,0.25); text-align: right; direction: rtl;
        }
        .custom-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
        .custom-modal-btn { padding: 8px 18px; border-radius: 8px; font-size: 0.9rem; font-weight: 500; cursor: pointer; border: none; }
        .custom-modal-btn.confirm { background: var(--accent-color, #f59e0b); color: #fff; }
        .custom-modal-btn.cancel { background: var(--border-color, #334155); color: var(--text-main, #f8fafc); }

        :root {
            --primary-color: #0284c7; --accent-color: #f59e0b;
            --bg-dark: #0f172a; --card-bg: #1e293b;
            --text-main: #f8fafc; --text-muted: #94a3b8; --border-color: #334155;
            --active-font: 'Cairo';
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body, button, input, select, textarea, a, p, h1, h2, h3, h4, h5, h6, span, div, li {
            font-family: var(--active-font, 'Cairo'), sans-serif;
        }

        .top-bar, .top-bar *,
        header, header *,
        .site-footer, .site-footer * {
            font-family: 'Cairo', sans-serif !important;
        }

        .top-bar i, header i, .site-footer i {
            font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
        }
        
        #app-index-view { display: block; }
        #app-admin-view { display: none; }

        body {
            background-color: var(--bg-color, #0f172a);
            color: var(--text-main, #f8fafc);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            transition: background 0.3s, color 0.3s;
            padding: 10px;
        }

        .site-outer-frame {
            max-width: 1230px;
            width: 100%;
            margin: 0 auto;
            border: 1px solid gray;
            border-radius: 0px;
            padding: 10px;
            background: var(--bg-color);
            box-shadow: 0 0 0px rgba(0, 0, 0, 0);
            display: flex;
            flex-direction: column;
            flex-grow: 1;
        }

        body.theme-default { --bg-color: #0f172a; --card-bg: #1e293b; --text-main: #f8fafc; --text-muted: #94a3b8; --primary-color: #0284c7; --accent-color: #0284c7; --border-color: #334155; }
        body.theme-blue-1 { --bg-color: #041221; --card-bg: #0c2340; --text-main: #f0f9ff; --text-muted: #7dd3fc; --primary-color: #38bdf8; --accent-color: #38bdf8; --border-color: #1d4ed8; }
        body.theme-pink { --bg-color: #12090e; --card-bg: #1f1017; --text-main: #fce8ef; --text-muted: #d4839d; --primary-color: #e04885; --accent-color: #e04885; --border-color: #5c2438; }
        body.theme-wood { --bg-color: #120e0a; --card-bg: #1f1712; --text-main: #f7ede2; --text-muted: #c29b7a; --primary-color: #b86b3a; --accent-color: #b86b3a; --border-color: #593f2b; }
        body.theme-green { --bg-color: #051911; --card-bg: #0d2e20; --text-main: #ecfdf5; --text-muted: #6ee7b7; --primary-color: #10b981; --accent-color: #10b981; --border-color: #065f46; }
        body.theme-purple { --bg-color: #130a24; --card-bg: #231442; --text-main: #f5f3ff; --text-muted: #c4b5fd; --primary-color: #8b5cf6; --accent-color: #8b5cf6; --border-color: #5b21b6; }
        body.theme-amber { --bg-color: #181004; --card-bg: #291c08; --text-main: #fffbeb; --text-muted: #fcd34d; --primary-color: #f59e0b; --accent-color: #f59e0b; --border-color: #78350f; }
        body.theme-crimson { --bg-color: #190709; --card-bg: #2b0d11; --text-main: #fff1f2; --text-muted: #fda4af; --primary-color: #e11d48; --accent-color: #e11d48; --border-color: #881337; }
        body.theme-teal { --bg-color: #041818; --card-bg: #0b2b2b; --text-main: #f0fdfa; --text-muted: #5eead4; --primary-color: #14b8a6; --accent-color: #14b8a6; --border-color: #115e59; }
        body.theme-indigo { --bg-color: #0b0d24; --card-bg: #161a42; --text-main: #eef2ff; --text-muted: #a5b4fc; --primary-color: #6366f1; --accent-color: #6366f1; --border-color: #3730a3; }
        body.theme-orange { --bg-color: #1a0c04; --card-bg: #2e1608; --text-main: #fff7ed; --text-muted: #fdba74; --primary-color: #f97316; --accent-color: #f97316; --border-color: #7c2d12; }
        body.theme-cyan { --bg-color: #04171d; --card-bg: #092a36; --text-main: #ecfeff; --text-muted: #67e8f9; --primary-color: #06b6d4; --accent-color: #06b6d4; --border-color: #155e75; }
        body.theme-lime { --bg-color: #0f1a04; --card-bg: #1b2e08; --text-main: #f7fee7; --text-muted: #bef264; --primary-color: #84cc16; --accent-color: #84cc16; --border-color: #3f6212; }
        body.theme-fuchsia { --bg-color: #1a061c; --card-bg: #2e0b33; --text-main: #fdf4ff; --text-muted: #f0abfc; --primary-color: #d946ef; --accent-color: #d946ef; --border-color: #701a75; }
        body.theme-slate { --bg-color: #0b0f17; --card-bg: #18202c; --text-main: #f1f5f9; --text-muted: #94a3b8; --primary-color: #64748b; --accent-color: #94a3b8; --border-color: #334155; }
        body.theme-gold { --bg-color: #171407; --card-bg: #29230d; --text-main: #fefce8; --text-muted: #fde047; --primary-color: #eab308; --accent-color: #eab308; --border-color: #713f12; }
        body.theme-coral { --bg-color: #1c0b0a; --card-bg: #301412; --text-main: #fef2f2; --text-muted: #fca5a5; --primary-color: #f87171; --accent-color: #f87171; --border-color: #7f1d1d; }
        body.theme-mint { --bg-color: #061a14; --card-bg: #0c2e24; --text-main: #ecfdf5; --text-muted: #6ee7b7; --primary-color: #34d399; --accent-color: #34d399; --border-color: #047857; }
        body.theme-royal { --bg-color: #070e24; --card-bg: #0f1d47; --text-main: #eff6ff; --text-muted: #93c5fd; --primary-color: #2563eb; --accent-color: #3b82f6; --border-color: #1e40af; }
        body.theme-plum { --bg-color: #17081c; --card-bg: #290f33; --text-main: #faf5ff; --text-muted: #d8b4fe; --primary-color: #a855f7; --accent-color: #c084fc; --border-color: #6b21a8; }

        .admin-container { max-width: 950px; margin: 0 auto; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); width: 100%; }
        h2 { color: var(--accent-color); margin-bottom: 20px; border-bottom: 2px solid var(--primary-color); padding-bottom: 8px; }
        h3 { color: var(--primary-color); margin-bottom: 12px; font-size: 1.1rem; }
        .form-group { margin-bottom: 15px; }
        label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
        input, textarea, select { width: 100%; padding: 10px; background: var(--bg-dark); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 6px; font-size: 0.95rem; }
        textarea { height: 110px; resize: vertical; }
        .btn { background: var(--primary-color); color: #fff; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 700; }
        .btn:hover { opacity: 0.9; }
        .btn-danger { background: #ef4444; }
        .btn-warning { background: #eab308; color: #000; }
        .section-box { background: rgba(255,255,255,0.02); border: 1px solid var(--border-color); padding: 20px; border-radius: 8px; margin-bottom: 25px; }
        .checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: normal; }
        .checkbox-label input { width: auto; }

        /* 
        .widgets-table { width: 100%; border-collapse: collapse; text-align: right; font-size: 0.85rem; }
        .widgets-table th { color: var(--accent-color); border-bottom: 1px solid var(--border-color); padding: 8px; }
        .widgets-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
        */
        
        .sticky-editor-header {
            position: sticky; top: 10px; z-index: 1000; background: var(--card-bg);
            border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 15px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.6); margin-bottom: 10px;
        }
        .ql-toolbar.ql-snow { 
            position: sticky; top: 115px; z-index: 999;
            background: var(--bg-dark) !important; border-color: var(--border-color) !important; 
            border-radius: 6px; direction: ltr; 
        }
        .custom-font-bar {
            display: flex; gap: 6px; align-items: center; margin-bottom: 8px;
            padding-bottom: 8px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap;
        }
        .font-tag-btn {
            background: var(--bg-dark); color: var(--text-main); border: 1px solid var(--border-color);
            padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; cursor: pointer; font-weight: 600;
        }
        .font-tag-btn:hover { background: var(--primary-color); border-color: var(--primary-color); }
        .ql-container.ql-snow { 
            background: var(--bg-dark); color: var(--text-main); border-color: var(--border-color); 
            border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; min-height: 350px; 
            font-size: 1.05rem; direction: rtl; text-align: right; 
        }
        .ql-editor { direction: rtl; text-align: right; min-height: 330px; }

        #color-palette-popup {
            position: fixed;
            top: 135px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(15, 23, 42, 0.88);
            backdrop-filter: blur(8px);
            border: 2px solid var(--primary-color);
            border-radius: 12px;
            padding: 15px;
            z-index: 10005;
            display: none;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
            width: 280px;
        }

        #color-palette-popup.active {
            display: block !important;
        }

        .palette-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            color: #fff;
            font-size: 0.85rem;
            font-weight: bold;
        }
        .palette-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 8px;
        }
        .palette-swatch {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            border: 2px solid rgba(255,255,255,0.4);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 1rem;
            transition: transform 0.15s, border-color 0.15s;
        }
        .palette-swatch:hover { transform: scale(1.08); border-color: #fff; }
        .palette-swatch.selected { border: 2px solid #fff; box-shadow: 0 0 8px rgba(255,255,255,0.8); }

        .header-center h1 { color: #ffffff !important; }
        .header-center h1 span { color: var(--primary-color) !important; }
        .header-center p { 
            color: var(--primary-color) !important; 
            filter: brightness(1.35); 
        }

    /* لون النصف الأول في الوضع العادي (أبيض تماماً) */
    #site-main-heading .first-half-span {
        color: #ffffff !important;
    }

    /* لون النصف الأول ليصبح أسود صريحاً في الوضع الليلي لضمان وضوحه */
    body.light-mode #site-main-heading .first-half-span,
    body.light-mode[class*="theme-"] #site-main-heading .first-half-span {
        color: #000000 !important; 
    }

        /* تنسيق مستطيلات التنقل أسفل المقال (سطح المكتب والجوال) */
        .bottom-nav-header-arrows {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        .bottom-nav-boxes-row {
            display: flex;
            justify-content: space-between;
            align-items: stretch;
            gap: 15px;
        }
        .nav-rect-box {
            flex: 1;
            min-width: 0;
            height: 76px;
            padding: 8px 14px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            text-decoration: none;
            color: var(--text-main);
            box-sizing: border-box;
            transition: border-color 0.2s;
        }
        .nav-rect-box:hover {
            border-color: var(--primary-color);
        }
        .nav-rect-box.empty-box {
            border-style: dashed;
            color: var(--text-muted);
            font-size: 0.82rem;
        }
        /* السماح بسطرين فقط مع سكرول عمودي للزيادة */
        .nav-rect-title-scroll {
            max-height: 3.1em;
            line-height: 1.55em;
            overflow-y: auto;
            overflow-x: hidden;
            width: 100%;
            font-size: 0.85rem;
            font-weight: bold;
            color: var(--accent-color);
            word-break: break-word;
            scrollbar-width: thin;
        }
        .nav-rect-title-scroll::-webkit-scrollbar {
            width: 4px;
        }
        .nav-rect-title-scroll::-webkit-scrollbar-thumb {
            background: var(--border-color);
            border-radius: 4px;
        }

        @media (max-width: 768px) {
            .bottom-nav-boxes-row {
                gap: 10px !important;
            }
            .nav-rect-box {
                height: 72px !important;
                padding: 6px 10px !important;
            }
            .nav-rect-title-scroll {
                font-size: 0.8rem !important;
                max-height: 3em !important;
                line-height: 1.5em !important;
            }
        }

        /* لظهور مكان الإعلان */
        .article-ad-box.ad-placeholder-box {
            border: 2px dashed var(--accent-color, #f59e0b) !important;
            background: rgba(245, 158, 11, 0.05) !important;
            min-height: 90px !important;
            color: var(--text-muted) !important;
            font-size: 0.85rem !important;
            font-weight: bold !important;
        }

        /* إعلان الهيدر الأيسر لسطح المكتب والجوال */
        header {
            display: grid;
            grid-template-columns: 200px 1fr 200px;
            align-items: center;
            gap: 15px;
        }
        #header-left-ad {
            max-width: 180px;
            min-height: 60px;
            margin: 0;
            justify-self: start;
        }

        /* تعديل الجداول وتوحيد الألوان ونزع أي خلفيات تحديد للنصوص المنسوخة */
        .single-post-content table,
        .dynamic-post-content-box table {
            width: 100% !important;
            border-collapse: collapse !important;
            margin: 15px auto !important;
            table-layout: fixed;
        }

        .single-post-content th, .single-post-content td,
        .dynamic-post-content-box th, .dynamic-post-content-box td {
            border: 1px solid #70533c !important;
            padding: 8px 10px !important;
            text-align: right !important;
            color: #000000 !important;
            background-color: #e6ccb2 !important;
            font-weight: bold !important;
            font-size: 0.85rem !important;
            word-wrap: break-word;
        }

        .single-post-content tr:first-child th, 
        .single-post-content tr:first-child td,
        .dynamic-post-content-box tr:first-child th, 
        .dynamic-post-content-box tr:first-child td,
        .single-post-content tr td:first-child,
        .dynamic-post-content-box tr td:first-child,
        .single-post-content tr th:first-child,
        .dynamic-post-content-box tr th:first-child {
            background-color: #3b281b !important; 
            color: #e6ccb2 !important; 
            font-weight: bold !important;
        }

        .single-post-content td:not(:first-child),
        .dynamic-post-content-box td:not(:first-child) {
            background-color: #e6ccb2 !important;
            color: #000000 !important;
        }
        
        .single-post-content td *, .dynamic-post-content-box td * {
            background-color: transparent !important;
        }
        .single-post-content tr:first-child td *, .single-post-content tr:first-child th *,
        .dynamic-post-content-box tr:first-child td *, .dynamic-post-content-box tr:first-child th *,
        .single-post-content tr td:first-child *, .dynamic-post-content-box tr td:first-child * {
            color: inherit !important;
            background-color: transparent !important;
        }

        .item-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--border-color); background: rgba(0,0,0,0.15); border-radius: 6px; margin-bottom: 6px; gap: 10px; }

        /* ضبط المدونة على شاشات الجوال */
        @media (max-width: 1024px) {
            .site-outer-frame {
                padding: 5px;
            }
            .three-columns-grid {
                grid-template-columns: 1fr;
            }
        }

        /* تنسيق قائمة خيارات الصورة العائمة */
        .image-options-popup {
            position: absolute;
            background: var(--card-bg, #1e293b);
            border: 1px solid var(--border-color, #334155);
            border-radius: 8px;
            padding: 6px;
            display: flex;
            gap: 6px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            z-index: 10000;
            direction: rtl;
        }
        .image-options-popup button {
            background: var(--bg-dark, #0f172a);
            color: var(--text-main, #f8fafc);
            border: 1px solid var(--border-color);
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }
        .image-options-popup button:hover {
            background: var(--primary-color, #0284c7);
            color: #fff;
        }
        .image-options-popup button.delete-btn {
            color: #ef4444;
        }
        .image-options-popup button.delete-btn:hover {
            background: #ef4444;
            color: #fff;
        }

        /* عدم ظهور إعلان الهيدر في حال كان جوال */
        @media (max-width: 768px) {
            #header-left-ad,
            .header-left-ad-box {
                display: none !important;
                visibility: hidden !important;
                width: 0 !important;
                height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
            }
        }

        
        /* شريط محتويات خاص بوضع الكمبيوتر */
        @media (min-width: 769px) {
            #dynamic-post-view,
            #dynamic-post-content-box,
            .single-post-content {
                overflow: visible !important;
            }

            #desktop-toc-container {
                position: -webkit-sticky !important;
                position: sticky !important;
                top: 52px !important;
                z-index: 950 !important;
                width: 100%;
                margin-bottom: 15px;
            }

            #desktop-toc-select {
                width: 100%;
                padding: 10px 14px;
                border: 1px solid var(--border-color);
                border-radius: 8px;
                background: var(--card-bg);
                color: var(--text-main);
                font-family: 'Cairo', sans-serif;
                font-size: 0.9rem;
                font-weight: bold;
                cursor: pointer;
                outline: none;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            }
        }

                .ql-snow .ql-stroke { stroke: var(--text-main); }
        .ql-snow .ql-fill { fill: var(--text-main); }
        .ql-snow .ql-picker { color: var(--text-main); }
        .ql-font-cairo { font-family: 'Cairo', sans-serif !important; }
        .ql-font-tajawal { font-family: 'Tajawal', sans-serif !important; }
        .ql-font-amiri { font-family: 'Amiri', serif !important; }
        .ql-editor img { cursor: grab; resize: both; }
        .ql-editor img:active { cursor: grabbing; }
        
        .post-card, #editor-container, .ql-container.ql-snow, #widget-custom-text, #widgets-list-box {
            background-color: #F7F4EF !important;
            background-image: url('https://www.transparenttextures.com/patterns/cream-pixels.png');
            border: 1px solid #E2D8C5 !important;
            border-radius: 12px;
            color: #2C3E50 !important;
        }
        
        .ql-editor, .post-card p, .section-box textarea, input[type="text"] {
            text-align: justify !important;
            text-justify: inter-word !important;
            color: #2C3E50 !important;
            line-height: 2 !important;
        }
        
        .post-card h1, .post-card h2, .post-card h3 { color: #2C3E50 !important; }
        #widgets-list-box { background: var(--bg-dark) !important; background-image: none !important; border: 1px solid var(--border-color) !important; color: var(--text-main) !important; }
        .ql-editor { text-align: justify !important; text-justify: inter-word !important; line-height: 2 !important; }
        
        /*
        .ql-editor table { width: 100% !important; max-width: 100% !important; table-layout: auto !important; }
        .ql-editor td, .ql-editor th { white-space: normal !important; word-break: break-word !important; vertical-align: top; }
        */

        .drag-item.drop-indicator-top { border-top: 2px solid var(--accent-color) !important; }
        .drag-item.drop-indicator-bottom { border-bottom: 2px solid var(--accent-color) !important; }
        .drag-item.drag-over-parent { background: rgba(245, 158, 11, 0.15) !important; border-left: 4px solid #ff9800 !important; }
        .drag-item.dragging { opacity: 0.4; }
        @keyframes fq-pulse { 0% { background-color: transparent; box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7); } 70% { background-color: rgba(255, 87, 34, 0.3); box-shadow: 0 0 0 10px rgba(255, 87, 34, 0); } 100% { background-color: transparent; box-shadow: 0 0 0 0 rgba(255, 87, 34, 0); } }
        .pulse-highlight { animation: fq-pulse 0.8s ease-in-out; border: 2px solid #ff5722 !important; }

        .section-title { text-align: center; color: var(--text-main); font-size: 1rem; font-weight: bold; margin-bottom: 8px; background-color: var(--accent-color); padding: 5px; border-radius: 6px; }
        .top-bar { background: var(--card-bg); border-bottom: 1px solid var(--border-color); padding: 8px 20px; display: grid; grid-template-columns: 1fr auto; align-items: center; font-size: 0.85rem; width: 100%; margin: 0 auto; border-radius: 8px 8px 0 0; }
        .top-pages { display: flex; gap: 12px; justify-content: flex-start; align-items: center; flex-wrap: wrap; }
        .top-pages a { color: var(--text-muted); text-decoration: none; font-size: 0.8rem; }
        .top-pages a:hover { color: var(--primary-color); }
        .sidebar-controls-box { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; margin-bottom: 15px; }
        .sidebar-controls-inner { display: flex; align-items: center; justify-content: center; gap: 8px; }
        
        .unified-bar-btn {
            width: 38px !important;
            height: 32px !important;
            min-width: 38px !important;
            max-width: 38px !important;
            padding: 0 !important;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.85rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s, color 0.2s;
        }
        .unified-bar-btn:hover { background: rgba(2, 132, 199, 0.25); color: var(--accent-color); }

        .top-social { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
        .top-social a { color: var(--text-muted); font-size: 0.9rem; text-decoration: none; transition: color 0.2s; }
        .top-social a:hover { color: var(--accent-color); }
        header { background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%); border-bottom: 2px solid var(--primary-color); padding: 10px; display: grid; grid-template-columns: 200px 1fr 200px; align-items: center; gap: 15px; width: 100%; margin: 10px auto 0; border-radius: 10px; border: 1px solid var(--border-color); position: sticky; top: -200px; z-index: 1000; }
        .header-logo { display: flex; align-items: center; justify-content: flex-start; }
        .header-logo img { max-height: 100px; }
        .header-center { text-align: center; }
        .header-center h1 { font-size: 2.2rem; font-weight: 900; color: var(--text-main); }
        .header-center h1 span { color: var(--primary-color); }
        .header-center p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 5px; }
        .header-themes-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 3px 6px; background: rgba(0,0,0,0.15); border-radius: 6px; max-width: 330px; margin: 0 auto; }

        .ticker-wrapper { width: 100%; margin: 15px auto 0; padding: 0; }
        .ticker-container { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 15px; display: flex; align-items: center; position: relative; overflow: hidden; }
        .ticker-title { background: var(--accent-color); color: #000; padding: 5px 12px; font-size: 0.85rem; font-weight: 700; border-radius: 4px; margin-left: 15px; flex-shrink: 0; z-index: 5; position: relative; }

        .ticker-viewport {
            overflow: hidden !important;
            width: 100%;
            position: relative;
            height: 24px;
            display: flex;
            align-items: center;
        }

        @keyframes siteTickerContinuousRun {
            from {
                transform: translate3d(var(--ticker-from-x, 0px), 0, 0);
            }
            to {
                transform: translate3d(var(--ticker-to-x, 100%), 0, 0);
            }
        }

        .ticker-content.ticker-active-motion {
            display: inline-flex !important;
            align-items: center !important;
            white-space: nowrap !important;
            width: max-content !important;
            max-width: none !important;
            position: relative !important;
            right: auto !important;
            left: auto !important;
            opacity: 1 !important;
            visibility: visible !important;
            will-change: transform;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            animation-name: siteTickerContinuousRun;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
            animation-fill-mode: both;
        }

        .ticker-content span {
            margin-left: 35px;
            cursor: pointer;
            flex-shrink: 0;
        }

        .ticker-wrapper:hover .ticker-content.ticker-active-motion,
        .ticker-wrapper:active .ticker-content.ticker-active-motion {
            animation-play-state: paused !important;
        }

        .ticker-viewport {
            overflow: hidden !important;
            width: 100%;
            position: relative;
            height: 24px;
            display: flex;
            align-items: center;
            contain: layout style;
        }

        
        .main-menu-bar { width: 100%; margin: 10px auto 0; padding: 0; position: sticky; top: 0px; z-index: 999; }
        .mega-menu { background: var(--card-bg); border: 2px solid var(--primary-color); border-radius: 10px; display: flex; flex-wrap: wrap; list-style: none; padding: 5px 10px; gap: 5px; justify-content: flex-start; }
        .mega-menu li a, .mega-menu > a { display: flex; align-items: center; gap: 6px; padding: 8px 16px; color: var(--text-main); text-decoration: none; font-weight: 700; font-size: 13px; border-radius: 6px; }
        .mega-menu li a:hover, .mega-menu > a:hover { background: rgba(2, 132, 199, 0.2); color: var(--accent-color); }
        .dropdown-menu { position: absolute; top: 100%; right: 0; min-width: 200px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; list-style: none; display: none; box-shadow: 0 10px 25px rgba(0,0,0,0.3); z-index: 99; text-align: right; padding: 5px 0; }
        .mega-menu > li { position: relative; }
        .mega-menu > li:hover > .dropdown-menu { display: block; }
        .dropdown-menu li { position: relative; border-bottom: 1px solid var(--border-color); }
        .dropdown-menu li:last-child { border-bottom: none; }
        .dropdown-menu li a { display: block; padding: 9px 15px; color: var(--text-main); text-decoration: none; font-size: 12.5px; font-weight: 600; transition: 0.2s; }
        .dropdown-menu li a:hover { background: rgba(2, 132, 199, 0.2); color: var(--accent-color); padding-right: 20px; }
        .dropdown-menu li:hover > .dropdown-menu { display: block; position: absolute; right: 100%; top: -5px; }
        .content img, .post-img, .featured-img, article img { display: block !important; margin: 15px auto !important; max-width: 100%; height: auto; border-radius: 8px; }
        .three-columns-grid { width: 100%; margin: 20px auto 0; padding: 0; display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; position: relative; }
        @media (max-width: 950px) { .three-columns-grid { grid-template-columns: 1fr; } }
        .right-scrollable-section { width: 100%; }
        .top-right-row { display: flex; gap: 15px; align-items: stretch; margin-bottom: 15px; }
        .square-slider-box { flex: 1.6; height: 310px; position: relative; border-radius: 12px; overflow: hidden; background: var(--card-bg); border: 1px solid var(--border-color); }
        .square-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s ease; background-size: cover; background-position: center; display: flex; align-items: flex-end; }
        .square-slide.active { opacity: 1; }
        .square-caption { background: linear-gradient(to top, rgba(15,23,42,0.95), transparent); width: 100%; padding: 15px; z-index: 2; }
        .square-title { font-size: 1.05rem; color: var(--accent-color); font-weight: 700; margin-bottom: 5px; cursor: pointer; }
        .square-desc { font-size: 0.75rem; color: #cbd5e1; }
        .slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(15, 23, 42, 0.6); color: #fff; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; font-size: 0.9rem; }
        .slider-arrow:hover { background: var(--primary-color); }
        .slider-prev { right: 10px; }
        .slider-next { left: 10px; }
        .news-mini-container { flex: 1; background: var(--card-bg); border: 2px dashed var(--border-color); border-radius: 12px; height: 310px; padding: 15px; display: flex; flex-direction: column; overflow: hidden; color: var(--text-muted); font-size: 0.9rem; box-sizing: border-box; }
        .products-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 6px; flex: 1; min-height: 0; overflow-y: auto; }
        .product-card { background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; text-decoration: none; overflow: hidden; padding: 8px 12px; position: relative; transition: all 0.3s ease; }
        .product-card:hover { background-color: var(--card-bg); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
        .product-card span { color: var(--text-main); font-size: 0.85rem; font-weight: bold; text-align: right; }
        #dynamic-post-view .post-card, .dynamic-post-content-box { background-color: #F7F4EF !important; background-image: url('https://www.transparenttextures.com/patterns/cream-pixels.png'); border: 1px solid #E2D8C5 !important; border-radius: 12px; color: #2C3E50 !important; padding: 25px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); }
        .single-post-content, .dynamic-post-content-box { text-align: justify !important; text-justify: inter-word !important; color: #2C3E50 !important; line-height: 2 !important; font-size: 0.88rem !important; }

        body.light-mode,
        body.light-mode[class*="theme-"] {
            --bg-color: #ffffff !important;
            --bg-dark: #f1f5f9 !important;
            --card-bg: #f8fafc !important;
            --text-main: #0f172a !important;
            --text-muted: #475569 !important;
            --border-color: #cbd5e1 !important;
            background-color: #ffffff !important;
            color: #0f172a !important;
        }


        .single-post-content p, .dynamic-post-content-box p { margin-bottom: 11px !important; }
        
        /*
        .single-post-content table, .dynamic-post-content-box table { width: 100% !important; border-collapse: collapse !important; margin: 15px auto !important;}
        .single-post-content th, .single-post-content td, .dynamic-post-content-box th, .dynamic-post-content-box td { border: 1px solid #70533c !important; padding: 8px 10px !important; text-align: right !important; color: #000000 !important; background-color: #e6ccb2 !important; font-weight: bold !important; font-size: 0.85rem !important; word-wrap: break-word; }
        .single-post-content tr:first-child th, .single-post-content tr:first-child td, .dynamic-post-content-box tr:first-child th, .dynamic-post-content-box tr:first-child td, .single-post-content tr td:first-child, .dynamic-post-content-box tr td:first-child, .single-post-content tr th:first-child, .dynamic-post-content-box tr th:first-child { background-color: #3b281b !important; color: #e6ccb2 !important; font-weight: bold !important; }
        .single-post-content td:not(:first-child), .dynamic-post-content-box td:not(:first-child) { background-color: #e6ccb2 !important; color: #000000 !important; }
        .single-post-content td *, .dynamic-post-content-box td * { background-color: transparent !important; }
        .single-post-content tr:first-child td *, .single-post-content tr:first-child th *, .dynamic-post-content-box tr:first-child td *, .dynamic-post-content-box tr:first-child th *, .single-post-content tr td:first-child *, .dynamic-post-content-box tr td:first-child * { color: inherit !important; background-color: transparent !important; }
        */
        
        .left-sticky-sidebar { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 15px; position: sticky; top: 55px; align-self: flex-start; height: calc(100vh - 80px); overflow-y: auto; }
        .left-sticky-sidebar::-webkit-scrollbar { display: none; }
        .left-sticky-sidebar { scrollbar-width: none; -ms-overflow-style: none; }
        .sidebar-widget { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
        .sidebar-widget h4, .sidebar-widget h3 { color: var(--accent-color); font-size: 0.95rem; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; margin-bottom: 8px; }
        .sidebar-widget ul { list-style: none; }
        .sidebar-widget ul li { padding: 6px 0; border-bottom: 1px dashed var(--border-color); font-size: 0.85rem; cursor: pointer; color: var(--text-main); }
        .sidebar-widget ul li:hover { color: var(--accent-color); }
        .tags-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
        .tag-btn { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-main); padding: 6px 15px; border-radius: 20px; cursor: pointer; font-size: 0.85rem; }
        .tag-btn.active, .tag-btn:hover { background: var(--primary-color); color: #fff; }
        .post-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-bottom: 15px; }
        .post-title a { font-size: 1.15rem; font-weight: 700; color: var(--accent-color); text-decoration: none; }
        .post-meta { font-size: 0.8rem; color: var(--text-muted); margin: 8px 0; display: flex; gap: 15px; }
        .post-excerpt { font-size: 0.9rem; color: var(--text-main); line-height: 1.6; margin-bottom: 10px; }
        .widget-card { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; margin-bottom: 15px; }
        .widget-title { color: var(--accent-color); font-size: 1rem; margin-bottom: 8px; border-bottom: 1px dashed var(--border-color); padding-bottom: 5px; }
        .recent-posts-list { list-style: none; padding: 0; }
        .recent-posts-list li { margin-bottom: 6px; font-size: 0.85rem; }
        .recent-posts-list li a { color: var(--text-main); text-decoration: none; display: flex; align-items: center; }
        .recent-posts-list li a:hover { color: var(--accent-color); }
        .site-footer { width: 100%; margin: 15px auto 0; padding: 0; }
        .footer-container { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 15px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
        .footer-bottom-bar { text-align: center; padding: 15px; margin-top: 15px; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.85rem; background: var(--card-bg); border-radius: 8px; }
        .secret-c { cursor: pointer; display: inline-block; padding: 0 2px; font-weight: bold; }
        @media (max-width: 900px) { .footer-container { grid-template-columns: repeat(2, 1fr); } }
        @media (max-width: 600px) { .footer-container { grid-template-columns: 1fr; } }

        /* السماح لـ sticky بالعمل داخل المقال بدون كسره بسبب overflow */
        #dynamic-post-content-box,
        .single-post-content {
            overflow: visible !important;
        }

                #toc-container {
                    position: -webkit-sticky;
                    position: sticky !important;
                    top: 52px !important;
                    z-index: 960 !important;
                    margin-bottom: 15px;
                    width: 100%;
                    background: transparent !important;
                    border: none !important;
                    box-shadow: none !important;
                    padding: 0 !important;
                }

                #toc-select {
                    width: 100%;
                    padding: 10px 14px;
                    border: 1px solid var(--border-color);
                    border-radius: 8px;
                    background: var(--card-bg);
                    color: var(--text-main);
                    font-family: 'Cairo', sans-serif;
                    font-size: 0.9rem;
                    font-weight: bold;
                    cursor: pointer;
                    outline: none;
                    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
                }


                /*للشاشات الأنحف في الجوالات*/
                @media (max-width: 768px) {
                    header {
                        flex-wrap: nowrap !important;
                        gap: 6px !important;
                        padding: 5px 8px !important;
                    }
                    .header-logo img {
                        max-height: 30px !important;
                        max-width: 38px !important;
                    }
                    .header-center {
                        padding: 0 3px !important;
                        min-width: 0 !important;
                    }
                    .header-center h1 {
                        font-size: 0.92rem !important;
                        line-height: 1.15 !important;
                        white-space: nowrap !important;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                    .header-center p {
                        font-size: 0.56rem !important;
                        line-height: 1.1 !important;
                        margin-top: 1px !important;
                        white-space: nowrap !important;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                    .header-themes-bar {
                        gap: 3px !important;
                        padding: 2px 3px !important;
                        max-width: 100% !important;
                        margin-top: 2px !important;
                    }
                    .header-themes-bar .unified-bar-btn {
                        width: 26px !important;
                        height: 24px !important;
                        min-width: 26px !important;
                        max-width: 26px !important;
                        font-size: 0.7rem !important;
                    }
                    .mobile-menu-btn {
                        width: 30px !important;
                        height: 30px !important;
                        font-size: 0.85rem !important;
                    }
                }


        .related-posts-box, .see-also-box { background-color: var(--card-bg) !important; border: 1px solid var(--border-color) !important; border-radius: 8px; padding: 15px; margin: 20px 0; color: var(--text-main) !important; }
        .related-posts-box h4, .see-also-box h4 { color: var(--accent-color) !important; font-size: 1rem; margin-bottom: 10px; border-bottom: 1px dashed var(--border-color); padding-bottom: 5px; }
        .related-posts-box ul, .see-also-box ul { list-style: none; padding: 0; }
        .related-posts-box li, .see-also-box li { margin-bottom: 8px; }
        .related-posts-box a, .see-also-box a { color: var(--primary-color) !important; text-decoration: none; font-weight: 600; }
        .related-posts-box a:hover, .see-also-box a:hover { color: var(--accent-color) !important; text-decoration: underline; }








        @media (max-width: 768px) {
            html, body, #app-index-view, .site-outer-frame, .three-columns-grid, .right-scrollable-section {
                max-width: 100vw !important;
                overflow-x: clip !important;
                min-width: 0;

            }
            
            .top-bar { display: flex !important; justify-content: space-between !important; align-items: center !important; padding: 6px 10px !important; }
            .top-pages { justify-content: flex-start !important; flex-wrap: wrap !important; gap: 8px 14px !important; flex: 1; }
            .top-pages a { font-size: 0.75rem !important; }
            .top-social { display: flex !important; gap: 8px !important; flex-shrink: 0; }
            header { position: sticky !important; top: 0 !important; z-index: 1000 !important; display: flex !important; align-items: center !important; justify-content: space-between !important; flex-wrap: wrap; padding: 6px 12px !important; margin-top: 5px !important; grid-template-columns: none !important; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
            .site-outer-frame { padding-top: 10px !important; }
            .header-logo { flex: 0 0 auto !important; }
            .header-logo img { max-height: 40px !important; }
            .header-center { flex: 1 !important; text-align: center !important; padding: 0 6px !important; }
            .header-center h1 { font-size: 1.2rem !important; line-height: 1.1 !important; margin: 0 !important; }
            .header-center p { font-size: 0.65rem !important; margin-top: 2px !important; white-space: nowrap !important; }
            .header-themes-bar { display: flex !important; max-width: 300px !important; margin: 3px auto 0 auto !important; }
            .mobile-menu-btn { display: flex !important; align-items: center; justify-content: center; background: var(--bg-color); border: 1px solid var(--border-color); color: var(--accent-color); width: 36px; height: 36px; border-radius: 6px; font-size: 1rem; cursor: pointer; flex-shrink: 0; }

            .main-menu-bar { position: fixed !important; top: 55px !important; left: 10px !important; right: 10px !important; width: calc(100% - 20px) !important; max-width: calc(100% - 20px) !important; z-index: 9999 !important; margin: 0 auto !important; box-sizing: border-box !important; }
            .mega-menu { display: none; flex-direction: column !important; gap: 4px !important; padding: 12px !important; max-height: 80vh !important; overflow-y: auto !important; overflow-x: hidden !important; box-shadow: 0 10px 25px rgba(0,0,0,0.3); border: 2px solid var(--primary-color) !important; border-radius: 10px !important; background-color: var(--card-bg) !important; width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }
            .mega-menu.mobile-active { display: flex !important; }
            .mega-menu > li, .mega-menu li { border: 1px solid var(--border-color) !important; border-radius: 6px !important; background: var(--bg-color); width: 100% !important; margin-bottom: 4px; box-sizing: border-box !important; }
            .mega-menu li a, .mega-menu > a { padding: 10px 12px !important; font-size: 0.85rem !important; display: flex !important; justify-content: space-between !important; align-items: center !important; width: 100% !important; box-sizing: border-box !important; }
            .mega-menu .dropdown-menu { position: static !important; display: none !important; box-shadow: none !important; background: rgba(0,0,0,0.15) !important; border: none !important; margin: 0 !important; padding: 5px 10px !important; width: 100% !important; box-sizing: border-box !important; }
            .mega-menu li.mobile-open > .dropdown-menu { display: block !important; }
            .dropdown-menu li { border-bottom: 1px dashed var(--border-color) !important; width: 100% !important; margin-bottom: 2px; }
            .dropdown-menu li:last-child { border-bottom: none !important; margin-bottom: 0; }
            .dropdown-menu li a { padding-right: 15px !important; }

            .top-right-row { display: flex !important; flex-direction: column !important; gap: 15px !important; align-items: stretch !important; }
            .square-slider-box { display: block !important; width: 100% !important; height: 230px !important; flex: none !important; }
            .square-slide { display: none; }
            .square-slide.active { display: flex !important; }
            .news-mini-container { display: flex !important; flex-direction: column !important; width: 100% !important; height: auto !important; min-height: 200px !important; flex: none !important; }

            #dynamic-post-view { padding-top: 0 !important; width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }
            #dynamic-post-view .post-card { padding: 14px 10px !important; width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }
            #dynamic-post-view .single-post-content > *:not(table) { max-width: 100% !important; box-sizing: border-box !important; }

            #dynamic-post-view .single-post-content table,
            #dynamic-post-view .dynamic-post-content-box table {
                display: block !important;
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                table-layout: auto !important;
                overflow-x: auto !important;
                overflow-y: hidden !important;
                -webkit-overflow-scrolling: touch !important;
                white-space: nowrap !important;
                margin: 12px 0 !important;
                box-sizing: border-box !important;
            }

            #dynamic-post-view .single-post-content th,
            #dynamic-post-view .single-post-content td,
            #dynamic-post-view .single-post-content th *,
            #dynamic-post-view .single-post-content td *,
            #dynamic-post-view .dynamic-post-content-box th,
            #dynamic-post-view .dynamic-post-content-box td,
            #dynamic-post-view .dynamic-post-content-box th *,
            #dynamic-post-view .dynamic-post-content-box td * {
                max-width: none !important;
                white-space: nowrap !important;
                padding: 5px 6px !important;
                font-size: 0.78rem !important;
            }

            #bottom-navigation-wrapper > div { display: flex !important; gap: 12px !important; width: 100% !important; justify-content: space-between !important; }
            #bottom-navigation-wrapper > div > div { flex: 1 !important; min-width: 0 !important; }
            #bottom-navigation-wrapper .nav-article-link-box { overflow-x: auto !important; -webkit-overflow-scrolling: touch; white-space: nowrap !important; }
            #bottom-navigation-wrapper .nav-article-link { display: inline-block !important; white-space: nowrap !important; }

            .article-ad-box { width: 100% !important; max-width: 100% !important; overflow: visible !important; box-sizing: border-box !important; margin: 10px auto !important; min-height: auto !important; padding: 5px !important; }
        }



    @media (min-width: 769px) { .mobile-menu-btn { display: none !important; } }
    .article-ad-box { display: flex; justify-content: center; align-items: center; margin: 20px auto; width: 100%; min-height: 90px; overflow: hidden; background: rgba(0, 0, 0, 0.02); border-radius: 8px; }
    #search-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 10000; backdrop-filter: blur(3px); }
    #search-modal-box { background: var(--card-bg); border: 2px solid var(--primary-color); border-radius: 12px; width: 90%; max-width: 500px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }

    /* =========================================================
   تحسينات الشريط العلوي للجوال، انكماش الشريط الجانبي، وتثبيت فهرس الجوال
   ========================================================= */

/* 1- الشريط العلوي في الجوال: الصفحات الثابتة في سطر علوي والسوشال ميديا في سطر سفلي */
@media (max-width: 768px) {
    .top-bar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        min-height: 58px !important;
        padding: 8px 10px !important;
    }

    .top-pages {
        order: 1;
        width: 100% !important;
        flex: none !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 6px 12px !important;
    }

    .top-pages a {
        font-size: 0.76rem !important;
        line-height: 1.3 !important;
    }

    .top-social {
        order: 2;
        width: 100% !important;
        flex: none !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 8px 10px !important;
        padding-top: 4px;
        border-top: 1px dashed rgba(148, 163, 184, 0.25);
    }

    .top-social > div[style*="margin-left"] {
        display: none !important;
    }

    .top-social a {
        margin: 0 !important;
        font-size: 0.88rem !important;
    }
}

/* =========================================================
   انطواء الشريط الجانبي مؤقتاً + التصاق فهرس الجوال مباشرة أسفل الهيدر
   ========================================================= */

/* زر الانطواء / الفتح المؤقت في يمين أعلى الشريط الجانبي */
.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-collapse-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.sidebar-controls-box {
    position: relative;
}

.sidebar-controls-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.left-sticky-sidebar {
    transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease, padding 0.22s ease;
}

/* عند الانطواء المؤقت: يبقى عرض الشريط على قدر الأيقونة فقط ويظهر جزء الزر ليُعاد فتحه */
@media (min-width: 769px) {
    .three-columns-grid.sidebar-temp-collapsed {
        grid-template-columns: 1fr 44px !important;
    }

    .left-sticky-sidebar.is-temp-collapsed {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 8px 6px !important;
        overflow: hidden !important;
    }

    .left-sticky-sidebar.is-temp-collapsed .sidebar-controls-box {
        padding: 0 !important;
        margin-bottom: 0 !important;
        background: transparent !important;
        border: none !important;
    }

    .left-sticky-sidebar.is-temp-collapsed .sidebar-controls-header-row {
        justify-content: center !important;
        margin-bottom: 0 !important;
    }

    .left-sticky-sidebar.is-temp-collapsed .sidebar-controls-title,
    .left-sticky-sidebar.is-temp-collapsed .sidebar-controls-inner,
    .left-sticky-sidebar.is-temp-collapsed .left-content-area {
        display: none !important;
    }
}

/* تثبيت شريط محتويات المقال في الجوال ملاصقاً للهيدر تماماً */
@media (max-width: 768px) {
    #toc-container {
        margin-bottom: 10px !important;
    }

    #toc-select.mobile-toc-stuck {
        border-radius: 0 0 8px 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    }
}






                @media (max-width: 768px) {
                    #toc-container {
                        top: 0px !important;
                    }
                }