.chatbot-launcher {
    width: 66px;
    height: 66px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f3f9a, #1f63da);
    color: #fff;
    box-shadow: 0 18px 40px rgba(31, 99, 218, .32);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.chatbot-launcher-wrap {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.chatbot-launcher-note {
    max-width: 210px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(215, 226, 247, .96);
    box-shadow: 0 16px 34px rgba(17, 44, 109, .12);
    color: #0f3f9a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    margin-right: 0;
}

.chatbot-launcher-wrap.is-open .chatbot-launcher-note {
    display: none;
}

.chatbot-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(31, 99, 218, .38);
}

.chatbot-launcher svg {
    width: 30px;
    height: 30px;
}

.chatbot-shell {
    position: fixed;
    right: 22px;
    bottom: 100px;
    z-index: 70;
    width: min(460px, calc(100vw - 24px));
    max-height: min(80vh, 780px);
    display: none;
    flex-direction: column;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(215, 226, 247, .96);
    box-shadow: 0 28px 70px rgba(17, 44, 109, .2);
    backdrop-filter: blur(18px);
}

.chatbot-shell.is-open {
    display: flex;
}

.chatbot-head {
    padding: 18px 18px 16px;
    background: linear-gradient(135deg, #0f3f9a, #1f63da);
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.chatbot-head strong {
    display: block;
    font-size: 18px;
}

.chatbot-head p {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.4;
    opacity: .92;
}

.chatbot-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    flex: 0 0 auto;
}

.chatbot-body {
    padding: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 340px;
}

.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 230px;
    max-height: 420px;
}

.chatbot-message {
    max-width: 88%;
    padding: 14px 16px;
    border-radius: 20px;
    line-height: 1.5;
    font-size: 14px;
    white-space: pre-wrap;
    animation: chatbotMessageIn .22s ease;
}

.chatbot-message.bot {
    align-self: flex-start;
    background: #fff;
    color: #1f2d4d;
    border: 1px solid #d7e2f7;
}

.chatbot-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #0f3f9a, #1f63da);
    color: #fff;
}

.chatbot-message.chatbot-typing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 54px;
}

.chatbot-typing span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #7d93c4;
    animation: chatbotTypingPulse 1s infinite ease-in-out;
}

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

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

.chatbot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.chatbot-sources {
    display: grid;
    gap: 6px;
    margin-top: 2px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #d7e2f7;
}

.chatbot-sources-title {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: #5e6f95;
}

.chatbot-source-link {
    color: #0f3f9a;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.chatbot-source-link:hover {
    text-decoration: underline;
}

.chatbot-action {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7e2f7;
    background: #fff;
    color: #0f3f9a;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(31, 82, 180, .08);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.chatbot-action.primary {
    background: linear-gradient(135deg, #0f3f9a, #1f63da);
    border-color: transparent;
    color: #fff;
}

.chatbot-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(31, 82, 180, .14);
}

.chatbot-form {
    padding: 16px;
    border-top: 1px solid #d7e2f7;
    background: #fff;
}

.chatbot-input-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.chatbot-input {
    min-height: 92px;
    max-height: 180px;
    resize: vertical;
    border-radius: 18px;
    border: 1px solid #d7e2f7;
    padding: 14px 16px;
    color: #1f2d4d;
    font: inherit;
}

.chatbot-submit {
    min-width: 54px;
    height: 54px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f3f9a, #1f63da);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(31, 99, 218, .22);
}

.chatbot-footnote {
    margin-top: 10px;
    font-size: 12px;
    color: #5e6f95;
}

.chatbot-status {
    font-size: 13px;
    color: #5e6f95;
}

.chatbot-status.is-error {
    color: #c83b2c;
}

@keyframes chatbotTypingPulse {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: .45;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes chatbotMessageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

@media (max-width: 1500px) {
    .chatbot-shell {
        right: 16px;
        bottom: 92px;
        width: min(420px, calc(100vw - 28px));
        max-height: min(76vh, 720px);
    }

    .chatbot-body {
        min-height: 300px;
        padding: 14px;
    }

    .chatbot-messages {
        min-height: 210px;
        max-height: 360px;
    }

    .chatbot-form {
        padding: 14px;
    }
}

@media (max-width: 1280px) {
    .chatbot-shell {
        width: min(360px, calc(100vw - 24px));
        bottom: 88px;
    }

    .chatbot-head {
        padding: 16px 16px 14px;
    }

    .chatbot-head strong {
        font-size: 17px;
    }

    .chatbot-head p,
    .chatbot-message {
        font-size: 13px;
    }

    .chatbot-input {
        min-height: 80px;
        padding: 12px 14px;
    }

    .chatbot-submit {
        min-width: 50px;
        height: 50px;
    }
}

@media (max-width: 720px) {
    .chatbot-launcher-wrap {
        right: 14px;
        bottom: 16px;
    }

    .chatbot-launcher-note {
        max-width: 160px;
        padding: 9px 12px;
        font-size: 12px;
    }

    .chatbot-shell {
        right: 12px;
        bottom: 88px;
        width: calc(100vw - 24px);
        max-height: min(82vh, 760px);
    }

    .chatbot-launcher {
        width: 60px;
        height: 60px;
    }
}
