/* Catch Inter and its SIL Open Font License are served locally; Chinese keeps the platform fallback. */
@font-face {
  font-family: 'Catch Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
}
/* Shared semantic roles follow Catch's foundation.css (df22a1e). Both themes are maintained here;
   product UI consumes these variables rather than keeping page-specific color copies. */
:root {
  color-scheme: light;
  --font:
    'Catch Inter', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #f7f8fa;
  --side: #f0f1f4;
  --panel: #ffffff;
  --hover: #e9ecf1;
  --selected: #e3eaf8;
  --line: #dfe2e8;
  --line-strong: #b7bdc9;
  --ink: #202127;
  --text: #202127;
  --muted: #636873;
  --faint: #646b76;
  --accent: #3463c8;
  --accent-ink: #3463c8;
  --accent-soft: #eef3fd;
  --warn: #856016;
  --warn-soft: #faf1df;
  --warn-line: #e4c98e;
  --danger: #b3263e;
  --danger-soft: #fcecef;
  --danger-line: #e7b3be;
  --dark: #3463c8;
  --dark-hover: #2b57b6;
  --on-dark: #ffffff;
  --line-hover: #b7bdc9;
  --brand-dot: #8256ab;
  --face: #627bb2;
  --face-soft: #a596e6;
  --bubble: #eef3fd;
  --code-bg: #f0f1f4;
  --code-title: #e9ecf1;
  --focus-line: #3463c8;
  --focus-ring: #3463c826;
  --disabled: #e9ecf1;
  --on-disabled: #646b76;
  --shadow-soft: #20212712;
  --shadow: #20212724;
  --shadow-drawer: #20212726;
  --backdrop: #20212755;
  --tile-edge: transparent;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-lg: 14px;
  --radius: 8px;
  --space-compact: 4px;
  --space-control: 8px;
  --space-row: 12px;
  --space-group: 16px;
  --space-section: 24px;
  --conversation-sidebar: 248px;
  --text-title: 21px;
  --text-page: 26px;
  --surface-soft: #f0f1f4;
  --topbar: #f7f8fa;
  --active-line: #b8caee;
  --spectrum: linear-gradient(110deg, #2e6fee 0%, #8264cc 52%, #c44e6b 100%);
  --spectrum-hover: linear-gradient(110deg, #2b67dd 0%, #795dbe 52%, #b64964 100%);
  --wash:
    radial-gradient(ellipse 65% 290px at 95% 0, #885b9c12, transparent),
    radial-gradient(ellipse 65% 310px at 0 0, #467ff011, transparent);
  --sidebar: 232px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
/* Catch dark surfaces and semantic accents. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --surface-soft: #19191c;
  --topbar: #141416;
  --active-line: #626d83;
  --bg: #131315;
  --side: #131315;
  --panel: #202022;
  --hover: #232428;
  --selected: #2b303a;
  --line: #353538;
  --line-strong: #515159;
  --ink: #eeeef0;
  --text: #eeeef0;
  --muted: #a7a8b0;
  --faint: #96979f;
  --accent: #91b5ff;
  --accent-ink: #91b5ff;
  --accent-soft: #272f40;
  --warn: #dfba7c;
  --warn-soft: #332b20;
  --warn-line: #5c4a2e;
  --danger: #f29aa5;
  --danger-soft: #38232a;
  --danger-line: #68404b;
  --dark: #3463c8;
  --dark-hover: #2b57b6;
  --on-dark: #ffffff;
  --line-hover: #55545e;
  --brand-dot: #b28adb;
  --face: #91b5ff;
  --face-soft: #a596e6;
  --bubble: #272f40;
  --code-bg: #19191c;
  --code-title: #2c2d33;
  --focus-line: #91b5ff;
  --focus-ring: #91b5ff33;
  --disabled: #2c2d33;
  --on-disabled: #96979f;
  --shadow-soft: #00000040;
  --shadow: #00000080;
  --shadow-drawer: #00000066;
  --backdrop: #00000080;
  /* Near-black brand tiles (GitHub, Notion) would sink into dark cards. */
  --tile-edge: #ffffff24;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: var(--text-md);
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.icon-sprite {
  display: none;
}
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.subtle {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.7;
  margin: 8px 0;
}

/* ---------- controls ---------- */
.icon-button {
  border: 0;
  background: transparent;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  flex-shrink: 0;
}
.icon-button:hover {
  background: var(--hover);
  color: var(--ink);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.button:hover {
  background: var(--panel);
  border-color: var(--line-hover);
}
.button-small {
  height: 30px;
  padding: 0 10px;
  font-size: var(--text-xs);
  color: var(--muted);
}
.button-dark {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--on-dark);
}
.button-dark:hover {
  background: var(--dark-hover);
  border-color: var(--dark-hover);
}
.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.button-quiet:hover {
  background: var(--hover);
  border-color: transparent;
  color: var(--ink);
}
.button-block {
  display: flex;
  width: 100%;
  margin-top: 18px;
  height: 40px;
}
.text-button {
  background: transparent;
  border: 0;
  padding: 4px 0;
  color: var(--accent);
  font-size: var(--text-sm);
}
.text-button:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  color: var(--accent);
  text-decoration: none;
}
.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link .icon {
  width: 14px;
  height: 14px;
}

/* ---------- shell ---------- */
.app-shell {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: sticky;
  top: 0;
  /* Account popovers extend over content and its resize handles (1–3); modal drawers stay above navigation. */
  z-index: 4;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 4px 0 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  line-height: 1;
  color: var(--ink);
  flex-shrink: 0;
}
.connection-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.connection-indicator.connected {
  background: var(--accent);
}
.sidebar-top .header-tag {
  margin-left: auto;
}
.brand > span {
  font-size: var(--text-title);
  letter-spacing: -1.3px;
  font-weight: 650;
}
.brand-dot {
  color: var(--brand-dot);
}
.mo-mark {
  width: 28px;
  height: 28px;
}
.new-chat {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  border-radius: var(--radius);
  font-size: var(--text-md);
  font-weight: 550;
  color: var(--ink);
}
.new-chat:hover:not(:disabled) {
  border-color: var(--line-hover);
  background: var(--panel);
}
.nav {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}
.nav a {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 33px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  font-size: var(--text-md);
  text-decoration: none;
}
.nav a .icon {
  color: var(--muted);
}
.nav a:hover {
  background: var(--hover);
}
.nav a[aria-current='page'] {
  border-color: var(--active-line);
  background: var(--selected);
  color: var(--ink);
  font-weight: 600;
}
.nav a[aria-current='page'] .icon {
  color: var(--accent);
}
.nav-meta {
  margin-left: auto;
  white-space: nowrap;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
}
.nav-meta.ok {
  color: var(--accent);
}
.nav-meta.warn {
  color: var(--warn);
  font-weight: 600;
}
.nav a > .nav-meta.warn {
  grid-column: 2 / -1;
  margin-left: 0;
  white-space: normal;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: -6px;
}
.file-list {
  margin-top: 2px;
}
.file-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 7px 0;
  text-align: left;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text);
}
.file-button:hover {
  color: var(--accent);
}
.file-icon {
  color: var(--faint);
  flex-shrink: 0;
}
.file-name {
  overflow-wrap: anywhere;
  flex: 1;
}
.file-size {
  color: var(--faint);
  font-size: var(--text-xs);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.file-row .file-button {
  flex: 1;
  min-width: 0;
}
.file-download {
  width: 26px;
  height: 26px;
}
/* A workspace file shown in place of the list (workspace-preview.ts). */
.file-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-group);
  min-height: 0;
}
.file-preview-head {
  display: grid;
  gap: var(--space-group);
}
.file-preview-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-control);
  margin-left: -6px;
}
.file-preview-title {
  min-width: 0;
  flex: 1;
}
.file-preview-name {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.file-preview-meta {
  margin: var(--space-compact) 0 0;
  color: var(--faint);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.file-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-control) var(--space-row);
}
.file-preview-status {
  padding: 12px 0;
}
.file-preview-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: zoom-in;
}
.file-preview-image img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}
.file-preview-pdf {
  width: 100%;
  height: 60vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.file-preview-text {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
}
.file-preview-code {
  margin: 0;
  padding: var(--space-row) var(--space-group);
  max-height: 60vh;
  overflow: auto;
  font-family: var(--mono);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text);
  white-space: pre;
  tab-size: 4;
}
.file-preview-markdown {
  padding: var(--space-row) var(--space-group);
  max-height: 60vh;
  overflow: auto;
  font-size: var(--text-md);
  line-height: 1.6;
  background: var(--panel);
}
.file-preview-markdown > :first-child {
  margin-top: 0;
}
.file-preview-markdown > :last-child {
  margin-bottom: 0;
}
.file-preview-truncated {
  margin: 0;
  padding: 7px 12px;
  border-top: 1px solid var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--text-xs);
}
.file-preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.file-preview-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}
.file-preview-ext {
  position: absolute;
  right: -8px;
  bottom: -6px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--panel);
  font-size: var(--text-xs);
  font-weight: 600;
}
.file-preview-fallback-name {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.file-preview-reason {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.chats {
  margin-top: 18px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-right: -6px;
  padding-right: 6px;
}
.sidebar-label {
  margin: 0 0 4px;
  padding: 0 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}
.chat-list .subtle {
  padding: 0 10px;
}
.chat-group h3 {
  margin: 10px 0 2px;
  padding: 0 10px;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--faint);
}
.chat-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
}
.chat-item {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 7px;
}
.chat-item:hover,
.chat-item:focus-within {
  background: var(--hover);
}
.chat-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 34px 0 10px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  text-align: left;
  font-size: var(--text-sm);
  color: var(--text);
  text-decoration: none;
}
.chat-open[aria-current='page'] {
  background: var(--selected);
  color: var(--ink);
  font-weight: 600;
}
.chat-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-running {
  margin-left: auto;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--active-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: image-spin 0.9s linear infinite;
}
.chat-running.uncertain {
  animation: none;
  border-color: var(--warn);
  border-style: dashed;
}
.chat-more {
  position: absolute;
  right: 2px;
  width: 28px;
  height: 28px;
  opacity: 0;
}
.chat-item:hover .chat-more,
.chat-more:focus-visible,
.chat-more[aria-expanded='true'] {
  opacity: 1;
}
.chat-more:disabled {
  display: none;
}
.chat-more .icon {
  width: 15px;
  height: 15px;
}
@media (hover: none) {
  .chat-more {
    opacity: 1;
  }
}
/*
 * On a touch screen the small icon buttons take a 44 × 44 tap (docs/cloud-agent-ui.md); the icons stay as they are. A
 * conversation row grows to 44 high so its actions button's tap area does not reach into the next row, and that area
 * runs left from the row's edge, which the scrolling list would otherwise cut off.
 */
@media (pointer: coarse) {
  .chat-open {
    height: 44px;
  }
  .mobile-menu,
  .close-chats,
  #toast-dismiss {
    position: relative;
  }
  .toast .toast-action {
    min-height: 44px;
  }
  .chat-more::after,
  .mobile-menu::after,
  .close-chats::after,
  #toast-dismiss::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }
  .chat-more::after {
    left: auto;
    right: -2px;
    transform: translateY(-50%);
  }
}
/* One conversation's menu: fixed to the window (chat-menu.ts places it), so the scrolling list does not clip it. */
.chat-row-menu {
  position: fixed;
  width: 168px;
}
.chat-row-menu .side-link {
  color: var(--text);
}
.chat-row-menu .side-link:disabled {
  color: var(--faint);
}
/* The sidebar's right edge, dragged to resize it: a strip over the border, drawn only while pointed at or focused. */
.sidebar-resize {
  flex: 0 0 8px;
  margin-left: -8px;
  position: relative;
  height: auto;
  align-self: stretch;
  z-index: 3;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.sidebar-resize[hidden] {
  display: none;
}
.sidebar-resize:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: -1px;
  width: 2px;
  background: transparent;
  transition: background 0.15s;
}
.sidebar-resize:hover:before,
.sidebar-resize:focus-visible:before,
body.sidebar-resizing .sidebar-resize:before {
  background: var(--accent);
}
body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}
.sidebar-bottom {
  position: relative;
  margin-top: auto;
  padding-top: 16px;
  display: grid;
  gap: 6px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  height: auto;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: left;
  text-decoration: none;
}
.side-link:hover {
  background: var(--hover);
  color: var(--ink);
}
.side-link[aria-current='page'] {
  background: var(--selected);
  color: var(--ink);
  font-weight: 600;
}
.side-link > [data-i18n] {
  min-width: 0;
  flex: 1;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  color: var(--muted);
}
.account-row:hover {
  background: var(--hover);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #b9a487;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
}
.avatar.empty {
  background: var(--selected);
}
.avatar img {
  width: 100%;
  height: 100%;
}
.account-text {
  min-width: 0;
  flex: 1;
  display: grid;
  line-height: 1.35;
}
.account-text strong {
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-text small {
  font-size: var(--text-xs);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  height: 100dvh;
}
.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar h1 {
  min-width: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-tag {
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.topbar-end,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-menu,
.conversation-menu {
  position: relative;
}
.menu-panel {
  position: absolute;
  z-index: 40;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 8px 24px var(--shadow);
}
.conversation-panel {
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
}
.account-panel {
  bottom: calc(100% + 8px);
  left: 0;
  width: max(100%, 260px);
  max-width: calc(100vw - 32px);
  max-height: min(70dvh, 420px);
  overflow-y: auto;
}
.choice-panel {
  max-height: min(70dvh, 420px);
  overflow-y: auto;
}
.nested-choice-panel {
  position: static;
  margin: 4px 8px;
  background: var(--panel);
  box-shadow: none;
}
.choice-current {
  flex: none;
  max-width: 45%;
  text-align: right;
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-xs);
  overflow-wrap: normal;
}
#theme-button,
#locale-button {
  min-height: 44px;
}
.choice-chevron {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
[aria-expanded='true'] > .choice-chevron {
  transform: rotate(180deg);
}
.runtime-status {
  font-size: var(--text-xs);
  color: var(--muted);
  margin: 0 4px 4px;
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--line);
}
#retry-history {
  margin-top: 8px;
}
.mobile-menu,
.close-sidebar,
.sidebar-backdrop,
.context-backdrop {
  display: none;
}

/* ---------- navigation folded to its icons (nav-collapse.ts) ---------- */
.collapse-sidebar {
  margin-left: auto;
  color: var(--muted);
}
@media (max-width: 700px) {
  .collapse-sidebar {
    display: none;
  }
}
@media (min-width: 701px) {
  :root[data-nav-collapsed] .sidebar {
    width: 57px;
    padding-inline: 8px;
  }
  :root[data-nav-collapsed] .sidebar-top {
    justify-content: center;
    padding: 0;
  }
  :root[data-nav-collapsed] .sidebar-top {
    position: relative;
  }
  /* The connection state stays visible: a dot at the rail's top corner, with its own label and tooltip. */
  :root[data-nav-collapsed] .connection-indicator {
    position: absolute;
    top: 8px;
    right: 2px;
  }
  :root[data-nav-collapsed] .sidebar-top > :not(.collapse-sidebar, .connection-indicator),
  :root[data-nav-collapsed] .nav-caption,
  :root[data-nav-collapsed] .account-text,
  :root[data-nav-collapsed] .account-row > .icon {
    display: none;
  }
  :root[data-nav-collapsed] .collapse-sidebar {
    margin: 0;
  }
  :root[data-nav-collapsed] .nav a {
    position: relative;
    grid-template-columns: 1fr;
    justify-items: center;
    padding-inline: 0;
  }
  /* The page name stays for screen readers; the link's title shows it on hover. */
  :root[data-nav-collapsed] .nav a > span:not(.nav-meta) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  /* Counts and states that need a look (recording, tasks waiting) become a dot on the icon. */
  :root[data-nav-collapsed] .nav a > .nav-meta {
    display: none;
  }
  :root[data-nav-collapsed] .nav a > :is(.nav-attention, .nav-recording, .warn):not([hidden]) {
    display: block;
    position: absolute;
    top: 6px;
    right: 8px;
    width: 7px;
    height: 7px;
    margin: 0;
    overflow: hidden;
    border-radius: 50%;
    background: var(--danger);
    font-size: 0;
  }
  :root[data-nav-collapsed] .account-row {
    justify-content: center;
    padding-inline: 0;
  }
}
.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 28px 0;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--danger);
  line-height: 1.7;
  flex-shrink: 0;
}
.error-banner .icon-button {
  color: var(--danger);
}
/* A note that an action went through (notice.ts showToast): it floats under the top bar, over drawers, moving nothing. */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  z-index: 70;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 24px var(--shadow);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink);
}
#toast-message {
  min-width: 0;
  margin-right: 6px;
  overflow-wrap: anywhere;
}
.toast-action {
  flex: none;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.toast-action:hover {
  background: var(--hover);
}
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- conversation ---------- */
.chat-view {
  flex-direction: row;
}
.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.messages {
  overflow-anchor: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: auto;
  padding: 32px max(28px, calc((100% - 760px) / 2)) 24px;
  overscroll-behavior: contain;
}
/* Page load, before the page knows who is signed in: sits where the welcome's face appears next. */
.loading-state {
  min-height: 70px;
  margin: clamp(16px, 6dvh, 72px) auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.loading-state p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.empty-state {
  max-width: 620px;
  margin: clamp(16px, 6dvh, 72px) auto 24px;
  text-align: center;
}
.empty-face {
  width: 70px;
  height: 70px;
  position: relative;
  margin: 0 auto 20px;
  color: var(--face);
}
.empty-face svg {
  width: 62px;
  height: 62px;
}
.empty-face > span {
  position: absolute;
  font-size: 16px;
  right: 0;
  top: 6px;
  color: var(--face-soft);
}
.empty-state h2 {
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.5px;
  color: var(--ink);
  margin: 0 0 10px;
}
.empty-state > p {
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 28px 0 24px;
}
.suggestions button {
  min-width: 0;
  text-align: left;
  display: grid;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.suggestions button:hover {
  background: var(--hover);
  border-color: var(--line-hover);
}
.suggestions :is(button, a):focus-visible {
  outline-offset: -3px;
}
.suggestions strong {
  font-size: var(--text-md);
  font-weight: 550;
  color: var(--ink);
}
.suggestions small {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.7;
}
.message-row {
  display: flex;
  gap: 12px;
  margin: 0 0 26px;
  /* A long conversation lays out only the messages on screen; the others keep the size they last had. */
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}
.message-row.message-enter {
  animation: message-in 0.2s ease-out;
}
.message-row.user {
  justify-content: flex-end;
  margin-bottom: 24px;
}
.message-avatar {
  width: 28px;
  height: 28px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-ink);
  flex-shrink: 0;
}
.message-content {
  min-width: 0;
  flex: 1;
}
.message-row.user .message-content {
  max-width: min(88%, 600px);
  flex: initial;
  background: var(--bubble);
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
}
.message-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  margin: 5px 0 8px;
}
.message-body {
  font-size: var(--text-lg);
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: anywhere;
}
.message-row.user .message-body {
  color: var(--ink);
  white-space: pre-wrap;
}
.message-body > :first-child {
  margin-top: 0;
}
.message-body > :last-child {
  margin-bottom: 0;
}
.message-body p {
  margin: 0 0 10px;
  white-space: normal;
}
.message-row.user .message-body p {
  /* Shift+Enter is intentional input; assistant soft breaks follow Markdown. */
  white-space: pre-wrap;
}
.message-body h2,
.message-body h3,
.message-body h4,
.message-body h5,
.message-body h6 {
  font-size: var(--text-lg);
  font-weight: 650;
  color: var(--ink);
  margin: 18px 0 8px;
}
.message-body h2 {
  font-size: 20px;
}
.message-body h3 {
  font-size: 17px;
}
.message-body blockquote {
  margin: 12px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}
.message-body hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}
.message-body .task-list-item {
  list-style: none;
}
.message-body .task-list-item input {
  accent-color: var(--accent);
}
.message-body li > p {
  margin: 0 0 8px;
}
.markdown-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border-radius: var(--radius);
}
.message-body a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.message-body ul,
.message-body ol {
  padding-left: 22px;
  margin: 8px 0 12px;
}
.message-body li {
  padding-left: 2px;
}
.message-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 1px 5px;
  background: var(--code-bg);
  border-radius: 4px;
}
.table-scroll {
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.message-body table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: var(--text-sm);
  line-height: 1.6;
}
.message-body th,
.message-body td {
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.message-body th {
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.message-body tbody tr:last-child td {
  border-bottom: 0;
}
.code-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 12px 0;
  overflow: hidden;
}
.code-block .code-title {
  padding: 6px 12px;
  background: var(--code-title);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--text-xs);
}
.code-block pre {
  overflow: auto;
  margin: 0;
  padding: 12px;
  font-size: var(--text-sm);
  line-height: 1.65;
  white-space: pre;
}
.code-block code {
  padding: 0;
  background: transparent;
  font-size: inherit;
}
.trace {
  margin: 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.trace > summary,
.step > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: var(--text-sm);
}
.trace > summary::-webkit-details-marker,
.step > summary::-webkit-details-marker {
  display: none;
}
.trace > summary {
  padding: 8px 12px;
  color: var(--text);
}
.trace > summary:after {
  content: '';
  width: 6px;
  height: 6px;
  margin: 0 2px 3px 4px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.trace[open] > summary:after {
  margin-bottom: -2px;
  transform: rotate(-135deg);
}
.trace-dot,
.step-dot {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}
.status-spinner {
  display: inline-block;
  border: 2px solid var(--active-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: image-spin 0.9s linear infinite;
}
.trace.running[open] > summary > .status-spinner {
  animation: none;
}
.trace.running {
  border-color: var(--active-line);
}
.trace.running > summary > .trace-text,
.step.running > summary > .step-verb {
  color: var(--accent-ink);
  font-weight: 600;
}
.step.running > summary {
  background: var(--accent-soft);
}
.failed > summary > .trace-dot,
.failed > summary > .step-dot {
  color: var(--danger);
}
.uncertain > summary > .trace-dot,
.uncertain > summary > .step-dot {
  color: var(--warn);
}
.trace-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.trace-status,
.step-status {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}
.trace.failed > summary > .trace-status,
.step.failed > summary > .step-status {
  color: var(--danger);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 6px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1px;
}
.step > summary {
  padding: 6px 8px;
  border-radius: 6px;
}
.step > summary:hover {
  background: var(--hover);
}
.step-verb {
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
}
.step-target {
  min-width: 0;
  flex: 1;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-body {
  padding: 6px 8px 10px 22px;
  color: var(--text);
}
.step-body .text-link {
  margin-bottom: 8px;
}
.step-hint {
  margin: 0 0 10px;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text);
}
.step-hint .text-link {
  margin: 0 0 0 4px;
}
.step-body h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--muted);
}
.step-body pre {
  font-size: var(--text-xs);
  font-family: var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
  margin: 0 0 10px;
  max-height: 280px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}
.write-card {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: var(--text-sm);
}
.write-card.awaiting {
  border-color: var(--warn-line);
}
.write-card.failed,
.write-card.refused {
  border-color: var(--danger-line);
}
.write-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
}
.write-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.write-title .icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.write-status {
  margin-left: auto;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: normal;
}
.write-card.awaiting .write-status {
  background: var(--warn-soft);
  color: var(--warn);
}
.write-card.executed .write-status {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.write-card.failed .write-status,
.write-card.refused .write-status {
  background: var(--danger-soft);
  color: var(--danger);
}
.write-quote {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0 0 8px;
  padding: 0 0 0 10px;
  border-left: 3px solid var(--line-strong);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.write-quote-sender {
  margin-right: 6px;
  font-weight: 600;
  color: var(--text);
}
.write-text {
  margin: 0 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
  max-height: 280px;
  overflow: auto;
  color: var(--ink);
}
.write-text-title {
  display: block;
  margin-bottom: 2px;
}
.write-signature {
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--faint);
}
.write-text-legacy {
  padding: 8px 10px;
  border-left: 3px solid var(--line-strong);
  background: var(--panel);
}
.write-fields {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0 0 8px;
}
.write-fields dt {
  color: var(--muted);
}
.write-fields dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.write-summary {
  margin: 0 0 8px;
  color: var(--muted);
}
.write-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.write-actions .text-link {
  margin: 0;
}
.write-note {
  font-size: var(--text-xs);
  color: var(--muted);
}
.write-request {
  margin-left: auto;
}
.write-request[open] {
  flex-basis: 100%;
  margin-left: 0;
}
.write-request > summary {
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: right;
}
.write-request .step-body {
  padding-left: 0;
  margin-top: 6px;
}
.message-error {
  font-size: var(--text-sm);
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin: 10px 0;
  line-height: 1.7;
}
.message-annotation {
  font-size: var(--text-xs);
  color: var(--muted);
  padding-top: 8px;
}
.composer-wrap {
  flex-shrink: 0;
  padding: 8px max(28px, calc((100% - 760px) / 2)) 16px;
}
.composer {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 4px 24px var(--shadow-soft);
  background: var(--bg);
  padding: 12px 12px 10px 16px;
}
.composer:focus-within {
  border-color: var(--focus-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.composer textarea {
  display: block;
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--ink);
  min-height: 50px;
  max-height: 180px;
  padding: 0;
  background: transparent;
}
.composer textarea::placeholder {
  color: var(--faint);
}
.composer textarea:disabled {
  cursor: not-allowed;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.composer-bottom > span {
  font-size: var(--text-xs);
  color: var(--faint);
}
.composer-bottom > div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tier-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.tier-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: var(--text-sm);
}
.tier-trigger:hover:not(:disabled),
.tier-trigger[aria-expanded='true'] {
  background: var(--accent-soft);
  border-color: var(--line-strong);
  color: var(--accent-ink);
}
.tier-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.tier-chevron {
  width: 14px;
  height: 14px;
}
.tier-trigger[aria-expanded='true'] .tier-chevron {
  transform: rotate(180deg);
}
.tier-panel {
  right: 0;
  bottom: calc(100% + 10px);
  width: min(200px, calc(100vw - 32px));
}
.tier-scope {
  white-space: normal;
  line-height: 1.5;
}
.choice-heading {
  margin: 4px 8px 6px;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
}
.choice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  text-align: left;
}
.choice-option > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.choice-option:hover {
  background: var(--hover);
}
.choice-option[aria-checked='true'] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.choice-option strong,
.choice-option small {
  display: block;
}
.choice-option strong {
  font-size: var(--text-sm);
  font-weight: 600;
}
.choice-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--text-xs);
}
.choice-check {
  flex-shrink: 0;
  visibility: hidden;
}
.choice-option[aria-checked='true'] .choice-check {
  visibility: visible;
}
.composer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.voice-action,
.voice-retry {
  border: 0;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 7px;
  font-size: var(--text-xs);
  padding: 6px 10px;
  white-space: nowrap;
}
.voice-action:hover,
.voice-retry:hover {
  background: var(--selected);
}
.voice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--text-xs);
}
.voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-line);
  animation: voice-pulse 1.5s infinite;
}
@keyframes voice-pulse {
  50% {
    opacity: 0.45;
  }
}
.voice-meter {
  height: 6px;
  width: min(20vw, 100px);
  overflow: hidden;
  border-radius: 99px;
  background: var(--danger-line);
}
.voice-meter i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--danger);
  transform: scaleX(0.04);
  transform-origin: left;
  transition: transform 80ms linear;
}
.voice-progress {
  flex: 1;
  color: var(--muted);
}
.voice-action {
  color: var(--danger);
  background: var(--bg);
  border: 1px solid var(--danger-line);
}
.voice-action-done {
  color: var(--on-dark);
  background: var(--dark);
  border-color: transparent;
}
.voice-status {
  margin: 8px 2px 0;
  color: var(--danger);
  font-size: var(--text-xs);
  line-height: 1.6;
}
.voice-retry {
  padding: 3px 7px;
}
.send-button {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--dark);
  color: var(--on-dark);
  display: grid;
  place-items: center;
}
.send-button:hover:not(:disabled) {
  filter: brightness(1.12);
}
.send-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.send-button:disabled {
  background: var(--disabled);
  color: var(--on-disabled);
  opacity: 1;
}
.voice-start {
  cursor: pointer;
}
.voice-start:disabled {
  cursor: not-allowed;
}
.stop-button {
  height: 32px;
  font-size: var(--text-xs);
  color: var(--muted);
}
.auto-reply {
  margin: 16px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}
.auto-reply-row,
.auto-reply-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.auto-reply-label {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--ink);
}
.auto-reply-status {
  margin-left: auto;
}
.auto-reply-status[data-state='on'] {
  color: var(--accent);
}
.auto-reply-status[data-state='needs_reauth'] {
  color: var(--warn);
}
.auto-reply-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
}
.auto-reply-switch::before {
  content: '';
  position: absolute;
  inset: 6px 4px;
  border-radius: 12px;
  background: var(--line-strong);
  transition: background 0.15s;
}
.auto-reply-switch[aria-checked='true']::before {
  background: var(--accent);
}
.auto-reply-switch:disabled {
  opacity: 0.6;
  cursor: default;
}
.auto-reply-switch:focus-visible {
  outline: 2px solid var(--focus-line);
  outline-offset: 2px;
}
.auto-reply-knob {
  position: absolute;
  top: 8px;
  left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--on-dark);
  transition: transform 0.15s;
}
.auto-reply-switch[aria-checked='true'] .auto-reply-knob {
  transform: translateX(16px);
}
.auto-reply-description {
  margin: 6px 0 0;
  color: var(--text);
}
.auto-reply-stop {
  margin: 2px 0 12px;
  font-size: var(--text-xs);
}
.auto-reply-rules {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.auto-reply-rules-text {
  flex: 1;
  min-width: 0;
}
.auto-reply-rules-title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}
.auto-reply-rules-summary {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.auto-reply-rules-summary.is-empty {
  color: var(--muted);
}
.auto-reply-rules > .button {
  flex: none;
}
.auto-reply-rules-saved {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: var(--text-xs);
}
/* Wide enough to read rules as rows beside the defaults they change; stacked on narrow screens. */
#auto-reply-rules-dialog {
  width: 1040px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.auto-reply-rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
  margin: 12px 0 0;
}
@media (max-width: 860px) {
  .auto-reply-rules-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.auto-reply-rules-mine h3,
.auto-reply-rules-suggestions-wrap h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
}
.auto-reply-rules-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* One rule: its kind as a coloured chip, the rule, and delete. The kind's colour is the row's left edge as well. */
.auto-reply-rule {
  --rule-ink: var(--muted);
  --rule-soft: var(--surface-soft);
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 6px 6px 6px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--rule-ink);
  border-radius: var(--radius);
  background: var(--panel);
}
.auto-reply-rule[data-kind='skip'],
.auto-reply-rule-suggestion[data-kind='skip'] {
  --rule-ink: var(--danger);
  --rule-soft: var(--danger-soft);
}
.auto-reply-rule[data-kind='follow_up'],
.auto-reply-rule-suggestion[data-kind='follow_up'] {
  --rule-ink: var(--warn);
  --rule-soft: var(--warn-soft);
}
.auto-reply-rule[data-kind='how'],
.auto-reply-rule-suggestion[data-kind='how'] {
  --rule-ink: var(--accent-ink);
  --rule-soft: var(--accent-soft);
}
.auto-reply-rule[data-kind='tone'],
.auto-reply-rule-suggestion[data-kind='tone'] {
  --rule-ink: var(--brand-dot);
  --rule-soft: var(--selected);
}
.auto-reply-rule-kind {
  width: 100%;
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--rule-soft);
  color: var(--rule-ink);
  font-size: var(--text-sm);
  font-weight: 600;
}
.auto-reply-rule-kind:focus-visible,
.auto-reply-rule-text:focus-visible {
  border-color: var(--focus-line);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.auto-reply-rule-text {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-md);
  line-height: 1.6;
  resize: none;
}
.auto-reply-rule-text:hover:not(:disabled) {
  border-color: var(--line);
}
.auto-reply-rule-text::placeholder {
  color: var(--faint);
}
.auto-reply-rule-remove {
  color: var(--muted);
}
.auto-reply-rule-remove:hover:not(:disabled) {
  color: var(--danger);
}
.auto-reply-rules-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-sm);
}
.auto-reply-rules-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.auto-reply-rules-suggestions-wrap {
  margin-top: 16px;
}
.auto-reply-rules-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.auto-reply-rules-suggestions[hidden],
.auto-reply-rules-suggestions-wrap:has(> .auto-reply-rules-suggestions[hidden]) {
  display: none;
}
.auto-reply-rule-suggestion {
  --rule-ink: var(--muted);
  --rule-soft: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-sm);
}
.auto-reply-rule-suggestion:hover:not(:disabled) {
  border-color: var(--rule-ink);
}
.auto-reply-rule-suggestion .icon {
  width: 12px;
  height: 12px;
  color: var(--muted);
}
.auto-reply-rule-suggestion-kind {
  padding: 0 6px;
  border-radius: 4px;
  background: var(--rule-soft);
  color: var(--rule-ink);
  font-size: var(--text-xs);
  font-weight: 600;
}
@media (max-width: 560px) {
  .auto-reply-rule {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .auto-reply-rule-kind {
    grid-column: 1;
    width: auto;
    justify-self: start;
  }
  .auto-reply-rule-text {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .auto-reply-rule-remove {
    grid-column: 2;
    grid-row: 1;
  }
}
.auto-reply-rules-defaults {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.6;
}
.auto-reply-rules-defaults h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
}
#auto-reply-rules-dialog .auto-reply-rules-defaults p {
  margin: 2px 0 0;
  color: inherit;
  font-size: inherit;
}
.auto-reply-rules-defaults ul {
  margin: 4px 0 10px;
  padding-left: 18px;
}
.auto-reply-rules-defaults ul:last-child {
  margin-bottom: 0;
}
#auto-reply-rules-dialog .auto-reply-rules-count {
  margin: 6px 0 16px;
  font-size: var(--text-xs);
  text-align: right;
}
.auto-reply-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.auto-reply-meta {
  font-size: var(--text-xs);
}
.auto-reply-reauth {
  color: var(--accent);
}
#auto-reply-confirm {
  width: 520px;
}
#auto-reply-confirm .auto-reply-consent-account {
  color: var(--ink);
  font-weight: 550;
}
.auto-reply-consent {
  padding-left: 20px;
  color: var(--text);
  font-size: var(--text-md);
  line-height: 1.75;
}
.auto-reply-consent li + li {
  margin-top: 10px;
}
.auto-reply-outcome {
  flex-shrink: 0;
  color: var(--muted);
  font-size: var(--text-xs);
}
.auto-reply-outcome[data-state='sent'] {
  color: var(--accent);
}
.auto-reply-outcome[data-state='failed'] {
  color: var(--danger);
}
.composer-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-xs);
  color: var(--muted);
  margin: 10px 4px 0;
  line-height: 1.6;
}
/* The conversation's goal (/goal), one line above the composer; expanding shows the whole objective. */
.goal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 0 8px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: var(--text-sm);
}
.goal-status {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--ink);
}
.goal-bar[data-status='active'] .goal-status,
.goal-bar[data-status='waiting'] .goal-status {
  color: var(--accent-ink);
}
.goal-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}
.goal-bar.goal-bar-expanded {
  align-items: flex-start;
}
.goal-bar.goal-bar-expanded .goal-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 30vh;
  overflow-y: auto;
}
.goal-elapsed,
.goal-note {
  flex-shrink: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.goal-note {
  color: var(--danger);
}
.goal-toggle {
  flex-shrink: 0;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-xs);
}
.goal-toggle:hover {
  background: var(--hover);
}
.goal-icon {
  width: 26px;
  height: 26px;
}
.goal-bar-expanded .goal-chevron {
  transform: rotate(180deg);
}
@media (max-width: 720px) {
  .goal-note {
    display: none;
  }
}

.run-indicator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--accent-ink);
  padding: 0 4px 10px;
}
.run-indicator #run-detail {
  overflow-wrap: anywhere;
  color: var(--muted);
  margin-left: auto;
  font-size: var(--text-xs);
}
.working-dot {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid var(--active-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: image-spin 0.9s linear infinite;
}
.run-indicator[data-state='unknown'] .working-dot,
.run-indicator[data-state='syncing'] .working-dot,
.run-indicator[data-state='stopping'] .working-dot {
  animation: none;
  border-color: var(--warn);
}
.run-slot {
  min-height: 30px;
}
.run-jump {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.run-jump:enabled:hover {
  text-decoration: underline;
}
.run-jump:disabled {
  opacity: 1;
  cursor: default;
}
.send-control {
  position: relative;
  display: inline-flex;
}
.send-help {
  visibility: hidden;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: min(280px, 80vw);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  box-shadow: 0 4px 16px var(--shadow-soft);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.send-control:not(.help-dismissed):is(:hover, :focus-within) .send-help {
  visibility: visible;
}

/* ---------- context panel ---------- */
.context-panel {
  /* context.ts sets --context-width from the width the reader dragged; 360px until then. */
  width: var(--context-width, 360px);
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}
.workspace-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.workspace-tabs [role='tab'] {
  padding: 8px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
}
.workspace-tabs [aria-selected='true'] {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}
/* The panel's left edge, dragged to resize it: a strip over the border, drawn only while pointed at or focused. */
.context-resize {
  flex: 0 0 8px;
  margin-right: -8px;
  position: relative;
  z-index: 3;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.context-resize[hidden] {
  display: none;
}
.context-resize:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: transparent;
  transition: background 0.15s;
}
.context-resize:hover:before,
.context-resize:focus-visible:before,
body.context-resizing .context-resize:before {
  background: var(--accent);
}
body.context-resizing {
  cursor: col-resize;
  user-select: none;
}
#context-attention {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--text-xs);
  font-weight: 600;
}
.workspace-tabs .count {
  margin-left: 4px;
  font-size: var(--text-xs);
  color: var(--muted);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
}
.panel-head h2 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--ink);
}
#files-title {
  margin: 0 0 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}
.panel-section .count {
  font-weight: 400;
  color: var(--faint);
  margin-left: 2px;
}
.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  min-width: 0;
  font-size: var(--text-sm);
}
.source-link,
.source-label {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
  color: var(--text);
}
.source-link {
  text-decoration: none;
}
.source-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- pages (connections) ---------- */
.connections-view,
.trash-view {
  overflow-y: auto;
}

/* ---------- memory ---------- */
.memory-view {
  --memory-time-width: 38px;
  padding: 24px 28px 20px;
  gap: 14px;
  min-height: 0;
}
.memory-view:lang(en) {
  --memory-time-width: 64px;
}
.memory-head {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.memory-head .page-title {
  font-size: 22px;
}
.memory-tabs {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow-x: auto;
}
.memory-tabs button {
  flex-shrink: 0;
  font: inherit;
  font-size: var(--text-sm);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 14px;
  cursor: pointer;
}
.memory-tabs button + button {
  border-left: 1px solid var(--line);
}
.memory-tabs button[aria-selected='true'] {
  background: var(--selected);
  color: var(--ink);
  font-weight: 600;
}
.memory-search {
  flex: 1 1 200px;
  max-width: 360px;
  min-width: 0;
}
.memory-search input {
  width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
}
.memory-search input:focus {
  outline: none;
  border-color: var(--focus-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.memory-progress {
  font-size: var(--text-xs);
  color: var(--faint);
}
/* The list and the pane fill the view below its head and scroll on their own. */
.memory-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.memory-list {
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 6px 0 12px;
}
.memory-pane {
  min-width: 0;
  overflow-y: auto;
  padding: 18px 24px 28px;
}
.memory-body.is-empty {
  grid-template-columns: minmax(0, 1fr);
  overflow-y: auto;
}
.memory-empty-state {
  align-self: center;
  justify-self: center;
  width: min(100%, 560px);
  padding: 32px 24px;
  text-align: center;
  color: var(--text);
}
.memory-empty-state > .icon {
  width: 40px;
  height: 40px;
  color: var(--accent-ink);
}
.memory-empty-state h3 {
  margin: 20px 0 12px;
  font-size: var(--text-title);
  color: var(--ink);
}
.memory-empty-state p {
  line-height: 1.7;
}
#memory-empty-progress {
  white-space: pre-line;
}
#memory-empty-progress.warn {
  color: var(--warn);
}
.memory-empty-state .button {
  margin-top: 12px;
}
.memory-row,
.memory-episode,
.memory-evidence-item,
.memory-item-main {
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.memory-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 8px;
  width: 100%;
  padding: 7px 16px 7px 13px;
  border-left: 3px solid transparent;
}
.memory-row:hover,
.memory-episode:hover {
  background: var(--hover);
}
.memory-row[aria-current='true'],
.memory-episode[aria-current='true'] {
  background: var(--selected);
  border-left-color: var(--accent);
}
.memory-row:focus-visible,
.memory-episode:focus-visible,
.memory-evidence-item:focus-visible,
.memory-item-main:focus-visible,
.memory-tabs button:focus-visible {
  outline: 2px solid var(--focus-line);
  outline-offset: -2px;
}
.memory-row-label {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.memory-row-meta,
.memory-row-sub {
  font-size: var(--text-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.memory-row-sub {
  flex-basis: 100%;
}
/* Under today in the changes view: when memory consolidates, and 立即整理. */
.memory-consolidation {
  margin: 2px 12px 10px 16px;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: var(--text-xs);
  color: var(--muted);
}
.memory-consolidation p {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.memory-consolidation-next {
  color: var(--ink);
}
.memory-consolidation-last {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.memory-consolidation-error {
  color: var(--warn);
}
.memory-consolidation-failed {
  margin: 0 0 4px;
  padding-left: 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.memory-consolidate {
  margin-top: 4px;
}
.memory-group {
  position: sticky;
  top: -6px;
  z-index: 1;
  background: var(--panel);
  padding: 10px 16px 3px;
  font-size: var(--text-xs);
  color: var(--faint);
}
.memory-separator {
  height: 1px;
  margin: 4px 16px;
  background: var(--line);
}
.memory-episode {
  display: grid;
  grid-template-columns: var(--memory-time-width) 10px minmax(0, 1fr);
  gap: 0 8px;
  width: 100%;
  padding: 6px 16px 6px 13px;
  border-left: 3px solid transparent;
}
.memory-episode time {
  font-size: var(--text-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  white-space: nowrap;
}
.memory-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}
.memory-dot.strong {
  background: var(--accent);
}
.memory-episode-text {
  color: var(--ink);
  font-size: var(--text-md);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.memory-episode-source {
  grid-column: 3;
  font-size: var(--text-xs);
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-result {
  grid-template-columns: var(--memory-time-width) auto minmax(0, 1fr);
}
.memory-result .memory-badge {
  align-self: start;
  margin-top: 2px;
}
.memory-fold,
.memory-more,
.memory-link {
  font: inherit;
  font-size: var(--text-xs);
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
}
.memory-fold {
  display: block;
  padding: 0 16px 6px calc(var(--memory-time-width) + 39px);
}
.memory-more {
  display: block;
  margin: 10px 16px 0;
}
/* A day of the episodes view: its date, how many episodes, who and what; unfolded, its timeline follows. */
.memory-day .memory-row-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 2px 1px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.memory-day[aria-expanded='true'] .memory-row-label::before {
  transform: rotate(45deg);
}
.memory-day .memory-row-sub {
  padding-left: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The day being read stays in view above its timeline. */
.memory-day[aria-expanded='true'] {
  position: sticky;
  top: -6px;
  z-index: 1;
  background: var(--panel);
}
.memory-day[aria-expanded='true']:hover {
  background: var(--hover);
}
.memory-timeline {
  padding-bottom: 6px;
}
.memory-day-rest {
  padding: 0 16px 8px calc(var(--memory-time-width) + 39px);
  font-size: var(--text-xs);
}
.memory-day-rest p {
  margin: 0 0 4px;
}
.memory-day-rest .memory-more {
  margin: 0;
}
.memory-fold:hover,
.memory-more:hover,
.memory-link:hover {
  text-decoration: underline;
}
.memory-filter {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 16px 8px;
  font-size: var(--text-sm);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.memory-empty,
.memory-hint {
  margin: 0;
  color: var(--faint);
  font-size: var(--text-sm);
}
.memory-empty {
  padding: 18px 16px;
}
.memory-pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 6px;
}
.memory-pane-head h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}
.memory-aliases {
  font-size: var(--text-sm);
  color: var(--faint);
}
.memory-open {
  font-size: var(--text-sm);
  color: var(--accent);
  margin-left: auto;
}
.memory-card-text {
  margin: 0 0 14px;
  color: var(--muted);
  max-width: 68ch;
}
.memory-section {
  display: grid;
  gap: var(--space-compact);
  margin-top: var(--space-group);
}
.memory-section h4 {
  margin: 0 0 var(--space-control);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.memory-item-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 12px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
}
.memory-item-main.fact {
  grid-template-columns: 7.5em minmax(0, 1fr);
}
.memory-item-main.memory-change-head {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
}
.memory-change-head .memory-value {
  font-weight: 600;
}
.memory-item-main:hover {
  background: var(--hover);
}
.memory-item-main[aria-expanded='true'] {
  background: var(--panel);
}
.memory-aspect {
  color: var(--faint);
  font-size: var(--text-sm);
  padding-top: 1px;
  overflow-wrap: anywhere;
}
.memory-value {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.memory-value .memory-badge {
  margin-left: 8px;
}
.memory-previous {
  display: block;
  font-size: var(--text-xs);
  color: var(--faint);
  text-decoration: line-through;
}
.memory-badge {
  font-size: 11px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.memory-badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.memory-evidence {
  display: grid;
  gap: 2px;
  margin: 2px 0 6px 16px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
}
.memory-evidence-item {
  display: flex;
  gap: 8px;
  padding: 3px 4px;
  font-size: var(--text-sm);
  color: var(--accent);
  border-radius: 4px;
}
.memory-evidence-item:hover {
  background: var(--hover);
}
.memory-evidence-item time {
  flex: none;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.memory-all {
  justify-self: start;
  padding: 4px 8px;
}
.memory-related,
.memory-back {
  display: inline-block;
  margin-top: 18px;
  font-size: var(--text-sm);
}
.memory-back {
  margin: 0 0 10px;
}
.memory-source {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}
.memory-block {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: var(--text-md);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
/* A source's text, rendered from its Markdown and HTML (markdown.ts renderSource). */
.memory-block-text {
  min-width: 0;
  white-space: normal;
}
.memory-block-text > :first-child {
  margin-top: 0;
}
.memory-block-text > :last-child {
  margin-bottom: 0;
}
.memory-block-text :is(p, ul, ol, blockquote, pre, details, table) {
  margin: 0 0 6px;
}
.memory-block-text :is(h1, h2, h3, h4, h5, h6) {
  margin: 8px 0 4px;
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--ink);
}
.memory-block-text :is(ul, ol) {
  padding-left: 22px;
}
.memory-block-text blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}
.memory-block-text code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 1px 5px;
  background: var(--code-bg);
  border-radius: 4px;
}
.memory-block-text pre {
  overflow-x: auto;
  padding: 8px 10px;
  background: var(--code-bg);
  border-radius: 6px;
}
.memory-block-text pre code {
  padding: 0;
  background: none;
}
.memory-block-text a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.memory-block-text hr {
  margin: 10px 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}
.memory-block-text summary {
  cursor: pointer;
  color: var(--muted);
}
.memory-block-text table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.memory-block-text :is(th, td) {
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}
.memory-block-text .markdown-image {
  max-height: 320px;
  margin: 4px 0;
}
.memory-image {
  display: inline-block;
  margin: 4px 0;
  vertical-align: top;
}
.memory-image img {
  display: block;
  max-width: min(100%, 320px);
  max-height: 240px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
}
.memory-image-missing {
  color: var(--muted);
}
.memory-source.chat .memory-block {
  display: grid;
  grid-template-columns: minmax(64px, 110px) minmax(0, 1fr);
  gap: 10px;
}
.memory-sender {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  font-size: var(--text-xs);
  color: var(--muted);
  padding-top: 3px;
  overflow-wrap: anywhere;
}
.memory-sender time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.memory-block.heading {
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
}
.memory-table {
  overflow-x: auto;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.memory-table table {
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 100%;
}
.memory-table th,
.memory-table td {
  text-align: left;
  vertical-align: top;
  padding: 5px 8px;
  border-top: 1px solid var(--line);
  min-width: 4em;
  max-width: 28em;
}
.memory-table th {
  border-top: 0;
  color: var(--muted);
  font-weight: 600;
}
.memory-episode-card {
  display: grid;
  gap: 6px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.memory-episode-card p {
  margin: 0;
  color: var(--ink);
}
.memory-pane > .memory-episode-card:first-child {
  margin-top: 0;
}
.memory-view-source {
  justify-self: start;
  font-size: var(--text-sm);
}
.memory-card-label {
  font-size: var(--text-xs);
  color: var(--faint);
}
.memory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.memory-chip {
  font: inherit;
  font-size: var(--text-xs);
  padding: 1px 9px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.memory-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 900px) {
  .memory-view {
    overflow-y: auto;
    padding: 18px 16px;
  }
  .memory-body {
    flex: none;
    grid-template-columns: 1fr;
    align-content: start;
    overflow: visible;
  }
  .memory-list {
    max-height: 46vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .memory-pane {
    overflow: visible;
    padding: 16px;
  }
}
.page {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: 36px 28px 48px;
}
.page-title {
  font-size: 26px;
  font-weight: 650;
  color: var(--ink);
  margin: 0;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page-head > .page-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.page-lead {
  font-size: var(--text-md);
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.7;
}
.page-note {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}
.page-note p {
  margin: 0;
  font-size: var(--text-md);
  color: var(--text);
}
.page-section {
  margin: 30px 0 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}
.trash-items {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.trash-items:empty {
  display: none;
}
.trash-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-top: 1px solid var(--line);
}
.trash-row:first-child {
  border-top: 0;
}
.trash-row-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.trash-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-md);
  color: var(--ink);
}
.trash-row-time {
  font-size: var(--text-xs);
  color: var(--faint);
}
.trash-row .button-quiet {
  color: var(--danger);
}
.trash-empty {
  margin: 22px 0 0;
  font-size: var(--text-md);
  color: var(--muted);
}
/* memory: a day's changes */
.memory-summary {
  margin: 4px 0 12px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.memory-summary:empty {
  display: none;
}
.memory-pending {
  margin: 0 0 12px;
  padding: 10px 14px;
  font-size: var(--text-sm);
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
}
.memory-lines {
  list-style: none;
  margin: 6px 0 16px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.memory-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.memory-line:first-child {
  border-top: 0;
}
.memory-kind {
  flex: none;
  min-width: 48px;
  font-size: var(--text-xs);
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
  text-align: center;
}
.memory-removed .memory-kind {
  color: var(--danger);
  background: var(--danger-soft);
}
.memory-updated .memory-kind {
  color: var(--warn);
  background: var(--warn-soft);
}
.memory-line-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.memory-text {
  font-size: var(--text-md);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.memory-removed .memory-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-hover);
}
.memory-meta {
  font-size: var(--text-xs);
  color: var(--muted);
}
.memory-time {
  flex: none;
  font-size: var(--text-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
/* meetings */
.nav-recording {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--danger);
  font-weight: 600;
}
.nav-recording::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: voice-pulse 1.5s infinite;
}
.nav-recording[hidden] {
  display: none;
}
.meeting-setup {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 640px;
}
.meeting-setup h3 {
  margin: 0 0 16px;
}
.meeting-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.meeting-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.meeting-mode:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.meeting-mode:has(input:disabled) {
  color: var(--muted);
  cursor: default;
}
.meeting-mode input {
  accent-color: var(--accent);
  flex-shrink: 0;
}
.meeting-mode:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.meeting-start {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
}
.meeting-mic {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text);
}
.meeting-mic select {
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.meeting-mic select:disabled {
  color: var(--faint);
}
.meeting-hint {
  margin: 10px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.6;
}
.meeting-engine-note {
  padding: 8px 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
}
#meeting-start-error {
  margin: 12px 0 0;
}
.meeting-live {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.meeting-live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink);
}
.recording-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-line);
  animation: voice-pulse 1.5s infinite;
}
.recording-dot-paused {
  background: var(--faint);
  box-shadow: 0 0 0 4px var(--line);
  animation: none;
}
.meeting-elapsed {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.meeting-source {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.meeting-live-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
}
.meeting-live-actions .button-dark {
  color: var(--on-dark);
}
.meeting-status {
  margin: 0;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--warn);
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-line);
}
/* Several notices at once each take a line. */
#meeting-status-text {
  white-space: pre-line;
}
.meeting-status[hidden] {
  display: none;
}
.meeting-transcript {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}
.meeting-live-transcript {
  margin: 0;
  padding: 16px;
  max-height: 46vh;
  overflow-y: auto;
}
.meeting-live-transcript .subtle {
  margin: 0;
}
.meeting-paragraph {
  margin: 0;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  font-size: var(--text-lg);
  line-height: 1.75;
  color: var(--ink);
}
.meeting-time {
  padding-top: 3px;
  font-size: var(--text-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.meeting-text {
  overflow-wrap: anywhere;
}
.meeting-interim {
  color: var(--faint);
}
.meeting-items {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.meeting-items:empty {
  display: none;
}
.meeting-items li + li {
  border-top: 1px solid var(--line);
}
.meeting-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 16px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.meeting-items li:first-child .meeting-item {
  border-radius: 10px 10px 0 0;
}
.meeting-items li:last-child .meeting-item {
  border-radius: 0 0 10px 10px;
}
.meeting-items li:only-child .meeting-item {
  border-radius: 10px;
}
.meeting-item:hover {
  background: var(--hover);
}
.meeting-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
}
.meeting-item-meta {
  font-size: var(--text-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.meeting-item-line {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  color: var(--muted);
}
.meeting-back {
  margin-bottom: 14px;
  padding: 0;
}
.meeting-actions {
  display: inline-flex;
  gap: 8px;
}
.meeting-actions #meeting-delete:not([disabled]) {
  color: var(--danger);
}
.meeting-memory {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: var(--text-sm);
  color: var(--muted);
  cursor: pointer;
}
.meeting-rename {
  flex: 1;
  display: flex;
  gap: 8px;
}
.meeting-rename[hidden] {
  display: none;
}
.meeting-rename input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: var(--text-lg);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.meeting-rename input:focus {
  outline: none;
  border-color: var(--focus-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
@media (max-width: 640px) {
  .meeting-paragraph {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .meeting-live-actions {
    margin-left: 0;
  }
  .meeting-status {
    flex-wrap: wrap;
  }
  #meeting-status-text {
    flex-basis: 100%;
    min-width: 0;
  }
  .meeting-status .text-button {
    flex-shrink: 0;
  }
}
.connection-cards {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}
.connection-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}
.connection-head,
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.connection-head {
  flex-wrap: wrap;
}
.tile {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px var(--tile-edge);
}
.tile-github {
  background: #24292f;
}
.tile-lark {
  background: #3370ff;
}
.tile-dingtalk {
  background: #1677ff;
}
.tile-slack {
  background: #4a154b;
}
.tile-notion {
  background: #191919;
}
.tile-shimo {
  background: #41464b;
}
.tile-wecom {
  background: #2aae67;
}
.tile-tencent-meeting {
  background: #0a6cff;
}
.tile-web {
  background: var(--selected);
  color: var(--muted);
}
.tile-small {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
}
.tile-small .icon {
  width: 14px;
  height: 14px;
}
.source-name {
  min-width: 0;
  flex: 1 1 120px;
  display: grid;
  line-height: 1.4;
}
.source-name strong {
  font-size: var(--text-lg);
  font-weight: 650;
  color: var(--ink);
}
.source-name small {
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--side);
  color: var(--muted);
  white-space: nowrap;
}
.status-pill:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.ok {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.status-pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.connection-reads {
  margin: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text);
}
.fact-label {
  color: var(--muted);
}
.connection-hint {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--text-sm);
}
.connection-sync {
  margin: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text);
}
#connections-sync-error {
  display: block;
  margin: 0 0 12px;
}
.connection-sync.busy span:last-child {
  color: var(--accent-ink);
}
.connection-sync.warn,
.connection-sync.warn span:last-child {
  color: var(--warn);
}
.connection-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.connection-actions .text-link {
  margin-left: auto;
}
.connection-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.connection-tabs button {
  padding: 12px 4px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.connection-tabs [aria-selected='true'] {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}
.connection-sync-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.connection-sync-toolbar p {
  margin: 0;
}
.connection-management summary {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text);
}
.connection-management summary::-webkit-details-marker {
  display: none;
}
.connection-management[open] > summary .icon {
  transform: rotate(180deg);
}
.connection-management .connection-actions {
  margin-top: 8px;
}
.upcoming {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.upcoming-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.upcoming-item .tile {
  width: 32px;
  height: 32px;
  font-size: 14px;
  border-radius: 8px;
}
.upcoming-item .source-name strong {
  font-size: var(--text-md);
}
.upcoming-item .source-name small {
  font-size: var(--text-xs);
}
.page-footnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 26px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.7;
}
.page-footnote .icon {
  margin-top: 3px;
  color: var(--accent);
}

/* ---------- dialogs ---------- */
dialog {
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 80px var(--shadow);
  color: var(--text);
  background: var(--bg);
}
dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
dialog h2 {
  font-size: 20px;
  font-weight: 650;
  color: var(--ink);
  margin: 0;
}
dialog p {
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--muted);
  margin: 12px 0;
}
dialog label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 550;
  margin: 20px 0 8px;
  color: var(--ink);
}
dialog input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  font-size: var(--text-md);
}
dialog input:focus {
  border-color: var(--focus-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
dialog input::placeholder {
  color: var(--faint);
}
dialog .token-note {
  font-size: var(--text-xs);
  color: var(--muted);
  margin: 10px 0 20px;
}
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-control) var(--space-row);
  margin-top: var(--space-group);
}
.token-details {
  margin-top: 18px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.token-details summary {
  cursor: pointer;
}
#about-dialog {
  width: 680px;
}
#about-dialog h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin: 20px 0 6px;
}
#about-dialog ul {
  margin: 0;
  padding-left: 18px;
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--text);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}
@keyframes message-in {
  from {
    opacity: 0.2;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* The narrowest phones leave enough room for the brand and the sidebar close button. */
@media (max-width: 480px) {
  .header-tag {
    display: none;
  }
  .voice-bar {
    flex-wrap: wrap;
  }
  .voice-progress {
    flex-basis: calc(100% - 60px);
    min-width: 0;
  }
  .voice-action {
    margin-left: auto;
  }
  .voice-action-done {
    margin-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}

/* ---------- narrow screens ---------- */
@media (max-width: 1199px) {
  .context-panel,
  .context-resize {
    display: none;
  }
  body.context-shown #context-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 21;
    border: 0;
    border-radius: 0;
    background: var(--backdrop);
  }
  body.context-shown .context-panel {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 22;
    height: 100dvh;
    width: min(340px, 92vw);
    box-shadow: -5px 0 40px var(--shadow-drawer);
  }
  .panel-head .icon-button {
    display: inline-flex;
  }
}
@media (max-width: 900px) {
  .topbar,
  .page {
    padding-left: 20px;
    padding-right: 20px;
  }
  .composer-footnote > span {
    display: none;
  }
  .messages,
  .composer-wrap {
    padding-left: 20px;
    padding-right: 20px;
  }
  .error-banner {
    margin-left: 20px;
    margin-right: 20px;
  }
}
@media (max-width: 700px) {
  .sidebar,
  .sidebar-resize {
    display: none;
  }
  body.sidebar-open .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 21;
    width: min(300px, 86vw);
    box-shadow: 5px 0 40px var(--shadow-drawer);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    border: 0;
    border-radius: 0;
    background: var(--backdrop);
  }
  body.sidebar-open .close-sidebar,
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    height: 54px;
    padding: 0 12px 0 8px;
  }
  .topbar h1 {
    font-size: var(--text-md);
  }
  .messages {
    padding: 20px 16px;
  }
  .composer-wrap {
    padding: 8px 12px max(12px, env(safe-area-inset-bottom));
  }
  .error-banner {
    margin: 10px 12px 0;
  }
  .empty-state h2 {
    font-size: 24px;
  }
  .suggestions {
    grid-template-columns: 1fr;
  }
  .message-row.user .message-content {
    max-width: 92%;
  }
  .page {
    padding: 24px 16px 40px;
  }
  .page-note {
    flex-direction: column;
    align-items: stretch;
  }
  .connection-card {
    padding: 16px;
  }
  .connection-reads {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .connection-actions .text-link {
    margin-left: 0;
  }
  dialog {
    padding: 20px;
  }
}

/* Meeting issues keep editable Markdown readable without interpreting model HTML. */
#meeting-issues {
  margin: 24px 0 32px;
}
#meeting-issues h2 {
  font-size: 18px;
  margin-bottom: 12px;
}
.meeting-issue {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-top: 12px;
}
.meeting-issue h3 {
  font-size: 16px;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.meeting-issue-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
}
.meeting-issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.meeting-issue-form {
  display: grid;
  gap: 12px;
}
.meeting-issue-form > label {
  display: grid;
  gap: 6px;
}
.meeting-issue-form input:not([type='checkbox']),
.meeting-issue-form textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 8px;
}
.meeting-issue-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 0;
  padding: 0;
}
.meeting-issues-dismissed {
  margin-top: 20px;
}

/* ---------- local agents (web/devices.ts, web/local-tasks.ts) ---------- */
.local-agents {
  margin-top: 28px;
}
.local-agents-lead {
  margin: 6px 0 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--muted);
}
.local-agents #local-agents-error {
  display: block;
  margin: 12px 0 0;
}
.tile-claude-code {
  background: #c96442;
}
.tile-codex {
  background: var(--dark);
  color: var(--on-dark);
}
.local-policy select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
}
.local-policy-hint {
  grid-column: -2;
  color: var(--muted);
}
@media (max-width: 600px) {
  .memory-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    border: 0;
    overflow: visible;
  }
  .memory-tabs button {
    min-height: 36px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    white-space: nowrap;
  }
  .connection-head {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .connection-head > .status-pill {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
    height: auto;
    min-height: 26px;
    white-space: normal;
  }
  .trash-row {
    flex-wrap: wrap;
  }
  .trash-row-text {
    flex-basis: 100%;
  }
  .trash-row-title {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
.local-connect-dialog {
  width: 560px;
}
.local-connect-dialog .dialog-actions {
  justify-content: flex-end;
}
.local-prompt {
  margin: 0 0 14px;
  max-height: 240px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
.local-connect-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: var(--text-sm);
  color: var(--faint);
}
.local-connect-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.local-connect-step:before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.local-connect-step.done {
  color: var(--accent-ink);
}
.local-connect-step.done:before {
  background: currentColor;
}
.local-connect-step.current {
  color: var(--ink);
}
.local-connect-step.current:before {
  animation: pulse 1.3s infinite;
  background: currentColor;
}
.local-connect-step.failed {
  color: var(--danger);
}
.agent-badge {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}
.chat-awaiting {
  flex-shrink: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--text-xs);
  font-weight: 600;
}
#local-count.attention {
  color: var(--warn);
  font-weight: 600;
}
.local-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.local-tab {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
}
.local-tab[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.local-task-list {
  display: grid;
  gap: 10px;
}
.local-empty {
  display: grid;
  gap: 6px;
  font-size: var(--text-sm);
}
.local-task {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: var(--text-sm);
  min-width: 0;
}
.local-task.awaiting {
  border-color: var(--warn-line);
}
.local-task.failed {
  border-color: var(--danger-line);
}
.local-task-head,
.local-card-task,
.local-result-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.local-task-index {
  flex-shrink: 0;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.local-task-title,
.local-card-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.local-task-state {
  margin-left: auto;
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--muted);
}
.running .local-task-state {
  color: var(--accent);
}
.awaiting .local-task-state {
  color: var(--warn);
  font-weight: 600;
}
.failed .local-task-state {
  color: var(--danger);
}
.completed .local-task-state {
  color: var(--accent-ink);
}
.local-device {
  min-width: 0;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--muted);
}
.local-task-repo {
  margin: 4px 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}
/* A finished task folded to its result. */
.local-task-line {
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--muted);
}
.local-task-line.failed {
  color: var(--danger);
}
/*
 * What the agent says, as a conversation in a block that grows with it up to a cap, so a short task stays compact and
 * one that keeps talking scrolls inside its block instead of pushing the others down. --local-stream-height changes the cap.
 */
.local-stream-wrap {
  position: relative;
  margin-top: 8px;
}
.local-stream {
  max-height: var(--local-stream-height, 220px);
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  overflow-wrap: anywhere;
}
.local-stream:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* Few messages sit at the bottom, where new ones arrive. */
.local-stream > :first-child {
  margin-top: auto;
}
.local-message {
  flex-shrink: 0;
}
.local-stream-empty {
  margin: 0;
  font-size: var(--text-xs);
}
.local-stream-jump {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  box-shadow: 0 2px 8px var(--shadow-drawer);
}
.local-stream-jump[hidden] {
  display: none;
}
.local-task-doing {
  margin: 6px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--accent-ink);
}
.local-steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--muted);
}
.local-step {
  overflow-wrap: anywhere;
}
.local-step.command,
.local-step.file {
  font-family: var(--mono);
}
.local-task-summary {
  margin: 8px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
/* A summary is the agent's Markdown; in the panel it has none of the conversation's reply styles around it. */
.local-markdown > :first-child {
  margin-top: 0;
}
.local-markdown > :last-child {
  margin-bottom: 0;
}
.local-markdown p,
.local-markdown ul,
.local-markdown ol {
  margin: 0 0 6px;
}
.local-markdown ul,
.local-markdown ol {
  padding-left: 18px;
}
.local-markdown code {
  font-family: var(--mono);
  font-size: 0.92em;
}
.local-markdown pre {
  margin: 0 0 6px;
  padding: 6px 8px;
  max-height: 200px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--code-bg);
  font-size: var(--text-xs);
}
.local-files {
  margin: 6px 0 0;
  padding-left: 16px;
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.local-task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.local-approval {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--warn-soft);
}
.local-approval p {
  margin: 0 0 4px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.local-approval .local-approval-title {
  font-weight: 600;
  color: var(--warn);
}
.local-approval pre {
  margin: 4px 0;
  max-height: 120px;
  overflow: auto;
  font-family: var(--mono);
  font-size: var(--text-xs);
  white-space: pre-wrap;
}
.local-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-control) var(--space-row);
  margin-top: var(--space-row);
}
.local-card {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: var(--text-sm);
}
.local-card.failed {
  border-color: var(--danger-line);
}
.local-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.local-card-title {
  font-weight: 600;
  color: var(--ink);
}
.local-card-status {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}
.local-card-approval .local-approval {
  margin-top: 0;
}
.local-card-tasks {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.local-result {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.local-result-title {
  margin: 0;
}
.local-result-changes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}
.local-results-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Uploaded images share the composer's surface and remain usable on narrow screens. */
.composer {
  position: relative;
}
.image-add {
  flex-shrink: 0;
}
#composer-hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-drafts {
  margin-bottom: 12px;
}
.image-draft-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}
.image-draft {
  position: relative;
  width: 88px;
  margin: 0;
  font-size: var(--text-xs);
}
.image-draft.error {
  width: min(240px, 100%);
}
.image-draft-picture {
  position: relative;
  width: 88px;
}
.image-draft-open {
  display: block;
  width: 88px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
  cursor: zoom-in;
}
.image-draft-open:hover {
  border-color: var(--accent);
}
.image-draft-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-draft figcaption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 5px;
}
.image-upload-status {
  display: block;
  color: var(--faint);
  font-size: 11px;
}
.image-draft.uploading .image-upload-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border: 1px solid var(--line-strong);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: image-spin 1s linear infinite;
}
.image-remove {
  position: absolute;
  right: -1px;
  top: 3px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  color: var(--on-dark);
  background: var(--dark);
  cursor: pointer;
}
.image-remove .icon {
  width: 16px;
  height: 16px;
}
.image-error,
.image-notice {
  color: var(--danger);
  font-size: var(--text-xs);
  line-height: 1.4;
  overflow-wrap: anywhere;
  margin: 5px 0 0;
}
.image-retry {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 0;
  border-radius: 5px;
  font-size: var(--text-xs);
  padding: 3px 6px;
  margin-top: 4px;
  cursor: pointer;
}
.image-drop-hint {
  display: none;
}
.image-dragging .image-drop-hint {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  margin: 0;
  border: 2px dashed var(--accent-ink);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  pointer-events: none;
}
.chat-image {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  width: 168px;
  max-width: 100%;
  margin: 4px 10px 8px 0;
}
.chat-image-open {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 116px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  color: var(--faint);
  cursor: zoom-in;
}
.chat-image-open img {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: contain;
}
.chat-image-open img:not([src]) {
  visibility: hidden;
}
.image-preview-status {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}
.chat-image figcaption {
  font-size: var(--text-xs);
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}
.image-viewer {
  position: relative;
  width: min(1160px, calc(100vw - 24px));
  padding: 48px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  max-width: calc(100vw - 24px);
  max-height: 94dvh;
  overflow: auto;
}
.image-viewer::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
#image-close {
  position: absolute;
  top: 10px;
  right: 12px;
}
#image-full {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 74dvh;
  object-fit: contain;
  margin: auto;
}
#image-caption {
  margin: 8px 0 0;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
@keyframes image-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .image-draft.uploading .image-upload-status::before {
    animation: none;
  }
}
@media (max-width: 600px) {
  .image-draft-list {
    gap: 8px;
  }
  .image-draft {
    width: 64px;
  }
  .image-draft-picture {
    width: 64px;
  }
  .image-draft-open {
    width: 64px;
    height: 58px;
  }
  .image-remove {
    width: 26px;
    height: 26px;
  }
  .chat-image {
    width: 132px;
  }
  .chat-image-open img {
    height: 112px;
  }
  #image-full {
    max-width: 100%;
  }
}

/* ---------- Catch application frame and conversation navigation ---------- */
body {
  overflow: hidden;
}
.app-shell {
  min-height: 0;
  height: 100dvh;
}
.sidebar-top {
  min-height: 48px;
  margin: 0 -10px 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.sidebar-top > .header-tag {
  display: none;
}
.brand {
  gap: 8px;
}
.brand [data-brand-name] {
  text-transform: lowercase;
}
.mo-mark,
.catch-mark {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
}
.catch-mark {
  display: none;
}
:root[data-page-brand-id='catch'] .catch-mark {
  display: block;
}
:root[data-page-brand-id='catch'] .mo-mark {
  display: none;
}
.nav-caption {
  padding: 0 8px;
  color: var(--faint);
  font-size: var(--text-xs);
}
.nav {
  margin-top: 9px;
}
.nav a {
  font-size: var(--text-md);
  margin-bottom: 2px;
}
.sidebar-bottom {
  margin-top: auto;
}
.account-text strong,
.account-text small {
  white-space: normal;
  overflow-wrap: anywhere;
}
.main {
  background: var(--wash), var(--bg);
}
.topbar {
  background: var(--topbar);
}
.topbar h1 {
  font-size: var(--text-md);
  font-weight: 450;
}
.breadcrumb-space,
.breadcrumb-divider {
  color: var(--muted);
  font-size: var(--text-md);
  white-space: nowrap;
}
.topbar-title {
  gap: 12px;
}
.top-search {
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--muted);
  background: var(--panel);
  font-size: var(--text-sm);
  white-space: nowrap;
}
.top-search .icon {
  width: 14px;
  height: 14px;
}
.conversation-sidebar {
  flex: 0 0 clamp(200px, var(--sidebar-width, var(--conversation-sidebar)), 480px);
  width: clamp(200px, var(--sidebar-width, var(--conversation-sidebar)), 480px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.conversation-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.conversation-sidebar-head h2 {
  padding: 0 6px;
  margin: 0;
  font-weight: 450;
}
.conversation-sidebar .new-chat {
  flex-shrink: 0;
  margin: 0 0 12px;
  height: 33px;
  font-size: var(--text-sm);
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.chat-search {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.chat-search > .icon {
  width: 14px;
  height: 14px;
  color: var(--faint);
}
.chat-search kbd {
  flex-shrink: 0;
  color: var(--faint);
  font: inherit;
  font-size: var(--text-xs);
}
.chat-search:has(input:not(:placeholder-shown)) kbd {
  display: none;
}
.chat-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  line-height: 20px;
}
.chat-search input::-webkit-search-cancel-button {
  display: none;
}
.chat-search:focus-within {
  border-color: var(--focus-line);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.chat-search .icon-button {
  width: 20px;
  height: 20px;
}
.chat-search .icon-button .icon {
  width: 12px;
  height: 12px;
}
.conversation-sidebar .chats {
  margin: 14px 0 0;
  padding: 0;
}
.chat-main {
  padding: 0 26px;
}
.chat-heading {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 0;
}
.chat-heading h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--text-title);
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-heading .top-actions {
  flex-shrink: 0;
}
.messages {
  padding: 22px 0 24px;
}
.message-row.assistant .message-content {
  border: 1px solid var(--line);
  border-radius: 3px 14px 14px 14px;
  padding: 14px;
  background: var(--panel);
}
.message-body {
  font-size: var(--text-md);
  line-height: 1.75;
}
.message-label {
  margin-top: 0;
}
:root[data-page-brand-id='catch'] .message-avatar {
  background: url('/catch.svg') center / contain no-repeat;
  font-size: 0;
}
.composer-wrap {
  padding: 8px 0 16px;
}
.composer {
  background: var(--panel);
  border-color: var(--line-strong);
}
.composer:has(textarea:disabled) {
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: none;
}
.composer textarea {
  font-size: var(--text-lg);
}
.composer-footnote {
  font-size: var(--text-xs);
  text-align: center;
}
.button-dark {
  background: var(--spectrum);
  color: var(--on-dark);
  border-color: transparent;
}
.button-dark:hover {
  background: var(--spectrum-hover);
  border-color: transparent;
}
.empty-state {
  margin-top: clamp(12px, 4dvh, 40px);
}
.empty-state h2 {
  font-size: var(--text-page);
  font-weight: 550;
}
.empty-state > p {
  font-size: var(--text-md);
}
.empty-face .catch-mark {
  width: 64px;
  height: 64px;
}
:root[data-page-brand-id='catch'] .empty-face > svg,
:root[data-page-brand-id='catch'] .empty-face > span {
  display: none;
}
.suggestions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 26px 0 20px;
  gap: 10px;
  text-align: left;
}
.suggestion-link {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 5px 8px;
  padding: 15px 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  text-decoration: none;
}
.suggestion-link:hover {
  background: var(--hover);
  border-color: var(--line-hover);
}
.suggestion-link > .icon {
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
}
.suggestion-link small {
  grid-column: 2;
  line-height: 1.7;
}
.chat-list-toggle,
.close-chats,
.mobile-tabs {
  display: none;
}
.chats-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  border: 0;
  padding: 0;
  background: var(--backdrop);
}

@media (max-width: 959px) {
  .top-search {
    display: inline-flex;
    min-height: 44px;
  }
  .chat-list-toggle,
  .close-chats {
    display: inline-flex;
  }
  .conversation-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 61;
    width: min(320px, 90vw);
    box-shadow: 8px 0 35px var(--shadow-drawer);
  }
  .breadcrumb-space,
  .breadcrumb-divider {
    display: none;
  }
}
@media (max-width: 700px) {
  .app-shell,
  .main {
    height: calc(100dvh - 66px - env(safe-area-inset-bottom));
  }
  .sidebar-top {
    min-height: 54px;
  }
  body.sidebar-open .sidebar {
    z-index: 61;
    width: min(300px, 86vw);
  }
  body.sidebar-open .sidebar-backdrop {
    z-index: 60;
  }
  .topbar {
    height: 54px;
    padding: 0 12px;
  }
  .topbar-title {
    gap: 8px;
  }
  .topbar h1 {
    font-size: var(--text-sm);
  }
  .topbar-end {
    gap: 5px;
  }
  .top-search {
    width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    background: transparent;
    border-color: transparent;
  }
  .top-search > span {
    display: none;
  }
  .chat-main {
    padding: 0 16px;
  }
  .chat-heading {
    min-height: 54px;
  }
  .chat-heading h2 {
    font-size: 18px;
  }
  .chat-heading #toggle-context > span {
    display: none;
  }
  .chat-heading #toggle-context {
    padding: 0 7px;
  }
  .messages {
    padding: 10px 0 18px;
  }
  .empty-state {
    margin: 10px auto 14px;
  }
  .empty-face {
    margin-bottom: 14px;
  }
  .empty-state h2 {
    font-size: 23px;
  }
  .suggestions {
    grid-template-columns: 1fr;
    margin: 20px 0 16px;
    gap: 8px;
  }
  .suggestion-link {
    padding: 11px 12px;
  }
  .composer-wrap {
    padding: 8px 0 10px;
  }
  .composer textarea,
  .chat-search input {
    font-size: 16px;
  }
  .composer-footnote {
    font-size: 10px;
    line-height: 1.6;
  }
  .composer-footnote > span {
    display: none;
  }
  .composer-bottom {
    flex-wrap: wrap;
    gap: 7px;
  }
  .composer-hint {
    font-size: var(--text-xs);
  }
  .mobile-tabs {
    position: fixed;
    inset: auto 0 0;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 5px 12px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--panel);
  }
  .mobile-tabs a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-width: 58px;
    min-height: 45px;
    border-radius: 8px;
    color: var(--muted);
    font-size: var(--text-xs);
    text-decoration: none;
  }
  .mobile-tabs a[aria-current='page'] {
    color: var(--accent);
    background: var(--accent-soft);
  }
  .mobile-tabs .icon {
    width: 19px;
    height: 19px;
  }
  body:has(textarea:focus, input[type='search']:focus) .mobile-tabs {
    display: none;
  }
  body:has(textarea:focus, input[type='search']:focus) .app-shell,
  body:has(textarea:focus, input[type='search']:focus) .main {
    height: 100dvh;
  }
}

/* ---------- 自动沟通 ---------- */
.auto-reply-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  min-height: 32px;
  color: var(--accent);
  text-decoration: none;
}
.auto-reply-open:hover {
  text-decoration: underline;
}
.auto-reply-open .icon {
  width: 14px;
  height: 14px;
}
.auto-reply-recent {
  margin-top: 12px;
}
.auto-reply-recent-note {
  margin: 4px 0 0;
  font-size: var(--text-xs);
}
.auto-reply-recent-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.auto-reply-recent-link {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
}
.auto-reply-recent-link:hover {
  background: var(--hover);
}
.auto-reply-recent-who {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 550;
}
.auto-reply-recent-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.auto-reply-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-bottom: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.auto-reply-entry:hover {
  background: var(--hover);
}
.auto-reply-entry[aria-current='page'] {
  background: var(--selected);
  border-color: var(--active-line);
}
.auto-reply-entry .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.auto-reply-entry-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auto-reply-entry-state {
  margin-left: auto;
  flex: none;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
}
.auto-reply-entry-state[data-state='on'] {
  color: var(--accent);
}
.auto-reply-entry-state[data-state='needs_reauth'] {
  color: var(--warn);
}
.auto-reply-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.auto-reply-actions .auto-reply-status {
  margin-left: 0;
}
/* Handled Lark messages read as a dense log: one row each, no avatar or bubble, status first. */
.message-row.auto-reply-row {
  margin-bottom: 8px;
  contain-intrinsic-size: auto 72px;
}
.message-row.auto-reply-row .message-content {
  flex: 1;
  min-width: 0;
}
.auto-reply-item {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: var(--text-sm);
  line-height: 1.55;
  scroll-margin: 24px;
}
.auto-reply-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.auto-reply-item-head .auto-reply-outcome {
  flex: none;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.7;
}
.auto-reply-item-head .auto-reply-outcome[data-state='sent'] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.auto-reply-item-head .auto-reply-outcome[data-state='queued'],
.auto-reply-item-head .auto-reply-outcome[data-state='sending'] {
  background: var(--warn-soft);
  color: var(--warn);
}
.auto-reply-item-head .auto-reply-outcome[data-state='failed'] {
  color: var(--danger);
}
.auto-reply-item-who {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auto-reply-item-head time {
  flex: none;
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.auto-reply-item-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-size: var(--text-xs);
  text-decoration: none;
}
.auto-reply-item-link:hover {
  text-decoration: underline;
}
.auto-reply-item-link .icon {
  width: 12px;
  height: 12px;
}
/* Labelled lines: a narrow column says whose words each line is; their message, the reply and the reason never blend. */
.auto-reply-item-lines {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 10px;
  margin: 6px 0 0;
}
.auto-reply-item-lines dt {
  padding-top: 1px;
  color: var(--faint);
  font-size: var(--text-xs);
}
.auto-reply-item-lines dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.auto-reply-item-text {
  color: var(--text);
}
/* The reply is what went out in the owner's name: it reads as a reply, not as more of the message. */
.auto-reply-item-reply {
  justify-self: start;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--ink);
}
.auto-reply-item-draft {
  color: var(--muted);
}
.auto-reply-item-reason {
  color: var(--muted);
}
/* The activity line gives way to the title: it is cut short in a narrow header and hidden on phones. */
.chat-heading:has(#auto-reply-actions:not([hidden])) #view-title {
  flex: none;
}
.chat-heading .auto-reply-actions {
  flex-shrink: 1;
  min-width: 0;
}
.auto-reply-view-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auto-reply-actions > :not(.auto-reply-view-meta) {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .auto-reply-actions .auto-reply-status,
  .auto-reply-actions .auto-reply-view-meta {
    display: none;
  }
  /* On a phone the Lark link is its icon, so the sender and the chat keep the row; its name stays for screen readers. */
  .auto-reply-item-link {
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    margin: -8px -8px -8px 0;
  }
  .auto-reply-item-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .auto-reply-item-link .icon {
    width: 14px;
    height: 14px;
  }
}

/* ---------- tasks (tasks.ts) ---------- */
.nav-meta.nav-attention {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 600;
  text-align: center;
}
.experiment-toggle {
  min-height: 44px;
  height: auto;
}
.experiment-name {
  min-width: 0;
}
.experiment-toggle .choice-current {
  margin-left: auto;
}
.experiment-track {
  position: relative;
  flex: none;
  width: 30px;
  height: 18px;
  border-radius: 9px;
  background: var(--line-strong);
  transition: background 0.15s;
}
.experiment-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--on-dark);
  transition: transform 0.15s;
}
.experiment-toggle[aria-pressed='true'] .experiment-track {
  background: var(--accent);
}
.experiment-toggle[aria-pressed='true'] .experiment-knob {
  transform: translateX(12px);
}
.experiment-toggle:disabled {
  opacity: 0.6;
}
.experiment-error {
  margin: 0;
  padding: 0 10px 6px;
  color: var(--danger);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.tasks-view {
  overflow-y: auto;
}
.tasks-page {
  width: 100%;
  min-width: 0;
  padding: 36px 28px 48px;
}
.tasks-switch {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.tasks-switch-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
}
.tasks-switch-option:hover {
  color: var(--ink);
}
.tasks-switch-option[aria-pressed='true'] {
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px var(--shadow-soft);
}
.tasks-switch-option .icon {
  width: 15px;
  height: 15px;
}
.tasks-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 18px;
}
.tasks-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.tasks-filter select {
  max-width: 220px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}
.tasks-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: var(--text-md);
  color: var(--muted);
}
.tasks-notice.failed {
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
}
.tasks-board {
  display: grid;
  /* Five columns side by side from a 1280-wide window with the sidebar open; narrower windows scroll the board. */
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.tasks-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  scroll-snap-align: start;
}
.tasks-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 4px 10px;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
}
.tasks-column-count {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
}
.tasks-column-needs_you {
  border-color: var(--warn-line);
}
.tasks-column-items,
.tasks-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tasks-list {
  margin-top: 18px;
}
.tasks-column-empty,
.tasks-list-empty {
  padding: 14px 6px;
  font-size: var(--text-sm);
  color: var(--faint);
  text-align: center;
}
.tasks-list-empty {
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.task-card {
  display: grid;
  gap: var(--space-row);
  min-width: 0;
  padding: var(--space-row) var(--space-group);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: var(--text-sm);
}
.task-card.trouble {
  border-color: var(--danger-line);
  box-shadow: inset 3px 0 0 var(--danger);
}
.task-card-title {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
}
.task-card-title:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.task-card-title:focus-visible {
  outline: 2px solid var(--focus-line);
  outline-offset: 2px;
  border-radius: 4px;
}
.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}
.task-executor {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-elapsed {
  font-size: var(--text-xs);
  color: var(--faint);
}
.task-report {
  display: flex;
  gap: 6px;
  margin: 0;
  min-width: 0;
  color: var(--text);
  line-height: 1.5;
}
.task-report-state {
  flex: none;
  color: var(--muted);
  font-weight: 600;
}
.task-report-state.trouble {
  color: var(--danger);
}
.task-report-summary {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* A card shows the start of a report or a question; the whole text is in the task's detail. */
.task-card .task-report-summary,
.task-card .task-attention-text span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.task-attention {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--warn-line);
  border-radius: 7px;
  background: var(--warn-soft);
}
.task-attention-text {
  display: grid;
  gap: 2px;
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.task-attention-text strong {
  color: var(--warn);
  font-size: var(--text-xs);
}
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-control) var(--space-row);
}
.task-actions .button-small {
  min-height: 30px;
  color: var(--ink);
}
.task-actions .button-dark {
  color: var(--on-dark);
}
.task-stage {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.task-stage-in_progress {
  border-color: var(--active-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.task-stage-needs_you {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
}
.task-stage.trouble {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}
dialog.task-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(440px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 20px 22px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: -12px 0 40px var(--shadow-drawer);
  overflow-y: auto;
}
.task-drawer h2 {
  font-size: 18px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.task-drawer-body {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.task-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
  font-size: var(--text-md);
}
.task-facts dt {
  color: var(--muted);
}
.task-facts dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.task-drawer-heading {
  margin: 6px 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}
.task-timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
  list-style: none;
  font-size: var(--text-md);
}
.task-timeline li {
  display: grid;
  gap: 2px;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.task-timeline li.trouble {
  color: var(--danger);
}
.task-timeline-time {
  font-size: var(--text-xs);
  color: var(--faint);
}
.task-thread-kind {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}
.task-answer-form {
  display: grid;
  gap: 6px;
}
.task-answer-input {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: var(--text-md);
  line-height: 1.5;
  resize: vertical;
}
.task-answer-input:focus-visible {
  outline: 2px solid var(--focus-line);
  outline-offset: 1px;
}
.task-answer-send {
  justify-self: start;
  min-height: 30px;
}
.task-message-hint {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.5;
}
.task-outputs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-md);
}
.task-output {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
a.task-output {
  color: var(--accent-ink);
  text-decoration: none;
}
a.task-output:hover {
  text-decoration: underline;
}
.task-output .icon {
  width: 13px;
  height: 13px;
}
.task-output-kind {
  flex: none;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-size: var(--text-xs);
}
.task-outputs-empty {
  color: var(--faint);
}
.task-drawer-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .tasks-page {
    padding: 20px 16px 32px;
  }
  .tasks-board {
    grid-template-columns: repeat(5, minmax(78vw, 1fr));
    margin-inline: -16px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
  }
  .tasks-filter {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .tasks-filter select {
    flex: 1;
    max-width: none;
  }
  .task-actions .button-small {
    min-height: 40px;
  }
}

.conversation-rename-progress {
  min-height: 1.75em;
}
.conversation-rename-form [aria-disabled='true'] {
  opacity: 0.5;
  cursor: default;
}

.catch-connect-form {
  display: grid;
  gap: 12px;
}
.catch-connect-form [role='status'] {
  margin: 0;
  color: var(--muted);
}
.catch-connect-choices {
  display: grid;
  gap: 4px;
  max-height: min(320px, 50vh);
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
}
.catch-connect-choices label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-inline: 4px;
  cursor: pointer;
}
.catch-connect-choices small {
  color: var(--muted);
}
