:root {
    --chat-bg: #0c1224;
    --chat-panel: #10162b;
    --chat-panel-alt: #161e3a;
    --chat-border: rgba(255,255,255,0.08);
    --chat-accent: #3b82f6;
    --chat-purple: #8b5cf6;
    --chat-cyan: #22d3ee;
    --chat-text: #f3f4f6;
    --chat-muted: #9ca3af;
}
#chat-launcher {
    position: fixed; right: 22px; bottom: 22px; z-index: 9999;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none; cursor: pointer; box-shadow: 0 10px 25px rgba(99,102,241,0.5);
    display: flex; align-items: center; justify-content: center; transition: transform .2s ease;
}
#chat-launcher:hover { transform: scale(1.06); }
#chat-launcher { overflow: hidden; padding: 0; border: 2px solid rgba(255,255,255,0.85); }
#chat-launcher img.mascot { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
#chat-launcher .badge {
    position: absolute; top: -2px; right: -2px; background: var(--chat-cyan); color: #04222a;
    font-size: 0.62rem; font-weight: 700; padding: 2px 6px; border-radius: 20px; border: 2px solid var(--chat-bg);
}
#chat-window {
    position: fixed; right: 22px; bottom: 94px; z-index: 9998;
    width: 370px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 120px);
    background: var(--chat-panel); border: 1px solid var(--chat-border); border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6); display: none; flex-direction: column; overflow: hidden;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
#chat-window.open { display: flex; }
.chat-header {
    background: linear-gradient(135deg, #1e2a6a 0%, #160b2e 100%);
    padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--chat-border);
}
.chat-avatar { width: 38px; height: 38px; border-radius: 10px; background: rgba(34,211,238,0.12); display:flex; align-items:center; justify-content:center; overflow: hidden; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.chat-header .title { color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1.1; }
.chat-header .sub { color: var(--chat-cyan); font-size: 0.72rem; }
.chat-close { margin-left: auto; background: transparent; border: none; color: #cbd5e1; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--chat-bg); }
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.msg { max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: 0.85rem; line-height: 1.45; }
.msg.bot { background: var(--chat-panel-alt); color: var(--chat-text); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg .ts { display: block; font-size: 0.6rem; color: var(--chat-muted); margin-top: 4px; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 8px; background: var(--chat-bg); }
.chip {
    background: rgba(139,92,246,0.14); border: 1px solid rgba(139,92,246,0.35); color: #c4b5fd;
    padding: 6px 11px; border-radius: 20px; font-size: 0.76rem; cursor: pointer; transition: all .15s ease;
}
.chip:hover { background: rgba(139,92,246,0.28); color: #fff; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--chat-border); background: var(--chat-panel); }
.chat-input-row input {
    flex: 1; background: var(--chat-bg); border: 1px solid var(--chat-border); color: var(--chat-text);
    border-radius: 10px; padding: 10px 12px; font-size: 0.85rem; outline: none; font-family: inherit;
}
.chat-input-row input:focus { border-color: var(--chat-accent); }
.chat-send {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6); border: none; color: #fff; border-radius: 10px;
    padding: 0 16px; font-weight: 600; cursor: pointer; font-size: 0.85rem;
}
.chat-send:hover { filter: brightness(1.08); }
.chat-footer { padding: 8px 14px 12px; border-top: 1px solid var(--chat-border); background: var(--chat-panel); }
.chat-wa {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    background: rgba(34,211,238,0.12); border: 1px solid rgba(34,211,238,0.4); color: var(--chat-cyan);
    padding: 9px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.chat-wa:hover { background: rgba(34,211,238,0.22); }
.chat-wa svg { width: 16px; height: 16px; fill: var(--chat-cyan); }
@media (max-width: 600px) {
    #chat-window { right: 12px; left: 12px; width: auto; bottom: 84px; }
    #chat-launcher { right: 14px; bottom: 14px; }
}
