.asur-chat {
    position: fixed;
    right: calc(1rem + var(--safe-area-right, 0px));
    bottom: calc(1rem + var(--safe-area-bottom, 0px));
    z-index: 1500;
    font-family: inherit;
    color: var(--text, #241018);
}

.asur-chat-hint {
    position: absolute;
    right: 4.6rem;
    bottom: .35rem;
    width: min(16.5rem, calc(100vw - 6.5rem));
    padding: .7rem .95rem .7rem .85rem;
    background: var(--panel, #fff);
    border: 1px solid var(--border, #ead6dd);
    border-radius: 14px;
    box-shadow: var(--shadow, 0 18px 45px rgba(59, 7, 24, .12));
}

.asur-chat-hint p {
    margin: 0;
    padding-right: 1.1rem;
    font-size: .9rem;
    line-height: 1.35;
    font-weight: 600;
}

.asur-chat-hint-close {
    position: absolute;
    top: .2rem;
    right: .25rem;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    background: transparent;
    color: var(--muted, #6d525d);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.asur-chat-fab {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border: 0;
    border-radius: 999px;
    background: var(--primary, #7f1734);
    color: #fff;
    box-shadow: 0 10px 28px rgba(127, 23, 52, .35);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.asur-chat-fab:hover,
.asur-chat-fab:focus-visible {
    background: var(--primary-dark, #5f0f27);
}

.asur-chat-fab-close {
    display: none;
    font-size: 1.8rem;
    line-height: 1;
}

.asur-chat.is-open .asur-chat-fab-icon {
    display: none;
}

.asur-chat.is-open .asur-chat-fab-close {
    display: block;
}

.asur-chat-panel {
    position: absolute;
    right: 0;
    bottom: 4.4rem;
    width: min(24.5rem, calc(100vw - 1.5rem));
    height: min(38rem, calc(100dvh - 6.5rem));
    display: flex;
    flex-direction: column;
    background: var(--panel, #fff);
    border: 1px solid var(--border, #ead6dd);
    border-radius: var(--radius, 18px);
    box-shadow: var(--shadow, 0 18px 45px rgba(59, 7, 24, .16));
    overflow: hidden;
}

.asur-chat-panel[hidden],
.asur-chat-hint[hidden],
.asur-chat-consent[hidden],
.asur-chat-main[hidden] {
    display: none !important;
}

.asur-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    background: var(--primary, #7f1734);
    color: #fff;
}

.asur-chat-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.asur-chat-kicker {
    margin: 0;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .85;
}

.asur-chat-header h2,
.asur-chat-consent-hero h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.asur-chat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    background: var(--gold, #c9a227);
    color: #3b0718;
    font-weight: 800;
}

.asur-chat-avatar-lg {
    width: 4.2rem;
    height: 4.2rem;
    font-size: 1.6rem;
    margin-bottom: .75rem;
}

.asur-chat-close {
    width: 2.4rem;
    height: 2.4rem;
    min-width: 2.4rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.asur-chat-consent,
.asur-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.asur-chat-consent {
    padding: 1.4rem 1.15rem 1.2rem;
    text-align: center;
    background: linear-gradient(180deg, #fbf5f7 0%, #fff 42%);
}

.asur-chat-consent-hero p {
    margin: .55rem 0 0;
    color: var(--muted, #6d525d);
    font-size: .92rem;
    line-height: 1.45;
}

.asur-chat-agree {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: 1.15rem 0 1rem;
    text-align: left;
    font-size: .86rem;
    color: var(--text, #241018);
}

.asur-chat-agree input {
    margin-top: .2rem;
    width: 1.1rem;
    height: 1.1rem;
}

.asur-chat-start {
    width: 100%;
    min-height: 44px;
}

.asur-chat-start:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.asur-chat-messages {
    flex: 1;
    overflow: auto;
    padding: 1rem .95rem .4rem;
    display: flex;
    flex-direction: column;
    gap: .7rem;
    background: var(--panel-soft, #fbf5f7);
}

.asur-chat-bubble {
    max-width: 92%;
    padding: .7rem .85rem;
    border-radius: 14px;
    font-size: .92rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.asur-chat-bubble-ai {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--border, #ead6dd);
}

.asur-chat-bubble-user {
    align-self: flex-end;
    background: var(--primary, #7f1734);
    color: #fff;
}

.asur-chat-bubble-system {
    align-self: stretch;
    background: transparent;
    color: var(--muted, #6d525d);
    font-size: .82rem;
    padding: 0 .15rem;
}

.asur-chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .55rem .9rem 0;
}

.asur-chat-chip {
    border: 1px solid var(--border, #ead6dd);
    background: #fff;
    color: var(--primary, #7f1734);
    border-radius: 999px;
    padding: .4rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
}

.asur-chat-chip:hover,
.asur-chat-chip:focus-visible {
    border-color: var(--primary, #7f1734);
    background: var(--burgundy-soft, #f3e1e7);
}

.asur-chat-compose {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    padding: .7rem .9rem .35rem;
}

.asur-chat-compose textarea {
    flex: 1;
    min-height: 44px;
    max-height: 7.5rem;
    resize: none;
    border: 1px solid var(--border, #ead6dd);
    border-radius: 12px;
    padding: .65rem .75rem;
    font: inherit;
}

.asur-chat-compose .btn {
    min-height: 44px;
}

.asur-chat-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.asur-chat-footnote {
    margin: 0;
    padding: 0 .95rem .8rem;
    font-size: .75rem;
    color: var(--muted, #6d525d);
}

.asur-chat-footnote a {
    color: var(--primary, #7f1734);
}

.asur-chat .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body.asur-ui-v2 .asur-chat {
    bottom: calc(4.75rem + var(--safe-area-bottom, 0px));
}

@media (min-width: 1024px) {
    body.asur-ui-v2 .asur-chat {
        bottom: calc(1rem + var(--safe-area-bottom, 0px));
    }
}

@media (max-width: 767px) {
    .asur-chat {
        right: 0;
        bottom: 0;
        left: 0;
    }

    .asur-chat-fab {
        position: absolute;
        right: calc(.85rem + var(--safe-area-right, 0px));
        bottom: calc(.85rem + var(--safe-area-bottom, 0px));
    }

    .asur-chat-hint {
        right: calc(4.7rem + var(--safe-area-right, 0px));
        bottom: calc(1rem + var(--safe-area-bottom, 0px));
    }

    .asur-chat.is-open .asur-chat-fab,
    .asur-chat.is-open .asur-chat-hint {
        display: none;
    }

    .asur-chat-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    body.asur-ui-v2 .asur-chat {
        bottom: 0;
    }
}
