:root {
            --primary-color: #000000;
            --secondary-color: #333333;
            --accent-color: #000000;
            --light-bg: #f8f9fa;
            --border-color: #dee2e6;
            --sidebar-width: 340px;
            --viewer-surface: #ebebeb;
        }

        html {
            margin: 0;
            padding: 0;
            min-height: 100%;
            background-color: var(--light-bg);
            max-width: 100%;
            width: 100%;
        }

        /* منع سكرول أفقي عند تكبير ويندوز (125%+) — نفس مبدأ الصفحة الرئيسية */
        html:not(.itqan-editor-active) {
            overflow-x: clip;
        }

        body,
        body.bg-light-subtle {
            margin: 0;
            padding: 0;
            min-height: 100vh;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--light-bg) !important;
        }

        html:not(.itqan-editor-active) body.bg-light-subtle {
            overflow-x: clip;
            overflow-y: auto;
            max-width: 100%;
        }

        /* وضع المعاينة — مطابق pdf_translate.php (هيدر نظيف + قوائم) */
        html.itqan-editor-active {
            height: 100%;
            overflow: hidden;
        }
        html.itqan-editor-active body.bg-light-subtle {
            overflow: hidden !important;
            height: 100%;
            max-height: 100dvh;
        }
        html.itqan-editor-active nav.navbar.navbar-expand-xl.navbar-dark.bg-dark {
            position: sticky;
            top: 0;
            z-index: 1040;
        }
        html.itqan-editor-active .itqan-tool-publisher {
            display: none !important;
        }
        html.itqan-editor-active .navbar .dropdown-menu {
            z-index: 1060 !important;
        }
        html.itqan-editor-active .nav-dropdown-wrapper {
            z-index: 1045;
        }
        html.itqan-editor-active .nav-dropdown-menu {
            z-index: 1050;
        }
        @media (min-width: 1200px) {
            html.itqan-editor-active .navbar.navbar-expand-xl #navbarNav.collapse.navbar-collapse {
                max-height: none !important;
                overflow: visible !important;
            }
        }

        .upload-area {
            position: relative;
            cursor: pointer;
            isolation: isolate;
            transition: background-color 0.3s ease, border-color 0.3s ease;
            border: 2px dashed #ced4da;
            border-radius: 12px;
            background: var(--light-bg, #f8f9fa);
            min-height: auto;
        }

        /* دارة كهربائية: شرارة رفيعة تسير على الإطار فقط — بدون توهج داخلي */
        @property --itqan-spark-angle {
            syntax: "<angle>";
            initial-value: 0deg;
            inherits: false;
        }

        #upload-section #dropArea.upload-area.itqan-upload-electric::after {
            content: "";
            position: absolute;
            inset: -2px;
            border-radius: 12px;
            padding: 2px;
            pointer-events: none;
            z-index: 3;
            background: conic-gradient(
                from var(--itqan-spark-angle),
                transparent 0deg 166deg,
                #6b7280 170deg,
                #111111 173deg,
                #000000 176deg,
                #1a1a1a 179deg,
                transparent 183deg 346deg,
                #6b7280 350deg,
                #111111 353deg,
                #000000 356deg,
                #1a1a1a 359deg,
                transparent 360deg
            );
            -webkit-mask:
                linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask:
                linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
            mask-composite: exclude;
            animation: itqan-spark-travel 2.4s linear infinite;
        }

        @keyframes itqan-spark-travel {
            to {
                --itqan-spark-angle: 360deg;
            }
        }

        #upload-section #dropArea.upload-area.itqan-upload-electric > .card-body {
            position: relative;
            z-index: 1;
        }

        #upload-section #dropArea.upload-area.itqan-upload-electric:hover::after,
        #upload-section #dropArea.upload-area.itqan-upload-electric.dragover::after {
            animation-duration: 1.6s;
        }

        #upload-section #dropArea.upload-area.itqan-upload-electric.dragover::after {
            animation-duration: 1s;
        }

        @media (prefers-reduced-motion: reduce) {
            #upload-section #dropArea.upload-area.itqan-upload-electric::after {
                display: none;
            }
        }

        .upload-area:hover,
        .upload-area.dragover {
            background-color: #eef0f2;
            border-color: #6b7280 !important;
        }

        #dropArea,
        .upload-area.card {
            overflow-x: hidden;
            max-width: 100%;
            background: var(--light-bg, #f8f9fa) !important;
            box-shadow: none !important;
            border: 2px dashed #ced4da !important;
        }
        /* يمنع عمود المحتوى من توسعة scrollWidth ضيّق العرض (بدون تغيّر بصري مقارنةً بالتصميم الأصلي) */
        .container.my-5 > .row.justify-content-center > .col-lg-8 {
            min-width: 0;
        }
        
        #pdfUpload {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            opacity: 0;
            cursor: pointer;
            z-index: 10;
        }
        
        .pdf-viewer-container {
            border: 1px solid #dee2e6;
            border-radius: 8px;
            background: #f8f9fa;
            padding: 25px;
            max-height: 800px;
            overflow-x: hidden;
            overflow-y: auto;
        }

        .pdf-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 30px;
            margin-bottom: 15px;
        }

        /* Center leftover thumbnails in the preview workspace (do not stretch a single card). */
        html.itqan-editor-active #pagePreview .pdf-grid {
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            justify-content: center;
            justify-items: center;
        }
        html.itqan-editor-active #pagePreview .pdf-thumbnail-wrapper {
            width: 100%;
            max-width: 240px;
        }
        @media (max-width: 1199.98px) {
            html.itqan-editor-active #pagePreview .pdf-grid {
                grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
            }
        }
        @media (max-width: 576px) {
            html.itqan-editor-active #pagePreview .pdf-grid {
                grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
            }
        }

        .pdf-thumbnail-wrapper {
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: transform 0.3s ease;
            cursor: move;
            padding: 10px;
            border-radius: 8px;
            background: white;
            border: 2px solid transparent;
        }

        .pdf-thumbnail-wrapper:hover {
            border-color: #dee2e6;
            background: #f8f9fa;
        }

        .pdf-thumbnail-wrapper.dragging {
            opacity: 0.5;
            border-color: #000;
        }

        .pdf-thumbnail-wrapper.drag-over {
            border-color: #090909ff;
            background: #f0f0f0;
            transform: scale(1.05);
        }

        .pdf-thumbnail-wrapper.touch-dragging {
            opacity: 0.72;
            border-color: #0a84ff;
            box-shadow: 0 8px 24px rgba(10, 132, 255, 0.28);
            transform: scale(1.03);
            z-index: 5;
            touch-action: none;
        }

        .pdf-thumbnail-wrapper img {
            -webkit-user-drag: none;
            user-select: none;
            pointer-events: none;
        }

        .merge-mobile-reorder-hint {
            display: none;
            flex-shrink: 0;
            margin: 8px 0 0;
            padding: 10px 12px;
            border-radius: 10px;
            background: #eef6ff;
            border: 1px solid #cfe2ff;
            color: #0b5ed7;
            font-size: 0.86rem;
            line-height: 1.45;
            text-align: center;
        }
        @media (max-width: 991.98px) {
            .merge-mobile-reorder-hint {
                display: block;
            }
        }
        @media (hover: hover) and (pointer: fine) {
            .merge-mobile-reorder-hint {
                display: none !important;
            }
        }

        .pdf-thumbnail-wrapper.page-marked-delete {
            border-color: rgba(222, 226, 230, 0.95);
            background: #fff;
        }
        .pdf-thumbnail-wrapper.page-marked-delete .pdf-thumbnail {
            border-color: rgba(224, 49, 49, 0.4);
        }

        .pdf-delete-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            background: rgba(255, 255, 255, 0.42);
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.22s ease, visibility 0.22s ease;
        }
        .pdf-thumbnail-wrapper.page-marked-delete .pdf-delete-overlay {
            opacity: 1;
            visibility: visible;
        }
        .pdf-thumbnail-wrapper.page-marked-delete .pdf-thumbnail img {
            filter: grayscale(0.45) brightness(0.9);
            opacity: 0.52;
        }
        .pdf-delete-overlay i {
            font-size: clamp(2.25rem, 10vw, 3.75rem);
            color: #E03131;
            line-height: 1;
            filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
        }

        .pdf-thumbnail-buttons {
            display: flex;
            gap: 6px;
            justify-content: center;
        }

        .pdf-action-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 1px solid #dee2e6;
            background: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            font-size: 14px;
        }

        .pdf-action-btn.delete {
            color: #dc3545;
        }

        .pdf-action-btn.delete:hover {
            background: #dc3545;
            color: white;
            border-color: #dc3545;
        }

        .pdf-action-btn.rotate {
            color: #1abc9c;
        }

        .pdf-action-btn.rotate:hover {
            background: #1abc9c;
            color: white;
            border-color: #1abc9c;
        }

        .pdf-thumbnail {
            background: white;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            width: 100%;
            aspect-ratio: 8.5 / 11;
            min-height: 220px;
        }

        .pdf-thumbnail.landscape {
            aspect-ratio: 11 / 8.5;
            min-height: 160px;
        }

        .pdf-thumbnail-wrapper.landscape-card .pdf-thumbnail.landscape {
            min-height: 140px;
        }

        .pdf-thumbnail:hover {
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
            border-color: #000;
        }

        .pdf-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            transition: opacity 0.2s ease;
            -webkit-user-drag: none;
            user-select: none;
            pointer-events: none;
        }
        
        .pdf-page-name {
            text-align: center;
            font-size: 0.75rem;
            color: #666;
            word-break: break-word;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        
        .additional-upload-row {
            display: flex;
            gap: 15px;
            justify-content: center;
            align-items: center;
            margin: 15px 0;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 6px;
            border: 1px dashed #dee2e6;
        }
        
        .cloud-upload-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid #dee2e6;
            background: white;
            /* لا all — عند وصول المقاس النهائي كانت الرجة تظهر كتحريك */
            transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
            cursor: pointer;
            padding: 0;
            position: relative;
            z-index: 100;
        }
        
        .cloud-upload-btn:hover {
            border-color: #000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        
        .stats-card {
            background: white;
            border-radius: 8px;
            padding: 15px;
            border: 1px solid var(--border-color);
        }
        
        .feature-icon {
            width: 45px;
            height: 45px;
            background: var(--primary-color);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 10px;
        }
        
        .feature-icon i {
            color: white;
            font-size: 18px;
        }
        
        .loading-spinner {
            display: none;
            text-align: center;
            padding: 20px;
        }
        
        .cloud-icon {
            position: relative;
            display: inline-block;
            transition: transform 0.3s ease;
            z-index: 101;
        }
        .cloud-tooltip {
            visibility: hidden;
            width: 140px;
            background-color: #333;
            color: #fff;
            text-align: center;
            border-radius: 6px;
            padding: 8px 5px;
            position: absolute;
            z-index: 1000;
            bottom: 125%;
            left: 50%;
            margin-left: -70px;
            opacity: 0;
            transition: opacity 0.3s;
            font-size: 12px;
            white-space: nowrap;
            pointer-events: none;
        }
        .cloud-tooltip::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            margin-left: -5px;
            border-width: 5px;
            border-style: solid;
            border-color: #333 transparent transparent transparent;
        }
        .cloud-icon:hover .cloud-tooltip {
            visibility: visible;
            opacity: 1;
        }
        
        .btn-merge {
            background-color: #000;
            border-color: #000;
            color: #fff;
        }
        .btn-merge:hover {
            background-color: #333;
            border-color: #333;
            color: #fff;
        }

        .alert-custom {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 9999;
            width: 90%;
            max-width: 500px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            border: 0;
            animation: slideInDown 0.4s ease-out;
        }

        @keyframes slideInDown {
            from {
                opacity: 0;
                transform: translate(-50%, -100px);
            }
            to {
                opacity: 1;
                transform: translate(-50%, -50%);
            }
        }

        .alert-custom.alert-warning {
            background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            border-left: 5px solid #000000;
        }

        .alert-custom .alert-content {
            display: flex;
            align-items: center;
            gap: 20px;
            padding: 0;
        }

        .alert-custom .alert-icon {
            font-size: 40px;
            color: #ffffff;
            flex-shrink: 0;
        }

        .alert-custom .alert-text h5 {
            margin: 0;
            color: #ffffff;
            font-weight: 600;
            font-size: 18px;
        }

        .alert-custom .alert-text p {
            margin: 8px 0 0 0;
            color: #d0d0d0;
            font-size: 14px;
            line-height: 1.4;
        }

        .alert-custom .btn-close {
            color: #ffffff;
            opacity: 0.8;
            transition: opacity 0.3s;
        }

        .alert-custom .btn-close:hover {
            opacity: 1;
        }

        .btn-close-custom {
            background: none;
            border: none;
            color: #ffffff;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            margin-right: 10px;
            opacity: 0.8;
            transition: opacity 0.3s;
            flex-shrink: 0;
        }

        .btn-close-custom:hover {
            opacity: 1;
        }

        .btn-close-custom::before {
            content: "×";
        }

        /* يُكمِّل ما في responsive-site.css — منع الإعلان من توسعة الصفحة أفقياً */
        #adContainer {
            margin: 20px 0;
            text-align: center;
            overflow: hidden;
            max-width: 100%;
            box-sizing: border-box;
        }
        html:not(.itqan-editor-active) #upload-section > #adContainer {
            margin: 0 auto 1.5rem !important;
            margin-top: auto !important;
        }
        #adContainer ins.adsbygoogle {
            display: block !important;
            width: min(100%, 728px) !important;
            max-width: 100% !important;
            margin-left: auto !important;
            margin-right: auto !important;
        }
        #adContainer iframe {
            max-width: 100% !important;
            width: 100% !important;
            display: block !important;
            margin-left: auto !important;
            margin-right: auto !important;
            box-sizing: border-box !important;
        }

        /* إعلانات جانبية */
.sidebar-ads {
    display: none !important;
    visibility: hidden !important;
}

.sidebar-ads.visible {
    display: block !important;
    visibility: visible !important;
    background: #007bff !important;
    padding: 10px !important;
    border-radius: 8px !important;
}

.sidebar-left {
    position: fixed;
    left: 20px;
    top: 150px;
    width: auto;
    max-width: 300px;
    z-index: 100;
}

.sidebar-right {
    position: fixed;
    right: 20px;
    top: 150px;
    width: auto;
    max-width: 300px;
    z-index: 100;
}

@media (max-width: 768px) {
    .sidebar-left,
    .sidebar-right {
        display: none !important;
    }
}

        /* وضع المعاينة — تخطيط كامل مثل أداة الترجمة */
        .main-editor {
            display: none;
            height: calc(100vh - 60px);
            flex-direction: row;
            min-width: 0;
            min-height: 0;
        }
        html.itqan-editor-active #editor-section.main-editor {
            display: flex !important;
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            top: var(--itqan-editor-top, 72px);
            height: auto !important;
            min-height: 0 !important;
            box-sizing: border-box;
            z-index: 1;
        }
        #editor-section .sidebar {
            width: var(--sidebar-width);
            min-width: var(--sidebar-width);
            flex: 0 0 var(--sidebar-width);
            background: #fff;
            border-left: 1px solid #ddd;
            display: flex;
            flex-direction: column;
            position: relative;
            z-index: 1;
            overflow: hidden;
            min-height: 0;
            height: 100%;
        }
        #editor-section .sidebar .merge-sidebar-body {
            padding-top: 0;
            flex: 1 1 auto;
            min-height: 0;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior-y: contain;
        }
        .merge-sidebar-header {
            flex-shrink: 0;
            padding: 16px 18px;
            border-bottom: 1px solid #eee;
            font-weight: 700;
            font-size: 17px;
            line-height: 1.35;
            background: #fff;
            position: relative;
            z-index: 2;
            text-align: center;
            color: #222;
        }
        .merge-sidebar-body {
            padding: 16px 18px 12px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        #editor-section .sidebar > .merge-sidebar-footer {
            flex-shrink: 0;
            margin-top: auto;
            padding: 14px 18px 18px;
            border-top: 1px solid #eee;
            background: #fff;
            z-index: 2;
        }
        .merge-sidebar-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }
        .merge-sidebar-label {
            font-size: 0.8rem;
            font-weight: 700;
            color: #666;
            text-align: center;
            margin: 0;
        }
        #editor-section .merge-cloud-stack {
            display: flex;
            flex-direction: row;
            gap: 12px;
            align-items: center;
            justify-content: center;
            padding: 12px 14px;
            background: #f8f9fa;
            border: 1px dashed #dee2e6;
            border-radius: 10px;
            width: 100%;
            box-sizing: border-box;
        }
        .merge-stats-sidebar.stats-card {
            display: flex;
            flex-direction: column;
            gap: 0;
            margin: 0;
            width: 100%;
            background: transparent;
            border: none;
            padding: 0;
        }
        .merge-stats-sidebar .merge-stat-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 0;
            border-bottom: 1px solid #f0f0f0;
        }
        .merge-stats-sidebar .merge-stat-item:last-child {
            border-bottom: 0;
        }
        .merge-stats-sidebar .merge-stat-icon {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: #111;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            flex-shrink: 0;
        }
        .merge-stats-sidebar .merge-stat-text strong {
            display: block;
            font-size: 0.95rem;
            line-height: 1.15;
        }
        .merge-stats-sidebar .merge-stat-text small {
            font-size: 0.72rem;
            color: #888;
        }
        .merge-sidebar-btn-clear {
            width: 100%;
            padding: 10px 14px;
            border-radius: 10px;
            border: 1px solid #ddd;
            background: #f5f5f5;
            color: #444;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s;
        }
        .merge-sidebar-btn-clear:hover {
            background: #eee;
            border-color: #bbb;
            color: #222;
        }
        .btn-finish {
            background: #000;
            color: #fff;
            width: 100%;
            border: none;
            padding: 15px;
            font-size: 18px;
            font-weight: 700;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
        }
        .btn-finish:hover:not(:disabled) {
            background: #222;
            color: #fff;
        }
        .btn-finish:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }
        .viewer-container {
            flex: 1 1 auto;
            min-width: 0;
            min-height: 0;
            background: var(--viewer-surface);
            overflow: hidden;
            padding: 0 12px 12px;
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        .viewer-container #adContainerViewer {
            margin-top: 16px;
            flex-shrink: 0;
            text-align: center;
        }
        .viewer-container #adContainerViewer ins.adsbygoogle {
            display: inline-block !important;
            width: min(100%, 728px) !important;
            max-width: 100% !important;
            margin-left: auto !important;
            margin-right: auto !important;
        }
        #mergeFilePages {
            min-width: 0;
            width: 100%;
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            overscroll-behavior-y: contain;
            padding-top: 8px;
        }
        html.itqan-editor-active #pagePreview.pdf-viewer-container {
            border: none;
            border-radius: 0;
            background: transparent;
            max-height: none;
            overflow: visible;
            padding: 25px;
            width: 100%;
            box-sizing: border-box;
        }
        #editor-section .loading-spinner {
            flex-shrink: 0;
            padding: 24px;
        }
        @media (max-width: 991.98px) {
            html.itqan-editor-active {
                overflow: auto !important;
                height: auto !important;
            }
            html.itqan-editor-active body.bg-light-subtle {
                overflow: auto !important;
                height: auto !important;
                max-height: none !important;
            }
            .main-editor {
                flex-direction: column !important;
                height: auto !important;
            }
            html.itqan-editor-active #editor-section.main-editor {
                position: relative !important;
                flex-direction: column !important;
                height: auto !important;
                top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
            }
            #editor-section .sidebar {
                order: 1 !important;
                position: relative !important;
                width: 100% !important;
                min-width: 0 !important;
                max-height: none !important;
                height: auto !important;
                flex: none !important;
                border-left: none;
                border-top: 1px solid #ddd;
            }
            #editor-section .sidebar .merge-sidebar-body {
                overflow: visible !important;
                max-height: none !important;
                height: auto !important;
            }
            .viewer-container {
                order: 2 !important;
                width: 100% !important;
                min-height: 50vh;
                overflow: visible !important;
            }
            #editor-section .sidebar > .merge-sidebar-footer,
            .main-editor .p-3 {
                position: fixed;
                bottom: 0; left: 0; right: 0;
                z-index: 1050;
                padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
                background: #fff;
                border-top: 1px solid #e8e8e8;
                box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
            }
            .btn-finish {
                padding: 14px !important;
                font-size: 16px !important;
                border-radius: 10px !important;
            }
            html.itqan-editor-active .tool-seo-visible-wrap,
            html.itqan-editor-active .merge-seo-content {
                display: none !important;
            }
        }
        @media (max-width: 576px) {
            html.itqan-editor-active #pagePreview.pdf-viewer-container {
                padding: 16px;
            }
        }

        /* شاشة نتيجة الدمج */
        .merge-result-wrap {
            display: none;
            margin-top: 24px;
        }
        .merge-result-card {
            background: #ffffff;
            border: 1px solid #e8e8e8;
            border-radius: 14px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.08);
            padding: 28px 20px;
            text-align: center;
        }
        .merge-result-actions {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin: 8px 0 18px;
        }
        .merge-result-download {
            background: #111111;
            color: #fff;
            border: 0;
            border-radius: 10px;
            padding: 14px 28px;
            font-size: 20px;
            font-weight: 700;
            min-width: 320px;
            transition: transform .15s ease, background .2s ease;
        }
        .merge-result-download:hover {
            background: #000000;
            transform: translateY(-1px);
        }
        .merge-result-next {
            width: 42px;
            height: 42px;
            border-radius: 999px;
            border: 0;
            background: #4f4f4f;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .merge-quick-actions {
            display: inline-flex;
            flex-direction: row;
            gap: 10px;
            margin-bottom: 14px;
        }
        .quick-action-wrap {
            position: relative;
            display: inline-flex;
        }
        .quick-action-note {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: #565666;
            color: #fff;
            font-size: 12px;
            font-weight: 700;
            padding: 7px 11px;
            border-radius: 6px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity .15s ease, transform .15s ease;
            z-index: 5;
        }
        .quick-action-note::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: #565666;
        }
        .quick-action-wrap:hover .quick-action-note {
            opacity: 1;
            transform: translateX(-50%) translateY(-2px);
        }
        .merge-quick-actions .quick-action-btn {
            width: 54px;
            height: 54px;
            border-radius: 999px;
            border: 2px solid #d8dce2;
            background: #ffffff;
            color: #2c2c2c;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            transition: transform .15s ease, filter .2s ease;
        }
        .merge-quick-actions .quick-action-btn:hover {
            transform: translateY(-2px);
            filter: brightness(0.98);
        }
        .merge-quick-actions .quick-action-btn i {
            font-size: 22px;
        }
        #saveToGoogleBtn i {
            color: #ea4335;
        }
        #saveToDropboxBtn i {
            color: #0b67ff;
        }
        #deleteMergedBtn {
            background: #ffffff;
            border-color: #f0c9c9;
        }
        #deleteMergedBtn i {
            color: #e5322d;
        }
        .merge-result-tools {
            border: 1px solid #ececec;
            border-radius: 12px;
            padding: 16px;
            background: linear-gradient(180deg, #fcfcfc 0%, #f6f6f6 100%);
            margin-bottom: 14px;
        }
        .merge-result-tools h6 {
            margin: 0 0 10px;
            font-size: 16px;
            color: #555;
            font-weight: 700;
        }
        .merge-result-tool-links {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px 12px;
        }
        .merge-result-tool-links a {
            text-decoration: none;
            color: #2e2e2e;
            font-size: 14px;
            padding: 8px 10px;
            border-radius: 10px;
            background: #fff;
            border: 1px solid #ececec;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            font-weight: 600;
            transition: all .15s ease;
        }
        .merge-result-tool-links a:hover {
            border-color: #dbdbdb;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.06);
        }
        .merge-tool-icon {
            width: 24px;
            height: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #0d6efd;
            font-size: 16px;
            flex: 0 0 24px;
            background: transparent;
        }
        .merge-tool-label {
            flex: 1 1 auto;
            text-align: right;
        }
        .merge-result-bottom {
            margin-top: 14px;
        }
        /* محاذاة زر الاختيار + أيقونات السحابة (مطابق compress.php) */
        .upload-pick-wrap {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            transform: none;
            position: relative;
            z-index: 20;
        }
        .upload-cloud-stack {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            position: relative;
            z-index: 220;
            pointer-events: auto;
            width: auto;
            flex: 0 0 auto;
        }
        .upload-cloud-stack .cloud-icon {
            margin-bottom: 0 !important;
            flex-shrink: 0;
        }
        .upload-cloud-stack .cloud-upload-btn {
            pointer-events: auto;
            flex-shrink: 0;
        }

        /* واجهة اختيار الملف — مدمجة */
        .container.my-5 {
            margin-top: 1rem !important;
            margin-bottom: 2rem !important;
        }
        #mergePageHeader {
            margin-bottom: 0 !important;
        }
        #mergePageHeader .display-5 {
            font-size: clamp(1.75rem, 3.5vw, 2.15rem);
            margin-bottom: 0.55rem !important;
            line-height: 1.25;
        }
        #mergePageHeader .lead {
            margin-bottom: 1.15rem !important;
            font-size: 0.98rem;
            line-height: 1.45;
        }
        /* واجهة الرفع — الحجم الأصلي؛ يتقلص بالعرض فقط إذا ضاق الحاوي (مثل بطاقات الرئيسية) */
        :root {
            --itqan-tool-panel-w: 46.5rem;
        }
        #upload-section #dropArea.upload-area {
            width: min(100%, var(--itqan-tool-panel-w));
            max-width: min(100%, var(--itqan-tool-panel-w));
            margin-left: auto;
            margin-right: auto;
            padding: 0.65rem 1.55rem 0.45rem !important;
            box-shadow: none !important;
            overflow: visible !important;
            background: var(--light-bg, #f8f9fa) !important;
        }
        #upload-section #dropArea .card-body,
        #upload-section #dropArea .upload-row-wrap,
        #upload-section #dropArea .d-flex.justify-content-center,
        #upload-section #dropArea .upload-pick-wrap,
        #upload-section #dropArea .upload-cloud-stack,
        #upload-section #dropArea .cloud-icon {
            overflow: visible !important;
        }
        #upload-section .cloud-tooltip {
            display: none !important;
        }
        .upload-cloud-stack {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            position: relative;
            z-index: 220;
            pointer-events: auto;
            width: auto;
            flex: 0 0 auto;
        }
        .upload-cloud-stack .cloud-icon {
            margin-bottom: 0 !important;
            flex-shrink: 0;
        }
        .upload-cloud-spacer {
            width: 44px;
            flex: 0 0 44px;
            visibility: hidden;
            pointer-events: none;
        }
        .itqan-merge-blog-wrap {
            width: 100%;
            max-width: min(100%, var(--itqan-tool-panel-w));
            margin: 0.7rem auto 0;
            padding: 0;
            box-sizing: border-box;
            min-width: 0;
            text-align: center;
        }
        .itqan-merge-blog-wrap .itqan-tool-blog-promo {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0 !important;
            margin: 0 !important;
            width: auto;
            max-width: 100%;
            display: inline-block;
            overflow: visible;
        }
        .itqan-merge-blog-wrap .itqan-tool-blog-promo__link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            max-width: 100%;
            min-width: 0;
            width: auto;
            color: #6c757d;
            font-weight: 500;
            font-size: 0.92rem;
            text-decoration: none;
            line-height: 1.4;
        }
        .itqan-merge-blog-wrap .itqan-tool-blog-promo__link:hover {
            color: #212529;
            text-decoration: underline;
        }
        .itqan-merge-blog-wrap .itqan-tool-blog-promo__title {
            flex: 0 1 auto;
            min-width: 0;
            white-space: normal;
            overflow-wrap: anywhere;
            word-break: break-word;
            line-height: 1.4;
        }
        /* إعلان أسفل الشاشة — body/main/upload-section سلسلة flex كاملة */
        html:not(.itqan-editor-active) body.bg-light-subtle {
            display: flex;
            flex-direction: column;
            min-height: 100dvh;
            min-height: 100svh;
            box-sizing: border-box;
        }
        html:not(.itqan-editor-active) #itqan-tool-main {
            flex: 0 0 auto;
            min-height: auto;
            height: auto;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            width: 100%;
        }
        html:not(.itqan-editor-active) #upload-section {
            position: relative;
            flex: 0 0 auto;
            flex-shrink: 0;
            min-height: calc(100dvh - 3.5rem);
            min-height: calc(100svh - 3.5rem);
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
        }
        html:not(.itqan-editor-active) #upload-section > .container.my-5 {
            flex: 0 0 auto;
            width: 100%;
            margin-top: 1rem !important;
            margin-bottom: 0.5rem !important;
        }
        html:not(.itqan-editor-active) #upload-section #adContainer {
            position: static;
            left: auto;
            transform: none;
            bottom: auto;
            width: min(calc(100% - 1.5rem), 728px);
            margin: 0 auto 1.5rem !important;
            margin-top: auto !important;
            padding: 0;
            text-align: center;
            z-index: 2;
            min-height: 90px;
            flex: 0 0 auto;
            box-sizing: border-box;
        }
        html:not(.itqan-editor-active) #upload-section #adContainer::before {
            content: "";
            display: block;
            height: clamp(72px, 12vh, 180px);
            pointer-events: none;
        }
        html:not(.itqan-editor-active) #upload-section #adContainer ins.adsbygoogle {
            min-height: 90px;
        }
        html:not(.itqan-editor-active) #upload-section #adContainer.itqan-ad-has-fill {
            margin-bottom: 1.5rem !important;
        }
        html:not(.itqan-editor-active) #upload-section #adContainer .itqan-ad {
            margin: 0 auto !important;
        }
        @media (min-width: 576px) {
            #upload-section .upload-cloud-stack {
                flex-direction: column !important;
                gap: 8px !important;
                width: auto !important;
                flex: 0 0 auto !important;
            }
            #upload-section .upload-pick-wrap {
                flex-wrap: nowrap !important;
                flex-direction: row !important;
            }
            #upload-section .upload-cloud-spacer {
                display: block;
            }
        }
        @media (max-width: 1199.98px) {
            #upload-section .upload-cloud-stack {
                flex-direction: row !important;
                justify-content: center !important;
                gap: 12px !important;
                width: auto !important;
                flex: 0 0 auto !important;
            }
        }
        @media (max-width: 575.98px) {
            .upload-cloud-spacer {
                display: none !important;
            }
            #upload-section .upload-pick-wrap {
                flex-direction: column !important;
                width: 100% !important;
                gap: 12px !important;
            }
            #upload-section #dropArea .upload-row-wrap {
                flex-wrap: nowrap !important;
            }
            .itqan-merge-blog-wrap {
                padding-left: 0;
                padding-right: 0;
                width: 100%;
            }
        }
        @media (min-width: 576px) {
            #upload-section #dropArea.upload-area,
            #upload-section #dropArea .card-body,
            #upload-section #dropArea .upload-row-wrap,
            #upload-section #dropArea .d-flex.justify-content-center {
                overflow: visible !important;
            }
        }
        @media (min-width: 992px) {
            #upload-section,
            #upload-section .container.my-5,
            #upload-section .row,
            #upload-section .col-lg-8 {
                max-width: 100%;
                min-width: 0;
            }
            #upload-section #dropArea.upload-area {
                padding-block: 0.75rem 0.5rem !important;
                padding-inline: 1.55rem !important;
                overflow: visible !important;
            }
        }
        @media (max-width: 575.98px) {
            #upload-section #dropArea.upload-area {
                width: 100%;
                padding: 1rem !important;
                overflow: visible !important;
            }
            #upload-section #dropArea .card-body,
            #upload-section #dropArea .upload-row-wrap {
                overflow: visible !important;
            }
        }
        #upload-section #dropArea .card-body {
            padding: 0.3rem 0.85rem 0.2rem;
            overflow: visible !important;
            width: 100%;
        }
        #upload-section #dropArea .upload-row-wrap {
            overflow: visible;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        @media (max-width: 768px) {
            .upload-pick-wrap { transform: none; }
        }
        @media (max-width: 576px) {
            .merge-result-download {
                min-width: 100%;
                font-size: 18px;
            }
            .merge-result-tool-links {
                grid-template-columns: 1fr;
            }
        }
        .merge-sidebar-help-btn {
            width: 100%;
            margin: 0 0 0.85rem;
            padding: 0.55rem 0.75rem;
            font-size: 0.82rem;
            font-weight: 600;
            border: 1px dashed var(--border-color);
            border-radius: 8px;
            background: #fff;
            color: #333;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.45rem;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .merge-sidebar-help-btn:hover {
            background: #f8f9fa;
            border-color: #adb5bd;
            color: #111;
        }
.merge-seo-content {
            margin-top: 2.5rem;
            padding-top: 1.75rem;
            border-top: 1px solid var(--border-color);
            max-width: 42rem;
            margin-left: auto;
            margin-right: auto;
        }
        .merge-seo-content--modal {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
            max-width: none;
        }
        .merge-seo-steps {
            list-style: none;
            padding: 0;
            margin: 0;
            counter-reset: merge-howto-step;
        }
        .merge-seo-steps li {
            counter-increment: merge-howto-step;
            display: flex;
            gap: 0.85rem;
            align-items: flex-start;
            padding: 0.55rem 0;
            color: #495057;
            font-size: 0.95rem;
            line-height: 1.55;
        }
        .merge-seo-steps li::before {
            content: counter(merge-howto-step);
            flex-shrink: 0;
            width: 1.65rem;
            height: 1.65rem;
            border-radius: 50%;
            background: #111;
            color: #fff;
            font-size: 0.8rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 0.1rem;
        }
        .merge-seo-faq .accordion-button {
            font-size: 0.95rem;
            font-weight: 600;
            padding: 0.85rem 1rem;
        }
        .merge-seo-faq .accordion-button:not(.collapsed) {
            background: #f8f9fa;
            color: #111;
            box-shadow: none;
        }
        .merge-seo-faq .accordion-item {
            border-color: var(--border-color);
        }

        /* تغلب على responsive-site — مربع الرفع بلا سكرول/قصّ للأيقونات */
        #upload-section #dropArea .upload-row-wrap.d-flex,
        #upload-section #dropArea .d-flex.justify-content-center {
            overflow: visible !important;
            flex-wrap: nowrap !important;
            max-width: 100%;
        }
        #upload-section .upload-cloud-stack {
            width: auto !important;
            flex: 0 0 auto !important;
            min-width: 0;
        }
