:root {
  --cream: #ffffff;
  --cream2: #f7f8fa;
  --ink: #252731;
  --secondary: #4e5665;
  --muted: #727b89;
  --line: #ebecf0;
  --accent: #3e63dd;
  --accent2: #3e63dd;
  --blue: #3e63dd;
  --soft: #eef2ff;
  --danger: #b83e4b;
  --queued: #b5812a;
  --running: #3e63dd;
  --done: #739985;
  --card: #ffffff;
  --rail: #f7f8fa;
  --shadow: 0 5px 24px #28345307, 0 1px 3px #28345303;
  --on-accent: #ffffff;
  --input: #fff;
  --bubble: #f3f4f8;
  --bubble-fg: #252731;
  --warn-bg: #fff7ed;
  --warn-fg: #9a3412;
  --selected: #e9edf8;
  --hover: #eeeff3;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --label-user: #3e63dd;
  --label-assistant: #3656b4;
  --label-system: #727b89;
  --label-context: #619780;
  --label-tool: #b5812a;
  --primary: #3e63dd;
  --primary-strong: #3656b4;
  --accent-red: #3e63dd;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --foreground: #252731;
  --muted-foreground: #727b89;
  --border: #ebecf0;
  --side: 248px;
  --left-w: 248px;
  --preview: 420px;
  --content: clamp(760px, 65vw, 1000px);
  --gutter: clamp(24px, 3vw, 48px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
html[data-theme="dark"] {
  --cream: #202329;
  --cream2: #191c21;
  --ink: #e7e9ef;
  --secondary: #bdc4d1;
  --muted: #9aa4b5;
  --line: #343943;
  --accent: #9db7ff;
  --accent2: #9db7ff;
  --blue: #9db7ff;
  --soft: #303e60;
  --danger: #ff9ca7;
  --queued: #d4a04a;
  --running: #9db7ff;
  --done: #b0d9c3;
  --card: #282c34;
  --rail: #191c21;
  --shadow: none;
  --on-accent: #202b43;
  --input: #282c34;
  --bubble: #2b3039;
  --bubble-fg: #e7e9ef;
  --warn-bg: #2a2418;
  --warn-fg: #e8d5a3;
  --selected: #2c3750;
  --hover: #303641;
  --label-user: #9db7ff;
  --label-assistant: #c0d0ff;
  --label-system: #9aa4b5;
  --label-context: #b0d9c3;
  --label-tool: #f59e0b;
  --primary: #a5bbf3;
  --primary-strong: #9db7ff;
  --accent-red: #9db7ff;
  --surface: #202329;
  --surface-raised: #282c34;
  --foreground: #e7e9ef;
  --muted-foreground: #9aa4b5;
  --border: #414754;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { height: 100%; margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}
input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
}
.authBody {
  display: grid;
  place-items: center;
  min-height: 100%;
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(8, 145, 178, 0.10), transparent 60%),
    var(--cream);
}
html[data-theme="dark"] .authBody {
  background: var(--cream);
}
.authCard {
  width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.brandRow { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brandName { font-size: 18px; font-weight: 650; }
.logoMark {
  width: 40px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  color: #f4f4f5;
  display: grid;
  place-items: center;
  overflow: hidden;
  line-height: 0;
}
.logoMark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.logoMark.sm {
  width: 40px;
  height: 28px;
  margin: 8px 0 10px;
}
.logoMark.lg {
  width: 196px;
  height: 84px;
  border-radius: 12px;
}
.seg { display: flex; gap: 6px; margin: 8px 0 16px; }
.segBtn, .btn, .pill, .sendBtn, .tabBtn, .railBtn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
}
.segBtn { padding: 6px 12px; }
.segBtn.active, .railBtn.active {
  background: var(--cream2);
}
.btn { padding: 6px 10px; font-size: 12px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.wide { width: 100%; margin-top: 12px; }
.input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  color: var(--ink);
  font-size: 13px;
}
label { display: block; margin: 10px 0 6px; font-size: 12px; color: var(--muted); }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.shell {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}
body.nav-collapsed .shell,
html.nav-collapsed-html .shell {
  /* sidebar slides away; topbar toggle remains */
}
body.nav-collapsed .leftCol,
html.nav-collapsed-html .leftCol {
  margin-left: calc(-1 * var(--left-w, var(--side)));
  visibility: hidden;
  pointer-events: none;
  border-right: none;
}
body.nav-collapsed .colResize,
html.nav-collapsed-html .colResize {
  display: none;
}
.colResize {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 6;
}
.colResize::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  border-radius: 99px;
  background: transparent;
}
.colResize:hover::after,
.colResize.drag::after {
  background: var(--accent);
}
.rail { display: none !important; }
.sidebar,
.leftCol {
  width: var(--left-w, var(--side));
  min-width: var(--left-w, var(--side));
  flex-shrink: 0;
  background: var(--cream2);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 27px 16px 14px;
  border-right: 1px solid #eff0f3;
  transition: margin .2s;
}
.railBtn {
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  display: grid; place-items: center;
}
.railBtn:hover { background: var(--cream2); color: var(--ink); }
.railBtn.active { background: #eff6ff; color: var(--accent); }
.railGrow { flex: 1; }
.leftCol, .centerCol {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.centerCol {
  flex: 1;
  min-width: 0;
  background: var(--cream);
  position: relative;
}
.rightCol,
.preview {
  width: var(--preview);
  min-width: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e7eaf1;
  background: #fafbfe;
}
.preview[hidden] { display: none !important; }
.topbar .sidebarToggle { display: none; }
body.nav-collapsed .topbar .sidebarToggle,
html.nav-collapsed-html .topbar .sidebarToggle { display: inline-flex; }
.leftHead, .crumb, .rightTabs, .composer {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.composer { border-bottom: none; border-top: 1px solid var(--line); background: rgba(255,255,255,.84); backdrop-filter: blur(12px); padding: 10px 48px 18px; }
.tokenBanner { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: #f4f6fb; color: #3c4454; font-size: 13px; }
.tokenBanner[hidden] { display: none; }
.tokenBanner button { border: 1px solid #d5dbe8; background: #fff; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.tokenBanner.blocked { background: #f8efe8; }
.leftHead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.leftHeadMain { display: flex; align-items: center; gap: 8px; min-width: 0; }
.navCollapse {
  width: 28px; height: 28px; flex-shrink: 0;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.navCollapse:hover { color: var(--ink); background: var(--hover); }
.btn.ghost, .newSession {
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: 8px;
  padding: 5px 12px; font-size: 12px; white-space: nowrap;
}
.btn.ghost:hover, .newSession:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.eyebrow { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.h1 { font-size: 16px; font-weight: 600; }
.taskList, .fileList, .chatLog, .rightPane {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.chatLog { overflow-anchor: none; }
.chatLog > .msg { overflow-anchor: none; }
.chatLog > .msg:last-of-type { overflow-anchor: auto; }
#taskPane, #drivePane {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#taskPane[hidden], #drivePane[hidden] { display: none !important; }
.userBar { flex-shrink: 0; }
.task {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.task:hover { background: var(--hover); }
.task.active { border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 10px; }
.task .title { font-weight: 500; font-size: 13px; }
.task .meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; }
.st {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.st.queued { color: var(--queued); }
.st.running { color: var(--running); }
.st.done { color: var(--done); }
.st.error { color: var(--danger); }
.crumb {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 48px 0;
  font-size: 12px;
  border-bottom: none;
}
.crumbRow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sep { color: var(--muted); }
.spacer { flex: 1; }
.queueBanner {
  margin: 10px 16px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 12px;
}
.chatLog {
  padding: 22px 48px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.chatLog[hidden], #welcome[hidden] { display: none !important; }
.msg { margin-bottom: 16px; max-width: 1040px; width: 100%; }
.msg.user {
  align-self: flex-end;
  margin-left: auto;
  max-width: min(72%, 720px);
  user-select: text;
  -webkit-user-select: text;
}
.msg.user .role { text-align: right; }
.msg.user .bubble {
  display: inline-block;
  text-align: left;
  background: var(--bubble);
  color: var(--bubble-fg);
  border: 1px solid var(--line);
  border-radius: 14px 14px 4px 14px;
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  cursor: text;
  line-height: 1.5;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}
.msg.assistant .md {
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
}
.msg.assistant .md p { margin: 0 0 0.7em; }
.msg.assistant .md p:last-child { margin-bottom: 0; }
.chatTraces { margin: 2px 0 12px; max-width: 100%; }
.chatTraces[hidden] { display: none !important; }
.msg .role { font-size: 12px; color: var(--muted); margin-bottom: 6px; user-select: none; }
.msg.user .msgAttach { justify-content: flex-end; }
.msg.assistant { align-self: center; width: 100%; max-width: min(100%, 1040px); }
.msgAttach { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.msg.assistant .msgAttach { margin: 8px 0 0; }
.msgActs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
  user-select: none;
}
.msgAct {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.msgAct svg { display: block; }
.msgAct:hover { background: var(--hover); color: var(--ink); }
.msgAct.on { color: var(--accent); background: #eff6ff; }
.msgAct.err { color: var(--danger); }
.msgAct.ok, .iconButton.ok { color: var(--done); }
.msgThumb {
  display: block; width: 168px; height: 168px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
}
.msgThumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msgFile {
  font-size: 12px; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; text-decoration: none; cursor: pointer;
}
.traces {
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--hover);
}
.traces summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.tracePre, .traces pre {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  margin: 8px 0 0;
}
.composerBox {
  background: #fff;
  border: 1px solid #d4d4d8;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(24, 24, 27, 0.07);
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}
.plusBtn {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 18px; line-height: 1; padding: 0;
}
.plusBtn:hover { background: var(--hover); }
.composerBox textarea {
  border: none;
  width: 100%;
  min-height: 48px;
  max-height: 200px;
  resize: none;
  overflow-y: hidden;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
  padding: 2px 4px 6px;
}
.composerActions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 0;
}
.composerSubmit {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sendBtn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sendBtn svg { width: 16px; height: 16px; display: block; }
.sendBtn.idle {
  background: #d4d4d8;
  color: #fff;
  cursor: default;
}
.sendBtn:not(.idle):hover { background: var(--primary-strong); }
.pauseBtn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0;
}
.pauseBtn svg { width: 10px; height: 10px; }
.pill { padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.rightTabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.tabBtn {
  padding: 0 12px;
  height: 58px;
  font-size: 13px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.tabBtn.active {
  background: transparent;
  color: var(--accent);
  font-weight: 650;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.rightPane { padding: 0; background: var(--card); min-height: 0; overflow: auto; }
.rightPane[hidden] { display: none !important; }
.notesBox { min-height: 220px; margin: 10px 0; }
.fileRow {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  align-items: center;
}
.fileRow a { color: var(--accent); }
.fileActs { display: flex; align-items: center; gap: 8px; }
.driveBar { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.md :is(h1, h2, h3, h4, h5, h6) { margin: 1.25em 0 0.6em; font-weight: 650; line-height: 1.4; }
.md h1 { font-size: 1.4em; }
.md h2 { font-size: 1.25em; }
.md :is(h3, h4, h5, h6) { font-size: 1.1em; }
.md > :first-child { margin-top: 0; }
.md :is(ul, ol) { margin: 0.75em 0; padding-inline-start: 1.75em; }
.md li { padding-inline-start: 0.25em; margin: 0.4em 0; }
.md li::marker { color: var(--muted); }
.md li :is(ul, ol) { margin: 0.35em 0; }
.md li > p { margin: 0.35em 0; }
.md blockquote { margin: 1em 0; padding: 0.15em 0 0.15em 1em; border-inline-start: 3px solid var(--line); color: var(--muted); }
.md blockquote > :last-child { margin-bottom: 0; }
.md .mdTaskItem { list-style: none; position: relative; }
.md .mdTaskItem > input, .md .mdTaskItem > p > input {
  position: absolute; inset-inline-start: -1.45em; top: 0.3em;
  width: 1em; height: 1em; margin: 0; accent-color: var(--ink);
}
.mdTable { max-width: 100%; overflow-x: auto; margin: 1em 0; }
.mdTable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.md .mdTable table { width: 100%; border-collapse: collapse; font-size: inherit; background: transparent; }
.md .mdTable th, .md .mdTable td { border: 0; border-bottom: 1px solid var(--line); padding: 0.75em 1em; text-align: left; vertical-align: top; min-width: 7em; }
.md .mdTable th { font-weight: 650; color: var(--ink); }
.md .mdTable tbody tr:last-child td { border-bottom: 0; }
.md .mdTable tbody tr:hover { background: var(--cream2); }
.md code { background: var(--cream2); padding: 1px 4px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 0.92em; }
.md pre { background: var(--card); border: 1px solid var(--line); padding: 10px; border-radius: 8px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md .katex-display { margin: 0.55em 0; overflow-x: auto; overflow-y: hidden; }
.md .katex { font-size: 1.05em; }
.md .texFallback { font-family: ui-monospace, monospace; font-size: 0.92em; }
.md a, .md a.mdLink {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  word-break: break-all;
}
.md a:hover { opacity: 0.88; }

a { color: var(--accent); }
.authH { font-size: 18px; margin: 8px 0 12px; font-weight: 600; }
.authCard.wide { width: 640px; max-width: calc(100vw - 32px); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.span2 { grid-column: 1 / -1; }
.notice {
  background: var(--cream2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0;
}
.searchWrap { padding: 8px 14px; border-bottom: 1px solid var(--line); }
.task { display: flex; align-items: flex-start; gap: 6px; }
.taskMain { flex: 1; min-width: 0; }
.moreBtn {
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); padding: 4px 6px; border-radius: 8px;
  font-size: 12px;
}
.moreBtn:hover { background: var(--cream2); }
.taskMenu {
  position: fixed; z-index: 40;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  min-width: 88px; padding: 3px;
}
.taskMenu button {
  display: block; width: 100%; text-align: left;
  border: none; background: transparent; padding: 5px 8px;
  border-radius: 6px; cursor: pointer;
  font-size: 12px; line-height: 1.35; color: inherit;
}
.taskMenu button:hover { background: var(--cream2); }
.emptyHint { padding: 24px 16px; text-align: center; color: var(--muted); }
.emptyState {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.emptyState .burst { display: none; }
.emptyState[hidden] { display: none !important; }
.emptyTitle { font-weight: 600; margin: 8px 0 5px; color: var(--ink); font-size: 14px; }
.burst {
  width: 40px; height: 40px; margin: 0 auto 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #67e8f9 0 18%, transparent 19%),
    repeating-conic-gradient(from 0deg, #a5f3fc 0 8deg, transparent 8deg 22deg);
}
.welcome { padding: 28px 48px 8px; overflow: auto; flex: 1; }
.welcomeTitle { font-size: clamp(21px, 2vw, 24px); font-weight: 650; letter-spacing: -0.025em; }
.welcomeLead { color: var(--muted); max-width: 720px; margin: 8px 0 16px; font-size: 13px; }
.quickGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 960px; }
.quickCard {
  text-align: left; padding: 18px; border-radius: 14px;
  min-height: 108px;
  background: rgba(255,255,255,.9); border: 1px solid var(--line); cursor: pointer;
  box-shadow: 0 8px 24px rgba(24,24,27,.035);
}
.quickCard:hover {
  border-color: #93c5fd;
  box-shadow: 0 5px 18px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}
.quickT { font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.chipRow { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 8px; }
.chip {
  font-size: 12px; border: 1px solid var(--line); background: var(--cream);
  border-radius: 12px; padding: 6px 8px 6px 6px;
  display: inline-flex; align-items: flex-start; gap: 8px; max-width: 280px;
  position: relative;
}
.chipThumb {
  width: 36px; height: 36px; object-fit: cover; border-radius: 8px;
  background: var(--card); flex-shrink: 0;
}
.chipIcon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #efe7d6; color: #8a6d3b;
  font-weight: 700; font-size: 14px; letter-spacing: 0;
}
.chipBody { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-right: 14px; }
.chipName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink); max-width: 180px; }
.chipMeta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chipError .chipMeta { color: var(--danger); }
.chipX {
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); width: 18px; height: 18px; border-radius: 50%;
  line-height: 1; font-size: 14px; padding: 0;
  position: absolute; top: 4px; right: 4px;
}
.chipX:hover { background: var(--cream2); color: var(--danger); }
.dropTarget.dragging, .composerBox.dragging {
  outline: 2px dashed #93c5fd;
  background: rgba(37, 99, 235, 0.04);
}
.modelWrap { position: relative; }
.modelPill {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 4px 10px; cursor: pointer;
  font-size: 12px;
}
.modelPill::after { content: " ▾"; color: var(--muted); font-size: 10px; }
.modelFlyout {
  position: fixed; left: 0; bottom: 72px; z-index: 80;
  flex-direction: column; gap: 8px;
}
.modelFlyout:not([hidden]) { display: flex; }
.modelFlyout[hidden], .customList[hidden], .effortList[hidden], .modelHint[hidden] { display: none !important; }
.modelCols { display: flex; align-items: stretch; gap: 8px; }
.tierList, .customList, .effortList {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  min-width: 220px; padding: 4px;
}
.customList, .effortList { min-width: 160px; }
.tierItem, .customItem, .effortItem {
  display: block; width: 100%; text-align: left;
  border: none; background: transparent; padding: 7px 8px;
  border-radius: 8px; cursor: pointer;
}
.tierItem:hover, .customItem:hover, .effortItem:hover { background: var(--cream2); }
.tierItem.selected, .customItem.selected, .effortItem.selected { background: var(--selected); }
.tierName { font-weight: 600; font-size: 13px; }
.tierDesc { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.customItem, .effortItem { font-size: 12px; }
.customItem.disabled, .effortItem.disabled { opacity: 0.45; cursor: not-allowed; }
.modelHint {
  max-width: 240px; font-size: 11px; color: var(--muted);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; box-shadow: var(--shadow);
}
.infoI {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line); font-size: 10px; color: var(--muted);
}
.userBar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.userAvatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #d9c8f0 0%, #f5d2c4 100%);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 650; flex-shrink: 0;
}
.userMeta { min-width: 0; flex: 1; }
.userName { font-size: 12px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userOrg { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { display: flex; height: 100vh; overflow: hidden; }
.pageMain { flex: 1; min-width: 0; overflow: auto; padding: 28px 36px; }
.pageMain h1 { font-size: 18px; font-weight: 600; }
.resources-main {
  padding: 0;
  background: #fafafa;
}
.resources-main .page-content h1 {
  font-size: 22px;
  font-weight: 650;
}
.resources-crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.resources-crumb strong { color: var(--ink); }
.resource-search {
  max-width: 420px;
  margin: 0 0 8px;
  height: 36px;
  border-radius: 8px;
}
html[data-theme="dark"] .resources-main { background: #101216; }
.resList { display: flex; flex-direction: column; gap: 8px; }
.resItem {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.resItem b { display: block; margin-bottom: 4px; }
.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 6px 8px;
}
.brand-wordmark { display: block; width: 142px; height: auto; object-fit: contain; }
.brand-wordmark-dark { display: none; }
.sidebar-nav { min-height: 0; display: grid; align-content: start; gap: 4px; overflow: auto; }
.nav-item {
  width: 100%;
  min-width: 0;
  height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover { background: var(--cream2); color: var(--ink); }
.nav-item.active { color: var(--accent); background: #eff6ff; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { min-width: 0; display: grid; gap: 8px; margin-top: auto; }
.sidebar-user {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}
.sidebar-user .avatar,
.sidebar #railUserAv {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  border: none;
  background: var(--soft);
  font-size: 11px;
  font-weight: 550;
  color: var(--blue);
  line-height: 1;
}
.sidebar-user-copy strong,
.sidebar-user-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-copy strong { font-size: 13px; line-height: 17px; }
.sidebar-user-copy small { color: var(--muted); font-size: 11px; line-height: 14px; }
.main-shell {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fafafa;
}
.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}
.breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb strong { color: var(--ink); }
.page-content {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 30px clamp(20px, 4vw, 54px);
  background: #fafafa;
}
.page-content h1 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.035em;
}
.page-content > p {
  max-width: 680px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}
.resource-section {
  max-width: 1040px;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 24, 27, 0.035);
}
.resource-section h2 { margin: 0 0 14px; font-size: 15px; }
.resource-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.resource-row {
  min-width: 0;
  padding: 14px;
  border: 1px solid #f0f0f2;
  border-radius: 12px;
  background: #fafafa;
  transition: border-color 150ms, background 150ms, transform 150ms;
}
.resource-row:hover { border-color: #bfdbfe; background: #f8fafc; transform: translateY(-1px); }
.resource-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.resource-row span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .sidebar { background: var(--surface); }
html[data-theme="dark"] .brand-wordmark-light { display: none; }
html[data-theme="dark"] .brand-wordmark-dark { display: block; }
html[data-theme="dark"] .nav-item.active { background: #172554; color: #60a5fa; }
html[data-theme="dark"] .main-shell,
html[data-theme="dark"] .page-content { background: #101216; }
html[data-theme="dark"] .topbar { background: rgba(21, 24, 29, 0.92); }
html[data-theme="dark"] .resource-section { background: var(--surface); }
html[data-theme="dark"] .resource-row { border-color: var(--line); background: var(--surface-raised); }
html[data-theme="dark"] .resource-row:hover { border-color: #1e3a8a; background: #1e293b; }
html[data-theme="dark"] .sidebar-user { background: var(--surface-raised); }
@media (max-width: 600px) {
  .resource-list { grid-template-columns: 1fr; }
  .page-content { padding-inline: 14px; }
}
.formNarrow { max-width: 520px; }
.rail a.railBtn { text-decoration: none; }
.railUser {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--soft);
  color: var(--blue); text-decoration: none;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 550; margin-top: 4px;
  border: none; cursor: pointer; padding: 0;
  overflow: hidden;
  line-height: 1;
}
.railUser #railUserAv {
  font-size: 11px;
  color: var(--blue);
  line-height: 1;
}
.userMenu {
  position: fixed; z-index: 80;
  width: 268px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px 0 6px;
}
.userMenuHead {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.userMenuAv {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--soft);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 550; flex-shrink: 0;
  color: var(--blue);
  border: none;
  line-height: 1;
  overflow: hidden;
}
.userMenuName { font-size: 13px; font-weight: 650; }
.userMenuEmail { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 196px; word-break: break-all; }
.userMenuItem {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 8px 14px; margin-top: 2px;
  border: none; background: transparent;
  color: inherit; text-decoration: none;
  font-size: 13px; cursor: pointer;
}
.userMenuItem:hover { background: var(--cream2); }
.userMenuItem.danger { color: var(--danger); }
.userMenuVer {
  padding: 8px 14px 4px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.userMenu[hidden] { display: none !important; }
.pauseBtn { background: var(--accent); color: #fff; }
.sendBtn[hidden], .pauseBtn[hidden] { display: none !important; }
.traceStack { display: flex; flex-direction: column; gap: 0; padding: 8px 10px; }
.traceStack[hidden] { display: none !important; }
.traceGroup { border: none; }
.traceGroup > summary {
  cursor: pointer; font-size: 12px; color: var(--muted);
  margin: 0 0 4px; list-style: none;
}
.traceGroup > summary::-webkit-details-marker { display: none; }
.traceGroup > summary::before { content: "▸ "; }
.traceGroup[open] > summary::before { content: "▾ "; }
.traceStackInner { display: flex; flex-direction: column; gap: 1px; }
.traceItem { display: flex; flex-direction: column; gap: 0; }
.tracePill {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 3px 2px;
  cursor: pointer;
  color: var(--ink);
  border-bottom: none;
}
.tracePill:hover { background: var(--cream2); }
.tracePill.open { border-radius: 0; }
.traceIcon {
  width: 16px; height: 16px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--muted);
}
.traceIcon[data-kind="observe"], .traceIcon[data-kind="error"] {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5c5 0 9.3 3.1 11 7-1.7 3.9-6 7-11 7S2.7 15.9 1 12c1.7-3.9 6-7 11-7zm0 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.traceIcon[data-kind="error"] { color: var(--danger); }
.traceIcon[data-kind="phase"], .traceIcon[data-kind="validate"] {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 5h-2v6l5 3 1-1.7-4-2.3V7z'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--muted);
}
.traceTitle {
  flex: 1; min-width: 0;
  font-size: 12px;
  font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.traceTime { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.traceTime::before { content: "⏱ "; }
.traceChev { color: var(--muted); font-size: 14px; transform: translateY(-1px); }
.tracePill.open .traceChev { transform: rotate(90deg); }
.traceBody {
  margin: 0 0 4px;
  border: none;
  border-top: none;
  border-radius: 0;
  padding: 0 2px 6px 26px;
  background: transparent;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  max-height: 240px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
}
.traceThumbs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 12px 4px;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: var(--card);
}
.traceThumbs img {
  max-width: 160px; max-height: 120px;
  border-radius: 8px; border: 1px solid var(--line);
}
.traceThink {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  padding: 4px 8px;
}
.thinkRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
  min-height: 22px;
}
.thinkCard {
  margin: 0 0 12px;
  background: transparent;
  border: none;
}
.thinkCard.processCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.thinkCard > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  user-select: none;
}
.thinkCard > summary::-webkit-details-marker { display: none; }
.thinkFold {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 14%, transparent);
}
.thinkFold svg {
  width: 12px;
  height: 12px;
  display: block;
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}
.thinkCard[open] > summary .thinkFold svg { transform: rotate(0deg); }
.thinkCard > summary:hover .thinkFold {
  background: var(--hover);
  color: var(--ink);
}
.thinkPanel { margin: 0; }
.thinkPanel .processPhases { margin: 0; }
.processTitle { color: var(--ink); font-size: 14px; flex: 0 0 auto; }
.processStatus {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.processTime {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.processToolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 12px;
  color: var(--muted);
}
.processToolbarActs { display: flex; align-items: center; gap: 8px; }
.processEarlier {
  border: 0;
  background: none;
  padding: 3px 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.processEarlier:hover { color: var(--ink); }
.processTimeline {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 13px;
  max-height: 420px;
  overflow: auto;
}
.trace-item {
  position: relative;
  border-left: 1px solid var(--line);
  padding: 0 0 8px 18px;
  margin-left: 4px;
}
.trace-item:last-child { padding-bottom: 0; }
.trace-item:before {
  content: "";
  position: absolute;
  left: -4px;
  top: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8c9eae;
  box-shadow: 0 0 0 4px var(--card);
}
.trace-item.current:before { background: var(--accent); }
.trace-item.failed:before { background: #b8783d; }
.trace-item .trace-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.trace-item .trace-row:hover { background: var(--rail); }
.trace-chevron {
  color: var(--muted);
  width: 12px;
  flex: 0 0 auto;
  transition: transform .12s;
}
.trace-item.is-open .trace-chevron { transform: rotate(90deg); }
.trace-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.trace-kind { font-weight: 500; white-space: nowrap; }
.trace-desc {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.trace-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.current .trace-state { color: var(--accent); }
.failed .trace-state { color: #a2682f; }
.trace-time { font-size: 12px; color: var(--muted); min-width: 40px; text-align: right; white-space: nowrap; }
.trace-detail {
  margin: 0 8px 10px 24px;
  padding: 12px 16px;
  background: var(--rail);
  border-radius: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.trace-detail code { color: var(--muted); font-size: 12px; }
.trace-detail p { white-space: pre-wrap; margin: 8px 0 0; line-height: 1.8; }
.thinkPanel .processPhases { padding: 0 18px 14px; border-top: 1px solid var(--line); }
.liveUpdate { margin: 28px 0 24px; }
.liveEyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.liveUpdateHead { color: var(--accent); }
.liveUpdateMeta { color: var(--muted); }
.liveUpdateTitle {
  font-size: 19px;
  font-weight: 600;
  margin: 10px 0 13px;
  color: var(--ink);
}
.liveUpdate .md { color: var(--ink); }
.liveUpdate .md h1,
.liveUpdate .md h2 { font-size: 19px; font-weight: 600; margin: 10px 0 13px; }
.liveUpdate .md p { margin: 12px 0; }
.liveUpdate .md ul { margin: 10px 0; padding-left: 22px; }
.liveUpdate .md li { margin: 7px 0; padding-left: 3px; }
.liveUpdateNote {
  border-left: 2px solid var(--line);
  padding: 1px 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}
.thinkStream {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  padding: 6px 0 4px 20px;
  margin: 4px 0 0 6px;
  border-left: 1px solid var(--line);
  user-select: text;
  -webkit-user-select: text;
}
.thinkOrb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 0 3px rgba(92, 107, 74, 0.16);
  animation: thinkPulse 1.15s ease-in-out infinite;
  flex-shrink: 0;
}
.thinkOrb.sm { width: 8px; height: 8px; box-shadow: none; margin-right: 2px; }
.thinkText {
  font-size: 13px;
  font-weight: 550;
  background: linear-gradient(90deg, #5a5246 0%, #9a8d78 45%, #5a5246 90%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: thinkShimmer 1.8s linear infinite;
}
.thinkDots { display: inline-flex; gap: 3px; align-items: flex-end; height: 10px; }
.thinkDots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: #8a7d6a;
  animation: thinkBounce 1.05s ease-in-out infinite;
}
.thinkDots i:nth-child(2) { animation-delay: 0.15s; }
.thinkDots i:nth-child(3) { animation-delay: 0.3s; }
.traceGroup.live > summary {
  display: flex; align-items: center; gap: 6px;
}
@keyframes thinkPulse {
  0%, 100% { transform: scale(0.86); opacity: 0.7; }
  50% { transform: scale(1); opacity: 1; }
}
@keyframes thinkShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes thinkBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.traceThinkDot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent2);
}
.todoList { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 4px; }
.todoItem { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.todoGroup { margin: 8px 12px 4px; }
.todoGroup > summary { cursor: pointer; font-size: 12px; font-weight: 650; }
.notesHead { font-size: 12px; font-weight: 650; padding: 10px 12px 0; }
.h1 { font-size: 15px; font-weight: 600; }
.task .title { font-weight: 500; font-size: 12px; }
.traceStack.inChat { margin-top: 0; margin-bottom: 8px; }
button.msgThumb {
  padding: 0; border: 1px solid var(--line); background: var(--card); cursor: zoom-in;
}
[data-preview-src] { cursor: zoom-in; }
.md .resultImage {
  display: block; width: auto; max-width: 100%; max-height: 480px;
  object-fit: contain; border: 1px solid var(--line); border-radius: 12px;
}
.chipThumb { cursor: zoom-in; }
.traceThumbs img { cursor: zoom-in; }
.filePreview {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: transparent; padding: 0;
  color: inherit; cursor: zoom-in; min-width: 0; text-align: left;
}
.filePreview img {
  width: 36px; height: 36px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); flex-shrink: 0;
}
.filePreview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imgLightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 16, 12, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 56px 24px 24px;
}
.imgLightbox[hidden] { display: none !important; }
.imgLightboxImg {
  max-width: min(92vw, 1400px);
  max-height: calc(100vh - 88px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  background: #111;
}
.imgLightboxBar {
  position: absolute; top: 14px; right: 16px;
  display: flex; gap: 8px;
}
.imgLightboxBtn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(32, 28, 24, 0.88);
  color: #f6f1e8;
  display: grid; place-items: center;
  cursor: pointer; padding: 0;
}
.imgLightboxBtn:hover { background: rgba(48, 42, 36, 0.95); }
.imgLightboxHint {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(32, 28, 24, 0.9); color: #f6f1e8;
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
}
body.lightboxOpen { overflow: hidden; }
.railHelp {
  width: 40px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 4px;
}
.railHelp:hover { color: var(--ink); }
.railHelpIcon {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid currentColor;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 650;
}
.railHelpLabel { font-size: 10px; }
.helpMenu { min-width: 180px; padding: 6px; }
.bugModal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(9, 9, 11, 0.48);
  display: grid; place-items: center;
  padding: 20px;
}
.bugModal[hidden] { display: none !important; }
.bugCard {
  width: 420px; max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.bugCard h2 { margin: 0 0 8px; font-size: 18px; }
.bugCard label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.bugDesc { min-height: 110px; resize: vertical; }
.bugShotBtn {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  margin: 8px 0 4px;
}
.bugCard .btn { width: 100%; margin-top: 6px; }
.bugCard .btn.primary { margin-top: 10px; }

.appDialog {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(9, 9, 11, 0.48);
  display: grid; place-items: center;
  padding: 20px;
}
.appDialog[hidden] { display: none !important; }
.appDialogCard {
  width: 400px; max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.appDialogCard h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.appDialogBody {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.appDialog[data-mode="alert"] #appDialogCancel { display: none; }
.appDialogBody[hidden] { display: none !important; }
.appDialogField {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.appDialogField[hidden] { display: none !important; }
.appDialogField .input { font-size: 14px; }
.appDialogActs {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.appDialogActs .btn {
  min-width: 72px;
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 550;
}
.appDialogActs .btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
html[data-theme="dark"] .appDialogActs .btn.danger {
  color: #202329;
}

/* Requirement gate: numbered radio / checkbox cards, matching paid Biomni. */
.clarifyCard {
  background: transparent;
  padding: 2px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 640px;
}
.clarifyMsg {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}
.clarifyQ { display: flex; flex-direction: column; gap: 10px; }
.clarifyHead {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.clarifyNum {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
  flex: none;
}
.clarifyTitle {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 500;
}
.clarifyOpts { display: flex; flex-direction: column; gap: 12px; padding-left: 22px; }
.clarifyOpt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.clarifyPick {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.clarifyOptBody { min-width: 0; }
.clarifyOptLabel {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.clarifyOptDetail {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.clarifyQ .clarifyInput,
.clarifyQ .clarifyFree {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  margin-left: 22px;
  max-width: calc(100% - 22px);
}
.clarifyActs { display: flex; gap: 8px; margin-top: 4px; }
.clarifyGo {
  padding: 4px 11px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 550;
  border-radius: 7px;
}
.clarifyErr { font-size: 12px; color: #b3261e; }
.clarifyErr[hidden] { display: none !important; }
.clarifyFree[hidden] { display: none !important; }

.settingsModal {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(9, 9, 11, 0.48);
  display: grid; place-items: center;
  padding: 20px;
}
.settingsModal[hidden] { display: none !important; }
.settingsCard {
  width: 760px; max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh - 40px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  color: var(--ink);
}
.settingsHead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.settingsHead h2 { margin: 0; font-size: 16px; font-weight: 650; }
.settingsClose {
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 20px; line-height: 1;
  width: 32px; height: 32px; border-radius: 8px;
}
.settingsClose:hover { background: var(--cream2); color: var(--ink); }
.settingsBody { display: grid; grid-template-columns: 168px 1fr; min-height: 0; flex: 1; }
.settingsNav {
  border-right: 1px solid var(--line);
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--cream);
}
.settingsNavBtn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: none; background: transparent;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; color: var(--ink); font-size: 13px;
}
.settingsNavBtn:hover { background: var(--cream2); }
.settingsNavBtn.active { background: var(--cream2); font-weight: 600; }
.settingsMain { padding: 16px 20px 20px; overflow: auto; min-height: 0; }
.settingsPane[hidden] { display: none !important; }
.settingsLabel { font-size: 13px; font-weight: 650; margin: 4px 0 10px; }
.settingsHint { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.settingsThemeRow { display: flex; gap: 10px; margin-bottom: 22px; }
.settingsThemeBtn {
  flex: 1; border: 1px solid var(--line); background: var(--cream);
  border-radius: 12px; padding: 14px 8px 12px; cursor: pointer;
  color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.settingsThemeBtn.selected { border-color: var(--accent); background: var(--cream2); }
.settingsThemeBtn svg { width: 22px; height: 22px; }
.settingsLangRow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0;
}
.settingsLangRow select {
  min-width: 140px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 10px; padding: 6px 8px;
}
.settingsRow {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.settingsRow:last-child { border-bottom: none; }
.settingsRow .settingsRowText { min-width: 0; }
.settingsRow .settingsRowText b { display: block; font-size: 13px; font-weight: 600; }
.settingsRow .btn.danger {
  color: var(--danger); border-color: var(--danger);
}
.settingsForm label { margin-top: 8px; }
.settingsForm .btn { margin-top: 14px; }
.settingsMsg { font-size: 12px; margin-top: 8px; }

.mainTabs {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 0;
  border-bottom: 1px solid var(--line);
}
.mainTab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0 0 8px;
  margin-bottom: -1px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
}
.mainTab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}
.compactTraces {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 12px;
}
.compactRow {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.compactPill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px 2px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 6px;
}
.compactPill:hover { background: var(--hover); color: var(--ink); }
.compactKind { color: var(--muted); flex-shrink: 0; font-weight: 550; }
.compactTitle {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.compactBody {
  margin: 0 0 6px 22px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 11px;
  max-height: 240px;
  overflow: auto;
  color: var(--ink);
}
.compactBody[hidden] { display: none !important; }
#trajView {
  --dsh-trajectory-toolbar-height: 32px;
  --dsw-alias-bg-layer-1: var(--card);
  --dsw-alias-bg-layer-2: var(--cream);
  --dsw-alias-border-l1: var(--line);
  --dsw-alias-border-l2: var(--line);
  --dsw-alias-label-primary: var(--ink);
  --dsw-alias-label-secondary: var(--muted);
  --dsw-alias-label-tertiary: var(--muted);
  --dsw-alias-label-caption: var(--muted);
  --dsw-alias-label-dimmed: var(--muted);
  --dsw-alias-state-business-primary: var(--accent);
  --dsw-alias-state-business-tertiary: color-mix(in srgb, var(--accent) 14%, var(--card));
  --dsw-alias-state-success-primary: #059669;
  --dsw-alias-state-success-tertiary: color-mix(in srgb, #059669 12%, var(--card));
  --dsw-alias-state-warn-label: #d97706;
  --dsw-alias-state-warn-tertiary: color-mix(in srgb, #d97706 14%, var(--card));
  --dsw-alias-state-error-primary: var(--danger);
  --dsw-alias-state-error-secondary: #c084fc;
  --dsw-alias-brand-primary: #7c3aed;
  --dsw-alias-interactive-bg-hover: var(--hover);
  --dsw-alias-interactive-bg-active: var(--selected);
  --dsw-specific-sidebar-fill: var(--cream2);
  --dsw-alias-bg-module-platform: var(--cream2);
  --ds-font-family-code: var(--mono);
  --dsw-font-xxs-12: 12px/18px ui-sans-serif, system-ui, sans-serif;
  --dsw-font-xs-13: 13px/18px ui-sans-serif, system-ui, sans-serif;
  --dsw-font-xs-strong-13: 600 13px/18px ui-sans-serif, system-ui, sans-serif;
  --dsw-static-blue-500: #3b82f6;
  --trajectory-turn-accent: color-mix(in srgb, var(--dsw-static-blue-500) 22%, var(--dsw-alias-bg-layer-1));
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  color: var(--dsw-alias-label-primary);
  background: var(--dsw-alias-bg-layer-1);
}
html[data-theme="dark"] #trajView {
  --dsw-alias-state-business-primary: #4d8dff;
  --dsw-alias-state-business-tertiary: rgba(77, 141, 255, 0.16);
  --dsw-alias-state-success-primary: #34d399;
  --dsw-alias-state-success-tertiary: rgba(52, 211, 153, 0.12);
  --dsw-alias-state-warn-label: #f5a524;
  --dsw-alias-state-warn-tertiary: rgba(245, 165, 36, 0.16);
  --dsw-alias-brand-primary: #c4b5fd;
  --dsw-specific-sidebar-fill: #171717;
  --dsw-alias-bg-module-platform: #1a1a1a;
}
#trajView[hidden] { display: none !important; }
.dshTraj {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
.dshToolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  box-sizing: border-box;
  width: 100%;
  height: var(--dsh-trajectory-toolbar-height);
  border-bottom: 1px solid var(--dsw-alias-border-l2);
  background: var(--dsw-alias-bg-layer-1);
}
.dshToolbarInner {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0 6px;
  gap: 8px;
}
.dshToggle,
.dshAction {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  gap: 4px;
  border: 0;
  border-radius: 3px;
  color: var(--dsw-alias-label-tertiary);
  background: transparent;
  cursor: pointer;
  font: var(--dsw-font-xxs-12);
}
.dshAction { padding: 0 5px; }
.dshToggle:hover,
.dshAction:hover,
.dshToggle[aria-pressed="true"] {
  color: var(--dsw-alias-label-primary);
  background: var(--dsw-alias-interactive-bg-hover);
}
.dshToggle:focus-visible,
.dshAction:focus-visible {
  outline: 1px solid var(--dsw-alias-state-business-primary);
  outline-offset: 1px;
}
.dshActionIcon {
  color: var(--dsw-alias-label-tertiary);
  font: 14px/14px var(--ds-font-family-code);
}
.dshSearch {
  display: flex;
  flex: 0 1 164px;
  align-items: center;
  min-width: 84px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  gap: 4px;
  border: 1px solid var(--dsw-alias-border-l2);
  border-radius: 4px;
  color: var(--dsw-alias-label-caption);
  background: var(--dsw-alias-bg-layer-2);
}
.dshSearch:hover { border-color: var(--dsw-alias-label-caption); }
.dshSearch:focus-within {
  border-color: var(--dsw-alias-state-business-primary);
  background: var(--dsw-alias-bg-layer-1);
}
.dshSearch input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--dsw-alias-label-primary);
  background: transparent;
  font: var(--dsw-font-xxs-12);
}
.dshSearch input::placeholder { color: var(--dsw-alias-label-caption); }
.dshTimeline {
  position: relative;
  z-index: 1;
  flex: none;
  border-bottom: 1px solid var(--dsw-alias-border-l2);
  user-select: none;
}
.dshPlot {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  height: 50px;
  overflow: hidden;
  background: var(--dsw-alias-bg-layer-2);
}
.dshLaneLabels {
  position: relative;
  border-right: 1px solid var(--dsw-alias-border-l1);
  color: var(--dsw-alias-label-caption);
  font-size: 10px;
  line-height: 1;
}
.dshLaneLabels span {
  position: absolute;
  right: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 8px;
  text-align: right;
}
.dshLaneLabels span:nth-child(1) { top: 7px; }
.dshLaneLabels span:nth-child(2) { top: 21px; }
.dshLaneLabels span:nth-child(3) { top: 35px; }
.dshTrack {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: crosshair;
}
.dshTrack::-webkit-scrollbar { height: 6px; }
.dshLanes {
  position: absolute;
  z-index: 2;
  top: 7px;
  bottom: 7px;
  left: 0;
  min-width: 100%;
}
.dshSpan {
  position: absolute;
  top: calc(var(--trajectory-span-lane) * 14px);
  left: var(--trajectory-span-left);
  width: max(2px, var(--trajectory-span-width));
  height: 8px;
  min-width: 2px;
  border-radius: 1px;
  background: var(--dsw-alias-label-secondary);
  opacity: 0.78;
  cursor: pointer;
}
.dshSpan[data-equal="true"] { min-width: 8px; }
.dshSpan[data-kind="user"] { background: var(--dsw-alias-state-business-primary); }
.dshSpan[data-kind="context"] {
  background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 68%, var(--dsw-alias-label-secondary));
}
.dshSpan[data-kind="message"] {
  background: color-mix(in srgb, var(--dsw-alias-brand-primary) 60%, var(--dsw-alias-state-error-secondary));
  opacity: 1;
}
.dshSpan[data-kind="tool"],
.dshSpan[data-kind="subtool"] {
  background: var(--dsw-alias-state-warn-label);
  opacity: 1;
}
.dshSpan[data-kind="system"] { background: var(--dsw-alias-label-tertiary); }
.dshSpan[data-error="true"] { background: var(--dsw-alias-state-error-primary); }
.dshSpan[data-current="true"] {
  z-index: 1;
  opacity: 1;
  box-shadow:
    0 0 0 1px var(--dsw-alias-bg-layer-2),
    0 0 0 2px var(--dsw-alias-state-business-primary);
}
.dshSpan[data-search-match="false"] { opacity: 0.14; }
.dshHover {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: clamp(0px, calc(var(--trajectory-hover-left) - 1px), calc(100% - 2px));
  width: 2px;
  background: var(--dsw-alias-state-business-primary);
  pointer-events: none;
}
.dshHover[hidden] { display: none; }
.dshSplit {
  position: relative;
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--dsw-alias-bg-layer-1);
}
.dshTablePane {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.dshEmpty {
  padding: 28px 16px;
  text-align: center;
  color: var(--dsw-alias-label-caption);
  font: var(--dsw-font-xs-13);
}
#trajEmpty.dshEmpty {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 30px;
  pointer-events: none;
}
.dshTable {
  width: 100%;
  min-width: 0;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--dsw-alias-label-primary);
  background: var(--dsw-alias-bg-layer-1);
  font: var(--dsw-font-xxs-12);
}
.dshEventCol { width: 122px; }
.dshTable th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-sizing: border-box;
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  border-bottom: 1px solid var(--dsw-alias-border-l2);
  color: var(--dsw-alias-label-tertiary);
  background: var(--dsw-specific-sidebar-fill);
  font: var(--dsw-font-xxs-12);
  font-weight: 500;
  text-align: left;
  text-overflow: ellipsis;
  user-select: none;
  white-space: nowrap;
}
.dshTable th.dshEventCol {
  padding-right: 4px;
  text-align: right;
}
.dshTable td {
  box-sizing: border-box;
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  border-bottom: 1px solid var(--dsw-alias-border-l1);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dshRow { cursor: default; outline: none; }
.dshRow:hover { background: var(--dsw-alias-interactive-bg-hover); }
.dshRow[data-selected="true"] { background: var(--dsw-alias-interactive-bg-active); }
.dshRow[data-collapsed="true"] td { height: 20px; }
.dshEvent {
  position: relative;
  overflow: visible !important;
  padding-right: 4px !important;
  padding-left: 36px !important;
}
.dshTurnRail,
.dshSelRail {
  position: absolute;
  left: 0;
  pointer-events: none;
}
.dshTurnRail {
  z-index: 4;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--trajectory-turn-accent);
}
.dshSelRail {
  z-index: 5;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--dsw-alias-brand-primary);
  display: none;
}
.dshRow[data-selected="true"] .dshSelRail { display: block; }
.dshRow[data-error="true"] .dshTurnRail {
  background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 22%, var(--dsw-alias-bg-layer-1));
}
.dshRow[data-error="true"] .dshSelRail { background: var(--dsw-alias-state-error-primary); }
.dshRow[data-turn-start="true"]:not(:first-child) td::before {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--dsw-alias-border-l1);
  content: "";
  pointer-events: none;
  transform: translateY(-50%);
}
.dshRow[data-turn-start="true"] td { position: relative; }
.dshRow[data-turn-start="true"] .dshEvent { overflow: visible; }
.dshRow[data-turn-start="true"] .dshContent { overflow: hidden; }
.dshKindSlot {
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: flex-end;
  width: 76px;
  margin-left: auto;
}
.dshKindTag {
  display: inline-flex;
  flex: none;
  align-items: center;
  box-sizing: border-box;
  height: 19px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 650;
  letter-spacing: 0.035em;
  user-select: none;
}
.dshKind-user { color: var(--dsw-alias-state-business-primary); background: var(--dsw-alias-state-business-tertiary); }
.dshKind-system { color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-module-platform); }
.dshKind-context {
  color: color-mix(in srgb, var(--dsw-alias-state-success-primary) 68%, var(--dsw-alias-label-secondary));
  background: var(--dsw-alias-state-success-tertiary);
}
.dshKind-message {
  color: color-mix(in srgb, var(--dsw-alias-brand-primary) 60%, var(--dsw-alias-state-error-secondary));
  background: color-mix(in srgb, color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, var(--dsw-alias-state-error-secondary)) 15%, var(--dsw-alias-bg-layer-1));
}
.dshKind-tool { color: var(--dsw-alias-state-warn-label); background: var(--dsw-alias-state-warn-tertiary); }
.dshKind-subtool {
  color: color-mix(in srgb, var(--dsw-alias-state-warn-label) 62%, var(--dsw-alias-label-tertiary));
  background: color-mix(in srgb, var(--dsw-alias-state-warn-tertiary) 58%, var(--dsw-alias-bg-layer-1));
}
.dshContent {
  padding-left: 4px !important;
  color: var(--dsw-alias-label-primary);
  min-width: 0;
  overflow: hidden;
}
.dshRow[data-kind="subtool"] .dshContent { padding-left: 26px !important; }
.dshContentText {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dshRow[data-kind="context"] td,
.dshRow[data-kind="message"] td,
.dshRow[data-kind="system"] td {
  height: auto;
  min-height: 30px;
  padding-top: 6px;
  padding-bottom: 6px;
  white-space: normal;
}
.dshRow[data-kind="context"] .dshContentText,
.dshRow[data-kind="message"] .dshContentText,
.dshRow[data-kind="system"] .dshContentText {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.dshToolPreview {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  overflow: hidden;
  font-family: var(--ds-font-family-code);
  font-size: 12px;
}
.dshToolReq {
  flex: 1 1 46%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dshToolName { color: var(--dsw-alias-label-primary); }
.dshToolArgs { margin-left: 7px; color: var(--dsw-alias-label-secondary); }
.dshInlineResult {
  display: flex;
  flex: 1 1 54%;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  color: var(--dsw-alias-label-secondary);
}
.dshInlineResult .dshContentText {
  flex: 1;
  min-width: 0;
}
.dshArrow { flex: none; margin-right: 8px; color: var(--dsw-alias-label-caption); }
.dshNoOut { color: var(--dsw-alias-label-caption); }
.dshCollapsed {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--dsw-alias-label-secondary);
  font-size: 12px;
  line-height: 16px;
}
.dshCollapsed i {
  flex: none;
  margin-right: 6px;
  color: var(--dsw-alias-label-tertiary);
  font-weight: 600;
  font-style: normal;
}
.dshDetails {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  width: clamp(280px, 34%, 320px);
  max-width: calc(100% - 280px);
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -6px 0 20px rgba(24, 24, 27, 0.025);
}
.dshDetails[hidden] { display: none !important; }
.dshDetailsHeader {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  min-height: 58px;
  height: auto;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.dshDetailsTitle {
  display: block;
  min-width: 0;
  color: var(--ink);
  font: 650 15px/20px Manrope, "Noto Sans SC", "PingFang SC", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dshDetailsLoc {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font: 11px/16px Manrope, "Noto Sans SC", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dshClose {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--dsw-alias-label-secondary);
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 18px;
}
.dshClose:hover {
  color: var(--dsw-alias-label-primary);
  background: var(--dsw-alias-interactive-bg-hover);
}
.dshDetailTabs {
  display: flex;
  flex: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  height: 46px;
  padding: 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  scrollbar-width: none;
  white-space: nowrap;
}
.dshDetailTabs::-webkit-scrollbar { display: none; }
.dshDetailTab {
  position: relative;
  flex: none;
  padding: 0 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: 13px/46px Manrope, "Noto Sans SC", sans-serif;
}
.dshDetailTab:hover {
  color: var(--ink);
  background: var(--cream2);
}
.dshDetailTab.on { color: var(--accent); font-weight: 650; }
.dshDetailTab.on::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  border-radius: 1px 1px 0 0;
  background: var(--accent);
  content: "";
}
.dshDetailBody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fafafa;
  padding: 8px 0;
}
.dshOverview {
  margin: 0;
  padding: 12px 16px;
  font: 13px/1.6 Manrope, "Noto Sans SC", sans-serif;
  background: #fff;
}
.dshOverview > div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  min-height: 22px;
  padding: 0 14px;
  align-items: center;
}
.dshOverview dt { color: var(--muted); }
.dshOverview dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dshOverview dd.error { color: var(--dsw-alias-state-error-primary); }
.dshSection {
  display: flex;
  flex-direction: column;
  min-height: 28px;
  overflow: hidden;
}
.dshSection + .dshSection { padding-top: 8px; }
.dshHeading {
  display: flex;
  flex: none;
  align-items: flex-end;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 10px 16px 6px;
  color: var(--ink);
  background: transparent;
  font: 650 13px/18px Manrope, "Noto Sans SC", sans-serif;
  user-select: none;
}
.dshMd {
  padding: 0 16px 16px;
  color: var(--ink);
  font: 13px/1.65 Manrope, "Noto Sans SC", sans-serif;
}
.dshMd table {
  width: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}
.dshPre {
  margin: 0;
  padding: 4px 16px 16px;
  overflow: auto;
  color: var(--ink);
  font: 12px/1.6 Manrope, "Noto Sans SC", sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
}
.dshSchemaEmpty {
  padding: 24px 16px;
  color: var(--dsw-alias-label-caption);
  font: var(--dsw-font-xs-13);
}
.dshPayload { padding: 10px 14px 14px; }
body[data-main-view="chat"] #pane-inspect {
  display: none !important;
}
body[data-main-view="trajectory"] .composer {
  display: none !important;
}
html[data-theme="dark"] .thinkOrb {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}
html[data-theme="dark"] .thinkText {
  background: linear-gradient(90deg, #8a8a8a 0%, #e8e8e8 45%, #8a8a8a 90%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="dark"] .traceThinkDot { background: var(--accent); }
html[data-theme="dark"] .centerCol {
  background: radial-gradient(circle at 50% -20%, rgba(30, 64, 175, 0.28), transparent 40%), #101216;
}
html[data-theme="dark"] .leftCol,
html[data-theme="dark"] .rightCol,
html[data-theme="dark"] .rightTabs,
html[data-theme="dark"] .rightPane,
html[data-theme="dark"] .rail,
html[data-theme="dark"] .dshDetails,
html[data-theme="dark"] .dshDetailsHeader,
html[data-theme="dark"] .dshDetailTabs {
  background: #15181d;
}
html[data-theme="dark"] .dshDetailBody { background: #101216; }
html[data-theme="dark"] .task.active { border-color: #1e3a8a; background: #172554; }
html[data-theme="dark"] .msgAct.on { background: #172554; color: #60a5fa; }
html[data-theme="dark"] .quickCard { background: #1b1f25; }
html[data-theme="dark"] .composer { background: rgba(21, 24, 29, 0.88); }
html[data-theme="dark"] .tokenBanner { background: #2a303a; color: #d5dbe6; }
html[data-theme="dark"] .tokenBanner button { background: #1b1f26; color: #d5dbe6; border-color: #414754; }
html[data-theme="dark"] .tokenBanner.blocked { background: #3a2c28; }
html[data-theme="dark"] .composerBox { background: #15181d; border-color: #2c313a; }
html[data-theme="dark"] .chipIcon { background: #2a2418; color: #d6b47a; }
html[data-theme="dark"] .sendBtn.idle { background: #3f4650; color: #e4e4e7; }

/* Zip login/register: white default, dark via html[data-theme]. */
.login-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100%;
  place-items: center;
  overflow: hidden;
  padding: 40px 24px;
  background: #fafaf9;
  color: var(--ink);
}
.login-screen::before {
  position: absolute;
  z-index: -3;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 78%);
  animation: tech-grid-drift 26s linear infinite;
}
.login-screen::after {
  position: absolute;
  z-index: -4;
  inset: -18%;
  content: "";
  background:
    radial-gradient(circle at 18% 30%, rgba(37, 99, 235, 0.16), transparent 25%),
    radial-gradient(circle at 78% 68%, rgba(99, 102, 241, 0.15), transparent 24%),
    radial-gradient(circle at 52% 46%, rgba(255, 255, 255, 0.98) 0, rgba(255, 255, 255, 0.82) 30%, rgba(250, 250, 249, 0.9) 74%);
  animation: tech-aurora-drift 20s ease-in-out infinite alternate;
}
.login-tech-field {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.login-tech-field::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72vw, 920px);
  height: min(72vw, 920px);
  content: "";
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  box-shadow: 0 0 0 42px rgba(37, 99, 235, 0.03), 0 0 0 84px rgba(14, 165, 233, 0.03);
  animation: tech-ring-breathe 12s ease-in-out infinite;
}
.login-tech-field::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(54vw, 680px);
  height: min(19vw, 240px);
  content: "";
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(30deg);
  animation: tech-ring-spin 32s linear infinite reverse;
}
.tech-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.tech-orbit-one {
  width: min(54vw, 680px);
  height: min(18vw, 220px);
  animation: tech-orbit-one 22s linear infinite;
}
.tech-orbit-two {
  width: min(66vw, 830px);
  height: min(28vw, 350px);
  border-color: rgba(99, 102, 241, 0.12);
  transform: translate(-50%, -50%) rotate(-38deg);
  animation: tech-orbit-two 30s linear infinite reverse;
}
.tech-orbit-three {
  width: min(38vw, 480px);
  height: min(72vw, 900px);
  border-color: rgba(37, 99, 235, 0.1);
  transform: translate(-50%, -50%) rotate(22deg);
  animation: tech-orbit-three 28s linear infinite;
}
.tech-node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1), 0 0 20px rgba(37, 99, 235, 0.35);
  animation: tech-node-pulse 4s ease-in-out infinite;
}
.tech-node-one { top: 24%; left: 18%; }
.tech-node-two { top: 28%; right: 19%; animation-delay: -1.2s; }
.tech-node-three { bottom: 24%; left: 23%; animation-delay: -2.4s; }
.tech-node-four { right: 13%; bottom: 18%; animation-delay: -3.3s; }
.tech-scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, rgba(37, 99, 235, 0.2), transparent);
  opacity: 0.6;
  animation: tech-scan 9s ease-in-out infinite alternate;
}
.login-card-modern {
  position: relative;
  width: min(100%, 448px);
  overflow: hidden;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 18px;
  padding: 22px 26px 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 26px 80px rgba(24, 24, 27, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.68) inset;
  backdrop-filter: blur(18px);
  color: var(--ink);
}
.login-card-modern::before {
  position: absolute;
  inset: 0 16% auto;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
  opacity: 0.9;
}
.login-card-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.login-wordmark-shell {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.login-wordmark-shell img { display: block; width: 156px; height: auto; object-fit: contain; }
.theme-logo-dark { display: none !important; }
.login-eyebrow {
  margin: 0 0 6px;
  color: var(--accent-red);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.login-form-head { margin-bottom: 14px; }
.login-form-head .login-eyebrow { margin-bottom: 6px; }
.login-form-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.login-form-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.login-form-footer {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.login-form-footer a { color: var(--accent-red); text-decoration: none; }
.login-form-footer a:hover { text-decoration: underline; }
.login-form-footer.small { font-size: 11px; margin-top: 6px; }
.err a { color: var(--accent); text-decoration: none; }
.err a:hover { text-decoration: underline; }
#codeRow[hidden] { display: none !important; }
.register-fields .code-field {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.login-screen.auth-a .code-field label {
  display: inline;
  height: auto;
  margin: 0;
  font-weight: 600;
}
.register-fields .input-with-btn {
  display: flex;
  gap: 8px;
  min-width: 0;
  align-items: stretch;
}
.register-fields .input-with-btn .input { flex: 1; min-width: 0; }
.login-screen.auth-a .input.verify-code {
  letter-spacing: normal;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: normal;
  padding: 7px 10px;
}
.send-code-btn {
  height: 46px;
  min-width: 108px;
  border-radius: 10px;
  padding: 0 12px;
  flex-shrink: 0;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.send-code-btn:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.send-code-btn:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--card);
  cursor: default;
}
html[data-theme="dark"] .send-code-btn:hover { color: #191c21; }
html[data-theme="dark"] .send-code-btn:disabled {
  background: #252830;
  color: var(--muted);
}
.code-status {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
}
.code-status.is-ok { color: var(--accent); }
.code-status.is-warn { color: var(--secondary); }
.code-status[hidden] { display: none !important; }
.authModal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(29, 36, 56, 0.42);
}
.authModal[hidden] { display: none !important; }
.authModalCard {
  width: min(100%, 400px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 48px rgba(29, 36, 56, 0.16);
  color: var(--ink);
}
.authModalCard .authModalTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.authModalLead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}
.captcha-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 16px 0 10px;
}
.captcha-row img {
  display: block;
  width: 280px;
  max-width: calc(100% - 76px);
  height: auto;
  aspect-ratio: 280 / 86;
  flex: 0 1 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  object-fit: contain;
}
.captcha-refresh {
  height: 36px;
  min-width: 64px;
  padding: 0 10px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--cream2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.captcha-refresh:hover { border-color: var(--accent); color: var(--accent); }
.authModalCard .input { width: 100%; }
.authModalActs {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.authModalActs .btn {
  min-width: 72px;
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1;
}
.login-screen.auth-a .authModalActs .btn.primary {
  height: 36px;
  min-height: 36px;
  margin-top: 0;
}
.authModalActs .btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.register-card-modern { width: min(100%, 520px); }
.register-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.register-fields label { min-width: 0; }
.register-fields .span2 { grid-column: 1 / -1; }
.register-fields .fieldName { display: inline; }
.register-fields .req {
  color: #e11d48;
  margin-left: 2px;
  font-weight: 700;
}
.register-fields .optionalHint {
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}
.form-stack { display: grid; gap: 8px; }
.form-stack label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.login-screen label,
.login-screen .form-stack label {
  font-weight: 600;
}
.login-screen .input {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 400;
  font-synthesis: none;
  padding: 7px 10px;
}
.login-screen .input::placeholder {
  font-weight: 400;
  font-synthesis: none;
  color: var(--muted);
  opacity: 1;
}
.login-screen .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 650;
  height: 36px;
  margin-top: 4px;
}
.login-screen .btn.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.theme-toggle:hover,
.auth-lang:hover {
  border-color: #d4d4d8;
  background: var(--cream2);
  color: var(--ink);
}
.login-theme-toggle { position: absolute; top: 22px; right: 24px; z-index: 2; }
.login-auth-bar {
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-chrome-icon,
.auth-lang-globe {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: block;
}
.auth-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding: 0 5px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--muted);
}
.auth-lang-globe { margin-right: 4px; }
.auth-lang-div {
  width: 1px;
  height: 12px;
  background: var(--line);
  margin: 0 2px;
}
.auth-lang-seg {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
}
.auth-lang-seg:hover { color: var(--ink); }
.auth-lang-seg[aria-pressed="true"] {
  background: #eff6ff;
  color: var(--accent);
}
.auth-lang-seg[aria-pressed="true"]:hover {
  color: var(--accent);
}
html[data-theme="dark"] .auth-lang-seg[aria-pressed="true"] {
  background: rgba(96, 165, 250, 0.16);
  color: var(--accent);
}
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .auth-lang:hover {
  border-color: #3f4652;
  background: var(--cream2);
  color: var(--ink);
}
html[data-theme="dark"] .login-screen { background: #0d0f12; color: var(--ink); }
html[data-theme="dark"] .login-screen::before {
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.08) 1px, transparent 1px);
}
html[data-theme="dark"] .login-screen::after {
  background:
    radial-gradient(circle at 18% 30%, rgba(37, 99, 235, 0.22), transparent 25%),
    radial-gradient(circle at 78% 68%, rgba(99, 102, 241, 0.2), transparent 24%),
    radial-gradient(circle at 52% 46%, rgba(21, 24, 29, 0.98) 0, rgba(13, 15, 18, 0.92) 70%);
}
html[data-theme="dark"] .login-card-modern {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
html[data-theme="dark"] .theme-logo-light { display: none; }
html[data-theme="dark"] .theme-logo-dark { display: block !important; }
html[data-theme="dark"] .login-wordmark-shell {
  background: transparent;
  box-shadow: none;
}
@keyframes tech-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}
@keyframes tech-aurora-drift {
  from { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
  to { transform: translate3d(2%, 1%, 0) rotate(3deg); }
}
@keyframes tech-ring-breathe {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) rotate(-18deg) scale(0.98); }
  50% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1.03); }
}
@keyframes tech-ring-spin {
  from { transform: translate(-50%, -50%) rotate(30deg); }
  to { transform: translate(-50%, -50%) rotate(390deg); }
}
@keyframes tech-orbit-one {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes tech-orbit-two {
  from { transform: translate(-50%, -50%) rotate(-38deg); }
  to { transform: translate(-50%, -50%) rotate(-398deg); }
}
@keyframes tech-orbit-three {
  from { transform: translate(-50%, -50%) rotate(22deg); }
  to { transform: translate(-50%, -50%) rotate(382deg); }
}
@keyframes tech-node-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
@keyframes tech-scan {
  from { transform: translateX(-22vw); opacity: 0.08; }
  to { transform: translateX(22vw); opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
  .login-screen::before, .login-screen::after, .login-tech-field::before, .login-tech-field::after, .tech-orbit, .tech-node, .tech-scan-line { animation: none; }
}
@media (max-width: 600px) {
  .login-screen { padding: 20px 14px; }
  .login-card-modern { padding: 26px 22px; border-radius: 14px; }
  .login-card-brand { margin-bottom: 28px; }
  .register-card-modern { width: min(100%, 448px); }
  .register-fields { grid-template-columns: 1fr; }
  .register-fields .input-with-btn { flex-wrap: wrap; }
  .send-code-btn { width: 100%; min-width: 0; }
  .login-theme-toggle { top: 14px; right: 14px; }
  .login-auth-bar { top: 14px; right: 14px; }
}

/* Scheme A shell */
.shell .sidebar,
.shell .leftCol,
.page.scheme-page .sidebar {
  background: var(--cream2);
  gap: 0;
  padding: 27px 16px 14px;
  color: var(--ink);
}
.shell .brand,
.page.scheme-page .brand {
  margin: 0;
  color: inherit;
  text-decoration: none;
}
.shell .navCollapse,
.shell .iconButton.navCollapse {
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  box-shadow: none;
}
.assistantHeader { display: flex; align-items: center; gap: 9px; margin: 8px 0 13px; }
.assistantHeader img { height: 25px; width: 25px; object-fit: contain; }
.assistantHeader strong { font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.msgAct[aria-pressed="true"] { color: var(--accent); background: var(--soft); }
svg.icon { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.iconButton { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--secondary); flex-shrink: 0; border: 0; background: none; cursor: pointer; }
.iconButton:hover { background: #f1f3f8; color: var(--blue); }
.sidebarHead { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.brand { display: flex; align-items: center; gap: 8px; padding-left: 4px; letter-spacing: -.5px; font-size: 16px; font-weight: 600; color: inherit; text-decoration: none; }
.brand img { width: 26px; height: 26px; object-fit: contain; }
.newChat { display: flex; justify-content: center; align-items: center; gap: 7px; width: 100%; background: #fff; border: 1px solid #e1e4ec; box-shadow: 0 2px 3px #272c3c03; border-radius: 10px; padding: 8px; margin: 16px 0 4px; font-weight: 550; cursor: pointer; color: inherit; }
.newChat:hover { border-color: #b5c2f3; color: var(--blue); }
.search { display: flex; align-items: center; gap: 8px; padding: 4px 8px; color: #90949e; }
.search input { width: 100%; min-width: 0; border: 0; background: none; outline: none; font-size: 13px; color: var(--ink); padding: 0; }
.historyWrap { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.history, .taskList.history { flex: 1; overflow: auto; margin: 4px -4px 0; }
.groupLabel { font-size: 12px; color: #787e8c; padding: 6px 10px 2px; margin: 0; letter-spacing: .5px; }
.taskList .task { width: 100%; text-align: left; padding: 8px 10px; margin: 0 0 1px; border-radius: 9px; display: flex; align-items: center; gap: 7px; border: 0; background: transparent; cursor: pointer; position: relative; }
.taskList .task .taskIcon { width: 14px; height: 14px; flex-shrink: 0; color: #9aa1ad; }
.taskList .task.active .taskIcon { color: #3656b4; }
.taskList .task .taskMain { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.taskList .task .title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.taskList .task .taskTime { flex: none; font-size: 11px; color: #9aa1ad; min-width: 2.4em; text-align: right; }
.taskList .task .meta { color: #787e8c; font-size: 11px; }
.taskList .task .moreBtn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; padding: 0; opacity: .45; pointer-events: auto; display: grid; place-items: center; font-size: 15px; line-height: 1; color: #9aa1ad; }
.taskList .task:hover .taskTime, .taskList .task.menuOpen .taskTime { visibility: hidden; }
.taskList .task:hover .moreBtn, .taskList .task.menuOpen .moreBtn, .taskList .task:focus-within .moreBtn { opacity: 1; color: inherit; }
.taskList .task.active { background: #e9edf8; color: #3656b4; box-shadow: none; border: 0; }
.taskList .task:hover:not(.active) { background: #eeeff3; }
.sidebarFoot { margin-top: auto; }
.workspace { display: flex; gap: 11px; align-items: center; border-top: 1px solid #e6e8ee; padding: 14px 9px; font-size: 13px; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; cursor: pointer; text-decoration: none; }
.workspace .icon { color: #888e9f; }
.workspace span { flex: 1; text-align: left; }
.workspace:hover { color: var(--blue); }
.workspace.active { color: var(--blue); }
.chip.pendingItem { border-style: dashed; }
.accountRow { display: flex; align-items: center; gap: 4px; }
.account { display: flex; align-items: center; gap: 10px; padding: 9px; flex: 1; min-width: 0; background: none; border: 0; cursor: pointer; color: inherit; text-align: left; }
.avatar { background: var(--soft); color: var(--blue); width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; flex-shrink: 0; font-weight: 550; }
.shell .sidebar #railUserAv, .shell .avatar, .userMenuAv { background: var(--soft); color: var(--blue); font-weight: 550; }
.account strong { font-size: 13px; font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { font-size: 11px; color: var(--muted); display: block; }
.drivePane { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.driveBar { display: flex; align-items: center; gap: 8px; }
.topbar { min-height: 64px; height: auto; flex-shrink: 0; padding: 10px 30px; display: flex; flex-direction: row; align-items: center; gap: 12px; background: #ffffffed; border-bottom: 0; overflow: visible; }
.sessionHead { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; flex: 0 1 auto; }
.sessionTitle { font-size: 16px; font-weight: 650; color: var(--ink); letter-spacing: -0.2px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: min(56vw, 720px); display: block; }
.topbar .spacer { flex: 1; }
.topbar .mainTabs { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; border-bottom: 0; flex-shrink: 0; }
.topbar .mainTab { border: 0; border-bottom: 0; background: transparent; color: var(--muted); padding: 3px 8px; margin: 0; border-radius: 6px; cursor: pointer; font-size: 12px; }
.topbar .mainTab.active { color: var(--blue); background: var(--soft); box-shadow: none; }
.resultButton { display: flex; gap: 7px; align-items: center; color: #656b7b; font-size: 12px; border: 1px solid #e7e9ef; border-radius: 8px; padding: 6px 10px; white-space: nowrap; background: #fff; cursor: pointer; }
.resultButton em { font-size: 10px; font-style: normal; color: var(--blue); background: var(--soft); border-radius: 4px; padding: 0 5px; }
.reading { width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); padding: 19px var(--gutter) 36px; margin: 0 auto; }
.chatLog, .chatLog.reading { align-items: stretch; }
.chatLog.reading { align-self: center; width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); padding: 19px var(--gutter) 112px; }
.chatLogSpacer { flex: 0 0 auto; width: 100%; pointer-events: none; overflow-anchor: none; }
.chatLog .msg { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
.chatLog .msg.user, .msg.user {
  width: fit-content;
  max-width: min(680px, 88%);
  margin-left: auto;
  margin-right: 0;
  align-self: flex-end;
}
.msg.user .bubble { background: #f3f4f8; border: 0; border-radius: 18px 18px 4px 18px; padding: 15px 20px; line-height: 1.8; font-size: 15px; width: fit-content; }
.msg.user .role, .msg.assistant .role { display: none; }
.msg.assistant { display: flex; flex-direction: column; scroll-margin-top: 12px; scroll-margin-bottom: 28px; }
.trace-item.is-open .trace-detail { scroll-margin-bottom: 28px; }
.msg.assistant::before { content: none; }
.thinkCard { font-size: 13px; color: var(--secondary); margin: 0 0 16px; border: 0; background: transparent; }
.thinkCard.processCard {
  flex-shrink: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}
.thinkCard > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 7px; width: fit-content; }
.thinkCard.processCard > summary { width: 100%; gap: 12px; padding: 13px 17px; box-sizing: border-box; font-size: 14px; }
.thinkCard.processCard-static > summary { cursor: default; }
.thinkCard.processCard-static > summary .thinkFold,
.thinkCard.processCard-static .thinkPanel { display: none; }
.thinkCard > summary::-webkit-details-marker { display: none; }
.msg.assistant .md { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.msg.assistant .md h1 { font-size: 20px; letter-spacing: -.2px; font-weight: 600; margin: 0 0 20px; }
.msg.assistant .md h2 { font-size: 15px; margin: 28px 0 14px; font-weight: 600; }
.msg.assistant .liveUpdate {
  margin: 28px 0 8px;
  width: 100%;
}
.msg.assistant .liveUpdate .liveUpdateTitle,
.msg.assistant .liveUpdate .md h1,
.msg.assistant .liveUpdate .md h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.2px;
  margin: 10px 0 13px;
}
.msg.assistant .liveUpdate .md {
  font-size: 16px;
  line-height: 1.75;
}
.msg.assistant .liveUpdate .md p { margin: 12px 0; }
.msg.assistant .liveUpdate .md ul { margin: 10px 0; padding-left: 22px; }
.msg.assistant .liveUpdate .md li { margin: 7px 0; padding-left: 3px; }
.fileGrid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.fileCard { border: 1px solid #e6e9f0; border-radius: 16px; overflow: hidden; text-align: left; padding: 0; min-width: 220px; max-width: 380px; background: white; cursor: pointer; color: inherit; }
.msg.assistant .md .fileCard { margin: 8px 0; }
.msg.assistant .md li:has(.fileCard) { list-style: none; margin: 0; padding: 0; }
.msg.assistant .md ul:has(.fileCard), .msg.assistant .md ol:has(.fileCard) { padding-left: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.fileCard:hover { border-color: #acbdeb; }
.fileInfo { display: flex; gap: 8px; align-items: center; padding: 10px 12px; min-width: 0; }
.fileType { width: 30px; height: 34px; border: 1px solid #dce3f3; border-radius: 5px; display: grid; place-items: center; color: #6a83bd; background: #f5f8ff; font-size: 10px; font-weight: 650; flex-shrink: 0; }
.fileType.csv { color: #619780; border-color: #d9eade; background: #f0f8f3; }
.fileType.svg { color: #9a7bb4; border-color: #e8dff2; background: #f8f4fc; }
.fileType.json { color: #b45309; border-color: #f3e0c4; background: #fff8ee; }
.fileType.md, .fileType.txt { color: #5b6d94; border-color: #dce3f1; background: #f5f7fb; }
.fileInfo > div { min-width: 0; flex: 1; }
.fileInfo strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.fileInfo small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.fileCardActs, .fileListDl { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.fileCardActs .iconButton, .fileListDl.iconButton { width: 28px; height: 28px; color: #9aa2b4; }
.fileCardActs .iconButton .icon, .fileListDl .icon { width: 14px; height: 14px; }
.fileCardActs .iconButton.ok { color: var(--done); }
.fileSectionHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 20px 0 8px; font-size: 13px; color: var(--muted); }
.followups { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.followups button { padding: 8px 12px; border: 1px solid #eceef3; color: var(--secondary); border-radius: 8px; font-size: 13px; background: #fff; cursor: pointer; }
.followups button:hover { color: var(--blue); border-color: #c3cff1; }
.msgActs { gap: 5px; }
.msgAct { width: 34px; height: 34px; }
.composer { flex-shrink: 0; padding: 12px var(--gutter) 15px; background: linear-gradient(#ffffffed, #fff); border-top: 0; }
.composerInner { max-width: var(--content); margin: 0 auto; width: 100%; }
.inputBox, .composerBox { border: 1px solid #dfe3ed; border-radius: 18px; padding: 15px 17px 12px; box-shadow: var(--shadow); background: white; }
.inputBox:focus-within, .composerBox:focus-within { border-color: #a9bae9; box-shadow: 0 0 0 3px #3e63dd06, 0 7px 24px #28345308; }
.composerBox textarea, .inputBox textarea { display: block; width: 100%; min-height: 48px; max-height: 130px; resize: none; outline: none; border: 0; background: transparent; color: #414857; font-size: 15px; line-height: 1.7; padding: 0; }
.inputToolbar, .composerActions { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.uploadButton, .plusBtn { border: 1px solid #e8ebf2; width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; color: #7f8798; background: #fff; padding: 0; cursor: pointer; }
.uploadButton:hover, .plusBtn:hover { color: var(--blue); background: #f3f6fd; }
.modelPill { display: flex; align-items: center; gap: 7px; color: var(--secondary); font-size: 13px; border: 0; background: none; padding: 0; }
.modelPill::after { content: none; }
.modelDot { width: 5px; height: 5px; border-radius: 50%; background: #87a493; display: inline-block; }
.send, .sendBtn { background: var(--blue); border-radius: 50%; color: #fff; width: 31px; height: 31px; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; }
.send:disabled, .sendBtn:disabled { background: #eef0f6; color: #b3bacb; cursor: default; }
.sendBtn.pauseBtn { background: var(--blue); color: #fff; }
.chipRow { display: flex; gap: 7px; overflow: auto; margin-bottom: 12px; padding: 2px; }
.chipRow[hidden] { display: none !important; }
.chip { display: flex; align-items: center; gap: 6px; border: 1px solid #e6eaf2; border-radius: 8px; padding: 5px 7px; white-space: nowrap; font-size: 12px; max-width: none; }
.previewHeader { height: 73px; display: flex; flex-direction: row; padding: 0 20px; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); background: #fff; flex-shrink: 0; overflow: hidden; }
.previewHeader strong { font-size: 14px; font-weight: 550; flex-shrink: 0; }
.previewHeader small { font-size: 12px; color: #818c9d; margin-left: 3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.previewHeader .iconButton:first-of-type { margin-left: auto; }
.preview .previewTabs.rightTabs, .previewTabs {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 0;
  height: auto;
  padding: 15px 20px 0;
  border-bottom: 0;
  background: transparent;
  flex-shrink: 0;
}
.previewTabs button, .previewTabs .tabBtn {
  height: auto;
  min-height: 0;
  font-size: 13px;
  font-weight: 400;
  color: #738095;
  padding: 6px 10px;
  border-radius: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  box-shadow: none;
}
.previewTabs button.active, .previewTabs .tabBtn.active {
  color: var(--blue);
  background: #eaf0fd;
  box-shadow: none;
  font-weight: 400;
}
.previewBody { flex: 1; overflow: auto; padding: 20px; min-height: 0; }
.previewBody .rightPane { padding: 0; background: transparent; overflow: visible; flex: none; min-height: 0; }
.previewName { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.previewName div { min-width: 0; }
.previewName strong { display: block; font-size: 14px; font-weight: 550; word-break: break-all; }
.previewName small { color: #7d8a9e; font-size: 12px; }
.previewCanvas { border: 1px solid #e3e8f1; background: #fff; border-radius: 10px; overflow: auto; min-height: 230px; display: flex; align-items: center; justify-content: center; padding: 14px; }
.previewCanvas.checker { background-color: #fff; background-image: conic-gradient(#f5f6f9 25%, #fff 0 50%, #f5f6f9 0 75%, #fff 0); background-size: 16px 16px; }
.previewCanvas img { display: block; max-width: 100%; max-height: 60vh; object-fit: contain; }
.previewCanvas.tableCanvas, .previewCanvas.mdCanvas { display: block; padding: 0; align-items: stretch; justify-content: flex-start; text-align: left; }
.previewCanvas.mdCanvas { padding: 16px 18px; }
.previewCanvas.frameCanvas { padding: 0; display: block; overflow: hidden; }
.previewFrame { width: 100%; height: 70vh; min-height: 360px; border: 0; display: block; background: #fff; }
.previewCode { margin: 0; width: 100%; min-height: 230px; padding: 14px 16px; overflow: auto; font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); text-align: left; }
.dataTable { border-collapse: collapse; width: 100%; font: 13px/1.6 var(--mono); white-space: nowrap; }
.dataTable th, .dataTable td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #edf0f5; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.dataTable th { background: #f1f5f9; color: #64748b; }
.previewFooter { padding: 17px 20px; border-top: 1px solid #e7ebf2; background: #fff; flex-shrink: 0; }
.previewFooter[hidden] { display: none !important; }
.download { display: flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; background: #fff; color: #5b6d94; border: 1px solid #dce3f1; border-radius: 9px; padding: 10px; font-size: 13px; }
.download[hidden] { display: none !important; }
.preview .fileList, .previewBody .fileList { display: grid; gap: 8px; overflow: visible; flex: none; }
.fileListItem { display: flex; align-items: center; gap: 8px; }
.fileListOpen { border: 1px solid var(--line); border-radius: 10px; background: white; text-align: left; flex: 1; min-width: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.fileListOpen:hover { border-color: #acbdeb; }
.fileListOpen .fileInfo { padding: 12px; }
.timeline { list-style: none; padding: 4px 0 0 9px; margin: 16px 0; width: 100%; background: transparent; }
.timeline li { position: relative; border-left: 1px solid #e0e6f0; padding: 0 0 27px 21px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border: 2px solid #fafbfe; border-radius: 50%; background: #94a9cf; box-shadow: 0 0 0 1px #dce4f1; }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline strong { display: block; font-size: 14px; font-weight: 550; color: #586a88; }
.timeline p { margin: 5px 0 0; font-size: 13px; color: #748197; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.timeline p.traceJson { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.55; }
.previewSplit { width: 5px; cursor: col-resize; margin-right: -3px; z-index: 4; flex-shrink: 0; }
.previewSplit:hover, .previewSplit.drag { background: #dce5ff; }
.previewSplit[hidden] { display: none !important; }
.dropOverlay { position: absolute; inset: 12px; border: 2px dashed #a8bcec; border-radius: 18px; background: #f2f6fff5; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; gap: 12px; color: #5b76b5; }
.dropOverlay[hidden] { display: none !important; }
.dropOverlay .icon { width: 36px; height: 36px; }
html[data-theme="dark"] .dropOverlay { background: #252e40f5; border-color: #8ba8e8; color: #c3d3f5; }
.mobileBackdrop { display: none; }
.welcome { padding: 48px var(--gutter) 8px; }
.welcomeTitle { font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.quickCard { border-radius: 14px; }
html[data-theme="dark"] .sidebar, html[data-theme="dark"] .leftCol { background: #191c21; border-color: var(--line); }
html[data-theme="dark"] .newChat, html[data-theme="dark"] .inputBox, html[data-theme="dark"] .composerBox, html[data-theme="dark"] .fileCard { background: #282c34; border-color: #414754; }
html[data-theme="dark"] .taskList .task.active { background: #2c3750; color: #c0d0ff; }
html[data-theme="dark"] .taskList .task .taskTime { color: var(--muted); }
html[data-theme="dark"] .taskList .task:hover:not(.active) { background: #303641; }
html[data-theme="dark"] .userMessage, html[data-theme="dark"] .msg.user .bubble { background: #2b3039; }
html[data-theme="dark"] .composer { background: linear-gradient(#202329ed, #202329); }
html[data-theme="dark"] .send, html[data-theme="dark"] .sendBtn { background: #a5bbf3; color: #202b43; }
html[data-theme="dark"] .preview { background: #242830; border-color: var(--line); }
html[data-theme="dark"] .previewHeader, html[data-theme="dark"] .previewFooter { background: #20242b; }
html[data-theme="dark"] .topbar { background: #202329ed; }
html[data-theme="dark"] .centerCol { background: #202329; }
html[data-theme="dark"] .account .avatar, html[data-theme="dark"] .shell .sidebar #railUserAv, html[data-theme="dark"] .userMenuAv { background: var(--soft); color: var(--blue); }
html[data-theme="dark"] .taskList .task .taskIcon { color: var(--muted); }
html[data-theme="dark"] .taskList .task.active .taskIcon { color: #c0d0ff; }
html[data-theme="dark"] .resultButton { background: #282c34; border-color: #414754; color: var(--muted); }
html[data-theme="dark"] .fileVisual { background: #232730; border-color: var(--line); }
html[data-theme="dark"] .fileListOpen { background: #282c34; border-color: #414754; }
html[data-theme="dark"] .previewTabs button, html[data-theme="dark"] .previewName small, html[data-theme="dark"] .previewHeader small { color: var(--muted); }
@media (min-width: 1650px) { :root { --side: 264px; --preview: 470px; } }
@media (max-width: 1200px) { :root { --preview: 360px; } .topbar { padding: 0 20px; } }
@media (max-width: 850px) {
  .sidebar { position: absolute; inset: 0 auto 0 0; z-index: 12; box-shadow: 12px 0 40px #14223c18; }
  .mobileBackdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: #24314a30; z-index: 11; }
  .preview { position: absolute; inset: 0 0 0 auto; width: min(460px, 100%); z-index: 13; }
  .previewSplit { display: none; }
  .fileGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Auth A */
.login-screen.auth-a {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
  background: var(--cream);
  place-items: stretch;
  overflow: auto;
}
html[data-theme="dark"] .login-screen.auth-a { background: var(--cream); color: var(--ink); }
html[data-theme="dark"] .authStory h2 { color: var(--ink); }
html[data-theme="dark"] .authStoryIntro { color: var(--secondary); }
html[data-theme="dark"] .researchCard { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .pathNode { background: var(--surface-raised); color: var(--ink); }
.login-screen.auth-a .login-auth-bar {
  position: static;
  align-self: flex-end;
  margin: 20px 28px 0;
}
.authLayout { width: 100%; max-width: 1176px; margin: auto; padding: 38px 40px 52px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: clamp(52px, 7vw, 112px); }
.authStory .eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 1.4px; margin: 0 0 20px; text-transform: uppercase; }
.authStory h2 { font-size: clamp(22px, 2vw, 24px); font-weight: 600; line-height: 1.5; letter-spacing: -.4px; margin: 0 0 16px; }
.authStoryIntro { font-size: 15px; color: var(--secondary); line-height: 1.9; max-width: 400px; margin: 0; }
.researchCard { max-width: 420px; background: var(--cream2); border: 1px solid var(--line); border-radius: 18px; margin: 36px 0 20px; padding: 24px; }
.evidencePath { display: flex; align-items: center; gap: 8px; }
.pathNode { border: 1px solid var(--line); border-radius: 8px; background: var(--cream); padding: 8px 10px; font-size: 12px; text-align: center; flex: 1; }
.pathNode:last-child { background: var(--soft); color: var(--accent); border-color: transparent; }
.authFormSection { width: 100%; max-width: 400px; justify-self: end; }
body[data-auth-title="page_register"] .authFormSection { max-width: 440px; }
.authFormSection h1 { font-size: 25px; font-weight: 600; margin: 0 0 9px; }
.authFormSection .lead { margin: 0 0 24px; color: var(--secondary); }
.login-screen.auth-a .authNotice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--soft);
}
.login-screen.auth-a .authNotice strong {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.login-screen.auth-a .authNotice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--secondary);
}
.login-screen.auth-a .migrateCard {
  width: min(100%, 420px);
}
.login-screen.auth-a .migrateCard .authModalLead {
  margin-top: 10px;
  line-height: 1.7;
  color: var(--secondary);
}
.login-screen.auth-a .login-card-modern, .login-screen.auth-a .register-card-modern {
  width: 100%; max-width: none; padding: 0; border: 0; box-shadow: none; background: transparent;
}
.login-screen.auth-a .login-card-modern::before { display: none; }
.login-screen.auth-a .login-card-brand { display: none; }
.login-screen.auth-a .input { height: 46px; border-radius: 10px; }
.login-screen.auth-a .btn.primary { min-height: 46px; border-radius: 10px; background: var(--accent); }
.sampleHead { display: flex; gap: 8px; align-items: center; color: var(--secondary); font-size: 12px; margin-bottom: 12px; }
.researchCard h2 { font-size: 15px; font-weight: 600; margin: 0 0 16px; }
.pathArrow { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.storyFoot { font-size: 12px; color: var(--muted); margin: 0; }
.paperLink { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 12px; color: var(--accent); text-decoration: none; }
.paperLink:hover { text-decoration: underline; }
body[data-auth-title="page_register"] .authLayout { grid-template-columns: minmax(0, 1fr) minmax(0, 480px); }
html.boot-pending #app,
html.boot-pending .page { visibility: hidden; }
@media (max-width: 980px) {
  .authLayout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(440px, calc(100% - 32px));
    max-width: 440px;
    margin: 0 auto;
    padding: 24px 0 40px;
    gap: 0;
  }
  .authStory { display: none; }
  .authFormSection, body[data-auth-title="page_register"] .authFormSection {
    max-width: none;
    justify-self: stretch;
  }
  .login-screen.auth-a .login-auth-bar { margin: 16px 16px 0; }
}
.page.scheme-page { display: flex; height: 100vh; overflow: hidden; background: var(--cream); }
.page.scheme-page .sidebar { position: relative; width: var(--left-w, var(--side)); flex-shrink: 0; }
.page.scheme-page .resources-main { flex: 1; overflow: auto; background: var(--cream); }
.page.scheme-page .page-content { max-width: 960px; margin: 0 auto; padding: 36px 32px 64px; }
.page.scheme-page .resource-row { border-radius: 12px; }
html[data-theme="dark"] .page.scheme-page .resources-main { background: #202329; }
.settingsModal .settingsCard { border-radius: 16px; }
.userMenu, .helpMenu { border-radius: 12px; }
.taskMenu { border-radius: 8px; box-shadow: 0 8px 24px #1d24380f, 0 1px 3px #1d24380a; }
.shell [hidden] { display: none !important; }
.clarifyCard {
  background: #f7f8fb;
  border: 1px solid #e6e9f0;
  border-radius: 14px;
  padding: 14px 16px;
  gap: 10px;
}
.clarifyCard.approvalCard {
  background: #fff;
  border: 1px solid #e6e9f0;
  border-radius: 12px;
  padding: 0;
  gap: 0;
  max-width: 560px;
}
.approvalMain { padding: 14px 16px 0; }
.approvalHeading { display: flex; gap: 9px; align-items: flex-start; }
.approvalIcon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--blue); background: var(--soft);
}
.approvalIcon .icon { width: 16px; height: 16px; }
.approvalTitle { font-size: 14px; font-weight: 600; line-height: 1.5; margin: 0 0 3px; color: var(--ink); }
.approvalMeta { color: var(--secondary); margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.approvalMeta code { font: 12px/1.5 var(--mono); }
.scopeShort { color: var(--secondary); font-size: 12px; line-height: 1.7; margin: 10px 0 0; }
.requestDetails { margin: 8px 0 0; }
.requestDetails > summary {
  font-size: 12px; color: var(--secondary); cursor: pointer;
  display: flex; align-items: center; gap: 5px; list-style: none; width: fit-content;
}
.requestDetails > summary::-webkit-details-marker { display: none; }
.requestDetails > summary .icon { width: 12px; height: 12px; transition: transform .15s; }
.requestDetails[open] > summary .icon { transform: rotate(90deg); }
.approvalCard .clarifyActs { padding: 10px 16px 14px; margin: 0; }
.approvalCard .clarifyErr { padding: 0 16px 12px; }
.clarifyActs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.clarifyGo, .clarifySkip {
  border-radius: 7px;
  padding: 4px 11px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  border: 0;
}
.clarifyGo {
  background: var(--blue);
  color: #fff;
}
.clarifyGo:hover { filter: brightness(1.04); }
.clarifySkip {
  background: #fff;
  color: var(--secondary);
  border: 1px solid #e6eaf2;
}
.clarifySkip:hover { border-color: #c3cff1; color: var(--blue); }
.clarifyGo:disabled, .clarifySkip:disabled { opacity: .55; cursor: default; }
.clarifyCard pre {
  max-height: 220px;
  overflow: auto;
  background: #f7f8fb;
  border: 1px solid #e6e9f0;
  border-radius: 8px;
  padding: 10px 12px;
  font: 12px/1.6 var(--mono);
  color: var(--secondary);
  margin: 8px 0 0;
  white-space: pre-wrap;
}
.fileNote { font-size: 13px; color: var(--muted); margin: 12px 0 0; line-height: 1.75; }
html[data-theme="dark"] .fileListOpen, html[data-theme="dark"] .clarifyCard, html[data-theme="dark"] .clarifySkip, html[data-theme="dark"] .clarifyCard.approvalCard { background: #282c34; border-color: #414754; }
html[data-theme="dark"] .clarifyCard pre { background: #242830; border-color: #414754; }
html[data-theme="dark"] .clarifyGo { background: #a5bbf3; color: #202b43; }
html[data-theme="dark"] .approvalIcon { background: var(--soft); color: var(--blue); }
html[data-theme="dark"] .timeline li { border-color: #465167; }
html[data-theme="dark"] .timeline li::before { border-color: #242830; background: #94a9cf; }
html[data-theme="dark"] .timeline p, html[data-theme="dark"] .timeline strong { color: var(--secondary); }
html[data-theme="dark"] .previewCode, html[data-theme="dark"] .previewCanvas.tableCanvas { background: #242830; color: var(--ink); }
html[data-theme="dark"] .previewTabs button.active, html[data-theme="dark"] .previewTabs .tabBtn.active { background: var(--soft); color: var(--blue); }
html[data-theme="dark"] .fileType.json { background: #3b3228; border-color: #6b5340; color: #efc08a; }
