Z ZPI 文档 v0.3.8
介绍页

源码

packages/ui/src/styles.css

css4415 行查看原文
@import "tailwindcss";
@import "./tokens.css";
@import "./preview-cards.css";
@import "katex/dist/katex.min.css";
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
@source "../../../node_modules/streamdown/dist/*.js";
@source "../../../node_modules/@streamdown/mermaid/dist/*.js";
@source "./components/QueuedSummaryContent.tsx";
@source "./components/FlipMetricValue.tsx";
@theme {
  --color-border: rgba(13, 13, 13, 0.1);
  --color-foreground: var(--color-text);
  --font-sans: var(--font-body);
  --font-mono: var(--font-code);
}
@theme inline {
  --color-background: var(--color-bg);
  --color-muted: var(--color-surface-muted);
  --color-muted-foreground: var(--color-text-muted);
}
:root {
  font-family: var(--font-body);
  /* Match ZCode's en document font selection while retaining Chinese HTML
     language metadata for accessibility. Chromium also needs the main locale. */
  -webkit-locale: "en";
  color: var(--color-text);
  background: transparent;
  /* Keep rem geometry at ZCode's 16px root; interface scaling belongs on text only. */
  font-size: 16px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html,
body,
#root {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
html {
  overscroll-behavior: none;
}
#root {
  height: 100dvh;
}
body {
  margin: 0;
  font-size: var(--text-body);
  line-height: var(--line-body);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  cursor: pointer;
  background: transparent;
  border-radius: var(--radius-control);
  transition:
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
button:disabled,
select:disabled {
  cursor: default;
  opacity: 0.5;
}
@layer base {
  /* Components can replace this keyboard-focus fallback with their own cue. */
  :where(:focus-visible) {
    outline: 1px solid var(--color-focus);
    outline-offset: -1px;
  }
  /* Text fields use a caret and their container border; menu surfaces delegate
     focus indication to the highlighted item. */
  :where(
    input:not([type="checkbox"], [type="radio"], [type="range"]),
    textarea,
    [contenteditable],
    [role="menu"],
    [role="listbox"]
  ),
  :where(:focus:not(:focus-visible)) {
    outline: none;
  }
}
button:hover:not(:disabled) {
  background-color: var(--color-hover);
}
svg {
  flex-shrink: 0;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-code);
  font-size: var(--text-small);
  line-height: var(--line-body);
  margin: var(--space-3) 0;
}
a {
  color: var(--color-file-link);
}
small {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
}
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: transparent;
  border-right: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-3) var(--space-3);
}
.sidebar-heading {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.projects {
  flex: 1;
  overflow: auto;
}
.project {
  margin: var(--space-3) 0;
}
.project-title {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  font-weight: 500;
}
.project-name,
.session-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.muted-icon {
  color: var(--color-text-muted);
  padding: var(--space-1);
  display: flex;
}
.session-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-control);
  margin: var(--space-1) 0 var(--space-1) var(--space-4);
  padding: var(--space-2);
  color: var(--color-text-muted);
  border-left: 2px solid transparent;
}
.session-row.active {
  background: var(--color-active);
  color: var(--color-text);
  border-left-color: var(--color-primary);
}
.session-name {
  padding: 0;
}
.row-action {
  opacity: 0;
  padding: 2px;
}
.session-row:hover .row-action,
.project-title:hover .row-action,
.row-action:focus-visible {
  opacity: 1;
}
.sidebar-footer {
  padding: var(--space-4) var(--space-2) var(--space-1);
}
.sidebar-footer button {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  color: var(--color-text-muted);
  padding: var(--space-1);
}
.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  min-height: 52px;
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) max(var(--space-6), calc((100% - 772px) / 2));
  display: flex;
  align-items: center;
}
.topbar-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conversation-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  isolation: isolate;
}
.task-find-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(360px, calc(100% - 16px));
  height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-input);
  box-shadow:
    0 4px 6px -1px #0000001a,
    0 2px 4px -2px #0000001a;
  -webkit-app-region: no-drag;
}
.task-find-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0;
  background: transparent;
  outline: none;
  font-weight: 500;
}
.task-find-bar input::placeholder {
  color: var(--color-text-subtlest);
}
.task-find-count {
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-subtle);
}
.task-find-controls,
.task-find-close {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  border-left: 1px solid var(--color-border);
  padding-left: 6px;
  gap: 2px;
}
.task-find-close {
  margin-left: 2px;
}
.task-find-action {
  display: inline-flex;
}
.task-find-action button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0;
}
.task-find-action button:active:not(:disabled) {
  transform: none;
}
.task-find-action button:disabled {
  opacity: 0.5;
}
@media (max-width: 767px) {
  .task-find-bar {
    top: 8px;
  }
}
.conversation {
  container-type: inline-size;
  container-name: conversation;
  position: relative;
  z-index: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.conversation-inner {
  width: 100%;
  margin: auto;
  padding: 0;
}
[data-history-mounted="false"] {
  overflow-anchor: none;
}
.run-group,
.compaction-run {
  padding: 56px 16px 20px;
}
.user-message {
  background: var(--color-surface-muted);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-panel);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: var(--line-body);
  margin: 0 0 var(--space-4) auto;
  max-width: 90%;
  width: fit-content;
}
.background-result-heading {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--color-border) 50%, transparent);
  color: var(--color-text-subtle);
  font-size: var(--text-body);
}
/* Process layout follows ZCode ConversationTurnGroup and ToolSummaryRow. */
.progress-heading {
  border-bottom: 1px solid color-mix(in oklab, var(--color-border) 50%, transparent);
  padding-bottom: 8px;
}
.progress,
.block-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: var(--text-body);
  line-height: 20px;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  text-align: left;
  min-width: 0;
}
.progress {
  color: var(--color-process-subtle);
}
.block-toggle {
  color: var(--color-process-subtlest);
}
.progress:hover:not(:disabled),
.block-toggle:hover:not(:disabled) {
  background: transparent;
}
.progress:active:not(:disabled),
.block-toggle:active:not(:disabled) {
  transform: none;
}
.progress > svg {
  opacity: 0.7;
}
.progress span,
.block-summary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.block-toggle strong {
  font-weight: 500;
  flex-shrink: 0;
}
.reasoning-duration,
.process-separator {
  white-space: nowrap;
  flex-shrink: 0;
}
.process-chevron {
  opacity: 0;
  transition:
    opacity 200ms ease-out,
    transform 200ms ease-out;
  will-change: transform;
}
.block-toggle:hover .process-chevron,
.block-toggle:focus-visible .process-chevron,
.block-toggle[aria-expanded="true"] .process-chevron {
  opacity: 1;
}
.rotated {
  transform: rotate(90deg);
}
.thinking-summary {
  flex: 1;
  color: var(--color-process-subtle);
  text-overflow: clip;
  scrollbar-width: none;
}
.thinking-summary[data-overflowing="true"] {
  mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}
.thinking-label-streaming {
  --thinking-gradient-strong: #0d0d0d;
  --thinking-gradient-soft: rgba(13, 13, 13, 0.22);
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--thinking-gradient-strong) 0%,
    var(--thinking-gradient-strong) 34%,
    var(--thinking-gradient-soft) 50%,
    var(--thinking-gradient-strong) 66%,
    var(--thinking-gradient-strong) 100%
  );
  background-size: 300% 100%;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: thinking-gradient-flow 4s linear infinite;
  will-change: background-position;
  transform: translateZ(0);
  backface-visibility: hidden;
}
[data-theme="dark"] .thinking-label-streaming {
  --thinking-gradient-strong: #ffffff;
  --thinking-gradient-soft: rgba(255, 255, 255, 0.22);
}
@keyframes thinking-gradient-flow {
  0% {
    background-position: 100% 0;
  }
  50%,
  100% {
    background-position: 0% 0;
  }
}
.chat-loading-slot {
  /* ZCode ConversationTurnGroup gives the loading slot its own gap-5. */
  margin-top: 20px;
  min-height: 20px;
}
.model-wait-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.model-wait {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  color: var(--color-text-subtle);
  font-size: var(--text-small);
}
.model-wait-message {
  min-width: 0;
  overflow-wrap: anywhere;
}
.model-wait-error {
  color: var(--color-error);
}
.model-wait-retry {
  flex-shrink: 0;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-subtle);
  font-size: inherit;
  line-height: 20px;
}
.model-wait-retry:hover:not(:disabled) {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.chat-loading-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.run-preparation {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-subtle);
  font-size: var(--text-small);
}
.chat-loading-spinner {
  color: var(--color-text-subtle);
  animation: chat-loading-spin 1s linear infinite;
}
@keyframes chat-loading-spin {
  to {
    transform: rotate(360deg);
  }
}
.tool-failure {
  color: var(--color-process-subtlest);
}
.process {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  margin: 0;
}
.process-thinking,
.tool-block {
  min-width: 0;
  padding: 0;
  margin: 0;
  color: var(--color-process-subtlest);
}
.thinking-body {
  margin: 12px 0 0 8px;
  padding-left: 14px;
  border-left: 1px solid var(--color-border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  max-height: 240px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 20px;
  color: var(--color-process-subtlest);
}
.interrupted-reply-body {
  margin-top: 12px;
}
.tool-details {
  min-width: 0;
  margin: 0 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  padding: 12px 16px;
}
.tool-command-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.tool-prompt {
  color: var(--color-process-subtle);
}
.tool-command {
  color: var(--color-text);
  min-width: 0;
  margin: 0;
  max-height: 60px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 20px;
}
.tool-output {
  margin: 0;
  color: var(--color-process-subtle);
  font-size: var(--text-body);
  line-height: 20px;
  width: 100%;
  overscroll-behavior: contain;
}
.tool-output-scroll {
  margin-top: 12px;
  max-height: 100px;
  overflow: auto;
  min-width: 0;
  max-width: 100%;
  line-height: 20px;
}
.scroll-fade-viewport[data-scroll-mask="top"] {
  mask-image: linear-gradient(to bottom, transparent 0, black 24px, black 100%);
}
.scroll-fade-viewport[data-scroll-mask="bottom"] {
  mask-image: linear-gradient(to bottom, black 0, black calc(100% - 24px), transparent 100%);
}
.scroll-fade-viewport[data-scroll-mask="both"] {
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    black 24px,
    black calc(100% - 24px),
    transparent 100%
  );
}
.tool-layout {
  --color-diff-added: light-dark(#1e8a3e, #46bf72);
  --color-diff-removed: light-dark(#e03131, #ff5c5c);
  width: 100%;
  display: flex;
  flex-direction: column;
}
.tool-content-shell {
  overflow: hidden;
  outline: none;
  color: var(--color-text);
}
.tool-content-spacing {
  padding-top: 8px;
}
.tool-content-shell[data-state="open"] {
  animation: tool-content-open 300ms ease-in-out;
}
.tool-content-shell[data-state="closed"] {
  animation: tool-content-close 300ms ease-in-out forwards;
}
.tool-content-shell[data-state="open"] > .tool-content-fade {
  animation: tool-content-fade-in 300ms ease-in-out;
}
.tool-content-shell[data-state="closed"] > .tool-content-fade {
  animation: tool-content-fade-out 300ms ease-in-out forwards;
}
@keyframes tool-content-open {
  from {
    height: 0;
  }
  to {
    height: var(--radix-collapsible-content-height);
  }
}
@keyframes tool-content-close {
  from {
    height: var(--radix-collapsible-content-height);
  }
  to {
    height: 0;
  }
}
@keyframes tool-content-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes tool-content-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.tool-group-children {
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.question-tool-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--color-border);
  color: var(--color-text-subtle);
  font-size: var(--text-body);
  line-height: 20px;
}
.question-tool-answers p {
  margin: 0;
}
.question-tool-answers .question-tool-question {
  margin-bottom: 4px;
  color: var(--color-text);
  font-weight: 500;
}
.tool-kind-label {
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.tool-summary-content {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 8px;
}
.tool-prioritize-file .tool-summary-content {
  flex: 1;
  overflow: hidden;
}
.tool-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  color: var(--color-process-subtle);
}
.tool-file-chip > span,
.tool-file-directory,
.tool-summary-text,
.tool-command-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-message-target {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}
.tool-summary-text:is(code) {
  font-family: var(--font-code);
}
.tool-message-target > span:first-child,
.tool-summary-status {
  flex-shrink: 0;
  white-space: nowrap;
}
.tool-file-chip:hover:not(:disabled) {
  background: transparent;
  text-decoration: underline;
}
.tool-file-chip:active:not(:disabled) {
  transform: none;
}
.tool-command-summary {
  font-family: var(--font-body);
}
.tool-group-active,
.tool-diff-counts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tool-active-label {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--color-process-subtle);
}
.tool-diff-counts {
  gap: 4px;
  flex-shrink: 0;
  font-family: var(--font-code);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tool-diff-counts > span {
  display: inline-flex;
  align-items: center;
  background: transparent;
}
.tool-no-output {
  margin: 12px 0 0;
  font-family: var(--font-code);
  color: var(--color-process-subtle);
}
.tool-inline-diff {
  max-height: 240px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: light-dark(#ffffff, #2b2b2b);
  margin-bottom: 8px;
}
.tool-diff-lines {
  min-width: 100%;
  width: max-content;
  font: 12px / 1.625 var(--font-code);
}
.tool-diff-line {
  display: flex;
  min-width: 100%;
}
.tool-diff-line.added,
.tool-diff-line.removed {
  --tool-diff-color: var(--color-diff-added);
  background: color-mix(in srgb, var(--tool-diff-color) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--tool-diff-color);
}
.tool-diff-line.removed {
  --tool-diff-color: var(--color-diff-removed);
}
.tool-diff-number {
  z-index: 1;
  position: sticky;
  left: 0;
  width: 48px;
  flex-shrink: 0;
  user-select: none;
  text-align: right;
  padding: 0 8px;
  border-right: 1px solid var(--color-border);
  color: var(--color-process-subtlest);
  background: var(--color-bg);
  font-variant-numeric: tabular-nums;
}
.added .tool-diff-number,
.removed .tool-diff-number {
  color: var(--tool-diff-color);
  background: color-mix(in srgb, var(--tool-diff-color) 18%, var(--color-bg));
  box-shadow: inset 3px 0 0 var(--tool-diff-color);
}
.tool-diff-line > code {
  display: block;
  padding: 0 12px;
  flex: 1;
  white-space: pre;
}
.tool-diff-omitted {
  padding: 4px 12px;
  color: var(--color-process-subtle);
}
.tool-file-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-parameters h4,
.tool-detail-error h4 {
  margin: 0 0 8px;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tool-parameters-code,
.tool-detail-error pre {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-surface-muted) 50%, transparent);
}
.tool-content-preview {
  max-height: 240px;
  overflow: auto;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-surface-muted) 15%, transparent);
}
.tool-markdown-preview {
  border: 1px solid var(--color-border);
  padding: 12px;
}
.tool-input-code {
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg);
}
.tool-input-code pre {
  margin: 0;
  padding: 0 8px 12px;
  font-size: 14px;
  white-space: pre;
}
.tool-detail-error pre {
  padding: 12px;
  background: color-mix(in srgb, var(--color-diff-removed) 10%, transparent);
  color: var(--color-diff-removed);
}
.tool-detail-note {
  margin: 0;
  color: var(--color-process-subtle);
}
@container conversation (max-width: 360px) {
  .tool-file-directory,
  .tool-prioritize-file .tool-kind-label {
    display: none;
  }
}
.answer {
  margin-top: var(--space-4);
  line-height: 1.75;
  overflow-wrap: anywhere;
  min-width: 0;
}
.process-text.answer {
  margin: 0;
  width: 100%;
  color: var(--color-text);
}
.answer pre {
  white-space: pre;
  overflow: auto;
}
.run-error {
  color: var(--color-error);
  background: var(--color-danger-surface);
  padding: var(--space-3);
  border-radius: var(--radius-control);
  margin: var(--space-3) 0;
  font-size: var(--text-small);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.run-notice {
  color: var(--color-text-muted);
  font-size: var(--text-small);
  margin: var(--space-2) 0;
  white-space: pre-wrap;
}
.composer-container {
  width: var(--conversation-column-width, 100%);
  flex-shrink: 0;
  margin: 0 auto;
  margin-inline-start: calc(
    (100% - var(--conversation-scrollbar-width, 0px) - var(--conversation-column-width, 100%)) /
    2
  );
  padding: 0 16px 16px;
}
.composer-stack {
  width: 100%;
  margin: auto;
}
/* ZCode conversationLayout and ConversationTurnGroup share one responsive column
   with the composer dock, with 20px after the final action row. */
@container conversation (min-width: 448px) {
  .run-group,
  .compaction-run {
    padding-inline: 24px;
  }
}
@container conversation (min-width: 864px) {
  .conversation-inner {
    width: calc(100% - 96px);
    max-width: 896px;
  }
}
@container conversation (min-width: 1280px) {
  .conversation-inner {
    width: calc(100% - 384px);
    max-width: 1152px;
  }
}
.conversation-queue {
  position: relative;
  z-index: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px 16px 0 0;
  background: var(--color-surface-muted);
  padding: 4px 4px 28px;
  margin-bottom: -28px;
  backdrop-filter: blur(12px);
}
.conversation-queue ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(240px, 30vh);
  overflow-y: auto;
}
.queue-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 6px;
  border-radius: 12px;
  transition: background-color 0.15s;
}
.queue-row + .queue-row {
  margin-top: 2px;
}
.queue-row:hover {
  background: color-mix(in oklab, var(--color-secondary) 30%, transparent);
}
.queue-row.dragging {
  background: color-mix(in oklab, var(--color-secondary) 40%, transparent);
  box-shadow: var(--shadow-popover);
}
.queue-row.pending {
  opacity: 0.6;
}
.queue-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.queue-text {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--text-body);
  color: var(--color-text);
}
.queue-text.compact {
  font-family: var(--font-code);
}
.queue-attachments {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--text-small);
  color: var(--color-text-subtle);
}
.queue-icon,
.queue-drag,
.queue-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0;
  color: var(--color-text);
}
.queue-icon,
.queue-drag {
  width: 28px;
}
.queue-drag {
  cursor: grab;
  touch-action: none;
  color: var(--color-text-subtlest);
}
.queue-drag:active {
  cursor: grabbing;
}
.queue-now {
  padding: 0 8px 0 6px;
  gap: 4px;
  font-size: var(--text-body);
  border-radius: 6px;
  background: var(--color-secondary);
}
.queue-paused {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  margin-bottom: 4px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: var(--text-body);
  background: var(--color-surface);
}
.queue-paused span {
  flex: 1;
  min-width: 0;
}
.queue-paused button {
  flex-shrink: 0;
  font-size: var(--text-body);
  color: var(--color-text-subtle);
}
.queue-error {
  display: block;
  padding: 4px 12px;
  color: var(--color-error);
}
.queue-confirmation {
  width: min(520px, calc(100vw - 32px));
  padding: 24px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-popover);
}
.queue-confirmation::backdrop {
  background: rgb(0 0 0 / 25%);
}
.queue-confirmation h3 {
  margin: 0 0 12px;
  font-size: 18px;
}
.queue-confirmation p {
  color: var(--color-text-subtle);
  line-height: 1.6;
}
.queue-confirmation > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.composer {
  position: relative;
  min-width: 0;
  max-width: 1024px;
  margin: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-dialog);
  background: var(--color-input);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.composer:focus-within {
  border-color: var(--color-focus);
}
.composer-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: color-mix(in oklab, var(--color-accent) 55%, transparent);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.composer-drop-overlay > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.1),
    0 1px 2px -1px rgb(0 0 0 / 0.1);
}
.composer textarea {
  width: 100%;
  border: 0;
  resize: none;
  min-height: 64px;
  max-height: 200px;
  background: transparent;
  outline: none;
  line-height: var(--line-body);
  color: var(--color-text);
}
.composer textarea::placeholder {
  color: var(--color-text-muted);
}
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.send {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-nested);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.send:not(.stop):hover:not(:disabled),
.primary:hover:not(:disabled) {
  background: var(--color-primary);
  filter: brightness(0.96);
}
.stop {
  background: var(--color-secondary);
  color: var(--color-foreground);
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 150ms;
}
.stop:hover:not(:disabled) {
  background: color-mix(in oklab, var(--color-secondary) 80%, transparent);
}
.stop:active:not(:disabled) {
  transform: none;
}
.empty-chat {
  text-align: center;
  color: var(--color-text-muted);
  padding-top: 18vh;
}
.empty-chat h1 {
  font-size: var(--text-title);
  color: var(--color-text);
  margin: var(--space-6) 0 var(--space-3);
  font-weight: 500;
}
.empty-chat p {
  font-size: var(--text-small);
}
/* ZCode ConversationBackToBottomButton: 28px circle, 8px above the composer. */
.latest,
.latest:hover:not(:disabled) {
  z-index: 2;
  bottom: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 3px #0000001a;
  display: grid;
  place-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.latest:active:not(:disabled) {
  transform: translateX(-50%);
}
.input-notice {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--color-error);
}

.input-notice-description {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.input-notice-tooltip {
  position: fixed;
  z-index: 100;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  max-height: 160px;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-tooltip);
  box-shadow: 0 2px 8px #00000014;
  color: var(--color-tooltip-foreground);
  font-size: var(--text-small);
  line-height: 1.5;
  overflow-y: auto;
  overflow-wrap: anywhere;
  -webkit-app-region: no-drag;
}

.input-notice-trigger {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0;
}

.input-notice-tooltip button {
  display: block;
  margin-top: 6px;
  color: inherit;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  font-size: var(--text-small);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.notice > svg {
  flex: 0 0 auto;
  margin-top: 2px;
}
.notice-error > svg {
  color: var(--color-error);
}
.notice-warning > svg {
  color: var(--color-waiting);
}
.notice-info > svg {
  color: var(--color-text-muted);
}
.notice-message {
  flex: 1;
  min-width: 0;
}
.notice-action {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.notice .notice-action:hover {
  background: transparent;
  color: var(--color-focus);
}
.notice-dismiss {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: -2px -2px 0 0;
  border-radius: 4px;
  color: var(--color-text-muted);
}
.notice .notice-dismiss:hover {
  background: var(--color-fill-hover);
  color: var(--color-text);
}
.notice-input {
  padding: 0 2px;
  color: var(--color-text);
}
.notice-turn {
  margin: 0 0 var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
}
.conversation-inner > .notice-turn {
  margin: 0 16px var(--space-3);
}
.notice-window {
  position: absolute;
  top: 64px;
  right: calc(var(--right-pane-offset, 0px) + 20px);
  z-index: 70;
  width: max-content;
  max-width: min(440px, calc(100% - 40px));
  max-height: calc(100% - 84px);
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-popover);
  color: var(--color-text);
  overflow-y: auto;
}
/* Settings replaces the workspace, so anchor the transient notice to the window instead. */
.shell.show-settings .notice-window {
  right: 20px;
}
.notice-config {
  align-items: center;
  padding: var(--space-3) var(--space-6);
  background: var(--color-warning-surface);
  color: var(--color-waiting);
}
.modal-backdrop {
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--layer-overlay);
  position: fixed;
  inset: 0;
}
.modal {
  z-index: var(--layer-dialog);
  background: var(--color-popover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-dialog);
  width: min(540px, 100vw - 32px);
  max-height: 90vh;
  padding: var(--space-4);
  box-shadow: var(--shadow-menu);
  position: fixed;
  top: 50%;
  left: 50%;
  overflow: auto;
  transform: translate(-50%, -50%);
}
.modal h2 {
  font-size: var(--text-body);
  margin: 0 0 var(--space-2);
  color: var(--color-text);
  font-weight: 500;
}
.modal p {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  line-height: 1.625;
}
.modal label {
  gap: var(--space-2);
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  flex-direction: column;
  display: flex;
}
.modal input,
.modal select,
.modal textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-bg);
  padding: var(--space-2);
  color: var(--color-text);
  width: 100%;
}
.modal input[type="checkbox"] {
  width: auto;
  accent-color: var(--color-focus);
}
.modal :is(input:not([type="checkbox"]), select, textarea):focus {
  border-color: var(--color-border-strong);
  outline: none;
}
.modal-actions {
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  flex-wrap: wrap;
  display: flex;
}
.primary,
.secondary,
.danger-button {
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  display: inline-flex;
}
.primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.secondary {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
}
.danger-button {
  color: var(--color-error);
  background: var(--color-danger-surface);
}
.modal details {
  margin-top: var(--space-4);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.sidebar-empty {
  padding: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-small);
  line-height: var(--line-body);
}
.settings-layout {
  gap: var(--space-6);
  margin-top: var(--space-4);
  grid-template-columns: 160px minmax(0, 1fr);
  min-height: 0;
  display: grid;
  overflow: hidden;
}
.provider-editor {
  max-height: calc(90vh - 160px);
  padding-right: var(--space-1);
  overflow: auto;
}
.provider-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2);
  position: sticky;
  bottom: 0;
}
.provider-list {
  gap: var(--space-2);
  border-right: 1px solid var(--color-border);
  padding-right: var(--space-3);
  flex-direction: column;
  display: flex;
  overflow: auto;
}
.provider-list button {
  text-align: left;
  padding: var(--space-2);
  overflow-wrap: anywhere;
}
.provider-list small {
  margin-top: var(--space-1);
  display: block;
}
.provider-list .selected {
  background: var(--color-active);
  color: var(--color-text);
}
.model-list-heading {
  margin-top: var(--space-4);
  justify-content: space-between;
  align-items: center;
  display: flex;
}
.model-list-heading h3 {
  font-size: var(--text-body);
  font-weight: 500;
}
.session-toolbar {
  align-items: center;
  gap: 4px;
  min-width: 0;
  display: flex;
}
.context-circle {
  padding: 2px;
  display: flex;
}
.context-track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 2px;
}
.context-value {
  fill: none;
  stroke: var(--color-running);
  stroke-width: 2px;
  transform-origin: 50%;
  transform: rotate(-90deg);
}
.context-value.unknown {
  stroke: var(--color-text-muted);
}
.context-tooltip {
  background: var(--color-popover);
  border: 1px solid var(--color-border);
  width: 335px;
  min-width: 0;
  max-width: min(calc(100vw - 32px), var(--radix-tooltip-content-available-width));
  max-height: var(--radix-tooltip-content-available-height);
  z-index: var(--layer-popover);
  font-size: var(--text-small);
  line-height: var(--line-body);
  box-shadow: var(--shadow-menu);
  border-radius: var(--radius-panel);
  padding: 16px;
  overflow: auto;
}
/* ZCode MentionPanel: shared rounded surface, scrollable list and hint footer. */
.command-panel {
  border: 1px solid var(--color-border);
  background: var(--color-popover);
  border-radius: var(--radius-dialog);
  box-shadow: 0 1px 2px #0000000d;
  z-index: var(--layer-popover);
  position: absolute;
  bottom: calc(100% + 4px);
  left: -1px;
  right: -1px;
  overflow: hidden;
}
.command-panel:focus {
  outline: none;
}
.command-options {
  max-height: min(224px, 40vh);
  padding: 3px 4px;
  overflow: auto;
  overscroll-behavior: contain;
}
.command-panel button {
  text-align: left;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 32px;
  margin: 1px 0;
  border-radius: var(--radius-nested);
  width: 100%;
  display: flex;
  font-size: var(--text-body);
}
.command-panel strong {
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.command-panel .file-option {
  gap: 4px;
}
.command-panel :where(.file-option) > span {
  min-width: 0;
}
.command-panel button[aria-selected="true"] {
  background: var(--color-active);
}
.command-panel :where(button) span {
  color: var(--color-text-subtlest);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.command-panel p {
  padding: 8px 12px;
  color: var(--color-text-subtle);
  margin: 0;
}
.command-section-title {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.slash-panel strong {
  max-width: 40%;
  flex-shrink: 0;
}
.slash-panel :where(button) > span {
  min-width: 0;
  flex: 1;
  font-size: var(--text-body);
}
.slash-panel button:active:not(:disabled) {
  transform: none;
}
.subagent-option > svg,
.subagent-option > strong {
  flex-shrink: 0;
}
.subagent-option > strong {
  max-width: 40%;
}
.subagent-option > span {
  min-width: 0;
  font-size: var(--text-xs);
}
/* ZCode skills rows keep the name intact; only the secondary description can shrink. */
.skill-panel {
  border-radius: var(--radius-dialog);
}
.skill-panel button {
  min-width: 0;
  border-radius: var(--radius-panel);
}
.skill-panel button:active:not(:disabled),
.session-panel button:active:not(:disabled) {
  transform: none;
}
.skill-panel strong {
  flex-shrink: 0;
  overflow: visible;
}
.skill-panel :where(button) > span,
.session-panel :where(button) > span {
  min-width: 0;
  font-size: var(--text-xs);
}
.skill-panel p,
.session-panel p {
  padding: 12px 16px;
  color: var(--color-text-subtlest);
}
.command-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: var(--text-body);
  color: var(--color-text-subtle);
}
.resource-diagnostics {
  max-width: 790px;
  margin: 0 auto var(--space-2);
  font-size: var(--text-small);
  padding: var(--space-2);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.resource-diagnostics {
  background: var(--color-warning-surface);
  color: var(--color-waiting);
}
@media (width <= 850px) {
  .sidebar {
    width: 210px;
  }
  .topbar {
    padding: var(--space-3) var(--space-6);
  }
  .settings-layout {
    gap: var(--space-3);
    grid-template-columns: 125px minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pulse {
    animation: none;
  }
}
.sidebar-global,
.composer-actions {
  align-items: center;
  gap: var(--space-2);
  display: flex;
}
.sidebar-global {
  padding: var(--space-2);
  justify-content: space-between;
}
.sidebar-global button {
  width: 100%;
  height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: var(--radius-nested);
  font-size: var(--text-body);
  font-weight: 400;
  display: flex;
}
.sidebar-global button:active:not(:disabled) {
  transform: none;
}
.sidebar.collapsed {
  padding: var(--space-3) var(--space-1);
}
.sidebar.collapsed .sidebar-global {
  flex-direction: column;
  padding: 0;
}
.sidebar.collapsed .sidebar-footer {
  margin-top: auto;
}
/* ZCode uses a transparent 4px gutter with a subtle hover/focus indicator. */
.sidebar-resizer {
  position: relative;
  cursor: col-resize;
  background: transparent;
  touch-action: none;
  border: 0;
  flex: 0 0 4px;
  width: 4px;
  margin: 0;
  outline: none;
  -webkit-app-region: no-drag;
}
.sidebar-resizer::after,
.right-resizer::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--color-text-subtlest) 50%, transparent);
  opacity: 0;
  transition: opacity 150ms;
}
.sidebar-resizer:hover::after,
.sidebar-resizer:active::after,
.sidebar-resizer:focus-visible::after,
.right-resizer:hover::after,
.right-resizer:active::after,
.right-resizer:focus-visible::after {
  opacity: 1;
}
.projects {
  flex: 0 42%;
  min-height: 0;
}
.recent-sessions {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.recent-sessions .session-row {
  margin-left: 0;
}
.session-row:focus-within .row-action {
  opacity: 1;
}
.composer-actions {
  min-width: 0;
  gap: 4px;
}
.composer-plus {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-nested);
  display: grid;
  place-items: center;
}
.composer-plus[aria-expanded="true"] {
  background: var(--color-active);
}
.composer-plus:active:not(:disabled) {
  transform: none;
}
.model-trigger {
  align-items: center;
  gap: 4px;
  max-width: 280px;
  height: 28px;
  border-radius: var(--radius-nested);
  padding: 0 6px 0 8px;
  font-size: var(--text-body);
  white-space: nowrap;
  text-overflow: ellipsis;
  display: flex;
  overflow: hidden;
}
.model-reasoning {
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.selection-menu {
  background: var(--color-popover);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-nested);
  padding: var(--space-1);
  min-width: 180px;
  max-width: min(320px, 100vw - 16px);
  max-height: var(--radix-dropdown-menu-content-available-height);
  z-index: var(--layer-popover);
  box-shadow: var(--shadow-menu);
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.625;
  overflow-y: auto;
}
.menu-label {
  padding: var(--space-2);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.menu-item {
  min-height: 28px;
  padding: 4px 8px;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: default;
  border-radius: var(--radius-control);
  outline: none;
  display: flex;
}
.menu-item[data-highlighted],
.menu-item[data-state="open"] {
  background: var(--color-menu-hover);
}
.menu-item[data-disabled] {
  color: var(--color-text-subtlest);
  opacity: 1;
  pointer-events: none;
  cursor: default;
}
.menu-item span {
  text-overflow: ellipsis;
  overflow: hidden;
}
.settings-tabs {
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
}
.settings-tabs button {
  text-align: left;
  border-radius: var(--radius-control);
  padding: var(--space-2) var(--space-3);
}
.settings-tabs button[aria-pressed="true"] {
  background: var(--color-active);
}
.interface-settings {
  padding: var(--space-6) 0;
}
.sidebar-resizer {
  height: 100%;
}
.model-label {
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
  overflow: hidden;
}
.menu-item span {
  white-space: nowrap;
}
.input-context {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.input-context-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  gap: 8px;
}
.input-context:empty {
  display: none;
}
.image-chip {
  display: inline-flex;
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
}
.image-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  pointer-events: none;
}
.image-chip > button:first-child {
  border-radius: var(--radius-nested);
  padding: 0;
  overflow: hidden;
}
.image-chip img {
  object-fit: cover;
  width: 48px;
  height: 48px;
}
.file-attachment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  max-width: 100%;
  min-width: 0;
  padding: 6px 24px 6px 6px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.file-attachment:hover {
  background: var(--color-active);
}
.file-attachment-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--color-background);
}
.file-attachment-info {
  min-width: 0;
  max-width: 160px;
}
.file-attachment-info strong,
.file-attachment-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-attachment-info strong {
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 20px;
}
.file-attachment-info small {
  color: var(--color-text-subtle);
  font-size: var(--text-small);
  line-height: 16px;
}
.chip-remove {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border: 0;
  border-radius: 50%;
  padding: 2px;
  position: absolute;
  top: 2px;
  right: 2px;
  opacity: 0;
}
.image-chip > .chip-remove {
  /* Image overlays stay dark with a white icon in both themes. */
  background: #191c1f;
  color: #fff;
  /* Keep the 12px icon inside the 14px grid instead of overflowing a padded 10px cell. */
  padding: 0;
  line-height: 0;
}
.image-chip > .chip-remove:hover:not(:disabled) {
  background: #454648;
}
.image-chip > :where(.chip-remove) > svg {
  display: block;
}
.image-chip:hover .chip-remove,
.file-attachment:hover .chip-remove,
.chip-remove:focus-visible {
  opacity: 1;
}
.image-lightbox {
  z-index: 150;
  color: #fff;
  background: #000c;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  display: flex;
  position: fixed;
  inset: 0;
}
.image-lightbox img {
  object-fit: contain;
  width: auto;
  max-width: 90vw;
  height: auto;
  max-height: 80vh;
}
.image-lightbox button {
  color: #fff;
  position: absolute;
  top: 20px;
  right: 20px;
}
.diff-layout {
  grid-template-columns: minmax(140px, 28%) minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
  display: grid;
}
.diff-layout > .diff-file-list {
  max-height: 60vh;
  overflow: auto;
}
.diff-layout > .diff-file-list button {
  text-align: left;
  overflow-wrap: anywhere;
  width: 100%;
  padding: 7px;
  display: block;
}
.diff-layout > .diff-file-list button.selected {
  background: var(--color-active);
}
.diff-detail {
  min-width: 0;
  max-height: 65vh;
  overflow: auto;
}
.diff-heading {
  justify-content: space-between;
  gap: 10px;
  display: flex;
}
.diff-added {
  color: var(--color-diff-added);
  background: #e8f1e8;
}
.diff-removed {
  color: var(--color-diff-removed);
  background: #fae9e4;
}
.diff-hunk {
  color: #54749e;
}
.diff-layout.diff-single-file {
  grid-template-columns: minmax(0, 1fr);
}
.diff-layout.diff-preview {
  --color-diff-added: light-dark(#1e8a3e, #46bf72);
  --color-diff-removed: light-dark(#e03131, #ff5c5c);
  --diffs-bg: var(--color-bg);
  --diffs-light-bg: var(--color-bg);
  --diffs-dark-bg: var(--color-bg);
  --diffs-font-family: var(--font-code);
  --diffs-font-size: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  gap: 0;
  margin-top: 0;
  overflow: hidden;
  background: var(--color-bg);
}
.diff-preview .diff-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
.diff-preview .diff-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.diff-preview .diff-entry {
  border: 0;
}
.diff-preview .diff-lightweight {
  min-width: 0;
  width: 100%;
  border: 0;
  background: var(--color-bg);
}
.diff-preview.diff-wrap .tool-diff-lines {
  width: auto;
}
.diff-preview.diff-wrap .diff-lightweight-code {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diff-preview diffs-container {
  display: block;
  min-width: 0;
  width: 100%;
}
.diff-layout.diff-wrap .diff-row {
  grid-template-columns: 38px 38px minmax(0, 1fr);
  white-space: pre-wrap;
}
.diff-layout.diff-wrap .diff-line-code {
  min-width: 0;
  overflow-wrap: anywhere;
}
.diff-preview .diff-row.added {
  box-shadow: inset 3px 0 0 var(--color-diff-added);
}
.diff-preview .diff-row.removed {
  box-shadow: inset 3px 0 0 var(--color-diff-removed);
}
.diff-preview .diff-plain .diff-hunk-simple {
  height: 12px;
  padding: 0;
  margin: 0;
  background: var(--color-bg);
  border: 0;
  border-top: 1px solid var(--color-border);
}
.resource-settings {
  max-height: 70vh;
  padding: 12px 2px;
  overflow: auto;
}
.resource-settings label {
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  display: flex;
}
.resource-settings textarea {
  min-height: 100px;
}
.resource-settings pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-code);
  background: var(--color-surface-muted);
  padding: 10px;
  font-size: var(--text-small);
  line-height: 1.5;
}
.topbar {
  justify-content: space-between;
}
.topbar-title {
  text-align: left;
}

.image-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border: 0;
}
.settings-tabs {
  flex-direction: column;
  border-bottom: 0;
  border-right: 1px solid var(--color-border);
  padding: 0 12px 0 0;
  gap: 6px;
}
.settings-page {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  max-height: calc(90vh - 120px);
}
.settings-page .resource-settings {
  max-height: none;
  overflow: visible;
}
.global-settings-note {
  color: var(--color-text-muted);
  font-size: var(--text-small);
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .settings-tabs {
    padding-right: 8px;
  }
  .settings-tabs button {
    padding: 8px 4px;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .provider-list {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }
}
.context-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.context-summary strong {
  color: var(--color-text);
  font-size: var(--text-body);
}
.context-summary > span {
  font-family: var(--font-code);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.context-progress {
  height: 8px;
  background: var(--color-surface-muted);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 16px;
}
.context-progress > span {
  height: 100%;
  display: block;
  background: var(--color-usage-bar);
  border-radius: inherit;
}
.context-breakdown > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  color: var(--color-text-muted);
}
.context-breakdown i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-usage-bar);
  flex-shrink: 0;
}
.context-breakdown strong {
  margin-left: auto;
  color: var(--color-text);
  font-family: var(--font-code);
  font-weight: 500;
}
.mention-editor {
  width: 100%;
  min-height: 40px;
  max-height: 160px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 0;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font: inherit;
  line-height: 20px;
}
.mention-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-subtlest);
  pointer-events: none;
}
/* ZCode's inline prompt layout keeps the editor mounted while the actions move beside it. */
.composer[data-layout="inline"] {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
}
.composer[data-layout="inline"] > :is(.input-context, small, .notice) {
  flex-basis: 100%;
  order: -1;
}
.composer[data-layout="inline"] .composer-footer {
  display: contents;
}
.composer[data-layout="inline"] .mention-editor {
  order: 1;
  flex: 1;
  width: auto;
  min-width: 50%;
  min-height: 28px;
  padding-block: 4px;
}
.composer[data-layout="inline"] :where(.composer-actions) {
  order: 2;
  flex-shrink: 0;
}
/* Animate the native caret, preserving selection, scrolling and IME positioning. */
@supports (caret-animation: manual) {
  .mention-editor:focus[contenteditable="true"] {
    caret-animation: manual;
    animation: composer-caret 1s ease-in-out infinite;
  }
  .mention-editor:focus[data-composing="true"] {
    animation: none;
    caret-color: currentColor;
  }
}
@keyframes composer-caret {
  0%,
  15%,
  100% {
    caret-color: currentColor;
  }
  50%,
  65% {
    caret-color: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mention-editor:focus[contenteditable="true"] {
    animation: none;
    caret-color: currentColor;
  }
}
.inline-mention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  line-height: inherit;
  vertical-align: baseline;
  white-space: nowrap;
  user-select: text;
}
.mention-editor .inline-mention {
  user-select: all;
  /* 与 ZCode prompt mention 一致:共用 20px 行盒顶部,避免图标合成基线抬高文件名。 */
  vertical-align: top;
}
.inline-mention.file {
  color: var(--color-file-reference);
}
.inline-mention.message-file-link {
  max-width: 100%;
  color: var(--color-file-link);
  font-weight: 400;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}
.inline-mention.message-file-link:hover {
  background: transparent;
  text-decoration-line: underline;
}
.inline-mention.skill {
  color: var(--color-skill-reference);
}
.inline-mention.subagent {
  color: var(--color-subagent-reference);
}
.inline-mention.session {
  color: var(--color-session-reference);
}
.inline-mention.command,
.reference-menu-icon.command {
  color: var(--color-command-reference);
}
button.inline-mention,
.mention-editor .inline-mention.file {
  cursor: pointer;
}
.inline-mention::before,
.reference-menu-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: var(--mention-icon-color, transparent) var(--mention-image, none) center / contain no-repeat;
  mask: var(--mention-mask, none) center / contain no-repeat;
}
.reference-menu-icon {
  display: inline-flex;
  flex-shrink: 0;
}
.file-type-icon {
  display: inline-block;
  flex-shrink: 0;
  object-fit: contain;
}
.user-message-text {
  white-space: pre-wrap;
}
/* ZCode 的用户消息引用共用行盒顶部,避免前置图标的合成基线让文件名偏离正文。 */
.user-message-text .inline-mention {
  vertical-align: top;
  line-height: 24px;
  margin-inline: 2px;
  max-width: 100%;
}
.user-message-text .reference-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}
.message-images:not(:empty) {
  margin: 0 0 8px;
}
.message-images:empty {
  display: none;
}

.changed-files {
  --color-diff-added: light-dark(#1e8a3e, #46bf72);
  --color-diff-removed: light-dark(#e03131, #ff5c5c);
  width: 100%;
  margin-top: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-input);
  overflow: hidden;
}
.changed-files-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: inherit;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.changed-files-summary::-webkit-details-marker {
  display: none;
}
.changed-files-summary:hover {
  background: var(--color-fill-hover);
}
.changed-files[open] > .changed-files-summary {
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
}
.changed-files-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.changed-files-heading strong {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.changed-files-warning {
  display: flex;
  color: var(--color-waiting);
}
.changed-files-totals,
.changed-file-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.changed-files-totals {
  flex-shrink: 0;
  font-size: var(--text-body);
}
.changed-files-totals .diff-added,
.changed-files-totals .diff-removed {
  background: transparent;
}
.changed-files-chevron {
  color: var(--color-text-muted);
  transition: transform 150ms ease;
}
.changed-files[open] .changed-files-chevron {
  transform: rotate(90deg);
}
.changed-files-list {
  max-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-border);
}
.changed-file-row {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: color-mix(in oklab, var(--color-bg) 50%, transparent);
}
.changed-file-row:hover {
  --changed-file-hover: light-dark(rgb(13 13 13 / 1.5%), rgb(255 255 255 / 1.5%));
  background-image: linear-gradient(var(--changed-file-hover), var(--changed-file-hover));
}
.changed-file-card {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  text-align: left;
}
.changed-file-card:hover:not(:disabled) {
  background: transparent;
}
.changed-file-card::after {
  content: "";
  position: absolute;
  inset: 0;
}
.changed-file-card:active:not(:disabled),
.changed-file-actions button:active:not(:disabled) {
  transform: none;
}
.changed-file-info {
  display: inline-grid;
  grid-template-columns: auto minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.changed-file-info strong,
.changed-file-directory {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.changed-file-info strong {
  font-weight: 500;
}
.changed-file-directory {
  color: var(--color-text-subtlest);
  font-size: var(--text-body);
}
.changed-file-note {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}
.changed-file-counts {
  flex-shrink: 0;
  font-size: var(--text-body);
}
.changed-file-counts .diff-added,
.changed-file-counts .diff-removed {
  background: transparent;
}
.changed-file-actions,
.changed-file-open {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.changed-file-actions {
  gap: 6px;
}
.changed-file-review,
.changed-file-open {
  position: relative;
  z-index: 1;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-nested);
  background: var(--color-input);
  font-size: var(--text-body);
}
.changed-file-review {
  padding: 0 8px;
}
.changed-file-open {
  overflow: hidden;
}
.changed-file-review:hover:not(:disabled),
.changed-file-open:hover {
  border-color: var(--color-focus);
}
.changed-file-open :where(button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 0;
}
.changed-file-open-default {
  padding: 0 6px 0 8px;
}
.changed-file-open-menu {
  width: 20px;
  padding: 0;
  color: var(--color-text-subtlest);
}
.changed-file-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 176px;
  min-width: 128px;
  max-width: var(--radix-dropdown-menu-content-available-width);
  border-radius: var(--radius-nested);
  background: var(--color-input);
  box-shadow:
    0 4px 6px -1px #0000001a,
    0 2px 4px -2px #0000001a;
  z-index: 60;
}
.changed-file-menu .menu-item {
  min-height: 28px;
  padding: 4px 8px;
  justify-content: flex-start;
  gap: 8px;
  font-size: var(--text-body);
  line-height: 1.625;
  cursor: default;
}
.changed-file-menu .menu-item[data-highlighted] {
  background: light-dark(#f0f0f0, #363636);
}
.changed-file-menu-separator {
  height: 1px;
  margin: 4px -4px;
  background: var(--color-border);
}
.changed-files-error {
  margin: 0;
  padding: 8px 12px;
  color: var(--color-error);
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  .changed-files-chevron {
    transition: none;
  }
}
/* Message typography and rich blocks share the desktop theme and font scale. */
.markdown-body {
  font-size: var(--text-body);
  line-height: 1.75;
  letter-spacing: 0.025em;
  min-width: 0;
  overflow-wrap: anywhere;
}
.markdown-body > :first-child {
  margin-top: 0;
}
.markdown-body > :last-child {
  margin-bottom: 0;
}
.markdown-body p {
  margin: 12px 0;
}
.markdown-body :is(h1, h2, h3, h4, h5, h6) {
  margin: 24px 0 16px;
  line-height: 1.75;
  font-size: var(--text-body);
  font-weight: 600;
}
.markdown-body h1 {
  font-size: calc(var(--ui-font-size) + 4px);
}
.markdown-body h2 {
  font-size: calc(var(--ui-font-size) + 2px);
}
.markdown-body h5 {
  font-weight: 500;
}
.markdown-body h6 {
  font-weight: 400;
}
.markdown-body strong {
  font-weight: 500;
}
.markdown-body a {
  color: var(--color-file-link);
  font-weight: 500;
  text-decoration: none;
}
.markdown-body a:hover {
  text-decoration: underline dotted;
  text-underline-offset: 4px;
}
.markdown-body ul {
  list-style: disc outside;
  padding-left: 20px;
  margin: 12px 0;
}
.markdown-body ol {
  list-style: decimal inside;
  padding-left: 0;
  margin: 12px 0;
}
.markdown-body li {
  margin: 6px 0;
  padding-left: 4px;
}
.markdown-body li::marker {
  color: var(--color-text-muted);
}
.markdown-body li > p {
  display: inline;
  margin: 0;
}
.markdown-body li :is(ul, ol) {
  margin: 6px 0;
}
.markdown-body blockquote {
  margin: 16px 0;
  border-left: 2px solid var(--color-border);
  padding-left: 12px;
  color: var(--color-text-muted);
  font-style: normal;
}
.markdown-body blockquote > p {
  margin: 0;
}
.markdown-body :where(blockquote > p + p) {
  margin-top: 8px;
}
.markdown-body hr {
  margin: 24px 0;
  border-color: var(--color-border);
}
.markdown-body .markdown-inline-code {
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-surface-muted) 50%, transparent);
  margin: 0 2px;
  padding: 2px 6px;
  font-size: var(--text-small);
  font-weight: 400;
}
.markdown-fallback {
  white-space: pre-wrap;
}
.markdown-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.markdown-action {
  /* Keep the copy status inside its button's scroll/clip boundary in long tool previews. */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--color-text);
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  line-height: 1;
}
.markdown-action:hover,
.markdown-action[aria-pressed="true"] {
  background: var(--color-surface-muted);
}
.markdown-action:disabled {
  opacity: 0.5;
  cursor: default;
}
.markdown-code {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}
.markdown-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 12px;
  color: var(--color-text-muted);
}
.markdown-code-language {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-small);
}
.markdown-code-language .file-icon {
  width: 16px;
  height: 16px;
}
.markdown-code-body {
  padding: 0 8px 12px;
}
.markdown-code-body pre {
  margin: 0;
  overflow: auto;
  background: transparent;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0;
}
.markdown-code-body code {
  display: block;
  width: max-content;
  min-width: 100%;
}
.markdown-code.wrap pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.markdown-code.wrap code {
  width: auto;
}
.markdown-table-block {
  margin: 16px 0;
}
.markdown-table-block > .markdown-toolbar {
  margin-bottom: 8px;
}
.markdown-table-frame {
  position: relative;
}
.markdown-table-border {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}
.markdown-table-scroll {
  overflow-x: auto;
  scrollbar-width: none;
}
.markdown-table-scroll::-webkit-scrollbar {
  display: none;
}
.markdown-body .markdown-table,
.markdown-preview .markdown-table {
  display: table;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 0;
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.75;
}
.markdown-table :is(th, td) {
  min-width: 64px;
  max-width: 448px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  text-align: left;
  background: transparent;
}
.markdown-table thead {
  background: transparent;
}
.markdown-table th {
  font-weight: 400;
  color: var(--color-text-subtlest);
}
.markdown-table tbody tr:last-child td {
  border-bottom: 0;
}
.markdown-table tbody tr:hover {
  background: color-mix(in srgb, var(--color-surface-muted) 20%, transparent);
}
.markdown-table-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
}
.markdown-table-shadow.left {
  left: 0;
  border-radius: 12px 0 0 12px;
  box-shadow: inset 12px 0 12px -12px #00000026;
}
.markdown-table-shadow.right {
  right: 0;
  border-radius: 0 12px 12px 0;
  box-shadow: inset -12px 0 12px -12px #00000026;
}
.markdown-table-scrollbar {
  position: sticky;
  bottom: 0;
  height: 18px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.markdown-table-block:hover .markdown-table-scrollbar,
.markdown-table-scrollbar:focus-within {
  opacity: 1;
}
.markdown-table-scrollbar input {
  display: block;
  width: 100%;
  height: 12px;
  padding: 0;
  margin: 0;
  appearance: none;
  background: transparent;
  border: 0;
}
.markdown-table-scrollbar input::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 3%, transparent);
}
.markdown-table-scrollbar input::-webkit-slider-thumb {
  appearance: none;
  height: 12px;
  margin-top: 1px;
  width: var(--markdown-table-thumb-width, 48px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 20%, transparent);
}
.markdown-preview {
  position: fixed;
  margin: auto;
  width: min(960px, calc(100vw - 128px));
  max-height: calc(100vh - 128px);
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: 0 20px 70px #0003;
}
.markdown-preview::backdrop {
  background: #0005;
}
.markdown-preview > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.markdown-preview h2 {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 600;
}
.markdown-preview header p {
  margin: 4px 0 0;
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.markdown-table-preview-scroll {
  background: var(--color-bg);
  max-height: calc(100vh - 230px);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}
.markdown-table-preview-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 1;
}
.markdown-image-single {
  margin: 16px 0;
}
.markdown-image-trigger {
  display: block;
  position: relative;
  max-width: 50%;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
  cursor: zoom-in;
}
.markdown-image-trigger img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin: 0;
}
.markdown-image-trigger.pending {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 176px;
  height: 176px;
  color: var(--color-text-muted);
  cursor: default;
}
.markdown-image-trigger:where(.pending) img {
  position: absolute;
  visibility: hidden;
}
.markdown-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.markdown-image-gallery .markdown-image-trigger {
  max-width: 100%;
  height: 176px;
}
.markdown-image-gallery img {
  height: 176px;
  max-height: 176px;
  width: auto;
  object-fit: cover;
}
.markdown-image-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.markdown-image-canvas {
  height: min(640px, calc(100vh - 280px));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.markdown-image-canvas:active {
  cursor: grabbing;
}
.markdown-image-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}
@media (max-width: 640px) {
  .markdown-preview {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
  }
  .markdown-image-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .markdown-image-single .markdown-image-trigger {
    max-width: 100%;
  }
}
.answer [data-streamdown="mermaid-block"] {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  box-shadow: none;
  margin-block: 14px;
  overflow: hidden;
  padding: 0;
  gap: 0;
}
.answer .katex-display {
  overflow: auto;
  padding-block: 6px;
}
.answer .zpi-mermaid {
  background: var(--color-surface);
  border: 0;
  border-radius: var(--radius-panel);
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}
.mermaid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 12px;
  color: var(--color-text-muted);
  font-size: var(--text-small);
}
.zpi-mermaid .mermaid-toolbar button {
  display: flex;
  align-items: center;
  padding: 5px;
  color: inherit;
  border-radius: var(--radius-control);
}
.zpi-mermaid .mermaid-toolbar button:hover {
  background: var(--color-surface-muted);
}
.mermaid-scroll {
  min-height: 112px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
}
.mermaid-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  min-width: max-content;
}
.mermaid-diagram svg {
  display: block;
  max-width: none;
  height: auto;
}
.mermaid-source {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.mermaid-preview {
  width: min(92vw, 1400px);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  color: var(--color-text);
  background: var(--color-surface);
}
.mermaid-preview::backdrop {
  background: rgb(0 0 0 / 25%);
}
.mermaid-preview .mermaid-scroll {
  max-height: calc(90vh - 36px);
}

.answer .mermaid-pending {
  padding: 16px;
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.load-history {
  display: block;
  margin: 0 auto 20px;
  font-size: var(--text-small);
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-nested);
  background: var(--color-surface-muted);
}
.draft-warning {
  display: block;
  color: var(--color-waiting);
  padding: 4px 0;
  overflow-wrap: anywhere;
}
.topbar-title {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-title span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title svg {
  flex-shrink: 0;
}

/* ZCode uses standard scrollbar properties so Chromium retains native overlay
   fading and hover expansion. WebKit pseudo-elements are the legacy fallback. */
* {
  scrollbar-width: auto;
  scrollbar-color: var(--color-border) transparent;
}
*::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  min-height: 32px;
  min-width: 32px;
  border: 3px solid transparent;
  border-radius: var(--radius-full);
  background: var(--color-border);
  background-clip: padding-box;
}

.composer:hover {
  border-color: var(--color-border-strong);
}
.composer:focus-within {
  border-color: var(--color-focus);
}
.composer.dragging-files {
  border-color: var(--color-primary);
}
.tool-summary-row {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  font-size: var(--text-body);
  line-height: 20px;
  color: var(--color-process-subtlest);
}
.tool-title {
  cursor: pointer;
}
.tool-title:hover .process-chevron,
.tool-title[aria-expanded="true"] .process-chevron {
  opacity: 1;
}
.tool-summary-static {
  display: flex;
  width: 100%;
  cursor: default;
}
.tool-failure {
  padding: 0;
  flex-shrink: 0;
  font-size: var(--text-body);
  cursor: help;
  white-space: nowrap;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.tool-error-tooltip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(384px, calc(100vw - 24px));
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-nested);
  background: var(--color-tooltip);
  color: var(--color-tooltip-foreground);
  z-index: var(--layer-popover);
  font-size: var(--text-small);
}
.tool-error-content {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}
.tool-error-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}
.tool-error-copy:active:not(:disabled) {
  transform: none;
}
.composer-add-panel {
  bottom: calc(100% + 5px);
  border-radius: var(--radius-dialog);
}
.composer-add-panel .command-options {
  max-height: min(384px, var(--composer-add-list-height, 40vh));
}
.composer-add-heading {
  display: flex;
  height: 34px;
  align-items: center;
  padding: 0 12px;
  color: var(--color-text-subtle);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: 0.025em;
}
.composer-add-panel :where(button) {
  border-radius: 12px;
}
.composer-add-panel button:active:not(:disabled) {
  transform: none;
}
.composer-add-panel .composer-attachment-option {
  gap: 12px;
}
.composer-add-panel :where(p) {
  min-height: 40px;
  padding: 8px 20px;
  color: var(--color-text-subtlest);
}
.composer-add-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 16px;
  color: var(--color-text-subtle);
  font-size: var(--text-small);
}
.composer-add-hint > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.composer-add-hint :where(code) {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--color-tooltip-tag);
  color: var(--color-text);
  font-family: var(--font-code);
}
.message-web-link {
  color: var(--color-file-link);
  font: inherit;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: left;
  padding: 0;
  background: transparent;
  text-decoration: none;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}
.message-web-link:hover {
  text-decoration: underline;
}
.message-file-link {
  align-items: baseline;
}
.message-file-link::before {
  align-self: center;
  margin-left: 2px;
}
.message-link-menu {
  z-index: var(--layer-popover);
  width: 176px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-popover);
}
.message-link-menu [role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: default;
  font-size: var(--text-body);
  line-height: 1.625;
}
.message-link-menu [data-highlighted] {
  background: var(--color-active);
}
.message-link-menu [role="separator"] {
  margin: 4px -4px;
  height: 1px;
  background: var(--color-border);
}
.message-file-menu {
  width: 208px;
  min-width: 176px;
  max-width: var(--radix-context-menu-content-available-width);
  overflow: hidden;
  transform-origin: var(--radix-context-menu-content-transform-origin);
  background: var(--color-input);
  box-shadow:
    0 4px 6px -1px #0000001a,
    0 2px 4px -2px #0000001a;
  z-index: 60;
}
.message-file-menu [role="menuitem"] {
  user-select: none;
}
.message-file-menu [data-highlighted] {
  background: light-dark(#f0f0f0, #363636);
}

.message-web-link:hover:not(:disabled) {
  background: transparent;
}
.message-web-link:active,
.message-file-link:active {
  transform: none;
}

.message-file-link .reference-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: baseline;
}

/* ZCode ConversationRowView: hover action rows are in normal flow, not overlays. */
.user-message-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: 20px;
}
.user-message-row .user-message {
  margin-bottom: 0;
}
.message-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  min-height: 24px;
  opacity: 0;
  transition: opacity 150ms;
}
.assistant-message-actions {
  margin-top: 0;
}
.user-message-row:hover > .message-actions,
.assistant-turn:hover .assistant-message-actions,
.message-actions:focus-within {
  opacity: 1;
}
.message-action {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-foreground);
  cursor: pointer;
  transition: background-color 150ms;
}
.message-action:hover {
  background: var(--color-fill-hover);
}
.message-action:disabled {
  opacity: 0.5;
  cursor: default;
}
.message-copied {
  color: var(--color-green-600);
}
[data-theme="dark"] .message-copied {
  color: var(--color-green-500);
}
.message-time {
  font-size: var(--text-small);
  color: var(--color-text-subtlest);
  user-select: none;
}
.message-action-tooltip {
  z-index: 50;
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-foreground);
  font-size: var(--text-small);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 320px;
}
.message-action-tooltip kbd {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  font: inherit;
  font-size: var(--text-xs);
  background: var(--color-fill);
}
.message-action-tooltip small {
  color: var(--color-text-subtle);
  font-size: inherit;
}
/* ZCode ControlHintTooltip's simple label variant (no arrow or elevation). */
.control-hint-tooltip {
  display: inline-flex;
  width: fit-content;
  max-width: min(28rem, calc(100vw - 1rem));
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--color-tooltip);
  color: var(--color-tooltip-foreground);
  line-height: 1.5;
  text-align: left;
  transform-origin: var(--radix-tooltip-content-transform-origin);
}
.control-hint-tooltip > span {
  font-weight: 500;
  white-space: pre-line;
  overflow-wrap: break-word;
}
.control-hint-tooltip[data-side="top"] {
  --control-hint-slide-y: 8px;
}
.control-hint-tooltip[data-side="bottom"] {
  --control-hint-slide-y: -8px;
}
.control-hint-tooltip[data-side="left"] {
  --control-hint-slide-x: 8px;
}
.control-hint-tooltip[data-side="right"] {
  --control-hint-slide-x: -8px;
}
.control-hint-tooltip[data-state="delayed-open"],
.control-hint-tooltip[data-state="open"],
.control-hint-tooltip[data-open]:not([data-open="false"]) {
  animation: control-hint-in 150ms ease;
}
.control-hint-tooltip[data-state="closed"],
.control-hint-tooltip[data-closed]:not([data-closed="false"]) {
  animation: control-hint-out 150ms ease;
}
@keyframes control-hint-in {
  from {
    opacity: 0;
    transform: translate3d(var(--control-hint-slide-x, 0), var(--control-hint-slide-y, 0), 0)
      scale3d(0.95, 0.95, 0.95);
  }
}
@keyframes control-hint-out {
  to {
    opacity: 0;
    transform: scale3d(0.95, 0.95, 0.95);
  }
}
.assistant-message-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}
.assistant-message-row:empty {
  display: none;
}
.assistant-turn > .notice-turn {
  margin: 20px 0 0;
}
.assistant-message-row > .answer,
.assistant-message-row > .changed-files,
.assistant-message-row > .run-error {
  margin: 0;
}
.user-message-editor {
  width: 100%;
  max-width: 576px;
}
.user-message-editor .composer-stack {
  margin: 0;
}
.user-message-editor .composer {
  min-height: 128px;
  border-radius: 16px;
}
.conversation-selection-menu {
  --selection-menu-hover: var(--color-surface-muted);
  position: fixed;
  z-index: 50;
  display: flex;
  width: max-content;
  max-width: min(576px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-popover);
  color: var(--color-foreground);
  font-size: var(--text-small);
  box-shadow:
    0 4px 6px -1px #0000001a,
    0 2px 4px -2px #0000001a;
}
.conversation-selection-menu > :where(button),
.conversation-selection-menu > span {
  min-width: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: inherit;
}
.conversation-selection-menu > :where(button):hover:not(:disabled) {
  background: var(--selection-menu-hover);
}
[data-theme="dark"] .conversation-selection-menu {
  --selection-menu-hover: var(--color-secondary);
}
.conversation-selection-menu > :where(button):disabled {
  cursor: not-allowed;
}
.conversation-selection-divider {
  width: 1px;
  flex-shrink: 0;
  background: var(--color-border);
}
.conversation-selection-menu > span {
  color: var(--color-warning);
}
.selection-reference-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 32px;
  padding: 6px 12px;
  border-radius: 9999px;
  /* ZCode bg-surface is a translucent fill; ZPI's surface token denotes opaque panels. */
  background: var(--color-fill);
  color: var(--color-foreground);
  font-size: var(--text-body);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
.selection-reference-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.selection-reference-chip > svg {
  flex-shrink: 0;
  color: var(--color-text-subtle);
}
.selection-reference-chip:hover {
  background: var(--color-fill-hover);
}
.selection-reference-chip :where(button),
.selection-reference-detail :where(button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-subtle);
  opacity: 0;
}
.selection-reference-chip:hover button,
.selection-reference-detail:hover button,
.selection-reference-chip button:focus-visible {
  opacity: 1;
}
.selection-reference-chip:has(.selection-remove-all) {
  padding-right: 6px;
}
.selection-reference-popover {
  z-index: 50;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: min(266px, 60vh);
  overflow-y: auto;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-tooltip);
  box-shadow:
    0 4px 6px -1px #0000001a,
    0 2px 4px -2px #0000001a;
  font-weight: 400;
  white-space: normal;
}
.selection-reference-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: var(--text-body);
}
.selection-reference-detail:hover {
  background: var(--color-fill-hover);
}
.selection-reference-detail > svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-text-subtle);
}
.selection-reference-detail > div {
  min-width: 0;
  flex: 1;
}
.selection-reference-detail :where(p) {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
.selection-reference-detail small {
  display: block;
  margin-top: 2px;
  color: var(--color-text-subtlest);
  overflow-wrap: anywhere;
}

.user-message-row .message-images:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  max-width: 576px;
}
.user-message-row .user-message {
  max-width: min(100%, 576px);
  border: 1px solid var(--color-border);
  border-top-right-radius: 2px;
  background: var(--color-fill);
}
.user-message-row .user-message:has(.user-message-text:empty) {
  display: none;
}
.selection-reference-popover {
  margin: 0;
  color: var(--color-foreground);
}

.compaction-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  color: var(--color-text-subtle);
  font-size: var(--text-body);
}
.compaction-line {
  height: 1px;
  min-width: 32px;
  flex: 1;
  background: color-mix(in oklab, var(--color-border) 50%, transparent);
}
.compaction-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  line-height: 20px;
}
.compaction-label > svg {
  flex-shrink: 0;
}
.compaction-label > span {
  min-width: 0;
  overflow-wrap: break-word;
}
.compaction-label .thinking-label-streaming {
  font-weight: 500;
}
.fork-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--color-text-subtle);
  font-size: var(--text-body);
  line-height: 20px;
  cursor: pointer;
}
.fork-notice > span {
  height: 1px;
  min-width: 32px;
  flex: 1;
  background: color-mix(in srgb, var(--color-border) 50%, transparent);
}

.edit-rewind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: transparent;
  color: var(--color-foreground);
}
.edit-rewind:hover:not(:disabled) {
  background: var(--color-fill-hover);
}
.edit-rewind:disabled {
  opacity: 0.5;
}
.file-rewind-conflict {
  width: min(512px, calc(100vw - 48px));
  margin: auto;
  max-height: 80vh;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-foreground);
  box-shadow:
    0 4px 6px -1px #0000001a,
    0 2px 4px -2px #0000001a;
}
.file-rewind-conflict::backdrop {
  background: rgb(0 0 0 / 60%);
  backdrop-filter: blur(2px);
}
.file-rewind-conflict h3 {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 500;
}
.file-rewind-conflict :where(p) {
  margin: 4px 0 16px;
  color: var(--color-text-subtle);
  font-size: var(--text-body);
  line-height: 1.625;
}
.file-rewind-conflict h4 {
  margin: 0 0 4px;
  font-size: var(--text-body);
  font-weight: 500;
}
.file-rewind-conflict section {
  max-height: 50vh;
  overflow-y: auto;
}
.file-rewind-conflict-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  margin-top: 4px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-xs);
}
.file-rewind-conflict-file > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.file-rewind-conflict-file > small {
  flex-shrink: 0;
  color: var(--color-text-subtle);
}
.file-rewind-conflict footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.file-rewind-conflict-close {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-subtle);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}
.file-rewind-conflict footer :where(button) {
  height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: var(--text-body);
}
.file-rewind-conflict footer :where(button:not(.primary)) {
  border-color: var(--color-border);
  background: transparent;
}
.user-message-editor .composer-actions {
  gap: 6px;
}
.user-message-editor .message-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.fork-notice > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  font-weight: 400;
}
.fork-notice:hover {
  color: var(--color-foreground);
}
.fork-notice:hover > strong {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ZCode dialogs preserve their centering transform while fading and scaling. */
[role="dialog"][data-state="open"] {
  animation: dialog-enter 100ms ease;
}
[role="dialog"][data-state="closed"] {
  animation: dialog-exit 100ms ease;
}
:is(.modal-backdrop, .model-config-backdrop)[data-state="open"] {
  animation: surface-fade-in 100ms ease;
}
:is(.modal-backdrop, .model-config-backdrop)[data-state="closed"] {
  animation: surface-fade-out 100ms ease;
}
[data-stream-entrance="true"] {
  animation: surface-fade-in 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes dialog-enter {
  from {
    opacity: 0;
    scale: 0.95;
  }
}
@keyframes dialog-exit {
  to {
    opacity: 0;
    scale: 0.95;
  }
}
@keyframes surface-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes surface-fade-out {
  to {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  button,
  .composer {
    transition: none;
  }
  [role="dialog"][data-state],
  [role="menu"][data-state],
  .settings-select-menu[data-state],
  .modal-backdrop[data-state],
  .model-config-backdrop[data-state],
  [data-stream-entrance="true"] {
    animation: none;
  }
}

/* ZCode user input: 120px, 70% fade, centered round toggle, 300ms expansion. */
.user-message-body {
  position: relative;
  min-width: 0;
}
.user-message-content {
  min-width: 0;
  overflow: hidden;
  transition: max-height 300ms ease-out;
}
.user-message-body[data-expandable="true"][data-expanded="false"] .user-message-content {
  mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}
.user-message-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
}
.user-message-body[data-expanded="false"] .user-message-toggle-row {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
}
.user-message-body[data-expanded="true"] .user-message-toggle-row {
  padding-top: 8px;
}
.user-message-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: var(--color-background);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  backdrop-filter: blur(8px);
}
@media (prefers-reduced-motion: reduce) {
  .user-message-content {
    transition: none;
  }
}

/* ZCode subagent identity palette and single-line Agent summaries. */
.subagent-task-output {
  margin: 0;
  max-height: 100px;
  overflow: auto;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--color-text-subtle);
  font: inherit;
  font-family: var(--font-mono);
}
[data-agent-color="yellow"] {
  --agent-dot: oklch(87.9% 0.169 91.605);
  --agent-text: oklch(55.5% 0.163 48.998);
  --agent-light: oklch(87.9% 0.169 91.605);
  --agent-dark-dot: oklch(87.9% 0.169 91.605);
}
[data-agent-color="red"] {
  --agent-dot: oklch(81% 0.117 11.638);
  --agent-text: oklch(51.4% 0.222 16.935);
  --agent-light: oklch(81% 0.117 11.638);
  --agent-dark-dot: oklch(71.2% 0.194 13.428);
}
[data-agent-color="orange"] {
  --agent-dot: oklch(83.7% 0.128 66.29);
  --agent-text: oklch(55.3% 0.195 38.402);
  --agent-light: oklch(83.7% 0.128 66.29);
  --agent-dark-dot: oklch(75% 0.183 55.934);
}
[data-agent-color="green"] {
  --agent-dot: oklch(84.5% 0.143 164.978);
  --agent-text: oklch(50.8% 0.118 165.612);
  --agent-light: oklch(84.5% 0.143 164.978);
  --agent-dark-dot: oklch(76.5% 0.177 163.223);
}
[data-agent-color="cyan"] {
  --agent-dot: oklch(86.5% 0.127 207.078);
  --agent-text: oklch(52% 0.105 223.128);
  --agent-light: oklch(86.5% 0.127 207.078);
  --agent-dark-dot: oklch(78.9% 0.154 211.53);
}
[data-agent-color="blue"] {
  --agent-dot: oklch(82.8% 0.111 230.318);
  --agent-text: oklch(50% 0.134 242.749);
  --agent-light: oklch(82.8% 0.111 230.318);
  --agent-dark-dot: oklch(74.6% 0.16 232.661);
}
[data-agent-color="purple"] {
  --agent-dot: oklch(81.1% 0.111 293.571);
  --agent-text: oklch(49.1% 0.27 292.581);
  --agent-light: oklch(81.1% 0.111 293.571);
  --agent-dark-dot: oklch(70.2% 0.183 293.541);
}
[data-agent-color="pink"] {
  --agent-dot: oklch(82.3% 0.12 346.018);
  --agent-text: oklch(52.5% 0.223 3.958);
  --agent-light: oklch(82.3% 0.12 346.018);
  --agent-dark-dot: oklch(71.8% 0.202 349.761);
}
[data-theme="dark"] [data-agent-color] {
  --agent-text: var(--agent-light);
  --agent-dot: color-mix(in oklab, var(--agent-dark-dot) 32%, transparent);
}
.subagent-name {
  display: inline-flex;
  align-items: center;
  max-width: 144px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-code);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.5;
  color: var(--agent-text, var(--color-text-subtle));
}
.subagent-summary-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subagent-message-details {
  margin: 0;
  padding: 12px 16px;
  background: var(--color-surface);
  border-radius: 8px;
  display: grid;
  gap: 12px;
}
.subagent-message-details dt {
  font-weight: 500;
  color: var(--color-text-subtle);
  margin-bottom: 4px;
}
.subagent-message-details dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Code comment attachments mirror ZCode: source/range first, then path and user note. */
.file-comment-detail {
  min-height: 28px;
  padding: 4px 8px;
  line-height: 1.625;
}
.selection-reference-detail > .file-comment-source {
  display: block;
  flex: 1;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  opacity: 1;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.file-comment-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.file-comment-detail .file-comment-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.file-comment-heading span {
  flex-shrink: 0;
  font-family: var(--font-mono);
  color: var(--color-text-subtle);
}
.file-comment-detail small {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  font: inherit;
  font-family: var(--font-mono);
}
.file-comment-detail :where(p) {
  -webkit-line-clamp: 2;
  color: var(--color-text-subtle);
}
.file-comment-detail > .selection-remove-one {
  flex-shrink: 0;
  margin-top: 2px;
}
.selection-reference-detail button:focus-visible {
  opacity: 1;
}

/* ZCode-style conversation query navigator. */
.conversation-navigator {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 48px;
  pointer-events: none;
  /* 保留挂载,让跨过宽度阈值时的退出动画与 ZCode 一致。 */
  visibility: hidden;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 150ms ease-out,
    transform 150ms ease-out,
    visibility 150ms ease-out;
}
.conversation-navigator[data-visible="true"] {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}
.conversation-navigator-rail {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 36px;
  max-height: calc(100% - 6rem);
  padding: 4px 0;
  overflow: hidden auto;
  scrollbar-width: none;
  transform: translateY(-50%);
  pointer-events: auto;
}
.conversation-navigator-rail::-webkit-scrollbar {
  display: none;
}
.conversation-navigator-item {
  display: flex;
  align-items: center;
  width: 36px;
  height: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.conversation-navigator-item span {
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-text-subtlest);
  transform-origin: left;
  transition:
    transform 150ms ease-out,
    opacity 150ms ease-out,
    background-color 150ms ease-out;
}
.conversation-navigator-item span[data-highlighted="true"] {
  background: var(--color-text);
}
.conversation-navigator-item:focus-visible {
  outline: 2px solid var(--color-text-subtle);
  outline-offset: 2px;
}
.conversation-navigator-tooltip {
  z-index: 100;
  width: min(320px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow:
    0 8px 24px #0002,
    0 1px 3px #0002;
  font-size: var(--text-body);
  line-height: 20px;
  overflow-wrap: anywhere;
}
.conversation-navigator-user,
.conversation-navigator-answer {
  margin: 0;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.conversation-navigator-user {
  -webkit-line-clamp: 2;
  font-weight: 600;
}
.conversation-navigator-answer {
  -webkit-line-clamp: 3;
  margin-top: 8px;
  color: var(--color-text-subtle);
}
@media (prefers-reduced-motion: reduce) {
  .conversation-navigator,
  .conversation-navigator-item span {
    transition: none;
  }
}