#ta-chat{position:fixed;bottom:20px;z-index:9999;font-family:inherit}
#ta-chat.ta-left{left:20px}
#ta-chat.ta-right{right:20px}
#ta-chat-toggle{width:60px;height:60px;border-radius:50%;border:0;cursor:pointer;background:var(--primary,#bc6c25);color:#fff;box-shadow:0 8px 24px rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;transition:transform .15s}
#ta-chat-toggle:hover{transform:scale(1.06)}

/* tooltip next to the button */
#ta-chat-tip{position:absolute;bottom:8px;width:max-content;max-width:250px;background:#fff;color:#222;border-radius:14px;padding:12px 30px 12px 14px;font-size:14px;line-height:1.4;box-shadow:0 10px 30px rgba(0,0,0,.22);cursor:pointer;animation:taTipIn .35s ease-out}
#ta-chat-tip[hidden]{display:none}
#ta-chat.ta-left #ta-chat-tip{left:74px}
#ta-chat.ta-right #ta-chat-tip{right:74px}
#ta-chat-tip::before{content:"";position:absolute;bottom:18px;width:12px;height:12px;background:#fff;transform:rotate(45deg)}
#ta-chat.ta-left #ta-chat-tip::before{left:-5px}
#ta-chat.ta-right #ta-chat-tip::before{right:-5px}
#ta-chat-tip strong::before{content:"";display:inline-block;width:9px;height:9px;border-radius:50%;background:#3ddc84;margin-right:6px;box-shadow:0 0 0 0 rgba(61,220,132,.6);animation:taPulse 1.8s infinite}
#ta-chat-tip-x{position:absolute;top:4px;right:6px;background:none;border:0;font-size:18px;line-height:1;color:#888;cursor:pointer}
#ta-chat.ta-open #ta-chat-tip{display:none}
@keyframes taTipIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes taPulse{0%{box-shadow:0 0 0 0 rgba(61,220,132,.6)}70%{box-shadow:0 0 0 7px rgba(61,220,132,0)}100%{box-shadow:0 0 0 0 rgba(61,220,132,0)}}

#ta-chat-panel{position:absolute;bottom:74px;width:380px;max-width:calc(100vw - 24px);height:540px;max-height:calc(100vh - 110px);background:#fff;color:#222;border-radius:18px;box-shadow:0 16px 48px rgba(0,0,0,.3);display:flex;flex-direction:column;overflow:hidden}
#ta-chat.ta-left #ta-chat-panel{left:0}
#ta-chat.ta-right #ta-chat-panel{right:0}
#ta-chat-panel[hidden]{display:none}
#ta-chat-panel header{background:var(--secondary,#1c2529);color:#fff;padding:14px 16px;display:flex;justify-content:space-between;align-items:center}
#ta-chat-agent::before{content:"";display:inline-block;width:9px;height:9px;border-radius:50%;background:#3ddc84;margin-right:8px}
#ta-chat-panel header small{display:block;opacity:.75;font-size:12px;margin-top:3px}
#ta-chat-close{background:none;border:0;color:#fff;font-size:26px;cursor:pointer;line-height:1}
#ta-chat-log{flex:1;overflow-y:auto;padding:14px;background:#f6f4f0}
.ta-msg{max-width:86%;padding:10px 13px;border-radius:15px;margin:0 0 10px;font-size:14px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}
.ta-msg.bot{background:#fff;border:1px solid #e7e2d9;border-bottom-left-radius:4px}
.ta-msg.me{background:var(--primary,#bc6c25);color:#fff;margin-left:auto;border-bottom-right-radius:4px}
.ta-msg.err{background:#fdecea;color:#8a1c12;border-color:#f5c6c0}
.ta-msg.ta-typing{opacity:.65;font-style:italic}
.ta-card{background:#fff;border:1px solid #e0d9cc;border-radius:12px;padding:12px;margin:0 0 10px;font-size:13px}
.ta-card div{margin:3px 0}
.ta-card div.tot{font-weight:700;margin-top:8px}
.ta-actions{display:flex;gap:8px;margin-top:10px}
.ta-btn{flex:1;padding:10px;border-radius:9px;border:0;cursor:pointer;font-weight:600;text-align:center;text-decoration:none;font-size:13px}
.ta-btn.pri{background:var(--primary,#bc6c25);color:#fff}
.ta-btn.sec{background:#eee;color:#333}
.ta-btn[disabled]{opacity:.5;cursor:default}
#ta-chat-form{display:flex;gap:8px;padding:10px;border-top:1px solid #eee;background:#fff}
#ta-chat-input{flex:1;padding:11px;border:1px solid #ddd;border-radius:9px;font-size:14px}
#ta-chat-send{padding:0 18px;border:0;border-radius:9px;background:var(--primary,#bc6c25);color:#fff;cursor:pointer;font-weight:600}
@media(max-width:480px){
  #ta-chat.ta-left{left:12px}#ta-chat.ta-right{right:12px}#ta-chat{bottom:12px}
  #ta-chat-panel{height:72vh}
  #ta-chat-tip{max-width:200px;font-size:13px}
}
