/* 自托管 Noto Sans Mono（原 Google Fonts 链路在国内不可达）：latin 子集可变
   字体单文件覆盖 400-700 全部字重；界面等宽场景不超 latin 范围。OFL 许可文本
   在 public/fonts/LICENSE-OFL.txt */
@font-face {
  font-family: "Noto Sans Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/noto-sans-mono-latin.woff2") format("woff2");
}

:root {
  /* 字号体系（spec R1.2）：全局唯一字号，对话区、chrome
     层与应用 chrome 一律 16px，层级只靠粗细、明暗、下划线表达。
     行高与块间距由 calc 从字号推导，调整字号只改这里。 */
  --fs-chat: 16px;
  /* 圆形图标按钮之间的间距（顶栏按钮组与输入区按钮行共用）: 同一数值
     只在此定义一次，两处布局引用，防止各自漂移（spec R12.2）。 */
  --gap-button: 8px;
  /* 行内前缀符号（活动行错误 ✕）到文字的间距: 取 1ch（等宽 16px 下
     9.59px）。前缀符号行内化，不再占独立前缀列；
     符号字形宽不假设等宽——PingFang SC 回退的 ✕ 是全宽。 */
  --prefix-gap: 1ch;
  --lh-chat: 1.5;
  --gap-block: calc(var(--fs-chat) * var(--lh-chat));
  --bg: #ffffff;
  --bg-panel: #f5f5f5;
  --bg-sheet: #ffffff;
  --tint-bg: #ffffff;
  --bg-hover: #eeeeee;
  --bg-selected: #e8e8e8;
  --border: #e0e0e0;
  --text: #1a1a1a;
  /* 次级/暗色灰阶（spec R3.1/R5.4 r13）: 纯灰阶，不用带蓝的框架灰。
     muted 对 bg 约 7.0:1；dim 对 bg 约 4.5:1（行内代码、路径按正文级
     可读性要求 ≥ 4.5），层级 text > muted > dim 在两个主题下都成立。 */
  --text-muted: #595959;
  --text-dim: #767676;
  --accent: #2563eb;
  --diff-del: #cd2b31;
}

html.dark {
  --bg: #1a1a1a;
  --bg-panel: #242424;
  --bg-sheet: #242424;
  --tint-bg: #1a1a1a;
  --bg-hover: #2e2e2e;
  --bg-selected: #383838;
  --border: #3a3a3a;
  --text: #e8e8e8;
  /* 暗色主题同规则（r13）: muted #a6a6a6 约 7.2:1，dim #8a8a8a 约 5.0:1。 */
  --text-muted: #a6a6a6;
  --text-dim: #8a8a8a;
  --accent: #60a5fa;
  /* 错误红分主题：红由 #e5484d 提亮一档过 4.5（#e5484d 对 #1a1a1a 只有 4.45） */
  --diff-del: #f2555a;
}

* {
  box-sizing: border-box;
}

/* 文档滚动架构（iOS 26 全屏铺满）: html/body 不再钉成视口高度 +
   overflow hidden 的应用壳，内容自然生长、由文档滚动器承载滚动——
   iOS 26 Safari 只有整个文档滚动时才让内容延伸到状态栏与底部工具栏
   下面，内 overflow 容器过不去。固定元素（返回按钮、输入行、通知、
   弹层）各自用 env(safe-area-inset-*) 与既定公式让位。 */
html {
  /* overflow-x hidden 防意外横向溢出（overflow-y visible 在根上传到
     视口后按 auto 处理，纵向滚动不受影响）；overflow-anchor none 关
     根滚动器的原生滚动锚定——贴底跟随由程序显式写 scrollTop，两套
     锚定打架（S9 实测），原对话区容器的同款纪律搬到根上；
     scrollbar-width/::-webkit-scrollbar 隐藏页面级滚动条——原应用壳
     架构下本就没有页面滚动条，维持原观感，滚轮/触摸滚动不受影响。 */
  overflow-x: hidden;
  overflow-anchor: none;
  scrollbar-width: none;
  /* 橡皮筋露底与链式滚动：overscroll 关掉，露出的就是本底的
     var(--tint-bg)，状态栏/工具栏着色与页面底色一致（Safari 26 从
     body 背景或贴边 fixed 元素取色）。 */
  overscroll-behavior: none;
  /* 触屏双击缩放：iOS Safari 忽略 viewport 的 maximum-scale（iOS 10+），
     靠 viewport 关不掉，只能靠 touch-action: manipulation；滚动与双指缩放
     保留，局部 touch-action: none 的弹层（滑动手势）按更严格值生效不受影响。
     连续快速点选会反复触发系统双击缩放，页面被放大
     （pagemark 划线页同款解法）。 */
  touch-action: manipulation;
}
html::-webkit-scrollbar {
  display: none;
}
html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--tint-bg);
  color: var(--text);
  /* 应用 chrome 的默认栈（r17）: 中文字体在 generic sans-serif 之前，
     同 --font-mono 的 generic 栈尾纪律——UI 文案是简体中文，generic 按
     浏览器语言展开（日语 = Hiragino）会在前面截走日文汉字共通字。 */
  font-family: -apple-system, BlinkMacSystemFont, Roboto,
    'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC',
    sans-serif;
  /* 全局唯一字号（R1.2）: html 上的声明同时是 rem 基准（1rem = 16px，
     浏览器标准默认值） */
  font-size: var(--fs-chat);
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

:root {
  /* 拉丁等宽前缀（r17 拆分）: generic monospace 不再出现在这里——
     generic 按浏览器界面语言展开（日语 = Osaka 等幅），放栈中部会在
     中文字体之前截走日文汉字共通字，简体专有字才落到后面的中文字体，
     一行中文两种字重（r17 实测，见 --font-mono 注释）。 */
  --font-noto-mono: "Noto Sans Mono", ui-monospace, "JetBrains Mono", "Fira Code";
  /* generic monospace 只能放栈尾: 中文字体必须出现在任何 generic 之前，
     日文汉字共通字与简体专有字才统一来自一款简体中文字体，不受系统 /
     浏览器语言影响。栈的中文字体段紧随拉丁段之后（r17 起），顺序:
     PingFang SC（macOS/iOS 常驻）→ Hiragino Sans GB（macOS 简体黑体
     补位）→ Noto Sans CJK SC（Linux/Android）
     → generic 栈尾兜底。根元素 lang="zh-CN"（index.html）负责语言相关
     的最后回退取向。r17 实测: 修复前探针「测试强调过调全部通斜体色」
     劈成 Osaka(6)+PingFang SC(6)，修复后 12 字全部 PingFang SC，两主题
     一致（r17/measure.txt）。代价: 假名不再走日文字体（Osaka），改由
     PingFang SC 的假名字形渲染——简体优先的既定取舍，与
     --font-content-sans 一致。 */
  --font-mono: var(--font-noto-mono), 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC', monospace;
  /* 用户内容用。lang 若解析到日文字体会让中文汉字呈现日文字形，
     因此内容域字体栈把中文字体放在前面（假名与 UI 表记交给后续的
     日文字体与整体默认栈处理）。拉丁文字前 4 种相同，不受影响。 */
  --font-content-sans: -apple-system, BlinkMacSystemFont, Roboto,
    'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC',
    'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic Medium', YuGothic,
    sans-serif;
}

pre, code {
  font-family: var(--font-mono);
}

/* markdown 输出样式 — fx 排版洁癖规格（hui-fx-polish/spec.txt）:
   等宽单字号、灰阶层级、块间距恒一个空行、无卡片 */
.markdown-body {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-size: var(--fs-chat);
  line-height: var(--lh-chat);
  color: var(--text);
  word-break: break-word;
  font-family: var(--font-mono);
}

/* 块间距: 恒一个空行（fx BlockGapPolicy default_gap_rows=1），20px = 基准行高取整 */
.markdown-user-message.markdown-body { padding-left: 0; }
/* 说话人标签（R4.1）：灰色、与正文同字号，跟首段行内
   （换行回左端不悬挂）；首个块为列表/标题/代码块时独占一行，
   不挤进块内。文案由 JS 侧经 --hui-speaker-label 传入（名字见 shared.browser.ts 的 CSS_VAR）。 */
.hui-speaker-labeled > :first-child::before {
  content: var(--hui-speaker-label, "");
  color: var(--text-muted);
}
.hui-speaker-labeled > ul:first-child::before,
.hui-speaker-labeled > ol:first-child::before,
.hui-speaker-labeled > pre:first-child::before,
.hui-speaker-labeled > h1:first-child::before,
.hui-speaker-labeled > h2:first-child::before,
.hui-speaker-labeled > h3:first-child::before,
.hui-speaker-labeled > h4:first-child::before,
.hui-speaker-labeled > h5:first-child::before,
.hui-speaker-labeled > h6:first-child::before,
.hui-speaker-labeled > .markdown-code-block:first-child::before {
  display: block;
}
.markdown-body p { margin: 0 0 var(--gap-block); }
/* 消息内 markdown 的末块不带走距: 块间距由消息外层 margin 统一承担，
   避免双份叠加（r2 实测 48px 的根因） */
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  font-weight: 700;
  font-size: var(--fs-chat);
  margin: var(--gap-block) 0 var(--gap-block);
  color: var(--text);
  line-height: var(--lh-chat);
  letter-spacing: 0;
}
/* 标题与前后块的间距都等于块间距（R2.1）；首个子标题的 top 归零，
   避免与消息外层 margin 叠加成双份 */
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1 { text-decoration: underline; text-underline-offset: 3px; }
.markdown-body h3 { font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.markdown-body h4 { font-weight: 700; color: var(--text-dim); }
.markdown-body h5 { font-weight: 400; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body h6 { font-weight: 400; color: var(--text-dim); }
/* 列表（R5.2）: 符号在正文列内。符号左边缘与正文列左边缘对齐，
   列表文字从符号之后开始，续行对齐列表文字。
   --li-indent / --ol-start 由 markdown.browser.tsx 按 CSS_VAR 写入。
   --li-indent 是该列表的符号占宽：无序列表的默认 2ch 正好覆盖 "• "；
   有序列表按最宽序号写入（位数 + 点号 + 一个空格）。等宽字体下
   1ch = 一个字符宽，缩进全部用 ch 计算。 */
.markdown-body ul, .markdown-body ol {
  --li-indent: 2ch;
  --ol-start: 0;
  padding-left: 0;
  margin: 0 0 var(--gap-block);
  list-style: none;
  counter-reset: hui-ol var(--ol-start);
}
.markdown-body li {
  margin: 0;
  padding-left: var(--li-indent);
  line-height: var(--lh-chat);
  position: relative;
}
.markdown-body li::before {
  position: absolute;
  left: 0;
  width: var(--li-indent);
  text-align: left;
  white-space: nowrap;
  color: var(--text);
  font-weight: 400;
}
.markdown-body ul > li::before { content: "• "; }
.markdown-body ol > li::before {
  content: counter(hui-ol) ".";
  counter-increment: hui-ol;
}
/* 嵌套列表在父列表文字列的基础上继续缩进 */
.markdown-body li > ul, .markdown-body li > ol {
  margin-bottom: 0;
  margin-top: 0;
}
.markdown-body li > p { margin: 0; }
.markdown-body li:last-child { margin-bottom: 0; }
.markdown-body strong {
  color: var(--text);
  font-weight: 700;
}
.markdown-body em { color: var(--text-muted); font-style: italic; }
.markdown-body a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
}
.markdown-body img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  margin: 0 0 var(--gap-block);
  border-radius: 0;
}
.markdown-body .markdown-inline-code {
  background: transparent;
  border-radius: 0;
  padding: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-chat);
  /* 仅变暗（R5.4）：字重固定 400 */
  font-weight: 400;
}
/* 点击复制的反馈态：文字短暂升到正文色，1500ms 后回到 dim */
.markdown-body .markdown-inline-copied {
  color: var(--text);
}
/* 新建会话弹窗的选择器行：胶囊换行；手机形态（is-mobile）不换行、
   横向滑动，不常驻渲染滚动条，右侧给关闭钮留白。 */
.new-session-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 10px;
}
.new-session-chips-row.is-mobile {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-right: 52px;
  scrollbar-width: none;
}
.new-session-chips-row.is-mobile::-webkit-scrollbar {
  display: none;
}
.new-session-chips-host {
  position: relative;
  flex-shrink: 0;
}
.new-session-close-host {
  position: absolute;
  right: 12px;
  top: 8px;
  z-index: 5;
}
/* 新建会话弹窗面板：双类选择器压过通用面板基线（原行内 panelStyle 恒高
   优先级，class 化后靠特异性维持覆盖）；形态差异 is-mobile 贴底卡片。
   对话框四周留白默认值与 ui.browser.tsx 的 dialogPadding 默认 20 同源，
   改一处必改另一处 */
.hui-modal-panel.new-session-panel {
  padding: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 880px;
  height: min(80vh, 720px);
}
.hui-modal-panel.new-session-panel.is-mobile {
  height: calc(100% - 20px);
  max-width: 100vw;
  border-radius: 16px 16px 0 0;
  background: var(--bg-sheet);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
}
.new-session-project-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  max-width: 300px;
  padding: 0 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: var(--fs-chat);
  font-weight: 500;
  flex-shrink: 0;
}
.new-session-project-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.new-session-project-icon {
  flex-shrink: 0;
}
.new-session-project-icon.is-muted {
  color: var(--text-muted);
}
.new-session-project-icon.is-dim {
  color: var(--text-dim);
}

/* 项目胶囊与项目选择弹窗 */
.project-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  font-size: var(--fs-chat);
  flex-shrink: 0;
}
.project-pill.is-selected {
  background: var(--bg-selected);
}
.project-pill.is-editing {
  padding: 0 4px 0 12px;
}
.project-pill-btn {
  min-width: 0;
  max-width: 200px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 400;
  font-size: inherit;
  padding: 0;
  cursor: pointer;
}
.project-pill-btn.is-selected {
  font-weight: 600;
}
.project-pill-btn.is-locked {
  cursor: default;
}
.project-pill-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-pill-remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
}
.project-picker-host {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 8px;
}
.project-picker-edit {
  flex-shrink: 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-chat);
}
.project-picker-hint {
  padding: 10px;
  font-size: var(--fs-chat);
  color: var(--text-dim);
}
.project-picker-load-error {
  padding: 6px 10px;
  font-size: var(--fs-chat);
  color: #f87171;
}
.project-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.project-picker-title {
  font-size: var(--fs-chat);
  font-weight: 600;
  color: var(--text);
}
.project-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* 视觉隐藏（屏幕阅读器可及，视觉不可见） */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 代码块: 无框，语言名暗色行 */
.markdown-code-block {
  position: relative;
  min-width: 0;
  margin: 0 0 var(--gap-block);
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}
.markdown-code-header {
  padding: 0 0 4px 0;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: var(--fs-chat);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.markdown-code-lang {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 400;
}
.markdown-code-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.markdown-code-action {
  border: none;
  border-radius: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: var(--fs-chat);
  cursor: pointer;
  /* spec R6.1: 按钮内容由文字改为图标，行盒需要给 svg
     一个基线锚点才能与左侧语言名同高 */
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.markdown-code-action:hover { color: var(--text); }
.markdown-code-block pre {
  margin: 0;
  padding-left: 0;
  font-size: var(--fs-chat);
  line-height: var(--lh-chat);
  /* spec R6.2: 长行自动换行，无横向滚动。
     pre-wrap 保留原有缩进与显式换行，只在行超出可用宽时折行 */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  textarea,
  input,
  select {
    /* 同全局唯一字号（R1.2）；16px 也是 iOS 聚焦不缩放的阈值 */
    font-size: var(--fs-chat) !important;
  }
}

/* ===== 组件 class（按功能域；状态用 is- 修饰类，运行时值留行内 style） ===== */

/* 图标圆按钮：顶栏浮动按钮与会话侧边栏头部按钮共用。spec R12.1: 悬浮
   元素不透明底——按钮浮在会话内容之上，底透出下层文字时图标与文字
   互相干扰；亮暗两主题均用 --bg-panel 实底，激活态用 --bg-selected
   区分。尺寸/定位差异与常态前景色覆盖经行内 style 传入 */
.hui-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  flex-shrink: 0;
}
.hui-icon-btn.is-active {
  background: var(--bg-selected);
  color: var(--text);
}

/* 会话输入区（composer）：对话列左右 padding 的对齐口径（会话侧对话容器
   同源引用） */
:root {
  --chat-column-pad-l: max(env(safe-area-inset-left), 8px);
  --chat-column-pad-r: max(env(safe-area-inset-right), 8px);
}
.composer-root {
  flex-shrink: 0;
  background: transparent;
  padding-top: 0;
  padding-left: var(--chat-column-pad-l);
  padding-right: var(--chat-column-pad-r);
  padding-bottom: 8px;
}
.composer-column {
  max-width: 820px;
  margin: 0 auto;
}
.composer-reply-options {
  margin-bottom: 6px;
}
.composer-reply-options-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.composer-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.composer-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 14px;
  flex-shrink: 0;
  max-width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  font-size: var(--fs-chat);
  font-family: var(--font-mono);
  white-space: normal;
  word-break: break-word;
}
.composer-input-box {
  position: relative;
  min-width: 0;
}
.composer-input-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  min-width: 0;
}
.composer-input-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px;
  gap: 6px;
}
.composer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-button);
  min-width: 0;
}
.composer-left-group {
  display: flex;
  align-items: center;
  gap: var(--gap-button);
  flex-shrink: 0;
}
.hui-composer-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-size: var(--fs-chat);
  line-height: var(--lh-chat);
  font-family: var(--font-mono);
  min-height: 24px;
  max-height: 200px;
  overflow: auto;
  padding: 4px 6px;
}
/* R11.5：输入盒下行的 40px 圆形灰底钮（菜单/首页/粘贴共用形状） */
.composer-row-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text);
}
.composer-row-btn.is-relative {
  position: relative;
}
.composer-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
  border: none;
}
.composer-send-btn.is-stop {
  background: var(--text);
  color: var(--bg);
}

/* 弹窗形态（.is-panel，新建会话弹窗内）：textarea 占满剩余高度，右上角
   角标双态圆钮，底部工具钮平铺带文字标签；发送胶囊覆盖圆形基线 */
.composer-root.is-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 16px 12px;
}
.composer-root.is-panel .hui-composer-input {
  flex: 1;
  min-height: 120px;
  max-height: none;
  box-sizing: border-box;
  background: var(--bg-panel);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.6;
  font-family: var(--font-content-sans);
}
.composer-input-area {
  position: relative;
  flex: 1;
  min-height: 120px;
  display: flex;
}
.composer-corner-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-panel);
  color: var(--text-dim);
}
.composer-root.is-panel .composer-send-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 9px;
  font-size: var(--fs-chat);
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-dim);
  opacity: 0.7;
}
.composer-root.is-panel .composer-send-btn.is-ok {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}
.composer-tool-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: var(--fs-chat);
}
.composer-tool-btn.is-disabled {
  opacity: 0.5;
}
.composer-tool-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-button-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-bottom: max(env(safe-area-inset-bottom), 2px);
}
.composer-menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--text);
  font-size: var(--fs-chat);
}
.composer-menu-btn.is-disabled {
  opacity: 0.5;
}
.composer-menu-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-muted);
}
.composer-menu-btn-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-menu-model-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-menu-model-row {
  margin-bottom: 12px;
  min-height: 32px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--text-dim);
  font-size: var(--fs-chat);
  font-family: var(--font-mono);
}
.composer-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 10px;
  column-gap: 4px;
}
.composer-menu-cancel {
  width: 100%;
  margin-top: 14px;
  padding: 12px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel);
  color: var(--text);
  font-size: var(--fs-chat);
}

/* 附件行：缩略图与文件胶囊；间距由调用方经行内 margin 传入 */
.composer-att-row {
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.composer-att-cell {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.composer-att-img-host {
  position: relative;
}
.composer-att-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
.composer-att-thumb.is-uploading {
  opacity: 0.6;
}
.composer-att-busy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  color: #fff;
  font-size: var(--fs-chat);
  font-weight: 600;
}
.composer-att-chip {
  max-width: 180px;
  height: 32px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-panel);
  font-size: var(--fs-chat);
  color: var(--text);
}
.composer-att-chip.is-error {
  background-image: linear-gradient(
    rgba(239, 68, 68, 0.06),
    rgba(239, 68, 68, 0.06)
  );
  color: #f87171;
}
.composer-att-chip-icon {
  flex-shrink: 0;
}
.composer-att-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-att-size {
  color: var(--text-dim);
  font-size: var(--fs-chat);
  flex-shrink: 0;
}
.composer-att-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
}

/* 模型错误横幅 */
.composer-model-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-height: 120px;
  margin-bottom: 8px;
  padding: 7px 10px;
  overflow-y: auto;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  background-color: var(--bg-panel);
  background-image: linear-gradient(
    rgba(239, 68, 68, 0.07),
    rgba(239, 68, 68, 0.07)
  );
  color: rgb(239, 68, 68);
  font-size: var(--fs-chat);
  line-height: 1.45;
}
.composer-model-error-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.composer-model-error-body {
  min-width: 0;
}
.composer-model-error-title {
  font-weight: 600;
}
.composer-model-error-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 隐藏元素（文件选择 input 等） */
.is-hidden {
  display: none;
}

/* ===== 会话域（对话流、消息、通知、列表） ===== */

/* 消息块与行结构 */
.hui-msg {
  margin-bottom: var(--gap-block);
}
.hui-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
}
/* 无底色无边框，层级由说话人标签承担（spec R4.1 修订：正文不再粗体，
   开头加灰色「时坤：」）；文字左缘贴列容器左缘（spec R2.4，8px 口径） */
.hui-user-msg {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-chat);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}
.hui-msg-blocks {
  display: flex;
  flex-direction: column;
}
.hui-msg-wrap {
  flex-shrink: 0;
  min-height: 0;
}
.hui-msg-fallback-text {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.hui-msg-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  min-height: 24px;
}
.hui-msg-action {
  padding: 5px 8px;
  min-height: 32px;
  background: none;
  border: none;
  border-radius: 5px;
  color: var(--text-dim);
  font-size: var(--fs-chat);
  font-weight: 400;
  white-space: nowrap;
}
.hui-msg-action.is-left {
  margin: 0 0 0 -8px;
}
.hui-msg-action.is-right {
  margin: 0 -8px 0 auto;
}
/* 点击复制的反馈态：文字短暂升到强调色，1500ms 后回 dim */
.hui-msg-action.is-copied {
  color: var(--accent);
}

/* 运行态行与回合末尾间距 */
.hui-turn-live {
  margin-bottom: var(--gap-block);
}

/* 活动行错误前缀与柔性行 */
.hui-err-prefix {
  color: var(--diff-del);
  margin-right: var(--prefix-gap);
}
.hui-line-flex {
  min-height: var(--gap-block);
  display: flex;
  align-items: center;
}
.hui-line-block {
  display: block;
  width: 100%;
  min-height: var(--gap-block);
  padding: 0;
  text-align: left;
}
.hui-line-inset {
  padding: 4px 0;
}
.hui-line-clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* provider 错误行 */
.hui-provider-error {
  color: var(--diff-del);
  font-family: var(--font-mono);
  font-size: var(--fs-chat);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hui-provider-error.is-after-answer {
  margin-top: var(--gap-block);
}

/* bash 执行块：头部工具名+命令，输出平铺不折叠 */
.hui-bash-block {
  margin: 6px 0;
  font-size: var(--fs-chat);
  min-width: 0;
}
.hui-bash-head {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  min-height: var(--gap-block);
  padding: 0;
  text-align: left;
  min-width: 0;
}
.hui-bash-tool {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 6px;
}
.hui-bash-tool.is-error {
  color: var(--diff-del);
}
.hui-bash-command {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.hui-bash-output {
  margin: 0;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: var(--fs-chat);
  line-height: 1.5;
  overflow: auto;
  max-height: 400px;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-all;
}
.hui-bash-output.is-empty {
  color: var(--text-dim);
  opacity: 0.6;
}
/* 失败优先于空输出：两修饰类同挂时 error 色（原行内三元 isError 先判） */
.hui-bash-output.is-error {
  color: var(--diff-del);
}

/* 会话列表行：固定行高 + 选中态底色；update 定点切换不重建整行 */
.hui-session-row {
  height: 64px;
  display: flex;
  align-items: center;
  cursor: default;
  background: transparent;
  gap: 6px;
  overflow: hidden;
}
.hui-session-row.is-selected {
  background: var(--bg-selected);
}
.hui-row-main {
  flex: 1;
  min-width: 0;
}
.hui-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-chat);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  font-family: var(--font-content-sans);
}
/* 收尾会话（[完] 前缀）标题连同前缀一律次要灰（R17.2） */
.hui-row-title.is-dimmed {
  color: var(--text-dim);
}
.hui-row-meta {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: var(--fs-chat);
  min-width: 0;
}
.hui-row-meta-item {
  flex-shrink: 0;
  white-space: nowrap;
}
.hui-running-indicator {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.hui-worktree-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  min-width: 0;
  overflow: hidden;
}
.hui-worktree-badge-icon {
  flex-shrink: 0;
}
.hui-worktree-badge-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 会话列表页：日期分组 + 居中提示 */
.hui-list-root {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.hui-list-body {
  padding: calc(env(safe-area-inset-top, 0px) + 62px) 8px
    calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.hui-list-inner {
  max-width: 820px;
  margin: 0 auto;
}
.hui-group-label {
  padding: 10px 0 4px;
  font-size: var(--fs-chat);
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
/* 首屏列表与对话页共用的居中提示 */
.hui-centered-notice {
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.hui-centered-notice.is-error {
  color: var(--diff-del);
}
.hui-list-error {
  padding: 10px 0 2px;
  color: var(--diff-del);
  font-size: var(--fs-chat);
}
.hui-list-empty {
  padding: 16px 0;
  color: var(--text-muted);
  font-size: var(--fs-chat);
}

/* 对话页骨架：列宽与列 padding（--chat-column-pad-l/r 与 composer 域同源） */
.hui-chat-root {
  min-width: 0;
}
.hui-composer-overlay {
  position: fixed;
  bottom: var(--hui-keyboard-inset, 0px);
  left: 0;
  right: 0;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.hui-chat-column-padding {
  min-width: 0;
  padding-top: 0;
  padding-left: var(--chat-column-pad-l);
  padding-right: var(--chat-column-pad-r);
}
.hui-chat-column {
  width: 100%;
  min-width: 0;
  max-width: 820px;
  margin: 0 auto;
}

/* 通知浮层（pointer-events none，条目自身 auto） */
.hui-notice-host {
  position: fixed;
  top: calc(max(env(safe-area-inset-top, 0px), 8px) + 52px);
  left: 0;
  right: 0;
  z-index: 40;
  padding-left: var(--chat-column-pad-l);
  padding-right: var(--chat-column-pad-r);
  pointer-events: none;
}
.hui-notice-shelf {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.hui-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  max-width: 100%;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-chat);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  pointer-events: auto;
}
.hui-notice:not(.is-last) {
  margin-bottom: 6px;
}
.hui-notice.has-detail {
  display: block;
  min-height: 0;
  padding: 8px 12px;
}
.hui-notice.is-error {
  color: var(--diff-del);
}
.hui-notice-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hui-notice-text {
  padding: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hui-notice.has-detail .hui-notice-text {
  white-space: normal;
  word-break: break-word;
}
.hui-notice-details {
  margin-top: 2px;
  font-size: var(--fs-chat);
  line-height: 1.4;
  color: inherit;
}
.hui-notice-summary {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  list-style: none;
}
.hui-notice-raw {
  font-family: var(--font-mono);
  font-size: var(--fs-chat);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 4px 0 2px;
  color: inherit;
}

/* 空白新建态：display 由运行时行内管理（""=回退 UA block 顶排，
   复刻原行为；flex 属性为原行内遗留，block 下不生效）与首屏加载宿主 */
.hui-empty-new-host {
  padding-top: calc(env(safe-area-inset-top, 0px) + 32px);
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
}
.hui-empty-new-column {
  width: 100%;
  max-width: 820px;
}
.hui-empty-new-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-left: 16px;
  margin-right: 52px;
  font-family: var(--font-mono);
}
.hui-empty-new-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
  line-height: 1.4;
  overflow: hidden;
}
.hui-empty-new-logo {
  font-size: var(--fs-chat);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  flex-shrink: 0;
  white-space: nowrap;
}
.hui-empty-new-cwd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
  margin-bottom: 10px;
  font-size: var(--fs-chat);
  font-family: var(--font-mono);
  color: var(--text-dim);
}
.hui-empty-new-cwd-icon {
  flex-shrink: 0;
}
.hui-empty-new-cwd-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hui-loading-host {
  display: none;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* 外壳骨架：全屏列布局（安全区 padding）与主列；错误面板为渲染兜底 */
.shell-column {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: var(--bg);
}
.shell-main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shell-main-host {
  flex: 1;
  position: relative;
  min-width: 0;
}
.shell-top-buttons {
  position: fixed;
  top: max(env(safe-area-inset-top), 8px);
  right: max(env(safe-area-inset-right), 8px);
  display: flex;
  gap: var(--gap-button);
  z-index: 400;
}
.shell-error-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint-bg);
  padding: 24px;
}
.shell-error-stack {
  max-width: 640px;
  max-height: 80vh;
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  font-size: var(--fs-chat);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* 模型选择器：根容器右对齐，布局差异经行内覆盖 */
.model-picker {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.model-picker-select {
  min-width: 0;
  max-width: 100%;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: var(--fs-chat);
  font-family: var(--font-mono);
}

/* 登录屏：全屏覆盖层 + 居中卡片；提交中按钮 opacity 由行内定点更新 */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint-bg);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, calc(100vw - 48px));
  padding: 24px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}
.login-title {
  font-size: var(--fs-chat);
  font-weight: 700;
  color: var(--text);
}
.login-input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-size: var(--fs-chat);
}
.login-button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-chat);
  font-weight: 600;
  opacity: 1;
}
.login-error {
  font-size: var(--fs-chat);
  color: #ef4444;
}

/* 弹层面板：定位元素——绘制顺序在 absolute 遮罩之后（同为 z-index auto
   按树序），面板不被自身遮罩盖住。键盘弹出等 visual viewport 收缩时
   在可视区域内出现内部滚动（可被行内覆盖）。宽/圆角等差异经行内覆盖 */
.hui-modal-panel {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
  max-height: 100%;
  overflow-y: auto;
}

/* 弹层壳内遮罩（点击关闭与淡入动画的载体） */
.hui-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* 弹窗外壳（原生 dialog 顶层）：居中形态默认，贴底形态用
   .hui-modal-bottom；居中留白可经行内 padding 覆盖（移动端 0）。
   默认 20px 与 ui.browser.tsx 的 dialogPadding 默认值同源，改一处必改另一处 */
dialog.hui-modal {
  position: fixed;
  inset: 0;
  padding: 20px;
  border: none;
  background: transparent;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
dialog.hui-modal.hui-modal-bottom {
  padding: 0;
  align-items: flex-end;
}

/* 底部卡片滑入（输入区菜单）与遮罩淡入动画 */
@keyframes hui-sheet-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes hui-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.hui-sheet-in {
  animation: hui-sheet-in 0.24s ease-out;
}
.hui-overlay-in {
  animation: hui-overlay-in 0.18s ease-out;
}
/* 弹窗外壳（原生 dialog 顶层）：遮罩由壳内 DOM 层承担，原生 ::backdrop
   透明化避免双层压暗 */
dialog.hui-modal::backdrop {
  background: transparent;
}

/* 对话区禁合成斜体（spec R5.7 r16）: 中文字体（PingFang SC 等）没有
   真斜体字形，font-style: italic 只会得到浏览器合成拉斜的字形，中文
   排版避忌。只关 style 合成，weight 合成保留——PingFang SC 无 Bold，
   strong 仍依赖合成加粗。font-synthesis 可继承，挂对话区
   滚动容器一处即覆盖 em、组件内联 fontStyle 等一切斜体来源（裸 HTML
   不渲染为元素，i/var/dfn 不会出现）；字体栈内有
   真斜体面的拉丁字体（ui-monospace、
   JetBrains Mono）不受影响，真斜体照常。 */
.hui-chat-stream {
  font-synthesis-style: none;
}

/* 对话区文本行基线（fx 洁癖: 等宽单字号灰阶，spec R1.x/R3.x） */
.hui-line {
  font-family: var(--font-mono);
  font-size: var(--fs-chat);
  line-height: var(--lh-chat);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.hui-line-dim { color: var(--text-dim); }
.hui-line-muted { color: var(--text-muted); }

/* 输入区占位文字单行（spec R11.4）。placeholder 折行会让 textarea 内容
   高于固定高度，overflow:auto 就冒出竖直滚动条（灰色竖条）；超出宽度的
   文字由 textarea 原生硬裁（不出省略号）。 */
.hui-composer-input::placeholder {
  white-space: nowrap;
}

/* ---- 基线样式（来自原 CSS 框架移除可行性调查）----
   独立承担原 CSS 框架 preflight 的实际被依赖项（逐元素实测与
   含框架版本 0 差异）。放文件末尾即可，无加载顺序约束。
   两条硬依赖：html 行距（漏写=全应用行距塌缩）、表单控件字体继承
   （漏写=按钮回落 Arial）。 */
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}
button {
  background: none;
  border: 0;
  appearance: button;
}
button:disabled { cursor: default; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p, h1, h2, h3, h4, h5, h6, blockquote, pre { margin: 0; }
svg { display: block; vertical-align: middle; }
img { display: block; max-width: 100%; }
*, ::before, ::after { border-width: 0; border-style: solid; }
