 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            min-height: 100dvh; /* Dynamic viewport height para mobile */
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 10px;
        }
        
        .chat-widget {
            width: 400px;
            max-width: 100%;
            height: 600px;
            max-height: calc(100vh - 20px);
            max-height: calc(100dvh - 20px); /* Dynamic viewport para mobile */
            background: white;
            border-radius: 20px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.2);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }
        
        /* Header do Chat */
        .chat-header {
            background: linear-gradient(135deg, #007bff, #0056b3);
            color: white;
            padding: 15px 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            flex-shrink: 0;
        }
        
        .chat-avatar {
            width: 40px;
            height: 40px;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            color: #007bff;
            font-weight: bold;
        }
        
        .chat-info h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 3px;
        }
        
        .chat-status {
            font-size: 12px;
            opacity: 0.9;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #4caf50;
            animation: pulse 2s infinite;
        }
        
        .status-dot.offline {
            background: #f44336;
            animation: none;
        }
        
        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
            100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
        }
        
        /* Área de mensagens */
        .chat-messages {
            flex: 1;
            padding: 15px;
            overflow-y: auto;
            background: #f8f9fa;
            scroll-behavior: smooth;
            min-height: 0; /* Importante para flex */
        }
        
        .chat-messages::-webkit-scrollbar {
            width: 6px;
        }
        
        .chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .chat-messages::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 3px;
        }
        
        .message-wrapper {
            margin-bottom: 15px;
        }
        
        .message {
            max-width: 85%;
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 14px;
            line-height: 1.4;
            word-wrap: break-word;
            position: relative;
            animation: messageSlide 0.3s ease-out;
        }
        
        @keyframes messageSlide {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .message.user {
            background: linear-gradient(135deg, #007bff, #0056b3);
            color: white;
            margin-left: auto;
            border-bottom-right-radius: 4px;
        }
        
        .message.bot {
            background: white;
            color: #333;
            border: 1px solid #e9ecef;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
            border-bottom-left-radius: 4px;
        }
        
        .message-time {
            font-size: 11px;
            opacity: 0.6;
            margin-top: 5px;
            text-align: right;
        }
        
        .message.bot .message-time {
            text-align: left;
        }
        
        /* Quick Replies */
        .quick-replies {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin: 10px 0;
            max-width: 85%;
        }
        
        .quick-reply {
            background: #e3f2fd;
            border: 2px solid #bbdefb;
            border-radius: 20px;
            padding: 8px 14px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            color: #1976d2;
            transition: all 0.2s ease;
            outline: none;
        }
        
        .quick-reply:hover {
            background: #007bff;
            color: white;
            border-color: #007bff;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0,123,255,0.3);
        }
        
        .quick-reply:active {
            transform: translateY(0);
        }
        
        /* Estilos para múltipla seleção */
        .multiple-selection-header {
            text-align: center;
            margin-bottom: 8px;
            color: #666;
            font-style: italic;
        }
        
        .multiple-selectable {
            position: relative;
            transition: all 0.3s ease;
        }
        
        .multiple-selectable.selected {
            background: #28a745 !important;
            color: white !important;
            border-color: #28a745 !important;
            transform: scale(0.98);
        }
        
        .multiple-selectable.selected::after {
            content: "✓";
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-weight: bold;
            font-size: 12px;
        }
        
        .confirm-multiple-selection {
            background: #007bff;
            border: 2px solid #007bff;
            border-radius: 20px;
            padding: 10px 16px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: white;
            transition: all 0.2s ease;
            outline: none;
            margin-top: 10px;
            width: 100%;
            text-align: center;
        }
        
        .confirm-multiple-selection:hover:not(:disabled) {
            background: #0056b3;
            border-color: #0056b3;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,123,255,0.4);
        }
        
        .confirm-multiple-selection:disabled {
            background: #6c757d;
            border-color: #6c757d;
            cursor: not-allowed;
            opacity: 0.6;
        }
        
        .confirm-multiple-selection:active:not(:disabled) {
            transform: translateY(0);
        }
        
        /* Indicador de digitação */
        .typing-indicator {
            display: none;
            padding: 12px 16px;
            background: white;
            border-radius: 18px;
            border-bottom-left-radius: 4px;
            border: 1px solid #e9ecef;
            max-width: 85%;
            margin-bottom: 15px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }
        
        .typing-dots {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        
        .typing-dot {
            width: 8px;
            height: 8px;
            background: #007bff;
            border-radius: 50%;
            animation: typing 1.4s infinite ease-in-out;
        }
        
        .typing-dot:nth-child(1) { animation-delay: -0.32s; }
        .typing-dot:nth-child(2) { animation-delay: -0.16s; }
        .typing-dot:nth-child(3) { animation-delay: 0s; }
        
        @keyframes typing {
            0%, 80%, 100% {
                transform: scale(0.8);
                opacity: 0.5;
            }
            40% {
                transform: scale(1);
                opacity: 1;
            }
        }
        
        /* Input área */
        .chat-input {
            padding: 15px;
            background: white;
            border-top: 1px solid #e9ecef;
            display: flex;
            gap: 10px;
            align-items: flex-end;
            flex-shrink: 0;
        }
        
        .input-container {
            flex: 1;
            position: relative;
        }

        .input-type-indicator {
            position: absolute;
            top: -25px;
            left: 16px;
            background: #007bff;
            color: white;
            padding: 2px 8px;
            border-radius: 8px;
            font-size: 10px;
            font-weight: 500;
            z-index: 10;
            animation: fadeIn 0.3s ease;
        }

        .input-type-indicator::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 10px;
            width: 0;
            height: 0;
            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
            border-top: 4px solid #007bff;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .message-input {
            width: 100%;
            padding: 12px 45px 12px 16px;
            border: 2px solid #e9ecef;
            border-radius: 25px;
            outline: none;
            font-size: 14px;
            font-family: inherit;
            resize: none;
            max-height: 80px;
            min-height: 44px;
            line-height: 1.4;
            transition: all 0.2s ease;
        }

        .dynamic-input {
            height: 44px !important;
            min-height: 44px !important;
            max-height: 44px !important;
            resize: none !important;
        }

        .message-input[type="file"] {
            padding: 8px 45px 8px 16px;
        }

        .message-input[type="date"],
        .message-input[type="time"],
        .message-input[type="datetime-local"] {
            cursor: pointer;
        }

        .message-input[type="number"] {
            -moz-appearance: textfield;
        }

        .message-input[type="number"]::-webkit-outer-spin-button,
        .message-input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        
        .message-input:focus {
            border-color: #007bff;
            box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
        }
        
        .message-input:disabled {
            background: #f8f9fa;
            color: #6c757d;
            cursor: not-allowed;
        }
        
        .emoji-button {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            padding: 5px;
            border-radius: 50%;
            transition: background 0.2s ease;
        }
        
        .emoji-button:hover {
            background: #f0f0f0;
        }
        
        .send-button {
            width: 44px;
            height: 44px;
            background: linear-gradient(135deg, #007bff, #0056b3);
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.2s ease;
            flex-shrink: 0;
        }
        
        .send-button:hover:not(:disabled) {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
        }
        
        .send-button:disabled {
            background: #6c757d;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        
        /* Notificações */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 12px 20px;
            border-radius: 8px;
            color: white;
            font-size: 14px;
            font-weight: 500;
            z-index: 1000;
            animation: slideIn 0.3s ease-out;
        }
        
        .notification.success {
            background: #4caf50;
        }
        
        .notification.error {
            background: #f44336;
        }
        
        .notification.warning {
            background: #ff9800;
        }
        
        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }
        
        /* Loading inicial */
        .loading-screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 10;
            transition: opacity 0.5s ease;
        }
        
        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #007bff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .loading-text {
            color: #666;
            font-size: 14px;
        }
        
        /* Responsividade para iPhone e dispositivos móveis */
        @media (max-width: 480px) {
            body {
                padding: 0;
                align-items: stretch;
                min-height: 100vh;
                min-height: 100dvh;
            }
            
            .chat-widget {
                width: 100%;
                height: 100vh;
                height: 100dvh;
                max-height: none;
                border-radius: 0;
                box-shadow: none;
            }
            
            .chat-header {
                padding: 12px 15px;
                /* Considera o safe area do iPhone */
                padding-top: max(12px, env(safe-area-inset-top));
            }
            
            .chat-input {
                padding: 12px 15px;
                /* Considera o safe area do iPhone */
                padding-bottom: max(12px, env(safe-area-inset-bottom));
            }
            
            .message {
                max-width: 90%;
                font-size: 15px; /* Ligeiramente maior para mobile */
            }
            
            .quick-replies {
                max-width: 90%;
            }
            
            .typing-indicator {
                max-width: 90%;
            }
            
            .chat-messages {
                padding: 12px 15px;
            }
        }
        
        /* Para iPhone X e posteriores com notch */
        @supports (padding: max(0px)) {
            @media (max-width: 480px) {
                .chat-header {
                    padding-top: max(15px, env(safe-area-inset-top));
                }
                
                .chat-input {
                    padding-bottom: max(15px, env(safe-area-inset-bottom));
                }
            }
        }
        
        /* Prevent zoom on input focus in iOS */
        @media (max-width: 480px) {
            .message-input {
                font-size: 16px; /* Evita zoom no iOS */
            }
        }
        
        /* Scroll suave */
        html {
            scroll-behavior: smooth;
        }
        
        /* Seleção de texto */
        ::selection {
            background: rgba(0, 123, 255, 0.2);
        }