.next-sales-ia-widget {
    --next-sales-ia-primary: #002e62;
    --next-sales-ia-secondary: #708cc1;
    position: fixed;
    right: 20px;
    bottom: 22px;
    z-index: 99999;
    font-family: inherit;
}

.next-sales-ia-launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 22px;
    border: 0;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, var(--next-sales-ia-primary), var(--next-sales-ia-secondary));
    box-shadow: 0 14px 35px rgba(0, 46, 98, 0.25);
    cursor: pointer;
}

.next-sales-ia-launcher-icon {
    font-size: 20px;
    line-height: 1;
}

.next-sales-ia-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(380px, calc(100vw - 28px));
    height: min(560px, calc(100vh - 110px));
    max-height: calc(100dvh - 100px);
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22);
}

.next-sales-ia-widget.is-open .next-sales-ia-panel {
    display: flex;
    flex-direction: column;
}

.next-sales-ia-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--next-sales-ia-primary), var(--next-sales-ia-secondary));
}

.next-sales-ia-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 700;
}

.next-sales-ia-header strong {
    flex: 1;
    font-size: 15px;
}

.next-sales-ia-header button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: transparent;
    cursor: pointer;
}

.next-sales-ia-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 18px;
    background: #fff;
}

.next-sales-ia-message {
    width: fit-content;
    max-width: 86%;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 14px;
}

.next-sales-ia-message.assistant {
    color: #344054;
    background: #f2f4f7;
}

.next-sales-ia-message.user {
    margin-left: auto;
    color: #fff;
    background: var(--next-sales-ia-primary);
}

.next-sales-ia-sources {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.next-sales-ia-sources a {
    color: var(--next-sales-ia-primary);
    font-weight: 700;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.next-sales-ia-form {
    display: flex;
    gap: 10px;
    padding: 14px 18px 16px;
    border-top: 1px solid #eaecf0;
}

.next-sales-ia-form input {
    flex: 1;
    min-width: 0;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--next-sales-ia-primary);
    border-radius: 25px;
    outline: none;
}

.next-sales-ia-form button {
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--next-sales-ia-primary), var(--next-sales-ia-secondary));
    cursor: pointer;
}

.next-sales-ia-panel.is-loading .next-sales-ia-form button {
    opacity: 0.65;
    cursor: wait;
}

.next-sales-ia-turn {
    width: 100%;
    min-width: 0;
    margin-bottom: 14px;
}

.next-sales-ia-turn .next-sales-ia-message {
    margin-bottom: 0;
}

.next-sales-ia-turn.assistant {
    max-width: 100%;
}

.next-sales-ia-message.assistant.has-products {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.next-sales-ia-course-cards {
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
    margin-top: 10px;
}

.next-sales-ia-course-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #d6e0ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.next-sales-ia-course-media {
    width: 78px;
    height: 96px;
    min-height: 96px;
    overflow: hidden;
    border-radius: 5px;
    background: #eef2f6;
}

.next-sales-ia-course-media img {
    display: block;
    width: 100%;
    height: 96px;
    object-fit: cover;
}

.next-sales-ia-course-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 96px;
    min-height: 96px;
    padding: 5px;
    box-sizing: border-box;
    color: #536273;
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
}

.next-sales-ia-course-details {
    min-width: 0;
    overflow-wrap: anywhere;
}

.next-sales-ia-course-title {
    margin: 0 0 5px;
    color: #173b5f;
    font-size: 14px;
    line-height: 1.35;
}

.next-sales-ia-course-description {
    display: -webkit-box;
    margin: 0 0 6px;
    overflow: hidden;
    color: #475467;
    font-size: 12px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.next-sales-ia-course-category,
.next-sales-ia-course-dates {
    margin: 0 0 4px;
    color: #536273;
    font-size: 11px;
    line-height: 1.35;
}

.next-sales-ia-course-price {
    margin: 5px 0 8px;
    color: #173b5f;
    font-size: 13px;
    font-weight: 700;
}

.next-sales-ia-course-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 5px;
    color: #fff !important;
    background: var(--next-sales-ia-primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.next-sales-ia-course-link:hover,
.next-sales-ia-course-link:focus {
    color: #fff !important;
    background: #164d83;
}

.next-sales-ia-suggested-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.next-sales-ia-suggested-actions a,
.next-sales-ia-suggested-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #c7d5e4;
    border-radius: 5px;
    color: var(--next-sales-ia-primary);
    background: #fff;
    font: inherit;
    font-size: 12px;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
}

.next-sales-ia-suggested-actions a:hover,
.next-sales-ia-suggested-actions button:hover {
    border-color: var(--next-sales-ia-primary);
}

.next-sales-ia-launcher:focus-visible,
.next-sales-ia-header button:focus-visible,
.next-sales-ia-form button:focus-visible,
.next-sales-ia-course-link:focus-visible,
.next-sales-ia-suggested-actions a:focus-visible,
.next-sales-ia-suggested-actions button:focus-visible {
    outline: 3px solid #f2b705;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .next-sales-ia-widget {
        right: 8px;
        bottom: 8px;
    }

    .next-sales-ia-panel {
        right: -4px;
        bottom: 68px;
        width: calc(100vw - 16px);
        height: min(600px, calc(100vh - 92px));
        max-height: calc(100dvh - 84px);
    }

    .next-sales-ia-messages {
        padding: 14px;
    }

    .next-sales-ia-course-card {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 10px;
        padding: 9px;
    }

    .next-sales-ia-course-media {
        width: 68px;
    }

    .next-sales-ia-form {
        padding: 10px 12px 12px;
    }
}
