#chat-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #2196F3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
}

#chat-window {
    position: fixed;
    bottom: 86px;
    right: 20px;
    width: 340px;
    max-width: calc(100vw - 16px);
    height: 480px;
    max-height: calc(100vh - 110px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

@media (max-width: 400px) {
    #chat-window {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }
    #chat-btn {
        bottom: 16px;
        right: 16px;
    }
}

#chat-header {
    background: #2196F3;
    color: white;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    flex-shrink: 0;
}

#chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
}

#chat-avatar svg {
    width: 100%;
    height: 100%;
}

#chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#chat-header-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
}

#chat-header-status {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    color: #e0f7e0;
}

#chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

#chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.msg-bot, .msg-user {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 18px;
    line-height: 1.4;
    word-break: break-word;
}

.msg-bot {
    background: #f0f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.msg-user {
    background: #2196F3;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-self: flex-start;
    padding: 2px 0;
}

.quick-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #2196F3;
    color: #2196F3;
    background: white;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.15s, color 0.15s;
}

.quick-btn:hover {
    background: #2196F3;
    color: white;
}

#chat-input-area {
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 16px;
    min-width: 0;
}

#chat-input:focus {
    border-color: #2196F3;
}

#chat-input-area button {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-typing {
    background: #f0f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    padding: 10px 16px;
    border-radius: 12px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.msg-typing span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing-dot 1.2s infinite;
}

.msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}