:root {
    --brand: #10a37f;
    --brand-strong: #0b8a6b;
    --sidebar: #f9f9f9;
    --hover: #ececec;
    --line: #e5e5e5;
    --canvas: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f4f4f4;
    --text: #2f2f2f;
    --muted: #8b8b8b;
    --assistant-width: 768px;
    --sidebar-width: 342px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --sidebar: #171717;
    --hover: #2f2f2f;
    --line: #363636;
    --canvas: #212121;
    --surface: #212121;
    --surface-soft: #2f2f2f;
    --text: #ececec;
    --muted: #a7a7a7;
}

body { color: var(--text); background: var(--canvas); }
.sidebar { width: var(--sidebar-width); padding: 10px; color: var(--text); background: var(--sidebar); border-right: 1px solid var(--line); }
.sidebar-resizer { width: 7px; flex: none; position: relative; z-index: 5; margin-left: -4px; cursor: col-resize; touch-action: none; }
.sidebar-resizer::after { content: ''; position: absolute; inset: 0 2px; background: transparent; transition: background .15s ease; }
.sidebar-resizer:hover::after, .sidebar-resizer.dragging::after { background: #8952ee; }
.app.sidebar-collapsed .sidebar { width: 0; padding-right: 0; padding-left: 0; border-right: 0; overflow: hidden; }
.app.sidebar-collapsed .sidebar-resizer { display: none; }
.sidebar-brand { padding: 8px 9px 15px; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; color: #fff; background: #111; font-size: 0; }
.brand-mark::after { content: 'L'; font-size: 13px; font-weight: 750; }
.brand-name { color: var(--text); font-size: 16px; font-weight: 650; }
.brand-subtitle { display: none; }
.new-chat { display: flex; align-items: center; gap: 8px; padding: 11px 10px; color: var(--text); font-size: 14px; }
.new-chat::before { content: '✎'; font-size: 17px; font-weight: 400; }
.new-chat:hover, .chat-item:hover { background: var(--hover); }
.sidebar-quote-link { display: block; margin: 4px 0 11px; padding: 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 13px; }
.sidebar-quote-link:hover { background: var(--hover); }
.sidebar h2 { margin: 17px 10px 7px; color: var(--muted); font-size: 12px; font-weight: 500; }
.chat-item { color: var(--text); font-size: 13px; }

.main { background: var(--canvas); }
.header { min-height: 56px; padding: 0 24px; border-bottom: 0; background: var(--surface); }
.sidebar-toggle { padding: 7px 9px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; }
.sidebar-toggle:hover { color: var(--text); background: var(--surface-soft); }
.page-title strong { color: var(--text); font-size: 16px; font-weight: 650; }
.page-title span { display: none; }
.model-select { max-width: 240px; border: 0; border-radius: 8px; color: var(--text); background: transparent; font-size: 14px; font-weight: 550; }
.model-select:hover, .model-select:focus { background: var(--surface-soft); box-shadow: none; }
.logout { color: var(--text); }
.logout:hover, .theme-toggle:hover { background: var(--surface-soft); color: var(--text); }
.theme-toggle { color: var(--text); }

.messages { padding: 24px max(24px, calc((100% - var(--assistant-width)) / 2)); }
.welcome { max-width: 700px; margin: 16vh auto 0; }
.welcome-badge { display: none; }
.welcome h1 { margin: 0 0 30px; color: var(--text); font-size: clamp(28px, 3vw, 34px); font-weight: 650; letter-spacing: -.035em; }
.welcome p { display: none; }
.capabilities { max-width: 680px; gap: 10px; margin-top: 0; }
.capabilities button { min-height: 54px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: var(--surface); font-size: 13px; font-weight: 450; }
.capabilities button::before { display: inline; margin-right: 7px; color: var(--muted); }
.capabilities button:nth-child(1)::before { content: '⌁'; }
.capabilities button:nth-child(2)::before { content: '◈'; }
.capabilities button:nth-child(3)::before { content: '↗'; }
.capabilities button:nth-child(4)::before { content: '◌'; }
.capabilities button:hover { transform: none; border-color: #c9c9c9; background: var(--surface-soft); box-shadow: none; }

.message { max-width: var(--assistant-width); padding: 19px 0; line-height: 1.72; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #111; }
.assistant .content { padding: 1px 2px; }
.content, .content h2, .content h3, .content h4, .content strong { color: var(--text); }
.user .content { padding: 10px 15px; border-radius: 20px; color: #2f2f2f; background: #ede5fc; box-shadow: none; }
.user .content strong { color: var(--text); }
.status { color: var(--muted); }
.status::before { background: var(--brand); box-shadow: none; }
.tool-results { margin-top: 13px; }
.tool-results-title, .tool-card-meta, .tool-card summary { color: var(--muted); }
.tool-card { border-color: var(--line); border-radius: 12px; background: var(--surface-soft); box-shadow: none; }
.tool-card-name, .tool-card pre { color: var(--text); }
.tool-card-status { color: var(--brand-strong); background: #e9f8f3; }
[data-theme="dark"] .tool-card-status { background: #123b31; color: #7be0bf; }

.composer-wrap { padding: 11px 24px 15px; background: linear-gradient(180deg, transparent, var(--canvas) 32%); }
.composer { max-width: var(--assistant-width); border-color: #d9d9d9; border-radius: 25px; background: var(--surface); box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }
.composer:focus-within { border-color: #bdbdbd; box-shadow: 0 3px 14px rgba(0, 0, 0, .11); }
.composer textarea { color: var(--text); }
.composer textarea::placeholder, .tip { color: var(--muted); }
.send { background: #8952ee; }
.send:hover { background: #7441d3; }
[data-theme="dark"] .send { background: #8952ee; color: #fff; }
[data-theme="dark"] .composer { border-color: #424242; }

@media (max-width: 900px) { .sidebar { width: min(var(--sidebar-width), 290px); } }
@media (max-width: 700px) {
    .sidebar { width: min(86vw, 342px); }
    .sidebar-resizer, .sidebar-toggle { display: none; }
    .header { padding: 0 10px; }
    .messages { padding: 18px 14px; }
    .welcome { margin-top: 13vh; }
    .capabilities { grid-template-columns: 1fr; }
    .composer-wrap { padding: 8px 10px 12px; }
}
