/* CQ AI Support — front-end widget.
   Scoped under .cqai- prefixes and uses its own font stack fallbacks so it renders the same
   whether or not the page's Tailwind build is present. Sits bottom-right; the site's WhatsApp
   button is pinned right-centre, so the two do not collide. */

.cqai-root {
    --cqai-primary: #0a1f44;
    --cqai-accent: #16a34a;
    --cqai-surface: #f8fafc;
    --cqai-border: #e2e8f0;
    --cqai-text: #0f172a;
    --cqai-muted: #64748b;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* --- avatar --- */

.cqai-avatar {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.cqai-avatar-mono {
    display: grid;
    place-items: center;
    background: var(--cqai-accent);
    color: #fff;
}

.cqai-avatar-mono svg { width: 17px; height: 17px; }

.cqai-header .cqai-avatar {
    width: 36px;
    height: 36px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.cqai-launcher .cqai-avatar { width: 28px; height: 28px; }

.cqai-row-bot .cqai-avatar { width: 26px; height: 26px; margin-top: 2px; }
.cqai-row-bot .cqai-avatar-mono svg { width: 15px; height: 15px; }

/* --- launcher --- */

.cqai-launcher {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 22px 0 13px;
    border: 0;
    border-radius: 999px;
    background: var(--cqai-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(10, 31, 68, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cqai-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(10, 31, 68, 0.34);
}

.cqai-root[data-open="true"] .cqai-launcher { display: none; }

/* --- panel --- */

.cqai-panel {
    display: none;
    flex-direction: column;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border: 1px solid var(--cqai-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.cqai-root[data-open="true"] .cqai-panel {
    display: flex;
    animation: cqai-rise 0.2s ease-out;
}

@keyframes cqai-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cqai-header {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 16px 16px 15px;
    background: var(--cqai-primary);
    color: #fff;
}

.cqai-header-text { flex: 1; min-width: 0; }

.cqai-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cqai-subtitle {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.cqai-close {
    flex: none;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.cqai-close:hover { background: rgba(255, 255, 255, 0.22); }

/* --- messages --- */

.cqai-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--cqai-surface);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cqai-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
}

.cqai-row-user { justify-content: flex-end; }

.cqai-msg {
    max-width: 84%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.6;
}

.cqai-msg-body { white-space: pre-wrap; word-wrap: break-word; }

.cqai-msg-bot {
    background: #fff;
    border: 1px solid var(--cqai-border);
    color: var(--cqai-text);
    border-top-left-radius: 4px;
}

.cqai-msg-user {
    background: var(--cqai-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.cqai-msg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.cqai-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--cqai-border);
}

.cqai-source {
    font-size: 11px;
    font-weight: 600;
    color: var(--cqai-accent);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid rgba(22, 163, 74, 0.28);
    border-radius: 999px;
}

.cqai-source:hover { background: rgba(22, 163, 74, 0.08); }

/* --- suggested prompts --- */

.cqai-prompts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding-left: 34px;
}

.cqai-prompt {
    max-width: 100%;
    padding: 8px 13px;
    border: 1px solid rgba(22, 163, 74, 0.35);
    border-radius: 999px;
    background: #fff;
    color: var(--cqai-primary);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cqai-prompt:hover {
    background: rgba(22, 163, 74, 0.07);
    border-color: var(--cqai-accent);
}

/* typing indicator */

.cqai-typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.cqai-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--cqai-muted);
    animation: cqai-bounce 1.2s infinite ease-in-out;
}
.cqai-typing span:nth-child(2) { animation-delay: 0.15s; }
.cqai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes cqai-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* --- composer --- */

.cqai-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--cqai-border);
}

.cqai-input {
    flex: 1;
    resize: none;
    max-height: 96px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: inherit;
    line-height: 1.5;
    color: var(--cqai-text);
    border: 1px solid var(--cqai-border);
    border-radius: 10px;
    background: #fff;
}

.cqai-input:focus {
    outline: none;
    border-color: var(--cqai-primary);
    box-shadow: 0 0 0 3px rgba(10, 31, 68, 0.1);
}

.cqai-send {
    flex: none;
    width: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: var(--cqai-accent);
    color: #fff;
    cursor: pointer;
}

.cqai-send:hover { background: #15803d; }
.cqai-send:disabled { opacity: 0.5; cursor: default; }
.cqai-send svg { width: 18px; height: 18px; }

.cqai-note {
    padding: 0 12px 10px;
    margin: 0;
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--cqai-muted);
    background: #fff;
    text-align: center;
}

@media (max-width: 480px) {
    .cqai-root { right: 16px; bottom: 16px; }
    .cqai-panel { width: calc(100vw - 32px); height: min(580px, calc(100vh - 100px)); }
    .cqai-launcher span { display: none; }
    .cqai-launcher { padding: 0 13px; }
}

/* --- intake card (name + email before the first message) --- */

.cqai-intake {
    display: grid;
    gap: 10px;
    margin: 4px 0 0 40px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--cqai-border);
    border-radius: 14px;
}

.cqai-intake-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--cqai-text);
}

.cqai-intake-label {
    display: grid;
    gap: 5px;
    font-size: 12.5px;
    color: var(--cqai-text);
}

.cqai-intake-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--cqai-text);
    border: 1px solid var(--cqai-border);
    border-radius: 10px;
    background: #fff;
}

.cqai-intake-input:focus {
    outline: none;
    border-color: var(--cqai-primary);
}

.cqai-intake-error {
    margin: 0;
    font-size: 12.5px;
    color: #b4453a;
}

.cqai-intake-go {
    margin-top: 2px;
    padding: 11px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--cqai-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.cqai-intake-go:hover {
    opacity: 0.9;
}

/* Craftell Home approved black chat interface — 2026-10-20. */
.cqai-root{--cqai-primary:#080808;--cqai-accent:#fff;--cqai-surface:#151515;--cqai-border:#393939;--cqai-text:#f5f5f5;--cqai-muted:#b5b5b5;color:#fff;color-scheme:dark;font-family:Arial,Helvetica,sans-serif}
.cqai-root *{box-sizing:border-box}
.cqai-root button,.cqai-root input,.cqai-root textarea{font-family:inherit}
.cqai-root button:focus-visible,.cqai-root a:focus-visible,.cqai-root input:focus-visible,.cqai-root textarea:focus-visible{outline:2px solid #fff;outline-offset:3px}
.cqai-root .cqai-avatar{background:#000;object-fit:contain}
.cqai-root .cqai-launcher{background:#080808;color:#fff;box-shadow:0 10px 30px #0003;padding-left:9px}
.cqai-root .cqai-launcher .cqai-avatar{width:38px;height:38px}
.cqai-root .cqai-panel{width:400px;height:650px;max-width:calc(100vw - 32px);max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);background:linear-gradient(155deg,#030303,#171717 45%,#101010 75%);border:0;border-radius:26px;box-shadow:0 18px 55px #0005;isolation:isolate}
.cqai-root .cqai-header{background:transparent;align-items:center;padding:21px 22px 14px;flex:none}
.cqai-root .cqai-header .cqai-avatar{width:42px;height:42px;box-shadow:none}
.cqai-root .cqai-title{color:#fff;font-size:15px;line-height:1.3}
.cqai-root .cqai-subtitle{font-size:11px;color:#b8b8b8}
.cqai-root .cqai-close{width:40px;height:40px;background:transparent;color:#fff;font-size:28px;line-height:1}
.cqai-root .cqai-close:hover{background:#292929}
.cqai-root .cqai-home{padding:20px 20px 24px;flex:1;overflow:auto;min-height:0}
.cqai-root .cqai-home-symbol{margin:0 8px 21px}
.cqai-root .cqai-home-symbol .cqai-avatar{width:54px;height:54px}
.cqai-root .cqai-welcome{font:700 52px/1.17 Arial,Helvetica,sans-serif;color:#fff;letter-spacing:-1.8px;margin:0 8px 27px;text-align:left}
.cqai-root .cqai-home-card{border-radius:22px;background:#252525;padding:22px 18px 18px}
.cqai-root .cqai-home-profile{display:flex;align-items:center;gap:13px;margin:0 4px 20px}
.cqai-root .cqai-home-profile .cqai-avatar{width:46px;height:46px}
.cqai-root .cqai-home-copy{min-width:0}
.cqai-root .cqai-home-name{margin:0 0 6px;color:#b7b7b7;font-size:13px;line-height:1.3}
.cqai-root .cqai-home-greeting{margin:0;font-size:16px;line-height:1.4;color:#fff}
.cqai-root .cqai-home-start{width:100%;min-height:52px;border:0;border-radius:16px;padding:15px 10px;background:#000;color:#fff;display:flex;align-items:center;justify-content:center;gap:9px;font-size:15px;font-weight:600;cursor:pointer}
.cqai-root .cqai-home-start:hover{background:#0b0b0b}
.cqai-root .cqai-home-start svg{width:21px;height:21px;flex:none}
.cqai-root .cqai-nav{display:flex;flex:none;margin:18px 22px 0;padding:11px;border:1px solid #363636;border-radius:27px;background:#222}
.cqai-root .cqai-nav button{flex:1;padding:4px;border:0;background:transparent;color:#aaa;display:flex;flex-direction:column;align-items:center;gap:6px;min-height:52px;font-size:14px;cursor:pointer}
.cqai-root .cqai-nav button[aria-pressed=true]{color:#fff}
.cqai-root .cqai-nav svg{width:24px;height:24px}
.cqai-root .cqai-credit{margin:14px 12px 16px;text-align:center;font-size:9px;letter-spacing:1.5px;color:#aaa;line-height:1.4;flex:none}
.cqai-root[data-view=home] .cqai-log,.cqai-root[data-view=home] .cqai-form,.cqai-root[data-view=home] .cqai-note{display:none}
.cqai-root[data-view=home] .cqai-header>.cqai-avatar{display:none}
.cqai-root[data-view=home] .cqai-title{font:16px Georgia,serif;letter-spacing:2px;font-weight:400}
.cqai-root[data-view=home] .cqai-subtitle{display:none}
.cqai-root[data-view=chat] .cqai-home{display:none}
.cqai-root .cqai-log{min-height:0;background:transparent;padding:12px 22px;gap:14px;scrollbar-width:thin;scrollbar-color:#555 #151515}
.cqai-root .cqai-msg{font-size:14px;line-height:1.6;border-radius:16px;overflow-wrap:anywhere}
.cqai-root .cqai-msg-bot{background:#292929;border:0;color:#fff;border-top-left-radius:4px}
.cqai-root .cqai-msg-user{background:#e9e9e9;color:#111;border-bottom-right-radius:4px}
.cqai-root .cqai-msg-error{background:#362627;border:1px solid #7e5053;color:#ffd8da}
.cqai-root .cqai-source{color:#eee;border-color:#666;font-size:11px}
.cqai-root .cqai-source:hover{background:#444}
.cqai-root .cqai-prompts{padding-left:0;gap:8px}
.cqai-root .cqai-prompt{background:#222;color:#eee;border-color:#555;padding:10px 13px;min-height:40px}
.cqai-root .cqai-prompt:hover{background:#333;border-color:#999}
.cqai-root .cqai-form{margin:10px 22px 0;padding:8px;background:#222;border:1px solid #444;border-radius:20px;flex:none;align-items:flex-end}
.cqai-root .cqai-input{min-width:0;width:0;background:transparent;color:#fff;border:0;border-radius:12px;padding:9px 7px;font-size:16px;line-height:1.5}
.cqai-root .cqai-input::placeholder{color:#aaa}
.cqai-root .cqai-input:focus{box-shadow:none}
.cqai-root .cqai-send{width:40px;height:42px;border-radius:50%;background:#eee;color:#111}
.cqai-root .cqai-send:hover{background:#fff}
.cqai-root .cqai-note{background:transparent;color:#aaa;font-size:10.5px;padding:8px 22px 0}
.cqai-root .cqai-intake{margin:0;background:#242424;border-color:#444;padding:16px;border-radius:17px}
.cqai-root .cqai-intake-text,.cqai-root .cqai-intake-label{color:#eee}
.cqai-root .cqai-intake-input{background:#161616;color:#fff;border-color:#555;font-size:16px}
.cqai-root .cqai-intake-go{background:#000;color:#fff;min-height:44px;border-radius:13px}
.cqai-root .cqai-intake-error{color:#ffb5ba}
@media(max-width:480px){.cqai-root{right:12px;bottom:12px}.cqai-root .cqai-panel{width:calc(100vw - 24px);max-width:calc(100vw - 24px);height:650px;max-height:calc(100dvh - 24px);border-radius:24px}.cqai-root .cqai-launcher{padding:0 8px}.cqai-root .cqai-home{padding:14px 16px 20px}.cqai-root .cqai-welcome{font-size:46px}.cqai-root .cqai-header{padding-top:16px}.cqai-root .cqai-nav{margin-top:12px}}
@media(max-width:350px){.cqai-root .cqai-welcome{font-size:40px}.cqai-root .cqai-home-greeting{font-size:14px}.cqai-root .cqai-home-card{padding:18px 14px}.cqai-root .cqai-home-profile{gap:10px}}
@media(prefers-reduced-motion:reduce){.cqai-root .cqai-panel,.cqai-root .cqai-launcher,.cqai-root .cqai-typing span{animation:none;transition:none}}

/* Requested WhatsApp placement and brand green — 2026-10-20 */
body > a.ft-wa{color:#25D366!important}
/* Position is set by the widget script (left of the chat launcher); this is only the fallback before it runs. */
body > a.ft-wa{left:auto!important;right:290px!important;bottom:26px!important}
@media(max-width:600px){body > a.ft-wa{right:76px!important;bottom:14px!important}}

/* --- WhatsApp hand-off card (shown when the chat is passed to the team) --- */
.cqai-root .cqai-wa-card{margin:6px 0 4px 40px;padding:14px 16px;border-radius:14px;background:#f2fbf5;border:1px solid #cdeed8;display:grid;gap:10px}
.cqai-root .cqai-wa-text{margin:0;font-size:13.5px;line-height:1.5;color:#1c1a17}
.cqai-root .cqai-wa-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:10px 16px;border-radius:10px;background:#25D366;color:#fff!important;font-size:14px;font-weight:600;text-decoration:none}
.cqai-root .cqai-wa-btn:hover{background:#1ebe5a}
.cqai-root .cqai-wa-btn svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.cqai-root .cqai-intake-msg{resize:vertical;min-height:72px;line-height:1.5}
