.val-chatbot,
.val-chatbot * {
    box-sizing: border-box;
}

.val-chatbot--floating {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99999;
    font-family: inherit;
}

.val-chatbot__bubble {
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 999px;
    background: var(--val-chatbot-bubble-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-bubble-text, #fff);
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.val-chatbot__bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .26);
}

.val-chatbot.is-open .val-chatbot__bubble {
    opacity: 0;
    pointer-events: none;
    transform: scale(.94);
}

.val-chatbot__bubble-icon {
    font-size: 27px;
    line-height: 1;
}

.val-chatbot__bubble-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--val-chatbot-unread-dot, #e11d48);
    border: 2px solid var(--val-chatbot-panel-bg, #fff);
}

.val-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 380px;
    max-width: calc(100vw - 28px);
    height: 620px;
    max-height: calc(100vh - 110px);
    background: var(--val-chatbot-panel-bg, #fff);
    border: 1px solid var(--val-chatbot-panel-border, rgba(0, 0, 0, .08));
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 22px 65px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
}

.val-chatbot--inline .val-chatbot__bubble {
    display: none;
}

.val-chatbot--inline .val-chatbot__panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 480px;
    height: 620px;
    max-height: calc(100vh - 80px);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .1);
}

.val-chatbot__head {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    min-height: 78px;
    padding: 18px 18px 16px;
    background: var(--val-chatbot-header-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-header-text, #fff);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.val-chatbot__title {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .01em;
}

.val-chatbot__subtitle {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    opacity: .86;
}

.val-chatbot__close {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border: 0;
    background: var(--val-chatbot-close-bg, rgba(255, 255, 255, .13));
    color: var(--val-chatbot-close-text, #fff);
    border-radius: 999px;
    font-size: 22px;
    line-height: 28px;
    cursor: pointer;
    padding: 0;
}

.val-chatbot__messages {
    flex: 1 1 auto;
    min-height: 190px;
    overflow-y: auto;
    padding: 16px;
    background: var(--val-chatbot-messages-bg, #f7f7f7);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.val-chatbot__msg {
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.42;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.val-chatbot__msg--bot {
    align-self: flex-start;
    background: var(--val-chatbot-bot-bg, #fff);
    color: var(--val-chatbot-bot-text, #151515);
    border: 1px solid var(--val-chatbot-bot-border, rgba(0, 0, 0, .06));
    border-bottom-left-radius: 5px;
}

.val-chatbot__msg--user {
    align-self: flex-end;
    background: var(--val-chatbot-user-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-user-text, #fff);
    border-bottom-right-radius: 5px;
}

.val-chatbot__quick {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 10px 12px 6px;
    background: var(--val-chatbot-quick-bg, #fff);
}

.val-chatbot__quick.is-muted {
    opacity: .72;
}

.val-chatbot__quick button {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    border: 1px solid var(--val-chatbot-quick-button-border, rgba(0, 0, 0, .13));
    background: var(--val-chatbot-quick-button-bg, #fff);
    color: var(--val-chatbot-quick-button-text, #111);
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.15;
    cursor: pointer;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

.val-chatbot__quick button:hover,
.val-chatbot__quick button:focus-visible {
    border-color: var(--val-chatbot-quick-button-hover-border, var(--val-chatbot-color, #111));
    outline: none;
}

.val-chatbot__quick button:disabled {
    cursor: default;
    opacity: .62;
}

.val-chatbot__quick-title {
    grid-column: 1 / -1;
    padding: 2px 2px 4px;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--val-chatbot-quick-button-text, #111);
}

.val-chatbot__quick .val-chatbot__quick-live {
    grid-column: 1 / -1;
    background: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111));
    border-color: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-main-button-text, #fff);
    font-weight: 700;
}

.val-chatbot__links {
    display: flex;
    gap: 8px;
    align-self: flex-start;
    margin-top: -2px;
    flex-wrap: wrap;
}

.val-chatbot__links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--val-chatbot-quick-button-bg, #fff);
    color: var(--val-chatbot-quick-button-text, #111);
    border: 1px solid var(--val-chatbot-quick-button-border, rgba(0, 0, 0, .12));
    font-size: 12px;
    text-decoration: none !important;
}

.val-chatbot__live-form {
    flex: 0 0 auto;
    padding: 10px 12px 4px;
    background: var(--val-chatbot-form-bg, #fff);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.val-chatbot__live-form[hidden] {
    display: none !important;
}

.val-chatbot__live-form input {
    width: 100%;
    height: 39px;
    border: 1px solid var(--val-chatbot-input-border, rgba(0, 0, 0, .14));
    border-radius: 12px;
    padding: 0 11px;
    font-size: 13px;
    outline: none;
    background: var(--val-chatbot-input-bg, #fff);
    color: var(--val-chatbot-input-text, #111);
}

.val-chatbot__live-form input:focus {
    border-color: var(--val-chatbot-input-focus-border, var(--val-chatbot-color, #111));
}

.val-chatbot__live-form input:first-child,
.val-chatbot__live-form button {
    grid-column: 1 / -1;
}

.val-chatbot__live-form button {
    height: 39px;
    border: 0;
    border-radius: 12px;
    background: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-main-button-text, #fff);
    font-weight: 700;
    cursor: pointer;
}

.val-chatbot__live-form .val-chatbot__live-back {
    background: var(--val-chatbot-back-button-bg, #fff);
    color: var(--val-chatbot-back-button-text, var(--val-chatbot-color, #111));
    border: 1px solid var(--val-chatbot-back-button-border, var(--val-chatbot-color, #111));
}

.val-chatbot__live-form .val-chatbot__live-back:hover,
.val-chatbot__live-form .val-chatbot__live-back:focus-visible {
    background: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-main-button-text, #fff);
    outline: none;
}

.val-chatbot__form {
    flex: 0 0 auto;
    padding: 10px 12px 12px;
    display: flex;
    gap: 8px;
    background: var(--val-chatbot-form-bg, #fff);
}

.val-chatbot__form input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--val-chatbot-input-border, rgba(0, 0, 0, .13));
    border-radius: 0;
    padding: 0 13px;
    font-size: 14px;
    outline: none;
    background: var(--val-chatbot-input-bg, #fff);
    color: var(--val-chatbot-input-text, #111);
}

.val-chatbot__form input:focus {
    border-color: var(--val-chatbot-input-focus-border, var(--val-chatbot-color, #111));
}

.val-chatbot__form button {
    flex: 0 0 46px;
    width: 46px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: var(--val-chatbot-send-button-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-send-button-text, #fff);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.val-chatbot__form button:disabled,
.val-chatbot__live-form button:disabled {
    cursor: not-allowed;
    opacity: .62;
}

@media (max-width: 520px) {
    .val-chatbot--floating {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 0;
    }

    .val-chatbot--floating .val-chatbot__bubble {
        position: fixed;
        right: 14px;
        bottom: 14px;
        width: 58px;
        height: 58px;
    }

    .val-chatbot--floating .val-chatbot__panel {
        position: fixed;
        left: 8px;
        right: 8px;
        top: 8px;
        bottom: 8px;
        width: auto;
        max-width: none;
        height: auto;
        max-height: none;
        border-radius: 18px;
    }

    .val-chatbot__head {
        min-height: 66px;
        padding: 14px 16px 13px;
    }

    .val-chatbot__title {
        font-size: 16px;
    }

    .val-chatbot__subtitle {
        font-size: 11px;
    }

    .val-chatbot__messages {
        min-height: 120px;
        padding: 14px;
    }

    .val-chatbot__quick {
        gap: 6px;
        padding: 9px 10px 6px;
    }

    .val-chatbot__quick button {
        min-height: 32px;
        padding: 7px 8px;
        font-size: 11px;
    }

    .val-chatbot__live-form {
        grid-template-columns: 1fr;
        padding: 9px 10px 4px;
    }

    .val-chatbot__form {
        padding: 9px 10px 10px;
    }

    .val-chatbot__form input,
    .val-chatbot__form button {
        height: 44px;
    }
}

@media (max-height: 620px) {
    .val-chatbot--floating .val-chatbot__panel {
        height: auto;
        max-height: calc(100vh - 20px);
    }

    .val-chatbot__messages {
        min-height: 110px;
    }
}

.val-chatbot.is-offline .val-chatbot__quick .val-chatbot__quick-live,
.val-chatbot.is-offline .val-chatbot__live-form button {
    background: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111));
    border-color: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111));
}

.val-chatbot.is-offline .val-chatbot__live-form .val-chatbot__live-back {
    background: var(--val-chatbot-back-button-bg, #fff);
    color: var(--val-chatbot-back-button-text, var(--val-chatbot-color, #111));
    border-color: var(--val-chatbot-back-button-border, var(--val-chatbot-color, #111));
}

.val-chatbot.is-offline .val-chatbot__live-form .val-chatbot__live-back:hover,
.val-chatbot.is-offline .val-chatbot__live-form .val-chatbot__live-back:focus-visible {
    background: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111));
    color: var(--val-chatbot-main-button-text, #fff);
}



@media (max-width: 520px) {
    .val-chatbot.is-mobile-keyboard .val-chatbot__quick {
        display: none !important;
    }

    .val-chatbot.is-mobile-keyboard .val-chatbot__messages {
        min-height: 0;
    }
}


@media (max-width: 520px) {
    .val-chatbot.is-live-form-visible .val-chatbot__quick {
        display: none !important;
    }

    .val-chatbot--floating .val-chatbot__panel {
        top: max(8px, env(safe-area-inset-top));
    }
}

/* Force correct floating open/closed state even if theme CSS or cached JS leaves attributes out of sync. */
.val-chatbot--floating:not(.is-open) .val-chatbot__panel {
    display: none !important;
}

.val-chatbot--floating.is-open .val-chatbot__panel {
    display: flex !important;
}

.val-chatbot--floating.is-open .val-chatbot__bubble {
    opacity: 0 !important;
    pointer-events: none !important;
}

.val-chatbot--floating:not(.is-open) .val-chatbot__bubble {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.val-chatbot__msg a,
.val-chatbot__msg a:visited,
.val-chatbot__msg a:hover,
.val-chatbot__msg a:focus,
.val-chatbot__msg a:active {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    font-weight: 700;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    word-break: break-word;
    opacity: 1 !important;
}

.val-chatbot--floating:not(.is-open) {
    bottom: 88px;
}

@media (max-width: 520px) {
    .val-chatbot--floating:not(.is-open) {
        bottom: 0;
    }

    .val-chatbot--floating .val-chatbot__bubble {
        bottom: 84px;
    }
}


/* v1.0.23: keep desktop contact/live form from pushing or clipping the header. */
.val-chatbot--floating .val-chatbot__panel {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.val-chatbot__head {
    flex: 0 0 auto !important;
    position: relative;
    z-index: 20;
}

.val-chatbot__messages {
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

.val-chatbot__quick,
.val-chatbot__live-form,
.val-chatbot__form {
    flex: 0 0 auto !important;
}

.val-chatbot.is-live-form-visible .val-chatbot__quick {
    display: none !important;
}

.val-chatbot.is-live-form-visible .val-chatbot__messages {
    min-height: 120px;
}

/* v1.0.26: isolate the widget palette from aggressive light/dark theme rules. */
.val-chatbot,
.val-chatbot button,
.val-chatbot input {
    font-family: inherit !important;
    text-shadow: none !important;
}

.val-chatbot__panel {
    color-scheme: light;
    background-color: var(--val-chatbot-panel-bg, #fff) !important;
    color: var(--val-chatbot-input-text, #111) !important;
}

.val-chatbot__head {
    background-color: var(--val-chatbot-header-bg, var(--val-chatbot-color, #111)) !important;
    color: var(--val-chatbot-header-text, #fff) !important;
    -webkit-text-fill-color: var(--val-chatbot-header-text, #fff) !important;
}

.val-chatbot__title,
.val-chatbot__subtitle {
    color: var(--val-chatbot-header-text, #fff) !important;
    -webkit-text-fill-color: var(--val-chatbot-header-text, #fff) !important;
    opacity: 1 !important;
}

.val-chatbot__close {
    background-color: var(--val-chatbot-close-bg, rgba(255, 255, 255, .13)) !important;
    color: var(--val-chatbot-close-text, #fff) !important;
    -webkit-text-fill-color: var(--val-chatbot-close-text, #fff) !important;
}

.val-chatbot__messages {
    background-color: var(--val-chatbot-messages-bg, #f7f7f7) !important;
}

.val-chatbot__msg--bot {
    background-color: var(--val-chatbot-bot-bg, #fff) !important;
    color: var(--val-chatbot-bot-text, #151515) !important;
    -webkit-text-fill-color: var(--val-chatbot-bot-text, #151515) !important;
}

.val-chatbot__msg--user {
    background-color: var(--val-chatbot-user-bg, var(--val-chatbot-color, #111)) !important;
    color: var(--val-chatbot-user-text, #fff) !important;
    -webkit-text-fill-color: var(--val-chatbot-user-text, #fff) !important;
}

.val-chatbot__quick {
    background-color: var(--val-chatbot-quick-bg, #fff) !important;
}

.val-chatbot__live-form,
.val-chatbot__form {
    background-color: var(--val-chatbot-form-bg, #fff) !important;
}

.val-chatbot__quick button,
.val-chatbot__links a {
    background-color: var(--val-chatbot-quick-button-bg, #fff) !important;
    color: var(--val-chatbot-quick-button-text, #111) !important;
    -webkit-text-fill-color: var(--val-chatbot-quick-button-text, #111) !important;
}

.val-chatbot__quick-title {
    color: var(--val-chatbot-quick-button-text, #111) !important;
    -webkit-text-fill-color: var(--val-chatbot-quick-button-text, #111) !important;
}

.val-chatbot__quick .val-chatbot__quick-live,
.val-chatbot__live-form button:not(.val-chatbot__live-back),
.val-chatbot__form button {
    background-color: var(--val-chatbot-main-button-bg, var(--val-chatbot-color, #111)) !important;
    color: var(--val-chatbot-main-button-text, #fff) !important;
    -webkit-text-fill-color: var(--val-chatbot-main-button-text, #fff) !important;
}

.val-chatbot__live-form .val-chatbot__live-back {
    background-color: var(--val-chatbot-back-button-bg, #fff) !important;
    color: var(--val-chatbot-back-button-text, var(--val-chatbot-color, #111)) !important;
    -webkit-text-fill-color: var(--val-chatbot-back-button-text, var(--val-chatbot-color, #111)) !important;
}

.val-chatbot__live-form input,
.val-chatbot__form input {
    background-color: var(--val-chatbot-input-bg, #fff) !important;
    color: var(--val-chatbot-input-text, #111) !important;
    -webkit-text-fill-color: var(--val-chatbot-input-text, #111) !important;
    caret-color: var(--val-chatbot-input-text, #111) !important;
    opacity: 1 !important;
}

.val-chatbot__live-form input::placeholder,
.val-chatbot__form input::placeholder {
    color: var(--val-chatbot-input-placeholder, #767676) !important;
    -webkit-text-fill-color: var(--val-chatbot-input-placeholder, #767676) !important;
    opacity: 1 !important;
}
