Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

90.9 KB
Raw Blame
@import './generated/tokens.css';
@import 'highlight.js/styles/github.css' layer(hljs-light);

/* biome-ignore lint/suspicious/noUnknownAtRules: Tailwind directives are expanded by PostCSS. */
@tailwind base;
/* biome-ignore lint/suspicious/noUnknownAtRules: Tailwind directives are expanded by PostCSS. */
@tailwind components;
/* biome-ignore lint/suspicious/noUnknownAtRules: Tailwind directives are expanded by PostCSS. */
@tailwind utilities;

@layer base {
  /* Static defaults and quota bootstrap aliases: generated/tokens.css. */
  body {
    -webkit-user-select: text;
    user-select: text;
  }

  /* 原生选区默认会在宿主失去焦点后变成深色,看起来像选中被取消。
     选中范围仍然存在,这里固定提示色,让用户切到插件/webview 后仍能看见。 */
  ::selection {
    background: var(--text-selection-bg);
  }

  button,
  [role='button'],
  [role='menuitem'],
  [role='option'],
  .select-none,
  .select-none * {
    -webkit-user-select: none;
    user-select: none;
  }

  input,
  textarea,
  [contenteditable='true'],
  [contenteditable='true'] *,
  .select-text,
  .select-text * {
    -webkit-user-select: text;
    user-select: text;
  }

  /* Inline quote atoms live inside contenteditable, whose broad rule above
     otherwise re-enables native text selection on every chip descendant. */
  [contenteditable='true'] [data-composer-quote],
  [contenteditable='true'] [data-composer-quote] * {
    -webkit-user-select: none;
    user-select: none;
  }

  input,
  textarea,
  [contenteditable='true'],
  [role='textbox'] {
    caret-color: var(--caret-accent);
  }

  /* 可拖拽 textarea 的原生 resize 角标(::-webkit-resizer)默认是不跟主题的
     白色方块,dark 下呈反白 BUG(设置自定义提示词 / 创建自动化提示词等所有
     resize-y 文本框)。置透明:保留拖拽功能,去掉视觉噪音,light/dark 通吃。 */
  textarea::-webkit-resizer {
    background: transparent;
  }

  /* F2: Global disable element drag — prevent image and element dragging */
  *:not(input):not(textarea):not([contenteditable='true']) {
    -webkit-user-drag: none;
  }

  /* Native Sortable marks its direct row draggable after pointerdown. Restore
     its subtree too: Chromium can start the drag on a project title or icon.
     Filtered controls never arm the row, and fallback lists stay unchanged. */
  [data-sortable-native-dnd='true'] > [draggable='true'],
  [data-sortable-native-dnd='true'] > [draggable='true'] * {
    -webkit-user-drag: element !important;
  }

  /* SessionItem 是同窗分屏的原生 HTML5 拖拽源。拖拽通常从标题、图标或时间
     子节点起手,所以必须与 composer atom 一样让整棵子树恢复 element drag;
     行内按钮仍由 onDragStart 的交互区守卫 preventDefault,不会误触发分屏。 */
  [data-split-group-drag-source='true'],
  [data-split-group-drag-source='true'] * {
    -webkit-user-drag: element !important;
  }

  /* F3: Global disable focus outline — Chromium default :focus-visible draws
     a yellow/orange ring on buttons, options and menu items after Esc/click
     transitions focus. Suppress it on non-input elements while inputs keep
     their focus hint via --*-border-focus. */
  *:focus,
  *:focus-visible {
    outline: none !important;
  }
  input:focus-visible,
  textarea:focus-visible,
  [contenteditable='true']:focus-visible {
    outline: revert;
  }

  @media (prefers-reduced-motion: reduce) {
    :root {
      --splash-fade-duration: 0ms;
      /* motion token 全档归零:float-in/out、fade-in 及一切引用这些 token 的
         过渡/动画统一失效。必须走 token 归零而非 .animate-* 类选择器——
         变体形态(如 data-[state=open]:animate-float-in)的 class token 带
         前缀,裸类选择器匹配不到(review 反馈)。 */
      --motion-instant: 0ms;
      --motion-fast: 0ms;
      --motion-base: 0ms;
      --motion-enter: 0ms;
      --motion-exit: 0ms;
      --motion-spinner-cycle: 0ms;
      --motion-sidebar-title-marquee-per-viewport: 0ms;
    }

    /* 'animate-spin' 是 'animate-spinner' 的子串,一条同时覆盖 Tailwind 的
       animate-spin 与自定义 animate-spinner(含 motion-safe: 等变体的转义类名)。
       之前只匹配 'animate-spinner',37 处裸 animate-spin 全部逃逸——组件级的
       motion-reduce:animate-none 有兜底的不受影响,但十余处没写兜底的转圈在
       减弱动效下照转(reducedMotionEscape.test.ts 回归)。 */
    [class*='animate-spin'] {
      animation: none !important;
    }

    .animate-confirm-overlay-in,
    .animate-confirm-overlay-out,
    .animate-confirm-content-in,
    .animate-confirm-content-out,
    .animate-confirm-content-layout-in,
    .animate-confirm-content-layout-out {
      animation-duration: 0ms !important;
    }

    * {
      transition: none !important;
    }
  }

  * {
    border-color: hsl(var(--border));
  }

  html,
  body,
  #root {
    /* Desktop shell owns scrolling through internal panes; root scrollbars
       shrink the viewport and make session switches jump horizontally. */
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    margin: 0;
    /* CJK 字体放在 Segoe UI / Roboto 之前:Windows 上 Segoe UI 自带 《》 等
       CJK 标点的窄字形,会跟相邻 CJK 字符 fallback 到 YaHei 的全角字形混在
       同一行,出现"一个半角一个全角"。把 CJK 字体提前后,Inter 没覆盖的
       CJK 标点直接落到 PingFang/YaHei,宽度统一。Latin 仍然走 Inter,无副作用。 */
    font-family: var(--app-font-ui, var(--app-font-ui-default));
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
  }

  html[data-voice-input-overlay='true'],
  html[data-voice-input-overlay='true'] body,
  html[data-voice-input-overlay='true'] #root {
    background: transparent;
  }

  [data-theme='cindy-light'][data-splash-active] .bg-content-area,
  [data-theme='cindy-dark'][data-splash-active] .bg-content-area {
    background: transparent;
  }

  html[data-computer-permission-overlay='true'],
  html[data-computer-permission-overlay='true'] body,
  html[data-computer-permission-overlay='true'] #root {
    background: transparent;
  }
}

/* 移动端下载卡:只有二维码本身,不加品牌描边、阴影与 3D 倾斜(曾经登记在
   DESIGN.md §14.4 / §15.7 的旋转折射边已按用户要求撤除)。唯一动效是设备
   列表刷新驱动的尺寸补间(132 ↔ 228)。 */
.mobile-download-qr-card {
  transition:
    width var(--motion-base) var(--motion-ease-move),
    height var(--motion-base) var(--motion-ease-move);
}

/* 按 <html lang> 切换 CJK 字体栈 —— 同一汉字在中/日/韩字体中字形不同
   (康熙体 vs 新字体 vs 한국체);不按 lang 区分会出现"日文界面里的汉字看起来像中文"。
   useLocale.ts 在 setLocale 时把 lang 写到 <html>,:lang() 选择器自动接管。
   覆盖 body 默认 sans 栈,并按 lang 覆盖代码 mono 栈的 CJK 段
   (代码注释/字符串里也有汉字,需要用对应语种字形);serif 已移除。 */
html:lang(ja) {
  --app-font-ui-default:
    'Inter Variable', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans',
    'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', Meiryo, 'Noto Sans CJK JP',
    'Source Han Sans JP', sans-serif;
  --app-font-code-default:
    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono',
    'Courier New', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic',
    Meiryo, 'Noto Sans CJK JP', 'Source Han Sans JP', monospace;
}

html:lang(ko) {
  --app-font-ui-default:
    'Inter Variable', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', 'Noto Sans CJK KR',
    'Source Han Sans KR', sans-serif;
  --app-font-code-default:
    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono',
    'Courier New', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', 'Noto Sans CJK KR',
    'Source Han Sans KR', monospace;
}

/* doc 模式右栏 chat 流字号收紧:在常见 Tailwind 字号上整体下调 1px。
   仅作用于挂了 .chat-rail-compact 的容器(WorkdirBrowseRoute doc-mode rail
   的 CCAgentSessionView 外层),其他模式不受影响。
   ChatInput 区域(data-chat-input-root)单独还原回默认字号,避免输入框
   字号也跟着缩。 */
.chat-rail-compact .text-xs {
  font-size: calc(var(--text-xs) - 1px);
}
.chat-rail-compact .text-sm {
  font-size: calc(var(--text-sm) - 1px);
  line-height: 1.4;
}
.chat-rail-compact .text-base {
  font-size: calc(var(--text-base) - 1px);
  line-height: 1.5;
}
.chat-rail-compact .text-lg {
  font-size: calc(var(--text-lg) - 1px);
  line-height: 1.5;
}
.chat-rail-compact .text-\[12px\] {
  font-size: 11px;
}
.chat-rail-compact .text-\[13px\] {
  font-size: 12px;
}
.chat-rail-compact .text-\[14px\] {
  font-size: 13px;
}
.chat-rail-compact .text-\[15px\] {
  font-size: 14px;
}
.chat-rail-compact .text-12 {
  font-size: calc(var(--text-12) - 1px);
}
.chat-rail-compact .text-13 {
  font-size: calc(var(--text-13) - 1px);
}
.chat-rail-compact .text-14 {
  font-size: calc(var(--text-14) - 1px);
}
.chat-rail-compact .text-15 {
  font-size: calc(var(--text-15) - 1px);
}
/* 代码块/围栏代码改用变量字号(var / calc(var - Npx))后,不再命中上面按字面
   类名 -1px 的紧凑栏规则。这里按同样的 -1px 语义为变量字号补降级,保证默认
   (未自定义,var=14px)用户在紧凑栏的代码字号 byte-for-byte 不变:
     var           原 text-[14px]→13px,补 calc(var - 1px)
     calc(var-1px) 原 text-[13px]→12px,补 calc(var - 2px)
     calc(var-2px) 原 text-[12px]→11px,补 calc(var - 3px)
   ⚠️ calc(var-1.5px)(原 text-[12.5px])不在原紧凑栏整数规则集(12/13/14/15)里、
   原本就没被降级,故这里也【不补】,维持默认 12.5px 不变;别"顺手"给它加规则。 */
.chat-rail-compact .text-\[length\:var\(--app-code-font-size\)\] {
  font-size: calc(var(--app-code-font-size) - 1px);
}
.chat-rail-compact .text-\[length\:calc\(var\(--app-code-font-size\)_-_1px\)\] {
  font-size: calc(var(--app-code-font-size) - 2px);
}
.chat-rail-compact .text-\[length\:calc\(var\(--app-code-font-size\)_-_2px\)\] {
  font-size: calc(var(--app-code-font-size) - 3px);
}

.chat-rail-compact [data-chat-input-root] .text-xs {
  font-size: var(--text-xs);
  line-height: var(--text-xs-line-height);
}
.chat-rail-compact [data-chat-input-root] .text-sm {
  font-size: var(--text-sm);
  line-height: var(--text-sm-line-height);
}
.chat-rail-compact [data-chat-input-root] .text-base {
  font-size: var(--text-base);
  line-height: var(--text-base-line-height);
}
.chat-rail-compact [data-chat-input-root] .text-lg {
  font-size: var(--text-lg);
  line-height: var(--text-lg-line-height);
}
.chat-rail-compact [data-chat-input-root] .text-\[12px\] {
  font-size: 12px;
}
.chat-rail-compact [data-chat-input-root] .text-\[13px\] {
  font-size: 13px;
}
.chat-rail-compact [data-chat-input-root] .text-\[14px\] {
  font-size: 14px;
}
.chat-rail-compact [data-chat-input-root] .text-\[15px\] {
  font-size: 15px;
}
.chat-rail-compact [data-chat-input-root] .text-12 {
  font-size: var(--text-12);
}
.chat-rail-compact [data-chat-input-root] .text-13 {
  font-size: var(--text-13);
}
.chat-rail-compact [data-chat-input-root] .text-14 {
  font-size: var(--text-14);
}
.chat-rail-compact [data-chat-input-root] .text-15 {
  font-size: var(--text-15);
}

/* Tiptap ChatInput — placeholder hook & chip alignment
   (command-palette F2.5). The Placeholder extension injects
   `p.is-editor-empty::before` with the placeholder text in a `data-*`
   attribute; after a controlled clear it can leave only `is-empty`, so the
   sole-empty-paragraph selector preserves the same truly-empty contract. */
.ProseMirror > p.is-editor-empty:first-child::before,
.ProseMirror > p.is-empty:first-child:only-child::before {
  content: attr(data-placeholder);
  color: var(--chat-input-placeholder-subtle);
  float: left;
  height: 0;
  pointer-events: none;
}
[data-voice-draft-active='true'] .ProseMirror > p.is-editor-empty:first-child::before,
[data-voice-draft-active='true'] .ProseMirror > p.is-empty:first-child:only-child::before {
  content: none;
}
/* 输入框推荐提示词生效时,推荐词由 ChatInput 的 overlay 承载,关掉原生 placeholder。 */
[data-voice-hint-active='true'] .ProseMirror > p.is-editor-empty:first-child::before,
[data-voice-hint-active='true'] .ProseMirror > p.is-empty:first-child:only-child::before,
[data-recommendation-active='true'] .ProseMirror > p.is-editor-empty:first-child::before,
[data-recommendation-active='true'] .ProseMirror > p.is-empty:first-child:only-child::before {
  content: none;
}
.ProseMirror[data-voice-holding='true'],
.ProseMirror[data-voice-holding='true'] * {
  -webkit-user-select: none;
  user-select: none;
}
/* 空框用完整语音提示替代语音光标,避免图标压住提示首字。 */
[data-voice-hint-active='true'] [data-voice-caret] {
  visibility: hidden;
}
/* 首页建议悬停预览:预览由 ChatInput 的 overlay 承载,暂时隐去正文/placeholder;
   预览不改变编辑器高度,见 ChatInput 的 promptPreviewLines。 */
[data-prompt-preview-active='true'] .ProseMirror {
  opacity: 0;
}
.ProseMirror {
  caret-color: var(--caret-accent);
}
.cm-editor .cm-content {
  caret-color: var(--caret-accent) !important;
}
.cm-editor .cm-cursor,
.cm-editor .cm-dropCursor {
  border-left-color: var(--caret-accent) !important;
}
/* Structured composer lists keep markers and body text in the same layout
   tree. Continuation lines therefore follow the list item content edge
   without decoration-owned width measurements. */
[data-chat-input-root] .ProseMirror :is(ul, ol) {
  margin: 0;
  --composer-list-padding: 1.5em;
  --composer-list-marker-extra: 0em;
  padding-inline-start: calc(
    var(--composer-list-padding, 1.5em) + var(--composer-list-marker-extra, 0em)
  );
}
/* The ideographic comma is a full-width glyph, unlike the period / closing
   parenthesis in the other ordered markers. Keep its extra width separate
   from the digit budget so multi-digit ordinals still compose correctly. */
[data-chat-input-root] .ProseMirror ol[data-marker='、'] {
  --composer-list-marker-extra: 0.7em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='2'] {
  --composer-list-padding: 2.2em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='3'] {
  --composer-list-padding: 2.8em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='4'] {
  --composer-list-padding: 3.4em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='5'] {
  --composer-list-padding: 4em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='6'] {
  --composer-list-padding: 4.6em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='7'] {
  --composer-list-padding: 5.2em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='8'] {
  --composer-list-padding: 5.8em;
}
[data-chat-input-root] .ProseMirror ol[data-marker-digits='9'] {
  --composer-list-padding: 6.4em;
}
[data-chat-input-root] .ProseMirror ul {
  list-style-type: disc;
}
[data-chat-input-root] .ProseMirror ol {
  list-style-type: decimal;
}
[data-chat-input-root] .ProseMirror ol[data-marker=')'] > li::marker {
  content: counter(list-item) ') ';
}
[data-chat-input-root] .ProseMirror ol[data-marker='、'] > li::marker {
  content: counter(list-item) '、';
}
[data-chat-input-root] .ProseMirror li {
  padding-inline-start: 0.15em;
  overflow-wrap: anywhere;
}
[data-chat-input-root] .ProseMirror li > p {
  margin: 0;
}

/* composer 列表行缩进(ComposerListIndentDecoration):单行列表使用段落级
   decoration,多行列表的无特殊标点行使用 inline-block 换行容器。padding-left
   留出"基础缩进 + 前缀宽度",首行再用负 text-indent 把列表标记悬挂回基础
   缩进位置;自动换行后的续行不吃负缩进,因此会与首行正文对齐。 */
.ProseMirror .composer-list-block-indent {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding-left: calc(1em + var(--composer-list-hang, 1.25em));
  text-indent: var(--composer-list-hang-negative, -1.25em);
  overflow-wrap: anywhere;
}
.ProseMirror .composer-list-prefix-indent {
  padding-left: 1em;
}
.ProseMirror .composer-list-fallback-container {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding-left: calc(1em + var(--composer-list-fallback-indent, 1.25em));
  overflow-wrap: anywhere;
}
.ProseMirror .composer-list-fallback-prefix {
  display: inline-block;
  box-sizing: border-box;
  width: var(--composer-list-fallback-indent, 1.25em);
  margin-left: calc(0px - var(--composer-list-fallback-indent, 1.25em));
  white-space: pre;
  vertical-align: top;
}
.ProseMirror .composer-list-fallback-long-run-body {
  overflow-wrap: anywhere;
  word-break: break-all;
}
.ProseMirror .composer-list-fallback-unindented {
  display: inline-block;
  box-sizing: border-box;
  width: calc(100% + 1em + var(--composer-list-fallback-indent, 1.25em));
  margin-left: calc(-1em - var(--composer-list-fallback-indent, 1.25em));
  vertical-align: top;
  overflow-wrap: anywhere;
}
.ProseMirror .composer-list-fallback-break {
  /* Keep native <br> line boxes so consecutive hard breaks retain intentional
     blank lines inside a paragraph-level list fallback. */
  display: inline;
}
.ProseMirror .composer-list-line-indent {
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  padding-left: calc(1em + var(--composer-list-hang, 1.25em));
  text-indent: var(--composer-list-hang-negative, -1.25em);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.ProseMirror .composer-list-tab-indent {
  /* Keep the browser's tab advance aligned with the deterministic prefix-width
     estimate. Do not measure and rewrite decoration DOM from a plugin view:
     ProseMirror's DOMObserver may restore that style and enter an update loop. */
  tab-size: 8ch;
}
/* The fallback unindented row must remain one inline-block; character-scoped
   ProseMirror decorations would split it into several full-width fragments.
   The local face covers the same ranges as CjkPunctDecoration, while the
   bundled faces cover the punctuation glyphs HarmonyOS actually ships. The
   ASCII range is punctuation-only, so Latin letters and digits continue
   through the configured UI font. Keep the asset names aligned with the
   exact-pinned font package. */
@font-face {
  font-family: 'Cindy CJK Punctuation Local';
  src:
    local('PingFang SC'), local('Hiragino Sans GB'), local('Microsoft YaHei UI'),
    local('Microsoft YaHei'), local('Noto Sans CJK SC'), local('Source Han Sans SC');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+0021-0022, U+0027-0029, U+002C, U+002E, U+003A-003B, U+003F, U+005B, U+005D, U+007B, U+007D,
    U+3000-303F, U+FF00-FFEF;
}
@font-face {
  font-family: 'Cindy CJK Punctuation Bundled';
  src: url('../../../../../node_modules/harmonyos-sans-sc-webfont-splitted/dist/Regular_256855.woff2')
    format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+3001-3002, U+3008-3011, U+3014-3017;
}
@font-face {
  font-family: 'Cindy CJK Punctuation Bundled';
  src: url('../../../../../node_modules/harmonyos-sans-sc-webfont-splitted/dist/Regular_312071.woff2')
    format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+3000, U+3003, U+3005-3007, U+3012-3013, U+3018-301B, U+301D-301E, U+3021-3029, U+303E;
}
@font-face {
  font-family: 'Cindy CJK Punctuation Bundled';
  src: url('../../../../../node_modules/harmonyos-sans-sc-webfont-splitted/dist/Regular_ac4458.woff2')
    format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+FF01-FF03, U+FF05-FF0A, U+FF0C-FF1B, U+FF1F-FF3D, U+FF3F, U+FF41-FF5B, U+FF5D, U+FF5F-FF60,
    U+FFE6;
}
@font-face {
  font-family: 'Cindy CJK Punctuation Bundled';
  src: url('../../../../../node_modules/harmonyos-sans-sc-webfont-splitted/dist/Regular_ea8896.woff2')
    format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+0021-0022, U+0027-0029, U+002C, U+002E, U+003A-003B, U+003F, U+005B, U+005D, U+007B, U+007D,
    U+FF04, U+FF0B, U+FF1C-FF1E, U+FF3E, U+FF40, U+FF5C, U+FF5E, U+FFE0-FFE5;
}
.ProseMirror .composer-list-cjk-punctuation-font {
  font-family:
    'Cindy CJK Punctuation Local', 'Cindy CJK Punctuation Bundled',
    var(--app-font-ui, var(--app-font-ui-default));
}
.ProseMirror .composer-list-cjk-font {
  font-family:
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans CJK SC',
    'Source Han Sans SC', 'HarmonyOS Sans SC', sans-serif;
}
/* 没有自然断点的长数字/字母串拆成 marker/body 两个相邻盒子。marker
   始终留在正文首行,body 独占剩余宽度;overflow-wrap:anywhere 仅在正文
   需要溢出时启用紧急断字,普通英文仍优先按空格换行。 */
.ProseMirror .composer-list-long-run-marker {
  display: inline-block;
  box-sizing: border-box;
  width: calc(1em + var(--composer-list-hang, 1.25em));
  padding-left: 1em;
  overflow: visible;
  white-space: nowrap;
  vertical-align: top;
}
.ProseMirror .composer-list-long-run-body {
  display: inline-block;
  box-sizing: border-box;
  width: calc(100% - 1em - var(--composer-list-hang, 1.25em));
  max-width: calc(100% - 1em - var(--composer-list-hang, 1.25em));
  overflow-wrap: anywhere;
  /* 该盒子只由 LONG_ALPHANUMERIC_BODY_RE 生成,正文没有自然断点;
     因此可以安全地在串内断字,而不会影响普通英文句子的词边界。 */
  word-break: break-all;
  vertical-align: top;
}
.ProseMirror .voice-input-draft-replaced {
  display: none;
}
/* Long-run body boxes can overlap a voice replacement in single-line rows.
   The general multiline list path switches to the paragraph fallback while a
   replacement is active, so its full-width row wrapper is never fragmented. */
.ProseMirror .composer-list-long-run-body.voice-input-draft-replaced {
  display: none;
}
.ProseMirror [data-voice-draft-inline] {
  color: var(--chat-input-text);
  opacity: 0.7;
  overflow-wrap: anywhere;
  pointer-events: none;
  white-space: pre-wrap;
}
.ProseMirror [data-voice-draft-inline][data-voice-draft-source='stable'],
.ProseMirror [data-voice-draft-inline][data-voice-draft-source='refinement'] {
  opacity: 1;
}
/* Voice caret — replaces the native caret while dictation holds the composer
   read-only. Listening keeps the mic outline static and animates only the
   level bars inside the capsule; submitting/refining swaps to a spinner arc. */
.ProseMirror [data-voice-caret] {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.2em;
  margin-left: 1px;
  color: var(--chat-input-text);
  pointer-events: none;
  user-select: none;
}
.ProseMirror [data-voice-caret] svg {
  display: block;
  width: 1.1em;
  height: 1.1em;
  /* Clip any sub-pixel bleed to the icon box so a busy refine indicator can
     never touch neighbouring wrapped text lines. */
  overflow: hidden;
}
/* Spin only the inner arc around the viewBox centre, NOT the whole <svg>:
   rotating the inline svg element sweeps a bounding box that overlaps adjacent
   wrapped lines and makes Chromium repaint their text every frame (the
   multi-line refine jitter). Rotating the path keeps the svg's paint box
   fixed — the same containment the listening level-bars rely on. */
.ProseMirror [data-voice-caret][data-voice-caret-state='processing'] [data-voice-spinner-arc] {
  transform-box: view-box;
  transform-origin: center;
  animation: voice-caret-spin 0.9s linear infinite;
}
@keyframes voice-caret-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Mic level bars — shared by every VoiceInputMicWaveIcon consumer (in-app
   voice caret widget, dictation overlay title), hence not scoped to
   .ProseMirror. The bars exist only inside that icon's svg. */
[data-voice-mic-active='true'] [data-voice-mic-bar] {
  transform-box: fill-box;
  transform-origin: center;
  animation: voice-mic-wave 1.1s ease-in-out infinite;
  will-change: transform, opacity;
}
/* bar 1 keeps the keyframe's default 0s delay */
[data-voice-mic-active='true'] [data-voice-mic-bar='2'] {
  animation-delay: 0.18s;
}
[data-voice-mic-active='true'] [data-voice-mic-bar='3'] {
  animation-delay: 0.36s;
}
@keyframes voice-mic-wave {
  0%,
  100% {
    transform: scaleY(0.4);
    opacity: 0.5;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}
.ProseMirror :is([data-mention-chip], [data-pasted-text-chip], [data-composer-quote]) {
  /* Small vertical lift so every atomic chip aligns with the inline text
     caret; the pills are a tad taller than 1em because of padding + border. */
  position: relative;
  top: -1px;
}

/* Keep the caret and surrounding prose a consistent, readable distance from
   every composer pill. This is external spacing, independent of chip padding. */
.ProseMirror
  :is(
    [data-mention-chip],
    [data-pasted-text-chip],
    [data-composer-quote],
    .ghost-cmd-pill,
    .slash-cmd-pill,
    .quick-start-pill
  ) {
  margin-inline: 4px;
}

/* The base layer disables native element dragging globally. Composer atoms
   are the intentional exception: a drag commonly starts on the label/icon
   child rather than the draggable wrapper itself, so every descendant must
   opt back in or Chromium turns the gesture into text selection. */
.ProseMirror :is([data-mention-chip], [data-pasted-text-chip], [data-composer-quote]),
.ProseMirror :is([data-mention-chip], [data-pasted-text-chip], [data-composer-quote]) * {
  -webkit-user-drag: element;
}

/* Slash 指令确认胶囊 — doc 里仍是普通 `/command` 文本。字号、字重和文字色
   完全继承 composer 正文;仅用 surface/border/radius 表达“已命中命令”。
   inline-flex 让 padding 进布局,避免行首悬挂绘制溢出输入卡片。 */
.ProseMirror .slash-cmd-pill {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  background: var(--surface-chip);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  padding: 2px 8px 3px;
  margin-inline: 0 4px;
  color: var(--chat-input-text);
  font: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* Pi 线路名 `/skill:git` 里的 `skill:` 只做识别:展示层与 CC/Codex 一样只留 `/git`。 */
.ProseMirror .slash-cmd-runtime-prefix {
  display: none;
}
/* 隐藏 runtime 前缀后 ProseMirror 会把胶囊切成相邻 span,接缝拼回一颗。 */
.ProseMirror .slash-cmd-pill:has(+ .slash-cmd-pill),
.ProseMirror .slash-cmd-pill:has(+ .slash-cmd-runtime-prefix) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}
.ProseMirror .slash-cmd-pill + .slash-cmd-pill,
.ProseMirror .slash-cmd-runtime-prefix + .slash-cmd-pill {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
  margin-left: 0;
  padding-left: 0;
}

/* 快速开始预填胶囊 — QuickStartPillMark。点击 New Maker 快速开始卡片后
   预填文本以此 mark 包裹,渲染为与 ModelPromotionBadge 同色系的圆角
   标签,区分「卡片预填」与「手动输入」。doc 里仍是普通 text + mark,
   发送序列化只取 textContent,mark 不产生额外输出。
   注意:快速开始文本是完整句子(用户需阅读/编辑),不能用 micro-label 字号
   (DESIGN.md §3 限定 10-13px 仅用于辅助标签);此处 font: inherit 继承
   composer 正文字号,仅用 background/color/radius 做视觉区分。 */
.ProseMirror .quick-start-pill {
  background: var(--accent-cta-bg);
  border-radius: 9999px;
  padding: 2px 8px 3px;
  color: var(--accent-pure-cta-fg);
  font: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* 意识指令确认胶囊 — GhostCommandDecoration。`$指令` 命中已唤醒意识时的
   inline decoration:doc 里仍是可编辑纯文本,只在渲染层套胶囊。几何与
   InlineReferenceChip 对齐:12/20px 字体行高、8×2px padding、6px 图文间距。 */
.ProseMirror .ghost-cmd-pill {
  background: var(--surface-chip);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  padding: 2px 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  /* 窄输入区换行时两端都保留胶囊圆角/内边距 */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* 触发符($/¥ 等)只做识别:胶囊态下渲染层隐藏,doc 里仍是真实字符 */
.ProseMirror .ghost-cmd-sigil {
  display: none;
}
/* 胶囊头部的意识标识:默认幽灵图标(lucide ghost,mask 走 currentColor
   随主题),意识声明了头像时换成头像(data URL 经 decoration 白名单校验
   后注入 --ghost-cmd-icon)。 */
.ProseMirror .ghost-cmd-pill::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%2010h.01'/%3E%3Cpath%20d='M15%2010h.01'/%3E%3Cpath%20d='M12%202a8%208%200%200%200-8%208v12l3-3%202.5%202.5L12%2019l2.5%202.5L17%2019l3%203V10a8%208%200%200%200-8-8z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%2010h.01'/%3E%3Cpath%20d='M15%2010h.01'/%3E%3Cpath%20d='M12%202a8%208%200%200%200-8%208v12l3-3%202.5%202.5L12%2019l2.5%202.5L17%2019l3%203V10a8%208%200%200%200-8-8z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.ProseMirror .ghost-cmd-pill[data-ghost-cmd-icon]::before {
  background: var(--ghost-cmd-icon) center / cover no-repeat;
  -webkit-mask: none;
  mask: none;
  border-radius: 999px;
}
/* 全角触发符($/¥)同时命中 CjkPunctDecoration 时,ProseMirror 会把重叠
   区间切成相邻多个 span:接缝处去圆角/去边框拼回一颗胶囊,图标只画一次。 */
.ProseMirror .ghost-cmd-pill:has(+ .ghost-cmd-pill) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}
.ProseMirror .ghost-cmd-pill + .ghost-cmd-pill {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
  margin-left: 0;
  padding-left: 0;
}
.ProseMirror .ghost-cmd-pill + .ghost-cmd-pill::before {
  content: none;
}
/* 同名冲突的 `/slug`、`/@root` 限定符:字符留在 doc 里供发送期消歧,渲染层
   收起;企业实例在同一颗胶囊尾部显示「团队共享」标签。 */
.ProseMirror .ghost-cmd-qualifier {
  display: none;
}
.ProseMirror .ghost-cmd-pill[data-ghost-cmd-origin]::after {
  content: attr(data-ghost-cmd-origin);
  margin-left: 6px;
  color: var(--text-tertiary);
}
/* CJK 标点会把胶囊切成多段、每段都带来源属性:只在最后一段显示标签。 */
.ProseMirror .ghost-cmd-pill[data-ghost-cmd-origin]:has(+ .ghost-cmd-pill)::after {
  content: none;
}

/* F-FI-3: Scrollbar-hide utility for thumbnail strip */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/*
 * Resize-pane pointer transparency for embedded webviews (RSB Phase 6 收尾)。
 *
 * host 端 resize handle 拖动期间(MainLayout 监听 isDragging / isRightDragging
 * 后 toggle body.resizing-pane),让 RSB 内置浏览器的 `<webview>` wrapper 透明
 * 传 pointer 事件 —— Electron webview 是独立 webContents,guest 默认会"吞"掉
 * host 的 pointermove,resize handler 全局 document listener 收不到 mousemove
 * 会卡住(2026-07-01 用户实测:RSB 浏览器 tab 拖不动 resize handle)。
 *
 * pointer-events: none 让 host 的 pointer 事件穿过 webview wrapper 不命中,
 * guest 也不收到,host 全局监听能正常拿到 → resize 顺畅。Resize 结束 body class
 * 移除,用户立刻能继续跟 webview 交互。
 */
body.resizing-pane #browser-webview-pool,
body.resizing-pane [data-pool-tab-id],
body.resizing-pane [data-ghost-webview] {
  pointer-events: none;
}

/* F-SDK-3: Running status bar — soft whole-line breathing.
   The old clipping animation was perceived as a subtle fade, but forced
   continuous Paint/Composite work in Electron. Opacity keeps it compositor-only.

   Cadenced(2026-08-07,DESIGN.md §14.4):不再 infinite 循环 —— RunningStatusBar
   在每次真实动静(状态文案 / token 计数变化)时通过重挂载触发一次呼吸,静默期
   保持常亮。呼吸节奏跟随实际产出而非固定心跳,「运行指示」不再需要在循环装饰
   红线上开洞;一次性动画也天然不进 hiddenAnimationGate 冻结清单。
   steps(18, end):每半程 18 步 → 全程 36 步 / 1.5s = 24fps。常驻期合成帧减半以上,
   低帧率的轻微颗粒感与纸面质感相合,肉眼近似无损(§14.4 低帧率原则)。 */
.status-bar-shimmer {
  color: var(--status-bar-accent);
  animation: status-shimmer 1.5s steps(18, end) 1;
  will-change: opacity;
}

/* F-SB-7: Session status indicator — breathing pulse.
   Animation lives directly on the indicator element (no inherited custom
   property, no driver container). This eliminates the cascade-style
   invalidation that the @property+inherits:true pattern caused on every
   sidebar descendant each frame. Indicators that mount together stay in
   sync naturally; late-mounted ones may drift by a fraction of a cycle,
   which is imperceptible at this opacity range. */
@keyframes session-breathing {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.session-status-breathing {
  animation: session-breathing 1.5s ease-in-out infinite;
  will-change: opacity;
}

/* 折叠 rail(竖排 tile)及置顶卡片运行中的扫动进度条。置顶卡片固定为 52px 宽度(见
   SessionCard showCardBar),rail 延续全宽;reduce-motion 停动画。 */
.session-card-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 36%;
  border-radius: 2px;
  background: var(--text-tertiary);
  animation: session-card-prog 1.5s ease-in-out infinite;
}
@keyframes session-card-prog {
  0% {
    transform: translateX(-115%);
  }
  100% {
    transform: translateX(330%);
  }
}

/* sidebar-card-mode: SessionCard 完成 settle——运行结束时卡片底色闪一下 hover 色
   再归位(0.9s),作为低调的"完成"提示。运行中的活动感由标题左侧
   SessionStatusIcon 呼吸 + 底部短扫动进度条表达。 */
.session-card--settle {
  animation: session-card-settle 0.9s ease;
}
@keyframes session-card-settle {
  0% {
    background-color: var(--surface-elevated);
  }
  35% {
    background-color: hsl(var(--sidebar-item-hover));
  }
  100% {
    background-color: var(--surface-elevated);
  }
}

/* 需关注圆点——深色 + box-shadow 扩散脉冲(对照 redesign 稿 xdtsb-pulse) */
/* 呼吸点(AttentionDot 的 breathing 形态)。
   常驻循环动画按 DESIGN.md §14.4 只允许动 transform / opacity(compositor-only);
   原实现动的是 box-shadow,每帧都要重绘,多张未读卡长期同屏时持续吃 CPU 与电量
   (codex review)。改成一个 ::after 光环做 scale + opacity,视觉节奏不变:
   6px 的点外扩到约 4px 光环(6→14px ≈ scale 2.33),同时淡出。
   起始帧 opacity 为 0,所以 scale(1) 那一刻光环不可见,不会给点本身蒙一层底色。 */
.session-card-dot {
  position: relative;
}
.session-card-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: hsl(var(--foreground));
  animation: session-card-pulse 2.1s infinite;
  will-change: transform, opacity;
  pointer-events: none;
}
@keyframes session-card-pulse {
  0% {
    transform: scale(1);
    opacity: 0;
  }
  30% {
    opacity: 0.32;
  }
  70% {
    transform: scale(2.33);
    opacity: 0;
  }
  100% {
    transform: scale(2.33);
    opacity: 0;
  }
}

/* 卡片列数切换(1↔2↔3)时新布局淡入,软化"硬跳"(对照 rail 收起的渐隐)。 */
.card-col-fade {
  animation: card-col-fade 0.2s ease;
}
@keyframes card-col-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Bot Market 详情页入场(DESIGN.md §14.4):按 --rise-index 依次淡入并上移 6px,
   相邻错峰 30ms、最多 6 段;仅 transform / opacity,减弱动态效果下直落终态。 */
.bot-market-rise {
  animation: bot-market-rise var(--motion-base) var(--motion-ease-out)
    calc(var(--rise-index, 0) * 30ms) both;
}
@keyframes bot-market-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-voice-mic-active='true'] [data-voice-mic-bar],
  .status-bar-shimmer,
  .status-bar-done,
  .session-status-breathing,
  .session-card-bar::before,
  .session-card--settle,
  .session-card-dot::after,
  .session-running-dot,
  .thinking-dot,
  .stream-word,
  [data-stream-marker]::marker,
  .card-col-fade,
  .bot-market-rise {
    animation: none !important;
    will-change: auto;
  }
}

/* 页面不可见时冻结常驻装饰动画(闸门见 lib/hiddenAnimationGate.ts)。
   主窗 backgroundThrottling 在有 running turn 时被主动关闭以保住流式输出,
   于是隐藏窗口里的 infinite 动画会继续推进并持续触发样式重算;实测 10 个动画
   令样式重算 29.8/s,冻结后 5.7/s(-81%),renderer CPU 12.4% → 6.0%。

   ⚠️ 新增任何 `animation: ... infinite` 时必须同步把它的元素加进本清单。
   `hiddenAnimationGate.test.ts` 会扫描本文件所有 infinite 规则并逐条核对,漏了会直接
   测试失败——不要改测试绕过,补选择器即可。清单按「真正挂动画的那个元素」(选择器的
   最后一段)收敛,所以祖先条件不同、落点相同的规则只需一条。

   只列 infinite 装饰动画。一次性动画(.status-bar-done / .session-card--settle /
   .card-col-fade / ghost-bubble 进出场 / ghost-panel 展开收起)刻意不纳入:它们总时长
   有限、省不到东西,却会在隐藏期被冻在中途帧,恢复可见时反而突兀。这也是这里用
   allowlist 而不是「全局暂停 + 一次性例外」的原因——漏掉 infinite 只是少省一点 CPU,
   漏掉一次性动画却会造成可见的视觉异常。

   用 animation-play-state 而非 animation: none —— 后者会让元素跳回静止态
   (opacity 回到 1),恢复可见的瞬间比冻结更显眼。冻结点落在动画自身的取值区间内,
   恢复后接着播,用户不可察觉。

   Tailwind 的 animate-spin / animate-pulse 用 [class*=] 匹配,以覆盖
   motion-safe:animate-pulse 这类变体编译出的转义类名。任意值工具类
   (animate-[spin_2.4s_linear_infinite] 之类,见 GhostSummonCard)不含 animate-spin
   子串,靠 [class*='infinite'] 兜住:Tailwind 把 keyframes 简写原样编进类名,
   循环动画必然带 infinite 字面量,而一次性的 animate-[xxx_200ms_ease-out] 不会。 */
[data-app-hidden='true'] [data-voice-spinner-arc],
[data-app-hidden='true'] [data-voice-mic-bar],
/* .status-bar-shimmer 已 cadenced 化为一次性动画(2026-08-07),按「一次性动画
   不得纳入冻结清单」原则移出 —— 冻在中途帧会让状态栏停在半暗。 */
[data-app-hidden='true'] .session-status-breathing,
[data-app-hidden='true'] .session-card-bar::before,
[data-app-hidden='true'] .session-card-dot::after,
[data-app-hidden='true'] .session-running-dot,
[data-app-hidden='true'] .thinking-dot,
[data-app-hidden='true'] .ghost-card-sweep,
[data-app-hidden='true'] .brand-loading-mark-sheen::before,
[data-app-hidden='true'] .ghost-bubble-face,
[data-app-hidden='true'] .agent-island-mascot-character,
[data-app-hidden='true'] .agent-island-mascot-keyboard,
[data-app-hidden='true'] .agent-island-mascot-key,
[data-app-hidden='true'] .agent-island-mascot-eyes,
[data-app-hidden='true'] .agent-island-mascot-sparkle,
[data-app-hidden='true'] [class*='animate-spinner'],
[data-app-hidden='true'] [class*='animate-spin'],
[data-app-hidden='true'] [class*='animate-pulse'],
[data-app-hidden='true'] [class*='infinite'],
/* drawio viewer(vendor/drawio/viewer-static.min.js)把循环动画以 inline style 直接写到
   SVG 元素上(flowAnimation 的流动虚线、加载 spinner),类名既不含 animate-* 也不含
   infinite,前面几条都够不着;它又是压缩过的第三方脚本,不归 globals.css / tsx 扫描管。
   按容器整棵子树冻结 —— 容器形态是 <div class="mxgraph" data-mxgraph="{json}">,
   见 DrawioPreview.tsx。 */
[data-app-hidden='true'] [data-mxgraph],
[data-app-hidden='true'] [data-mxgraph] * {
  animation-play-state: paused !important;
}

/* Running indicator — three horizontal dots, scale-up wave from left to right.
   Color uses currentColor so the parent span controls accent vs gray. */
.session-running-dots {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
}
.session-running-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: currentColor;
  animation: session-running-dot-wave 1.1s ease-in-out infinite;
}
.session-running-dot-1 {
  animation-delay: 0s;
}
.session-running-dot-2 {
  animation-delay: 0.18s;
}
.session-running-dot-3 {
  animation-delay: 0.36s;
}

@keyframes session-running-dot-wave {
  0%,
  60%,
  100% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  30% {
    transform: scale(1.35);
    opacity: 1;
  }
}

/* Cadenced 后的一次呼吸:静止态是全亮(无动画时 opacity 继承 fadeStyle 的 1),
   每次触发从 1 下潜到 0.45 再回满 —— 幅度与旧 infinite 版一致,只是方向反转
   (旧版 0% 起点是 0.45,一次性播放会让常亮态在触发瞬间硬跳暗)。 */
@keyframes status-shimmer {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* 流式正文分段淡入(§14.4 第五个 sanctioned motion class,2026-08-07):
   每个新词与 inline-code 原子以 --motion-fast 从透明「浮现」。词段沿消息级
   连续时间线错峰进入;已见段 remount 时可用负 delay 恢复原动画进度。
   不是逐字打字机 —— 段整体已就位,只有 opacity 渐变;
   pure-opacity 一次性动画,compositor-only。`both` 保证负 delay / remount 续播。
   reduced-motion 双保险:JS 侧短路(插件不挂载,span 不进 DOM)+ 下方 reduce
   块的 animation: none(摘掉动画连同 both 填充,span 落回自然 opacity 1,
   不会钉在透明帧 —— 与「forwards/both 入场动画只能时长归零」那条坑的区别在于
   这里 0% 帧之外元素本身没有 opacity 声明)。 */
.stream-word {
  animation: stream-word-in var(--motion-fast) var(--motion-ease-out) var(--wf-delay, 0ms) both;
}
/* 流式列表圆点淡入(同一 motion class 家族,2026-08-08):动画打在 ::marker 上,圆点/序号从 transparent
   浮现,delay 由 rehypeStreamWordFade 写入(与 li 内第一个词共享 timeline
   位置,圆点与文字同帧出现)。::marker 只支持 color/font 等少数属性,故用
   color 关键帧而不是 opacity。data 属性仅流式挂载;终版渲染无此属性。 */
[data-stream-marker]::marker {
  animation: stream-marker-in var(--motion-fast) var(--motion-ease-out) var(--wf-delay, 0ms) both;
}
/* 只定义 0% 帧:终点回落元素自然颜色,不用 inherit 终帧。 */
@keyframes stream-marker-in {
  from {
    color: transparent;
  }
}
@keyframes stream-word-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* #5406: Electron 41 的 Blink 在跳过消息行布局后,正文更新/滚动触发的
   原生 AX 增量序列化会在 AXBlockFlowData::ComputeNeighborOnLine 断言崩溃。
   已用真实 MessageStream 复现,不依赖 CDP 查询。消息行必须保持真实布局,
   不能恢复 content-visibility:auto 的估高占位,也不能靠关闭无障碍规避。
   逻辑尾窗保留 80 个条目;历史正文按视口挂载,其余用实测高度占位。
   复现及对照见 scripts/ax5406/COMPONENT-REPRO.md。 */
.msg-stream-items > * {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

/* Fixed-position menu triggers must keep the viewport as their containing
   block. Their menu content is portaled to body, but Radix still measures the
   zero-size trigger inside the render item. Keep this explicit exception when
   changing message-row layout rules: a containing block would offset the menu. */
.msg-stream-items > *:has([data-fixed-menu-anchor]) {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

/* 分享选择模式会在消息 wrapper 左侧动态挂载绝对定位的选择框。该元素需要真实
   消息盒参与布局与绘制;继续使用视口外 intrinsic 占位会让长消息末尾的选择框
   被压缩或裁切。伙伴消息的分享 wrapper 位于含时间分组的条目内部,也必须让
   外层条目保持真实布局,包括伙伴消息的嵌套分享 wrapper。 */
.msg-stream-items[data-share-selection-active] > [data-share-message-id],
.msg-stream-items[data-share-selection-active] > :has([data-share-message-id]) {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

/* 会话切换 shell-first 帧的品牌加载指示(BrandLoadingMark):
   wordmark 低亮常驻 + 亮带经同形 mask 在字标形状内扫过(Codex Desktop
   startup loader 同构表现)。两条硬约束:
   ① 延迟浮现 —— 指示器整体 200ms 后才淡入(brand-loading-appear,both 起始
      透明)。多数会话下一帧就挂载完,指示器从未可见,小会话不闪 loading;
   ② compositor-only —— 扫光用 sheen 伪层的 transform 位移(而非
      background-position):消息树构建阻塞主线程时 transform 动画不冻结。
   reduced-motion:两个动画全停,wordmark 直接静态显示(见下方 reduce 块)。 */
.brand-loading-mark {
  opacity: 0;
  animation: brand-loading-appear var(--motion-base) ease-out 200ms both;
}
.brand-loading-mark > img {
  opacity: 0.35;
}
.brand-loading-mark-sheen::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent 10%, var(--text-primary) 50%, transparent 90%);
  transform: translateX(-120%);
  animation: brand-loading-sheen 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes brand-loading-appear {
  to {
    opacity: 1;
  }
}
@keyframes brand-loading-sheen {
  to {
    transform: translateX(350%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .brand-loading-mark {
    animation: none;
    opacity: 1;
  }
  .brand-loading-mark-sheen::before {
    animation: none;
    transform: translateX(-120%);
  }
}

/* 意识卡片 running 扫光(卡槽③):主机盖在意识画布上的斜向光带。
   transform-only(规则 7 compositor-only);仅 running 挂载,settle 即卸,
   历史卡永远静止(净化器已剥意识自带动画,动感统一由主机供给)。 */
@keyframes ghost-card-sweep {
  0% {
    transform: translateX(-160%) skewX(-12deg);
  }
  100% {
    transform: translateX(420%) skewX(-12deg);
  }
}
.ghost-card-sweep {
  animation: ghost-card-sweep 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .ghost-card-sweep {
    animation: none;
  }
}

/* 召唤法阵终态编舞(GhostSummonCard/SummonSeal,DESIGN.md §14.4 登记):
   running 结束时两道弧在旋转中把缺口收拢至满圆(600ms 一次性 dasharray
   过渡,一次性瞬态允许非合成器属性)→ 光晕从法阵荡开一圈 + ✓ 弹出
   (✓ 复用 Done 语义的唯一批准 overshoot 曲线,同 status-done-pop)。
   motion-reduce 下全部禁用,直接落终态帧。 */
.summon-seal-arc {
  transition:
    stroke-dasharray 600ms var(--motion-ease-out),
    opacity 600ms var(--motion-ease-out);
}
@keyframes summon-seal-halo {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}
.summon-seal-halo {
  animation: summon-seal-halo 0.9s var(--motion-ease-out) forwards;
}
@keyframes summon-seal-tick-pop {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}
.summon-seal-tick-pop {
  animation: summon-seal-tick-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .summon-seal-arc {
    transition: none;
  }
  .summon-seal-halo,
  .summon-seal-tick-pop {
    animation: none;
  }
  .summon-seal-halo {
    opacity: 0;
  }
}

/* Done: pop bounce, stays orange */
.status-bar-done {
  color: var(--status-bar-accent);
  animation: status-done-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes status-done-pop {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* F-MSG-2: Code highlight theme imports — moved to top of file (CSS @import must precede all other statements) */

:root {
  /* Light theme highlight.js styles are the default (imported globally at top of file) */
  --model-budget-gradient: linear-gradient(
    90deg,
    #e11d48,
    #ea580c,
    #d97706,
    #ca8a04,
    #65a30d,
    #16a34a,
    #0d9488
  );
}

.dark {
  --model-budget-gradient: linear-gradient(
    90deg,
    #fb7185,
    #fb923c,
    #fbbf24,
    #fde047,
    #a3e635,
    #4ade80,
    #2dd4bf
  );
}

/* github.css 把 .hljs background 硬编码为 #ffffff,会盖掉 <pre> 的
 * --msg-code-block-bg;surface-elevated 非白的 light 主题(如 solarized-light
 * 的 #eee8d5)会出现色块割裂。改 transparent 让 token 接管。
 * .dark .hljs 显式设 background,特异性更高,不受影响。 */
.hljs {
  background: transparent;
}

/* Dark mode hljs override — full GitHub Dark palette, applied as a complete
   replacement for the light github theme imported on line 1. Previously this
   block was a hand-picked partial override which left several token classes
   (e.g. .hljs-regexp, .hljs-attr, .hljs-name) inheriting light-theme colors
   in dark mode and rendering nearly invisible on dark backgrounds.

   Mirrors highlight.js/styles/github-dark.css 1:1, except `.hljs` background
   uses --msg-code-block-bg (Card #2c2c2a per docs/design-rules/cindy-design-system.md §6) instead of
   github-dark's default #0d1117 — so TextLightbox and message code blocks
   sit on the design system surface. */
.dark .hljs {
  background: var(--msg-code-block-bg);
  color: #c9d1d9;
}
.dark .hljs-doctag,
.dark .hljs-keyword,
.dark .hljs-meta .hljs-keyword,
.dark .hljs-template-tag,
.dark .hljs-template-variable,
.dark .hljs-type,
.dark .hljs-variable.language_ {
  color: #ff7b72;
}
.dark .hljs-title,
.dark .hljs-title.class_,
.dark .hljs-title.class_.inherited__,
.dark .hljs-title.function_ {
  color: #d2a8ff;
}
.dark .hljs-attr,
.dark .hljs-attribute,
.dark .hljs-literal,
.dark .hljs-meta,
.dark .hljs-number,
.dark .hljs-operator,
.dark .hljs-variable,
.dark .hljs-selector-attr,
.dark .hljs-selector-class,
.dark .hljs-selector-id {
  color: #79c0ff;
}
.dark .hljs-regexp,
.dark .hljs-string,
.dark .hljs-meta .hljs-string {
  color: #a5d6ff;
}
.dark .hljs-built_in,
.dark .hljs-symbol {
  color: #ffa657;
}
.dark .hljs-comment,
.dark .hljs-code,
.dark .hljs-formula {
  color: #8b949e;
}
.dark .hljs-name,
.dark .hljs-quote,
.dark .hljs-selector-tag,
.dark .hljs-selector-pseudo {
  color: #7ee787;
}
.dark .hljs-subst {
  color: #c9d1d9;
}
.dark .hljs-section {
  color: #1f6feb;
  font-weight: bold;
}

/* CINDY dark hljs 整改(D 裁决 2026-07-17,§15.4 双门槛):
   github-dark .hljs-section #1f6feb × CINDY surface-elevated #312F2F = 2.87 <3:1(语法色门槛);
   保持色相(蓝 H212 S84%),仅提亮度 L52%→53.5% → #2573ec × #312F2F = 3.00 ≥3:1。
   -punctuation/-tag dark 无单独选择器,继承 .dark .hljs text #c9d1d9(× #312F2F=8.62 ≥3,无需整改)。
   2026-08 色阶改版复算: 代码块底随 surface-elevated 变为 #1F1F1F,#2573ec×#1F1F1F=3.72、
   #c9d1d9×#1F1F1F=10.68,整改值继续达标,选择器与值均不需调整(决策表 §9)。 */
[data-theme='cindy-dark'] .hljs-section {
  color: #2573ec;
}

/* CINDY dark hljs -punctuation/-tag(D 裁决):github-dark "purposely ignored" 无显式色,
   dark 继承 .dark .hljs text #c9d1d9(× #312F2F=8.62 ≥3 达标,无需提亮);
   此处 [data-theme=cindy-dark] 显式覆盖 #c9d1d9 防御性(不依赖继承,满足 D 裁决"三项覆盖",
   值同 text 不降对比度)。 */
[data-theme='cindy-dark'] .hljs-punctuation,
[data-theme='cindy-dark'] .hljs-tag {
  color: #c9d1d9;
}
.dark .hljs-bullet {
  color: #f2cc60;
}
.dark .hljs-emphasis {
  color: #c9d1d9;
  font-style: italic;
}
.dark .hljs-strong {
  color: #c9d1d9;
  font-weight: bold;
}
.dark .hljs-addition {
  color: #aff5b4;
  background-color: #033a16;
}
.dark .hljs-deletion {
  color: #ffdcd7;
  background-color: #67060c;
}

/* Diff full-row fill (2026-04-21) — highlight.js wraps each `+`/`-` line in
 * an inline span, so the background only covers the line's text. We force
 * `display: block` so the colored band stretches to the right edge of the
 * code container, matching the GitHub-style diff render used by DiffView /
 * MarkdownDiffBlock. Applies to both light (github.css) and dark themes. */
.hljs-addition,
.hljs-deletion {
  display: block;
}

/* Solarized Light — 1:1 mirror highlight.js/styles/base16/solarized-light.css,
 * 对 base08 red 做一处偏离:variable / name / template-variable / selector-tag
 * 不再染 red,回退到默认 base05。依据 Schoonover 原作的 "red = errors" 语义
 * (base16 派生版本扩散到标识符是社区改的),base08 仅保留给 hljs-deletion。
 * 选择器 [data-theme="solarized-light"] 特异性高于通用 .hljs-*,不影响其他主题。 */
[data-theme='solarized-light'] .hljs {
  color: #586e75; /* base05 — Solarized default foreground */
}
[data-theme='solarized-light'] .hljs-comment {
  color: #839496; /* base03 */
}
[data-theme='solarized-light'] .hljs-tag {
  color: #657b83; /* base04 */
}
[data-theme='solarized-light'] .hljs-subst,
[data-theme='solarized-light'] .hljs-punctuation,
[data-theme='solarized-light'] .hljs-operator {
  color: #586e75; /* base05 */
}
[data-theme='solarized-light'] .hljs-operator {
  opacity: 0.7;
}
/* hljs-bullet (fenced ```markdown 块内部的 list marker) 并入 base09 橙组:
 * base05 (H=195° 青调) 在 ivory 米黄底有互补色偏色 —— 同 solarized-light.ts
 * 顶部注释为正文主动规避 base00/base01 的坑,且 marker 与 number / literal
 * 同属"索引/标记"语义,base09 是 Solarized 16 色板里唯一的橙。 */
[data-theme='solarized-light'] .hljs-bullet,
[data-theme='solarized-light'] .hljs-symbol,
[data-theme='solarized-light'] .hljs-number,
[data-theme='solarized-light'] .hljs-link,
[data-theme='solarized-light'] .hljs-attr,
[data-theme='solarized-light'] .hljs-variable.constant_,
[data-theme='solarized-light'] .hljs-literal {
  color: #cb4b16; /* base09 orange */
}
[data-theme='solarized-light'] .hljs-title,
[data-theme='solarized-light'] .hljs-class .hljs-title,
[data-theme='solarized-light'] .hljs-title.class_ {
  color: #b58900; /* base0A yellow */
}
[data-theme='solarized-light'] .hljs-strong {
  color: #b58900;
  font-weight: bold;
}
[data-theme='solarized-light'] .hljs-code,
[data-theme='solarized-light'] .hljs-title.class_.inherited__,
[data-theme='solarized-light'] .hljs-string {
  color: #859900; /* base0B green — solarized-light 的 accent 同色 */
}
[data-theme='solarized-light'] .hljs-built_in,
[data-theme='solarized-light'] .hljs-doctag,
[data-theme='solarized-light'] .hljs-quote,
[data-theme='solarized-light'] .hljs-keyword.hljs-atrule,
[data-theme='solarized-light'] .hljs-regexp {
  color: #2aa198; /* base0C cyan */
}
[data-theme='solarized-light'] .hljs-function .hljs-title,
[data-theme='solarized-light'] .hljs-attribute,
[data-theme='solarized-light'] .ruby .hljs-property,
[data-theme='solarized-light'] .hljs-title.function_,
[data-theme='solarized-light'] .hljs-section {
  color: #268bd2; /* base0D blue */
}
[data-theme='solarized-light'] .hljs-type,
[data-theme='solarized-light'] .hljs-template-tag,
[data-theme='solarized-light'] .diff .hljs-meta,
[data-theme='solarized-light'] .hljs-keyword {
  color: #6c71c4; /* base0E violet */
}
[data-theme='solarized-light'] .hljs-emphasis {
  color: #6c71c4;
  font-style: italic;
}
[data-theme='solarized-light'] .hljs-meta,
[data-theme='solarized-light'] .hljs-meta .hljs-keyword,
[data-theme='solarized-light'] .hljs-meta .hljs-string {
  color: #d33682; /* base0F magenta */
}
[data-theme='solarized-light'] .hljs-meta .hljs-keyword,
[data-theme='solarized-light'] .hljs-meta-keyword {
  font-weight: bold;
}
/* Diff bands — 把 GitHub Light 的 #f0fff4 / #ffeef0(冷绿/粉)换成 Solarized
 * 调色板的 12% alpha 版,在米黄底上更协调。
 * addition 走 base0B 绿(与 hljs-string 同源,"green = inserted" 语义);
 * deletion 走 base08 红 —— 这是整套 Solarized Light 配色里唯一保留 base08
 * 的位置,与本文件顶部 Schoonover 原作 "red = errors / deletion" 的取舍一致。 */
[data-theme='solarized-light'] .hljs-addition {
  color: #859900;
  background-color: rgba(133, 153, 0, 0.12);
}
[data-theme='solarized-light'] .hljs-deletion {
  color: #dc322f;
  background-color: rgba(220, 50, 47, 0.12);
}

/* Scrollbar: 6px visible thumb with gap from edges and a hover color.
   Gutter=12px (= sidebar 左 padding pl-3,让 scrollbar-gutter:stable 时左右视觉对称),
   transparent border=3px each side → visible thumb=6px, gap=3px from edges
   ---
   Auto-show: thumb 默认透明,容器带 .is-scrolling 类时显形(由 lib/scrollbarAutoHide.ts
   在滚动 / 鼠标悬停在右侧 scrollbar 带时加上,2s 无活动后移除)。
   注:Chromium 对 ::-webkit-scrollbar-thumb 的 transition 实测不渲染中间帧(已知 quirk),
   所以这里没有 fade 动画,显隐是瞬切。如果想要 fade,只能放弃 native scrollbar
   走自定义 overlay 方案。 */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
/* 纵横滚动条交汇角件默认是不跟主题的白色方块(dark 下刺眼),置透明全皮肤通吃 */
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: transparent;
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 6px;
}
.is-scrolling::-webkit-scrollbar-thumb {
  background-color: var(--msg-scrollbar);
}
.is-scrolling::-webkit-scrollbar-thumb:hover {
  background-color: var(--msg-scrollbar-hover);
}

/* Diff 卡片(chat/DiffView + chat/MarkdownDiffBlock)的横向滚动条 —— 常显,
   不参与 `.is-scrolling` 自动隐藏体系。
   why: 纵向"还有内容"有视觉线索(卡片被容器切断),横向没有 —— 长行到卡片右缘
   就没了,thumb 默认透明时用户根本不知道这里能横滚(2026-07-30 用户反馈)。
   槽厚 12px 与全局纵向槽宽对齐,thumb 同样靠 3px 透明 border 收成可见 6px;
   `:horizontal` 让规则只吃横向条,纵向条继续走 auto-hide。 */
.diff-hscroll::-webkit-scrollbar:horizontal {
  height: 12px;
}
.diff-hscroll::-webkit-scrollbar-thumb:horizontal {
  background-color: var(--msg-scrollbar);
}
.diff-hscroll::-webkit-scrollbar-thumb:horizontal:hover {
  background-color: var(--msg-scrollbar-hover);
}

/* workdir-browse FileTreeView 的横向滚动条 —— 常显,不参与 `.is-scrolling` 自动隐藏
   体系。
   why:文件树行宽由内容决定(行 min-w-max:深层缩进 + 完整文件名/输入框),窄面板里
   必须横滚才能看到深层目标;横向溢出没有“被截断”的视觉线索,thumb 默认透明时用户会认为
   这里没有滚动条(2026-09-14 用户反馈「文件树缺少横向滚动条,层级过深看不见目标层级」)。
   槽厚 12px 与全局纵向槽宽对齐,thumb 同样靠 3px 透明 border 收成可见 6px;
   `:horizontal` 让规则只吃横向条,纵向条继续走 auto-hide。 */
.tree-hscroll::-webkit-scrollbar:horizontal {
  height: 12px;
}
.tree-hscroll::-webkit-scrollbar-thumb:horizontal {
  background-color: var(--msg-scrollbar);
}
.tree-hscroll::-webkit-scrollbar-thumb:horizontal:hover {
  background-color: var(--msg-scrollbar-hover);
}

/* F-QUEUE-DEFER · PendingQueuePanel — slim 4px scrollbar so the
   `scrollbar-gutter: stable both-edges` reserved slot is small
   (4px each side instead of 12px). Without this, the chip-bg rows
   sit ~20px inside the card; with it, ~8px. */
.pending-queue-scroll::-webkit-scrollbar {
  width: 4px;
}
.pending-queue-scroll::-webkit-scrollbar-thumb {
  background-color: var(--msg-scrollbar);
  border: none;
  border-radius: 9999px;
}
.pending-queue-scroll::-webkit-scrollbar-thumb:hover {
  background-color: var(--msg-scrollbar-hover);
}

/* 项目选择菜单的列表:还能继续滚动的一侧 24px 渐隐,提示列表未完(只改透明度,双模式通用)。
   遮罩只取不透明度:currentColor 继承菜单的不透明正文色,不引入字面颜色。 */
.folder-picker-fade-top {
  mask-image: linear-gradient(to bottom, transparent, currentColor 24px);
}
.folder-picker-fade-bottom {
  mask-image: linear-gradient(to bottom, currentColor calc(100% - 24px), transparent);
}
.folder-picker-fade-top.folder-picker-fade-bottom {
  mask-image: linear-gradient(to bottom, transparent, currentColor 24px, currentColor calc(100% - 24px), transparent);
}

/* Composer 形变面板(MorphPopover)内的下拉列表 — 8px 细滚动条。
   配合列表容器的 -mr-2 + scrollbar-gutter:stable,滚动条整体挪进面板右侧
   8px 内边距留白;行宽不再被 12px 全局滚动条挤窄,行高亮/对勾与搜索框、
   vendor tab 右缘像素对齐(2026-07-22 用户反馈的右缘错位)。 */
.morph-panel-list-scroll::-webkit-scrollbar {
  width: 8px;
}
.morph-panel-list-scroll::-webkit-scrollbar-thumb {
  background-color: var(--msg-scrollbar);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 9999px;
}
.morph-panel-list-scroll::-webkit-scrollbar-thumb:hover {
  background-color: var(--msg-scrollbar-hover);
}

/* workdir-browse FileTabsBar — 横向 scrollbar 完全隐藏。
   尝试过几种 overlay 方案 (gutter / -top trick / items-end+padding) 都有
   视觉副作用,最终决定不显示 scrollbar,横向滚动靠 wheel/trackpad 完成。
   active tab 自动定位由 FileTabsBar 直接写 scrollLeft 完成 (32px peek 也在
   JS 里),不依赖 CSS scroll-padding。 */
.workdir-tabs-scroll::-webkit-scrollbar {
  display: none;
}

/* Three small circles fade their opacity in sequence to suggest "model is
   currently emitting thinking". Pure CSS, no JS, no shimmer mask — much
   cheaper than the status-bar shimmer (no @property, no mask animation). */
.thinking-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  /* 与紧凑动作图标和元信息使用同一层级的灰色。 */
  background-color: var(--msg-tool-card-chevron);
  animation: thinking-dot-wave 1.2s ease-in-out infinite;
}
.thinking-dot-1 {
  animation-delay: 0s;
}
.thinking-dot-2 {
  animation-delay: 0.2s;
}
.thinking-dot-3 {
  animation-delay: 0.4s;
}

@keyframes thinking-dot-wave {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

/* SkillhubDetailView — soft entry fade (cooperates with MainLayout FadeSwitcher).
   FadeSwitcher 把外壳 0→1 渐入(220ms),用户仍能感觉到 detail 内部数据填入
   那一帧的"硬切"。这里给 detail 容器再加一层 0.4→1 的快速 fade,叠在
   FadeSwitcher 之上,组合后用户看到的是"逐渐浮现",不是突然就位。 */
@keyframes detail-soft-in {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

/* Agent Island settings — compact mascot animation previews.
   These are renderer-only previews for choosing a skin; the native helper keeps
   its own AppKit/SwiftUI animation timing. */
.agent-island-mascot-stage {
  isolation: isolate;
}

.agent-island-mascot-character {
  --agent-island-mascot-scale: 1;
  transform-origin: 50% 62%;
  transform: translate3d(0, 0, 0) scale(var(--agent-island-mascot-scale));
  will-change: transform;
}

.agent-island-mascot-keyboard {
  transform-origin: 50% 92%;
  will-change: transform;
}

.agent-island-mascot-eyes {
  transform-origin: center;
  will-change: transform;
}

/* 键帽不设常驻 will-change:12 键 x 6 皮肤会造出 72 个常驻合成层,
   而 opacity/transform keyframe 动画激活时 Chromium 会自动按需提层。 */

.agent-island-mascot-sparkle {
  position: absolute;
  z-index: 0;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background-color: var(--settings-section-sublabel);
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(0.6);
  will-change: opacity, transform;
}

.agent-island-mascot-sparkle:nth-child(1) {
  left: 10px;
  top: 9px;
}

.agent-island-mascot-sparkle:nth-child(2) {
  right: 12px;
  top: 11px;
}

.agent-island-mascot-sparkle:nth-child(3) {
  right: 18px;
  bottom: 11px;
}

.agent-island-mascot-stage[data-motion='idle'] .agent-island-mascot-character {
  animation: agent-island-mascot-float 1.7s ease-in-out infinite;
}

.agent-island-mascot-stage[data-motion='working'] .agent-island-mascot-character {
  animation: agent-island-mascot-type 520ms ease-in-out infinite;
}

.agent-island-mascot-stage[data-motion='working'] .agent-island-mascot-keyboard {
  animation: agent-island-mascot-keyboard-tap 520ms ease-in-out infinite;
}

.agent-island-mascot-stage[data-motion='working'] .agent-island-mascot-key {
  animation: agent-island-mascot-key-flash 720ms ease-in-out infinite;
  animation-delay: var(--agent-island-key-delay);
}

.agent-island-mascot-stage[data-motion='waitingApproval'] .agent-island-mascot-character {
  animation: agent-island-mascot-focus 1.15s ease-in-out infinite;
}

.agent-island-mascot-stage[data-motion='waitingApproval'] .agent-island-mascot-eyes {
  animation: agent-island-mascot-eye-focus 1.15s ease-in-out infinite;
}

.agent-island-mascot-stage[data-motion='completed'] .agent-island-mascot-character {
  animation: agent-island-mascot-hop 720ms cubic-bezier(0.2, 0.9, 0.2, 1) infinite;
}

.agent-island-mascot-stage[data-motion='completed'] .agent-island-mascot-sparkle {
  animation: agent-island-mascot-sparkle 720ms ease-out infinite;
  animation-delay: var(--agent-island-sparkle-delay);
}

@keyframes agent-island-mascot-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(var(--agent-island-mascot-scale));
  }
  50% {
    transform: translate3d(0, -2px, 0) scale(var(--agent-island-mascot-scale));
  }
}

@keyframes agent-island-mascot-type {
  0%,
  100% {
    transform: translate3d(-1px, 0, 0) rotate(-1deg) scale(var(--agent-island-mascot-scale));
  }
  50% {
    transform: translate3d(1px, 1px, 0) rotate(1deg) scale(var(--agent-island-mascot-scale));
  }
}

@keyframes agent-island-mascot-keyboard-tap {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, 0.7px, 0);
  }
}

@keyframes agent-island-mascot-key-flash {
  0%,
  100% {
    opacity: 0.55;
    transform: translate3d(0, 0, 0);
  }
  45% {
    opacity: 1;
    transform: translate3d(0, 0.35px, 0);
  }
}

@keyframes agent-island-mascot-focus {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-1deg) scale(var(--agent-island-mascot-scale));
  }
  50% {
    transform: translate3d(0, -1px, 0) rotate(1deg) scale(var(--agent-island-mascot-scale));
  }
}

@keyframes agent-island-mascot-eye-focus {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.58);
  }
}

@keyframes agent-island-mascot-hop {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(var(--agent-island-mascot-scale));
  }
  35% {
    transform: translate3d(0, -5px, 0) scale(var(--agent-island-mascot-scale));
  }
  65% {
    transform: translate3d(0, 1px, 0) scale(var(--agent-island-mascot-scale));
  }
}

@keyframes agent-island-mascot-sparkle {
  0% {
    opacity: 0;
    transform: translate3d(0, 3px, 0) scale(0.45);
  }
  35% {
    opacity: 0.55;
    transform: translate3d(0, -1px, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -5px, 0) scale(0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .agent-island-mascot-stage .agent-island-mascot-character,
  .agent-island-mascot-stage .agent-island-mascot-keyboard,
  .agent-island-mascot-stage .agent-island-mascot-key,
  .agent-island-mascot-stage .agent-island-mascot-eyes,
  .agent-island-mascot-stage .agent-island-mascot-sparkle {
    animation: none !important;
  }
}

/* FileBodyView Ctrl+F — local search highlight inside doc preview.
   Two states:
     .doc-search-mark              → normal match
     .doc-search-mark[data-active] → currently focused match + inset outline
   Share the theme tokens with global find and the file editor. */
.doc-search-mark {
  background-color: hsl(var(--search-match-bg));
  color: hsl(var(--search-match-fg));
  /* font / line-height 显式继承 —— <mark> 是 phrasing element,Chromium UA
     默认不改字号,但跨主题 / 跨 reset 时把字体属性钉在 inherit 最稳,避免
     把 code block 里那段被高亮的字渲染得跟周围尺寸不一致。 */
  font: inherit;
  line-height: inherit;
  padding: 2px 1px;
  border-radius: 2px;
}
.doc-search-mark[data-active] {
  background-color: hsl(var(--search-match-active-bg));
  color: hsl(var(--search-match-active-fg));
  font-weight: 500;
  /* 用 inset box-shadow 模拟外框 —— 比 outline 好在不会在盒子外多画
     1px,高亮块严格等于行高,视觉上不会觉得"字变大了"。 */
  box-shadow: inset 0 0 0 1px hsl(var(--search-match-active-fg));
}

/* CodeMirror search highlight (PlaintextEditor — code 模式 + plain 模式都
   走 CodeMirror 后,所有文件类型的编辑/代码预览都用这套 decoration)。
   Same tokens as .doc-search-mark above. .cm-doc-search-active is added to
   the active match IN ADDITION TO .cm-doc-search-match — second selector
   wins via source order, no specificity tricks needed. */
.cm-doc-search-match {
  background-color: hsl(var(--search-match-bg));
  color: hsl(var(--search-match-fg));
  border-radius: 2px;
}
.cm-doc-search-active {
  background-color: hsl(var(--search-match-active-bg));
  color: hsl(var(--search-match-active-fg));
  font-weight: 500;
  /* outline 而不是 inset box-shadow:CodeMirror 的 .cm-line 自己用
     box-shadow 画选区背景层,inset 会被它的层级压掉,outline 走的是
     完全独立的绘制通道,稳定可见。1px 外描边在等宽字体里几乎不会让
     字符看起来变大。 */
  outline: 1px solid hsl(var(--search-match-active-fg));
}

/* Syntax decorations may sit inside search marks. Keep their text on the
   mark's foreground instead of repainting pale syntax colors on a gold fill. */
.cm-editor .cm-content .cm-doc-search-match *,
mark.doc-search-mark [class] {
  color: inherit;
}

/* Settings search navigation briefly marks the section selected from the
   sidebar. Reuse the existing dual-theme search tokens instead of baking a
   light-only color into the settings surface. */
.settings-search-target-highlight {
  outline: 1px solid hsl(var(--search-match-active-fg));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px hsl(var(--search-match-active-bg) / 0.28);
  transition:
    outline-color var(--motion-fast) var(--motion-ease-move),
    box-shadow var(--motion-fast) var(--motion-ease-move);
}

@layer utilities {
  .text-sidebar-item-active-foreground {
    color: var(--sidebar-item-active-foreground);
  }

  /* Disabled controls keep the ordinary desktop arrow. Their visual disabled
     state already comes from opacity/color, so a separate cursor adds noise. */
  .cursor-not-allowed,
  .disabled\:cursor-not-allowed:disabled,
  .data-\[disabled\]\:cursor-not-allowed[data-disabled] {
    cursor: default;
  }
}

/* KaTeX math in chat markdown (rehype-katex output).
   - display 公式(.katex-display)可能超出气泡宽度,给横向滚动而不是溢出;
     overflow-y hidden 防止某些字形基线计算触发的 1px 纵向滚动条。
   - KaTeX 文字色走 currentColor,天然跟随主题,无需 token override。
   - 不覆盖 KaTeX 默认字号(1.21em 相对正文),与主流公式排版一致。 */
.msg-markdown .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
  margin: 8px 0;
}
.msg-markdown .katex {
  /* 长 inline 公式允许在气泡内换行退化为可断行,避免撑破布局。 */
  white-space: normal;
}
.msg-markdown .katex-display .katex {
  /* display 模式内部保持不换行,交给外层横向滚动。 */
  white-space: nowrap;
}

/* Sidebar peek 抽屉滑入(useSidebarPeek / Sidebar.tsx peeking 态)。
   用 keyframes 而非双 rAF 翻 transition:animation-name 从 none 变为有值即
   触发一次播放,无首帧竞态;滑出走 peekClosing 态的 transition(见 Sidebar.tsx)。 */
@keyframes sidebar-peek-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* 侧栏超长任务标题:只在实际溢出且 hover 时把完整标题横向带过视口。
   轨道是 HTML 元素,动效只改 transform/opacity,离开标题区域立即恢复省略号。 */
@keyframes sidebar-title-marquee {
  0%,
  12% {
    transform: translateX(0);
  }
  88%,
  100% {
    transform: translateX(var(--sidebar-title-marquee-shift));
  }
}

.sidebar-title-marquee {
  position: relative;
  display: block;
}

.sidebar-title-marquee__ellipsis {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-title-marquee__track {
  position: absolute;
  inset: 0 auto auto 0;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
}

.sidebar-title-marquee[data-title-overflowing='true'] .sidebar-title-marquee__ellipsis {
  opacity: 0;
}

.sidebar-title-marquee[data-title-overflowing='true'] .sidebar-title-marquee__track {
  visibility: visible;
  opacity: 1;
  animation: sidebar-title-marquee var(--sidebar-title-marquee-duration) var(--motion-ease-move)
    forwards;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-title-marquee[data-title-overflowing='true'] .sidebar-title-marquee__track {
    animation: none;
    visibility: hidden;
    opacity: 0;
  }

  .sidebar-title-marquee[data-title-overflowing='true'] .sidebar-title-marquee__ellipsis {
    opacity: 1;
  }
}

/* 布局树引擎分割线(C1,LayoutRoot 渲染)——面板之间的 1px 缝由引擎统一画,
   面板自己不再画侧边框(两块时代"各画一侧"的做法在 N 块布局下会漏缝)。
   未来统一拖宽把手也落位在这条缝上。颜色走 token(规则 16)。
   邻接面板折叠(data-pane-collapsed,如工具面板收起到 0 宽)或隐藏
   (.hidden,如 maximize 时的主区)时,这条缝随之隐藏,不留孤线。 */
.layout-divider-v {
  width: 1px;
  flex: 0 0 auto;
  align-self: stretch;
  background: var(--border-default);
}
.layout-divider-h {
  height: 1px;
  flex: 0 0 auto;
  background: var(--border-default);
}
/* CINDY 毛玻璃下根容器透明,缝的背后是窗口原生材质;CINDY 边框是半透明墨水
   (DESIGN.md §15.16),先垫页面底色再叠线色,不让窗外透出来。壁纸模式下两侧面板
   本身就透出壁纸画布,缝照常直接叠在画布上。 */
[data-theme='cindy-light'] :is(.layout-divider-v, .layout-divider-h),
[data-theme='cindy-dark'] :is(.layout-divider-v, .layout-divider-h) {
  background: linear-gradient(var(--border-default), var(--border-default)), var(--surface);
}
html[data-wallpaper-active='true'] :is(.layout-divider-v, .layout-divider-h) {
  background: var(--border-default);
}
/* CINDY 文字色是半透明墨水,图标经 currentColor 继承同一颜色;图标由多段描边拼成,
   半透明时每段各叠一次,交叠处出深点(浅色)/亮点(深色)。改为整枚合成:子元素按同色
   不透明绘制,整枚图标再按原色透明度蒙一层,等同实色图标整体降透明度。不透明颜色时
   蒙层全透光,视觉零变化;:where 不加优先级,组件可自行覆盖。lucide 图标自动生效,
   手写的单色多段图标加 data-ink-icon(子元素若另有颜色会被一起蒙淡,不要加)。 */
@supports (color: rgb(from currentColor r g b / 1)) {
  :where([data-theme='cindy-light'], [data-theme='cindy-dark'])
    :where(svg.lucide, svg[data-ink-icon]) {
    mask-image: linear-gradient(currentColor, currentColor);
  }
  :where([data-theme='cindy-light'], [data-theme='cindy-dark'])
    :where(svg.lucide > *, svg[data-ink-icon] > *) {
    color: rgb(from currentColor r g b / 1);
  }
}
/* 隐线规则是**单侧**的 —— 面板收起/隐藏后它两侧的缝要"合并成一条",不能两条全藏
   (否则收起中间面板后,剩下相邻两块之间反而没线了,2026-07-08 实测 bug):
   - 折叠(0 宽)面板:藏它**前面**那条缝,保留后面那条作为合并后的缝;
     经典布局(工具面板在最右)收起后窗口右缘因此不留孤线;
   - 隐藏(display:none,如 maximize 时的主区)面板:藏它**后面**那条缝
     (maximize 场景主区在前,如此正好不在接管面板左缘留线)。 */
.layout-divider-v:has(+ [data-pane-collapsed]),
.hidden + .layout-divider-v {
  display: none;
}

/* E4D 毛玻璃(R1 audit,用户裁决透壁纸 2026-07-17):仅 CINDY family,窗口 vibrancy
   透壁纸(main 设置)+ 应用内 backdrop-filter 互透。**仅侧栏 + 浮层 blur;主内容区
   不透明(macOS 标准范式;用户勘误 2026-07-17:主区不透壁纸,content-area 回落
   --content-area=--surface-hsl 不透明,2026-08 起 #F2F2ED/#181818)**。blur(50px 侧栏、6px 浮层)。
   精确选择器(转义 Tailwind class .bg-\[var\(--panel-bg\)\] 等,避免 contains 过命中渐变/border)。其他 family 不命中,行为零变化。 */
[data-theme='cindy-light'] body,
[data-theme='cindy-dark'] body {
  background: transparent;
}
/* CINDY 根容器让路(2026-07-18 真凶修复):MainLayout 根 div(h-screen bg-content-area)整窗
   不透明垫底,把侧栏毛玻璃与窗外壁纸隔死——主区 <main> 自带 bg-content-area,根层职责冗余,
   CINDY 下透明化;其他 family 不受影响。 */
[data-theme='cindy-light'] .h-screen.bg-content-area,
[data-theme='cindy-dark'] .h-screen.bg-content-area {
  background: transparent;
}

/* 模式1 侧栏(light):半透底,壁纸模糊由原生 vibrancy sidebar 材质提供。
   红渐变覆盖层已拆除(用户裁决 2026-07-18:Figma 该两块渐变矩形按装饰废稿处理,不实现);
   CSS backdrop-filter 已撤(A/B 实证:blur 会把透明窗背衬黑箱)。 */
/* 2026-07-21 用户裁决:模式1 玻璃只保留左侧栏(aside.bg-sidebar)。
   .bg-\[var\(--panel-bg\)\] 已从本规则移除 —— 该 class 的消费者全是右侧工具面板族
   (RSB TabBar/Body、Review、PanelChrome、Ghost 面板、独立窗顶带),被劫持成玻璃后
   与左侧主区(不透明 content-area)底色打架;移除后回落 CINDY 的 --panel-bg
   (2026-08 起 #F2F2ED/#181818),与主区同色,右侧面板整体与左边聊天区一致(模式2 口径)。 */
[data-theme='cindy-light'] aside.bg-sidebar {
  background: var(--surface-translucent-sidebar);
}
[data-theme='cindy-dark'] aside.bg-sidebar {
  background: var(--surface-translucent-sidebar);
  /* backdrop-filter 移除:CSS blur 采样不到窗外壁纸,且已知会把透明窗背衬渲染成黑;壁纸模糊由原生 vibrancy 材质提供 */
}
/* Windows Acrylic 的 BrowserWindow backing 已在创建期铺同一份 85% 侧栏染色,确保快速
   扩窗时原生新区域先显示正确颜色。常规侧栏让 backing 直接透出,避免 CSS 再叠一遍导致
   颜色变重;peek drawer 覆盖的是应用内容,仍保留下方独立的染色 + blur。 */
[data-platform='win32'][data-window-backdrop-material='acrylic'][data-theme='cindy-light']
  aside.bg-sidebar:not([data-sidebar-peek-drawer]),
[data-platform='win32'][data-window-backdrop-material='acrylic'][data-theme='cindy-dark']
  aside.bg-sidebar:not([data-sidebar-peek-drawer]) {
  background: transparent;
}
/* Sidebar peek 抽屉是 fixed overlay,它覆盖的是应用内容而不是窗外壁纸;这里需要
   单独 blur 被覆盖的应用 UI,避免 hover 预览时正文直接透出来。常规展开态仍交给
   原生 vibrancy,非 CINDY family 不命中。 */
[data-theme='cindy-light'] aside.bg-sidebar[data-sidebar-peek-drawer],
[data-theme='cindy-dark'] aside.bg-sidebar[data-sidebar-peek-drawer] {
  background: var(--surface-translucent-sidebar);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}
/* 模式2 主面板:用户勘误 2026-07-17 — 主内容区不透壁纸(macOS 标准范式),撤销 blur。
   content-area 回落 --content-area(=var(--surface-hsl) 不透明,2026-08 起 #F2F2ED/#181818),无 blur。
   surface-translucent-main token 保留注册但 CINDY override 改不透明等价值(见 cindy themes)。 */
/* 模式3 浮层卡:blur 6px + surface-translucent-overlay(cmd-palette/popover 类) */
[data-theme='cindy-light'] .bg-\[var\(--cmd-palette-bg\)\],
[data-theme='cindy-dark'] .bg-\[var\(--cmd-palette-bg\)\] {
  background: var(--surface-translucent-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* Windows 例外:cmd-palette 浮层一律不透明、不加模糊 —— 透明窗口背景上的 CSS
   backdrop-filter 可能渲染成黑块(§15.12,菜单常在侧栏上方打开),集显 / 软件渲染有性能风险,
   Windows 原生材质也未实机验证。回落 --cmd-palette-bg 本身(CINDY 下即 Card 面板色
   --surface-elevated),1px 描边与阴影不变。 */
[data-platform='win32'][data-theme='cindy-light'] .bg-\[var\(--cmd-palette-bg\)\],
[data-platform='win32'][data-theme='cindy-dark'] .bg-\[var\(--cmd-palette-bg\)\] {
  background: var(--cmd-palette-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* 弹窗外框(DESIGN §4 Dialog & Modal):所有模态弹窗的遮罩与面板都用这两个类,不在调用处
   另写颜色、模糊、圆角、底色、描边或阴影(modalSurfaceContract.test.ts 守护)。
   - 遮罩:--overlay-modal 压暗 + 背后内容模糊 4px;Windows 不模糊 —— 透明窗口上的 CSS
     backdrop-filter 可能渲染成黑块,集显 / 软件渲染有性能风险(§15.12,与菜单毛玻璃同口径)。
   - 面板:12px 容器圆角、--confirm-bg 卡片底、1px Board 描边、与下拉菜单同一个登记浮层阴影 --shadow-menu。
   - 出现 / 消失(DESIGN §14.4 heavy overlay,参照 Fluid Functionalism chat-message 的入场):
     遮罩淡入;面板淡入 + 上浮 8px + 0.96→1,--motion-enter / --motion-ease-out。
     消失只淡出、不倒放入场,--motion-exit / --motion-ease-in。Radix 弹窗按 data-state 走
     入退场(Presence 等退场动画结束才卸载);手写弹窗没有 data-state,只有挂载时的入场。
     用 left-1/2 top-1/2 + -translate-x/y-1/2 居中的面板,关键帧要带上 translate(-50%,-50%),
     否则动画期间会盖掉 Tailwind 的居中位移、整块跳到左上。时长走 motion token,减弱动效时归零。
   放在 components 层,宽度、定位、内边距等布局类照常由 Tailwind 工具类决定。 */
@keyframes modal-scrim-in {
  from {
    opacity: 0;
  }
}
@keyframes modal-fade-out {
  to {
    opacity: 0;
  }
}
@keyframes modal-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}
@keyframes modal-panel-in-centered {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(8px) scale(0.96);
  }
  to {
    transform: translate(-50%, -50%);
  }
}
@layer components {
  .modal-scrim {
    background-color: var(--overlay-modal);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: modal-scrim-in var(--motion-enter) var(--motion-ease-out);
  }
  .modal-panel.-translate-x-1\/2 {
    animation-name: modal-panel-in-centered;
  }
  .modal-scrim[data-state='closed'],
  .modal-panel[data-state='closed'] {
    animation: modal-fade-out var(--motion-exit) var(--motion-ease-in) forwards;
  }
  [data-platform='win32'] .modal-scrim {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .modal-panel {
    border-radius: 0.75rem;
    border: 1px solid var(--border-default);
    background-color: var(--confirm-bg);
    box-shadow: var(--shadow-menu);
    animation: modal-panel-in var(--motion-enter) var(--motion-ease-out);
  }
}

/* MorphPopover 菜单面板(输入框的模型 / 权限 / + 菜单)终态与共享下拉菜单同一材质:面板底色
   经内联 background-color 从 chip 底色形变过去,所以用变量承接上面两条规则的取值 ——
   其它主题 = --cmd-palette-bg,Cindy 主题 = 毛玻璃底 + blur 6px,Windows 一律实色、无模糊。 */
:root {
  --menu-panel-surface: var(--cmd-palette-bg);
}
[data-theme='cindy-light'],
[data-theme='cindy-dark'] {
  --menu-panel-surface: var(--surface-translucent-overlay);
}
[data-platform='win32'][data-theme='cindy-light'],
[data-platform='win32'][data-theme='cindy-dark'] {
  --menu-panel-surface: var(--cmd-palette-bg);
}
[data-theme='cindy-light'] [data-menu-surface],
[data-theme='cindy-dark'] [data-menu-surface] {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
[data-platform='win32'][data-theme='cindy-light'] [data-menu-surface],
[data-platform='win32'][data-theme='cindy-dark'] [data-menu-surface] {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* 共享下拉菜单行(components/ui/dropdown-menu.tsx,DESIGN §4):行内 Lucide 图标平时线宽 1.5,
   高亮 / 勾选 / 展开时回到 2。只动默认线宽(stroke-width="2")的图标:显式传了其他 strokeWidth 的
   不命中;显式传 2 的由组件标上 data-menu-icon-stroke(行内直接子元素与普通标签内可识别)。
   data-menu-row="skip" 是面板里的非选项块(开关、价格卡,menu-row.tsx menuSkipAttrs),不变细。 */
[data-menu-row]:not([data-menu-row='skip']) svg.lucide[stroke-width='2']:not([data-menu-icon-stroke]) {
  stroke-width: 1.5;
  transition: stroke-width var(--motion-instant) var(--motion-ease-out);
}
[data-menu-row]:is(
    [data-menu-active],
    [data-highlighted],
    [data-state='checked'],
    [data-state='open']
  )
  svg.lucide[stroke-width='2']:not([data-menu-icon-stroke]) {
  stroke-width: 2;
}

/* Opt-in whole-window wallpaper. Page surfaces share one fixed canvas;
   elevated controls and external web content keep their readable surfaces. */
html[data-wallpaper-active='true'] body {
  isolation: isolate;
  background: var(--surface);
}
html[data-wallpaper-active='true'] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-color: var(--surface);
  background-image: linear-gradient(
    color-mix(in srgb, var(--surface) var(--app-wallpaper-veil), transparent),
    color-mix(in srgb, var(--surface) var(--app-wallpaper-veil), transparent)
  ), var(--app-wallpaper-image);
  background-size: auto, cover;
  background-position: center;
  background-repeat: no-repeat;
}
html[data-wallpaper-active='true'] :is(
  .bg-content-area,
  .app-wallpaper-surface,
  main[class~='bg-[var(--surface)]'],
  [class~='bg-[var(--panel-bg)]'],
  [class~='bg-[var(--settings-bg)]']
) {
  background-color: transparent;
}
html[data-wallpaper-active='true'] aside.bg-sidebar:not([data-sidebar-peek-drawer]) {
  background: transparent;
}
/* Fixed attachment uses the same viewport coordinates as the canvas. The
   footer masks scrolled messages without introducing a differently tinted slab. */
html[data-wallpaper-active='true'] :is(.wallpaper-composer-zone, .wallpaper-composer-fade) {
  position: relative;
  isolation: isolate;
  background-color: var(--surface);
  background-image: linear-gradient(
    color-mix(in srgb, var(--surface) var(--app-wallpaper-veil), transparent),
    color-mix(in srgb, var(--surface) var(--app-wallpaper-veil), transparent)
  ), var(--app-wallpaper-image);
  background-size: auto, cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
html[data-wallpaper-active='true'] .wallpaper-composer-fade {
  mask-image: linear-gradient(transparent, currentColor);
}

/* Keep the decoded old canvas above the new one and fade only its opacity.
   Fixed composer copies follow the same transition, preserving the crop and
   theme veil across the entire window without fading text or controls.
   Zero-specificity mode guards let local positioning and reduced motion win. */
html[data-wallpaper-transition='true'] body::after,
html[data-wallpaper-transition='true']:where(:not([data-wallpaper-motion='dynamic']):not([data-wallpaper-blur='true'])) :is(.wallpaper-composer-zone, .wallpaper-composer-fade)::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: var(--surface);
  background-image: linear-gradient(
    color-mix(in srgb, var(--surface) var(--app-wallpaper-veil), transparent),
    color-mix(in srgb, var(--surface) var(--app-wallpaper-veil), transparent)
  ), var(--app-wallpaper-previous-image);
  background-size: auto, cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: app-wallpaper-image-out var(--motion-fast) var(--motion-ease-move) both;
}
html[data-wallpaper-transition='true'] :is(.wallpaper-composer-zone, .wallpaper-composer-fade)::before {
  position: absolute;
  z-index: -1;
  background-attachment: fixed;
}
@keyframes app-wallpaper-image-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-wallpaper-transition='true'] body::after,
  html[data-wallpaper-transition='true'] :is(.wallpaper-composer-zone, .wallpaper-composer-fade)::before {
    animation: none;
    opacity: 0;
  }
}

/* Blend video into an opaque theme surface before composing with the UI.
   A separate translucent veil over a hardware video overlay changes brightness
   when P3 content switches Windows HDR output to scRGB. Keep visibility on the
   video itself; the wrapper opacity is reserved for loading/exit crossfades. */
.app-wallpaper-video {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--surface);
  transition: opacity var(--motion-base) var(--motion-ease-move);
}
.app-wallpaper-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: calc(100% - var(--app-wallpaper-veil));
}
/* Fade the message layer itself, so the moving scene remains continuous behind
   the composer. Repainting a static copy there would create a visible seam. */
html:is([data-wallpaper-motion='dynamic'], [data-wallpaper-blur='true']) .wallpaper-message-viewport [data-scroll-container] {
  mask-image: linear-gradient(to bottom, black calc(100% - var(--wallpaper-composer-height)), transparent calc(100% - var(--wallpaper-composer-height) + 32px));
}
html:is([data-wallpaper-motion='dynamic'], [data-wallpaper-blur='true']) :is(.wallpaper-composer-zone, .wallpaper-composer-fade) {
  background: transparent;
}

/* Opt-in media-only blur. Overscan by three radii before clipping to avoid
   sampling transparent edges. Static and moving canvases share the same crop;
   zero blur leaves the original compositor path entirely unchanged. */
html[data-wallpaper-blur='true'] body::before,
html[data-wallpaper-blur='true'] body::after {
  inset: calc(-3 * var(--app-wallpaper-blur));
  filter: blur(var(--app-wallpaper-blur));
}
html[data-wallpaper-blur='true'] .app-wallpaper-video {
  overflow: hidden;
}
html[data-wallpaper-blur='true'] .app-wallpaper-video video {
  position: absolute;
  inset: calc(-3 * var(--app-wallpaper-blur));
  width: calc(100% + 6 * var(--app-wallpaper-blur));
  height: calc(100% + 6 * var(--app-wallpaper-blur));
  max-width: none;
  filter: blur(var(--app-wallpaper-blur));
}