:root {
    --vf-chatbot-accent: #1f4dad;
    --vf-chatbot-accent-dark: #183c8a;
    --vf-chatbot-accent-soft: #edf3ff;
}

html[data-vf-chatbot-area="reporting"] {
    --vf-chatbot-accent: #17844f;
    --vf-chatbot-accent-dark: #126b40;
    --vf-chatbot-accent-soft: #edf8f2;
}

html[data-vf-chatbot-area="internal"] {
    --vf-chatbot-accent: #778190;
    --vf-chatbot-accent-dark: #626b78;
    --vf-chatbot-accent-soft: #f0f2f4;
}

.vf-chatbot-badge {
    align-items: flex-start;
    background: var(--vf-chatbot-accent);
    border: 0;
    border-radius: 5px 5px 0 0;
    bottom: 0;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.2);
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    height: 50px;
    justify-content: center;
    left: 170px;
    padding: 5px;
    position: fixed;
    transition: background-color 140ms ease, transform 140ms ease;
    width: 40px;
    z-index: 1999;
}

.vf-chatbot-badge:hover,
.vf-chatbot-badge:focus-visible {
    background: var(--vf-chatbot-accent-dark);
}

.vf-chatbot-badge:focus-visible,
.vf-chatbot-close:focus-visible,
.vf-chatbot-composer button:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.vf-chatbot-badge img {
    display: block;
    height: auto;
    max-height: 40px;
    max-width: 30px;
    position: relative;
    width: 30px;
    z-index: 1;
}

.vf-chatbot-popup {
    background: #fff;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    bottom: 16px;
    box-shadow: 0 14px 48px rgba(15, 23, 42, 0.28);
    color: #273244;
    display: flex;
    flex-direction: column;
    height: min(560px, calc(100vh - 40px));
    left: 230px;
    overflow: hidden;
    position: fixed;
    width: min(380px, calc(100vw - 254px));
    z-index: 12020;
}

.vf-chatbot-popup[hidden] {
    display: none !important;
}

.vf-chatbot-header {
    align-items: center;
    background: var(--vf-chatbot-accent);
    color: #fff;
    display: flex;
    flex: 0 0 auto;
    gap: 11px;
    box-sizing: border-box;
    height: 56px;
    min-height: 56px;
    padding: 2px 14px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.vf-chatbot-header.is-dragging {
    cursor: grabbing;
}

.vf-chatbot-header-icon {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    padding: 6px;
    width: 42px;
}

.vf-chatbot-header-icon img {
    display: block;
    height: auto;
    max-width: 30px;
    width: 30px;
}

.vf-chatbot-heading {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.vf-chatbot-heading strong {
    font-size: 0.8125rem !important;
    font-weight: 700;
}

.vf-chatbot-heading span {
    font-size: 13px;
    opacity: 0.88;
}

.vf-chatbot-close {
    align-items: center;
    background: rgba(0, 0, 0, 0.18);
    border: 0;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    display: flex;
    font-size: 18px;
    height: 26px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 26px;
}

.vf-chatbot-close:hover {
    background: rgba(0, 0, 0, 0.35);
}

.vf-chatbot-close span {
    transform: translateY(-1px);
}

.vf-chatbot-conversation {
    background: #f7f8fa;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 16px;
}

.vf-chatbot-date {
    align-self: center;
    color: #7a8493;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.vf-chatbot-message {
    border-radius: 4px 14px 14px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    font-size: 13px;
    line-height: 1.5;
    max-width: 92%;
    padding: 12px 14px;
}

.vf-chatbot-message-assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5e9ef;
}

.vf-chatbot-message-author {
    color: var(--vf-chatbot-accent-dark);
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
}

.vf-chatbot-message p {
    margin: 0;
}

.vf-chatbot-message p + p {
    color: #667085;
    margin-top: 7px;
}

.vf-chatbot-suggestions {
    align-items: flex-start;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-left: 4px;
}

.vf-chatbot-suggestions span {
    background: var(--vf-chatbot-accent-soft);
    border: 1px solid color-mix(in srgb, var(--vf-chatbot-accent) 24%, white);
    border-radius: 16px;
    color: var(--vf-chatbot-accent-dark);
    font-size: 13px;
    line-height: 1.3;
    padding: 7px 11px;
}

.vf-chatbot-composer {
    background: #fff;
    border-top: 1px solid #e5e9ef;
    flex: 0 0 auto;
    padding: 12px 14px 14px;
}

.vf-chatbot-disabled-note {
    color: #7a8493;
    display: block;
    font-size: 13px;
    margin: 0 0 7px 2px;
}

.vf-chatbot-composer-row {
    align-items: center;
    background: #f7f8fa;
    border: 1px solid #dfe4eb;
    border-radius: 9px;
    display: flex;
    gap: 8px;
    padding: 5px;
}

.vf-chatbot-composer-row input {
    background: transparent;
    border: 0;
    box-shadow: none !important;
    color: #667085;
    flex: 1 1 auto;
    font: inherit;
    font-size: 13px;
    min-width: 0;
    opacity: 1;
    padding: 8px 7px;
}

.vf-chatbot-composer-row input:disabled {
    -webkit-text-fill-color: #7a8493;
    cursor: not-allowed;
}

.vf-chatbot-composer-row input::placeholder {
    color: #8a93a0;
    opacity: 1;
}

.vf-chatbot-composer-row button {
    align-items: center;
    background: var(--vf-chatbot-accent);
    border: 0;
    border-radius: 7px;
    color: #fff;
    display: flex;
    flex: 0 0 34px;
    font-size: 20px;
    height: 34px;
    justify-content: center;
    padding: 0;
    width: 34px;
}

.vf-chatbot-composer-row button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

@media (max-width: 760px) {
    .vf-chatbot-badge {
        left: 170px;
        width: 40px;
        height: 50px;
        padding: 5px;
    }

    .vf-chatbot-badge img {
        max-height: 40px;
        max-width: 30px;
        width: 30px;
    }

    .vf-chatbot-popup {
        bottom: 86px;
        height: min(560px, calc(100vh - 112px));
        left: 10px;
        max-width: 420px;
        width: calc(100vw - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vf-chatbot-badge,
    .vf-chatbot-close {
        transition: none;
    }
}
