        :root {
                --primary-color: #6366f1;
                --primary-hover: #5b21b6;
                --secondary-color: #f8fafc;
                --text-primary: #1e293b;
                --text-secondary: #64748b;
                --border-color: #e2e8f0;
                --success-color: #10b981;
                --warning-color: #f59e0b;
                --danger-color: #ef4444;
                --info-color: #3b82f6;
                --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
                --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
        }

        /* Boutons de suggestion */
        .btn-suggestion {
            background: var(--warning-color);
            border: none;
            border-radius: 50%;
            width: 28px;
            height: 28px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .btn-suggestion:hover {
            background: #d97706;
            transform: scale(1.1);
        }

        .btn-suggestion:disabled {
            background: #d1d5db;
            cursor: not-allowed;
            transform: none;
        }

        /* Tooltips pour suggestions */
        .suggestion-tooltip {
            position: absolute;
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 16px;
            margin-top: 8px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.15);
            max-width: 560px;
            width: auto;
            z-index: 1000;
            font-size: 14px;
            line-height: 1.5;
            max-height: 70vh;
            overflow: auto;
            white-space: normal;
            word-break: break-word;
            overflow-wrap: anywhere;
        }

        .suggestion-tooltip::before {
            content: '';
            position: absolute;
            top: -8px;
            left: 20px;
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-bottom: 8px solid white;
        }

        .tooltip-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 10px;
            padding-bottom: 8px;
            border-bottom: 1px solid #f1f5f9;
        }

        .tooltip-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
            color: var(--primary-color);
        }

        .tooltip-dot {
            width: 8px;
            height: 8px;
            background: #7c3aed;
            border-radius: 9999px;
            display: inline-block;
        }

        .tooltip-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-icon {
            border: none;
            background: #f5f3ff;
            color: #6d28d9;
            padding: 6px 10px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
        }

        .btn-icon:hover {
            background: #ede9fe;
        }

        * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
        }

        body {
                font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
                line-height: 1.6;
                color: var(--text-primary);
                background-color: #ffffff;
        }

        /* Masquer le contenu principal pendant la vérification auth */
        .main-content-hidden {
                opacity: 0;
                visibility: hidden;
                transition: opacity 0.1s, visibility 0.1s;
        }

        .main-content-visible {
                opacity: 1;
                visibility: visible;
        }

        /* Header Navigation */
        .header {
                background: #ffffff;
                border-bottom: 1px solid var(--border-color);
                position: sticky;
                top: 0;
                z-index: 1000;
                box-shadow: var(--shadow);
        }

        .nav-container {
                max-width: 1200px;
                margin: 0 auto;
                padding: 0 24px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                height: 64px;
        }

        .logo {
                font-size: 24px;
                font-weight: 700;
                color: var(--primary-color);
                text-decoration: none;
        }

        .plan-badge {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .plan-badge.pro {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        }

        .plan-badge.free {
            background: #e5e7eb;
            color: #6b7280;
        }

        .nav-menu {
                display: flex;
                align-items: center;
                gap: 32px;
                list-style: none;
        }

        .nav-link {
                color: var(--text-primary);
                text-decoration: none;
                font-weight: 500;
                padding: 8px 0;
                transition: color 0.2s;
        }

        .nav-link:hover {
                color: var(--primary-color);
        }

        .nav-link.active {
                color: var(--primary-color);
                border-bottom: 2px solid var(--primary-color);
        }

        .auth-buttons {
                display: flex;
                align-items: center;
                gap: 16px;
        }

        .btn {
                padding: 8px 16px;
                border-radius: 8px;
                font-weight: 500;
                text-decoration: none;
                transition: all 0.2s;
                border: none;
                cursor: pointer;
                font-size: 14px;
        }

        .btn-primary {
                background: var(--primary-color);
                color: white;
        }

        .btn-outline {
                background: transparent;
                color: var(--text-primary);
                border: 1px solid var(--border-color);
        }

        .btn-danger {
                background: var(--danger-color);
                color: white;
        }

        .btn-danger:hover {
                background: #dc2626;
        }

        /* User Info Styles */
        .user-info {
                display: flex;
                align-items: center;
                gap: 12px;
        }

        .user-name {
                display: flex;
                align-items: center;
                gap: 8px;
                font-weight: 500;
                color: var(--text-primary);
        }

        .user-avatar {
                width: 32px;
                height: 32px;
                border-radius: 50%;
                background: var(--primary-color);
                display: flex;
                align-items: center;
                justify-content: center;
                color: white;
                font-weight: 600;
                font-size: 14px;
        }
        /* Main Content */
        .main-container {
                max-width: 1000px;
                margin: 0 auto;
                padding: 40px 24px;
        }

        .page-header {
                text-align: center;
                margin-bottom: 48px;
        }

        .page-title {
                font-size: 36px;
                font-weight: 700;
                margin-bottom: 16px;
                color: var(--text-primary);
        }

        .page-subtitle {
                font-size: 18px;
                color: var(--text-secondary);
        }



        /* Analysis Steps */
        .analysis-container {
                background: white;
                border-radius: 16px;
                box-shadow: var(--shadow-lg);
                overflow: hidden;
        }

        .step-indicator {
                background: var(--secondary-color);
                padding: 24px;
                border-bottom: 1px solid var(--border-color);
        }

        .steps {
                display: flex;
                justify-content: center;
                gap: 32px;
        }

        .step {
                display: flex;
                align-items: center;
                gap: 8px;
                font-weight: 500;
                color: var(--text-secondary);
        }

        .step.active {
                color: var(--primary-color);
        }

        .step.completed {
                color: var(--success-color);
        }

        .step-number {
                width: 32px;
                height: 32px;
                border-radius: 50%;
                background: var(--border-color);
                display: flex;
                align-items: center;
                justify-content: center;
                font-weight: 600;
                font-size: 14px;
        }

        .step.active .step-number {
                background: var(--primary-color);
                color: white;
        }

        .step.completed .step-number {
                background: var(--success-color);
                color: white;
        }

        /* Step Content */
        .step-content {
                padding: 40px;
                display: none;
        }

        .step-content.active {
                display: block;
        }

        /* Upload Section */
        .upload-area {
                border: 3px dashed var(--border-color);
                border-radius: 16px;
                padding: 20px;
                text-align: center;
                transition: all 0.3s ease;
                cursor: pointer;
                margin-bottom: 32px;
                background: #F6F5FB;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                height: 254px;
        }

        .upload-area:hover,
        .upload-area.dragover {
                border-color: var(--primary-color);
                background: #f8faff;
        }

        .upload-area.file-selected {
                border-color: var(--success-color);
                background: #f0fdf4;
        }

        .upload-icon {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: auto;
                height: auto;
                border-radius: 0;
                background: transparent;
                margin-bottom: 16px;
                color: var(--primary-color);
                font-size: 72px;
                font-weight: 300;
                line-height: 1;
        }

        .upload-area.file-selected .upload-icon {
                color: var(--success-color);
        }

        .upload-title {
                font-size: 18px;
                font-weight: 600;
                margin-bottom: 6px;
        }

        .upload-subtitle {
                color: #6B7280;
                margin-bottom: 0;
                font-size: 14px;
        }

        /* Boutons d'upload côte à côte */
        .upload-buttons-row {
                display: flex;
                gap: 12px;
                justify-content: center;
                margin-top: 20px;
                flex-wrap: wrap;
        }
        
        .btn-upload {
                background: var(--primary-color);
                color: white;
                border: none;
                border-radius: 8px;
                padding: 14px 28px;
                font-size: 15px;
                font-weight: 600;
                cursor: pointer;
                transition: all 0.2s ease;
                display: flex;
                align-items: center;
                gap: 10px;
                flex: 1;
                max-width: 240px;
                justify-content: center;
        }
        
        .btn-upload:hover {
                background: var(--primary-hover);
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }
        
        .btn-upload i {
                font-size: 16px;
        }
        
        /* Masquer le bouton caméra sur desktop */
        @media (min-width: 769px) {
                .btn-camera {
                        display: none !important;
                }
                
                .upload-buttons-row .btn-upload {
                        max-width: 280px;
                }
        }
        
        /* Mobile : afficher les 2 boutons */
        @media (max-width: 768px) {
                .upload-buttons-row {
                        flex-direction: column;
                        gap: 12px;
                }
                
                .btn-upload {
                        max-width: 100%;
                        width: 100%;
                }
        }

        .upload-info {
                background: #e7f3ff;
                border: 1px solid #b3d7ff;
                border-radius: 8px;
                padding: 10px 12px;
                margin: 12px 0 16px 0;
                font-size: 13px;
                color: #0066cc;
                display: flex;
                align-items: center;
                gap: 8px;
                max-width: 280px;
        }

        .upload-info i {
                font-size: 16px;
                color: #0066cc;
        }

        .file-input {
                display: none;
        }

        .btn-large {
                padding: 16px 32px;
                font-size: 16px;
                border-radius: 12px;
        }

        /* Action Buttons */
        .action-buttons {
                display: flex;
                gap: 16px;
                justify-content: center;
                flex-wrap: wrap;
                margin-top: 32px;
        }

        /* Mobile Navigation */
        .mobile-menu-toggle {
            display: none;
            background: none;
            border: none;
            font-size: 24px;
            color: var(--text-primary);
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: background-color 0.2s;
        }
        .mobile-menu-toggle:hover {
            background-color: var(--secondary-color);
        }
        .mobile-menu-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 9999;
        }

        .mobile-menu {
            position: fixed;
            top: 0;
            right: -300px;
            width: 300px;
            height: 100%;
            background: white;
            box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
            transition: right 0.3s ease;
            z-index: 10000;
            overflow-y: auto;
        }

        .mobile-menu.active {
            right: 0;
        }

        .mobile-menu-header {
            padding: 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .mobile-menu-close {
            background: none;
            border: none;
            font-size: 24px;
            color: var(--text-primary);
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
        }

        .mobile-menu-nav {
            padding: 20px 0;
        }

        .mobile-menu-nav a {
            display: block;
            padding: 15px 20px;
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 500;
            border-bottom: 1px solid var(--border-color);
            transition: background-color 0.2s;
        }

        .mobile-menu-nav a:hover,
        .mobile-menu-nav a.active {
            background-color: var(--secondary-color);
            color: var(--primary-color);
        }

        .mobile-menu-auth {
            padding: 20px;
            border-top: 1px solid var(--border-color);
        }

        .mobile-menu-auth .btn {
            width: 100%;
            margin-bottom: 12px;
            justify-content: center;
            display: flex;
            align-items: center;
            padding: 12px 20px;
            font-size: 14px;
            text-align: center;
        }

        .mobile-menu-auth .btn:last-child {
            margin-bottom: 0;
        }

        /* Footer */
        .footer-simple {
            background: var(--text-primary);
            color: white;
            padding: 20px 24px;
        }

        .footer-container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .disclaimer {
            text-align: center;
            margin-bottom: 16px;
        }

        .disclaimer p {
            margin: 0;
            font-size: 14px;
            color: #94a3b8;
        }
        .footer-bottom {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid #374151;
            padding-top: 16px;
        }

        .footer-left p,
        .footer-right p {
            margin: 0;
            font-size: 14px;
            color: #94a3b8;
        }

        .footer-right a {
            color: #94a3b8;
            text-decoration: none;
            transition: color 0.2s;
        }

        .footer-right a:hover {
            color: white;
        }
        /* Responsive */
        @media (max-width: 768px) {
                /* ✅ Protection globale contre les débordements horizontaux */
                body {
                    overflow-x: hidden !important;
                }

                /* Protection des conteneurs principaux */
                .main-container,
                .analysis-container,
                .step-content {
                    overflow-x: hidden !important;
                    max-width: 100% !important;
                }

                /* Toutes les grilles avec minmax en une seule colonne sur mobile */
                [style*="grid-template-columns: repeat(auto-fit, minmax("] {
                    grid-template-columns: 1fr !important;
                }

                /* Protection des cartes CGV avec largeur minimale */
                [style*="minmax(240px"] {
                    grid-template-columns: 1fr !important;
                }

                [style*="minmax(200px"] {
                    grid-template-columns: 1fr !important;
                }

                [style*="minmax(300px"] {
                    grid-template-columns: 1fr !important;
                }

                [style*="minmax(320px"] {
                    grid-template-columns: 1fr !important;
                }

                /* Protection des éléments flex avec largeur minimale fixe problématique */
                [style*="min-width: 300px"] {
                    min-width: 0 !important;
                    width: 100% !important;
                }

                /* Protection des textes dans les cartes et listes */
                .exclusions-list li,
                .clause-content,
                .analysis-details span,
                .cgv-section-header h4,
                .exclusions-header h5 {
                    word-wrap: break-word !important;
                    overflow-wrap: break-word !important;
                    hyphens: auto !important;
                }

                /* Empêcher white-space: nowrap problématique sur mobile */
                .missing-clause-btn,
                .cgv-chat-btn,
                .btn-view,
                .btn-delete {
                    white-space: normal !important;
                }

                /* Boutons de chat des clauses de contrat - mobile */
                .clause-chat-btn {
                    padding: 8px !important;
                    min-width: 36px !important;
                    width: auto !important;
                    height: 36px !important;
                    border-radius: 18px !important;
                    justify-content: center !important;
                    gap: 4px !important;
                }
                
                .clause-chat-btn span {
                    display: none !important; /* Masquer le texte sur mobile */
                }
                
                .clause-chat-btn i {
                    margin: 0 !important;
                }

                /* Protection des grilles de cartes CGV */
                .cgv-cards-grid {
                    grid-template-columns: 1fr !important;
                    gap: 12px !important;
                }

                /* Protection des cartes CGV individuelles */
                .cgv-cards-grid > div {
                    overflow-x: hidden !important;
                    word-wrap: break-word !important;
                    overflow-wrap: break-word !important;
                }

                /* Protection des modales sur mobile */
                .modal-content {
                    max-width: 95% !important;
                    margin: 10px auto !important;
                    overflow-x: hidden !important;
                }

                /* Protection des tableaux si présents */
                table {
                    display: block !important;
                    overflow-x: auto !important;
                    width: 100% !important;
                }
            .footer-bottom {
                flex-direction: column;
                gap: 12px;
                text-align: center;
            }
                .nav-menu {
                    display: none;
                }

                .auth-buttons {
                    display: none;
                }

                .mobile-menu-toggle {
                    display: block;
                }

                .main-container {
                    padding: 20px 16px;
                }

                .page-title {
                    font-size: 28px;
                }

                .steps {
                    gap: 12px;
                    flex-wrap: wrap;
                    justify-content: center;
                }

                .step {
                    min-width: 80px;
                }

                .step span {
                    font-size: 12px;
                }

                .step-number {
                    width: 32px;
                    height: 32px;
                    font-size: 14px;
                }

                .step-content {
                    padding: 20px 16px;
                }

                .upload-area {
                    padding: 24px 16px;
                    height: auto !important;
                    min-height: 280px;
                }
                
                /* Réduire l'icône + sur mobile pour gagner de l'espace */
                .upload-icon {
                    font-size: 48px !important;
                    margin-bottom: 12px !important;
                }
                
                /* Espacement optimisé pour les boutons */
                .upload-buttons-row {
                    margin-top: 16px !important;
                }

                .upload-title {
                    font-size: 20px;
                }

                .upload-subtitle {
                    font-size: 14px;
                }

                .action-buttons {
                    flex-direction: column;
                    align-items: center;
                    gap: 12px;
                }

                .btn-large {
                    width: 100%;
                    max-width: 280px;
                }

                /* Optimisation des cartes de clauses pour mobile */
                .clauses-grid {
                    grid-template-columns: 1fr !important;
                    gap: 12px !important;
                }

                /* Adaptation des modales pour mobile */
                .modal-content {
                    margin: 10px auto;
                    max-height: 90vh;
                    overflow-y: auto;
                }

                /* Amélioration de la lisibilité mobile */
                .clause-content {
                    font-size: 14px;
                    line-height: 1.5;
                }

                /* Blocs de clauses repliables */
                .clause-card { border: 1px solid var(--border-color); border-radius: 12px; background: white; overflow: hidden; }
                .clause-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; cursor:pointer; }
                .clause-title { display:flex; align-items:center; gap:8px; font-weight:700; }
                .clause-risk-badge { padding:4px 8px; border-radius:999px; font-size:11px; }
                .clause-body { padding:16px; border-top:1px solid var(--border-color); }
                
                /* Zone d'erreur optimisée pour mobile */
                #upload-error-zone {
                    margin: 15px 0;
                }
                
                #upload-error-zone .alert {
                    padding: 16px;
                    margin-bottom: 0;
                    border-radius: 8px;
                    font-size: 14px;
                    line-height: 1.4;
                }
                
                #upload-error-zone .alert h4 {
                    font-size: 16px;
                    margin-bottom: 10px;
                }
                
                #upload-error-zone .alert p {
                    margin-bottom: 0;
                    word-wrap: break-word;
                }
                
                /* Masquer les éléments uploadés sur mobile lors du clic examiner */
                .upload-hidden-mobile .upload-area,
                .upload-hidden-mobile #fileInfo,
                .upload-hidden-mobile .action-buttons {
                    display: none !important;
                }

                .risk-score-badge {
                    min-width: 44px;
                    min-height: 44px;
                    font-size: 12px;
                }

                /* Progress bars mobiles */
                .progress-container {
                    margin: 16px 0;
                }

                .sage-quote {
                    margin: 16px auto;
                    padding: 16px 20px;
                    max-width: 100%;
                }

                /* Upload info responsive */
                .upload-info {
                    padding: 10px 12px;
                    font-size: 12px;
                    line-height: 1.4;
                    flex-direction: row;
                    align-items: flex-start;
                    gap: 8px;
                    text-align: left;
                }

                .upload-info i {
                    font-size: 14px;
                    margin-top: 2px;
                    flex-shrink: 0;
                }

                .upload-info div {
                    flex: 1;
                }

                .upload-info br {
                    display: block;
                    margin: 2px 0;
                }

                /* ✅ Correction grille de résumé sur mobile */
                .summary-grid {
                    grid-template-columns: 1fr !important;
                    grid-template-rows: auto !important;
                }

                /* ✅ Correction cartes pleine hauteur sur mobile */
                .summary-card-full {
                    grid-row: span 1 !important;
                }

                /* ✅ Réorganisation de l'ordre sur mobile : Clauses manquantes avant Score */
                .summary-card-analyzed {
                    order: 1 !important;
                }

                .summary-card-risk {
                    order: 2 !important;
                }

                .summary-card-missing {
                    order: 3 !important;
                }

                .summary-card-score {
                    order: 4 !important;
                }

                /* ✅ Correction cartes de clauses manquantes sur mobile */
                .missing-clause-card {
                    flex-direction: column !important;
                    align-items: stretch !important;
                    gap: 12px !important;
                }

                /* Contenu des clauses manquantes - éviter débordement */
                .missing-clause-content {
                    min-width: 0 !important;
                    word-wrap: break-word !important;
                    overflow-wrap: break-word !important;
                }

                /* Bouton "Générer la clause" en pleine largeur sur mobile */
                .missing-clause-btn {
                    width: 100% !important;
                    justify-content: center !important;
                    white-space: normal !important;
                    padding: 12px 16px !important;
                }

                /* ✅ Correction sections CGV sur mobile */
                .cgv-section-header {
                    flex-direction: column !important;
                    align-items: stretch !important;
                    gap: 12px !important;
                }

                .cgv-section-header h4 {
                    width: 100% !important;
                    margin-bottom: 0 !important;
                }

                .cgv-chat-btn {
                    width: 100% !important;
                    justify-content: center !important;
                    white-space: normal !important;
                    padding: 12px 16px !important;
                    font-size: 13px !important;
                    position: relative !important;
                    overflow: visible !important;
                }
                
                /* ✅ Fix bulle d'attente Vector Store sur mobile */
                .vs-waiting-bubble {
                    position: absolute !important;
                    top: auto !important;
                    bottom: -40px !important;
                    right: 50% !important;
                    transform: translateX(50%) !important;
                    white-space: nowrap !important;
                    font-size: 10px !important;
                    padding: 6px 10px !important;
                    max-width: 200px !important;
                    text-align: center !important;
                }
                
                /* Texte court dans la bulle sur mobile */
                .vs-waiting-bubble span:not(.vs-countdown) {
                    display: none !important;
                }
                
                .vs-waiting-bubble::before {
                    content: "Patientez" !important;
                    display: inline !important;
                }
                
                /* Permettre à la section header de montrer la bulle */
                .cgv-section-header {
                    overflow: visible !important;
                    margin-bottom: 50px !important;
                }

                /* Réduction padding des sections CGV sur mobile */
                #cgv-vigilance-section {
                    padding: 16px !important;
                }

                /* Grille de résumé CGV responsive */
                div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
                    grid-template-columns: 1fr !important;
                }

                /* ✅ Correction carte Avis Web sur mobile */
                .provider-info-container {
                    flex-direction: column !important;
                }

                .web-reviews-card {
                    flex: 1 1 100% !important;
                    min-width: 100% !important;
                    max-width: 100% !important;
                    margin-bottom: 16px !important;
                }

                /* Carte fournisseur en pleine largeur sur mobile */
                .provider-info-container > div[style*="flex: 1 1 72%"] {
                    flex: 1 1 100% !important;
                    min-width: 100% !important;
                    max-width: 100% !important;
                }

                /* ✅ Correction carte Exclusions de garantie sur mobile */
                .exclusions-card-container {
                    padding: 16px !important;
                    overflow-x: hidden !important;
                }

                .exclusions-header {
                    flex-wrap: wrap !important;
                    gap: 8px !important;
                }

                .exclusions-header h5 {
                    font-size: 16px !important;
                    line-height: 1.4 !important;
                }

                .exclusions-grid {
                    grid-template-columns: 1fr !important;
                    gap: 16px !important;
                }

                .exclusions-subcard {
                    padding: 16px !important;
                    overflow-x: hidden !important;
                    max-width: 100% !important;
                }

                .exclusions-list {
                    padding-left: 20px !important;
                    overflow-x: hidden !important;
                    max-width: 100% !important;
                }

                .exclusions-list li {
                    word-wrap: break-word !important;
                    overflow-wrap: break-word !important;
                    hyphens: auto !important;
                    max-width: 100% !important;
                    padding-right: 0 !important;
                }

                .exclusions-footer {
                    padding: 12px !important;
                    font-size: 12px !important;
                    word-wrap: break-word !important;
                    overflow-wrap: break-word !important;
                }
        }

        /* Grille dynamique pour upload */
        .upload-container {
                display: grid;
                gap: 16px;
                margin-bottom: 24px;
        }
        
        .upload-container[data-cols="1"] { grid-template-columns: 1fr; }
        .upload-container[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
        .upload-container[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
        .upload-container[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
        .upload-container[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
        
        @media (max-width: 768px) {
                .upload-container { grid-template-columns: 1fr !important; }
        }
        
        .upload-container[data-cols="1"] .upload-area {
                max-width: 600px;
                margin: 0 auto;
        }
        
        /* Tooltip pour explication du score */
        .score-info-icon {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 18px;
                height: 18px;
                border-radius: 50%;
                background: #e5e7eb;
                color: #6b7280;
                font-size: 12px;
                font-weight: 600;
                cursor: pointer;
                margin-left: 6px;
                transition: all 0.2s ease;
                position: relative;
        }
        
        .score-info-icon:hover {
                background: var(--primary-color);
                color: white;
                transform: scale(1.1);
        }
        
        .score-tooltip {
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                background: white;
                border: 1px solid #e5e7eb;
                border-radius: 12px;
                padding: 20px;
                box-shadow: 0 10px 40px rgba(0,0,0,0.2);
                z-index: 10000;
                width: 340px;
                max-width: 90vw;
                display: none;
                animation: tooltipFadeIn 0.2s ease;
                max-height: 80vh;
                overflow-y: auto;
        }
        
        .score-tooltip.show {
                display: block;
        }
        
        @keyframes tooltipFadeIn {
                from {
                        opacity: 0;
                        transform: translate(-50%, -50%) scale(0.95);
                }
                to {
                        opacity: 1;
                        transform: translate(-50%, -50%) scale(1);
                }
        }
        
        /* Overlay sombre derrière le tooltip */
        .tooltip-overlay {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.4);
                z-index: 9999;
                display: none;
                animation: overlayFadeIn 0.2s ease;
        }
        
        .tooltip-overlay.show {
                display: block;
        }
        
        @keyframes overlayFadeIn {
                from { opacity: 0; }
                to { opacity: 1; }
        }
        
        .score-tooltip h5 {
                margin: 0 0 16px 0;
                font-size: 16px;
                font-weight: 700;
                color: #111827;
                text-align: center;
        }
        
        .score-tooltip p {
                margin: 0 0 16px 0;
                font-size: 13px;
                line-height: 1.6;
                color: #374151;
        }
        
        .score-tooltip .grade-legend {
                margin: 16px 0;
                font-size: 13px;
                line-height: 2;
                background: #f9fafb;
                padding: 12px;
                border-radius: 8px;
        }
        
        .score-tooltip .grade-legend div {
                margin: 6px 0;
                color: #1f2937;
                display: flex;
                align-items: center;
                gap: 8px;
        }
        
        .score-tooltip .calculation-info {
                margin-top: 16px;
                padding-top: 16px;
                border-top: 1px solid #e5e7eb;
                font-size: 13px;
                line-height: 1.8;
        }
        
        .score-tooltip .calculation-info div {
                margin: 6px 0;
                color: #374151;
        }
        
        .tooltip-close {
                position: absolute;
                top: 12px;
                right: 12px;
                width: 28px;
                height: 28px;
                border-radius: 50%;
                background: #f3f4f6;
                border: none;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #6b7280;
                font-size: 16px;
                transition: all 0.2s ease;
        }
        
        .tooltip-close:hover {
                background: #e5e7eb;
                color: #111827;
        }
        
        @media (max-width: 768px) {
                .score-tooltip {
                        width: 280px;
                        padding: 14px;
                }
        }
        
        .file-card {
                background: #fff;
                border: 1px solid #E5E7EB;
                border-radius: 12px;
                overflow: hidden;
                box-shadow: 0 1px 3px rgba(0,0,0,0.06);
                display: flex;
                flex-direction: column;
                position: relative;
                width: 100%;
                height: 254px;
        }
        .file-card .thumb-wrap {
                background: #F9FAFB;
                height: 180px;
                display: flex;
                align-items: center;
                justify-content: center;
                overflow: hidden;
                position: relative;
        }
        
        .file-card canvas {
                width: 100%;
                height: 100%;
                object-fit: contain;
                display: block;
        }
        
        .file-card-body {
                padding: 16px;
                display: flex;
                align-items: flex-start;
                justify-content: space-between;
                gap: 8px;
                flex: 1;
        }
        
        .file-card-title {
                font-weight: 600;
                font-size: 14px;
                line-height: 1.2;
                overflow: hidden;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
        }
        
        .file-card-meta {
                color: #6B7280;
                font-size: 12px;
                margin-top: 6px;
        }
        
        .file-remove {
                background: none;
                border: none;
                color: #6B7280;
                cursor: pointer;
                padding: 4px;
                border-radius: 8px;
                position: absolute;
                top: 8px;
                right: 8px;
                background: white;
                box-shadow: 0 1px 3px rgba(0,0,0,0.1);
                width: 32px;
                height: 32px;
                display: flex;
                align-items: center;
                justify-content: center;
        }
        
        .file-remove:hover {
                color: #D92D20;
                background: #FEF3F2;
        }
        
        .file-pages-badge {
                position: absolute;
                bottom: 8px;
                left: 8px;
                background: rgba(0,0,0,0.7);
                color: white;
                padding: 4px 8px;
                border-radius: 4px;
                font-size: 12px;
                font-weight: 500;
        }

        /* ═══════════════════════════════════════════════════════════════
           OVERLAYS DE CONVERSION (Agent DocType)
           ═══════════════════════════════════════════════════════════════ */
        
        .conversion-overlay {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(255, 255, 255, 0.97);
                backdrop-filter: blur(4px);
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                z-index: 100;
                border-radius: 12px;
                transition: opacity 0.3s ease;
        }
        
        /* Spinner circulaire animé */
        .conversion-spinner {
                width: 48px;
                height: 48px;
                border: 4px solid #E5E7EB;
                border-top: 4px solid var(--primary-color);
                border-radius: 50%;
                animation: spin 1s linear infinite;
                margin-bottom: 16px;
        }
        
        @keyframes spin {
                0% { transform: rotate(0deg); }
                100% { transform: rotate(360deg); }
        }
        
        /* Texte principal */
        .conversion-text {
                font-weight: 600;
                font-size: 14px;
                color: var(--text-primary);
                margin-bottom: 4px;
                text-align: center;
        }
        
        /* Sous-texte avec animation des points */
        .conversion-subtext {
                font-size: 12px;
                color: var(--text-secondary);
                text-align: center;
        }
        
        .conversion-subtext::after {
                content: '';
                animation: ellipsis 1.5s infinite;
        }
        
        @keyframes ellipsis {
                0% { content: ''; }
                25% { content: '.'; }
                50% { content: '..'; }
                75% { content: '...'; }
                100% { content: ''; }
        }
        
        /* Badge de progression pour OCR */
        .conversion-progress {
                margin-top: 8px;
                font-size: 11px;
                color: var(--primary-color);
                font-weight: 500;
                padding: 4px 8px;
                background: rgba(59, 130, 246, 0.1);
                border-radius: 4px;
        }

        /* Alerts */
        .alert {
                padding: 20px;
                border-radius: 12px;
                margin-bottom: 20px;
                border: 1px solid;
        }

        .alert-success {
                background: #dcfce7;
                border-color: var(--success-color);
                color: #166534;
        }

        .alert-danger {
                background: #fee2e2;
                border-color: #fecaca;
                color: #b91c1c;
        }

        .alert-warning {
                background: #fef3c7;
                border-color: #fde68a;
                color: #92400e;
        }

        .alert-info {
                background: #dbeafe;
                border-color: #bfdbfe;
                color: #1e40af;
        }

        .page-limit-info, .pdf-type-info {
                margin: 15px 0;
        }

        .limit-stats {
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 10px;
                margin-bottom: 15px;
                font-size: 16px;
        }

        .stat {
                color: #dc2626;
        }

        .stat-separator {
                color: #6b7280;
        }

        .limit-message {
                background: rgba(255, 255, 255, 0.5);
                padding: 15px;
                border-radius: 8px;
                line-height: 1.6;
                font-size: 14px;
        }

        .action-buttons {
                margin-top: 20px;
                text-align: center;
        }

        /* Dynamic Progress Animations */
        @keyframes spin {
                0% { transform: rotate(0deg); }
                100% { transform: rotate(360deg); }
        }

        .loading-spinner {
                width: 16px;
                height: 16px;
                border: 2px solid #e5e7eb;
                border-top-color: #3b82f6;
                border-radius: 50%;
                animation: spin 0.8s linear infinite;
        }
        @keyframes shimmer {
                0% { transform: translateX(-100%); }
                100% { transform: translateX(100%); }
        }

        @keyframes slideInDown {
                0% {
                    transform: translateX(-50%) translateY(-20px);
                    opacity: 0;
                }
                100% {
                    transform: translateX(-50%) translateY(0);
                    opacity: 1;
                }
        }

        @keyframes slideOutUp {
                0% {
                    transform: translateX(-50%) translateY(0);
                    opacity: 1;
                }
                100% {
                    transform: translateX(-50%) translateY(-20px);
                    opacity: 0;
                }
        }

        @keyframes fadeInUp {
                0% {
                    transform: translateY(20px);
                    opacity: 0;
                }
                100% {
                    transform: translateY(0);
                    opacity: 1;
                }
        }

        .progress-item {
                animation: fadeInUp 0.6s ease-out;
        }

        .progress-item.active {
                box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
        }

        .progress-item.completed {
                box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
        }
        #encouragementMessage {
                animation: fadeInUp 0.5s ease-out;
        }

        #timeCounter {
                font-weight: 500;
                letter-spacing: 0.5px;
        }

        /* Pulse animation for active step */
        .progress-item.active .step-icon {
                animation: pulse 2s infinite;
        }

        @keyframes pulse {
                0% {
                    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
                }
                70% {
                    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
                }
                100% {
                    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
                }
        }

        /* Styles pour fichiers multiples */
        .files-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .file-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: rgba(99, 102, 241, 0.05);
            border: 1px solid rgba(99, 102, 241, 0.2);
            border-radius: 8px;
            transition: all 0.2s ease;
        }

        .file-item:hover {
            background: rgba(99, 102, 241, 0.1);
        }

        .file-info {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
        }

        .file-icon {
            color: var(--primary-color);
            font-size: 1.2em;
        }
        .file-details {
            flex: 1;
        }

        .file-name {
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 2px;
        }

        .file-size {
            font-size: 0.85em;
            color: var(--text-secondary);
        }

        .file-remove {
            background: none;
            border: none;
            color: #ef4444;
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .file-remove:hover {
            background: rgba(239, 68, 68, 0.1);
            transform: scale(1.1);
        }

        .files-counter {
            text-align: center;
            font-weight: 500;
            color: var(--primary-color);
            margin-bottom: 15px;
        }

        .files-merge-info {
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid rgba(16, 185, 129, 0.2);
            border-radius: 8px;
            padding: 12px;
            margin-top: 10px;
            font-size: 0.9em;
            color: #065f46;
        }

        .files-merge-info i {
            color: #10b981;
            margin-right: 8px;
        }
        .chat-bubble { max-width: 80%; padding: 12px 14px; margin: 8px 0; border-radius: 12px; line-height: 1.5; }
        .chat-bubble.user { margin-left: auto; background: var(--primary-color); color: #fff; }
        .chat-bubble.assistant { margin-right: auto; background: #ffffff; border: 1px solid var(--border-color); color: var(--text-primary); }
        .chat-bubble.assistant ul { margin: 6px 0 0 20px; padding: 0; }
        .chat-bubble.assistant li { margin: 4px 0; }

        /* Animations pour les notifications */
        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOut {
            from {
                transform: translateX(0);
                opacity: 1;
            }
            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        /* Style pour l'icône d'édition */
        .clause-header .fa-edit:hover {
            color: #d97706 !important;
            transform: scale(1.1);
            transition: all 0.2s ease;
        }
        .chat-bubble.assistant code { background: #f3f4f6; padding: 1px 4px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
        .typing { display: inline-flex; gap: 4px; align-items: center; }
        .typing span { width: 6px; height: 6px; background: var(--text-secondary); border-radius: 50%; display: inline-block; animation: blink 1s infinite ease-in-out; }
        .typing span:nth-child(2) { animation-delay: .2s; }
        .typing span:nth-child(3) { animation-delay: .4s; }
        @keyframes blink { 0%, 80%, 100% {opacity: .2} 40% {opacity: 1} }
        @keyframes spin {
                0% { transform: rotate(0deg); }
                100% { transform: rotate(360deg); }
        }
        
        /* Styles pour la modale */
        .modal {
                display: none;
                position: fixed;
                z-index: 1000;
                width: 100%;
                height: 100%;
                overflow: auto;
                background-color: rgba(0,0,0,0.4);
                animation: fadeIn 0.3s;
        }
        
        @keyframes fadeIn {
                from {opacity: 0;}
                to {opacity: 1;}
        }
        
        .modal-content {
                animation: slideIn 0.3s;
        }
        
        /* Centrage flex pour les modaux de chat uniquement */
        #conditionsChatModal[style*="display: block"],
        #clauseChatModal[style*="display: block"] {
                display: flex !important;
                justify-content: center !important;
                align-items: flex-start !important;
                padding-top: 4% !important;
                max-width: none !important; /* Supprimer la limite de 600px de components.css */
        }
        
        #conditionsChatModal .modal-content,
        #clauseChatModal .modal-content {
                margin: 0 !important;
        }
        
        @keyframes slideIn {
                from {transform: translateY(-50px); opacity: 0;}
                to {transform: translateY(0); opacity: 1;}
        }
        
        @keyframes slideInDown {
                0% { 
                    opacity: 0; 
                    transform: translateY(-20px) scale(0.95); 
                }
                100% { 
                    opacity: 1; 
                    transform: translateY(0) scale(1); 
                }
        }
        
        @keyframes slideOutUp {
                0% { 
                    opacity: 1; 
                    transform: translateY(0) scale(1); 
                }
                100% { 
                    opacity: 0; 
                    transform: translateY(-20px) scale(0.95); 
                }
        }
        
        .close:hover,
        .close:focus {
                color: var(--danger-color);
                text-decoration: none;
                cursor: pointer;
        }
        
        .clause-original-content {
                background: #f8fafc;
                border: 1px solid var(--border-color);
                border-radius: 8px;
                padding: 20px;
                font-family: 'Georgia', serif;
                font-size: 15px;
                line-height: 1.7;
                color: var(--text-primary);
                white-space: pre-wrap;
                word-wrap: break-word;
        }

        /* Modal Mode Boost */
        .boost-modal {
            display: none;
            position: fixed;
            z-index: 10000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            align-items: center;
            justify-content: center;
        }

        .boost-modal.active {
            display: flex;
        }

        .boost-modal-content {
            background-color: white;
            border-radius: 16px;
            padding: 32px;
            max-width: 520px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            animation: modalSlideIn 0.3s ease;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-20px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .boost-modal-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 24px;
        }

        .boost-modal-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: linear-gradient(135deg, #8b5cf6, #7c3aed);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
        }

        .boost-modal-title {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .boost-modal-body {
            margin-bottom: 24px;
        }

        .boost-modal-body p {
            color: var(--text-secondary);
            line-height: 1.6;
            margin-bottom: 16px;
        }

        .boost-features {
            background: #f8fafc;
            border-radius: 12px;
            padding: 20px;
            margin: 20px 0;
        }

        .boost-features h4 {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 12px;
        }

        .boost-features ul {
            list-style: none;
            padding: 0;
        }

        .boost-features li {
            padding: 8px 0;
            color: var(--text-secondary);
            display: flex;
            align-items: start;
            gap: 8px;
        }

        .boost-features li:before {
            content: "✓";
            color: #10b981;
            font-weight: 700;
            font-size: 16px;
        }

        .boost-modal-footer {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }

        .boost-modal-close {
            background: var(--border-color);
            color: var(--text-primary);
        }

        .boost-modal-close:hover {
            background: #cbd5e1;
        }

