.customer-chatbot-widget {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1100;
    font-family: var(--gc-font, "Segoe UI", sans-serif);
}

.customer-chatbot-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 3.25rem;
    padding: .65rem 1.1rem;
    border-radius: 999px;
    border-color: var(--gc-primary, #0f5f58);
    background: var(--gc-primary, #0f5f58);
    box-shadow: 0 8px 28px rgba(15, 48, 47, .24);
    font-weight: 700;
}

.customer-chatbot-toggle:hover,
.customer-chatbot-toggle:focus-visible {
    border-color: var(--gc-primary-hover, #0c4f49);
    background: var(--gc-primary-hover, #0c4f49);
}

.customer-chatbot-panel {
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 2rem));
    height: min(620px, calc(100vh - 2rem));
    height: min(620px, calc(100dvh - 2rem));
    overflow: hidden;
    border: 1px solid var(--gc-border, #dde3e2);
    border-radius: 1.125rem;
    background: var(--gc-surface, #fff);
    box-shadow: 0 24px 64px rgba(12, 36, 37, .22), 0 4px 14px rgba(12, 36, 37, .1);
    color: var(--gc-text, #13212b);
}

.customer-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex: none;
    padding: .85rem 1rem;
    background: var(--gc-primary, #0f5f58);
    color: #fff;
}

.customer-chatbot-heading,
.customer-chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.customer-chatbot-heading > div {
    min-width: 0;
}

.customer-chatbot-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    font-size: 1.2rem;
}

.customer-chatbot-title {
    font-weight: 700;
    line-height: 1.2;
}

.customer-chatbot-subtitle {
    overflow: hidden;
    color: rgba(255, 255, 255, .8);
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-chatbot-header-actions {
    gap: .2rem;
}

.customer-chatbot-icon-button {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.customer-chatbot-icon-button:hover,
.customer-chatbot-icon-button:focus-visible {
    background: rgba(255, 255, 255, .18);
}

.customer-chatbot-widget button:focus-visible,
.customer-chatbot-widget input:focus-visible {
    outline: 2px solid var(--gc-accent, #f2a65a);
    outline-offset: 2px;
}

.customer-chatbot-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .8rem;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    background: var(--gc-surface-subtle, #f8faf9);
}

.customer-chatbot-empty {
    margin: auto;
    max-width: 17rem;
    color: var(--gc-text-secondary, #55636b);
    font-size: .875rem;
    text-align: center;
}

.customer-chatbot-message {
    display: flex;
    flex: none;
}

.customer-chatbot-message.is-inbound {
    justify-content: flex-end;
}

.customer-chatbot-bubble {
    max-width: 88%;
    padding: .7rem .85rem;
    border: 1px solid var(--gc-border, #dde3e2);
    border-radius: .9rem .9rem .9rem .2rem;
    background: #fff;
    font-size: .875rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.customer-chatbot-bubble.is-inbound {
    border-color: var(--gc-primary, #0f5f58);
    border-radius: .9rem .9rem .2rem .9rem;
    background: var(--gc-primary, #0f5f58);
    color: #fff;
}

.customer-chatbot-speaker {
    margin-bottom: .2rem;
    font-size: .72rem;
    font-weight: 700;
    opacity: .8;
}

.customer-chatbot-actions,
.customer-chatbot-suggestions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    gap: .4rem;
    max-height: 6.5rem;
    overflow-y: auto;
    padding: .65rem .85rem;
    border-top: 1px solid var(--gc-border-subtle, #e9eeed);
    background: #fff;
}

.customer-chatbot-actions .btn,
.customer-chatbot-suggestions .btn {
    border-radius: 999px;
    white-space: normal;
    text-align: left;
}

.customer-chatbot-compose {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: none;
    padding: .75rem;
    border-top: 1px solid var(--gc-border, #dde3e2);
    background: #fff;
}

.customer-chatbot-compose .form-control {
    min-width: 0;
    border-radius: .7rem;
}

.customer-chatbot-send {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
    border-radius: .7rem;
}

@media (max-width: 480px) {
    .customer-chatbot-widget {
        right: .5rem;
        bottom: max(.5rem, env(safe-area-inset-bottom));
        left: .5rem;
    }

    .customer-chatbot-toggle {
        display: flex;
        width: max-content;
        margin-left: auto;
    }

    .customer-chatbot-panel {
        width: 100%;
        height: min(680px, calc(100dvh - 1rem - env(safe-area-inset-bottom)));
    }
}
