﻿:root {
    --cbt-primary: #0787ff;
    --cbt-primary-dark: #0068c9;
    --cbt-primary-soft: #e6f3ff;
    --cbt-header: #0787ff;
    --cbt-border: rgba(7, 135, 255, .32);
    --cbt-surface: #ffffff;
    --cbt-surface-soft: #f5f9ff;
    --cbt-surface-muted: #edf6ff;
    --cbt-text: #111827;
    --cbt-text-soft: #5f6b7a;
    --cbt-shadow: 0 24px 60px rgba(7, 135, 255, .22);
    --cbt-shadow-soft: 0 14px 30px rgba(7, 135, 255, .16);
    --cbt-radius-xl: 24px;
    --cbt-radius-lg: 18px;
    --cbt-radius-md: 14px;
    --cbt-radius-pill: 999px;
    --cbt-z: 1050;
    --cbt-focus: #003d82;
    --cbt-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

#chatbot-launcher-wrap {
    position: fixed;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: var(--cbt-z);
    display: flex;
    align-items: center;
    gap: 12px;
}

#chatbot-launcher {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.chatbot-launcher-teaser {
    position: relative;
    width: 220px;
    min-height: 72px;
    padding: 15px 18px;
    border-radius: 20px;
    background: #fff;
    color: var(--cbt-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    box-shadow: var(--cbt-shadow-soft);
}

    .chatbot-launcher-teaser::after {
        content: '';
        position: absolute;
        top: 50%;
        right: -7px;
        width: 18px;
        height: 18px;
        border-radius: 4px;
        background: #fff;
        transform: translateY(-50%) rotate(45deg);
    }

#chatbot-teaser-close {
    position: absolute;
    top: -9px;
    right: 68px;
    z-index: 2;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--cbt-primary-dark);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(7, 135, 255, .22);
}

    #chatbot-teaser-close::before,
    #chatbot-teaser-close::after,
    #chatbot-close::before,
    #chatbot-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 13px;
        height: 2px;
        background: currentColor;
        border-radius: 99px;
    }

    #chatbot-teaser-close::before,
    #chatbot-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    #chatbot-teaser-close::after,
    #chatbot-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

.chatbot-launcher-teaser-dismissed .chatbot-launcher-teaser,
.chatbot-launcher-teaser-dismissed #chatbot-teaser-close {
    display: none;
}

.chatbot-launcher-icon-wrap {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cbt-primary), #61b8ff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 34px rgba(7, 135, 255, .36);
    font-size: 31px;
}

#chatbot-popup {
    position: fixed;
    right: 24px;
    bottom: calc(104px + env(safe-area-inset-bottom));
    width: 410px;
    height: 650px;
    max-height: calc(100vh - 128px);
    background: var(--cbt-surface);
    border: 1px solid var(--cbt-border);
    border-radius: var(--cbt-radius-xl);
    box-shadow: var(--cbt-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: var(--cbt-z);
    transition: transform .2s ease, opacity .2s ease, visibility .2s ease;
}

    #chatbot-popup.chatbot-popup-hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(16px) scale(.98);
    }

.chatbot-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--cbt-header), #42a8ff);
    color: #ffffff;
}

.chatbot-popup-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.chatbot-popup-brand-text strong {
    display: block;
    font-size: 15px;
}

.chatbot-popup-brand-text span {
    display: block;
    font-size: 12px;
    opacity: .86;
    margin-top: 2px;
}

#chatbot-close {
    position: relative;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    color: #fff;
    cursor: pointer;
}

#chatbot-popup-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.chatbot-hidden {
    display: none !important;
}

.chatbot-stage {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chatbot-stage-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-stage-title {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--cbt-text);
}

.chatbot-back {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--cbt-primary-soft);
    color: var(--cbt-primary-dark);
    cursor: pointer;
    flex: 0 0 auto;
    position: relative;
}

    .chatbot-back::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 9px;
        height: 9px;
        border-left: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translate(-40%, -50%) rotate(45deg);
    }

.chatbot-intro-copy {
    padding: 16px;
    border-radius: 20px;
    background: var(--cbt-primary-soft);
    color: #223148;
    font-size: 14px;
    line-height: 1.55;
}

    .chatbot-intro-copy p {
        margin: 0;
    }

.chatbot-intro-greeting {
    font-weight: 500;
    margin-bottom: 8px !important;
}

.chatbot-stage-prompt {
    color: var(--cbt-text);
    font-weight: 500;
    font-size: 16px;
}

.chatbot-category-list,
.chatbot-program-list,
.chatbot-question-list,
.chatbot-inline-program-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-category-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.chatbot-inline-program-list {
    width: 92%;
}

.chatbot-category,
.chatbot-question,
.chatbot-program {
    width: auto;
    max-width: 100%;
    border: 0;
    padding: 13px 16px;
    border-radius: 18px 18px 4px 18px;
    background: var(--cbt-primary);
    color: #ffffff;
    text-align: left;
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 500;
    cursor: pointer;
    transition: transform .08s ease, background-color .18s ease, box-shadow .18s ease;
    box-shadow: 0 8px 18px rgba(7, 135, 255, .15);
}

    .chatbot-category:hover,
    .chatbot-question:hover,
    .chatbot-program:hover {
        background: var(--cbt-primary-dark);
    }

.chatbot-inline-program-list .chatbot-program {
    background: #eef6ff;
    color: #26384f;
    border: 1px solid rgba(7, 135, 255, .14);
    box-shadow: none;
}

    .chatbot-inline-program-list .chatbot-program:hover {
        background: #dbeeff;
    }

.chatbot-category-item-expanded > .chatbot-category {
    background: var(--cbt-primary-dark);
}

.chatbot-answer-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chatbot-answer-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-message {
    display: flex;
    width: 100%;
}

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

.chatbot-message-bot {
    justify-content: flex-start;
    flex-direction: column;
    gap: 8px;
}

.chatbot-answer-question-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    max-width: 92%;
}

.chatbot-message-bubble {
    padding: 13px 15px;
    font-size: 14px;
    line-height: 1.55;
}

.chatbot-message-bubble-user {
    background: var(--cbt-primary);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}

.chatbot-answer-time {
    color: #94a3b8;
    font-size: 11px;
}

.chatbot-message-bubble-bot {
    width: 100%;
    background: #eef6ff;
    color: #2d3748;
    border: 1px solid rgba(7, 135, 255, .13);
    border-radius: 18px 18px 18px 4px;
}

.chatbot-answer-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cbt-text-soft);
    font-size: 12px;
}

.chatbot-answer-body ul,
.chatbot-answer-body ol {
    margin: 8px 0 8px 18px;
    padding: 0;
}

.chatbot-answer-body li {
    margin-bottom: 6px;
}

.chatbot-answer-body p {
    margin: 0 0 10px;
}

.chatbot-answer-body a {
    color: var(--cbt-primary-dark);
    font-weight: 500;
}

.chatbot-support-note {
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(7, 135, 255, .14);
    color: var(--cbt-text-soft);
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}

.chatbot-empty {
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--cbt-border);
    color: var(--cbt-text-soft);
}

.chatbot-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(7, 135, 255, .35);
    outline-offset: 2px;
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .preview-card {
        display: none;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding-top: 42px;
    }

    #chatbot-launcher-wrap {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .chatbot-launcher-teaser,
    #chatbot-teaser-close {
        display: none;
    }

    .chatbot-launcher-icon-wrap {
        width: 58px;
        height: 58px;
    }

    #chatbot-popup {
        left: 10px;
        right: 10px;
        bottom: calc(84px + env(safe-area-inset-bottom));
        width: auto;
        height: min(680px, calc(100vh - 104px));
        max-height: none;
    }

    #chatbot-popup-body {
        padding: 16px;
    }
}
