.world-ai-chat-widget {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 320px;
    max-width: calc(100vw - 2rem);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

.world-ai-chat-widget.minimized .wai-chat-body,
.world-ai-chat-widget.minimized .wai-chat-form {
    display: none;
}

.wai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #111827;
    color: #fff;
    cursor: pointer;
}

.wai-chat-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.wai-chat-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.wai-chat-body {
    flex: 1;
    min-height: 280px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.75rem;
    background: #f9fafb;
}

.wai-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wai-chat-message {
    padding: 0.6rem 0.8rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.35;
    max-width: 85%;
    word-wrap: break-word;
}

.wai-chat-message.user {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
}

.wai-chat-message.assistant,
.wai-chat-message.agent {
    align-self: flex-start;
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.wai-chat-message.agent {
    border-left: 4px solid #10b981;
}

.wai-chat-typing {
    font-size: 0.8rem;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
}

.wai-chat-typing.hidden {
    display: none;
}

.wai-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.wai-chat-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.wai-chat-send {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.wai-chat-send:disabled,
.wai-chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wai-chat-error {
    color: #dc2626;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    text-align: center;
}
