.wplac-chatbot {
    --wplac-bg: #0f172a;
    --wplac-panel: #111827;
    --wplac-muted: #94a3b8;
    --wplac-text: #f8fafc;
    --wplac-user: #2563eb;
    --wplac-assistant: #1f2937;
    --wplac-border: #334155;
    width: 70vw;
    /*max-width: 920px;
    margin: 24px auto;*/
    background: var(--wplac-bg);
    color: var(--wplac-text);
    border: 1px solid var(--wplac-border);
    border-radius: 18px;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
}

.wplac-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: var(--wplac-panel);
    border-bottom: 1px solid var(--wplac-border);
}

.wplac-title { font-size: 18px; }
.wplac-subtitle { color: var(--wplac-muted); font-size: 12px; margin-top: 3px; word-break: break-all; }

.wplac-new-chat,
.wplac-send {
    border: 0;
    border-radius: 999px;
    background: var(--wplac-user);
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
}

.wplac-new-chat { background: #334155; white-space: nowrap; }
.wplac-new-chat:hover, .wplac-send:hover { filter: brightness(1.08); }
.wplac-send:disabled { opacity: .55; cursor: not-allowed; }

.wplac-documents {
    padding: 10px 20px;
    color: var(--wplac-muted);
    font-size: 13px;
    border-bottom: 1px solid rgba(51, 65, 85, .6);
}

.wplac-messages {
    height: min(62vh, 620px);
    min-height: 360px;
    overflow-y: auto;
    padding: 18px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(17, 24, 39, 1));
}

.wplac-message { display: flex; flex-direction: column; margin: 0 0 16px; }
.wplac-message-user { align-items: flex-end; }
.wplac-message-assistant { align-items: flex-start; }
.wplac-role { color: var(--wplac-muted); font-size: 12px; margin: 0 8px 6px; }

.wplac-bubble {
    max-width: min(76%, 940px);
    padding: 13px 15px;
    border-radius: 18px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.wplac-message-user .wplac-bubble { background: var(--wplac-user); color: #fff; border-bottom-right-radius: 5px; }
.wplac-message-assistant .wplac-bubble { background: var(--wplac-assistant); color: var(--wplac-text); border-bottom-left-radius: 5px; }

.wplac-form {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--wplac-border);
    background: var(--wplac-panel);
}

.wplac-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--wplac-border);
    border-radius: 16px;
    padding: 12px 14px;
    min-height: 48px;
    max-height: 140px;
    background: #0b1120;
    color: var(--wplac-text);
    outline: none;
}

.wplac-input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, .16); }
.wplac-status { min-height: 24px; padding: 0 18px 14px; color: var(--wplac-muted); font-size: 13px; background: var(--wplac-panel); }
.wplac-status.wplac-error { color: #fca5a5; }

@media (max-width: 680px) {
    .wplac-header { align-items: flex-start; flex-direction: column; }
    .wplac-form { flex-direction: column; }
    .wplac-bubble { max-width: 94%; }
    .wplac-messages { height: 60vh; }
}


.wplac-loader-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wplac-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: wplac-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.wplac-loader-text {
    opacity: 0.85;
    font-size: 14px;
}

.wplac-message-assistant .wplac-bubble p {
    margin: 0 0 0.85em;
}

.wplac-message-assistant .wplac-bubble p:last-child {
    margin-bottom: 0;
}

.wplac-message-assistant .wplac-bubble ul,
.wplac-message-assistant .wplac-bubble ol {
    margin: 0.4em 0 0.85em 1.3em;
    padding: 0;
}

.wplac-message-assistant .wplac-bubble a {
    color: #93c5fd;
    text-decoration: underline;
}

@keyframes wplac-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
