:root {
      --bg-primary: #fcfbf9;
      --bg-secondary: #ffffff;
      --bg-tertiary: #f8fafc;
      --border-primary: #e2e8f0;
      --border-accent: #d97706;
      --text-primary: #0f172a;
      --text-secondary: #334155;
      --text-muted: #64748b;
      --accent: #b45309;
      --accent-hover: #92400e;
      --accent-glow: rgba(20, 184, 166, 0.3);
      --blue: #3b82f6;
      --violet: #8b5cf6;
      --red: #ef4444;
      --amber: #f59e0b;
    }
    * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', 'Inter', sans-serif; }
    html {
      height: 100% !important;
    }
    body {
      background: var(--bg-primary);
      color: var(--text-primary);
      min-height: 100% !important;
      min-height: 100vh !important;
      min-height: 100dvh !important;
      display: flex !important;
      flex-direction: column !important;
      overflow-x: hidden;
      margin: 0 !important;
    }
    main, #main-content, .main-content, [role="main"] {
      flex: 1 0 auto !important;
    }

    /* Navigation */
    .nav-glass { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255,255,255,0.06); }
    .nav-inner { max-width: 1600px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
    .nav-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: white; }
    .nav-brand-icon { width: 34px; height: 34px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
    .nav-brand-text { font-size: 18px; font-weight: 800; }
    .nav-links { display: flex; align-items: center; gap: 12px; }
    .nav-links a { color: var(--text-secondary); font-size: 13px; font-weight: 600; text-decoration: none; transition: color 0.2s; }
    .nav-links a:hover { color: white; }

    /* Hero */
    .hero-section { background: linear-gradient(135deg, #020617 0%, #1e1b4b 50%, #020617 100%); padding: 80px 16px 24px; text-align: center; }
    .hero-icon { width: 56px; height: 56px; background: rgba(20,184,166,0.15); border: 1px solid rgba(20,184,166,0.3); border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
    .hero-title { font-size: 28px; font-weight: 900; margin-bottom: 8px; }
    .hero-sub { color: var(--text-secondary); font-size: 15px; max-width: 700px; margin: 0 auto; }

    /* Drop Zone */
    .drop-zone { border: 2px dashed var(--border-accent); border-radius: 16px; padding: 48px 24px; text-align: center; cursor: pointer; background: var(--bg-secondary); transition: all 0.3s; max-width: 700px; margin: 24px auto; }
    .drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-hover); background: rgba(20, 184, 166, 0.06); transform: translateY(-2px); }
    .drop-zone-icon { font-size: 56px; margin-bottom: 16px; }
    .drop-zone h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
    .drop-zone p { color: var(--text-muted); font-size: 14px; }
    .drop-zone-btn { background: var(--accent); color: white; border: none; padding: 12px 32px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 16px; transition: all 0.3s; }
    .drop-zone-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }

    /* Editor Workspace */
    #editorWorkspace { display: none; }
    #editorWorkspace.active { display: block; }

    /* Top Action Bar */
    .action-bar { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
    .action-bar-info { display: flex; align-items: center; gap: 10px; }
    .action-bar-icon { width: 32px; height: 32px; background: rgba(20,184,166,0.15); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
    .action-bar-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .ab-btn { background: var(--bg-tertiary); border: 1px solid var(--border-primary); color: var(--text-secondary); padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
    .ab-btn:hover { border-color: var(--text-muted); color: white; }
    .ab-btn.danger { border-color: rgba(239,68,68,0.3); color: #f87171; background: rgba(239,68,68,0.08); }
    .ab-btn.danger:hover { background: rgba(239,68,68,0.15); }
    .ab-btn.primary { background: linear-gradient(135deg, #3b82f6, #8b5cf6); border: none; color: white; padding: 8px 20px; font-weight: 800; font-size: 13px; }
    .ab-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.4); }

    /* Main Layout Grid */
    .editor-grid { display: grid; grid-template-columns: 320px 1fr; gap: 12px; align-items: start; }
    @media (max-width: 1024px) { .editor-grid { grid-template-columns: 1fr; } }

    /* Sidebar */
    .sidebar { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 14px; padding: 14px; max-height: 84vh; overflow-y: auto; }
    .sidebar-section { margin-bottom: 16px; }
    .sidebar-label { color: white; font-size: 12px; font-weight: 700; margin-bottom: 8px; display: block; }
    .sidebar-sublabel { color: var(--text-muted); font-size: 11px; margin-bottom: 6px; display: block; }

    /* Tool Grid */
    .tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .tool-btn { border: 1px solid var(--border-primary); border-radius: 8px; padding: 7px 4px; cursor: pointer; transition: all 0.2s; font-size: 11px; font-weight: 700; text-align: center; background: var(--bg-primary); color: var(--text-secondary); line-height: 1.3; }
    .tool-btn.active { border-color: var(--accent); background: rgba(20,184,166,0.15); color: #5eead4; box-shadow: 0 0 12px var(--accent-glow); }
    .tool-btn:hover:not(.active) { border-color: var(--text-muted); color: white; }
    .tool-btn .tool-icon { font-size: 16px; display: block; margin-bottom: 2px; }

    /* Form Inputs */
    .form-input { background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 8px; padding: 7px 10px; color: white; outline: none; font-size: 13px; width: 100%; transition: border-color 0.2s; }
    .form-input:focus { border-color: var(--accent); }
    .form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 8px center; background-size: 18px; padding-left: 28px; }

    /* Color Palette */
    .color-palette { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
    .color-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
    .color-swatch.active { border-color: white; transform: scale(1.2); box-shadow: 0 0 8px var(--accent-glow); }

    /* Font Preview */
    .font-preview { background: white; border-radius: 8px; padding: 8px 12px; text-align: center; overflow: hidden; border: 1px solid var(--border-primary); min-height: 38px; display: flex; align-items: center; justify-content: center; }

    /* Options Panel */
    .opts-panel { background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 10px; padding: 12px; }
    .opts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }

    /* Canvas Viewport */
    .viewport-container { background: #1e293b; border-radius: 14px; padding: 20px 10px; max-height: 84vh; overflow-y: auto; scroll-behavior: smooth; }
    .viewport-container::-webkit-scrollbar { width: 8px; }
    .viewport-container::-webkit-scrollbar-track { background: #1e293b; border-radius: 8px; }
    .viewport-container::-webkit-scrollbar-thumb { background: #475569; border-radius: 8px; }

    /* Page Wrapper */
    .page-wrapper { position: relative; margin: 0 auto 32px auto; box-shadow: 0 15px 40px rgba(0,0,0,0.5); border-radius: 6px; background: white; transition: width 0.15s, height 0.15s; }
    .page-pdf-canvas { display: block; width: 100%; height: 100%; border-radius: 6px; }
    .page-overlay-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair; border-radius: 6px; touch-action: none; z-index: 2; }
    .page-badge { position: absolute; top: -26px; right: 0; background: var(--bg-primary); border: 1px solid var(--border-primary); color: #38bdf8; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 6px; z-index: 5; }

    /* Text Layer - Interactive Editable Text Overlay */
    .text-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; overflow: hidden; pointer-events: none; }
    .text-layer.edit-mode { pointer-events: auto; cursor: text; }
    .text-layer .text-item { position: absolute; color: transparent; white-space: pre; transform-origin: 0% 0%; cursor: text; border: 1px solid transparent; transition: border-color 0.15s, background 0.15s; pointer-events: auto; padding: 1px 2px; border-radius: 2px; line-height: 1.0; }
    .text-layer .text-item:hover { border-color: rgba(20,184,166,0.4); background: rgba(20,184,166,0.05); }
    .text-layer .text-item.editing { color: inherit; background: rgba(255,255,255,0.95); border-color: var(--accent); box-shadow: 0 2px 12px rgba(20,184,166,0.3); z-index: 10; outline: none; border-radius: 3px; }
    .text-layer .text-item.modified { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.04); }
    .text-layer .text-item.search-match { background: rgba(250,204,21,0.35) !important; border-color: rgba(250,204,21,0.6) !important; }
    .text-layer .text-item.search-active { background: rgba(251,146,60,0.5) !important; border-color: #f97316 !important; }

    /* Floating Toolbar */
    .float-toolbar { position: fixed; z-index: 200; background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 12px; padding: 8px 12px; display: none; flex-wrap: wrap; align-items: center; gap: 8px; box-shadow: 0 12px 40px rgba(0,0,0,0.6); backdrop-filter: blur(12px); min-width: 320px; }
    .float-toolbar.visible { display: flex; }
    .ft-group { display: flex; align-items: center; gap: 4px; }
    .ft-sep { width: 1px; height: 24px; background: var(--border-primary); }
    .ft-btn { background: var(--bg-tertiary); border: 1px solid var(--border-primary); color: var(--text-secondary); width: 30px; height: 30px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; transition: all 0.15s; }
    .ft-btn:hover { border-color: var(--accent); color: white; }
    .ft-btn.active { background: rgba(20,184,166,0.2); border-color: var(--accent); color: #5eead4; }
    .ft-select { background: var(--bg-primary); border: 1px solid var(--border-primary); color: white; padding: 4px 6px; border-radius: 6px; font-size: 11px; outline: none; max-width: 110px; }
    .ft-input { background: var(--bg-primary); border: 1px solid var(--border-primary); color: white; padding: 4px 6px; border-radius: 6px; font-size: 12px; outline: none; width: 50px; text-align: center; }
    .ft-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-primary); cursor: pointer; }

    /* Find & Replace Panel */
    .find-panel { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 150; background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 14px; padding: 14px 18px; display: none; box-shadow: 0 12px 40px rgba(0,0,0,0.5); min-width: 400px; }
    .find-panel.visible { display: block; }
    .find-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .find-input { flex: 1; background: var(--bg-primary); border: 1px solid var(--border-primary); color: white; padding: 8px 12px; border-radius: 8px; font-size: 13px; outline: none; }
    .find-input:focus { border-color: var(--accent); }
    .find-btn { background: var(--bg-tertiary); border: 1px solid var(--border-primary); color: var(--text-secondary); padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
    .find-btn:hover { border-color: var(--accent); color: white; }
    .find-btn.accent { background: var(--accent); border-color: var(--accent); color: white; }
    .find-info { color: var(--text-muted); font-size: 11px; }

    /* Layers Panel */
    .layers-panel { max-height: 200px; overflow-y: auto; }
    .layer-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 11px; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
    .layer-item:hover { background: rgba(20,184,166,0.06); border-color: var(--border-primary); }
    .layer-item .layer-icon { font-size: 14px; }
    .layer-item .layer-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .layer-item .layer-del { color: #f87171; font-size: 12px; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
    .layer-item:hover .layer-del { opacity: 1; }

    /* Image Overlay */
    .img-overlay-box { position: absolute; border: 2px dashed var(--accent); cursor: move; user-select: none; z-index: 4; }
    .img-overlay-box .handle { position: absolute; width: 12px; height: 12px; background: var(--accent); border: 1px solid white; border-radius: 2px; }
    .img-overlay-box .handle.se { bottom: -6px; left: -6px; cursor: se-resize; }
    .img-overlay-box .del-btn { position: absolute; top: -10px; right: -10px; background: var(--red); color: white; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: bold; z-index: 5; }

    /* Progress */
    .progress-modal { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 16px; padding: 32px; text-align: center; max-width: 420px; margin: 40px auto; }
    .progress-bar-track { background: var(--bg-tertiary); border-radius: 999px; height: 10px; overflow: hidden; margin: 16px 0; }
    .progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #10b981); border-radius: 999px; transition: width 0.4s ease; }

    /* Info Box */
    .info-box { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #93c5fd; line-height: 1.6; }

    /* SEO Footer */
    .seo-footer { max-width: 900px; margin: 0 auto; padding: 40px 16px; }
    .seo-footer-box { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 14px; padding: 24px; }
    .seo-footer-box h2 { font-size: 22px; font-weight: 900; margin-bottom: 12px; }
    .seo-footer-box p { color: var(--text-secondary); line-height: 1.8; font-size: 14px; }

    /* Footer */
    .site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border-primary); padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
    .site-footer a { color: var(--blue); text-decoration: none; }

    /* Toast */
    .toast { position: fixed; bottom: 24px; right: 24px; background: var(--accent); color: white; padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 700; box-shadow: 0 8px 30px rgba(20,184,166,0.4); z-index: 300; animation: toastIn 0.3s ease; }
    @keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

    /* Responsive */
    @media (max-width: 768px) {
      .hero-title { font-size: 22px; }
      .editor-grid { grid-template-columns: 1fr; }
      .sidebar { max-height: none; }
      .float-toolbar { min-width: auto; left: 8px !important; right: 8px !important; }
      .find-panel { min-width: auto; left: 8px; right: 8px; transform: none; }
    }

    /* Ad Placeholder */
    .ad-placeholder { background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-primary)); border: 1px dashed var(--border-primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; }
  
    
    
    /* ==========================================================================
       ANUBIS PDF - MASTER LUXURY TWO-COLOR DESIGN SYSTEM (Pearl White & Gold)
       ========================================================================== */
    :root {
      --gold-primary: #b45309;
      --gold-dark: #92400e;
      --gold-light: #fef3c7;
      --gold-border: #fcd34d;
      --black-primary: #0f172a;
      --black-secondary: #334155;
      --bg-light: #fcfbf9;
    }

    html, body {
      background-color: #fcfbf9 !important;
      color: #0f172a !important;
      font-family: 'Cairo', sans-serif !important;
    }

    /* Hero Gradient in Luxury Gold & Pearl White */
    .hero-gradient, .hero-section {
      background: linear-gradient(135deg, #ffffff 0%, #fffbeb 40%, #fef3c7 80%, #fcfbf9 100%) !important;
      border-bottom: 1px solid #fde68a !important;
    }

    /* All Cards, Boxes, Panels - Crisp Pure White with Subtle Gold Hover */
    .tool-card, article.card-hover, 
    .bg-slate-950, .bg-slate-900, .bg-slate-850, .bg-slate-800, .bg-slate-700,
    .bg-slate-900\/60, .bg-slate-900\/50, .bg-slate-900\/40, .bg-slate-800\/50,
    .bg-slate-900\/80, .sidebar, .action-bar, .opts-panel, .file-card,
    #filesContainer > div, .card, .settings-panel, .modal-content,
    .bg-gray-900, .bg-gray-800 {
      background-color: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      color: #0f172a !important;
    }

    .tool-card:hover, article.card-hover:hover {
      transform: translateY(-4px) !important;
      border-color: #d97706 !important;
      box-shadow: 0 16px 32px -8px rgba(180, 83, 9, 0.16) !important;
    }

    /* Unified Glowing Tool Icon - High Contrast Gold */
    .tool-icon-bg {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
      border: 1.5px solid #fcd34d !important;
      color: #92400e !important;
      box-shadow: 0 2px 10px rgba(217, 119, 6, 0.18) !important;
    }
    .tool-icon-bg svg, .tool-card svg {
      color: #92400e !important;
      stroke: #92400e !important;
      stroke-width: 2.2 !important;
    }
    .tool-card:hover .tool-icon-bg {
      background: linear-gradient(135deg, #d97706 0%, #92400e 100%) !important;
      border-color: #92400e !important;
      box-shadow: 0 4px 14px rgba(180, 83, 9, 0.35) !important;
    }
    .tool-card:hover .tool-icon-bg svg {
      color: #ffffff !important;
      stroke: #ffffff !important;
    }

    /* Unified Badges & Pill Tags in Deep Gold */
    .bg-blue-500\/20, .bg-violet-500\/20, .bg-pink-500\/20, .bg-teal-500\/20, 
    .bg-emerald-500\/20, .bg-orange-500\/20, .bg-sky-500\/20, .bg-rose-500\/20,
    .bg-purple-500\/20, .bg-amber-500\/20, .bg-green-500\/20, .bg-red-500\/20,
    .bg-blue-500\/10, .bg-violet-500\/10, .bg-amber-500\/10, .bg-emerald-500\/10,
    .page-badge {
      background-color: #fef3c7 !important;
      border: 1px solid #fde68a !important;
      color: #92400e !important;
    }

    /* Typography - Deep Black & Crisp High Contrast */
    h1, h2, h3, h4, h5, h6, .text-white, .font-black, .font-bold {
      color: #0f172a !important;
    }
    p, span.text-slate-400, span.text-slate-500, .text-slate-300, .text-slate-400, .text-slate-500, label {
      color: #334155 !important;
    }
    .text-slate-600 {
      color: #64748b !important;
    }

    /* Card bottom link & accents in Deep Gold */
    .tool-card .flex span:first-child, .tool-card .border-t, 
    .text-amber-700, .text-amber-600, .text-amber-500, .text-brand-400, .text-brand-500 {
      color: #b45309 !important;
      font-weight: 700 !important;
    }
    .tool-card:hover .flex span:first-child {
      color: #78350f !important;
    }

    /* Luxury Gold Buttons & CTAs */
    .btn-primary, .btn-gold, .bg-blue-600, .bg-violet-500, .bg-violet-600, 
    .bg-indigo-600, .bg-emerald-600, .filter-tab.active, button.btn-primary, 
    #processBtn, .drop-zone-btn, .ab-btn.primary, .find-btn.accent,
    button[type="submit"]:not(.bg-transparent), .cta-button {
      background: linear-gradient(135deg, #d97706 0%, #b45309 50%, #92400e 100%) !important;
      color: #ffffff !important;
      border: none !important;
      box-shadow: 0 4px 14px rgba(180, 83, 9, 0.28) !important;
      font-weight: 700 !important;
    }
    .btn-primary:hover, .btn-gold:hover, .bg-blue-600:hover, .bg-violet-500:hover, 
    .bg-violet-600:hover, #processBtn:hover, .drop-zone-btn:hover, .ab-btn.primary:hover {
      background: linear-gradient(135deg, #b45309 0%, #78350f 100%) !important;
      transform: translateY(-2px) !important;
      box-shadow: 0 8px 22px rgba(180, 83, 9, 0.4) !important;
    }

    /* Filter Tabs & Secondary Buttons */
    .filter-tab, .ab-btn, .find-btn, .tool-btn {
      background-color: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      color: #334155 !important;
    }
    .filter-tab:hover, .ab-btn:hover, .find-btn:hover, .tool-btn:hover {
      border-color: #d97706 !important;
      color: #b45309 !important;
      background-color: #fffdf5 !important;
    }
    .filter-tab.active, .filter-tab.bg-blue-600, .tool-btn.active {
      background: linear-gradient(135deg, #d97706 0%, #92400e 100%) !important;
      color: #ffffff !important;
      border-color: #92400e !important;
    }

    /* Navigation Bar */
    nav.glass, .nav-glass {
      background: rgba(255, 255, 255, 0.96) !important;
      border-bottom: 1px solid #f1f5f9 !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    }
    nav a, .nav-links a {
      color: #334155 !important;
    }
    nav a:hover, .nav-links a:hover {
      color: #b45309 !important;
    }

    /* Drop Zone / Upload Box */
    .drop-zone, .border-dashed {
      border: 2px dashed #cbd5e1 !important;
      background-color: #ffffff !important;
      color: #0f172a !important;
      box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03) !important;
    }
    .drop-zone:hover, .border-dashed:hover, .drop-zone.dragover {
      border-color: #d97706 !important;
      background-color: #fffdf5 !important;
      box-shadow: 0 10px 25px -5px rgba(217, 119, 6, 0.1) !important;
    }

    /* Form Inputs, Selects, and Number Boxes */
    input[type="text"], input[type="password"], input[type="number"], 
    input[type="email"], select, textarea, .form-input, .form-select, 
    .ft-input, .ft-select, .find-input, .margin-block {
      background-color: #ffffff !important;
      color: #0f172a !important;
      border: 1px solid #cbd5e1 !important;
    }
    input:focus, select:focus, textarea:focus, .form-input:focus, .find-input:focus {
      border-color: #d97706 !important;
      box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15) !important;
      outline: none !important;
    }
    .margin-block {
      background-color: #ffffff !important;
      border: 1px solid #cbd5e1 !important;
    }
    .margin-label {
      color: #64748b !important;
    }

    /* Mega Menu and Dropdowns */
    .mega-menu, #langDropdown, .dropdown-menu, .float-toolbar, .find-panel {
      background-color: #ffffff !important;
      border: 1px solid #e2e8f0 !important;
      box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1) !important;
      color: #0f172a !important;
    }

    /* Ad Placeholder */
    .ad-placeholder {
      background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
      border: 1px dashed #cbd5e1 !important;
      color: #94a3b8 !important;
    }

    /* Editor Viewport & Canvases */
    .viewport-container {
      background-color: #f1f5f9 !important;
      border: 1px solid #e2e8f0 !important;
    }
    .viewport-container::-webkit-scrollbar-track {
      background: #f1f5f9 !important;
    }
    .viewport-container::-webkit-scrollbar-thumb {
      background: #cbd5e1 !important;
    }

    /* Footer */
    footer {
      background-color: #ffffff !important;
      border-top: 1px solid #e2e8f0 !important;
      color: #64748b !important;
      margin-top: auto !important;
      width: 100% !important;
      flex-shrink: 0 !important;
    }

    /* === UPGRADED HIGH-PRECISION SEJDA-STYLE EDITOR STYLES === */
    .text-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; overflow: hidden; pointer-events: none; }
    .text-layer.edit-mode { pointer-events: auto; }
    
    .text-item {
      position: absolute;
      color: transparent;
      white-space: pre;
      transform-origin: 0% 0%;
      cursor: pointer;
      border: 1px dashed transparent;
      transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
      pointer-events: auto;
      padding: 1px 3px;
      border-radius: 3px;
      line-height: 1.0;
      user-select: none;
      z-index: 4;
    }
    .text-item:hover {
      border-color: #0284c7;
      background: rgba(14, 165, 233, 0.08);
      color: inherit !important;
    }
    .text-item.active-selected {
      border: 1px solid #0284c7;
      background: rgba(255, 255, 255, 0.95);
      color: inherit !important;
      box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
      z-index: 15;
    }
    .text-item.editing {
      color: inherit !important;
      background: #ffffff !important;
      border: 1.5px solid #0284c7 !important;
      box-shadow: 0 4px 18px rgba(2, 132, 199, 0.35) !important;
      z-index: 20;
      outline: none;
      user-select: text;
      cursor: text;
    }
    .text-item.modified {
      color: inherit !important;
      background: #ffffff !important;
      border: 1px solid rgba(217, 119, 6, 0.6);
      box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }
    .text-item.is-dragging {
      opacity: 0.85;
      cursor: move !important;
      box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
      z-index: 30 !important;
    }

    /* Redaction mask layer covering original text */
    .redaction-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
    .redaction-box {
      position: absolute;
      background-color: #ffffff;
      pointer-events: none;
      border-radius: 2px;
      box-shadow: 0 0 1px rgba(0,0,0,0.05);
    }

    /* Floating Drag Handles */
    .text-drag-handle {
      position: absolute;
      top: -18px;
      left: 0;
      background: #0284c7;
      color: white;
      font-size: 10px;
      padding: 1px 6px;
      border-radius: 3px 3px 0 0;
      cursor: move;
      display: none;
      align-items: center;
      gap: 3px;
      font-family: sans-serif;
      font-weight: bold;
      z-index: 25;
    }
    .text-item.active-selected .text-drag-handle,
    .text-item.editing .text-drag-handle {
      display: flex;
    }

    /* Enhanced Image Overlay */
    .img-overlay-box {
      position: absolute;
      border: 2px solid #0284c7;
      background: rgba(255,255,255,0.05);
      cursor: move;
      user-select: none;
      z-index: 10;
      box-shadow: 0 4px 14px rgba(0,0,0,0.15);
      border-radius: 4px;
    }
    .img-overlay-box.active-obj {
      border: 2px solid #d97706;
      box-shadow: 0 6px 20px rgba(217, 119, 6, 0.3);
    }
    .img-overlay-box .handle {
      position: absolute;
      width: 10px;
      height: 10px;
      background: #ffffff;
      border: 2px solid #0284c7;
      border-radius: 50%;
    }
    .img-overlay-box .handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
    .img-overlay-box .handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
    .img-overlay-box .handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
    .img-overlay-box .handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
    .img-overlay-box .del-btn {
      position: absolute;
      top: -10px;
      right: -10px;
      background: #ef4444;
      color: white;
      border-radius: 50%;
      width: 22px;
      height: 22px;
      font-size: 11px;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 12;
      box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }
    .img-overlay-box .layer-btn {
      position: absolute;
      top: -10px;
      left: -10px;
      background: #0284c7;
      color: white;
      border-radius: 4px;
      padding: 2px 4px;
      font-size: 10px;
      cursor: pointer;
      z-index: 12;
    }