@import url('https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.12.0/styles/github-dark.min.css');

:root {
  color-scheme: dark;
  --bg: #1a1a1a;
  --surface: #222222;
  --surface-raised: #262626;
  --surface-hover: #303030;
  --surface-user: #292929;
  --border: #343434;
  --border-soft: #2b2b2b;
  --text: #f0efed;
  --text-strong: #faf9f7;
  --muted: #a09f9c;
  --faint: #73726f;
  --accent: #577ad9;
  --accent-hover: #6f8ee5;
  --accent-soft: rgba(87, 122, 217, .14);
  --danger: #e28b83;
  --shadow: 0 20px 60px rgba(0, 0, 0, .42);
  font-family: 'IBM Plex Sans', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f8f7f5;
  --surface: #efeeeb;
  --surface-raised: #fff;
  --surface-hover: #e7e5e1;
  --surface-user: #ecebe8;
  --border: #dedcd7;
  --border-soft: #e8e6e2;
  --text: #302f2d;
  --text-strong: #1f1e1c;
  --muted: #6f6d69;
  --faint: #888681;
  --accent: #577ad9;
  --accent-hover: #466acb;
  --accent-soft: rgba(87, 122, 217, .11);
  --danger: #a84c43;
  --shadow: 0 20px 60px rgba(42, 39, 32, .17);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); overflow: hidden; font-size: 14px; }
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.material-symbols-rounded { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 21px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-flex; white-space: nowrap; direction: ltr; font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-screen { min-height: 100%; display: grid; place-items: center; padding: 32px; position: relative; background: var(--bg); }
.auth-card { width: min(100%, 420px); padding: 38px 0 24px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; color: var(--text-strong); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 19px; }
.brand-name { font-weight: 600; letter-spacing: -.035em; font-size: 17px; }
.auth-copy { margin-top: 78px; }
.eyebrow { margin: 0 0 12px; text-transform: uppercase; letter-spacing: .13em; font-size: 10px; color: var(--muted); font-weight: 600; }
.auth-copy h1, .empty-state h1 { font: 500 52px/1.02 'Crimson Pro', serif; color: var(--text-strong); letter-spacing: -.025em; margin: 0; }
.auth-description { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 18px 0 0; max-width: 360px; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 550; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; text-decoration: none; }
.button:active, .icon-button:active, .new-chat-button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.button-subtle { color: var(--text); border-color: var(--border); background: transparent; }
.button-subtle:hover { background: var(--surface-hover); border-color: #4a4a4a; }
.login-button { width: 100%; margin-top: 30px; min-height: 46px; }
.auth-footnote { margin: 15px 0 0; color: var(--faint); text-align: center; font-size: 11px; }
.auth-corner-note { position: absolute; left: 30px; bottom: 24px; color: var(--faint); font-size: 11px; letter-spacing: .04em; }
.auth-error { border: 1px solid rgba(226, 139, 131, .35); border-radius: 8px; color: var(--danger); padding: 10px 12px; margin: 24px 0 -14px; font-size: 13px; line-height: 1.5; }

.app-shell { width: 100%; height: 100dvh; display: flex; background: var(--bg); }
.sidebar { width: 264px; flex: 0 0 264px; background: var(--surface); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; padding: 18px 12px 12px; position: relative; z-index: 20; transition: width .2s ease, flex-basis .2s ease, padding .2s ease; }
.sidebar-top { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; margin: 0 0 20px; }
.sidebar-brand .brand-mark { width: 25px; height: 25px; font-size: 17px; }
.sidebar-brand .brand-name { font-size: 15px; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; transition: color .15s ease, background .15s ease; }
.icon-button:hover { color: var(--text); background: var(--surface-hover); }
.icon-button .material-symbols-rounded { font-size: 20px; }
.small-icon { width: 28px; height: 28px; }
.small-icon .material-symbols-rounded { font-size: 18px; }
.new-chat-button { width: 100%; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; text-align: left; transition: background .16s ease, border-color .16s ease; }
.new-chat-button:hover { background: var(--surface-hover); border-color: #4a4a4a; }
.new-chat-button .material-symbols-rounded { color: var(--accent); font-size: 20px; }
.new-chat-shortcut { margin-left: auto; color: var(--faint); font-size: 10px; letter-spacing: .03em; }
.history-heading { display: flex; align-items: center; justify-content: space-between; padding: 25px 8px 8px; color: var(--faint); text-transform: uppercase; font-size: 10px; letter-spacing: .12em; font-weight: 600; }
.conversation-list { overflow: auto; flex: 1; padding: 0 2px 10px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.conversation-item { min-height: 36px; display: flex; align-items: center; gap: 4px; margin: 2px 0; padding: 0 4px 0 9px; color: var(--muted); border-radius: 7px; cursor: pointer; position: relative; }
.conversation-item:hover, .conversation-item.active { background: var(--surface-hover); color: var(--text); }
.conversation-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: 12px; }
.conversation-item-actions { display: none; align-items: center; gap: 1px; }
.conversation-item:hover .conversation-item-actions, .conversation-item.active .conversation-item-actions { display: flex; }
.conversation-item-actions .icon-button { width: 25px; height: 25px; }
.conversation-item-actions .material-symbols-rounded { font-size: 17px; }
.history-empty { color: var(--faint); font-size: 12px; line-height: 1.5; padding: 10px 8px; }
.sidebar-bottom { position: relative; border-top: 1px solid var(--border); padding-top: 9px; }
.sidebar-action { width: 100%; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 9px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 12px; cursor: pointer; text-align: left; }
.sidebar-action:hover { color: var(--text); background: var(--surface-hover); }
.sidebar-action .material-symbols-rounded { font-size: 19px; }
.account-row { position: relative; height: 49px; display: flex; align-items: center; gap: 9px; padding: 5px 4px 0; margin-top: 3px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; background: var(--surface-hover); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.account-name { color: var(--text); font-size: 12px; font-weight: 550; }
.account-caption { color: var(--faint); font-size: 10px; }
.account-menu { position: absolute; right: 4px; bottom: 46px; width: 148px; padding: 5px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); z-index: 3; }
.account-menu button { width: 100%; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--text); background: transparent; border: 0; border-radius: 5px; cursor: pointer; text-align: left; font-size: 12px; }
.account-menu button:hover { background: var(--surface-hover); }
.account-menu .material-symbols-rounded { font-size: 18px; }
.sidebar-collapsed .sidebar { width: 0; flex-basis: 0; padding-left: 0; padding-right: 0; overflow: hidden; border: 0; }
.sidebar-collapsed .expand-sidebar { display: inline-grid !important; }
.chat-main { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; position: relative; }
.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--border-soft); }
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar-title { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-brand, .mobile-menu-button { display: none; }
.model-badge { color: var(--muted); font-size: 10px; border: 1px solid var(--border); border-radius: 999px; padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-stage { flex: 1; overflow-y: auto; padding: 42px 28px 26px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.messages { max-width: 780px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.empty-state { min-height: min(100%, 470px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; margin: 0 auto; max-width: 620px; }
.empty-kicker { color: var(--accent); text-transform: uppercase; font-size: 10px; letter-spacing: .17em; font-weight: 600; }
.empty-state h1 { font-size: 48px; margin-top: 13px; }
.empty-state > p { color: var(--muted); margin: 13px 0 0; font-size: 13px; line-height: 1.7; }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.suggestions button { color: var(--muted); background: transparent; border: 1px solid var(--border); padding: 8px 11px; border-radius: 999px; font-size: 11px; cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.suggestions button:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.message { width: 100%; display: flex; flex-direction: column; animation: message-in .18s ease-out; }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.message.user { align-items: flex-end; }
.message.user .message-content { max-width: min(84%, 600px); background: var(--surface-user); border: 1px solid var(--border-soft); border-radius: 16px 16px 5px 16px; padding: 11px 15px; white-space: pre-wrap; line-height: 1.55; color: var(--text); }
.message.assistant { align-items: stretch; }
.message-tools { display: flex; gap: 3px; align-items: center; opacity: 0; min-height: 25px; transition: opacity .15s ease; margin: 2px 0 0; }
.message.assistant:hover .message-tools, .message-tools:focus-within { opacity: 1; }
.message-tools .icon-button { width: 27px; height: 27px; }
.message-tools .material-symbols-rounded { font-size: 17px; }
.message-content { color: var(--text); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: 0 0 14px; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4 { color: var(--text-strong); line-height: 1.3; margin: 20px 0 8px; font-weight: 600; }
.message-content h1 { font-size: 24px; }
.message-content h2 { font-size: 20px; }
.message-content h3 { font-size: 16px; }
.message-content ul, .message-content ol { padding-left: 23px; margin: 10px 0 16px; }
.message-content li { padding-left: 3px; margin: 4px 0; }
.message-content blockquote { border-left: 2px solid var(--accent); margin: 14px 0; padding: 2px 0 2px 14px; color: var(--muted); }
.message-content a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.message-content hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.message-content table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 12px; overflow-x: auto; display: block; }
.message-content th, .message-content td { border: 1px solid var(--border); text-align: left; padding: 7px 9px; }
.message-content th { background: var(--surface-raised); color: var(--text-strong); }
.message-content :not(pre) > code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #c7d3f8; font-size: .9em; background: var(--surface-raised); border: 1px solid var(--border-soft); border-radius: 4px; padding: 2px 5px; }
.code-block { position: relative; background: #161719; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin: 14px 0 17px; }
.code-header { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px 0 12px; color: #a8a8a5; background: #202123; border-bottom: 1px solid #303133; font-size: 10px; }
.code-header button { color: #a8a8a5; background: transparent; border: 0; border-radius: 5px; padding: 4px 6px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 10px; }
.code-header button:hover { color: #fff; background: #353638; }
.code-header .material-symbols-rounded { font-size: 15px; }
.code-block pre { margin: 0; padding: 13px 15px; overflow-x: auto; scrollbar-width: thin; }
.code-block code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.65; tab-size: 2; }
.thinking-details { margin: 0 0 12px; color: var(--muted); }
.thinking-details summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-size: 11px; list-style: none; user-select: none; }
.thinking-details summary::-webkit-details-marker { display: none; }
.thinking-details summary:hover { color: var(--text); }
.thinking-details summary .material-symbols-rounded { color: var(--accent); font-size: 16px; }
.thinking-copy { border-left: 1px solid var(--border); margin: 9px 0 2px 7px; padding: 1px 0 2px 12px; color: var(--muted); font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.tool-activity { display: flex; align-items: center; gap: 7px; color: var(--muted); background: transparent; border: 1px solid var(--border-soft); border-radius: 7px; padding: 7px 9px; margin: 2px 0 9px; width: fit-content; font-size: 11px; }
.tool-activity .material-symbols-rounded { font-size: 16px; color: var(--accent); }
.tool-activity.error { color: var(--danger); }
.typing-indicator { display: flex; gap: 4px; padding: 7px 0 0; }
.typing-indicator span { width: 5px; height: 5px; background: var(--muted); border-radius: 50%; animation: pulse 1.1s ease-in-out infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .15s; }
.typing-indicator span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-3px); } }
.stream-error { border-left: 2px solid var(--danger); color: var(--danger); padding: 8px 11px; font-size: 12px; margin-top: 8px; }
.notice-message { color: var(--muted); font-size: 11px; margin: 3px 0; }
.scroll-anchor { height: 1px; }

.composer-area { width: 100%; padding: 10px 24px 14px; background: linear-gradient(0deg, var(--bg) 80%, transparent); }
.composer-form { position: relative; width: min(100%, 800px); margin: 0 auto; padding: 12px 12px 9px 15px; border: 1px solid #424242; background: var(--surface-raised); border-radius: 13px; box-shadow: 0 8px 28px rgba(0,0,0,.15); transition: border-color .15s ease, box-shadow .15s ease; }
.composer-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.composer-form textarea { display: block; width: 100%; max-height: 180px; min-height: 28px; resize: none; border: 0; outline: 0; padding: 2px 0 6px; background: transparent; color: var(--text-strong); line-height: 1.55; font-size: 13px; }
.composer-form textarea::placeholder { color: var(--faint); }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-hints { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tool-mention-hint { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border: 0; background: transparent; color: var(--muted); border-radius: 5px; cursor: pointer; font-size: 10px; }
.tool-mention-hint:hover { color: var(--text); background: var(--surface-hover); }
.tool-mention-hint .material-symbols-rounded { color: var(--accent); font-size: 15px; }
.keyboard-hint { color: var(--faint); font-size: 9px; white-space: nowrap; }
kbd { font: inherit; border: 1px solid var(--border); border-radius: 3px; padding: 1px 3px; color: var(--muted); }
.send-button { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 8px; background: var(--accent); color: white; cursor: pointer; transition: background .14s ease, transform .14s ease; }
.send-button:hover { background: var(--accent-hover); }
.send-button:disabled { background: var(--surface-hover); color: var(--faint); cursor: not-allowed; }
.send-button .material-symbols-rounded { font-size: 19px; }
.stop-button { background: var(--surface-hover); color: var(--text); }
.stop-button:hover { background: var(--border); }
.composer-note { width: min(100%, 800px); color: var(--faint); font-size: 9px; text-align: center; margin: 8px auto 0; }
.mention-menu { position: absolute; left: 14px; bottom: calc(100% + 8px); z-index: 10; width: min(350px, calc(100% - 28px)); max-height: 230px; overflow: auto; padding: 5px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow); }
.mention-option { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 9px; text-align: left; color: var(--text); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.mention-option:hover, .mention-option[aria-selected='true'] { background: var(--surface-hover); }
.mention-option .material-symbols-rounded { color: var(--accent); font-size: 17px; }
.mention-option-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mention-option-title { font-size: 11px; font-weight: 550; }
.mention-option-detail { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings-dialog { width: min(660px, calc(100vw - 26px)); max-height: min(84vh, 820px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); }
.settings-dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(2px); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 16px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.dialog-header .eyebrow { margin-bottom: 4px; font-size: 9px; }
.dialog-header h2 { margin: 0; font: 500 27px/1 'Crimson Pro', serif; color: var(--text-strong); }
.dialog-body { max-height: calc(min(84vh, 820px) - 82px); overflow: auto; padding: 18px 22px 22px; }
.settings-section { padding: 3px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading-row h3, .settings-section h3 { margin: 0; color: var(--text-strong); font-size: 13px; font-weight: 600; }
.section-heading-row p, .settings-section > div > p { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 5px 0 0; max-width: 430px; }
.add-server-button { height: 34px; min-height: 34px; padding: 0 10px; white-space: nowrap; font-size: 11px; }
.add-server-button .material-symbols-rounded { font-size: 17px; }
.server-list { display: flex; flex-direction: column; gap: 7px; margin-top: 17px; }
.server-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 10px 10px 10px 12px; min-width: 0; }
.server-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.server-indicator.enabled { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.server-card-copy { flex: 1; min-width: 0; }
.server-card-name { color: var(--text-strong); font-size: 12px; font-weight: 550; }
.server-card-subtitle { color: var(--muted); font-size: 10px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card-actions { display: flex; align-items: center; gap: 2px; }
.server-card-actions .icon-button { width: 29px; height: 29px; }
.server-card-actions .material-symbols-rounded { font-size: 17px; }
.server-empty { text-align: center; padding: 22px 10px 4px; color: var(--muted); }
.server-empty .material-symbols-rounded { color: var(--accent); font-size: 22px; }
.server-empty p { font-size: 11px; margin: 7px 0 0; }
.server-editor-section { padding-top: 2px; }
.editor-heading { align-items: center; margin-bottom: 14px; }
.server-form { display: flex; flex-direction: column; gap: 12px; }
.server-form label:not(.check-row) { display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 11px; font-weight: 550; }
.server-form input:not([type='checkbox']), .server-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); padding: 9px 10px; font-size: 12px; outline: none; }
.server-form input:focus, .server-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.server-form textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.5; }
.server-form small { color: var(--faint); font-weight: 400; font-size: 10px; line-height: 1.4; }
.optional-label { color: var(--faint); font-size: 10px; font-weight: 400; }
.server-form code, .section-heading-row code { color: var(--text); background: var(--surface-hover); padding: 1px 4px; border-radius: 3px; font-size: .95em; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; cursor: pointer; }
.check-row input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.form-actions .button { min-height: 36px; font-size: 11px; }
.form-error, .test-result { color: var(--danger); background: rgba(226,139,131,.08); border-radius: 6px; padding: 8px 10px; font-size: 11px; margin: 0; line-height: 1.5; }
.test-result { color: var(--muted); background: var(--bg); border: 1px solid var(--border-soft); }
.test-result.success { color: var(--text); border-color: rgba(87,122,217,.45); }
.about-section { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.settings-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; padding-top: 12px; }
.settings-meta + .settings-meta { border-top: 1px solid var(--border-soft); margin-top: 10px; }
.settings-meta span:last-child { color: var(--text); }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); z-index: 100; padding: 9px 13px; color: var(--text); background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); font-size: 11px; max-width: calc(100vw - 32px); }
.drawer-shade { display: none; }

@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 85vw); flex-basis: auto; transform: translateX(-102%); transition: transform .22s ease; box-shadow: none; }
  .drawer-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  .drawer-shade { position: fixed; inset: 0; z-index: 15; border: 0; background: rgba(0,0,0,.5); display: none; }
  .drawer-open .drawer-shade { display: block; }
  .sidebar-collapsed .sidebar { width: min(290px, 85vw); flex-basis: auto; padding: 18px 12px 12px; border-right: 1px solid var(--border-soft); }
  .sidebar-collapse, .expand-sidebar { display: none !important; }
  .mobile-menu-button { display: inline-grid; }
  .mobile-brand { display: block; color: var(--text-strong); font-weight: 600; font-size: 13px; letter-spacing: -.03em; }
  .topbar-title { display: none; }
  .topbar { min-height: 54px; padding: 0 13px; }
  .topbar-leading, .topbar-actions { gap: 5px; }
  .model-badge { font-size: 9px; padding: 4px 7px; }
  .topbar-actions .icon-button { width: 32px; height: 32px; }
  .chat-stage { padding: 24px 16px 18px; }
  .empty-state { min-height: min(100%, 430px); padding: 15px 4px; }
  .empty-state h1 { font-size: 40px; }
  .empty-state > p { max-width: 300px; }
  .suggestions { gap: 6px; margin-top: 21px; }
  .suggestions button { font-size: 10px; padding: 7px 9px; }
  .messages { gap: 21px; }
  .message-tools { opacity: 1; }
  .message.user .message-content { max-width: 92%; }
  .message-content { font-size: 13px; }
  .composer-area { padding: 8px 10px 9px; }
  .composer-form { padding: 11px 10px 8px 12px; }
  .keyboard-hint { display: none; }
  .settings-dialog { width: min(calc(100vw - 12px), 660px); max-height: 90vh; border-radius: 11px; }
  .dialog-header { padding: 16px 16px 13px; }
  .dialog-body { max-height: calc(90vh - 70px); padding: 15px 16px 18px; }
  .section-heading-row { gap: 8px; }
  .section-heading-row p { max-width: 250px; }
}
@media (max-width: 380px) {
  .model-badge { display: none; }
  .topbar { padding: 0 8px; }
  .chat-stage { padding-left: 12px; padding-right: 12px; }
  .composer-hints { gap: 3px; }
  .tool-mention-hint { padding-left: 2px; }
  .tool-mention-hint span:last-child { font-size: 9px; }
  .add-server-button { padding: 0 8px; font-size: 10px; }
  .server-card { padding-left: 8px; padding-right: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
