/* Inter, self-hosted. Copyright (c) The Inter Project Authors.
   SIL Open Font License 1.1: see fonts/OFL.txt and fonts/README.md. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/InterVariable.woff2") format("woff2");
}

.new-chat-options { position: absolute; top: calc(60px + env(safe-area-inset-top, 0px)); right: 24px; z-index: 2; }
.temporary-toggle { display: flex; align-items: center; gap: 6px; margin: 0; min-height: 44px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.temporary-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.privacy-notice { margin: 3px 0; font-size: 11px; color: var(--muted); line-height: 1.35; }
.voice-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px; }
.voice-button svg { width: 22px; height: 22px; }
.voice-button[aria-pressed="true"] { color: #d33; background: #d331; }
.voice-recording-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.voice-stop { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; color: #b22; background: #d331; border: 1px solid currentColor; border-radius: 10px; font: inherit; font-size: 13px; cursor: pointer; }
.voice-stop svg { display: block; width: 18px; height: 18px; }
.voice-stop > span { display: inline-flex; }
.voice-stop:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 760px) {
  .new-chat-options { right: 12px; }
  .temporary-toggle { white-space: nowrap; line-height: 1.1; font-size: 12px; gap: 6px; }
  .temporary-toggle input { flex: 0 0 16px; width: 16px; height: 16px; }
  .topbar-right { gap: 3px; }
}
:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-optical-sizing: auto;
  color-scheme: light;
  --ink: #202329;
  --muted: #646b76;
  --canvas: #ffffff;
  --surface: #ffffff;
  --soft: #f5f6f8;
  --hover: #eceef2;
  --line: #e1e4e9;
  --input-border: #a0a6b0;
  --blue: #3055ca;
  --blue-dark: #2543a4;
  --button-bg: #3156cf;
  --button-hover: #2949b4;
  --button-ink: #ffffff;
  --accent-soft: #eaf0ff;
  --accent-border: #c8d4f6;
  --focus-border: #5475d5;
  --danger: #b22d3b;
  --danger-soft: #fff1f2;
  --danger-border: #e1afb6;
  --success: #347254;
  --warning: #765218;
  --warning-soft: #fff6e5;
  --backdrop: #171b2666;
  --shadow: #2026320b;
  --dialog-shadow: #0e172a26;
  --toast-bg: #252b36;
  --scrollbar: #b8bec8;
  --sidebar: 248px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eceef2;
  --muted: #a3abb9;
  --canvas: #17191e;
  --surface: #1d2027;
  --soft: #13151a;
  --hover: #292d36;
  --line: #343842;
  --input-border: #717986;
  --blue: #a6baff;
  --blue-dark: #c6d3ff;
  --button-bg: #4265da;
  --button-hover: #5073e8;
  --button-ink: #ffffff;
  --accent-soft: #27334e;
  --accent-border: #445883;
  --focus-border: #9bb2ff;
  --danger: #ffacb7;
  --danger-soft: #392329;
  --danger-border: #88525e;
  --success: #9ad2b3;
  --warning: #efd09a;
  --warning-soft: #342d22;
  --backdrop: #05070db3;
  --shadow: #00000020;
  --dialog-shadow: #00000080;
  --toast-bg: #354052;
  --scrollbar: #575f6d;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) { color-scheme: dark; --ink: #eceef2; --muted: #a3abb9; --canvas: #17191e; --surface: #1d2027; --soft: #13151a; --hover: #292d36; --line: #343842; --input-border: #717986; --blue: #a6baff; --blue-dark: #c6d3ff; --button-bg: #4265da; --button-hover: #5073e8; --button-ink: #ffffff; --accent-soft: #27334e; --accent-border: #445883; --focus-border: #9bb2ff; --danger: #ffacb7; --danger-soft: #392329; --danger-border: #88525e; --success: #9ad2b3; --warning: #efd09a; --warning-soft: #342d22; --backdrop: #05070db3; --shadow: #00000020; --dialog-shadow: #00000080; --toast-bg: #354052; --scrollbar: #575f6d; }
}

* { box-sizing: border-box; font-family: Inter, sans-serif; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, select, input, textarea, a, summary { outline-offset: 3px; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); }
a { color: var(--blue); text-decoration: none; }
svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
button svg, span[data-icon] { flex-shrink: 0; }
[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; }
h1, h2, h3, h4, p { margin: 0; }
.muted { color: var(--muted); line-height: 1.6; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 9px; color: var(--muted); }
.icon-button:hover { background: var(--hover); color: var(--ink); }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 10px 16px; border-radius: 9px; font-size: 13px; font-weight: 550; line-height: 1.4; text-align: center; }
.primary-button { background: var(--button-bg); color: var(--button-ink); }
.primary-button:hover { background: var(--button-hover); }
.secondary-button { background: var(--surface); border: 1px solid var(--line); }
.secondary-button:hover { background: var(--hover); }
.danger-button { color: var(--danger); border: 1px solid var(--danger-border); }
.text-button { min-height: 44px; padding: 8px 2px; color: var(--blue); font-size: 13px; font-weight: 550; }
.text-button:hover { color: var(--blue-dark); }
input, select, textarea { min-width: 0; color: var(--ink); }
input, select { width: 100%; min-height: 44px; padding: 11px 12px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); font-size: 14px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus { border-color: var(--focus-border); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--button-bg); flex-shrink: 0; }
select option { background: var(--surface); color: var(--ink); }
label { display: block; margin: 20px 0 8px; font-size: 13px; font-weight: 550; }
.field-help { margin: 7px 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.inline-error { padding: 11px 13px; margin: 14px 0; color: var(--danger); background: var(--danger-soft); border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
::selection { color: var(--ink); background: var(--accent-soft); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 23px; font-weight: 680; letter-spacing: -1px; line-height: 1; }
.brand-deepo { display: inline-block; font-family: Inter, sans-serif; font-weight: 300; letter-spacing: -.8px; line-height: 1; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 25px; height: 25px; flex: 0 0 25px; color: var(--ink); overflow: hidden; }
.brand-mark svg { display: block; width: 25px; height: 25px; }
.brand-mark svg path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.auth-brand .brand-mark svg path, .sidebar-brand .brand-mark svg path { transform: translate(0, 0); }

/* One full-height workspace. Only history and conversation scroll. */
.app{display:flex;position:fixed;top:var(--app-offset-top,0px);left:0;right:0;height:100vh;height:var(--app-height,100dvh);min-height:0;overflow:hidden}
.sidebar { width: var(--sidebar); flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; padding: max(20px, env(safe-area-inset-top)) 12px 0; background: var(--soft); border-right: 1px solid var(--line); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding: 0 10px; margin-bottom: 22px; }
.new-chat { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 550; text-align: left; }
.new-chat:hover { border-color: var(--input-border); }
.new-chat kbd { margin-left: auto; color: var(--muted); font: 11px Inter, sans-serif; }
.new-chat svg { width: 18px; height: 18px; }
.sidebar-section-head { display: flex; align-items: center; justify-content: space-between; margin: 27px 12px 9px; color: var(--muted); font-size: 12px; }
.count-badge { font-variant-numeric: tabular-nums; font-size: 11px; }
.chat-list { overflow: auto; min-height: 0; scrollbar-width: thin; overscroll-behavior: contain; }
.chat-row { display: flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 5px 0 11px; margin: 2px 0; border-radius: 8px; }
.chat-row:hover { background: var(--hover); }
.chat-row.active { background: var(--hover); }
.chat-open { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; min-height: 44px; padding: 10px 0; text-align: left; font-size: 13px; }
.chat-open > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-open svg { display: none; }
.chat-row .icon-button { width: 28px; height: 36px; opacity: 0; }
.chat-row .icon-button svg { width: 14px; height: 14px; }
.chat-row:hover .icon-button, .chat-row:focus-within .icon-button, .chat-row.active .icon-button { opacity: 1; }
.sidebar-empty { padding: 19px 12px; color: var(--muted); }
.sidebar-empty p { margin-bottom: 6px; font-size: 13px; }
.sidebar-empty span { font-size: 12px; line-height: 1.6; }
.load-chats { margin: 8px 0; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; flex-shrink: 0; }
.sidebar-link { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: var(--muted); text-align: left; font-size: 13px; }
.sidebar-link:hover { color: var(--ink); background: var(--hover); }
.sidebar-link > span:nth-child(2) { flex: 1; }
.sidebar-link svg { width: 18px; height: 18px; }
.sidebar-link > span:last-child svg { width: 14px; height: 14px; }
.user-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 14px 8px calc(16px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.user-avatar { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; color: var(--ink); background: var(--hover); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.user-row > div { flex: 1; min-width: 0; }
.user-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; }
.user-row > div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.user-row .icon-button { width: 32px; }
.workspace { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--canvas); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; height: calc(60px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 24px 0; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow: hidden; }
.current-chat-title { flex: 0 1 auto; min-width: 0; max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.topbar-left > .icon-button { flex-shrink: 0; }
@media (min-width: 761px) { .app.sidebar-collapsed > .sidebar { display: none; } }
@media (max-width: 760px) { .desktop-only { display: none !important; } .current-chat-title { max-width: 30%; flex-shrink: 1; font-size: 12px; } }
.model-select-wrap { display: flex; align-items: center; position: relative; min-width: 0; max-width: min(420px, 100%); border-radius: 8px; }
.header-project { flex: 0 1 180px; min-width: 70px; max-width: 200px; }
.header-project select { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 0; background: transparent; color: var(--ink); font-size: 13px; text-overflow: ellipsis; cursor: pointer; }
@media (max-width: 760px) { .header-project { flex: 1 1 85px; min-width: 64px; max-width: 32%; } .header-project select { font-size: 16px; padding: 4px; } }
.model-select-wrap:hover { background: var(--soft); }
.model-select-wrap > div { min-width: 0; width: 100%; }
.model-select-wrap select { appearance: none; min-height: 44px; width: 100%; max-width: 420px; padding: 10px 28px 10px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.5; text-overflow: ellipsis; cursor: pointer; }
.select-chevron { position: absolute; right: 8px; pointer-events: none; color: var(--muted); }
.select-chevron svg { width: 14px; height: 14px; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sync-status { display: flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.sync-status i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.sync-status.offline i { background: var(--warning); }
.sync-status.busy i { background: var(--blue); }
.theme-toggle { color: var(--muted); font-size: 21px; }
.theme-toggle[aria-pressed="true"] { color: var(--blue); }
.settings-theme-toggle { font-size: 13px; margin: 0 8px 8px 0; }
.connection-banner { flex-shrink: 0; padding: 8px 24px; color: var(--warning); background: var(--warning-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.demo-banner { max-height: 72px; overflow-y: auto; color: var(--muted); background: var(--soft); border-bottom: 1px solid var(--line); }
.conversation { flex: 1; min-height: 0; overflow: auto; padding: 0 28px; position: relative; overscroll-behavior: contain; scroll-behavior: auto; scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
.welcome { width: min(720px, 100%); margin: auto; padding: clamp(40px, 14vh, 140px) 0 32px; text-align: center; }
.welcome h1 { font-size: 24px; line-height: 1.3; letter-spacing: -.6px; font-weight: 580; }
.welcome > p { max-width: 360px; margin: 12px auto 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.empty-setup { margin-top: 20px; }
.empty-setup .secondary-button { border-color: var(--input-border); }
.messages { width: min(720px, 100%); margin: 0 auto; padding: 32px 0 20px; }
.messages:empty { display: none; }
.message { display: flex; align-items: flex-start; gap: 12px; min-width: 0; margin-bottom: 32px; }
.message-avatar { display: flex; align-items: center; justify-content: center; width: 27px; height: 27px; flex-shrink: 0; color: var(--ink); font-size: 11px; font-weight: 600; }
.message-avatar svg { width: 22px; height: 25px; }
.message-body { min-width: 0; flex: 1; }
.message-head { display: flex; align-items: center; gap: 10px; min-height: 25px; margin-bottom: 8px; }
.message-author { font-size: 12px; font-weight: 600; }
.message-time { color: var(--muted); font-size: 11px; }
.message-content { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 16px; line-height: 1.75; }
.message.user { width: fit-content; max-width: 88%; margin-left: auto; padding: 12px 17px 14px; border-radius: 16px; background: var(--soft); }
.message.user .message-avatar { display: none; }
.message.user .message-head { margin-bottom: 4px; }
.message.user .message-content { line-height: 1.65; }
.message pre { max-width: 100%; overflow: auto; margin: 14px 0; padding: 12px 16px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); white-space: pre; font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.message code { font: inherit; }
.code-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font: 11px Inter, sans-serif; }
.message-footer { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.message-footer .icon-button { width: 36px; height: 36px; margin-left: -8px; }
.message-footer svg { width: 16px; height: 16px; }
.message-error { margin-top: 12px; padding: 11px 13px; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.sources { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.sources a { display: flex; align-items: center; gap: 5px; max-width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); font-size: 12px; overflow-wrap: anywhere; }
.sources a:hover { background: var(--soft); }
.sources svg { width: 13px; height: 13px; }
.typing { display: flex; align-items: center; gap: 4px; padding: 8px 0; color: var(--muted); font-size: 12px; }
.typing span { width: 4px; height: 4px; background: var(--muted); border-radius: 50%; animation: pulse 1.6s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
.typing em { margin-left: 6px; font-style: normal; }
.load-messages { display: flex; margin: 20px auto 0; }

/* A stable writing surface, with a separate single row for tools. */
.composer-dock { flex-shrink: 0; padding: 12px 28px calc(16px + var(--safe-bottom)); background: var(--canvas); }
.composer { width: 100%; max-width: 768px; margin: 0 auto; border: 1px solid var(--input-border); border-radius: 18px; background: var(--surface); box-shadow: 0 3px 12px var(--shadow); }
.composer:focus-within { border-color: var(--focus-border); }
textarea{display:block;resize:none;border:0;width:100%;max-height:280px;background:transparent;padding:16px 18px 12px;font-size:16px;line-height:1.5;min-height:96px;scrollbar-width:thin;overflow-y:hidden;overscroll-behavior:contain;border-radius:17px 17px 0 0}
textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
textarea:disabled { color: var(--muted); }
.composer-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 10px 10px; min-height: 56px; }
.composer-options { display: flex; align-items: center; flex-wrap: nowrap; gap: 5px; min-width: 0; }
.option-button { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 9px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.option-button svg { width: 18px; height: 18px; }
.option-button:hover { background: var(--soft); }
.option-button[aria-pressed="true"] { color: var(--blue); background: var(--accent-soft); border-color: var(--accent-border); }
.reasoning-wrap { display: flex; align-items: center; gap: 3px; min-width: 0; max-width: 210px; color: var(--muted); }
.reasoning-wrap svg { width: 16px; height: 16px; }
.reasoning-wrap select { min-height: 44px; padding: 9px 2px; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-overflow: ellipsis; }
.composer-send { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.composer-hint { color: var(--muted); font-size: 11px; }
.send-button{width:44px;height:44px;min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;border-radius:12px;background:var(--button-bg);color:var(--button-ink);touch-action:manipulation}
.send-button:hover { background: var(--button-hover); }
.send-button:disabled { opacity: 1; background: var(--hover); color: var(--muted); }
.send-button svg { width: 21px; height: 21px; }
.stop-button svg { width: 15px; height: 15px; }
.privacy-note { max-width: 768px; margin: 9px auto 0; text-align: center; font-size: 11px; line-height: 1.5; color: var(--muted); }
.retry-notice { max-width: 768px; margin: 0 auto 10px; padding: 10px 13px; border-radius: 8px; color: var(--warning); background: var(--warning-soft); font-size: 12px; line-height: 1.6; }
.retry-notice .text-button { padding: 4px 0; }

/* Settings use one reading column; editing temporarily replaces the list. */
.settings-dialog { width: min(820px, calc(100vw - 40px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); color: var(--ink); box-shadow: 0 20px 80px var(--dialog-shadow); }
.settings-dialog::backdrop, .small-dialog::backdrop { background: var(--backdrop); }
.settings-shell { display: flex; flex-direction: column; max-height: calc(100dvh - 50px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.settings-layout { display: flex; min-height: 390px; min-width: 0; overflow: hidden; }
.settings-nav { width: 172px; flex-shrink: 0; padding: 16px 10px; border-right: 1px solid var(--line); background: var(--soft); }
.settings-nav button { display: flex; align-items: center; gap: 9px; min-height: 44px; width: 100%; margin: 0 0 4px; padding: 10px; border-radius: 8px; color: var(--muted); text-align: left; font-size: 13px; }
.settings-nav button.selected { background: var(--hover); color: var(--ink); font-weight: 550; }
.settings-nav button:hover { background: var(--hover); }
.settings-nav svg { width: 17px; height: 17px; }
.settings-content { flex: 1; min-width: 0; overflow: auto; padding: 26px; overscroll-behavior: contain; scrollbar-width: thin; }
.settings-content h3 { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.3px; }
.settings-content h4 { font-size: 14px; font-weight: 600; line-height: 1.5; }
.settings-content p.muted { margin: 8px 0 22px; font-size: 13px; }
.settings-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.settings-section-title p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-section-title button { padding: 9px 12px; }
.settings-section-title button svg { width: 17px; height: 17px; }
.settings-empty { padding: 22px 0; }
.settings-empty p { max-width: 360px; margin: 9px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.security-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.security-note svg { width: 14px; height: 14px; margin-top: 3px; }
.provider-card { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.provider-card:first-child { padding-top: 0; }
.provider-card-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; color: var(--muted); background: var(--soft); }
.provider-card-icon svg { width: 18px; height: 18px; }
.provider-card-info { min-width: 0; flex: 1; }
.provider-card-info strong { display: block; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.provider-card-info p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.key-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--success); font-size: 11px; line-height: 1.5; }
.key-badge svg { width: 12px; height: 12px; }
.provider-card .icon-button { width: 36px; height: 44px; }
.provider-card .icon-button svg { width: 17px; height: 17px; }
.provider-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -5px 0 4px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.label-aside { margin-left: 4px; color: var(--success); font-size: 11px; font-weight: 400; }
.model-rows-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.model-row { margin: 8px 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.model-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 44px; font-size: 12px; color: var(--ink); }
.model-row[open] { padding-bottom: 12px; }
.model-row-head { cursor: pointer; list-style: none; }
.model-row-head::-webkit-details-marker { display: none; }
.model-row-head > span { flex: 1; overflow-wrap: anywhere; }
.model-row-head > svg { width: 14px; height: 14px; }
.model-row[open] > .model-row-head > svg { transform: rotate(180deg); }
.model-row-head .icon-button { width: 36px; height: 44px; }
.model-row-head svg { width: 15px; height: 15px; }
.model-row label { margin-top: 12px; font-size: 12px; }
.model-row input, .model-row select { font-size: 13px; }
.model-row .form-grid { gap: 10px; }
.model-advanced { margin-top: 12px; }
.model-advanced summary { min-height: 44px; padding: 12px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.model-advanced[open] summary { color: var(--ink); }
.provider-form > .primary-button { width: 100%; margin-top: 18px; }
.telegram-status-copy { margin: 14px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.telegram-link-info { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.telegram-link-info > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.code-row code { min-width: 0; overflow-wrap: anywhere; font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.telegram-link-info .primary-button { margin: 8px 0 12px; }
.account-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px 0; margin: 18px 0 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-card > svg { color: var(--muted); }
.account-card > div { min-width: 0; }
.account-card span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.account-card strong { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.settings-notice, .secure-storage-setup { width: 100%; padding: 15px; margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.settings-notice strong, .secure-storage-setup h4 { font-size: 14px; }
.settings-notice p, .secure-storage-setup p { margin-top: 8px; color: var(--muted); line-height: 1.6; font-size: 13px; overflow-wrap: anywhere; }
.settings-notice button, .secure-storage-setup .primary-button { margin-top: 12px; }
.small-dialog { padding: 0; width: min(420px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 80px var(--dialog-shadow); }
.small-dialog form { padding: 0 20px 20px; }
.small-dialog .dialog-header { padding: 14px 0; border: 0; }
.small-dialog h2 { font-size: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 20px; gap: 8px; }
#telegram-confirm-dialog { padding: 0 20px 20px; }
#telegram-confirm-dialog p { line-height: 1.65; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 100; bottom: calc(24px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); max-width: min(520px, calc(100vw - 28px)); padding: 12px 18px; border-radius: 10px; color: var(--button-ink); background: var(--toast-bg); box-shadow: 0 6px 20px var(--shadow); font-size: 13px; line-height: 1.6; text-align: center; }
.boot-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); background: var(--canvas); font-size: 13px; }

/* Authentication is a compact form, with no promotional side panel. */
.auth-screen { min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
.auth-form-side { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: 96px 24px 72px; position: relative; }
.auth-form-wrap { width: 100%; max-width: 360px; }
.auth-brand { margin-bottom: 36px; font-size: 26px; }
.auth-form-wrap > h1 { font-size: 26px; font-weight: 600; letter-spacing: -.7px; line-height: 1.3; }
.auth-form-wrap > .muted { margin: 10px 0 26px; font-size: 14px; }
.auth-form-wrap input { min-height: 48px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.password-wrap .icon-button { position: absolute; top: 2px; right: 3px; width: 44px; height: 44px; }
.password-wrap .icon-button svg { width: 18px; height: 18px; }
.auth-submit { width: 100%; justify-content: space-between; min-height: 48px; margin-top: 24px; font-size: 14px; }
.auth-switch { margin-top: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.auth-switch button { margin-left: 4px; }
.auth-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.auth-note svg { width: 15px; height: 15px; margin-top: 2px; }
.auth-note p { font-size: 12px; line-height: 1.7; }
.auth-theme-toggle { position: absolute; top: max(20px, env(safe-area-inset-top)); right: max(24px, env(safe-area-inset-right)); font-size: 12px; background: var(--canvas); }
.auth-copyright { position: absolute; bottom: max(24px, var(--safe-bottom)); color: var(--muted); font-size: 12px; }
.mobile-only { display: none !important; }
.sidebar-backdrop { display: none; }

/* Private media never creates a public URL. */
.attachments-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; max-height: 220px; overflow: auto; overscroll-behavior: contain; margin: 0; padding: 12px 14px 0; }
.attachments-list:empty { display: none; }
.attachment-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.attachment-card > div, .attachment-info { min-width: 0; }
.attachment-preview { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; overflow: hidden; border-radius: 6px; background: var(--hover); color: var(--muted); }
.attachment-preview img, .attachment-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-card .attachment-preview figcaption { display: none; }
.attachment-name, .attachment-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; line-height: 1.5; }
.attachment-status { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.attachment-card[data-status="error"] .attachment-status { color: var(--danger); }
.attachment-card[data-status="error"] { border-color: var(--danger-border); }
.attachment-card .icon-button { width: 36px; height: 44px; }
.attachment-card > .text-button { grid-column: 2; justify-self: start; }
.attachment-progress { display: block; grid-column: 1 / -1; width: 100%; min-width: 0; height: 4px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); accent-color: var(--button-bg); }
.attachment-progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.attachment-progress::-webkit-progress-value, .attachment-progress::-moz-progress-bar { background: var(--button-bg); border-radius: 99px; }
.attachment-help { max-width: 768px; margin: 8px auto 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.attachment-help:empty { display: none; }
.composer.is-dragging, .composer.drag-over { border-color: var(--blue); background: var(--accent-soft); }
.message-attachments { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; min-width: 0; max-width: 100%; margin-top: 10px; }
.message-attachments > * { min-width: 0; max-width: 100%; }
.message-attachments .attachment-preview { display: block; width: min(360px, 100%); height: auto; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.message-attachments .attachment-preview img, .message-attachments .attachment-preview video { display: block; width: 100%; height: auto; max-width: 100%; max-height: 420px; object-fit: contain; }
.message-attachments figcaption { padding: 7px 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.media-error { margin: 8px 10px 0; font-size: 12px; }

/* Catalog and optional model capabilities stay in the settings scroll area. */
.model-discovery { min-width: 0; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.model-discovery > label { margin-top: 0; }
.discover-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; min-width: 0; }
.discover-toolbar .field-help { flex-basis: 100%; margin: 0; }
.discovery-list { display: grid; gap: 6px; max-height: 280px; overflow: auto; overscroll-behavior: contain; margin: 10px 0; padding: 2px; scrollbar-width: thin; }
.discovery-item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; margin: 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.discovery-item:focus-within { border-color: var(--focus-border); }
.discovery-item > span { min-width: 0; flex: 1; }
.discovery-item input { margin: 2px 0 0; }
.discovery-item strong { display: block; font-size: 13px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.discovery-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.capability-flags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; }
.capability-flags label { display: flex; align-items: center; gap: 7px; min-height: 44px; margin: 0; color: var(--ink); }

@keyframes pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@media (max-width: 1100px) {
  .sync-status span { display: none; }
  .sync-status { padding: 0 2px; }
  .topbar { padding-left: 18px; padding-right: 18px; }
  .conversation { padding-left: 22px; padding-right: 22px; }
  .composer-dock { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-flex !important; }
  .sidebar { position: fixed; left: 0; top: var(--app-offset-top, 0px); z-index: 20; width: min(304px, calc(100vw - 24px)); height: var(--app-height, 100dvh); padding-top: max(12px, env(safe-area-inset-top)); transform: translateX(-100%); transition: transform .18s ease; box-shadow: 8px 0 30px var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 19; background: var(--backdrop); }
  .sidebar-brand { margin-bottom: 16px; }
  .chat-row .icon-button { width: 44px; height: 44px; opacity: 1; }
  .chat-row .icon-button svg { width: 16px; height: 16px; }
  .user-row .icon-button { width: 44px; height: 44px; }
  .topbar { height: calc(58px + env(safe-area-inset-top, 0px)); min-height: 58px; gap: 4px; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .topbar-left { min-width: 0; flex: 1; gap: 2px; }
  .model-select-wrap { min-width: 0; flex: 1; }
  .model-select-wrap select { width: 100%; max-width: 100%; padding-left: 6px; }
  .topbar-right { gap: 0; }
  .topbar-right .theme-toggle, .topbar-right .sync-status { display: none; }
  .connection-banner { padding: 7px 16px; font-size: 11px; }
  .conversation { padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .welcome { padding-top: clamp(30px, 12vh, 96px); }
  .welcome h1 { font-size: 22px; }
  .welcome > p { font-size: 13px; max-width: 280px; }
  .messages { padding: 24px 0 8px; }
  .message { gap: 9px; margin-bottom: 28px; }
  .message-avatar { width: 22px; }
  .message-avatar svg { width: 20px; height: 23px; }
  .message-content { font-size: 16px; line-height: 1.7; }
  .message.user { max-width: 93%; padding: 11px 14px 13px; border-radius: 14px; }
  .message-head { margin-bottom: 6px; }
  .message pre { padding-left: 11px; padding-right: 11px; font-size: 12px; }
  .message-footer .icon-button, .code-header .icon-button { width: 44px; height: 44px; }
  .settings-dialog { width: 100%; height: var(--app-height, 100dvh); max-height: var(--app-height, 100dvh); max-width: 100%; margin: 0; top: var(--app-offset-top, 0px); border: 0; border-radius: 0; }
  .settings-shell { height: 100%; max-height: none; }
  .dialog-header { padding: max(8px, env(safe-area-inset-top)) 16px 8px; min-height: 60px; }
  .dialog-header .icon-button { width: 44px; height: 44px; }
  .settings-layout { flex-direction: column; flex: 1; min-height: 0; }
  .settings-nav { display: flex; gap: 2px; width: 100%; padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
  .settings-nav button { justify-content: center; gap: 6px; min-width: 0; margin: 0; padding: 10px 6px; font-size: 12px; }
  .settings-nav svg { width: 16px; height: 16px; }
  .settings-content { min-height: 0; padding: 22px max(18px, env(safe-area-inset-right)) calc(24px + var(--safe-bottom)) max(18px, env(safe-area-inset-left)); }
  .settings-section-title { gap: 10px; }
  .settings-section-title p { font-size: 11px; }
  .settings-section-title button { gap: 5px; padding: 8px 10px; font-size: 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .model-row .form-grid { gap: 0; }
  input, select, .model-row input, .model-row select { font-size: 16px; }
  .provider-card-icon { display: none; }
  .provider-card .icon-button { width: 44px; height: 44px; }
  .attachments-list { grid-template-columns: 1fr; max-height: 150px; padding: 10px 10px 0; }
  .message-attachments .attachment-preview img, .message-attachments .attachment-preview video { max-height: 300px; }
  .model-discovery { padding: 12px; }
  .auth-form-side { padding: 104px 24px 72px; }
  .auth-brand { margin-bottom: 30px; }
}

/* Keep one compact tools row below a readable, expanding writing area. */
@media (max-width: 760px), (pointer: coarse) {
  .composer-dock { padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + var(--safe-bottom)) max(10px, env(safe-area-inset-left)); }
  .composer-controls { padding: 2px 8px 8px; align-items: center; gap: 8px; }
  .composer-options { flex: 1; flex-wrap: nowrap; gap: 4px; }
  .option-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px; }
  .option-button svg { width: 20px; height: 20px; }
  .option-button > span:last-child { display: none; }
  #voice-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; }
  #voice-button > svg { display: block; width: 22px; height: 22px; visibility: visible; }
  .reasoning-wrap { position: relative; flex: 0 0 48px; width: 48px; height: 44px; justify-content: center; }
  .reasoning-wrap > span { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; pointer-events: none; z-index: 1; color: var(--muted); }
  .reasoning-wrap > span svg { width: 21px; height: 21px; }
  .reasoning-wrap select { position: absolute; inset: 0; z-index: 2; width: 48px; min-width: 48px; max-width: 48px; height: 44px; min-height: 44px; padding: 0; opacity: 0; cursor: pointer; }
  .composer-hint { display: none; }
  .send-button svg { width: 21px; height: 21px; }
  .stop-button svg { width: 17px; height: 17px; }
  .privacy-note { font-size: 10px; margin-top: 6px; line-height: 1.4; }
  .topbar .icon-button, .attachment-card .icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .model-select-wrap select { font-size: 16px; }
}
@media (max-width: 360px) {
  .conversation { padding-left: 12px; padding-right: 12px; }
  .settings-content { padding-left: 14px; padding-right: 14px; }
  .settings-nav { padding-left: 8px; padding-right: 8px; }
  .settings-nav button { font-size: 11px; }
  .composer textarea { padding-left: 14px; padding-right: 14px; }
}
/* Leave room for the native keyboard without changing draft nodes or zoom. */
html[data-compact-viewport="true"] textarea { min-height: 72px; padding-top: 12px; padding-bottom: 12px; }
html[data-compact-viewport="true"] .topbar { height: 52px; min-height: 52px; padding-top: 0; }
html[data-compact-viewport="true"] .composer-dock { flex-shrink: 1; min-height: 0; padding-top: 4px; padding-bottom: max(4px, var(--safe-bottom)); max-height: calc(var(--app-height, 100dvh) - 60px); overflow-y: auto; overscroll-behavior: contain; }
html[data-compact-viewport="true"] .composer-controls { padding-bottom: 4px; }
html[data-compact-viewport="true"] .privacy-note { margin-top: 4px; }
html[data-compact-viewport="true"] .attachments-list { max-height: 70px; }
html[data-compact-viewport="true"] .media-error,
html[data-compact-viewport="true"] .attachment-help,
html[data-compact-viewport="true"] .retry-notice,
html[data-compact-viewport="true"] .connection-banner { max-height: 44px; overflow-y: auto; }
html[data-compact-viewport="true"] .welcome { padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.telegram-admin-section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.telegram-admin-section form > button { margin-top: 8px; }
.telegram-admin-webhook { margin-top: 22px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.telegram-admin-webhook > span { color: var(--muted); font-size: 12px; }
.telegram-admin-webhook p { margin-top: 7px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.telegram-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
@media (max-width: 760px) { .telegram-admin-actions > button, .telegram-admin-section form > button { width: 100%; } }

.message-generation { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: -2px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.generation-model { font-weight: 500; }
.generation-effort { font-variant-numeric: tabular-nums; }
.server-limits { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Answer identity is intentionally just the immutable model name. */
.message.assistant { display: block; }
.message.assistant .message-head { margin-bottom: 7px; min-height: 18px; }
.message.assistant .message-author { font-size: 12px; color: var(--muted); font-weight: 550; }

.telegram-command-reference { margin: 24px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.telegram-command-reference h4 { margin-bottom: 10px; }
.telegram-command-reference ul { padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.telegram-command-reference code { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
#telegram-owner-check { margin: 16px 0; }
#telegram-owner-check .secondary-button { margin-top: 8px; }

/* Project folders and per-chat context stay outside the writing surface. */
.sidebar-section-head { margin-top: 14px; margin-bottom: 3px; }
.sidebar-section-head .icon-button { width: 36px; height: 36px; }
.project-group { border-bottom: 1px solid var(--line); padding: 3px 0; }
.project-summary { display: flex; align-items: center; min-height: 44px; gap: 2px; cursor: pointer; padding-left: 8px; list-style: none; }
.project-summary::-webkit-details-marker { display: none; }
.project-summary > span:first-child { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 13px; font-weight: 550; }
.project-actions { display: flex; }
.project-actions .icon-button { width: 30px; height: 40px; }
.project-actions svg { width: 15px; height: 15px; }
.project-chats { padding-left: 8px; }
.group-label { padding: 14px 12px 6px; font-size: 11px; color: var(--muted); }
.project-new-chat { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; text-align: left; }
.project-new-chat:hover { background: var(--hover); color: var(--ink); }
.project-new-chat svg { width: 16px; height: 16px; order: -1; }
#chat-settings-context { overflow-wrap: anywhere; }
.chat-context { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.chat-context label { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; }
.chat-context select { flex-basis: 100%; width: 100%; min-height: 44px; padding: 8px 10px; font-size: 14px; }
.chat-context .secondary-button { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.checkbox-line { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 8px 0; overflow-wrap: anywhere; }
.files-dialog { width: min(860px, calc(100vw - 32px)); padding: 0 20px 20px; max-height: calc(100dvh - 40px); overflow-y: auto; }
.files-dialog .dialog-header { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.files-dialog form { padding: 0; }
.files-list { display: grid; gap: 4px; max-height: 200px; overflow: auto; margin-top: 12px; }
.file-entry { text-align: left; min-height: 44px; padding: 8px; border-radius: 6px; overflow-wrap: anywhere; color: var(--blue); background: var(--soft); }
#file-content { border: 1px solid var(--input-border); border-radius: 8px; min-height: 220px; max-height: 50vh; overflow: auto; resize: vertical; font: 13px/1.6 ui-monospace, monospace; margin-bottom: 12px; }
#connector-preview { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 ui-monospace, monospace; }
#connector-form { margin-top: 24px; }
@media (max-width: 760px) {
  .chat-context select { min-width: 0; font-size: 16px; }
  .chat-context .secondary-button { flex: 1; }
  .settings-nav { overflow-x: auto; flex-shrink: 0; }
  .settings-nav button { flex-shrink: 0; width: auto; }
  .project-actions .icon-button { width: 36px; min-height: 44px; }
}
