/* XABCD Live Chat — AI assistant add-on. Uses the widget's variables, so the
   light and dark themes and the colour settings apply. */

#xabcd-lc-root .xlc-ai-welcome {
    margin: 4px 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#xabcd-lc-root .xlc-ai-disclosure {
    font-size: max(11px, calc(var(--xlc-fs-body) - 1px));
    color: var(--xlc-gray);
    background: var(--xlc-bg);
    border: 1px dashed var(--xlc-gray-light);
    border-radius: 10px;
    padding: 7px 10px;
    line-height: 1.4;
}
#xabcd-lc-root .xlc-ai-greeting {
    background: var(--xlc-bg);
    color: var(--xlc-dark);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: var(--xlc-fs-body);
    line-height: 1.45;
}

#xabcd-lc-root .xlc-ai-thinking {
    align-items: center;
    gap: 8px;
    padding: 4px 16px 8px;
    font-size: max(11px, calc(var(--xlc-fs-body) - 1px));
    color: var(--xlc-gray);
}

#xabcd-lc-root .xlc-ai-bar {
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 14px;
    font-size: max(11px, calc(var(--xlc-fs-body) - 1px));
    color: var(--xlc-gray);
    border-top: 1px solid var(--xlc-gray-light);
}
#xabcd-lc-root .xlc-ai-human {
    border: 1px solid var(--xlc-primary);
    background: transparent;
    color: var(--xlc-primary);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
#xabcd-lc-root .xlc-ai-human:disabled { opacity: 0.5; cursor: default; }

/* Links, listen button, suggestion chips under assistant messages */
#xabcd-lc-root .xlc-ai-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
#xabcd-lc-root .xlc-ai-link {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--xlc-primary);
    color: #fff;
    text-decoration: none;
    font-size: max(11px, calc(var(--xlc-fs-body) - 1px));
    font-weight: 600;
}
#xabcd-lc-root .xlc-ai-link:hover { background: var(--xlc-primary-dark); }
#xabcd-lc-root .xlc-ai-play {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    border: 0;
    background: transparent;
    color: var(--xlc-primary);
    font-size: max(11px, calc(var(--xlc-fs-body) - 1px));
    cursor: pointer;
    padding: 2px 0;
}
#xabcd-lc-root .xlc-ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
#xabcd-lc-root .xlc-ai-chip {
    border: 1px solid var(--xlc-primary-light);
    background: var(--xlc-white);
    color: var(--xlc-primary-dark);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: max(11px, calc(var(--xlc-fs-body) - 1px));
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
}
#xabcd-lc-root .xlc-ai-chip:hover { background: var(--xlc-bg); }

/* Email form */
#xabcd-lc-root .xlc-ai-card {
    position: relative;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--xlc-gray-light);
    border-radius: 12px;
    background: var(--xlc-white);
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 280px;
}
#xabcd-lc-root .xlc-ai-card-label { font-weight: 600; font-size: max(11px, calc(var(--xlc-fs-body) - 1px)); color: var(--xlc-dark); }
#xabcd-lc-root .xlc-ai-email,
#xabcd-lc-root .xlc-ai-note {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--xlc-gray-light);
    border-radius: 8px;
    font-size: 16px; /* no zoom on iOS */
    background: var(--xlc-white);
    color: var(--xlc-dark);
}
#xabcd-lc-root .xlc-ai-note { resize: vertical; min-height: 64px; font-family: inherit; line-height: 1.4; }
#xabcd-lc-root .xlc-ai-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#xabcd-lc-root .xlc-ai-optin { display: flex; gap: 6px; align-items: flex-start; font-size: max(10px, calc(var(--xlc-fs-body) - 2px)); color: var(--xlc-gray); }
#xabcd-lc-root .xlc-ai-consent { font-size: max(10px, calc(var(--xlc-fs-body) - 2px)); color: var(--xlc-gray); line-height: 1.35; }
#xabcd-lc-root .xlc-ai-consent a { color: var(--xlc-primary); }
#xabcd-lc-root .xlc-ai-card-actions { display: flex; gap: 6px; }
#xabcd-lc-root .xlc-ai-card-send {
    border: 0;
    background: var(--xlc-primary);
    color: #fff;
    border-radius: 8px;
    padding: 7px 14px;
    font-weight: 600;
    cursor: pointer;
}
#xabcd-lc-root .xlc-ai-card-send:disabled { opacity: 0.6; }
#xabcd-lc-root .xlc-ai-card-skip { border: 0; background: transparent; color: var(--xlc-gray); cursor: pointer; }
#xabcd-lc-root .xlc-ai-card-msg { font-size: max(10px, calc(var(--xlc-fs-body) - 2px)); color: #c62828; }
#xabcd-lc-root .xlc-ai-card-msg button { border: 0; background: transparent; color: var(--xlc-primary); text-decoration: underline; cursor: pointer; padding: 0; }
#xabcd-lc-root .xlc-ai-card-done { color: var(--xlc-success); font-weight: 600; }

/* Push-to-talk */
#xabcd-lc-root .xlc-ai-mic {
    /* Above the recording bar, so a second tap stops the recording. */
    position: relative;
    z-index: 3;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}
#xabcd-lc-root .xlc-ai-mic.is-recording { color: #e5484d; }
#xabcd-lc-root .xlc-ai-rec {
    position: absolute;
    inset: 0;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: inherit;
    background: var(--xlc-white);
    color: var(--xlc-dark);
    font-size: var(--xlc-fs-input);
    z-index: 2;
}
#xabcd-lc-root .xlc-input-wrap { position: relative; }
#xabcd-lc-root .xlc-ai-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e5484d;
    animation: xlc-ai-pulse 1s ease-in-out infinite;
}
#xabcd-lc-root .xlc-ai-rec-text { flex: 1; }
#xabcd-lc-root .xlc-ai-rec-cancel { border: 0; background: transparent; color: var(--xlc-gray); cursor: pointer; }
@keyframes xlc-ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (prefers-reduced-motion: reduce) {
    #xabcd-lc-root .xlc-ai-rec-dot { animation: none; }
}

/* "Start an AI chat": a slim grey button (half the height of "Start a
   conversation", which stays a chat with people), shown open or closed. */
#xabcd-lc-root #xlc-btn-new-chat + .xlc-start-ai-btn { margin-top: -12px !important; }
#xabcd-lc-root .xlc-start-ai-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    margin: 0 0 20px !important;
    padding: 8px 16px !important;
    border: 1px solid #e3e3e8;
    border-radius: 12px;
    background: #f1f1f4;
    color: #3f3f4a;
    font-family: var(--xlc-font);
    font-size: calc(14px * var(--xlc-fs-scale, 1));
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
#xabcd-lc-root .xlc-start-ai-btn:hover { background: #e7e7ec; border-color: #d4d4dc; transform: translateY(-1px); }
#xabcd-lc-root .xlc-start-ai-btn:focus-visible { outline: 3px solid var(--xlc-primary); outline-offset: 2px; }
#xabcd-lc-root .xlc-start-ai-btn * { padding: 0; }
#xabcd-lc-root .xlc-start-ai-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--xlc-primary); }
#xabcd-lc-root.xlc-dark .xlc-start-ai-btn { background: #23233a; border-color: #2f2f48; color: #d4d4dc; }
#xabcd-lc-root.xlc-dark .xlc-start-ai-btn:hover { background: #2b2b45; border-color: #3a3a58; }

/* In an assistant chat the header shows its name only: no team status pill,
   no "Offline - back …" strip. */
#xabcd-lc-root.xlc-ai-live #xlc-header-status,
#xabcd-lc-root.xlc-ai-live .xlc-status-banner { display: none !important; }
