:root {
    --bg-color: #fbfaf8;
    --text-color: #1a1a1a;
    --accent-color: #d97757;
    --secondary-bg: #f3f0e9;
    --border-color: #e5e0d8;
    --user-msg-bg: #efebe3;
    --assistant-msg-bg: transparent;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

h1 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
}

.model-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background-color: var(--secondary-bg);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    scroll-behavior: smooth;
}

.welcome-message {
    margin: auto;
    text-align: center;
    max-width: 500px;
    animation: fadeIn 0.8s ease-out;
}

.welcome-message h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.welcome-message p {
    color: #666;
    line-height: 1.6;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: slideUp 0.3s ease-out;
}

.message.user {
    align-self: flex-end;
    background-color: var(--user-msg-bg);
    padding: 1rem 1.25rem;
    border-radius: 18px 18px 2px 18px;
}

.message.assistant {
    align-self: flex-start;
    padding: 0;
    max-width: 100%;
}

.message-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: #888;
}

.message-content {
    line-height: 1.7;
    font-size: 1rem;
    white-space: pre-wrap;
}

.assistant .message-content {
    color: var(--text-color);
}

footer {
    padding: 2rem;
    background-color: var(--bg-color);
}

.input-wrapper {
    position: relative;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px rgba(217, 119, 87, 0.08);
}

textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.25rem 0;
    max-height: 200px;
    background: transparent;
}

#send-btn {
    background-color: var(--text-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

#send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

#send-btn svg {
    width: 18px;
    height: 18px;
}

.disclaimer {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    margin-top: 1rem;
}

/* Typing indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 10px 0;
}

.typing span {
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0.4;
    animation: blink 1.4s infinite both;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0.4; }
    40% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Markdown styling lite */
.message-content code {
    background-color: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.message-content pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
}

.message-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}
