.ai-consultant-widget {
    position: fixed;
    right: 15px;
    bottom: 80px;
    z-index: 99990;
    width: 50px;
    height: 50px;
    font-family: Arial, sans-serif;

    overflow: visible;
    text-align: center;
    text-decoration: none;
    transition: .45s all ease-in-out;
    transform: translate3d(0, 100px, 0);
}

.ai-consultant-widget.active,
.ai-consultant-widget.is-open {
    transform: translate3d(0, 0, 0);
}

.ai-consultant-button {
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    background: #007CBC;
    box-shadow: none;
    transition: .45s all ease-in-out;
}

.ai-consultant-button:hover {
    background: #009ECC;
}

.ai-consultant-button:focus {
    outline: none;
}

.ai-consultant-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-consultant-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 62px;
    width: 460px;
    max-width: calc(100vw - 24px);
    height: 640px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
}

.ai-consultant-widget.is-open .ai-consultant-panel {
    display: flex;
    flex-direction: column;
}

.ai-consultant-header {
    min-height: 66px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #0067ff, #00c8e8);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-consultant-title {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.ai-consultant-status {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.9;
}

.ai-consultant-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 30px;
}

.ai-consultant-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: #f7f9fc;
}

.ai-consultant-message {
    max-width: 86%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ai-consultant-message-ai {
    background: #ffffff;
    color: #333333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-consultant-message-user {
    margin-left: auto;
    background: #0078ff;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.ai-consultant-message-error {
    background: #fff1f1;
    color: #9b1c1c;
    border: 1px solid #ffd1d1;
}

.ai-consultant-form {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e9edf3;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ai-consultant-input {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    resize: none;
    border: 1px solid #d7dde6;
    border-radius: 13px;
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
}

.ai-consultant-input:focus {
    border-color: #0078ff;
}

.ai-consultant-send {
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 13px;
    background: #0078ff;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.ai-consultant-send:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (min-width: 480px) {
    .ai-consultant-widget {
        right: 40px;
        bottom: 105px;
    }
}

@media (max-width: 600px) {
    .ai-consultant-panel {
        width: calc(100vw - 40px);
        height: 520px;
        max-height: calc(100vh - 125px);
    }
}
