:root {
  color-scheme: light;
  --ink: #192641;
  --sub: #415270;
  --muted: #536482;
  --line: #dce5f5;
  --paper: #f3f7ff;
  --white: #fff;
  --brand-blue: #264fd6;
  --brand-blue-hover: #183fbd;
  --pale: #e9f0ff;
  --nav-width: 232px;
  --gutter: clamp(28px, 3.9vw, 64px);
  --measure: 840px;
  --radius: 7px;
  background: white;
  color: var(--ink);
  font: 15px/1.55 "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select, summary { cursor: pointer; }
button { border: 0; background: transparent; }
button:disabled, select:disabled { cursor: default; opacity: .65; }
button, a, input, select, textarea { touch-action: manipulation; }
a { text-decoration: none; color: inherit; }
h1, h2, h3, p, blockquote, dl { margin: 0; }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 3px; }
::selection { background: #dce7ff; color: var(--ink); }
.ui-icon { display: inline-block; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; inset: 8px auto auto 8px; z-index: 100; background: white; color: var(--brand-blue); padding: 9px 14px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  width: var(--nav-width); height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #edf3ff 0, var(--paper) 48%); border-right: 1px solid var(--line);
}
.brand { min-height: 94px; display: flex; align-items: center; flex: none; gap: 11px; padding: 16px 21px; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: var(--brand-blue); color: white; display: grid; place-items: center; }
.brand-mark svg { width: 29px; height: 29px; }
.brand strong, .brand small, .profile strong, .profile small { display: block; }
.brand strong { font-size: 20px; font-weight: 720; letter-spacing: .025em; line-height: 1.25; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; margin-top: 3px; }
.sidebar-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.nav-actions { padding: 4px 14px 17px; display: grid; gap: 6px; }
.nav-item, .new-question {
  display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 12px;
  border-radius: 6px; font-size: 14px; font-weight: 520; text-align: left;
}
.nav-item { color: var(--sub); }
.nav-item:hover, .history-row:hover { background: #eaf1ff; }
.nav-item[aria-current], .history-row[aria-current] { color: var(--brand-blue); background: #e3ecff; font-weight: 650; }
.new-question { color: var(--brand-blue); background: var(--pale); border: 1px solid #cfddff; font-weight: 630; }
.new-question:hover { background: #dfeaff; border-color: #9fb8f4; }
.history-section { min-height: 0; flex: 1; display: flex; flex-direction: column; margin: 0 14px; border-top: 1px solid var(--line); padding-top: 22px; }
.history-section h2 { padding: 0 7px; color: var(--muted); font-size: 12px; font-weight: 630; margin-bottom: 9px; }
.history-search { display: flex; flex: none; align-items: center; gap: 7px; height: 34px; padding: 0 9px; margin: 0 2px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: white; }
.history-search input { min-width: 0; width: 100%; border: 0; padding: 0; outline: none; background: transparent; font-size: 12px; }
.history-search:focus-within { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: #5c6e8f; opacity: 1; }
.history-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 0 14px; scrollbar-width: thin; }
.history-day, .history-note { margin: 15px 7px 5px; color: var(--muted); font-size: 11.5px; }
.history-note { overflow-wrap: anywhere; }
.history-row { display: flex; align-items: center; gap: 8px; min-height: 33px; padding: 6px 7px; border-radius: 5px; color: var(--sub); font-size: 12.5px; }
.history-row svg { color: #60769b; }
.history-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row:focus-visible { outline-offset: -2px; }
.text-action { color: var(--brand-blue); font-size: 12px; padding: 6px 8px; font-weight: 600; }
.text-action:hover { text-decoration: underline; }
.sidebar-footer { flex: none; padding: 8px 14px max(12px, env(safe-area-inset-bottom)); }
.admin-entry { margin-bottom: 9px; font-size: 13px; }
.admin-entry svg:last-child { margin-left: auto; color: var(--muted); }
.user-area { border-top: 1px solid var(--line); padding: 15px 6px 3px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid #d4dfff; border-radius: 50%; background: #eaf1ff; color: #3658ac; }
.profile { min-width: 0; }
.profile strong { font-size: 12.5px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.user-area button { margin-left: auto; }
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; min-width: 0; margin-left: var(--nav-width); }
#main { flex: 1; min-height: 0; min-width: 0; outline: 0; overflow: auto; }
.mobile-bar, .nav-close, .nav-backdrop { display: none; }
.icon-button { place-items: center; width: 34px; height: 34px; color: var(--sub); border-radius: 5px; }
.icon-button:hover { background: #eaf1ff; }
.connection { flex: none; padding: 7px var(--gutter); background: #edf3ff; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--sub); }
.workspace { padding: 40px var(--gutter); max-width: calc(960px + 2 * var(--gutter)); margin: 0; }
.ask-workspace { min-width: 0; background: #fcfdff; }
.body-column { width: min(100%, var(--measure)); min-width: 0; }
.ask-workspace .body-column { margin-inline: auto; }
.landing { min-height: 100%; padding: clamp(70px, 17vh, 155px) var(--gutter) 36px; background: radial-gradient(ellipse at 54% 0%, #eaf2ff, transparent 65%); }
.landing-heading { margin-bottom: 26px; }
.work-title { color: var(--ink); font-size: clamp(26px, 2.1vw, 32px); line-height: 1.4; font-weight: 650; letter-spacing: .01em; }
.landing-heading p { margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.composer { min-width: 0; width: 100%; border: 1px solid #cbd9f3; border-radius: 12px; background: white; box-shadow: 0 8px 24px #264fd60a; }
.composer:focus-within { border-color: #7193f5; }
.question-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 20px; }
.question-examples button { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; min-width: 0; padding: 11px 20px 12px 0; text-align: left; border-top: 1px solid var(--line); color: var(--sub); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.question-examples button:hover { color: var(--brand-blue); border-color: var(--brand-blue); }
.example-label { display: block; margin-bottom: 3px; color: var(--brand-blue); font-size: 12px; font-weight: 630; }
.question-examples .ui-icon { position: absolute; right: 2px; top: 13px; color: var(--brand-blue); }
.composer:has(#question:focus-visible) { outline: 2px solid #4268e3; outline-offset: -2px; }
#question { display: block; width: 100%; border: 0; outline: none; resize: none; border-radius: 12px; padding: 17px 18px 5px; height: 94px; background: transparent; font-size: 15px; line-height: 1.65; }
.composer-tools, .send-tools, .mode-picker { display: flex; align-items: center; }
.composer-tools { justify-content: space-between; gap: 8px; padding: 9px 13px 12px; }
.send-tools { gap: 11px; }
.key-hint { color: var(--muted); font: 11px/1.5 Consolas, "Segoe UI", monospace; }
.mode-picker { position: relative; gap: 5px; border-radius: 5px; color: var(--sub); }
.mode-picker svg { position: absolute; pointer-events: none; }
.mode-picker svg:first-child { left: 8px; color: var(--brand-blue); }
.mode-picker svg:last-child { right: 6px; }
.mode-picker select { appearance: none; background: #f0f5ff; border: 1px solid #dce6fb; border-radius: inherit; font-size: 12px; font-weight: 550; min-height: 31px; padding: 5px 24px 5px 31px; }
.mode-picker select:hover { border-color: #acc2fa; }
.primary-btn, .secondary-btn, .sources-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; font-size: 13px; font-weight: 600; min-height: 35px; padding: 7px 14px; }
.primary-btn { color: white; background: var(--brand-blue); }
.primary-btn:hover { background: var(--brand-blue-hover); }
.send-btn { min-width: 76px; }
.stop-mark { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.secondary-btn, .sources-button { color: var(--brand-blue); background: white; border: 1px solid #cedbf6; }
.secondary-btn:hover, .sources-button:hover { background: var(--pale); }
.active-ask { height: 100%; display: flex; flex-direction: column; }
.session-heading { display: flex; align-items: center; gap: 9px; flex: none; min-height: 58px; padding: 10px var(--gutter); border-bottom: 1px solid var(--line); color: var(--brand-blue); }
.session-heading .work-title { font-size: 14px; font-weight: 600; }
.answer-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: auto; padding: clamp(26px, 4.4vh, 42px) var(--gutter) 30px; }
.answer-scroll:focus-visible { outline-offset: -3px; }
.result-panel { display: flex; flex-direction: column; gap: 22px; outline: none; }
.result-panel + .result-panel { margin-top: 34px; }
.asked { align-self: flex-end; max-width: min(78%, 40rem); min-width: 0; }
.question-meta { text-align: end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.asked h2 {
  margin-top: 5px; padding: 10px 15px; border: 1px solid #d5e2ff; border-radius: 14px 4px 14px 14px;
  background: var(--pale); color: var(--ink); font-size: 15px; font-weight: 550; line-height: 1.7;
  text-align: start; white-space: pre-wrap; overflow-wrap: anywhere;
}
.answer-section { align-self: flex-start; width: min(91%, 46rem); min-width: 0; }
.answer-title { display: flex; align-items: center; gap: 9px; }
.answer-title h3 { font-size: 15px; font-weight: 650; }
.answer-symbol { width: 27px; height: 27px; border-radius: 6px; display: grid; place-items: center; color: var(--brand-blue); background: var(--pale); }
.answer-status { margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.answer-copy { max-width: 74ch; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; color: var(--ink); }
.answer-copy:not(:empty) { margin-top: 12px; }
.answer-copy > * { margin: 0; }
.answer-copy > * + * { margin-top: .85em; }
.answer-copy > * + h4 { margin-top: 1.2em; }
.answer-copy h4 { font-size: 1.05em; line-height: 1.5; font-weight: 650; }
.answer-copy h4 + * { margin-top: .35em; }
.answer-copy :is(ul,ol) { padding-inline-start: 1.75em; }
.answer-copy li { padding-inline-start: .15em; }
.answer-copy li + li { margin-top: .35em; }
.answer-copy li::marker { color: var(--sub); }
.answer-copy blockquote { padding-left: 12px; border-left: 2px solid #a6baf4; color: var(--sub); }
.answer-copy code { background: #edf3ff; padding: 1px 4px; border-radius: 3px; font-family: Consolas, monospace; font-size: .92em; }
.answer-copy pre { overflow-x: auto; padding: 12px; background: #edf3ff; border-radius: 5px; }
.answer-copy pre code { padding: 0; }
.answer-sources:not(:empty) { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.returned-table { margin-top: 17px; max-width: 100%; overflow-x: auto; }
.returned-table table { border-collapse: collapse; font-size: 13px; }
.returned-table :is(th,td) { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; min-width: 5em; }
.returned-table th { color: var(--sub); background: #f1f5ff; }
.returned-table caption { text-align: left; padding: 5px 0; color: var(--muted); }
.sources-button { font-size: 12.5px; min-height: 33px; gap: 7px; padding: 5px 10px; }
.source-count { min-width: 18px; border-radius: 4px; padding: 0 4px; color: var(--brand-blue); background: var(--pale); font: 600 11px/18px "Segoe UI", sans-serif; }
.no-sources { color: var(--muted); font-size: 12px; }
.composer-dock { flex: none; padding: 14px var(--gutter) max(22px, env(safe-area-inset-bottom)); background: #fcfdff; }
.composer-dock #question { height: 60px; padding-top: 12px; }
.composer-dock .composer-tools { padding-top: 4px; }
.follow-up { display: grid; gap: 6px; justify-items: start; max-width: 380px; margin-top: 18px; }
.follow-up input, .follow-up select { width: 100%; max-width: 100%; border: 1px solid #cad7f1; background: white; border-radius: 5px; padding: 8px; }
.follow-up label { display: block; font-size: 13px; color: var(--sub); font-weight: 550; }
.follow-up button { margin-top: 7px; }
.loading-panel, .reading-state, .error-state { color: var(--muted); font-size: 14px; }
.loading-panel { padding: 40px var(--gutter); }
.reading-state { display: flex; align-items: center; gap: 9px; padding-block: 24px; }
.error-state { padding-block: 22px; }
.error-state h1, .error-state h2 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.error-state button, #retry-result { margin-top: 12px; }
.toast { position: fixed; right: 18px; bottom: 16px; z-index: 100; background: white; color: var(--ink); border: 1px solid #bdcdef; border-radius: 6px; font-size: 13px; max-width: min(420px, calc(100vw - 28px)); padding: 10px 15px; overflow-wrap: anywhere; }
.toast.is-error { border-left: 3px solid var(--brand-blue); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) and (min-width: 761px) {
  :root { --nav-width: 220px; --gutter: 26px; }
}
@media (max-width: 760px) {
  :root { --nav-width: min(280px, 85vw); --gutter: clamp(18px, 4.5vw, 28px); }
  .shell { margin-left: 0; }
  .mobile-bar { flex: none; height: 49px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 620; }
  .mobile-bar .icon-button, .nav-close { display: grid; width: 42px; height: 42px; }
  .mobile-divider { width: 1px; height: 14px; background: var(--line); }
  .mobile-context { color: var(--muted); font-size: 12px; font-weight: 450; }
  .nav-close { margin-left: auto; }
  .sidebar { visibility: hidden; transform: translateX(-101%); transition: transform .16s ease, visibility .16s; }
  .menu-open .sidebar { visibility: visible; transform: translateX(0); }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 19; background: #14274c48; }
  .brand { min-height: 79px; }
  .history-row, .nav-item, .new-question { min-height: 42px; }
  .history-search { height: 39px; }
  .history-search input { font-size: 16px; }
  .history-row { font-size: 13px; }
  .landing { padding-top: 40px; }
  .question-examples { grid-template-columns: 1fr; gap: 0; margin-top: 15px; }
  .question-examples button { flex-direction: row; align-items: baseline; gap: 12px; min-height: 45px; }
  .example-label { flex: none; }
  .landing-heading { margin-bottom: 21px; }
  .work-title { font-size: 26px; }
  .landing-heading p { font-size: 13px; max-width: 32em; }
  #question { height: 99px; padding: 14px 13px 5px; font-size: 16px; }
  .key-hint { display: none; }
  .composer-tools { padding: 7px 10px 10px; }
  .send-btn, .mode-picker select, .sources-button { min-height: 40px; }
  .session-heading { min-height: 43px; }
  .answer-scroll { padding-top: 23px; }
  .result-panel { gap: 16px; }
  .result-panel + .result-panel { margin-top: 25px; }
  .asked { max-width: 87%; }
  .answer-section { width: 100%; }
  .asked h2 { padding: 9px 12px; }
  .composer-dock { padding: 8px var(--gutter) max(10px, env(safe-area-inset-bottom)); }
  .composer-dock #question { height: 49px; }
  .workspace { padding-block: 25px; }
}
@media (max-height: 500px) {
  .brand { min-height: 60px; padding-block: 8px; }
  .sidebar-footer { padding-block: 4px; }
  .user-area { padding-block: 5px; }
  .nav-actions { padding-block: 0 5px; gap: 0; }
  .history-section { padding-top: 7px; }
  .landing { padding-top: 18px; }
  .session-heading { min-height: 32px; padding-block: 4px; }
  .active-ask .composer-dock { padding-block: 4px; }
  .active-ask #question { height: 38px; padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
