/* ═══════════════════════════════════════════════════════════════════
   VOICETACT CHAT WIDGET — PREMIUM DESIGN SYSTEM
   Dark glassmorphic surfaces + VoiceTact green brand.
   All design tokens live on :root. Components consume tokens only.
═══════════════════════════════════════════════════════════════════ */

:root {
    /* ── Brand colors (VoiceTact green) ── */
    --cw-primary:        #19C96B;
    --cw-primary-dark:   #12A356;
    --cw-primary-light:  #90ffae;
    --cw-accent:         #0ea5e9;
    --cw-gradient:       linear-gradient(135deg, #19C96B 0%, #0fb87f 55%, #0d9e6e 100%);
    --cw-gradient-soft:  linear-gradient(135deg, rgba(25,201,107,0.16) 0%, rgba(144,255,174,0.06) 100%);

    /* ── Dark surfaces (match voicetact.com) ── */
    --cw-bg:             #0B1117;
    --cw-surface:        #101821;
    --cw-surface-2:      #16202b;
    --cw-border:         rgba(255, 255, 255, 0.08);
    --cw-border-strong:  rgba(144, 255, 174, 0.22);
    --cw-text:           #f1f5f9;
    --cw-text-muted:     #a7b0c0;
    --cw-text-faint:     #64748b;

    /* ── Status colors ── */
    --cw-success:        #10b981;
    --cw-error:          #ef4444;
    --cw-warning:        #f59e0b;

    /* ── Shadows (layered, with brand glow) ── */
    --cw-shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.35);
    --cw-shadow-md:      0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
    --cw-shadow-lg:      0 24px 64px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.04);
    --cw-glow:           0 8px 32px rgba(25, 201, 107, 0.35);

    /* ── Radius scale ── */
    --cw-radius-sm:      8px;
    --cw-radius-md:      12px;
    --cw-radius-lg:      16px;
    --cw-radius-xl:      20px;
    --cw-radius-full:    9999px;

    /* ── Typography & motion ── */
    --cw-font:           var(--font-poppins, 'Inter'), 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --cw-transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --cw-spring:         0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════════════════════════════
   ROOT CONTAINER
═══════════════════════════════════════════════════════════════════ */

.cw-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2147483000;
    font-family: var(--cw-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--cw-text);
}

.cw-root *,
.cw-root *::before,
.cw-root *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   FLOATING TOGGLE BUTTON — glow + attention pulse ring
═══════════════════════════════════════════════════════════════════ */

.cw-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: var(--cw-radius-full);
    background: var(--cw-gradient);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--cw-glow), var(--cw-shadow-md);
    transition: transform var(--cw-transition), box-shadow var(--cw-transition);
    animation: cw-toggle-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cw-toggle-enter {
    from { opacity: 0; transform: scale(0.4) translateY(20px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* Expanding attention ring — stops once the window is open */
.cw-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid rgba(25, 201, 107, 0.65);
    animation: cw-ring 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}

.cw-root.is-open .cw-toggle::before { animation: none; opacity: 0; }

@keyframes cw-ring {
    0%   { transform: scale(1);    opacity: 0.8; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* Sheen sweep on hover */
.cw-toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
    background-size: 220% 100%;
    background-position: 130% 0;
    transition: background-position 0.7s ease;
    pointer-events: none;
}

.cw-toggle:hover::after { background-position: -30% 0; }

.cw-toggle:hover  { transform: scale(1.08); box-shadow: 0 12px 40px rgba(25, 201, 107, 0.5), var(--cw-shadow-md); }
.cw-toggle:active { transform: scale(0.96); }
.cw-toggle:focus-visible {
    outline: 3px solid var(--cw-primary-light);
    outline-offset: 3px;
}

.cw-toggle-icon {
    width: 26px;
    height: 26px;
    position: absolute;
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Icon swap: chat visible by default, close when window open */
.cw-toggle-icon--close                  { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.cw-root.is-open .cw-toggle-icon--chat  { opacity: 0; transform: rotate(90deg) scale(0.5); }
.cw-root.is-open .cw-toggle-icon--close { opacity: 1; transform: rotate(0) scale(1); }

/* ═══════════════════════════════════════════════════════════════════
   CHAT WINDOW — dark glass panel
═══════════════════════════════════════════════════════════════════ */

.cw-window {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 384px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: rgba(11, 17, 23, 0.92);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--cw-border);
    border-radius: 24px;
    box-shadow: var(--cw-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: cw-slide-up var(--cw-spring);
}

.cw-window[hidden] { display: none; }

@keyframes cw-slide-up {
    from { opacity: 0; transform: translateY(28px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER — dark with animated gradient accent line
═══════════════════════════════════════════════════════════════════ */

.cw-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 16px;
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(25, 201, 107, 0.18) 0%, transparent 55%),
        var(--cw-surface);
    border-bottom: 1px solid var(--cw-border);
    color: var(--cw-text);
    flex-shrink: 0;
}

/* Shimmering brand accent along the top edge */
.cw-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cw-primary), var(--cw-primary-light), var(--cw-primary), transparent);
    background-size: 200% 100%;
    animation: cw-shimmer 3.5s linear infinite;
}

@keyframes cw-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.cw-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* Avatar with gradient ring + breathing glow */
.cw-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--cw-radius-full);
    background: var(--cw-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(144, 255, 174, 0.25), 0 4px 14px rgba(25, 201, 107, 0.35);
    animation: cw-breathe 3.2s ease-in-out infinite;
}

@keyframes cw-breathe {
    0%, 100% { box-shadow: 0 0 0 2px rgba(144, 255, 174, 0.25), 0 4px 14px rgba(25, 201, 107, 0.30); }
    50%      { box-shadow: 0 0 0 3px rgba(144, 255, 174, 0.40), 0 4px 22px rgba(25, 201, 107, 0.55); }
}

.cw-avatar svg { width: 20px; height: 20px; }

.cw-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #fff 0%, var(--cw-primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cw-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--cw-text-muted);
}

/* Status dot: green online / red offline, pulsing */
.cw-status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--cw-radius-full);
    background: var(--cw-warning);
    flex-shrink: 0;
    animation: cw-pulse 1.6s ease-in-out infinite;
}

.cw-status-dot.is-online  { background: var(--cw-success); }
.cw-status-dot.is-offline { background: var(--cw-error); }

@keyframes cw-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 201, 107, 0.5); }
    50%      { box-shadow: 0 0 0 5px rgba(25, 201, 107, 0); }
}

.cw-header-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cw-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: var(--cw-radius-sm);
    background: transparent;
    color: var(--cw-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--cw-transition), color var(--cw-transition), border-color var(--cw-transition), transform var(--cw-transition);
}

.cw-icon-btn:hover {
    background: rgba(25, 201, 107, 0.12);
    border-color: rgba(25, 201, 107, 0.25);
    color: var(--cw-primary-light);
    transform: translateY(-1px);
}

.cw-icon-btn:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 1px; }
.cw-icon-btn svg           { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════════════════════════
   MESSAGES AREA
═══════════════════════════════════════════════════════════════════ */

.cw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    background:
        radial-gradient(90% 60% at 100% 100%, rgba(25, 201, 107, 0.05) 0%, transparent 60%),
        transparent;
}

.cw-messages::-webkit-scrollbar             { width: 5px; }
.cw-messages::-webkit-scrollbar-thumb       { background: rgba(255, 255, 255, 0.12); border-radius: var(--cw-radius-full); }
.cw-messages::-webkit-scrollbar-thumb:hover { background: rgba(144, 255, 174, 0.35); }

/* ── Welcome card ── */
.cw-welcome {
    background: var(--cw-gradient-soft);
    border: 1px solid var(--cw-border-strong);
    border-radius: var(--cw-radius-lg);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--cw-shadow-sm);
    animation: cw-fade-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cw-welcome-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: var(--cw-radius-full);
    background: var(--cw-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(25, 201, 107, 0.4);
    animation: cw-float 3s ease-in-out infinite;
}

@keyframes cw-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

.cw-welcome-icon svg { width: 24px; height: 24px; }

.cw-welcome h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--cw-text);
}

.cw-welcome p {
    font-size: 13px;
    color: var(--cw-text-muted);
    line-height: 1.6;
}

/* ── Message rows & bubbles ── */
.cw-msg {
    display: flex;
    flex-direction: column;
    max-width: 84%;
    animation: cw-msg-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cw-msg--user { align-self: flex-end; align-items: flex-end; }
.cw-msg--bot  { align-self: flex-start; align-items: flex-start; }

@keyframes cw-msg-in {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.cw-bubble {
    padding: 11px 15px;
    border-radius: var(--cw-radius-lg);
    font-size: 13.5px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* User: brand gradient, right-aligned, soft glow */
.cw-msg--user .cw-bubble {
    background: var(--cw-gradient);
    color: #06281a;
    font-weight: 500;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(25, 201, 107, 0.28);
}

/* Bot: dark glass surface with border, left-aligned */
.cw-msg--bot .cw-bubble {
    background: var(--cw-surface-2);
    color: var(--cw-text);
    border: 1px solid var(--cw-border);
    border-bottom-left-radius: 4px;
    box-shadow: var(--cw-shadow-sm);
}

.cw-timestamp {
    font-size: 10.5px;
    color: var(--cw-text-faint);
    margin-top: 5px;
    padding: 0 4px;
}

@keyframes cw-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Typing indicator (3 animated dots) ── */
.cw-typing .cw-bubble {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 15px 17px;
}

.cw-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--cw-radius-full);
    background: var(--cw-primary);
    animation: cw-bounce 1.2s ease-in-out infinite;
}

.cw-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.cw-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes cw-bounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
    30%           { transform: translateY(-6px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   SUGGESTION CHIPS — staggered entrance, gradient hover fill
═══════════════════════════════════════════════════════════════════ */

.cw-suggestions {
    padding: 0 16px 12px;
    flex-shrink: 0;
}

.cw-suggestions[hidden] { display: none; }

.cw-suggestions-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cw-text-faint);
    margin-bottom: 8px;
}

.cw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.cw-chip {
    border: 1px solid var(--cw-border-strong);
    background: rgba(25, 201, 107, 0.06);
    color: var(--cw-primary-light);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 13px;
    border-radius: var(--cw-radius-full);
    cursor: pointer;
    transition: background var(--cw-transition), border-color var(--cw-transition), color var(--cw-transition), transform var(--cw-transition), box-shadow var(--cw-transition);
    animation: cw-fade-in 0.4s ease backwards;
}

.cw-chip:nth-child(1) { animation-delay: 0.15s; }
.cw-chip:nth-child(2) { animation-delay: 0.25s; }
.cw-chip:nth-child(3) { animation-delay: 0.35s; }

.cw-chip:hover {
    background: var(--cw-gradient);
    border-color: transparent;
    color: #06281a;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(25, 201, 107, 0.35);
}

.cw-chip:active         { transform: translateY(0) scale(0.97); }
.cw-chip:focus-visible  { outline: 2px solid var(--cw-primary); outline-offset: 1px; }

/* ═══════════════════════════════════════════════════════════════════
   INPUT AREA
═══════════════════════════════════════════════════════════════════ */

.cw-input-area {
    flex-shrink: 0;
    padding: 12px 16px 10px;
    background: var(--cw-surface);
    border-top: 1px solid var(--cw-border);
}

.cw-input-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.cw-textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--cw-border);
    border-radius: 14px;
    background: var(--cw-bg);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--cw-text);
    padding: 11px 14px;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color var(--cw-transition), box-shadow var(--cw-transition);
}

.cw-textarea::placeholder { color: var(--cw-text-faint); }

.cw-textarea:focus {
    outline: none;
    border-color: rgba(25, 201, 107, 0.55);
    box-shadow: 0 0 0 3px rgba(25, 201, 107, 0.15);
}

.cw-send-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: var(--cw-radius-full);
    background: var(--cw-gradient);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(25, 201, 107, 0.35);
    transition: transform var(--cw-transition), opacity var(--cw-transition), box-shadow var(--cw-transition);
}

.cw-send-btn:hover:not(:disabled) {
    transform: scale(1.08) rotate(8deg);
    box-shadow: 0 6px 22px rgba(25, 201, 107, 0.5);
}

.cw-send-btn:active:not(:disabled) { transform: scale(0.92); }

.cw-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.cw-send-btn:focus-visible { outline: 2px solid var(--cw-primary-light); outline-offset: 2px; }
.cw-send-btn svg           { width: 17px; height: 17px; }

.cw-powered {
    text-align: center;
    font-size: 10.5px;
    color: var(--cw-text-faint);
    margin-top: 8px;
}

.cw-powered a {
    color: var(--cw-text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--cw-transition);
}

.cw-powered a:hover { color: var(--cw-primary-light); }

/* ═══════════════════════════════════════════════════════════════════
   ERROR TOAST
═══════════════════════════════════════════════════════════════════ */

.cw-toast {
    position: absolute;
    bottom: 78px;
    right: 0;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 24, 33, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--cw-border);
    border-left: 4px solid var(--cw-error);
    border-radius: var(--cw-radius-md);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--cw-text);
    box-shadow: var(--cw-shadow-md);
    animation: cw-toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.cw-toast[hidden] { display: none; }

.cw-toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--cw-warning);
}

@keyframes cw-toast-in {
    from { opacity: 0; transform: translateX(28px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0)    scale(1); }
}

/* Toast rides above the open chat window */
.cw-root.is-open .cw-toast {
    bottom: auto;
    top: -56px;
}

/* ═══════════════════════════════════════════════════════════════════
   LIGHT THEME — when the site is switched to light mode
═══════════════════════════════════════════════════════════════════ */

html.light .cw-window {
    background: rgba(255, 255, 255, 0.94);
    border-color: #e2e8f0;
}

html.light .cw-header {
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(25, 201, 107, 0.12) 0%, transparent 55%),
        #ffffff;
    border-bottom-color: #e2e8f0;
}

html.light .cw-title {
    background: linear-gradient(90deg, #0f172a 0%, var(--cw-primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

html.light .cw-status            { color: #64748b; }
html.light .cw-icon-btn          { color: #64748b; }
html.light .cw-welcome           { background: rgba(25, 201, 107, 0.06); }
html.light .cw-welcome h3        { color: #0f172a; }
html.light .cw-welcome p         { color: #64748b; }
html.light .cw-msg--bot .cw-bubble {
    background: #ffffff;
    color: #0f172a;
    border-color: #e2e8f0;
}
html.light .cw-timestamp         { color: #94a3b8; }
html.light .cw-chip              { background: rgba(25, 201, 107, 0.07); color: var(--cw-primary-dark); }
html.light .cw-input-area        { background: #ffffff; border-top-color: #e2e8f0; }
html.light .cw-textarea          { background: #f8fafc; color: #0f172a; border-color: #e2e8f0; }
html.light .cw-powered           { color: #94a3b8; }
html.light .cw-powered a         { color: #64748b; }
html.light .cw-toast             { background: rgba(255, 255, 255, 0.97); color: #0f172a; border-color: #e2e8f0; }
html.light .cw-messages::-webkit-scrollbar-thumb { background: #e2e8f0; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — full-screen widget on mobile
═══════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .cw-root {
        bottom: 16px;
        right: 16px;
    }

    .cw-window {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
    }

    .cw-toast {
        position: fixed;
        top: 16px;
        left: 16px;
        right: 16px;
        bottom: auto;
        max-width: none;
    }

    .cw-root.is-open .cw-toast {
        top: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .cw-root *,
    .cw-root *::before,
    .cw-root *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   EXPANDED LAYOUT — enlarged chat window (toggled via header button)
═══════════════════════════════════════════════════════════════════ */

.cw-expand-icon--shrink                    { display: none; }
.cw-root.is-expanded .cw-expand-icon--grow   { display: none; }
.cw-root.is-expanded .cw-expand-icon--shrink { display: block; }

.cw-root.is-expanded .cw-window {
    width: min(760px, calc(100vw - 48px));
    height: min(calc(100vh - 120px), 860px);
}

/* ═══════════════════════════════════════════════════════════════════
   DRAGGING — widget can be moved by its header or the toggle button
═══════════════════════════════════════════════════════════════════ */

.cw-header { cursor: grab; touch-action: none; }
.cw-toggle { touch-action: none; }

.cw-root.is-dragging .cw-header,
.cw-root.is-dragging .cw-toggle { cursor: grabbing; }

.cw-root.is-dragging,
.cw-root.is-dragging * {
    user-select: none;
    -webkit-user-select: none;
}

/* Buttons inside the drag handle keep their own cursor. */
.cw-header .cw-icon-btn { cursor: pointer; }

/* On small screens the window is fullscreen: no expand, no drag. */
@media (max-width: 480px) {
    .cw-root { transform: none !important; }
    .cw-root.is-expanded .cw-window {
        width: 100%;
        height: 100%;
    }
    #cw-expand { display: none; }
    .cw-header { cursor: default; }
}

/* ═══════════════════════════════════════════════════════════════════
   STREAMING CARET — blinking cursor while a reply is being typed
═══════════════════════════════════════════════════════════════════ */

.cw-bubble.is-streaming::after {
    content: '▍';
    display: inline-block;
    margin-left: 2px;
    color: var(--cw-primary);
    animation: cw-caret-blink 0.8s steps(1) infinite;
}

@keyframes cw-caret-blink {
    50% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   ACTION BUTTON — CTA rendered in-chat (e.g. "Book Demo")
═══════════════════════════════════════════════════════════════════ */

.cw-action-row {
    display: flex;
    justify-content: flex-start;
    padding-left: 4px;
    animation: cw-slide-up var(--cw-spring);
}

.cw-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--cw-radius-sm, 12px);
    background: linear-gradient(135deg, var(--cw-primary), var(--cw-primary-light));
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(25, 201, 107, 0.35);
    transition: transform var(--cw-transition), box-shadow var(--cw-transition), filter var(--cw-transition);
}

.cw-action-btn svg { width: 16px; height: 16px; }

.cw-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(25, 201, 107, 0.45);
    filter: brightness(1.05);
}

.cw-action-btn:active     { transform: translateY(0); }
.cw-action-btn:focus-visible { outline: 2px solid var(--cw-primary); outline-offset: 2px; }
