.ai-chat {
    bottom: 22px;
    font-family: "Tilda Sans", Arial, sans-serif;
    position: fixed;
    right: 22px;
    z-index: 1100;
}

.ai-chat__toggle {
    align-items: center;
    background: #1565d8;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 14px 32px rgba(21, 101, 216, 0.32);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font: 600 15px/1 "Tilda Sans", Arial, sans-serif;
    gap: 8px;
    min-height: 52px;
    padding: 0 18px;
}

.ai-chat.has-external-opener > .ai-chat__toggle {
    display: none;
}

.ai-chat__toggle-icon {
    font-size: 20px;
    line-height: 1;
}

.ai-chat__panel {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 8px;
    bottom: 68px;
    box-shadow: 0 22px 58px rgba(17, 24, 39, 0.18);
    display: none;
    max-height: min(620px, calc(100vh - 110px));
    overflow: hidden;
    position: absolute;
    right: 0;
    width: min(380px, calc(100vw - 32px));
}

.ai-chat.is-open .ai-chat__panel {
    display: flex;
    flex-direction: column;
}

.ai-chat__header {
    align-items: center;
    background: #111827;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
}

.ai-chat__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.ai-chat__status {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    margin: 3px 0 0;
}

.ai-chat__close {
    background: transparent;
    border: 0;
    color: #ffffff;
    cursor: pointer;
    font-size: 26px;
    height: 32px;
    line-height: 1;
    padding: 0;
    width: 32px;
}

.ai-chat__messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 14px;
}

.ai-chat__message {
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 88%;
    padding: 10px 12px;
    white-space: pre-wrap;
}

.ai-chat__message--assistant {
    align-self: flex-start;
    background: #f3f6fb;
    color: #111827;
}

.ai-chat__message--user {
    align-self: flex-end;
    background: #1565d8;
    color: #ffffff;
}

.ai-chat__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 14px 12px;
}

.ai-chat__quick button {
    background: #eef4ff;
    border: 1px solid rgba(21, 101, 216, 0.2);
    border-radius: 999px;
    color: #0f4fad;
    cursor: pointer;
    font: 500 13px/1 "Tilda Sans", Arial, sans-serif;
    padding: 8px 10px;
}

.ai-chat__form {
    border-top: 1px solid rgba(17, 24, 39, 0.1);
    display: flex;
    gap: 8px;
    padding: 12px;
}

.ai-chat__input {
    border: 1px solid rgba(17, 24, 39, 0.18);
    border-radius: 6px;
    flex: 1;
    font: 14px/1.35 "Tilda Sans", Arial, sans-serif;
    min-height: 44px;
    padding: 10px 12px;
    resize: none;
}

.ai-chat__send {
    background: #1565d8;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font: 600 14px/1 "Tilda Sans", Arial, sans-serif;
    min-width: 92px;
    padding: 0 14px;
}

.ai-chat__send:disabled,
.ai-chat__quick button:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 640px) {
    .ai-chat {
        bottom: 14px;
        right: 14px;
    }

    .ai-chat__toggle-label {
        display: none;
    }

    .ai-chat__toggle {
        min-height: 52px;
        padding: 0;
        width: 52px;
        justify-content: center;
    }

    .ai-chat__panel {
        bottom: 64px;
        max-height: calc(100vh - 92px);
        width: calc(100vw - 28px);
    }
}
