#wpreplai-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    /* background: #2563eb; */
    background: #ff7304;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: background 0.2s;
}

#wpreplai-launcher:hover {
    background: #ff7304;
}

#wpreplai-launcher svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

#wpreplai-widget {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 360px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 99998;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
}

#wpreplai-widget.wpreplai-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.wpreplai-header {
    background: #0D0630;
    color: #fff;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpreplai-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.wpreplai-header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.wpreplai-header-info {
    flex: 1;
}

.wpreplai-header-name {
    font-size: 14px;
    font-weight: 600;
}

.wpreplai-header-status {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 400;
}

.wpreplai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 280px;
    max-height: 360px;
}

.wpreplai-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.wpreplai-msg.agent {
    background: #f1f5f9;
    color: #0D0630;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.wpreplai-msg.user {
    background: #0D0630 !important;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.wpreplai-msg.agent ol, .wpreplai-msg.agent ul {
    padding-left: 20px;
    margin-left: 10px;
}

.wpreplai-msg.agent h3 {
    font-size: 15px;
}

.wpreplai-msg.agent h2 {
    font-size: 18px;
}

.wpreplai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #f1f5f9;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.wpreplai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: wpreplai-bounce 1.2s infinite ease-in-out;
}

.wpreplai-typing span:nth-child(2) { animation-delay: 0.2s; }
.wpreplai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wpreplai-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40%            { transform: scale(1.1); opacity: 1; }
}

.wpreplai-footer {
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#wpreplai-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    resize: none;
    outline: none;
    max-height: 100px;
    line-height: 1.5;
    font-family: inherit;
    color: #1e293b;
}

#wpreplai-input:focus {
    border-color: #ff7304;
}

#wpreplai-send {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ff7304;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

#wpreplai-send:hover {
    background: #ff7304;
}

#wpreplai-send svg {
    width: 16px;
    min-width: 16px;
    max-width: 16px;
    height: 16px;
    fill: #fff;
}

#wpreplai-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

#wpreplai-new-chat {
    background: #150568;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s;
    flex-shrink: 0;
    border-radius: 3px;
}

#wpreplai-new-chat:hover {
    opacity: 1;
}

#wpreplai-new-chat svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

#wpreplai-new-chat.wpreplai-hidden {
    display: none;
}

.wpreplai-rating-overlay {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    align-self: stretch;
}

.wpreplai-rating-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.wpreplai-stars {
    display: flex;
    gap: 6px;
}

.wpreplai-star {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #cbd5e1;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.15s, transform 0.1s;
}

.wpreplai-star:hover,
.wpreplai-star-active {
    color: #ff7304;
    transform: scale(1.15);
}

.wpreplai-rating-skip {
    background: none;
    border: none;
    font-size: 12px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.wpreplai-rating-skip:hover {
    color: #64748b;
}

@media (max-width: 480px) {
    #wpreplai-widget {
        right: 16px;
        left: 16px;
        width: calc(100% - 32px);
        max-height: 80vh;
    }

    #wpreplai-launcher {
        bottom: 16px;
        right: 16px;
    }
}
