:root {
  --paper: #f8f5f1;
  --paper-raised: #ffffff;
  --paper-muted: #f1ebe6;
  --ink: #413a37;
  --ink-soft: #554b46;
  --muted: #766d68;
  --line: #e6ddd6;
  --line-strong: #d5c6bd;
  --rose: #9e5c68;
  --rose-deep: #854652;
  --rose-soft: #f4e7e6;
  --sage: #6e8271;
  --sage-soft: #edf2ec;
  --amber: #805c2e;
  --amber-soft: #fff2df;
  --red: #a24646;
  --red-soft: #fbeceb;
  --shadow: 0 6px 24px rgba(75, 52, 39, .045);
  --shadow-raised: 0 22px 65px rgba(65, 44, 32, .16);
  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 24px;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
html { background: var(--paper); }
body { margin: 0; overflow: hidden; color: var(--ink); background: var(--paper); font: 18px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
button, textarea, select { font: inherit; }
button, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: wait; opacity: .55; }
button:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #b77684; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 650; line-height: 1.45; letter-spacing: -.5px; }
h2 { font-size: 25px; font-weight: 650; line-height: 1.4; }
h3 { font-size: 19px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: 0 0 auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 16px; border-radius: var(--radius-small); background: var(--rose); color: white; font-weight: 650; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { --history-width: 340px; --inspector-width: 0px; width: 100%; height: 100dvh; display: grid; grid-template-columns: var(--history-width) minmax(0, 1fr) var(--inspector-width); overflow: hidden; }
body.history-collapsed .app-shell { --history-width: 0px; }
body.inspector-open .app-shell { --inspector-width: 340px; }
.conversation-rail { grid-column: 1; }
.workspace { grid-column: 2; }
.inspector { grid-column: 3; }
.conversation-rail, .workspace, .inspector { min-width: 0; min-height: 0; overflow: hidden; }

/* A quiet, white conversation library. */
.conversation-rail { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; background: #fffdfb; border-right: 1px solid var(--line); }
.rail-header { min-height: 106px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 20px 18px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 43px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; }
.brand-mark img { width: 43px; height: 48px; object-fit: contain; }
.brand-copy { display: grid; min-width: 0; }
.brand-copy strong { font-size: 19px; font-weight: 650; }
.brand-copy span { margin-top: 3px; color: var(--muted); font-size: 14px; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--rose-deep); background: var(--rose-soft); }
.rail-close { display: inline-grid; flex-shrink: 0; }
.rail-primary { padding: 0 18px 22px; }
.new-conversation { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid #d9b9bf; border-radius: 14px; background: var(--rose-soft); color: var(--rose-deep); font-size: 17px; font-weight: 650; }
.new-conversation:hover { background: #efd9dc; border-color: var(--rose); }
.history-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 10px; color: var(--muted); font-size: 15px; }
.count-badge { min-width: 27px; min-height: 27px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; border-radius: 999px; background: var(--paper-muted); color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.conversation-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 16px; scrollbar-width: thin; scrollbar-color: #d4c7bd transparent; }
.conversation-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; margin-bottom: 8px; border: 1px solid transparent; border-radius: 14px; }
.conversation-row:hover { background: #f8f2ed; }
.conversation-row[data-active="true"] { border-color: #e2c7ca; background: #f5e9e8; }
.conversation-select { min-width: 0; min-height: 84px; display: grid; align-content: center; gap: 5px; padding: 13px 0 13px 13px; border: 0; border-radius: inherit; background: transparent; color: inherit; text-align: left; }
.conversation-title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.5; }
.conversation-subtitle { color: var(--muted); font-size: 14px; line-height: 1.4; }
.conversation-delete { width: 36px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; }
.conversation-delete:hover { color: var(--red); background: var(--red-soft); }
.history-empty { padding: 32px 14px; color: var(--muted); text-align: center; font-size: 16px; }
.history-loading { display: grid; gap: 12px; padding: 8px; }
.history-loading span { height: 72px; border-radius: 14px; background: linear-gradient(90deg, #f4eeea, #fcf9f6, #f4eeea); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
.rail-footer { padding: 14px; border-top: 1px solid var(--line); }
.runtime-card { display: flex; align-items: flex-start; gap: 10px; padding: 5px 5px 14px; }
.runtime-dot { width: 9px; height: 9px; margin-top: 9px; flex: 0 0 auto; border-radius: 50%; background: #938881; box-shadow: 0 0 0 4px #efebe6; }
.runtime-dot.ready { background: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }
.runtime-dot.fallback { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.runtime-dot.error { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.runtime-card div { display: grid; min-width: 0; }
.runtime-card strong { font-size: 15px; font-weight: 600; }
.runtime-card span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.data-workbench-link { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); font-size: 16px; background: white; }
.data-workbench-link:hover { border-color: #c99ba4; color: var(--rose-deep); background: var(--rose-soft); }

/* Readable conversation, with the input always in reach. */
.workspace { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; border-right: 1px solid var(--line); background: var(--paper); }
.workspace-header { min-height: 106px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 26px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, .96); z-index: 2; }
.workspace-heading { min-width: 0; display: flex; align-items: center; gap: 10px; }
.conversation-title-wrap { min-width: 0; }
.conversation-title-wrap h1, .conversation-title-wrap p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-title-wrap p { margin-top: 5px; color: var(--muted); font-size: 15px; }
.rail-trigger { display: inline-grid; flex-shrink: 0; }
.workspace-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.toolbar-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink-soft); font-size: 16px; }
.toolbar-button:hover { border-color: #c99ba4; color: var(--rose-deep); background: #fcf3f2; }
.inspector-trigger { display: inline-flex; }
.status-banner { position: absolute; z-index: 12; top: 114px; left: 50%; width: min(650px, calc(100% - 32px)); min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 13px 17px; border: 1px solid #d1b2b6; border-left: 4px solid var(--rose); border-radius: 12px; background: #fffdfc; color: var(--ink); box-shadow: var(--shadow-raised); font-size: 16px; transform: translateX(-50%); }
.status-banner.loading::before { content: ""; width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid #ead3d8; border-top-color: var(--rose); border-radius: 50%; animation: spin .75s linear infinite; }
.status-banner.error { border-color: #cd9696; border-left-color: var(--red); background: var(--red-soft); color: #843939; }
.status-banner.warning { border-color: #dcb98b; border-left-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.message-scroll { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #d4c7bd transparent; }
.message-list { width: min(1050px, 100%); min-height: 100%; display: flex; flex-direction: column; gap: 28px; margin: 0 auto; padding: 26px clamp(18px, 2.2vw, 36px) 34px; }
.empty-state { position: relative; display: flex; flex-direction: column; align-items: center; margin: auto 0; padding: 32px 12px; text-align: center; }
.empty-symbol { width: 90px; height: 78px; margin-bottom: 18px; background: url('lotus.svg') center/contain no-repeat; }
.empty-state h2 { max-width: 560px; font-size: 30px; font-weight: 600; line-height: 1.5; }
.empty-state > p { max-width: 580px; margin-top: 14px; color: var(--muted); font-size: 18px; line-height: 1.9; }
.quick-prompts { width: 100%; display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 32px; }
.quick-prompt { position: relative; min-height: 90px; display: grid; align-content: center; gap: 4px; padding: 17px 48px 17px 22px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--ink); text-align: left; box-shadow: var(--shadow); transition: border-color .16s ease, transform .16s ease; }
.quick-prompt::after { content: "↗"; position: absolute; top: 23px; right: 22px; color: var(--rose); font-size: 22px; }
.quick-prompt strong { font-size: 18px; font-weight: 600; }
.quick-prompt span { color: var(--muted); font-size: 16px; line-height: 1.65; }
.quick-prompt:hover { border-color: #c99ba4; background: #fffafa; transform: translateY(-1px); }
.message-row { position: relative; width: 100%; display: flex; align-items: flex-start; gap: 12px; }
.message-row.user { flex-direction: row-reverse; }
.message-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--rose); font-size: 16px; font-weight: 600; }
.message-row.assistant .message-avatar { font-size: 0; background: white url('lotus.svg') center/29px auto no-repeat; }
.message-row.user .message-avatar { background: var(--rose-soft); color: var(--rose-deep); border-color: #e2c7ca; }
.message-card { max-width: calc(100% - 50px); min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px 22px 22px 22px; background: white; box-shadow: var(--shadow); }
.message-row.user .message-card { max-width: min(650px, calc(100% - 50px)); border-color: #e6ced0; border-radius: 22px 4px 22px 22px; background: var(--rose-soft); }
.message-card[data-selected="true"] { border-color: #c799a2; box-shadow: 0 0 0 2px rgba(158, 92, 104, .06), var(--shadow); }
.message-head { min-height: 50px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; padding: 8px 13px 8px 20px; border-bottom: 1px solid var(--line); }
.message-row.user .message-head { border-bottom-color: #e6ced0; }
.message-role { font-size: 15px; font-weight: 650; }
.message-provider { color: var(--muted); font-size: 14px; }
.message-head-actions { margin-left: auto; display: flex; gap: 2px; }
.message-action { min-height: 36px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; }
.message-action:hover { background: var(--rose-soft); color: var(--rose-deep); }
.message-content { padding: 22px 24px 24px; overflow-wrap: anywhere; }
.user-content { font-size: 18px; line-height: 1.9; white-space: pre-wrap; }
.assistant-content { color: var(--ink); font-size: 18px; line-height: 1.95; }
.assistant-content p + p, .assistant-content ul + p, .assistant-content p + ul { margin-top: 18px; }
.assistant-content ul { margin: 12px 0 0; padding-left: 24px; }
.assistant-content li + li { margin-top: 12px; }
.citation-button { position: relative; min-height: 28px; display: inline-flex; align-items: center; margin: 0 3px; padding: 0 6px; border: 1px solid #e2c7ca; border-radius: 6px; background: #fcf0f1; color: var(--rose-deep); font-size: 14px; font-weight: 650; vertical-align: baseline; }
.citation-button::before { content: ""; position: absolute; inset: -7px -3px; }
.citation-button:hover { background: #eed3d9; }
.route-line { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 20px; }
.route-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 999px; background: var(--sage-soft); color: #536656; font-size: 14px; }
.route-pill.fallback { background: var(--amber-soft); color: var(--amber); }
.message-pending .message-card { border-style: dashed; background: #fffdfa; }
.pending-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--ink-soft); }
.typing-dots { display: inline-flex; gap: 5px; }
.typing-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); animation: bounce 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .12s; }
.typing-dots i:nth-child(3) { animation-delay: .24s; }
.elapsed { margin-left: auto; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.message-error .message-card { border-color: #d9b3b1; background: #fff8f6; }
.message-error .message-avatar { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.error-action { margin-top: 14px; min-height: 44px; padding: 0 14px; border: 1px solid var(--red); border-radius: 10px; background: white; color: var(--red); font-weight: 600; }
.composer-shell { min-width: 0; padding: 14px clamp(18px, 2.2vw, 36px) 14px; border-top: 1px solid var(--line); background: #fffcf9; }
.composer { width: min(950px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 auto; overflow: hidden; border: 1px solid #ceb5b8; border-radius: 20px; background: white; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(158, 92, 104, .1); }
.composer textarea { width: 100%; min-height: 75px; max-height: 146px; resize: none; padding: 16px 20px 8px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; line-height: 1.75; }
.composer textarea::placeholder { color: #81746e; }
.composer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 10px 10px 14px; }
.retrieval-controls { display: flex; align-items: center; gap: 2px; }
.retrieval-select { min-height: 40px; display: flex; align-items: center; gap: 5px; padding: 0 5px; color: var(--muted); border-radius: 9px; }
.retrieval-select > span { font-size: 14px; white-space: nowrap; }
.retrieval-select:hover { background: var(--paper); }
.retrieval-select select { min-height: 40px; max-width: 114px; border: 0; outline: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.retrieval-select option { color: var(--ink); background: white; }
.retrieval-help-toggle { width: 40px; min-height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--rose-deep); font-size: 20px; }
.retrieval-help-toggle:hover, .retrieval-help-toggle[aria-expanded="true"] { background: var(--rose-soft); }
.retrieval-help { width: min(950px, 100%); margin: 8px auto 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--muted); font-size: 14px; }
.retrieval-help h3 { margin-bottom: 6px; font-size: 16px; color: var(--rose-deep); }
.retrieval-scroll-hint { display: none; }
.retrieval-help-body { max-height: min(34dvh, 280px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px 4px; }
.retrieval-help p { line-height: 1.7; }
.retrieval-presets { display: grid; gap: 6px; list-style: none; padding: 0; margin: 10px 0; }
.retrieval-presets li { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 5px 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; }
.retrieval-presets li[aria-current="true"] { border-color: #ddbdc4; background: var(--rose-soft); }
.retrieval-presets strong { color: var(--ink-soft); }
.retrieval-example { padding-top: 8px; border-top: 1px solid var(--line); }
.retrieval-help .retrieval-footnote { margin-top: 8px; color: var(--rose-deep); }
.char-count { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.shortcut-hint { color: var(--muted); font-size: 14px; }
.send-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 22px; border: 1px solid var(--rose); border-radius: 12px; background: var(--rose); color: white; font-size: 17px; font-weight: 600; }
.send-button:hover { border-color: var(--rose-deep); background: var(--rose-deep); }
.scope-note { width: min(950px, 100%); display: flex; align-items: flex-start; gap: 8px; margin: 10px auto 0; padding: 9px 12px; border-radius: 10px; background: #f3eee8; color: #675a51; font-size: 14px; line-height: 1.6; }
.scope-note strong { flex-shrink: 0; color: #5e5148; font-weight: 650; }

/* Evidence remains next to the answer, with enough space for real text. */
.inspector { display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: white; }
.inspector-header { min-height: 106px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); background: #fffdfb; }
.inspector-header h2 { font-size: 25px; }
.eyebrow { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.inspector-close { display: inline-grid; flex-shrink: 0; }
.inspector-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: white; }
.inspector-tab { position: relative; min-height: 46px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 16px; font-weight: 550; }
.inspector-tab:hover { color: var(--rose-deep); background: #fcf5f4; }
.inspector-tab.active { color: var(--rose-deep); background: var(--rose-soft); font-weight: 650; }
.inspector-tab span { margin-left: 3px; font-size: 14px; }
.inspector-body { min-height: 0; overflow: hidden; }
.inspector-panel { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 16px; scrollbar-width: thin; scrollbar-color: #d4c7bd transparent; }
.panel-empty { display: grid; place-items: center; min-height: 260px; padding: 24px 14px; color: var(--muted); text-align: center; font-size: 16px; }
.panel-empty strong { display: block; margin-bottom: 12px; color: var(--ink); font-size: 20px; font-weight: 600; }
.evidence-list { display: grid; gap: 16px; }
.evidence-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: white; transition: border-color .16s ease, background .16s ease; }
.evidence-card.highlighted { border-color: var(--rose); background: #fff4f3; box-shadow: 0 0 0 3px rgba(158, 92, 104, .1); }
.evidence-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.evidence-id { color: var(--rose-deep); font-size: 16px; font-weight: 700; }
.evidence-kind { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; }
.evidence-text { margin-top: 14px; color: var(--ink); font-size: 17px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence-source { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.evidence-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.meta-tag { display: inline-flex; min-height: 29px; align-items: center; padding: 3px 8px; border-radius: 7px; background: var(--sage-soft); color: #536656; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.meta-tag.condition { background: var(--amber-soft); color: var(--amber); }
.raw-details { margin-top: 10px; }
.raw-details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--rose-deep); font-size: 14px; }
.raw-details summary::after { content: "⌄"; margin-left: auto; }
.raw-details[open] summary::after { content: "⌃"; }
.raw-details pre { max-height: 320px; margin: 0; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 14px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.process-list { position: relative; display: grid; gap: 0; }
.process-list::before { content: ""; position: absolute; top: 25px; bottom: 25px; left: 17px; width: 1px; background: var(--line-strong); }
.process-step { position: relative; padding-left: 45px; }
.process-step + .process-step { margin-top: 12px; }
.process-step > summary { min-height: 62px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; list-style: none; cursor: pointer; }
.process-step > summary::-webkit-details-marker { display: none; }
.process-dot { position: absolute; left: 0; width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid #d9b9bf; border-radius: 50%; background: white; color: var(--rose-deep); font-size: 15px; z-index: 1; }
.process-step[open] .process-dot { border-color: var(--rose); background: var(--rose); color: white; }
.process-title { min-width: 0; flex: 1 1 150px; }
.process-title strong { display: block; font-size: 16px; }
.process-title span { display: block; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process-status { color: #536656; font-size: 14px; white-space: nowrap; }
.process-status::after { content: "⌄"; margin-left: 5px; color: var(--muted); }
.process-step[open] .process-status::after { content: "⌃"; }
.process-content { padding: 10px 0 14px; }
.process-summary { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fcf9f5; }
.process-summary + .process-summary { margin-top: 10px; }
.process-summary-title { margin-bottom: 8px; color: var(--rose-deep); font-size: 15px; font-weight: 600; }
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; min-height: 29px; padding: 4px 9px; border-radius: 8px; background: var(--sage-soft); color: #536656; font-size: 14px; overflow-wrap: anywhere; }
.chip.muted { background: var(--paper-muted); color: var(--muted); }
.chip.warning { background: var(--amber-soft); color: var(--amber); }
.mini-record { padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-record:last-child { border-bottom: 0; }
.mini-record strong { font-size: 16px; }
.mini-record p { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.context-panel { display: grid; gap: 16px; }
.context-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.context-card h3 { margin-bottom: 16px; font-size: 20px; font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.metric { padding: 12px; border-radius: 10px; background: var(--paper); }
.metric span { display: block; color: var(--muted); font-size: 14px; }
.metric strong { display: block; margin-top: 5px; font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.context-list { display: grid; gap: 14px; }
.context-row { display: grid; gap: 6px; }
.context-row > span { color: var(--rose-deep); font-size: 14px; font-weight: 600; }
.context-row > div { color: var(--ink-soft); font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.limits-list { margin: 0; padding-left: 21px; color: var(--amber); font-size: 15px; line-height: 1.8; }
.limits-list li + li { margin-top: 10px; }
.drawer-scrim { position: fixed; z-index: 30; inset: 0; background: rgba(65, 47, 40, .28); backdrop-filter: blur(2px); }
.dialog-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(65, 47, 40, .35); backdrop-filter: blur(3px); }
.dialog-card { width: min(470px, 100%); max-height: calc(100dvh - 44px); overflow-y: auto; display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow-raised); }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); }
.dialog-card p { margin-top: 10px; color: var(--muted); font-size: 16px; }
.dialog-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.secondary-button, .danger-button { min-height: 46px; padding: 0 18px; border-radius: 12px; font-size: 16px; }
.secondary-button { border: 1px solid var(--line-strong); background: white; color: var(--ink-soft); }
.danger-button { border: 1px solid var(--red); background: var(--red); color: white; }
.danger-button:hover { background: #873d3d; }

@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 70%, 100% { transform: translateY(0); opacity: .5; } 35% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 1399px) and (min-width: 1180px) {
  .rail-header { padding: 18px 12px; }
  .workspace-header { padding: 18px; gap: 10px; }
  .workspace-header h1 { font-size: 26px; }
  .workspace-actions .button-label { display: none; }
  .message-list { padding-right: 18px; padding-left: 18px; }
  .message-avatar { display: none; }
  .message-card { max-width: 100%; }
  .message-row.user .message-card { max-width: 94%; }
}
@media (max-width: 1179px) {
  .app-shell { grid-template-columns: var(--history-width) minmax(0, 1fr); }
  .inspector { position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; width: min(420px, calc(100vw - 28px)); border-left: 1px solid var(--line); box-shadow: var(--shadow-raised); transform: translateX(104%); transition: transform .2s ease; }
  body.inspector-open .inspector { transform: translateX(0); }
  .inspector-close { display: inline-grid; }
  body.inspector-open .drawer-scrim { display: block !important; }
  .workspace-actions .button-label { display: none; }
  .workspace-header { padding-right: 18px; padding-left: 18px; }
}
@media (max-width: 799px) {
  body { font-size: 17px; }
  .app-shell { display: block; }
  .workspace { width: 100%; height: 100dvh; border-right: 0; }
  .conversation-rail { position: fixed; z-index: 46; top: 0; left: 0; bottom: 0; width: min(340px, calc(100vw - 36px)); box-shadow: var(--shadow-raised); transform: translateX(-104%); transition: transform .2s ease; }
  body.history-open .conversation-rail { transform: translateX(0); }
  body.history-open .drawer-scrim { display: block !important; }
  .rail-close, .rail-trigger { display: inline-grid; }
  .workspace-header { min-height: 82px; padding: 12px; gap: 8px; }
  .workspace-heading { gap: 4px; }
  .workspace-heading .icon-button { width: 38px; }
  .conversation-title-wrap h1 { font-size: 23px; }
  .conversation-title-wrap p { font-size: 14px; }
  .toolbar-button { width: 44px; padding: 0; }
  .inspector-trigger > span:not(.count-badge), .toolbar-button .button-label { display: none; }
  .inspector-trigger .count-badge { min-width: 19px; padding: 0 2px; background: transparent; }
  .inspector-trigger { gap: 1px; }
  .workspace-actions { gap: 2px; }
  .message-list { gap: 24px; padding: 20px 16px 28px; }
  .message-avatar { display: none; }
  .message-card { max-width: 100%; }
  .message-row.user .message-card { max-width: 94%; }
  .message-content { padding: 18px; }
  .assistant-content, .user-content { font-size: 17px; line-height: 1.9; }
  .message-head { padding: 8px 10px 8px 16px; gap: 4px 8px; }
  .message-head .message-provider { font-size: 14px; }
  .message-head .message-provider:first-of-type { display: none; }
  .message-action { padding: 0 5px; }
  .action-label { display: none; }
  .message-action { width: 34px; justify-content: center; }
  .empty-state { margin: auto 0; padding: 12px 0 20px; }
  .empty-symbol { width: 74px; height: 68px; margin-bottom: 16px; }
  .empty-state h2 { font-size: 27px; }
  .empty-state > p { font-size: 17px; margin-top: 12px; }
  .quick-prompts { margin-top: 24px; }
  .quick-prompt { padding: 15px 40px 15px 17px; }
  .quick-prompt span { font-size: 15px; }
  .quick-prompt::after { right: 16px; }
  .composer-shell { padding: 10px 12px 8px; }
  .composer { border-radius: 17px; }
  .composer textarea { min-height: 66px; padding: 12px 15px 5px; font-size: 17px; }
  .composer-actions { padding: 4px 8px 8px 10px; gap: 5px; }
  .shortcut-hint { display: none; }
  .send-button { padding: 0 15px; min-height: 44px; font-size: 16px; }
  .retrieval-select { padding: 0; gap: 1px; }
  .retrieval-select select { max-width: 103px; font-size: 14px; }
  .retrieval-controls { flex: 1 0 100%; }
  .retrieval-presets li { grid-template-columns: 1fr; }
  .retrieval-scroll-hint { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
  .char-count { margin-left: 0; margin-right: auto; font-size: 14px; }
  .scope-note { padding: 8px 10px; font-size: 14px; gap: 6px; margin-top: 8px; }
  .status-banner { top: 90px; }
  .inspector-header { min-height: 88px; padding: 16px 20px; }
  .inspector-panel { padding: 14px; }
  .dialog-card { grid-template-columns: 1fr; padding: 22px; }
}
@media (max-height: 760px) and (min-width: 800px) {
  .rail-header, .workspace-header, .inspector-header { min-height: 90px; }
  .empty-state { padding-top: 14px; padding-bottom: 14px; }
  .empty-symbol { width: 64px; height: 55px; margin-bottom: 12px; }
  .quick-prompts { margin-top: 22px; }
  .quick-prompt { min-height: 78px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
