:root {
            --brand-red: #e5322d;
            --bg-viewer: #f8f9fa;
            --viewer-surface: #ebebeb;
            --sidebar-width: 340px;
            --black-accent: #1e1e1e;
            --primary-color: #000000;
            --light-bg: #f8f9fa;
            --border-color: #dee2e6;
        }
        .visually-hidden {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            padding: 0 !important;
            margin: -1px !important;
            overflow: hidden !important;
            clip: rect(0, 0, 0, 0) !important;
            white-space: nowrap !important;
            border: 0 !important;
        }

        html {
            margin: 0;
            padding: 0;
            min-height: 100%;
            background-color: var(--light-bg);
        }
        /* وضع المعاينة: منع تمرير الصفحة الخارجية + ملء المساحة تحت الشريط (يتجنب شريطي تمرير وفراغ أسفل) */
        html.itqan-editor-active {
            height: 100%;
            overflow: hidden;
        }
        html.itqan-editor-active body.bg-light-subtle {
            overflow: hidden !important;
            height: 100%;
            max-height: 100dvh;
        }
        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: visible;
            overflow-y: auto;
        }

        /* Upload area styling (merge pattern) */
        .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;
            overflow: visible !important;
        }
        .upload-area:hover,
        .upload-area.dragover {
            background-color: #eef0f2;
            border-color: #6b7280 !important;
        }
        #dropArea,
        .upload-area.card,
        #upload-section .card.upload-area {
            overflow: visible;
            max-width: 100%;
            background-color: #f8f9fa !important;
            background: #f8f9fa !important;
            box-shadow: none !important;
            border: 2px dashed #ced4da !important;
        }
        #upload-section .card-body,
        #upload-section .upload-row-wrap,
        #upload-section .upload-pick-wrap,
        #upload-section .upload-cloud-stack,
        #upload-section .cloud-icon {
            overflow: visible !important;
        }
        #pdfUploadInput {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            opacity: 0;
            cursor: pointer;
            z-index: 10;
        }
        .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;
        }
        .ad-container {
            margin: 20px 0;
            text-align: center;
        }
        .merge-seo-intro { opacity: 0.82; line-height: 1.7; }
        .upload-secure-note { pointer-events: none; user-select: none; }
        .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; }
        .merge-sidebar-body { padding: 16px 18px 20px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
        .merge-sidebar-footer { flex-shrink: 0; padding: 8px 18px 4px; border-top: 1px solid #eee; background: #fff; }
        .merge-sidebar-section { margin-bottom: 1rem; }
        .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-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; }
        .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, #dee2e6); 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; cursor: pointer; }
        .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, #dee2e6); max-width: 42rem; margin-left: auto; margin-right: auto; }
        .upload-pick-wrap {
            display: flex;
            align-items: 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;
        }
        /* صف «إضافة المزيد» داخل شريط المعاينة فقط */
        .files-bar .additional-upload-row {
            display: inline-flex;
            gap: 8px;
            justify-content: center;
            align-items: center;
            margin: 0;
            padding: 0;
            flex-shrink: 1;
            flex-wrap: wrap;
            background: transparent;
            border: none;
            border-radius: 0;
            width: auto;
            max-width: 100%;
            box-sizing: border-box;
        }

        
        

        /* Editor section */
        .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;
        }
        .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;
            /* تحت الشريط العلوي وليس فوقه (لا يُضاهي z-index الـ navbar) */
            position: relative;
            z-index: 1;
            overflow: hidden;
            min-height: 0;
            height: 100%;
        }
        .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;
        }
        .sidebar-body {
            padding: 16px 18px 20px;
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            overscroll-behavior-y: contain;
            scrollbar-gutter: stable;
        }
        .sidebar > .p-3 { flex-shrink: 0; }
        .sidebar-body .option__panel__content { overflow: visible; }
        .reset-btn {
            background: #f0f0f0;
            border: 1px solid #ddd;
            color: #333;
            width: 100%;
            padding: 10px;
            margin-top: 15px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: 0.2s;
        }
        .reset-btn:hover {
            background: #e0e0e0;
            border-color: #000;
        }
        .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;
        }
        #filePages {
            min-width: 0;
            width: 100%;
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            overflow-y: auto;
            overflow-x: hidden;
            overscroll-behavior-y: contain;
            padding-top: 16px;
            gap: 0;
        }
        #filePages .ad-container {
            margin: 0;
            padding: 0;
            width: 100%;
        }
        /* معاينة مثل أداة الدمج: حاوية + شبكة بطاقات */
        #draw-area.pdf-viewer-container,
        html.itqan-editor-active #draw-area.pdf-viewer-container {
            border: none;
            border-radius: 0;
            background: transparent;
            max-height: none;
            overflow: visible;
            padding: 25px;
            width: 100%;
            box-sizing: border-box;
        }
        #draw-area .pdf-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 30px;
            margin-bottom: 15px;
        }
        html.itqan-editor-active #draw-area .pdf-grid {
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            justify-content: center;
            justify-items: center;
        }
        html.itqan-editor-active #draw-area .pdf-thumbnail-wrapper {
            width: 100%;
            max-width: 240px;
        }
        @media (max-width: 1199.98px) {
            html.itqan-editor-active #draw-area .pdf-grid {
                grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
            }
        }
        @media (max-width: 576px) {
            html.itqan-editor-active #draw-area .pdf-grid {
                grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
            }
        }
        #draw-area .pdf-thumbnail-wrapper {
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: transform 0.3s ease;
            cursor: default;
            padding: 10px;
            border-radius: 8px;
            background: white;
            border: 2px solid transparent;
            box-sizing: border-box;
        }
        #draw-area .pdf-thumbnail-wrapper:hover {
            border-color: #dee2e6;
            background: #f8f9fa;
        }
        #draw-area .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;
        }
        #draw-area .pdf-thumbnail.landscape {
            aspect-ratio: 11 / 8.5;
            min-height: 160px;
        }
        #draw-area .pdf-thumbnail-wrapper.landscape-card .pdf-thumbnail.landscape {
            min-height: 140px;
        }
        #draw-area .pdf-thumbnail:hover {
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
            border-color: #000;
        }
        #draw-area .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;
        }
        #draw-area .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;
        }
        /* بقايا أنماط الصفحة القديمة (غير مستخدمة في المعاينة الجديدة) */
        .tool-file-pages {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: flex-start;
            align-content: flex-start;
            gap: 16px 20px;
            width: 100%;
            max-width: 100%;
            margin: 0 auto;
            box-sizing: border-box;
            padding: 8px 12px 24px;
        }
        .tool-file-pages.mode-facing {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            max-width: 100%;
        }
        .tool-file-pages.mode-facing .facing-page {
            display: flex;
            flex-direction: row;
            align-items: flex-end;
            justify-content: center;
            gap: 2px;
            background: #dedede;
            padding: 8px 12px 10px;
            border-radius: 8px;
            box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
        }
        .tool-file-pages.mode-facing .facing-page--single {
            justify-content: center;
        }
        .page-facing-spacer {
            visibility: hidden;
            pointer-events: none;
            width: var(--pn-thumb-w, 220px);
            max-width: 100%;
            aspect-ratio: 210 / 297;
        }
        .page {
            background: white;
            padding: 0;
            margin: 0;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid #dee2e6;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            flex: 0 0 auto;
        }
        .page:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
            border-color: #000;
        }
        .page__container {
            position: relative;
            line-height: 0;
            background: #fff;
            box-shadow: none;
        }
        .page__element {
            line-height: 0;
        }
        .page__canvas {
            position: relative;
            line-height: 0;
        }
        .page__canvas canvas {
            width: 100%;
            height: auto;
            display: block;
            vertical-align: top;
        }
        .file__bullet {
            position: absolute;
            width: 18px;
            height: 18px;
            background-color: #000000;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: auto;
            cursor: pointer;
            z-index: 10;
            box-shadow: 0 0 0 2px #ffffff;
        }
        .file__bullet:hover {
            transform: translate(-50%, -50%) scale(1.15);
            background-color: #222222;
        }
        .btn-finish {
            background: #000;
            color: white;
            width: 100%;
            border: none;
            padding: 15px;
            font-size: 20px;
            font-weight: bold;
            border-radius: 8px;
            cursor: pointer;
        }
        .option-group { margin-bottom: 1.5rem; }
        .option-label { font-weight: 600; margin-bottom: 0.5rem; display: block; font-size: 0.9rem; }
        .option__tab__select { list-style:none; display:flex; gap:8px; padding:0; margin:0; }
        .option__tab__select__item {
            flex: 1;
            text-align: center;
            border: 1px solid #d7d7dc;
            border-radius: 12px;
            padding: 12px 10px;
            cursor: pointer;
            background: #fff;
            transition: all .18s ease;
        }
        .option__tab__select__item:hover {
            border-color: #bfc3ca;
            transform: translateY(-1px);
        }
        .option__tab__select__item.option--active {
            border-color: #111;
            box-shadow: inset 0 0 0 1px #111;
            background: #f8f8f9;
        }
        .wm-mode-icon {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            margin: 0 auto 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f1f3f6;
            color: #222;
            font-size: 19px;
        }
        .option__tab__select__item.option--active .wm-mode-icon {
            background: #111;
            color: #fff;
        }
        .option__image__item__title {
            font-weight: 700;
            font-size: 13px;
        }
        .radio-group { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.5rem; }
        .position-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            max-width: 180px;
            margin-top: 10px;
        }
        .pos-cell {
            background: #f5f5f5;
            border: 1px solid #ddd;
            border-radius: 4px;
            aspect-ratio: 1 / 1;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }
        .pos-cell.active {
            background: #e5322d;
            border-color: #e5322d;
        }
        .pos-cell.active::after {
            content: "●";
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-size: 18px;
        }
        .format-toolbar {
            display: flex;
            gap: 10px;
            margin: 10px 0;
            flex-wrap: wrap;
            align-items: center;
        }
        .format-btn {
            background: #f0f0f0;
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 6px 10px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .format-btn.active {
            background: #e5322d;
            color: white;
            border-color: #e5322d;
        }
        /* شريط تنسيق واحد — القوائم تنفتح للأعلى (fixed) */
        .pn-text-format-stack {
            width: 100%;
            margin-bottom: 14px;
            padding: 10px 8px 12px;
            border-bottom: 1px solid #eee;
            box-sizing: border-box;
            background: linear-gradient(180deg, #ffffff 0%, #fff9f9 100%);
            border-radius: 10px;
            position: relative;
            overflow: visible;
        }
        .pn-text-format-heading-row {
            margin-bottom: 6px;
        }
        .pn-text-format-tools-row {
            display: flex;
            align-items: center;
            min-width: 0;
            width: 100%;
        }
        .pn-text-format-heading {
            margin: 0 !important;
            display: block;
            white-space: nowrap;
            line-height: 1.25;
            font-weight: 700;
            font-size: 13px;
            color: #161616;
        }
        .pn-editor-toolbar.editor__toolbar__options {
            flex: 1 1 auto;
            min-width: 0;
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            gap: 2px 4px;
            margin: 0;
            padding: 0;
            border: none;
            overflow-x: visible;
            overflow-y: visible;
            justify-content: flex-start;
        }
        .pn-editor-toolbar .editor__toolbar__block {
            display: contents;
        }
        .pn-editor-toolbar .editor__toolbar__option.pn-pop-anchor {
            position: relative;
            display: inline-flex;
            align-items: center;
            flex: 0 0 auto;
            align-self: center;
            overflow: visible;
        }
        .pn-editor-toolbar .pn-pop-anchor--font {
            flex: 0 1 auto;
            min-width: 0;
        }
        .pn-toolbar-trigger {
            border: none;
            background: transparent;
            padding: 4px 3px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 3px;
            color: #161616;
            font-size: 13px;
            border-radius: 6px;
            transition: background 0.15s ease;
            white-space: nowrap;
            max-width: 100px;
            min-width: 0;
        }
        #pnFontTrigger {
            max-width: 86px;
            flex: 0 1 86px;
        }
        #pnFontLabel {
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }
        .pn-toolbar-trigger:hover {
            background: rgba(0, 0, 0, 0.06);
        }
        .pn-toolbar-trigger[aria-expanded="true"] {
            background: rgba(0, 0, 0, 0.08);
        }
        .pn-toolbar-chevron {
            font-size: 9px;
            opacity: 0.85;
            flex-shrink: 0;
        }
        .pn-toolbar-trigger.pn-tt-trigger {
            padding: 4px 4px;
            max-width: none;
        }
        .pn-color-trigger {
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            gap: 3px;
            max-width: none;
            padding: 3px 3px;
        }
        .pn-color-trigger .pn-fontcolor-bar {
            display: none;
            height: 3px;
            width: 18px;
            min-width: 18px;
            flex-shrink: 0;
            border-radius: 1px;
            background: #161616;
            pointer-events: none;
        }
        /* نوافذ منبثقة للأعلى — position يُضبط بـ JS */
        .pn-toolbar-popover {
            display: none;
            position: fixed;
            z-index: 10060;
            background: #ffffff;
            border-radius: 10px;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
            border: 1px solid #ececec;
            padding: 0;
            max-height: min(320px, 70vh);
            overflow: hidden;
        }
        .pn-toolbar-popover.is-open {
            display: block;
        }
        .pn-toolbar-popover--font {
            min-width: 200px;
            max-width: min(280px, 92vw);
            overflow-y: auto;
        }
        .pn-font-item {
            display: block;
            width: 100%;
            text-align: right;
            padding: 10px 14px;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 14px;
            color: #161616;
            transition: background 0.12s ease;
        }
        .pn-font-item:hover,
        .pn-font-item.is-active {
            background: #f3f3f3;
        }
        .pn-toolbar-popover--size {
            padding: 14px 16px;
        }
        .pn-size-popover-inner {
            display: flex;
            align-items: center;
            gap: 14px;
            direction: ltr;
            min-width: 240px;
        }
        .pn-fs-num {
            width: 56px;
            padding: 8px 6px;
            border: 1px solid #ccc;
            border-radius: 8px;
            font-size: 14px;
            text-align: center;
        }
        .pn-fs-range-popover {
            flex: 1 1 auto;
            min-width: 100px;
            height: 28px;
            accent-color: #2196f3;
            cursor: pointer;
            background: linear-gradient(90deg, #e5322d 0%, #e5322d 100%);
            background-size: 100% 6px;
            background-position: center;
            background-repeat: no-repeat;
            border-radius: 4px;
        }
        .pn-toolbar-popover--color {
            padding: 12px 14px 14px;
            width: min(280px, 92vw);
        }
        .pn-color-popover-head {
            font-size: 12px;
            font-weight: 600;
            color: #444;
            margin-bottom: 10px;
            text-align: start;
        }
        .pn-color-grid {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: 6px;
        }
        .pn-color-swatch {
            width: 100%;
            aspect-ratio: 1;
            max-width: 26px;
            margin: 0 auto;
            border-radius: 4px;
            border: 1px solid rgba(0, 0, 0, 0.12);
            cursor: pointer;
            padding: 0;
            transition: transform 0.1s ease, box-shadow 0.1s ease;
        }
        .pn-color-swatch:hover {
            transform: scale(1.08);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        .pn-color-swatch.is-selected {
            outline: 2px solid #161616;
            outline-offset: 1px;
        }
        .pn-editor-toolbar .editor__toolbar__fmt-btn {
            border: none;
            background: transparent;
            padding: 3px 4px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 24px;
            flex-shrink: 0;
            border-radius: 4px;
            transition: background 0.15s ease;
        }
        .pn-editor-toolbar .editor__toolbar__fmt-btn:hover {
            background: rgba(0, 0, 0, 0.05);
        }
        .pn-editor-toolbar .editor__toolbar__fmt-btn.active svg path,
        .pn-editor-toolbar .editor__toolbar__fmt-btn.active svg polygon {
            fill: var(--brand-red);
        }
        .pn-fmt-letter {
            font-family: Georgia, 'Times New Roman', serif;
            font-size: 15px;
            color: #161616;
            line-height: 1;
            display: inline-block;
            user-select: none;
        }
        .pn-fmt-letter--bold {
            font-weight: 800;
            font-style: normal;
        }
        .pn-fmt-letter--italic {
            font-style: italic;
            font-weight: 600;
        }
        .pn-fmt-letter--underline {
            font-weight: 700;
            font-style: normal;
            text-decoration: underline;
            text-underline-offset: 3px;
        }
        .pn-editor-toolbar .editor__toolbar__fmt-btn.active .pn-fmt-letter {
            color: var(--brand-red);
        }
        .pn-editor-toolbar .pn-toolbar-fontcolor {
            margin-inline-start: 0;
            align-self: center;
            flex-shrink: 0;
        }
        .pn-editor-toolbar .editor__toolbar__option.pn-pop-anchor:not(.pn-pop-anchor--font) {
            flex-shrink: 0;
        }
        .pn-color-trigger svg {
            pointer-events: none;
            display: block;
        }
        .pn-format-advanced {
            margin-top: 4px;
        }
        .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; }
        .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: "×"; }

        .tool-inline-note {
            font-size: 12px;
            color: #6c757d;
            margin-top: 6px;
            line-height: 1.4;
        }

        .two-col {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .two-col > * { min-width: 0; }

        /* تخطيط الشريط الجانبي */
        .option__panel__title {
            font-weight: 700;
            font-size: 16px;
            margin-bottom: 14px;
        }
        .option__panel__content {
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }
        .option__panel__content:last-child { border-bottom: 0; }
        .wm-hidden { display: none !important; }
        .wm-image-picker {
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;
        }
        .wm-file-input {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        .wm-file-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px 16px;
            border-radius: 10px;
            border: 1px solid #d5d5d5;
            background: #f8f8f8;
            color: #1f1f1f;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all .15s ease;
        }
        .wm-file-btn:hover {
            background: #efefef;
            border-color: #bfbfbf;
            transform: translateY(-1px);
        }
        .wm-file-name {
            font-size: 12px;
            color: #666;
            line-height: 1.4;
            word-break: break-word;
        }
        [data-wm-mode] { display: none; }
        [data-wm-mode].wm-mode-active { display: block; }
        .options { display: flex; flex-direction: column; }
        #wm-tabs-block { order: 1; }
        #wm-mode-input-block { order: 2; }
        #wm-text-format-block { order: 3; }
        #wm-position-block { order: 4; }
        #wm-pages-block { order: 5; }
        #wm-adjustments-block { order: 6; }
        #wm-layer-block { order: 7; }
        .form__group { margin-bottom: 12px; }
        .form__group label { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: block; }
        .option__title { font-weight: 700; font-size: 13px; margin: 0 0 8px 0; color: #222; }
        .wm-text-divider {
            height: 1px;
            background: #d8d8dd;
            margin-top: 10px;
        }
        .radio-list .radio { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
        .radio-list input[type="radio"] { transform: scale(1.05); }
        .checkbox { transform: scale(1.05); }
        .form__group--boxed {
            border: 1px solid #e6e6e6;
            border-radius: 10px;
            padding: 10px 12px;
            background: #fff;
            min-width: 0;
            box-sizing: border-box;
        }
        .form__group--boxed label { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
        .form__group--boxed .input {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }
        .form__group__container {
            display: flex;
            align-items: stretch;
            gap: 10px;
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }
        .form__group__container > .form__group--boxed {
            flex: 1 1 0;
            min-width: 0;
        }
        /* English UI: keep Western digits (123), not Arabic-Indic (١٢٣) */
        html[lang="en"] .pn-latin-digits,
        html[lang="en"] #pageFrom,
        html[lang="en"] #pageTo {
            font-family: Arial, "Segoe UI", Tahoma, sans-serif !important;
            font-feature-settings: "locl" 0;
            font-variant-numeric: lining-nums;
            -webkit-locale: "en";
            direction: ltr;
            unicode-bidi: isolate;
        }
        .input, .form-select, .form-control {
            border-radius: 10px;
        }
        .wm-range {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 8px;
            border-radius: 999px;
            background: linear-gradient(90deg, #8fb8c6 0%, #e5322d 100%);
            outline: none;
            border: 0;
            box-shadow: none;
        }
        .wm-range::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #ffffff;
            border: 2px solid #4f4f4f;
            cursor: pointer;
            box-shadow: 0 1px 4px rgba(0,0,0,.25);
        }
        .wm-range::-moz-range-track {
            height: 8px;
            border: 0;
            border-radius: 999px;
            background: linear-gradient(90deg, #8fb8c6 0%, #e5322d 100%);
        }
        .wm-range::-moz-range-thumb {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #ffffff;
            border: 2px solid #4f4f4f;
            cursor: pointer;
            box-shadow: 0 1px 4px rgba(0,0,0,.25);
        }
        .option__page {
            width: 130px;
            height: 130px;
            border: 1px solid #d9d9d9;
            border-radius: 10px;
            background: #fff;
            padding: 10px;
            display: grid;
            grid-template-rows: repeat(3, 1fr);
            gap: 6px;
        }
        .option__page__row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }
        .option__page__position {
            border: 1px solid #e2e2e2;
            border-radius: 8px;
            background: #f7f7f7;
            cursor: pointer;
            position: relative;
            transition: transform .12s ease, border-color .12s ease, background .12s ease;
        }
        .option__page__position:hover { transform: scale(1.03); border-color: #cfcfcf; }
        .option__page__position.option--active {
            background: #000000;
            border-color: #000000;
        }
        .option__page__position.option--active::after {
            content: "●";
            position: absolute;
            inset: 0;
            display: grid;
            place-items: center;
            color: #fff;
            font-size: 16px;
        }

        /* الموقع + الهامش: بدون صف Bootstrap داخل الشريط الضيق (يتسبب بتداخل) */
        .panel-position-margin {
            display: flex;
            flex-direction: column;
            gap: 22px;
            width: 100%;
        }
        .panel-position-margin__block {
            width: 100%;
            min-width: 0;
        }
        .panel-position-margin__block .option__page {
            margin-top: 4px;
        }
        .panel-position-margin__block select.input {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            margin-top: 4px;
        }

        /* شريط الملفات — خلفية واحدة مع المعاينة، بلا حدود على الشريط */
        .files-bar {
            flex-shrink: 0;
            padding: 10px 12px 12px;
            background: var(--viewer-surface);
            border-bottom: none;
        }
        .files-bar__inner {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center;
            gap: 6px 10px;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
        }
        .files-bar .files-bar__cloud {
            margin: 0 !important;
            padding: 0;
            flex: 0 1 auto;
            max-width: 100%;
            min-width: 0;
            justify-content: center;
            gap: 6px;
        }
        /* دوائر كأداة الدمج (معاينة الملفات) */
        .files-bar .cloud-upload-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid #dee2e6;
            background: #ffffff;
            transition: all 0.3s;
            cursor: pointer;
            padding: 0;
            box-shadow: none;
        }
        .files-bar .cloud-upload-btn:hover {
            background: #d4d4d4;
            border-color: #111111;
            transform: scale(1.08);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
        }
        .files-bar .cloud-icon {
            position: relative;
            display: inline-block;
            z-index: 101;
        }
        .files-bar .cloud-tooltip {
            z-index: 1200;
            pointer-events: none;
            white-space: nowrap;
        }
        .files-bar .cloud-icon:hover .cloud-tooltip {
            visibility: visible;
            opacity: 1;
        }
        .files-bar .cloud-icon .cloud-upload-btn {
            pointer-events: auto;
        }
        .files-bar .files-bar__cloud .text-muted {
            color: #5a5a5a !important;
        }
        .files-bar .file-pill {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            background: #ffffff;
            border: 1px solid #e0e0e0;
            border-radius: 999px;
            padding: 6px 14px 6px 10px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
            min-width: 260px;
        }
        .files-bar .file-pill__select {
            flex: 1;
            border: none;
            background: transparent;
            font-size: 14px;
            outline: none;
            text-align: right;
            direction: rtl;
            min-width: 0;
            cursor: pointer;
        }
        .files-bar .file-pill__delete {
            background: transparent;
            border: none;
            color: #6c757d;
            font-size: 16px;
            cursor: pointer;
            padding: 4px 6px;
            border-radius: 6px;
            transition: color 0.2s, background 0.2s;
        }
        .files-bar .file-pill__delete:hover {
            color: #dc3545;
            background: #f8d7da33;
        }
        .files-bar .add-more-btn {
            background: #ffffff;
            border: 1px dashed #c0c0c0;
            color: #444;
            border-radius: 999px;
            padding: 6px 14px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
        }
        .files-bar .add-more-btn:hover {
            background: #f5f5f5;
            border-color: #888;
        }


        @media (max-width: 768px) {
            .upload-pick-wrap {
                transform: none;
            }
        }

        .tr-panel-title-row {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }
        .tr-panel-title-row > span:last-child {
            font-weight: 700;
            font-size: 1.05rem;
        }
        .badge--ai-soft {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: linear-gradient(135deg, #f0ebff 0%, #e8e0ff 100%);
            color: #5a3dc7;
            border: 1px solid #d4c4f5;
            border-radius: 999px;
            padding: 4px 12px;
            font-size: 12px;
            font-weight: 600;
        }
        .tr-info-note {
            font-size: 12px;
            color: #555;
            line-height: 1.5;
            margin-bottom: 14px;
            padding: 10px 12px;
            background: #f6f7f9;
            border-radius: 8px;
            border: 1px solid #e8e8e8;
        }
        /* اختيار لغات بند مضغوط (مشابه لـ Itqan Tools): قائمتان منسدلتان + تبديل */
        .tr-lang-pair {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            gap: 8px 6px;
            align-items: end;
            margin-bottom: 6px;
        }
        .tr-lang-field {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .tr-lang-label {
            font-size: 12px;
            font-weight: 700;
            color: #333;
            margin: 0;
        }
        .tr-lang-select {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            padding: 10px 32px 10px 12px;
            font-size: 14px;
            line-height: 1.35;
            border-radius: 10px;
            border: 1px solid #c8c8c8;
            background-color: #fff;
            color: #111;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23444' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: max(12px, 100% - 14px) 50%;
        }
        html[dir="rtl"] .tr-lang-select {
            padding: 10px 12px 10px 32px;
            background-position: 14px 50%;
        }
        .tr-lang-select:focus {
            outline: none;
            border-color: #7253e2;
            box-shadow: 0 0 0 2px rgba(114, 83, 226, 0.2);
        }
        .tr-lang-detect {
            margin: 8px 0 10px;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid #e0d4ff;
            background: #f7f3ff;
            color: #3d2d6b;
            font-size: 13px;
            line-height: 1.45;
        }
        .tr-lang-detect--mixed {
            border-color: #c8e6d9;
            background: #f0faf4;
            color: #1e4d36;
        }
        .tr-lang-detect__actions {
            margin-top: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .tr-lang-detect__btn {
            border: 0;
            border-radius: 8px;
            padding: 6px 12px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            background: #7253e2;
            color: #fff;
        }
        .tr-swap-btn {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            border: 1px solid #c8c8c8;
            background: #f5f5f5;
            color: #333;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            margin-bottom: 2px;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .tr-swap-btn:hover {
            background: #7253e2;
            border-color: #7253e2;
            color: #fff;
        }
        @media (max-width: 360px) {
            .tr-lang-pair {
                grid-template-columns: 1fr;
                justify-items: stretch;
            }
            .tr-swap-btn {
                width: 100%;
                margin-bottom: 0;
            }
        }
        .tr-model-selector {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .tr-radio-card {
            border: 1px solid #dadada;
            border-radius: 12px;
            overflow: hidden;
            background: #fff;
        }
        .tr-radio-card input.tr-sr-only {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }
        .tr-radio-card label {
            display: block;
            margin: 0;
            padding: 12px 14px;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
            border: 2px solid transparent;
            box-sizing: border-box;
        }
        .tr-radio-card input:checked + label {
            background: #f6f2ff;
            border-color: #7253e2;
            box-shadow: none;
        }
        .tr-card-title {
            font-weight: 700;
            font-size: 14px;
            color: #222;
        }
        .tr-card-desc {
            font-size: 12px;
            color: #555;
            margin-top: 6px;
            line-height: 1.45;
        }
        .tr-section-title {
            font-weight: 700;
            font-size: 13px;
            margin: 16px 0 10px;
            color: #333;
        }
        .tr-ai-note {
            margin: 0;
            padding: 10px 14px 12px;
            font-size: 12px;
            line-height: 1.5;
            color: #555;
            border-bottom: 1px solid #ececec;
            background: #fafafa;
        }
        .tr-info-box {
            font-size: 0.82rem;
            color: #555;
            background: #f8f9fa;
            border-radius: 8px;
            padding: 0.65rem 0.75rem;
            line-height: 1.55;
            margin: 10px 14px 0;
        }

        /* شريط الخيارات — عرض ثابت ولا ينهار عند تغيير وضع الترجمة (نص فقط / تنسيق) */
        html.itqan-editor-active #editor-section.main-editor {
            display: flex !important;
            flex-direction: row;
            align-items: stretch;
            flex-wrap: nowrap;
        }
        #editor-section .sidebar {
            width: var(--sidebar-width) !important;
            min-width: var(--sidebar-width) !important;
            max-width: var(--sidebar-width) !important;
            flex: 0 0 var(--sidebar-width) !important;
            flex-shrink: 0 !important;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: 0;
            height: 100%;
            box-sizing: border-box;
        }
        html[dir="rtl"] #editor-section .sidebar {
            border-left: none;
            border-right: 1px solid #ddd;
        }
        html[dir="ltr"] #editor-section .sidebar {
            border-right: none;
            border-left: 1px solid #ddd;
        }
        #editor-section .sidebar .merge-sidebar-body,
        #editor-section .sidebar .sidebar-body {
            display: flex;
            flex-direction: column;
            gap: 12px;
            flex: 1 1 auto;
            min-height: 0;
            min-width: 0;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            overflow-x: hidden;
            overflow-y: auto;
        }
        #editor-section .sidebar > .merge-sidebar-footer {
            flex-shrink: 0;
            margin-top: auto;
            padding: 8px 18px 4px;
            border-top: 1px solid #eee;
            background: #fff;
            z-index: 2;
        }
        #editor-section .sidebar > .p-3 {
            flex-shrink: 0;
        }
        #editor-section .sidebar .options,
        #editor-section .sidebar .option__panel,
        #editor-section .sidebar .option__panel__content,
        #editor-section .sidebar .tr-model-selector,
        #editor-section .sidebar .tr-lang-pair-wrap {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }
        #editor-section .viewer-container {
            flex: 1 1 auto;
            min-width: 0;
            min-height: 0;
        }
        .tr-radio-card {
            position: relative;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
        }
        .tr-radio-card label {
            width: 100%;
            box-sizing: border-box;
        }

        @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;
                min-height: auto !important;
                max-height: none !important;
            }
            html.itqan-editor-active #editor-section.main-editor {
                position: relative !important;
                flex-direction: column !important;
                height: auto !important;
                min-height: 0 !important;
                max-height: none !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-width: 100% !important;
                max-height: none !important;
                height: auto !important;
                flex: none !important;
                border-left: none !important;
                border-right: none !important;
                border-bottom: 1px solid #ddd;
            }
            #editor-section .sidebar .merge-sidebar-body {
                padding: 12px 16px !important;
                overflow: visible !important;
                max-height: none !important;
                height: auto !important;
            }
            .viewer-container {
                order: 2 !important;
                width: 100% !important;
                height: auto !important;
                min-height: 50vh;
                overflow: visible !important;
                padding: 8px 6px 20px 6px !important;
            }
            .files-bar {
                padding: 8px 10px;
            }
            .files-bar__inner {
                justify-content: center;
            }
            .files-bar .file-pill {
                min-width: 0 !important;
                max-width: 100%;
                flex: 1 1 100%;
            }
            .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);
            }
            .main-editor .p-3 .btn-finish {
                padding: 14px;
                font-size: 16px;
                border-radius: 10px;
            }
            .two-col {
                grid-template-columns: 1fr;
            }
            html.itqan-editor-active .tool-seo-visible-wrap,
            html.itqan-editor-active .merge-seo-content {
                display: none !important;
            }
        }
        #pdfTranslatePageHeader .display-5 { font-size: clamp(1.75rem, 3.5vw, 2.15rem); margin-bottom: 0.15rem !important; line-height: 1.2; }
        #pdfTranslatePageHeader .lead { margin-bottom: 0; font-size: 0.98rem; line-height: 1.3; }
        /* مربع الرفع — نهائي: مطابق merge_pdf */
        #upload-section #dropArea.upload-area,
        #upload-section #dropArea.card.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-color: #f8f9fa !important;
            background: #f8f9fa !important;
            border: 2px dashed #ced4da !important;
        }
        @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 #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%;
            background: transparent !important;
        }
        #upload-section #dropArea .upload-row-wrap {
            overflow: visible !important;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .container.my-5 { margin-top: 1rem !important; margin-bottom: 2rem !important; }
        #adContainer { margin: 20px 0; text-align: center; overflow: hidden; max-width: 100%; }
        #adContainer ins.adsbygoogle { display: block !important; width: min(100%, 728px) !important; max-width: 100% !important; margin-left: auto !important; margin-right: auto !important; }
        @media (max-width: 768px) { .upload-pick-wrap { transform: none; } }
        .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);
        }
