/* keke-home：照旧版 Claude App。颜色、字号按任务文件第一节，再对着截图 02（Opus 4.6）微调 */
:root {
  --bg: #FAF9F5;
  --side: #F0EEE6;
  --bubble: #EFEDE6;
  --card: #FFFFFF;
  --ink: #3D3929;
  --ink-strong: #2B2A26;
  --muted: #8A8578;
  --icon: #6F6B62;
  --line: #E5E2D9;
  --accent: #D97757;
  --accent-ink: #FFFFFF;
  --sheet: #FAF9F5;
  --sheet-card: #F0EDE6;
  --serif: "Source Serif 4", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .9, .25, 1.02);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body { overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.serif { font-family: var(--serif); }
.ic { width: 24px; height: 24px; display: block; }
/* 整个页面跟着 iPhone 的可见区域走（键盘弹起时可见区域变矮、还会往下挪）：高度 = 可见区域高度，往下挪多少就跟着挪多少，
   输入框就贴在键盘上沿。--app-h / --app-top 由 app.js 按 visualViewport 设置 */
#app { position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100dvh); transform: translate3d(0, var(--app-top, 0px), 0); display: flex; flex-direction: column; overflow: hidden; }

/* 按下的那一刻就有反应（第十四节） */
.icon-btn:active, .round-btn:active, .plain-btn:active, .act:active, .model-btn:active, .starter:active, .row:active { opacity: .55; transform: scale(.96); }
.send-btn:active, .voice-btn:active, .stop-btn:active, .btn-primary:active { transform: scale(.93); }
.icon-btn, .round-btn, .plain-btn, .act, .send-btn, .voice-btn, .stop-btn, .btn-primary, .starter, .row { transition: transform .12s var(--ease), opacity .12s; }

/* ---------- 登录 ---------- */
.login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.login-box h1 { font-weight: 500; font-size: 40px; margin: 0 0 28px; color: var(--ink-strong); letter-spacing: -.5px; }
.login-box input { width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 0 16px; font-size: 17px; color: var(--ink); outline: none; box-shadow: 0 1px 3px rgba(60, 50, 30, .05); }
.login-box input:focus { border-color: #D8D3C7; }
.btn-primary { width: 100%; height: 50px; margin-top: 12px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-size: 17px; font-weight: 500; }
.login-msg { min-height: 22px; margin-top: 14px; color: #B5533A; font-size: 14px; }

/* ---------- 顶栏 ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.topbar { flex: none; height: calc(56px + var(--safe-top)); padding: var(--safe-top) 10px 0; display: flex; align-items: center; justify-content: space-between; background: var(--bg); position: relative; z-index: 5; }
.icon-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink-strong); border-radius: 12px; }
.icon-btn .ic { width: 25px; height: 25px; }
.icon-btn.accent { color: var(--accent); }
.icon-btn.accent .ic { width: 28px; height: 28px; stroke-width: 1.5; }
.icon-btn-space { width: 44px; }
.model-btn { display: flex; align-items: baseline; gap: 7px; padding: 6px 10px; border-radius: 10px; max-width: calc(100% - 110px); white-space: nowrap; }
#modelName { font-size: 19px; font-weight: 600; color: var(--ink-strong); letter-spacing: -.2px; }
.model-ext { font-size: 19px; color: var(--muted); font-weight: 400; }
.model-btn .chev { align-self: center; color: var(--muted); margin-left: -2px; }
.model-btn .chev .ic { width: 18px; height: 18px; stroke-width: 1.8; }
.banner { flex: none; margin: 0 16px 6px; padding: 8px 12px; border-radius: 10px; background: #F3E6DF; color: #8C4A33; font-size: 14px; text-align: center; }

/* ---------- 对话区 ---------- */
.scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 0 16px; }
.msgs { padding: 0 20px; }
.msgs-end { height: 8px; }
.msg { margin: 0 0 20px; contain: layout style; }
.msg.user { display: flex; justify-content: flex-end; margin-left: 15%; }
.bubble { background: var(--bubble); color: var(--ink-strong); border-radius: 18px; padding: 10px 15px; font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.assistant { font-size: 16px; line-height: 1.6; color: var(--ink-strong); word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 12px; }
.md p:last-child { margin-bottom: 0; }
.md h2, .md h3, .md h4, .md h5 { font-family: var(--serif); font-weight: 600; margin: 18px 0 8px; line-height: 1.35; }
.md h2 { font-size: 20px; } .md h3 { font-size: 18px; } .md h4, .md h5 { font-size: 16.5px; }
.md ul, .md ol { margin: 4px 0 12px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md blockquote { margin: 8px 0 12px; padding: 2px 0 2px 14px; border-left: 3px solid var(--line); color: var(--icon); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md a { color: var(--accent); text-decoration: none; }
.md code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; background: #EFECE4; border-radius: 5px; padding: 1px 5px; }
.md .codeblock { margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #FDFCF9; }
.md .code-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; font-size: 13px; color: var(--muted); background: #F4F2EC; }
.md .code-copy { font-size: 13px; color: var(--icon); }
.md pre { margin: 0; padding: 12px; overflow-x: auto; font-size: 13.5px; line-height: 1.5; }
.md pre code { background: none; padding: 0; font-size: inherit; }
.md .table-wrap { overflow-x: auto; margin: 8px 0 14px; }
.md table { border-collapse: collapse; font-size: 15px; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: #F4F2EC; font-weight: 600; }
/* 回复里的英文和数字用衬线体：中文跟着系统字体走 */
.msg.assistant .md { font-family: "Source Serif 4", var(--sans); }

.cursor::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--muted); vertical-align: middle; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.err-line { margin-top: 8px; color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.err-line button { color: var(--accent); font-size: 14px; }

/* 回复下面那一排图标：灰、细、间距宽 */
.acts { display: flex; gap: 0; margin: 8px 0 0 -8px; } /* 息息 11-11：图标约 18px、间距约 20px（对着参考图 02、04） */
.act { width: 38px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--icon); border-radius: 10px; }
.act .ic { width: 18px; height: 18px; stroke-width: 1.5; }
.act.on { color: var(--ink-strong); }

/* 空对话 */
.empty { padding: 18vh 28px 0; text-align: center; }
.empty h2 { font-weight: 400; font-size: 32px; color: var(--ink-strong); margin: 0 0 26px; letter-spacing: -.3px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.starter { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 9px 14px; font-size: 15px; color: var(--ink); }

.down-btn { position: absolute; right: 18px; bottom: 150px; width: 40px; height: 40px; border-radius: 50%; background: var(--card); color: var(--icon); box-shadow: 0 2px 10px rgba(60, 50, 30, .12); display: flex; align-items: center; justify-content: center; z-index: 4; }
.down-btn .ic { width: 20px; height: 20px; }

/* ---------- 输入框 ---------- */
.composer-wrap { flex: none; padding: 6px 12px calc(10px + var(--safe-bottom)); background: linear-gradient(rgba(250, 249, 245, 0), var(--bg) 22%); position: relative; z-index: 5; }
.composer { background: var(--card); border: 1px solid #ECE9E1; border-radius: 26px; box-shadow: 0 2px 14px rgba(60, 50, 30, .07); padding: 14px 14px 10px 18px; }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink-strong); max-height: calc(1.45em * 6); min-height: 1.45em; padding: 0; display: block; }
.composer textarea::placeholder { color: #9C978C; }
.composer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.composer-row .left, .composer-row .right { display: flex; align-items: center; gap: 6px; }
.round-btn { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink-strong); margin-left: -6px; }
.round-btn .ic { width: 24px; height: 24px; }
.round-btn + .round-btn { margin-left: 2px; }
.plain-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--ink-strong); }
.plain-btn .ic { width: 24px; height: 24px; }
.voice-btn, .send-btn, .stop-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.voice-btn { background: #1F1E1D; color: #fff; }
.voice-btn .ic { width: 22px; height: 22px; stroke-width: 2; }
.send-btn { background: var(--accent); color: #fff; }
.send-btn .ic { width: 21px; height: 21px; stroke-width: 2.2; }
.stop-btn { background: #1F1E1D; color: #fff; }
.stop-btn .ic { width: 22px; height: 22px; }

/* ---------- 底部面板 ---------- */
.dim { position: fixed; inset: 0; background: rgba(20, 18, 12, .32); z-index: 20; opacity: 0; transition: opacity .24s var(--ease); }
.dim.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--sheet); border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + var(--safe-bottom)); max-height: 88vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .26s var(--ease); will-change: transform; touch-action: none; }
.sheet.show { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: #D6D2C8; margin: 2px auto 8px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px 12px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--ink-strong); }
.sheet-head .icon-btn .ic { width: 22px; height: 22px; }
.sheet-body { overflow-y: auto; touch-action: pan-y; }
.group { background: var(--sheet-card); border-radius: 18px; overflow: hidden; margin-bottom: 14px; }
.row { display: flex; align-items: center; width: 100%; text-align: left; padding: 16px 20px; gap: 10px; min-height: 58px; }
.group .row + .row { border-top: 1px solid #E4E0D7; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-size: 17px; font-weight: 600; color: var(--ink-strong); }
.row .desc { font-size: 14px; color: var(--muted); margin-top: 3px; }
.row .val { color: var(--muted); font-size: 16px; }
.row .label { font-size: 16.5px; color: var(--ink-strong); }
.row .tick { color: var(--ink-strong); }
.row .chev-r { color: var(--muted); }
.row .chev-r .ic { width: 17px; height: 17px; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: #D9D5CB; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s var(--ease); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
.sheet-note { color: var(--muted); font-size: 14px; padding: 4px 6px 10px; }

.toast { position: fixed; left: 50%; bottom: calc(118px + var(--safe-bottom)); transform: translate(-50%, 8px); background: #2B2A26; color: #fff; font-size: 14px; padding: 9px 16px; border-radius: 20px; z-index: 40; opacity: 0; transition: opacity .18s, transform .18s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 侧栏（参考图 00 / 15：侧栏在下面，对话卡片往右推开，左边成圆角卡片） ---------- */
:root { --side-w: min(80vw, 330px); }
.side { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); background: #F5F3EE; z-index: 1; display: flex; flex-direction: column;
  padding: calc(18px + var(--safe-top)) 0 calc(8px + var(--safe-bottom)); transform: translateX(calc(var(--p, 0) * 0px)); }
.side-title { font-size: 30px; font-weight: 500; color: var(--ink-strong); padding: 6px 24px 22px; letter-spacing: -.3px; }
.side-nav { display: flex; flex-direction: column; padding: 0 10px; flex: none; }
.nav { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 14px; border-radius: 12px; font-size: 17px; color: var(--ink-strong); text-align: left; }
.nav .ic { width: 23px; height: 23px; }
.nav.accent { color: var(--accent); }
.nav:active, .recent:active { background: #EAE7DF; }
.recents-label { font-size: 13.5px; color: var(--muted); padding: 22px 24px 8px; flex: none; }
.recents { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px; overscroll-behavior: contain; }
.recent { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; font-size: 16px; color: var(--ink-strong); text-align: left; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.recent .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .ic { width: 15px; height: 15px; color: var(--muted); flex: none; }
.recent.on { background: #EAE7DF; }
.recent-empty { color: var(--muted); font-size: 14px; padding: 6px 14px; }
.side-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px 4px 22px; border-top: 1px solid #E8E5DC; flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #2B2A26; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.me-name { flex: 1; font-size: 16px; color: var(--ink-strong); }

/* 对话这张卡片：侧栏打开时往右推，左边变圆角、带阴影 */
.chat { background: var(--bg); z-index: 2; transform: translateX(calc(var(--p, 0) * var(--side-w))); will-change: transform; }
.chat.slide { transition: transform .26s var(--ease), border-radius .26s, box-shadow .26s; }
body.side-open .chat, .chat.dragging { border-radius: 26px 0 0 26px; box-shadow: -8px 0 30px rgba(60, 50, 30, .12); overflow: hidden; }
.chat-cover { position: absolute; inset: 0; z-index: 30; }

/* 二级页面 */
.page { position: fixed; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); will-change: transform; }
.page.show { transform: translateX(0); }
.page.slide { transition: transform .26s var(--ease); }
.page-title { margin: 0; font-size: 19px; font-weight: 600; color: var(--ink-strong); }
.page-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px calc(20px + var(--safe-bottom)); }
.searchbox { display: flex; align-items: center; gap: 8px; background: #EFECE4; border-radius: 12px; padding: 0 12px; height: 42px; margin: 4px 0 12px; color: var(--muted); }
.searchbox .ic { width: 18px; height: 18px; }
.searchbox input { flex: 1; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--ink-strong); }
.soon { text-align: center; color: var(--muted); padding: 30vh 20px 0; font-size: 15px; }
.chat-row { display: block; width: 100%; text-align: left; padding: 13px 6px; border-bottom: 1px solid var(--line); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chat-row .t { font-size: 16px; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .d { font-size: 13px; color: var(--muted); margin-top: 3px; }
.chat-row:active { background: #F0EDE6; }

/* 居中小弹窗 */
.dlg-dim { position: fixed; inset: 0; z-index: 50; background: rgba(20, 18, 12, .32); display: flex; align-items: center; justify-content: center; padding: 24px; }
.dlg { width: 100%; max-width: 300px; background: var(--card); border-radius: 18px; padding: 20px 18px 12px; box-shadow: 0 10px 40px rgba(0,0,0,.18); animation: pop .2s var(--ease); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.dlg-title { font-size: 17px; font-weight: 600; color: var(--ink-strong); text-align: center; margin-bottom: 12px; }
.dlg input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; outline: none; margin-bottom: 4px; }
.dlg-btns { display: flex; margin: 12px -6px 0; }
.dlg-btns button { flex: 1; height: 44px; font-size: 16.5px; color: var(--ink-strong); border-radius: 10px; }
.dlg-btns button:active { background: #F0EDE6; }
.dlg-btns .danger { color: #D0402A; font-weight: 600; }
.row.danger .label { color: #D0402A; }

/* ---------- 思考行、工具行（第五节） ---------- */
.steps { margin: 0 0 10px 6px; }
.step { display: flex; align-items: center; gap: 8px; width: calc(100% - 6px); text-align: left; color: var(--muted); font-size: 14px; line-height: 1.4; padding: 5px 0; min-height: 30px; }
.step .ic { width: 17px; height: 17px; flex: none; }
.step .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .chev-r { flex: none; display: flex; }
.step .chev-r .ic { width: 15px; height: 15px; }
.step.err .t::after { content: '  Failed'; color: #C0533A; }
.step.denied .t::after { content: '  Not allowed'; color: #C0533A; }
.step:active { opacity: .55; }
.step-sub { margin-left: 10px; border-left: 1px solid var(--line); padding-left: 10px; }
.spin { width: 14px; height: 14px; flex: none; border: 1.6px solid #D6D2C8; border-top-color: var(--muted); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.think-body { font-size: 16px; line-height: 1.75; color: var(--ink-strong); font-family: "Source Serif 4", var(--sans); padding: 0 6px 12px; white-space: pre-wrap; word-break: break-word; }
.think-body p { margin: 0 0 18px; }
.tool-sec { margin: 0 4px 16px; }
.tool-sec h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: .4px; }
.tool-sec h4 button { font-size: 13px; color: var(--icon); text-transform: none; letter-spacing: 0; }
.tool-sec pre { margin: 0; background: #F2EFE8; border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.tool-sec.err pre { color: #9C3B25; }

/* 允许 / 拒绝 */
.perm { margin: 2px 0 12px; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 6px rgba(60, 50, 30, .05); }
.perm .q { font-size: 15px; font-weight: 600; color: var(--ink-strong); margin-bottom: 8px; }
.perm pre { margin: 0 0 10px; background: #F4F2EC; border-radius: 10px; padding: 9px 11px; font-size: 13px; white-space: pre-wrap; word-break: break-all; max-height: 30vh; overflow: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.perm .warn { color: #B5533A; font-size: 13px; margin: -2px 0 10px; }
.perm label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--icon); margin-bottom: 12px; }
.perm label input { width: 17px; height: 17px; accent-color: var(--accent); }
.perm .btns { display: flex; gap: 10px; justify-content: flex-end; }
.perm .btns button { height: 38px; padding: 0 18px; border-radius: 19px; font-size: 15px; font-weight: 500; }
.perm .deny { background: #EFECE4; color: var(--ink-strong); }
.perm .allow { background: var(--accent); color: #fff; }
.perm.done { padding: 8px 14px; color: var(--muted); font-size: 13.5px; box-shadow: none; }

/* ---------- 空对话首页：大 Clawd + 一句话 ---------- */
.empty { padding: 0 28px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; }
@keyframes clawdRun { to { background-position: var(--w) 0; } }
/* 素材每帧 32 格、小k 本身约 16 格宽：框 288（每格 9 倍），小k 约 144px。框四周是透明的，用负边距收紧 */
.home-clawd { width: 288px; height: 288px; image-rendering: pixelated; background-repeat: no-repeat; margin: -70px auto -60px; flex: none; }
.home-line { font-size: 17px; line-height: 1.6; color: var(--ink-strong); max-width: 300px; min-height: 1.6em; }
.starters { position: absolute; left: 0; right: 0; bottom: calc(132px + var(--safe-bottom)); padding: 0 16px; gap: 6px; z-index: 4; }
.starter { padding: 6px 11px; font-size: 13px; border-radius: 15px; color: var(--icon); }

@media (min-width: 760px) {
  .msgs, .empty { max-width: 760px; margin: 0 auto; }
  .composer-wrap { padding-left: calc(50% - 370px); padding-right: calc(50% - 370px); }
  .sheet { max-width: 520px; margin: 0 auto; }
}
.ic.inline { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; color: var(--muted); }
body.side-open .chat, .chat.dragging, .page.dragging { -webkit-user-select: none; user-select: none; }
/* 回复里的图片（表情包、![](链接)、<img>）：圆角，宽约 160 */
.md img.md-img { display: block; width: 160px; max-width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; margin: 6px 0 10px; background: #EFECE4; } /* 没加载完先按正方形占位，加载完按真实比例（app.js），不把页面顶一下 */
.md p > img.md-img:only-child { margin: 2px 0; }
.kb-open .composer-wrap { padding-bottom: 6px; } /* 键盘弹起时底部安全区被键盘盖住，不用再留 */
/* 语音条（speak）：照 keke-chat 的样子，胶囊、播放键、波形、秒数；下面"转中文"展开翻译 */
.vbox { margin: 6px 0 12px; }
.vbar { display: flex; align-items: center; gap: 12px; max-width: 100%; padding: 12px 20px; border-radius: 999px; background: rgba(180, 150, 120, .22); color: var(--ink-strong); font: inherit; }
.vbar.loading { opacity: .6; }
.vbar-ic { flex: none; display: flex; }
.vbar-w { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.vbar-w i { display: block; flex: none; width: 3px; border-radius: 2px; background: currentColor; opacity: .4; }
.vbar-w i.on { opacity: .9; }
.vbar-d { flex: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.vbar-t { margin-top: 8px; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--icon); }
.vbar-x { display: none; margin: 8px 2px 0; font-size: 14.5px; line-height: 1.65; color: var(--icon); white-space: pre-wrap; }
.vbar-x.on { display: block; }
.vbar-m { font-size: 12.5px; color: #B5533A; margin-top: 4px; }
.vbar-m:empty { display: none; }
/* 思考、工具面板：固定高度（打开时约屏幕 60%，app.js 设 height），正文在面板里滚；横条那一条加大好按 */
.sheet.tall { max-height: 92vh; transition: transform .26s var(--ease), height .22s var(--ease); }
.sheet.tall.dragging { transition: none; }
.sheet.tall .sheet-body { flex: 1; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.grabber { position: relative; cursor: grab; touch-action: none; }
.grabber::before { content: ''; position: absolute; left: -60px; right: -60px; top: -12px; bottom: -12px; } /* 手指好按到 */
.sheet { touch-action: auto; }
/* 没发出去的消息：标灰 + Retry */
.msg.user.failed { flex-direction: column; align-items: flex-end; }
.msg.user.failed .bubble { opacity: .55; }
.send-failed { font-size: 13px; color: #B5533A; margin-top: 4px; }
.send-failed button { color: var(--accent); font-size: 13px; }
/* 版本切换 ‹ 1/2 ›、编辑框 */
.ver { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13.5px; margin-left: 6px; }
.ver-b { width: 26px; height: 30px; font-size: 19px; color: var(--icon); line-height: 1; }
.ver-b:disabled { opacity: .3; }
.ver-n { font-variant-numeric: tabular-nums; min-width: 26px; text-align: center; }
.msg.user.has-ver { flex-direction: column; align-items: flex-end; }
.msg.user.has-ver .ver { margin: 2px -4px 0 0; }
.acts .ver { margin-left: auto; margin-right: 4px; }
.msg.user .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* 她的气泡往左拉，右边露出复制、编辑（息息 11-11 第 6 条） */
.uswipe { position: relative; max-width: 100%; }
.msg.user .uswipe .bubble { position: relative; z-index: 1; touch-action: pan-y; transition: transform .22s var(--ease); will-change: transform; }
.uacts { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; opacity: 0; pointer-events: none; }
.uact { width: 44px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--icon); border-radius: 10px; }
.uact .ic { width: 19px; height: 19px; stroke-width: 1.5; }
.uact:active { opacity: .55; }
.msg.editing { margin-left: 0; display: block; }
.edit-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 10px; box-shadow: 0 1px 6px rgba(60, 50, 30, .05); }
.edit-box textarea { width: 100%; border: 0; outline: none; resize: none; font: inherit; font-size: 15.5px; line-height: 1.5; color: var(--ink-strong); background: transparent; }
.edit-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.edit-btns button { height: 34px; padding: 0 16px; border-radius: 17px; font-size: 14.5px; }
.edit-btns .cancel { background: #EFECE4; color: var(--ink-strong); }
.edit-btns .save { background: var(--accent); color: #fff; }
/* 最新回复下面的 Clawd（息息 11-11 第 15 条）：不转圈，只要本体，和一行正文差不多高。
   素材每帧 32 格、放大 3 倍（96px）；本体在帧里大约 x 6–18、y 8–15，所以框只露出本体那一块（40×26），多出来的帽子、冲浪板之类照样画在外面 */
.clawd { position: relative; width: 40px; height: 26px; margin: 8px 0 2px 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
.clawd-spr { position: absolute; left: -16px; top: -22px; width: 96px; height: 96px; image-rendering: pixelated; background-repeat: no-repeat; pointer-events: none; transition: transform .2s var(--ease); }
.clawd.nudge .clawd-spr { transform: translateY(-3px); }
.clawd-bub { position: absolute; left: 46px; top: -4px; white-space: nowrap; background: #2B2A26; color: #fff; font-family: "Source Serif 4", var(--serif); font-style: italic; font-size: 14px; padding: 6px 12px; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.12); animation: pop .18s var(--ease); z-index: 3; }
/* ---------- 项目（第 4 步） ---------- */
/* 顶栏下面浮着的胶囊（参考图 20）：白底、细边、居中 */
.pills { position: absolute; left: 0; right: 0; top: calc(56px + var(--safe-top)); z-index: 6; display: flex; justify-content: center; gap: 8px; padding: 4px 16px; pointer-events: none; }
.pill { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; max-width: 46%; height: 36px; padding: 0 16px 0 13px; border-radius: 18px; background: rgba(255, 255, 255, .92); border: 1px solid #DCD8CE; box-shadow: 0 2px 8px rgba(60, 50, 30, .06); font-size: 15px; color: var(--ink-strong); transition: transform .12s var(--ease), opacity .12s; }
.pill .ic { width: 18px; height: 18px; flex: none; }
.pill .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pill:active { opacity: .6; transform: scale(.96); }
.chat:has(.pills:not([hidden])) .scroller { padding-top: 50px; }
/* Recents 里的项目分组行（参考图 00 / 15）："项目名 条数 ›" */
.recent-group { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 14px 0 8px; margin-top: 6px; border-radius: 12px; text-align: left; -webkit-user-select: none; user-select: none; }
.recent-group .n { font-size: 14.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.recent-group .c { font-size: 14px; color: var(--muted); flex: 1; }
.recent-group .chev-r { color: var(--ink); display: flex; }
.recent-group .chev-r .ic { width: 17px; height: 17px; }
.recent-group:active { background: #EAE7DF; }
/* Projects 页和项目页 */
.proj-new { display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; padding: 0 16px; margin: 4px 0 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--accent); font-size: 16px; box-shadow: 0 1px 4px rgba(60, 50, 30, .04); transition: transform .12s var(--ease), opacity .12s; }
.proj-new .ic { width: 21px; height: 21px; }
.proj-new:active, .proj-card:active, .proj-ins:active { opacity: .6; transform: scale(.985); }
.proj-empty { padding: 10px 6px; line-height: 1.55; }
.proj-card { display: block; width: 100%; text-align: left; padding: 15px 16px; margin-bottom: 10px; border-radius: 16px; background: var(--sheet-card); transition: transform .12s var(--ease), opacity .12s; }
.proj-card .n { font-family: var(--serif); font-size: 17.5px; font-weight: 600; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-card .d { font-size: 14.5px; color: var(--icon); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-card .d:empty { display: none; }
.proj-card .m { font-size: 13px; color: var(--muted); margin-top: 6px; }
.proj-h { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--muted); padding: 14px 4px 8px; }
.proj-h-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 14px; padding: 4px 2px; }
.proj-h-btn .ic { width: 16px; height: 16px; }
.proj-box { display: block; width: 100%; text-align: left; background: var(--sheet-card); border-radius: 14px; padding: 13px 15px; font-size: 15px; line-height: 1.55; color: var(--ink-strong); }
.proj-ins { white-space: pre-wrap; word-break: break-word; max-height: 9.5em; overflow: hidden; transition: transform .12s var(--ease), opacity .12s; }
.proj-ins.empty, .proj-muted { color: var(--muted); font-size: 14.5px; }
.proj-files { padding: 4px 6px 4px 14px; }
.proj-files .proj-muted { padding: 9px 0; }
.file-row { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.file-row + .file-row { border-top: 1px solid #E4E0D7; }
.file-row > .ic { width: 19px; height: 19px; color: var(--icon); flex: none; }
.file-row .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-strong); text-decoration: none; font-size: 15px; }
.file-row .fs { font-size: 13px; color: var(--muted); flex: none; }
.file-x { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.file-x .ic { width: 17px; height: 17px; }
.page.fade .page-body { animation: pageIn .22s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateX(14px); } }
.ins-input { width: 100%; min-height: 34vh; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink-strong); outline: none; resize: none; display: block; }
.ins-save { display: block; width: 100%; height: 48px; margin-top: 12px; border-radius: 14px; background: var(--accent); color: #fff; font-size: 16.5px; font-weight: 500; }
.dlg-text { text-align: center; color: var(--icon); font-size: 14.5px; line-height: 1.5; word-break: break-word; }

/* ---------- 第 6 步：她发的文件、作品 ---------- */
/* 输入框上面一排待发的文件 */
.attach { display: flex; gap: 8px; overflow-x: auto; margin: -4px -4px 10px; padding: 4px; scrollbar-width: none; }
.attach::-webkit-scrollbar { display: none; }
.att { position: relative; flex: none; display: flex; align-items: center; gap: 8px; height: 56px; max-width: 200px; padding: 0 30px 0 10px; border-radius: 12px; background: #F4F2EC; border: 1px solid var(--line); color: var(--icon); }
.att.img { width: 56px; padding: 0; overflow: hidden; }
.att.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att.err { border-color: #E5B9AC; }
.att > .ic { width: 20px; height: 20px; flex: none; }
.att-t { min-width: 0; text-align: left; }
.att-t .n { font-size: 13.5px; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-t .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.att-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(43, 42, 38, .72); color: #fff; display: flex; align-items: center; justify-content: center; }
.att-x .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.att-spin { position: absolute; left: 50%; top: 50%; margin: -7px 0 0 -7px; background: rgba(255,255,255,.7); border-radius: 50%; }
/* 她消息上面的文件 */
.msg.user.has-files { flex-direction: column; align-items: flex-end; }
.ufiles { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; max-width: 100%; }
.ufile { display: flex; align-items: center; gap: 9px; padding: 10px 14px 10px 11px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--icon); text-decoration: none; max-width: 240px; }
.ufile > .ic { width: 22px; height: 22px; flex: none; }
.ufile.img { padding: 0; border: 0; background: #EFECE4; border-radius: 14px; overflow: hidden; }
.ufile.img img { display: block; width: 168px; height: 168px; object-fit: cover; }
/* 回复里的作品卡片 */
.art-card { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 360px; text-align: left; margin: 8px 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(60, 50, 30, .05); font-family: var(--sans); transition: transform .12s var(--ease), opacity .12s; }
.art-card:active { opacity: .6; transform: scale(.985); }
.art-ic { width: 40px; height: 40px; border-radius: 10px; background: #F2EFE8; color: var(--icon); display: flex; align-items: center; justify-content: center; flex: none; }
.art-ic .ic { width: 21px; height: 21px; }
.art-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.art-t .n { font-size: 15.5px; font-weight: 600; color: var(--ink-strong); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-t .s { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.art-card .chev-r { color: var(--muted); display: flex; }
.art-card .chev-r .ic { width: 16px; height: 16px; }
.pill.art-pill { padding: 0 16px; }
/* 全屏看作品 */
.art-view { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .26s var(--ease); }
.art-view.show { transform: translateY(0); }
.art-head { flex: none; height: calc(56px + var(--safe-top)); padding: var(--safe-top) 10px 0; display: flex; align-items: center; gap: 4px; }
.art-title { flex: 1; min-width: 0; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-ver { display: inline-flex; align-items: center; color: var(--muted); font-size: 13.5px; margin-right: 4px; }
.art-seg { flex: none; display: flex; align-self: center; gap: 2px; padding: 3px; margin: 0 0 10px; border-radius: 11px; background: #EFECE4; }
.art-seg button { height: 32px; padding: 0 18px; border-radius: 9px; font-size: 14.5px; color: var(--icon); }
.art-seg button.on { background: var(--card); color: var(--ink-strong); box-shadow: 0 1px 3px rgba(60, 50, 30, .1); }
.art-body { flex: 1; min-height: 0; position: relative; overflow: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
.art-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.art-code { margin: 0; padding: 16px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: var(--ink-strong); }
.art-copy { position: sticky; top: 8px; float: right; margin: 8px 10px 0 0; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--icon); z-index: 1; }
.art-md { padding: 16px 20px 30px; font-size: 16px; line-height: 1.6; }

/* ---------- 第 7 步：选项卡、上下文用量、同步、压缩 ---------- */
/* 选项卡（参考图 11）：从输入框那里弹出的白色圆角面板，盖住输入框，对话区轻微变暗 */
.chat.asking .scroller { opacity: .55; transition: opacity .2s; }
.ask { position: absolute; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); z-index: 8; background: var(--card); border: 1px solid #ECE9E1; border-radius: 22px; box-shadow: 0 6px 30px rgba(60, 50, 30, .16); padding: 14px 14px 12px 18px;
  transform: translateY(24px); opacity: 0; transition: transform .24s var(--ease), opacity .2s; }
.ask.show { transform: translateY(0); opacity: 1; }
.kb-open .ask { bottom: 6px; }
.ask-head { display: flex; align-items: flex-start; gap: 8px; }
.ask-q { flex: 1; font-size: 15.5px; line-height: 1.5; color: var(--ink-strong); padding-top: 6px; }
.ask-head .icon-btn { width: 36px; height: 36px; margin: -2px -6px 0 0; color: var(--muted); }
.ask-head .icon-btn .ic { width: 20px; height: 20px; }
.ask-opts { margin: 8px 0 6px; }
.ask-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 2px; font-size: 15px; color: var(--ink-strong); transition: opacity .12s; }
.ask-opt + .ask-opt { border-top: 1px solid #EEEBE4; }
.ask-opt:active { opacity: .5; }
.ask-n { width: 26px; height: 26px; border-radius: 50%; background: #F0EEE8; color: var(--icon); font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.ask-own { display: flex; align-items: center; gap: 8px; border-top: 1px solid #EEEBE4; padding-top: 10px; }
.ask-own input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 15.5px; color: var(--ink-strong); }
.ask-own input::placeholder { color: #A9A49A; }
.ask-send { width: 34px; height: 34px; border-radius: 50%; background: #EFECE4; color: var(--icon); display: flex; align-items: center; justify-content: center; flex: none; }
.ask-send .ic { width: 18px; height: 18px; stroke-width: 2; }
/* 上下文用量 + 同步：顶栏下面右边一行小灰字 */
.ctx-label { position: absolute; right: 14px; top: calc(58px + var(--safe-top)); z-index: 6; font-size: 11.5px; color: var(--muted); background: rgba(250, 249, 245, .85); padding: 2px 7px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.ctx-label.bad { color: #B5533A; }
.banner.long { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 8px 8px 12px; }
.banner.long .t { flex: 1; min-width: 0; }
.banner.long button { font-size: 13.5px; color: #8C4A33; font-weight: 600; padding: 4px 6px; }
.banner.long .x { display: flex; color: #B07A63; }
.banner.long .x .ic { width: 16px; height: 16px; }
.compact-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }
.compact-line::before, .compact-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.row:disabled { opacity: 1; cursor: default; }
.chat:has(.banner:not([hidden])) .ctx-label { display: none; } /* 顶上有提示条时（里面已经写了百分比）先不显示用量那行 */

/* ---------- 第 8 步：设置页、用量页、深色、字号 ---------- */
.set-group .row .ic { width: 21px; height: 21px; color: var(--icon); flex: none; }
.set-group { margin-top: 4px; }
.group .row .desc { line-height: 1.4; }
.soon-tag { font-size: 13px; color: var(--muted); background: #E9E6DE; padding: 2px 8px; border-radius: 8px; }
.set-field { display: block; margin: 6px 0 18px; }
.set-field .label { font-size: 15px; font-weight: 600; color: var(--ink-strong); }
.set-field .desc { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.set-input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 11px 13px; font: inherit; font-size: 16px; color: var(--ink-strong); outline: none; resize: none; display: block; }
.set-seg-row { padding: 14px 20px; }
.group .set-seg-row + .set-seg-row { border-top: 1px solid #E4E0D7; }
.set-seg-row .label { font-size: 16.5px; color: var(--ink-strong); }
.set-seg-row .desc { font-size: 14px; color: var(--muted); margin-top: 3px; }
.set-seg { display: flex; margin: 10px 0 0; }
.set-seg button { flex: 1; padding: 0 8px; }
.usage-top { padding: 4px 0 0; }
.usage-top .set-seg { margin: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #CFCAC0; margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: #6FA36B; } .dot.bad { background: #C9543A; }
.usage-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.usage-tile { background: var(--sheet-card); border-radius: 14px; padding: 12px 14px; }
.usage-tile .v { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.usage-tile .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.usage-table { font-size: 14px; padding: 6px 16px 8px; }
.usage-table > div { display: grid; grid-template-columns: 1.6fr .8fr .8fr .8fr; gap: 6px; padding: 8px 0; border-top: 1px solid #E4E0D7; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.usage-table > div:first-child { border-top: 0; }
.usage-table .h { color: var(--muted); font-size: 12.5px; }
.usage-table span:not(:first-child) { text-align: right; }
.usage-chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 8px 2px 0; border-bottom: 1px solid var(--line); }
.usage-chart .bar { flex: 1; background: #D9CBB9; border-radius: 3px 3px 0 0; min-height: 2px; }
.usage-chart .bar.today { background: var(--accent); }
.usage-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 4px 2px 20px; }
/* 正文字号（设置 → 外观） */
html[data-text="small"] .msgs { zoom: .92; }
html[data-text="large"] .msgs { zoom: 1.12; }
/* 回复字体、消息间距（设置 → 外观） */
html[data-font="sans"] .msg.assistant .md, html[data-font="sans"] .think-body { font-family: var(--sans); }
html[data-space="compact"] .msg { margin-bottom: 12px; }
html[data-space="roomy"] .msg { margin-bottom: 30px; }
/* 深色（设置 → 外观）：单独一套暖色——深暖灰底、米白字，不是反色 */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] {
  --bg: #262624; --side: #1F1E1D; --bubble: #3A3935; --card: #30302D; --ink: #E5E1D8; --ink-strong: #F2EEE6; --muted: #9C978C; --icon: #B4AFA4;
  --line: #3E3D39; --sheet: #2B2A28; --sheet-card: #353431;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] { color-scheme: dark;
    --bg: #262624; --side: #1F1E1D; --bubble: #3A3935; --card: #30302D; --ink: #E5E1D8; --ink-strong: #F2EEE6; --muted: #9C978C; --icon: #B4AFA4;
    --line: #3E3D39; --sheet: #2B2A28; --sheet-card: #353431; }
}
html[data-theme="dark"] .side { background: #1F1E1D; }
html[data-theme="dark"] .nav:active, html[data-theme="dark"] .recent:active, html[data-theme="dark"] .recent.on, html[data-theme="dark"] .recent-group:active { background: #2E2D2A; }
html[data-theme="dark"] .composer, html[data-theme="dark"] .ask, html[data-theme="dark"] .edit-box { border-color: #3E3D39; }
html[data-theme="dark"] .composer-wrap { background: linear-gradient(rgba(38, 38, 36, 0), var(--bg) 22%); }
html[data-theme="dark"] .md code, html[data-theme="dark"] .searchbox, html[data-theme="dark"] .art-seg, html[data-theme="dark"] .perm .deny, html[data-theme="dark"] .edit-btns .cancel, html[data-theme="dark"] .ask-n, html[data-theme="dark"] .ask-send, html[data-theme="dark"] .att, html[data-theme="dark"] .art-ic, html[data-theme="dark"] .soon-tag { background: #3A3935; }
html[data-theme="dark"] .md .codeblock { background: #2B2A28; } html[data-theme="dark"] .md .code-head, html[data-theme="dark"] .md th, html[data-theme="dark"] .tool-sec pre, html[data-theme="dark"] .perm pre { background: #34332F; }
html[data-theme="dark"] .group .row + .row, html[data-theme="dark"] .file-row + .file-row, html[data-theme="dark"] .usage-table > div, html[data-theme="dark"] .ask-opt + .ask-opt, html[data-theme="dark"] .ask-own { border-color: #42413C; }
html[data-theme="dark"] .pill { background: rgba(48, 48, 45, .92); border-color: #4A4844; }
html[data-theme="dark"] .ctx-label { background: rgba(38, 38, 36, .85); }
html[data-theme="dark"] .banner { background: #4A3329; color: #F0C9B8; }
html[data-theme="dark"] .voice-btn, html[data-theme="dark"] .stop-btn { background: #F2EEE6; color: #262624; }
html[data-theme="dark"] .usage-chart .bar { background: #5B5246; }
