/* ===== Upload screen (merge pattern) ===== */
        .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 #dee2e6; border-radius: 8px; background: #fff; color: #333;
            display: flex; align-items: center; justify-content: center; gap: 0.45rem; cursor: pointer;
        }
        .merge-sidebar-help-btn:hover { background: #f8f9fa; border-color: #adb5bd; color: #111; }
        .ad-container { text-align: center; margin-top: 1.5rem; }
        .merge-ad-slot { display: inline-block; width: 100%; max-width: 728px; min-height: 90px; height: 90px; }

        html:not(.sign-pdf-editor-active) { overflow-x: visible; }
        html:not(.sign-pdf-editor-active) body.bg-light-subtle {
            overflow-x: visible;
            overflow-y: auto;
        }
        .container.my-5 > .row.justify-content-center > .col-lg-8 { min-width: 0; }
        .upload-pick-wrap {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            transform: none;
            position: relative;
            z-index: 20;
            flex-wrap: nowrap;
            max-width: 100%;
            box-sizing: border-box;
        }
        .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,
        .upload-cloud-stack .cloud-upload-btn { pointer-events: auto; }
        .upload-cloud-stack .cloud-icon { margin-bottom: 0 !important; }
        .upload-cloud-spacer { width: 44px; flex: 0 0 44px; visibility: hidden; pointer-events: none; }
        .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; font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; }
        #mergePageHeader .lead { margin-bottom: 1.15rem !important; font-size: 0.98rem; line-height: 1.45; }
        #pickFilesBtn { font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; white-space: nowrap; display: inline-flex; align-items: center; flex-shrink: 0; }
        #upload-section #dropArea.upload-area {
            width: min(100%, var(--itqan-tool-panel-w, 46.5rem));
            max-width: min(100%, var(--itqan-tool-panel-w, 46.5rem));
            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;
        }
        @media (min-width: 992px) {
            #upload-section #dropArea.upload-area {
                padding-block: 0.75rem 0.5rem !important;
                padding-inline: 1.55rem !important;
            }
        }
        @media (max-width: 575.98px) {
            #upload-section #dropArea.upload-area { width: 100%; padding: 1rem !important; }
            .upload-pick-wrap { transform: none; flex-direction: column !important; width: 100% !important; gap: 12px !important; }
            #upload-section .upload-cloud-spacer { display: none !important; }
        }
        @media (max-width: 768px) { .upload-pick-wrap { transform: none; } }
        #upload-section #dropArea .card-body {
            padding: 0.3rem 0.85rem 0.2rem;
            overflow: visible !important;
            width: 100%;
            background: transparent !important;
        }
        #upload-section #dropArea .upload-row-wrap {
            overflow: visible !important;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: nowrap !important;
        }
        @media (min-width: 576px) {
            #upload-section .upload-pick-wrap { flex-wrap: nowrap !important; flex-direction: row !important; }
            #upload-section .upload-cloud-stack { flex-direction: column !important; gap: 8px !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; }
        }


:root {
            --itq-primary: #000000;
            --itq-secondary: #333333;
            --itq-accent: #000000;
            --itq-success: #28a745;
            --itq-light-bg: #f8f9fa;
            --itq-border: #dee2e6;
            --itq-toolbar: #1e1e1e;
            --itq-page-bg: #f3f3f3;
            --itq-sidebar-bg: #ffffff;
            --itq-blue: #0a84ff;
        }

        html, body,
        body.bg-light-subtle {
            background-color: var(--itq-light-bg) !important;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        /* واجهة اختيار الملف — مطابقة merge_pdf.php */
        .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(--itq-light-bg, #f8f9fa);
            min-height: auto;
        }
        .upload-area:hover,
        .upload-area.dragover {
            background-color: #eef0f2;
            border-color: #6b7280 !important;
        }
        #dropArea,
        .upload-area.card {
            overflow-x: visible;
            max-width: 100%;
            background: var(--itq-light-bg, #f8f9fa) !important;
            box-shadow: none !important;
            border: 2px dashed #ced4da !important;
        }

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

        .cloud-upload-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid #dee2e6;
            background: white;
            transition: all 0.3s;
            cursor: pointer;
            padding: 0;
            position: relative;
            z-index: 100;
        }
        .cloud-upload-btn:hover {
            border-color: #000;
            transform: scale(1.1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }

        .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;
        }
        /* أزرار الحفظ السحابي في صفحة النتيجة — نفس التلميحة مع نص أطول */
        .merge-quick-actions .quick-action-wrap.cloud-icon .cloud-tooltip {
            width: auto;
            min-width: 140px;
            max-width: 240px;
            white-space: normal;
            line-height: 1.35;
            margin-left: 0;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10050;
        }

        .upload-pick-wrap {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            transform: translateX(18px);
            position: relative;
            z-index: 20;
        }
        .upload-cloud-stack {
            display: flex;
            flex-direction: column;
            gap: 1px;
            position: relative;
            z-index: 220;
            pointer-events: auto;
        }
        .upload-cloud-stack .cloud-icon,
        .upload-cloud-stack .cloud-upload-btn {
            pointer-events: auto;
        }
        @media (max-width: 768px) {
            .upload-pick-wrap {
                transform: none;
            }
        }

        /* ============================================================
           2) واجهة المحرّر (شبيهة بـ edit_pdf.php من حيث التركيب)
           ============================================================ */
        .itq-editor-shell {
            display: none;
            flex-direction: column;
            background: #fff;
            border-radius: 0;
            box-shadow: none;
            overflow: hidden;
            margin: 0;
            padding: 0;
            width: 100%;
            gap: 0;
        }
        .itq-editor-shell.active { display: flex; }
        .itq-editor-bleed {
            width: 100%;
            max-width: 100%;
            padding-left: 0;
            padding-right: 0;
            padding-top: 0 !important;
            margin-top: 0 !important;
            margin-bottom: 0 !important;
            --bs-gutter-x: 0;
            --bs-gutter-y: 0;
        }

        /* أثناء المحرّر: لا شريط تمرير للصفحة — التمرير داخل الأعمدة فقط */
        html.sign-pdf-editor-active {
            height: 100%;
            overflow: hidden !important;
        }
        body.sign-pdf-editor-active {
            padding-top: 0 !important;
            overflow: hidden !important;
            min-height: 100%;
            max-height: 100dvh;
        }
        /* المحرّر يملأ ما تحت شريط التنقل — أعلى الشريط يُحدَّد بـ JS (--itq-editor-top) */
        body.sign-pdf-editor-active .itq-editor-bleed {
            margin-top: 0 !important;
            position: fixed;
            left: 0;
            right: 0;
            top: var(--itq-editor-top, 52px);
            bottom: 0;
            z-index: 1010;
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 100%;
            min-height: 0 !important;
            box-sizing: border-box;
        }
        /* الهيدر وفوق طبقة المحرّر الثابتة حتى تعمل قوائم التصفح والقوائم المنسدلة */
        body.sign-pdf-editor-active nav.navbar {
            position: relative;
            z-index: 1200;
        }
        body.sign-pdf-editor-active nav.navbar .dropdown-menu {
            z-index: 1210 !important;
        }
        body.sign-pdf-editor-active nav.navbar .navbar-nav,
        body.sign-pdf-editor-active nav.navbar .navbar-collapse {
            overflow: visible;
        }

        .itq-toolbar {
            background: var(--itq-toolbar);
            color: #fff;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            padding: 8px 14px;
            gap: 12px;
            margin: 0;
            flex: 0 0 auto;
            flex-wrap: wrap;
            position: relative;
        }
        .itq-toolbar-main {
            display: flex;
            align-items: center;
            gap: 12px 14px;
            flex-wrap: wrap;
            min-width: 0;
            flex: 0 0 auto;
        }
        .itq-toolbar-main h5 {
            flex-shrink: 0;
        }
        /* مجموعة الملف + شريط العرض — متوسّطة مع إزاحة بسيطة */
        .itq-toolbar-center {
            position: absolute;
            left: calc(50% - 70px);
            top: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            align-items: center;
            gap: 12px;
            max-width: calc(100% - 320px);
            z-index: 2;
            pointer-events: none;
        }
        .itq-toolbar-center > * {
            pointer-events: auto;
        }
        @media (max-width: 1100px) {
            .itq-toolbar-center {
                position: static;
                left: auto;
                transform: none;
                flex: 1 1 auto;
                justify-content: center;
                flex-wrap: wrap;
                max-width: none;
                pointer-events: auto;
            }
        }
        .itq-toolbar-end {
            flex: 0 0 auto;
            margin-inline-start: auto;
        }
        /* شريط العرض — مثل صفحة تعديل PDF */
        .itq-viewbar {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: #1a1a1a;
            border-radius: 10px;
            padding: 6px 12px;
            box-shadow: 0 4px 18px rgba(0,0,0,0.35);
            direction: ltr;
        }
        .itq-viewbar button {
            background: transparent;
            border: 0;
            color: #fff;
            width: 30px;
            height: 30px;
            border-radius: 6px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .itq-viewbar button:hover {
            background: rgba(255,255,255,0.14);
            color: #fff;
        }
        .itq-vb-div {
            width: 1px;
            height: 20px;
            background: rgba(255,255,255,0.22);
            flex-shrink: 0;
        }
        .itq-vb-input {
            width: 46px;
            background: #0d0d0d;
            border: 1px solid rgba(255,255,255,0.28);
            color: #fff !important;
            text-align: center;
            border-radius: 5px;
            padding: 4px 6px;
            font-size: 13px;
            font-weight: 600;
        }
        .itq-vb-input:hover,
        .itq-vb-input:focus {
            background: #141414;
            border-color: rgba(255,255,255,0.45);
            color: #fff !important;
            outline: none;
        }
        .itq-zoom-pct {
            font-size: 13px;
            font-weight: 700;
            color: rgba(255,255,255,0.9);
            user-select: none;
        }
        .itq-vb-slash {
            font-weight: 700;
            padding: 0 2px;
            color: rgba(255,255,255,0.85);
        }
        .itq-page-total {
            min-width: 28px;
            text-align: center;
            font-weight: 700;
            font-size: 13px;
            padding: 4px 8px;
            background: #0d0d0d;
            border: 1px solid rgba(255,255,255,0.28);
            border-radius: 5px;
            color: #fff;
        }
        /* قائمة الملف: نص واضح عند المرور */
        select.itq-file-select {
            border: 1px solid rgba(255,255,255,0.22) !important;
            background: rgba(255,255,255,0.1) !important;
            color: #fff !important;
            font-size: 13px;
            max-width: min(240px, 36vw);
            border-radius: 8px;
            padding: 6px 10px;
            cursor: pointer;
        }
        select.itq-file-select:hover,
        select.itq-file-select:focus {
            background: rgba(255,255,255,0.2) !important;
            color: #fff !important;
            border-color: rgba(255,255,255,0.4) !important;
            outline: none;
        }
        select.itq-file-select option,
        select.itq-file-select optgroup {
            background: #2d2d33;
            color: #fff;
        }
        .itq-toolbar .itq-tb-section {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        /* توافق قديم إن وُجدت أقسام قديمة */
        .itq-toolbar-cluster {
            display: flex;
            align-items: center;
            gap: 10px 14px;
            flex-wrap: wrap;
            min-width: 0;
        }
        .itq-toolbar h5 {
            margin: 0;
            font-weight: 700;
            font-size: 18px;
            color: #fff;
        }
        .itq-tb-btn {
            background: rgba(255,255,255,0.08);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px;
            padding: 6px 12px;
            font-size: 14px;
            transition: background .15s ease;
        }
        .itq-tb-btn:hover { background: rgba(255,255,255,0.18); color:#fff; }
        .itq-tb-btn.danger { background: var(--itq-accent); border-color: var(--itq-accent); }
        .itq-tb-btn.danger:hover { background: #222222; }
        .itq-page-status {
            background: rgba(255,255,255,0.1);
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 13px;
            display: inline-flex;
            gap: 6px;
            align-items: center;
        }
        .itq-page-status input {
            width: 50px;
            background: #fff;
            color: #111;
            border: 0;
            border-radius: 4px;
            padding: 2px 4px;
            text-align: center;
            font-weight: 700;
        }

        /* ثلاثة أعمدة (نمط Itqan Tools) — LTR: خيارات يسار | معاينة | مصغّرات يمين */
        .itq-workarea {
            display: grid;
            direction: ltr;
            grid-template-columns: minmax(320px, 420px) 1fr 140px;
            min-height: 0;
            flex: 1 1 auto;
            align-items: stretch;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        html[dir="rtl"] .itq-workarea {
            direction: rtl;
        }
        /* ضروري في Grid حتى لا يتمدد الصف بارتفاع المحتوى فيخرج عن الشاشة */
        .itq-workarea > .itq-tools-col,
        .itq-workarea > .itq-canvas-col,
        .itq-workarea > .itq-thumbs-col {
            min-height: 0;
        }
        @media (max-width: 1100px) {
            .itq-workarea {
                grid-template-columns: minmax(280px, 360px) 1fr 132px;
            }
        }
        @media (max-width: 900px) {
            .itq-workarea {
                grid-template-columns: 1fr;
            }
            .itq-tools-col,
            .itq-thumbs-col { display: none !important; }
            .itq-tools-col.mobile-show { display: flex !important; }
            .itq-thumbs-col.mobile-show { display: block !important; }
        }
        @media (max-width: 991.98px) {
            html.sign-pdf-editor-active {
                overflow: auto !important;
                height: auto !important;
            }
            body.sign-pdf-editor-active {
                overflow: auto !important;
                height: auto !important;
                max-height: none !important;
            }
            body.sign-pdf-editor-active .itq-editor-bleed {
                position: relative !important;
                top: auto !important;
                left: auto !important;
                right: auto !important;
                bottom: auto !important;
                height: auto !important;
                min-height: 100vh;
            }
            .itq-editor-bleed:has(.itq-editor-shell.active) .itq-editor-shell,
            .itq-editor-shell.active {
                overflow: visible !important;
                max-height: none !important;
                height: auto !important;
            }
            .itq-workarea {
                grid-template-columns: 1fr !important;
                overflow: visible !important;
                height: auto !important;
            }
            .itq-tools-col {
                display: flex !important;
                order: 1 !important;
                width: 100% !important;
                max-height: none !important;
                overflow: visible !important;
            }
            .itq-tools-scroll {
                overflow: visible !important;
                max-height: none !important;
            }
            .itq-canvas-col {
                order: 2 !important;
                width: 100% !important;
                min-height: 60vh;
                overflow: visible !important;
                padding-bottom: 160px !important;
            }
            .itq-thumbs-col {
                display: none !important;
            }
            .itq-tools-footer {
                position: fixed !important;
                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);
            }
            .itq-tools-footer .btn,
            .itq-tools-footer .itq-process-btn {
                padding: 14px !important;
                font-size: 16px !important;
                border-radius: 10px !important;
                width: 100%;
            }
            .mobile-tabs {
                display: none !important;
            }
            .itq-toolbar {
                position: static !important;
                box-shadow: none !important;
            }
            html.sign-pdf-editor-active .tool-seo-visible-wrap,
            html.sign-pdf-editor-active .merge-seo-content {
                display: none !important;
            }
            .sf-field.itq-sf-group {
                touch-action: none;
            }
            .sf-field .gizmo {
                width: 20px !important;
                height: 20px !important;
            }
        }

        /* عمود مصغّرات الصفحات — عمود عمودي على يسار المعاينة */
        .itq-thumbs-col {
            width: 140px;
            box-sizing: border-box;
            background: #fff;
            border-left: 1px solid #ececec;
            border-right: 1px solid #ececec;
            padding: 10px 6px;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            max-height: none;
            min-height: 0;
            flex-shrink: 0;
        }
        .itq-thumbs-col h6 {
            font-size: 12px;
            font-weight: 700;
            color: #777;
            text-align: center;
            margin: 4px 0 8px;
        }
        .itq-thumbs-col #thumbsList {
            padding-inline-end: 2px;
        }
        .itq-thumb-ph {
            min-height: 72px;
            height: 100px;
            max-height: 120px;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ccc;
            font-size: 12px;
            border-radius: 3px;
        }
        .itq-editor-bleed:has(.itq-editor-shell.active) .itq-editor-shell {
            flex: 1 1 auto;
            min-height: 0;
            max-height: 100%;
            overflow: hidden;
        }

        .itq-tools-footer {
            flex-shrink: 0;
            padding-top: 10px;
            margin-top: auto;
            border-top: 1px solid #ececec;
        }
        .itq-thumb {
            background: #fafafa;
            border: 2px solid transparent;
            border-radius: 6px;
            padding: 4px;
            margin-bottom: 10px;
            cursor: pointer;
            position: relative;
            transition: border-color .15s ease, background .15s ease;
            text-align: center;
        }
        .itq-thumb:hover { border-color: #bbb; }
        .itq-thumb.active {
            border-color: var(--itq-blue);
            background: #e6f4ff;
        }
        .itq-thumb img {
            display: block;
            width: 100%;
            height: auto;
            border-radius: 3px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.15);
        }
        .itq-thumb .pn {
            text-align: center;
            font-size: 11px;
            color: #666;
            margin-top: 4px;
        }

        /* عمود لوحة الصفحة الرئيسية — يغطّي العرض الكامل بدون فراغ */
        .itq-canvas-col {
            background: var(--itq-page-bg);
            position: relative;
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            min-height: 0;
            flex: 1;
            min-width: 0;
            padding: 0 2px 8px;
            margin: 0;
            text-align: center;
        }
        .itq-canvas-col #adContainerViewer {
            margin-top: 16px;
            flex-shrink: 0;
            text-align: center;
        }
        .itq-canvas-col #adContainerViewer ins.adsbygoogle {
            display: inline-block !important;
            width: min(100%, 728px) !important;
            max-width: 100% !important;
            margin-left: auto !important;
            margin-right: auto !important;
        }
        .itq-pages-stack {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 52px 4px 24px;
            gap: 0;
        }
        .itq-page-wrap {
            position: relative;
            background: #fff;
            box-shadow: 0 6px 30px rgba(0,0,0,0.15);
            user-select: none;
            margin-bottom: 18px;
            flex-shrink: 0;
        }
        .itq-page-wrap:last-child {
            margin-bottom: 8px;
        }
        .itq-page-stage {
            display: inline-block;
            position: relative;
            background: transparent;
            user-select: none;
            max-width: 100%;
            width: 100%;
        }
        .itq-page-stage img.pageimg {
            display: block;
            max-width: 100%;
            height: auto;
            pointer-events: none;
        }
        .itq-page-stage canvas.pagecanvas {
            display: block;
            width: 100%;
            height: auto;
        }

        /* حقول التوقيع — نمط Itqan Tools: itq-sf-group + gizmo + شريط إجراءات */
        .sf-field.itq-sf-group {
            position: absolute;
            background: transparent;
            border: none;
            border-radius: 2px;
            min-width: 40px;
            min-height: 22px;
            padding: 0;
            margin: 0;
            cursor: move;
            box-sizing: border-box;
            color: #111;
            font-size: 13px;
            font-weight: 600;
            text-align: center;
            overflow: visible;
            box-shadow: none;
        }
        .sf-field.itq-sf-group.placed {
            background: transparent;
            border: none;
        }
        .sf-field.itq-sf-group.selected {
            background: rgba(255,255,255,0.92);
            border: 2px solid #1a1a1a;
            box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 6px 18px rgba(0,0,0,0.1);
        }
        .itq-sf-group__inner {
            width: 100%;
            height: 100%;
            min-height: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            padding: 2px 4px;
            overflow: hidden;
            pointer-events: auto;
            position: relative;
            z-index: 1;
        }
        .sf-field[data-type="name"] .itq-sf-group__inner,
        .sf-field[data-type="text"] .itq-sf-group__inner,
        .sf-field[data-type="date"] .itq-sf-group__inner {
            overflow: visible;
        }
        .sf-field[data-type="signature"] .itq-sf-group__inner,
        .sf-field[data-type="initials"] .itq-sf-group__inner {
            padding: 2px 3px;
        }
        .sf-field[data-type="signature"] .itq-sf-el__applied,
        .sf-field[data-type="initials"] .itq-sf-el__applied {
            width: 100%;
            height: 100%;
        }
        .sf-field img.sf-img,
        .sf-field svg.sf-svg,
        .sf-field svg.sf-draw-sig {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            display: block;
            object-fit: contain;
            object-position: center;
            pointer-events: none;
        }
        .sf-field[data-type="signature"] img.sf-img,
        .sf-field[data-type="initials"] img.sf-img,
        .sf-field[data-type="stamp"] img.sf-img {
            width: 100%;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            object-position: center;
        }
        .sf-field .sf-label-text {
            font-size: 12px;
            color: #333;
            opacity: 0.9;
            line-height: 1.1;
            pointer-events: none;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .sf-field .sf-input-val {
            font-weight: 700;
            margin-inline-start: 6px;
        }
        .sf-field .sf-input-ph {
            opacity: 0.85;
        }
        .sf-field .sf-rendered-text {
            white-space: nowrap;
            overflow: visible;
            text-overflow: clip;
            display: block;
            max-width: none;
            line-height: 1.15;
            word-break: normal;
            color: #111;
            text-align: center;
            box-sizing: border-box;
        }
        /* حجم خط التوقيع/الحروف يُحدَّد من JS (scale) — لا تثبيت هنا حتى لا يُلغى خط السكربت */
        .sf-field[data-type="initials"] .sf-rendered-text {
            max-width: none;
            overflow: visible;
            white-space: nowrap;
            text-overflow: clip;
        }
        /* الاسم والتاريخ والنص: سطر واحد، بدون قصّ بنقاط — العرض يوسَّع بالكود عند الحاجة */
        .sf-field[data-type="name"] .sf-rendered-text,
        .sf-field[data-type="text"] .sf-rendered-text,
        .sf-field[data-type="date"] .sf-rendered-text {
            white-space: nowrap;
            overflow: visible;
            text-overflow: clip;
            word-break: normal;
            overflow-wrap: normal;
            line-height: 1.45;
            display: block;
            max-width: none;
        }
        .sf-field[data-type="name"],
        .sf-field[data-type="text"],
        .sf-field[data-type="date"] {
            overflow: visible;
        }
        .sf-field[data-type="name"] .itq-sf-el__applied,
        .sf-field[data-type="text"] .itq-sf-el__applied,
        .sf-field[data-type="date"] .itq-sf-el__applied {
            max-width: none;
        }
        /* إحكام الإطار حول النص/التاريخ/الحقل (غير التوقيع الرسومي) */
        .sf-field[data-type="name"] .itq-sf-group__inner,
        .sf-field[data-type="text"] .itq-sf-group__inner,
        .sf-field[data-type="date"] .itq-sf-group__inner,
        .sf-field[data-type="input"] .itq-sf-group__inner {
            padding: 1px 3px;
        }
        .sf-field.itq-sf-group:not(.selected) .gizmo,
        .sf-field.itq-sf-group:not(.selected) .itq-sf-group__actions {
            display: none !important;
        }

        /* مربع التوقيع للموقّعين (وضع متعدد) — نمط Itqan Tools */
        .sf-field.sf-multi-placeholder.itq-sf-group {
            background: color-mix(in srgb, var(--sign-tint, #f4a5b8) 18%, #fff);
            border: 2px solid color-mix(in srgb, var(--sign-tint, #f4a5b8) 72%, #ccc) !important;
            border-radius: 3px;
            min-width: 88px;
            min-height: 88px;
            box-shadow: none;
        }
        .sf-field.sf-multi-placeholder.itq-sf-group.selected {
            border-color: #1a1a1a !important;
            box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.1);
        }
        .sf-field.sf-multi-placeholder .itq-sf-group__inner {
            padding: 0;
            align-items: stretch;
            justify-content: stretch;
            overflow: hidden;
        }
        .sf-field.sf-multi-placeholder .multi-ph-inner {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100%;
            min-height: 0;
            box-sizing: border-box;
            pointer-events: none;
        }
        .sf-field.sf-multi-placeholder .itq-sf-el__name {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 4px 6px 2px;
            flex: 0 0 auto;
            min-height: 22px;
        }
        .sf-field.sf-multi-placeholder .itq-sf-el__icon {
            width: 14px;
            height: 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #4a7aab;
            font-size: 11px;
            flex-shrink: 0;
        }
        .sf-field.sf-multi-placeholder .itq-sf-el__label {
            font-size: 11px;
            font-weight: 700;
            color: #333;
            line-height: 1.1;
            white-space: nowrap;
        }
        .sf-field.sf-multi-placeholder .itq-sf-el__body {
            flex: 1 1 auto;
            min-height: 0;
            padding: 0 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .sf-field.sf-multi-placeholder .multi-ph-line {
            width: 100%;
            height: 0;
            border-bottom: 1.5px solid rgba(0,0,0,0.35);
            margin-top: 2px;
        }
        .sf-field.sf-multi-placeholder .itq-sf-el__id {
            flex: 0 0 auto;
            font-size: 7px;
            line-height: 1.2;
            letter-spacing: 0.02em;
            color: #888;
            text-align: center;
            padding: 2px 4px 4px;
            font-family: monospace, Tahoma, sans-serif;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* نافذة التسجيل — أنماط sign_auth_modal.css */

        .itq-sf-group__actions {
            position: absolute;
            top: -32px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 1px;
            background: #2d2d33;
            border-radius: 7px;
            padding: 3px 5px;
            z-index: 120;
            box-shadow: 0 4px 14px rgba(0,0,0,0.28);
        }
        .itq-sf-act {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            margin: 0;
            border: 0;
            background: transparent;
            cursor: pointer;
            border-radius: 5px;
            padding: 0;
            color: #fff;
            flex-shrink: 0;
        }
        .itq-sf-act:hover {
            background: rgba(255,255,255,0.14);
        }
        .itq-sf-act--remove {
            color: #ff8b8b;
        }
        .itq-sf-act svg,
        .itq-sf-act i {
            display: block;
            pointer-events: none;
        }
        .itq-sf-act i {
            font-size: 13px;
            line-height: 1;
        }
        .itq-sf-act .itq-sf-act__ico {
            display: block;
            flex-shrink: 0;
        }
        .gizmo {
            position: absolute;
            width: 11px;
            height: 11px;
            background: #fff;
            border: 2px solid #1a1a1a;
            border-radius: 50%;
            z-index: 8;
            box-sizing: border-box;
            box-shadow: 0 0 0 1px rgba(255,255,255,0.9);
        }
        .gizmo--top.gizmo--left { top: -6px; left: -6px; cursor: nwse-resize; }
        .gizmo--top.gizmo--right { top: -6px; right: -6px; cursor: nesw-resize; }
        .gizmo--bottom.gizmo--left { bottom: -6px; left: -6px; cursor: nesw-resize; }
        .gizmo--bottom.gizmo--right { bottom: -6px; right: -6px; cursor: nwse-resize; }

        /* نافذة «ضعه على» — صفحات متعددة */
        .field-place-body {
            display: flex;
            flex-direction: row;
            gap: 18px;
            align-items: flex-start;
            text-align: start;
        }
        html[dir="rtl"] .field-place-body {
            flex-direction: row-reverse;
            text-align: right;
        }
        @media (max-width: 576px) {
            .field-place-body { flex-direction: column; }
        }
        .field-place-info {
            flex: 1;
            min-width: 0;
            background: linear-gradient(180deg, #e8f4fc 0%, #dcecf8 100%);
            border: 1px solid #7eb8e0;
            border-radius: 10px;
            padding: 14px 14px;
            font-size: 13px;
            font-weight: 600;
            color: #1e3a5f;
            line-height: 1.55;
        }
        .field-place-options {
            flex: 1;
            min-width: 0;
        }
        .field-place-options label {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 10px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: #222;
        }
        .field-place-options input[type="radio"] {
            width: 18px;
            height: 18px;
            accent-color: #16a34a;
            flex-shrink: 0;
        }
        .field-place-options label:has(input[type="radio"]:disabled) {
            opacity: 0.45;
            cursor: not-allowed;
        }
        html[dir="rtl"] #fieldPlaceCustomRow .form-control {
            text-align: right;
            direction: rtl;
        }

        /* خيارات التوقيع — أعلى التخطيط العمودي */
        .itq-tools-col {
            background: var(--itq-sidebar-bg);
            border-left: 1px solid #ececec;
            border-right: 1px solid #ececec;
            padding: 16px 14px;
            overflow: hidden;
            max-height: none;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .itq-tools-scroll {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            overflow-x: visible;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            padding-bottom: 8px;
            padding-inline: 4px;
        }
        .itq-tools-col .tools-title {
            font-size: 16px;
            font-weight: 800;
            color: #111;
            margin: 0 0 4px;
            text-align: center;
        }
        .itq-tools-col .tools-sub {
            font-size: 13px;
            color: #666;
            margin: 0 0 14px;
            text-align: center;
        }
        .itq-section-title {
            font-size: 12px;
            font-weight: 800;
            color: #555;
            text-transform: uppercase;
            letter-spacing: .04em;
            margin: 16px 0 8px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* تلميحة معلومات لقسم النوع */
        .itq-info-tip {
            position: relative;
            display: inline-flex;
            color: #999;
            cursor: help;
        }
        .itq-info-tip i { font-size: 13px; }
        .itq-info-tip .itq-info-bubble {
            position: absolute;
            top: calc(100% + 6px);
            inset-inline-end: 0;
            background: #2a2a30;
            color: #fff;
            padding: 12px 14px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 600;
            line-height: 1.55;
            min-width: 240px;
            max-width: 280px;
            text-transform: none;
            letter-spacing: 0;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-4px);
            transition: opacity .15s ease, transform .15s ease, visibility .15s;
            z-index: 60;
            box-shadow: 0 8px 24px rgba(0,0,0,0.25);
            text-align: start;
        }
        .itq-info-tip .itq-info-bubble::before {
            content: '';
            position: absolute;
            bottom: 100%;
            inset-inline-end: 8px;
            border: 6px solid transparent;
            border-bottom-color: #2a2a30;
        }
        .itq-info-tip:hover .itq-info-bubble,
        .itq-info-tip:focus .itq-info-bubble,
        .itq-info-tip:focus-within .itq-info-bubble {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        /* أيقونات وضع التوقيع (Single / Multi) — للنافذة فقط */
        .itq-mode-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .itq-mode-pill {
            border: 1.5px solid #e5e5e8;
            background: #fff;
            border-radius: 10px;
            padding: 10px 6px;
            text-align: center;
            cursor: pointer;
            transition: border-color .15s ease, background .15s ease;
        }
        .itq-mode-pill.active {
            border-color: var(--itq-accent);
            background: #f5f5f5;
        }
        .itq-mode-pill .ic { font-size: 22px; color: #444; }
        .itq-mode-pill.active .ic { color: var(--itq-accent); }
        .itq-mode-pill .lb { font-size: 13px; font-weight: 700; margin-top: 4px; color: #222; }

        /* نوع التوقيع: التوقيع الرقمي / التوقيع البسيط */
        .itq-type-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            padding-top: 8px;
            overflow: visible;
        }
        .itq-type-pill {
            position: relative;
            border: 1.5px solid #e5e5e8;
            background: #fff;
            border-radius: 10px;
            padding: 14px 6px 10px;
            text-align: center;
            cursor: pointer;
            transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
            min-height: 80px;
        }
        .itq-type-pill:hover {
            border-color: #cfcfd4;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }
        .itq-type-pill.active {
            border-color: #1a1a1a;
            background: #f7f7f8;
        }
        .itq-type-pill .ic { font-size: 26px; color: #555; }
        .itq-type-pill.active .ic { color: #1a1a1a; }
        .itq-type-pill .lb {
            font-size: 12.5px;
            font-weight: 700;
            margin-top: 4px;
            color: #222;
        }
        .itq-type-pill .pro-badge {
            position: absolute;
            top: -6px;
            inset-inline-end: -6px;
            width: 22px; height: 22px;
            border-radius: 50%;
            background: rgba(0, 180, 220, 0.38);
            color: #0099bb;
            font-size: 11px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 6px rgba(0, 153, 187, 0.4);
            border: 1px solid rgba(0, 153, 187, 0.55);
        }

        /* أزرار إعادة الترتيب / حذف الكل — نفس أداة التنظيم */
        .itq-sidebar-actions {
            margin-top: 14px;
            margin-bottom: 4px;
        }
        .itq-sidebar-actions .reset-btn {
            width: 100%;
            padding: 10px;
            border-radius: 6px;
            border: 1px solid #dee2e6;
            background: #fff3cd;
            cursor: pointer;
            transition: all 0.3s;
            color: #856404;
            font-weight: 600;
            margin-bottom: 10px;
        }
        .itq-sidebar-actions .reset-btn:hover {
            background: #ffc107;
            border-color: #ffc107;
            color: #000;
        }
        .itq-sidebar-actions .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;
        }
        .itq-sidebar-actions .merge-sidebar-btn-clear:hover {
            background: #eee;
            border-color: #bbb;
            color: #222;
        }

        /* أزرار إضافة ملفات في السايدبار (نفس نمط أزرار النتيجة) */
        .itq-add-files-row {
            display: inline-flex;
            justify-content: center;
            gap: 12px;
            margin: 10px 0 6px;
            width: 100%;
        }
        .itq-add-files-row .add-file-wrap {
            position: relative;
            display: inline-flex;
        }
        .itq-add-files-row .add-file-tip {
            position: absolute;
            bottom: calc(100% + 6px);
            left: 50%;
            transform: translateX(-50%);
            background: #565666;
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            padding: 5px 9px;
            border-radius: 5px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity .15s ease, transform .15s ease;
            z-index: 5;
        }
        .itq-add-files-row .add-file-tip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-top-color: #565666;
        }
        .itq-add-files-row .add-file-wrap:hover .add-file-tip {
            opacity: 1;
            transform: translateX(-50%) translateY(-2px);
        }
        .itq-add-files-row .add-file-btn {
            width: 46px;
            height: 46px;
            border-radius: 999px;
            border: 2px solid #d8dce2;
            background: #fff;
            color: #2c2c2c;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.07);
            transition: transform .15s ease, filter .2s ease;
        }
        .itq-add-files-row .add-file-btn:hover {
            transform: translateY(-2px);
            filter: brightness(0.98);
        }
        .itq-add-files-row .add-file-btn i {
            font-size: 18px;
        }
        #sidebarGoogleBtn i  { color: #ea4335; }
        #sidebarDropboxBtn i { color: #0061FF; }
        #sidebarComputerBtn i { color: #2c2c2c; }

        /* قائمة الموقّعين */
        .itq-signers-list {
            list-style: none;
            padding: 0;
            margin: 0 0 8px;
        }
        .itq-signer-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            background: #f7f7f9;
            border-radius: 8px;
            margin-bottom: 6px;
            cursor: pointer;
            border: 1.5px solid transparent;
            transition: border-color .15s ease;
        }
        .itq-signer-row.active { border-color: var(--itq-accent); background: #f5f5f5; }
        .itq-signer-color {
            width: 10px; height: 10px; border-radius: 50%;
            background: var(--c, #999);
            flex-shrink: 0;
        }
        .itq-signer-info { flex: 1; min-width: 0; }
        .itq-signer-info .nm { font-size: 13px; font-weight: 700; color: #111; }
        .itq-signer-info .em { font-size: 11px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .itq-edit-receivers-btn {
            width: 100%;
            background: #fff;
            border: 1.5px dashed #ddd;
            color: #444;
            border-radius: 8px;
            padding: 8px;
            font-weight: 700;
            font-size: 13px;
            transition: all .15s ease;
        }
        .itq-edit-receivers-btn:hover {
            border-color: var(--itq-accent);
            color: var(--itq-accent);
        }

        /* لوحة الحقول — نمط Itqan Tools (itq-opt-panel + itq-sf-tool) */
        .itq-opt-panel__content {
            margin-top: 4px;
        }
        .option__title {
            font-size: 11px;
            font-weight: 800;
            color: #6b6b76;
            text-transform: uppercase;
            letter-spacing: .06em;
            margin: 14px 0 8px;
        }
        .itq-opt-panel__content > .option__title:first-child {
            margin-top: 4px;
        }
        .itq-sf-tool {
            display: block;
            margin-bottom: 10px;
            border-radius: 10px;
            background: #fafafa;
            border: 1px solid #c9cdd4;
            cursor: pointer;
            transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
            user-select: none;
            position: relative;
        }
        .itq-sf-tool:hover {
            border-color: #111;
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
            transform: translateY(-1px);
        }
        .itq-sf-tool:active { cursor: grabbing; }
        .itq-sf-tool.dragging { opacity: .6; transform: scale(.99); }
        .itq-sf-tool.preview__active .itq-sf-tool__preview {
            display: flex;
        }
        .itq-sf-tool__content {
            display: flex;
            flex-direction: row;
            align-items: stretch;
            gap: 8px;
            padding-block: 10px;
            padding-inline: 8px 10px;
            direction: ltr;
            min-height: 72px;
        }
        html[dir="rtl"] .itq-sf-tool__content {
            direction: rtl;
        }
        .itq-sf-tool__drag {
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 14px;
            opacity: 0.55;
            cursor: grab;
        }
        .itq-sf-tool__drag:active { cursor: grabbing; }
        .itq-sf-tool__icon {
            flex: 0 0 40px;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            background: #111;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            align-self: center;
            box-shadow: none;
            border: 1px solid #111;
        }
        .itq-sf-tool__text {
            flex: 0 0 auto;
            min-width: 4.5rem;
            font-size: 13px;
            font-weight: 800;
            color: #1a1d24;
            display: flex;
            align-items: center;
            line-height: 1.25;
            align-self: center;
        }
        .itq-sf-tool__preview {
            flex: 1 1 auto;
            min-width: 0;
            display: flex;
            align-items: stretch;
        }
        .signature__area__signature {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .signature__preview {
            position: relative;
            width: 100%;
            height: 84px;
            min-height: 84px;
            max-height: 84px;
            padding: 6px 8px;
            box-sizing: border-box;
            border: 1px dashed #6b7280;
            border-radius: 6px;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .signature__preview .sidebar-preview-img {
            /* ارتفاع صريح — max-height:100% لا يعمل بدون height ثابت على الأب */
            max-width: 100%;
            max-height: 70px;
            width: auto;
            height: auto;
            object-fit: contain;
            object-position: center;
            display: block;
            flex-shrink: 1;
        }
        .signature__preview--initials .ilov-preview-initials-txt {
            display: block;
            font-size: clamp(11px, 2.8vw, 16px);
            font-weight: 700;
            color: #111;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding: 0 6px;
            line-height: 1.1;
        }
        .signature__preview .ilov-preview-sig-type {
            display: block;
            max-width: 100%;
            font-size: clamp(12px, 3.2vw, 18px);
            line-height: 1.05;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: center;
        }
        .signature__preview--signature .ilov-preview-sig {
            font-family: 'Great Vibes', 'Segoe Script', cursive;
            font-size: 1.35rem;
            color: #111;
            opacity: 0.92;
            line-height: 1;
        }
        .signature__preview--initials .ilov-preview-initials-svg {
            width: 88%;
            max-height: 48px;
            color: #111;
        }
        .signature__preview--name .ilov-preview-ph,
        .signature__preview--date .ilov-preview-ph,
        .signature__preview--text .ilov-preview-ph {
            font-size: 12px;
            font-weight: 700;
            color: #3d4a5c;
        }
        .signature__preview--name .ilov-preview-ph[class*="ff-"],
        .signature__preview--date .ilov-preview-ph[class*="ff-"],
        .signature__preview--text .ilov-preview-ph[class*="ff-"] {
            font-size: clamp(11px, 2.6vw, 15px);
            font-weight: 400;
            color: #111;
        }
        .signature__preview--initials .ilov-preview-initials-txt[class*="ff-"] {
            font-size: clamp(12px, 3vw, 18px);
            font-weight: 400;
        }
        .signature__preview--input .ilov-preview-ph {
            font-size: 11px;
            color: #5a6570;
        }
        .signature__preview--stamp {
            background: linear-gradient(180deg, #fafbfc, #f3f5f8);
        }
        .itq-sf-tool__actions {
            flex: 0 0 auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            gap: 6px;
            padding-top: 2px;
            align-self: flex-start;
        }
        .itq-sf-tool__edit {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 1px solid #dce4ee;
            background: #fff;
            color: #5a6570;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            cursor: pointer;
            padding: 0;
            transition: background .15s ease, color .15s ease, border-color .15s ease;
        }
        .itq-sf-tool__edit:hover {
            border-color: #111;
            color: #111;
            background: #f3f3f3;
        }
        .itq-sf-tool__count {
            display: none;
            min-width: 22px;
            height: 22px;
            border-radius: 50%;
            background: #111;
            color: #fff;
            font-size: 11px;
            font-weight: 800;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }
        .itq-sf-tool__count.is-visible {
            display: inline-flex;
        }
        .itq-sf-tool__content > * {
            pointer-events: none;
        }
        .itq-sf-tool__actions button,
        .itq-sf-tool__edit,
        .itq-sf-tool [data-edit-signature],
        .itq-sf-tool [data-edit-field-tool] {
            pointer-events: auto;
        }
        .color-picker-row {
            flex-wrap: wrap;
            gap: 6px 8px;
        }
        .color-picker-row .color-dot {
            flex-shrink: 0;
        }

        /* زر المعالجة الرئيسي — داخل عمود الأدوات */
        .itq-process-bar {
            background: #fafafa;
            border-top: 0;
            padding: 12px 0 4px;
            text-align: center;
        }
        .itq-process-btn {
            background: #111;
            color: #fff;
            border: 0;
            padding: 14px 24px;
            border-radius: 10px;
            font-size: 18px;
            font-weight: 800;
            width: 100%;
            max-width: 100%;
            box-shadow: 0 4px 16px rgba(0,0,0,0.22);
            transition: transform .15s ease, background .2s ease;
        }
        .itq-process-btn:hover { background: #000; transform: translateY(-1px); }
        .itq-process-btn:disabled {
            background: #aaa;
            box-shadow: none;
            cursor: not-allowed;
        }
        .itq-process-btn i { margin-inline-end: 6px; }

        /* ============================================================
           3) النوافذ المنبثقة (Modal) — تصميم خاص بالموقع
           ============================================================ */
        .itq-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.55);
            z-index: 4000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .itq-modal-overlay.active { display: flex; }
        .itq-modal {
            background: #fff;
            border-radius: 14px;
            max-width: 720px;
            width: 100%;
            max-height: 92vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 30px 80px rgba(0,0,0,0.4);
            animation: itqIn 0.22s ease-out;
        }
        .itq-modal.lg { max-width: 880px; }
        .itq-modal.sm { max-width: 460px; }
        @keyframes itqIn {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .itq-modal-header {
            background: #1a1a1a;
            color: #fff;
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .itq-modal-header h4 { margin: 0; font-size: 18px; font-weight: 800; }
        .itq-modal-close {
            background: transparent;
            border: 0;
            color: #fff;
            font-size: 26px;
            line-height: 1;
            cursor: pointer;
            opacity: 0.8;
        }
        .itq-modal-close:hover { opacity: 1; }
        .itq-modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
        }
        .itq-modal-footer {
            padding: 14px 20px;
            background: #fafafa;
            border-top: 1px solid #ececec;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        .btn-itq-primary {
            background: var(--itq-accent);
            color: #fff;
            border: 0;
            padding: 10px 22px;
            border-radius: 8px;
            font-weight: 700;
        }
        .btn-itq-primary:hover { background: #222222; color: #fff; }
        /* نافذة اختيار الموقّعين (multi-signer) */
        .signer-picker-list { display: flex; flex-direction: column; gap: 8px; }
        .signer-picker-row {
            display: flex; align-items: center; gap: 12px;
            padding: 12px 14px; border: 1.5px solid #e8eaef; border-radius: 10px;
            cursor: pointer; transition: border-color .15s, background .15s;
        }
        .signer-picker-row:hover { border-color: #cbd5e1; background: #fafbfc; }
        .signer-picker-row.selected { border-color: #111; background: #f8f9fb; }
        .signer-picker-row input[type="checkbox"] {
            width: 18px; height: 18px; accent-color: #28a745; flex-shrink: 0; cursor: pointer;
        }
        .signer-picker-dot {
            width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
        }
        .signer-picker-name { flex: 1; font-weight: 600; font-size: .95rem; color: #111; }
        .signer-picker-email { font-size: .78rem; color: #888; margin-top: 2px; }

        .btn-itq-secondary {
            background: #fff;
            color: #333;
            border: 1.5px solid #ddd;
            padding: 10px 22px;
            border-radius: 8px;
            font-weight: 700;
        }
        .btn-itq-secondary:hover { background: #f7f7f9; }

        /* اختيار الوضع */
        .mode-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        .mode-card {
            border: 2px solid #e5e5e8;
            border-radius: 12px;
            padding: 26px 18px;
            text-align: center;
            cursor: pointer;
            transition: all .2s ease;
            background: #fff;
        }
        .mode-card:hover {
            border-color: var(--itq-accent);
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        }
        .mode-card .mc-ic {
            width: 78px; height: 78px;
            border-radius: 50%;
            background: #f3f3f3;
            margin: 0 auto 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 34px;
            color: #1a1a1a;
        }
        .mode-card.primary .mc-ic { background: var(--itq-accent); color: #fff; }
        .mode-card .mc-title {
            font-weight: 800;
            font-size: 16px;
            color: #111;
            margin-bottom: 4px;
        }
        .mode-card .mc-desc { font-size: 13px; color: #666; }
        @media (max-width: 540px) {
            .mode-grid { grid-template-columns: 1fr; }
        }

        /* تبويبات إنشاء التوقيع */
        .itq-tabs {
            display: flex;
            gap: 0;
            border-bottom: 2px solid #ececec;
            margin-bottom: 16px;
        }
        .itq-tab {
            background: transparent;
            border: 0;
            padding: 12px 18px;
            font-weight: 700;
            font-size: 14px;
            color: #666;
            border-bottom: 3px solid transparent;
            margin-bottom: -2px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .itq-tab.active {
            color: var(--itq-primary);
            border-bottom-color: var(--itq-accent);
        }
        .itq-tab-pane { display: none; }
        .itq-tab-pane.active { display: block; }

        /* تبويبات رئيسية: التوقيع / الحروف الأولى / الختم (مثل Itqan Tools) */
        .sig-meta-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            border-bottom: 2px solid #ececec;
            margin: -4px 0 16px;
            padding: 0;
        }
        .sig-meta-tab {
            flex: 1 1 auto;
            min-width: 0;
            background: transparent;
            border: 0;
            padding: 12px 14px;
            font-weight: 700;
            font-size: 14px;
            color: #666;
            border-bottom: 3px solid transparent;
            margin-bottom: -2px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
            transition: color .15s ease, border-color .15s ease;
        }
        .sig-meta-tab:hover { color: #333; }
        .sig-meta-tab.active {
            color: #1565c0;
            border-bottom-color: #1565c0;
        }
        .sig-meta-tab i { opacity: 0.85; font-size: 15px; }

        /* خطوط التوقيع — شبكة أفقية كما كانت (بدون فرض عمودين في النافذة) */
        .signature-fonts {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
            gap: 8px;
            margin-bottom: 12px;
            align-items: stretch;
        }
        .signature-fonts .sig-font-subtitle {
            grid-column: 1 / -1;
            margin-bottom: 0;
        }
        @media (max-width: 380px) {
            .signature-fonts { grid-template-columns: 1fr 1fr; }
        }
        .sig-font-pick {
            border: 1.5px solid #e5e5e8;
            border-radius: 8px;
            padding: 10px 8px;
            cursor: pointer;
            background: #fff;
            transition: border-color .15s ease;
            min-height: 62px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: visible;
        }
        .sig-font-pick:hover { border-color: #b8b8b8; }
        .sig-font-pick.active { border-color: var(--itq-accent); background: #f5f5f5; }
        .sig-font-pick .preview {
            font-size: 26px;
            line-height: 1.35;
            color: #111;
            white-space: nowrap;
            overflow: visible;
            text-overflow: clip;
            max-width: 100%;
            display: block;
            text-align: center;
        }
        .ff-caveat   { font-family: 'Caveat', cursive; }
        .ff-dancing  { font-family: 'Dancing Script', cursive; }
        .ff-greatv   { font-family: 'Great Vibes', cursive; }
        .ff-homemade { font-family: 'Homemade Apple', cursive; }
        .ff-marck    { font-family: 'Marck Script', cursive; }
        .ff-pacifico { font-family: 'Pacifico', cursive; }
        .ff-sacram   { font-family: 'Sacramento', cursive; }
        .ff-satisfy  { font-family: 'Satisfy', cursive; }
        .ff-shadows  { font-family: 'Shadows Into Light', cursive; }
        .ff-yellow   { font-family: 'Yellowtail', cursive; }
        .ff-ar-amiri   { font-family: 'Amiri', serif; }
        .ff-ar-cairo   { font-family: 'Cairo', sans-serif; }
        .ff-ar-tajwal  { font-family: 'Tajawal', sans-serif; }
        .ff-ar-messiri { font-family: 'El Messiri', sans-serif; }
        .ff-ar-reem    { font-family: 'Reem Kufi Ink', sans-serif; }
        .ff-ar-lemon   { font-family: 'Lemonada', cursive; }
        .ff-ar-lalezar { font-family: 'Lalezar', system-ui; }
        /* حجم المعاينة داخل أزرار الخط فقط — لا يفرض على الحقل فوق PDF */
        .sig-font-pick .preview.ff-homemade { font-size: 22px !important; }
        .sig-font-pick .preview.ff-ar-lemon { font-size: 22px !important; }
        .sig-font-pick .preview.ff-ar-lalezar { font-size: 26px !important; }
        .ff-ar-aref    { font-family: 'Aref Ruqaa', serif; }
        .signature-fonts-ar { margin-top: 12px; }
        .signature-fonts-ar .sig-font-subtitle {
            font-size: 12px;
            font-weight: 700;
            color: #444;
            margin-bottom: 8px;
        }
        .itq-sf-el__body {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            box-sizing: border-box;
        }
        .itq-sf-el__applied {
            max-width: 100%;
            max-height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .itq-sf-el__applied .sf-img {
            object-fit: contain;
        }

        /* اختيار اللون */
        .color-picker-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 10px;
            font-size: 13px;
            color: #444;
        }
        .color-dot {
            width: 24px; height: 24px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            transition: transform .15s ease;
        }
        .color-dot:hover { transform: scale(1.1); }
        .color-dot.active { border-color: #111; transform: scale(1.15); }

        /* لوحة الرسم — مستطيل أفقي قليلاً (أعرض من الارتفاع) لتوسيع الجانبين وتقليل الارتفاع قليلًا */
        .draw-board {
            position: relative;
            border: 2px dashed #ccc;
            border-radius: 8px;
            background: #fff;
            width: min(340px, calc(100% - 24px), min(calc(92vw - 32px), 62vh));
            max-width: 100%;
            aspect-ratio: 5 / 4;
            height: auto;
            margin-inline: auto;
            flex-shrink: 0;
            overflow: hidden;
            box-sizing: border-box;
        }
        .draw-board canvas {
            display: block;
            width: 100%;
            height: 100%;
            cursor: crosshair;
            touch-action: none;
        }
        .draw-board .placeholder {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #aaa;
            font-size: 15px;
            pointer-events: none;
        }
        .draw-board.has-content .placeholder { display: none; }
        .draw-board .clear-btn {
            position: absolute;
            top: 8px;
            left: 8px;
            background: #fff;
            border: 1px solid #e5e5e8;
            border-radius: 6px;
            padding: 4px 8px;
            font-size: 12px;
            color: #666;
            cursor: pointer;
        }
        .draw-board .clear-btn:hover { color: var(--itq-accent); border-color: var(--itq-accent); }

        /* رفع صورة التوقيع */
        .upload-sig-zone {
            border: 2px dashed #ccc;
            border-radius: 8px;
            padding: 30px 20px;
            text-align: center;
            background: #fff;
            transition: border-color .15s ease;
            position: relative;
            min-height: 200px;
        }
        .upload-sig-zone.dragover { border-color: var(--itq-accent); background: #f5f5f5; }
        .upload-sig-zone .preview-img {
            max-width: 100%;
            max-height: 160px;
            display: none;
            margin: 0 auto;
        }
        .upload-sig-zone.has-image .upload-prompt { display: none; }
        .upload-sig-zone.has-image .preview-img { display: block; }
        .upload-sig-zone input[type=file] {
            position: absolute;
            inset: 0;
            opacity: 0;
            cursor: pointer;
        }

        /* المستلمون (Receivers) */
        .receiver-item {
            background: #f7f7f9;
            border: 1.5px solid #e8e8eb;
            border-radius: 10px;
            padding: 12px;
            margin-bottom: 10px;
        }
        .receiver-row-1 {
            display: grid;
            grid-template-columns: 24px 24px 1fr 1fr 110px 32px;
            gap: 8px;
            align-items: center;
        }
        @media (max-width: 700px) {
            .receiver-row-1 {
                grid-template-columns: 24px 1fr 32px;
                row-gap: 8px;
            }
            .receiver-row-1 > .receiver-grow-2 { grid-column: 1 / -1; }
        }
        .receiver-num {
            width: 24px; height: 24px;
            border-radius: 50%;
            background: var(--c, #999);
            color: #fff;
            text-align: center;
            line-height: 24px;
            font-weight: 800;
            font-size: 12px;
            flex-shrink: 0;
        }
        .receiver-grip {
            color: #aaa;
            cursor: grab;
            text-align: center;
        }
        .receiver-item input.input-r,
        .receiver-item select.input-r {
            border: 1px solid #d8d8dc;
            border-radius: 6px;
            padding: 7px 8px;
            font-size: 13px;
            width: 100%;
        }
        .receiver-item input.input-r:focus,
        .receiver-item select.input-r:focus {
            border-color: var(--itq-accent);
            outline: none;
        }
        .receiver-del {
            background: transparent;
            border: 0;
            color: #999;
            font-size: 18px;
            cursor: pointer;
            line-height: 1;
        }
        .receiver-del:hover { color: var(--itq-accent); }
        .itq-add-recv {
            display: block;
            width: 100%;
            background: #f0f4ff;
            color: #1a4a8a;
            border: 1.5px dashed #b8c8e8;
            border-radius: 8px;
            padding: 10px;
            font-weight: 700;
            font-size: 13px;
            margin-bottom: 16px;
            transition: all .15s ease;
        }
        .itq-add-recv:hover { background: #e0eaff; }

        .receiver-settings { margin-top: 4px; }
        .itq-recv {
            border-top: 1px solid #ececec;
            padding: 12px 0;
        }
        .itq-recv:first-child { border-top: 0; }
        .itq-recv__head {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 10px 12px;
            align-items: start;
        }
        .itq-recv__head input[type=checkbox] {
            margin-top: 3px;
            transform: scale(1.12);
            accent-color: var(--itq-accent, #1a4a8a);
        }
        .itq-recv__head input[type=checkbox]:disabled {
            opacity: .45;
            cursor: not-allowed;
        }
        .itq-recv__label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 700;
            color: #222;
            font-size: 14px;
            line-height: 1.35;
            cursor: pointer;
            margin: 0;
        }
        .itq-recv__icon {
            flex-shrink: 0;
            width: 26px;
            height: 26px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--itq-accent, #1a4a8a);
            font-size: 15px;
            background: #eef3fa;
            border-radius: 7px;
        }
        .itq-recv__icon i { line-height: 1; }
        .itq-recv__body {
            margin-top: 6px;
            padding-inline-start: 30px;
            font-size: 12px;
            color: #666;
            line-height: 1.55;
        }
        .itq-recv__body.disabled { opacity: .55; }
        .itq-recv__body p { margin: 0 0 4px; }
        .itq-recv__body p:last-child { margin-bottom: 0; }
        .itq-recv__body .small { font-size: 11px; color: #888; margin-top: 4px; }
        .itq-recv__body input[type=number].input--sm,
        .itq-recv__body select.input--sm {
            width: 56px;
            border: 1px solid #d8d8dc;
            border-radius: 6px;
            padding: 3px 6px;
            font-size: 12px;
            text-align: center;
        }
        .itq-recv__body .st-extra {
            margin-top: 8px;
            display: none;
        }
        .itq-recv.expanded .itq-recv__body .st-extra { display: block; }
        .itq-recv.expanded .st-extra-inline { display: inline; }
        .itq-recv:not(.expanded) .st-extra-inline { display: none; }
        .itq-recv.expanded #expireDaysDefault,
        .itq-recv.expanded #reminderDaysDefault { display: none; }
        .itq-recv:not(.expanded) #expireSet,
        .itq-recv:not(.expanded) #reminderSet { display: none; }
        .itq-recv.expanded #languageDefault { display: none; }
        .itq-recv:not(.expanded) #languageSelected { display: none; }
        .brand-upload-box {
            border: 1.5px dashed #c8d4e8;
            border-radius: 8px;
            padding: 14px;
            text-align: center;
            background: #f7f9fc;
            margin-top: 8px;
        }
        .brand-upload-box input[type=file] { font-size: 12px; max-width: 100%; }
        .brand-upload-preview {
            max-width: 180px;
            max-height: 70px;
            margin: 8px auto 0;
            display: none;
        }
        .brand-upload-preview.has-image { display: block; }

        /* صفحة التقدم والمعالجة */
        .itq-overlay {
            position: fixed;
            inset: 0;
            background: rgba(255,255,255,0.95);
            z-index: 5000;
            display: none;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            text-align: center;
        }
        .itq-overlay.active { display: flex; }
        .itq-overlay .spinner-border {
            width: 4rem;
            height: 4rem;
            color: var(--itq-accent) !important;
        }
        .itq-overlay .msg {
            margin-top: 18px;
            font-size: 18px;
            font-weight: 700;
            color: #222;
        }
        .itq-overlay .submsg {
            margin-top: 6px;
            color: #666;
            font-size: 14px;
        }

        /* ============================================================
           صفحة النتيجة — نفس أصناف merge_pdf.php (merge-result-*)
           ============================================================ */
        #signResult.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;
        }
        #saveSignedToGoogleBtn i {
            color: #ea4335;
        }
        #saveSignedToDropboxBtn i {
            color: #0b67ff;
        }
        #deleteSignedBtn {
            background: #ffffff;
            border-color: #dddddd;
        }
        #deleteSignedBtn i {
            color: #111111;
        }
        .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: start;
        }
        @media (max-width: 576px) {
            .merge-result-download {
                min-width: 100%;
                font-size: 18px;
            }
            .merge-result-tool-links {
                grid-template-columns: 1fr;
            }
        }

        /* تنبيهات — وسط الشاشة */
        .toast-area {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 10060;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            max-width: min(92vw, 440px);
            pointer-events: none;
        }
        .toast-msg {
            background: #1a1a1a;
            color: #fff;
            padding: 12px 18px;
            border-radius: 8px;
            font-size: 14px;
            line-height: 1.5;
            text-align: center;
            box-shadow: 0 6px 20px rgba(0,0,0,0.25);
            animation: toastIn 0.25s ease-out;
            pointer-events: auto;
        }
        .toast-msg.error { background: var(--itq-accent); }
        .toast-msg.success { background: #000000; color: #ffffff; }
        @keyframes toastIn {
            from { transform: translateY(10px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        /* تلميحات سحب الحقول */
        .drag-tip {
            position: fixed;
            background: #1a1a1a;
            color: #fff;
            padding: 6px 10px;
            font-size: 12px;
            border-radius: 4px;
            pointer-events: none;
            z-index: 9000;
            display: none;
        }

        /* تصغير الأدوات على الجوال */
        @media (max-width: 900px) {
            .itq-toolbar-end { margin-inline-start: 0; }
            .itq-process-btn { min-width: 100%; font-size: 16px; }
            .mobile-tabs { display: none !important; }
        }
        .mobile-tabs {
            display: none;
            background: #1a1a1a;
            color: #fff;
            border-bottom: 1px solid #2a2a2a;
        }
        .mobile-tabs button {
            flex: 1;
            padding: 12px 8px;
            background: transparent;
            color: #ccc;
            border: 0;
            font-size: 13px;
            font-weight: 700;
        }
        .mobile-tabs button.active {
            color: #fff;
            border-bottom: 2px solid var(--itq-accent);
        }
