/* Configuration notice shown by the chatbot test page. */
.tdp-chatbot-test-page {
    min-height: 60vh;
    padding: 40px 18px;
    background: #f8fbff;
}

.tdp-chatbot-alert {
    width: min(920px, 100%);
    margin: 0 auto 16px;
    padding: 12px 14px;
    border: 1px solid #f3d08d;
    border-radius: 14px;
    color: #7a4b00;
    background: #fff8e1;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.tdp-chatbot-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: inherit;
}

.tdp-chatbot-widget .tdp-chatbot-teaser {
    position: absolute;
    right: 0;
    bottom: 82px;
    width: 320px !important;
    max-width: calc(100vw - 48px) !important;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 160ms ease, transform 160ms ease;
}

.tdp-chatbot-teaser.is-hidden,
.tdp-chatbot-widget.is-open .tdp-chatbot-teaser {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.tdp-chatbot-widget .tdp-chatbot-teaser__body {
    box-sizing: border-box;
    display: grid !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 86px;
    padding: 18px 48px 18px 18px;
    border: 0;
    border-radius: 20px;
    color: #2f3542;
    background: #fff;
    box-shadow: 0 16px 46px rgba(21, 35, 68, 0.14);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.65;
    overflow: hidden;
    overflow-wrap: anywhere !important;
    text-align: left;
    white-space: normal !important;
    word-break: break-word !important;
}

.tdp-chatbot-widget .tdp-chatbot-teaser__body span,
.tdp-chatbot-widget .tdp-chatbot-teaser__body strong {
    display: block;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.tdp-chatbot-widget .tdp-chatbot-teaser__body strong {
    font-weight: 800;
}

.tdp-chatbot-teaser__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0 0 1px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #7a7f87;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
}

.tdp-chatbot-launcher {
    position: relative;
    display: grid;
    width: 66px;
    height: 66px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #1c64f2;
    box-shadow: 0 18px 42px rgba(28, 100, 242, 0.36);
    cursor: pointer;
}

.tdp-chatbot-widget.is-open .tdp-chatbot-launcher {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.tdp-chatbot-launcher img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
}

.tdp-chatbot-launcher__pulse {
    position: absolute;
    top: 0;
    right: 8px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2fdd7b;
}

.tdp-chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr) auto;
    width: 392px;
    max-width: calc(100vw - 48px);
    height: 620px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border: 1px solid rgba(28, 100, 242, 0.16);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 24px 80px rgba(21, 35, 68, 0.22);
    transform: translateY(10px) scale(0.98);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.tdp-chatbot-widget.is-open .tdp-chatbot-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.tdp-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid #e5ebf3;
    background: #fff;
}

.tdp-chatbot-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tdp-chatbot-header__brand img {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    object-fit: contain;
    background: #f2f6ff;
}

.tdp-chatbot-header__eyebrow {
    margin: 0 0 2px;
    color: #1c64f2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.tdp-chatbot-header h1 {
    margin: 0;
    color: #172033;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
}

.tdp-chatbot-header__actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tdp-chatbot-reset,
.tdp-chatbot-close,
.tdp-chatbot-compose button {
    border: 0;
    cursor: pointer;
    font-weight: 800;
}

.tdp-chatbot-reset {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    color: #36506f;
    background: #f0f5fb;
    font-size: 12px;
}

.tdp-chatbot-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0 0 1px;
    border-radius: 50%;
    color: #36506f;
    background: #f0f5fb;
    font-family: Arial, sans-serif;
    font-size: 22px;
    line-height: 1;
}

.tdp-chatbot-messages {
    overflow-y: auto;
    padding: 18px 14px;
    background: #fbfdff;
}

.tdp-chatbot-message {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    margin: 0 0 14px;
}

.tdp-chatbot-message--user {
    justify-content: flex-end;
}

.tdp-chatbot-message__avatar {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #1c64f2;
    font-size: 9px;
    font-weight: 800;
}

.tdp-chatbot-message__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.tdp-chatbot-message--user .tdp-chatbot-message__avatar {
    order: 2;
    background: #172033;
}

.tdp-chatbot-message__bubble {
    max-width: 78%;
    padding: 11px 13px;
    border-radius: 17px 17px 17px 5px;
    color: #1e2a3d;
    background: #fff;
    box-shadow: 0 6px 20px rgba(29, 42, 67, 0.08);
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.tdp-chatbot-message__bubble a {
    color: #1c64f2;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tdp-chatbot-message--user .tdp-chatbot-message__bubble {
    border-radius: 17px 17px 5px 17px;
    color: #fff;
    background: #1c64f2;
}

.tdp-chatbot-message--user .tdp-chatbot-message__bubble a {
    color: #fff;
}

.tdp-chatbot-message.is-loading .tdp-chatbot-message__bubble {
    color: #66758c;
    background: #eef4ff;
}

.tdp-chatbot-message.is-typing .tdp-chatbot-message__bubble::after {
    display: inline-block;
    width: 7px;
    height: 1.1em;
    margin-left: 3px;
    border-radius: 999px;
    background: currentColor;
    vertical-align: -0.16em;
    animation: tdp-chatbot-caret 0.8s steps(2, start) infinite;
    content: "";
}

@keyframes tdp-chatbot-caret {
    50% {
        opacity: 0;
    }
}

.tdp-chatbot-message.is-error .tdp-chatbot-message__bubble {
    color: #9d1c1f;
    background: #fff0f0;
}

.tdp-chatbot-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e5ebf3;
    background: #fff;
}

.tdp-chatbot-compose textarea {
    width: 100%;
    min-height: 46px;
    max-height: 132px;
    margin: 0;
    padding: 12px 13px;
    resize: none;
    border: 1px solid #d8e2ef;
    border-radius: 17px;
    color: #172033;
    background: #f9fbfe;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: none;
}

.tdp-chatbot-compose textarea:focus {
    border-color: #1c64f2;
    outline: 3px solid rgba(28, 100, 242, 0.14);
}

.tdp-chatbot-compose button {
    align-self: end;
    min-width: 74px;
    min-height: 46px;
    padding: 0 15px;
    border-radius: 999px;
    color: #fff;
    background: #1c64f2;
    box-shadow: 0 8px 20px rgba(28, 100, 242, 0.25);
}

.tdp-chatbot-compose button:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 782px) {
    .tdp-chatbot-widget {
        right: 16px;
        bottom: 88px;
        z-index: 2147483000;
    }

    .tdp-chatbot-launcher {
        width: 62px;
        height: 62px;
        border-radius: 50%;
    }

    .tdp-chatbot-panel {
        right: 12px;
        bottom: 84px;
        width: calc(100vw - 24px);
        max-width: none;
        height: min(560px, calc(100vh - 108px));
        max-height: none;
        border-radius: 24px;
        transform-origin: bottom center;
    }

    .tdp-chatbot-widget .tdp-chatbot-teaser {
        right: 0;
        bottom: 76px;
        width: calc(100vw - 32px) !important;
        max-width: none !important;
    }

    .tdp-chatbot-widget .tdp-chatbot-teaser__body {
        min-height: 78px;
        padding: 15px 48px 15px 16px;
        font-size: 13px;
        line-height: 1.6;
    }

    .tdp-chatbot-teaser__close {
        top: 9px;
        right: 9px;
    }

    .tdp-chatbot-message__bubble {
        max-width: 82%;
        font-size: 13px;
    }

    .tdp-chatbot-compose textarea {
        font-size: 16px;
    }
}
