:root {
    --wpca-accent: #F39ca5;
    --wpca-text: #ffffff;
    --wpca-panel-bg: linear-gradient(180deg, #fff7f9 0%, #ffffff 100%);
    --wpca-ink: #452832;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

#wpca-chatbot-root {
    position: fixed;
    right: 24px;
    bottom: 44px;
    z-index: 999999;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.wpca-launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--wpca-accent), #f7bbc1);
    color: var(--wpca-text);
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 20px 40px rgba(243, 156, 165, 0.28);
    cursor: pointer;
}

.wpca-launcher__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.16);
}

.wpca-panel {
    width: min(380px, calc(100vw - 24px));
    height: min(640px, calc(100vh - 110px));
    margin-top: 12px;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(243, 156, 165, 0.22), transparent 33%),
        radial-gradient(circle at bottom left, rgba(243, 156, 165, 0.14), transparent 30%),
        var(--wpca-panel-bg);
    border: 1px solid rgba(243, 156, 165, 0.22);
    box-shadow: 0 30px 60px rgba(80, 35, 50, 0.22);
    animation: wpca-rise 220ms ease;
}

.wpca-panel[hidden] {
    display: none !important;
}

.wpca-panel__header {
    padding: 20px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--wpca-accent), #f9bdc4);
    color: var(--wpca-text);
}

.wpca-header__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.wpca-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    flex: 0 0 auto;
    overflow: hidden;
}

.wpca-avatar__face {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.wpca-avatar__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wpca-eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.84;
}

.wpca-panel__header h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    color: #ffffff;
}

.wpca-close {
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.22);
    color: var(--wpca-text);
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 24px;
    cursor: pointer;
}

.wpca-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wpca-message {
    display: flex;
}

.wpca-message--user {
    justify-content: flex-end;
}

.wpca-bubble {
    max-width: 85%;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--wpca-ink);
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(80, 35, 50, 0.08);
}

.wpca-message--user .wpca-bubble {
    background: linear-gradient(135deg, var(--wpca-accent), #f8bcc3);
    color: var(--wpca-text);
}

.wpca-bubble p {
    margin: 0 0 10px;
}

.wpca-bubble p:last-child {
    margin-bottom: 0;
}

.wpca-sources {
    padding: 0 18px 12px;
    color: #7a4c59;
    font-size: 12px;
}

.wpca-sources p {
    margin: 0 0 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wpca-sources ul {
    margin: 0;
    padding-left: 18px;
}

.wpca-sources a {
    color: #a64b5d;
}

.wpca-form {
    padding: 16px;
    border-top: 1px solid rgba(243, 156, 165, 0.18);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    background: rgba(255, 255, 255, 0.92);
}

.wpca-form textarea {
    resize: none;
    min-height: 48px;
    max-height: 140px;
    border: 1px solid rgba(243, 156, 165, 0.28);
    border-radius: 16px;
    padding: 12px 14px;
    font: inherit;
    color: var(--wpca-ink);
    background: #ffffff;
}

.wpca-form button {
    border: 0;
    border-radius: 16px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--wpca-accent), #f7b5bd);
    color: var(--wpca-text);
    font-weight: 700;
    cursor: pointer;
}

.wpca-form.is-loading button,
.wpca-form button:disabled {
    opacity: 0.7;
    cursor: progress;
}

@media (max-width: 640px) {
    #wpca-chatbot-root {
        right: 12px;
        left: 12px;
        bottom: 32px;
    }

    .wpca-launcher {
        margin-left: auto;
        display: flex;
    }

    .wpca-panel {
        width: 100%;
        height: min(72vh, 620px);
    }
}

@keyframes wpca-rise {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
