:root {
  color: #1f1f1f;
  background: #f5f5f5;
  --surface-canvas: #f5f5f5;
  --surface-raised: #fff;
  --surface-subtle: #fafafa;
  --surface-muted: #f0f0f0;
  --text-primary: #1f1f1f;
  --text-secondary: #595959;
  --text-muted: #6b7280;
  --text-on-accent: #fff;
  --border-default: #d9d9d9;
  --border-control: #8c8c8c;
  --border-subtle: #f0f0f0;
  --accent: #0b57d0;
  --accent-solid: #0b57d0;
  --accent-solid-hover: #0847ab;
  --accent-hover: #0847ab;
  --accent-selected: #bae0ff;
  --accent-subtle: #e6f4ff;
  --danger: #cf1322;
  --danger-solid: #b42318;
  --danger-strong: #cf1322;
  --danger-border: #ffccc7;
  --danger-subtle: #fff2f0;
  --success: #237804;
  --success-subtle: #f6ffed;
  --warning: #faad14;
  --overlay-backdrop: rgb(0 0 0 / 45%);
  --shadow-card: 0 2px 8px rgb(0 0 0 / 6%);
  --shadow-dialog: 0 6px 16px rgb(0 0 0 / 8%);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --page-gutter: 32px;
  --content-reading: 820px;
  --content-standard: 960px;
  --content-dashboard: 1040px;
  --radius-control: 8px;
  --radius-card: 12px;
  --control-height: 36px;
  --motion-fast: 120ms;
  --motion-normal: 180ms;
  --motion-slow: 240ms;
  --font-page-title: 24px;
  --font-section-title: 14px;
  --font-body: 13px;
  --font-caption: 11px;
  --font-family-ui:
    "Inter Variable", "Noto Sans SC Variable", "Segoe UI Variable",
    "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC",
    sans-serif;
  --font-family-mono:
    "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-family: var(--font-family-ui);
  font-optical-sizing: auto;
  font-synthesis: style;
  text-rendering: optimizeLegibility;
}

@media (max-width: 1199px) {
  :root {
    --page-gutter: 24px;
  }
}

@media (max-width: 959px) {
  :root {
    --page-gutter: 16px;
  }
}

.magic-notes-page {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  gap: var(--space-4);
}

.magic-notes-layout {
  display: grid;
  flex: 1;
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  grid-template-columns: 220px minmax(300px, 1fr) minmax(240px, 280px);
}

.magic-notes-layout--ai-hidden {
  grid-template-columns: 220px minmax(300px, 1fr);
}

.magic-notes-list-pane,
.magic-notes-stream-pane,
.magic-notes-ai-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.magic-notes-list-pane,
.magic-notes-ai-pane {
  background: var(--surface-subtle);
}

.magic-notes-list-pane {
  display: flex;
  padding: var(--space-4);
  border-right: 1px solid var(--border-subtle);
  flex-direction: column;
  gap: var(--space-3);
}

.magic-notes-list-pane > .page-tabs--segmented {
  width: 100%;
}

.magic-notes-list-pane > .page-tabs--segmented .page-tabs__tab {
  flex: 1;
  justify-content: center;
  padding-inline: var(--space-2);
}

.magic-notes-library-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
}

.magic-notes-ai-pane {
  padding: var(--space-4);
  border-left: 1px solid var(--border-subtle);
}

.magic-notes-pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  font-size: var(--font-section-title);
  line-height: 1.4;
}

.magic-notes-pane-heading > span {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.magic-notes-pane-heading .icon-button {
  width: 28px;
  height: 28px;
  margin: -4px;
}

.magic-notes-search input,
.magic-notes-create input,
.magic-notes-create textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.magic-notes-create textarea {
  padding-block: var(--space-2);
  resize: vertical;
}

.magic-notes-create {
  display: grid;
  padding: var(--space-3);
  border: 1px solid var(--accent-selected);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  gap: var(--space-2);
}

.magic-notes-create label {
  display: grid;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  gap: var(--space-1);
}

.magic-notes-create > div,
.magic-note-entry header > div,
.magic-note-entry__editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.magic-notes-list {
  display: grid;
  flex: 1;
  min-height: 0;
  overflow: auto;
  align-content: start;
  gap: var(--space-1);
}

.magic-todo-list-item {
  display: grid;
  width: 100%;
  min-width: 0;
  align-items: start;
  min-height: 48px;
  padding: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  gap: var(--space-2);
  grid-template-columns: auto minmax(0, 1fr);
  text-align: left;
}

.magic-todo-list-item:hover {
  background: var(--surface-muted);
}

.magic-todo-list-item--active {
  border-color: var(--accent-selected);
  background: var(--accent-subtle);
}

.magic-todo-list-item__check {
  display: grid;
  padding-top: 1px;
  color: var(--accent);
  place-items: center;
}

.magic-todo-list-item > span:last-child {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
}

.magic-todo-list-item strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.magic-todo-list-item small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.magic-todo-directory {
  display: grid;
  gap: var(--space-1);
}

.magic-todo-directory__heading {
  display: grid;
  min-width: 0;
  align-items: center;
  padding: var(--space-2) var(--space-1) var(--space-1);
  color: var(--text-secondary);
  font-size: var(--font-caption);
  gap: var(--space-1);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.magic-todo-directory__heading strong {
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.magic-todo-directory__heading > span {
  color: var(--text-muted);
}

.magic-todo-directory__items {
  display: grid;
  padding-left: var(--space-3);
  border-left: 1px solid var(--border-default);
  margin-left: 7px;
  gap: var(--space-1);
}

.magic-note-list-item {
  display: grid;
  width: 100%;
  padding: var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  gap: var(--space-1);
  text-align: left;
}

.magic-note-list-item:hover {
  background: var(--surface-muted);
}

.magic-note-list-item--active {
  border-color: var(--accent-selected);
  background: var(--accent-subtle);
}

.magic-note-list-item__title {
  display: flex;
  overflow: hidden;
  align-items: center;
  color: var(--text-primary);
  font-weight: 600;
  gap: var(--space-1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.magic-note-list-item__preview {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--font-caption);
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.magic-note-list-item__meta {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.magic-notes-stream-pane {
  padding: var(--space-6);
  background: var(--surface-raised);
}

.magic-note-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
}

.magic-todo-detail {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: var(--space-4);
}

.magic-todo-detail > header {
  display: grid;
  min-width: 0;
  align-items: start;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-3);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.magic-todo-detail__check {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  background: var(--accent-subtle);
  color: var(--accent);
  place-items: center;
}

.magic-todo-detail > header > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
}

.magic-todo-detail > header span {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.magic-todo-detail h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.magic-todo-detail__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.magic-todo-detail__actions button,
.magic-todo-detail__content .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.magic-todo-detail__content {
  display: grid;
  align-content: start;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  gap: var(--space-4);
}

.magic-todo-detail__content p {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.magic-todo-detail__content .secondary-button {
  width: fit-content;
}

.magic-todo-detail__editor {
  display: grid;
  gap: var(--space-4);
}

.magic-todo-detail__editor label {
  display: grid;
  color: var(--text-secondary);
  font-size: var(--font-body);
  gap: var(--space-2);
}

.magic-todo-detail__editor input,
.magic-todo-detail__editor textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  resize: vertical;
}

.magic-todo-detail__editor > div {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.magic-notes-ai-source {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.magic-note-detail-header > input {
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  flex: 1;
  font-size: 18px;
  font-weight: 600;
}

.magic-note-detail-header > input:hover,
.magic-note-detail-header > input:focus {
  border-color: var(--border-control);
  background: var(--surface-raised);
}

.magic-note-detail-header > div {
  display: flex;
  gap: var(--space-1);
}

.magic-note-delete-confirmation {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  margin-bottom: var(--space-3);
  background: var(--surface-raised);
  color: var(--text-secondary);
  gap: var(--space-2);
}

.magic-note-delete-confirmation > span {
  min-width: 0;
  flex: 1;
}

.magic-notes-field-error {
  margin: 0;
  color: var(--danger-strong);
  font-size: var(--font-caption);
  line-height: 1.5;
}

.magic-note-detail-header + .magic-notes-field-error {
  margin: calc(-1 * var(--space-2)) 0 var(--space-3);
}

.magic-note-composer > .magic-notes-field-error,
.magic-note-entry__editor > .magic-notes-field-error {
  padding: 0 var(--space-4);
}

.magic-note-composer,
.magic-note-entry {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.magic-note-composer {
  margin-bottom: var(--space-4);
}

.magic-note-composer > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--font-caption);
  gap: var(--space-3);
}

.magic-note-entry-stream {
  display: grid;
  gap: var(--space-3);
}

.magic-note-entry > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--font-caption);
  gap: var(--space-2);
}

.magic-note-entry > header > div {
  align-items: center;
  flex-wrap: wrap;
}

.magic-note-entry > header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  line-height: 1;
}

.magic-note-entry__editor {
  min-width: 0;
  padding: var(--space-3);
}

.magic-note-entry__delete {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--danger-border);
  background: var(--danger-subtle);
  color: var(--danger-strong);
  gap: var(--space-2);
}

.magic-note-entry__delete > span {
  min-width: 0;
  flex: 1;
}

.magic-note-entry__editor-actions {
  margin-top: var(--space-2);
}

.magic-note-editor {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-control);
}

.magic-note-editor__toolbar.ql-toolbar.ql-snow {
  padding: var(--space-2);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
}

.magic-note-editor__toolbar.ql-toolbar button,
.magic-note-editor__toolbar.ql-toolbar .ql-picker {
  color: var(--text-secondary);
}

.magic-note-editor__content.ql-container.ql-snow {
  min-height: 132px;
  border: 0;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.magic-note-editor__content .ql-editor {
  min-height: 132px;
  line-height: 1.65;
}

.magic-note-editor .ql-editor img,
.magic-note-content .ql-editor img {
  display: block;
  max-width: min(100%, 720px);
  max-height: 520px;
  border-radius: var(--radius-control);
  object-fit: contain;
}

.magic-note-content.ql-container.ql-snow {
  border: 0;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.magic-note-content .ql-editor {
  padding: var(--space-4);
  line-height: 1.7;
}

.magic-notes-muted {
  margin: 0;
  padding: var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-body);
  line-height: 1.6;
}

.magic-notes-ai-feed {
  display: grid;
  margin-top: var(--space-3);
  gap: var(--space-3);
}

.magic-notes-ai-group {
  display: grid;
  gap: var(--space-2);
}

.magic-notes-ai-group > a {
  color: var(--accent);
  font-size: var(--font-caption);
  text-decoration: none;
}

.magic-note-comment {
  display: flex;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-secondary);
  gap: var(--space-2);
}

.magic-note-comment--warning {
  border-color: var(--danger-border);
}

.magic-note-comment > span {
  padding-top: 2px;
  color: var(--accent);
}

.magic-note-comment--warning > span {
  color: var(--danger);
}

.magic-note-comment strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.magic-note-comment p {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--font-body);
  line-height: 1.6;
}

.magic-notes-page .danger-solid {
  min-height: var(--control-height);
  padding: 0 13px;
  border: 1px solid var(--danger-solid);
  border-radius: var(--radius-control);
  background: var(--danger-solid);
  color: var(--text-on-accent);
  cursor: pointer;
}

@container (max-width: 800px) {
  .magic-notes-layout {
    grid-template-columns: 210px minmax(320px, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .magic-notes-ai-pane {
    max-height: 280px;
    border-top: 1px solid var(--border-subtle);
    border-left: 0;
    grid-column: 1 / -1;
  }
}

@container (max-width: 720px) {
  .magic-notes-page {
    height: auto;
  }

  .magic-notes-layout {
    min-height: 0;
    overflow: visible;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .magic-notes-list-pane {
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .magic-notes-ai-pane {
    max-height: none;
    grid-column: auto;
  }

  .magic-note-composer > footer,
  .magic-note-entry > header {
    align-items: stretch;
    flex-direction: column;
  }

  .magic-note-entry > header > div,
  .magic-note-entry__delete {
    align-items: stretch;
    flex-direction: column;
  }

  .magic-todo-detail > header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .magic-todo-detail__actions {
    justify-content: flex-start;
    grid-column: 1 / -1;
  }

}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
}

.sidebar {
  display: flex;
  flex: 0 0 278px;
  flex-direction: column;
  min-width: 0;
  padding: 20px 14px 14px;
  overflow: hidden;
  border-right: 1px solid #f0f0f0;
  background: #fff;
  color: #1f1f1f;
  transition:
    flex-basis 180ms ease,
    padding 180ms ease;
}

.sidebar--closed {
  flex-basis: 0;
  padding-right: 0;
  padding-left: 0;
}

.sidebar-backdrop {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 248px;
  padding: 0 8px 20px;
  gap: 11px;
  -webkit-app-region: drag;
  user-select: none;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #1677ff;
  border-radius: 8px;
  background: #e6f4ff;
  color: #1677ff;
}

.brand__mark img {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
}

.brand__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__copy strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand__copy span {
  color: #8c8c8c;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-switcher {
  position: relative;
  min-width: 248px;
  margin-bottom: 11px;
}

.project-switcher__row {
  display: grid;
  align-items: center;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.project-switcher select {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fafafa;
  color: #1f1f1f;
  font-size: 10px;
}

.project-create-backdrop {
  position: fixed;
  z-index: 80;
  display: grid;
  padding: 16px;
  background: rgb(0 0 0 / 38%);
  inset: 0;
  place-items: center;
}

.project-create-card {
  position: relative;
  display: flex;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 14px;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 12px 36px rgb(0 0 0 / 14%);
  flex-direction: column;
  gap: 10px;
}

.project-create-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-create-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.project-create-card label > span {
  color: #595959;
  font-size: 9px;
  font-weight: 650;
}

.project-create-card input,
.project-create-card textarea,
.project-create-card select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
  resize: vertical;
}

.project-create-card__path {
  display: flex;
  gap: 6px;
}

.project-create-card__path input {
  min-width: 0;
  flex: 1;
}

.project-create-card__path button {
  padding: 0 10px;
}

.project-create-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.project-create-card__actions button {
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-create-card__error {
  margin: 0;
  color: #ff4d4f;
  font-size: 9px;
}

.project-danger-zone {
  display: flex;
  padding: var(--space-3);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-control);
  background: var(--danger-subtle);
  flex-direction: column;
  gap: var(--space-3);
}

.project-danger-zone > div:first-child {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.project-danger-zone strong {
  color: var(--danger);
  font-size: var(--font-body);
}

.project-danger-zone p,
.project-danger-zone small {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  line-height: 1.5;
}

.project-danger-zone > .danger-button {
  align-self: flex-start;
}

.project-delete-confirmation {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-delete-confirmation > div {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.project-delete-confirmation .danger-button,
.project-delete-confirmation .secondary-button {
  align-self: auto;
}

.new-chat {
  display: flex;
  min-width: 248px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #1677ff;
  border-radius: 8px;
  margin-bottom: 11px;
  background: #1677ff;
  color: #fff;
  cursor: pointer;
  gap: 9px;
  text-align: left;
}

.new-chat:hover {
  border-color: #4096ff;
  background: #4096ff;
}

.new-chat span {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.new-chat kbd {
  padding: 2px 5px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 5px;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font-size: 9px;
}

.sidebar-search {
  display: flex;
  min-width: 248px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid #d9d9d9;
  border-radius: 9px;
  margin-bottom: 15px;
  background: #fafafa;
  color: #8c8c8c;
  gap: 8px;
}

.sidebar-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f1f1f;
  font-size: 12px;
}

.sidebar-search input::placeholder {
  color: #8c8c8c;
}

.primary-nav {
  display: flex;
  min-width: 248px;
  flex-direction: column;
  padding-bottom: 13px;
  border-bottom: 1px solid #f0f0f0;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  color: #595959;
  cursor: pointer;
  gap: 10px;
  text-align: left;
}

.nav-item:hover,
.nav-item--active {
  background: #e6f4ff;
  color: #1677ff;
}

.nav-item span:nth-child(2) {
  flex: 1;
  font-size: 12px;
  font-weight: 550;
}

.nav-item__hint {
  color: #8c8c8c;
  font-size: 9px;
}

.nav-item__badge {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  place-items: center;
}

.conversation-list {
  min-width: 248px;
  flex: 1;
  padding-top: 14px;
  overflow: auto;
}

.conversation-entry + .conversation-entry {
  margin-top: var(--space-1);
}

.section-label {
  padding: 0 9px;
  margin: 0 0 7px;
  color: #8c8c8c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.conversation-item {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  color: #595959;
  cursor: pointer;
  gap: 8px;
  text-align: left;
}

.conversation-item:hover,
.conversation-item--active {
  background: #e6f4ff;
  color: #1677ff;
}

.conversation-item span {
  flex: 1;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item small {
  color: #8c8c8c;
  font-size: 9px;
}

.conversation-source-badge {
  display: inline-flex;
  margin-right: var(--space-1);
  padding: 1px var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--font-caption);
  font-weight: 600;
  line-height: 1.4;
  vertical-align: 1px;
}

.conversation-unread {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: var(--space-1);
  border-radius: 50%;
  background: var(--accent-solid);
  vertical-align: 1px;
}

.sidebar-footer {
  min-width: 248px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.user-card {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: transparent;
  color: #595959;
  cursor: pointer;
  gap: 9px;
  text-align: left;
}

.user-card:hover {
  background: #fafafa;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #e6f4ff;
  color: #1677ff;
  font-size: 10px;
  font-weight: 800;
}

.user-card__copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.user-card__copy strong {
  color: #1f1f1f;
  font-size: 11px;
}

.user-card__copy small {
  color: #8c8c8c;
  font-size: 9px;
}

.workspace {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-rows: 58px minmax(0, 1fr) auto;
}

.topbar {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 0 0 0 21px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  gap: 3px;
  -webkit-app-region: drag;
  user-select: none;
}

.topbar :is(button, input, select),
.topbar__actions,
.window-controls {
  -webkit-app-region: no-drag;
}

.window-controls {
  display: flex;
  height: 100%;
  flex: 0 0 auto;
  align-self: stretch;
  margin-left: 8px;
}

.window-control {
  display: grid;
  width: 46px;
  min-width: 46px;
  height: 100%;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--motion-fast, 120ms) ease-out,
    color var(--motion-fast, 120ms) ease-out;
}

.window-control:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.window-control--close:hover {
  background: var(--danger-solid);
  color: var(--text-on-accent);
}

.window-control:focus-visible {
  outline-offset: -2px;
}

button > svg,
button > svg * {
  pointer-events: none;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.icon-button--active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.assistant-sidebar {
  position: relative;
  display: flex;
  width: 0;
  flex: 0 0 0;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-left: 0 solid #f0f0f0;
  background: #fff;
  opacity: 0;
  transition:
    width 180ms ease,
    flex-basis 180ms ease,
    opacity 120ms ease;
}

.assistant-sidebar--open {
  width: var(--assistant-sidebar-width, 350px);
  flex-basis: var(--assistant-sidebar-width, 350px);
  border-left-width: 1px;
  opacity: 1;
}

.assistant-sidebar--resizing {
  transition: none;
}

.assistant-sidebar__resize-handle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: -5px;
  display: none;
  width: 10px;
  padding: 0;
  cursor: col-resize;
  touch-action: none;
}

.assistant-sidebar--open > .assistant-sidebar__resize-handle {
  display: block;
}

.assistant-sidebar__resize-handle::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  content: '';
  transition: background var(--motion-fast, 120ms) ease-out;
}

.assistant-sidebar__resize-handle:hover::after,
.assistant-sidebar__resize-handle:focus-visible::after,
.assistant-sidebar--resizing > .assistant-sidebar__resize-handle::after {
  background: var(--accent);
}

.assistant-sidebar__resize-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.assistant-sidebar__header {
  display: flex;
  height: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid #f0f0f0;
}

.assistant-sidebar__header strong {
  font-size: 13px;
}

.assistant-sidebar__tabs {
  display: grid;
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  gap: 3px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.assistant-sidebar__tab {
  position: relative;
  padding: 7px 2px;
  border-radius: 7px;
  background: transparent;
  color: #8c8c8c;
  cursor: pointer;
  font-size: 10px;
}

.assistant-sidebar__tab:hover,
.assistant-sidebar__tab--active {
  background: #e6f4ff;
  color: #1677ff;
}

.assistant-sidebar__badge {
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  place-items: center;
  border-radius: 8px;
  background: var(--danger-solid);
  color: var(--text-on-accent);
  font-size: 8px;
}

.assistant-sidebar__body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.assistant-sidebar__section {
  display: flex;
  padding: 14px;
  flex-direction: column;
  gap: 8px;
}

.assistant-sidebar__section-description {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  margin: 0;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--font-caption);
  line-height: 1.6;
}

.assistant-sidebar__section h3 {
  display: flex;
  align-items: center;
  margin: 8px 0 2px;
  color: #595959;
  font-size: 11px;
  gap: 6px;
}

.assistant-sidebar__section h3 .icon-button {
  width: 26px;
  height: 26px;
  margin-left: auto;
}

.assistant-sidebar__diff {
  max-height: 420px;
  padding: 10px;
  overflow: auto;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin: 0;
  background: #fafafa;
  color: #3d3d3d;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-sidebar__diff-details {
  color: var(--text-secondary);
  font-size: var(--font-caption);
}

.assistant-sidebar__diff-details summary {
  padding: var(--space-2) 0;
  cursor: pointer;
}

.workspace-files {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-2);
}

.workspace-files__heading,
.workspace-files__changed > strong {
  color: var(--text-secondary);
  font-size: var(--font-caption);
}

.workspace-files__changed {
  display: flex;
  min-width: 0;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  flex-direction: column;
  gap: var(--space-1);
}

.workspace-files__changed-row,
.workspace-files__row {
  display: grid;
  width: 100%;
  min-height: 32px;
  align-items: center;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-caption);
  gap: var(--space-2);
  text-align: left;
}

.workspace-files__changed-row {
  padding: var(--space-2);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.workspace-files__row {
  padding: var(--space-2);
  padding-right: 38px;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.workspace-files__entry {
  position: relative;
}

.workspace-files__open-entry {
  position: absolute;
  top: 50%;
  right: var(--space-1);
  display: grid;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    opacity var(--motion-fast) ease-out,
    background var(--motion-fast) ease-out,
    color var(--motion-fast) ease-out;
}

.workspace-files__entry:hover .workspace-files__open-entry,
.workspace-files__entry:focus-within .workspace-files__open-entry {
  opacity: 1;
  pointer-events: auto;
}

.workspace-files__open-entry:hover {
  background: var(--accent-selected);
  color: var(--accent);
}

.workspace-files__changed-row:hover:not(:disabled),
.workspace-files__row:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.workspace-files__changed-row:disabled {
  cursor: default;
  opacity: 0.62;
}

.workspace-files__changed-row span,
.workspace-files__row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-files__changed-row small,
.workspace-files__change {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.workspace-files__tree {
  min-width: 0;
}

.workspace-files__children {
  margin-left: var(--space-4);
}

.workspace-files__indent {
  width: 13px;
}

.workspace-files__status,
.workspace-files__error {
  padding: var(--space-1) var(--space-2);
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-caption);
  line-height: 1.5;
}

.workspace-files__error {
  color: var(--danger);
}

.assistant-sidebar__row {
  display: grid;
  width: 100%;
  align-items: center;
  padding: 10px;
  border: 1px solid #f0f0f0;
  border-radius: 9px;
  background: #fafafa;
  color: #595959;
  cursor: pointer;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  text-align: left;
}

.assistant-sidebar__row:hover {
  border-color: #91caff;
  background: #e6f4ff;
}

.assistant-sidebar__row span,
.assistant-sidebar__context span,
.assistant-sidebar__library {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.assistant-sidebar__row strong,
.assistant-sidebar__context strong,
.assistant-sidebar__library strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-sidebar__row small,
.assistant-sidebar__context small,
.assistant-sidebar__library small {
  overflow: hidden;
  color: #8c8c8c;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-sidebar__approval {
  padding: 11px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-control);
  background: var(--danger-subtle);
}

.assistant-sidebar__approval strong {
  display: block;
  font-size: 11px;
}

.assistant-sidebar__approval p {
  margin: 5px 0;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.45;
}

.assistant-sidebar__approval code {
  color: var(--danger);
  font-size: 9px;
}

.assistant-sidebar__approval-actions {
  display: flex;
  margin-top: 9px;
  gap: 6px;
}

.assistant-sidebar__approval-actions button {
  flex: 1;
  padding: 7px 5px;
  font-size: 9px;
}

.assistant-sidebar__context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border: 1px solid #f0f0f0;
  border-radius: 9px;
  gap: 8px;
}

.assistant-sidebar__library {
  padding: 9px 10px;
  border: 1px solid #f0f0f0;
  border-radius: 9px;
  background: #fafafa;
}

.assistant-sidebar__memory {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 9px 10px;
  border: 1px solid #d6e4ff;
  border-radius: 9px;
  background: #f0f5ff;
  color: #2f54eb;
  font-size: 10px;
  gap: 8px;
  line-height: 1.45;
}

.assistant-sidebar__memory > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.assistant-sidebar__memory > span small {
  color: #d46b08;
  font-size: 8px;
}

.assistant-sidebar__schedule-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assistant-sidebar__schedule-form input,
.assistant-sidebar__schedule-form textarea,
.assistant-sidebar__schedule-form select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 9px;
  resize: vertical;
}

.assistant-sidebar__schedule {
  padding: 9px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
}

.assistant-sidebar__schedule > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.assistant-sidebar__schedule strong {
  font-size: 10px;
}

.assistant-sidebar__schedule small {
  color: var(--text-muted);
  font-size: 8px;
}

.assistant-sidebar__schedule > div {
  display: flex;
  margin-top: 7px;
  gap: 8px;
}

.assistant-sidebar__schedule button {
  padding: 3px 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 8px;
}

.heartbeat-settings {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 13px;
  container: heartbeat-settings / inline-size;
}

.heartbeat-settings__intro h3 {
  display: flex;
  align-items: center;
  margin: 0;
  color: #1f1f1f;
  font-size: 13px;
  gap: 7px;
}

.heartbeat-settings__intro p,
.heartbeat-settings__empty {
  margin: 5px 0 0;
  color: #8c8c8c;
  font-size: 10px;
  line-height: 1.5;
}

.heartbeat-settings__error {
  margin: 0;
  color: #cf1322;
  font-size: 10px;
  line-height: 1.5;
}

.heartbeat-settings__form {
  display: grid;
  align-items: end;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 9px;
}

.heartbeat-settings__form--weekly {
  grid-template-columns:
    minmax(100px, 1fr) minmax(100px, 1fr)
    minmax(120px, 1fr) auto;
}

.heartbeat-settings__form input,
.heartbeat-settings__form select {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

.heartbeat-settings__form .primary-button {
  min-height: 34px;
  white-space: nowrap;
}

.heartbeat-settings__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.heartbeat-settings__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border: 1px solid #d9d9d9;
  border-radius: 9px;
  background: #fff;
  gap: 12px;
}

.heartbeat-settings__item > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.heartbeat-settings__item strong {
  font-size: 11px;
}

.heartbeat-settings__item small {
  color: #8c8c8c;
  font-size: 9px;
}

.heartbeat-settings__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.heartbeat-settings__actions button {
  min-width: 40px;
  min-height: 28px;
  padding: 4px 0;
  background: transparent;
  color: #1677ff;
  cursor: pointer;
  font-size: 9px;
}

.heartbeat-settings--sidebar {
  gap: 8px;
}

.heartbeat-settings--sidebar .heartbeat-settings__intro h3 {
  font-size: 10px;
}

.heartbeat-settings--sidebar .heartbeat-settings__intro p,
.heartbeat-settings--sidebar .heartbeat-settings__empty {
  font-size: 8px;
}

.heartbeat-settings--sidebar .heartbeat-settings__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.heartbeat-settings--sidebar .heartbeat-settings__form input,
.heartbeat-settings--sidebar .heartbeat-settings__form select {
  min-height: 0;
  padding: 8px 9px;
  font-size: 9px;
}

.heartbeat-settings--sidebar .heartbeat-settings__item {
  display: block;
  padding: 9px 10px;
  background: #fafafa;
}

.heartbeat-settings--sidebar .heartbeat-settings__item strong {
  font-size: 10px;
}

.heartbeat-settings--sidebar .heartbeat-settings__item small,
.heartbeat-settings--sidebar .heartbeat-settings__actions button {
  font-size: 8px;
}

.heartbeat-settings--sidebar .heartbeat-settings__actions {
  margin-top: 7px;
}

.heartbeat-settings--sidebar .heartbeat-settings__actions button {
  min-width: 36px;
  min-height: 26px;
}

.assistant-sidebar__empty {
  padding: 16px 10px;
  margin: 0;
  border: 1px dashed #d9d9d9;
  border-radius: 9px;
  color: #8c8c8c;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.assistant-sidebar__preview {
  min-width: 0;
  padding: 16px;
}

.assistant-sidebar__browser {
  display: flex;
  min-width: 0;
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-3);
}

.assistant-sidebar__browser > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.assistant-sidebar__browser > header > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
}

.assistant-sidebar__browser-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.assistant-sidebar__browser > header .secondary-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  flex: none;
  font-size: 10px;
  gap: var(--space-1);
}

.assistant-sidebar__browser-status {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.5;
}

.assistant-sidebar__browser-status--failed {
  border-color: var(--danger-border);
  background: var(--danger-subtle);
  color: var(--danger);
}

.assistant-sidebar__browser-url {
  overflow: hidden;
  color: var(--text-muted);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-sidebar__browser-frame,
.assistant-sidebar__browser-placeholder {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
}

.assistant-sidebar__browser-frame {
  display: block;
  height: auto;
}

.assistant-sidebar__browser-placeholder {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-direction: column;
  gap: var(--space-2);
  font-size: 10px;
}

.assistant-sidebar__preview > header {
  display: flex;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 12px;
  flex-direction: column;
  gap: var(--space-2);
}

.assistant-sidebar__preview > header > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.assistant-sidebar__back {
  display: flex;
  width: fit-content;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-caption);
  gap: var(--space-1);
}

.assistant-sidebar__back:hover {
  background: var(--surface-subtle);
  color: var(--accent);
}

.assistant-sidebar__preview > header strong {
  font-size: 12px;
}

.assistant-sidebar__preview > header small {
  color: #8c8c8c;
  font-size: 9px;
}

.assistant-sidebar__import {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 6px;
  font-size: 9px;
}

.assistant-sidebar__image-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.assistant-sidebar__web-preview {
  width: 100%;
  min-height: 480px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
}

.assistant-sidebar__preview pre {
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 9px;
  white-space: pre-wrap;
}

.conversation-title {
  display: flex;
  max-width: min(360px, 36vw);
  min-width: 0;
  align-items: center;
  padding: 7px 9px;
  border-radius: 8px;
  margin-left: 4px;
  background: transparent;
  color: #1f1f1f;
  flex: 0 1 auto;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
}

.conversation-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  min-width: 0;
  align-items: center;
  flex: 0 1 auto;
  margin-left: auto;
  gap: 3px;
}

.topbar-menu {
  position: relative;
}

.topbar-menu__popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 188px;
  padding: var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  gap: var(--space-1);
}

.topbar-menu__popover button {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-section-title);
  font-weight: 500;
  gap: var(--space-2);
  line-height: 1.4;
  text-align: left;
}

.topbar-menu__popover button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.topbar-menu__popover button:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.runtime-status {
  display: flex;
  min-width: 0;
  max-width: clamp(108px, 18vw, 220px);
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  margin-right: 8px;
  color: #595959;
  font-size: 10px;
  font-weight: 650;
  gap: 6px;
}

.runtime-status__dot {
  flex: 0 0 auto;
}

.runtime-status__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8c8c8c;
}

.runtime-status--online {
  color: #52c41a;
}

.runtime-status--online .runtime-status__dot {
  background: #52c41a;
}

.chat {
  min-height: 0;
  padding:
    var(--page-gutter)
    max(var(--page-gutter), calc((100% - var(--content-reading)) / 2))
    10px;
  overflow-y: auto;
  scrollbar-color: #d9d9d9 transparent;
  scrollbar-width: thin;
}

.welcome {
  padding: 26px 0 30px;
  text-align: center;
}

.welcome__badge {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #1677ff;
  border-radius: 8px;
  margin: 0 auto 14px;
  background: #e6f4ff;
  color: #1677ff;
}

.eyebrow {
  margin: 0 0 8px;
  color: #1677ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.welcome h1 {
  margin: 0;
  color: #1f1f1f;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.welcome__description {
  margin: 12px 0;
  color: #595959;
  font-size: 12px;
}

.quick-actions {
  display: grid;
  max-width: 720px;
  margin: 0 auto;
  gap: 10px;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(180px, 100%), 1fr)
  );
}

.quick-actions button {
  display: grid;
  min-height: 118px;
  padding: 15px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  gap: 5px;
  grid-template-rows: auto auto 1fr;
  text-align: left;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.quick-actions button:hover {
  border-color: #4096ff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
  transform: translateY(-2px);
}

.quick-actions__icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  margin-bottom: 4px;
  background: #e6f4ff;
  color: #1677ff;
}

.quick-actions strong {
  color: #1f1f1f;
  font-size: 11px;
}

.quick-actions small {
  color: #8c8c8c;
  font-size: 10px;
  line-height: 1.45;
}

.message-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
  gap: 4px;
}

.message {
  display: grid;
  padding: 17px 8px;
  border-top: 1px solid transparent;
  gap: 12px;
  grid-template-columns: 30px 1fr;
}

.message + .message {
  border-top-color: #f0f0f0;
}

.message--user {
  grid-template-columns: 1fr 30px;
}

.message__avatar {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 9px;
  background: #fff;
  color: #1677ff;
}

.message--user .message__avatar {
  grid-column: 2;
  grid-row: 1;
  border-color: #1677ff;
  background: #e6f4ff;
  color: #1677ff;
}

.message__body {
  min-width: 0;
}

.message--user .message__body {
  width: min(78%, 720px);
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.message__meta {
  display: flex;
  align-items: center;
  margin: 1px 0 8px;
  gap: 8px;
}

.message--user .message__meta {
  justify-content: flex-end;
}

.message-attachments {
  display: flex;
  max-width: 100%;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.message--user .message-attachments {
  justify-content: flex-end;
}

.message-attachment {
  display: flex;
  min-width: 0;
  max-width: min(100%, 320px);
  align-items: center;
  padding: var(--space-2);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  gap: var(--space-2);
}

.message-attachment--image {
  width: min(100%, 240px);
  flex: 1 1 180px;
  align-items: flex-end;
  flex-direction: column;
}

.message-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  cursor: zoom-in;
}

.message-image-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.message-attachment img {
  display: block;
  width: min(240px, 100%);
  max-height: 180px;
  align-self: stretch;
  border-radius: calc(var(--radius-control) - 2px);
  background: var(--surface-subtle);
  object-fit: contain;
}

.message-attachment__icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--accent-subtle);
  color: var(--accent);
}

.message-attachment__details {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-self: stretch;
  flex-direction: column;
  justify-content: center;
}

.message-attachment__details strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment__details small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.message-image-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.message-image-actions button {
  display: inline-flex;
  min-height: 28px;
  padding: var(--space-1) var(--space-2);
  align-items: center;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: var(--font-caption);
  gap: var(--space-1);
}

.message-image-actions button:hover {
  background: var(--accent-subtle);
}

.message__meta strong {
  color: #1f1f1f;
  font-size: 11px;
}

.message__meta span {
  color: #8c8c8c;
  font-size: 9px;
}

.markdown-content {
  color: #1f1f1f;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.message--user .message__content {
  padding: 9px 13px;
  border: 1px solid #bae0ff;
  border-radius: 14px 4px 14px 14px;
  background: #e6f4ff;
}

.message-reasoning {
  max-width: 100%;
  margin: 0 0 var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.message-reasoning > summary {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-size: var(--font-body);
  font-weight: 600;
  list-style-position: inside;
}

.message-reasoning > summary:hover {
  background: var(--surface-muted);
}

.message-reasoning > summary:focus-visible {
  border-radius: var(--radius-control);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.message-reasoning__content {
  max-height: 320px;
  padding: 0 var(--space-3) var(--space-3);
  overflow-y: auto;
  color: var(--text-secondary);
  font-size: var(--font-body);
}

.message-reasoning[open] > summary {
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.message-blocks {
  display: grid;
  gap: var(--space-3);
}

.message-blocks .message-reasoning,
.message-blocks .tool-execution-list {
  margin: 0;
}

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

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

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 1em 0 0.45em;
  line-height: 1.3;
}

.markdown-content h1 {
  font-size: 1.5em;
}

.markdown-content h2 {
  font-size: 1.3em;
}

.markdown-content h3 {
  font-size: 1.15em;
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote {
  margin: 0.65em 0;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 1.5em;
}

.markdown-content pre {
  padding: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 9px;
  overflow-x: auto;
  background: #1f1f1f;
  color: #f5f5f5;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre;
}

.markdown-content :not(pre) > code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #f5f5f5;
  color: #1677ff;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.markdown-table-scroll {
  max-width: 100%;
  margin: 0.8em 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.markdown-table-scroll:focus-visible {
  border-radius: 4px;
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

.markdown-content table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  margin: 0;
  font-size: 11px;
}

.markdown-content th,
.markdown-content td {
  padding: 7px 8px;
  border: 1px solid #d9d9d9;
  text-align: left;
}

.markdown-content blockquote {
  padding-left: 11px;
  border-left: 3px solid #1677ff;
  color: #595959;
}

.markdown-content a {
  color: #1677ff;
  text-decoration-thickness: 1px;
}

.markdown-content img {
  max-width: 100%;
}

.message-generated-image {
  max-width: 640px;
  margin: 10px 0 0;
}

.message-generated-image img {
  display: block;
  width: 100%;
  max-height: 640px;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #fafafa;
  object-fit: contain;
}

.message-generated-image figcaption {
  margin-top: 5px;
  color: #8c8c8c;
  font-size: 9px;
}

.message-generated-image > .message-image-actions {
  margin-top: var(--space-1);
}

.message__status {
  display: flex;
  align-items: flex-start;
  margin-top: 8px;
  color: #8c8c8c;
  font-size: 10px;
  gap: 7px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message__status--error {
  color: #ff4d4f;
}

.message__status-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: currentColor;
}

.message__status-dot--active {
  animation: pulse 1.1s ease-in-out infinite;
  background: var(--accent-solid);
}

.tool-execution-list {
  display: grid;
  margin-top: var(--space-2);
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.tool-execution-list__header {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: var(--space-2) var(--space-3);
  gap: var(--space-2);
}

.tool-execution-list__header strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.tool-execution-list__header small {
  margin-left: auto;
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.tool-execution-list > ol {
  display: grid;
  padding: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 0;
  list-style: none;
}

.tool-execution-list > ol > li + li {
  border-top: 1px solid var(--border-subtle);
}

.tool-execution > summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  gap: var(--space-3);
  list-style-position: inside;
  transition: background var(--motion-fast) ease-out;
}

.tool-execution > summary:hover {
  background: var(--accent-subtle);
}

.tool-execution > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tool-execution__identity {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: var(--space-1);
}

.tool-execution__identity strong {
  color: var(--text-primary);
  font-family: var(--font-family-mono);
  font-size: var(--font-body);
  overflow-wrap: anywhere;
}

.tool-execution__identity > span {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.tool-execution > summary small {
  color: var(--text-muted);
  font-size: var(--font-caption);
  white-space: nowrap;
}

.tool-execution--failed > summary small,
.tool-execution--recoverable > summary small {
  color: var(--danger);
}

.tool-execution__details {
  display: grid;
  padding: 0 var(--space-3) var(--space-3);
  gap: var(--space-3);
}

.tool-execution__details section {
  display: grid;
  gap: var(--space-2);
}

.tool-execution__details strong {
  color: var(--text-secondary);
  font-size: var(--font-caption);
}

.tool-execution__details pre {
  max-height: 320px;
  padding: var(--space-3);
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  margin: 0;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: var(--font-family-mono);
  font-size: var(--font-caption);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.tool-execution__details p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.tool-execution__error pre {
  border-color: var(--danger-border);
  color: var(--danger);
}

.subagent-status-list {
  display: grid;
  margin-top: var(--space-2);
  gap: var(--space-2);
}

.subagent-status-card {
  display: grid;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  gap: var(--space-2);
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.subagent-status-card--running {
  border-color: var(--accent-selected);
}

.subagent-status-card--failed,
.subagent-status-card--cancelled {
  border-color: var(--danger-border);
  background: var(--danger-subtle);
}

.subagent-status-card > div {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
}

.subagent-status-card strong,
.subagent-status-card span {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.subagent-status-card small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.subagent-status-card p {
  margin: 0;
  color: var(--danger);
  font-size: var(--font-caption);
  overflow-wrap: anywhere;
}

.approval-card {
  display: grid;
  align-items: center;
  padding: 12px;
  border: 1px solid #faad14;
  border-radius: 8px;
  margin-top: 10px;
  background: #fafafa;
  color: #faad14;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) repeat(4, auto);
}

.approval-card > div {
  min-width: 0;
}

.approval-card strong {
  display: block;
  color: #1f1f1f;
  font-size: 11px;
}

.approval-card p {
  margin: 3px 0 0;
  color: #595959;
  font-size: 9px;
  line-height: 1.5;
}

.approval-card code {
  display: block;
  max-width: 420px;
  margin-top: 6px;
  overflow: hidden;
  color: #434343;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-card button {
  min-height: 29px;
  padding: 0 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.approval-card__deny {
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #595959;
}

.approval-card__allow {
  background: #1677ff;
  color: #fff;
}

.agent-question-card {
  display: flex;
  padding: var(--space-4);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-card);
  margin-top: var(--space-3);
  background: var(--surface-raised);
  color: var(--text-primary);
  flex-direction: column;
  gap: var(--space-3);
}

.agent-question-card > header,
.agent-question-card > footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.agent-question-card > header {
  color: var(--accent);
}

.agent-question-card > footer {
  justify-content: flex-end;
}

.agent-question-card fieldset {
  display: flex;
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  margin: 0;
  flex-direction: column;
  gap: var(--space-2);
}

.agent-question-card legend {
  padding: 0 var(--space-1);
  color: var(--text-primary);
  font-size: var(--font-body);
  line-height: 1.5;
}

.agent-question-card legend span {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-caption);
  font-weight: 650;
}

.agent-question-card fieldset > label {
  display: flex;
  align-items: flex-start;
  color: var(--text-secondary);
  cursor: pointer;
  gap: var(--space-2);
}

.agent-question-card fieldset > label > span {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.agent-question-card fieldset > label strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.agent-question-card fieldset > label small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.agent-question-card__custom {
  flex-direction: column;
}

.agent-question-card__custom input {
  width: 100%;
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.agent-question-card__error {
  margin: 0;
  color: var(--danger);
  font-size: var(--font-caption);
}

.composer-wrap {
  padding:
    var(--space-3)
    max(var(--page-gutter), calc((100% - var(--content-reading)) / 2))
    var(--space-4);
  background: var(--surface-canvas);
}

.composer {
  padding: 0;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  transition:
    border-color var(--motion-fast, 120ms) ease-out,
    box-shadow var(--motion-fast, 120ms) ease-out;
}

.context-list {
  display: flex;
  padding: var(--space-3) var(--space-4) 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.context-chip {
  display: flex;
  min-width: 150px;
  max-width: 220px;
  align-items: center;
  padding: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  gap: var(--space-2);
}

.context-chip > span {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.context-chip strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-chip small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.context-chip button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.context-chip button:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

.window-capture-backdrop {
  position: fixed;
  z-index: 70;
  display: grid;
  padding: var(--space-4);
  background: var(--overlay-backdrop);
  inset: 38px 0 0;
  place-items: center;
}

.image-viewer-backdrop {
  position: fixed;
  z-index: 80;
  display: grid;
  padding: var(--space-4);
  background: var(--overlay-backdrop);
  inset: 38px 0 0;
  place-items: center;
}

.image-viewer-dialog {
  display: grid;
  width: min(1120px, 100%);
  max-height: calc(100vh - 70px);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  gap: var(--space-3);
}

.image-viewer-dialog__header,
.image-viewer-dialog__header > div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.image-viewer-dialog__header {
  min-width: 0;
  justify-content: space-between;
}

.image-viewer-dialog__header > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-section-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-dialog__header .secondary-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.image-viewer-dialog__content {
  display: grid;
  min-height: 0;
  overflow: auto;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  place-items: center;
}

.image-viewer-dialog__content img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
}

.window-capture-dialog {
  display: grid;
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 70px));
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  gap: var(--space-3);
}

.window-capture-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.window-capture-dialog__header > div {
  display: grid;
  gap: var(--space-1);
}

.window-capture-dialog__header strong {
  color: var(--text-primary);
  font-size: var(--font-section-title);
}

.window-capture-dialog__header small {
  color: var(--text-secondary);
  font-size: var(--font-body);
}

.window-capture-dialog__list {
  display: grid;
  min-height: 0;
  padding: var(--space-1);
  overflow-y: auto;
  gap: var(--space-2);
}

.window-capture-dialog__list > button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  color: var(--text-primary);
  cursor: pointer;
  gap: var(--space-2);
  text-align: left;
}

.window-capture-dialog__list > button:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.window-capture-dialog__list > button span {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.composer__input {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-radius: calc(var(--radius-card) - 1px)
    calc(var(--radius-card) - 1px) 0 0;
  background: var(--surface-raised);
}

.context-list + .composer__input {
  padding-top: var(--space-3);
}

.composer__input textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  max-height: 220px;
  padding: 0;
  border: 0;
  overflow-y: auto;
  outline: 0;
  resize: none;
  background: transparent !important;
  color: var(--text-primary);
  font-size: var(--font-body);
  line-height: 1.6;
}

.composer__input textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.composer__toolbar {
  display: flex;
  min-width: 0;
  min-height: 56px;
  padding: 10px var(--space-3);
  align-items: center;
  border-top: 1px solid var(--border-default);
  border-radius: 0 0 calc(var(--radius-card) - 1px)
    calc(var(--radius-card) - 1px);
  background: var(--surface-subtle);
  gap: var(--space-3);
}

.composer__controls {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.composer__tool-group,
.composer__configuration {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.composer__tool-group {
  gap: 2px;
}

.composer__tool-group button,
.knowledge-scope > button {
  display: grid;
  min-width: 32px;
  height: 32px;
  align-items: center;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  place-items: center;
  transition:
    background var(--motion-fast, 120ms) ease-out,
    border-color var(--motion-fast, 120ms) ease-out,
    color var(--motion-fast, 120ms) ease-out;
}

.composer__tool-group button:hover,
.knowledge-scope > button:hover {
  border-color: var(--accent-selected);
  background: var(--accent-subtle);
  color: var(--accent);
}

.composer__tool-group button:disabled,
.knowledge-scope > button:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: default;
  opacity: 0.55;
}

.composer__voice-button--recording {
  position: relative;
  border-color: var(--danger-border) !important;
  background: var(--danger-subtle) !important;
  color: var(--danger) !important;
}

.composer__voice-button--recording::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--danger);
  content: "";
  animation: composer-recording-pulse 1.4s ease-in-out infinite;
}

.composer__voice-button--processing {
  border-color: var(--accent-selected) !important;
  background: var(--accent-subtle) !important;
  color: var(--accent) !important;
}

.composer__configuration {
  min-width: 0;
  padding-left: var(--space-3);
  border-left: 1px solid var(--border-default);
}

.composer__expert,
.composer__mode {
  display: flex;
  height: 34px;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-secondary);
  gap: var(--space-1);
  user-select: none;
}

.composer__expert {
  width: 124px;
  padding-left: var(--space-2);
}

.composer__expert svg,
.composer__mode svg {
  flex: 0 0 auto;
}

.composer__expert select,
.composer__mode select {
  min-width: 0;
  height: 100%;
  padding: 0 var(--space-2) 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: var(--font-caption);
  user-select: none;
}

.composer__expert select {
  width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer__expert:focus-within,
.composer__mode:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.composer__mode {
  width: 144px;
  padding-left: var(--space-2);
  color: var(--text-primary);
}

.composer__mode select {
  width: 116px;
  font-weight: 600;
}

.composer__mode--ask svg {
  color: var(--accent);
}

.composer__mode--execute {
  border-color: var(--border-default);
}

.composer__mode--execute svg {
  color: var(--warning);
}

.model-button {
  display: flex;
  width: 160px;
  height: 34px;
  min-width: 0;
  align-items: center;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 600;
  gap: var(--space-1);
  user-select: none;
}

.model-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.model-button:disabled {
  border-color: var(--border-default);
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: default;
}

.model-button__label {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-picker {
  position: relative;
  min-width: 0;
}

.runtime-picker__menu {
  position: absolute;
  z-index: 25;
  right: 0;
  bottom: calc(100% + var(--space-2));
  display: flex;
  width: 300px;
  max-height: min(420px, 60vh);
  flex-direction: column;
  padding: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow-y: auto;
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  gap: var(--space-1);
}

.runtime-picker__menu > strong {
  padding: var(--space-2) var(--space-2) var(--space-1);
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.runtime-picker__menu > button {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 44px;
  align-items: center;
  padding: var(--space-2);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  cursor: pointer;
  gap: var(--space-1) var(--space-2);
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: left;
}

.runtime-picker__menu > button:hover,
.runtime-picker__menu > button[aria-checked="true"] {
  background: var(--accent-subtle);
  color: var(--accent);
}

.runtime-picker__menu > button[aria-checked="true"]::after {
  content: "✓";
  font-weight: 700;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.runtime-picker__menu > button > span {
  display: flex;
  min-width: 0;
  align-items: center;
  font-size: var(--font-body);
  font-weight: 650;
  gap: var(--space-1);
}

.runtime-picker__menu > button > small {
  grid-column: 1;
  grid-row: 2;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-picker__menu > button.runtime-picker__back {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
}

.runtime-picker__chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.runtime-picker__divider {
  height: 1px;
  margin: var(--space-1);
  background: var(--border-subtle);
}

.send-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--accent-solid);
  color: var(--text-on-accent);
  cursor: pointer;
}

.send-button:hover {
  background: var(--accent-solid-hover);
}

.send-button:disabled {
  border: 1px solid var(--border-default);
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: default;
  box-shadow: none;
}

.send-button--stop {
  background: var(--danger-solid);
}

.composer-hint {
  display: flex;
  margin: var(--space-2) 0 0;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  line-height: 1.45;
  text-align: center;
}

.composer-hint--error {
  color: var(--danger);
}

.composer-hint__shortcut {
  color: var(--text-muted);
  white-space: nowrap;
}

.composer-hint kbd {
  padding: 1px var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-family: var(--font-family-mono);
  font-size: 10px;
}

@container (max-width: 700px) {
  .composer__configuration {
    width: 100%;
    padding-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border-default);
    border-left: 0;
  }

  .composer__expert,
  .composer__mode,
  .runtime-picker {
    flex: 1 1 150px;
  }

  .composer__expert,
  .composer__mode,
  .model-button {
    width: 100%;
  }

  .composer__expert select,
  .composer__mode select {
    width: 100%;
  }
}

.settings-backdrop {
  position: fixed;
  z-index: 50;
  display: grid;
  background: rgb(0 0 0 / 45%);
  inset: 0;
  place-items: center;
}

.settings-page {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f7f8fa;
}

.settings-panel {
  display: grid;
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgb(0 0 0 / 8%);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.settings-page .settings-panel {
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.settings-panel__header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f0f0f0;
}

.settings-panel__header > div {
  flex: 1;
}

.settings-panel__header .page-header {
  position: relative;
  width: 100%;
}

.settings-panel__header .page-header__content {
  padding-right: 44px;
}

.settings-panel__header
  .page-header:not(.page-header--compact)
  .page-header__actions {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  justify-content: flex-end;
}

.settings-panel__header .eyebrow {
  margin-bottom: 5px;
}

.settings-panel__header h2 {
  margin: 0;
  color: #1f1f1f;
  font-size: 22px;
  font-weight: 500;
}

.settings-panel__description {
  margin: 6px 0 0;
  color: #8c8c8c;
  font-size: 10px;
}

.settings-panel__body {
  display: flex;
  flex-direction: column;
  padding: 20px 24px 26px;
  overflow-y: auto;
  gap: 18px;
}

.settings-panel__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.settings-tabs {
  display: grid;
  padding: 3px;
  border-radius: 9px;
  background: #f5f5f5;
  grid-template-columns: repeat(10, 1fr);
}

.settings-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 34px;
  border-radius: 7px;
  background: transparent;
  color: #595959;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.settings-tabs button strong {
  font-size: 11px;
}

.settings-tabs button small {
  display: none;
  color: #8c8c8c;
  font-size: 9px;
  font-weight: 400;
}

.settings-page .settings-panel__body {
  display: grid;
  min-height: 0;
  padding: 24px 32px 32px;
  overflow: hidden;
  align-items: stretch;
  grid-template-columns: 190px minmax(0, 760px);
  justify-content: start;
  gap: 28px;
}

.platform-feature-option {
  display: grid;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  gap: var(--space-2);
}

.platform-feature-option > span {
  font-size: var(--font-body);
  font-weight: 600;
}

.platform-feature-option > small {
  color: var(--text-muted);
  font-size: var(--font-caption);
  line-height: 1.6;
}

.settings-page .settings-tabs {
  display: flex;
  min-height: 0;
  max-height: 100%;
  padding: 6px;
  overflow-y: auto;
  align-self: stretch;
  flex-direction: column;
  grid-template-columns: none;
  scrollbar-gutter: stable;
}

.settings-page .settings-panel__content {
  min-height: 0;
  padding-right: var(--space-1);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.settings-page .settings-tabs button {
  min-height: 58px;
  padding: 10px 12px;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}

.settings-page .settings-tabs button small {
  display: block;
  margin-top: 3px;
}

.settings-page .settings-tabs button[aria-selected='true'] {
  background: #eaf3ff;
  box-shadow: none;
}

.settings-tabs button[aria-selected='true'] {
  background: #fff;
  color: #1677ff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 8%);
}

.settings-section {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background: #fafafa;
  gap: 13px;
}

.settings-section__title {
  display: flex;
  align-items: center;
  color: #1677ff;
  gap: 9px;
}

.settings-section__title > div {
  display: flex;
  flex-direction: column;
}

.settings-section__title--actions > div {
  flex: 1;
}

.settings-section__title--actions .secondary-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: #1677ff;
  gap: 5px;
}

.settings-section__title strong {
  color: #1f1f1f;
  font-size: 12px;
}

.settings-section__title small {
  color: #8c8c8c;
  font-size: 9px;
}

.model-capability-badge,
.runtime-capability-badge {
  padding: 2px 7px;
  border: 1px solid #ffd591;
  border-radius: 999px;
  background: #fff7e6;
  color: #ad4e00;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.model-type-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.model-type-navigation > small {
  color: var(--text-muted);
  font-size: var(--font-caption);
  line-height: 1.5;
}

.agent-runtime-navigation {
  display: grid;
  align-items: center;
  grid-template-columns: max-content minmax(0, 1fr);
}

.agent-runtime-navigation > small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.runtime-note {
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: var(--font-body);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.runtime-note strong {
  color: var(--text-primary);
  font-size: inherit;
  font-weight: 650;
}

.runtime-source-options {
  display: grid;
  min-width: 0;
  margin: 0 var(--space-4);
  padding: 0;
  border: 0;
  gap: var(--space-2);
}

.runtime-source-options legend {
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: var(--font-body);
  font-weight: 650;
}

.runtime-source-options label {
  display: grid;
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  cursor: pointer;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
}

.runtime-source-options label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-selected);
}

.runtime-source-options label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.65;
}

.runtime-source-options input {
  margin-top: 2px;
}

.runtime-source-options label > span,
.runtime-config-card > div:first-child {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
}

.runtime-source-options strong,
.runtime-config-card strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.runtime-source-options small,
.runtime-config-card small {
  color: var(--text-muted);
  font-size: var(--font-caption);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.runtime-config-card {
  display: grid;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  gap: var(--space-3);
}

.runtime-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.runtime-config-card__hint {
  color: var(--text-secondary) !important;
}

details.settings-section {
  padding: 0;
  gap: 0;
}

details.settings-section > summary {
  padding: var(--space-4);
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--font-body);
  font-weight: 650;
  line-height: 1.4;
}

details.settings-section[open] {
  padding-bottom: var(--space-4);
}

details.settings-section[open] > summary {
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

details.settings-section > :not(summary) {
  margin-right: var(--space-4);
  margin-left: var(--space-4);
}

details.settings-section > :not(summary) + :not(summary) {
  margin-top: var(--space-3);
}

.model-connection-manager {
  display: grid;
  min-width: 0;
  align-items: start;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: var(--space-4);
}

.model-connection-list,
.model-connection-detail {
  min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.model-connection-list {
  overflow: hidden;
}

.model-connection-list__header {
  display: flex;
  min-height: 40px;
  padding: 0 var(--space-3);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: var(--font-body);
}

.model-connection-list__header > span {
  display: inline-flex;
  min-width: 22px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: var(--font-caption);
}

.model-connection-list > [role='list'] {
  max-height: 480px;
  overflow-y: auto;
}

.model-connection-list [role='listitem'] + [role='listitem'] {
  border-top: 1px solid var(--border-subtle);
}

.model-connection-list button {
  display: flex;
  width: 100%;
  min-height: 58px;
  padding: var(--space-2) var(--space-3);
  align-items: center;
  justify-content: space-between;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  gap: var(--space-2);
}

.model-connection-list button:hover {
  background: var(--surface-subtle);
}

.model-connection-list button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.model-connection-list button[aria-current='page'] {
  background: var(--accent-subtle);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--accent);
}

.model-connection-list__name {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
}

.model-connection-list__name strong,
.model-connection-list__name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-connection-list__name strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.model-connection-list__name small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.model-connection-list__badges {
  display: flex;
  flex-shrink: 0;
  align-items: flex-end;
  flex-direction: column;
  gap: var(--space-1);
}

.model-connection-list__badges > span {
  padding: 2px var(--space-1);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: var(--font-caption);
  line-height: 1.4;
}

.model-connection-detail {
  display: flex;
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-3);
}

.model-connection-detail > .settings-section__title {
  min-height: 32px;
  flex-wrap: wrap;
}

.model-connection-detail > .settings-section__title > div:first-child {
  min-width: 120px;
  flex: 1;
}

.model-connection-detail__compatibility {
  color: var(--text-muted);
  font-size: var(--font-caption);
  line-height: 1.5;
}

.role-prompt-detail__prompt {
  min-height: 240px;
  font-family: inherit;
  line-height: 1.6;
}

.field-error {
  color: var(--danger) !important;
}

.role-prompt-detail__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.role-prompt-detail__actions > .danger-button,
.role-prompt-detail__actions > .danger-confirm {
  margin-right: auto;
}

.role-prompt-detail__actions .primary-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.channel-settings__tabs {
  overflow-x: auto;
}

.channel-settings__tabs .page-tabs {
  min-width: max-content;
}

.channel-settings__panel {
  min-width: 0;
}

.channel-settings__panel > .channel-settings-card {
  width: 100%;
}

.channel-project-settings {
  display: grid;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  gap: var(--space-3);
}

.channel-project-settings__identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  gap: var(--space-2);
}

.channel-project-settings__identity strong {
  color: var(--text-primary);
}

.channel-project-settings__root,
.channel-binding-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.channel-project-settings__root input {
  min-width: 0;
  flex: 1;
}

.channel-project-settings__root .secondary-button,
.channel-binding-actions button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.channel-work-mode {
  display: grid;
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0;
  gap: var(--space-2);
}

.channel-work-mode legend {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

.channel-work-mode small {
  color: var(--text-muted);
}

.channel-project-settings__risk {
  padding: var(--space-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  margin: 0;
  background: var(--surface-subtle);
  color: var(--warning);
  font-size: var(--font-caption);
  line-height: 1.5;
}

.channel-qr-backdrop {
  position: fixed;
  z-index: var(--z-dialog);
  display: grid;
  padding: var(--space-4);
  background: var(--overlay-backdrop);
  inset: 38px 0 0;
  place-items: center;
}

.channel-qr-dialog {
  display: grid;
  width: min(460px, 100%);
  max-height: calc(100vh - 70px);
  padding: var(--space-6);
  overflow: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  gap: var(--space-4);
}

.channel-qr-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.channel-qr-dialog > header > div {
  display: grid;
  gap: var(--space-1);
}

.channel-qr-dialog > header small,
.channel-qr-dialog__content small {
  color: var(--text-muted);
}

.channel-qr-dialog__content,
.channel-qr-dialog__failure {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--space-3);
}

.channel-qr-dialog__content img,
.channel-qr-dialog__placeholder {
  width: min(280px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: white;
}

.channel-qr-dialog__placeholder {
  display: grid;
  color: var(--text-secondary);
  place-items: center;
}

.channel-verification-form {
  display: flex;
  align-items: end;
  gap: var(--space-3);
}

.channel-verification-form .field {
  min-width: 0;
  flex: 1;
}

.remote-conversation-notice {
  display: flex;
  width: min(100%, 820px);
  align-items: flex-start;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  gap: var(--space-3);
}

.remote-conversation-notice > div {
  display: grid;
  gap: var(--space-1);
}

.remote-conversation-notice strong {
  color: var(--text-primary);
}

.channel-settings-card > .secondary-button,
.channel-settings .settings-section__title--actions > .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.update-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.update-settings__actions button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.update-settings__result ul {
  display: grid;
  padding: 0;
  margin: 0;
  gap: var(--space-2);
  list-style: none;
}

.update-settings__result li {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.update-settings__result li code {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speech-model-settings__list {
  display: grid;
  gap: var(--space-3);
}

.speech-model-settings .settings-section__title--actions > button,
.speech-model-card__actions,
.speech-model-card__actions button {
  display: flex;
  align-items: center;
}

.speech-model-settings .settings-section__title--actions > button,
.speech-model-card__actions button {
  gap: var(--space-2);
}

.speech-model-card__actions {
  flex-wrap: wrap;
  gap: var(--space-2);
}

.speech-model-operation {
  display: grid;
  gap: var(--space-1);
}

.speech-model-operation progress {
  width: 100%;
}

.role-prompt-empty {
  min-height: 180px;
  padding: var(--space-6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.field {
  display: flex;
  flex-direction: column;
  color: #1f1f1f;
  gap: 7px;
}

.field > span {
  font-size: 11px;
  font-weight: 650;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #d9d9d9;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: #1f1f1f;
  font-size: 12px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgb(22 119 255 / 12%);
}

.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  background: #f5f5f5;
  color: #8c8c8c;
}

.field textarea {
  padding-top: 9px;
  padding-bottom: 9px;
  resize: vertical;
}

.field small {
  color: #8c8c8c;
  font-size: 9px;
  line-height: 1.45;
}

.credential-state {
  display: flex;
  align-items: center;
  color: #595959;
  font-size: 10px;
  gap: 7px;
}

.credential-state span {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.credential-state button {
  padding: 4px 7px;
  border-radius: 6px;
  background: transparent;
  color: #ff4d4f;
  cursor: pointer;
  font-size: 9px;
}

.credential-state button:hover {
  background: #fafafa;
}

.settings-warning {
  padding: 9px 10px;
  border: 1px solid #faad14;
  border-radius: 8px;
  margin: 0;
  background: #fafafa;
  color: #595959;
  font-size: 10px;
  line-height: 1.55;
}

.settings-notice,
.settings-empty {
  margin: 0;
  color: #8c8c8c;
  font-size: 10px;
  line-height: 1.55;
}

.capability-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capability-list--tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mcp-tool-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mcp-server-list {
  display: grid;
  gap: var(--space-2);
}

.mcp-server-card {
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.mcp-server-card__header {
  display: flex;
  align-items: center;
  padding-right: var(--space-3);
  gap: var(--space-2);
}

.mcp-server-card__toggle {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: var(--space-3);
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  flex: 1;
  gap: var(--space-3);
  text-align: left;
}

.mcp-server-card__header > .mcp-server-card__toggle {
  width: auto;
}

.mcp-server-card__toggle:hover {
  background: var(--surface-subtle);
}

.mcp-server-card__toggle > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
}

.mcp-server-card__toggle strong,
.mcp-server-tools__heading strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.mcp-server-card__toggle small,
.mcp-server-card__summary,
.mcp-server-tools__heading small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.mcp-server-card__summary {
  display: flex;
  align-items: center;
  margin-left: auto;
  white-space: nowrap;
  gap: var(--space-1);
}

.mcp-server-card__chevron {
  transition: transform var(--motion-normal) ease-out;
}

.mcp-server-card__chevron--expanded {
  transform: rotate(180deg);
}

.mcp-server-card__body {
  display: grid;
  padding: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  gap: var(--space-3);
}

.mcp-server-card__body > p,
.mcp-server-tools li > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  line-height: 1.55;
}

.mcp-server-card__body > code {
  padding: var(--space-2);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-server-tools {
  display: grid;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  gap: var(--space-2);
}

.mcp-server-tools__heading,
.mcp-server-tools li > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.mcp-server-tools ul {
  display: grid;
  padding: 0;
  margin: 0;
  gap: var(--space-2);
  list-style: none;
}

.mcp-server-tools li {
  display: grid;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  gap: var(--space-1);
}

.mcp-server-tools code {
  color: var(--text-primary);
  font-size: var(--font-caption);
  overflow-wrap: anywhere;
}

.mcp-server-tool__identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-1);
}

.mcp-server-tool__identity strong {
  color: var(--text-primary);
  font-size: var(--font-caption);
}

.computer-capability-risk {
  display: flex;
  align-items: flex-start;
  color: var(--warning) !important;
  gap: var(--space-2);
}

.computer-capability-risk svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.computer-capability-profile {
  max-width: 360px;
}

.capability-diagnostic {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.capability-diagnostic > button {
  flex: 0 0 auto;
}

.capability-diagnostic__result {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  gap: var(--space-1);
}

.capability-diagnostic__result strong {
  color: var(--text-primary);
  font-size: var(--font-caption);
}

.embedding-settings .settings-section__title h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-body);
  line-height: 1.4;
}

.embedding-settings__group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
}

.embedding-settings__group + .embedding-settings__group {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.embedding-settings__subheading,
.embedding-settings__subheading > div,
.embedding-settings__job-header {
  display: flex;
  align-items: center;
}

.embedding-settings__subheading {
  justify-content: space-between;
  gap: var(--space-3);
}

.embedding-settings__subheading > div {
  min-width: 0;
  color: var(--text-secondary);
  gap: var(--space-2);
}

.embedding-settings__subheading h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-body);
}

.embedding-settings__model,
.embedding-settings__job {
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.embedding-settings__model {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.embedding-settings__model-name,
.embedding-settings__job-header > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-1);
}

.embedding-settings__model-name > span,
.embedding-settings__model-name small,
.embedding-settings__job small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.embedding-settings__model-name strong,
.embedding-settings__job strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.embedding-settings__credential {
  color: var(--text-secondary);
  font-size: var(--font-caption);
  white-space: nowrap;
}

.embedding-settings__endpoint,
.embedding-settings__empty p,
.embedding-settings__job p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  line-height: 1.55;
}

.embedding-settings__endpoint code {
  overflow-wrap: anywhere;
}

.embedding-settings__job {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.embedding-settings__empty {
  display: grid;
  padding: var(--space-4);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-subtle);
  gap: var(--space-1);
}

.embedding-settings__empty strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.embedding-settings__job-header {
  justify-content: space-between;
  gap: var(--space-3);
}

.embedding-settings__job-header > div {
  flex: 1;
}

.embedding-settings__job progress {
  width: 100%;
  accent-color: var(--accent-solid);
}

.embedding-settings__job[data-status='failed'] {
  border-color: var(--danger-border);
  background: var(--danger-subtle);
}

@media (max-width: 720px) {
  .embedding-settings__subheading,
  .embedding-settings__model,
  .embedding-settings__job-header {
    align-items: stretch;
    flex-direction: column;
  }

  .embedding-settings__subheading > button,
  .embedding-settings__job-header > button {
    justify-content: center;
  }
}

.browser-profile-create,
.browser-profile-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.browser-profile-create .field,
.browser-profile-row .field {
  flex: 1;
  margin: 0;
}

.browser-profile-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.browser-profile-row {
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.browser-profile-default {
  display: flex;
  align-items: center;
  min-height: 32px;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  gap: var(--space-1);
}

.browser-profile-row .danger-ghost {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: var(--font-caption);
  gap: var(--space-1);
}

.browser-profile-row .danger-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 720px) {
  .capability-diagnostic,
  .browser-profile-create,
  .browser-profile-row,
  .mcp-server-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .mcp-server-card__header {
    padding-right: 0;
  }

  .mcp-server-card__header > .capability-card__actions {
    padding: 0 var(--space-3) var(--space-3);
  }

  .mcp-server-card__toggle {
    flex-wrap: wrap;
  }
}

.mcp-subsection-heading,
.mcp-subsection-heading > div {
  display: flex;
  align-items: center;
}

.mcp-subsection-heading {
  justify-content: space-between;
  color: var(--text-secondary);
  gap: var(--space-2);
}

.mcp-subsection-heading > div {
  gap: var(--space-2);
}

.mcp-subsection-heading__title {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mcp-subsection-heading strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.mcp-subsection-heading small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.builtin-tool-badge {
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: var(--font-caption);
  white-space: nowrap;
}

.capability-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  gap: var(--space-2);
}

.capability-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.capability-card__header > div:first-child {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.capability-card strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.capability-card small,
.runtime-assignments small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.capability-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  line-height: 1.55;
}

.capability-card code {
  padding: var(--space-2);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-switch,
.runtime-assignments,
.runtime-assignments label,
.capability-card__actions,
.capability-card__actions button,
.capability-remove {
  display: flex;
  align-items: center;
}

.capability-switch,
.runtime-assignments label {
  color: var(--text-secondary);
  font-size: var(--font-caption);
  gap: var(--space-1);
}

.toggle-row {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-body);
  gap: var(--space-3);
}

.toggle-row input {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-control);
  border-radius: 999px;
  appearance: none;
  background: var(--surface-muted);
  cursor: pointer;
  flex: 0 0 auto;
  transition:
    border-color var(--motion-fast) ease-out,
    background-color var(--motion-fast) ease-out;
}

.toggle-row input::after {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 1px 2px rgb(0 0 0 / 24%);
  content: '';
  left: 2px;
  top: 2px;
  transition: transform var(--motion-fast) ease-out;
}

.toggle-row input:checked {
  border-color: var(--accent-solid);
  background: var(--accent-solid);
}

.toggle-row input:checked::after {
  transform: translateX(16px);
}

.toggle-row input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.toggle-row:has(input:disabled) {
  cursor: not-allowed;
}

.runtime-assignments {
  flex-wrap: wrap;
  gap: 9px;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.capability-tags span {
  padding: 2px 6px;
  border-radius: 10px;
  background: #e6f4ff;
  color: #1677ff;
  font-size: 8px;
}

.capability-remove {
  margin-left: auto;
  background: transparent;
  color: #ff4d4f;
  cursor: pointer;
  font-size: 9px;
  gap: 3px;
}

.capability-card__actions {
  gap: 4px;
}

.capability-card__actions button {
  padding: 4px 6px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  color: #595959;
  cursor: pointer;
  font-size: 8px;
  gap: 3px;
}

.mcp-editor-backdrop {
  position: fixed;
  z-index: 70;
  display: grid;
  padding: var(--space-4);
  background: var(--overlay-backdrop);
  inset: 38px 0 0;
  place-items: center;
}

.mcp-editor {
  display: flex;
  width: min(560px, 100%);
  max-height: calc(100vh - 70px);
  flex-direction: column;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow-y: auto;
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  gap: var(--space-3);
}

.mcp-editor__header,
.mcp-editor__actions {
  display: flex;
  align-items: center;
}

.mcp-editor__header strong {
  flex: 1;
  color: var(--text-primary);
  font-size: var(--font-section-title);
}

.mcp-editor__actions {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  justify-content: flex-end;
  gap: var(--space-2);
}

.mcp-test-result {
  color: #389e0d !important;
}

.settings-panel__footer {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  gap: 8px;
}

.settings-feedback {
  flex: 1;
  min-width: 0;
  font-size: 10px;
}

.settings-error {
  color: #ff4d4f;
}

.settings-success {
  display: flex;
  align-items: center;
  color: #52c41a;
  gap: 5px;
}

.primary-button,
.secondary-button {
  min-height: var(--control-height);
  padding: 0 13px;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.primary-button {
  background: var(--accent-solid);
  color: var(--text-on-accent);
}

.primary-button:hover {
  background: var(--accent-solid-hover);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid var(--border-control);
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.conversation-row {
  position: relative;
  display: flex;
  align-items: center;
}

.conversation-row .conversation-item {
  padding-right: 58px;
}

.conversation-more,
.conversation-delete {
  position: absolute;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #8c8c8c;
  cursor: pointer;
  opacity: 0;
}

.conversation-more {
  right: 31px;
}

.conversation-delete {
  right: 5px;
}

.conversation-row:hover .conversation-more,
.conversation-row:hover .conversation-delete,
.conversation-row--active .conversation-more,
.conversation-more:focus-visible,
.conversation-delete:focus-visible {
  opacity: 1;
}

.conversation-more[aria-expanded='true'] {
  background: var(--accent-subtle);
  color: var(--accent);
  opacity: 1;
}

.conversation-more:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.conversation-delete:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

.conversation-actions {
  display: grid;
  padding: var(--space-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  margin: 2px 5px var(--space-2);
  background: var(--surface-subtle);
  gap: 2px;
}

.conversation-actions button {
  display: flex;
  min-height: 30px;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-caption);
  gap: var(--space-2);
  text-align: left;
}

.conversation-actions button:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.conversation-rename {
  display: grid;
  padding: var(--space-1);
  margin: 2px 5px var(--space-2);
  gap: var(--space-1);
  grid-template-columns: minmax(0, 1fr) 28px 28px;
}

.conversation-rename input {
  min-width: 0;
  height: 30px;
  padding: 0 var(--space-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--surface-raised);
  font-size: var(--font-caption);
}

.conversation-rename button {
  display: grid;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: pointer;
}

.app-notification-viewport {
  position: fixed;
  z-index: 75;
  top: 54px;
  right: var(--space-4);
  display: grid;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  gap: var(--space-2);
}

.app-notification {
  display: grid;
  min-width: 0;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  color: var(--text-secondary);
  font-size: var(--font-body);
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
}

.app-notification--success {
  border-color: var(--success);
  background: var(--success-subtle);
}

.app-notification--info {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.app-notification--error {
  border-color: var(--danger-border);
  background: var(--danger-subtle);
}

.app-notification--success > svg {
  color: var(--success);
}

.app-notification--info > svg {
  color: var(--accent);
}

.app-notification--error > svg {
  color: var(--danger);
}

.app-notification > div {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
}

.app-notification strong {
  color: var(--text-primary);
  font-size: var(--font-body);
}

.app-notification span {
  overflow-wrap: anywhere;
}

.app-notification button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.app-notification button:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.conversation-empty {
  padding: 12px 10px;
  margin: 0;
  color: #8c8c8c;
  font-size: 10px;
}

.message-sources {
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #1677ff;
  border-radius: 8px;
  margin-top: 9px;
  background: #e6f4ff;
  color: #1677ff;
  font-size: 9px;
  gap: 6px;
}

.message-citations {
  padding: 8px 10px;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  margin-top: 7px;
  background: #fafcff;
  font-size: 9px;
}

.message-citations summary {
  color: #1677ff;
  cursor: pointer;
  font-weight: 600;
}

.message-citations ol {
  padding-left: 18px;
  margin: 8px 0 0;
}

.message-citations li {
  margin-bottom: 8px;
}

.message-citations strong,
.message-citations small {
  display: block;
}

.message-citations small {
  margin-top: 2px;
  color: #8c8c8c;
}

.message-citations p {
  margin: 4px 0;
  color: #434343;
  line-height: 1.5;
}

.message-retry {
  padding: 6px 9px;
  border: 1px solid #ff4d4f;
  border-radius: 7px;
  margin-top: 9px;
  background: #fafafa;
  color: #ff4d4f;
  cursor: pointer;
  font-size: 9px;
}

.context-chip__thumbnail {
  width: 34px;
  height: 28px;
  flex: 0 0 34px;
  border-radius: 5px;
  object-fit: cover;
}

.knowledge-scope {
  position: relative;
}

.knowledge-scope > button {
  display: flex;
  gap: var(--space-1);
}

.knowledge-scope > button > span {
  display: flex;
  align-items: center;
  font-size: var(--font-caption);
  font-weight: 600;
  gap: var(--space-1);
  white-space: nowrap;
}

.knowledge-scope > button strong {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-1);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 10px;
  place-items: center;
}

.knowledge-scope__popover {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + var(--space-2));
  left: 0;
  display: flex;
  width: 270px;
  max-height: 260px;
  flex-direction: column;
  padding: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow-y: auto;
  background: var(--surface-raised);
  box-shadow: var(--shadow-dialog);
  gap: var(--space-1);
}

.knowledge-scope__popover > strong {
  padding: var(--space-1) var(--space-2) var(--space-2);
  color: var(--text-primary);
  font-size: var(--font-body);
}

.knowledge-scope__popover label {
  display: grid;
  align-items: center;
  min-height: 36px;
  padding: var(--space-2);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  cursor: pointer;
  gap: var(--space-1) var(--space-2);
  grid-template-columns: auto 1fr auto;
}

.knowledge-scope__popover label:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.knowledge-scope__popover label input {
  accent-color: var(--accent-solid);
}

.knowledge-scope__popover label span {
  overflow: hidden;
  font-size: var(--font-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-scope__popover label small {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.workspace-picker {
  display: flex;
  gap: 8px;
}

.workspace-picker input {
  flex: 1;
  min-width: 0;
}

.check-field {
  display: flex;
  align-items: center;
  color: #595959;
  cursor: pointer;
  font-size: 10px;
  gap: 8px;
}

.check-field input {
  width: 15px;
  height: 15px;
  accent-color: #1677ff;
}

.subagent-routing-settings > small {
  color: var(--text-muted);
  font-size: var(--font-caption);
  line-height: 1.55;
}

.settings-section--danger {
  border-color: #ff4d4f;
  background: #fafafa;
}

.settings-section--danger strong {
  color: #ff4d4f;
  font-size: 11px;
}

.settings-section--danger p {
  margin: 5px 0 0;
  color: #595959;
  font-size: 9px;
  line-height: 1.55;
}

.danger-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  min-height: var(--control-height);
  padding: 0 13px;
  border: 1px solid var(--danger-solid);
  border-radius: var(--radius-control);
  background: var(--danger-solid);
  color: var(--text-on-accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  gap: 6px;
}

.danger-button:hover {
  filter: brightness(1.06);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.danger-button--quiet {
  border-color: var(--danger-border);
  background: var(--danger-subtle);
  color: var(--danger);
}

.danger-confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  gap: var(--space-2);
}

.heartbeat-settings__actions .danger-button,
.heartbeat-settings__actions .secondary-button {
  width: auto;
  min-width: 40px;
  min-height: 28px;
  padding: 4px 8px;
}

.heartbeat-settings__actions .danger-button {
  border-color: var(--danger-solid);
  background: var(--danger-solid);
  color: var(--text-on-accent);
}

.heartbeat-settings__actions .danger-button--quiet {
  border-color: var(--danger-border);
  background: var(--danger-subtle);
  color: var(--danger);
}

.heartbeat-settings__actions .secondary-button {
  border-color: var(--border-default);
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.workspace-panel-scroll {
  min-height: 0;
  padding:
    var(--page-gutter)
    max(
      var(--page-gutter),
      calc((100% - var(--content-standard)) / 2)
    );
  overflow-y: auto;
}

.workspace-panel-scroll.page-shell--reading {
  display: grid;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  container-type: inline-size;
  grid-template-rows: minmax(0, 1fr) auto;
}

.page-shell--master-detail {
  padding: var(--page-gutter);
  overflow-x: hidden;
  container-type: inline-size;
}

.page-shell--dashboard {
  padding-inline:
    max(
      var(--page-gutter),
      calc((100% - var(--content-dashboard)) / 2)
    );
  container-type: inline-size;
}

.page-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-6);
}

.page-header__content {
  min-width: 0;
  flex: 1;
}

.page-header__title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.page-header__icon {
  display: grid;
  color: var(--accent);
  place-items: center;
}

.page-header h1 {
  overflow: hidden;
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-page-title);
  font-weight: 550;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
}

.page-header__description {
  max-width: 680px;
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: var(--font-body);
  line-height: 1.65;
}

.page-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.page-header__actions button {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.page-header--compact {
  display: block;
  padding-bottom: var(--space-3);
  border-bottom: 0;
}

.page-header--compact .eyebrow {
  margin-bottom: 5px;
}

.page-header--compact h1 {
  font-size: 17px;
}

.page-header--compact .page-header__description {
  font-size: var(--font-caption);
}

.scope-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--border-control);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--font-caption);
  font-weight: 650;
  gap: 5px;
  line-height: 1;
}

.scope-badge > span {
  display: grid;
  place-items: center;
}

.page-tabs {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  gap: var(--space-1);
}

.page-tabs__tab {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 650;
  gap: 6px;
  white-space: nowrap;
}

.page-tabs__tab:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.page-tabs__tab--active {
  border-color: var(--border-control);
  background: var(--accent-subtle);
  color: var(--accent);
}

.page-tabs__count {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--text-on-accent);
  font-size: 9px;
  place-items: center;
}

.page-tabs__icon {
  display: grid;
  place-items: center;
}

.segmented-control,
.page-tabs--segmented {
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--border-control);
  border-radius: calc(var(--radius-control) + 2px);
  overflow-x: auto;
  background: var(--surface-subtle);
  gap: 2px;
}

.segmented-control__option,
.page-tabs--segmented .page-tabs__tab {
  min-height: 28px;
  padding: 5px 10px;
  border: 0;
  border-radius: calc(var(--radius-control) - 2px);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 600;
  white-space: nowrap;
}

.segmented-control__option--active,
.page-tabs--segmented .page-tabs__tab--active {
  background: var(--surface-raised);
  color: var(--accent);
  box-shadow: var(--shadow-card);
}

.empty-state {
  display: grid;
  place-content: center;
  justify-items: center;
  padding: var(--space-6);
  color: var(--text-muted);
  gap: var(--space-2);
  text-align: center;
}

.empty-state--page {
  min-height: 460px;
}

.empty-state--section {
  min-height: 200px;
}

.empty-state--table {
  min-height: 88px;
}

.empty-state__icon {
  display: grid;
  color: var(--text-muted);
  place-items: center;
}

.empty-state strong {
  color: var(--text-primary);
  font-size: var(--font-section-title);
}

.empty-state p {
  max-width: 480px;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-body);
  line-height: 1.6;
}

.empty-state__action {
  margin-top: var(--space-1);
}

.status-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: var(--font-caption);
  font-weight: 650;
}

.knowledge-page {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: var(--space-4);
}

.knowledge-workspace {
  width: 100%;
  min-height: 520px;
  flex: 1;
  font-size: var(--font-body);
  grid-template-columns: clamp(240px, 24vw, 300px) minmax(0, 1fr);
  container-type: inline-size;
}

.knowledge-workspace__sidebar {
  display: flex;
  min-width: 0;
  padding: var(--space-4);
  overflow: hidden auto;
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  flex-direction: column;
  gap: var(--space-3);
}

.knowledge-workspace__sidebar-heading {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  font-size: var(--font-section-title);
}

.knowledge-workspace__sidebar-heading > span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.knowledge-workspace__sidebar-heading small {
  color: var(--text-muted);
  font-size: var(--font-caption);
  font-weight: 500;
}

.knowledge-workspace__library-nav {
  min-width: 0;
  overflow: hidden auto;
}

.knowledge-workspace__main {
  min-height: 0;
  overflow: hidden;
}

.knowledge-workspace__mobile-back {
  display: none;
}

.knowledge-workspace__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
}

.knowledge-workspace__header > div:first-child {
  min-width: 0;
  flex: 1;
}

.knowledge-workspace__header h2 {
  overflow: hidden;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
}

.knowledge-workspace h3 {
  font-size: var(--font-section-title);
}

.knowledge-workspace__header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-workspace__strategy {
  width: min(170px, 100%);
}

.knowledge-workspace__tabs {
  padding: 12px 20px 0;
}

.knowledge-workspace__tabs .page-tabs {
  width: 100%;
}

.knowledge-workspace__body {
  padding: clamp(16px, 2vw, 20px);
}

.knowledge-documents__section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.knowledge-documents__import-actions,
.knowledge-source-row__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-documents__url-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.knowledge-source-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.knowledge-documents__search {
  width: min(300px, 50%);
}

.knowledge-documents__table-scroll {
  margin-top: 12px;
  overflow-x: auto;
}

.knowledge-documents__table-scroll table {
  min-width: 680px;
}

.knowledge-graph {
  display: grid;
  min-height: clamp(500px, calc(100dvh - 260px), 780px);
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

.knowledge-graph--with-details {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
}

.knowledge-graph__canvas {
  min-width: 0;
}

.knowledge-graph__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  gap: var(--space-2);
}

.knowledge-graph__search {
  min-width: 220px;
  flex: 1 1 280px;
}

.knowledge-graph__filter {
  width: 150px;
  flex: 0 1 150px;
}

.knowledge-graph__entity-picker {
  width: 180px;
  min-height: var(--control-height);
  flex: 0 1 180px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
}

.knowledge-graph__zoom {
  font-size: var(--font-body);
  text-align: center;
}

.knowledge-graph__chart {
  width: 100%;
  min-height: clamp(420px, calc(100dvh - 330px), 720px);
  background: var(--surface-subtle);
}

.knowledge-graph__accessible-surface {
  padding: var(--space-2);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-raised);
}

.knowledge-graph__relation-list {
  display: flex;
  min-width: 0;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  gap: var(--space-2);
  list-style: none;
}

.knowledge-graph__accessible-surface > summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 650;
}

.knowledge-graph__accessible-surface[open] > summary {
  margin-bottom: var(--space-2);
}

.knowledge-graph__relation-list li {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: var(--font-caption);
  gap: var(--space-1);
  white-space: nowrap;
}

.knowledge-graph__relation-list strong {
  color: var(--text-primary);
}

.knowledge-graph__detail {
  max-height: clamp(500px, calc(100dvh - 260px), 780px);
}

@container (max-width: 1120px) {
  .knowledge-graph--with-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-graph__detail {
    max-height: none;
  }
}

@container (max-width: 1000px) {
  .knowledge-workspace__header {
    flex-direction: column;
  }

  .knowledge-workspace__header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .knowledge-documents__section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-documents__import-actions {
    width: 100%;
  }

  .knowledge-documents__search {
    width: min(360px, 100%);
  }
}

@container (max-width: 780px) {
  .knowledge-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-workspace__sidebar {
    display: none;
    padding: 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .knowledge-workspace--mobile-list .knowledge-workspace__sidebar {
    display: flex;
  }

  .knowledge-workspace--mobile-list .knowledge-workspace__main {
    display: none;
  }

  .knowledge-workspace__mobile-back {
    display: inline-flex;
    margin: 14px 18px 0;
  }

  .knowledge-workspace__library-nav {
    overflow: visible;
  }

  .knowledge-workspace__header {
    padding: 17px 18px 13px;
  }

  .knowledge-workspace__tabs {
    padding: 10px 18px 0;
  }
}

@container (max-width: 640px) {
  .knowledge-workspace__header {
    flex-direction: column;
  }

  .knowledge-workspace__header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .knowledge-workspace__strategy {
    width: min(220px, 100%);
  }

  .knowledge-source-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-documents__search {
    width: 100%;
  }

  .knowledge-documents__url-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .knowledge-documents__url-form > input {
    grid-column: 1 / -1;
  }

  .knowledge-graph__search {
    min-width: 100%;
  }

  .knowledge-graph__filter,
  .knowledge-graph__entity-picker {
    width: min(180px, 100%);
    flex-basis: 180px;
  }
}

.knowledge-panel {
  display: flex;
  width: 100%;
  max-width: var(--content-standard);
  min-height: 100%;
  flex-direction: column;
  margin: 0 auto;
}

.activity-panel {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
}

.knowledge-panel__limits {
  margin: 14px 0;
  color: #595959;
  font-size: 10px;
}

.knowledge-panel__error {
  padding: 10px 12px;
  border: 1px solid #ff4d4f;
  border-radius: 9px;
  background: #fafafa;
  color: #ff4d4f;
  font-size: 10px;
}

.knowledge-panel__empty,
.knowledge-panel__loading {
  display: grid;
  min-height: 260px;
  place-content: center;
  justify-items: center;
  color: #8c8c8c;
  gap: 8px;
  text-align: center;
}

.knowledge-panel__empty strong {
  color: #595959;
  font-size: 13px;
}

.knowledge-panel__empty span {
  margin: 0;
  font-size: 10px;
}

.knowledge-panel__summary {
  display: flex;
  align-items: center;
  margin: 4px 0 12px;
  color: #595959;
  font-size: 10px;
}

.knowledge-panel__summary > span:first-child {
  flex: 1;
}

.knowledge-panel__clear-confirm {
  display: flex;
  align-items: center;
  gap: 7px;
}

.knowledge-panel__list,
.activity-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.knowledge-panel__document {
  display: flex;
  align-items: center;
  padding: 13px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
  color: #1677ff;
  gap: 10px;
}

.knowledge-panel__document-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.knowledge-panel__document-info strong {
  overflow: hidden;
  color: #1f1f1f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-panel__document-info span {
  color: #8c8c8c;
  font-size: 9px;
}

.token-usage {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  margin-top: var(--space-4);
  background: var(--surface-raised);
}

.token-usage__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-usage__header h3 {
  flex: 1;
  margin: 0;
  color: #1f1f1f;
  font-size: 13px;
}

.token-usage__stats {
  display: grid;
  margin: 12px 0;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}

.token-usage__stats div {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: #fafafa;
}

.token-usage__stats dt {
  overflow: hidden;
  color: #8c8c8c;
  font-size: var(--font-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-usage__stats dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: #1677ff;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.token-usage__table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.token-usage table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--font-caption);
}

.token-usage th,
.token-usage td {
  padding: 7px 9px;
  border-top: 1px solid #f0f0f0;
  color: #595959;
  text-align: right;
  white-space: nowrap;
}

.token-usage thead th {
  color: #8c8c8c;
  font-size: var(--font-caption);
  font-weight: 600;
}

.token-usage th:first-child {
  position: sticky;
  left: 0;
  min-width: 120px;
  background: var(--surface-raised);
  color: var(--text-primary);
  text-align: left;
}

.token-usage tbody th span,
.token-usage tbody th small {
  display: block;
}

.token-usage tbody th small {
  margin-top: 2px;
  color: #8c8c8c;
  font-size: 8px;
  font-weight: 400;
}

.token-usage td.token-usage__empty {
  color: #8c8c8c;
  text-align: center;
}

.activity-panel__stats {
  display: grid;
  margin: 18px 0 14px;
  gap: 9px;
  grid-template-columns: repeat(3, 1fr);
}

.activity-panel__stats div {
  padding: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: #fff;
}

.activity-panel__stats dt {
  color: #8c8c8c;
  font-size: var(--font-caption);
}

.activity-panel__stats dd {
  margin: 4px 0 0;
  color: #1677ff;
  font-size: 18px;
  font-weight: 700;
}

.activity-panel__filters {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 12px;
  gap: 6px;
}

.activity-groups {
  display: grid;
  gap: var(--space-3);
}

.activity-group {
  overflow: clip;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.activity-group > summary {
  display: grid;
  min-height: 52px;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-subtle);
  color: var(--text-primary);
  cursor: pointer;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr) auto auto;
  list-style-position: inside;
}

.activity-group > summary:hover {
  background: var(--surface-muted);
}

.activity-group > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.activity-group > summary > span:first-child {
  display: grid;
  min-width: 0;
  gap: var(--space-1);
}

.activity-group > summary strong {
  overflow: hidden;
  font-size: var(--font-section-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-group > summary small,
.activity-group > summary time {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.activity-group > .activity-list {
  display: grid;
  padding: var(--space-3);
  background: var(--surface-canvas);
  gap: var(--space-2);
}

.activity-group .activity-item {
  margin-bottom: 0;
}

.activity-item {
  padding: 13px 14px;
  border: 1px solid #d9d9d9;
  border-left: 3px solid #1677ff;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}

.activity-item--failed,
.activity-item--denied {
  border-left-color: #ff4d4f;
}

.activity-item__header,
.activity-item__labels {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.activity-item__header time {
  margin-left: auto;
  color: #8c8c8c;
  font-size: 8px;
}

.activity-item__kind {
  padding: 3px 6px;
  border-radius: 6px;
  background: #e6f4ff;
  color: #1677ff;
  font-size: var(--font-caption);
}

.activity-item__status {
  background: var(--accent-subtle);
  color: var(--accent);
}

.activity-item__status--completed {
  background: var(--success-subtle);
  color: var(--success);
}

.activity-item__status--failed,
.activity-item__status--denied,
.activity-item__status--cancelled,
.activity-item__status--interrupted {
  background: var(--danger-subtle);
  color: var(--danger);
}

.activity-item h3 {
  margin: 9px 0 4px;
  color: #1f1f1f;
  font-size: 13px;
}

.activity-item p {
  margin: 0;
  color: #595959;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.activity-item__conversation {
  padding: 5px 0;
  margin-top: 7px;
  background: transparent;
  color: #1677ff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
}

.heartbeat-center {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  container: heartbeat-center / inline-size;
}

.heartbeat-center__latest > div:last-child,
.heartbeat-center__suggestion > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.heartbeat-center__latest button,
.heartbeat-center__suggestion button {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.heartbeat-center__error {
  padding: 9px 11px;
  border: 1px solid #ffccc7;
  border-radius: 8px;
  margin: 14px 0 0;
  background: #fff2f0;
  color: #cf1322;
  font-size: 10px;
}

.heartbeat-center > .page-tabs {
  padding: 14px 0;
}

.heartbeat-center__panel {
  display: flex;
  flex-direction: column;
  padding-bottom: 32px;
  gap: 14px;
}

.heartbeat-center__section {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #fff;
}

.heartbeat-center__section-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  margin-bottom: 13px;
  gap: 10px;
}

.heartbeat-center__section-heading > div {
  min-width: 0;
  flex: 1;
}

.heartbeat-center__section-heading h3 {
  display: flex;
  align-items: center;
  margin: 2px 0 0;
  color: #1f1f1f;
  font-size: var(--font-section-title);
  gap: 6px;
}

.heartbeat-center__section-heading > span,
.heartbeat-center__section-heading > time {
  color: #595959;
  font-size: 10px;
}

.heartbeat-center__live {
  display: inline-flex;
  align-items: center;
  color: #8c8c8c;
  font-size: 9px;
  font-weight: 650;
  gap: 6px;
}

.heartbeat-center__live > span,
.heartbeat-center__pulse-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #bfbfbf;
}

.heartbeat-center__live--active {
  color: #237804;
}

.heartbeat-center__live--active > span,
.heartbeat-center__pulse-dot--active {
  background: #52c41a;
  box-shadow: 0 0 0 4px rgb(82 196 26 / 12%);
}

.heartbeat-center__section-empty {
  margin: 0;
  color: #8c8c8c;
  font-size: 10px;
  line-height: 1.6;
}

.heartbeat-center__config-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}

.heartbeat-center__config-card {
  padding: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  background: #fafafa;
}

.heartbeat-center__config-card header {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.heartbeat-center__config-card header > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.heartbeat-center__config-card header strong {
  overflow: hidden;
  color: #1f1f1f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heartbeat-center__config-card header small {
  color: #595959;
  font-size: var(--font-caption);
}

.heartbeat-center__config-card dl {
  display: grid;
  margin: 11px 0;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
}

.heartbeat-center__config-card dl div {
  min-width: 0;
}

.heartbeat-center__config-card dt {
  color: #595959;
  font-size: var(--font-caption);
}

.heartbeat-center__config-card dd {
  overflow: hidden;
  margin: 2px 0 0;
  color: #595959;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heartbeat-center__config-card > div:last-child {
  display: flex;
  gap: 6px;
}

.heartbeat-center__config-card button {
  padding: 5px 8px;
  border-radius: 7px;
  background: #fff;
  color: #1677ff;
  cursor: pointer;
  font-size: var(--font-caption);
  font-weight: 650;
}

.heartbeat-center__config-card button:hover {
  background: #e6f4ff;
}

.heartbeat-center__config-card button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.heartbeat-center__metrics {
  display: grid;
  margin: 0;
  gap: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.heartbeat-center__metrics > div {
  display: flex;
  min-width: 0;
  min-height: 125px;
  flex-direction: column;
  padding: 13px;
  border: 1px solid #d9d9d9;
  border-radius: 11px;
  background: #fff;
}

.heartbeat-center__metrics dt {
  display: flex;
  align-items: center;
  color: #595959;
  font-size: 11px;
  font-weight: 650;
  gap: 6px;
}

.heartbeat-center__metrics dt svg {
  color: #1677ff;
}

.heartbeat-center__metrics dd {
  margin: 7px 0 2px;
  color: #1677ff;
  font-size: 21px;
  font-weight: 750;
}

.heartbeat-center__metrics small {
  color: #595959;
  font-size: var(--font-caption);
  line-height: 1.45;
}

.heartbeat-center__meter {
  height: 5px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 999px;
  background: #f0f0f0;
}

.heartbeat-center__meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #69b1ff);
}

.heartbeat-center__metric-note {
  display: flex;
  min-height: 23px;
  align-items: flex-end;
  margin-top: auto;
  color: #1677ff;
  font-size: 9px;
  font-weight: 650;
}

.heartbeat-center__overview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.heartbeat-center__legend {
  display: flex;
  margin-bottom: 12px;
  color: #8c8c8c;
  font-size: 9px;
  gap: 12px;
}

.heartbeat-center__legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.heartbeat-center__legend span::before {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #1677ff;
  content: "";
}

.heartbeat-center__legend--memory::before {
  background: #9254de !important;
}

.heartbeat-center__legend--task::before {
  background: #13c2c2 !important;
}

.heartbeat-center__trend {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.heartbeat-center__trend-row {
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: 86px minmax(0, 1fr) 20px;
}

.heartbeat-center__trend-row time,
.heartbeat-center__trend-row small {
  color: #595959;
  font-size: 9px;
}

.heartbeat-center__trend-row small {
  text-align: right;
}

.heartbeat-center__trend-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #f5f5f5;
}

.heartbeat-center__trend-total {
  display: flex;
  height: 100%;
  min-width: 6px;
  overflow: hidden;
  border-radius: inherit;
}

.heartbeat-center__trend-insight {
  background: #1677ff;
}

.heartbeat-center__trend-memory {
  background: #9254de;
}

.heartbeat-center__trend-task {
  background: #13c2c2;
}

.heartbeat-center__latest > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 10px;
  color: #1f1f1f;
  font-size: 10px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.heartbeat-center__latest ul,
.heartbeat-center__timeline ul {
  padding: 0;
  margin: 0 0 12px;
  color: #595959;
  font-size: 9px;
  line-height: 1.6;
  list-style: none;
}

.heartbeat-center__latest li,
.heartbeat-center__timeline li {
  position: relative;
  padding-left: 12px;
  margin-top: 5px;
}

.heartbeat-center__latest li::before,
.heartbeat-center__timeline li::before {
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1677ff;
  content: "";
}

.heartbeat-center__suggestions,
.heartbeat-center__history {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.heartbeat-center__suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.heartbeat-center__suggestion {
  padding: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  background: #fafafa;
}

.heartbeat-center__suggestion header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.heartbeat-center__suggestion header span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #e6f4ff;
  color: #1677ff;
  font-size: 9px;
  font-weight: 650;
}

.heartbeat-center__suggestion header small {
  margin-left: auto;
  color: #595959;
  font-size: 9px;
}

.heartbeat-center__suggestion > strong {
  display: block;
  margin-bottom: 5px;
  color: #1f1f1f;
  font-size: 11px;
}

.heartbeat-center__suggestion > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 10px;
  color: #595959;
  font-size: 10px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.heartbeat-center__suggestion
  > p.heartbeat-center__suggestion-content--expanded {
  display: block;
  overflow: visible;
}

.heartbeat-center__timeline {
  position: relative;
  padding-left: 13px;
}

.heartbeat-center__timeline::before {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 3px;
  width: 1px;
  background: #d9d9d9;
  content: "";
}

.heartbeat-center__timeline > article {
  position: relative;
  padding: 0 0 17px 12px;
}

.heartbeat-center__timeline-dot {
  position: absolute;
  top: 4px;
  left: -14px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1677ff;
  box-shadow: 0 0 0 1px #91caff;
}

.heartbeat-center__timeline header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 6px;
  gap: 7px;
}

.heartbeat-center__timeline time {
  color: #1f1f1f;
  font-size: 10px;
  font-weight: 650;
}

.heartbeat-center__timeline header small {
  color: #595959;
  font-size: 9px;
}

.heartbeat-center__report-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 5px;
  color: #595959;
  font-size: 10px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: pre-wrap;
}

.heartbeat-center__report-summary--expanded {
  display: block;
  overflow: visible;
}

.heartbeat-center__link-button {
  padding: 3px 0;
  background: transparent;
  color: #1677ff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
}

.heartbeat-center__run-list {
  display: flex;
  padding: 0;
  margin: 0;
  flex-direction: column;
  gap: 7px;
  list-style: none;
}

.heartbeat-center__run {
  display: flex;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid #f0f0f0;
  border-radius: 9px;
  background: #fafafa;
  color: #8c8c8c;
  gap: 8px;
}

.heartbeat-center__run--completed {
  color: #389e0d;
}

.heartbeat-center__run--failed {
  color: #cf1322;
}

.heartbeat-center__run > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.heartbeat-center__run strong {
  color: #1f1f1f;
  font-size: 10px;
}

.heartbeat-center__run small {
  color: #595959;
  font-size: 9px;
}

.heartbeat-center__run em {
  margin-top: 3px;
  color: #cf1322;
  font-size: 9px;
  font-style: normal;
  line-height: 1.5;
  word-break: break-word;
}

.heartbeat-center__load-more {
  min-height: 34px;
  align-self: flex-start;
  margin-top: 12px;
}

.heartbeat-center__plans .heartbeat-settings {
  max-width: none;
  padding: 18px;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #fff;
}

.appearance-settings {
  gap: 14px;
}

.appearance-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.appearance-options label {
  display: flex;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.appearance-options label:has(input:checked) {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgb(22 119 255 / 12%);
}

.appearance-options label:has(input:focus-visible) {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

.appearance-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.appearance-options__preview {
  display: grid;
  height: 76px;
  padding: 9px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #f5f5f5;
  gap: 5px;
  grid-template-columns: 30% 1fr;
  grid-template-rows: 12px 1fr;
}

.appearance-options__preview i {
  display: block;
  border-radius: 3px;
  background: #fff;
}

.appearance-options__preview i:first-child {
  grid-column: 1 / -1;
}

.appearance-options__preview i:nth-child(2) {
  grid-row: 2;
}

.appearance-options__preview i:nth-child(3) {
  background: #e6f4ff;
  grid-column: 2;
  grid-row: 2;
}

.appearance-options__preview--dark {
  border-color: #344258;
  background: #0b111b;
}

.appearance-options__preview--dark i {
  background: #1c2738;
}

.appearance-options__preview--dark i:nth-child(3) {
  background: #15345f;
}

.appearance-options__preview--system {
  background: linear-gradient(90deg, #f5f5f5 0 50%, #0b111b 50% 100%);
}

.appearance-options__preview--system i {
  background: linear-gradient(90deg, #fff 0 50%, #1c2738 50% 100%);
}

.appearance-options__preview--system i:nth-child(3) {
  background: linear-gradient(90deg, #e6f4ff 0 50%, #15345f 50% 100%);
}

:root[data-theme='dark'] {
  color: #edf4ff;
  background: #0b111b;
  --surface-canvas: #0b111b;
  --surface-raised: #111827;
  --surface-subtle: #172033;
  --surface-muted: #1f2a3d;
  --text-primary: #edf4ff;
  --text-secondary: #aebbd0;
  --text-muted: #9aa7ba;
  --text-on-accent: #fff;
  --border-default: #344258;
  --border-control: #66758f;
  --border-subtle: #293548;
  --accent: #8cc2ff;
  --accent-solid: #2b69c9;
  --accent-solid-hover: #365f9f;
  --accent-hover: #b3d7ff;
  --accent-selected: #245fa8;
  --accent-subtle: #15345f;
  --danger: #ffaaa7;
  --danger-solid: #b93a43;
  --danger-strong: #ff9c99;
  --danger-border: #703b3d;
  --danger-subtle: #351d22;
  --success: #a1e887;
  --success-subtle: #18351d;
  --warning: #f3c969;
  --overlay-backdrop: rgb(0 0 0 / 62%);
  --shadow-card: 0 2px 8px rgb(0 0 0 / 24%);
  --shadow-dialog: 0 12px 30px rgb(0 0 0 / 36%);
}

:root[data-theme='dark'] .app-shell {
  background: #0b111b;
  color: #edf4ff;
}

:root[data-theme='dark'] :where(
  .settings-page,
  .composer-wrap
) {
  background: #0b111b;
}

:root[data-theme='dark'] :where(
  .sidebar,
  .topbar,
  .assistant-sidebar,
  .project-create-card,
  .settings-panel,
  .runtime-picker__menu,
  .knowledge-scope__popover,
  .knowledge-panel__document,
  .token-usage,
  .activity-item,
  .heartbeat-center__section,
  .heartbeat-center__metrics > div,
  .heartbeat-center__plans .heartbeat-settings,
  .heartbeat-settings__item,
  .capability-card,
  .quick-actions button,
  .secondary-button
) {
  border-color: #293548;
  background: #111827;
}

:root[data-theme='dark'] :where(
  .app-shell,
  .sidebar,
  .topbar,
  .assistant-sidebar,
  .settings-panel,
  .project-create-card,
  .workspace-panel-scroll
) :where(input, textarea, select) {
  border-color: #344258;
  background: #172033;
  color: #edf4ff;
}

:root[data-theme='dark'] :where(
  .app-shell,
  .sidebar,
  .topbar,
  .assistant-sidebar,
  .settings-panel,
  .project-create-card
) :where(input, textarea)::placeholder {
  color: #718096;
}

:root[data-theme='dark'] :where(
  .sidebar-search,
  .settings-section,
  .settings-tabs,
  .settings-panel__footer,
  .assistant-sidebar__row,
  .assistant-sidebar__library,
  .assistant-sidebar__diff,
  .assistant-sidebar__preview pre,
  .tool-activity,
  .approval-card,
  .context-chip,
  .token-usage__stats div,
  .activity-panel__stats div,
  .heartbeat-center__config-card,
  .heartbeat-center__suggestion,
  .heartbeat-center__run,
  .heartbeat-settings--sidebar .heartbeat-settings__item,
  .knowledge-graph__toolbar,
  .markdown-content pre,
  .markdown-content :not(pre) > code
) {
  border-color: #293548;
  background: #172033;
}

:root[data-theme='dark'] :where(
  .primary-nav,
  .sidebar-footer,
  .topbar,
  .assistant-sidebar,
  .assistant-sidebar__header,
  .assistant-sidebar__tabs,
  .assistant-sidebar__context,
  .assistant-sidebar__preview > header,
  .message + .message,
  .divider,
  .runtime-picker__divider,
  .settings-panel__header,
  .settings-panel__footer,
  .knowledge-workspace__sidebar,
  .knowledge-workspace__header,
  .knowledge-panel__header,
  .heartbeat-center__config-card,
  .heartbeat-center__suggestion,
  .heartbeat-center__run
) {
  border-color: #293548;
}

:root[data-theme='dark'] :where(
  h1,
  h2,
  h3,
  h4,
  .conversation-title,
  .welcome h1,
  .message__meta strong,
  .markdown-content,
  .settings-section__title strong,
  .field,
  .capability-card strong,
  .knowledge-panel__document-info strong,
  .token-usage__header h3,
  .activity-item h3,
  .heartbeat-center__latest > p,
  .heartbeat-center__run strong
) {
  color: #edf4ff;
}

:root[data-theme='dark'] .app-shell strong {
  color: #edf4ff;
}

:root[data-theme='dark'] :where(
  .nav-item,
  .conversation-item,
  .user-card,
  .icon-button,
  .assistant-sidebar__row,
  .runtime-status,
  .welcome__description,
  .tool-activity,
  .context-chip,
  .settings-tabs button,
  .credential-state,
  .capability-card p,
  .secondary-button,
  .check-field,
  .knowledge-panel__limits,
  .knowledge-panel__summary,
  .token-usage th,
  .token-usage td,
  .activity-item p,
  .heartbeat-center__config-card,
  .heartbeat-center__suggestion > p,
  .heartbeat-center__run small
) {
  color: #aebbd0;
}

:root[data-theme='dark'] :where(
  .brand__copy span,
  .nav-item__hint,
  .section-label,
  .conversation-item small,
  .user-card__copy small,
  .assistant-sidebar__tab,
  .assistant-sidebar__empty,
  .runtime-picker__menu > strong,
  .runtime-picker__menu > button > small,
  .message__meta span,
  .message__status,
  .settings-panel__description,
  .settings-tabs button small,
  .settings-section__title small,
  .field small,
  .settings-notice,
  .settings-empty,
  .knowledge-panel__empty,
  .knowledge-panel__loading,
  .heartbeat-center__live,
  .heartbeat-center__legend
) {
  color: #8290a6;
}

:root[data-theme='dark'] :where(
  .icon-button:hover,
  .icon-button--active,
  .nav-item:hover,
  .conversation-item:hover,
  .conversation-item--active,
  .user-card:hover,
  .secondary-button:hover,
  .settings-tabs button[aria-selected='true']
) {
  background: #1f2a3d;
}

:root[data-theme='dark'] .settings-page
  .settings-tabs
  button[aria-selected='true'] {
  background: #1f2a3d;
  color: #69adff;
}

:root[data-theme='dark'] :where(
  .nav-item--active,
  .brand__mark,
  .runtime-capability-badge,
  .model-capability-badge
) {
  border-color: #245fa8;
  background: #15345f;
  color: #69adff;
}

:root[data-theme='dark'] :where(
  .settings-warning,
  .approval-card,
  .heartbeat-center__error
) {
  border-color: #70511d;
  background: #302511;
  color: #f3c969;
}

:root[data-theme='dark'] .markdown-content blockquote {
  border-left-color: #4c9aff;
  color: #aebbd0;
}

:root[data-theme='dark'] .message--user .message__content {
  border-color: #245fa8;
  background: #15345f;
  color: #edf4ff;
}

:root[data-theme='dark'] .heartbeat-center__metrics small {
  color: #aebbd0;
}

:root[data-theme='dark'] .assistant-sidebar__tab--active {
  background: #15345f;
  color: #69adff;
}

:root[data-theme='dark'] :where(
  .runtime-picker__menu > button,
  .quick-actions strong,
  .user-card__copy strong
) {
  color: #edf4ff;
}

:root[data-theme='dark'] .markdown-content :where(th, td) {
  border-color: #344258;
}

:root[data-theme='dark'] .appearance-options label {
  border-color: #344258;
  background: #172033;
}

:root[data-theme='dark'] .appearance-options label:has(input:checked) {
  border-color: #4c9aff;
  box-shadow: 0 0 0 2px rgb(76 154 255 / 20%);
}

@container heartbeat-settings (max-width: 680px) {
  .heartbeat-settings__form,
  .heartbeat-settings__form--weekly {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heartbeat-settings__form .primary-button {
    grid-column: 1 / -1;
  }

  .heartbeat-settings__item {
    align-items: stretch;
    flex-direction: column;
  }

  .heartbeat-settings__actions {
    flex-wrap: wrap;
  }
}

@container heartbeat-settings (max-width: 420px) {
  .heartbeat-settings__form,
  .heartbeat-settings__form--weekly {
    grid-template-columns: 1fr;
  }

  .heartbeat-settings__form .primary-button {
    grid-column: auto;
  }

  .heartbeat-settings__actions button {
    padding-inline: 8px;
    flex: 1 1 auto;
  }
}

@container heartbeat-center (max-width: 820px) {
  .heartbeat-center__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heartbeat-center__overview-grid,
  .heartbeat-center__suggestions,
  .heartbeat-center__history {
    grid-template-columns: 1fr;
  }

  .activity-group > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .activity-group > summary time {
    grid-column: 1 / -1;
  }
}

@container heartbeat-center (max-width: 620px) {
  .heartbeat-center > .page-header {
    flex-direction: column;
  }

  .heartbeat-center .page-header__actions {
    width: 100%;
  }

  .heartbeat-center .page-header__actions button {
    flex: 1;
  }

  .heartbeat-center__config-card > div:last-child {
    flex-wrap: wrap;
  }
}

@container heartbeat-center (max-width: 460px) {
  .heartbeat-center__metrics {
    grid-template-columns: 1fr;
  }

  .heartbeat-center__trend-row {
    grid-template-columns: 70px minmax(0, 1fr) 18px;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes composer-recording-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1279px) {
  .assistant-sidebar {
    position: absolute;
    z-index: 30;
    top: 58px;
    right: 0;
    bottom: 0;
    box-shadow: -12px 0 30px rgb(0 0 0 / 10%);
  }

  .assistant-sidebar--open {
    width: min(
      var(--assistant-sidebar-width, 350px),
      calc(100vw - 36px)
    );
    flex-basis: min(
      var(--assistant-sidebar-width, 350px),
      calc(100vw - 36px)
    );
  }
}

@media (max-width: 1020px) {
  .sidebar {
    flex-basis: 236px;
  }

  .brand,
  .project-switcher,
  .new-chat,
  .sidebar-search,
  .primary-nav,
  .conversation-list,
  .sidebar-footer {
    min-width: 206px;
  }

  .assistant-sidebar--open {
    width: min(
      var(--assistant-sidebar-width, 350px),
      calc(100vw - 36px)
    );
    flex-basis: min(
      var(--assistant-sidebar-width, 350px),
      calc(100vw - 36px)
    );
  }

  .settings-page .settings-panel__body {
    display: grid;
    padding: 20px;
    overflow: hidden;
    align-items: stretch;
    grid-template-columns: 176px minmax(0, 1fr);
    justify-content: stretch;
    gap: var(--space-4);
  }

  .settings-page .settings-tabs {
    position: static;
    display: flex;
    width: auto;
    min-height: 0;
    overflow-y: auto;
    flex-direction: column;
    grid-template-columns: none;
  }

  .settings-page .settings-tabs button {
    min-height: 52px;
    align-items: flex-start;
    text-align: left;
  }

  .settings-page .settings-tabs button small {
    display: block;
  }

  .heartbeat-center__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .sidebar {
    position: absolute;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(278px, calc(100vw - 52px));
    box-shadow: 12px 0 30px rgb(0 0 0 / 14%);
  }

  .sidebar--closed {
    width: 0;
    box-shadow: none;
  }

  .sidebar-backdrop {
    position: absolute;
    z-index: 35;
    display: block;
    border: 0;
    background: var(--overlay-backdrop);
    inset: 0;
  }
}

@media (max-width: 719px) {
  .assistant-sidebar__resize-handle {
    display: none;
  }
}

@media (max-width: 720px) {
  .workspace-panel-scroll {
    padding: var(--page-gutter);
  }

  .settings-page .settings-panel__body {
    display: flex;
    padding: var(--space-4);
    overflow: hidden;
    flex-direction: column;
    gap: var(--space-3);
  }

  .settings-page .settings-tabs {
    display: flex;
    width: 100%;
    min-height: auto;
    padding: var(--space-1);
    overflow-x: auto;
    overflow-y: hidden;
    flex: 0 0 auto;
    flex-direction: row;
    scrollbar-gutter: auto;
    scrollbar-color: var(--border-control) transparent;
    scrollbar-width: thin;
  }

  .settings-page .settings-tabs button {
    min-width: max-content;
    min-height: 40px;
    padding: var(--space-2) var(--space-3);
    align-items: center;
    text-align: center;
  }

  .settings-page .settings-tabs button small {
    display: none;
  }

  .settings-page .settings-panel__content {
    width: 100%;
    min-height: 0;
    padding-right: 0;
    overflow-y: auto;
    flex: 1;
  }

  .agent-runtime-navigation {
    grid-template-columns: 1fr;
  }

  .model-connection-manager {
    grid-template-columns: 1fr;
  }

  .model-connection-list > [role='list'] {
    max-height: 180px;
  }

  .capability-list--tools {
    grid-template-columns: 1fr;
  }

  .page-header:not(.page-header--compact) {
    flex-direction: column;
  }

  .page-header:not(.page-header--compact) .page-header__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .heartbeat-center .page-header__actions button {
    flex: 1;
  }

  .heartbeat-center__overview-grid,
  .heartbeat-center__suggestions,
  .heartbeat-center__history {
    grid-template-columns: 1fr;
  }

  .appearance-options {
    grid-template-columns: 1fr;
  }

  .workspace-picker {
    flex-wrap: wrap;
  }

  .workspace-picker input {
    flex-basis: 100%;
  }

  .settings-panel__footer {
    flex-wrap: wrap;
  }

  .settings-feedback {
    flex-basis: 100%;
  }

  .mcp-editor {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .workspace-panel-scroll {
    padding: var(--page-gutter);
  }

  .model-connection-add {
    width: 100%;
    justify-content: center;
  }

  .model-type-navigation {
    align-items: stretch;
    flex-direction: column;
  }

  .role-prompt-add {
    width: 100%;
    justify-content: center;
  }

  .heartbeat-center__metrics {
    grid-template-columns: 1fr;
  }

  .heartbeat-center__trend-row {
    grid-template-columns: 70px minmax(0, 1fr) 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
