/* Generated from legacy styles.css: thread view, trace rendering, and side chat. */



.brand-card h1,
.assistant-header h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.brand-card p,
.trace-item-text,
.trace-item-detail {
  margin: 0;
  color: #526375;
  line-height: 1.55;
}

.label,
.turn-meta,
.assistant-header time,
.trace-item-label,
.trace-item-status {
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7d90;
}

.workspace-group-header strong,
.session-card strong,
.trace-item-title {
  color: #182532;
}

.thread-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
  justify-content: stretch;
  padding: 0 var(--pane-content-gutter);
}

.thread-column {
  width: 100%;
  min-width: 0;
  max-width: var(--pane-content-max-width);
  flex: 1 1 auto;
  margin: 0 auto;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 14px 0 8px;
  gap: 12px;
}

.thread-column::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.thread-column.is-virtualized {
  gap: 0;
}

.thread-virtual-spacer {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

.thread-virtual-row {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-width: 0;
}

.turn {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.turn[data-turn-motion="new"],
.turn[data-turn-motion="live"] {
  animation: rise-in 260ms ease;
}

.turn-meta {
  justify-content: flex-end;
}

.thread-inline-link {
  color: var(--seg-accent-strong);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
  -webkit-app-region: no-drag;
}

.thread-inline-link:hover {
  color: var(--seg-accent);
}

.thread-inline-link:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
  border-radius: 2px;
}

.assistant-turn {
  justify-items: stretch;
}

.assistant-shell {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.assistant-shell.is-sectioned {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  gap: 3px;
}

.assistant-shell.is-streaming {
  border-color: rgba(97, 146, 193, 0.52);
  box-shadow: 0 16px 38px rgba(48, 86, 124, 0.08);
}

.assistant-shell.is-sectioned.is-streaming {
  box-shadow: none;
}

.assistant-shell.is-sectioned.is-streaming .assistant-section {
  border-color: rgba(97, 146, 193, 0.46);
}

.assistant-header h3 {
  font-size: 22px;
  line-height: 1.1;
}

.assistant-section {
  border: 1px solid rgba(166, 186, 208, 0.42);
  border-radius: var(--seg-radius-xs);
  background: #ffffff;
  padding: 14px 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.assistant-section.is-reasoning,
.assistant-section.is-response,
.assistant-section.is-tools {
  border: 0;
  background: transparent;
  padding: 0;
}

.assistant-section.is-reasoning {
  gap: 10px;
}

.assistant-section.is-tools {
  gap: 10px;
}

.assistant-section.is-file-change {
  background: transparent;
  padding-top: 4px;
  padding-bottom: 4px;
}

.assistant-section.is-debug {
  background: #f7fafc;
}

.assistant-process-trace {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 0;
}

.assistant-process-trace-header {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  display: grid;
  grid-template-columns: 16px auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  border: 0;
  border-radius: var(--seg-radius-xs);
  background: transparent;
  color: var(--seg-text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.assistant-process-trace-header:hover,
.assistant-process-trace-header:focus-visible {
  background: var(--mix-seg-panel-muted-86-transparent-14);
  color: var(--seg-text-1);
  outline: none;
}

.assistant-process-trace-chevron {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.assistant-process-trace-chevron svg {
  width: 13px;
  height: 13px;
}

.assistant-process-trace-title {
  color: currentColor;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.assistant-process-trace-duration {
  color: var(--seg-text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.assistant-process-trace-summary {
  min-width: 0;
  overflow: hidden;
  color: var(--seg-text-3);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-process-trace-body {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding-left: 22px;
}

.assistant-process-trace-body .assistant-section {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-top: 0;
  padding-bottom: 0;
}

.assistant-process-trace-row {
  min-width: 0;
  max-width: 100%;
}

.assistant-process-item-row {
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 0 0 22px;
}

.assistant-process-item-row .trace-item {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assistant-section-label {
  color: #4b6074;
}

.assistant-section-body,
.assistant-section-list,
.assistant-reasoning-stack,
.assistant-response-stack,
.assistant-file-change-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.assistant-section-empty {
  margin: 0;
  color: #6b7d90;
  line-height: 1.6;
}

.assistant-ephemeral-state {
  padding: 10px 14px;
  border: 1px solid var(--seg-border);
  border-radius: var(--seg-radius-xs);
  background: var(--seg-panel-muted);
}

.assistant-ephemeral-hint {
  margin: 0;
  color: #607487;
  font-size: 13px;
  line-height: 1.5;
}

.assistant-reasoning-round {
  display: grid;
  gap: 8px;
}

.assistant-reasoning-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7a8c9d;
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.assistant-reasoning-separator::before,
.assistant-reasoning-separator::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(166, 186, 208, 0.42);
}

.assistant-trace-list {
  display: grid;
  gap: 8px;
}

.trace-item {
  position: relative;
  border: 1px solid var(--seg-border);
  border-radius: 0;
  border-left: 3px solid #c5ccd6;
  padding: 8px 10px;
  background: var(--seg-panel-muted);
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  box-shadow: none;
}

.trace-item.is-plain {
  border-left: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  gap: 4px;
}

.trace-item::before {
  display: none;
}

.trace-item.is-plain::before {
  display: none;
}

.trace-item-header {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.trace-item-title {
  min-width: 0;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.trace-item-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #334657;
}

.trace-item-detail {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #607386;
}

.trace-item-debug {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px dashed rgba(166, 186, 208, 0.42);
}

.trace-item-debug-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.5;
}

.trace-item-debug-label {
  color: #526375;
}

.trace-item-debug-value {
  color: #6b7d90;
  white-space: pre-wrap;
  word-break: break-word;
}

.trace-item-plain-text,
.trace-item-plain-detail {
  color: #526375;
}

.trace-item-reasoning-toggle {
  min-width: 0;
  cursor: pointer;
}

.trace-item.is-expanded .trace-item-reasoning-toggle {
  display: block;
  width: 100%;
  max-width: 100%;
}

.trace-item-reasoning-toggle:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
  border-radius: var(--seg-radius-xs);
}

.trace-item-reasoning-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trace-item-collapsed-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-item-toggle {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.trace-item-toggle-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.trace-item-toggle-static-summary {
  margin: 0;
}

.trace-item-toggle-leading-icon,
.trace-item-toggle-chevron {
  display: inline-flex;
  width: 14px;
  height: 14px;
  margin-top: 0;
  align-items: center;
  justify-content: center;
  color: #6b7d90;
  flex: 0 0 auto;
}

.trace-item-toggle-leading-icon svg,
.trace-item-toggle-chevron svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trace-item-toggle-line {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  color: #2d4153;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.trace-item-inline-title,
.trace-item-inline-status {
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
}

.trace-item-inline-title {
  color: #2d4153;
  overflow-wrap: anywhere;
}

.trace-item-inline-status {
  color: #6b7d90;
}

.trace-item-disclosure {
  padding-left: 20px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trace-item-subsection {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.trace-item-subsection-toggle {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
}

.trace-item-subsection-toggle-icon {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  color: #6b7d90;
  flex: 0 0 auto;
}

.trace-item-subsection-toggle-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trace-item-subsection-toggle-line {
  min-width: 0;
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.trace-item-subsection-body {
  padding-left: 18px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trace-tool-io-pane,
.trace-reasoning-pane {
  padding: 6px 8px 6px 18px;
  border-left: 1px solid var(--seg-divider);
}

.trace-reasoning-pane {
  padding: 0;
  border-left: 0;
}

.trace-item-subsection-label {
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7d90;
}

.trace-item-status {
  padding: 3px 8px;
  border: 1px solid rgba(160, 178, 196, 0.45);
  background: rgba(255, 255, 255, 0.8);
}

.trace-item.is-streaming .trace-item-text::after {
  content: " ";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: currentColor;
  animation: stream-caret 1s steps(1) infinite;
}

.trace-kind-system {
  background: #f7f9fb;
  border-left-color: #b9c2ce;
}

.trace-kind-system::before {
  background: #9eb0c2;
}

.trace-kind-reasoning {
  background: var(--seg-panel-muted);
  border-left-color: #94a4ba;
}

.trace-kind-reasoning,
.trace-kind-tool {
  background: var(--seg-panel-muted);
  border-left: 0;
  box-shadow: none;
}

.trace-kind-reasoning::before {
  background: #71889e;
}

.trace-kind-reasoning .trace-item-text,
.trace-kind-reasoning .trace-item-detail {
  font-size: 14px;
  line-height: 1.7;
}

.assistant-section.is-reasoning .trace-item,
.assistant-section.is-response .trace-item {
  border-left: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-section.is-reasoning .trace-item::before,
.assistant-section.is-response .trace-item::before,
.assistant-section.is-file-change .trace-item::before {
  display: none;
}

.assistant-section.is-response .trace-item-header {
  display: none;
}

.assistant-section.is-response .trace-item-text {
  color: var(--seg-text-1);
  font-size: 16px;
  line-height: 1.82;
}

.assistant-section.is-response .trace-item-detail {
  color: var(--seg-text-2);
  font-size: 14px;
  line-height: 1.72;
}

.thread-markdown {
  --md-text: var(--semantic-markdown-text, var(--seg-text-1));
  --md-muted: var(--semantic-markdown-muted-text, var(--seg-text-2));
  --md-faint: var(--semantic-markdown-muted-text, var(--seg-text-3));
  --md-strong: var(--semantic-markdown-strong-text, var(--seg-text-1));
  --md-accent: var(--semantic-markdown-accent, var(--seg-accent-strong));
  --md-border: var(--semantic-markdown-border, var(--seg-border));
  --md-border-strong: var(--semantic-markdown-border-strong, var(--seg-border));
  --md-quote-bg: var(--semantic-markdown-quote-surface, var(--seg-panel-muted));
  --md-inline-code-bg: var(--semantic-markdown-inline-code-surface, var(--seg-panel-muted));
  --md-table-head-bg: var(--semantic-markdown-table-head-surface, var(--seg-panel-muted));
  --md-table-row-alt-bg: var(--semantic-markdown-table-row-alt-surface, var(--seg-panel-muted));
  --md-code-bg: var(--semantic-markdown-code-surface, var(--surface-code));
  --md-code-text: var(--semantic-markdown-code-text, var(--text-on-dark));
  --md-code-muted: var(--semantic-markdown-code-muted-text, rgba(250, 250, 249, 0.62));
  --md-code-border: var(--semantic-markdown-code-border, var(--surface-code));

  min-width: 0;
  max-width: 100%;
  color: var(--md-text);
  line-height: 1.66;
  white-space: normal;
  overflow-wrap: anywhere;
}

.thread-markdown > :first-child {
  margin-top: 0;
}

.thread-markdown > :last-child {
  margin-bottom: 0;
}

.thread-markdown :where(p, blockquote, ul, ol, pre, .thread-markdown-table-scroll, h1, h2, h3, h4, h5, h6) {
  margin: 0 0 0.82em;
}

.thread-markdown p {
  color: var(--md-text);
}

.thread-markdown strong {
  color: var(--md-strong);
  font-weight: 700;
}

.thread-markdown :where(h1, h2, h3, h4, h5, h6) {
  color: var(--md-strong);
  font-weight: 700;
  line-height: 1.24;
}

.thread-markdown :where(h1, h2) {
  position: relative;
  padding-left: 11px;
}

.thread-markdown :where(h1, h2)::before {
  content: "";
  position: absolute;
  top: 0.18em;
  bottom: 0.2em;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--md-accent);
}

.thread-markdown h1 {
  font-size: 23px;
}

.thread-markdown h2 {
  font-size: 20px;
}

.thread-markdown :where(h3, h4, h5, h6) {
  font-size: 16px;
}

.thread-markdown h3 {
  color: var(--md-accent);
}

.thread-markdown :where(ul, ol) {
  padding-left: 1.45em;
}

.thread-markdown :where(ul, ol) :where(ul, ol) {
  margin-top: 0.32em;
  margin-bottom: 0.32em;
}

.thread-markdown :where(li + li) {
  margin-top: 0.34em;
}

.thread-markdown li::marker {
  color: var(--md-accent);
  font-weight: 700;
}

.thread-markdown :where(blockquote) {
  padding: 8px 12px 8px 14px;
  border-left: 3px solid var(--md-accent);
  border-radius: var(--seg-radius-xs);
  background: var(--md-quote-bg);
  color: var(--md-muted);
}

.thread-markdown blockquote > :last-child {
  margin-bottom: 0;
}

.thread-markdown :where(code) {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.thread-markdown :where(:not(pre) > code) {
  padding: 0.12em 0.36em;
  border: 1px solid var(--md-border-strong);
  border-radius: 4px;
  background: var(--md-inline-code-bg);
  color: var(--md-strong);
}

.thread-markdown pre {
  position: relative;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 13px 15px;
  border: 1px solid var(--md-code-border);
  border-radius: var(--seg-radius-xs);
  background: var(--md-code-bg);
  color: var(--md-code-text);
  white-space: pre;
  scrollbar-width: thin;
}

.thread-markdown pre code {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.thread-markdown pre code[data-language]::before {
  content: attr(data-language);
  display: block;
  width: fit-content;
  margin: 0 0 10px;
  color: var(--md-code-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.thread-markdown-table-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--md-border);
  border-radius: var(--seg-radius-xs);
  background: var(--seg-panel);
  scrollbar-width: thin;
}

.thread-markdown table {
  width: 100%;
  min-width: max-content;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.thread-markdown :where(th, td) {
  min-width: 0;
  padding: 7px 10px;
  border: 0;
  border-right: 1px solid var(--md-border);
  border-bottom: 1px solid var(--md-border);
  text-align: left;
  vertical-align: top;
}

.thread-markdown th {
  color: var(--md-strong);
  font-weight: 700;
  background: var(--md-table-head-bg);
}

.thread-markdown td {
  color: var(--md-text);
  background: var(--seg-panel);
}

.thread-markdown tbody tr:nth-child(even) td {
  background: var(--md-table-row-alt-bg);
}

.thread-markdown :where(th, td):last-child {
  border-right: 0;
}

.thread-markdown tbody tr:last-child td {
  border-bottom: 0;
}

.thread-markdown thead tr:last-child th {
  border-bottom-color: var(--md-border-strong);
}

.thread-markdown hr {
  height: 1px;
  margin: 1em 0;
  border: 0;
  background: var(--md-border);
}

.thread-markdown .contains-task-list {
  padding-left: 0;
  list-style: none;
}

.thread-markdown .task-list-item {
  list-style: none;
}

.thread-markdown .task-list-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0 7px 0 0;
  vertical-align: -2px;
  accent-color: var(--md-accent);
}

.thread-markdown-image-alt {
  color: var(--md-muted);
  font-style: italic;
}

.thread-markdown-image {
  display: block;
  width: auto;
  max-width: min(100%, 520px);
  max-height: 420px;
  margin: 10px 0;
  object-fit: contain;
  border: 1px solid var(--md-border);
  border-radius: 8px;
  background: var(--seg-panel);
}

.thread-html {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  white-space: normal;
}

.thread-html-frame {
  display: block;
  width: 100%;
  min-height: 320px;
  max-height: 720px;
  border: 1px solid var(--seg-border);
  border-radius: var(--seg-radius-sm);
  background: #ffffff;
}

.trace-kind-text {
  background: #ffffff;
  border-left-color: rgba(81, 136, 188, 0.75);
}

.trace-kind-text::before {
  background: #4e89bd;
}

.trace-kind-patch,
.trace-kind-file,
.trace-kind-image,
.trace-kind-subtask,
.trace-kind-compaction,
.trace-kind-step,
.trace-kind-retry,
.trace-kind-snapshot,
.trace-kind-task-state {
  background: #f8fbfd;
  border-left-color: rgba(109, 156, 194, 0.68);
}

.trace-kind-patch::before,
.trace-kind-file::before,
.trace-kind-image::before,
.trace-kind-subtask::before,
.trace-kind-compaction::before,
.trace-kind-step::before,
.trace-kind-retry::before,
.trace-kind-snapshot::before,
.trace-kind-task-state::before {
  background: #6a9ac2;
}

.trace-kind-compaction {
  border: 0;
  padding: 3px 0;
  background: transparent;
  box-shadow: none;
}

.trace-compaction-separator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--seg-text-3);
  min-width: 0;
}

.trace-compaction-rule {
  height: 1px;
  background: var(--seg-divider);
}

.trace-compaction-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--seg-text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.trace-compaction-glyph {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.78;
  position: relative;
  flex: 0 0 auto;
}

.trace-compaction-glyph::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.trace-compaction-detail {
  text-align: center;
  font-size: 12px;
}

.trace-item-step-line {
  gap: 4px;
}

.trace-item-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.trace-item-step-row .trace-item-label,
.trace-item-step-row .trace-item-status {
  flex: 0 0 auto;
}

.trace-item-step-row .trace-item-title,
.trace-item-step-summary {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
}

.trace-item-step-row .trace-item-title {
  flex: 0 1 auto;
}

.trace-item-step-summary {
  flex: 1 1 auto;
}

.trace-item-step-summary::before {
  content: "·";
  margin-right: 8px;
  color: var(--seg-text-3);
}

.task-progress-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.task-progress-item {
  display: grid;
  grid-template-columns: minmax(86px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.task-progress-status {
  color: #5f7184;
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.5;
  text-transform: uppercase;
}

.task-progress-step {
  color: #24384c;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-progress-item.is-completed .task-progress-status {
  color: #2a8357;
}

.task-progress-item.is-in_progress .task-progress-status {
  color: #1669af;
}

.trace-kind-tool .trace-item-detail {
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #42586d;
  white-space: pre-wrap;
  word-break: break-word;
}

.trace-kind-tool .trace-item-toggle:hover .trace-item-inline-title,
.trace-kind-tool .trace-item-toggle:focus-visible .trace-item-inline-title {
  color: #0f67aa;
}

.trace-kind-tool .trace-item-toggle:hover .trace-item-inline-status,
.trace-kind-tool .trace-item-toggle:focus-visible .trace-item-inline-status {
  color: #0f67aa;
}

.trace-kind-tool .trace-item-toggle:focus-visible {
  outline: none;
}

.assistant-section.is-file-change .trace-item {
  border-left: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  gap: 6px;
}

.assistant-section.is-file-change .trace-item + .trace-item {
  border-top: 1px solid rgba(166, 186, 208, 0.32);
  padding-top: 12px;
}

.assistant-section.is-file-change .trace-item-header {
  gap: 10px;
}

.assistant-section.is-file-change .trace-item-title {
  font-size: 14px;
}

.trace-item-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.trace-item-file-chip {
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(79, 116, 200, 0.18);
  border-radius: var(--seg-radius-xs);
  background: rgba(79, 116, 200, 0.08);
  color: var(--seg-accent-strong);
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.trace-item-file-chip:hover,
.trace-item-file-chip:focus-visible {
  border-color: rgba(95, 146, 194, 0.7);
  background: #ffffff;
  color: #0f67aa;
  outline: none;
}

.trace-file-change-summary {
  display: inline-grid;
  grid-template-columns: 16px auto 14px;
  gap: 6px;
  align-items: center;
  justify-content: start;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--seg-text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.trace-file-change-summary:hover,
.trace-file-change-summary:focus-visible {
  color: var(--seg-text-1);
  outline: none;
}

.trace-file-change-summary-icon,
.trace-file-change-summary-chevron,
.trace-file-change-toggle-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.trace-file-change-summary-icon svg,
.trace-file-change-summary-chevron svg,
.trace-file-change-toggle-icon svg {
  width: 13px;
  height: 13px;
}

.trace-file-change-summary-icon svg {
  transform: translateY(-1px);
}

.trace-file-change-summary-label {
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.trace-file-change-list {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 20px;
}

.trace-file-change-entry {
  display: grid;
  gap: 0;
  min-width: 0;
}

.trace-file-change-row {
  display: grid;
  grid-template-columns: 14px auto minmax(0, auto) auto auto;
  gap: 5px;
  align-items: baseline;
  justify-content: start;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--seg-text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.trace-file-change-row.is-static {
  cursor: default;
}

.trace-file-change-row:hover,
.trace-file-change-row:focus-visible {
  color: var(--seg-text-1);
  outline: none;
}

.trace-file-change-action {
  color: var(--seg-text-2);
  font-size: 14px;
  line-height: 1.45;
  white-space: nowrap;
}

.trace-file-change-file {
  min-width: 0;
  color: var(--seg-accent-strong);
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.trace-file-change-stats {
  display: inline-flex;
  gap: 4px;
  color: var(--seg-text-2);
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

.trace-file-change-stats .is-add {
  color: #238447;
}

.trace-file-change-stats .is-remove {
  color: #a53a31;
}

.trace-file-change-note {
  color: var(--seg-text-3);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

.trace-file-change-preview {
  min-width: 0;
  margin: 6px 0 8px 19px;
  border: 1px solid rgba(166, 186, 208, 0.22);
  border-radius: var(--seg-radius-xs);
  overflow: hidden;
}

.trace-historical-diff.right-sidebar-diff-preview,
.trace-historical-diff-empty.right-sidebar-diff-empty {
  border: 0;
  background: #ffffff;
}

.trace-historical-diff.right-sidebar-diff-preview {
  max-height: 280px;
}

.trace-historical-diff.right-sidebar-diff-preview.is-full-height {
  max-height: none;
}

.trace-historical-diff .right-sidebar-diff-code {
  gap: 8px;
  padding: 8px 0;
  font-size: 11px;
}

.trace-historical-diff .right-sidebar-diff-hunk {
  border: 0;
  background: transparent;
}

.trace-historical-diff .right-sidebar-diff-hunk + .right-sidebar-diff-hunk {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(166, 186, 208, 0.22);
}

.trace-historical-diff .right-sidebar-diff-hunk-header {
  padding: 0 8px 4px;
  border-bottom: 0;
  background: transparent;
  color: var(--seg-text-3);
}

.trace-historical-diff .right-sidebar-diff-row {
  grid-template-columns: 34px 34px minmax(0, 1fr);
  background: transparent;
}

.trace-historical-diff .right-sidebar-diff-row + .right-sidebar-diff-row {
  border-top: 0;
}

.trace-historical-diff .right-sidebar-diff-line-number {
  padding: 0 6px;
  border-right: 0;
  background: transparent;
  color: var(--seg-text-3);
}

.trace-historical-diff .right-sidebar-diff-content {
  padding: 0 8px 0 6px;
  color: var(--seg-text-1);
}

.trace-historical-diff .right-sidebar-diff-row.is-add {
  background: var(--mix-seg-success-9-transparent-91);
}

.trace-historical-diff .right-sidebar-diff-row.is-add .right-sidebar-diff-content {
  color: var(--mix-seg-success-78-seg-text-1-22);
}

.trace-historical-diff .right-sidebar-diff-row.is-remove {
  background: var(--mix-seg-danger-9-transparent-91);
}

.trace-historical-diff .right-sidebar-diff-row.is-remove .right-sidebar-diff-content {
  color: var(--mix-seg-danger-78-seg-text-1-22);
}

.trace-historical-diff .right-sidebar-diff-preview-footer {
  position: static;
  justify-content: flex-start;
  padding: 8px;
  border-top: 0;
  background: transparent;
  backdrop-filter: none;
}

.trace-historical-diff .right-sidebar-diff-height-toggle {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--seg-text-2);
  font-size: 11px;
}

.trace-historical-diff .right-sidebar-diff-height-toggle:hover,
.trace-historical-diff .right-sidebar-diff-height-toggle:focus-visible {
  border: 0;
  background: transparent;
  color: var(--seg-text-1);
}

.trace-historical-diff-empty.right-sidebar-diff-empty {
  padding: 8px;
}

.trace-historical-diff-empty p {
  margin: 0;
  color: var(--seg-text-3);
  font-size: 12px;
}

.trace-image-preview {
  display: grid;
  gap: 6px;
  width: min(100%, 420px);
  min-width: 0;
}

.trace-image-thumbnail {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 120px;
  max-height: 320px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(166, 186, 208, 0.54);
  border-radius: 8px;
  background: rgba(247, 250, 252, 0.88);
  cursor: zoom-in;
}

.trace-image-thumbnail:disabled {
  cursor: default;
}

.trace-image-thumbnail:hover,
.trace-image-thumbnail:focus-visible {
  border-color: rgba(95, 146, 194, 0.72);
  outline: none;
}

.trace-image-thumbnail-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: contain;
}

.trace-image-thumbnail.is-loading .trace-image-thumbnail-image,
.trace-image-thumbnail.is-error .trace-image-thumbnail-image {
  opacity: 0;
}

.trace-image-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #607386;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  background: rgba(247, 250, 252, 0.92);
}

.trace-image-state.is-error {
  color: var(--seg-danger);
}

.trace-image-meta {
  margin: 0;
  color: #607386;
  font-size: 12px;
  line-height: 1.4;
}

body.is-image-lightbox-open {
  overflow: hidden;
}

.trace-image-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 17, 27, 0.82);
}

.trace-image-lightbox-panel {
  width: min(96vw, 1400px);
  height: min(94vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(8, 14, 22, 0.94);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.44);
}

.trace-image-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.trace-image-lightbox-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.trace-image-lightbox-toolbar-button,
.trace-image-lightbox-toolbar-icon-button,
.trace-image-lightbox-close {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(218, 229, 241, 0.28);
  border-radius: 8px;
  color: #eff7ff;
  background: rgba(14, 23, 34, 0.9);
}

.trace-image-lightbox-toolbar-icon-button,
.trace-image-lightbox-close {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}

.trace-image-lightbox-toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
}

.trace-image-lightbox-toolbar-button.is-active {
  border-color: rgba(121, 167, 207, 0.92);
  background: rgba(43, 79, 118, 0.78);
}

.trace-image-lightbox-toolbar-button:hover,
.trace-image-lightbox-toolbar-button:focus-visible,
.trace-image-lightbox-toolbar-icon-button:hover,
.trace-image-lightbox-toolbar-icon-button:focus-visible,
.trace-image-lightbox-close:hover,
.trace-image-lightbox-close:focus-visible {
  border-color: rgba(174, 204, 231, 0.92);
  background: rgba(28, 45, 65, 0.95);
  outline: none;
}

.trace-image-lightbox-zoom-button svg {
  width: 14px;
  height: 14px;
}

.trace-image-lightbox-toolbar-icon-button svg,
.trace-image-lightbox-close svg {
  width: 16px;
  height: 16px;
}

.trace-image-lightbox-viewport {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(176, 196, 216, 0.22);
  border-radius: 10px;
  background: rgba(14, 23, 34, 0.7);
}

.trace-image-lightbox-viewport.is-fit-width {
  overflow-y: auto;
  overflow-x: hidden;
}

.trace-image-lightbox-canvas {
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
}

.trace-image-lightbox-canvas.is-fit-width {
  display: block;
  min-height: auto;
  padding: 0;
}

.trace-image-lightbox-canvas.is-zoomed {
  cursor: grab;
}

.trace-image-lightbox-canvas.is-zoomed.is-dragging {
  cursor: grabbing;
}

.trace-image-lightbox-image {
  display: block;
  transform-origin: center center;
  transition: transform 120ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.trace-image-lightbox-canvas.is-fit-contain .trace-image-lightbox-image {
  max-width: 100%;
  max-height: calc(94vh - 140px);
  object-fit: contain;
}

.trace-image-lightbox-canvas.is-fit-width .trace-image-lightbox-image {
  width: 100%;
  max-width: none;
  height: auto;
}

.trace-kind-error {
  background: #fff5f3;
  border-left-color: var(--seg-danger);
}

.trace-kind-error::before {
  background: #c65e4e;
}

.trace-item-status.is-running,
.trace-item-status.is-pending {
  color: #1669af;
}

.trace-item-status.is-completed {
  color: #2a8357;
}

.trace-item-status.is-waiting-approval {
  color: #9a5b08;
}

.trace-item-status.is-error {
  color: #b14537;
}

.trace-item-status.is-denied {
  color: #b14537;
}

.permission-request-turn {
  animation: rise-in 220ms ease;
}

.permission-request-inline {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  border: 1px solid rgba(166, 186, 208, 0.46);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 247, 255, 0.92) 100%);
  box-shadow: 0 16px 36px rgba(46, 81, 118, 0.09);
}

.permission-request-inline-header,
.permission-request-header,
.permission-request-footer,
.permission-request-badges {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.permission-request-inline-header > div,
.permission-request-header > div {
  min-width: 0;
}

.permission-request-inline-header h3,
.permission-request-header h3 {
  margin: 4px 0 0;
  line-height: 1.1;
  color: #17232f;
  font-size: 20px;
}

.permission-request-card {
  border: 1px solid rgba(166, 186, 208, 0.42);
  border-left-color: var(--seg-border);
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(46, 81, 118, 0.12);
  padding: 20px;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.permission-request-inline .permission-request-card {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.96);
}

.permission-request-subtitle,
.permission-request-rationale,
.permission-request-note,
.permission-request-inline-copy,
.permission-request-error {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.permission-request-subtitle,
.permission-request-rationale,
.permission-request-note,
.permission-request-inline-copy {
  color: #526375;
}

.permission-request-rationale {
  font-size: 13px;
}

.permission-request-error {
  color: #a33d2f;
}

.permission-request-badges {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.permission-request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.permission-request-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-request-meta {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--mix-seg-border-90-transparent-10);
  background: var(--mix-seg-panel-muted-78-seg-panel-22);
  display: grid;
  gap: 6px;
}

.permission-request-meta-wide {
  grid-column: 1 / -1;
}

.permission-request-meta-label {
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7d90;
}

.permission-request-meta strong {
  color: #17232f;
  line-height: 1.5;
  word-break: break-word;
}

.permission-request-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #17232f;
  line-height: 1.55;
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
}

.permission-request-controls {
  display: grid;
  gap: 10px;
}

.permission-request-disclosure {
  border: 1px solid var(--mix-seg-border-84-transparent-16);
  background: var(--mix-seg-panel-muted-78-seg-panel-22);
  min-width: 0;
}

.permission-request-disclosure summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b6074;
}

.permission-request-disclosure summary::-webkit-details-marker {
  display: none;
}

.permission-request-disclosure[open] summary {
  border-bottom: 1px solid rgba(166, 186, 208, 0.3);
}

.permission-request-disclosure[open] .permission-request-grid,
.permission-request-disclosure[open] .permission-request-memory-actions {
  padding: 12px;
}

.permission-request-memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-request-footer {
  align-items: center;
}

.permission-request-actions {
  flex-wrap: wrap;
}

.permission-request-count {
  align-self: center;
}

.ask-user-question-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 12px 0 10px;
  border: 0;
  background: var(--semantic-question-card-surface);
  box-shadow: none;
  animation: none;
}

.ask-user-question-body,
.ask-user-question-options {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ask-user-question-options {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ask-user-question-text {
  margin: 0;
  color: var(--seg-text-1);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ask-user-question-option,
.ask-user-question-freeform-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.ask-user-question-freeform-row.is-standalone {
  grid-template-columns: minmax(0, 1fr);
}

.ask-user-question-option-number {
  color: var(--seg-text-3);
  font-size: 16px;
  line-height: 1.5;
  text-align: right;
  user-select: none;
}

.ask-user-question-option-button,
.ask-user-question-option-choice,
.ask-user-question-option-static {
  min-width: 0;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--seg-text-1);
  font: inherit;
  text-align: left;
}

.ask-user-question-option-button,
.ask-user-question-option-choice {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.ask-user-question-option-button {
  cursor: pointer;
}

.ask-user-question-option-button:not(:disabled):hover .ask-user-question-option-label,
.ask-user-question-option-button:not(:disabled):focus-visible .ask-user-question-option-label {
  color: var(--seg-accent-strong);
}

.ask-user-question-option-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.ask-user-question-option-static {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ask-user-question-option-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--seg-accent);
}

.ask-user-question-option .primary-button,
.ask-user-question-option .secondary-button {
  width: 100%;
  justify-self: stretch;
  text-align: left;
}

.ask-user-question-response-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ask-user-question-freeform-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--seg-border);
  border-radius: var(--seg-radius-xs);
  background: var(--surface-elevated);
  color: var(--seg-text-1);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.ask-user-question-freeform-input:focus-visible {
  border-color: var(--seg-accent);
  box-shadow: 0 0 0 2px var(--mix-seg-accent-soft-84-seg-panel-16);
}

.ask-user-question-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.ask-user-question-actions .secondary-button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--seg-accent);
  color: var(--text-on-dark);
  font-weight: 700;
}

.ask-user-question-actions .secondary-button:disabled {
  opacity: 0.48;
}

.ask-user-question-option-label {
  min-width: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ask-user-question-option-description,
.ask-user-question-note {
  margin: 0;
  color: var(--seg-text-3);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ask-user-question-option-description {
  font-size: 12px;
}

.ask-user-question-note {
  font-size: 13px;
}

.proposed-plan-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  padding: 14px;
  border: 1px solid var(--seg-border);
  border-radius: var(--seg-radius-sm);
  background: var(--semantic-proposed-plan-card-surface);
  box-shadow: var(--shadow-xs);
}

.proposed-plan-card-body {
  min-width: 0;
}

.proposed-plan-markdown {
  margin: 0;
}

.proposed-plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--seg-border);
}

.proposed-plan-actions .primary-button,
.proposed-plan-actions .secondary-button {
  min-height: 30px;
  padding: 0 12px;
}

.proposed-plan-state,
.proposed-plan-error {
  margin-right: auto;
  color: var(--seg-text-3);
  font-size: 12px;
  font-weight: 700;
}

.proposed-plan-error {
  color: var(--danger, #b42318);
}

.trace-kind-tool {
  border-left-color: var(--seg-accent);
}

.trace-item-title,
.trace-item-inline-title,
.trace-item-toggle-line,
.trace-item-text,
.assistant-section.is-response .trace-item-text {
  color: var(--seg-text-1);
}

.trace-item-detail,
.trace-item-plain-text,
.trace-item-plain-detail,
.assistant-section.is-response .trace-item-detail {
  color: var(--seg-text-2);
}

.thread-shell.create-session-shell {
  align-items: center;
  justify-content: center;
}

.assistant-shell.is-streaming,
.assistant-shell.is-sectioned.is-streaming {
  border: 0;
  box-shadow: none;
}

.assistant-section.is-response,
.assistant-section.is-reasoning,
.assistant-section.is-tools,
.assistant-section.is-file-change {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.assistant-section.is-response {
  padding-top: 2px;
  padding-bottom: 2px;
}

.assistant-section.is-response .trace-item {
  border: 0;
  background: transparent;
  padding: 0;
}

.assistant-section.is-tools .trace-item,
.assistant-section.is-reasoning .trace-item,
.assistant-section.is-file-change .trace-item {
  border-radius: var(--seg-radius-xs);
}

body.is-resizing-sidebar .assistant-section.is-tools .trace-item,
body.is-resizing-sidebar .assistant-section.is-reasoning .trace-item,
body.is-resizing-sidebar .assistant-section.is-file-change .trace-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}

body.is-resizing-sidebar .trace-file-change-entry,
body.is-resizing-sidebar .user-turn-diff-file-entry {
  content-visibility: auto;
  contain-intrinsic-size: auto 40px;
}

.assistant-section.is-reasoning,
.assistant-section.is-tools {
  padding-top: 0;
  padding-bottom: 0;
}

.assistant-section.is-tools .trace-item,
.assistant-section.is-reasoning .trace-item {
  padding: 4px 10px;
}

.side-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid rgba(48, 118, 175, 0.22);
  border-radius: 999px;
  background: rgba(34, 118, 184, 0.1);
  color: #1d5f94;
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.side-chat-badge.is-compact {
  min-height: 18px;
  padding: 0 6px;
  font-size: 9px;
}

.session-tab-copy .side-chat-badge {
  flex-shrink: 0;
}

.assistant-response-side-chat {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
}

.assistant-response-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  padding-top: 0;
}

.assistant-branch-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: min(260px, 100%);
  height: 24px;
  padding: 0 4px 0 8px;
  border: 1px solid var(--seg-border);
  border-radius: var(--seg-radius-xs);
  background: var(--seg-panel);
  color: var(--seg-text-3, #64748b);
  font-size: 11px;
  line-height: 1;
}

.assistant-branch-switcher-label {
  flex: 0 0 auto;
  font-weight: 700;
}

.assistant-branch-switcher-select {
  min-width: 0;
  max-width: 180px;
  border: 0;
  background: transparent;
  color: var(--seg-text-2, #475569);
  font: inherit;
  outline: none;
}

.assistant-branch-switcher:focus-within {
  border-color: var(--focus-outline-color);
  box-shadow: 0 0 0 var(--focus-outline-width) var(--focus-outline-color);
}

.message-action-icon-button {
  border: 0;
  background: transparent;
  color: var(--seg-text-3, #64748b);
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 160ms ease;
}

.message-action-icon-button:hover,
.message-action-icon-button.is-active {
  color: var(--seg-accent-strong, #174b76);
}

.message-action-icon-button:focus-visible {
  color: var(--seg-accent-strong, #174b76);
  border-radius: var(--seg-radius-xs);
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
}

.message-action-icon-button svg {
  width: 15px;
  height: 15px;
}

.user-message-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  margin-top: -2px;
  transition: opacity 160ms ease;
}

.inline-side-chat-thread {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  margin: 6px 0 2px;
  padding: 10px 12px 12px;
  border: 1px solid var(--seg-border);
  border-radius: 10px;
  background: var(--seg-panel);
  box-shadow: none;
}

.right-sidebar-side-chat-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.inline-side-chat-thread.is-sidebar {
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 8px 10px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inline-side-chat-thread::before {
  content: none;
}

.inline-side-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.inline-side-chat-close {
  width: var(--icon-button-size);
  min-width: var(--icon-button-size);
  height: var(--icon-button-size);
  min-height: var(--icon-button-size);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--seg-radius-xs);
  background: transparent;
  box-shadow: none;
  color: var(--seg-text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.inline-side-chat-close:hover,
.inline-side-chat-close:focus-visible {
  background: var(--mix-seg-panel-muted-88-seg-panel-12);
  border-color: transparent;
  box-shadow: none;
  color: var(--seg-text-2);
  transform: none;
}

.inline-side-chat-close:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
}

.inline-side-chat-close:active {
  color: var(--seg-text-1);
}

.inline-side-chat-close svg {
  width: var(--section-toolbar-aux-icon-size);
  height: var(--section-toolbar-aux-icon-size);
}

.inline-side-chat-tabs {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
}

.inline-side-chat-tab-list {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 6px;
  min-width: 0;
  max-width: calc(100% - 34px);
  overflow-x: auto;
  overflow-y: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
  white-space: nowrap;
}

.inline-side-chat-tab-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.inline-side-chat-tab,
.inline-side-chat-tab-add {
  height: 26px;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--seg-text-2, #475569);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.inline-side-chat-tab {
  min-width: 58px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
}

.inline-side-chat-tab:hover,
.inline-side-chat-tab:focus-visible,
.inline-side-chat-tab-add:hover,
.inline-side-chat-tab-add:focus-visible {
  border-color: var(--seg-border);
  background: var(--mix-seg-panel-muted-88-seg-panel-12);
  color: var(--seg-text-1);
}

.inline-side-chat-tab.is-active {
  border-color: var(--seg-border);
  background: var(--seg-panel-muted);
  color: var(--seg-text-1);
  box-shadow: none;
}

.inline-side-chat-tab:focus-visible,
.inline-side-chat-tab-add:focus-visible {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
  outline-offset: var(--focus-outline-offset);
}

.inline-side-chat-tab-add {
  width: 26px;
  min-width: 26px;
  padding: 0;
}

.inline-side-chat-tab-add:disabled {
  cursor: default;
  opacity: 0.55;
}

.inline-side-chat-tab-add svg {
  width: 14px;
  height: 14px;
}

.inline-side-chat-tab-menu {
  --side-chat-tab-menu-surface: var(--semantic-dropdown-menu-surface, var(--seg-dropdown-menu-surface, var(--surface-elevated, #ffffff)));
  --side-chat-tab-menu-border: var(--seg-border, rgba(17, 24, 39, 0.12));
  --side-chat-tab-menu-text: var(--seg-text-1, #1f2937);
  --side-chat-tab-menu-danger-text: var(--semantic-error-text, var(--seg-danger-text, #b42318));
  --side-chat-tab-menu-danger-hover: var(--semantic-error-surface, var(--seg-danger-surface, rgba(180, 35, 24, 0.08)));
  --side-chat-tab-menu-radius: var(--semantic-dropdown-menu-radius, 8px);
  --side-chat-tab-menu-shadow: var(--ui-shadow-md, var(--shadow-md, 0 14px 34px rgba(17, 24, 39, 0.14)));

  position: fixed;
  z-index: 1000;
  width: max-content;
  min-width: 0;
  max-width: min(180px, calc(100vw - 16px));
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--side-chat-tab-menu-border);
  border-radius: var(--side-chat-tab-menu-radius);
  background: var(--side-chat-tab-menu-surface);
  color: var(--side-chat-tab-menu-text);
  box-shadow: var(--side-chat-tab-menu-shadow);
  animation: ui-context-menu-in 120ms ease;
}

.inline-side-chat-tab-menu-item {
  width: 100%;
  min-height: 32px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: max(4px, calc(var(--side-chat-tab-menu-radius) - 2px));
  background: transparent;
  color: var(--side-chat-tab-menu-danger-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
}

.inline-side-chat-tab-menu-item:hover,
.inline-side-chat-tab-menu-item:focus-visible {
  background: var(--side-chat-tab-menu-danger-hover);
  color: var(--side-chat-tab-menu-danger-text);
  outline: none;
}

.inline-side-chat-tab-menu-item:focus-visible {
  box-shadow: inset 0 0 0 1px var(--focus-outline-color);
}

.inline-side-chat-tab-menu-item:disabled {
  cursor: default;
  opacity: 0.48;
}

.inline-side-chat-tab-menu-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.inline-side-chat-tab-menu-icon svg {
  width: 15px;
  height: 15px;
}

.inline-side-chat-tab-menu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-side-chat-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.inline-side-chat-thread.is-sidebar .inline-side-chat-body {
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.inline-side-chat-thread.is-sidebar .composer {
  grid-row: 2;
  align-self: end;
}

.inline-side-chat-thread .thread-shell {
  padding: 0;
  min-width: 0;
}

.inline-side-chat-thread.is-sidebar .thread-shell {
  min-height: 0;
  overflow: hidden;
}

.inline-side-chat-thread .thread-column {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 12px;
}

.inline-side-chat-thread.is-sidebar .thread-column {
  overflow-y: auto;
}

.inline-side-chat-thread .turn {
  margin: 0;
}

.inline-side-chat-thread .user-bubble {
  background: var(--mix-seg-panel-76-seg-panel-muted-24);
  border-color: var(--mix-seg-border-88-white-12);
}

.thread-session-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: transparent;
  border-radius: 0;
}

.thread-session-banner-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.thread-session-banner-copy strong {
  color: var(--seg-text-1, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-session-banner-copy p {
  margin: 0;
  color: var(--seg-text-3, #64748b);
  font-size: 13px;
  line-height: 1.5;
}

.thread-session-banner-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 0;
  color: var(--seg-text-2, #334155);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Thread trace refinements: flatter cards and stronger content hierarchy. */

.trace-item,
.assistant-ephemeral-state,
.ask-user-question-card,
.permission-request-card {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}

.trace-item,
.assistant-ephemeral-state {
  border-left-width: 2px;
}

.permission-request-card,
.ask-user-question-card {
  border-left-width: 2px;
}

.assistant-section.is-reasoning .trace-item-inline-title,
.assistant-section.is-reasoning .trace-item-text,
.assistant-section.is-reasoning .trace-item-plain-text,
.assistant-section.is-tools .trace-item-inline-title,
.assistant-section.is-tools .trace-item-text,
.assistant-section.is-tools .trace-item-toggle-line {
  color: var(--seg-text-2);
}

.assistant-section.is-reasoning .trace-item-inline-status,
.assistant-section.is-reasoning .trace-item-detail,
.assistant-section.is-reasoning .trace-item-plain-detail,
.assistant-section.is-tools .trace-item-inline-status,
.assistant-section.is-tools .trace-item-detail,
.assistant-section.is-tools .trace-item-subsection-label {
  color: var(--seg-text-3);
}

.user-turn {
  justify-items: end;
}

.assistant-stream-insertion-user-turn {
  margin: 8px 0;
}

.user-bubble {
  max-width: min(100%, 520px);
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid #bdc8d7;
  border-radius: var(--seg-radius-sm);
  background: #eef2f7;
  color: var(--seg-text-1);
  font-size: 16px;
  line-height: 1.6;
  box-shadow: none;
}

.user-turn-diff-card {
  width: min(100%, 736px);
  min-width: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #e3e5e8;
  border-radius: 8px;
  background: #ffffff;
  color: #26292f;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.user-turn .user-turn-diff-card {
  justify-self: end;
  width: min(100%, 520px);
}

.user-turn-diff-card-header {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
}

.user-turn-diff-card-summary {
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-turn-diff-card-summary:hover,
.user-turn-diff-card-summary:focus-visible {
  outline: none;
}

.user-turn-diff-card-title {
  min-width: 0;
  font-size: 18px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-turn-diff-stats {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
  font-family: "IBM Plex Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}

.user-turn-diff-stats .is-add {
  color: #0f9f53;
}

.user-turn-diff-stats .is-remove {
  color: #c4322d;
}

.user-turn-diff-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  color: #858891;
}

.user-turn-diff-action,
.user-turn-diff-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.user-turn-diff-action:hover,
.user-turn-diff-action:focus-visible,
.user-turn-diff-expand:hover,
.user-turn-diff-expand:focus-visible {
  color: #42464f;
  outline: none;
}

.user-turn-diff-action:disabled,
.user-turn-diff-expand:disabled {
  opacity: 0.45;
  cursor: default;
}

.user-turn-diff-action svg,
.user-turn-diff-expand svg {
  width: 13px;
  height: 13px;
}

.user-turn-diff-expand {
  width: 20px;
}

.user-turn-diff-file-list {
  display: grid;
  min-width: 0;
  border-top: 1px solid #eceef1;
}

.user-turn-diff-file-entry + .user-turn-diff-file-entry {
  border-top: 1px solid #f0f1f3;
}

.user-turn-diff-file-entry:has(.user-turn-diff-file-preview) + .user-turn-diff-file-entry {
  border-top-color: #e6e9ee;
}

.user-turn-diff-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-turn-diff-file-row:hover,
.user-turn-diff-file-row:focus-visible {
  background: #f8f9fb;
  outline: none;
}

.user-turn-diff-file-row.is-static {
  cursor: default;
}

.user-turn-diff-file-path {
  min-width: 0;
  color: #30343b;
  font-size: 16px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-turn-diff-file-chevron {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: #858891;
}

.user-turn-diff-file-chevron svg {
  width: 13px;
  height: 13px;
}

.user-turn-diff-file-preview {
  min-width: 0;
  margin: 0 10px 10px;
  border: 1px solid rgba(166, 186, 208, 0.24);
  border-radius: 6px;
  overflow: hidden;
}

.user-turn-historical-diff.right-sidebar-diff-preview,
.user-turn-historical-diff-empty.right-sidebar-diff-empty {
  background: #fbfcfe;
}

.user-turn-diff-error {
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid #f0d4d1;
  background: #fff7f7;
  color: #a53a31;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .user-turn-diff-card-header {
    gap: 8px;
    padding: 0 10px;
  }

  .user-turn-diff-actions {
    gap: 8px;
  }

  .user-turn-diff-action {
    font-size: 14px;
  }

  .user-turn-diff-card-title,
  .user-turn-diff-file-path {
    font-size: 15px;
  }
}

.user-bubble-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.user-bubble-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.user-bubble-steer-note {
  display: grid;
  gap: 2px;
  padding-top: 2px;
  color: var(--seg-text-3);
  font-size: 13px;
  line-height: 1.35;
}

.thread-inline-reference {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: text-bottom;
}

.user-bubble-chip-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.user-bubble-chip {
  min-width: 0;
  max-width: 100%;
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(166, 186, 208, 0.42);
  background: #f5f8fb;
  color: #314353;
}

.user-bubble-reference-chip {
  border-color: var(--mix-seg-accent-28-seg-border-72);
  background: var(--mix-seg-accent-soft-78-seg-panel-22);
  color: var(--seg-accent-strong);
}

.user-bubble-chip svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.user-bubble-chip-label {
  max-width: 220px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
}

@keyframes sage-thinking-pulse {
  0%,
  100% {
    opacity: 0.72;
    box-shadow: none;
  }

  50% {
    opacity: 1;
    box-shadow: none;
  }
}

@keyframes sage-thinking-caret {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 1;
  }
}

@keyframes tool-status-breath-soft {
  0%,
  100% {
    opacity: 0.48;
    transform: translate(-50%, -50%) scale(0.88);
    box-shadow: 0 0 0 0 var(--tool-status-halo);
  }

  50% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 4px var(--tool-status-halo);
  }
}

@keyframes tool-status-breath-active {
  0%,
  100% {
    opacity: 0.66;
    transform: translate(-50%, -50%) scale(0.9);
    box-shadow: 0 0 0 0 var(--tool-status-halo), 0 0 0 var(--tool-status-color);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow: 0 0 0 5px var(--tool-status-halo), 0 0 8px var(--tool-status-color);
  }
}

/* Sage / Teal & Slate theme overrides */

.assistant-shell.is-streaming,
.assistant-shell.is-sectioned.is-streaming {
  border: 0;
  box-shadow: none;
}

.assistant-shell.is-streaming .assistant-section.is-reasoning .trace-item,
.assistant-shell.is-streaming .assistant-section.is-tools .trace-item,
.assistant-shell.is-streaming .assistant-ephemeral-state {
  animation: sage-thinking-pulse 2s ease-in-out infinite;
}

.assistant-section.is-reasoning .trace-item,
.assistant-section.is-tools .trace-item,
.assistant-section.is-file-change .trace-item,
.assistant-ephemeral-state,
.permission-request-card {
  border: 1px solid var(--seg-border);
  border-left: 3px solid var(--seg-accent);
  border-radius: var(--seg-radius-xs);
  background: var(--surface-trace);
  color: var(--seg-text-1);
  box-shadow: none;
}

.assistant-section.is-tools .trace-item {
  border-left-color: var(--brand-accent-active);
}

.assistant-section.is-file-change .trace-item {
  border-left-color: var(--seg-info-strong);
}

.permission-request-card {
  border-left-color: var(--seg-warning-strong);
  background: var(--mix-seg-warning-surface-84-surface-trace-16);
}

.ask-user-question-card {
  border: 0;
  background: var(--semantic-question-card-surface);
}

.assistant-section.is-response,
.assistant-section.is-response .trace-item,
.assistant-section.is-response .trace-kind-text {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.assistant-section.is-response .ask-user-question-card {
  border: 0;
  background: var(--semantic-question-card-surface);
}

.assistant-section.is-debug {
  background: var(--mix-surface-trace-88-seg-panel-12);
}

.assistant-section-label,
.trace-item-detail,
.trace-item-debug,
.trace-item-debug-label,
.trace-item-plain-detail,
.assistant-section-empty,
.assistant-reasoning-separator,
.trace-item-inline-status,
.trace-item-subsection-label {
  color: var(--seg-text-3);
}

.trace-item-inline-title,
.trace-item-toggle-line,
.trace-item-text,
.trace-item-plain-text,
.trace-item-title,
.assistant-section.is-response .trace-item-text,
.assistant-section.is-response .trace-item-detail {
  color: var(--seg-text-1);
}

.trace-kind-system {
  background: var(--mix-seg-panel-muted-82-seg-panel-18);
  border-left-color: var(--seg-border);
}

.trace-kind-reasoning {
  background: var(--mix-surface-trace-88-seg-panel-12);
  border-left-color: var(--brand-accent-active);
}

.trace-kind-tool {
  background: var(--mix-surface-trace-84-seg-panel-16);
  border-left-color: var(--seg-info);
}

.assistant-reasoning-separator::before,
.assistant-reasoning-separator::after,
.assistant-response-actions,
.trace-item-debug {
  border-color: var(--seg-divider);
  background: none;
}

.assistant-reasoning-separator::before,
.assistant-reasoning-separator::after {
  background: var(--seg-divider);
}

.assistant-shell.is-streaming .assistant-header h3 {
  background: transparent;
}

.trace-item.is-streaming .trace-item-text::after {
  background: linear-gradient(180deg, var(--brand-accent-active), var(--brand-accent-active));
  animation: sage-thinking-caret 1.8s ease-in-out infinite;
}

.trace-item-status.is-running,
.trace-item-status.is-working {
  color: var(--brand-accent-active);
}

.trace-item-status.is-success {
  color: var(--seg-success);
}

.trace-item-status.is-waiting-approval {
  color: var(--seg-warning);
}

.trace-item-status.is-error {
  color: var(--seg-danger);
}

.user-bubble,
.inline-side-chat-thread .user-bubble {
  border: 1px solid var(--mix-seg-accent-14-seg-border-86);
  background: var(--surface-user-bubble);
  color: var(--seg-text-1);
  box-shadow: none;
}

.user-bubble-chip {
  border: 1px solid var(--seg-border);
  background: var(--mix-surface-user-bubble-68-seg-panel-32);
  color: var(--seg-text-2);
}

.user-bubble-reference-chip,
.trace-item-file-chip {
  border-color: var(--mix-seg-accent-28-seg-border-72);
  background: var(--mix-seg-accent-soft-80-seg-panel-20);
  color: var(--seg-accent-strong);
}

.trace-item-file-chip:hover,
.trace-item-file-chip:focus-visible {
  border-color: var(--mix-seg-accent-48-seg-border-52);
  background: var(--seg-panel);
  color: var(--seg-accent-strong);
}

.user-bubble-reference-chip svg,
.trace-item-file-chip svg,
.assistant-response-action-button:hover,
.assistant-response-action-button:focus-visible,
.assistant-response-action-button.is-active,
.side-chat-badge {
  color: var(--seg-accent-strong);
}

.side-chat-badge {
  background: var(--mix-seg-accent-soft-70-seg-panel-30);
  border-left-color: var(--seg-accent);
}

.assistant-shell.is-sectioned > .assistant-section:not(.assistant-ephemeral-state) {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-shell.is-sectioned .assistant-section.is-reasoning .trace-item,
.assistant-shell.is-sectioned .assistant-section.is-tools .trace-item,
.assistant-shell.is-sectioned .assistant-section.is-workflow .trace-item,
.assistant-shell.is-sectioned .assistant-section.is-file-change .trace-item,
.assistant-shell.is-sectioned .assistant-ephemeral-state {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Compact thread density for scan-heavy conversations. */
.thread-shell > .thread-column {
  gap: 7px;
  padding-top: 10px;
}

.thread-column .turn {
  gap: 4px;
}

.assistant-shell.is-sectioned {
  gap: 1px;
}

.assistant-section.is-response {
  padding-top: 0;
  padding-bottom: 0;
}

.assistant-section.is-reasoning,
.assistant-section.is-tools {
  gap: 2px;
}

.assistant-section-body,
.assistant-section-list,
.assistant-reasoning-stack,
.assistant-response-stack,
.assistant-file-change-stack {
  gap: 4px;
}

.assistant-section.is-tools .trace-item,
.assistant-section.is-reasoning .trace-item,
.assistant-section.is-file-change .trace-item {
  padding: 1px 8px;
}

.assistant-section.is-reasoning .trace-item,
.assistant-process-item-row.is-reasoning .trace-item {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.trace-item-toggle-summary {
  gap: 4px 6px;
}

.trace-item-subsection-toggle {
  gap: 4px;
}

.trace-item-toggle-leading-icon,
.trace-item-toggle-chevron {
  margin-top: 0;
}

.trace-tool-status-indicator {
  --tool-status-color: var(--seg-text-3);
  --tool-status-halo: transparent;
  position: relative;
  color: var(--tool-status-color);
}

.trace-tool-status-indicator.is-preparing {
  --tool-status-color: var(--seg-info);
  --tool-status-halo: var(--seg-info-surface);
}

.trace-tool-status-indicator.is-running {
  --tool-status-color: var(--brand-accent-active);
  --tool-status-halo: var(--mix-seg-accent-soft-72-surface-trace-28);
}

.trace-tool-status-indicator.is-waiting-approval {
  --tool-status-color: var(--seg-warning);
  --tool-status-halo: var(--seg-warning-surface);
}

.trace-tool-status-indicator.is-success {
  --tool-status-color: var(--seg-success);
}

.trace-tool-status-indicator.is-error,
.trace-tool-status-indicator.is-denied {
  --tool-status-color: var(--seg-danger);
}

.trace-tool-status-indicator.is-cancelled {
  --tool-status-color: var(--seg-text-3);
}

.trace-tool-status-indicator:is(.is-icon-dot, .is-icon-success, .is-icon-error) svg {
  opacity: 0;
}

.trace-tool-status-indicator:is(.is-icon-dot, .is-icon-success, .is-icon-error)::before {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  color: var(--tool-status-color);
  transform: translate(-50%, -50%);
}

.trace-tool-status-indicator.is-icon-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.trace-tool-status-indicator.is-icon-success::before,
.trace-tool-status-indicator.is-icon-error::before {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.trace-tool-status-indicator.is-icon-success::before {
  content: "\2713";
}

.trace-tool-status-indicator.is-icon-error::before {
  content: "\00d7";
}

.trace-tool-status-indicator.is-preparing.is-breathing::before,
.trace-tool-status-indicator.is-waiting-approval.is-breathing::before {
  animation: tool-status-breath-soft 2.4s ease-in-out infinite;
}

.trace-tool-status-indicator.is-running.is-breathing::before {
  animation: tool-status-breath-active 1.6s ease-in-out infinite;
}

.assistant-shell.is-streaming .assistant-section.is-tools .trace-item {
  animation: none;
}

.trace-item-toggle-line {
  line-height: 1.38;
}

.trace-item-text,
.trace-item-detail,
.assistant-section.is-response .trace-item-text,
.assistant-section.is-response .trace-item-detail {
  line-height: 1.55;
}

.assistant-section.is-response .trace-item-text,
.assistant-section.is-response .trace-item-detail {
  color: var(--semantic-thread-response-text);
}

.assistant-section.is-reasoning .trace-item-inline-title,
.assistant-section.is-reasoning .trace-item-toggle-line,
.assistant-section.is-reasoning .trace-item-text,
.assistant-section.is-reasoning .trace-item-plain-text,
.assistant-section.is-reasoning .trace-item-detail,
.assistant-section.is-reasoning .trace-item-plain-detail {
  color: var(--semantic-thread-reasoning-text);
}

.inline-side-chat-thread .thread-column {
  gap: 7px;
}

.trace-log-list {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  contain: layout paint style;
}

.trace-log-item {
  min-width: 0;
  max-width: 100%;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  contain: layout paint style;
}

.trace-log-row {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--seg-text-2);
  font: inherit;
  text-align: left;
  box-shadow: none;
  transition: none;
  contain: layout paint style;
}

button.trace-log-row {
  cursor: pointer;
}

.trace-log-row:hover,
.trace-log-row:focus-visible {
  background: var(--mix-seg-panel-muted-86-transparent-14);
  color: var(--seg-text-1);
  outline: none;
}

.trace-log-row.is-static {
  cursor: default;
}

.trace-log-status-dot {
  flex: 0 0 14px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--seg-text-3);
  margin: 0 4px;
}

.trace-log-status-dot.is-running,
.trace-log-status-dot.is-pending {
  background: var(--brand-accent-active);
}

.trace-log-status-dot.is-waiting-approval {
  background: var(--seg-warning);
}

.trace-log-status-dot.is-completed {
  background: var(--seg-success);
}

.trace-log-status-dot.is-error,
.trace-log-status-dot.is-denied,
.trace-log-status-dot.is-cancelled {
  background: var(--seg-danger);
}

.trace-log-row .trace-tool-status-indicator {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trace-log-row .trace-tool-status-indicator::before {
  animation: none;
}

.trace-log-row .trace-tool-status-indicator svg {
  width: 13px;
  height: 13px;
}

.trace-log-label,
.trace-log-status-text,
.trace-log-time {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0;
}

.trace-log-label {
  flex: 0 1 72px;
  min-width: 42px;
  max-width: 72px;
  overflow: hidden;
  color: var(--seg-text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-log-summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--seg-text-2);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-log-row:hover .trace-log-summary,
.trace-log-row:focus-visible .trace-log-summary {
  color: var(--seg-text-1);
}

.trace-log-meta {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  color: var(--seg-text-3);
  white-space: nowrap;
}

.trace-log-status-text {
  color: currentColor;
}

.trace-log-status-text.is-running,
.trace-log-status-text.is-pending {
  color: var(--brand-accent-active);
}

.trace-log-status-text.is-waiting-approval {
  color: var(--seg-warning);
}

.trace-log-status-text.is-error,
.trace-log-status-text.is-denied,
.trace-log-status-text.is-cancelled {
  color: var(--seg-danger);
}

.trace-log-chevron {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.trace-log-chevron svg {
  width: 13px;
  height: 13px;
}

.trace-log-detail {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 2px 0 4px 22px;
  padding: 6px 8px;
  border-left: 1px solid var(--seg-divider);
  color: var(--seg-text-2);
  contain: layout paint style;
}

.thread-resize-lightweight .trace-log-row,
body.is-resizing-sidebar .trace-log-row,
body.is-resizing-sidebar .trace-item,
body.is-resizing-sidebar .turn {
  transition: none !important;
  animation: none !important;
  box-shadow: none !important;
}

.thread-resize-lightweight .trace-tool-status-indicator::before,
body.is-resizing-sidebar .trace-tool-status-indicator::before {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .trace-tool-status-indicator.is-breathing::before {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
