#cloudhermit-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#cloudhermit-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, transform 0.2s;
}

#cloudhermit-chat-toggle:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

#cloudhermit-chat-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#cloudhermit-chat-window.cloudhermit-hidden {
    display: none;
}

#cloudhermit-chat-header {
    background: #2563eb;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
}

#cloudhermit-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#cloudhermit-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cloudhermit-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.cloudhermit-bot {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    line-height: 1.8;
}

.cloudhermit-bot strong {
    font-weight: 600;
}

.cloudhermit-user {
    background: #2563eb;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.cloudhermit-typing {
    align-self: flex-start;
    background: #f1f5f9;
    padding: 10px 18px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.cloudhermit-typing-dots {
    display: flex;
    gap: 4px;
}

.cloudhermit-typing-dots span {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: cloudhermit-bounce 1.4s ease-in-out infinite;
}

.cloudhermit-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.cloudhermit-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes cloudhermit-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

#cloudhermit-chat-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
}

#cloudhermit-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#cloudhermit-chat-input:focus {
    border-color: #2563eb;
}

#cloudhermit-chat-send {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#cloudhermit-chat-send:hover {
    background: #1d4ed8;
}

#cloudhermit-chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

@media (max-width: 440px) {
    #cloudhermit-chat-window {
        width: calc(100vw - 32px);
        right: -8px;
        bottom: 68px;
        max-height: 70vh;
    }
}
