.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: 95%;
    height: 85vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
    z-index: 999999;

    display: flex;
    flex-direction: column;

    opacity: 0;
    transform: translateY(30px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s ease;
}

/* OPEN STATE */
.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.chat-header{padding:14px 16px;display:flex;align-items:center;gap:10px;background:#0BB7AF;flex-shrink:0;}
.header-avatar{width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,0.2);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.header-avatar svg{width:22px;height:22px;}
.header-text{flex:1;}
.header-text p{font-size:14px;font-weight:600;color:#fff;line-height:1.3;}
.header-text span{font-size:11px;color:rgba(255,255,255,0.75);}
.header-actions{display:flex;gap:6px;}
.h-btn{width:28px;height:28px;border-radius:8px;background:rgba(255,255,255,0.15);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s;}
.h-btn:hover{background:rgba(255,255,255,0.25);}
.h-btn svg{width:13px;height:13px;}
.agent-bar{background:#fff;padding:7px 16px;display:flex;align-items:center;gap:7px;border-bottom:1px solid #eef0f3;flex-shrink:0;}
.agent-dot{width:7px;height:7px;border-radius:50%;background:#22c55e;flex-shrink:0;box-shadow:0 0 0 2px rgba(34,197,94,0.2);}
.agent-bar span{font-size:11.5px;color:#6b7280;font-weight:500;}
.messages{padding:16px 14px;display:flex;flex-direction:column;gap:14px;flex:1;overflow-y:auto;background:#f7f8fa;height:75vh;}
.messages::-webkit-scrollbar{width:4px;}
.messages::-webkit-scrollbar-track{background:transparent;}
.messages::-webkit-scrollbar-thumb{background:#dde0e7;border-radius:4px;}
.msg-row{display:flex;gap:8px;align-items:flex-end;}
.msg-row.user{flex-direction:row-reverse;}
.msg-avatar-sm{width:30px;height:30px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:12px;font-weight:600;color:#fff;background:#0BB7AF;margin-right:7px;}
.msg-row.bot .msg-avatar-sm{background:#0BB7AF;}
.msg-content{display:flex;flex-direction:column;gap:3px;max-width:75%;}
.msg-row.user .msg-content{align-items:flex-end;}
.msg-bubble{padding:10px 14px;border-radius:18px;font-size:13px;line-height:1.55;}
.msg-row.bot .msg-bubble{background:#fff;color:#1f2937;border-bottom-left-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,0.06);}
.msg-row.user .msg-bubble{background:#0BB7AF;color:#fff;border-bottom-right-radius:4px;}
.msg-time{font-size:10px;color:#c4c8d0;padding:0 4px;}
.pdf-btn{display:inline-flex;align-items:center;gap:5px;margin-top:7px;padding:5px 10px;background:#f0fdf9;border-radius:8px;color:#0BB7AF;font-size:12px;text-decoration:none;border:1px solid rgba(11,183,175,0.2);}
.pdf-btn:hover{background:#e0faf7;}
.csv-btn{display:inline-flex;align-items:center;gap:5px;margin-top:7px;padding:5px 10px;background:#f0fdf9;border-radius:8px;color:#0BB7AF;font-size:12px;border:1px solid rgba(11,183,175,0.2);cursor:pointer;font-family:inherit;}
.csv-btn:hover{background:#e0faf7;}
.typing-row{display:flex;}
.typing-bubble{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;background:#fff;border-radius:18px;border-bottom-left-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,0.06);overflow:hidden;height:27px;}
.typing-bubble span{width:6px;height:6px;border-radius:50%;background:#0BB7AF;animation:smoothBounce 1.4s infinite ease-in-out;transform-origin:center;}
.typing-bubble span:nth-child(2){animation-delay:.2s;}
.typing-bubble span:nth-child(3){animation-delay:.4s;}
@keyframes smoothBounce{0%,80%,100%{transform:translateY(0) scale(.9);opacity:.5;}40%{transform:translateY(-4px) scale(1);opacity:1;}}
.chat-footer{background:#fff;border-top:1px solid #eef0f3;flex-shrink:0;padding:10px 12px 10px;}
.input-row{display:flex;align-items:center;gap:8px;background:#f7f8fa;border-radius:12px;padding:4px 4px 4px 12px;border:1px solid #eef0f3;}
.input-row input{flex:1;height:34px;border:none;font-size:13px;background:transparent;color:#111;outline:none;}
.input-row input::placeholder{color:#b0b7c3;}
.send-btn{width:34px;height:34px;border-radius:9px;background:#0BB7AF;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s;}
.send-btn:hover{background:#099e97;}
.send-btn:disabled{opacity:0.45;cursor:not-allowed;}
.send-btn svg{width:14px;height:14px;}
.footer-meta{display:flex;align-items:center;gap:4px;padding:8px 2px 0;}
.footer-meta button{background:none;border:none;cursor:pointer;padding:4px;color:#b0b7c3;display:flex;align-items:center;border-radius:6px;transition:color .15s;}
.footer-meta button:hover{color:#6b7280;}
.footer-meta svg{width:16px;height:16px;}
.fab{width:52px;height:52px;border-radius:16px;background:#0BB7AF;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;position:fixed;bottom:10px;right:24px;transition:transform .15s,background .15s;box-shadow:0 4px 18px rgba(11,183,175,0.45);z-index:999999;}
.fab:hover{background:#099e97;transform:scale(1.06);}
.fab:active{transform:scale(0.96);}
.fab svg{width:24px;height:24px;}
