/* ============================================================
   MY DESK · 可插拔模块工作台 Shell
   复用 styles.css 的设计令牌（暖纸 / 陶土朱红），只定义模块壳与视图样式。
   ============================================================ */

.shell { grid-template-columns: var(--sidebar-width, 240px) minmax(0, 1fr); zoom: var(--ui-scale, 1); }
/* 外观执行器（Agent ui_command setAppearance / 设置 ui.*）：字号缩放 / 密度 / 侧栏宽 */
:root[data-font-size="small"] { --ui-scale: 0.92; }
:root[data-font-size="large"] { --ui-scale: 1.12; }
:root[data-density="compact"] { --s2: 6px; --s3: 8px; --s4: 12px; --s5: 16px; }
.main { display: flex; flex-direction: column; min-height: 0; grid-template-rows: none; background: var(--bg); }
.workspace-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5);
  flex: none; padding: var(--s5) var(--s6) var(--s4);
  border-bottom: 1px solid var(--border); background: var(--panel);
}
.workspace-head h1 { margin: 3px 0 2px; font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.workspace-head p { margin: 0; font-size: 12.5px; color: var(--text-3); }
.head-actions { display: flex; align-items: center; gap: var(--s2); flex: none; flex-wrap: wrap; justify-content: flex-end; }
.view-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s5) var(--s6) var(--s7); }
.view-body.flush { padding: 0; }
.workspace-head.is-hidden { display: none; }

/* 设置页 */
/* 设置页：同一行的卡片等高，最后一张跨满整行，避免出现参差与右下空白 */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--s4); align-items: stretch; }
.settings-grid > .panel { display: flex; flex-direction: column; min-width: 0; }
/* 栅格内由 gap 统一控制间距，覆盖全局的 .panel + .panel 外边距，避免逐张下移 */
.settings-grid > .panel + .panel { margin-top: 0; }
.settings-grid > .panel > .panel-body { flex: 1; }
.settings-grid > .panel.settings-wide { grid-column: 1 / -1; }
.settings-grid > .panel.settings-wide > .panel-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); }
.settings-wide .setting-row { border-bottom: none; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 60px; padding: var(--s3) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.setting-row:last-child { border-bottom: none; }
.setting-row > div:first-child { flex: 1; min-width: 180px; }
.setting-row b { font-size: 13px; font-weight: 650; }
.setting-row .hint { margin: 3px 0 0; }
.setting-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.setting-note { margin-top: var(--s3); line-height: 1.7; }
.setting-switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.setting-switch input { width: 16px; height: 16px; accent-color: var(--accent); }
/* 模型配置表单：字段标签保持中文原貌，不套用全局的大写与字距 */
.model-config .field-label { text-transform: none; letter-spacing: 0; font-size: 12px; }
.model-config .hint { margin-top: 5px; }
.model-config .field-row.single { grid-template-columns: 1fr; }
.cfg-endpoint { margin-top: var(--s2); word-break: break-all; }
.cfg-endpoint span { min-width: 0; }
.cfg-endpoint code { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
/* 助理身份编辑 */
.identity-row { align-items: flex-start; }
.identity-edit { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.identity-edit .input { width: 108px; font-size: 12.5px; padding: 6px 9px; }
.identity-edit .input-avatar-text { width: 62px; text-align: center; }
.avatar-options { display: flex; gap: 5px; }
.avatar-option { width: 28px; height: 28px; border: 2px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 800; cursor: pointer; }
.avatar-option.is-on { border-color: currentColor; box-shadow: 0 0 0 2px var(--panel) inset; }
.avatar-preview { display: grid; place-items: center; width: 34px; height: 34px; flex: none; overflow: hidden; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 12px; font-weight: 800; }
.avatar-preview:hover { border-color: var(--accent); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-switch { display: inline-flex; align-items: center; cursor: pointer; }
.profile-switch input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.settings-wide .data-dir-row { grid-column: 1 / -1; }
.dir-pick-row { display: flex; align-items: center; gap: 8px; }
.dir-pick-row .input { flex: 1; min-width: 0; }
/* 多套模型配置 */
.profile-list { display: flex; flex-direction: column; gap: 6px; margin: 0 0 var(--s4); }
.profile-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.profile-card.is-active { border-color: var(--accent); background: var(--accent-soft); }
/* 卡片默认灰；只有实际测试通过才变绿，失败变红，未选中的整卡置灰 */
.profile-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--text-3); }
.profile-dot.is-ok { background: var(--ok); }
.profile-dot.is-err { background: var(--err); }
.profile-dot.is-off { background: var(--text-3); }
.profile-card:not(.is-active) { opacity: .58; }
.profile-card:not(.is-active) .profile-dot { background: var(--text-3); }
.profile-info { flex: 1; min-width: 0; }
.profile-info b { font-size: 12.5px; }
.profile-info .hint { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-state { margin-top: 3px; font-size: 10.5px; color: var(--text-3); }
.profile-state.is-ok { color: var(--ok); }
.profile-state.is-err { color: var(--err); }
.profile-card .mini-btn { width: 28px; height: 28px; }
@media (max-width: 768px) {
  .identity-edit { justify-content: flex-start; }
  .profile-card { flex-wrap: wrap; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > .panel.settings-wide { grid-column: auto; }
  .settings-grid > .panel.settings-wide > .panel-body { grid-template-columns: 1fr; }
}

/* ---------------- Sidebar ---------------- */
.sidebar { padding: var(--s5) var(--s3) var(--s4); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 0 var(--s2) var(--s3); }
.side-head .eyebrow { flex: 1; min-width: 0; }
.side-count { font: 11px var(--font-mono); color: var(--text-3); }
.side-collapse { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: var(--r-sm); color: var(--text-3); }
.side-collapse:hover { background: var(--surface-hover); color: var(--accent); }
.side-collapse svg { width: 15px; height: 15px; }
/* 手动收起：只留模块图标 */
body.sidebar-collapsed .shell { grid-template-columns: 64px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { padding-inline: var(--s2); }
body.sidebar-collapsed .side-head { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .side-head .eyebrow,
body.sidebar-collapsed .side-count,
body.sidebar-collapsed .mod-name,
body.sidebar-collapsed .mod-badge,
body.sidebar-collapsed .side-rule { display: none; }
body.sidebar-collapsed .mod-item { justify-content: center; padding: 0; min-height: 40px; }
body.sidebar-collapsed .mod-item.is-home .mod-name::after { display: none; }
body.sidebar-collapsed .side-collapse svg { transform: rotate(180deg); }
.module-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.mod-item {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 38px; padding: 0 var(--s2) 0 11px; border-radius: var(--r-md);
  color: var(--text-2); font-size: 13px; text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mod-item:hover { background: var(--surface-hover); color: var(--text); }
.mod-item.is-active { background: var(--panel); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm); }
.mod-item.is-active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 2px 2px 0; background: var(--accent); }
.mod-item.is-home .mod-name::after { content: "默认"; margin-left: 6px; padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); vertical-align: 1px; }
.mod-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: none; color: var(--text-3); }
.mod-icon svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mod-item.is-active .mod-icon { color: var(--accent); }
.mod-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-badge { font: 10.5px var(--font-mono); color: var(--text-3); background: var(--surface-sunk); border-radius: 999px; padding: 1px 6px; }
.mod-state { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.mod-state.is-off { background: var(--text-3); }
.side-bottom { margin-top: auto; padding: var(--s4) var(--s2) 0; }
.backup-box { padding: var(--s3); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.backup-actions { display: flex; gap: 6px; margin-top: var(--s2); }
.side-btn { flex: 1; min-height: 30px; padding: 5px 4px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel); color: var(--text-2); font-size: 11px; font-weight: 600; }
.side-btn:hover { border-color: var(--accent); color: var(--accent); }
.storage { padding-top: var(--s3); }

.sync-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-sunk); border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.sync-chip.is-busy .sync-dot { background: var(--warn); }
.sync-chip.is-offline .sync-dot { background: var(--err); }
.demo-badge[hidden], .backup-tip[hidden] { display: none; }
.backup-tip { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 8px 16px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); font-size: 12px; font-weight: 600; box-shadow: var(--shadow-sm); }
.mobile-tabs { display: none; }

/* ---------------- 通用组件 ---------------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s4); padding: var(--s3); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 120px; padding: 7px 10px; font-size: 13px; }
.filter-bar .grow { flex: 1; min-width: 180px; }
.filter-bar .seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--r-sm); }
.filter-bar .seg button { padding: 5px 10px; font-size: 12px; color: var(--text-3); border-radius: 3px; }
.filter-bar .seg button.is-active { background: var(--panel); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm); }
.filter-bar .count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stat-card { padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.stat-card .lbl { font-size: 11px; color: var(--text-3); letter-spacing: .04em; }
.stat-card .val { display: block; margin-top: 5px; font: 700 22px/1.2 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.stat-card .sub { display: block; margin-top: 3px; font-size: 11px; color: var(--text-3); }
.val.is-expense { color: var(--err); }   /* 支出红 */
.val.is-income { color: var(--ok); }     /* 收入绿，符合国内习惯 */
.val.is-accent { color: var(--accent); }

.panel { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.panel + .panel { margin-top: var(--s4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 700; }
.panel-head .hint { margin: 0; font-size: 11px; color: var(--text-3); }
.panel-body { padding: var(--s4); }
.panel-body.flush { padding: 0; }

.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; background: var(--surface-sunk); color: var(--text-2); white-space: nowrap; }
.tag.is-accent { background: var(--accent-soft); color: var(--accent); }
.tag.is-ok { background: var(--ok-soft); color: var(--ok); }
.tag.is-err { background: var(--err-soft); color: var(--err); }
.tag.is-info { background: var(--info-soft); color: var(--info); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; text-align: center; color: var(--text-3); gap: 8px; }
.empty h3 { margin: 0; font-size: 15px; color: var(--text-2); }
.empty p { margin: 0; font-size: 12px; max-width: 44ch; line-height: 1.7; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: var(--s5) 0 var(--s3); }
.section-title h2 { margin: 0; font-size: 13px; font-weight: 700; }
.section-title .hint { font-size: 11px; color: var(--text-3); }

/* 表格 / 列表 */
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { padding: 10px var(--s4); text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); background: var(--surface-sunk); white-space: nowrap; }
.data-table td { padding: 10px var(--s4); border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table .num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.mini-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); border: 1px solid var(--border); color: var(--text-3); background: var(--panel); }
.mini-btn:hover { border-color: var(--text-3); color: var(--text); }
.mini-btn.danger:hover { color: var(--err); border-color: var(--err); }
.mini-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; }
.mini-btn.wide { width: auto; padding: 0 10px; font-size: 11.5px; font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* 卡片网格（网站导航） */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--s3); }
.site-card { position: relative; display: flex; flex-direction: column; gap: 9px; min-height: 150px; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); text-align: left; transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.site-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.site-card::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: var(--r-md) var(--r-md) 0 0; background: var(--accent); opacity: .55; }
.site-name { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-url { font: 10.5px var(--font-mono); color: var(--info); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: var(--s2); border-top: 1px solid var(--border); }
.site-time { font: 10.5px var(--font-mono); color: var(--text-3); }
.open-hint { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-3); }
.tag-picker { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: var(--s3); }
.tag-picker button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 11.5px; color: var(--text-2); background: var(--panel); }
.tag-picker button:hover { border-color: var(--accent); color: var(--accent); }
.tag-picker button.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }

/* 图表 */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s4); }
.chart-box { min-width: 0; }
.chart-box svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: var(--s3); font-size: 11.5px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
/* 两栏图表共用 640×232 视口；面板与内容区都拉伸填满，图例贴底才真正平齐 */
.chart-box.panel { display: flex; flex-direction: column; }
.chart-box .panel-body { flex: 1; display: flex; flex-direction: column; }
.chart-box .chart-legend { margin-top: auto; padding-top: var(--s3); min-height: 36px; align-items: center; align-content: flex-end; }
.chart-legend .legend-lead { font-weight: 700; }
.chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-gridline { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-label { fill: var(--text-3); font: 10px var(--font-ui); }
.chart-value { fill: var(--text-2); font: 600 10px var(--font-mono); }

/* 时间线（生活琐事） */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl-day { position: relative; margin-bottom: var(--s5); }
.tl-day::before { content: ""; position: absolute; left: -20px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.tl-date { display: inline-block; margin-bottom: var(--s3); font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); }
.tl-item { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); margin-bottom: var(--s2); }
.tl-main { min-width: 0; }
.tl-title { font-size: 13px; font-weight: 650; color: var(--text); }
.tl-meta { margin-top: 4px; font-size: 11px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tl-desc { margin-top: 6px; font-size: 12px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; }
.template-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.template-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); font-size: 12px; color: var(--text-2); background: var(--panel); }
.template-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Agent 对话 */
.view-body.is-chat { overflow: hidden; }
.chat-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.engineering-jobs { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.engineering-jobs summary { cursor: pointer; font-weight: 600; }
.engineering-jobs summary span { margin-left: 8px; font-size: .85em; color: var(--text-3); }
.engineering-notice { color: var(--text-3); margin: 6px 0; }
.engineering-notice:empty { display: none; }
.engineering-form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.engineering-form label { display: grid; gap: 4px; flex: 1 1 170px; }
.engineering-form textarea { padding: 6px 8px; min-width: 0; width: 100%; resize: vertical; color: var(--text); background: var(--surface-sunk); border: 1px solid var(--border); border-radius: 6px; }
.engineering-list { list-style: none; max-height: 180px; overflow: auto; padding: 0; margin: 8px 0 0; }
.engineering-list:empty { margin: 0; }
.engineering-list li { padding: 7px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.engineering-list p { margin: 4px 0; white-space: pre-wrap; }
.engineering-task-heading, .engineering-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.engineering-task-heading span { color: var(--text-3); }
.engineering-file-search { display: flex; gap: 8px; margin: 12px 0; }
.engineering-acceptance { margin: 12px 0; }
.engineering-acceptance label { display: grid; gap: 6px; margin: 8px 0; }
.engineering-acceptance textarea { width: 100%; min-height: 110px; resize: vertical; font-family: monospace; }
.engineering-file-results { list-style: none; padding: 0; margin: 8px 0 0; }
.engineering-file-results li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.engineering-file-content { max-height: 40vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-sunk); padding: 8px; }
.today-strip { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.today-card { flex: 1 1 150px; padding: 10px var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.today-card b { display: block; font: 700 17px var(--font-mono); color: var(--text); }
.today-card span { font-size: 11px; color: var(--text-3); }
.today-card .is-overdue { color: var(--err); }
.chat-scroll { flex: 1; min-height: 120px; overflow-y: auto; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.chat-msg { display: flex; gap: 10px; margin-bottom: var(--s4); animation: msg-in 220ms var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-msg.is-user { flex-direction: row-reverse; }
.chat-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.chat-msg.is-user .chat-avatar { background: var(--surface-sunk); color: var(--text-2); }
/* 助理头像预设：浅底深字，深浅主题下都清晰 */
.avatar-c1 { background: #FFF0E4; color: #C2521F; }
.avatar-c2 { background: #E6F1FF; color: #1B62B5; }
.avatar-c3 { background: #E7F5EC; color: #1F7A45; }
.avatar-c4 { background: #F1EAFB; color: #6B42B5; }
.avatar-c5 { background: #FDEBEA; color: #B0392F; }
.avatar-c6 { background: #ECEFF2; color: #3C4652; }
.chat-bubble { max-width: min(680px, 82%); padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); font-size: 13px; line-height: 1.72; white-space: pre-wrap; word-break: break-word; }
.chat-msg.is-user .chat-bubble { background: var(--accent-soft); border-color: var(--accent-soft); }
.chat-rollback { flex: none; align-self: center; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text-3); font-size: 11px; cursor: pointer; -webkit-user-select: none; user-select: none; transition: color .15s, border-color .15s; }
.chat-rollback:hover { color: var(--err); border-color: var(--err); }
.chat-cite { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
/* 输入框卡片：上方文本区，下方一行「大脑 / 工具 / 指标 / 发送」 */
.chat-compose { display: flex; flex: none; flex-direction: column; margin-top: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--panel); overflow: visible; transition: border-color .15s, box-shadow .15s; }
.chat-compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-compose textarea { width: 100%; min-height: 54px; max-height: 180px; padding: 12px 14px 4px; font-size: 14px; line-height: 1.6; resize: vertical; background: transparent; border: 0; border-radius: 0; color: var(--text); }
.chat-compose textarea:focus { border-color: transparent; box-shadow: none; outline: none; }
.chat-compose textarea::placeholder { color: var(--text-3); }
.compose-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 4px 8px 8px 10px; }
.compose-left, .compose-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.compose-right { margin-left: auto; }
.brain-pick { display: inline-flex; align-items: center; min-width: 0; }
.brain-dot { width: 7px; height: 7px; flex: none; margin-right: 2px; border-radius: 50%; background: var(--ok); }
.brain-dot.is-off { background: var(--text-3); }
.brain-dot.is-err { background: var(--err); }
.compose-meta, .compose-metrics { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.compose-metrics { font-family: var(--font-mono); color: var(--text-2); cursor: help; }
.compose-status { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.compose-status.is-err { color: var(--err); }

/* 主题化下拉：替代原生 select 的操作系统蓝色高亮弹层，全部走设计令牌 */
.wb-select { position: relative; display: inline-flex; min-width: 0; }
.wb-select-btn { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 230px; padding: 4px 7px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.wb-select-btn:hover, .wb-select-btn:focus-visible, .wb-select-btn[aria-expanded="true"] { color: var(--accent); background: var(--surface-hover); outline: none; }
.wb-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-select-chevron { width: 10px; height: 10px; flex: none; transition: transform .15s var(--ease); }
.wb-select-btn[aria-expanded="true"] .wb-select-chevron { transform: rotate(180deg); }
.wb-select-menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 200px; max-width: 290px; max-height: 260px; overflow-y: auto; padding: 5px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow-md); }
.wb-select-menu.is-top { top: auto; bottom: calc(100% + 6px); }
.wb-select-menu.is-right { left: auto; right: 0; }
.wb-select-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.wb-select-option:hover, .wb-select-option.is-cursor { background: var(--surface-hover); }
.wb-select-option[aria-selected="true"] { color: var(--accent); font-weight: 650; }
.wb-select-option-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-select-option-label small { display: block; max-width: 220px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 10px; font-weight: 400; }
.wb-select-check { width: 13px; height: 13px; flex: none; color: var(--accent); }
.wb-select.is-inline .wb-select-btn { color: var(--text-2); }
.wb-select.is-pill .wb-select-btn { border: 1px solid var(--border); border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 500; background: var(--panel); }
.wb-select.is-pill .wb-select-btn:hover, .wb-select.is-pill .wb-select-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--panel); }
.chat-send { min-height: 32px; padding: 0 14px; font-size: 12px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.chat-chips button { padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 11.5px; color: var(--text-2); background: var(--panel); }
.chat-chips button:hover { border-color: var(--accent); color: var(--accent); }

.preview-card { margin-top: 4px; padding: var(--s3); border: 1px solid var(--warn); border-radius: var(--r-md); background: var(--warn-soft); max-width: min(680px, 88%); }
.preview-card h4 { margin: 0 0 4px; font-size: 12.5px; color: var(--warn); }
.preview-card p { margin: 0 0 10px; font-size: 11.5px; color: var(--text-2); line-height: 1.6; }
.preview-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 10px; }
.preview-fields label { display: block; font-size: 10px; color: var(--text-3); margin-bottom: 3px; }
.preview-fields .input, .preview-fields .select { padding: 6px 9px; font-size: 12.5px; background: var(--panel); }
.preview-warn { margin-bottom: 10px; padding: 7px 10px; border-radius: var(--r-sm); background: var(--err-soft); color: var(--err); font-size: 11.5px; }
.preview-batch { margin-bottom: 9px; padding: 8px 10px; border: 1px solid var(--warn); border-radius: var(--r-sm); background: var(--panel); }
.preview-batch-title { margin-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--warn); }
.preview-actions { display: flex; gap: var(--s2); }
.preview-card.is-danger { border-color: var(--err); background: var(--err-soft); }
.preview-card.is-danger h4 { color: var(--err); }
.pf-diff-field { grid-column: 1 / -1; }
.pf-diff { display: flex; align-items: center; gap: 6px; }
.pf-before { flex: 1; min-width: 0; padding: 6px 9px; border-radius: var(--r-sm); background: var(--surface-sunk); color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: line-through; text-decoration-color: var(--text-3); }
.pf-arrow { flex: none; color: var(--text-3); font-size: 11px; }
.pf-after { flex: 1; min-width: 0; }
.pf-after .input, .pf-after .select, .pf-after .textarea { width: 100%; }
.agent-status { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s3); font-size: 11.5px; color: var(--text-3); }
.agent-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.agent-status .dot.is-off { background: var(--warn); }
.agent-status .sep { color: var(--border); }
.brain-banner { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s4); padding: 11px var(--s4); border: 1px solid var(--warn); border-radius: var(--r-md); background: var(--warn-soft); color: var(--text-2); font-size: 12px; line-height: 1.65; }
.brain-banner .bb-icon { display: grid; place-items: center; color: var(--warn); flex: none; }
.brain-banner b { color: var(--text); }
.brain-banner > div { flex: 1; min-width: 0; }
.brain-banner .btn { flex: none; }
.chat-notice { margin-top: 8px; padding: 7px 10px; border-left: 2px solid var(--warn); border-radius: var(--r-sm); background: var(--warn-soft); color: var(--text-2); font-size: 11.5px; line-height: 1.6; }
.chat-alert { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; padding: 7px 9px; border-radius: var(--r-sm); background: var(--err-soft); color: var(--err); font-size: 11.5px; line-height: 1.6; }
.chat-alert svg { flex: none; margin-top: 1px; }
.tool-trace { margin-top: 6px; opacity: .92; }

/* 模块管理 */
.mgr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s3); }
.mgr-card { display: flex; flex-direction: column; gap: 10px; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.mgr-card.is-disabled { opacity: .68; }
.mgr-top { display: flex; align-items: flex-start; gap: 10px; }
.mgr-top h3 { margin: 0; font-size: 14px; font-weight: 700; }
.mgr-top p { margin: 3px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
.mgr-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--text-3); }
.mgr-caps { display: flex; flex-wrap: wrap; gap: 4px; }
.mgr-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--border); }
.perm-row { display: flex; flex-wrap: wrap; gap: 10px; padding: var(--s2) 0; font-size: 11.5px; color: var(--text-2); }
.perm-row label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.perm-row input { accent-color: var(--accent); }
.schema-editor { max-height: 320px; overflow-y: auto; }
.schema-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.schema-row .input, .schema-row .select { padding: 6px 8px; font-size: 12px; }
.schema-opts { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); }
.schema-opts label { flex: none; white-space: nowrap; }
.schema-opts .input { flex: 1; min-width: 0; }

.legacy-frame { width: 100%; height: 100%; min-height: 620px; border: none; display: block; background: var(--bg); }
.legacy-note { padding: var(--s3) var(--s4); font-size: 11.5px; color: var(--text-3); background: var(--surface-sunk); border-bottom: 1px solid var(--border); }

/* ---------------- 文本选择 ---------------- */
/* 无边框窗口里标题栏是 drag region，默认选区行为会被带偏：显式声明正文可选，
   保证用户消息与助手回复都能鼠标框选、Ctrl+C 复制（按钮/标签仍保持不可选，避免误拖）。 */
.view-body, .chat-scroll, .chat-msg, .chat-bubble, .preview-card,
.data-table td, .data-table th, .panel-body, .hint {
  -webkit-user-select: text; user-select: text;
}
.chat-bubble, .chat-bubble * { -webkit-user-select: text; user-select: text; }
.chat-bubble { cursor: text; }
/* 用户气泡底色与全局 ::selection 高亮同为 --accent-soft、文字也同为 --text，
   框选时完全看不出选中态（看起来像「用户消息不能复制」）。换成 accent / on-accent 强对比配色。 */
.chat-msg.is-user .chat-bubble::selection,
.chat-msg.is-user .chat-bubble *::selection {
  background: var(--accent); color: var(--on-accent);
}
/* 变更预览卡里的说明/字段文字也要能复制；只把真正的按钮保留为不可选 */
.chat-bubble .tag, .chat-bubble .btn, .chat-bubble button { -webkit-user-select: none; user-select: none; }

/* ---------------- 流式输出 ---------------- */
.chat-bubble { position: relative; }
.chat-stream-text { white-space: pre-wrap; word-break: break-word; }
.chat-bubble.is-streaming .chat-stream-text::after {
  content: ''; display: inline-block; width: 6px; height: 13px; margin-left: 3px;
  vertical-align: -2px; border-radius: 1px; background: var(--accent);
  animation: stream-caret 1s steps(2, start) infinite;
}
@keyframes stream-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---------------- 输入框粘贴图片 ---------------- */
.chat-image-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px 0; }
.chat-image-strip:empty { display: none; }
.chat-image-item { position: relative; width: 72px; height: 72px; flex: none; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-sunk); }
.chat-image-open { display: block; width: 100%; height: 100%; padding: 0; cursor: zoom-in; }
.chat-image-open:focus-visible { outline-offset: -3px; }
.chat-image-open img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-image-remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; line-height: 18px; }
.chat-image-btn { min-height: 28px; padding: 0 9px; font-size: 11px; }
.chat-image-preview { position: fixed; inset: 0; width: min(1040px, calc(100vw - var(--s5))); height: min(760px, calc(100dvh - var(--s5)));
  max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; color: var(--text); }
.chat-image-preview:not([open]) { display: none; }
.chat-image-preview::backdrop { background: oklch(20% 0.02 60 / .55); }
.chat-image-preview .modal-head { align-items: center; padding: var(--s3) var(--s4); }
.chat-image-preview .modal-head h2 { margin: 0; }
.chat-image-viewport { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--surface-sunk); }
.chat-image-viewport:focus-visible { outline-offset: -2px; }
.chat-image-stage { display: grid; place-items: center; width: max-content; min-width: 100%; height: max-content; min-height: 100%; }
.chat-image-stage img { display: block; max-width: none; max-height: none; user-select: none; }
.chat-image-viewport.is-pannable img { cursor: grab; }
.chat-image-viewport.is-panning, .chat-image-viewport.is-panning img { cursor: grabbing; }
.chat-image-controls { justify-content: center; flex-wrap: wrap; padding: var(--s3); }
.chat-image-controls output { min-width: 5ch; color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.chat-images { display: flex; flex-direction: column; gap: 6px; }
.chat-bubble img.chat-image { display: block; max-width: 100%; max-height: 260px; margin: 6px 0; border: 1px solid var(--border); border-radius: var(--r-sm); }

/* ---------------- 按状态分栏看板 ---------------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.board-col { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.board-col.is-overdue { border-color: var(--err); }
.board-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px var(--s3); border-bottom: 1px solid var(--border); background: var(--surface-sunk); }
.board-col-head b { font-size: 12.5px; }
.board-col-head .count { font-size: 11px; color: var(--text-3); }
.board-col.is-overdue .board-col-head b { color: var(--err); }
.board-col-body { display: flex; flex-direction: column; gap: 8px; min-height: 88px; max-height: 420px; overflow-y: auto; padding: var(--s2); }
.board-empty { padding: 14px 8px; text-align: center; font-size: 11.5px; color: var(--text-3); }
.board-card { padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); }
.board-card-title { font-size: 12.5px; font-weight: 650; color: var(--text); word-break: break-word; }
.board-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; font-size: 10.5px; color: var(--text-3); }
.board-card-meta .is-overdue { color: var(--err); font-weight: 650; }
.board-card-actions { display: flex; gap: 5px; margin-top: 8px; }
.board-card-actions .mini-btn { width: 26px; height: 26px; }

/* ---------------- 到点提醒弹窗 ---------------- */
.remind-list { display: flex; flex-direction: column; gap: 8px; }
.remind-row { padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-sm); background: var(--bg); }
.remind-row b { display: block; font-size: 13px; color: var(--text); }
.remind-row span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-3); }

/* ---------------- 模块宇宙 ---------------- */
.uni-wrap { display: flex; flex-direction: column; gap: var(--s4); }
.uni-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); flex-wrap: wrap; }
.uni-scope { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.uni-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.uni-attention { padding: var(--s3) var(--s4); border-left: 3px solid var(--accent); }
.uni-att-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.uni-att-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.uni-att-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); font-size: 11.5px; }
.uni-att-row.is-err { border-color: var(--err); color: var(--err); }
.uni-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s4); }
.uni-grid > .panel { display: flex; flex-direction: column; min-width: 0; }
.uni-grid > .panel + .panel { margin-top: 0; }
.uni-catalog > .panel-body { display: flex; flex: 1; flex-direction: column; }
.uni-table { table-layout: fixed; min-width: 328px; }
.uni-table th, .uni-table td { padding-inline: var(--s3); }
.uni-table col.c-kind { width: 64px; }
.uni-table col.c-status { width: 88px; }
.uni-table col.c-act { width: 92px; }
.uni-table .uni-name { display: block; max-width: 100%; color: var(--text); padding: 0; font-weight: 650;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uni-table .uni-name:hover { color: var(--accent); text-decoration: underline; }
.uni-table .uni-desc { margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uni-table .row-actions { flex-wrap: nowrap; }
.uni-table .mini-btn { flex: none; }
.uni-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s2); margin-top: auto; padding-top: var(--s3); }
.uni-pagination[hidden] { display: none; }
.uni-page-buttons { display: flex; align-items: center; gap: var(--s2); }
.uni-page-buttons .btn { padding-inline: var(--s2); }
.uni-page-buttons .hint { white-space: nowrap; font-variant-numeric: tabular-nums; }
.uni-graph-legend { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s3); color: var(--text-2); font-size: 12px; }
.uni-graph-legend span { display: inline-flex; align-items: center; gap: var(--s2); }
.uni-graph-legend i { display: inline-block; width: var(--s4); border-top: 2px solid var(--text-3); }
.uni-graph-legend i.dashed { border-top-style: dashed; }
.uni-graph-stage { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-sunk); }
.uni-graph-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.uni-graph-scroll { position: relative; max-height: min(34rem, 58vh); overflow: auto; }
.uni-graph-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr)); align-items: start;
  gap: var(--s4); padding: var(--s3); }
.uni-graph-group { display: grid; gap: var(--s1); min-width: 0; }
.uni-graph-group h3 { margin: 0 0 var(--s1); color: var(--text-2); font-size: 11px; }
.uni-graph-node { min-width: 0; min-height: 32px; overflow: hidden; padding: var(--s1) var(--s2);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--panel); color: var(--text);
  font-size: 12px; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.uni-graph-node.is-deleted { color: var(--text-3); text-decoration: line-through; }
.uni-graph-node:hover, .uni-graph-node[aria-pressed="true"] { border-color: var(--accent); }
.uni-graph-node[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.uni-graph-detail { padding-top: var(--s3); color: var(--text-2); font-size: 12px; }
.uni-graph-detail strong { display: block; overflow-wrap: anywhere; color: var(--text); }
.uni-graph-detail ul { display: grid; gap: var(--s1); max-height: 8rem; overflow: auto; margin: var(--s1) 0 0; padding: 0; list-style: none; }
.uni-graph-detail li { display: flex; align-items: baseline; gap: var(--s2); }
.uni-graph-detail li span { flex: none; color: var(--text-3); }
.uni-graph-detail button { padding: 2px 0; color: var(--accent); text-align: left; overflow-wrap: anywhere; }
.uni-graph-detail button:hover { text-decoration: underline; }
.uni-graph-detail p { margin: var(--s1) 0 0; }
.uni-timeline { display: flex; flex-direction: column; gap: 5px; max-height: 320px; overflow-y: auto; }
.uni-event { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.uni-event.undo { background: var(--surface-sunk); }
.uni-event.stable { background: var(--accent-soft); }
@media (max-width: 1080px) { .uni-grid { grid-template-columns: 1fr; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .brand-sub { display: none; }
  .brand { min-width: 150px; }
  .view-body { padding-inline: var(--s4); }
  .workspace-head { padding-inline: var(--s4); }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding-inline: var(--s2); }
  .side-head .eyebrow, .side-count, .mod-name, .mod-badge, .side-bottom, .side-rule { display: none; }
  .mod-item { justify-content: center; padding: 0; min-height: 44px; }
  .mod-item.is-home .mod-name::after { display: none; }
  #moduleNav { gap: 6px; }
}
@media (max-width: 768px) {
  html, body { overflow: hidden; }
  .app { grid-template-rows: 52px minmax(0, 1fr); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .titlebar { padding-inline: var(--s3); gap: var(--s2); }
  .sync-chip { display: none; }
  .workspace-head { flex-direction: column; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); }
  .head-actions { justify-content: flex-start; width: 100%; }
  .view-body { padding: var(--s3) var(--s3) calc(78px + env(safe-area-inset-bottom)); }
  .view-body.flush { padding: 0 0 calc(78px + env(safe-area-inset-bottom)); }
  .btn { min-height: 44px; padding-inline: 16px; font-size: 13px; }
  .input, .textarea, .select, .chat-compose textarea { font-size: 16px; }
  .filter-bar .input, .filter-bar .select { font-size: 16px; }
  .mini-btn { width: 44px; height: 44px; }
  .template-btn, .tag-picker button, .chat-chips button { min-height: 44px; }
  .card-grid, .mgr-grid, .chart-grid { grid-template-columns: 1fr; }
  .mobile-tabs { display: flex; gap: 4px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 6px var(--s2) calc(6px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--border); overflow-x: auto; }
  .mobile-tabs button { flex: 1 0 auto; min-height: 44px; min-width: 64px; padding: 4px 8px; border-radius: var(--r-md); font-size: 11px; color: var(--text-3); white-space: nowrap; }
  .mobile-tabs button.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
  .data-table th, .data-table td { padding: 10px 8px; }
  .chat-bubble { max-width: 90%; }
  .compose-bar { flex-wrap: wrap; }
  .compose-metrics { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
