
:root {
    color-scheme: light;
    --bg: #ffffff;
    --panel: #f7f7f8;
    --panel-2: #ececf1;
    --panel-3: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --line: rgba(17, 24, 39, 0.10);
    --line-strong: rgba(17, 24, 39, 0.16);
    --hover: rgba(17, 24, 39, 0.06);
    --active: rgba(17, 24, 39, 0.09);
    --accent: #111827;
    --accent-text: #ffffff;
    --danger: #dc2626;
    --success: #10a37f;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    --composer-shadow: 0 8px 30px rgba(15, 23, 42, 0.10);
    --sidebar-width: 280px;
    --topbar-height: 58px;
    --radius-lg: 18px;
    --radius-md: 13px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #212121;
    --panel: #171717;
    --panel-2: #2f2f2f;
    --panel-3: #3a3a3a;
    --text: #ececec;
    --muted: #b4b4b4;
    --muted-2: #858585;
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.16);
    --hover: rgba(255, 255, 255, 0.07);
    --active: rgba(255, 255, 255, 0.11);
    --accent: #ececec;
    --accent-text: #171717;
    --danger: #ff6b6b;
    --success: #10a37f;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    --composer-shadow: 0 8px 30px rgba(0, 0, 0, 0.30);
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        color-scheme: dark;
        --bg: #212121;
        --panel: #171717;
        --panel-2: #2f2f2f;
        --panel-3: #3a3a3a;
        --text: #ececec;
        --muted: #b4b4b4;
        --muted-2: #858585;
        --line: rgba(255, 255, 255, 0.10);
        --line-strong: rgba(255, 255, 255, 0.16);
        --hover: rgba(255, 255, 255, 0.07);
        --active: rgba(255, 255, 255, 0.11);
        --accent: #ececec;
        --accent-text: #171717;
        --danger: #ff6b6b;
        --success: #10a37f;
        --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
        --composer-shadow: 0 8px 30px rgba(0, 0, 0, 0.30);
    }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, textarea, select, input { font: inherit; }
button { color: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: currentColor; display: block; }
[hidden] { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    height: 100dvh;
    min-height: 100%;
}

.sidebar {
    position: relative;
    z-index: 40;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-right: 1px solid var(--line);
    overflow: hidden;
}
.sidebar-top { padding: 10px 10px 8px; }
.brand-button, .sidebar-action {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}
.brand-button:hover, .sidebar-action:hover { background: var(--hover); }
.brand-mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--accent-text);
    flex: 0 0 auto;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-button > span:nth-child(2) { font-weight: 600; }
.shortcut {
    margin-left: auto;
    color: var(--muted-2);
    font-size: 11px;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
}

.sidebar-search {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--muted);
}
.sidebar-search:focus-within {
    border-color: var(--line-strong);
    background: var(--bg);
}
.sidebar-search svg { width: 17px; height: 17px; flex: 0 0 auto; }
.sidebar-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    min-width: 0;
}
.sidebar-search input::placeholder { color: var(--muted-2); }

.history-heading {
    padding: 12px 12px 7px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-3) transparent;
}
.history-empty {
    color: var(--muted-2);
    font-size: 13px;
    padding: 18px 10px;
    text-align: center;
}
.history-item {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 9px;
    margin: 1px 0;
}
.history-item.active { background: var(--active); }
.history-main {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    padding: 9px 38px 9px 10px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-more {
    position: absolute;
    right: 5px;
    border: 0;
    background: transparent;
    width: 30px; height: 30px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    cursor: pointer;
    opacity: 0;
    color: var(--muted);
}
.history-item:hover .history-more,
.history-item.active .history-more,
.history-more:focus { opacity: 1; }
.history-more:hover { background: var(--hover); color: var(--text); }
.history-menu {
    position: fixed;
    z-index: 100;
    min-width: 150px;
    background: var(--bg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 10px;
    padding: 5px;
}
.history-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 7px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-align: left;
}
.history-menu button:hover { background: var(--hover); }
.history-menu .danger { color: var(--danger); }

.sidebar-bottom {
    border-top: 1px solid var(--line);
    padding: 8px 8px calc(9px + var(--safe-bottom));
}
.sidebar-action svg { color: var(--muted); }
.sidebar-note { padding: 2px 10px 5px; color: var(--muted-2); font-size: 11px; }

.main-panel {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-rows: var(--topbar-height) minmax(0, 1fr) auto;
    height: 100dvh;
    background: var(--bg);
}
.topbar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid transparent;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 6px; }
.model-picker { position: relative; display: flex; align-items: center; }
.model-picker select {
    appearance: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    border-radius: 9px;
    padding: 8px 30px 8px 10px;
    cursor: pointer;
}
.model-picker select:hover { background: var(--hover); }
.model-picker svg {
    width: 17px; height: 17px;
    position: absolute;
    right: 8px;
    pointer-events: none;
    color: var(--muted);
}
.icon-button, .composer-icon {
    border: 0;
    background: transparent;
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.icon-button:hover, .composer-icon:hover { background: var(--hover); }
.icon-button.subtle { width: 30px; height: 30px; }
.icon-button.subtle svg { width: 17px; height: 17px; }
.tool-toggle {
    border: 1px solid var(--line);
    background: transparent;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-radius: 10px;
    padding: 0 10px;
    color: var(--muted);
    cursor: pointer;
}
.tool-toggle svg { width: 17px; height: 17px; }
.tool-toggle:hover { background: var(--hover); color: var(--text); }
.tool-toggle[aria-pressed="true"] {
    color: var(--text);
    background: var(--active);
    border-color: var(--line-strong);
}
.theme-icon { width: 19px; height: 19px; }

.chat-stage {
    position: relative;
    min-height: 0;
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-3) transparent;
}
.empty-state {
    min-height: 100%;
    width: min(820px, 100%);
    margin: 0 auto;
    padding: max(40px, 11vh) 20px 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.empty-logo {
    width: 44px; height: 44px;
    display: grid;
    place-items: center;
    color: var(--text);
    margin-bottom: 18px;
}
.empty-logo svg { width: 40px; height: 40px; }
.empty-state h1 {
    font-size: clamp(25px, 3.5vw, 34px);
    line-height: 1.2;
    margin: 0 0 28px;
    text-align: center;
    letter-spacing: -0.03em;
}
.suggestion-grid {
    width: 100%;
    max-width: 720px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.suggestion-card {
    min-height: 94px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    border-radius: 14px;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.suggestion-card:hover {
    background: var(--hover);
    border-color: var(--line-strong);
}
.suggestion-card strong { font-size: 14px; }
.suggestion-card span { color: var(--muted); font-size: 13px; }

.message-list {
    width: 100%;
    padding: 12px 0 170px;
}
.message-row {
    width: 100%;
    padding: 14px 20px;
}
.message-inner {
    width: min(780px, 100%);
    margin: 0 auto;
}
.message-row.user .message-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.user-bubble {
    max-width: min(78%, 650px);
    padding: 10px 15px;
    background: var(--panel-2);
    border-radius: 18px;
    border-bottom-right-radius: 5px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.message-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 8px;
    margin-bottom: 8px;
}
.message-images img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    cursor: zoom-in;
}
.assistant-block {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.assistant-avatar {
    width: 28px; height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--accent-text);
    margin-top: 2px;
}
.assistant-avatar svg { width: 17px; height: 17px; }
.assistant-content { min-width: 0; }
.markdown-body {
    color: var(--text);
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.markdown-body > :first-child { margin-top: 0 !important; }
.markdown-body > :last-child { margin-bottom: 0 !important; }
.markdown-body p { margin: 0 0 1em; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    line-height: 1.3;
    margin: 1.35em 0 .65em;
}
.markdown-body h1 { font-size: 1.55em; }
.markdown-body h2 { font-size: 1.3em; }
.markdown-body h3 { font-size: 1.12em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; margin: .8em 0 1em; }
.markdown-body li + li { margin-top: .3em; }
.markdown-body blockquote {
    margin: 1em 0;
    padding: .1em 0 .1em 1em;
    border-left: 3px solid var(--line-strong);
    color: var(--muted);
}
.markdown-body a { color: #2563eb; text-decoration: none; }
html[data-theme="dark"] .markdown-body a { color: #8ab4f8; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    margin: 1em 0;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--line-strong);
    padding: 8px 10px;
    text-align: left;
}
.markdown-body th { background: var(--panel); }
.markdown-body code:not(pre code) {
    background: var(--panel-2);
    padding: .14em .35em;
    border-radius: 5px;
    font-size: .9em;
}
.code-shell {
    position: relative;
    margin: 1em 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #0d1117;
}
.code-header {
    height: 34px;
    padding: 0 8px 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #aeb6c1;
    background: #161b22;
    font-size: 12px;
}
.code-copy {
    border: 0;
    background: transparent;
    color: inherit;
    border-radius: 6px;
    padding: 4px 7px;
    cursor: pointer;
}
.code-copy:hover { background: rgba(255, 255, 255, .08); }
.code-shell pre {
    margin: 0;
    overflow: auto;
    padding: 15px;
}
.code-shell code { font-size: 13px; line-height: 1.55; }
.typing-cursor::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 1.1em;
    margin-left: 2px;
    vertical-align: -2px;
    border-radius: 1px;
    background: currentColor;
    animation: blink .8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.thinking-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    min-height: 28px;
}
.thinking-dots { display: inline-flex; gap: 4px; }
.thinking-dots i {
    width: 5px; height: 5px;
    border-radius: 999px;
    background: currentColor;
    animation: bounce 1.1s infinite ease-in-out;
}
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}
.message-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 8px;
    min-height: 30px;
}
.message-actions button {
    border: 0;
    background: transparent;
    width: 30px; height: 30px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: var(--muted);
    cursor: pointer;
}
.message-actions button:hover { background: var(--hover); color: var(--text); }
.message-actions svg { width: 16px; height: 16px; }
.source-list {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.source-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 240px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
}
.source-chip:hover { background: var(--hover); color: var(--text); }
.source-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scroll-bottom {
    position: fixed;
    left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
    bottom: 132px;
    transform: translateX(-50%);
    z-index: 15;
    width: 34px; height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--bg);
    box-shadow: var(--shadow);
    cursor: pointer;
}
.scroll-bottom:hover { background: var(--panel); }

.composer-wrap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 18;
    padding: 12px 20px calc(8px + var(--safe-bottom));
    background: linear-gradient(to bottom, transparent, var(--bg) 28%, var(--bg));
}
.composer {
    width: min(790px, 100%);
    margin: 0 auto;
    min-height: 58px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: var(--bg);
    box-shadow: var(--composer-shadow);
}
.composer:focus-within { border-color: color-mix(in srgb, var(--text) 28%, transparent); }
.composer textarea {
    flex: 1;
    min-width: 0;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    padding: 9px 8px;
    line-height: 1.45;
}
.composer textarea::placeholder { color: var(--muted-2); }
.composer-icon { flex: 0 0 auto; color: var(--muted); }
.composer-icon.recording {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    animation: pulse 1s infinite;
}
@keyframes pulse { 50% { opacity: .55; } }
.send-button {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    border: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
}
.send-button:disabled { opacity: .35; cursor: default; }
.send-button .stop-icon { display: none; }
.send-button.generating .send-icon { display: none; }
.send-button.generating .stop-icon { display: block; }
.composer-disclaimer {
    width: min(790px, 100%);
    margin: 6px auto 0;
    color: var(--muted-2);
    font-size: 11px;
    text-align: center;
}
.attachment-strip {
    width: min(790px, 100%);
    margin: 0 auto 8px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.attachment-card {
    position: relative;
    width: 70px; height: 70px;
    flex: 0 0 70px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
}
.attachment-card img { width: 100%; height: 100%; object-fit: cover; }
.attachment-remove {
    position: absolute;
    top: 3px; right: 3px;
    width: 23px; height: 23px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(0, 0, 0, .72);
    cursor: pointer;
}
.attachment-remove svg { width: 14px; height: 14px; }

.settings-modal {
    width: min(620px, calc(100% - 28px));
    max-height: min(760px, calc(100dvh - 28px));
    border: 0;
    border-radius: 18px;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow);
}
.settings-modal::backdrop { background: rgba(0, 0, 0, .42); backdrop-filter: blur(2px); }
.settings-card { display: flex; flex-direction: column; max-height: inherit; }
.modal-header, .modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 20px;
}
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); justify-content: flex-end; gap: 8px; }
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.settings-body {
    padding: 18px 20px;
    overflow-y: auto;
    display: grid;
    gap: 17px;
}
.field { display: grid; gap: 7px; }
.field > span { font-weight: 600; font-size: 13px; }
.field textarea, .field select {
    width: 100%;
    border: 1px solid var(--line-strong);
    outline: 0;
    background: var(--panel);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 11px;
    resize: vertical;
}
.field textarea:focus, .field select:focus { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.switch-row span { display: grid; }
.switch-row strong { font-size: 13px; }
.switch-row small { color: var(--muted); }
.switch-row input {
    appearance: none;
    width: 42px; height: 24px;
    border-radius: 999px;
    background: var(--panel-3);
    position: relative;
    cursor: pointer;
    transition: .2s ease;
}
.switch-row input::after {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 999px;
    top: 3px; left: 3px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    transition: .2s ease;
}
.switch-row input:checked { background: var(--success); }
.switch-row input:checked::after { transform: translateX(18px); }
.primary-button, .secondary-button {
    border-radius: 9px;
    padding: 8px 13px;
    cursor: pointer;
    font-weight: 600;
}
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); }
.secondary-button { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.secondary-button:hover { background: var(--hover); }
.data-actions { padding-top: 4px; }

.toast-region {
    position: fixed;
    z-index: 200;
    left: 50%;
    bottom: calc(100px + var(--safe-bottom));
    transform: translateX(-50%);
    display: grid;
    gap: 8px;
    pointer-events: none;
}
.toast {
    min-width: 220px;
    max-width: min(420px, calc(100vw - 30px));
    padding: 10px 13px;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    box-shadow: var(--shadow);
    text-align: center;
    animation: toast-in .2s ease;
}
.toast.error { background: #7f1d1d; color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

.image-lightbox {
    position: fixed;
    z-index: 300;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0,0,0,.82);
}
.image-lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 12px;
}
.image-lightbox button {
    position: absolute;
    top: 16px; right: 16px;
    width: 42px; height: 42px;
    border: 0; border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #fff;
    display: grid; place-items: center;
    cursor: pointer;
}

.mobile-only { display: none; }
.mobile-backdrop { display: none; }

@media (max-width: 800px) {
    :root { --sidebar-width: 280px; }
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(var(--sidebar-width), 88vw);
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: var(--shadow);
    }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        background: rgba(0,0,0,.4);
    }
    .mobile-only { display: grid; }
    .topbar { padding: 0 8px; }
    .tool-toggle span { display: none; }
    .tool-toggle { width: 38px; padding: 0; justify-content: center; }
    .empty-state { padding: 30px 14px 160px; }
    .suggestion-grid { grid-template-columns: 1fr; }
    .suggestion-card { min-height: 76px; }
    .message-row { padding: 12px 13px; }
    .message-inner { width: 100%; }
    .user-bubble { max-width: 88%; }
    .assistant-block { grid-template-columns: 25px minmax(0, 1fr); gap: 10px; }
    .assistant-avatar { width: 25px; height: 25px; border-radius: 8px; }
    .composer-wrap { padding-left: 9px; padding-right: 9px; }
    .composer { border-radius: 19px; }
    .scroll-bottom { left: 50%; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .topbar-actions { gap: 1px; }
    .topbar .icon-button { width: 35px; height: 35px; }
    #exportButton { display: none; }
    .model-picker select { max-width: 170px; }
    .message-images { grid-template-columns: 1fr; }
    .user-bubble { max-width: 92%; }
    .composer-disclaimer { display: none; }
    .composer-wrap { padding-bottom: calc(8px + var(--safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
