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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    justify-content: center;
}

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

header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    text-align: center;
}

header h1 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

.chat-main {
    flex: 1;
    overflow: hidden;
}

.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 1rem;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    max-width: 85%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-user {
    background: #007bff;
    color: #fff;
    margin-left: auto;
}

.message-assistant {
    background: #f0f0f0;
    color: #333;
}

.message-error {
    background: #fee;
    color: #c00;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.chat-input-area textarea {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.chat-input-area button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.chat-input-area button:hover {
    background: #0056b3;
}

.chat-input-area button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#clear-btn {
    background: #6c757d;
}

#clear-btn:hover {
    background: #545b62;
}
