        :root {
            --primary: #7C3AED;
            --primary-dark: #6D28D9;
            --primary-light: #A78BFA;
            --primary-50: #F5F3FF;
            --secondary: #06B6D4;
            --secondary-dark: #0891B2;
            --accent: #F59E0B;
            --accent-dark: #D97706;
            --danger: #EF4444;
            --danger-light: #FEE2E2;
            --success: #10B981;
            --success-light: #D1FAE5;
            --bg: #F8FAFC;
            --bg-elevated: #FFFFFF;
            --text-main: #0F172A;
            --text-secondary: #475569;
            --text-muted: #64748B;
            --text-light: #94A3B8;
            --border: #E2E8F0;
            --border-light: #F1F5F9;
            --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
            --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
            --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
            --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
            --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.25rem;
            --radius-3xl: 1.5rem;
            --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
            --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
        }

        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
        body { font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text-main); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }

        .skip-link { position: absolute; top: -40px; left: 0; background: var(--primary); color: white; padding: 8px 16px; z-index: 10000; transition: top var(--transition-fast); border-radius: 0 0 var(--radius-md) 0; font-weight: 600; font-size: 0.875rem; text-decoration: none; }
        .skip-link:focus { top: 0; }

        .app-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
        .main-layout { display: flex; gap: 2rem; max-width: 1400px; margin: 0 auto; padding: 1.5rem 1rem; width: 100%; }
        .content-area { flex: 1; min-width: 0; }
        .sidebar { width: 300px; flex-shrink: 0; }

        /* Header */
        .page-header { text-align: center; margin-bottom: 2rem; padding: 0 1rem; }
        .page-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 0.75rem; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
        .page-header p { color: var(--text-secondary); font-size: clamp(0.95rem, 2vw, 1.05rem); max-width: 650px; margin: 0 auto; line-height: 1.5; }
        .header-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
        .header-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.875rem; background: var(--primary-50); color: var(--primary); border-radius: 9999px; font-size: 0.75rem; font-weight: 600; border: 1px solid rgba(124, 58, 237, 0.15); }
        .header-badge i { font-size: 0.7rem; }

        /* Tool Card */
        .tool-card { background: var(--bg-elevated); border-radius: var(--radius-2xl); padding: 1.5rem; box-shadow: var(--shadow-lg); border: 1px solid var(--border-light); }

        /* Language Chips */
        .lang-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; justify-content: center; }
        .lang-chip { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 0.875rem; background: var(--bg); border: 1.5px solid var(--border); border-radius: 9999px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); user-select: none; }
        .lang-chip:hover { border-color: var(--primary-light); background: var(--primary-50); color: var(--primary); transform: translateY(-1px); }
        .lang-chip.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: var(--primary); color: white; box-shadow: var(--shadow-sm); }
        .lang-chip .flag { font-size: 0.9rem; line-height: 1; }

        /* Upload Zone */
        .upload-zone { position: relative; border: 2px dashed var(--border); border-radius: var(--radius-xl); padding: 2.5rem 1.5rem; text-align: center; cursor: pointer; transition: all var(--transition-base); background: linear-gradient(135deg, #FAFBFC, #FFFFFF); margin-bottom: 1.5rem; overflow: hidden; }
        .upload-zone::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(124, 58, 237, 0.03), rgba(6, 182, 212, 0.03)); opacity: 0; transition: opacity var(--transition-base); }
        .upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: linear-gradient(135deg, #F5F3FF, #FFFFFF); transform: scale(0.995); }
        .upload-zone:hover::before, .upload-zone.dragover::before { opacity: 1; }
        .upload-zone input[type="file"] { 
    display: none; 
}

/* ==================== PREVENT FILE PICKER ON QUEUE BUTTONS ==================== */
.file-queue,
.file-queue * {
    pointer-events: auto;
    cursor: default;
}

.file-queue button,
.file-queue .file-item-remove,
#clearQueueBtn {
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

/* Make sure the queue blocks clicks from reaching the drop zone */
.upload-zone .file-queue {
    pointer-events: auto;
    position: relative;
    z-index: 5;
}
        .upload-icon { width: 56px; height: 56px; background: var(--primary-50); border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; color: var(--primary); font-size: 1.5rem; transition: transform var(--transition-base); }
        .upload-zone:hover .upload-icon { transform: scale(1.05); }
        .upload-zone h3 { font-size: 1rem; font-weight: 600; color: var(--text-main); margin-bottom: 0.375rem; }
        .upload-zone .upload-sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.5rem; }
        .upload-zone .upload-meta { font-size: 0.75rem; color: var(--text-light); }

        /* File Queue */
        .file-queue { display: none; margin-top: 1rem; text-align: left; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-lg); max-height: 240px; overflow-y: auto; padding: 0.5rem; }
        .file-queue.visible { display: block; }
        .file-item { display: flex; align-items: center; justify-content: space-between; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border-light); font-size: 0.8rem; transition: background var(--transition-fast); }
        .file-item:last-child { border-bottom: none; }
        .file-item:hover { background: rgba(124, 58, 237, 0.03); }
        .file-item-info { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
        .file-item-info i { color: var(--primary); font-size: 0.875rem; flex-shrink: 0; }
        .file-item-name { font-weight: 500; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .file-item-size { color: var(--text-light); font-size: 0.7rem; flex-shrink: 0; margin-left: 0.5rem; }
        .file-item-status { font-size: 0.7rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: 9999px; flex-shrink: 0; }
        .file-item-status.pending { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
        .file-item-status.processing { background: var(--primary-50); color: var(--primary); border: 1px solid rgba(124, 58, 237, 0.2); }
        .file-item-status.done { background: var(--success-light); color: var(--secondary-dark); border: 1px solid rgba(16, 185, 129, 0.2); }
        .file-item-status.error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
        .file-item-remove { background: none; border: none; color: var(--text-light); cursor: pointer; padding: 0.25rem; margin-left: 0.5rem; border-radius: var(--radius-sm); transition: all var(--transition-fast); flex-shrink: 0; }
        .file-item-remove:hover { color: var(--danger); background: var(--danger-light); }
        .queue-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; border-bottom: 1.5px solid var(--border); margin-bottom: 0.25rem; }
        .queue-header span { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
        .queue-header button { background: none; border: none; color: var(--danger); font-size: 0.75rem; font-weight: 600; cursor: pointer; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); transition: background var(--transition-fast); }
        .queue-header button:hover { background: var(--danger-light); }

        /* Controls */
        .controls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
        .control-field { display: flex; flex-direction: column; gap: 0.375rem; }
        .control-field label { font-size: 0.75rem; font-weight: 600; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 0.375rem; }
        .control-field label i { color: var(--primary); font-size: 0.8rem; }
        .control-field select { padding: 0.75rem 1rem; border-radius: var(--radius-lg); border: 1.5px solid var(--border); outline: none; font-weight: 500; background: white; cursor: pointer; font-size: 0.875rem; color: var(--text-main); transition: all var(--transition-fast); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.5rem; }
        .control-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }
        .control-field select:hover { border-color: var(--primary-light); }

        /* Buttons */
        .btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius-lg); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); color: white; text-decoration: none; position: relative; overflow: hidden; white-space: nowrap; }
        .btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%); opacity: 0; transition: opacity var(--transition-fast); }
        .btn:hover::after { opacity: 1; }
        .btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25); }
        .btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35); }
        .btn-primary:active:not(:disabled) { transform: translateY(0); }
        .btn-secondary { background: #334155; padding: 0.625rem 1rem; font-size: 0.8rem; }
        .btn-secondary:hover:not(:disabled) { background: #1e293b; }
        .btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); padding: 0.625rem 1rem; font-size: 0.8rem; }
        .btn-success { background: linear-gradient(135deg, var(--success), #059669); padding: 0.625rem 1rem; font-size: 0.8rem; }
        .btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); padding: 0.625rem 1rem; font-size: 0.8rem; }
        .btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none; }
        .btn-lg { padding: 1rem 2rem; font-size: 1rem; }
        .btn-block { width: 100%; }

        .spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 0.7s linear infinite; display: inline-block; flex-shrink: 0; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Progress */
        .progress-track { width: 100%; height: 6px; background: var(--border-light); border-radius: 9999px; margin-bottom: 1rem; overflow: hidden; display: none; }
        .progress-track.visible { display: block; }
        .progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 9999px; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; }
        .progress-fill::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 20px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4)); animation: shimmer 1.5s infinite; }
        @keyframes shimmer { 0% { transform: translateX(-20px); } 100% { transform: translateX(20px); } }

        .status-bar { display: none; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.875rem; color: var(--primary); margin-bottom: 1rem; font-weight: 600; padding: 0.5rem; background: var(--primary-50); border-radius: var(--radius-lg); }
        .status-bar.visible { display: flex; }
        .status-bar i { font-size: 0.8rem; }
        .status-bar.error { background: var(--danger-light); color: var(--danger); }
        .status-bar.success { background: var(--success-light); color: var(--secondary-dark); }

        /* Result Panel */
        .result-panel { border-radius: var(--radius-xl); background: var(--bg); border: 1.5px solid var(--border); overflow: hidden; transition: border-color var(--transition-fast); }
        .result-panel:focus-within { border-color: var(--primary-light); }
        .result-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: white; border-bottom: 1.5px solid var(--border); flex-wrap: wrap; gap: 0.75rem; }
        .toolbar-stats { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-muted); }
        .toolbar-stat { display: flex; align-items: center; gap: 0.375rem; }
        .toolbar-stat i { color: var(--primary); font-size: 0.7rem; }
        .toolbar-stat-value { font-weight: 700; color: var(--text-main); }
        .toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .toolbar-btn { background: var(--bg); border: 1.5px solid var(--border); padding: 0.375rem 0.625rem; border-radius: var(--radius-md); font-size: 0.75rem; cursor: pointer; transition: all var(--transition-fast); color: var(--text-secondary); display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 500; font-family: inherit; }
        .toolbar-btn:hover { background: var(--primary); border-color: var(--primary); color: white; }
        .toolbar-btn i { font-size: 0.7rem; }
        .result-textarea { width: 100%; height: 280px; padding: 1rem; border: none; resize: vertical; font-size: 0.875rem; line-height: 1.7; outline: none; background: var(--bg); font-family: 'JetBrains Mono', 'Inter', monospace; color: var(--text-main); }
        .result-textarea::placeholder { color: var(--text-light); }
        .result-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem; background: white; border-top: 1.5px solid var(--border); }

        /* Find & Replace */
        .find-replace-popover { position: absolute; top: 48px; right: 0.5rem; background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 1rem; z-index: 50; min-width: 280px; display: none; border: 1.5px solid var(--border); }
        .find-replace-popover.active { display: block; }
        .find-replace-popover .popover-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
        .find-replace-popover .popover-title { font-size: 0.875rem; font-weight: 600; color: var(--text-main); }
        .find-replace-popover .close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); transition: all var(--transition-fast); }
        .find-replace-popover .close-btn:hover { background: var(--bg); color: var(--danger); }
        .find-replace-input { width: 100%; padding: 0.625rem 0.75rem; margin-bottom: 0.5rem; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 0.8rem; font-family: inherit; transition: all var(--transition-fast); }
        .find-replace-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }
        .find-replace-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
        .find-replace-actions button { flex: 1; }

        /* Tool Nav */
        .tool-nav { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 1.5rem 0; }
        .tool-nav-link { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1.25rem; background: white; border: 1.5px solid var(--border); border-radius: var(--radius-xl); color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 0.875rem; transition: all var(--transition-fast); }
        .tool-nav-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); transform: translateY(-1px); }
        .tool-nav-link.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: var(--primary); color: white; box-shadow: var(--shadow-md); }
        .tool-nav-link i { font-size: 0.875rem; }

        /* FAQ */
        .faq-section { margin-top: 2.5rem; background: var(--bg-elevated); border-radius: var(--radius-2xl); padding: 1.5rem; box-shadow: var(--shadow-md); border: 1px solid var(--border-light); }
        .faq-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; text-align: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
        .faq-item { border-bottom: 1px solid var(--border-light); }
        .faq-item:last-child { border-bottom: none; }
        .faq-question { font-size: 0.95rem; font-weight: 600; color: var(--text-main); cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; transition: color var(--transition-fast); background: none; border: none; width: 100%; text-align: left; font-family: inherit; }
        .faq-question:hover { color: var(--primary); }
        .faq-question i { font-size: 0.8rem; color: var(--text-muted); transition: transform var(--transition-base); }
        .faq-item.active .faq-question i { transform: rotate(180deg); color: var(--primary); }
        .faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; color: var(--text-secondary); font-size: 0.875rem; line-height: 1.7; }
        .faq-item.active .faq-answer { max-height: 300px; padding-bottom: 1rem; }
        .faq-answer p { margin-bottom: 0.75rem; }
        .faq-answer ul { margin-left: 1.25rem; margin-bottom: 0.75rem; }
        .faq-answer li { margin-bottom: 0.375rem; }
        .faq-answer a { color: var(--primary); text-decoration: none; font-weight: 600; }
        .faq-answer a:hover { text-decoration: underline; }

        /* SEO Content */
        .seo-article { margin-top: 2.5rem; padding: 1.5rem; background: var(--bg-elevated); border-radius: var(--radius-2xl); box-shadow: var(--shadow-md); border: 1px solid var(--border-light); }
        .seo-article h2 { margin-top: 1.5rem; margin-bottom: 0.75rem; font-size: 1.25rem; color: var(--primary); font-weight: 700; }
        .seo-article h2:first-child { margin-top: 0; }
        .seo-article p { margin-bottom: 0.875rem; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }
        .seo-article ul { margin-left: 1.25rem; margin-bottom: 0.875rem; }
        .seo-article li { margin-bottom: 0.375rem; color: var(--text-secondary); font-size: 0.9rem; }
        .seo-article strong { color: var(--text-main); }

        /* Sidebar */
        .sidebar-card { background: var(--bg-elevated); border-radius: var(--radius-2xl); padding: 1.25rem; box-shadow: var(--shadow-md); border: 1px solid var(--border-light); margin-bottom: 1.25rem; }
        .sidebar-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }
        .sidebar-card h3 i { font-size: 0.875rem; }
        .sidebar-card p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.625rem; line-height: 1.6; display: flex; align-items: flex-start; gap: 0.5rem; }
        .sidebar-card p i { color: var(--secondary); font-size: 0.75rem; margin-top: 0.25rem; flex-shrink: 0; }
        .feature-list { list-style: none; margin-left: 0 !important; }
        .feature-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.8rem; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 0.5rem; }
        .feature-list li:last-child { border-bottom: none; }
        .feature-list li i { color: var(--success); font-size: 0.7rem; margin-top: 0.2rem; flex-shrink: 0; }
        .format-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
        .format-badge { display: inline-block; background: var(--bg); padding: 0.375rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); border: 1px solid var(--border); }

        /* Ad Containers */
        .ad-container { width: 100%; text-align: center; min-height: 90px; margin: 1.5rem 0; }
        .ad-label { font-size: 0.65rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; display: block; font-weight: 600; }
        .ad-placeholder { min-height: 90px; background: linear-gradient(135deg, #F1F5F9, #E2E8F0); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 0.8rem; border: 1px dashed #CBD5E1; }
        .sidebar-ad { background: linear-gradient(135deg, #F8FAFC, #F1F5F9); border-radius: var(--radius-xl); padding: 1rem; margin-bottom: 1.25rem; text-align: center; min-height: 250px; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 0.875rem; border: 1px dashed #CBD5E1; }

        /* Toast */
        .toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
        .toast { background: var(--text-main); color: white; padding: 0.75rem 1.25rem; border-radius: var(--radius-lg); font-size: 0.875rem; font-weight: 500; box-shadow: var(--shadow-xl); transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: auto; display: flex; align-items: center; gap: 0.5rem; max-width: 320px; }
        .toast.show { transform: translateX(0); }
        .toast.error { background: var(--danger); }
        .toast.success { background: var(--secondary-dark); }
        .toast i { font-size: 0.875rem; }

        /* Stats Row */
        .stats-row { display: flex; justify-content: space-between; background: linear-gradient(135deg, #F8FAFC, #FFFFFF); padding: 0.75rem 1rem; border-radius: var(--radius-lg); margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem; border: 1px solid var(--border-light); }
        .stats-row .stat { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
        .stats-row .stat i { color: var(--primary); font-size: 0.75rem; }
        .stats-row .stat strong { color: var(--text-main); font-weight: 700; }

        /* App Footer */
        .app-footer { margin-top: auto; padding: 2rem 1rem; text-align: center; border-top: 1px solid var(--border-light); background: white; }
        .app-footer p { color: var(--text-muted); font-size: 0.8rem; }

        /* Responsive */
        @media (max-width: 1024px) {
            .main-layout { flex-direction: column; }
            .sidebar { width: 100%; order: 2; }
            .content-area { order: 1; }
        }
        @media (max-width: 768px) {
            .main-layout { padding: 1rem 0.75rem; gap: 1rem; }
            .tool-card { padding: 1rem; border-radius: var(--radius-xl); }
            .page-header { margin-bottom: 1.5rem; }
            .page-header h1 { font-size: 1.6rem; }
            .upload-zone { padding: 2rem 1rem; }
            .upload-zone h3 { font-size: 0.95rem; }
            .controls-grid { grid-template-columns: 1fr; gap: 0.75rem; }
            .result-toolbar { flex-direction: column; align-items: stretch; padding: 0.625rem 0.75rem; }
            .toolbar-stats { justify-content: center; order: 1; }
            .toolbar-actions { justify-content: center; order: 2; }
            .result-textarea { height: 220px; padding: 0.75rem; }
            .result-footer { justify-content: center; padding: 0.625rem 0.75rem; }
            .result-footer .btn { flex: 1 1 calc(33% - 0.5rem); min-width: 80px; }
            .tool-nav { gap: 0.375rem; }
            .tool-nav-link { padding: 0.5rem 1rem; font-size: 0.8rem; }
            .faq-section, .seo-article { padding: 1rem; margin-top: 1.5rem; }
            .stats-row { justify-content: center; gap: 0.5rem 1rem; }
            .lang-chips { gap: 0.375rem; }
            .lang-chip { padding: 0.375rem 0.625rem; font-size: 0.75rem; }
            .find-replace-popover { position: fixed; top: auto; bottom: 1rem; left: 1rem; right: 1rem; min-width: auto; }
            .toast-container { left: 1rem; right: 1rem; bottom: 1rem; }
            .toast { max-width: 100%; }
        }
        @media (max-width: 480px) {
            .page-header h1 { font-size: 1.4rem; }
            .upload-icon { width: 48px; height: 48px; font-size: 1.25rem; }
            .btn { padding: 0.625rem 1rem; font-size: 0.8rem; }
            .btn-lg { padding: 0.875rem 1.5rem; font-size: 0.9rem; }
            .result-footer .btn { flex: 1 1 calc(50% - 0.25rem); }
            .toolbar-btn { padding: 0.375rem 0.5rem; font-size: 0.7rem; }
            .header-badge { padding: 0.25rem 0.625rem; font-size: 0.7rem; }
            .sidebar-card { padding: 1rem; }
            .file-item { padding: 0.5rem; }
            .file-item-name { max-width: 120px; }
        }
        @media print {
            .ad-container, .sidebar-ad, .tool-nav, .app-footer, .toast-container { display: none !important; }
            .main-layout { flex-direction: column; }
            .sidebar { width: 100%; }
            .tool-card { box-shadow: none; border: 1px solid #ddd; }
        }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
        }
        :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
        
        
        /* ==================== FILE QUEUE FIXES ==================== */
.file-queue {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.file-item {
    max-width: 100%;
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
}

.file-item-info {
    min-width: 0;
    overflow: hidden;
}

.file-item-name {
    max-width: 100%;
    min-width: 0;
}

.file-item.processing-active {
    order: -1;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.08), transparent);
    border-left: 3px solid var(--primary);
    animation: pulse-processing 2s infinite;
}

@keyframes pulse-processing {
    0%, 100% { background: linear-gradient(90deg, rgba(124, 58, 237, 0.08), transparent); }
    50% { background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), transparent); }
}

/* ==================== UPLOAD ZONE CONTAINMENT ==================== */
.upload-zone {
    max-width: 100%;
    overflow: hidden;
}

.upload-initial-ui {
    max-width: 100%;
    padding: 0 0.5rem;
}

/* ==================== RESULT PANEL FIXES ==================== */
.result-panel {
    max-width: 100%;
    overflow: hidden;
}

.result-textarea {
    max-width: 100%;
    min-width: 0;
}

/* ==================== STATUS BAR FIXES ==================== */
.status-bar {
    max-width: 100%;
    word-break: break-word;
    text-align: center;
}

/* ==================== MAIN LAYOUT SAFETY ==================== */
.main-layout {
    overflow-x: hidden;
    max-width: 100vw;
}

.content-area {
    min-width: 0;
    max-width: 100%;
}

/* ==================== AD CONTAINMENT ==================== */
.ad-container,
.ad-placeholder,
.sidebar-ad {
    max-width: 100%;
    overflow: hidden;
}

/* ==================== SCROLLBAR STYLING FOR QUEUE ==================== */
.file-queue::-webkit-scrollbar {
    width: 6px;
}

.file-queue::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 9999px;
}

.file-queue::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 9999px;
}

.file-queue::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.file-queue {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) var(--border-light);
}

/* ==================== RESPONSIVE FIXES ==================== */

/* Toolbar buttons horizontal scroll on mobile */
@media (max-width: 768px) {
    .result-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .toolbar-stats {
        justify-content: flex-start;
        order: 1;
        width: 100%;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-light);
    }
    
    .toolbar-actions {
        order: 2;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .toolbar-actions::-webkit-scrollbar {
        display: none;
    }
    
    .toolbar-btn {
        flex-shrink: 0;
    }
    
    .result-footer {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .result-footer .btn {
        width: 100%;
        min-width: 0;
    }
    
    .file-queue {
        max-height: 200px;
        padding: 0.375rem;
    }
    
    .file-item {
        padding: 0.5rem;
        gap: 0.375rem;
    }
    
    .file-item-info {
        gap: 0.375rem;
    }
    
    .file-item-name {
        font-size: 0.75rem;
        max-width: 150px;
    }
    
    .file-item-size {
        display: none;
    }
    
    .file-item-status {
        padding: 0.2rem 0.5rem;
        font-size: 0.65rem;
    }
    
    .queue-header span {
        font-size: 0.7rem;
    }
}

@media (max-width: 640px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .control-field select {
        width: 100%;
    }
    
    .lang-chips {
        gap: 0.375rem;
        padding: 0 0.25rem;
    }
    
    .lang-chip {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .lang-chip .flag {
        font-size: 0.8rem;
    }
    
    .stats-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        text-align: center;
    }
    
    .stats-row .stat {
        justify-content: center;
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .stats-row .stat i {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .file-item-name {
        max-width: 100px;
    }
    
    .file-item-remove {
        padding: 0.2rem;
        margin-left: 0.25rem;
    }
    
    .find-replace-popover {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        min-width: auto;
        max-height: 50vh;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

@media (max-width: 380px) {
    .result-footer {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .content-area {
        order: 1;
        width: 100%;
        max-width: 100%;
    }
}