.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    height: var(--topbar-height);
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-toggle {
    display: none;
}

.model-selector select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}

.model-selector select:focus {
    outline: none;
    border-color: var(--primary);
}

.topbar-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: var(--text-secondary);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
}

.welcome-screen h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-screen p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.welcome-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 560px;
    width: 100%;
}

.suggestion-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: left;
    transition: all var(--transition);
    cursor: pointer;
}

.suggestion-card:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.suggestion-card span {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
}

.suggestion-card small {
    color: var(--text-muted);
    font-size: 12px;
}

/* Messages */
.message {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--primary);
}

.message.assistant .message-avatar {
    background: var(--accent);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-role {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: capitalize;
}

.message-text {
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-text pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
}

.message-text code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
}

.message-text pre code {
    background: none;
    padding: 0;
}

.message-text p {
    margin-bottom: 8px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, .message-text ol {
    padding-left: 20px;
    margin: 8px 0;
}

.message-text li {
    margin-bottom: 4px;
}

.message-text img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 8px 0;
}

.message-text audio {
    width: 100%;
    margin: 8px 0;
}

.message-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Streaming indicator */
.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--primary);
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Input area */
.input-area {
    padding: 12px 20px 20px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    transition: border-color var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
}

.input-wrapper textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    resize: none;
    padding: 4px 0;
    max-height: 200px;
    line-height: 1.5;
}

.input-wrapper textarea:focus {
    outline: none;
}

.btn-send {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    flex-shrink: 0;
    transition: all var(--transition);
}

.btn-send:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-send:not(:disabled):hover {
    background: var(--primary-hover);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        z-index: 100;
        height: 100%;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .welcome-suggestions {
        grid-template-columns: 1fr;
    }
}
