/* Wonda AI — static widget demo stylesheet.
 *
 * Generated from public/widget/widget.css. Do not edit directly.
 * To regenerate: php scripts/rebuild-widget-demo-css.php
 *
 * The only change is that `#wonda-root` becomes `.wonda-demo`, so
 * the exact widget styling can render multiple times on one page
 * without the fixed-position rules of the live widget firing.
 */
/* Wonda AI — chat widget styles. All selectors prefixed with .wonda-demo. */

.wonda-demo {
    all: initial;
    display: block;
    position: fixed;
    z-index: 2147483000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #0f172a;
    text-align: left;
    pointer-events: none;
}

.wonda-demo *, .wonda-demo *::before, .wonda-demo *::after { box-sizing: border-box; }

.wonda-demo.wonda-br { bottom: 20px; right: 20px; }
.wonda-demo.wonda-bl { bottom: 20px; left: 20px; }
.wonda-demo.wonda-tr { top: 20px; right: 20px; }
.wonda-demo.wonda-tl { top: 20px; left: 20px; }

.wonda-demo .wonda-root-inner { pointer-events: none; position: relative; }

.wonda-demo .wonda-launcher {
    width: 56px; height: 56px;
    border-radius: 28px;
    background: var(--wonda-accent, #FF007E);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    transition: transform .15s ease, box-shadow .15s ease;
    border: 0;
    padding: 0;
    position: relative;
    pointer-events: auto;
    font-family: inherit;
    overflow: hidden;
}
.wonda-demo .wonda-launcher:hover { transform: scale(1.05); box-shadow: 0 8px 30px rgba(0,0,0,.22); }
.wonda-demo .wonda-launcher:active { transform: scale(.97); }
.wonda-demo .wonda-launcher svg { width: 26px; height: 26px; }
.wonda-demo .wonda-launcher img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wonda-demo .wonda-launcher.wonda-pulse::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 32px;
    border: 2px solid var(--wonda-accent, #FF007E);
    opacity: 0;
    animation: wonda-pulse 2.4s ease-out infinite;
    pointer-events: none;
}
@keyframes wonda-pulse {
    0%   { transform: scale(.92); opacity: .55; }
    70%  { transform: scale(1.18); opacity: 0; }
    100% { transform: scale(1.18); opacity: 0; }
}

.wonda-demo .wonda-launcher__badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 20px; height: 20px;
    background: #ef4444; color: #fff;
    border-radius: 10px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 6px; box-shadow: 0 2px 6px rgba(0,0,0,.2);
    pointer-events: none; line-height: 1;
}

/* ============================================================
   Launcher group — teaser + launcher on one inline row
   ============================================================ */
.wonda-demo .wonda-launcher-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row;
    pointer-events: none;
}
.wonda-demo.wonda-bl .wonda-launcher-group,
.wonda-demo.wonda-tl .wonda-launcher-group {
    flex-direction: row-reverse;
}

/* ============================================================
   Teaser bubble — inline, sits next to the launcher
   ============================================================ */
.wonda-demo .wonda-teaser {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 12px 16px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.15);
    font-size: 13px;
    line-height: 1.4;
    color: #0f172a;
    cursor: pointer;
    pointer-events: auto;
    flex-shrink: 0;
    animation: wonda-teaser-pop-right .3s ease;
}
.wonda-demo.wonda-bl .wonda-teaser,
.wonda-demo.wonda-tl .wonda-teaser {
    animation-name: wonda-teaser-pop-left;
}

.wonda-demo .wonda-teaser__text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.wonda-demo .wonda-teaser__close {
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
    cursor: pointer;
    flex-shrink: 0;
    pointer-events: auto;
}
.wonda-demo .wonda-teaser__close:hover { color: #475569; }

/* CSAT card keeps the vertical pop keyframe */
@keyframes wonda-teaser-pop {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Inline teaser slides in horizontally from the launcher */
@keyframes wonda-teaser-pop-right {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes wonda-teaser-pop-left {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.wonda-demo .wonda-window {
    position: absolute;
    width: 380px;
    height: min(80vh, 620px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px -10px rgba(0,0,0,.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    pointer-events: auto;
    font-family: inherit;
    color: #0f172a;
}
.wonda-demo.wonda-br .wonda-window,
.wonda-demo.wonda-tr .wonda-window { right: 0; }
.wonda-demo.wonda-bl .wonda-window,
.wonda-demo.wonda-tl .wonda-window { left: 0; }
.wonda-demo.wonda-br .wonda-window,
.wonda-demo.wonda-bl .wonda-window { bottom: 72px; }
.wonda-demo.wonda-tr .wonda-window,
.wonda-demo.wonda-tl .wonda-window { top: 72px; }

.wonda-demo .wonda-window.wonda-open { display: flex; }

.wonda-demo .wonda-window__header {
    background: var(--wonda-accent, #FF007E);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
}
.wonda-demo .wonda-window__header strong { font-size: 15px; font-weight: 600; color: #fff; }
.wonda-demo .wonda-window__header-logo { height: 22px; width: auto; max-width: 140px; }
.wonda-demo .wonda-window__header-spacer { flex: 1; }
.wonda-demo .wonda-window__header-btn {
    background: rgba(255,255,255,.15);
    border: 0;
    padding: 0;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.wonda-demo .wonda-window__header-btn:hover { background: rgba(255,255,255,.25); }
.wonda-demo .wonda-window__header-btn svg { width: 16px; height: 16px; }

.wonda-demo .wonda-menu {
    position: absolute;
    top: 46px;
    right: 10px;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 30px -8px rgba(0,0,0,.2);
    overflow: hidden;
    z-index: 5;
    display: none;
}
.wonda-demo .wonda-menu.wonda-open { display: block; }
.wonda-demo .wonda-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #0f172a;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
.wonda-demo .wonda-menu a:hover { background: #f8fafc; }
.wonda-demo .wonda-menu a svg { width: 14px; height: 14px; color: #64748b; }

.wonda-demo .wonda-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.wonda-demo .wonda-message { max-width: 88%; display: flex; flex-direction: column; }
.wonda-demo .wonda-from-bot { align-self: flex-start; }
.wonda-demo .wonda-from-user { align-self: flex-end; align-items: flex-end; }

.wonda-demo .wonda-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.wonda-demo .wonda-from-bot .wonda-bubble {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}
.wonda-demo .wonda-from-user .wonda-bubble {
    background: var(--wonda-accent, #FF007E);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.wonda-demo .wonda-message-body { white-space: pre-wrap; }
.wonda-demo .wonda-message-body p { margin: 0 0 8px; }
.wonda-demo .wonda-message-body p:last-child { margin-bottom: 0; }
.wonda-demo .wonda-message-body h3,
.wonda-demo .wonda-message-body h4 { margin: 8px 0 4px; font-size: 1em; font-weight: 700; }
.wonda-demo .wonda-message-body ul { margin: 6px 0; padding-left: 20px; }
.wonda-demo .wonda-message-body li { margin: 2px 0; }
.wonda-demo .wonda-message-body code {
    background: rgba(0,0,0,.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: ui-monospace, Menlo, Monaco, Consolas, monospace;
    font-size: .9em;
}
.wonda-demo .wonda-message-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin: 6px 0;
}
.wonda-demo .wonda-message-body pre code { background: transparent; padding: 0; color: inherit; }
.wonda-demo .wonda-from-user .wonda-message-body code { background: rgba(255,255,255,.18); }
.wonda-demo .wonda-message-body a { color: inherit; text-decoration: underline; }
.wonda-demo .wonda-from-bot .wonda-message-body a { color: var(--wonda-accent, #FF007E); }

.wonda-demo .wonda-message-meta {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px; font-size: 11px; color: #94a3b8; min-height: 20px;
}
.wonda-demo .wonda-from-user .wonda-message-meta { color: rgba(255,255,255,.75); }

.wonda-demo .wonda-message-actions { display: flex; gap: 4px; opacity: 1; transition: opacity .12s; }

.wonda-demo .wonda-action {
    background: transparent; border: 0; padding: 3px; cursor: pointer;
    color: #94a3b8; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color .12s, background .12s;
}
.wonda-demo .wonda-action:hover { background: rgba(0,0,0,.06); color: #475569; }
.wonda-demo .wonda-action svg { width: 15px; height: 15px; }
.wonda-demo .wonda-action--done { color: #16a34a; }
.wonda-demo .wonda-action--flash { color: #16a34a !important; }

.wonda-demo .wonda-menu-section {
    border-top: 1px solid #FFE5F2;
    padding: 6px 0;
}
.wonda-demo .wonda-menu-section-title {
    padding: 4px 14px 2px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #94a3b8;
}
.wonda-demo .wonda-menu-theme-item {
    display: flex;
    justify-content: space-between;
}
.wonda-demo .wonda-menu-theme-check {
    color: var(--wonda-accent, #FF007E);
    font-weight: 700;
}
.wonda-demo.wonda-dark .wonda-menu-section {
    border-top-color: #334155;
}
.wonda-demo.wonda-dark .wonda-menu-section-title { color: #64748b; }
.wonda-demo .wonda-action[disabled] { cursor: default; opacity: .55; }

.wonda-demo .wonda-wa-cta {
    display: flex; flex-direction: column; align-items: center;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}
.wonda-demo .wonda-wa-cta small { color: #94a3b8; font-size: 11px; margin-bottom: 6px; }
.wonda-demo .wonda-wa-cta a {
    display: inline-flex; align-items: center; gap: 6px;
    background: #25D366; color: #fff;
    padding: 6px 14px; border-radius: 30px;
    text-decoration: none; font-weight: 600; font-size: 12px;
}
.wonda-demo .wonda-wa-cta a:hover { background: #1ebe5c; color: #fff; text-decoration: none; }
.wonda-demo .wonda-wa-cta svg { width: 14px; height: 14px; }

.wonda-demo .wonda-typing-cursor {
    display: inline-block; width: 2px; height: 1em;
    background: currentColor; vertical-align: -2px; margin-left: 2px;
    animation: wonda-cursor-blink 1s steps(1) infinite;
}
@keyframes wonda-cursor-blink { 50% { opacity: 0; } }

.wonda-demo .wonda-feedback-box {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 10px; margin-top: 6px; width: 100%;
}
.wonda-demo .wonda-feedback-box textarea {
    width: 100%; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 6px 8px; font-size: 12px; font-family: inherit;
    resize: vertical; min-height: 60px;
}
.wonda-demo .wonda-feedback-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.wonda-demo .wonda-feedback-skip,
.wonda-demo .wonda-feedback-send {
    padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer;
    border: 1px solid #e5e7eb; background: #fff; font-family: inherit;
}
.wonda-demo .wonda-feedback-send {
    background: var(--wonda-accent, #FF007E); color: #fff;
    border-color: var(--wonda-accent, #FF007E); font-weight: 600;
}

.wonda-demo .wonda-typing-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.wonda-demo .wonda-typing-label {
    font-size: 13px;
    color: #64748b;
    line-height: 1;
}
.wonda-demo.wonda-dark .wonda-typing-label { color: #94a3b8; }

.wonda-demo .wonda-typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.wonda-demo .wonda-typing span {
    width: 6px; height: 6px; border-radius: 3px;
    background: #94a3b8; display: inline-block;
    animation: wonda-bounce 1.2s infinite;
}
.wonda-demo .wonda-typing span:nth-child(2) { animation-delay: .15s; }
.wonda-demo .wonda-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes wonda-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.wonda-demo .wonda-prompts {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 0 16px 12px; background: #f8fafc;
}
.wonda-demo .wonda-prompt {
    background: #fff; border: 1px solid #e5e7eb; color: #0f172a;
    padding: 6px 12px; border-radius: 16px; font-size: 12px;
    cursor: pointer; font-family: inherit;
}
.wonda-demo .wonda-prompt:hover { background: #eef2f7; }

.wonda-demo .wonda-lead {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 14px; margin: 0 4px; align-self: flex-start; max-width: 90%;
}
.wonda-demo .wonda-lead-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.wonda-demo .wonda-lead-title { font-size: 13px; font-weight: 600; margin: 0; }
.wonda-demo .wonda-lead-close {
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 6px;
    font-family: inherit;
}
.wonda-demo .wonda-lead-close:hover { color: #475569; background: #f1f5f9; }
.wonda-demo .wonda-lead label { display: block; font-size: 12px; color: #64748b; margin: 8px 0 4px; }
.wonda-demo .wonda-lead input {
    width: 100%; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px;
    font-family: inherit; font-size: 14px; background: #fff; color: #0f172a;
}
.wonda-demo .wonda-lead input:focus { outline: none; border-color: var(--wonda-accent, #FF007E); }
.wonda-demo .wonda-lead button {
    margin-top: 10px; padding: 8px 16px;
    background: var(--wonda-accent, #FF007E); color: #fff; border: 0;
    border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px;
    width: 100%; font-family: inherit;
}
.wonda-demo .wonda-lead button[disabled] { opacity: .6; cursor: not-allowed; }

/* --- CSAT card --- */
.wonda-demo .wonda-csat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    align-self: stretch;
    max-width: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,.04);
    animation: wonda-teaser-pop .3s ease;
}
.wonda-demo .wonda-csat-title {
    font-size: 13px;
    font-weight: 600;
    color: #1c1c3c;
    margin-bottom: 12px;
    text-align: center;
}
.wonda-demo .wonda-csat-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
}
.wonda-demo .wonda-csat-star {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #d1d5db;
    cursor: pointer;
    padding: 4px;
    transition: color .12s, transform .12s;
    font-family: inherit;
}
.wonda-demo .wonda-csat-star:hover,
.wonda-demo .wonda-csat-star.wonda-active {
    color: #f59e0b;
    transform: scale(1.1);
}
.wonda-demo .wonda-csat-thanks {
    text-align: center;
    font-size: 13px;
    color: #15803d;
    padding: 8px 0;
}

.wonda-demo .wonda-modal-backdrop {
    position: absolute;
    top: 56px; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,.45);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; z-index: 10;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}
.wonda-demo .wonda-modal {
    background: #fff; border-radius: 14px; padding: 20px;
    max-width: 280px; width: 100%;
    box-shadow: 0 20px 40px -12px rgba(0,0,0,.3);
    text-align: center; font-size: 13px; line-height: 1.5;
}
.wonda-demo .wonda-modal h3 { margin: 0 0 8px; font-size: 15px; color: #1c1c3c; }
.wonda-demo .wonda-modal p { margin: 0 0 10px; color: #475569; }
.wonda-demo .wonda-modal a { color: var(--wonda-accent, #FF007E); }
.wonda-demo .wonda-modal button {
    background: var(--wonda-accent, #FF007E); border: 0;
    padding: 8px 18px; border-radius: 8px; color: #fff;
    font-weight: 600; font-size: 13px; cursor: pointer;
    margin-top: 6px; font-family: inherit;
}

.wonda-demo .wonda-toast {
    position: absolute; bottom: 90px; left: 50%;
    transform: translateX(-50%);
    background: #1e293b; color: #fff; padding: 8px 16px;
    border-radius: 40px; font-size: 12px; font-weight: 500;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    opacity: 0; transition: opacity .2s ease, transform .2s ease;
    pointer-events: none; white-space: nowrap; z-index: 20;
}
.wonda-demo .wonda-toast.wonda-show {
    opacity: 1; transform: translateX(-50%) translateY(-4px);
}

.wonda-demo .wonda-composer {
    padding: 12px 14px; background: #fff; border-top: 1px solid #e5e7eb;
    display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; position: relative;
}
.wonda-demo.wonda-reconnecting .wonda-composer::before {
    content: 'Reconnecting…';
    position: absolute; top: -22px; left: 14px;
    font-size: 11px; color: #b45309; background: #fffbeb;
    padding: 2px 8px; border-radius: 8px; border: 1px solid #fde68a;
}
.wonda-demo .wonda-composer textarea {
    flex: 1; border: 1px solid #e5e7eb; border-radius: 22px;
    padding: 10px 16px; font-family: inherit; font-size: 14px;
    resize: none; max-height: 120px; min-height: 42px;
    line-height: 1.4; background: #f8fafc; color: #0f172a; width: 100%;
}
.wonda-demo .wonda-composer textarea:focus { outline: none; border-color: var(--wonda-accent, #FF007E); background: #fff; }
.wonda-demo .wonda-composer button {
    width: 42px; height: 42px; border-radius: 21px; border: 0; padding: 0;
    background: var(--wonda-accent, #FF007E); color: #fff;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wonda-demo .wonda-composer button[disabled] { opacity: .5; cursor: not-allowed; }
.wonda-demo .wonda-composer button svg { width: 18px; height: 18px; }

.wonda-demo .wonda-footer {
    text-align: center; font-size: 11px; color: #94a3b8;
    padding: 0 0 10px; background: #fff; flex-shrink: 0;
}
.wonda-demo .wonda-footer a { color: #64748b; text-decoration: none; }
.wonda-demo .wonda-footer a:hover { text-decoration: underline; }

.wonda-demo.wonda-dark .wonda-window,
.wonda-demo.wonda-dark .wonda-footer,
.wonda-demo.wonda-dark .wonda-composer { background: #0f172a; border-color: #1e293b; }
.wonda-demo.wonda-dark .wonda-messages { background: #020617; }
.wonda-demo.wonda-dark .wonda-from-bot .wonda-bubble { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.wonda-demo.wonda-dark .wonda-message-body code { background: rgba(255,255,255,.08); }
.wonda-demo.wonda-dark .wonda-composer textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.wonda-demo.wonda-dark .wonda-prompt { background: #1e293b; color: #cbd5e1; border-color: #334155; }
.wonda-demo.wonda-dark .wonda-teaser { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.wonda-demo.wonda-dark .wonda-feedback-box { background: #1e293b; border-color: #334155; }
.wonda-demo.wonda-dark .wonda-feedback-box textarea { background: #0f172a; color: #e2e8f0; border-color: #334155; }
.wonda-demo.wonda-dark .wonda-lead { background: #1e293b; border-color: #334155; }
.wonda-demo.wonda-dark .wonda-lead input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
.wonda-demo.wonda-dark .wonda-csat { background: #1e293b; border-color: #334155; }
.wonda-demo.wonda-dark .wonda-csat-title { color: #e2e8f0; }
.wonda-demo.wonda-dark .wonda-menu { background: #1e293b; border-color: #334155; }
.wonda-demo.wonda-dark .wonda-menu a { color: #e2e8f0; }
.wonda-demo.wonda-dark .wonda-menu a:hover { background: #334155; }
.wonda-demo.wonda-dark .wonda-modal { background: #1e293b; color: #e2e8f0; }
.wonda-demo.wonda-dark .wonda-modal h3 { color: #f1f5f9; }
.wonda-demo.wonda-dark .wonda-modal p { color: #cbd5e1; }
.wonda-demo.wonda-dark .wonda-action { color: #64748b; }
.wonda-demo.wonda-dark .wonda-action:hover { background: rgba(255,255,255,.06); color: #cbd5e1; }

@media (prefers-reduced-motion: reduce) {
    .wonda-demo *, .wonda-demo *::before, .wonda-demo *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .wonda-demo .wonda-launcher.wonda-pulse::before { animation: none; opacity: 0; }
    .wonda-demo .wonda-typing-cursor { animation: none; opacity: .4; }
}

@media (max-width: 480px) {
    .wonda-demo.wonda-br { bottom: 12px; right: 12px; }
    .wonda-demo.wonda-bl { bottom: 12px; left: 12px; }
    .wonda-demo.wonda-tr { top: 12px; right: 12px; }
    .wonda-demo.wonda-tl { top: 12px; left: 12px; }
    .wonda-demo .wonda-window {
        position: fixed;
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: auto;
        width: auto;
        height: calc(var(--wonda-vh-px, 100vh) - 24px);
        max-height: calc(100vh - 24px);
        border-radius: 14px;
        transition: height 0.15s ease;
    }
    .wonda-demo .wonda-launcher { width: 52px; height: 52px; }
    .wonda-demo .wonda-teaser {
        max-width: calc(100vw - 110px);
        font-size: 12.5px;
        padding: 10px 12px;
    }
}

/* ============================================================
   Phase 7.5 — Visual upgrade (corporate look + avatars)
   ============================================================ */

.wonda-demo {
    --wonda-radius-lg: 20px;
    --wonda-radius-md: 14px;
    --wonda-radius-sm: 10px;
    --wonda-radius-bubble: 18px;
    --wonda-shadow-window: 0 24px 60px -20px rgba(15, 23, 42, .30), 0 12px 24px -12px rgba(15, 23, 42, .18);
    --wonda-shadow-launcher: 0 10px 30px -8px rgba(0, 0, 0, .28), 0 4px 12px -4px rgba(0, 0, 0, .16);
    --wonda-shadow-launcher-hover: 0 14px 36px -8px rgba(0, 0, 0, .32), 0 6px 16px -4px rgba(0, 0, 0, .20);
    --wonda-border-soft: rgba(15, 23, 42, .06);
    --wonda-text-primary: #0f172a;
    --wonda-text-secondary: #64748b;
    --wonda-surface-elevated: #ffffff;
    --wonda-surface-canvas: #f7f9fc;
    --wonda-avatar-size: 34px;
    --wonda-header-height: 60px;
}

/* Launcher — squircle with richer depth */
.wonda-demo .wonda-launcher {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E) 0%,
        color-mix(in srgb, var(--wonda-accent, #FF007E) 78%, black) 100%);
    box-shadow: var(--wonda-shadow-launcher);
    transition: transform .18s ease, box-shadow .18s ease;
}
.wonda-demo .wonda-launcher:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: var(--wonda-shadow-launcher-hover);
}

/* Window shell */
.wonda-demo .wonda-window {
    width: 400px;
    height: min(82vh, 660px);
    border-radius: var(--wonda-radius-lg);
    box-shadow: var(--wonda-shadow-window);
    border: 1px solid var(--wonda-border-soft);
}

/* Header */
.wonda-demo .wonda-window__header {
    padding: 14px 16px;
    min-height: var(--wonda-header-height);
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E) 0%,
        color-mix(in srgb, var(--wonda-accent, #FF007E) 72%, black) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.wonda-demo .wonda-window__header strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    color: #fff;
}
.wonda-demo .wonda-window__header-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
}
.wonda-demo .wonda-window__header-btn:hover {
    background: rgba(255, 255, 255, .22);
}

/* Messages canvas */
.wonda-demo .wonda-messages {
    padding: 20px 18px 16px;
    gap: 14px;
    background: var(--wonda-surface-canvas);
}

/* Message row — avatar + bubble */
.wonda-demo .wonda-message {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    max-width: 92%;
}
.wonda-demo .wonda-from-user {
    flex-direction: row-reverse;
}

/* Avatar */
.wonda-demo .wonda-avatar {
    width: var(--wonda-avatar-size);
    height: var(--wonda-avatar-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-end;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}
.wonda-demo .wonda-avatar svg {
    width: 18px;
    height: 18px;
    display: block;
}
.wonda-demo .wonda-avatar--bot {
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E) 0%,
        color-mix(in srgb, var(--wonda-accent, #FF007E) 75%, black) 100%);
    color: #fff;
}
.wonda-demo .wonda-avatar--user {
    background: #fff;
    border: 1px solid var(--wonda-border-soft);
    color: var(--wonda-text-secondary);
}

/* Bubble — refined */
.wonda-demo .wonda-bubble {
    background: #fff;
    border: 1px solid var(--wonda-border-soft);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 12px 14px;
    border-radius: var(--wonda-radius-bubble);
    border-bottom-left-radius: 6px;
}
.wonda-demo .wonda-from-user .wonda-bubble {
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E) 0%,
        color-mix(in srgb, var(--wonda-accent, #FF007E) 82%, black) 100%);
    color: #fff;
    border: 0;
    border-bottom-left-radius: var(--wonda-radius-bubble);
    border-bottom-right-radius: 6px;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--wonda-accent, #FF007E) 55%, transparent);
}

.wonda-demo .wonda-message-body {
    font-size: 14px;
    line-height: 1.55;
}

.wonda-demo .wonda-message-meta {
    margin-top: 8px;
    min-height: 16px;
    opacity: .92;
}
.wonda-demo .wonda-from-user .wonda-message-meta {
    color: rgba(255, 255, 255, .82);
}

.wonda-demo .wonda-action {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

/* Typing */
.wonda-demo .wonda-typing-wrap {
    padding: 3px 2px;
}
.wonda-demo .wonda-typing-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--wonda-text-secondary);
}

/* Composer */
.wonda-demo .wonda-composer {
    padding: 14px 16px 16px;
    background: #fff;
    border-top: 1px solid var(--wonda-border-soft);
    gap: 10px;
}
.wonda-demo .wonda-composer textarea {
    background: var(--wonda-surface-canvas);
    border: 1px solid var(--wonda-border-soft);
    border-radius: 14px;
    padding: 11px 16px;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.wonda-demo .wonda-composer textarea:focus {
    background: #fff;
    border-color: var(--wonda-accent, #FF007E);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--wonda-accent, #FF007E) 14%, transparent);
    outline: none;
}
.wonda-demo .wonda-composer button {
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E) 0%,
        color-mix(in srgb, var(--wonda-accent, #FF007E) 78%, black) 100%);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--wonda-accent, #FF007E) 55%, transparent);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    transition: transform .1s ease, box-shadow .15s ease;
}
.wonda-demo .wonda-composer button:hover:not([disabled]) {
    transform: translateY(-1px);
}
.wonda-demo .wonda-composer button:active:not([disabled]) {
    transform: translateY(0) scale(.97);
}

/* Quick prompts */
.wonda-demo .wonda-prompt {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 500;
    background: #fff;
    border: 1px solid var(--wonda-border-soft);
    transition: all .15s ease;
}
.wonda-demo .wonda-prompt:hover {
    border-color: color-mix(in srgb, var(--wonda-accent, #FF007E) 45%, transparent);
    background: color-mix(in srgb, var(--wonda-accent, #FF007E) 6%, #fff);
}

/* Lead form */
.wonda-demo .wonda-lead {
    border-radius: var(--wonda-radius-md);
    padding: 16px;
    box-shadow: 0 8px 24px -12px rgba(15, 23, 42, .16);
}
.wonda-demo .wonda-lead input {
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--wonda-surface-canvas);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wonda-demo .wonda-lead input:focus {
    background: #fff;
    border-color: var(--wonda-accent, #FF007E);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--wonda-accent, #FF007E) 14%, transparent);
    outline: none;
}
.wonda-demo .wonda-lead button {
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E),
        color-mix(in srgb, var(--wonda-accent, #FF007E) 78%, black));
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--wonda-accent, #FF007E) 55%, transparent);
}

/* CSAT */
.wonda-demo .wonda-csat {
    border-radius: var(--wonda-radius-md);
    box-shadow: 0 10px 28px -14px rgba(15, 23, 42, .18);
}
.wonda-demo .wonda-csat-star {
    font-size: 32px;
}

/* Footer */
.wonda-demo .wonda-footer {
    background: #fff;
    border-top: 1px solid var(--wonda-border-soft);
    padding: 8px 0 10px;
    font-size: 11px;
}

/* Dark mode refinements */
.wonda-demo.wonda-dark {
    --wonda-border-soft: rgba(255, 255, 255, .06);
    --wonda-text-primary: #e2e8f0;
    --wonda-text-secondary: #94a3b8;
    --wonda-surface-canvas: #0b1220;
}
.wonda-demo.wonda-dark .wonda-window {
    background: #0f172a;
    border-color: rgba(255, 255, 255, .06);
}
.wonda-demo.wonda-dark .wonda-messages {
    background: #0b1220;
}
.wonda-demo.wonda-dark .wonda-bubble {
    background: #1e293b;
    border-color: rgba(255, 255, 255, .06);
    color: #e2e8f0;
}
.wonda-demo.wonda-dark .wonda-from-user .wonda-bubble {
    color: #fff;
}
.wonda-demo.wonda-dark .wonda-avatar--user {
    background: #1e293b;
    color: #94a3b8;
    border-color: rgba(255, 255, 255, .08);
}
.wonda-demo.wonda-dark .wonda-composer {
    background: #0f172a;
    border-top-color: rgba(255, 255, 255, .06);
}
.wonda-demo.wonda-dark .wonda-composer textarea {
    background: #1e293b;
    border-color: rgba(255, 255, 255, .06);
    color: #e2e8f0;
}
.wonda-demo.wonda-dark .wonda-composer textarea:focus {
    background: #1e293b;
    border-color: var(--wonda-accent, #FF007E);
}
.wonda-demo.wonda-dark .wonda-prompt {
    background: #1e293b;
    border-color: rgba(255, 255, 255, .06);
    color: #cbd5e1;
}
.wonda-demo.wonda-dark .wonda-prompt:hover {
    background: color-mix(in srgb, var(--wonda-accent, #FF007E) 15%, #1e293b);
}
.wonda-demo.wonda-dark .wonda-lead {
    background: #1e293b;
    border-color: rgba(255, 255, 255, .06);
}
.wonda-demo.wonda-dark .wonda-lead input {
    background: #0b1220;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, .08);
}
.wonda-demo.wonda-dark .wonda-csat {
    background: #1e293b;
    border-color: rgba(255, 255, 255, .06);
}
.wonda-demo.wonda-dark .wonda-footer {
    background: #0f172a;
    border-top-color: rgba(255, 255, 255, .06);
}
.wonda-demo.wonda-dark .wonda-action:hover {
    background: rgba(255, 255, 255, .08);
}

/* ============================================================
   Phase 7.6 — Mobile + design fix
   ============================================================ */

/* --- Avatars top-aligned with the bubble, not beside --- */
.wonda-demo .wonda-message {
    align-items: flex-start !important;
}
.wonda-demo .wonda-avatar {
    align-self: flex-start !important;
}

/* --- Quick prompts: transparent bg, themed chips --- */
.wonda-demo .wonda-prompts {
    background: transparent !important;
    border-top: 0 !important;
    padding: 4px 18px 12px !important;
    gap: 8px !important;
}
.wonda-demo .wonda-prompt {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, .10) !important;
    color: var(--wonda-text-primary, #0f172a) !important;
    padding: 9px 14px !important;
    border-radius: 20px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: all .15s ease;
}
.wonda-demo .wonda-prompt:hover {
    border-color: color-mix(in srgb, var(--wonda-accent, #FF007E) 55%, transparent) !important;
    background: color-mix(in srgb, var(--wonda-accent, #FF007E) 6%, #ffffff) !important;
    transform: translateY(-1px);
}
.wonda-demo.wonda-dark .wonda-prompt {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, .10) !important;
    color: #e2e8f0 !important;
}
.wonda-demo.wonda-dark .wonda-prompt:hover {
    background: color-mix(in srgb, var(--wonda-accent, #FF007E) 18%, #1e293b) !important;
}

/* --- Lead form: redesigned card --- */
.wonda-demo .wonda-lead {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    padding: 18px;
    align-self: stretch;
    max-width: 100%;
    margin: 4px 0 8px;
    box-shadow: 0 14px 36px -18px rgba(15, 23, 42, .22);
}
.wonda-demo .wonda-lead-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.wonda-demo .wonda-lead-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E) 0%,
        color-mix(in srgb, var(--wonda-accent, #FF007E) 75%, black) 100%);
    color: #ffffff;
}
.wonda-demo .wonda-lead-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.wonda-demo .wonda-lead-headtext {
    flex: 1;
    min-width: 0;
}
.wonda-demo .wonda-lead-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--wonda-text-primary, #0f172a);
    line-height: 1.2;
    margin: 0;
}
.wonda-demo .wonda-lead-sub {
    font-size: 12px;
    color: var(--wonda-text-secondary, #64748b);
    margin-top: 2px;
    line-height: 1.3;
}
.wonda-demo .wonda-lead-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
    flex-shrink: 0;
}
.wonda-demo .wonda-lead-close:hover {
    background: rgba(15, 23, 42, .06);
    color: #475569;
}
.wonda-demo .wonda-lead-field {
    margin-bottom: 12px;
}
.wonda-demo .wonda-lead-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--wonda-text-secondary, #64748b);
    margin-bottom: 6px;
}
.wonda-demo .wonda-lead input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: #f8fafc;
    color: var(--wonda-text-primary, #0f172a);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.wonda-demo .wonda-lead input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--wonda-accent, #FF007E);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--wonda-accent, #FF007E) 14%, transparent);
}
.wonda-demo .wonda-lead > button {
    width: 100%;
    padding: 13px 18px;
    border-radius: 12px;
    border: 0;
    background: var(--wonda-accent, #FF007E);
    background: linear-gradient(135deg,
        var(--wonda-accent, #FF007E) 0%,
        color-mix(in srgb, var(--wonda-accent, #FF007E) 78%, black) 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--wonda-accent, #FF007E) 60%, transparent);
    transition: transform .12s ease, box-shadow .15s ease;
    margin-top: 4px;
    font-family: inherit;
}
.wonda-demo .wonda-lead > button:hover:not([disabled]) {
    transform: translateY(-1px);
}
.wonda-demo .wonda-lead > button[disabled] {
    opacity: .65;
    cursor: not-allowed;
}
.wonda-demo .wonda-lead-microcopy {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-top: 10px;
    line-height: 1.3;
}
.wonda-demo.wonda-dark .wonda-lead {
    background: #1e293b;
    border-color: rgba(255, 255, 255, .08);
}
.wonda-demo.wonda-dark .wonda-lead-title { color: #f1f5f9; }
.wonda-demo.wonda-dark .wonda-lead-sub,
.wonda-demo.wonda-dark .wonda-lead-label,
.wonda-demo.wonda-dark .wonda-lead-microcopy { color: #94a3b8; }
.wonda-demo.wonda-dark .wonda-lead input {
    background: #0b1220;
    border-color: rgba(255, 255, 255, .08);
    color: #e2e8f0;
}
.wonda-demo.wonda-dark .wonda-lead input:focus { background: #0b1220; }
.wonda-demo.wonda-dark .wonda-lead-close:hover {
    background: rgba(255, 255, 255, .08);
    color: #cbd5e1;
}

/* --- Composer: better focus ring --- */
.wonda-demo .wonda-composer textarea {
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

/* --- Mobile: proper sizing at 768px, docked with margins --- */
@media (max-width: 768px) {
    .wonda-demo .wonda-window {
        position: fixed !important;
        top: 12px !important;
        left: 12px !important;
        right: 12px !important;
        bottom: auto !important;
        width: auto !important;
        height: calc(var(--wonda-vh-px, 100vh) - 24px) !important;
        max-height: calc(var(--wonda-vh-px, 100vh) - 24px) !important;
        border-radius: 18px !important;
        box-shadow: 0 20px 50px -20px rgba(15, 23, 42, .35) !important;
    }
    .wonda-demo .wonda-messages {
        padding: 16px 14px 12px !important;
        gap: 12px !important;
    }
    .wonda-demo .wonda-composer {
        padding: 10px 12px 12px !important;
    }
    .wonda-demo .wonda-composer textarea {
        padding: 10px 14px !important;
        font-size: 15px !important; /* iOS zooms inputs < 16px */
    }
    .wonda-demo .wonda-lead input {
        font-size: 16px !important; /* iOS zooms inputs < 16px */
    }
    .wonda-demo .wonda-window__header {
        padding: 12px 14px !important;
        min-height: 56px !important;
    }
    .wonda-demo .wonda-message {
        max-width: 88% !important;
    }
}

/* ============================================================
   Phase 8 — theme menu icons in the widget menu
   ============================================================ */
.wonda-demo .wonda-menu-theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #64748b;
}
.wonda-demo .wonda-menu-theme-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}
.wonda-demo .wonda-menu-theme-item {
    gap: 8px;
}

/* ============================================================
   Phase 8 fix — theme menu row layout (icon left, label, check right)
   ============================================================ */
.wonda-demo .wonda-menu-theme-item {
    justify-content: flex-start !important;
    align-items: center;
    gap: 10px;
}
.wonda-demo .wonda-menu-theme-label {
    flex: 1;
    text-align: left;
}
.wonda-demo .wonda-menu-theme-check {
    margin-left: auto;
}


/* ============================================================
   Header version tag (e.g. v4.0), sits right after the logo
   ============================================================ */
.wonda-demo .wonda-window__version {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.72;
    color: inherit;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
    pointer-events: none;
}

/* ============================================================
   Logo sizing — belt and braces
   ============================================================ */
.wonda-demo .wonda-window__header-logo {
    height: 24px !important;
    width: auto !important;
    max-width: 120px !important;
    max-height: 24px !important;
    object-fit: contain !important;
    display: block !important;
}
.wonda-demo .wonda-window__header img {
    height: 24px !important;
    max-height: 24px !important;
    max-width: 120px !important;
    object-fit: contain !important;
}
.wonda-demo .wonda-launcher img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}
.wonda-demo .wonda-menu-theme-icon img,
.wonda-demo .wonda-window__header-btn img,
.wonda-demo .wonda-wa-cta img {
    width: 14px !important;
    height: 14px !important;
    object-fit: contain !important;
    display: inline-block !important;
}

/* ============================================================
   Header tightening — more room for the chat
   ============================================================ */
.wonda-demo .wonda-window__header {
    padding: 10px 14px !important;
    min-height: 52px !important;
}

/* Header logo — smaller */
.wonda-demo .wonda-window__header-logo,
.wonda-demo .wonda-window__header img {
    height: 18px !important;
    max-height: 18px !important;
    max-width: 100px !important;
    object-fit: contain !important;
}

/* Header buttons — slightly larger icons inside */
.wonda-demo .wonda-window__header-btn {
    width: 34px !important;
    height: 34px !important;
}
.wonda-demo .wonda-window__header-btn svg {
    width: 17px !important;
    height: 17px !important;
}

/* Message action icons — larger */
.wonda-demo .wonda-action {
    width: 26px !important;
    height: 26px !important;
}
.wonda-demo .wonda-action svg {
    width: 16px !important;
    height: 16px !important;
}

/* Composer send icon */
.wonda-demo .wonda-composer button svg {
    width: 19px !important;
    height: 19px !important;
}

/* Launcher icon */
.wonda-demo .wonda-launcher svg {
    width: 28px !important;
    height: 28px !important;
}

/* Bot / user avatar glyphs */
.wonda-demo .wonda-avatar svg {
    width: 19px !important;
    height: 19px !important;
}

/* ============================================================
   Guarantee bot avatar is always present for bot messages
   ============================================================ */
.wonda-demo .wonda-from-bot > .wonda-avatar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
/* Keep typing bubble same width as the final message */
.wonda-demo .wonda-from-bot > .wonda-bubble {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   Lead capture form — compact redesign
   ============================================================ */
.wonda-demo .wonda-lead {
    padding: 14px 14px 12px !important;
    border-radius: 14px !important;
    margin: 2px 0 6px !important;
}

.wonda-demo .wonda-lead-header {
    gap: 10px !important;
    margin-bottom: 12px !important;
    align-items: center !important;
}
.wonda-demo .wonda-lead-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
}
.wonda-demo .wonda-lead-icon svg {
    width: 16px !important;
    height: 16px !important;
}
.wonda-demo .wonda-lead-title {
    font-size: 14px !important;
    line-height: 1.2 !important;
}
.wonda-demo .wonda-lead-sub {
    font-size: 11px !important;
    margin-top: 1px !important;
    line-height: 1.25 !important;
}
.wonda-demo .wonda-lead-close {
    width: 24px !important;
    height: 24px !important;
    font-size: 18px !important;
}

/* Hide the visible labels — placeholders carry the same info
   and we don't want double text. Kept in the DOM for screen readers. */
.wonda-demo .wonda-lead-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.wonda-demo .wonda-lead-field {
    margin-bottom: 8px !important;
}
.wonda-demo .wonda-lead-field:last-of-type {
    margin-bottom: 10px !important;
}
.wonda-demo .wonda-lead input {
    padding: 9px 12px !important;
    font-size: 13.5px !important;
    border-radius: 9px !important;
    min-height: 0 !important;
}
.wonda-demo .wonda-lead > button {
    padding: 10px 16px !important;
    font-size: 13.5px !important;
    border-radius: 10px !important;
    margin-top: 2px !important;
    box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--wonda-accent, #FF007E) 55%, transparent) !important;
}
.wonda-demo .wonda-lead-microcopy {
    margin-top: 8px !important;
    font-size: 10.5px !important;
    line-height: 1.3 !important;
}

/* Dark mode — keep the same compact metrics */
.wonda-demo.wonda-dark .wonda-lead {
    padding: 14px 14px 12px !important;
}
.wonda-demo.wonda-dark .wonda-lead-title {
    font-size: 14px !important;
}
.wonda-demo.wonda-dark .wonda-lead-sub {
    font-size: 11px !important;
}

/* Mobile — even tighter */
@media (max-width: 480px) {
    .wonda-demo .wonda-lead {
        padding: 12px 12px 10px !important;
        border-radius: 12px !important;
    }
    .wonda-demo .wonda-lead-icon {
        width: 28px !important;
        height: 28px !important;
    }
    .wonda-demo .wonda-lead-title {
        font-size: 13.5px !important;
    }
    .wonda-demo .wonda-lead input {
        padding: 10px 12px !important;
        font-size: 15px !important; /* iOS zoom prevention */
    }
    .wonda-demo .wonda-lead > button {
        padding: 11px 16px !important;
        font-size: 14px !important;
    }
}

/* ============================================================
   Widget header brand wrapper + mobile shrink
   ============================================================ */
.wonda-demo .wonda-window__brand {
    display: inline-flex;
    align-items: flex-end;
    gap: 5px;
    max-width: 100%;
    min-width: 0;
}
.wonda-demo .wonda-window__brand strong {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}
.wonda-demo .wonda-window__version {
    font-size: 9px !important;
    font-weight: 500 !important;
    letter-spacing: .02em !important;
    color: inherit !important;
    opacity: .62 !important;
    line-height: 1 !important;
    margin-bottom: 1px !important;
    white-space: nowrap !important;
    pointer-events: none !important;
}

@media (max-width: 480px) {
    /* Tighter header on phones */
    .wonda-demo .wonda-window__header {
        padding: 8px 12px !important;
        min-height: 44px !important;
        gap: 8px !important;
    }
    /* Smaller logo on phones */
    .wonda-demo .wonda-window__header-logo,
    .wonda-demo .wonda-window__header img {
        height: 15px !important;
        max-height: 15px !important;
        max-width: 80px !important;
    }
    /* Smaller header buttons */
    .wonda-demo .wonda-window__header-btn {
        width: 30px !important;
        height: 30px !important;
    }
    .wonda-demo .wonda-window__header-btn svg {
        width: 15px !important;
        height: 15px !important;
    }
    .wonda-demo .wonda-window__brand strong { font-size: 14px; }
    .wonda-demo .wonda-window__version { font-size: 8px !important; }
}

/* ============================================================
   Header notice (admin-set, appears below the widget header)
   ============================================================ */
.wonda-demo .wonda-header-notice {
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.wonda-demo .wonda-header-notice--info {
    background: #eff6ff;
    color: #1e40af;
}
.wonda-demo .wonda-header-notice--warn {
    background: #fffbeb;
    color: #92400e;
}
.wonda-demo.wonda-dark .wonda-header-notice--info {
    background: rgba(59, 130, 246, .15);
    color: #93c5fd;
    border-bottom-color: rgba(255, 255, 255, .06);
}
.wonda-demo.wonda-dark .wonda-header-notice--warn {
    background: rgba(180, 83, 9, .18);
    color: #fbbf24;
    border-bottom-color: rgba(255, 255, 255, .06);
}

/* ============================================================
   Header icon alignment — force consistent centering
   ============================================================ */
.wonda-demo .wonda-window__header-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important;
    padding: 0 !important;
}
.wonda-demo .wonda-window__header-btn > * {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important;
}
.wonda-demo .wonda-window__header-btn svg {
    display: block !important;
    width: 17px !important;
    height: 17px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}
.wonda-demo .wonda-window__header-btn img {
    display: block !important;
    width: 17px !important;
    height: 17px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

@media (max-width: 480px) {
    .wonda-demo .wonda-header-notice {
        padding: 6px 12px;
        font-size: 12px;
    }
    .wonda-demo .wonda-window__header-btn svg,
    .wonda-demo .wonda-window__header-btn img {
        width: 15px !important;
        height: 15px !important;
    }
}

/* ============================================================
   WONDA_WIDGET_TABLE_CSS
   Markdown tables rendered inside the widget's message body.
   The wrap div scrolls horizontally so long tables (pricing,
   comparisons) don't blow out the 380px chat panel.
   ============================================================ */

.wonda-demo .wonda-md-table-wrap {
    margin: 10px -6px 10px -2px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 10px;
    background: #ffffff;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .55) transparent;
}
.wonda-demo .wonda-md-table-wrap::-webkit-scrollbar { height: 6px; }
.wonda-demo .wonda-md-table-wrap::-webkit-scrollbar-track { background: transparent; }
.wonda-demo .wonda-md-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .5);
    border-radius: 3px;
}

.wonda-demo .wonda-md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    line-height: 1.4;
    background: #ffffff;
    min-width: 280px;
}

.wonda-demo .wonda-md-table__th {
    padding: 8px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    white-space: nowrap;
}
.wonda-demo .wonda-md-table__td {
    padding: 8px 12px;
    color: #0f172a;
    border-bottom: 1px solid rgba(15, 23, 42, .05);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.wonda-demo .wonda-md-table__th--right,
.wonda-demo .wonda-md-table__td--right  { text-align: right; }
.wonda-demo .wonda-md-table__th--center,
.wonda-demo .wonda-md-table__td--center { text-align: center; }
.wonda-demo .wonda-md-table__th--left,
.wonda-demo .wonda-md-table__td--left   { text-align: left; }

.wonda-demo .wonda-md-table tbody tr:last-child .wonda-md-table__td {
    border-bottom: 0;
}
.wonda-demo .wonda-md-table tbody tr:hover {
    background: rgba(255, 0, 126, .03);
}

/* Bold text in a table cell (package names often come as **bold**) */
.wonda-demo .wonda-md-table strong { font-weight: 700; color: #0f172a; }

/* Dark mode */
.wonda-demo.wonda-dark .wonda-md-table-wrap {
    border-color: rgba(255, 255, 255, .08);
    background: #0f172a;
}
.wonda-demo.wonda-dark .wonda-md-table { background: #0f172a; }
.wonda-demo.wonda-dark .wonda-md-table__th {
    background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
    color: #cbd5e1;
    border-bottom-color: rgba(255, 255, 255, .08);
}
.wonda-demo.wonda-dark .wonda-md-table__td {
    color: #e2e8f0;
    border-bottom-color: rgba(255, 255, 255, .06);
}
.wonda-demo.wonda-dark .wonda-md-table strong { color: #f1f5f9; }
.wonda-demo.wonda-dark .wonda-md-table tbody tr:hover {
    background: rgba(255, 0, 126, .08);
}

/* ==== END WONDA_WIDGET_TABLE_CSS ==== */

/* ============================================================
   WONDA_WIDGET_LINK_STYLE
   Link text inherits the bubble's own text colour — whatever is
   already readable on that bubble in either theme. The accent only
   shows in the underline. Result: legible on every accent, every
   theme, every bubble.
   ============================================================ */

.wonda-demo .wonda-from-bot .wonda-message-body a,
.wonda-demo.wonda-dark .wonda-from-bot .wonda-message-body a {
    color: inherit !important;
    text-decoration: underline !important;
    text-decoration-color: var(--wonda-accent, #FF007E) !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
    font-weight: 600;
}

.wonda-demo .wonda-from-user .wonda-message-body a,
.wonda-demo.wonda-dark .wonda-from-user .wonda-message-body a {
    color: inherit !important;
    text-decoration: underline !important;
    text-decoration-color: rgba(255, 255, 255, 0.85) !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
    font-weight: 600;
}

/* ==== END WONDA_WIDGET_LINK_STYLE ==== */


/* ============================================================
   WONDA_WIDGET_RICH_MAP
   Rich map card rendered inside a bot bubble.
   ============================================================ */

.wonda-demo .wonda-rich {
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, .08);
    animation: wonda-rich-in 420ms ease both;
}
@keyframes wonda-rich-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wonda-demo .wonda-rich__map {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #111827;
    position: relative;
    overflow: hidden;
}
.wonda-demo .wonda-rich__map.leaflet-container {
    background: #0f172a;
    font-family: inherit;
    font-size: 11px;
}
.wonda-demo .wonda-rich__map .leaflet-control-attribution {
    background: rgba(15, 23, 42, .78) !important;
    color: rgba(226, 232, 240, .75) !important;
    font-size: 9.5px !important;
    padding: 1px 5px !important;
    border-radius: 4px 0 0 0 !important;
}
.wonda-demo .wonda-rich__map .leaflet-control-attribution a {
    color: rgba(226, 232, 240, .92) !important;
}
.wonda-demo .wonda-rich__map .leaflet-container:focus,
.wonda-demo .wonda-rich__map .leaflet-container:focus-visible {
    outline: none !important;
}
.wonda-demo .wonda-rich__map-marker,
.wonda-demo .wonda-rich__map-marker.leaflet-div-icon {
    background: transparent !important;
    border: 0 !important;
}
@keyframes wonda-map-pulse {
    0%   { transform: scale(.8); opacity: .45; }
    70%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}

.wonda-demo .wonda-rich__body { padding: 10px 12px 12px; }
.wonda-demo .wonda-rich__title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.3;
    margin: 0 0 3px;
}
.wonda-demo .wonda-rich__meta {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0 0 10px;
}
.wonda-demo .wonda-rich__row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.wonda-demo .wonda-rich__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 9px;
    background: var(--wonda-accent, #FF007E);
    color: #fff !important;
    text-decoration: none !important;
}
.wonda-demo .wonda-rich__cta:hover {
    filter: brightness(1.08);
    color: #fff !important;
    text-decoration: none !important;
}

/* Dark mode inherits the same colours — card is already dark. */
.wonda-demo.wonda-dark .wonda-rich {
    border-color: rgba(255, 255, 255, .06);
}

/* ═════════════════════════════════════════════════════════════════
   STATIC MODE
   Reverses the fixed positioning from the live widget and gives
   the window an explicit height so it renders as a self-contained
   card inside a marketing page.
   ═════════════════════════════════════════════════════════════════ */

.wonda-demo {
    position: static !important;
    z-index: auto !important;
    bottom: auto !important;
    right: auto !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    max-width: 100% !important;
}

.wonda-demo * {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
}

.wonda-demo .wonda-root-inner {
    position: relative !important;
    pointer-events: none !important;
}

.wonda-demo .wonda-window {
    position: static !important;
    display: flex !important;
    width: 100% !important;
    max-width: 400px !important;
    height: 500px !important;
    max-height: 500px !important;
    margin: 0 auto !important;
    bottom: auto !important;
    right: auto !important;
    top: auto !important;
    left: auto !important;
    box-shadow:
        0 40px 80px -40px rgba(15, 23, 42, .55),
        0 16px 40px -20px rgba(15, 23, 42, .30) !important;
}

/* Launcher and teaser never show in a static shot. */
.wonda-demo .wonda-launcher,
.wonda-demo .wonda-launcher-group,
.wonda-demo .wonda-teaser {
    display: none !important;
}

/* Composer is inert — pointer-events: none is inherited */
.wonda-demo .wonda-composer textarea {
    cursor: default !important;
}


/* Small tag under a bot bubble */
.wonda-demo .wonda-demo-tag {
    display: block;
    font-size: 10.5px;
    color: #64748b;
    font-family: ui-monospace, Menlo, Monaco, Consolas, monospace;
    margin-top: 2px;
    padding-left: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   Demo-only tweaks
   ═══════════════════════════════════════════════════════════════ */

/* Product list inside a bot bubble — mirrors the widget's own
   markdown bullet list rendering. */
.wonda-demo .wonda-message-body ul.wonda-demo-products {
    margin: 8px 0 2px;
    padding-left: 20px;
}
.wonda-demo .wonda-message-body ul.wonda-demo-products li {
    margin: 5px 0;
    line-height: 1.45;
}
.wonda-demo .wonda-message-body ul.wonda-demo-products code {
    font-size: 11px;
    padding: 1px 5px;
    background: rgba(255, 255, 255, .06);
    border: 0;
    color: #94a3b8;
}

/* The lead form is a direct child of .wonda-messages in the real
   widget; keep it flush left like the widget does. */
.wonda-demo .wonda-messages > .wonda-lead {
    align-self: flex-start;
    max-width: 92%;
    margin: 4px 0 8px;
}

/* The CSAT card in the real widget spans the whole message column. */
.wonda-demo .wonda-messages > .wonda-csat {
    align-self: stretch;
    margin: 4px 0 8px;
}

/* Make the composer's disabled send button look active (it's just
   a static shot; the widget's own styling is correct). */
.wonda-demo .wonda-composer button.wonda-composer__send {
    opacity: 1 !important;
}

/* Give the readonly textarea the look of the live one. */
.wonda-demo .wonda-composer textarea {
    pointer-events: none !important;
    cursor: default !important;
}


/* ═════════════════════════════════════════════════════════════════
   WONDA_WIDGET_DEMO_AUTOSCROLL_CSS
   Homepage widget previews: no scrollbar visible, no user scroll.
   The messages container is auto-scrolled by JS in app.js.
   ═════════════════════════════════════════════════════════════════ */
.wonda-demo .wonda-messages {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    scroll-behavior: auto !important;
    overscroll-behavior: contain;
}
.wonda-demo .wonda-messages::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}


/* ═════════════════════════════════════════════════════════════════
   WONDA_WIDGET_DEMO_PRODUCT_CARDS
   Products in the homepage preview render as image cards stacked
   in a single column, matching how a real widget shows them when
   the bot attaches an image.
   ═════════════════════════════════════════════════════════════════ */
.wonda-demo .wonda-demo-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0 2px;
}

.wonda-demo .wonda-demo-product {
    display: flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    border-radius: 10px;
    align-items: center;
    min-width: 0;
}

.wonda-demo .wonda-demo-product__media {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background-color: #334155;
    background-image: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    position: relative;
    overflow: hidden;
}

.wonda-demo .wonda-demo-product__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wonda-demo .wonda-demo-product__title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wonda-demo .wonda-demo-product__meta {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wonda-demo .wonda-demo-product__price {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

/* Light-mode fallback (if the demo is ever rendered light) */
.wonda-demo:not(.wonda-dark) .wonda-demo-product {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, .08);
}
.wonda-demo:not(.wonda-dark) .wonda-demo-product__title,
.wonda-demo:not(.wonda-dark) .wonda-demo-product__price {
    color: #0f172a;
}
.wonda-demo:not(.wonda-dark) .wonda-demo-product__meta {
    color: #64748b;
}


/* ═════════════════════════════════════════════════════════════════
   WONDA_DEMO_INTERACTIVE
   Release the pointer-events / user-select lock so the demos are
   clickable and typeable. Everything else stays exactly as-is.
   ═════════════════════════════════════════════════════════════════ */
.wonda-demo,
.wonda-demo * {
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* Remove the readonly look on the composer textarea when it is live */
.wonda-demo .wonda-composer textarea {
    cursor: text !important;
}

/* Demo toast — appears inside the widget when a demo-only action fires */
.wonda-demo-toast {
    position: absolute;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%) translateY(6px);
    max-width: min(340px, calc(100% - 24px));
    padding: 11px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, .96);
    color: #f1f5f9;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none !important;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 60;
}
.wonda-demo-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Lead form success state */
.wonda-demo-lead-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 18px;
    text-align: center;
}
.wonda-demo-lead-success__icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 8px 20px -6px rgba(34, 197, 94, .45);
}
.wonda-demo-lead-success__title {
    font-size: 14.5px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.35;
}
.wonda-demo-lead-success__sub {
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.5;
    word-break: break-word;
}
.wonda-demo:not(.wonda-dark) .wonda-demo-lead-success__title { color: #0f172a; }
.wonda-demo:not(.wonda-dark) .wonda-demo-lead-success__sub   { color: #64748b; }

/* Message actions look clickable in the demo */
.wonda-demo .wonda-action {
    cursor: pointer !important;
}
.wonda-demo .wonda-action:hover {
    background: rgba(255, 255, 255, .08);
}

/* Header buttons look clickable */
.wonda-demo .wonda-window__header-btn {
    cursor: pointer !important;
}
.wonda-demo .wonda-window__header-btn:hover {
    background: rgba(255, 255, 255, .22) !important;
}

/* Product cards become clickable teasers */
.wonda-demo .wonda-demo-product {
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease;
}
.wonda-demo .wonda-demo-product:hover {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
}

/* CSAT stars become clickable */
.wonda-demo .wonda-csat-star {
    cursor: pointer !important;
}
.wonda-demo .wonda-csat-star:disabled {
    cursor: default !important;
}


/* ═════════════════════════════════════════════════════════════════
   WONDA_DEMO_BUBBLE_WIDTH
   Message rows cap at 72% of the messages column, and left/right
   rows get a hard minimum gutter so they never touch or cross.
   ================================================================ */

/* Base row: cap the total row width (avatar + bubble) */
.wonda-demo .wonda-message {
    max-width: 84% !important;
    box-sizing: border-box;
}

/* Bot rows: hug the left, never cross past 60% of column */
.wonda-demo .wonda-from-bot {
    align-self: flex-start !important;
    margin-right: auto !important;
    margin-left: 0 !important;
    max-width: 84% !important;
}

/* User rows: hug the right, never cross into the left side */
.wonda-demo .wonda-from-user {
    align-self: flex-end !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    max-width: 84% !important;
}

/* Bubble itself gets a touch more inner padding now that it is narrower */
.wonda-demo .wonda-bubble {
    min-width: 0;
}

/* Very narrow screens: relax the cap slightly so it doesn't look cramped */
@media (max-width: 480px) {
    .wonda-demo .wonda-message,
    .wonda-demo .wonda-from-bot,
    .wonda-demo .wonda-from-user {
        max-width: 90% !important;
    }
}

/* The lead form and CSAT are full-width children, not messages —
   they should not be affected by the 72% cap. */
.wonda-demo .wonda-messages > .wonda-lead,
.wonda-demo .wonda-messages > .wonda-csat {
    align-self: stretch !important;
    max-width: 100% !important;
}
