* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.model-badge {
    font-size: 0.75rem;
    background: #4a4a6a;
    padding: 4px 10px;
    border-radius: 12px;
    color: #aaa;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

#messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user {
    background: #4a4aff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    background: #2a2a4a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.error {
    background: #ff4a4a;
    align-self: center;
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

footer {
    padding: 16px 20px;
    border-top: 1px solid #333;
}

#chat-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 12px 16px;
    color: #eee;
    font-size: 1rem;
    resize: none;
    max-height: 150px;
    font-family: inherit;
}

#message-input:focus {
    outline: none;
    border-color: #4a4aff;
}

#send-btn {
    background: #4a4aff;
    border: none;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #5a5aff;
}

#send-btn:disabled {
    background: #333;
    cursor: not-allowed;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}
