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

.eocx-ai-chat__button {
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(90deg, #7A76FF 0%, #CB46FA 50%, #FE881C 100%);
    box-shadow: 0 18px 42px rgba(6, 19, 30, 0.18), 0 0 0 10px rgba(122, 118, 255, 0.08), 0 0 34px rgba(203, 70, 250, 0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.eocx-ai-chat__welcome {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: min(360px, calc(100vw - 28px));
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(16, 16, 20, 0.08);
    box-shadow: 0 22px 58px rgba(6, 19, 30, 0.2);
    color: #101014;
    padding: 16px;
    display: none;
}

.eocx-ai-chat.is-welcome-visible:not(.is-open) .eocx-ai-chat__welcome {
    display: block;
}

.eocx-ai-chat__welcome-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    color: #5c5b66;
    background: rgba(16, 16, 20, 0.06);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.eocx-ai-chat__welcome-head {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
    padding-right: 30px;
}

.eocx-ai-chat__welcome-title {
    margin: 0;
    color: #2b2a33;
    font-size: 15px;
    line-height: 20px;
    font-weight: 800;
}

.eocx-ai-chat__welcome-status {
    margin: 1px 0 0;
    color: #6f6d7a;
    font-size: 12px;
    line-height: 17px;
}

.eocx-ai-chat__welcome-copy {
    margin: 14px 0 12px;
    color: #2f2e38;
    font-size: 13px;
    line-height: 20px;
}

.eocx-ai-chat__welcome-row {
    display: grid;
    grid-template-columns: 1fr 42px;
    align-items: center;
    border: 1px solid rgba(16, 16, 20, 0.14);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.eocx-ai-chat__welcome-input {
    width: 100%;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: none;
    color: #101014;
    padding: 0 12px;
    font-size: 13px;
    line-height: 18px;
}

.eocx-ai-chat__welcome-input::placeholder {
    color: #8a8794;
}

.eocx-ai-chat__welcome-send {
    width: 42px;
    height: 40px;
    border: 0;
    color: transparent;
    background: linear-gradient(135deg, #7A76FF 0%, #CB46FA 54%, #FE881C 100%);
    cursor: pointer;
    position: relative;
}

.eocx-ai-chat__welcome-send::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 11px;
    width: 15px;
    height: 15px;
    background: #fff;
    clip-path: polygon(0 0, 100% 50%, 0 100%, 22% 55%);
}

.eocx-ai-chat__welcome-note {
    margin: 12px 0 0;
    color: #6f6d7a;
    font-size: 11px;
    line-height: 16px;
}

.eocx-ai-chat__welcome-note a {
    color: #CB46FA;
    text-decoration: underline;
}

.eocx-ai-chat__panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: min(390px, calc(100vw - 28px));
    height: min(620px, calc(100vh - 120px));
    border-radius: 14px;
    background: #101014;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    overflow: hidden;
    display: none;
    color: #fff;
}

.eocx-ai-chat.is-open .eocx-ai-chat__panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.eocx-ai-chat__header {
    padding: 16px;
    background: #0b0b0f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
}

.eocx-ai-chat__avatar,
.eocx-ai-chat__mini-avatar {
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #7A76FF 0%, #CB46FA 54%, #FE881C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    position: relative;
}

.eocx-ai-chat__avatar {
    width: 42px;
    height: 42px;
    font-size: 13px;
}

.eocx-ai-chat__avatar::after,
.eocx-ai-chat__mini-avatar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #14d488;
    border: 2px solid #101014;
}

.eocx-ai-chat__mini-avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
    flex: 0 0 auto;
}

.eocx-ai-chat__title {
    margin: 0;
    font-size: 15px;
    line-height: 22px;
    font-weight: 700;
}

.eocx-ai-chat__status {
    margin: 1px 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    line-height: 18px;
}

.eocx-ai-chat__close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.eocx-ai-chat__messages {
    padding: 16px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top left, rgba(122, 118, 255, 0.14), transparent 30%),
        radial-gradient(circle at bottom right, rgba(254, 136, 28, 0.14), transparent 28%),
        #101014;
}

.eocx-ai-chat__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.eocx-ai-chat__row--user {
    justify-content: flex-end;
}

.eocx-ai-chat__message {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 20px;
    white-space: pre-wrap;
}

.eocx-ai-chat__message-text {
    display: block;
}

.eocx-ai-chat__message--bot {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.eocx-ai-chat__message--user {
    margin-left: auto;
    color: #fff;
    background: linear-gradient(90deg, #7A76FF 0%, #CB46FA 50%, #FE881C 100%);
}

.eocx-ai-chat__time {
    display: block;
    margin-top: 5px;
    font-size: 9px;
    line-height: 12px;
    color: rgba(255, 255, 255, 0.62);
}

.eocx-ai-chat__message--user .eocx-ai-chat__time {
    color: rgba(255, 255, 255, 0.82);
}

.eocx-ai-chat__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.eocx-ai-chat__source {
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    line-height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
}

.eocx-ai-chat__feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
}

.eocx-ai-chat__feedback-btn {
    min-width: 42px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
}

.eocx-ai-chat__feedback-btn:hover {
    color: #fff;
    border-color: rgba(203, 70, 250, 0.7);
    background: rgba(203, 70, 250, 0.2);
}

.eocx-ai-chat__feedback-thanks {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    line-height: 16px;
}

.eocx-ai-chat__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
    background: #101014;
}

.eocx-ai-chat__quick:empty {
    display: none;
}

.eocx-ai-chat__chip {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    padding: 7px 10px;
    font-size: 12px;
    line-height: 17px;
    cursor: pointer;
}

.eocx-ai-chat__chip:hover {
    background: rgba(122, 118, 255, 0.24);
}

.eocx-ai-chat__composer {
    padding: 12px;
    background: #0b0b0f;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.eocx-ai-chat__input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.eocx-ai-chat__input {
    min-height: 42px;
    max-height: 96px;
    resize: none;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 19px;
    outline: none;
}

.eocx-ai-chat__input::placeholder {
    color: rgba(255, 255, 255, 0.48);
}

.eocx-ai-chat__send {
    min-width: 74px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(90deg, #7A76FF 0%, #CB46FA 50%, #FE881C 100%);
    cursor: pointer;
}

.eocx-ai-chat__typing {
    opacity: 0.68;
    font-style: italic;
}

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

    .eocx-ai-chat__panel {
        right: -8px;
        bottom: 74px;
        width: min(390px, calc(100vw - 20px));
        height: min(620px, calc(100vh - 104px));
    }

    .eocx-ai-chat__welcome {
        right: -8px;
        bottom: 74px;
        width: min(390px, calc(100vw - 20px));
        padding: 14px;
    }

    .eocx-ai-chat__welcome-copy {
        font-size: 12px;
        line-height: 19px;
    }

    .eocx-ai-chat__welcome-note {
        font-size: 10px;
        line-height: 15px;
    }
}
