/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #1377C3;
    --primary-dim: #82bdff;
    --bg: #0e0e10;
    --surface: #1e1e21;
    --surface-high: #25252b;
    --surface-low: #131316;
    --input: #2a2a2e;
    --sidebar: #131316;
    --border: rgba(255,255,255,0.08);
    --text: #e6e4ec;
    --text-muted: #9f9da2;
    --text-dim: rgba(255,255,255,0.3);
    --error: #ee7d77;
    --sidebar-w: 256px;
    --sidebar-collapsed: 72px;
}
html, body { height: 100%; overflow: hidden; }
#app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; position: fixed; width: 100%; height: 100%; }
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input, textarea { font-family: inherit; color: var(--text); }
.material-symbols-outlined { font-variation-settings: 'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24; vertical-align: middle; }

/* ===== LAYOUT ===== */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); transition: margin-left 0.3s; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w); min-width: var(--sidebar-w);
    background: var(--sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 20px 12px;
    transition: width 0.3s, min-width 0.3s; overflow: hidden; z-index: 50;
    height: 100%;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 0 4px; }
.logo-wordmark { font-size: 15px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text); white-space: nowrap; overflow: hidden; text-decoration: none; }
.mobile-logo { font-size: 15px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text); text-decoration: none; }
.sidebar.collapsed .logo-wordmark { display: none; }
.sidebar-toggle { color: var(--text-muted); padding: 4px; border-radius: 6px; transition: color 0.15s, background 0.15s; flex-shrink: 0; }
.sidebar-toggle:hover { color: var(--text); background: var(--surface-high); }
.new-chat-btn {
    width: 100%; padding: 10px 12px; background: var(--primary); color: #fff;
    border-radius: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.8px;
    text-transform: uppercase; display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-bottom: 20px; transition: opacity 0.15s, transform 0.1s; flex-shrink: 0;
}
.new-chat-btn:hover { opacity: 0.9; }
.new-chat-btn:active { transform: scale(0.97); }
.sidebar-nav { flex: 1; overflow-y: auto; }
.nav-section { margin-bottom: 16px; }
.nav-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); padding: 4px 8px 8px; }
.chat-label {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 6px; cursor: pointer; transition: background 0.15s, color 0.15s;
    color: var(--text-muted); position: relative;
}
.chat-label:hover { background: var(--surface-high); color: var(--text); }
.chat-label.active { background: rgba(255,255,255,0.08); color: #fff; border-left: 2px solid var(--primary); padding-left: 8px; }
.chat-label .pin-icon { color: #FBBF24; font-size: 16px; flex-shrink: 0; }
.chat-label .chat-name { flex: 1; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.3px; min-width: 0; }
.chat-label .chat-menu-btn { opacity: 0; font-size: 16px; flex-shrink: 0; padding: 4px; border-radius: 4px; transition: opacity 0.15s, background 0.15s; line-height: 1; }
.chat-label:hover .chat-menu-btn { opacity: 1; }
.chat-label .chat-menu-btn:hover { background: rgba(255,255,255,0.1); }
.dropdown-menu {
    position: fixed; z-index: 999;
    background: #2a2a2e; border: 1px solid var(--border);
    border-radius: 8px; padding: 4px; min-width: 150px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: background 0.1s; }
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.dropdown-item.danger { color: var(--error); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); overflow: hidden; }
.user-profile { display: flex; align-items: center; gap: 10px; padding: 4px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-info { flex: 1; overflow: hidden; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signout-btn { color: var(--text-muted); padding: 4px; border-radius: 6px; transition: color 0.15s; flex-shrink: 0; }
.signout-btn:hover { color: var(--error); }
.signin-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.5px; transition: background 0.15s, color 0.15s; white-space: nowrap; overflow: hidden; }
.signin-link:hover { background: var(--surface-high); color: var(--text); }
.sidebar.collapsed .signin-link { padding: 8px; justify-content: center; overflow: hidden; }
.sidebar.collapsed .signin-link .btn-text { display: none; }
.sidebar.collapsed .guest-profile { overflow: hidden; }

/* Collapsed sidebar overrides */
.sidebar.collapsed .btn-text,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .chat-name,
.sidebar.collapsed .chat-menu-btn,
.sidebar.collapsed .user-info,
.sidebar.collapsed .signout-btn { display: none; }
.sidebar.collapsed .new-chat-btn { padding: 10px; justify-content: center; }
.sidebar.collapsed .chat-label { justify-content: center; padding: 10px; }
.sidebar.collapsed .pin-icon { display: none; }
.sidebar.collapsed .user-profile { justify-content: center; }
.sidebar.collapsed .signin-link { justify-content: center; padding: 10px; }

.topbar { display: none; }

/* ===== WELCOME SCREEN ===== */
.welcome-screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.welcome-content { max-width: 720px; width: 100%; text-align: center; padding: 20px 0; }
.welcome-heading { font-size: 52px; font-weight: 800; letter-spacing: -2px; color: var(--text); margin-bottom: 12px; }
.welcome-sub { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin-bottom: 32px; }
.prompt-wrap-center { margin-bottom: 32px; }
.suggestion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }
.suggestion-card { padding: 16px; border-radius: 12px; background: #19191d; border: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: background 0.15s; }
.suggestion-card:hover { background: var(--surface-high); }
.suggestion-card .material-symbols-outlined { color: var(--primary-dim); margin-bottom: 8px; display: block; }
.suggestion-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.suggestion-card p { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* ===== CHAT SCREEN ===== */
.chat-screen { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.messages-container { flex: 1; overflow-y: auto; padding: 32px 24px; display: flex; flex-direction: column; gap: 32px; }
.prompt-wrap-bottom { padding: 16px 24px 20px; background: linear-gradient(to top, var(--bg) 80%, transparent); flex-shrink: 0; }

/* ===== PROMPT BOX ===== */
.prompt-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; transition: box-shadow 0.2s; max-width: 860px; margin: 0 auto; width: 100%; }
.prompt-box:focus-within { box-shadow: 0 0 0 1px rgba(19,119,195,0.35); }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.file-chip { display: flex; align-items: center; gap: 6px; background: var(--input); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 11px; color: var(--text-muted); }
.file-chip .material-symbols-outlined { font-size: 14px; }
.file-chip .chip-remove { cursor: pointer; font-size: 14px; opacity: 0.5; transition: opacity 0.15s; }
.file-chip .chip-remove:hover { opacity: 1; }
.prompt-textarea { width: 100%; background: transparent; border: none; outline: none; resize: none; font-size: 15px; color: var(--text); min-height: 52px; max-height: 200px; padding: 4px 8px; line-height: 1.6; }
@media (max-width: 768px) { .prompt-textarea { font-size: 16px; } }
.prompt-textarea::placeholder { color: var(--text-muted); }
.prompt-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.04); margin-top: 4px; }
.prompt-left { display: flex; align-items: center; gap: 6px; }
.deepthink-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); font-size: 12px; font-weight: 600; transition: all 0.15s; }
.deepthink-btn.active { border-color: rgba(19,119,195,0.6); color: var(--primary-dim); background: rgba(19,119,195,0.1); }
.deepthink-btn .material-symbols-outlined { font-size: 16px; }
.divider-v { width: 1px; height: 16px; background: rgba(255,255,255,0.08); margin: 0 4px; }
@media (max-width: 400px) { .divider-v { display: none; } }
.icon-btn { padding: 7px; border-radius: 8px; color: var(--text-muted); transition: color 0.15s, background 0.15s; }
.icon-btn:hover { color: var(--text); background: var(--surface-high); }
.icon-btn .material-symbols-outlined { font-size: 20px; }
.send-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; transition: transform 0.1s, opacity 0.15s; }
.send-btn:hover { opacity: 0.9; transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { background: rgba(255,255,255,0.1); cursor: not-allowed; transform: none; opacity: 1; }
.send-btn .material-symbols-outlined { font-size: 20px; }
.stop-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(238,125,119,0.15); border: 1px solid rgba(238,125,119,0.4); color: #ee7d77; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.stop-btn:hover { background: rgba(238,125,119,0.25); }
.prompt-disclaimer { text-align: center; font-size: 10px; color: rgba(255,255,255,0.25); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 10px; }

/* ===== MESSAGES ===== */
.msg-date-divider { text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: rgba(255,255,255,0.2); margin: 8px 0; }
.msg-wrap { display: flex; flex-direction: column; max-width: 860px; margin: 0 auto; width: 100%; }

/* User message */
.msg-user { align-items: flex-end; }
.msg-user-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; justify-content: flex-end; }
.msg-user-row { display: flex; align-items: flex-end; gap: 10px; }
.msg-user-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.msg-user-row:hover .msg-user-actions { opacity: 1; }
.msg-action-btn { padding: 5px; border-radius: 6px; color: var(--text-muted); transition: color 0.15s, background 0.15s; }
.msg-action-btn:hover { color: var(--text); background: var(--surface-high); }
.msg-action-btn .material-symbols-outlined { font-size: 16px; }
.msg-bubble { background: var(--surface); border-radius: 18px 18px 4px 18px; padding: 12px 18px; font-size: 14px; line-height: 1.65; max-width: 640px; word-break: break-word; }
.msg-edit-wrap { width: 100%; max-width: 640px; }
.msg-edit-textarea { width: 100%; background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--text); resize: none; outline: none; min-height: 60px; }
.msg-edit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* Assistant message */
.msg-assistant { align-items: flex-start; }
.msg-assistant-row { display: flex; gap: 16px; width: 100%; }
.msg-avatar { width: 32px; height: 32px; border-radius: 8px; background: #0d1f30; border: 1px solid rgba(19,119,195,0.4); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.msg-avatar .material-symbols-outlined { color: var(--primary-dim); font-size: 20px; }
.msg-assistant-body { flex: 1; min-width: 0; }

/* Thinking block */
.thinking-block { border-left: 2px solid rgba(19,119,195,0.3); padding: 8px 14px; margin-bottom: 14px; border-radius: 0 6px 6px 0; background: rgba(19,119,195,0.04); }
.thinking-summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--text-muted); font-size: 12px; font-weight: 500; user-select: none; }
.thinking-summary .material-symbols-outlined { font-size: 16px; color: var(--primary-dim); }
.thinking-content { color: rgba(255,255,255,0.35); font-size: 12px; white-space: pre-wrap; margin-top: 8px; line-height: 1.6; max-height: 300px; overflow-y: auto; }
.thinking-dots { display: inline-flex; gap: 3px; align-items: center; margin-left: 4px; }
.thinking-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.2s infinite; display: inline-block; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Markdown content */
.msg-content { font-size: 15px; line-height: 1.75; color: var(--text); word-break: break-word; }
.msg-content p { margin-bottom: 12px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content h1,.msg-content h2,.msg-content h3,.msg-content h4 { font-weight: 700; margin: 16px 0 8px; color: var(--text); }
.msg-content h1 { font-size: 20px; } .msg-content h2 { font-size: 18px; } .msg-content h3 { font-size: 16px; }
.msg-content ul,.msg-content ol { padding-left: 20px; margin-bottom: 12px; }
.msg-content li { margin-bottom: 4px; }
.msg-content code { background: var(--surface-high); color: var(--primary-dim); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'Fira Code', 'Consolas', monospace; }
.msg-content pre { background: #0d0d0f; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 12px 0; }
.msg-content pre .code-header { display: flex; justify-content: space-between; align-items: center; background: var(--surface-high); padding: 8px 14px; border-bottom: 1px solid var(--border); }
.msg-content pre .code-lang { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); font-family: monospace; }
.msg-content pre .copy-code-btn { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); transition: color 0.15s; }
.msg-content pre .copy-code-btn:hover { color: var(--text); }
.msg-content pre .copy-code-btn .material-symbols-outlined { font-size: 14px; }
.msg-content pre code { background: none; color: inherit; padding: 14px 16px; display: block; overflow-x: auto; font-size: 13px; line-height: 1.6; white-space: pre; }
.msg-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.msg-content th,.msg-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.msg-content th { background: var(--surface-high); font-weight: 600; }
.msg-content blockquote { border-left: 3px solid var(--primary); padding: 8px 14px; color: var(--text-muted); margin: 12px 0; background: rgba(19,119,195,0.05); border-radius: 0 6px 6px 0; }
.msg-content a { color: var(--primary-dim); text-decoration: underline; }
.msg-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Loading dots */
.loading-dots { display: flex; gap: 5px; align-items: center; padding: 8px 0; }
.loading-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.2s infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,80%,100% { transform: scale(0.7); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* Stopped */
.msg-stopped { font-style: italic; color: var(--text-dim); font-size: 13px; }

/* Message footer actions */
.msg-footer-actions { display: flex; gap: 4px; margin-top: 10px; opacity: 0.4; transition: opacity 0.15s; }
.msg-footer-actions:hover { opacity: 1; }
.msg-footer-btn { padding: 5px; border-radius: 6px; color: var(--text-muted); transition: color 0.15s, background 0.15s; display: flex; align-items: center; gap: 4px; font-size: 11px; }
.msg-footer-btn:hover { color: var(--text); background: var(--surface-high); }
.msg-footer-btn .material-symbols-outlined { font-size: 16px; }
.msg-footer-btn.copied .material-symbols-outlined { color: #4ade80; }

/* ===== MODALS ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(14,14,16,0.8); backdrop-filter: blur(8px); }
.modal { background: #1e1e21; border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 440px; overflow: hidden; }
.modal-sm { max-width: 360px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; }
.modal-header h2 { font-size: 17px; font-weight: 600; }
.modal-close { color: var(--text-muted); padding: 4px; border-radius: 6px; transition: color 0.15s; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 0 24px 16px; }
.modal-input { width: 100%; background: var(--input); border: none; border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--text); outline: none; transition: box-shadow 0.15s; }
.modal-input:focus { box-shadow: 0 0 0 2px rgba(19,119,195,0.4); }
.modal-hint { font-size: 12px; color: rgba(255,255,255,0.3); margin-top: 8px; line-height: 1.5; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; }

/* ===== BUTTONS ===== */
.btn-ghost { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted); border-radius: 8px; transition: color 0.15s, background 0.15s; }
.btn-ghost:hover { color: var(--text); background: var(--surface-high); }
.btn-primary { padding: 8px 20px; font-size: 13px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 8px; transition: background 0.15s, transform 0.1s; }
.btn-primary:hover { background: #1588de; }
.btn-primary:active { transform: scale(0.97); }
.btn-danger { padding: 8px 20px; font-size: 13px; font-weight: 700; color: #fff; background: #7f2927; border-radius: 8px; transition: background 0.15s; }
.btn-danger:hover { background: #9b3330; }
.btn-sm { padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: 6px; transition: all 0.15s; }

/* ===== FORM ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 6px; }
.form-group input { width: 100%; background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; font-size: 14px; color: var(--text); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.form-group input:focus { border-color: rgba(19,119,195,0.5); box-shadow: 0 0 0 2px rgba(19,119,195,0.15); }

/* ===== AUTH OVERLAY ===== */
.auth-overlay { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 16px; font-weight: 700; }
.auth-logo .logo-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.auth-logo .logo-icon .material-symbols-outlined { color: #fff; font-size: 20px; }
.auth-box h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.auth-btn { width: 100%; padding: 12px; background: var(--primary); color: #fff; border-radius: 8px; font-size: 14px; font-weight: 700; transition: background 0.15s; margin-top: 4px; }
.auth-btn:hover { background: #1588de; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 20px; }
.auth-switch a { color: var(--primary-dim); }
.auth-error { background: rgba(127,41,39,0.3); border: 1px solid rgba(238,125,119,0.3); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--error); margin-bottom: 16px; }

/* ===== MOBILE TOPBAR ===== */
.mobile-topbar { display: none; }

/* ===== SIDEBAR BACKDROP ===== */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 90; backdrop-filter: blur(2px); }
.sidebar-backdrop.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Mobile topbar */
    .mobile-topbar {
        display: flex; align-items: center; justify-content: space-between;
        height: 56px; padding: 0 16px; background: var(--sidebar);
        border-bottom: 1px solid var(--border); flex-shrink: 0; z-index: 95;
        position: sticky; top: 0;
    }
    .mobile-menu-btn { padding: 8px; border-radius: 8px; color: var(--text-muted); transition: color 0.15s, background 0.15s; }
    .mobile-menu-btn:hover { color: var(--text); background: var(--surface-high); }
    .mobile-menu-btn .material-symbols-outlined { font-size: 24px; }
    .mobile-new-chat-btn { padding: 8px; border-radius: 8px; color: var(--text-muted); transition: color 0.15s, background 0.15s; }
    .mobile-new-chat-btn:hover { color: var(--text); background: var(--surface-high); }
    .mobile-new-chat-btn .material-symbols-outlined { font-size: 24px; }
    .mobile-logo { font-size: 14px; color: var(--text); font-weight: 700; letter-spacing: 1px; }

    /* Sidebar as overlay */
    .sidebar {
        position: fixed; left: -100%; top: 0; height: 100%;
        z-index: 100; transition: left 0.3s ease; width: var(--sidebar-w) !important; min-width: var(--sidebar-w) !important;
    }
    .sidebar.mobile-open { left: 0; }
    .sidebar.collapsed { left: -100%; }

    /* Hide desktop sidebar toggle */
    .sidebar-toggle { display: none; }

    /* Main takes full width */
    .main { width: 100%; }

    /* Welcome screen */
    .welcome-heading { font-size: 32px; letter-spacing: -1.5px; margin-bottom: 8px; }
    .welcome-sub { font-size: 14px; margin-bottom: 24px; padding: 0 10px; }
    .welcome-screen { padding: 16px; align-items: flex-start; justify-content: flex-start; }
    .welcome-content { padding-top: 20px; }
    .suggestion-grid { grid-template-columns: 1fr; gap: 8px; padding-bottom: 40px; }
    .prompt-wrap-center { margin-bottom: 24px; }

    /* Messages */
    .messages-container { padding: 16px 12px 100px; gap: 20px; }
    .prompt-wrap-bottom { padding: 10px 12px 14px; position: relative; }
    .msg-bubble { max-width: 92%; font-size: 14px; }
    .msg-content { font-size: 14px; }
    .msg-content pre code { font-size: 12px; padding: 10px 12px; }

    /* Prompt box */
    .prompt-box { border-radius: 12px; padding: 10px; }
    .prompt-textarea { font-size: 14px; min-height: 44px; }
    .deepthink-btn span:last-child { display: none; }
    .deepthink-btn { padding: 6px 8px; }

    /* Auth */
    .auth-box { padding: 28px 20px; border-radius: 12px; }
    .auth-box h2 { font-size: 20px; }

    /* Modals */
    .modal { border-radius: 12px; }
    .modal-header { padding: 16px 18px 12px; }
    .modal-body { padding: 0 18px 12px; }
    .modal-footer { padding: 12px 18px 16px; }

    /* Chat menu always visible on touch */
    .chat-label .chat-menu-btn { opacity: 1; }
    .msg-user-actions { opacity: 1; }
    .msg-footer-actions { opacity: 1; }
    .thinking-block { padding: 6px 10px; margin-bottom: 10px; font-size: 13px; }
    .thinking-content { font-size: 11px; }
    .icon-btn { padding: 5px; }
    .icon-btn .material-symbols-outlined { font-size: 18px; }
}
