/* CIDADAPBOT - FLOATING CHATBOT */
        /* ====================================================== */

        :root {
            --chat-brand: #0369a1;
            --chat-brand-dark: #075985;
            --chat-brand-deep: #0c4a6e;
            --chat-soft: #f0f9ff;
            --chat-border: #dbeafe;
            --chat-text: #0f172a;
            --chat-muted: #64748b;
        }


        #cidadapbot-launcher {
            position: fixed;

            right: 24px;
            bottom: 24px;

            width: 60px;
            height: 60px;

            z-index: 9998;

            border: 0;
            border-radius: 999px;

            display: flex;
            align-items: center;
            justify-content: center;

            color: white;

            background:
                linear-gradient(
                    145deg,
                    #0ea5e9,
                    #0284c7 52%,
                    #0369a1
                );

            box-shadow:
                0 18px 42px rgba(2,132,199,.30),
                inset 0 1px 0 rgba(255,255,255,.24);

            cursor: pointer;

            transition:
                transform .35s cubic-bezier(.16,1,.3,1),
                box-shadow .35s ease,
                opacity .25s ease;

            animation:
                cidadapbotLauncherIntro
                .8s
                cubic-bezier(.16,1,.3,1)
                .7s
                both;
        }


        #cidadapbot-launcher::before {
            content: "";

            position: absolute;
            inset: -7px;

            border:
                1px solid rgba(14,165,233,.18);

            border-radius: inherit;

            opacity: .7;

            animation:
                cidadapbotPulse
                2.8s
                ease-out
                2s
                2;
        }


        #cidadapbot-launcher:hover {
            transform:
                translateY(-4px)
                scale(1.04);

            box-shadow:
                0 22px 50px rgba(2,132,199,.36),
                inset 0 1px 0 rgba(255,255,255,.28);
        }


        #cidadapbot-launcher.chat-open {
            opacity: 0;
            transform: scale(.78);
            pointer-events: none;
        }


        @keyframes cidadapbotLauncherIntro {

            from {
                opacity: 0;
                transform:
                    translateY(18px)
                    scale(.86);
            }

            to {
                opacity: 1;
                transform:
                    translateY(0)
                    scale(1);
            }

        }


        @keyframes cidadapbotPulse {

            0% {
                transform: scale(.90);
                opacity: .7;
            }

            100% {
                transform: scale(1.38);
                opacity: 0;
            }

        }



        /* ====================================================== */
        /* CHAT WINDOW */
        /* ====================================================== */

        #cidadapbot-window {
            position: fixed;

            right: 24px;
            bottom: 24px;

            width: min(410px, calc(100vw - 32px));
            height: min(610px, calc(100vh - 42px));

            z-index: 9999;

            display: flex;
            flex-direction: column;

            background:
                rgba(255,255,255,.985);

            border:
                1px solid rgba(186,230,253,.90);

            border-radius:
                28px;

            overflow: hidden;

            box-shadow:
                0 30px 85px rgba(15,23,42,.22),
                0 8px 30px rgba(2,132,199,.10),
                inset 0 1px 0 rgba(255,255,255,.90);

            opacity: 0;

            transform:
                translateY(24px)
                scale(.965);

            transform-origin:
                100% 100%;

            pointer-events: none;

            transition:
                opacity .32s ease,
                transform .42s cubic-bezier(.16,1,.3,1);
        }


        #cidadapbot-window.open {
            opacity: 1;

            transform:
                translateY(0)
                scale(1);

            pointer-events: auto;
        }



        /* ====================================================== */
        /* HEADER */
        /* ====================================================== */

        .cidadapbot-header {
            position: relative;

            flex: none;

            padding:
                16px 18px;

            display: flex;
            align-items: center;

            gap: 12px;

            color: white;

            background:
                radial-gradient(
                    circle at 85% 15%,
                    rgba(56,189,248,.20),
                    transparent 34%
                ),
                linear-gradient(
                    135deg,
                    #075985,
                    #0369a1
                );

            box-shadow:
                0 8px 24px rgba(3,105,161,.14);
        }


        .cidadapbot-avatar {
            width: 42px;
            height: 42px;

            flex: none;

            display: flex;
            align-items: center;
            justify-content: center;

            border-radius: 14px;

            color: #bae6fd;

            background:
                rgba(255,255,255,.11);

            border:
                1px solid rgba(255,255,255,.16);

            box-shadow:
                inset 0 1px 0 rgba(255,255,255,.13);
        }


        .cidadapbot-status-dot {
            width: 7px;
            height: 7px;

            flex: none;

            border-radius: 999px;

            background:
                #86efac;

            box-shadow:
                0 0 0 3px rgba(134,239,172,.12);
        }


        #cidadapbot-close {
            margin-left: auto;

            width: 38px;
            height: 38px;

            flex: none;

            display: flex;
            align-items: center;
            justify-content: center;

            border-radius: 12px;

            border: 1px solid transparent;

            color:
                rgba(255,255,255,.82);

            background:
                transparent;

            cursor: pointer;

            transition:
                background .25s ease,
                border-color .25s ease,
                color .25s ease,
                transform .25s ease;
        }


        #cidadapbot-close:hover {
            color: white;

            background:
                rgba(255,255,255,.10);

            border-color:
                rgba(255,255,255,.12);

            transform:
                rotate(4deg);
        }



        /* ====================================================== */
        /* MESSAGE AREA */
        /* ====================================================== */

        #cidadapbot-messages {
            flex: 1;

            min-height: 0;

            overflow-y: auto;

            padding:
                22px 18px
                14px;

            scroll-behavior: smooth;

            background:
                linear-gradient(
                    180deg,
                    #ffffff,
                    #fbfdff
                );
        }


        #cidadapbot-messages::-webkit-scrollbar {
            width: 7px;
        }


        #cidadapbot-messages::-webkit-scrollbar-track {
            background:
                transparent;
        }


        #cidadapbot-messages::-webkit-scrollbar-thumb {
            background:
                #cbd5e1;

            border-radius:
                999px;

            border:
                2px solid white;
        }


        .cidadapbot-message-row {
            width: 100%;

            display: flex;

            margin-bottom: 14px;
        }


        .cidadapbot-message-row.bot {
            justify-content: flex-start;
        }


        .cidadapbot-message-row.user {
            justify-content: flex-end;
        }


        .cidadapbot-message {
            max-width: 82%;

            padding:
                12px 14px;

            border-radius:
                18px;

            font-size:
                13px;

            line-height:
                1.65;

            word-break:
                break-word;

            animation:
                cidadapbotMessageIn
                .42s
                cubic-bezier(.16,1,.3,1)
                both;
        }


        .cidadapbot-message.bot {
            color: #0f172a;

            background:
                #f0f9ff;

            border:
                1px solid #dbeafe;

            border-bottom-left-radius:
                7px;

            box-shadow:
                0 8px 22px rgba(15,23,42,.045);
        }


        .cidadapbot-message.user {
            color: white;

            background:
                linear-gradient(
                    135deg,
                    #0284c7,
                    #0369a1
                );

            border:
                1px solid rgba(3,105,161,.55);

            border-bottom-right-radius:
                7px;

            box-shadow:
                0 9px 24px rgba(2,132,199,.16);
        }


        @keyframes cidadapbotMessageIn {

            from {
                opacity: 0;

                transform:
                    translateY(8px)
                    scale(.985);
            }

            to {
                opacity: 1;

                transform:
                    translateY(0)
                    scale(1);
            }

        }


        .cidadapbot-answer-actions {
            display: flex;
            flex-wrap: wrap;

            gap: 7px;

            margin-top: 10px;
        }


        .cidadapbot-answer-link {
            display: inline-flex;
            align-items: center;

            gap: 5px;

            padding:
                7px 10px;

            border-radius:
                999px;

            color:
                #0369a1;

            background:
                rgba(255,255,255,.78);

            border:
                1px solid #bae6fd;

            font-size:
                10px;

            font-weight:
                750;

            text-decoration: none;

            transition:
                transform .25s cubic-bezier(.16,1,.3,1),
                background .25s ease,
                color .25s ease;
        }


        .cidadapbot-answer-link:hover {
            color: white;

            background:
                #0284c7;

            transform:
                translateY(-1px);
        }



        /* ====================================================== */
        /* TYPING */
        /* ====================================================== */

        .cidadapbot-typing {
            display: inline-flex;
            align-items: center;

            gap: 5px;

            padding:
                12px 14px;

            border-radius:
                18px 18px 18px 7px;

            background:
                #f0f9ff;

            border:
                1px solid #dbeafe;

            box-shadow:
                0 7px 18px rgba(15,23,42,.04);
        }


        .cidadapbot-typing span {
            width: 6px;
            height: 6px;

            border-radius: 50%;

            background:
                #38bdf8;

            animation:
                cidadapbotTyping
                1.05s
                infinite
                ease-in-out;
        }


        .cidadapbot-typing span:nth-child(2) {
            animation-delay:
                .13s;
        }


        .cidadapbot-typing span:nth-child(3) {
            animation-delay:
                .26s;
        }


        @keyframes cidadapbotTyping {

            0%,
            70%,
            100% {
                transform:
                    translateY(0);

                opacity:
                    .40;
            }

            35% {
                transform:
                    translateY(-4px);

                opacity:
                    1;
            }

        }



        /* ====================================================== */
        /* QUICK QUESTIONS */
        /* ====================================================== */

        .cidadapbot-quick-wrap {
            flex: none;

            padding:
                10px 16px
                12px;

            background:
                #ffffff;

            border-top:
                1px solid #eef2f7;
        }


        #cidadapbot-quick {
            display: flex;
            flex-wrap: wrap;

            gap: 7px;

            max-height: 88px;

            overflow-y: auto;

            padding-right: 3px;
        }


        #cidadapbot-quick::-webkit-scrollbar {
            width: 5px;
        }


        #cidadapbot-quick::-webkit-scrollbar-thumb {
            background:
                #dbeafe;

            border-radius:
                999px;
        }


        .cidadapbot-chip {
            display: inline-flex;
            align-items: center;

            gap: 6px;

            padding:
                7px 10px;

            border-radius:
                999px;

            border:
                1px solid #bae6fd;

            color:
                #0369a1;

            background:
                #f0f9ff;

            font-size:
                10.5px;

            font-weight:
                650;

            line-height:
                1;

            cursor: pointer;

            white-space:
                nowrap;

            transition:
                transform .25s cubic-bezier(.16,1,.3,1),
                background .25s ease,
                border-color .25s ease;
        }


        .cidadapbot-chip:hover {
            transform:
                translateY(-1px);

            background:
                #e0f2fe;

            border-color:
                #7dd3fc;
        }



        /* ====================================================== */
        /* INPUT */
        /* ====================================================== */

        .cidadapbot-inputbar {
            flex: none;

            display: grid;

            grid-template-columns:
                40px
                minmax(0,1fr)
                42px;

            align-items: center;

            gap: 8px;

            padding:
                11px 12px
                12px;

            background:
                #fff;

            border-top:
                1px solid #e2e8f0;
        }


        .cidadapbot-mini-button,
        #cidadapbot-send {
            width: 40px;
            height: 40px;

            display: flex;
            align-items: center;
            justify-content: center;

            border-radius:
                999px;

            cursor: pointer;

            transition:
                transform .25s cubic-bezier(.16,1,.3,1),
                background .25s ease;
        }


        .cidadapbot-mini-button {
            color:
                #0284c7;

            border:
                1px solid #bae6fd;

            background:
                #f0f9ff;
        }


        .cidadapbot-mini-button:hover {
            background:
                #e0f2fe;

            transform:
                rotate(-5deg);
        }


        .cidadapbot-input-shell {
            min-width: 0;

            height: 42px;

            display: flex;
            align-items: center;

            border:
                2px solid #bae6fd;

            border-radius:
                999px;

            background:
                #fff;

            transition:
                border-color .25s ease,
                box-shadow .25s ease;
        }


        .cidadapbot-input-shell:focus-within {
            border-color:
                #0ea5e9;

            box-shadow:
                0 0 0 4px rgba(14,165,233,.10);
        }


        #cidadapbot-input {
            width: 100%;

            padding:
                0 14px;

            border: 0;
            outline: 0;

            background:
                transparent;

            color:
                #0f172a;

            font-size:
                13px;
        }


        #cidadapbot-input::placeholder {
            color:
                #94a3b8;
        }


        #cidadapbot-send {
            width: 42px;
            height: 42px;

            border: 0;

            color:
                white;

            background:
                linear-gradient(
                    135deg,
                    #0ea5e9,
                    #0284c7
                );

            box-shadow:
                0 8px 18px rgba(2,132,199,.20);
        }


        #cidadapbot-send:hover {
            transform:
                translateY(-2px)
                rotate(-2deg);

            background:
                linear-gradient(
                    135deg,
                    #0284c7,
                    #0369a1
                );
        }



        /* ====================================================== */
        /* MOBILE */
        /* ====================================================== */

        @media (max-width: 640px) {

            #cidadapbot-launcher {
                right: 16px;
                bottom: 16px;

                width: 56px;
                height: 56px;
            }


            #cidadapbot-window {
                right: 10px;
                bottom: 10px;

                width:
                    calc(100vw - 20px);

                height:
                    min(
                        650px,
                        calc(100dvh - 20px)
                    );

                border-radius:
                    24px;
            }


            .cidadapbot-header {
                padding:
                    13px 14px;
            }


            #cidadapbot-messages {
                padding:
                    18px 14px
                    12px;
            }


            .cidadapbot-message {
                max-width:
                    88%;
            }


            .cidadapbot-quick-wrap {
                padding-left:
                    12px;

                padding-right:
                    12px;
            }


            .cidadapbot-inputbar {
                padding-left:
                    10px;

                padding-right:
                    10px;
            }

        }


        @media (prefers-reduced-motion: reduce) {

            #cidadapbot-launcher,
            #cidadapbot-window,
            .cidadapbot-message,
            .cidadapbot-typing span {

                animation:
                    none !important;

                transition-duration:
                    .01ms !important;
            }

        }


        /* ====================================================== */
