#kdata-chatbot {
    --kc-accent: #0b3d6e;
    --kc-bg: #ffffff;
    --kc-text: #1d1d1f;
    --kc-muted: #6b7280;
    --kc-user: #e8f0f8;
    --kc-border: #d9dee5;
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--kc-offset, 0px));
    z-index: 1050;
    font-size: 15px;
    line-height: 1.45;
}

.kdata-chatbot__launcher {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 0;
    background: var(--kc-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kdata-chatbot__launcher.has-label {
    width: auto;
    height: 52px;
    padding: 0 20px 0 16px;
    gap: 8px;
    border-radius: 26px;
    font: inherit;
    font-weight: 600;
}

.kdata-chatbot__launcher.has-label svg {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

#kdata-chatbot.is-open .kdata-chatbot__launcher,
#kdata-chatbot.is-open .kdata-chatbot__teaser {
    display: none;
}

.kdata-chatbot__teaser {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: max-content;
    max-width: min(300px, calc(100vw - 40px));
    display: flex;
    align-items: flex-start;
    gap: 4px;
    background: var(--kc-bg);
    color: var(--kc-text);
    border: 1px solid var(--kc-border);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    padding: 10px 6px 10px 14px;
    animation: kdata-chatbot-teaser-in .25s ease-out;
}

.kdata-chatbot__teaser::after {
    content: '';
    position: absolute;
    right: 24px;
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: var(--kc-bg);
    border-right: 1px solid var(--kc-border);
    border-bottom: 1px solid var(--kc-border);
    transform: rotate(45deg);
}

.kdata-chatbot__teaser-text {
    border: 0;
    background: none;
    padding: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.kdata-chatbot__teaser-close {
    border: 0;
    background: none;
    color: var(--kc-muted);
    font-size: 18px;
    line-height: 1;
    padding: 0 6px;
    cursor: pointer;
}

@keyframes kdata-chatbot-teaser-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.kdata-chatbot__panel {
    display: none;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: 560px;
    max-height: calc(100vh - 40px - var(--kc-offset, 0px));
    background: var(--kc-bg);
    color: var(--kc-text);
    border: 1px solid var(--kc-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    overflow: hidden;
}

#kdata-chatbot.is-open .kdata-chatbot__panel {
    display: flex;
}

.kdata-chatbot__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--kc-accent);
    color: #fff;
}

.kdata-chatbot__title {
    flex: 1;
    font-weight: 600;
}

.kdata-chatbot__badge {
    background: #f5b301;
    color: #1d1d1f;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
}

.kdata-chatbot__header button {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.kdata-chatbot__log {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kdata-chatbot__msg {
    max-width: 88%;
    padding: 8px 11px;
    border-radius: 10px;
    word-wrap: break-word;
}

.kdata-chatbot__msg--user {
    align-self: flex-end;
    background: var(--kc-user);
    white-space: pre-wrap;
}

.kdata-chatbot__msg--bot {
    align-self: flex-start;
    background: #f4f5f7;
}

.kdata-chatbot__msg--bot ul,
.kdata-chatbot__msg--bot ol {
    margin: 4px 0;
    padding-left: 20px;
}

.kdata-chatbot__msg--bot a {
    color: var(--kc-accent);
    text-decoration: underline;
}

.kdata-chatbot__feedback {
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: -4px;
    font-size: 13px;
    color: var(--kc-muted);
    max-width: 88%;
}

.kdata-chatbot__feedback button {
    border: 1px solid var(--kc-border);
    background: var(--kc-bg);
    border-radius: 14px;
    padding: 2px 9px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    color: var(--kc-text);
}

.kdata-chatbot__feedback button:hover,
.kdata-chatbot__feedback button:focus-visible {
    border-color: var(--kc-accent);
}

.kdata-chatbot__feedback textarea {
    width: 100%;
    min-width: 240px;
    border: 1px solid var(--kc-border);
    border-radius: 8px;
    padding: 6px 8px;
    font: inherit;
    color: var(--kc-text);
    resize: vertical;
}

.kdata-chatbot__feedback-actions {
    display: flex;
    gap: 6px;
}

.kdata-chatbot__feedback-send {
    background: var(--kc-accent) !important;
    border-color: var(--kc-accent) !important;
    color: #fff !important;
}

.kdata-chatbot__msg.is-typing {
    color: var(--kc-muted);
    animation: kdata-chatbot-pulse 1.2s infinite;
}

@keyframes kdata-chatbot-pulse {
    50% { opacity: .4; }
}

.kdata-chatbot__form {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid var(--kc-border);
}

.kdata-chatbot__input {
    flex: 1;
    resize: none;
    border: 1px solid var(--kc-border);
    border-radius: 8px;
    padding: 6px 8px;
    font: inherit;
    line-height: 1.4;
}

.kdata-chatbot__send {
    border: 0;
    border-radius: 8px;
    background: var(--kc-accent);
    color: #fff;
    width: 44px;
    cursor: pointer;
}

.kdata-chatbot__send:disabled {
    opacity: .5;
}

.kdata-chatbot__notice {
    padding: 0 10px 8px;
    font-size: 11px;
    color: var(--kc-muted);
}

@media (max-width: 480px) {
    #kdata-chatbot {
        right: 12px;
        bottom: calc(12px + var(--kc-offset, 0px));
    }

    #kdata-chatbot.is-open {
        right: 0;
        bottom: var(--kc-offset, 0px);
        left: 0;
        top: 0;
    }

    #kdata-chatbot.is-open .kdata-chatbot__panel {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* "k-data" is a brand name: no line break at the hyphen */
.kdata-chatbot__brand {
    white-space: nowrap;
}

/* Hint under the welcome: the bot answers in the customer's language */
.kdata-chatbot__langs {
    align-self: flex-start;
    max-width: 85%;
    margin: -2px 0 4px;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
}

.kdata-chatbot__langs-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.kdata-chatbot__langs-codes span {
    padding: 1px 6px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}
