@charset "UTF-8";

/* Ant Design 5 visual language. All assets remain local and dependency-free. */
:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  --primary-bg: #e6f4ff;
  --primary-border: #91caff;
  --ink: rgba(0, 0, 0, .88);
  --muted: rgba(0, 0, 0, .65);
  --faint: rgba(0, 0, 0, .45);
  --paper: #f5f5f5;
  --white: #fff;
  --line: #f0f0f0;
  --border: #d9d9d9;
  --navy: var(--primary);
  --green: var(--primary);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  --shadow: 0 6px 16px 0 rgba(0,0,0,.08), 0 3px 6px -4px rgba(0,0,0,.12), 0 9px 28px 8px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 14px/1.5715 var(--sans); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { border: 0; background: none; color: inherit; cursor: pointer; transition: color .2s, background .2s, border-color .2s, box-shadow .2s; }
button:disabled { color: rgba(0,0,0,.25); cursor: not-allowed; }
a { color: var(--primary); text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--primary-border); outline-offset: 2px; }
input, textarea { min-width: 0; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
[hidden] { display: none !important; }

.shell { display: flex; height: 100dvh; min-height: 500px; }
.sidebar { width: 272px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 24px 16px 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.4; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; border-radius: 8px; color: #fff; background: var(--primary); font-size: 23px; font-weight: 500; box-shadow: 0 2px 0 rgba(5,145,255,.1); }
.brand-sub { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--faint); }
.new-chat { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; min-height: 40px; margin: 24px 0; color: #fff; background: var(--primary); border-radius: 6px; box-shadow: 0 2px 0 rgba(5,145,255,.1); }
.new-chat:hover { background: var(--primary-hover); }
.new-chat:active { background: var(--primary-active); }
.new-chat:disabled, .send-button:disabled { color: rgba(0,0,0,.25); background: #f5f5f5; border: 1px solid var(--border); box-shadow: none; }
.new-chat > span:first-child { font-size: 20px; line-height: 1; }
.new-chat-arrow { display: none; }
.side-section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; }
.side-section-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.text-button { padding: 2px 0; color: var(--primary); font-size: 12px; }
.text-button:hover { color: var(--primary-hover); }
.network-tabs { display: flex; padding: 3px; gap: 2px; background: #f5f5f5; border-radius: 6px; }
.network-tabs button { flex: 1; padding: 4px 2px; border-radius: 4px; font-size: 13px; color: var(--muted); }
.network-tabs button:hover { color: var(--ink); }
.network-tabs .active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px -2px rgba(0,0,0,.12), 0 1px 4px -1px rgba(0,0,0,.08); }
.system-search { display: flex; align-items: center; gap: 7px; padding: 3px 10px; margin: 16px 0 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--faint); }
.system-search:hover { border-color: var(--primary-hover); }
.system-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5,145,255,.1); }
.system-search > span { font-size: 22px; line-height: 1; }
.system-search input { width: 100%; height: 26px; background: none; border: 0; outline: none; font-size: 13px; }
.system-search input:focus-visible { outline: none; }
.system-list { flex: 1; overflow: auto; min-height: 70px; scrollbar-width: thin; scrollbar-color: #d9d9d9 transparent; }
.scope-all, .system-item { width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 9px 12px; min-height: 40px; margin: 4px 0; border-radius: 6px; font-size: 13px; line-height: 22px; color: var(--muted); }
.scope-all { align-items: center; justify-content: space-between; }
.scope-all:hover, .system-item:hover { background: #f5f5f5; color: var(--ink); }
.scope-all.active, .system-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.scope-all span { color: inherit; font-size: 12px; line-height: 20px; min-width: 24px; padding: 0 5px; background: rgba(0,0,0,.04); border-radius: 10px; text-align: center; }
.system-group-label { display: flex; justify-content: space-between; padding: 16px 12px 4px; font-size: 12px; color: var(--faint); }
.nav-square { width: 12px; height: 13px; margin-top: 4px; border: 1px solid currentColor; border-radius: 2px; flex-shrink: 0; opacity: .65; position: relative; }
.nav-square:after { content: ""; position: absolute; width: 6px; height: 1px; background: currentColor; top: 4px; left: 2px; box-shadow: 0 3px currentColor; }
.empty-systems { color: var(--faint); padding: 24px 12px; font-size: 13px; }
.document-card { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 16px 8px 12px; border-top: 1px solid var(--line); }
.document-symbol { display: grid; place-items: center; width: 32px; height: 38px; border: 1px solid #b7d8ff; border-radius: 4px; background: #f0f7ff; color: var(--primary); font-size: 10px; font-weight: 600; }
.document-card strong { display: block; font-weight: 500; font-size: 13px; }
.document-card div span { font-size: 11px; color: var(--faint); }
.document-card a { margin-left: auto; padding: 4px; font-size: 24px; line-height: 1; }
.sidebar-footer { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--faint); font-size: 11px; }
.tiny-square { width: 5px; height: 5px; border-radius: 50%; background: #52c41a; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--paper); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; min-height: 64px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.workspace-label { font-weight: 600; }
.topbar-slash { color: rgba(0,0,0,.25); }
.project-label { color: var(--faint); }
.connection { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fafafa; }
.connection-dot { width: 6px; height: 6px; border-radius: 50%; background: #bfbfbf; }
.connection.ready { color: #389e0d; background: #f6ffed; border-color: #b7eb8f; }
.connection.ready .connection-dot { background: #52c41a; }
.connection.offline { background: #fffbe6; color: #ad6800; border-color: #ffe58f; }
.connection.offline .connection-dot { background: #faad14; }
.modebar { display: flex; align-items: center; justify-content: space-between; height: 56px; min-height: 56px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); }
.mode-tabs { display: flex; align-self: stretch; gap: 32px; }
.mode-tabs button { display: flex; align-items: center; gap: 8px; position: relative; padding: 0; font-size: 14px; color: var(--muted); }
.mode-tabs button > span { font-size: 19px; line-height: 1; }
.mode-tabs button:hover { color: var(--primary-hover); }
.mode-tabs button.active { color: var(--primary); font-weight: 500; }
.mode-tabs button.active:after { content: ""; position: absolute; bottom: -1px; right: 0; left: 0; height: 2px; background: var(--primary); border-radius: 2px 2px 0 0; }
.source-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.source-dot { width: 6px; height: 6px; border-radius: 50%; background: #bfbfbf; }
.service-banner { padding: 9px 24px; color: #ad6800; background: #fffbe6; border-bottom: 1px solid #ffe58f; font-size: 13px; flex-shrink: 0; }
.chat-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.conversation-scroll { flex: 1; overflow: auto; scrollbar-width: thin; scroll-behavior: smooth; }
.welcome { max-width: 1000px; margin: 24px auto; padding: 28px 32px 26px; background: #fff; border: 1px solid var(--line); border-radius: 8px; animation: appear .2s ease-out; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.eyebrow > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.edition { margin-left: auto; font-size: 12px; color: var(--faint); }
.welcome h1 { font-size: 28px; line-height: 1.4; margin: 20px 0 12px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.welcome-description { margin: 0; font-size: 14px; line-height: 1.8; color: var(--muted); }
.knowledge-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin: 24px 0; }
.knowledge-stats > div:not(.stats-divider) { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; background: #fafafa; border: 1px solid var(--line); border-radius: 6px; }
.knowledge-stats strong { order: 2; font-size: 26px; line-height: 1.25; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--ink); }
.knowledge-stats span { order: 1; font-size: 12px; color: var(--faint); }
.knowledge-stats .stat-word { color: var(--primary); font-size: 24px; }
.stats-divider { display: none; }
.suggestion-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; font-weight: 500; }
.suggestion-heading > span:last-child { font-size: 12px; color: var(--faint); font-weight: 400; }
.suggestions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.suggestion { display: flex; flex-direction: column; text-align: left; padding: 16px; min-height: 146px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.suggestion:hover { border-color: var(--primary-border); box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.suggestion-type { font-size: 12px; color: var(--primary); }
.suggestion strong { margin: 10px 0 16px; font-size: 14px; line-height: 1.7; font-weight: 500; color: var(--ink); }
.suggestion-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; font-size: 11px; color: var(--faint); }
.suggestion-bottom > span { font-size: 18px; color: var(--primary); }

.composer-wrap { width: 100%; max-width: 1064px; padding: 12px 32px 20px; margin: 0 auto; flex-shrink: 0; }
.composer-scope { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.scope-pill { max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 7px; border: 1px solid var(--primary-border); border-radius: 4px; background: var(--primary-bg); color: var(--primary); font-size: 12px; }
.composer-scope .text-button { margin-left: auto; }
.composer { padding: 14px 16px 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; transition: border-color .2s, box-shadow .2s; }
.composer:hover { border-color: var(--primary-hover); }
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5,145,255,.1); }
.composer textarea { border: 0; resize: none; background: none; width: 100%; height: 48px; min-height: 48px; max-height: 130px; padding: 0; font-size: 14px; line-height: 1.8; outline: none; }
.composer textarea:focus-visible { outline: none; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.composer-bottom > div { display: flex; align-items: center; gap: 12px; }
.model-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.model-symbol { font-size: 20px; color: var(--primary); }
.model-detail { color: var(--faint); }
.send-button { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 15px; min-height: 32px; border: 1px solid transparent; border-radius: 6px; color: #fff; background: var(--primary); box-shadow: 0 2px 0 rgba(5,145,255,.1); font-size: 18px; }
.send-button > span { font-size: 14px; }
.send-button:hover:not(:disabled) { background: var(--primary-hover); }
.stop-button { color: var(--primary); font-size: 12px; }
.answer-rule { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--faint); margin: 10px 0 0; }
.answer-rule > span { white-space: nowrap; }
.messages { max-width: 1064px; margin: 0 auto; padding: 28px 32px 8px; }
.messages:empty { display: none; }
.message { margin-bottom: 24px; animation: appear .2s ease-out; }
.message-user { max-width: 88%; margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; }
.message-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--faint); font-size: 12px; }
.message-text { font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-user .message-text { padding: 12px 16px; background: var(--primary-bg); border: 1px solid #bae0ff; border-radius: 8px 2px 8px 8px; }
.assistant-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.assistant-avatar { display: grid; place-items: center; width: 32px; height: 32px; background: var(--primary); color: #fff; border-radius: 6px; font-size: 22px; }
.assistant-name { font-weight: 600; font-size: 14px; }
.message-scope { font-size: 12px; color: var(--muted); margin: 0 0 10px 42px; }
.status-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid #b7eb8f; border-radius: 4px; color: #389e0d; background: #f6ffed; font-size: 12px; line-height: 20px; font-weight: 400; }
.status-tag.missing, .status-tag.uncertain, .status-tag.clarify { color: #ad6800; background: #fffbe6; border-color: #ffe58f; }
.status-tag.error { color: #cf1322; background: #fff1f0; border-color: #ffa39e; }
.message-assistant .message-text { padding: 16px 20px; margin-left: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.message-assistant.missing .message-text { font-size: 20px; font-weight: 500; color: var(--ink); }
.message-error .message-text { color: #cf1322; border-color: #ffccc7; background: #fff1f0; }
.citation-list { margin: 14px 0 0 42px; display: flex; flex-direction: column; gap: 8px; }
.citation-label { margin-bottom: 2px; font-size: 12px; color: var(--faint); }
.citation-button { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.citation-button:hover { background: #f0f7ff; border-color: var(--primary-border); }
.citation-index { padding-right: 12px; color: var(--primary); border-right: 1px solid var(--line); font-size: 14px; }
.citation-main { flex: 1; min-width: 0; }
.citation-title { display: block; font-size: 13px; font-weight: 500; color: var(--primary); }
.citation-path { display: block; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 11px; }
.citation-arrow { font-size: 18px; color: var(--primary); }
.inline-citation { color: var(--primary); font-size: 12px; padding: 0 3px; }
.inline-citation:hover { text-decoration: underline; }
.message-actions { display: flex; gap: 16px; margin: 8px 0 0 42px; }
.message-actions button { font-size: 12px; color: var(--muted); padding: 3px 0; }
.message-actions button:hover { color: var(--primary); }
.thinking { padding-left: 42px; color: var(--muted); font-size: 13px; }
.thinking-dots { color: var(--primary); animation: pulse 1s infinite; }

.search-panel { padding: 24px 32px; flex: 1; overflow: auto; scrollbar-width: thin; }
.search-panel > div, .search-panel > form { max-width: 1000px; margin-left: auto; margin-right: auto; }
.search-heading h1 { font-size: 24px; line-height: 1.4; font-weight: 600; margin: 16px 0 8px; }
.search-heading p { margin: 0 0 24px; font-size: 14px; color: var(--muted); }
.full-search { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.full-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5,145,255,.1); }
.full-search > span { color: var(--faint); font-size: 25px; line-height: 1; }
.full-search input { flex: 1; width: 100%; height: 32px; border: 0; outline: none; background: none; }
.full-search input:focus-visible { outline: none; }
.full-search button { white-space: nowrap; color: #fff; background: var(--primary); border-radius: 6px; padding: 6px 16px; min-height: 32px; }
.full-search button:hover { background: var(--primary-hover); }
.search-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px auto 24px !important; font-size: 13px; color: var(--muted); }
.search-options select { margin-left: 8px; padding: 4px 8px; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--ink); }
.search-options > span { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-summary { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px 8px 0 0; background: #fafafa; font-size: 13px; color: var(--muted); }
.results-summary > span:last-child { font-size: 12px; color: var(--faint); }
.search-results { background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; }
.result-card { display: block; width: 100%; text-align: left; padding: 20px; border-bottom: 1px solid var(--line); background: #fff; }
.result-card:last-child { border-bottom: 0; border-radius: 0 0 8px 8px; }
.result-card:hover { background: #fafcff; }
.result-breadcrumb { display: block; font-size: 12px; color: var(--faint); line-height: 1.8; }
.result-card h2 { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; line-height: 1.7; font-weight: 500; margin: 8px 0; color: var(--primary); }
.result-card h2 > span { color: var(--primary); }
.result-card p { margin: 0; font-size: 14px; line-height: 1.9; color: var(--muted); overflow-wrap: anywhere; }
.result-ref { display: block; font-size: 12px; color: var(--faint); margin-top: 10px; }
mark { padding: 0 2px; border-radius: 2px; color: var(--ink); background: #fff1b8; }
.search-empty { text-align: center; padding: 56px 20px; }
.empty-icon { font-size: 42px; color: #bfbfbf; margin-bottom: 12px; }
.search-empty h2 { margin: 0 0 8px; font-size: 16px; font-weight: 500; }
.search-empty p { margin: 0; font-size: 13px; color: var(--faint); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding-top: 20px; color: var(--muted); font-size: 13px; }
.pagination button { padding: 4px 12px; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.source-dialog { position: fixed; inset: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: 660px; max-width: 94vw; margin: 0; padding: 0; border: 0; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.source-dialog[open] { display: flex; flex-direction: column; animation: drawer .2s ease-out; }
.source-dialog::backdrop { background: rgba(0,0,0,.45); }
.source-dialog-top { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 12px 24px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.source-document-name { color: var(--faint); font-size: 13px; font-weight: 400; margin-left: 8px; }
.icon-button { min-width: 32px; min-height: 32px; color: var(--faint); font-size: 24px; border-radius: 4px; }
.icon-button:hover { color: var(--ink); background: rgba(0,0,0,.06); }
.source-dialog-body { flex: 1; overflow: auto; padding: 24px; }
.source-network { display: inline-block; font-size: 12px; color: var(--primary); border: 1px solid var(--primary-border); background: var(--primary-bg); border-radius: 4px; padding: 1px 7px; margin-bottom: 16px; }
.source-breadcrumb { font-size: 12px; color: var(--faint); line-height: 1.9; margin-bottom: 12px; }
.source-dialog h2 { margin: 0 0 16px; font-size: 24px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.source-meta { font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.source-text { margin: 4px 0 20px; font-size: 14px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-text-ref { display: block; font-size: 11px; color: var(--faint); }
.source-dialog img { display: block; max-width: 100%; height: auto; margin: 16px auto; }
.source-table-wrap { max-width: 100%; overflow-x: auto; margin: 8px 0 24px; }
.source-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.8; }
.source-table th, .source-table td { border: 1px solid #d9d9d9; padding: 8px 10px; min-width: 80px; text-align: left; vertical-align: top; }
.source-table th { background: #fafafa; font-weight: 500; }
.source-ocr { color: var(--muted); padding: 12px; background: #fffbe6; border: 1px solid #ffe58f; border-radius: 6px; }
.network-tabs button { font-size: 11px; white-space: nowrap; }
.source-children { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.source-children > p { font-size: 13px; color: var(--muted); }
.source-child { display: block; text-align: left; width: 100%; padding: 12px 8px; border-bottom: 1px solid var(--line); color: var(--primary); font-size: 14px; line-height: 1.8; }
.source-child:hover { background: var(--primary-bg); }
.source-child > span { float: right; }
.source-dialog-footer { display: flex; justify-content: space-between; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); background: #fff; }
.source-dialog-footer button { padding: 4px 10px; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.source-dialog-footer button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 9px 16px; border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; box-shadow: var(--shadow); }
.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; }
.menu-button, .sidebar-shade { display: none; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes drawer { from { opacity: .6; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

@media (min-width: 1450px) { .welcome { margin-top: 40px; } }
@media (max-width: 1336px) { .welcome { margin: 24px 32px; } }
@media (max-width: 1100px) {
  .sidebar { width: 248px; padding-left: 12px; padding-right: 12px; }
  .welcome { margin: 20px 24px; padding: 24px; }
  .suggestions { gap: 12px; }
  .suggestion { padding: 12px; }
  .suggestion-bottom { font-size: 10px; }
  .composer-wrap, .messages { padding-left: 24px; padding-right: 24px; }
  .answer-rule > span { display: none; }
  .knowledge-stats { gap: 12px; }
  .search-panel { padding: 24px; }
}
@media (max-height: 800px) and (min-width: 821px) {
  .welcome { padding: 20px 24px; margin-top: 16px; margin-bottom: 16px; }
  .welcome h1 { font-size: 24px; margin-top: 12px; }
  .knowledge-stats { margin: 16px 0; }
  .knowledge-stats > div:not(.stats-divider) { padding: 10px 14px; }
  .suggestion { min-height: 130px; padding: 12px; }
  .suggestion strong { margin: 6px 0 10px; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 11; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar-shade:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.45); }
  .menu-button { display: block; font-size: 18px; margin-left: -4px; }
  .topbar { padding: 0 20px; height: 56px; min-height: 56px; }
  .topbar-left { gap: 10px; }
  .modebar { padding: 0 20px; height: 52px; min-height: 52px; }
  .welcome { margin: 20px; padding: 24px; }
  .composer-wrap, .messages { padding-left: 20px; padding-right: 20px; }
  .service-banner { padding: 8px 20px; font-size: 12px; }
}
@media (max-width: 520px) {
  .project-label, .topbar-slash { display: none; }
  .topbar, .modebar { padding-left: 16px; padding-right: 16px; }
  .connection { font-size: 11px; padding: 3px 6px; }
  .mode-tabs { gap: 24px; }
  .source-label { font-size: 10px; }
  .welcome { margin: 16px; padding: 20px 16px; }
  .eyebrow, .edition { font-size: 11px; }
  .welcome h1 { font-size: 24px; margin-top: 16px; }
  .welcome-description { font-size: 13px; }
  .knowledge-stats { gap: 8px; margin: 20px 0; }
  .knowledge-stats > div:not(.stats-divider) { padding: 10px 8px; }
  .knowledge-stats span { font-size: 10px; }
  .knowledge-stats strong { font-size: 23px; }
  .knowledge-stats .stat-word { font-size: 20px; }
  .suggestion-heading { font-size: 13px; }
  .suggestion-heading > span:last-child { font-size: 11px; }
  .suggestions { grid-template-columns: 1fr; gap: 12px; }
  .suggestion { display: grid; grid-template-columns: 1fr auto; min-height: 0; column-gap: 12px; padding: 12px; }
  .suggestion-type { grid-column: 1 / 3; font-size: 11px; }
  .suggestion strong { font-size: 13px; line-height: 1.7; margin: 8px 0 0; }
  .suggestion strong br { display: none; }
  .suggestion-bottom { margin-top: 8px; max-width: 92px; gap: 4px; font-size: 10px; }
  .composer-wrap { padding: 10px 16px 14px; }
  .composer-scope, .scope-pill, .composer-scope .text-button { font-size: 10px; }
  .composer-scope { gap: 6px; }
  .composer { padding: 12px; }
  .composer textarea { font-size: 13px; }
  .model-detail { display: none; }
  .answer-rule { font-size: 10px; }
  .messages { padding: 20px 16px 8px; }
  .message-label { font-size: 11px; }
  .message-user { max-width: 95%; }
  .message-scope { font-size: 11px; margin-left: 0; }
  .message-assistant .message-text { margin-left: 0; padding: 14px 16px; }
  .citation-list, .message-actions { margin-left: 0; }
  .citation-button { padding: 10px 12px; gap: 10px; }
  .citation-path { font-size: 10px; }
  .search-panel { padding: 20px 16px; }
  .search-heading h1 { font-size: 22px; }
  .search-heading p { font-size: 13px; }
  .full-search { padding-left: 10px; gap: 6px; }
  .full-search input { font-size: 12px; }
  .full-search button { font-size: 12px; padding: 4px 10px; }
  .search-options { font-size: 11px; gap: 8px; }
  .search-options select { margin-left: 4px; padding: 4px; font-size: 12px; }
  .results-summary > span:last-child { display: none; }
  .result-card { padding: 16px; }
  .result-breadcrumb, .result-ref { font-size: 11px; }
  .result-card h2 { font-size: 15px; }
  .result-card p { font-size: 13px; }
  .source-dialog-top, .source-dialog-body { padding-left: 20px; padding-right: 20px; }
  .source-dialog h2 { font-size: 22px; }
  .source-dialog-footer { padding: 12px; }
  .source-dialog-footer button { font-size: 11px; padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
