.grad-ai-chatbot {
    --grad-ai-green: #134529;
    --grad-ai-gold: #ffc107;
    --grad-ai-ink: #10233f;
    --grad-ai-offset-bottom: 24px;
    --grad-ai-offset-right: 24px;
    bottom: 24px;
    font-family: Arial, Helvetica, sans-serif;
    left: 24px;
    position: fixed;
    right: auto;
    z-index: 9999;
}

.grad-ai-toggle {
    align-items: center;
    background: rgba(19, 69, 41, .72);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(16, 35, 63, .18);
    color: #fff;
    cursor: pointer;
    display: flex;
    height: 42px;
    justify-content: center;
    min-width: 132px;
    opacity: .68;
    padding: 0 13px;
    transition: background-color .18s ease, box-shadow .18s ease, opacity .18s ease, transform .18s ease;
}

.grad-ai-toggle:hover,
.grad-ai-toggle:focus,
.grad-ai-chatbot.is-open .grad-ai-toggle {
    background: var(--grad-ai-green);
    box-shadow: 0 12px 28px rgba(16, 35, 63, .28);
    opacity: 1;
    transform: translateY(-1px);
}

.grad-ai-toggle-icon {
    align-items: center;
    background: transparent;
    color: #fff;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    height: 100%;
    justify-content: center;
    white-space: nowrap;
}

.grad-ai-panel {
    background: #fff;
    border: 1px solid #dde6ef;
    border-radius: 8px;
    bottom: 76px;
    box-shadow: 0 18px 44px rgba(16, 35, 63, .24);
    display: none;
    overflow: hidden;
    position: absolute;
    right: 0;
    max-height: calc(100vh - 120px);
    left: 0;
    right: auto;
    width: min(370px, calc(100vw - (var(--grad-ai-offset-right) * 2)));
}

.grad-ai-chatbot.is-open .grad-ai-panel {
    display: block;
}

.grad-ai-header {
    align-items: center;
    background: var(--grad-ai-ink);
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
}

.grad-ai-header strong,
.grad-ai-header span {
    display: block;
}

.grad-ai-header span {
    color: #cbd9e8;
    font-size: 12px;
    margin-top: 2px;
}

.grad-ai-close {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.grad-ai-messages {
    background: #f4f7fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: min(270px, calc(100vh - 300px));
    min-height: 170px;
    overflow-y: auto;
    padding: 14px;
}

.grad-ai-message {
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 88%;
    overflow-wrap: anywhere;
    padding: 10px 12px;
}

.grad-ai-bot {
    align-self: flex-start;
    background: #fff;
    color: #263238;
}

.grad-ai-user {
    align-self: flex-end;
    background: var(--grad-ai-green);
    color: #fff;
}

.grad-ai-suggestions {
    display: flex;
    gap: 8px;
    padding: 10px 12px 0;
}

.grad-ai-suggestions button {
    background: #eaf2ef;
    border: 1px solid #cfe1d8;
    border-radius: 6px;
    color: var(--grad-ai-green);
    cursor: pointer;
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 6px;
}

.grad-ai-form {
    display: flex;
    gap: 8px;
    padding: 12px;
}

.grad-ai-form input {
    border: 1px solid #cad5df;
    border-radius: 6px;
    flex: 1;
    font-size: 14px;
    min-width: 0;
    padding: 10px;
}

.grad-ai-form button {
    background: var(--grad-ai-green);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 0 14px;
}

@media (max-width: 576px) {
    .grad-ai-chatbot {
        --grad-ai-offset-bottom: 12px;
        --grad-ai-offset-right: 10px;
        bottom: 72px;
        left: 10px;
        right: auto;
    }

    .grad-ai-panel {
        border-radius: 8px 8px 0 0;
        bottom: 54px;
        left: -10px;
        max-height: calc(100vh - 78px);
        right: auto;
        width: 100vw;
    }

    .grad-ai-toggle {
        border-radius: 999px;
        height: 38px;
        min-width: 74px;
        padding: 0 10px;
    }

    .grad-ai-toggle-icon {
        font-size: 0;
    }

    .grad-ai-toggle-icon::before {
        content: "Chat";
        font-size: 12px;
    }

    .grad-ai-header {
        padding: 12px 14px;
    }

    .grad-ai-messages {
        height: calc(100vh - 270px);
        min-height: 180px;
        padding: 12px;
    }

    .grad-ai-suggestions {
        flex-wrap: wrap;
    }

    .grad-ai-suggestions button {
        flex: 1 1 30%;
    }

    .grad-ai-form {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 380px) {
    .grad-ai-panel {
        bottom: 50px;
    }

    .grad-ai-chatbot {
        bottom: 70px;
    }

    .grad-ai-toggle {
        height: 36px;
        min-width: 66px;
    }

    .grad-ai-toggle-icon::before {
        font-size: 11px;
    }

    .grad-ai-form {
        gap: 6px;
    }

    .grad-ai-form input {
        font-size: 13px;
        padding: 9px;
    }

    .grad-ai-form button {
        padding: 0 10px;
    }
}
