:root {
  color-scheme: light;
  --background: #ffffff; --sidebar: #f7f8fa; --text: #24262b; --muted: #777d87;
  --line: #e9ebef; --hover: #edf0f4; --accent: #217768; --accent-soft: #e9f3ef;
  --danger: #b84040; --blue: #517cb6; --orange: #bd8651;
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "PingFang SC", sans-serif;
  font-size: 14px; letter-spacing: 0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--background); color: var(--text); }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: 2px solid #c3ded5; outline-offset: 1px; }
input, textarea, select { width: 100%; color: var(--text); background: #fff; border: 1px solid #dfe3e8; border-radius: 8px; padding: 11px 12px; }
textarea { resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #a0a5ad; }
label { display: grid; gap: 8px; font-size: 13px; }
svg { width: 19px; height: 19px; stroke-width: 1.7; flex: 0 0 auto; }
.icon-button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 8px; color: #737983; flex: 0 0 auto; }
.icon-button:hover { background: var(--hover); color: var(--text); }
.icon-button.small { width: 28px; height: 28px; }
.icon-button.small svg { width: 16px; height: 16px; }
.solid-button, .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.solid-button { background: #282b30; border: 1px solid #282b30; color: #fff; }
.solid-button:hover { background: #41454d; }
.outline-button { background: #fff; border: 1px solid var(--line); }
.outline-button:hover { background: var(--sidebar); }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; font-size: 12px; }
.text-button:hover { color: var(--accent); }
.danger-text { color: var(--danger); }
.muted { color: var(--muted); line-height: 1.6; font-size: 13px; }
.app-mark { width: 31px; height: 31px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 8px; }
.app-mark.large { width: 48px; height: 48px; margin: 0 auto 18px; }
.app-mark.large svg { width: 27px; height: 27px; }
.app-mark img, .welcome-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.model-toolbar { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 44px; padding: 4px 20px; border-bottom: 1px solid var(--line); }
.model-toolbar label { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.model-toolbar label svg { width: 15px; height: 15px; }
.model-toolbar select { width: 210px; max-width: 55%; min-width: 0; height: 32px; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.model-toolbar > span { font-size: 11px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.draft-photo { display: flex; align-items: flex-start; gap: 8px; padding: 8px; }
.draft-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.chat-photo { border: 0; padding: 0; background: transparent; display: block; margin-bottom: 8px; }
.chat-photo img { max-width: 100%; width: 200px; max-height: 240px; object-fit: contain; border-radius: 6px; }
.photo-preview { display: block; width: 100%; height: min(32dvh, 240px); object-fit: contain; margin: 8px 0 20px; }
.photo-dialog form { display: grid; gap: 8px; }
.call-dialog { border: 0; margin: 0; padding: 24px; width: 100%; max-width: none; height: 100dvh; max-height: none; background: #fcfdfd; color: var(--text); }
.call-dialog[open] { display: flex; flex-direction: column; }
.call-heading { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.call-heading span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.call-portrait { width: 108px; height: 108px; object-fit: cover; border-radius: 50%; flex: 0 0 auto; }
.call-body h2 { font-size: 20px; margin: 0; }
  .call-transcript { width: min(580px, 100%); max-height: 35dvh; overflow: auto; text-align: center; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
  .call-retry { margin-top: 4px; }
  .storage-section { border-top: 1px solid var(--line); padding: 16px 0; }
  .storage-heading, .storage-disk-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .storage-heading h3 { margin: 0; font-size: 14px; }
  .storage-disk-heading { margin-top: 12px; font-size: 12px; flex-wrap: wrap; }
  .storage-section progress { display: block; width: 100%; height: 8px; margin: 12px 0; accent-color: #318269; }
  .storage-section progress[hidden] { display: none; }
  .storage-section progress.danger { accent-color: #b63737; }
  .storage-details { margin: 14px 0; font-size: 13px; }
  .storage-details > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
  .storage-details dt { color: var(--muted); }
  .storage-details dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .storage-meta { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 5px 0; overflow-wrap: anywhere; }
  .storage-warning { font-size: 12px; line-height: 1.6; color: #a43a28; }
#callUserText { color: var(--muted); }
.call-controls { display: flex; justify-content: center; gap: 24px; padding: 20px 0 max(20px, env(safe-area-inset-bottom)); }
.call-control { width: 52px; height: 52px; display: grid; place-items: center; background: #edf1f2; border: 0; border-radius: 50%; }
.call-control[aria-pressed=true] { background: #f5dfde; color: #ad3939; }
.call-control.hangup { background: #c94646; color: white; }
.call-control svg { width: 23px; height: 23px; }
.composer-tools { min-width: 0; }
@media (max-width: 480px) {
  .composer-tools .icon-button { width: 32px; height: 32px; }
  .composer-tools .scope-label { display: none; }
}
@media (max-width: 480px) {
  .model-toolbar { padding: 4px 12px; gap: 6px; flex-wrap: wrap; }
  .model-toolbar > span:not(:empty) { width: 100%; }
}
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 28px; background: #fafbfc; }
.auth-form { width: min(360px, 100%); }
.auth-form h1 { text-align: center; font-size: 25px; font-weight: 650; margin: 0 0 8px; }
.auth-caption { margin: 0 0 36px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-form label { margin-bottom: 20px; }
.auth-form .solid-button { width: 100%; height: 44px; margin-top: 8px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-wrap .icon-button { position: absolute; right: 4px; top: 4px; }
.auth-private { display: flex; justify-content: center; align-items: center; gap: 6px; color: #90969e; font-size: 11px; margin-top: 23px; }
.auth-private svg { width: 13px; height: 13px; }
.form-error { color: var(--danger); font-size: 12px; min-height: 16px; line-height: 1.6; }
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100dvh; overflow: hidden; }
.sidebar { min-height: 0; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid #f0f1f4; padding: 18px 13px 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 7px 22px; flex: 0 0 auto; }
.sidebar-brand strong { font-size: 16px; font-weight: 650; }
.sidebar-brand .mobile-only { margin-left: auto; }
.new-chat-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 11px 13px; background: #fff; border: 1px solid #e3e6eb; border-radius: 8px; font-size: 13px; box-shadow: 0 1px 2px #1f293708; }
.new-chat-button:hover { border-color: #c7d5d1; }
.new-chat-button .trailing-icon { margin-left: auto; width: 15px; height: 15px; color: #9da2ab; }
.primary-nav { display: grid; gap: 3px; margin: 17px 0 20px; flex: 0 0 auto; }
.nav-button { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 0; background: transparent; border-radius: 8px; text-align: left; font-size: 13px; }
.nav-button svg { color: #858b95; width: 18px; height: 18px; }
.nav-button:hover { background: #eef0f4; }
.nav-button.active { background: #e9f1ed; color: #286254; font-weight: 600; }
.nav-button.active svg { color: #357762; }
.nav-indicator { margin-left: auto; width: 5px; height: 5px; background: #538e76; border-radius: 50%; }
.nav-section-head { display: flex; justify-content: space-between; align-items: center; min-height: 30px; padding: 0 10px; color: #9298a1; font-size: 11px; flex: 0 0 auto; }
.project-list { display: grid; gap: 2px; max-height: 22vh; overflow: auto; flex: 0 1 auto; margin: 2px 0 14px; }
.project-row { display: flex; align-items: center; width: 100%; min-height: 37px; gap: 9px; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 13px; }
.project-row svg { width: 17px; height: 17px; color: var(--blue); }
.project-row:hover, .project-row.active { background: #e9edf3; }
.project-row .row-title, .conversation-row .row-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-row .row-count { color: #9da2aa; font-size: 11px; }
.history-heading { flex: 0 0 auto; }
.history-search { display: flex; align-items: center; gap: 6px; margin: 6px 7px 10px; padding: 0 7px; height: 32px; border: 1px solid transparent; border-radius: 6px; }
.history-search:focus-within { background: #fff; border-color: var(--line); }
.history-search svg { width: 14px; height: 14px; color: #a1a6ae; }
.history-search input { border: 0; background: transparent; padding: 3px; font-size: 11px; outline: none; min-width: 0; }
.conversation-list { min-height: 60px; flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.conversation-row { display: flex; align-items: center; gap: 7px; min-height: 38px; border-radius: 7px; padding: 2px 4px 2px 12px; }
.conversation-row:hover, .conversation-row.active { background: #e8ebf0; }
.conversation-row > button:first-child { display: flex; flex: 1; align-items: center; min-width: 0; gap: 8px; border: 0; background: transparent; text-align: left; padding: 8px 0; font-size: 12px; }
.conversation-row > button:first-child svg { width: 14px; height: 14px; color: #9da3ac; }
.conversation-row .row-menu { opacity: 0; }
.conversation-row:hover .row-menu, .conversation-row:focus-within .row-menu, .conversation-row.active .row-menu { opacity: 1; }
.empty-nav { padding: 10px 12px 16px; color: #a1a6ae; font-size: 11px; }
.more-conversations { flex: 0 0 auto; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 14px 7px; margin-top: 8px; border-top: 1px solid #e9ecf0; font-size: 12px; flex: 0 0 auto; }
.sidebar-footer .settings-entry { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #5f6875; font-size: 12px; }
.sidebar-footer .settings-entry:hover, .sidebar-footer .settings-entry:focus-visible { background: #fff; border-color: var(--line); color: var(--text); }
.sidebar-footer .settings-entry svg { width: 16px; height: 16px; }
.owner-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e5e8ee; color: #657082; font-size: 12px; flex: 0 0 auto; }
.main-content { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-header { display: flex; align-items: center; padding: 16px 28px; min-height: 72px; flex: 0 0 auto; gap: 8px; }
.header-title { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.header-title h1 { font-size: 15px; font-weight: 600; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: min(520px, 65%); }
.header-title > span { color: #9ca2ab; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.header-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.chat-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-scroll { min-height: 0; overflow-y: auto; flex: 1; padding: 24px 32px; scroll-behavior: smooth; }
.chat-welcome { max-width: 720px; margin: 0 auto; min-height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 28px 0 44px; }
.welcome-mark { width: 52px; height: 52px; display: grid; place-items: center; color: var(--accent); background: #eff7f2; border-radius: 50%; margin-bottom: 18px; }
.welcome-mark svg { width: 29px; height: 29px; }
.chat-welcome h2 { font-size: 25px; font-weight: 600; line-height: 1.5; margin: 0 0 25px; text-align: center; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.welcome-actions button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e8ebef; border-radius: 8px; padding: 10px 12px; background: #fff; color: #717984; font-size: 12px; }
.welcome-actions button:nth-child(1) svg { color: #7383b6; }
.welcome-actions button:nth-child(2) svg { color: #b99762; }
.welcome-actions button:nth-child(3) svg { color: #639b8a; }
.welcome-actions button:hover { background: #f7f9fb; }
.chat-list { max-width: 800px; margin: 0 auto; display: grid; gap: 30px; }
.chat-message { min-width: 0; }
.chat-message.user { justify-self: end; max-width: 85%; padding: 12px 18px; background: #f0f2f5; border-radius: 8px; }
.chat-message.assistant { width: 100%; padding-left: 40px; position: relative; }
.message-avatar { position: absolute; left: 0; top: 0; width: 27px; height: 27px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 7px; }
.message-avatar svg { width: 17px; height: 17px; }
.chat-text { margin: 0; font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.markdown { white-space: normal; }
.markdown p { margin: 0 0 12px; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1, .markdown h2, .markdown h3 { line-height: 1.6; margin: 18px 0 10px; font-weight: 600; }
.markdown h1 { font-size: 21px; }
.markdown h2 { font-size: 18px; }
.markdown h3 { font-size: 16px; }
.markdown ul, .markdown ol { padding-left: 24px; margin: 10px 0; }
.markdown li { margin: 5px 0; }
.markdown a { color: var(--blue); text-decoration-thickness: 1px; }
.markdown pre { max-width: 100%; overflow: auto; border: 1px solid var(--line); background: #f7f8fa; border-radius: 8px; padding: 15px; font-size: 12px; line-height: 1.7; }
.markdown code { font-family: Consolas, monospace; font-size: 12px; background: #f3f4f6; border-radius: 3px; padding: 2px 4px; }
.markdown pre code { background: none; padding: 0; white-space: pre; }
.markdown blockquote { margin: 12px 0; border-left: 3px solid #d2dfd8; padding-left: 15px; color: #7e8783; }
.markdown table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; font-size: 12px; margin: 16px 0; }
.markdown td, .markdown th { border: 1px solid var(--line); padding: 9px 12px; min-width: 90px; }
.markdown th { background: #f7f8fa; text-align: left; }
.chat-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.chat-actions .icon-button { width: 29px; height: 29px; }
.chat-actions svg { width: 15px; height: 15px; }
.chat-provider { margin-left: auto; font-size: 10px; color: #a0a6af; }
.source-references { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.source-reference { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #e7eaee; padding: 5px 8px; background: #fbfcfd; border-radius: 6px; color: #6d7f95; font-size: 11px; max-width: 100%; }
.source-reference span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; }
.source-reference svg { width: 12px; height: 12px; }
.knowledge-references { color: #94a0a8; font-size: 10px; line-height: 1.7; margin-top: 8px; overflow-wrap: anywhere; }
.pending-message { color: #a0a6af; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.pending-dots { display: flex; gap: 4px; }
.pending-dots b { width: 5px; height: 5px; background: #8ca399; border-radius: 50%; animation: breathe 1.4s infinite ease-in-out; }
.pending-dots b:nth-child(2) { animation-delay: .15s; }
.pending-dots b:nth-child(3) { animation-delay: .3s; }
@keyframes breathe { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.composer-area { width: min(840px, 100%); padding: 0 28px 16px; margin: 0 auto; flex: 0 0 auto; }
.composer { border: 1px solid #dfe3e8; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px #243b5306; padding: 12px 12px 8px; }
.composer:focus-within { border-color: #b8cdc5; box-shadow: 0 2px 12px #243b5308; }
.composer textarea { display: block; border: 0; resize: none; padding: 3px 6px; min-height: 56px; max-height: 150px; outline: none; font-size: 14px; }
.composer-toolbar { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; }
.composer-tools { display: flex; align-items: center; gap: 6px; min-width: 0; }
.voice-entry { display: flex; align-items: center; gap: 10px; }
.voice-entry .input-mode { width: 48px; height: 60px; color: #47505c; }
.voice-input-primary { min-width: 0; flex: 1; min-height: 64px; padding: 12px; border: 1px solid #d4e6de; border-radius: 8px; background: #eef6f2; color: #225f50; font-size: 19px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.voice-input-primary span { overflow-wrap: anywhere; }
.voice-input-primary:hover { background: #e0eee6; }
.voice-input-primary.listening { background: #fff0f1; border-color: #e8b8be; color: #a43748; }
.voice-input-primary.listening svg { animation: voice-pulse 1s ease-in-out infinite; }
.composer .composer-tools .icon-button { width: 44px; height: 44px; }
.call-entry { min-height: 44px; padding: 8px 10px; display: flex; align-items: center; gap: 7px; border: 0; border-radius: 6px; background: transparent; color: #47505c; font-size: 15px; white-space: nowrap; }
.call-entry:hover { background: var(--hover); }
.text-mode .voice-entry { position: absolute; bottom: 8px; left: 12px; }
.text-mode { position: relative; }
.text-mode .composer-toolbar { padding-left: 50px; }
.text-mode .voice-entry .input-mode { width: 44px; height: 44px; }
.text-mode .composer-tools .scope-label { display: none; }
.composer:not(.text-mode) textarea { margin-bottom: 8px; font-size: 17px; }
.composer .send-button { width: 44px; height: 44px; }
@media (max-width: 480px) {
  .composer-tools { gap: 2px; }
  .text-mode .composer-toolbar { padding-left: 44px; }
  .text-mode .call-entry { padding: 8px; }
  .text-mode .call-entry span { display: none; }
  .composer:has(.voice-input-primary.listening) .call-entry span { display: none; }
  .voice-input-primary { font-size: 18px; }
}
.scope-label { display: flex; gap: 5px; align-items: center; color: #929aa3; font-size: 10px; min-width: 0; }
.scope-label svg { width: 13px; height: 13px; }
.scope-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.send-button { display: grid; place-items: center; width: 34px; height: 34px; background: #2f3339; color: #fff; border: 0; border-radius: 50%; flex: 0 0 auto; }
.send-button:hover { background: var(--accent); }
.composer-tools .icon-button.listening { color: #b43f48; background: #fbecee; border-color: #f0c9ce; }
.composer-tools .icon-button.listening svg { animation: voice-pulse 1s ease-in-out infinite; }
@keyframes voice-pulse { 50% { transform: scale(1.12); } }
.composer-note { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10px; color: #b0b5be; padding-top: 10px; min-height: 24px; }
.composer-note svg { width: 10px; height: 10px; margin-left: 8px; }
.chat-status { min-height: 24px; font-size: 11px; color: #a0775c; padding: 0 7px 6px; }
.load-older { display: block; margin: 0 auto 20px; }
.library-view { overflow: auto; padding: 25px 36px 50px; min-height: 0; flex: 1; }
.library-heading { display: flex; align-items: center; gap: 10px; max-width: 840px; margin: 0 auto 30px; }
.library-heading h2 { font-size: 22px; margin: 0 auto 0 0; font-weight: 600; }
.library-heading select { width: 180px; font-size: 12px; padding: 9px; }
.library-panel { max-width: 840px; margin: auto; }
.record-composer { border-bottom: 1px solid var(--line); padding-bottom: 25px; }
.record-composer textarea { min-height: 130px; }
.record-toolbar { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.record-toolbar > span, .section-heading > span { color: #a4aab3; font-size: 11px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 6px; }
.section-heading h3 { font-size: 14px; margin: 0; font-weight: 600; }
.record-item, .knowledge-item { border-bottom: 1px solid var(--line); padding: 20px 0; }
.record-item h3, .knowledge-item h3 { margin: 0 0 8px; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.record-item p, .knowledge-item p { color: #717984; line-height: 1.85; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
.record-meta, .knowledge-meta { display: flex; flex-wrap: wrap; gap: 10px; color: #a0a6af; font-size: 11px; }
.record-tag { color: #638c80; }
.library-search { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.library-search svg { color: #9ba2ac; width: 16px; height: 16px; }
.library-search input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.task-item { display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding: 18px 0; }
.task-item input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.task-title { line-height: 1.7; font-size: 13px; overflow-wrap: anywhere; }
.task-title.done { text-decoration: line-through; color: #a8aeb6; }
.task-due { display: block; font-size: 11px; color: #b08e67; margin-top: 4px; }
.empty-state { text-align: center; padding: 65px 16px; color: #a2a9b2; font-size: 13px; }
.empty-state svg { display: block; width: 32px; height: 32px; margin: 0 auto 13px; color: #c8ced6; }
.knowledge-import-form { border-bottom: 1px solid var(--line); padding-bottom: 25px; margin-bottom: 12px; }
.import-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.file-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; border: 1px dashed #d5dce4; border-radius: 8px; padding: 12px; align-self: end; min-height: 44px; color: #7b8694; font-size: 12px; overflow: hidden; }
.file-picker span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.file-picker input { border: 0; padding: 0; font-size: 10px; }
.inline-message { color: #7d8e86; font-size: 12px; line-height: 1.6; margin: 10px 0; min-height: 16px; }
.import-history { margin-top: 30px; color: var(--muted); font-size: 12px; }
.import-history summary { cursor: pointer; padding: 12px 0; }
.knowledge-import-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.knowledge-import-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.knowledge-import-row strong { font-weight: 500; overflow-wrap: anywhere; }
.knowledge-import-meta { display: block; color: #a7aeb8; font-size: 10px; margin-top: 6px; }
.import-status { color: #688b7b; white-space: nowrap; font-size: 11px; }
.import-status.failed, .import-error { color: var(--danger); }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 10px); background: #30353c; color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 20; font-size: 12px; box-shadow: 0 6px 20px #0002; max-width: min(420px, 90vw); pointer-events: none; opacity: 0; transition: opacity .16s, transform .16s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 8px; padding: 25px; box-shadow: 0 15px 60px #1d29392b; color: var(--text); max-height: calc(100dvh - 48px); overflow: auto; }
.app-dialog::backdrop { background: #16212c45; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 24px; }
.dialog-heading h2 { font-size: 17px; margin: 0; font-weight: 600; }
.app-dialog label { margin-bottom: 19px; }
.dialog-footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; }
.dialog-footer .danger-text { margin-right: auto; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.settings-owner { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; }
.settings-owner strong { font-size: 13px; display: block; font-weight: 500; }
.settings-owner span { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; overflow-wrap: anywhere; }
.settings-actions { display: grid; gap: 10px; }
.settings-actions button { justify-content: flex-start; font-weight: 400; }
#securityPanel { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }
.source-dialog { width: min(600px, calc(100vw - 32px)); }
.source-content { white-space: pre-wrap; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; }
.message-highlight { background: #f0f7ed !important; outline: 2px solid #c8dfb9; outline-offset: 8px; border-radius: 6px; }
.mobile-only { display: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .chat-header { padding: 14px 20px; }
  .header-title { display: block; }
  .header-title h1 { max-width: 100%; font-size: 14px; }
  .header-title > span { display: block; margin-top: 4px; font-size: 10px; }
  .chat-scroll { padding: 18px 24px; }
  .composer-area { padding-left: 20px; padding-right: 20px; }
  .library-view { padding: 20px 24px; }
}
@media (max-width: 680px) {
  .mobile-only { display: inline-flex; }
  .app-shell { display: flex; }
  .main-content { width: 100%; }
  .sidebar { position: fixed; z-index: 15; left: 0; top: 0; bottom: 0; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; border: 0; background: #1d26394d; z-index: 14; }
  .chat-header { padding: 9px 10px; min-height: 64px; }
  .header-actions { gap: 0; }
  .header-actions .icon-button { width: 31px; height: 34px; }
  .chat-scroll { padding: 20px 16px; }
  .chat-list { gap: 25px; }
  .chat-message.assistant { padding-left: 33px; }
  .chat-text { font-size: 14px; }
  .chat-message.user { max-width: 92%; padding: 10px 14px; }
  .chat-welcome { padding: 20px 0 25px; }
  .chat-welcome h2 { font-size: 22px; margin-bottom: 22px; }
  .welcome-actions { gap: 8px; max-width: 290px; }
  .welcome-actions button { padding: 9px 11px; font-size: 11px; }
  .composer-area { padding: 0 12px max(10px, env(safe-area-inset-bottom)); }
  .composer textarea { min-height: 48px; }
  .library-view { padding: 20px 18px 40px; }
  .library-heading { flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
  .library-heading h2 { font-size: 19px; }
  .library-heading select { width: 135px; }
  .import-fields { grid-template-columns: 1fr; }
  .scope-label span { max-width: 160px; }
  .project-list { max-height: 25vh; }
  .conversation-row .row-menu { opacity: 1; }
  .source-reference span { max-width: 190px; }
  .app-dialog { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
