/* Vortex Precision — AI chat widget (public site). */
.vp-chat {
    --vp-chat-brand: #1659e6;
    --vp-chat-brand-dark: #0f44b8;
    --vp-chat-ink: #0b1424;
    --vp-chat-muted: #5b6472;
    --vp-chat-bubble-user: #1659e6;
    --vp-chat-bubble-bot: #f1f4f9;
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1000;
    font-family: Inter, system-ui, sans-serif;
}

/* Launcher button */
.vp-chat__launcher {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 9999px;
    background: var(--vp-chat-brand);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(11, 20, 36, .28);
    transition: background .18s ease, transform .18s ease;
}
.vp-chat__launcher:hover { background: var(--vp-chat-brand-dark); transform: translateY(-2px); }
.vp-chat__launcher-avatar {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
}
.vp-chat__launcher-icon { position: absolute; }
.vp-chat__launcher--close { display: none; }
.vp-chat.is-open .vp-chat__launcher-avatar { display: none; }
.vp-chat.is-open .vp-chat__launcher--close { display: block; }

/* Panel */
.vp-chat__panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 360px;
    max-width: calc(100vw - 2rem);
    height: 560px;
    max-height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(11, 20, 36, .22);
    overflow: hidden;
}
.vp-chat__panel[hidden] { display: none; }

.vp-chat__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    background: var(--vp-chat-ink);
    color: #fff;
}
.vp-chat__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    background: var(--vp-chat-brand);
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}
.vp-chat__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
}
.vp-chat__meta { flex: 1; min-width: 0; }
.vp-chat__title { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.vp-chat__status { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: #c9d3e0; }
.vp-chat__dot { width: 8px; height: 8px; border-radius: 9999px; background: #34d399; }
.vp-chat__minimize {
    border: none; background: transparent; color: #fff; font-size: 18px;
    cursor: pointer; padding: .25rem; border-radius: .4rem;
}
.vp-chat__minimize:hover { background: rgba(255,255,255,.12); }

/* Messages */
.vp-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    background: #fafbfd;
}
.vp-chat__msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    font-size: .9rem;
    line-height: 1.45;
    color: var(--vp-chat-ink);
    animation: vp-chat-in .22s ease;
}
.vp-chat__msg--bot { align-self: flex-start; }
.vp-chat__msg--user { align-self: flex-end; }
.vp-chat__bubble {
    padding: .65rem .85rem;
    border-radius: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}
.vp-chat__msg--bot .vp-chat__bubble {
    background: var(--vp-chat-bubble-bot);
    border-bottom-left-radius: 4px;
}
.vp-chat__msg--user .vp-chat__bubble {
    background: var(--vp-chat-bubble-user);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.vp-chat__bubble a { color: var(--vp-chat-brand); text-decoration: underline; }
.vp-chat__msg--user .vp-chat__bubble a { color: #fff; }
.vp-chat__typing { display: inline-flex; gap: 4px; padding: .75rem .9rem; }
.vp-chat__typing span {
    width: 7px; height: 7px; border-radius: 9999px; background: #94a3b8;
    animation: vp-chat-blink 1.2s infinite ease-in-out;
}
.vp-chat__typing span:nth-child(2) { animation-delay: .15s; }
.vp-chat__typing span:nth-child(3) { animation-delay: .3s; }

@keyframes vp-chat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes vp-chat-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Quick replies */
.vp-chat__quick {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .5rem 1rem;
    border-top: 1px solid #eef1f6;
    background: #fff;
}
.vp-chat__chip {
    border: 1px solid #dbe2ec;
    background: #fff;
    color: var(--vp-chat-ink);
    font-size: .78rem;
    padding: .4rem .7rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.vp-chat__chip:hover { background: #eef4ff; border-color: var(--vp-chat-brand); color: var(--vp-chat-brand); }

/* Input */
.vp-chat__form {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    padding: .7rem 1rem;
    border-top: 1px solid #eef1f6;
    background: #fff;
}
.vp-chat__input {
    flex: 1;
    resize: none;
    border: 1px solid #dbe2ec;
    border-radius: 12px;
    padding: .6rem .8rem;
    font-size: .9rem;
    line-height: 1.4;
    max-height: 120px;
    outline: none;
    font-family: inherit;
}
.vp-chat__input:focus { border-color: var(--vp-chat-brand); box-shadow: 0 0 0 3px rgba(22, 89, 230, .12); }
.vp-chat__send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--vp-chat-brand);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease;
}
.vp-chat__send:hover { background: var(--vp-chat-brand-dark); }
.vp-chat__send:disabled { opacity: .6; cursor: default; }

@media (max-width: 640px) {
    .vp-chat { right: .75rem; bottom: .75rem; }
    .vp-chat__panel { width: calc(100vw - 1.5rem); height: 70vh; }
}
