/* 工作保险库的样式。颜色、字号、间距都用下面的变量；浅色、深色各一套，跟随系统。不外链任何资源。 */
:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --fs-body: 15px; --fs-title: 20px; --fs-small: 13px; --lh: 1.6;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;
  --r-card: 10px; --r-ctl: 8px;
  --side-w: 220px; --main-w: 880px;
  /* 中性灰 */
  --bg: #f7f7f8; --side: #f1f2f4; --surface: #ffffff; --surface-2: #f3f4f6; --hover: #e9ebef;
  --border: #e4e6ea; --border-strong: #cdd2d9;
  --text: #1c2026; --text-2: #565e6b; --text-3: #656c78;
  /* 强调色：沉稳的蓝，只用在主按钮、当前选中项和链接 */
  --accent: #2c5bc9; --accent-hover: #234cad; --accent-soft: #e9effb; --accent-text: #2852b8; --on-accent: #ffffff;
  --ring: rgba(44, 91, 201, .28);
  --danger: #b42318; --danger-soft: #fdeeec; --ok: #1d6b44; --ok-soft: #e7f4ec;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #131417; --side: #17181c; --surface: #1c1d22; --surface-2: #24262c; --hover: #2a2c33;
    --border: #2c2e35; --border-strong: #3d4049;
    --text: #e7e8eb; --text-2: #a9aeb8; --text-3: #959ba6;
    --accent: #6f9cff; --accent-hover: #8aafff; --accent-soft: rgba(111, 156, 255, .14); --accent-text: #93b5ff; --on-accent: #0b1222;
    --ring: rgba(111, 156, 255, .35);
    --danger: #ff8f84; --danger-soft: rgba(255, 143, 132, .12); --ok: #7fd6a4; --ok-soft: rgba(127, 214, 164, .12);
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-body)/var(--lh) var(--font); }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { flex: none; }
.meta { font-size: var(--fs-small); color: var(--text-2); }

/* —— 骨架：桌面左侧栏 + 右主区域 —— */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s6); padding: var(--s4) var(--s3); background: var(--side); border-right: 1px solid var(--border); }
.side-top { display: flex; flex-direction: column; gap: var(--s3); padding: 0 var(--s2); }
.back { font-size: var(--fs-small); color: var(--text-2); text-decoration: none; }
.back:hover { color: var(--text); }
.brand { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
#title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: none; font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 999px; color: var(--text-2); border: 1px solid var(--border-strong); }
.tabs, .cats { display: flex; flex-direction: column; gap: 2px; }
.tabs button.tab, .cats button.cat { justify-content: flex-start; width: 100%; border: 0; background: transparent; color: var(--text-2); font-weight: 500; padding: 6px var(--s2); min-height: 34px; }
.tabs button.tab:hover, .cats button.cat:hover { background: var(--hover); color: var(--text); }
.tabs button.tab[aria-current], .cats button.cat[aria-current] { background: var(--accent-soft); color: var(--accent-text); }
.cats { margin-top: calc(-1 * var(--s4)); padding-left: var(--s6); }
.cats[hidden] { display: none; }
.cats button.cat { min-height: 30px; font-size: 14px; font-weight: 400; padding: 4px var(--s2); }
.cats .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cats button.cat[aria-current] .count { color: inherit; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s3); padding: 0 var(--s2); }
.side-actions { display: flex; flex-direction: column; align-items: flex-start; margin: 0 calc(-1 * var(--s2)); }
.side-actions:empty { display: none; }
.side-actions button { min-height: 30px; padding: 4px var(--s2); font-size: var(--fs-small); font-weight: 400; }
.notice { font-size: 12px; line-height: 1.5; color: var(--text-3); }
/* 侧栏顶部的全局搜索框；下面一行很小的正文读取进度 */
.search { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: calc(-1 * var(--s2)); }
.search input[type=search] { min-height: 34px; padding: 5px 10px; font-size: 14px; }
.search-progress { font-size: 12px; color: var(--text-3); padding: 0 var(--s1); font-variant-numeric: tabular-nums; }
.search-progress:empty { display: none; }
.search button.read-all { align-self: flex-start; min-height: 26px; padding: 2px var(--s1); font-size: 12px; font-weight: 400; color: var(--accent-text); }
.search button.read-all[hidden] { display: none; }
.layout[data-mode=gate] .search { display: none; }
/* 栏目入口旁的待处理数 */
.tab-count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
/* 常用标签：和分类一组的样子，上面一行小标题 */
.tag-nav { margin-top: calc(-1 * var(--s3)); }
.tag-nav[hidden] { display: none; }
.nav-title { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 0 var(--s2) 2px; }
.more-toggle { display: none; }
.layout[data-mode=gate] .tabs, .layout[data-mode=gate] .cats { display: none; }
#search-results[hidden], #content[hidden] { display: none; }
.search-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin-bottom: var(--s4); }
.search-hint { color: var(--text-3); font-size: 12px; }
.search-group + .search-group { margin-top: var(--s6); }

.main { min-width: 0; padding: var(--s8) var(--s8) 64px; }
.main-inner { max-width: var(--main-w); margin: 0 auto; }
.page-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s1) var(--s3); margin-bottom: var(--s4); }
.page-head h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.4; }
.page-head p { font-size: var(--fs-small); color: var(--text-2); }
.layout[data-mode=gate] .page-head { display: none; }

/* 状态条：固定在主区域顶部；普通、成功、出错三种样子 */
#status { position: sticky; top: var(--s2); z-index: 5; margin-bottom: var(--s4); padding: var(--s2) var(--s3); border-radius: var(--r-ctl); font-size: 14px; background: var(--surface); color: var(--text-2); border: 1px solid var(--border); overflow-wrap: anywhere; box-shadow: var(--shadow); }
#status:empty { display: none; }
#status[data-tone=ok] { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
#status[data-tone=error] { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* —— 控件：主按钮（实心）、次按钮（描边，默认）、文字按钮、危险按钮 —— */
button, .btn { font: inherit; font-size: 14px; font-weight: 500; line-height: 20px; min-height: 36px; padding: 7px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; max-width: 100%; }
button:hover, .btn:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.text { border-color: transparent; background: transparent; color: var(--text-2); padding-left: 10px; padding-right: 10px; }
button.text:hover:not(:disabled) { background: var(--hover); color: var(--text); }
button.danger { border-color: transparent; background: transparent; color: var(--danger); padding-left: 10px; padding-right: 10px; }
button.danger:hover { background: var(--danger-soft); }
.btn.wide { width: 100%; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type=text], input[type=search], input[type=password], select, textarea {
  font: inherit; font-size: var(--fs-body); width: 100%; max-width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--text);
}
textarea { display: block; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-name { display: flex; align-items: baseline; gap: var(--s2); font-size: var(--fs-small); font-weight: 500; color: var(--text-2); }
.hint { font-weight: 400; font-size: 12px; color: var(--text-3); }
.check { display: flex; align-items: center; gap: var(--s2); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.toolbar { display: flex; align-items: center; gap: var(--s2); margin: var(--s6) 0 var(--s3); }
.toolbar input { flex: 1; }
.count-text { flex: none; }

/* —— 卡片和列表 —— */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s4); min-width: 0; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.list { display: flex; flex-direction: column; gap: var(--s2); }
.entry { padding: var(--s3) var(--s4); }
.entry-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.entry-main { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.entry-actions { display: flex; align-items: center; gap: var(--s1); flex: none; }
.entry-note { font-size: var(--fs-small); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title-btn { border: 0; background: none; padding: 0; min-height: 26px; font-size: var(--fs-body); font-weight: 600; color: var(--text); text-align: left; white-space: normal; overflow-wrap: anywhere; justify-content: flex-start; }
.title-btn:hover { background: none; color: var(--accent-text); }
.entry-panel { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s3); }
.entry-panel[hidden] { display: none; }
.panel-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s3); }
.panel-tools { justify-content: space-between; }
.chip { display: inline-flex; align-items: center; font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.nowrap { white-space: nowrap; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 4px; row-gap: 4px; }
.note-meta .chip { margin-right: 4px; }
.chip.todo { background: var(--accent-soft); color: var(--accent-text); }
/* 卡片、详情里可点的标签和来源 */
button.tag-btn { min-height: 22px; padding: 0 8px; font-size: 12px; font-weight: 400; line-height: 20px; border-radius: 999px; border-color: var(--border); background: transparent; color: var(--text-2); vertical-align: baseline; }
button.tag-btn:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
button.source-link { min-height: 0; padding: 0; border: 0; background: none; font-size: inherit; font-weight: 400; color: var(--accent-text); white-space: normal; text-align: left; overflow-wrap: anywhere; }
button.source-link:hover { background: none; text-decoration: underline; }
.entry.flash { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
/* 按标签筛时列表上方那一条 */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: calc(-1 * var(--s1)) 0 var(--s2); padding: 2px 4px 2px var(--s3); border-radius: var(--r-ctl); background: var(--accent-soft); color: var(--accent-text); font-size: 14px; }
.filter-bar[hidden] { display: none; }
.filter-name { font-weight: 500; overflow-wrap: anywhere; }
.filter-bar button.text { min-height: 30px; color: var(--accent-text); }
/* 邮件：待处理、已处理、全部的分段切换 */
.segmented { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--surface-2); }
.segmented button { min-height: 30px; padding: 4px 12px; border: 0; background: transparent; color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.segmented button:hover { background: var(--hover); color: var(--text); }
.segmented button[aria-pressed=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.note-snippet { font-size: var(--fs-small); color: var(--text-2); margin-top: 2px; }
.empty { padding: var(--s8) var(--s4); text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: var(--s4); }
.group { display: flex; flex-direction: column; gap: var(--s2); }
.group + .group { margin-top: var(--s4); }
.group-title { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 0 var(--s1); }
.warn { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }

/* 上传区、随手收：虚线边的卡片 */
.drop, .collect { border: 1.5px dashed var(--border-strong); border-radius: var(--r-card); background: transparent; transition: border-color .15s, background-color .15s; }
.drop { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s4); padding: var(--s6); }
.drop.over, .collect.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-title, .collect-title { font-weight: 600; }
.progress { flex-basis: 100%; font-size: var(--fs-small); color: var(--text-2); }
.progress:empty { display: none; }
.collect { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); }
.collect textarea { min-height: 64px; }
.progress-line { margin: calc(-1 * var(--s1)) 0 var(--s2); }
.progress-line:empty { display: none; }
.results { margin-top: var(--s4); }
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s1); }
.results h3 { font-size: 14px; font-weight: 600; }
.results ul { list-style: none; margin: 0; padding: 0; }
.results li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 6px 0; border-top: 1px solid var(--border); }
.result-text { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); min-width: 0; }
.result-title { font-weight: 500; overflow-wrap: anywhere; }
.ok-text { color: var(--ok); }
.error-text { color: var(--danger); }

/* 详情、表单 */
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.detail-top > button.text { margin-left: -10px; }
.detail-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--s4); }
.detail-title { font-size: 18px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; margin-bottom: var(--s1); }
.cat-row { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s1); }
.inline-select { width: auto; min-height: 30px; padding: 3px 8px; font-size: var(--fs-small); }
.section { margin-top: var(--s6); display: flex; flex-direction: column; gap: var(--s2); }
.section h3 { font-size: 15px; font-weight: 600; }
.attach { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s1) var(--s2) var(--s1) var(--s4); }
.attach-name { min-width: 0; overflow-wrap: anywhere; }
.reply { padding: var(--s4); }
#note-editor { display: flex; flex-direction: column; gap: var(--s2); }
.form { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.form textarea { min-height: 280px; }
.callout { font-size: 14px; padding: var(--s2) var(--s3); border-radius: var(--r-ctl); background: var(--accent-soft); color: var(--text); }
.mail-body, .note-body { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; font: inherit; line-height: 1.7; margin: 0; padding: var(--s4) var(--s6); }
.note-body.muted { color: var(--text-3); }
/* 正文的简单排版：只有标题、段落、列表、引用、加粗、代码 */
.note-body.rich > * + * { margin-top: .7em; }
.note-body.rich h3, .note-body.rich h4, .note-body.rich h5 { margin: 0; font-weight: 600; line-height: 1.45; }
.note-body.rich h3 { font-size: 18px; }
.note-body.rich h4 { font-size: 16px; }
.note-body.rich h5 { font-size: 15px; color: var(--text-2); }
.note-body.rich > h3:not(:first-child), .note-body.rich > h4:not(:first-child) { margin-top: 1.1em; }
.note-body.rich ul, .note-body.rich ol { margin: 0; padding-left: 1.4em; }
.note-body.rich li + li { margin-top: 2px; }
.note-body.rich blockquote { margin: 0; padding: 2px 0 2px var(--s3); border-left: 3px solid var(--border-strong); color: var(--text-2); }
.note-body.rich strong { font-weight: 600; }
.note-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }

/* —— AI：设置面板、表单里的生成状态、摘要、邮件起草 —— */
.hint:empty { display: none; }
.hint.ai-hint { color: var(--accent-text); }
.ai-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: var(--s6); color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(16, 24, 40, .18); }
.ai-dialog[open] { display: flex; flex-direction: column; gap: var(--s4); }
.ai-dialog::backdrop { background: rgba(16, 20, 28, .45); }
.ai-title { font-size: 18px; font-weight: 600; }
.ai-disclosure { font-size: 13px; line-height: 1.6; color: var(--text-2); }
.ai-warn { font-size: 13px; padding: var(--s2) var(--s3); border-radius: var(--r-ctl); background: var(--danger-soft); color: var(--danger); }
.ai-form { display: flex; flex-direction: column; gap: var(--s4); }
.ai-switch { font-weight: 500; }
.ai-key-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); min-height: 36px; padding: 2px 2px 2px var(--s3); border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface-2); }
.ai-key-tail { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 14px; }
.ai-key-row .tools { gap: 0; }
.field button.ai-inline { align-self: flex-start; min-height: 28px; padding: 2px 8px; font-size: 13px; font-weight: 400; }
.ai-result { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.ai-result:empty { display: none; }
.ai-result[data-tone=ok] { color: var(--ok); }
.ai-result[data-tone=error] { color: var(--danger); }
.ai-tools { padding-top: var(--s1); }
/* 表单顶上一行：「让 AI 重新生成」和截断说明 */
.ai-bar { display: flex; align-items: center; justify-content: flex-end; gap: var(--s3); margin: calc(-1 * var(--s2)) calc(-1 * var(--s2)) calc(-1 * var(--s3)) 0; }
.ai-bar .ai-note { margin-right: auto; font-size: 12px; }
.ai-bar .ai-note.ai-hint { color: var(--accent-text); }
.ai-bar .ai-note:empty { display: none; }
.ai-bar button.ai-regen { color: var(--accent-text); font-weight: 400; min-height: 32px; }
.form textarea.summary-input { min-height: 64px; }
/* 列表卡片上一行摘要（超出省略），详情里正文上面的摘要 */
.note-summary { max-width: 100%; font-size: var(--fs-small); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-summary-detail { padding: var(--s3) var(--s4); margin-bottom: var(--s3); font-size: 14px; color: var(--text-2); background: var(--surface-2); border-color: transparent; box-shadow: none; }
.results .batch-ai-note { margin-bottom: var(--s1); }
/* 邮件回复区：「想怎么回」和「AI 起草回复」一行 */
.reply .ai-check { margin-top: calc(-1 * var(--s1)); }
.ai-draft { display: flex; align-items: center; gap: var(--s2); }
.ai-draft input { flex: 1; min-width: 0; }

/* 未登录、未解锁：侧栏收成顶部一条，内容是居中的一张卡片 */
.layout[data-mode=gate] { display: block; }
.layout[data-mode=gate] .side { position: static; height: auto; overflow: visible; background: transparent; border-right: 0; border-bottom: 1px solid var(--border); padding: var(--s3) var(--s6); }
.layout[data-mode=gate] .side-top { flex-direction: row; align-items: center; gap: var(--s4); padding: 0; }
.layout[data-mode=gate] .side-foot { display: none; }
.layout[data-mode=gate] .main-inner { max-width: 460px; padding-top: 8vh; }
.gate-card { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s6); }
.gate-card h2 { font-size: var(--fs-title); font-weight: 600; }
.gate-text { color: var(--text-2); font-size: 14px; }
.gate-card > .tools:last-child button.primary { width: 100%; }
.divider { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-small); color: var(--text-3); }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.login-form { flex-wrap: nowrap; }
.login-form input { flex: 1; }
.qr-card { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s4); }
.qr-card h2 { font-size: 16px; font-weight: 600; }
.qr { max-width: 280px; background: white; padding: 14px; border-radius: var(--r-ctl); }
.qr svg { display: block; width: 100%; height: auto; }

/* —— 手机：侧栏收成顶部一条 —— */
@media (max-width: 900px) {
  .layout { display: block; }
  .side { position: static; height: auto; overflow: visible; gap: var(--s3); padding: var(--s3) var(--s4); border-right: 0; border-bottom: 1px solid var(--border); }
  .side-top { flex-direction: row; align-items: center; gap: var(--s3); padding: 0; }
  .back { flex: none; }
  .brand { flex: 1; }
  .more-toggle:not([hidden]) { display: inline-flex; }
  .side-foot { order: 1; display: none; margin: 0; padding: var(--s2) var(--s3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
  .side-foot.open { display: flex; }
  .side-actions { margin: 0 calc(-1 * var(--s2)); }
  .side-actions button { min-height: 44px; font-size: 14px; }
  .search { order: 2; margin-bottom: 0; }
  .search input[type=search] { min-height: 40px; }
  .tabs { order: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--r-ctl); }
  .tabs button.tab { justify-content: center; min-height: 44px; }
  .tabs button.tab[aria-current] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
  .tab-count { margin-left: 2px; }
  .cats { order: 4; flex-direction: row; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4) 2px; overflow-x: auto; gap: var(--s2); scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cats button.cat { width: auto; flex: none; min-height: 36px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 12px; gap: 6px; }
  .cats button.cat[aria-current] { border-color: var(--accent); }
  .cats .count { margin-left: 0; }
  .tag-nav { order: 5; margin-top: 0; align-items: center; }
  .tag-nav .nav-title { flex: none; padding: 0 2px 0 0; }
  .tag-nav button.cat { min-height: 32px; font-size: 13px; }
  button.tag-btn { min-height: 26px; }
  button.source-link { min-height: 0; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-height: 36px; padding: 4px 6px; }
  .main { padding: var(--s4) var(--s4) 48px; }
  .layout[data-mode=gate] .main-inner { padding-top: var(--s4); }
  .page-head { margin-bottom: var(--s3); }
  button, .btn { min-height: 44px; }
  input[type=text], input[type=search], input[type=password], select { min-height: 44px; }
  .title-btn { min-height: 32px; }
  .entry-row { flex-direction: column; align-items: stretch; gap: var(--s1); }
  .entry-actions { margin-left: -10px; }
  .entry-actions button { border-color: transparent; background: transparent; color: var(--accent-text); padding-left: 10px; padding-right: 10px; }
  .entry-actions button.text { color: var(--text-2); }
  .panel-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .drop { padding: var(--s4); }
  .drop .file-btn { width: 100%; }
  .collect .tools > .meta { flex-basis: 100%; }
  .toolbar { flex-wrap: wrap; }
  .mail-body, .note-body { padding: var(--s3) var(--s4); }
  .inline-select { min-height: 36px; }
  .warn, .attach { flex-wrap: wrap; }
  .ai-dialog { padding: var(--s4); }
  .ai-draft { flex-wrap: wrap; }
  .ai-draft button { width: 100%; }
  .ai-bar { flex-wrap: wrap; }
}
