/* ============================================================
   Vee: the AI live chat widget (replaces the tawk.to bubble).
   Brand variables come from style.css :root; this file loads after it.
   ============================================================ */

.vee-launcher {
    position: fixed; right: 20px; bottom: 20px; z-index: 9000;
    width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
}
.vee-launcher:hover { transform: translateY(-2px) scale(1.04); }
.vee-launcher svg { width: 26px; height: 26px; }
.vee-launcher .vee-close-ic { display: none; }
.vee-launcher[aria-expanded="true"] .vee-chat-ic { display: none; }
.vee-launcher[aria-expanded="true"] .vee-close-ic { display: block; }
.vee-dot {
    position: absolute; top: -3px; right: -3px; width: 15px; height: 15px; border-radius: 50%;
    background: var(--u-pink); border: 2px solid #fff; display: none;
}
.vee-launcher[data-unread="1"] .vee-dot { display: block; }

/* Hidden by default: the widget's own JS removes this once chat.js has booted
   the panel, so a slow network never leaves a half-built widget on screen. */
.vee-root[hidden] { display: none !important; }

.vee-teaser {
    position: fixed; right: 20px; bottom: 90px; z-index: 8999;
    max-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 4px 16px;
    box-shadow: var(--shadow-lg); padding: 13px 16px; font: 500 .88rem/1.4 var(--font); color: var(--ink);
    opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.vee-teaser.on { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; cursor: pointer; }
.vee-teaser button.vee-teaser-x {
    position: absolute; top: 4px; right: 6px; border: none; background: none; color: var(--muted);
    font-size: .95rem; cursor: pointer; line-height: 1; padding: 4px;
}

.vee-panel {
    position: fixed; right: 20px; bottom: 90px; z-index: 9001;
    width: 376px; max-width: calc(100vw - 32px);
    height: min(640px, calc(100vh - 118px));
    background: #fff; border-radius: 18px; box-shadow: 0 30px 70px rgba(23, 24, 28, .32);
    display: flex; flex-direction: column; overflow: hidden;
    opacity: 0; transform: translateY(16px) scale(.97); pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    font-family: var(--font);
}
.vee-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.vee-head {
    display: flex; align-items: center; gap: 11px; padding: 15px 16px;
    background: var(--grad-brand); color: #fff; flex: none;
}
.vee-avatar {
    width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .22);
    display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
}
.vee-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.vee-head-text { flex: 1; min-width: 0; }
.vee-head-name { font-weight: 800; font-size: .98rem; display: flex; align-items: center; gap: 7px; }
.vee-head-tag {
    display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 2px 8px;
}
.vee-head-sub { font-size: .76rem; opacity: .85; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.vee-online-dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; flex: none; }
.vee-head-close {
    border: none; background: rgba(255, 255, 255, .18); color: #fff; border-radius: 50%;
    width: 30px; height: 30px; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; transition: background .15s ease;
}
.vee-head-close:hover { background: rgba(255, 255, 255, .3); }

.vee-body {
    flex: 1; overflow-y: auto; padding: 16px 14px; background: var(--bg-tint);
    display: flex; flex-direction: column; gap: 10px;
}
.vee-row { display: flex; gap: 8px; max-width: 92%; }
.vee-row.vee-visitor { align-self: flex-end; flex-direction: row-reverse; }
.vee-row.vee-vee, .vee-row.vee-system { align-self: flex-start; }
.vee-bubble-avatar {
    width: 24px; height: 24px; border-radius: 50%; flex: none; overflow: hidden;
    /* A flat, dark backdrop, not the busy multi-hue gradient: at 24px the
       logo's own light-on-dark strokes need one plain colour behind them to
       stay readable, not another gradient in the same hue family. */
    background: var(--ink); display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.vee-bubble-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.vee-bubble {
    padding: 10px 13px; border-radius: 14px; font-size: .89rem; line-height: 1.48; white-space: pre-wrap; word-break: break-word;
    box-shadow: 0 1px 3px rgba(29, 25, 54, .06);
}
.vee-visitor .vee-bubble { background: var(--brand-dark); color: #fff; border-radius: 14px 14px 3px 14px; }
.vee-vee .vee-bubble { background: #fff; color: var(--ink); border-radius: 14px 14px 14px 3px; }
.vee-system .vee-bubble { background: transparent; color: var(--muted); font-size: .78rem; text-align: center; box-shadow: none; padding: 2px 4px; }
.vee-bubble a { color: inherit; text-decoration: underline; font-weight: 700; }
.vee-visitor .vee-bubble a { color: #fff; }

.vee-typing { align-self: flex-start; display: flex; gap: 8px; padding-left: 2px; }
.vee-typing .vee-bubble { display: flex; align-items: center; gap: 4px; padding: 11px 14px; }
.vee-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; animation: veeTyping 1.1s ease-in-out infinite; }
.vee-typing span:nth-child(2) { animation-delay: .15s; }
.vee-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes veeTyping { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-3px); } }

.vee-foot { flex: none; border-top: 1px solid var(--line); background: #fff; }
.vee-quick { display: flex; gap: 6px; padding: 9px 12px 0; overflow-x: auto; }
.vee-quick button {
    flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
    border-radius: 999px; padding: 6px 12px; font-size: .78rem; font-weight: 600; cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.vee-quick button:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.vee-input-row { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; }
.vee-input {
    flex: 1; border: 1px solid var(--line); border-radius: 14px; padding: 10px 13px;
    font: 400 .88rem/1.4 var(--font); color: var(--ink); resize: none; max-height: 92px; overflow-y: auto;
}
.vee-input:focus { outline: none; border-color: var(--brand); }
.vee-send {
    flex: none; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--grad-brand); color: #fff; display: flex; align-items: center; justify-content: center;
    transition: opacity .15s ease, transform .1s ease;
}
.vee-send:disabled { opacity: .45; cursor: default; }
.vee-send:not(:disabled):active { transform: scale(.92); }
.vee-send svg { width: 17px; height: 17px; }
.vee-foot-note {
    text-align: center; font-size: .66rem; color: var(--muted); padding: 0 14px 10px; line-height: 1.4;
}
.vee-foot-note a { color: inherit; text-decoration: underline; }

.vee-honey { position: absolute !important; left: -9999px !important; top: -9999px !important; opacity: 0 !important; height: 0 !important; width: 0 !important; }

@media (max-width: 480px) {
    .vee-panel {
        right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%;
        height: 100%; border-radius: 0;
    }
    .vee-launcher { right: 14px; bottom: 76px; }
    .vee-teaser { right: 12px; left: 12px; max-width: none; bottom: 150px; }
}

@media (prefers-color-scheme: dark) {
    /* The site itself has no dark theme, so the widget stays light for
       contrast with the page around it; only honour a real OS-level
       high-contrast override, which @media doesn't separately expose here. */
}
