* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f3f5f9;
    color: #1f2937;
}

.chat-shell {
    max-width: 980px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
}

h1 {
    margin: 0;
    font-size: 20px;
}

.status {
    margin: 4px 0 0;
    font-size: 13px;
}

.status.idle { color: #6b7280; }
.status.loading { color: #b45309; }
.status.success { color: #047857; }
.status.error { color: #b91c1c; }

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.message {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.message.user {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 4px;
}

.message-meta {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.8;
}

.empty-tip {
    margin: auto;
    color: #6b7280;
}

.chat-input-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
}

textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    resize: none;
    font-size: 14px;
}

.chat-actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hint {
    color: #6b7280;
    font-size: 12px;
}

button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
}

button:hover { background: #1d4ed8; }

.secondary-btn { background: #6b7280; }
.secondary-btn:hover { background: #4b5563; }
