   
   * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        :root {
            --primary: #1e7b4b;
            --primary-dark: #0f5e3a;
            --primary-soft: #eaf6ef;
            --primary-border: #c2dfce;
            --text-dark: #0f2c1f;
            --text-mid: #385c48;
            --text-soft: #6e8b7a;
            --bg-page: #ecf3ef;
            --surface: #ffffff;
            --shadow-lg: 0 20px 42px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.03);
            --radius-card: 28px;
        }

        body,
        html {
            height: 100%;
            width: 100%;
            overflow: hidden;
            font-family: 'Inter', sans-serif;
            background: var(--bg-page);
        }

        .app-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
            padding: 12px;
        }

        .chat-container {
            width: 100%;
            max-width: 480px;
            height: 100%;
            background: var(--surface);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
            transition: all 0.2s ease;
        }

        @media (min-width: 640px) {
            .app-wrapper {
                padding: 20px;
            }

            .chat-container {
                height: 88vh;
                max-height: 780px;
                border-radius: var(--radius-card);
                box-shadow: var(--shadow-lg);
            }
        }

        .chat-header {
            padding: 14px 20px 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--primary-border);
            background: var(--surface);
            flex-shrink: 0;
        }

        .back-icon {
            width: 36px;
            height: 36px;
            background: var(--primary-soft);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--primary);
            transition: 0.2s;
            flex-shrink: 0;
        }

        .back-icon:hover {
            background: var(--primary-border);
            transform: scale(1.02);
        }

        .agent-info {
            flex: 1;
        }

        .agent-name {
            font-weight: 700;
            font-size: 16px;
            color: var(--text-dark);
            letter-spacing: -0.2px;
        }

        .agent-badge {
            font-size: 11px;
            color: var(--primary);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .status-dot {
            width: 7px;
            height: 7px;
            background: #2aad6a;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% {
                opacity: 0.6;
            }

            50% {
                opacity: 1;
            }

            100% {
                opacity: 0.6;
            }
        }

        .avatar-wrapper {
            width: 46px;
            height: 46px;
            border-radius: 50%;
            background: linear-gradient(145deg, var(--primary), #2e9b62);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
            box-shadow: 0 4px 10px rgba(30, 123, 75, 0.2);
        }

        .avatar-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }



        .initial-message {
            background: var(--primary-soft);
            padding: 10px 16px;
            border-radius: 24px;
            border-bottom-left-radius: 4px;
            font-size: 10px;
            line-height: 1.55;
            color: var(--text-dark);
            border: 1px solid var(--primary-border);
            font-weight: 200;

        }

        .categories-grid {
            padding: 12px 20px 16px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            flex-shrink: 0;
        }

        .cat-button {
            background: var(--primary-soft);
            border: 1.5px solid var(--primary-border);
            border-radius: 60px;
            padding: 11px 6px;
            font-size: 13px;
            font-weight: 600;
            color: #1a4d2c;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-family: 'Inter', sans-serif;
        }

        .cat-button:hover {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
            transform: translateY(-1px);
            box-shadow: 0 6px 14px rgba(30, 123, 75, 0.2);
        }

        .messages-area {
            flex: 1;
            overflow-y: auto;
            padding: 10px 22px 18px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            scroll-behavior: smooth;
        }

        .messages-area::-webkit-scrollbar {
            width: 5px;
        }

        .messages-area::-webkit-scrollbar-track {
            background: #e3ede6;
            border-radius: 10px;
        }

        .messages-area::-webkit-scrollbar-thumb {
            background: #bacec0;
            border-radius: 10px;
        }

        .msg {
            max-width: 80%;
            padding: 8px 14px;
            border-radius: 20px;
            font-size: 13.5px;
            line-height: 1.5;
            font-weight: 500;
            word-break: break-word;
            animation: fadeSlide 0.2s ease;
        }

        @keyframes fadeSlide {
            from {
                opacity: 0;
                transform: translateY(8px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .msg-bot {
            align-self: flex-start;
            background: var(--primary-soft);
            border: 1px solid var(--primary-border);
            color: var(--text-dark);
            border-bottom-left-radius: 6px;
        }

        .msg-user {
            align-self: flex-end;
            background: var(--primary);
            color: white;
            border-bottom-right-radius: 6px;
            box-shadow: 0 2px 8px rgba(30, 123, 75, 0.25);
        }

        /* Estilo para links "disfarçados" — apenas texto em negrito, sem mostrar URL */
        .msg-bot a.whatsapp-link,
        .msg-bot a.email-link,
        .msg-bot a.contact-link {
            display: inline-block;
            font-weight: 700;
            text-decoration: none;
            background: var(--primary);
            color: white;
            padding: 6px 16px;
            border-radius: 40px;
            margin: 4px 2px;
            font-size: 12px;
            transition: 0.2s;
            cursor: pointer;
        }

        .msg-bot a.whatsapp-link:hover,
        .msg-bot a.email-link:hover {
            background: var(--primary-dark);
            transform: scale(1.02);
        }

        /* Botões de ação inline */
        .action-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .btn-inline {
            background: var(--primary);
            color: white;
            border: none;
            padding: 6px 14px;
            border-radius: 40px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: 0.2s;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .btn-inline:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
        }

        .typing-indicator {
            display: flex;
            gap: 6px;
            padding: 10px 16px;
            background: var(--primary-soft);
            border: 1px solid var(--primary-border);
            border-radius: 20px;
            border-bottom-left-radius: 6px;
            width: fit-content;
            align-self: flex-start;
        }

        .typing-indicator span {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #8bbaa2;
            animation: typingAnim 1.2s infinite;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes typingAnim {

            0%,
            80%,
            100% {
                transform: scale(0.6);
                opacity: 0.5;
            }

            40% {
                transform: scale(1);
                opacity: 1;
                background: var(--primary);
            }
        }

        .footer-area {
            padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
            border-top: 1px solid var(--primary-border);
            background: var(--surface);
            flex-shrink: 0;
        }

        .input-group {
            display: flex;
            align-items: center;
            background: var(--primary-soft);
            border: 1.5px solid var(--primary-border);
            border-radius: 48px;
            padding: 5px 5px 5px 18px;
            gap: 8px;
            transition: 0.2s;
        }

        .input-group:focus-within {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(30, 123, 75, 0.1);
        }

        #userMessage {
            flex: 1;
            border: none;
            outline: none;
            background: transparent;
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-dark);
            padding: 10px 0;
        }

        #userMessage::placeholder {
            color: var(--text-soft);
            font-weight: 400;
        }

        .send-button {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            border: none;
            background: #c1d8cb;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: default;
            transition: 0.2s;
            flex-shrink: 0;
        }

        .send-button.active {
            background: var(--primary);
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(30, 123, 75, 0.3);
        }

        .send-button.active:hover {
            background: var(--primary-dark);
            transform: scale(1.02);
        }

        .footer-note {
            font-size: 9.5px;
            text-align: center;
            color: var(--text-soft);
            margin-top: 10px;
            letter-spacing: 0.3px;
        }
    