:root {
  --ink: #1e2b33;
  --muted: #60717a;
  --soft: #95a1a7;
  --line: #e2e8ea;
  --canvas: #f5f7f8;
  --surface: #fff;
  --navy: #2f4657;
  --navy-dark: #263c4b;
  --blue: #2387ad;
  --blue-dark: #156e91;
  --blue-soft: #e7f4f8;
  --green: #23856f;
  --green-soft: #e7f4f0;
  --amber: #ad7627;
  --amber-soft: #fbf1dd;
  --purple: #7657a2;
  --purple-soft: #f0ebf7;
  --shadow: 0 14px 40px rgba(31, 54, 64, .09);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.16, 1, .3, 1);
  --font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; color: var(--ink); background: var(--canvas); font-family: var(--font); -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
button, textarea { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, textarea:focus-visible { outline: 2px solid rgba(21, 110, 145, .72); outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app { height: 100vh; display: grid; grid-template-columns: 246px minmax(520px, 1fr) 330px; grid-template-rows: 62px minmax(0, 1fr); }

.oa-header { grid-column: 1 / -1; z-index: 30; display: flex; align-items: center; height: 62px; padding: 0 22px; background: #fff; border-bottom: 1px solid #dce3e5; box-shadow: 0 2px 8px rgba(39,64,72,.04); }
.oa-brand { display: flex; align-items: center; min-width: 330px; }
.company-logo { display: block; width: 142px; height: auto; object-fit: contain; }
.brand-symbol { position: relative; width: 48px; height: 35px; margin-right: 8px; }
.brand-symbol i { position: absolute; left: 0; right: 0; height: 5px; border-radius: 6px; background: #2485b5; transform: skewX(-22deg); }
.brand-symbol i:nth-child(1) { top: 3px; }
.brand-symbol i:nth-child(2) { top: 15px; }
.brand-symbol i:nth-child(3) { top: 27px; }
.brand-symbol b { position: absolute; z-index: 2; left: 16px; top: 7px; width: 21px; height: 21px; border-radius: 50%; background: #efc33e; box-shadow: inset -3px -3px 5px rgba(184,123,16,.25); }
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-name strong { color: #4d5458; font-size: 17px; letter-spacing: .05em; }
.brand-name span { margin-top: 5px; color: #69747a; font-size: 9px; font-weight: 800; letter-spacing: .42em; }
.product-divider { width: 1px; height: 29px; margin: 0 14px; background: #dfe4e6; }
.product-name { display: flex; flex-direction: column; gap: 3px; }
.product-name strong { font-size: 12px; }
.product-name span { color: #99a4a9; font-size: 7px; letter-spacing: .08em; }
.oa-modules { height: 100%; flex: 1; display: flex; justify-content: center; gap: 8px; }
.oa-modules button { position: relative; height: 100%; padding: 0 13px; border: 0; color: #4f5a60; background: transparent; font-size: 12px; cursor: default; }
.oa-modules button.active { color: var(--blue); font-weight: 700; }
.oa-modules button.active::after { content: ""; position: absolute; inset: auto 10px 0; height: 3px; background: var(--blue); }
.header-actions { min-width: 165px; display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.header-icon { position: relative; display: grid; place-items: center; border: 0; color: #68767c; background: transparent; }
.header-icon i { position: absolute; right: 1px; top: -1px; width: 5px; height: 5px; border-radius: 50%; background: #e25959; }
.header-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #5c6b71; background: #e7ebed; font-size: 11px; }
.header-user { color: #4f5d63; font-size: 11px; }
.mobile-nav-button { display: none; }

.chat-sidebar { grid-column: 1; grid-row: 2; min-height: 0; display: flex; flex-direction: column; padding: 18px 14px; color: #dce5e9; background: var(--navy); border-right: 1px solid #293e4d; }
.new-chat { height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #607483; border-radius: 6px; color: #fff; background: #385366; font-size: 11px; cursor: pointer; transition: .2s; }
.new-chat:hover { border-color: #8eb6c6; background: #415f72; }
.new-chat svg { width: 15px; }
.connection-mini { margin-top: 15px; padding: 12px; border-radius: 7px; background: rgba(16, 35, 47, .25); }
.connection-title { display: flex; align-items: center; justify-content: space-between; }
.connection-title span { display: flex; align-items: center; gap: 6px; color: #f1f6f7; font-size: 10px; font-weight: 700; }
.connection-title i { width: 6px; height: 6px; border-radius: 50%; background: #62d2b1; box-shadow: 0 0 0 4px rgba(98,210,177,.12); animation: pulse 2.2s infinite; }
.connection-title button { padding: 0; border: 0; color: #91abb6; background: transparent; font-size: 8px; cursor: pointer; }
.connection-mini dl { margin: 10px 0 0; }
.connection-mini dl div { display: flex; justify-content: space-between; margin-top: 7px; font-size: 8px; }
.connection-mini dt { color: #8299a5; }
.connection-mini dd { margin: 0; max-width: 128px; overflow: hidden; color: #c6d3d8; white-space: nowrap; text-overflow: ellipsis; }
.history { margin-top: 25px; }
.sidebar-label { margin: 0 9px 9px; color: #8fa3ad; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.history-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 9px; border: 0; border-radius: 6px; color: #c9d4d9; background: transparent; text-align: left; cursor: pointer; transition: .18s; }
.history-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.history-item svg { flex: 0 0 auto; width: 14px; color: #8ba2ad; }
.history-item > span { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.history-item strong { overflow: hidden; font-size: 10px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.history-item small { color: #7f97a2; font-size: 8px; }
.source-lock { margin-top: auto; display: flex; gap: 9px; padding: 12px 9px; border-top: 1px solid rgba(255,255,255,.11); }
.source-lock svg { flex: 0 0 auto; width: 15px; color: #6fc3d4; }
.source-lock div { display: flex; flex-direction: column; gap: 4px; }
.source-lock strong { color: #d7e2e6; font-size: 9px; }
.source-lock span { color: #8299a4; font-size: 8px; }

.chat-workspace { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; display: grid; grid-template-rows: 78px 44px minmax(0, 1fr) auto; background: #fff; }
.conversation-header { display: flex; align-items: center; gap: 20px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.conversation-header > div:first-child { min-width: 0; }
.breadcrumb { display: flex; gap: 7px; margin-bottom: 5px; color: #8c989d; font-size: 8px; }
.breadcrumb b { color: #c1c9cc; font-weight: 400; }
.breadcrumb strong { color: var(--blue); }
.conversation-header h1 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.header-status { margin-left: auto; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #dfe8e8; border-radius: 6px; background: #fbfdfd; }
.header-status > i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.header-status div { display: flex; flex-direction: column; gap: 2px; }
.header-status strong { color: #45555b; font-size: 9px; }
.header-status span { color: #95a0a4; font-size: 7px; }
.mobile-inspector { display: none; }
.scope-bar { display: flex; align-items: center; padding: 0 28px; color: #718087; background: #f8fafb; border-bottom: 1px solid #e8edef; font-size: 8px; }
.scope-path { display: flex; align-items: center; gap: 7px; min-width: 0; }
.scope-path svg { width: 14px; color: var(--blue); }
.scope-path strong { overflow: hidden; color: #506168; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.scope-count { margin-left: auto; padding-left: 14px; border-left: 1px solid #dce4e6; color: #8a979c; white-space: nowrap; }
.scope-count b { color: var(--blue); }
.scope-count strong { color: var(--green); font-weight: 700; }

.conversation { min-height: 0; overflow-y: auto; padding: 28px max(28px, calc((100% - 790px) / 2)); scroll-behavior: smooth; }
.welcome-message { display: flex; gap: 14px; max-width: 780px; margin: 20px auto; animation: enter .45s ease both; }
.assistant-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px 9px 9px 3px; color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(35,135,173,.18); }
.assistant-avatar svg { width: 17px; }
.welcome-copy { flex: 1; padding-top: 2px; }
.welcome-kicker { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.welcome-copy h2 { margin: 7px 0 7px; font-size: 24px; letter-spacing: -.035em; }
.welcome-copy > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.prompt-examples { margin-top: 23px; border-top: 1px solid var(--line); }
.prompt-examples button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 42px 1fr auto; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 11px; padding: 11px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: .18s; }
.prompt-examples button:hover { padding-left: 13px; background: #f8fbfc; }
.example-type { grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; font-size: 8px; font-weight: 800; }
.example-type.sop { color: var(--green); background: var(--green-soft); }
.example-type.law { color: var(--purple); background: var(--purple-soft); }
.example-type.compliance { color: var(--amber); background: var(--amber-soft); }
.prompt-examples strong { grid-column: 2; grid-row: 1; align-self: end; min-width: 0; font-size: 10px; }
.prompt-examples small { grid-column: 2; grid-row: 2; align-self: start; min-width: 0; color: #8d999e; font-size: 8px; }
.prompt-examples svg { grid-column: 3; grid-row: 1 / 3; width: 15px; color: #9aa6aa; transition: transform .18s; }
.prompt-examples button:hover svg { color: var(--blue); transform: translateX(3px); }

.message { max-width: 790px; margin: 0 auto 24px; animation: enter .35s ease both; }
.user-message { display: flex; justify-content: flex-end; }
.user-bubble { max-width: 78%; padding: 11px 14px; border-radius: 12px 12px 3px 12px; color: #fff; background: var(--navy); font-size: 11px; line-height: 1.65; box-shadow: 0 8px 18px rgba(42,66,80,.12); }
.assistant-message { display: flex; gap: 11px; }
.assistant-message .assistant-avatar { width: 30px; height: 30px; }
.assistant-body { flex: 1; min-width: 0; padding-top: 2px; }
.assistant-body > p { margin: 0 0 12px; color: #435158; font-size: 10px; line-height: 1.75; }
.assistant-body .result-intro strong { color: var(--ink); }
.assistant-body mark { padding: 1px 3px; color: var(--blue-dark); background: var(--blue-soft); }
.grounded-answer { margin: 12px 0 15px; padding: 15px 16px; border-left: 3px solid var(--green); border-radius: 0 7px 7px 0; background: #f4f9f7; }
.grounded-label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .04em; }
.grounded-label strong { font-size: 10px; }
.grounded-label span { padding: 2px 5px; border-radius: 8px; color: #55736b; background: #e2efeb; font-size: 7px; letter-spacing: 0; }
.answer-proof { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.answer-proof span { padding: 4px 7px; border: 1px solid #d6e8e1; border-radius: 4px; color: #58776f; background: rgba(255,255,255,.7); font-size: 7px; }
.answer-proof .generator-badge { border-color: #c9dbf4; color: var(--blue-dark); background: #f4f8ff; }
.grounded-answer > p { margin: 0 0 8px; color: #35484a; font-size: 10px; line-height: 1.7; }
.grounded-answer .rich-summary { margin: 2px 0 13px; padding: 9px 11px; border: 1px solid #dce9e5; border-radius: 5px; background: rgba(255,255,255,.72); color: #344b48; font-size: 9px; line-height: 1.75; }
.rich-answer-content { display: grid; gap: 11px; }
.rich-answer-section { padding: 0 1px; }
.rich-answer-section h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 5px; color: #243f3b; font-size: 10px; line-height: 1.5; }
.rich-answer-section h3 b { display: inline-grid; width: 21px; height: 21px; place-items: center; border-radius: 4px; color: #fff; background: var(--green); font-size: 7px; letter-spacing: -.3px; }
.rich-answer-section ul { margin: 0; padding-left: 1px; }
.grounded-answer ul { margin: 8px 0 11px; padding: 0; list-style: none; }
.grounded-answer li { position: relative; margin: 7px 0; padding-left: 16px; color: #43565a; font-size: 9px; line-height: 1.7; }
.grounded-answer li::before { content: ""; position: absolute; left: 1px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.grounded-answer sup { margin-left: 3px; color: var(--green); font-size: 7px; font-weight: 800; }
.rich-table-wrap { overflow-x: auto; margin: 7px 0 2px; border: 1px solid #d7e7e1; border-radius: 5px; background: #fff; }
.rich-table { width: 100%; border-collapse: collapse; color: #43565a; font-size: 8px; line-height: 1.55; }
.rich-table th, .rich-table td { min-width: 92px; padding: 8px 9px; border-right: 1px solid #e2ece8; border-bottom: 1px solid #e2ece8; text-align: left; vertical-align: top; }
.rich-table th { color: #315b52; background: #edf6f2; font-weight: 800; }
.rich-table tr:last-child td { border-bottom: 0; }
.rich-table th:last-child, .rich-table td:last-child { border-right: 0; }
.evidence-list { margin-top: 13px; }
.evidence-list-title { display: block; margin-bottom: 1px; color: #526a65; font-size: 8px; }
.evidence-ref { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; padding: 9px 0 0; border: 0; border-top: 1px solid #dce9e5; color: #70837e; background: transparent; font-size: 7px; line-height: 1.55; text-align: left; cursor: pointer; }
.evidence-ref b { color: var(--green); }
.evidence-ref span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.evidence-ref em { color: var(--blue-dark); font-style: normal; font-weight: 700; white-space: nowrap; }
.evidence-ref:hover em { text-decoration: underline; }
.no-evidence { border-left-color: var(--amber); background: #fff9ef; }
.no-evidence .grounded-label { color: var(--amber); }
.assistant-meta { display: flex; gap: 10px; margin-top: 10px; color: #91a0a5; font-size: 8px; }
.assistant-meta span { display: flex; align-items: center; gap: 4px; }
.assistant-meta svg { width: 11px; }
.thinking-box { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfc; }
.thinking-title { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; }
.thinking-dots { display: flex; gap: 3px; }
.thinking-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--blue); animation: dots 1.1s infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
.thinking-progress { height: 3px; margin-top: 11px; overflow: hidden; border-radius: 3px; background: #e4ecee; }
.thinking-progress i { display: block; width: var(--progress, 10%); height: 100%; border-radius: 3px; background: var(--blue); transition: width .35s var(--ease-out); }

.result-list { margin-top: 13px; border-top: 1px solid var(--line); }
.file-result { width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: .18s; }
.file-result:hover { padding-left: 9px; background: #f8fbfc; }
.file-icon { display: grid; place-items: center; width: 36px; height: 42px; border-radius: 5px; color: #fff; background: #4d86a2; font-size: 7px; font-weight: 800; box-shadow: inset 0 -7px 0 rgba(0,0,0,.08); }
.file-icon.pdf { background: #b95e57; }
.file-icon.docx { background: #3f7fa5; }
.file-icon.xlsx { background: #3d8d67; }
.file-info { min-width: 0; }
.file-info strong { display: block; margin-bottom: 5px; overflow: hidden; color: #314148; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.file-info span { display: flex; flex-wrap: wrap; gap: 5px; color: #8b979c; font-size: 8px; }
.file-info span b { padding: 1px 4px; border-radius: 3px; color: #5e7077; background: #edf1f2; font-weight: 500; }
.file-score { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--blue); font-size: 9px; font-weight: 800; }
.file-score span { color: #99a4a8; font-size: 7px; font-weight: 400; }

.composer-area { padding: 10px max(28px, calc((100% - 790px) / 2)) 12px; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); }
.category-filter { display: flex; gap: 5px; margin-bottom: 7px; }
.category-filter button { padding: 4px 9px; border: 1px solid #e0e6e8; border-radius: 12px; color: #748188; background: #fff; font-size: 8px; cursor: pointer; }
.category-filter button.active { color: var(--blue-dark); border-color: #a8cfdd; background: var(--blue-soft); font-weight: 700; }
.composer { padding: 6px 7px 6px 13px; border: 1px solid #ccdadd; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(37,65,76,.08); transition: .18s; }
.composer:focus-within { border-color: #6dacc2; box-shadow: 0 12px 32px rgba(35,135,173,.12); }
.composer textarea { width: 100%; min-height: 31px; max-height: 90px; padding: 8px 0 3px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; line-height: 1.6; }
.composer textarea::placeholder { color: #a4afb3; }
.composer-tools { display: flex; align-items: center; justify-content: space-between; }
.composer-tools > span { display: flex; align-items: center; gap: 4px; color: #9aa5a9; font-size: 7px; }
.composer-tools > span svg { width: 11px; }
.composer-tools button { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 7px; color: #fff; background: var(--blue); cursor: pointer; transition: .18s; }
.composer-tools button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.composer-tools button:disabled { opacity: .55; cursor: wait; }
.composer-tools button svg { width: 15px; }
.composer-note { margin: 6px 0 0; color: #a1aaae; font-size: 7px; text-align: center; }

.process-inspector { grid-column: 3; grid-row: 2; min-height: 0; overflow-y: auto; background: #f8fafb; border-left: 1px solid #dfe6e8; }
.inspector-header { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.inspector-header > div { display: flex; flex-direction: column; gap: 4px; }
.inspector-header span { color: var(--blue); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.inspector-header strong { font-size: 13px; }
.inspector-header button { display: none; border: 0; color: #8c999e; background: transparent; font-size: 22px; }
.connection-panel, .trace-panel, .preview-panel { padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.panel-heading > span { color: #65757c; font-size: 9px; font-weight: 800; }
.panel-heading em { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 7px; font-style: normal; font-weight: 700; }
.panel-heading em > i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.panel-heading em.testing { color: var(--amber); background: var(--amber-soft); }
.panel-heading em.testing i { background: var(--amber); animation: pulse 1s infinite; }
.panel-heading .duration { color: #89979d; background: #edf1f2; }
.endpoint-row { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid #e2e9eb; border-radius: 6px; background: #fff; }
.endpoint-row > svg { width: 16px; color: var(--blue); }
.endpoint-row div { display: flex; flex-direction: column; gap: 3px; }
.endpoint-row span { color: #95a0a5; font-size: 7px; }
.endpoint-row strong { color: #45565d; font-size: 9px; }
.connection-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 9px; border: 1px solid #e4e9eb; border-radius: 6px; background: #fff; overflow: hidden; }
.connection-grid div { display: flex; flex-direction: column; gap: 3px; padding: 8px; border-right: 1px solid #e7ecee; border-bottom: 1px solid #e7ecee; }
.connection-grid div:nth-child(2n) { border-right: 0; }
.connection-grid div:nth-child(n+3) { border-bottom: 0; }
.connection-grid span { color: #96a1a5; font-size: 7px; }
.connection-grid strong { color: #4f6168; font-size: 8px; }
.trace-list { margin: 0; padding: 0; list-style: none; }
.trace-list li { position: relative; display: grid; grid-template-columns: 21px 1fr auto; gap: 8px; min-height: 48px; }
.trace-list li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 23px; bottom: 3px; width: 1px; background: #dce4e6; }
.trace-list b { z-index: 1; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #96a2a7; background: #e8edef; font-size: 7px; }
.trace-list li div { display: flex; flex-direction: column; gap: 3px; padding-top: 1px; }
.trace-list strong { color: #78868c; font-size: 8px; }
.trace-list span { color: #a0aaae; font-size: 7px; line-height: 1.45; }
.trace-list time { padding-top: 3px; color: #a2abad; font-size: 7px; }
.trace-list li.running b { color: #fff; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); animation: pulseBlue 1.2s infinite; }
.trace-list li.running strong { color: var(--blue-dark); }
.trace-list li.done b { color: #fff; background: var(--green); }
.trace-list li.done b::after { content: "✓"; }
.trace-list li.done b { font-size: 0; }
.trace-list li.done strong { color: #3e5655; }
.trace-list li.done time { color: var(--green); }
.preview-panel { min-height: 190px; background: #fff; }
.empty-preview { min-height: 145px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9aa6aa; text-align: center; }
.empty-preview svg { width: 28px; margin-bottom: 9px; color: #a8bcc3; }
.empty-preview strong { margin-bottom: 5px; color: #66767d; font-size: 9px; }
.empty-preview span { max-width: 190px; font-size: 7px; line-height: 1.6; }
.file-preview { animation: enter .3s ease both; }
.preview-top { display: flex; gap: 10px; }
.preview-top .file-icon { flex: 0 0 auto; }
.preview-title { min-width: 0; }
.preview-title span { color: var(--blue); font-size: 7px; font-weight: 800; }
.preview-title strong { display: block; margin: 4px 0 5px; color: #35464d; font-size: 9px; line-height: 1.5; }
.preview-title small { display: block; color: #929ea3; font-size: 7px; }
.preview-path { margin: 12px 0; padding: 8px; border-radius: 5px; color: #64757c; background: #f1f5f6; font-size: 7px; line-height: 1.55; word-break: break-all; }
.preview-excerpt { color: #506068; font-size: 8px; line-height: 1.75; }
.preview-excerpt strong { display: block; margin-bottom: 6px; color: #35464d; font-size: 8px; }
.preview-excerpt mark { color: var(--blue-dark); background: var(--blue-soft); }
.preview-chunk + .preview-chunk { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e6ecee; }
.preview-chunk > span { display: inline-block; margin-bottom: 4px; color: var(--blue-dark); font-size: 7px; font-weight: 700; }
.preview-chunk p { margin: 0; white-space: pre-wrap; }
.preview-actions { display: flex; gap: 7px; margin-top: 12px; }
.preview-actions button { flex: 1; padding: 7px; border: 1px solid #dce5e7; border-radius: 5px; color: #66777e; background: #fff; font-size: 7px; cursor: pointer; }
.preview-actions button.primary { color: #fff; border-color: var(--blue); background: var(--blue); }

.mobile-scrim { display: none; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 80; display: flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 6px; color: #fff; background: var(--navy-dark); box-shadow: var(--shadow); font-size: 9px; pointer-events: none; opacity: 0; transform: translate(-50%, 12px); transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 13px; color: #72d7bc; }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes enterMobile {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.995); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes dots { 50% { opacity: .25; transform: translateY(-2px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(98,210,177,0); } }
@keyframes pulseBlue { 50% { box-shadow: 0 0 0 7px rgba(35,135,173,0); } }

@media (max-width: 1180px) {
  .app { grid-template-columns: 220px minmax(480px, 1fr) 300px; }
  .oa-brand { min-width: 290px; }
  .product-name { display: none; }
  .product-divider { display: none; }
  .oa-modules button { padding: 0 8px; }
}

@media (max-width: 940px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .process-inspector { position: fixed; inset: 62px 0 0 auto; z-index: 45; width: 330px; transform: translateX(100%); box-shadow: -20px 0 50px rgba(23,42,51,.15); transition: transform .25s; }
  .process-inspector.open { transform: none; }
  .inspector-header button { display: block; }
  .mobile-inspector { display: block; margin-left: 0; padding: 6px 8px; border: 1px solid #dbe4e6; border-radius: 5px; color: var(--blue); background: #fff; font-size: 8px; }
  .header-status { display: none; }
  .oa-modules button:nth-child(n+6) { display: none; }
}

@media (max-width: 700px) {
  :root {
    --ink: #172b34;
    --muted: #516771;
    --line: #dbe8eb;
    --canvas: #f4f8f9;
    --blue: #157da2;
    --blue-dark: #075f80;
    --blue-soft: #e6f5f9;
    --green: #15745f;
    --green-soft: #e4f4ef;
    --shadow: 0 16px 38px rgba(26, 55, 68, .13);
  }
  body { overflow: hidden; background: #f4f8f9; }
  .app { display: block; height: 100dvh; min-height: 100svh; background: linear-gradient(180deg, #f7fbfc 0%, #f1f6f7 100%); }
  .oa-header { position: relative; z-index: 55; height: 58px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); background: rgba(255, 255, 255, .94); border-bottom-color: rgba(203, 219, 224, .86); box-shadow: 0 1px 0 rgba(255,255,255,.85), 0 8px 24px rgba(28,61,73,.06); backdrop-filter: blur(14px); }
  .mobile-nav-button { display: flex; flex: 0 0 44px; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 4px; margin: 0 7px 0 -8px; padding: 0; border: 0; border-radius: 12px; background: transparent; transition: background-color .18s var(--ease-out), transform .18s var(--ease-out); }
  .mobile-nav-button:active { background: #e8f1f4; transform: scale(.96); }
  .mobile-nav-button span { width: 18px; height: 1.5px; border-radius: 2px; background: #314c57; transition: transform .24s var(--ease-spring), opacity .18s var(--ease-out); }
  body.nav-open .mobile-nav-button span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  body.nav-open .mobile-nav-button span:nth-child(2) { opacity: 0; }
  body.nav-open .mobile-nav-button span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
  .company-logo { width: 116px; }
  .brand-name span, .oa-modules, .header-user { display: none; }
  .oa-brand { min-width: 0; }
  .header-actions { min-width: auto; margin-left: auto; }
  .header-icon { width: 42px; height: 42px; border-radius: 12px; transition: background-color .18s var(--ease-out), transform .18s var(--ease-out); }
  .header-icon:active { background: #edf4f6; transform: scale(.96); }
  .header-avatar { width: 32px; height: 32px; color: #39525c; background: #e3edf0; font-weight: 700; }
  .mobile-scrim { position: fixed; inset: 58px 0 0; z-index: 48; display: block; background: rgba(12, 28, 38, .32); opacity: 0; pointer-events: none; transition: opacity .24s var(--ease-out); backdrop-filter: blur(2px); }
  body.nav-open .mobile-scrim, body.inspector-open .mobile-scrim { opacity: 1; pointer-events: auto; }
  .chat-sidebar { position: fixed; inset: 58px auto 0 0; z-index: 50; width: min(304px, 84vw); padding: 16px 14px max(18px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #263f50 0%, #223746 100%); transform: translate3d(-102%, 0, 0); box-shadow: 24px 0 55px rgba(11, 30, 41, .22); transition: transform .34s var(--ease-spring); will-change: transform; contain: paint; }
  .chat-sidebar.open { transform: translate3d(0, 0, 0); }
  .new-chat { min-height: 44px; border-color: rgba(159, 190, 202, .45); border-radius: 12px; background: rgba(255,255,255,.08); font-size: 13px; transition: transform .18s var(--ease-out), background-color .18s var(--ease-out), border-color .18s var(--ease-out); }
  .new-chat:active, .history-item:active, .connection-title button:active { transform: scale(.98); }
  .connection-mini { border-radius: 12px; background: rgba(13, 32, 44, .35); }
  .connection-title span { font-size: 12px; }
  .connection-title button { min-height: 30px; padding: 0 4px; font-size: 11px; }
  .connection-mini dl div { font-size: 11px; }
  .connection-mini dd { max-width: 150px; }
  .history { margin-top: 20px; }
  .sidebar-label { font-size: 10px; color: #acc0c8; }
  .history-item { min-height: 56px; padding: 11px 10px; border-radius: 12px; transition: transform .18s var(--ease-out), background-color .18s var(--ease-out), color .18s var(--ease-out); }
  .history-item strong { font-size: 12px; }
  .history-item small { font-size: 10px; color: #9eb4bd; }
  .source-lock { padding: 14px 10px; }
  .source-lock strong { font-size: 11px; }
  .source-lock span { font-size: 10px; color: #a4b8c0; }
  .chat-workspace { height: calc(100dvh - 58px); min-height: calc(100svh - 58px); display: grid; grid-template-rows: 62px auto minmax(0, 1fr) auto; background: transparent; }
  .conversation-header { min-height: 62px; gap: 10px; padding: 0 16px; background: rgba(247, 251, 252, .88); border-bottom-color: rgba(219,232,235,.78); }
  .breadcrumb { display: none; }
  .conversation-header h1 { font-size: 16px; line-height: 1.35; letter-spacing: 0; color: #172b34; }
  .mobile-inspector { min-height: 38px; flex: 0 0 auto; padding: 0 12px; border: 1px solid #c8dfe6; border-radius: 12px; color: var(--blue-dark); background: #fff; box-shadow: 0 4px 12px rgba(21,125,162,.08); font-size: 12px; font-weight: 700; white-space: nowrap; transition: transform .18s var(--ease-out), background-color .18s var(--ease-out), box-shadow .18s var(--ease-out); }
  .mobile-inspector:active { transform: scale(.97); background: #eef8fb; box-shadow: 0 2px 8px rgba(21,125,162,.08); }
  .scope-bar { min-height: 40px; padding: 8px 16px; align-items: flex-start; background: rgba(238, 247, 249, .74); border-bottom-color: rgba(218,232,236,.82); }
  .scope-path { width: 100%; gap: 6px; }
  .scope-path svg { color: var(--blue-dark); }
  .scope-path span { flex: 0 0 auto; color: #5f747c; font-size: 11px; }
  .scope-path strong { color: #334d57; font-size: 11px; }
  .scope-count { display: none; }
  .conversation { padding: 16px 16px 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .welcome-message { gap: 10px; margin: 6px auto 14px; animation: enterMobile .42s var(--ease-out) both; }
  .welcome-copy h2 { margin-top: 5px; font-size: 23px; line-height: 1.22; color: #142832; }
  .welcome-copy > p { color: #4e6570; font-size: 13px; line-height: 1.68; }
  .welcome-kicker { color: var(--blue-dark); font-size: 10px; }
  .assistant-avatar { width: 32px; height: 32px; border-radius: 11px 11px 11px 4px; background: linear-gradient(145deg, #1686ac, #0f6f92); box-shadow: 0 8px 18px rgba(13, 111, 146, .2); }
  .prompt-examples { display: grid; gap: 9px; margin-top: 17px; border-top: 0; }
  .prompt-examples button { min-height: 74px; grid-template-columns: 42px minmax(0, 1fr) 18px; grid-template-rows: auto auto; column-gap: 11px; row-gap: 4px; padding: 12px 12px; border: 1px solid #dce9ed; border-radius: 14px; background: rgba(255,255,255,.9); box-shadow: 0 8px 20px rgba(26, 55, 68, .06); touch-action: manipulation; transition: transform .18s var(--ease-out), border-color .18s var(--ease-out), background-color .18s var(--ease-out), box-shadow .18s var(--ease-out); }
  .prompt-examples button:hover { padding-left: 12px; background: #fff; }
  .prompt-examples button:active { transform: scale(.985); border-color: #bddce6; background: #f5fbfd; box-shadow: 0 4px 12px rgba(26, 55, 68, .05); }
  .prompt-examples strong { color: #1e333d; font-size: 13px; line-height: 1.35; }
  .prompt-examples small { color: #657981; font-size: 10.5px; line-height: 1.45; }
  .example-type { width: 38px; height: 38px; border-radius: 12px; font-size: 9px; }
  .prompt-examples svg { transition: transform .18s var(--ease-out), color .18s var(--ease-out); }
  .prompt-examples button:active svg { transform: translateX(2px); }
  .message { margin-bottom: 18px; animation: enterMobile .32s var(--ease-out) both; }
  .assistant-message { gap: 9px; }
  .assistant-message .assistant-avatar { width: 28px; height: 28px; }
  .assistant-body > p, .grounded-answer > p { color: #2f444d; font-size: 13px; line-height: 1.75; }
  .user-bubble { max-width: min(88%, 520px); padding: 11px 14px; font-size: 14px; line-height: 1.65; border-radius: 16px 16px 5px 16px; background: linear-gradient(145deg, #28485a, #203847); box-shadow: 0 8px 18px rgba(24, 50, 62, .16); }
  .grounded-answer { margin: 7px 0 12px; padding: 14px 13px; border-left: 3px solid var(--green); border-radius: 14px; background: linear-gradient(180deg, #f6fbf9 0%, #ffffff 100%); box-shadow: 0 10px 28px rgba(25, 61, 52, .08); }
  .grounded-label { align-items: flex-start; flex-wrap: wrap; font-size: 10px; line-height: 1.5; }
  .grounded-label strong { font-size: 12px; }
  .grounded-label span { color: #3f695f; font-size: 9px; }
  .answer-proof { gap: 5px; }
  .answer-proof span { color: #405f58; border-color: #cfe5dd; background: rgba(255,255,255,.82); font-size: 9px; padding: 4px 7px; }
  .grounded-answer .rich-summary { color: #2f4643; border-color: #d7e8e3; background: #fff; font-size: 12px; line-height: 1.72; padding: 10px 11px; border-radius: 10px; }
  .rich-answer-content { gap: 12px; }
  .rich-answer-section h3 { font-size: 13px; line-height: 1.45; }
  .rich-answer-section h3 b { width: 24px; height: 24px; flex: 0 0 auto; font-size: 8px; }
  .grounded-answer li { margin: 9px 0; padding-left: 17px; color: #344a52; font-size: 12px; line-height: 1.78; }
  .grounded-answer li::before { top: 8px; }
  .grounded-answer sup { font-size: 9px; }
  .rich-table-wrap { margin-right: -2px; -webkit-overflow-scrolling: touch; }
  .rich-table { min-width: 520px; font-size: 11px; }
  .rich-table th, .rich-table td { padding: 9px 10px; }
  .evidence-list-title { font-size: 10px; }
  .evidence-ref { min-height: 54px; grid-template-columns: auto minmax(0, 1fr); gap: 4px 7px; padding: 11px 8px 9px; border-radius: 10px; border-top: 1px solid #dce9e5; font-size: 10px; transition: background-color .18s var(--ease-out), transform .18s var(--ease-out); }
  .evidence-ref:active { background: #eef8f4; transform: scale(.99); }
  .evidence-ref b { align-self: start; }
  .evidence-ref span { grid-column: 2; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .evidence-ref em { grid-column: 1 / -1; justify-self: start; margin-left: 0; padding-left: 0; font-size: 10px; }
  .result-list { margin-top: 10px; }
  .file-result { min-height: 76px; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; padding: 12px 8px; border-radius: 12px; transition: transform .18s var(--ease-out), background-color .18s var(--ease-out); }
  .file-result:hover { padding-left: 8px; background: #f7fbfc; }
  .file-result:active { transform: scale(.99); background: #f2f8fa; }
  .file-icon { width: 38px; height: 44px; border-radius: 8px; }
  .file-info strong { font-size: 12px; white-space: normal; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .file-info span { font-size: 10px; line-height: 1.55; }
  .file-score { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 5px; font-size: 11px; }
  .file-score span { font-size: 10px; }
  .assistant-meta { flex-wrap: wrap; gap: 6px 10px; font-size: 10px; line-height: 1.5; }
  .thinking-box { padding: 13px; border-color: #d9e8ec; border-radius: 14px; background: rgba(255,255,255,.9); box-shadow: 0 8px 20px rgba(26,55,68,.06); }
  .thinking-title { font-size: 12px; }
  .composer-area { padding: 9px max(12px, env(safe-area-inset-right)) max(11px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: rgba(250,252,253,.92); border-top-color: rgba(212,228,232,.86); box-shadow: 0 -12px 28px rgba(37,65,76,.08); backdrop-filter: blur(16px); }
  .category-filter { gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .category-filter::-webkit-scrollbar { display: none; }
  .category-filter button { min-height: 34px; flex: 0 0 auto; padding: 0 13px; border-color: #d4e4e8; border-radius: 17px; color: #516771; background: #fff; font-size: 12px; touch-action: manipulation; transition: transform .18s var(--ease-out), background-color .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out); }
  .category-filter button.active { color: #075f80; border-color: #9bcfdd; background: #e8f7fb; }
  .category-filter button:active { transform: scale(.96); }
  .composer { padding: 7px 7px 7px 13px; border-color: #c6dce3; border-radius: 16px; box-shadow: 0 12px 28px rgba(26,55,68,.11); transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .2s var(--ease-out); }
  .composer:focus-within { border-color: #65b6cf; box-shadow: 0 14px 32px rgba(21,125,162,.16); transform: translateY(-1px); }
  .composer textarea { min-height: 38px; max-height: 118px; padding: 7px 0 4px; font-size: 16px; line-height: 1.55; }
  .composer-tools > span { max-width: calc(100% - 54px); overflow: hidden; color: #6b7c84; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
  .composer-tools > span svg { width: 13px; flex: 0 0 auto; }
  .composer-tools button { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(145deg, #1689af, #0d6e92); touch-action: manipulation; box-shadow: 0 8px 18px rgba(21,125,162,.22); transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), opacity .18s var(--ease-out); }
  .composer-tools button:active { transform: scale(.94); box-shadow: 0 4px 10px rgba(21,125,162,.18); }
  .composer-tools button:disabled { opacity: .58; transform: none; box-shadow: none; }
  .composer-tools button svg { width: 18px; }
  .composer-note { display: none; }
  .process-inspector { position: fixed; inset: auto 0 0; z-index: 60; width: 100%; height: min(78dvh, 700px); border: 0; border-radius: 20px 20px 0 0; background: #f7fbfc; box-shadow: 0 -22px 56px rgba(11, 30, 41, .24); transform: translate3d(0, 102%, 0); transition: transform .34s var(--ease-spring); -webkit-overflow-scrolling: touch; will-change: transform; contain: paint; }
  .process-inspector.open { transform: translate3d(0, 0, 0); }
  .process-inspector::before { content: ""; position: sticky; top: 7px; z-index: 2; display: block; width: 42px; height: 4px; margin: 8px auto -12px; border-radius: 999px; background: #c2d3d8; }
  .inspector-header { position: sticky; top: 0; z-index: 1; height: 64px; padding: 8px 16px 0; border-radius: 20px 20px 0 0; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
  .inspector-header button { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-size: 25px; transition: transform .18s var(--ease-out), background-color .18s var(--ease-out); }
  .inspector-header button:active { transform: scale(.94); background: #eef4f6; }
  .connection-panel, .trace-panel, .preview-panel { padding: 15px 16px; }
  .panel-heading > span { font-size: 11px; }
  .panel-heading em { font-size: 10px; }
  .endpoint-row, .connection-grid { border-color: #dce9ed; border-radius: 12px; box-shadow: 0 6px 16px rgba(26,55,68,.04); }
  .endpoint-row { padding: 11px; }
  .endpoint-row span, .connection-grid span, .trace-list span, .trace-list time, .preview-title span, .preview-title small, .preview-path, .preview-excerpt, .preview-chunk > span, .preview-actions button, .empty-preview span { font-size: 10px; }
  .endpoint-row strong, .connection-grid strong, .trace-list strong, .preview-title strong, .preview-excerpt strong, .empty-preview strong { font-size: 12px; }
  .trace-list li { grid-template-columns: 26px 1fr auto; min-height: 60px; }
  .trace-list b { width: 26px; height: 26px; font-size: 9px; transition: background-color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .2s var(--ease-out); }
  .trace-list li.running b { transform: scale(1.04); }
  .trace-list li:not(:last-child)::after { left: 12px; top: 26px; }
  .preview-actions button { min-height: 42px; border-radius: 11px; font-size: 11px; transition: transform .18s var(--ease-out), background-color .18s var(--ease-out); }
  .preview-actions button:active { transform: scale(.98); }
  .toast { bottom: max(14px, env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); font-size: 12px; }
}

@media (max-width: 420px) {
  .company-logo { width: 104px; }
  .header-actions { gap: 4px; }
  .conversation-header h1 { font-size: 14px; }
  .mobile-inspector { padding: 0 10px; font-size: 10.5px; }
  .scope-path span { display: none; }
  .welcome-message { gap: 8px; }
  .welcome-copy h2 { font-size: 21px; }
  .assistant-avatar { width: 28px; height: 28px; }
  .prompt-examples button { grid-template-columns: 38px minmax(0, 1fr) 14px; }
  .grounded-answer { padding: 12px 10px; }
  .composer-tools > span { max-width: calc(100% - 48px); }
}

@media (max-width: 360px) {
  .company-logo { width: 96px; }
  .header-icon { display: none; }
  .conversation-header { padding: 0 12px; }
  .conversation { padding-left: 12px; padding-right: 12px; }
  .mobile-inspector { min-height: 32px; }
  .category-filter button { padding: 0 10px; }
  .composer-tools > span { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
