.at-ai,
.at-ai * {
    box-sizing: border-box;
}

.at-ai {
    --at-ai-blue: #075eb8;
    --at-ai-blue-dark: #063f7c;
    --at-ai-teal: #008b82;
    --at-ai-orange: #ff8a1f;
    --at-ai-ink: #182536;
    --at-ai-muted: #64748b;
    position: fixed;
    right: 20px;
    bottom: 94px;
    z-index: 1090;
    font-family: "Poppins", Arial, sans-serif;
}

.at-ai__launcher {
    position: relative;
    width: 72px;
    height: 72px;
    padding: 4px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--at-ai-blue), var(--at-ai-teal));
    box-shadow: 0 12px 34px rgba(3, 76, 145, .4), 0 0 0 4px rgba(255,255,255,.92);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
    isolation: isolate;
}

.at-ai__launcher:hover,
.at-ai__launcher:focus-visible {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 16px 40px rgba(3, 76, 145, .48), 0 0 0 4px #fff;
    outline: none;
}

.at-ai__launcher img {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #d9efff;
}

.at-ai__launcher-ring {
    position: absolute;
    inset: -8px;
    z-index: -1;
    border: 2px solid rgba(0, 139, 130, .62);
    border-radius: 50%;
    animation: at-ai-pulse 2.2s ease-out infinite;
}

.at-ai__launcher-badge {
    position: absolute;
    top: -5px;
    left: -8px;
    min-width: 29px;
    padding: 4px 6px;
    border: 2px solid #fff;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--at-ai-orange), #ef5f00);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1;
}

.at-ai__launcher-status,
.at-ai__online-dot {
    position: absolute;
    right: 1px;
    bottom: 4px;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #19bf65;
    box-shadow: 0 0 0 3px rgba(25,191,101,.2);
}

.at-ai__panel {
    position: absolute;
    right: 0;
    bottom: 88px;
    display: flex;
    width: min(390px, calc(100vw - 32px));
    height: min(610px, calc(100vh - 210px));
    min-height: 420px;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(17, 66, 119, .13);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(9, 40, 78, .3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(22px) scale(.94);
    transform-origin: right bottom;
    transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1), visibility .25s;
}

.at-ai--open .at-ai__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.at-ai--open .at-ai__launcher-ring {
    animation-play-state: paused;
    opacity: 0;
}

.at-ai__header {
    position: relative;
    display: flex;
    min-height: 82px;
    padding: 14px 52px 14px 16px;
    align-items: center;
    gap: 12px;
    color: #fff;
    background: linear-gradient(125deg, var(--at-ai-blue-dark), var(--at-ai-blue) 58%, var(--at-ai-teal));
}

.at-ai__header::after {
    position: absolute;
    right: -20px;
    bottom: -36px;
    width: 130px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    content: "";
}

.at-ai__avatar-wrap {
    position: relative;
    flex: 0 0 52px;
}

.at-ai__avatar {
    display: block;
    width: 52px;
    height: 52px;
    border: 3px solid rgba(255,255,255,.9);
    border-radius: 50%;
    object-fit: cover;
    background: #d9efff;
}

.at-ai__online-dot {
    right: -1px;
    bottom: 0;
    width: 13px;
    height: 13px;
    border-width: 2px;
}

.at-ai__identity {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.at-ai__identity strong {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.at-ai__identity > span {
    color: rgba(255,255,255,.85);
    font-size: 10px;
}

.at-ai__identity i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-radius: 50%;
    background: #54ed90;
}

.at-ai__close {
    position: absolute;
    z-index: 2;
    top: 18px;
    right: 14px;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 8px;
    border: 0;
    border-radius: 50%;
    place-items: center;
    color: #fff;
    background: rgba(255,255,255,.13);
    cursor: pointer;
}

.at-ai__close svg,
.at-ai__send svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.at-ai__messages {
    flex: 1;
    padding: 18px 14px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    background:
        radial-gradient(circle at 10% 0%, rgba(7,94,184,.07), transparent 34%),
        linear-gradient(#f8fbff, #fff);
}

.at-ai__message {
    display: flex;
    margin: 0 0 12px;
    align-items: flex-end;
    gap: 8px;
    animation: at-ai-message-in .25s ease both;
}

.at-ai__message--user {
    justify-content: flex-end;
}

.at-ai__message-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    object-fit: cover;
}

.at-ai__bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 16px 16px 16px 5px;
    color: var(--at-ai-ink);
    background: #fff;
    box-shadow: 0 5px 18px rgba(29, 73, 118, .11);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.at-ai__message--user .at-ai__bubble {
    border-radius: 16px 16px 5px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--at-ai-blue), #0879d4);
}

.at-ai__typing {
    display: flex;
    min-width: 54px;
    padding: 13px;
    gap: 4px;
}

.at-ai__typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7c91a8;
    animation: at-ai-dot 1.1s infinite ease-in-out;
}

.at-ai__typing span:nth-child(2) { animation-delay: .15s; }
.at-ai__typing span:nth-child(3) { animation-delay: .3s; }

.at-ai__quick {
    display: flex;
    padding: 8px 12px 5px;
    overflow-x: auto;
    gap: 7px;
    background: #fff;
    scrollbar-width: none;
}

.at-ai__quick::-webkit-scrollbar { display: none; }

.at-ai__quick button {
    padding: 7px 10px;
    flex: 0 0 auto;
    border: 1px solid #cfe1f4;
    border-radius: 999px;
    color: var(--at-ai-blue-dark);
    background: #f4f9ff;
    font: 600 10px/1.2 inherit;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.at-ai__quick button:hover {
    border-color: #75ace0;
    background: #e9f4ff;
}

.at-ai__contact-row {
    display: grid;
    padding: 6px 12px;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    background: #fff;
}

.at-ai__contact-row a {
    padding: 7px 8px;
    border-radius: 10px;
    color: #fff;
    background: var(--at-ai-blue);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.at-ai__contact-row a:last-child { background: #15974a; }

.at-ai__form {
    display: flex;
    margin: 0 12px;
    padding: 6px 6px 6px 12px;
    align-items: flex-end;
    gap: 7px;
    border: 1px solid #d9e3ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(25, 59, 94, .07);
}

.at-ai__form:focus-within {
    border-color: #65a5df;
    box-shadow: 0 0 0 3px rgba(7,94,184,.1);
}

.at-ai__form textarea {
    width: 100%;
    min-height: 34px;
    max-height: 92px;
    padding: 7px 0;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: 0;
    color: var(--at-ai-ink);
    background: transparent;
    font: 400 12px/1.45 inherit;
}

.at-ai__form textarea::placeholder { color: #92a0af; }

.at-ai__send {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 10px;
    flex: 0 0 38px;
    border: 0;
    border-radius: 12px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--at-ai-blue), var(--at-ai-teal));
    cursor: pointer;
}

.at-ai__send:disabled { opacity: .55; cursor: wait; }

.at-ai__notice {
    margin: 6px 12px 8px;
    color: var(--at-ai-muted);
    font-size: 8px;
    line-height: 1.3;
    text-align: center;
}

.at-ai__consent {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    margin: 7px 12px 0;
    color: var(--at-ai-muted);
    font-size: 8px;
    line-height: 1.35;
    cursor: pointer;
}

.at-ai__consent input {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    margin-top: 0;
    accent-color: var(--at-ai-blue);
}

.at-ai__consent a { color: var(--at-ai-blue); text-decoration: underline; }
.at-ai__consent--error { color: #b42318; }

.at-ai__teaser {
    position: absolute;
    right: 84px;
    bottom: 8px;
    width: 250px;
    padding: 12px 34px 12px 13px;
    border: 1px solid rgba(7,94,184,.15);
    border-radius: 16px 16px 4px 16px;
    color: var(--at-ai-ink);
    background: #fff;
    box-shadow: 0 12px 35px rgba(9, 48, 91, .22);
    font-size: 11px;
    line-height: 1.45;
    animation: at-ai-teaser-in .45s cubic-bezier(.2,.8,.2,1) both;
}

.at-ai__teaser[hidden] { display: none; }

.at-ai__teaser strong { color: var(--at-ai-blue); }

.at-ai__teaser-close {
    position: absolute;
    top: 5px;
    right: 7px;
    border: 0;
    color: #738398;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

@keyframes at-ai-pulse {
    0% { transform: scale(.88); opacity: .8; }
    75%, 100% { transform: scale(1.34); opacity: 0; }
}

@keyframes at-ai-message-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes at-ai-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes at-ai-teaser-in {
    from { opacity: 0; transform: translateX(15px) scale(.94); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 767.98px) {
    .at-ai {
        right: 14px;
        bottom: 152px;
    }

    .at-ai__launcher {
        width: 64px;
        height: 64px;
    }

    .at-ai__launcher img {
        width: 56px;
        height: 56px;
    }

    .at-ai__panel {
        position: fixed;
        right: 10px;
        bottom: 72px;
        width: calc(100vw - 20px);
        height: min(640px, calc(100dvh - 88px));
        min-height: 430px;
        border-radius: 22px;
    }

    .at-ai__teaser {
        right: 73px;
        width: min(235px, calc(100vw - 105px));
    }

    .at-ai--open .at-ai__launcher {
        opacity: 0;
        pointer-events: none;
    }
}

@media (min-width: 768px) and (max-height: 650px) {
    .at-ai__panel {
        height: calc(100vh - 190px);
        min-height: 350px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .at-ai *,
    .at-ai *::before,
    .at-ai *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
