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

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

#app {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #232f3e;
    color: #fff;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
}

.logout-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.1);
}

.loading {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: 16px;
}

#chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.message.assistant {
    align-self: flex-start;
    background: #e8eef3;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

.message.error {
    align-self: center;
    background: #fde8e8;
    color: #c53030;
    font-size: 13px;
}

.message.thinking {
    align-self: flex-start;
    background: #e8eef3;
    color: #888;
    font-style: italic;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e2e2e2;
    background: #fafafa;
}

.chat-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-form input:focus {
    border-color: #232f3e;
}

.chat-form button {
    padding: 12px 24px;
    background: #ff9900;
    color: #000;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}

.chat-form button:hover {
    background: #ec7211;
}

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