.dev-chatbot {
    position: fixed;
    right: clamp(18px, 2.4vw, 34px);
    bottom: clamp(18px, 2.6vw, 34px);
    z-index: 1450;
    display: grid;
    justify-items: end;
    align-content: end;
    gap: 14px;
    isolation: isolate;
}

.dev-chatbot::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.dev-chatbot.is-open::before {
    opacity: 1;
}

.page--perguntas .dev-chatbot {
    right: clamp(14px, 1.8vw, 24px);
    bottom: clamp(18px, 2vw, 28px);
}

.page--perguntas .dev-chatbot__launcher {
    width: 74px;
    height: 74px;
    display: grid !important;
}

.page--perguntas .dev-chatbot__mascot {
    width: 60px;
    height: 60px;
}

.page--perguntas .dev-chatbot__panel {
    width: min(344px, calc(100vw - 28px));
    height: min(560px, calc(100vh - 118px));
}

.dev-chatbot__launcher {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.dev-chatbot__launcher:hover,
.dev-chatbot__launcher:focus-visible {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.04);
    outline: none;
}

.dev-chatbot.is-open .dev-chatbot__launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.86);
}

.dev-chatbot__mascot {
    position: relative;
    width: 76px;
    height: 76px;
    display: block;
    animation: devChatbotFloat 2.8s ease-in-out infinite;
    transform: scaleX(-1);
}

.dev-chatbot__mascot--small {
    width: 48px;
    height: 48px;
    animation-duration: 3.1s;
}

.dev-chatbot__pacman {
    position: absolute;
    left: 8px;
    width: calc(100% - 16px);
    height: calc((100% - 16px) / 2);
    background:
        radial-gradient(circle at 34% 36%, #fff4b6 0%, #ffd96e 34%, #f0ad22 72%, #d58400 100%);
    box-shadow:
        inset -10px -10px 16px rgba(167, 96, 0, 0.22),
        inset 10px 8px 14px rgba(255, 255, 255, 0.18),
        0 10px 24px rgba(240, 173, 34, 0.2);
}

.dev-chatbot__pacman--top {
    top: 10px;
    border-radius: 999px 999px 0 0;
    transform-origin: center bottom;
    animation: devChatbotChompTop 0.34s ease-in-out infinite;
}

.dev-chatbot__pacman--bottom {
    top: calc(50% + 2px);
    border-radius: 0 0 999px 999px;
    transform-origin: center top;
    animation: devChatbotChompBottom 0.34s ease-in-out infinite;
}

.dev-chatbot__panel {
    width: min(392px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 132px));
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 28%),
        linear-gradient(180deg, rgba(22, 22, 22, 0.98), rgba(8, 8, 8, 0.99));
    box-shadow: 0 32px 72px rgba(0, 0, 0, 0.38);
    transform-origin: bottom right;
}

.dev-chatbot__panel[hidden] {
    display: none !important;
}

.dev-chatbot__panel-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dev-chatbot__avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.dev-chatbot__panel-meta {
    min-width: 0;
}

.dev-chatbot__panel-meta strong {
    display: block;
    font-size: 15px;
}

.dev-chatbot__status {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
}

.dev-chatbot__close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.dev-chatbot__close:hover,
.dev-chatbot__close:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(241, 203, 80, 0.36);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.dev-chatbot__messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
}

.dev-chatbot__message {
    max-width: min(86%, 320px);
}

.dev-chatbot__message--bot {
    align-self: flex-start;
}

.dev-chatbot__message--user {
    align-self: flex-end;
}

.dev-chatbot__bubble {
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.65;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
}

.dev-chatbot__message--bot .dev-chatbot__bubble {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #f5f5f5;
    border-top-left-radius: 6px;
}

.dev-chatbot__message--user .dev-chatbot__bubble {
    background: linear-gradient(135deg, rgba(241, 203, 80, 0.96), rgba(183, 143, 35, 0.96));
    color: #101010;
    font-weight: 600;
    border-top-right-radius: 6px;
}

.dev-chatbot__actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dev-chatbot__action {
    padding: 9px 12px;
    border: 1px solid rgba(241, 203, 80, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #f6f6f6;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.dev-chatbot__action:hover,
.dev-chatbot__action:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(241, 203, 80, 0.46);
    background: rgba(241, 203, 80, 0.1);
    outline: none;
}

.dev-chatbot__quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px 14px;
}

.dev-chatbot__quick button {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.dev-chatbot__quick button:hover,
.dev-chatbot__quick button:focus-visible {
    border-color: rgba(241, 203, 80, 0.44);
    background: rgba(241, 203, 80, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.dev-chatbot__composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 16px 16px;
}

.dev-chatbot__composer textarea {
    min-height: 54px;
    max-height: 148px;
    resize: vertical;
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font: inherit;
}

.dev-chatbot__composer textarea:focus {
    outline: none;
    border-color: rgba(241, 203, 80, 0.48);
}

.dev-chatbot__composer button {
    min-width: 102px;
    padding: 0 18px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #f1cb50, #b78f23);
    color: #101010;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.dev-chatbot__composer button:hover,
.dev-chatbot__composer button:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.04);
    outline: none;
}

.dev-chatbot__composer button[disabled] {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.dev-chatbot__typing {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.dev-chatbot__typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(241, 203, 80, 0.85);
    animation: devChatbotTyping 1s ease-in-out infinite;
}

.dev-chatbot__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.dev-chatbot__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@media (max-width: 720px) {
    .dev-chatbot {
        right: 12px;
        bottom: 12px;
    }

    .dev-chatbot__launcher {
        width: 84px;
        height: 84px;
    }

    .dev-chatbot__mascot {
        width: 68px;
        height: 68px;
    }

    .dev-chatbot__panel {
        width: min(392px, calc(100vw - 24px));
        height: min(72vh, 560px);
    }

    .dev-chatbot__composer {
        grid-template-columns: 1fr;
    }

    .dev-chatbot__composer button {
        min-height: 50px;
    }

    .dev-chatbot__message {
        max-width: 100%;
    }
}

@keyframes devChatbotChompTop {
    0%,
    100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-26deg);
    }
}

@keyframes devChatbotChompBottom {
    0%,
    100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(26deg);
    }
}

@keyframes devChatbotFloat {
    0%,
    100% {
        transform: scaleX(-1) translateY(0);
    }
    50% {
        transform: scaleX(-1) translateY(-5px);
    }
}

@keyframes devChatbotTyping {
    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
