.support-chat {
    --chat-gap: 24px;
    position: fixed;
    right: max(var(--chat-gap), env(safe-area-inset-right));
    bottom: max(var(--chat-gap), env(safe-area-inset-bottom));
    z-index: 20;
    color: #181818;
}

.support-chat, .support-chat * { box-sizing: border-box; }
.support-chat[hidden], .support-chat [hidden] { display: none !important; }
.support-chat .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.support-chat:has(.support-chat__panel:not([hidden])) {
    bottom: max(var(--chat-gap), env(safe-area-inset-bottom), calc(var(--chat-keyboard-inset, 0px) + 8px));
}

.support-chat__launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 51px;
    padding: 0 17px;
    border: 0;
    border-radius: 28px;
    background: var(--blue, #0756b1);
    color: #fff;
    box-shadow: 0 6px 20px #0e2e5638;
    font-size: 14px;
    font-weight: 650;
}

.support-chat__launcher:hover { background: #084788; }

.support-chat__panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(370px, calc(100vw - var(--chat-gap) * 2));
    height: min(480px, calc(var(--chat-viewport-height, 100vh) - var(--chat-gap) * 2));
    overflow: hidden;
    border: 1px solid #dfe5ec;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 45px #051c3b38;
}

.support-chat__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 14px;
    background: var(--blue, #0756b1);
    color: #fff;
}

.support-chat__mascot {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 3px;
    border-radius: 50%;
    background: #eef5ff;
    object-fit: contain;
}

.support-chat svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.support-chat__heading h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
    letter-spacing: 0;
}

.support-chat__close, .support-chat__send {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
}

.support-chat__close { margin-left: auto; background: transparent; color: inherit; }
.support-chat__close:hover { background: #ffffff25; }
.support-chat__close:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.support-chat__history {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 14px;
    background: #f3f6fa;
    font-size: 14px;
}

.support-chat__history:focus-visible { outline: 2px solid var(--blue, #0756b1); outline-offset: -2px; }
.support-chat__messages { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.support-chat__greeting, .support-chat__message {
    width: fit-content;
    max-width: 90%;
    padding: 8px 11px;
    border-radius: 12px 12px 12px 4px;
    background: #fff;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.support-chat__greeting { margin: 0 0 9px; }
.support-chat__message--visitor {
    align-self: flex-end;
    border-radius: 12px 12px 4px 12px;
    background: #dfedff;
}

.support-chat__message time {
    display: block;
    color: #526179;
    font-size: 11px;
    text-align: right;
}

.support-chat__form { padding: 10px 12px 9px; border-top: 1px solid #e3e8ef; }
.support-chat__compose { display: flex; gap: 8px; align-items: flex-end; }
.support-chat__compose textarea {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    max-height: 90px;
    resize: none;
    padding: 7px 9px;
    border: 1px solid #bbc6d5;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    font: inherit;
    line-height: 1.3;
}

.support-chat__compose textarea:focus { outline: 2px solid var(--blue, #0756b1); outline-offset: -1px; }
.support-chat__send { background: var(--yellow, #ffd900); }
.support-chat__send:hover:not(:disabled) { background: #ffe559; }
.support-chat__send:disabled { background: #e7ebf1; color: #5e6b7b; }
.support-chat__status { margin-bottom: 6px; color: #324b68; font-size: 13px; }

@media (max-width: 600px) {
    .support-chat { --chat-gap: 12px; }
    .support-chat__launcher { justify-content: center; width: 52px; min-height: 52px; padding: 0; }
    .support-chat__launcher span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}

@media (max-width: 550px) {
    .mobile-screen--offer:has(.claim-primary) .support-chat:has(.support-chat__panel[hidden]) {
        bottom: calc(101px + env(safe-area-inset-bottom));
    }
}
