.tea-ai {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1050;
    font-family: "Karla", sans-serif;
}

.tea-ai__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: #24372b;
    color: #fff;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.tea-ai__toggle:hover {
    transform: translateY(-1px);
}

.tea-ai__panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: min(380px, calc(100vw - 32px));
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fffdf8;
    border: 1px solid rgba(36, 55, 43, 0.18);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
}

.tea-ai__panel[hidden] {
    display: none;
}

.tea-ai__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    background: #24372b;
    color: #fff;
}

.tea-ai__header h2 {
    margin: 0 0 4px;
    font-family: "Marcellus", serif;
    font-size: 1.15rem;
}

.tea-ai__header p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

.tea-ai__close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.tea-ai__messages {
    height: 330px;
    overflow-y: auto;
    padding: 18px;
    background: #f7f4ed;
}

.tea-ai__message {
    max-width: 84%;
    margin-bottom: 12px;
    padding: 10px 13px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.4;
    font-size: 0.92rem;
}

.tea-ai__message--assistant {
    margin-right: auto;
    background: #fff;
    border: 1px solid rgba(36, 55, 43, 0.12);
    color: #24372b;
}

.tea-ai__message--user {
    margin-left: auto;
    background: #24372b;
    color: #fff;
}

.tea-ai__form {
    padding: 14px;
    border-top: 1px solid rgba(36, 55, 43, 0.12);
    background: #fffdf8;
}

.tea-ai__input {
    width: 100%;
    resize: none;
    border: 1px solid rgba(36, 55, 43, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

.tea-ai__input:focus {
    border-color: #24372b;
}

.tea-ai__form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.tea-ai__status {
    font-size: 0.78rem;
    color: #8b3f33;
}

.tea-ai__send {
    border: 0;
    border-radius: 999px;
    padding: 8px 18px;
    background: #24372b;
    color: #fff;
    cursor: pointer;
}

.tea-ai__send:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (max-width: 576px) {
    .tea-ai {
        right: 16px;
        bottom: 16px;
    }

    .tea-ai__toggle-text {
        display: none;
    }

    .tea-ai__panel {
        position: fixed;
        right: 16px;
        left: 16px;
        bottom: 76px;
        width: auto;
    }
}
/* Keep the Send button visible inside the chat window */
.tea-ai__panel {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.tea-ai__header {
    flex: 0 0 auto;
}

.tea-ai__messages {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
}

.tea-ai__form {
    flex: 0 0 auto;
}

.tea-ai__panel[hidden] {
    display: none;
}
