/* (gardez votre CSS exactement comme dans votre fichier original) */
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        .chat-container {
            width: 550px;
            max-width: 100%;
            height: 750px;
            background: white;
            border-radius: 30px;
            box-shadow: 0 30px 50px rgba(0,0,0,0.3);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .chat-header {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 20px;
            text-align: center;
            flex-shrink: 0;
        }
        .chat-header h1 { font-size: 1.3rem; margin-bottom: 5px; }
        .chat-header p { font-size: 0.75rem; opacity: 0.9; line-height: 1.5; }
        .lang-selector {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            padding: 8px 20px;
            background: white;
            border-bottom: 1px solid #eee;
            flex-shrink: 0;
        }
        .lang-selector .lang-btn {
            background: none;
            border: none;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            padding: 6px 12px;
            border-radius: 30px;
            transition: 0.2s;
            color: #667eea;
        }
        .lang-selector .lang-btn.active {
            background: #667eea;
            color: white;
        }
        .lang-selector .lang-btn:hover {
            background: rgba(102,126,234,0.1);
        }
        .connection-status {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #4ade80;
            margin-left: 8px;
            box-shadow: 0 0 6px #4ade80;
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0%, 100% { box-shadow: 0 0 4px #4ade80; }
            50%       { box-shadow: 0 0 10px #4ade80; }
        }
        .chat-messages {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
            background: #f8f9fa;
            scroll-behavior: smooth;
        }
        .message {
            max-width: 85%;
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 0.9rem;
            line-height: 1.5;
            animation: fadeIn 0.3s ease;
            word-wrap: break-word;
            word-break: break-word;
        }
        .user {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 5px;
        }
        .bot {
            background: white;
            color: #333;
            align-self: flex-start;
            border-bottom-left-radius: 5px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.07);
        }
        .lead-captured {
            background: #e8f5e9;
            color: #2e7d32;
            border-left: 4px solid #4caf50;
            font-size: 0.8rem;
            padding: 8px 12px;
            border-radius: 10px;
            align-self: stretch;
        }
        .typing {
            background: #e9ecef;
            color: #6c757d;
            align-self: flex-start;
            padding: 12px 16px;
            border-radius: 18px;
            font-style: italic;
            font-size: 0.85rem;
        }
        .chat-input {
            display: flex;
            gap: 10px;
            padding: 16px 20px;
            background: white;
            border-top: 1px solid #eee;
            flex-shrink: 0;
        }
        .chat-input input {
            flex: 1;
            padding: 12px 18px;
            border: 1px solid #ddd;
            border-radius: 30px;
            outline: none;
            font-size: 0.9rem;
            transition: border-color 0.2s;
        }
        .chat-input input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }
        .chat-input input:disabled { background: #f1f1f1; cursor: not-allowed; }
        .send-btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 0 20px;
            border-radius: 30px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.9rem;
            transition: opacity 0.2s, transform 0.1s;
            white-space: nowrap;
        }
        .send-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
        .send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
        .footer-buttons {
            display: flex;
            gap: 10px;
            padding: 0 20px 16px;
            flex-shrink: 0;
        }
        .footer-buttons button {
            flex: 1;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 25px;
            cursor: pointer;
            font-weight: 500;
            background: transparent;
            color: #666;
            font-size: 0.85rem;
            transition: all 0.2s;
        }
        .footer-buttons button:hover { background: #f0f0f0; border-color: #bbb; }
        .urgency-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }
        .urgency-btn {
            flex: 1;
            min-width: 120px;
            padding: 10px 8px;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.8rem;
            text-align: center;
            transition: transform 0.15s, opacity 0.2s;
            line-height: 1.4;
        }
        .urgency-btn:hover { transform: scale(1.03); opacity: 0.92; }
        .urgency-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
        .urgency-1 { background: #ef4444; color: white; }
        .urgency-2 { background: #f59e0b; color: white; }
        .urgency-3 { background: #eab308; color: white; }
        .urgency-4 { background: #10b981; color: white; }
        .custom-option {
            display: inline-block;
            background: #e2e8f0;
            border: none;
            padding: 8px 16px;
            border-radius: 25px;
            margin: 4px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.2s;
        }
        .custom-option:hover { background: #cbd5e1; transform: scale(1.02); }
        .custom-option:disabled { opacity: 0.5; cursor: not-allowed; }
        .confirm-buttons { display: flex; gap: 10px; margin-top: 12px; }
        .confirm-btn {
            flex: 1;
            padding: 11px;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.9rem;
            transition: opacity 0.2s, transform 0.1s;
        }
        .confirm-btn:hover { opacity: 0.9; transform: translateY(-1px); }
        .confirm-yes { background: #10b981; color: white; }
        .confirm-no  { background: #ef4444; color: white; }
        .quick-reply {
            display: inline-block;
            background: #667eea;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 25px;
            margin: 4px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.2s;
        }
        .quick-reply:hover { background: #5a67d8; transform: scale(1.02); }
        .restore-banner {
            background: #e0e7ff;
            color: #4338ca;
            padding: 10px 15px;
            border-radius: 12px;
            font-size: 0.85rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }
        .restore-banner button {
            background: #4338ca;
            color: white;
            border: none;
            padding: 5px 14px;
            border-radius: 20px;
            cursor: pointer;
            white-space: nowrap;
            font-size: 0.8rem;
        }
        .progress-bar-wrapper {
            padding: 0 20px 6px;
            flex-shrink: 0;
        }
        .progress-bar-track {
            height: 4px;
            background: #e2e8f0;
            border-radius: 4px;
            overflow: hidden;
        }
        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 4px;
            transition: width 0.4s ease;
            width: 0%;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .chat-messages::-webkit-scrollbar { width: 5px; }
        .chat-messages::-webkit-scrollbar-track { background: transparent; }
        .chat-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
        @media (max-width: 600px) {
            body { padding: 0; align-items: flex-end; }
            .chat-container { width: 100%; height: 100vh; border-radius: 24px 24px 0 0; }
            .urgency-btn { min-width: 100px; font-size: 0.75rem; }
        }

.text-required { color: #ef4444; }