#chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    
    transition: all .3s ease;
}

#chat-toggle-btn.light-mode {
    background:#fff;
    color:#0d6efd;
    box-shadow:0 4px 12px rgba(0,0,0,.35);
}
/*#chat-helper-text{*/
/*    background:#fff;*/
/*    border-radius:18px;*/
/*    padding:14px 18px;*/
/*    box-shadow:0 8px 24px rgba(0,0,0,.15);*/
/*    line-height:1.25;*/
/*    max-width:260px;*/
/*}*/


#chat-helper-text {
    position: fixed;
    right: 20px;
    bottom: 90px;
    background: #ffffff;
    color: #333;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
    z-index: 9998;
    white-space: nowrap;
}

#chat-helper-text .title{
    font-size:17px;
    font-weight:700;
    color:#333;
    text-align:left;
}

#chat-helper-text .sub{
    margin-top:4px;
    font-size:15px;
    font-weight:500;
    color:#666;
    text-align:center;
}

#chat-helper-text {
    animation: chatHint 2s infinite;
}

@keyframes chatHint {
    0%,100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

#chat-helper-text::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 25px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #ffffff transparent transparent;
}

#chat-widget {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    z-index: 9999;
}

#chat-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 10000;
    touch-action: none;
}

#chat-resize-handle::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    border-left: 2px solid #bbb;
    border-top: 2px solid #bbb;
}

#chat-widget.chat-resizing {
    transition: none;
    user-select: none;
}

#chat-widget.chat-hidden {
    display: none;
}

#chat-header {
    background: #0d6efd;
    color: #fff;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-close-btn {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

#chat-messages {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 220px;
    max-height: 340px;
    overflow-y: auto;
}

#chat-messages .msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

#chat-messages .msg-assistant {
    align-self: flex-start;
    background: #f1f1f1;
    border-bottom-left-radius: 4px;
}

#chat-messages .msg-user {
    align-self: flex-end;
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 4px;
}

#chat-messages .msg-error {
    background: #fdecea;
    color: #b3261e;
}

#chat-messages .msg-admin {
    align-self: flex-start;
    background: #e6f4ea;
    border-bottom-left-radius: 4px;
    border-left: 3px solid #1e8e3e;
}

#chat-messages .msg-handoff {
    align-self: flex-start;
    background: #f1f1f1;
    border-bottom-left-radius: 4px;
    max-width: 90%;
}

#chat-messages .msg-handoff .handoff-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

#chat-messages .msg-handoff button {
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}

#chat-messages .msg-handoff .handoff-yes {
    background: #0d6efd;
    color: #fff;
}

#chat-messages .msg-handoff .handoff-no {
    background: #e0e0e0;
    color: #333;
}

#chat-messages .msg-handoff button:disabled {
    opacity: 0.5;
    cursor: default;
}

#typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0 14px 10px;
}

#typing-indicator span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #999;
    display: inline-block;
}

#chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
}

#chat-form input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
}

#chat-form button {
    border: none;
    background: #0d6efd;
    color: #fff;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}