.ai-chatbox {
    position: fixed;
    right: 20px;
    bottom: 74px;
    z-index: 2100;
    font-family: inherit;
    pointer-events: none;
}

body.is-chat-open .site-header-v2,
body.is-chat-open .header-mobile {
    display: none !important;
}

.ai-chatbox__launcher,
.ai-chatbox__close,
.ai-chatbox__composer button {
    border: 0;
    cursor: pointer;
}

.ai-chatbox__launcher {
    /* Replaced by the consolidated .action-dock trigger — panel still opens from this container's position. */
    display: none;
}

.ai-chatbox__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: auto;
    max-height: min(440px, calc(100vh - 96px));
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dfe8f2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 50px rgba(19, 54, 88, .18);
}

.ai-chatbox.is-open .ai-chatbox__panel {
    display: flex;
    pointer-events: auto;
}

.ai-chatbox.has-messages .ai-chatbox__panel {
    max-height: min(600px, calc(100vh - 96px));
}

@media (prefers-reduced-motion: reduce) {
    .ai-chatbox__panel {
        transition: none;
    }
}

.ai-chatbox__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    color: #fff;
    background: linear-gradient(135deg, #073b72 0%, #075994 55%, #0877bb 100%);
}

.ai-chatbox__header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ai-chatbox__avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.ai-chatbox__header strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.ai-chatbox__header span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    opacity: .85;
}

.ai-chatbox__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .25);
    flex-shrink: 0;
}

.ai-chatbox__close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    color: #fff;
}

.ai-chatbox__close:hover {
    background: rgba(255, 255, 255, .16);
}

.ai-chatbox__messages {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: auto;
    background: #f8fbfe;
}

.ai-chatbox__welcome {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.ai-chatbox__welcome-heading {
    margin: 2px 0 0;
    color: #334e68;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.ai-chatbox__message {
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line;
}

.ai-chatbox__message--bot {
    align-self: flex-start;
    max-width: 88%;
    color: #17324d;
    background: #eaf4fc;
    border: 0;
    border-radius: 4px 14px 14px 14px;
}

.ai-chatbox__message--user {
    align-self: flex-end;
    max-width: 88%;
    min-height: 34px;
    padding: 8px 12px;
    color: #fff;
    background: #006bb6;
    border-radius: 14px 4px 14px 14px;
}

.ai-chatbox__message--typing {
    display: flex;
    align-items: center;
    color: #667085;
    font-size: 13px;
}

.ai-chatbox__typing {
    display: inline-flex;
    gap: 3px;
    margin-right: 7px;
}

.ai-chatbox__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #98a2b3;
    animation: aiChatTypingBounce 1s infinite ease-in-out;
}

.ai-chatbox__typing span:nth-child(2) {
    animation-delay: .15s;
}

.ai-chatbox__typing span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes aiChatTypingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: .4;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.ai-chatbox__quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ai-chatbox__quick-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 42px;
    border: 1px solid #d6e5f2;
    border-radius: 10px;
    padding: 9px 10px;
    color: #24516f;
    background: #fff;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    line-height: 1.25;
    cursor: pointer;
}

.ai-chatbox__quick-action:hover {
    border-color: #006bb6;
    background: #f4faff;
    color: #006bb6;
}

.ai-chatbox__quick-action:focus-visible {
    outline: 2px solid rgba(0, 107, 182, .28);
    outline-offset: 2px;
}

.ai-chatbox__quick-action i {
    flex-shrink: 0;
    font-size: 16px;
    color: #006bb6;
}

.ai-chatbox__cta-link {
    width: fit-content;
    margin: 1px 0 0;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: #006bb6;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

.ai-chatbox__cta-link:hover {
    text-decoration: underline;
}

.ai-chatbox__cta-link:focus-visible {
    outline: 2px solid rgba(0, 107, 182, .28);
    outline-offset: 3px;
    border-radius: 3px;
}

.ai-chatbox__result-list {
    align-self: flex-start;
    max-width: 88%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-chatbox__result-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e5edf4;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
}

.ai-chatbox__result-row:hover {
    border-color: #006bb6;
    background: #f4faff;
}

.ai-chatbox__result-row i {
    flex-shrink: 0;
    font-size: 16px;
    color: #006bb6;
}

.ai-chatbox__result-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ai-chatbox__result-title {
    font-size: 13px;
    font-weight: 600;
    color: #17324d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-chatbox__result-type {
    font-size: 11.5px;
    color: #64748b;
}

.ai-chatbox__result-link {
    font-size: 12px;
    font-weight: 600;
    color: #006bb6;
}

.ai-chatbox__feedback {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-top: 1px solid rgba(16, 24, 40, .08);
    background: #fff;
}

.ai-chatbox__feedback-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.ai-chatbox__feedback input {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(16, 24, 40, .16);
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 14px;
}

.ai-chatbox__feedback button {
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 9px 12px;
    color: #fff;
    background: #006bb6;
}

.ai-chatbox__composer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 8px 10px;
    border-top: 1px solid #e5edf4;
    background: #fff;
}

.ai-chatbox__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    border-radius: 20px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #dde6f0;
    font-size: 13px;
}

.ai-chatbox__send {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #006bb6;
    font-size: 16px;
}

@media (max-width: 575.98px) {
    .ai-chatbox {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 2100;
        width: 100%;
        height: 100dvh;
    }

    .ai-chatbox__panel {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .ai-chatbox.has-messages .ai-chatbox__panel {
        max-height: none;
    }

    .ai-chatbox__header {
        padding-top: calc(10px + env(safe-area-inset-top));
    }

    .ai-chatbox__messages {
        flex: 1 1 auto;
        min-height: 0;
    }

    .ai-chatbox__composer {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .ai-chatbox__quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
