/* ==================== css/ui-agency-sheet.css ====================
   中介「代孕妈妈」页(Tab 146,js/ui-agency-sheet*.js)。只用 .asg- 前缀的类,颜色 / 圆角 / 阴影走 style.css 的设计令牌
   (--surface / --border / --ink / --info-* / --warning-* …);全站只有亮色,这里也只有亮色。选项的 10 种颜色是这一页自己的令牌(--asg-o-*)。
   强调色(10-19 对齐系统):主按钮 / 选中的分段 = 墨色 --ink;聚焦 / 选中 / 今天 = 暖橙 --asg-accent*(下面 :root,其他段也用这几个);
   不用系统的靛蓝品牌色 —— 只有 :focus-visible 的焦点框沿用系统默认。
   页面骨架(10-19,规格 AGENCY-SURROGATE-SHEET-UI-POLISH-2026-10-19.md §一 / §五):#agencySheetBody > [.table-toolbar.asg-tb, .asg-main | .asg-sub-main];
   #contentArea 的内边距由 js 量出来写进 --asg-pad-t/r/b/l(工具条的负外边距、下面那块的高度都按它算)。
   编辑型表格(不进统一表格族,见 js/ui-agency-sheet.js 文件头):44px 行、表头吸顶、表宽跟着容器;横滚时标题列吸左、操作列吸右(10-19 起没有行号列)。
   #contentArea 对 table / td 有全局样式(内边距、末格 flex、表 overflow:hidden 会弄坏吸顶)—— 下面 §表格 用更高的特异度盖掉。
   浮层(弹出菜单 / 确认框 / 侧拉面板 / 向导 / 提示条)挂在 <body> 上,z-index 由 JS 取 getTopModalZ()。 */

:root {
    --asg-o-gray-bg: #eef0f4; --asg-o-gray-fg: #4b5268; --asg-o-gray-row: #f6f7f9;
    --asg-o-red-bg: #fde4e4; --asg-o-red-fg: #b42318; --asg-o-red-row: #fff5f5;
    --asg-o-orange-bg: #ffe9d2; --asg-o-orange-fg: #c2410c; --asg-o-orange-row: #fff7ee;
    --asg-o-amber-bg: #fdf0c4; --asg-o-amber-fg: #946200; --asg-o-amber-row: #fffbea;
    --asg-o-green-bg: #d9f7e3; --asg-o-green-fg: #15803d; --asg-o-green-row: #f1fbf4;
    --asg-o-teal-bg: #cdf7ee; --asg-o-teal-fg: #0f766e; --asg-o-teal-row: #effbf8;
    --asg-o-blue-bg: #dce9fe; --asg-o-blue-fg: #1d4ed8; --asg-o-blue-row: #f2f7ff;
    --asg-o-indigo-bg: #e2e6ff; --asg-o-indigo-fg: #4338ca; --asg-o-indigo-row: #f4f5ff;
    --asg-o-purple-bg: #f1e6ff; --asg-o-purple-fg: #7e22ce; --asg-o-purple-row: #faf5ff;
    --asg-o-pink-bg: #fce4f1; --asg-o-pink-fg: #be185d; --asg-o-pink-row: #fdf4f9;
    --asg-bad-cell: #fff0f0; --asg-bad-text: #b42318;
    --asg-overlay: rgba(15, 23, 42, 0.36);
    /* 本页强调色(暖橙,同中介 elab v4 抽屉 / 仓库选中行):聚焦框 #ea580c + 3px #ffedd5 光圈;选中底 #fff7ed;今天 #ea580c / #c2410c */
    --asg-accent: #ea580c; --asg-accent-hover: #c2410c; --asg-accent-bg: #fff7ed; --asg-accent-border: #fed7aa; --asg-accent-ring: #ffedd5;
}

/* ── 页面外壳(加载中 / 拦截卡 / 同意卡 / 起步页 = 一个 .asg-root;工作台和子页见下面「工作台」「子页」两段)
   高度 = 视口 − 顶栏 − #contentArea 上下内边距(js 量的 --asg-pad-*),底下不留死带 */
#agencySheetBody { --asg-pad-t: 24px; --asg-pad-r: 28px; --asg-pad-b: 24px; --asg-pad-l: 28px;
    font-family: var(--font-sans); font-size: 13px; line-height: 1.45; color: var(--ink); }
.asg-root { display: flex; flex-direction: column; min-height: 420px; height: calc(100vh - var(--topbar-h, 56px) - var(--asg-pad-t, 24px) - var(--asg-pad-b, 24px)); }
#agencySheetBody *, .asg-pop *, .asg-sheet *, .asg-drawer *, .asg-dlg * { box-sizing: border-box; }
.asg-ic { flex: none; display: block; }
.asg-num { font-variant-numeric: tabular-nums; }
.asg-muted { color: var(--ink-muted); }
.asg-small { font-size: 12px; }
.asg-grow { flex: 1; min-width: 0; }
.asg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.asg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.asg-err { color: var(--danger-text); font-size: 12px; min-height: 16px; }
.asg-h3 { font-size: 13px; font-weight: 650; margin: 4px 0 0; }
.asg-link { border: 0; background: none; padding: 0 2px; color: var(--ink-secondary); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--ink-faint); }
.asg-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.asg-link.bad { color: var(--danger-text); }
.asg-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--ink-muted); }
.asg-empty b { color: var(--ink); font-size: 14px; }
.asg-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--asg-accent); animation: asg-spin .8s linear infinite; flex: none; }
.asg-spin.inline { display: inline-block; vertical-align: -2px; margin-right: 8px; }
@keyframes asg-spin { to { transform: rotate(360deg); } }

/* ── 小件:按钮、输入、药丸、标签(10-19 A2:去掉靛蓝 —— 选中 / 开关 / 勾选 = 墨色,聚焦 / 今天 / 进度 = 暖橙;药丸 = .tbl-pill 几何 + --cat-* 色族) */
.asg-ibtn { position: relative; width: 30px; height: 30px; border-radius: var(--radius-xs); border: 1px solid transparent; background: none; color: var(--ink-secondary); display: inline-grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.asg-ibtn:hover { background: var(--surface-muted); color: var(--ink); }
.asg-ibtn.on { background: var(--surface-muted); color: var(--ink); }
.asg-ibtn[disabled] { opacity: .45; cursor: not-allowed; }
.asg-cnt { position: absolute; top: -4px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger-accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.asg-inp { height: 30px; padding: 0 9px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; min-width: 0; }
.asg-inp:focus { outline: none; border-color: var(--asg-accent); box-shadow: 0 0 0 3px var(--asg-accent-ring); }
textarea.asg-inp { height: auto; padding: 6px 9px; line-height: 1.45; resize: vertical; width: 100%; }
.asg-inp.bad { background: var(--asg-bad-cell); color: var(--asg-bad-text); border-color: var(--danger-border); }
.asg-inp.sm { height: 28px; font-size: 12px; }
.asg-ck { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.asg-ck input, .asg-root input[type=checkbox] { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }
.asg-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-xs); overflow: hidden; flex: none; }
.asg-seg button { height: 28px; padding: 0 10px; border: 0; border-right: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 12px; color: var(--ink-secondary); }
.asg-seg button:last-child { border-right: 0; }
.asg-seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.asg-switch { position: relative; width: 30px; height: 18px; border-radius: 9px; border: 0; background: var(--ink-faint); cursor: pointer; flex: none; padding: 0; }
.asg-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.asg-switch[aria-checked=true] { background: var(--ink); }
.asg-switch[aria-checked=true]::after { transform: translateX(12px); }
.asg-pill { display: inline-block; font-size: 10px; font-weight: 600; line-height: 15px; padding: 2px 8px; border-radius: 9999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; flex: none; box-sizing: border-box; }
.asg-pill.sm { font-size: 9.5px; line-height: 14px; padding: 1px 6px; }
/* 用户选的 10 种颜色:药丸(--pc-*)映射到系统 --cat-* 色族(§二 9:gray→slate、red/pink→red、orange→#fff7ed/#c2410c、amber→yellow、green/teal→green、
   blue/indigo→blue、purple→purple;slate 用 Tab147「成员」药丸那一档 --surface-muted / --cat-slate-accent,--cat-slate-bg 在白底上看不出来);
   着色规则的格子 / 整行涂底(--cc-*)照旧是这一页自己的 10 种(格子着色不变,整行涂底用更浅的 --cc-row) */
[data-c=gray] { --pc-bg: var(--surface-muted); --pc-fg: var(--cat-slate-accent); --cc-bg: var(--asg-o-gray-bg); --cc-fg: var(--asg-o-gray-fg); --cc-row: var(--asg-o-gray-row); }
[data-c=red] { --pc-bg: var(--cat-red-bg); --pc-fg: var(--cat-red-text); --cc-bg: var(--asg-o-red-bg); --cc-fg: var(--asg-o-red-fg); --cc-row: var(--asg-o-red-row); }
[data-c=orange] { --pc-bg: #fff7ed; --pc-fg: #c2410c; --cc-bg: var(--asg-o-orange-bg); --cc-fg: var(--asg-o-orange-fg); --cc-row: var(--asg-o-orange-row); }
[data-c=amber] { --pc-bg: var(--cat-yellow-bg); --pc-fg: var(--cat-yellow-text); --cc-bg: var(--asg-o-amber-bg); --cc-fg: var(--asg-o-amber-fg); --cc-row: var(--asg-o-amber-row); }
[data-c=green] { --pc-bg: var(--cat-green-bg); --pc-fg: var(--cat-green-text); --cc-bg: var(--asg-o-green-bg); --cc-fg: var(--asg-o-green-fg); --cc-row: var(--asg-o-green-row); }
[data-c=teal] { --pc-bg: var(--cat-green-bg); --pc-fg: var(--cat-green-text); --cc-bg: var(--asg-o-teal-bg); --cc-fg: var(--asg-o-teal-fg); --cc-row: var(--asg-o-teal-row); }
[data-c=blue] { --pc-bg: var(--cat-blue-bg); --pc-fg: var(--cat-blue-text); --cc-bg: var(--asg-o-blue-bg); --cc-fg: var(--asg-o-blue-fg); --cc-row: var(--asg-o-blue-row); }
[data-c=indigo] { --pc-bg: var(--cat-blue-bg); --pc-fg: var(--cat-blue-text); --cc-bg: var(--asg-o-indigo-bg); --cc-fg: var(--asg-o-indigo-fg); --cc-row: var(--asg-o-indigo-row); }
[data-c=purple] { --pc-bg: var(--cat-purple-bg); --pc-fg: var(--cat-purple-text); --cc-bg: var(--asg-o-purple-bg); --cc-fg: var(--asg-o-purple-fg); --cc-row: var(--asg-o-purple-row); }
[data-c=pink] { --pc-bg: var(--cat-red-bg); --pc-fg: var(--cat-red-text); --cc-bg: var(--asg-o-pink-bg); --cc-fg: var(--asg-o-pink-fg); --cc-row: var(--asg-o-pink-row); }
.asg-pill[data-c], .asg-sw[data-c] { background: var(--pc-bg); color: var(--pc-fg); }
.asg-sw.cell[data-c] { background: var(--cc-bg); color: var(--cc-fg); }
.asg-sw { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; padding: 0; flex: none; }
.asg-sw.static { cursor: default; }
.asg-sw[aria-pressed=true] { outline: 2px solid var(--ink); outline-offset: 1px; }
.asg-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; background: var(--surface-muted); color: var(--ink-muted); white-space: nowrap; flex: none; }
.asg-tag.vita { background: var(--asg-o-teal-bg); color: var(--asg-o-teal-fg); }
.asg-tag.home { background: var(--asg-accent-bg); color: var(--asg-accent-hover); }
.asg-tag.hi { background: var(--success-bg); color: var(--success-text); }
.asg-tag.mid { background: var(--warning-bg); color: var(--warning-text); }
.asg-tag.lo { background: var(--danger-bg); color: var(--danger-text); }
.asg-tag.fu { background: var(--asg-accent-bg); color: var(--asg-accent-hover); }
.asg-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-faint); }
.asg-dot.over { background: var(--danger-accent); }
.asg-dot.today { background: var(--asg-accent); }
.asg-doc { display: inline-grid; place-items: center; width: 28px; height: 22px; border-radius: 6px; border: 0; padding: 0; font-weight: 700; font-size: 12px; cursor: pointer; background: transparent; color: var(--ink-faint); box-shadow: inset 0 0 0 1px var(--border); }
.asg-doc.y { background: var(--asg-o-green-bg); color: var(--asg-o-green-fg); box-shadow: none; }
.asg-doc.n { background: var(--asg-o-red-bg); color: var(--asg-o-red-fg); box-shadow: none; }
.asg-doc.na { background: var(--asg-o-gray-bg); color: var(--asg-o-gray-fg); box-shadow: none; }
.asg-cbx { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--ink-faint); background: var(--surface); color: #fff; cursor: pointer; padding: 0; flex: none; }
.asg-cbx.on { background: var(--ink); border-color: var(--ink); }
.asg-prog { display: flex; align-items: center; gap: 8px; min-width: 0; }
.asg-prog .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-muted); overflow: hidden; min-width: 30px; }
.asg-prog .bar i { display: block; height: 100%; background: var(--asg-accent); border-radius: 3px; }
.asg-prog.full .bar i { background: var(--success-accent); }
.asg-prog .n { font-size: 11.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.asg-ph { color: var(--ink-faint); }
.asg-owner { font-weight: 400; }
.asg-owner.me { color: var(--ink); font-weight: 600; }
.asg-owner.raw { font-style: italic; color: var(--ink-muted); }
.asg-dd { display: inline-block; min-width: 140px; max-width: 260px; vertical-align: middle; }
.asg-bar-dd { min-width: 150px; }
.asg-dd .ui-dd-trigger { min-height: 30px; }

/* ── 横幅(工具条和表格之间,同 HR 10-17;语义令牌 --info-* / --warning-*)、开始页、同意卡 */
.asg-banner { flex: none; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 8px 5px 12px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.45; margin-bottom: 8px; }
.asg-banner span { flex: 1; min-width: 0; }
.asg-banner.warn { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.asg-banner.info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }
.asg-start { overflow: auto; padding: 8px 4px 32px; display: flex; flex-direction: column; gap: 16px; max-width: 880px; }
.asg-lead { color: var(--ink-secondary); max-width: 72ch; margin: 0; }
.asg-start-points { margin: 0; padding-left: 20px; color: var(--ink-secondary); display: grid; gap: 4px; }
.asg-start-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 220px; padding: 28px 20px; text-align: center;
    border-radius: var(--radius-md); border: 1.5px dashed var(--border); background: var(--surface-dim); color: var(--ink-muted); cursor: pointer; }
.asg-start-drop b { color: var(--ink); font-size: 15px; font-weight: 600; }
.asg-start-drop .asg-ic { color: var(--asg-accent); }
.asg-start-drop:hover { border-color: var(--asg-accent-border); }
.asg-start-drop:focus-visible { border-color: var(--asg-accent); outline: none; box-shadow: 0 0 0 3px var(--asg-accent-ring); }
.asg-start-drop.over { border-color: var(--asg-accent); background: var(--asg-accent-bg); }
.asg-start-alt { margin: 0; font-size: 12.5px; color: var(--ink-muted); }
.asg-blocked { max-width: 56ch; margin: 0 auto; }
.asg-blocked .asg-ic { color: var(--ink-faint); }
.asg-blocked b { font-weight: 500; line-height: 1.5; }
.asg-consent { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); max-width: 74ch; }
.asg-consent h2 { font-size: 15px; font-weight: 650; margin: 0; }
.asg-consent ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ── 工作台(§一):工具条 = #agencySheetBody 的第一个子元素,族规 .table-toolbar(白底 52 高、吸顶 top:56、下边框),
   负外边距 = #contentArea 的内边距(贴着顶栏、满宽,y=56–108);下面 .asg-main 从 y≈120 起,高度铺到视口底。从左到右的顺序见 js/ui-agency-sheet.js 文件头。
   窄了按本页自己的档收(js fitToolbar 在工具条上加 .asg-fit1…7,一档包含前一档),收完还放不下本页自己折两行(.asg-wrap,高度写进 --asg-tb-h)。
   不用 table-builder tbFit 的 .tb-tight / .tb-wrap(它按容器记档只升不降;js vetoTbFit 摘掉)。分段、页码和「新增」任何时候都不缩。 */
#agencySheetBody > .table-toolbar.asg-tb { margin: calc(-1 * var(--asg-pad-t, 24px)) calc(-1 * var(--asg-pad-r, 28px)) 12px calc(-1 * var(--asg-pad-l, 28px));
    min-width: 0; font-size: 13px; line-height: 1.4; }
/* 视图分段 = 仓库 _whSegHtml 同款(js/ui-warehouse.js):12px/600、6px 10px、圆角 6;选中 = 墨色底白字;数字 tabular。长 / 短两种名字(收档 2 起短的) */
.asg-vseg { display: inline-flex; gap: 4px; flex-shrink: 0; }
.asg-vseg > button { padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-secondary);
    font: 600 12px/17px var(--font-sans); cursor: pointer; white-space: nowrap; }
.asg-vseg > button:hover { background: var(--surface-muted); color: var(--ink); }
.asg-vseg > button[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.asg-vseg-n { margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.asg-vseg-n.zero { color: var(--ink-faint); }
.asg-vseg > button[aria-selected=true] .asg-vseg-n { color: rgba(255, 255, 255, .72); }
.asg-vseg-s, .asg-dd-s, .asg-cnt-s { display: none; }
/* 搜索框放不下先缩(flex-basis = 本来的 220,下限 180 → 收档 1 起 150 → 档 2 起 120 → 档 7 起 96;占位字省略号);三个下拉按字定宽,到档 7 才缩(下限 88,省略号) */
.asg-tb > .toolbar-search { flex: 0 1 220px; min-width: 180px; }
.asg-tb > .toolbar-search input { text-overflow: ellipsis; }
.asg-tb > .toolbar-count { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.asg-tb > .toolbar-separator { min-width: 0; }
.asg-tb > .asg-dd { flex: 0 0 auto; width: auto; min-width: 0; max-width: 220px; }
.asg-tb > .asg-dd .ui-dd { width: 100%; }
.asg-tb > .btn, .asg-tb > .btn-action, .asg-tb > .btn-new, .asg-tb > .toolbar-pager { flex-shrink: 0; }
/* 批量改派 / 清除筛选(筛过才出现):幽灵键带图标;收档 4 起只剩图标 */
.asg-tb-ghost { gap: 5px; }
/* 右端一组(状态槽 → 撤销 → 导入 / 日程 / 设置 → 更多 → 新增)是一个盒子:折两行时整组一起走(.asg-row2 = margin-left:auto,第二行靠右) */
.asg-tb > .asg-tb-end { display: flex; align-items: center; gap: inherit; flex-shrink: 0; }
.asg-tb-end > * { flex-shrink: 0; }
/* 每页条数(uiDropdown,外观照 .toolbar-pager .toolbar-select:34 高、灰底、无框、圆角 10) */
.asg-tb .toolbar-pager { margin-right: 0; }
.asg-pgsize { display: inline-block; width: 60px; min-width: 0; max-width: none; flex: none; }
.asg-pgsize .ui-dd-trigger { height: 34px; padding: 0 8px; gap: 4px; border-color: transparent; background: var(--surface-muted); color: var(--ink-secondary); font-size: 13px; }
.asg-pgsize .ui-dd-trigger:hover { border-color: var(--border); }
.asg-tb .pager-info { white-space: nowrap; }
/* 状态槽:定宽 72,平时空着但占位(字变,框不变;同 HR 账号工作室 .hs-tb-status)。只放一句短话(保存中… / 3 处未存 / 已暂停 · 1 / 2 行冲突),
   整句在 title 里;放不下的字省略号 */
.asg-tb-status { flex: none; width: 72px; height: 18px; display: inline-flex; align-items: center; justify-content: flex-end; overflow: hidden;
    font-size: 12px; line-height: 18px; color: var(--ink-muted); white-space: nowrap; }
.asg-tb-status > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-tb-status.bad { color: var(--danger-text); }
.asg-tb-status .asg-link { font-size: 12px; }
/* 次要按钮(导入 / 日程 N / 设置):带字的 btn--secondary btn--sm(放得下时只有字);收档后只剩图标(aria-label / title 是全名);
   日程开着 = 白底墨字(不用靛蓝);N = 暖橙小数字 */
.asg-tb-btn { gap: 6px; }
.asg-tb-btn > .asg-ic { display: none; flex: none; }
.asg-tb-ghost > .asg-ic { display: block; }
.asg-tb-btn[aria-pressed=true] { background: var(--surface); border-color: var(--ink-faint); color: var(--ink); }
.asg-tb-n { color: var(--asg-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.asg-tb .btn-action.btn-edit[disabled] { opacity: .4; }
/* 收档 1:筛选下拉没筛时只写维度名(「负责人」);没筛选时不显示计数(分段上已经有数);搜索下限 150 */
.asg-tb.asg-fit1 .asg-dd-l { display: none; }
.asg-tb.asg-fit1 .asg-dd-s { display: inline; }
.asg-tb.asg-fit1 > .toolbar-count.is-plain { display: none; }
.asg-tb.asg-fit1 > .toolbar-search { min-width: 150px; }
/* 收档 2:长名字的分段换短名(今天要跟进 → 今天 …;title 是全名)、搜索下限 120、间距 10 → 8 */
.asg-tb.asg-fit2 { gap: 8px; }
.asg-tb.asg-fit2 .asg-vseg-l:has(+ .asg-vseg-s) { display: none; }
.asg-tb.asg-fit2 .asg-vseg-s { display: inline; }
.asg-tb.asg-fit2 > .toolbar-search { min-width: 120px; }
/* 收档 3:日程 / 设置只剩图标 */
.asg-tb.asg-fit3 :is(#tb-rem, #tb-settings) { padding-left: 9px; padding-right: 9px; }
.asg-tb.asg-fit3 :is(#tb-rem, #tb-settings) > .asg-ic { display: block; }
.asg-tb.asg-fit3 :is(#tb-rem, #tb-settings) > .asg-tb-lbl { display: none; }
/* 收档 4:导入 / 批量改派 / 清除筛选也只剩图标;筛过时的计数只写「n / 总数」 */
.asg-tb.asg-fit4 .asg-cnt-l:has(+ .asg-cnt-s) { display: none; }
.asg-tb.asg-fit4 .asg-cnt-s { display: inline; }
.asg-tb.asg-fit4 :is(#tb-import, #tb-bulk, #bar-clear) { padding-left: 9px; padding-right: 9px; }
.asg-tb.asg-fit4 #tb-import > .asg-ic { display: block; }
.asg-tb.asg-fit4 :is(#tb-import, #tb-bulk, #bar-clear) > .asg-tb-lbl { display: none; }
/* 收档 5:分段收紧(同 Tab 41 窄档 6px 7px);间距 6 */
.asg-tb.asg-fit5 { gap: 6px; }
.asg-tb.asg-fit5 .asg-vseg > button { padding-left: 7px; padding-right: 7px; }
.asg-tb.asg-fit5 .asg-vseg-n { margin-left: 4px; }
/* 收档 6:每页条数让出来(「更多」菜单里补「每页 25 / 50 条」);页码「1 / N」和翻页键一直在 */
.asg-tb.asg-fit6:not(.asg-wrap) .asg-pgsize { display: none; }
/* 收档 7:三个下拉也可以缩(下限 88、本来就比 88 窄的不撑大 —— --asg-dd-nat 是 js 量的本来宽度;字省略号,悬停 title 是全句)、搜索下限 96、
   状态槽 72 → 60(放不下的字省略号,整句在 title 里)、两根分隔线不占位(这时已经没有空可分) */
.asg-tb.asg-fit7 > .asg-dd { flex-shrink: 1; min-width: min(88px, var(--asg-dd-nat, 88px)); }
.asg-tb.asg-fit7 > .toolbar-search { min-width: 96px; }
.asg-tb.asg-fit7 .asg-tb-status { width: 60px; }
.asg-tb.asg-fit7:not(.asg-wrap) > .toolbar-separator { display: none; }
/* 折两行(本页自己折,js fitToolbar / wrapToolbar;子页的工具条也用):同族规 .tb-wrap 的样子 —— 第二行整组靠右,第一行行尾的分隔竖线不悬空 */
#contentArea #agencySheetBody > .table-toolbar.asg-wrap { height: auto; min-height: 52px; flex-wrap: wrap; row-gap: 6px; padding-top: 8px; padding-bottom: 8px; }
#contentArea #agencySheetBody > .table-toolbar.asg-wrap > .asg-row2 { margin-left: auto; }
#contentArea #agencySheetBody > .table-toolbar.asg-wrap > .toolbar-separator:has(+ .asg-row2) { visibility: hidden; }
/* 工作台折两行时在翻页前面断开:第一行 = 分段 / 搜索 / 计数 / 筛选,第二行 = 翻页 + 右端那一组(靠右)。断行的那根分隔线占满一行、零高
   (它自己算一行,上下各一个行距 → 行距 3,合起来还是 6,高度同 .tb-wrap 的两行 = 90) */
#contentArea #agencySheetBody > #asgToolbar.asg-wrap { row-gap: 3px; }
/* 折了以后第一行的分隔线不再当弹簧(族规 .toolbar-separator 是 flex:1):筛选下拉跟着搜索框靠左,不被推到行尾 */
#contentArea #agencySheetBody > #asgToolbar.asg-wrap > .toolbar-separator:not(.asg-tb-brk) { flex: 0 0 0; }
#contentArea #agencySheetBody > .table-toolbar.asg-wrap > .asg-tb-brk { flex-basis: 100%; height: 0; margin: 0; visibility: hidden; }
/* 工具条下面那块:横幅 → 筛选标签 → 两栏;外框不出滚动条,各栏自己滚 */
#agencySheetBody > .asg-main { display: flex; flex-direction: column; min-height: 360px;
    height: calc(100vh - var(--topbar-h, 56px) - var(--asg-tb-h, 52px) - 12px - var(--asg-pad-b, 24px)); }
.asg-fchips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
.asg-fchips .toolbar-chip { max-width: 100%; }
.asg-fchips .toolbar-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-wsg { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.asg-wsg.has-side { grid-template-columns: minmax(0, 1fr) auto; }
/* 栏 = 白卡片(圆角 12 + shadow-sm,同族表外框) */
.asg-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
/* 导入 / 设置助手里还在用的圆角开关按钮(选中 = 暖橙浅底;只换颜色不换字重) */
.asg-chipbtn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-secondary); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.asg-chipbtn.on { background: var(--asg-accent-bg); color: var(--asg-accent-hover); border-color: var(--asg-accent-border); }

/* ── 表格(编辑型;不进统一表格族)。特异度压过 #contentArea table / td 的全局规则 */
/*   10-19 起表格的规则都在文件末尾「A2 grid & drawer」段(表宽跟着容器、钉住标题列 / 操作列、族规表头、只有横线、暖橙选中)。 */

/* ── 日程(§一 3):右栏白卡片 340 宽(窗口 <1500 时 320),44px 头「日程 · N 条要办」+ ×;下面一行两个 xs 墨色分段;每条压成一行
   (名字 · 原因 · ✓ · 推迟 ▾ · 打开)。< 1100px 是浮层(.is-float,z-index js 打开时取一次) */
.asg-ag-pane { width: 340px; }
@media (max-width: 1499.98px) { .asg-ag-pane { width: 320px; } }
.asg-ag-pane.is-float { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100%); border-radius: 0; border-width: 0 0 0 1px; box-shadow: var(--shadow-float); }
.asg-pane-h { flex: none; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); }
.asg-pane-h h3 { margin: 0; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asg-pane-h h3 .n { color: var(--ink-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.asg-pane-ctl { flex: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--border-subtle); }
/* xs 墨色分段(同 HR 账号工作室 .hs-seg--xs:4px 8px、11.5px/600;选中只换底色和字色) */
.asg-xseg { display: inline-flex; gap: 2px; flex-shrink: 0; }
.asg-xseg > button { padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-secondary); font: 600 11.5px/15px var(--font-sans); cursor: pointer; white-space: nowrap; }
.asg-xseg > button:hover { background: var(--surface-muted); color: var(--ink); }
.asg-xseg > button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
/* 天数:紧凑的「14 天 ▾」(同 xs 分段的字号;点开 uiMenu 7 / 14 / 30)。范围分段 + 它在 320 / 340 宽里四语都是一行(40 高) */
.asg-xbtn { display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 4px 6px 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
    color: var(--ink-secondary); font: 600 11.5px/15px var(--font-sans); cursor: pointer; white-space: nowrap; }
.asg-xbtn:hover { background: var(--surface-muted); color: var(--ink); }
.asg-ag-pane .asg-pane-ctl { flex-wrap: nowrap; }
.asg-ag-pane .asg-xseg { min-width: 0; }
@media (max-width: 1499.98px) {
    .asg-ag-pane .asg-pane-ctl { gap: 4px; padding: 7px 10px; }
    .asg-ag-pane .asg-xseg > button { padding: 4px 6px; }
}
.asg-agenda { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.asg-ag-sec h3 { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--ink-secondary); }
.asg-ag-sec h3 .n { font-variant-numeric: tabular-nums; color: var(--ink-muted); font-weight: 500; }
.asg-ag-sec.over h3 { color: var(--danger-text); }
.asg-ag-sec p { margin: 0; }
.asg-ag-day { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--border-subtle); }
.asg-ag-day:first-of-type { border-top: 0; }
.asg-ag-date { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; padding-top: 8px; }
.asg-ag-date b { display: block; color: var(--ink); font-size: 13px; }
.asg-ag-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.asg-ag-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 10px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.asg-ag-item .what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.asg-ag-item .what b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-ag-item .what small { color: var(--ink-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-ag-item .acts { display: flex; gap: 2px; flex: none; align-items: center; }
.asg-ag-item.date { background: var(--surface-dim); color: var(--ink-muted); border-style: dashed; }
.asg-ag-item.over { border-color: var(--danger-border); box-shadow: inset 3px 0 0 var(--danger-accent); }
.asg-ag-foot { font-size: 12px; color: var(--ink-muted); margin: 0; }
/* 右栏里(.narrow):日期一行在上、条目一行一条 —— 名字 · 原因(一行,省略号)· ✓ · 推迟 ▾ · 打开 */
.asg-agenda.narrow { padding: 10px 12px 14px; gap: 14px; }
.asg-agenda.narrow .asg-ag-day { grid-template-columns: 1fr; gap: 4px; }
.asg-agenda.narrow .asg-ag-date { padding-top: 2px; }
.asg-agenda.narrow .asg-ag-date b { display: inline; margin-right: 6px; }
.asg-agenda.narrow .asg-ag-list { gap: 4px; }
.asg-agenda.narrow .asg-ag-item { gap: 4px; min-height: 36px; padding: 3px 3px 3px 10px; }
.asg-agenda.narrow .asg-ag-item .asg-tag.kind { display: none; }
.asg-agenda.narrow .asg-ag-item > .asg-ic { display: none; }
.asg-agenda.narrow .asg-ag-item .what { flex-direction: row; align-items: baseline; gap: 0; }
.asg-agenda.narrow .asg-ag-item .what b { flex: 0 1 auto; min-width: 0; font-size: 12.5px; }
.asg-agenda.narrow .asg-ag-item .what small { flex: 1 1 0; min-width: 24px; }
.asg-agenda.narrow .asg-ag-item .what small::before { content: '·'; padding: 0 5px; color: var(--ink-faint); }
.asg-agenda.narrow .asg-ag-item .acts .btn--sm { padding: 4px 6px; min-height: 26px; gap: 2px; }
.asg-agenda.narrow .asg-ag-item .acts .asg-ibtn { width: 26px; height: 26px; }

/* ── 浮层:遮罩 + 几个共用的小件(行详情抽屉 / 设置 / 历史子页 / 弹出菜单的规则 10-19 起在文件末尾「A2」段;确认框 = 系统 uiModal、提示 = 系统 showToast) */
.asg-scrim { position: fixed; inset: 0; background: var(--asg-overlay); }
/* 列表行(导入向导 / 抽屉里也用):一行一个白框 */
.asg-list { display: flex; flex-direction: column; gap: 6px; }
.asg-li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface); min-width: 0; font: inherit; color: inherit; }
.asg-li-btn { cursor: pointer; text-align: left; width: 100%; }
.asg-li .asg-grow small { display: block; color: var(--ink-muted); font-size: 11.5px; }
.asg-intro { color: var(--ink-muted); font-size: 12px; max-width: 72ch; margin: 0; }
.asg-formrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.asg-lbl { color: var(--ink-secondary); font-size: 12px; min-width: 72px; }
/* 确认框 / 小窗的正文(系统 uiModal 的 .ds-modal-body 里;js U.dialog / U.confirm)+ 快捷键说明 */
.asg-dlg { display: flex; flex-direction: column; gap: 10px; }
.asg-dlg p, .asg-dlg ul, .asg-dlg ol { margin: 0; }
.asg-dlg ul, .asg-dlg ol { padding-left: 18px; }
.asg-dlg-list { font-size: 13px; color: var(--ink-secondary); display: grid; gap: 2px; }
.asg-dlg ul.asg-sc { list-style: none; padding: 0; display: grid; gap: 8px; }
.asg-sc li { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; color: var(--ink-secondary); }
.asg-sc-k { color: var(--ink-muted); white-space: nowrap; }
.asg-sc kbd { font: 600 11px/1 var(--font-sans); padding: 3px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-dim); color: var(--ink-secondary); }
.asg-sc-note { font-size: 12.5px; color: var(--ink-muted); }

/* ── 侧栏角标(Tab 146 按钮右上角;侧栏重画后由 js 补回) */
.sidebar-item .asg-side-badge { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--danger-accent); color: #fff;
    font-size: 9.5px; font-weight: 800; line-height: 15px; text-align: center; font-variant-numeric: tabular-nums; pointer-events: none; box-sizing: border-box; }

/* ── 窄屏:< 1100px 日程栏 / 行详情变浮层 */
@media (max-width: 1099.98px) {
    /* 浮层的 z-index 由 js 取 getTopModalZ() 写在行内;日程栏的浮层样式见「日程」段 .asg-ag-pane.is-float */
}
@media (max-width: 760px) {
    .asg-root, #agencySheetBody > .asg-main, #agencySheetBody > .asg-sub-main { height: auto; }
    .asg-wsg { min-height: 480px; }
    .asg-grid-wrap { max-height: 64vh; min-height: 260px; }
    .asg-fl { grid-template-columns: 56px minmax(0, 1fr) auto; }
    .asg-fl .grp, .asg-fl .ty { display: none; }
    .asg-opts { padding-left: 0; }
    .asg-ag-day { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .asg-spin { animation: none; }
    .asg-switch::after, .asg-progressbig i { transition: none; }
}

/* ── 子页(§五 15;js U.subPage):导入 / 设置 / 历史 是页面里的一页,不再是盖住整屏的大窗。
   [.table-toolbar.asg-sub-tb(← 返回 + 标题 + 步骤 / 状态 + 右侧主次按钮), .asg-sub-main > .asg-sub-card(白卡片,里面各栏自己滚,外框不出滚动条)] */
.asg-sub-tb .asg-sub-back { flex: none; gap: 4px; padding-left: 9px; }
.asg-sub-tb .asg-sub-title { flex: none; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.asg-sub-tb .asg-sub-sub { flex: 0 1 auto; min-width: 0; font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asg-sub-tb > .btn { flex-shrink: 0; }
/* 页面自己的主按钮(子页工具条、同意卡「我知道了」、拦截卡「重试」)= 系统主按钮的墨色(同 .btn-new),不用靛蓝 */
.asg-btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.asg-btn-ink:hover { background: #1e293b; border-color: #1e293b; color: #fff; }
#agencySheetBody > .asg-sub-main { display: flex; flex-direction: column; min-height: 360px;
    height: calc(100vh - var(--topbar-h, 56px) - var(--asg-tb-h, 52px) - 12px - var(--asg-pad-b, 24px)); }
.asg-sub-card { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.asg-sub-card > * { flex: 1 1 auto; min-height: 0; }

/* ===== A2 grid & drawer (owned by role A2) ===== */
/* 10-19 界面对齐(AGENCY-SURROGATE-SHEET-UI-POLISH-2026-10-19.md §二 / §三 / §五 17-18;js/ui-agency-sheet-grid.js、js/ui-agency-sheet-panels.js)。
   这一段:表格 · 表格里的浮层 / 小表单 · 日程栏条目 · 行详情抽屉(系统中介抽屉的样子)· 设置子页 · 历史子页。不用靛蓝:选中 / 聚焦 / 今天 = 暖橙 --asg-accent*,
   主按钮 = 墨色,状态药丸 = --cat-*(见「小件」段的 [data-c])。z-index 只有表头 / 钉住列的层级(个位数),浮层的 z 都是 js 取 getTopModalZ() 写在行内。 */

/* ── 表格(编辑型;不进统一表格族)。特异度压过 #contentArea table / td 的全局规则(圆角阴影、16px 内边距、末格 flex)。
   表宽跟着容器(100%,标题列吃剩下的,Σ 是 min-width);放不下才横滚:标题列钉左、操作列钉右,压着列的一侧出阴影(.sx-l / .sx-r)。
   族规:只有横线;表头 11px / 500 / 大写 / 字距 .06em / 灰底;行高 44、字 12px;悬停 --surface-dim;选中格 2px 暖橙描边 */
.asg-grid-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--surface); }
#contentArea .asg-grid-wrap > table.asg-grid, .asg-grid-wrap > table.asg-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: var(--surface); margin: 0; }
#contentArea table.asg-grid > thead > tr > th, #contentArea table.asg-grid > tbody > tr > td,
table.asg-grid > thead > tr > th, table.asg-grid > tbody > tr > td {
    height: 44px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--border-subtle); background: var(--surface); box-shadow: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; vertical-align: middle; display: table-cell;
    font-size: 12px; line-height: 1.35; color: var(--ink); font-weight: 400; gap: 0; letter-spacing: 0; text-transform: none;
}
#contentArea table.asg-grid > thead > tr > th, table.asg-grid > thead > tr > th { position: sticky; top: 0; z-index: 3; height: 36px; background: var(--surface-muted); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border);
    font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); cursor: pointer; user-select: none; }
#contentArea table.asg-grid > thead > tr > th:hover, table.asg-grid > thead > tr > th:hover { color: var(--ink); }
table.asg-grid th .hd { display: flex; align-items: center; gap: 5px; min-width: 0; }
table.asg-grid th .hd-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
table.asg-grid th .hd-ic { display: inline-flex; flex: none; color: var(--ink-faint); }
table.asg-grid th .asg-tag { height: 16px; padding: 0 5px; font-size: 9.5px; letter-spacing: .03em; text-transform: none; }
table.asg-grid th input { height: 26px; width: 100%; font-size: 12px; text-transform: none; letter-spacing: 0; }
/* 钉住的两列:标题列(左)、操作列(右)。表头那两格层级更高 */
#contentArea table.asg-grid > * > tr > .ttl, table.asg-grid > * > tr > .ttl { position: sticky; left: 0; z-index: 2; }
#contentArea table.asg-grid > tbody > tr > td.ttl, table.asg-grid > tbody > tr > td.ttl { font-weight: 500; }
#contentArea table.asg-grid > * > tr > .act, table.asg-grid > * > tr > .act { position: sticky; right: 0; z-index: 2; padding: 0 8px; text-align: center; cursor: default; }
#contentArea table.asg-grid > thead > tr > .ttl, #contentArea table.asg-grid > thead > tr > .act, table.asg-grid > thead > tr > .ttl, table.asg-grid > thead > tr > .act { z-index: 4; }
#contentArea table.asg-grid > thead > tr > th.act, table.asg-grid > thead > tr > th.act { cursor: default; padding: 0 6px; }
#contentArea table.asg-grid > thead > tr > th.add, table.asg-grid > thead > tr > th.add { padding: 0; text-align: center; color: var(--ink-muted); }
#contentArea table.asg-grid > thead > tr > th.add .asg-ic, table.asg-grid > thead > tr > th.add .asg-ic { margin: 0 auto; }
table.asg-grid td.act .btn-action { vertical-align: middle; }
/* 列宽拖动(10-20):表头右缘 8px 的手柄;悬停表头出一条细竖线,按住 / 悬停手柄变成主色整高;拖的时候整页 col-resize 光标、不选字。
   标题列拖过就定宽,剩下的宽度给「+」那一格(.flex:加号靠左,不悬在一大片空白中间) */
table.asg-grid > thead > tr > th > .asg-cw { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; z-index: 1; }
table.asg-grid > thead > tr > th > .asg-cw::after { content: ''; position: absolute; top: 10px; bottom: 10px; right: 3px; width: 2px; border-radius: 1px; background: transparent; transition: background .12s; }
table.asg-grid > thead > tr > th:hover > .asg-cw::after { background: var(--border); }
table.asg-grid > thead > tr > th > .asg-cw:hover::after, table.asg-grid > thead > tr > th > .asg-cw.on::after { top: 0; bottom: 0; background: var(--asg-accent); }
body.asg-col-dragging, body.asg-col-dragging * { cursor: col-resize !important; user-select: none !important; }
#contentArea table.asg-grid > thead > tr > th.add.flex, table.asg-grid > thead > tr > th.add.flex { padding-left: 12px; text-align: left; }
#contentArea table.asg-grid > thead > tr > th.add.flex .asg-ic, table.asg-grid > thead > tr > th.add.flex .asg-ic { margin: 0; }
/* 横滚提示:左边压着列 → 标题列右边一道阴影;右边还有列 → 操作列左边一道阴影(表头那一格保留它的底线) */
#contentArea .asg-grid-wrap.sx-l table.asg-grid > tbody > tr > .ttl, .asg-grid-wrap.sx-l table.asg-grid > tbody > tr > .ttl { box-shadow: 6px 0 8px -6px rgba(15, 23, 42, .22); }
#contentArea .asg-grid-wrap.sx-l table.asg-grid > thead > tr > .ttl, .asg-grid-wrap.sx-l table.asg-grid > thead > tr > .ttl { box-shadow: inset 0 -1px 0 var(--border), 6px 0 8px -6px rgba(15, 23, 42, .22); }
#contentArea .asg-grid-wrap.sx-r table.asg-grid > tbody > tr > .act, .asg-grid-wrap.sx-r table.asg-grid > tbody > tr > .act { box-shadow: -6px 0 8px -6px rgba(15, 23, 42, .22); }
#contentArea .asg-grid-wrap.sx-r table.asg-grid > thead > tr > .act, .asg-grid-wrap.sx-r table.asg-grid > thead > tr > .act { box-shadow: inset 0 -1px 0 var(--border), -6px 0 8px -6px rgba(15, 23, 42, .22); }
/* 着色规则:整行涂底用更浅的色调;悬停 = --surface-dim;单元格着色照旧(--cc-*,在悬停之后,盖得住);红底格 = 转不了的原文 */
#contentArea table.asg-grid > tbody > tr[data-c] > td, table.asg-grid > tbody > tr[data-c] > td { background: var(--cc-row); background: color-mix(in srgb, var(--cc-row) 60%, var(--surface)); }
#contentArea table.asg-grid > tbody > tr:hover > td, table.asg-grid > tbody > tr:hover > td { background: var(--surface-dim); }
#contentArea table.asg-grid > tbody > tr > td[data-c], table.asg-grid > tbody > tr > td[data-c] { background: var(--cc-bg); color: var(--cc-fg); }
#contentArea table.asg-grid > tbody > tr > td.bad, table.asg-grid > tbody > tr > td.bad { background: var(--asg-bad-cell); color: var(--asg-bad-text); }
#contentArea table.asg-grid > tbody > tr > td.num, table.asg-grid > tbody > tr > td.num { text-align: right; font-variant-numeric: tabular-nums; }
#contentArea table.asg-grid > tbody > tr > td.dt, table.asg-grid > tbody > tr > td.dt { font-variant-numeric: tabular-nums; }
#contentArea table.asg-grid > tbody > tr > td.ro, table.asg-grid > tbody > tr > td.ro { color: var(--ink-muted); }
#contentArea table.asg-grid > tbody > tr > td.ctr, table.asg-grid > tbody > tr > td.ctr { text-align: center; }
#contentArea table.asg-grid > tbody > tr > td.sel, table.asg-grid > tbody > tr > td.sel { outline: 2px solid var(--asg-accent); outline-offset: -2px; }
table.asg-grid td.ttl .asg-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; vertical-align: 1px; }
table.asg-grid .asg-pills { display: flex; gap: 4px; overflow: hidden; }
table.asg-grid td > .asg-pill { max-width: 100%; }
table.asg-grid td.asg-next { font-variant-numeric: tabular-nums; }
.asg-next-d { font-weight: 500; }
.asg-next-r { margin-left: 6px; font-size: 11px; color: var(--ink-muted); }
.asg-next-d.over, .asg-next-r.over { color: var(--danger-text); }
.asg-next-d.today { color: var(--asg-accent); }
.asg-next-r.today { color: var(--asg-accent-hover); }
/* 材料格(✓ ✗ —):--cat-* 绿 / 红,不适用 = 灰 */
.asg-doc { width: 26px; height: 20px; border-radius: 6px; font-size: 11px; }
.asg-doc.y { background: var(--cat-green-bg); color: var(--cat-green-text); box-shadow: inset 0 0 0 1px var(--cat-green-border); }
.asg-doc.n { background: var(--cat-red-bg); color: var(--cat-red-text); box-shadow: inset 0 0 0 1px var(--cat-red-border); }
.asg-doc.na { background: var(--surface-muted); color: var(--ink-muted); box-shadow: none; }
/* 空表 / 搜不到:居中灰字(同族表 _agStateRow:48px 16px、--ink-faint、13px);横滚时也留在可见区 */
.asg-grid-empty { position: sticky; left: 0; padding: 48px 16px; text-align: center; color: var(--ink-faint); font-size: 13px; }
/* 单个浮动编辑器:选中时透明;编辑时显形 —— 暖橙边 + 3px 浅橙光圈(同中介抽屉输入框聚焦) */
.asg-ed { position: fixed; left: -9999px; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; caret-color: transparent; resize: none; border: 0; padding: 0; margin: 0;
    overflow: hidden; background: transparent; color: var(--ink); font: 12px/1.45 var(--font-sans); white-space: pre-wrap; }
.asg-ed.on { caret-color: auto; opacity: 1; padding: 13px 12px 9px; border-radius: 3px; background: var(--surface); box-shadow: 0 0 0 1px var(--asg-accent), 0 0 0 4px var(--asg-accent-ring), var(--shadow-lg); outline: none; overflow: auto; }
.asg-cell-dd { position: fixed; height: 44px; display: flex; align-items: center; padding: 0 4px; pointer-events: auto; }
.asg-cell-dd .asg-dd { width: 100%; max-width: none; }

/* ── 表格里的浮层(格子的选项勾选 / 跟进浮层):尺寸照系统 uiMenu(圆角 14、--shadow-float、13px、悬停 --surface-muted)。菜单本身 = uiMenu */
.asg-pop { position: fixed; min-width: 200px; max-width: min(400px, calc(100vw - 24px)); max-height: min(480px, calc(100vh - 24px)); overflow: auto; padding: 6px; border-radius: var(--radius-md);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-float); font: 13px/1.4 var(--font-sans); color: var(--ink); }
.asg-pop.wide { width: min(400px, calc(100vw - 24px)); }
.asg-pop-h { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-muted); padding: 8px 10px 4px; }
.asg-pop hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 6px 4px; }
.asg-mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 7px 10px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; font: 500 13px var(--font-sans); }
.asg-mi:hover, .asg-mi:focus-visible { background: var(--surface-muted); outline: none; }
.asg-mi[disabled] { color: var(--ink-faint); cursor: not-allowed; background: none; }
.asg-mi small { color: var(--ink-muted); font-size: 11px; font-weight: 400; }
.asg-mi .asg-ic { color: var(--ink-muted); }
.asg-mi.cur { background: var(--asg-accent-bg); }
.asg-pop .asg-inp { width: 100%; }
.asg-pad { padding: 6px 8px; display: flex; flex-direction: column; gap: 8px; }
.asg-pad .asg-row .asg-inp { width: auto; }
.asg-fu-now { font-weight: 600; }
/* uiMenu 的分组标题里放的是列名(用户的字):不大写 */
#ui-menu-popover.asg-menu .ui-menu__section { text-transform: none; letter-spacing: .01em; }
/* 暖橙动作键(跟进完成);墨色主按钮 = .asg-btn-ink(子页段) */
.btn.asg-btn-accent, .asg-btn-accent { background: var(--asg-accent); border-color: var(--asg-accent); color: #fff; }
.btn.asg-btn-accent:hover:not(:disabled), .asg-btn-accent:hover:not(:disabled) { background: var(--asg-accent-hover); border-color: var(--asg-accent-hover); color: #fff; }
/* 小表单(加列 / 加选项 / 筛选此列 = 系统 uiModal sm):小字标签 + 控件;报错行预留高度(弹窗不变高) */
.asg-dlg.asg-form { gap: 12px; }
.asg-ff { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.asg-ff > label { font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.asg-ff > .asg-inp { height: 34px; width: 100%; font-size: 13px; }
.asg-dd.asg-dd-wide { display: block; width: 100%; max-width: none; min-width: 0; }
.asg-ff-flag { min-height: 20px; font-size: 12.5px; color: var(--ink-secondary); }
.asg-form-err { min-height: 18px; line-height: 18px; }

/* ── 日程栏的条目(§一 3 最后一条):一行 = 名字 · 原因 · ✓ · 推迟 ▾ · 打开(栏的外壳在「日程」段) */
.asg-agenda.narrow .asg-ag-item { padding: 2px 2px 2px 10px; }
.asg-agenda.narrow .asg-ag-item .acts { gap: 0; }
.asg-agenda.narrow .asg-ag-item .acts .btn-action { width: 26px; height: 26px; padding: 0; justify-content: center; }
.asg-ag-item .acts .btn-action + .btn-action { margin-left: 0; }
.asg-agenda.narrow .asg-ag-item .acts .asg-ag-move { padding: 3px 6px; min-height: 26px; gap: 2px; font-size: 12px; color: var(--ink-secondary); }
.asg-ag-sec.today h3 { color: var(--asg-accent-hover); }
.asg-ag-item.over { border-color: var(--danger-border); }
.asg-ag-item .asg-ag-done:hover { color: var(--success-text); }

/* ── 行详情 = 系统中介抽屉(§三;同 ui-agency.js 卵妹档案 .dcdw-narrow 660 + 遮罩)。style.css 的 elab v4 炭黑皮只认 #elabOverlay /
   #agencyPairingDrawerOverlay,这里照抄同一套数值:标题栏 57(炭黑 #292524)、正文 20/24、底栏 55(#fafaf9)、宽 660。
   作用域挂在常驻的外壳 #asgDrawerHost 上,不挂遮罩的 id:关的时候 hideOverlay 先把遮罩的 id 摘了(免得马上再开的抽屉撞号),
   样式要是认 #asgDrawerOverlay,滑出去那 0.3 秒就掉回 style.css 的 72vw 白底抽屉(10-20 业主「退出弹窗的动画有问题」) */
#asgDrawerHost { font-family: var(--font-sans); }
#asgDrawerHost .elab-drawer.dcdw-narrow { width: min(660px, 100vw); min-width: 0; max-width: 100vw; color: var(--ink); font-size: 13px; line-height: 1.45; }
#asgDrawerHost .elab-drawer * { box-sizing: border-box; }
#asgDrawerHost .elab-drawer:focus { outline: none; }
#asgDrawerHost .elab-drawer-header { background: #292524; border-bottom: 1px solid #1c1917; padding: 14px 24px; gap: 12px; }
#asgDrawerHost .elab-v4-head-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 auto; }
#asgDrawerHost .elab-v4-head-right { display: flex; align-items: center; gap: 10px; flex: none; }
#asgDrawerHost .elab-v4-head-tag { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1.2; color: #a8a29e; text-transform: uppercase; padding: 4px 8px;
    background: #44403c; border-radius: 4px; border: 1px solid #57534e; white-space: nowrap; }
#asgDrawerHost .elab-v4-head-title { margin: 0; flex: 0 1 auto; min-width: 0; max-width: 48%; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#asgDrawerHost .elab-v4-head-divider { flex: none; color: #57534e; }
#asgDrawerHost .elab-v4-head-meta { flex: 1 1 auto; min-width: 0; color: #a8a29e; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#asgDrawerHost .elab-v4-head-meta b { color: #e7e5e4; font-weight: 500; }
#asgDrawerHost .elab-v4-head-right .asg-pill { font-size: 11px; padding: 3px 10px; }
#asgDrawerHost .elab-v4-head-right .asg-tag { background: #44403c; color: #d6d3d1; }
/* × 在上、esc 在下(同 style.css 10-18 的修法:框随内容长、两个都居中;上下 -4px 抵掉多出的高度,标题栏不变高) */
#asgDrawerHost .elab-v4-close { background: transparent; border: none; color: #a8a29e; cursor: pointer; min-width: 28px; min-height: 28px; border-radius: 5px; font-size: 16px;
    display: inline-grid; place-items: center; place-content: center; gap: 3px; padding: 2px 3px; margin: -4px 0; line-height: 1; }
#asgDrawerHost .elab-v4-close:hover { background: #44403c; color: #fff; }
#asgDrawerHost .elab-v4-kbd { font: 9px ui-monospace, Menlo, monospace; background: #44403c; color: #d6d3d1; padding: 1px 5px; border-radius: 3px; border: 1px solid #57534e; line-height: 1; letter-spacing: .02em; }
#asgDrawerHost .elab-drawer-body { padding: 20px 24px 28px; }
#asgDrawerHost .asg-dr-body > .dcdw-sec:first-child, #asgDrawerHost .asg-dr-body > .asg-dr-trash + .dcdw-sec { margin-top: 0; }
#asgDrawerHost .asg-dr-trash { margin: 0 0 18px; }
#asgDrawerHost .asg-dr-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* 字段:两栏 .elab-v4-field(10px 大写小字标签 + 32px 输入框;聚焦暖橙);长文本 / 多选占两栏;改过没存的标签变暖棕带圆点 */
#asgDrawerHost .asg-dr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#asgDrawerHost .elab-v4-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#asgDrawerHost .elab-v4-field.wide { grid-column: 1 / -1; }
#asgDrawerHost .elab-v4-field > label { font-size: 10px; color: #a8a29e; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#asgDrawerHost .elab-v4-field.is-dirty > label { color: #b45309; }
#asgDrawerHost .elab-v4-field.is-dirty > label::after { content: ' ●'; font-size: 8px; vertical-align: 1px; }
#asgDrawerHost .elab-v4-field.is-dirty .elab-v4-input:not(:focus), #asgDrawerHost .elab-v4-field.is-dirty .ui-dd-trigger { border-color: #fdba74; }
#asgDrawerHost .elab-v4-input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font: 13px var(--font-sans); background: var(--surface); color: var(--ink);
    transition: border-color .12s ease, box-shadow .12s ease; width: 100%; height: 32px; min-width: 0; }
#asgDrawerHost .elab-v4-input:focus { outline: none; border-color: var(--asg-accent); box-shadow: 0 0 0 3px var(--asg-accent-ring); }
#asgDrawerHost textarea.elab-v4-input { height: auto; min-height: 66px; line-height: 1.45; resize: vertical; }
#asgDrawerHost .elab-v4-input.bad { background: var(--asg-bad-cell); color: var(--asg-bad-text); border-color: var(--danger-border); }
#asgDrawerHost .ui-dd-trigger { min-height: 32px; height: 32px; border-width: 1px; border-radius: 6px; font-size: 13px; }
#asgDrawerHost .asg-dd.bad .ui-dd-trigger { background: var(--asg-bad-cell); color: var(--asg-bad-text); }
#asgDrawerHost .asg-dr-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
#asgDrawerHost .asg-dr-row > .elab-v4-input, #asgDrawerHost .asg-dr-row > .asg-dd { flex: 1 1 auto; min-width: 0; }
#asgDrawerHost .asg-dr-hint { font-size: 11.5px; color: var(--ink-muted); }
#asgDrawerHost .asg-dr-hint.bad { color: var(--asg-bad-text); }
#asgDrawerHost .asg-dr-ro { font-size: 13px; color: var(--ink); padding: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#asgDrawerHost .asg-dr-ro.bad { color: var(--asg-bad-text); }
#asgDrawerHost .asg-selbtn { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; height: auto; min-height: 32px; padding: 4px 8px; text-align: left; cursor: pointer; }
#asgDrawerHost .asg-selbtn > .asg-ic { margin-left: auto; color: var(--ink-faint); }
#asgDrawerHost .asg-dr-seg { align-self: flex-start; }
#asgDrawerHost .asg-dr-seg button { height: 30px; }
#asgDrawerHost .asg-dr-ck { min-height: 32px; font-size: 13px; }
/* v4 键(抽屉里的动作):30 高、12.5px;次要 = 白底灰框;幽灵 = 透明;强调 = 暖橙(跟进完成) */
#asgDrawerHost .elab-v4-btn { font: 500 12.5px var(--font-sans); padding: 6px 12px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    white-space: nowrap; height: 30px; transition: background .12s ease, border-color .12s ease, color .12s ease; }
#asgDrawerHost .elab-v4-btn:disabled { opacity: .45; cursor: not-allowed; }
#asgDrawerHost .elab-v4-btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
#asgDrawerHost .elab-v4-btn-secondary:hover:not(:disabled) { background: #fafaf9; border-color: #d6d3d1; }
#asgDrawerHost .elab-v4-btn-ghost { background: transparent; color: var(--ink-secondary); }
#asgDrawerHost .elab-v4-btn-ghost:hover:not(:disabled) { background: #fafaf9; color: var(--ink); }
#asgDrawerHost .elab-v4-btn-accent { background: #ea580c; color: #fff; }
#asgDrawerHost .elab-v4-btn-accent:hover:not(:disabled) { background: #c2410c; }
/* 下次跟进卡:大字日期(今天暖橙 / 逾期红)+ 一排动作 + 频率(草稿)/ 备注 + 跟进记录 */
#asgDrawerHost .asg-dr-next { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-variant-numeric: tabular-nums; }
#asgDrawerHost .asg-dr-next-d b { font-weight: 600; }
#asgDrawerHost .asg-dr-next-clear { margin-left: auto; }
#asgDrawerHost .asg-dr-next-d.today { color: var(--asg-accent-hover); }
#asgDrawerHost .asg-dr-next-d.over { color: var(--danger-text); }
#asgDrawerHost .asg-dr-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#asgDrawerHost .asg-dr-setd { display: inline-flex; align-items: center; gap: 6px; }
#asgDrawerHost .asg-dr-setd .elab-v4-input { width: 168px; height: 30px; padding: 5px 8px; }
/* 抽屉里的日期框(下次跟进「设日期」/ 单次提醒):自由文字 +「今天」键(同字段编辑器;不用原生 type=date,它的占位字跟系统语言) */
#asgDrawerHost .asg-dr-day { display: inline-flex; align-items: center; gap: 2px; flex: none; min-width: 0; }
#asgDrawerHost .asg-dr-day > .elab-v4-input { width: 168px; flex: none; }
#asgDrawerHost .asg-dr-day > .elab-v4-btn { padding: 6px 8px; }
#asgDrawerHost .asg-dr-sub { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
#asgDrawerHost .asg-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 12.5px; max-height: 220px; overflow: auto; }
#asgDrawerHost .asg-log li { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
#asgDrawerHost .asg-log li:last-child { border-bottom: 0; }
#asgDrawerHost .asg-log .who { color: var(--ink-secondary); }
#asgDrawerHost .asg-log q { color: var(--ink-secondary); quotes: "“" "”"; }
#asgDrawerHost .asg-dr-list { display: flex; flex-direction: column; }
#asgDrawerHost .asg-dr-li { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border-subtle); min-width: 0; font-size: 12.5px; }
#asgDrawerHost .asg-dr-li:last-child { border-bottom: 0; }
#asgDrawerHost .asg-dr-li small { display: block; color: var(--ink-muted); font-size: 11.5px; }
#asgDrawerHost .asg-dr-rem { padding: 0; gap: 0; overflow: visible; flex: none; }
#asgDrawerHost .asg-dr-oo { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-subtle); padding-top: 10px; }
#asgDrawerHost .asg-dr-meta { margin: 0; font-size: 12px; color: var(--ink-secondary); }
/* Vita 只读卡 */
#asgDrawerHost .asg-vcard { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
#asgDrawerHost .asg-vcard .vh { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-dim); border-bottom: 1px solid var(--border); }
#asgDrawerHost .asg-vcard .vh div { padding: 8px 10px; min-width: 0; }
#asgDrawerHost .asg-vcard .vh div + div { border-left: 1px solid var(--border); }
#asgDrawerHost .asg-vcard .vh small { display: block; color: var(--ink-muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#asgDrawerHost .asg-vcard .vh b { font-weight: 600; overflow-wrap: anywhere; }
#asgDrawerHost .asg-vcard .vb { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
#asgDrawerHost .asg-vcard table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
#asgDrawerHost .asg-vcard td, #asgDrawerHost .asg-vcard th { padding: 5px 6px; border-bottom: 1px solid var(--border-subtle); text-align: left; font-size: 12px; color: var(--ink); font-weight: 400; }
#asgDrawerHost .asg-vcard th { font-size: 10px; color: var(--ink-muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
#asgDrawerHost .asg-vcard .vnote { font-size: 11.5px; color: var(--ink-muted); padding: 8px 10px; border-top: 1px solid var(--border-subtle); background: var(--surface-dim); }
/* 危险区(正文最下面):红字删除键 + 一句说明;删除先 uiModal.confirm */
#asgDrawerHost .asg-dr-danger { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#asgDrawerHost .asg-dr-del { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 8px; margin-left: -8px; border-radius: 6px; color: var(--danger-text);
    font: 500 12.5px var(--font-sans); cursor: pointer; }
#asgDrawerHost .asg-dr-del:hover { background: var(--danger-bg); }
/* 底栏:左「关闭」,右「● N 项未保存」+ 炭黑「保存 ⌘S」(没改动时置灰不隐藏;有改动时右上角琥珀色圆点 = style.css .elab-save-btn.has-unsaved) */
#asgDrawerHost .elab-drawer-footer { justify-content: space-between; align-items: center; background: #fafaf9; padding: 12px 22px; gap: 10px; }
#asgDrawerHost .elab-v4-footer-right { display: flex; align-items: center; gap: 6px; flex: none; }
#asgDrawerHost .asg-dr-state { font-size: 12px; font-weight: 600; white-space: nowrap; color: #b45309; }
#asgDrawerHost .asg-dr-state:not(:empty) { margin: 0 4px 0 10px; }
#asgDrawerHost .elab-v4-save-btn { padding: 6px 14px; border-radius: 6px; font: 500 12.5px var(--font-sans); height: 30px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
#asgDrawerHost .elab-v4-save-btn:disabled { opacity: .38; cursor: not-allowed; }
#asgDrawerHost .elab-v4-save-btn:disabled:hover { background: #292524; }
#asgDrawerHost .elab-v4-save-kbd { font: 10px ui-monospace, Menlo, monospace; background: rgba(255, 255, 255, .18); color: #fafaf9; padding: 1px 5px; border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, .22); margin-left: 4px; letter-spacing: .02em; }
@media (max-width: 700px) { #asgDrawerHost .asg-dr-grid { grid-template-columns: minmax(0, 1fr); } #asgDrawerHost .elab-v4-head-meta { display: none; } }
@media (prefers-reduced-motion: reduce) { #asgDrawerHost > .elab-overlay, #asgDrawerHost .elab-drawer { transition: none; } }

/* ── 设置子页(§五 17):左边固定的分区导航,右边内容自己滚;挂进来的分区(AI 设置助手,fill)占满右边、自己管滚动 */
.asg-sheet.asg-st { display: grid; grid-template-columns: 212px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; }
.asg-st-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-right: 1px solid var(--border); background: var(--surface-dim); overflow: auto; min-height: 0; }
.asg-st-nav-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-secondary);
    font: 500 13px var(--font-sans); text-align: left; cursor: pointer; white-space: nowrap; }
.asg-st-nav-i > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.asg-st-nav-i > .asg-ic { color: var(--ink-muted); }
.asg-st-nav-i:hover { background: var(--surface-muted); color: var(--ink); }
.asg-st-nav-i.on { background: var(--surface); color: var(--ink); box-shadow: inset 2px 0 0 var(--asg-accent), 0 0 0 1px var(--border); }
.asg-st-nav-i.on > .asg-ic { color: var(--asg-accent); }
.asg-st-pane { min-width: 0; min-height: 0; overflow: auto; padding: 18px 24px 32px; }
.asg-st-pane.fill { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.asg-st-pane.fill > * { flex: 1 1 auto; min-height: 0; }
.asg-st-h { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.asg-st .asg-sh-b { display: flex; flex-direction: column; gap: 14px; max-width: 1080px; }
.asg-st .asg-inp.sm { height: 30px; font-size: 12.5px; }
/* 列清单 / 规则清单 = 白框里一行一条(只有横线,同族表) */
.asg-st .asg-list { gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.asg-fl { display: grid; grid-template-columns: 60px minmax(140px, 1.3fr) 120px minmax(90px, .8fr) 236px; gap: 10px; align-items: center; min-height: 48px; padding: 6px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--surface); }
.asg-st .asg-list > .asg-fl:last-child, .asg-st .asg-list > .asg-rule:last-child { border-bottom: 0; }
.asg-fl .mv { display: flex; }
.asg-fl .ty { font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asg-fl .ac { display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.asg-fl.hid { background: var(--surface-dim); }
.asg-fl.hid > .asg-inp { color: var(--ink-muted); }
.asg-fl .btn-action.on { color: var(--ink); background: var(--surface-muted); }
.asg-opts { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 8px 0 4px 70px; }
.asg-opt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.asg-opt .asg-inp { flex: 1; min-width: 120px; }
.asg-opt.faint { opacity: .6; }
.asg-formbox { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-dim); }
.asg-formbox h4 { font-size: 13px; font-weight: 600; margin: 0; color: var(--ink); }
.asg-formbox > .asg-seg { align-self: flex-start; }
.asg-preview-line { padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; }
.asg-preview-line small { display: block; color: var(--ink-muted); }
.asg-rule { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); background: var(--surface); }
.asg-rule .asg-grow { display: flex; flex-direction: column; gap: 4px; }
.asg-rule .hits { font-size: 11.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.asg-rule.off { opacity: .6; }
.asg-rule .btn-action.on { color: var(--ink); background: var(--surface-muted); }
.asg-st .asg-sw { width: 22px; height: 22px; border-radius: 6px; }
/* 设置的列清单在窄窗口(右栏 < 约 760)里:类型那一栏不显示(表头菜单 / 类型都还看得到),名字和分组让出位置,右边的操作那一栏不被挤掉 */
@media (max-width: 1240px) {
    .asg-fl { grid-template-columns: 60px minmax(120px, 1.3fr) minmax(80px, .8fr) 236px; }
    .asg-fl .ty { display: none; }
    .asg-opts { padding-left: 0; }
}
@media (max-width: 900px) {
    .asg-sheet.asg-st { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .asg-st-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 10px; }
    .asg-st-nav-i { width: auto; flex: none; }
    .asg-fl { grid-template-columns: 60px minmax(0, 1fr) 236px; }
    .asg-fl .grp, .asg-fl .ty { display: none; }
    .asg-opts { padding-left: 0; }
}

/* ── 历史子页(§五 18):卡片头 = 墨色分段(历史版本 / 导入记录 / 回收站,带数字)+ 一句说明;下面一张族表(只有横线,每行操作 .btn-action) */
.asg-sheet.asg-hs { display: flex; flex-direction: column; min-height: 0; }
.asg-hs-head { flex: none; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.asg-hs-intro { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asg-hs-body { flex: 1; min-height: 0; overflow: auto; }
.asg-hs-body > .asg-err, .asg-hs-body > .btn, .asg-hs-loading { margin: 16px; }
#contentArea table.asg-hst, table.asg-hst { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 0; border-radius: 0; box-shadow: none; overflow: visible; background: var(--surface); margin: 0; }
#contentArea table.asg-hst > thead > tr > th, table.asg-hst > thead > tr > th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 12px; border: 0; background: var(--surface-muted); box-shadow: inset 0 -1px 0 var(--border);
    font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#contentArea table.asg-hst > tbody > tr > td, table.asg-hst > tbody > tr > td { height: 44px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--border-subtle); background: var(--surface); display: table-cell;
    font-size: 12px; font-weight: 400; color: var(--ink); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#contentArea table.asg-hst > tbody > tr:hover > td, table.asg-hst > tbody > tr:hover > td { background: var(--surface-dim); }
#contentArea table.asg-hst > * > tr > .act, table.asg-hst > * > tr > .act { text-align: center; padding: 0 8px; }
#contentArea table.asg-hst > tbody > tr > td.strong, table.asg-hst > tbody > tr > td.strong { font-weight: 500; }
#contentArea table.asg-hst > tbody > tr > td.muted, table.asg-hst > tbody > tr > td.muted { color: var(--ink-muted); }
#contentArea table.asg-hst > tbody > tr.asg-hst-empty > td, table.asg-hst > tbody > tr.asg-hst-empty > td { height: auto; text-align: center; white-space: normal; }
#contentArea table.asg-hst > tbody > tr.asg-hst-empty:hover > td, table.asg-hst > tbody > tr.asg-hst-empty:hover > td { background: var(--surface); }
.asg-hst-empty td > div { padding: 48px 16px; color: var(--ink-faint); font-size: 13px; }
table.asg-hst td.act .btn-action.btn-delete:not(:disabled) { color: var(--danger-text); }
table.asg-hst td.act .btn-action.btn-delete:not(:disabled):hover { background: var(--danger-bg); }

/* ===== B import & settings sub-pages (owned by role B) ===== */
/* 导入向导 = 页内子页(js/ui-agency-sheet-import.js;规格 §五 16)。外框(子页工具条 + 白卡片 .asg-sub-card)是 js/ui-agency-sheet.js 的 U.subPage;
   这里只管卡片里的 #asgWizard.asg-wz 和工具条上插进来的步骤指示 #wz-steps。卡片里按步分栏(.asg-wz-panes),各栏 44px 栏头 + 自己滚的栏体,
   外框不出滚动条。主按钮墨色(子页工具条的 .asg-btn-ink);聚焦 / 当前步 / 选中 = 暖橙 --asg-accent*;勾选框墨色。不用系统的靛蓝品牌色。
   向导在 #contentArea 里:那里对 table / td 的全局样式(圆角阴影、16px 内边距、末格 flex)用 #contentArea 前缀盖掉。 */

/* ── 步骤指示(子页工具条上,文件名后面):中性色,做完的打勾,当前步暖橙;放不下由 js fitSteps 一档一档收(.asg-wz-fit1…3) */
#asgSubToolbar .asg-wz-steps { flex: none; display: flex; align-items: center; gap: 14px; margin: 0 0 0 6px; padding: 0; list-style: none; }
.asg-wz-step { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 4px; border-radius: 13px;
    font-size: 12px; line-height: 1; color: var(--ink-muted); white-space: nowrap; }
.asg-wz-step + .asg-wz-step::before { content: ""; position: absolute; left: -11px; top: 50%; width: 8px; height: 1px; background: var(--ink-faint); }
.asg-wz-step > i { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 600 11px/1 var(--font-sans); font-style: normal;
    background: var(--surface-muted); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.asg-wz-step > i .asg-ic { display: block; }
.asg-wz-step.done { color: var(--ink-secondary); }
.asg-wz-step.done > i { background: var(--surface-muted); color: var(--ink-secondary); }
.asg-wz-step.on { background: var(--asg-accent-bg); color: var(--asg-accent-hover); box-shadow: inset 0 0 0 1px var(--asg-accent-border); }
.asg-wz-step.on > i { background: var(--asg-accent); color: #fff; }
#asgSubToolbar.asg-wz-fit1 .asg-wz-steps { gap: 10px; }
#asgSubToolbar.asg-wz-fit1 .asg-wz-step + .asg-wz-step::before { left: -8px; width: 6px; }
#asgSubToolbar.asg-wz-fit1 .asg-wz-step:not(.on) { padding: 0 2px; }
#asgSubToolbar.asg-wz-fit1 .asg-wz-step:not(.on) > .asg-wz-step-t { display: none; }
#asgSubToolbar.asg-wz-fit2 > .asg-sub-sub { display: none; }
#asgSubToolbar.asg-wz-fit3 .asg-wz-step.on { padding: 0 4px; }
#asgSubToolbar.asg-wz-fit3 .asg-wz-step > .asg-wz-step-t { display: none; }

/* ── 卡片里:一条(提示 / AI 状态 / 汇总)+ 分栏;或者一整块(第 1、5 步) */
.asg-wz { display: flex; flex-direction: column; min-width: 0; min-height: 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.asg-wz p { margin: 0; }
.asg-wz-strip { flex: none; display: flex; flex-direction: column; gap: 8px; max-height: 40%; overflow: auto; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.asg-wz-panes { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); }
.asg-wz-panes.one { grid-template-columns: minmax(0, 1fr); }
.asg-wz-panes.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.asg-wz-panes.two-side { grid-template-columns: minmax(0, 1fr) 340px; }
.asg-wz-panes.three { grid-template-columns: 340px minmax(0, 1fr) minmax(0, 1.1fr); }
.asg-wz-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.asg-wz-pane + .asg-wz-pane { border-left: 1px solid var(--border); }
.asg-wz-ph { flex: none; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); min-width: 0; }
.asg-wz-ph h3 { margin: 0; flex: 0 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asg-wz-pm { margin-left: auto; flex: 0 1 auto; min-width: 0; font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.asg-wz-pm.warn { color: var(--warning-text); }
.asg-wz-pb { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.asg-wz-pb > * { flex-shrink: 0; }
.asg-wz-pb.flush { padding: 0; gap: 0; }
.asg-wz-pb.narrow > * { width: 100%; max-width: 820px; }
.asg-wz-one { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.asg-wz-one > * { flex-shrink: 0; }
.asg-wz-one.center { align-items: center; justify-content: center; }
.asg-wz-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.asg-wz-pb > .asg-wz-sec:first-child, .asg-wz-dqs > .asg-wz-sec:first-child { padding-top: 0; border-top: 0; }
.asg-wz-sec h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.asg-wz-sec > .asg-xseg { align-self: flex-start; }
.asg-wz-q { font-size: 13px; line-height: 1.55; color: var(--ink-secondary); }
.asg-wz-sum { color: var(--ink-secondary); line-height: 1.5; }
.asg-wz-warn { color: var(--warning-text); font-size: 11.5px; }
.asg-wz-none { padding: 32px 0; text-align: center; color: var(--ink-faint); }
.asg-wz-foot { font-size: 12px; color: var(--ink-muted); }
.asg-wz .asg-tag.acc { background: var(--asg-accent-bg); color: var(--asg-accent-hover); }
.asg-wz input[type=checkbox], .asg-wz input[type=radio] { accent-color: var(--ink); }
.asg-wz .asg-li .asg-grow > small, .asg-wz .asg-li .asg-grow > b { display: block; overflow-wrap: anywhere; }
.asg-wz .asg-li .asg-grow > b { font-weight: 500; }
.asg-wz .asg-li .asg-grow > small { color: var(--ink-muted); font-size: 11.5px; }
.asg-callout { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface-dim); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--ink-secondary); }
.asg-callout.err { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-border); }
.asg-callout p { margin: 0; }
.asg-callout .asg-formrow { margin-top: 8px; }
label.asg-ck.asg-callout { display: flex; align-items: flex-start; gap: 8px; }
label.asg-ck.asg-callout input { margin-top: 2px; flex: none; }

/* ── 第 1 步:一整块拖放区(撑满卡片;多张工作表时下面列出来选) */
.asg-wz-one > .asg-wz-drop { flex: 1 0 240px; }
.asg-wz-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 24px; text-align: center; cursor: pointer;
    border-radius: var(--radius-md); border: 1.5px dashed var(--border); background: var(--surface-dim); color: var(--ink-muted); transition: border-color .15s, background-color .15s; }
.asg-wz-drop > .asg-ic { color: var(--asg-accent); }
.asg-wz-drop > b { color: var(--ink); font-size: 15px; font-weight: 600; }
.asg-wz-drop > .asg-muted { max-width: 72ch; font-size: 12.5px; line-height: 1.5; }
.asg-wz-drop > .asg-formrow { justify-content: center; margin-top: 4px; }
.asg-wz-drop:hover { border-color: var(--asg-accent-border); }
.asg-wz-drop.over { border-color: var(--asg-accent); background: var(--asg-accent-bg); }
.asg-wz-drop.busy { cursor: progress; }
.asg-wz .asg-li-btn { cursor: pointer; text-align: left; width: 100%; }
.asg-wz .asg-li-btn:hover { border-color: var(--ink-faint); background: var(--surface-dim); }
.asg-wz .asg-li-btn > .asg-ic { color: var(--ink-muted); }

/* ── 第 2 步:左「文件里的行」(点一行 = 选它当表头)· 右「表头行」(问句 / 提示 / 隐藏的行 / 编码) */
#contentArea .asg-wz table.asg-raw, .asg-wz table.asg-raw { width: max-content; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; border: 0; border-radius: 0;
    box-shadow: none; overflow: visible; background: var(--surface); font-size: 12px; }
#contentArea .asg-wz table.asg-raw td, .asg-wz table.asg-raw td { display: table-cell; height: 38px; padding: 0 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 12px; font-weight: 400; color: var(--ink-secondary); text-align: left; vertical-align: middle; background: var(--surface); border-bottom: 1px solid var(--border-subtle); }
.asg-wz table.asg-raw tr { cursor: pointer; }
.asg-wz table.asg-raw tr:hover > td { background: var(--surface-dim); }
#contentArea .asg-wz table.asg-raw tr.hdr > td, .asg-wz table.asg-raw tr.hdr > td { background: var(--asg-accent-bg); color: var(--asg-accent-hover); }
#contentArea .asg-wz table.asg-raw td.rn, .asg-wz table.asg-raw td.rn { position: sticky; left: 0; z-index: 1; color: var(--ink-muted); font-weight: 400; font-variant-numeric: tabular-nums;
    box-shadow: inset -1px 0 0 var(--border); }
.asg-wz table.asg-raw td.rn .asg-ck { gap: 8px; }
.asg-wz table.asg-raw td.rn .asg-tag { margin-left: 2px; }
.asg-wz-enc { align-items: flex-start; }
.asg-wz-enc small { display: block; font: 11.5px/1.45 var(--font-mono); color: var(--ink-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 第 3 步:上面一条 AI 状态,下面三栏(方案 340 · 预览 · 列对照);< 1180 宽时左栏通高、预览和列对照上下叠 */
.asg-aibar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; padding: 6px 8px 6px 12px; border-radius: var(--radius-sm); background: var(--surface-dim); border: 1px solid var(--border); font-size: 12.5px; }
.asg-aibar .lab { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.asg-aibar .lab .asg-ic { color: var(--asg-accent); }
.asg-unsurebox { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning-text); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.asg-unsurebox b { color: var(--ink); }
.asg-igrp h4 { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin: 4px 0 6px; }
.asg-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 8px; border-radius: var(--radius-xs); border: 1px solid transparent; cursor: pointer; }
.asg-item:hover { background: var(--surface-dim); }
.asg-item input { margin: 2px 0 0; width: 15px; height: 15px; }
.asg-item .t { min-width: 0; }
.asg-item .t b { font-weight: 500; overflow-wrap: anywhere; }
.asg-item .t small { display: block; color: var(--ink-muted); font-size: 11.5px; line-height: 1.45; }
.asg-item .t .q { display: block; color: var(--warning-text); font-size: 11.5px; margin-top: 2px; }
.asg-item.unsure { border-color: var(--warning-border); background: var(--warning-bg); }
.asg-item.off .t b { color: var(--ink-faint); text-decoration: line-through; }
.asg-wz-dups .asg-li { align-items: center; }
.asg-wz-dups .asg-formrow { gap: 4px; margin-left: -8px; }
details.asg-sent { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
details.asg-sent summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 500; color: var(--ink-secondary); }
details.asg-sent pre { margin: 0; padding: 10px 12px; max-height: 320px; overflow: auto; font: 11.5px/1.45 var(--font-mono); border-top: 1px solid var(--border); background: var(--surface-dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.asg-sent-note { padding: 8px 12px; font-size: 12px; border-top: 1px solid var(--border); color: var(--ink-secondary); }
.asg-sent-list { margin: 0; padding: 8px 12px 10px 30px; font-size: 12px; border-top: 1px solid var(--border); }
.asg-wz-cards { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-dim); }
.asg-wz-pane.preview .asg-wz-pb.flush { display: flex; flex-direction: column; overflow: hidden; }
.asg-wz-pane.preview .asg-wz-pb.flush > * { flex: 1 1 auto; min-height: 0; }
.asg-wz-dqs { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.asg-wz-dq small { display: block; font-size: 11.5px; line-height: 1.45; overflow-wrap: anywhere; }
.asg-map-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); container-type: inline-size; }
/* 列对照表跟着栏宽走(table-layout:fixed + 百分比列宽,不出横向滚动条);栏窄于 600 时「理由」那一列收进第一格的第二行(td[data-why]::after) */
#contentArea .asg-wz table.asg-map, .asg-wz table.asg-map { width: 100%; min-width: 0; table-layout: fixed; margin: 0; border-collapse: collapse; border: 0; border-radius: 0; box-shadow: none; overflow: visible;
    background: var(--surface); font-size: 12px; }
#contentArea .asg-wz table.asg-map th:nth-child(1), .asg-wz table.asg-map th:nth-child(1) { width: 22%; }
#contentArea .asg-wz table.asg-map th:nth-child(2), .asg-wz table.asg-map th:nth-child(2) { width: 22px; padding-left: 0; padding-right: 0; }
#contentArea .asg-wz table.asg-map th:nth-child(3), .asg-wz table.asg-map th:nth-child(3) { width: 22%; }
#contentArea .asg-wz table.asg-map th:nth-child(4), .asg-wz table.asg-map th:nth-child(4) { width: 13%; }
#contentArea .asg-wz table.asg-map th:nth-child(5), .asg-wz table.asg-map th:nth-child(5) { width: 21%; }
#contentArea .asg-wz table.asg-map th, .asg-wz table.asg-map th { overflow: hidden; text-overflow: ellipsis; }
#contentArea .asg-wz table.asg-map td[data-why]::after, .asg-wz table.asg-map td[data-why]::after { content: attr(data-why); display: none; margin-top: 3px; font-size: 11.5px; font-weight: 400;
    color: var(--ink-muted); line-height: 1.4; }
@container (max-width: 599.98px) {
    #contentArea .asg-wz table.asg-map th:nth-child(6), #contentArea .asg-wz table.asg-map td:nth-child(6), .asg-wz table.asg-map th:nth-child(6), .asg-wz table.asg-map td:nth-child(6) { display: none; }
    #contentArea .asg-wz table.asg-map th:nth-child(1), .asg-wz table.asg-map th:nth-child(1) { width: 29%; }
    #contentArea .asg-wz table.asg-map th:nth-child(3), .asg-wz table.asg-map th:nth-child(3) { width: 26%; }
    #contentArea .asg-wz table.asg-map th:nth-child(4), .asg-wz table.asg-map th:nth-child(4) { width: 20%; }
    #contentArea .asg-wz table.asg-map th:nth-child(5), .asg-wz table.asg-map th:nth-child(5) { width: auto; }
    #contentArea .asg-wz table.asg-map td[data-why]::after, .asg-wz table.asg-map td[data-why]::after { display: block; }
}
#contentArea .asg-wz table.asg-map th, .asg-wz table.asg-map th { padding: 8px 10px; background: var(--surface-dim); border-bottom: 1px solid var(--border); text-align: left;
    font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }
#contentArea .asg-wz table.asg-map td, .asg-wz table.asg-map td { display: table-cell; padding: 8px 10px; vertical-align: top; font-size: 12px; font-weight: 400; color: var(--ink-secondary);
    border-bottom: 1px solid var(--border-subtle); overflow-wrap: break-word; }
#contentArea .asg-wz table.asg-map td:first-child, .asg-wz table.asg-map td:first-child { color: var(--ink); font-weight: 500; }
#contentArea .asg-wz table.asg-map tbody tr:last-child td { border-bottom: 0; }
.asg-wz table.asg-map td.cv { font-variant-numeric: tabular-nums; }
.asg-wz table.asg-map td.cv.warn { color: var(--asg-bad-text); }
.asg-wz table.asg-map td.arrow { color: var(--ink-faint); padding-left: 0; padding-right: 0; text-align: center; }
#contentArea .asg-wz table.asg-map tr.skip td { color: var(--ink-muted); background: var(--surface-dim); }

/* ── 第 5 步:写入进度(居中);第 6 步:上面一排数字,下面两栏 */
.asg-writing { width: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; }
.asg-writing > b { font-size: 15px; font-weight: 600; }
.asg-progressbig { height: 8px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.asg-progressbig i { display: block; height: 100%; background: var(--asg-accent); border-radius: 4px; transition: width .2s; }
.asg-done-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.asg-done-sum > div { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.asg-done-sum b { display: block; font-size: 20px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--ink); }
.asg-done-sum small { color: var(--ink-muted); font-size: 12px; }

@media (max-width: 1439.98px) {
    .asg-wz-panes.three { grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1.2fr); }
}
@media (max-width: 1179.98px) {
    .asg-wz-panes.three { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
    .asg-wz-panes.three > .plan { grid-row: 1 / span 2; }
    .asg-wz-panes.three > .map { border-top: 1px solid var(--border); }
    .asg-wz-panes.two-side { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 760px) {
    .asg-wz-panes.two, .asg-wz-panes.two-side, .asg-wz-panes.three { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .asg-wz-panes.three > .plan { grid-row: auto; }
    .asg-wz-pane { min-height: 360px; }
    .asg-wz-pane + .asg-wz-pane { border-left: 0; border-top: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) {
    .asg-wz-drop, .asg-progressbig i { transition: none; }
}

/* ── AI 设置助手(js/ui-agency-sheet-chat.js):设置子页里的一个分区(U.settingsNav.register({id:'ai'}),render 进右边的内容区);
   设置子页还没有分区导航时,自己开一个子页(带 44px 栏头)。不再是浮层,不取 z-index。
   内容区宽(≥ 760px,容器查询):左边一栏是点选(本地快捷问题 / AI 预设),右边是对话 + 打字框;窄了上下叠。
   选中的按钮只换背景 / 边框 / 文字颜色,不改字重(10-18 晚业主口味);模型写的字只走 textContent,换行靠 pre-line。主按钮(发送 / 应用)墨色 */
.asg-chat, .asg-chat * { box-sizing: border-box; }
.asg-chat { container-type: inline-size; display: flex; flex-direction: column; flex: 1 1 auto; width: 100%; height: 100%; min-height: 0; min-width: 0; background: var(--surface);
    font-family: var(--font-sans); font-size: 13px; line-height: 1.45; color: var(--ink); }
.asg-chat-in { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
.asg-chat-h { grid-column: 1 / -1; grid-row: 1; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
.asg-chat-h h3 { font-size: 14px; font-weight: 600; margin: 0; }
.asg-chat-h > .asg-ic { color: var(--asg-accent); }
.asg-chat-top { grid-row: 2; display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-dim); max-height: 40vh; overflow: auto; }
.asg-chat-lbl { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.asg-chat-lbl + .asg-chat-chips { margin-bottom: 6px; }
.asg-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.asg-chat-chip { height: auto; min-height: 28px; padding: 4px 10px; white-space: normal; text-align: left; line-height: 1.35; max-width: 100%; }
.asg-chat-chip:hover:not([disabled]) { border-color: var(--ink-faint); color: var(--ink); }
.asg-chat-chip[disabled] { opacity: .5; cursor: not-allowed; }
.asg-chat-chip.ai .asg-ic { color: var(--asg-accent); }
.asg-chat-chip.on, .asg-chat-chip.on[disabled] { background: var(--asg-accent-bg); color: var(--asg-accent-hover); border-color: var(--asg-accent-border); opacity: 1; }
.asg-chat-b { grid-row: 3; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 12px; outline: none; }
.asg-chat-b > * { flex-shrink: 0; width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.asg-chat-intro { margin: 0; font-size: 12px; color: var(--ink-muted); }
.asg-chat-pair { display: flex; flex-direction: column; gap: 10px; }
.asg-chat-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.asg-chat-msg.me { align-items: flex-end; }
.asg-chat-who { font-size: 11px; color: var(--ink-muted); }
.asg-chat-bub { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); white-space: pre-line; overflow-wrap: anywhere; max-width: 88%; }
.asg-chat-msg.me .asg-chat-bub { background: var(--surface-muted); border-color: var(--border); }
.asg-chat-msg.local .asg-chat-bub { border-style: dashed; }
.asg-chat-msg.err .asg-chat-bub { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.asg-chat-note { font-size: 11.5px; color: var(--ink-muted); margin: 0; }
.asg-chat-note ul { margin: 2px 0 0; padding-left: 18px; }
.asg-chat-sent { font-size: 11.5px; color: var(--ink-muted); max-width: 88%; }
.asg-chat-sent summary { cursor: pointer; }
.asg-chat-sent p { margin: 4px 0 0; }
.asg-chat-sent pre { margin: 6px 0 0; padding: 8px; max-height: 240px; overflow: auto; border-radius: var(--radius-xs); background: var(--surface-dim); border: 1px solid var(--border-subtle);
    font: 11px/1.4 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-secondary); text-align: left; }
.asg-chat-ask { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.asg-chat-ask p { margin: 0; }
.asg-chat-card { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.asg-chat-card h4 { margin: 0; font-size: 13px; font-weight: 600; }
.asg-chat-card.done { background: var(--surface-dim); box-shadow: none; }
.asg-chat-card.stale { border-color: var(--warning-border); }
.asg-chat-card .asg-row { gap: 6px; }
.asg-chat-ops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.asg-chat-op { display: flex; align-items: flex-start; gap: 8px; }
.asg-chat-op input { flex: none; margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--ink); }
.asg-chat-op label { display: flex; flex-direction: column; gap: 1px; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.asg-chat-op small { font-size: 11.5px; color: var(--ink-muted); }
.asg-chat-op small.hits { color: var(--asg-accent-hover); }
.asg-chat-op.off label { color: var(--ink-muted); }
.asg-chat-stale { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--warning-bg); color: var(--warning-text);
    border: 1px solid var(--warning-border); font-size: 12px; }
.asg-chat-busy { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); font-size: 12px; }
.asg-chat-f { grid-row: 4; display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.asg-chat-f textarea.asg-inp { flex: 1; min-height: 52px; max-height: 140px; resize: none; }
.asg-chat-f textarea.asg-inp:focus { border-color: var(--asg-accent); box-shadow: 0 0 0 3px var(--asg-accent-ring); }
@container (min-width: 760px) {
    .asg-chat-in { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
    .asg-chat-top { grid-column: 1; grid-row: 2 / span 2; max-height: none; border-bottom: 0; border-right: 1px solid var(--border); padding: 14px 16px; }
    .asg-chat-b { grid-column: 2; grid-row: 2; }
    .asg-chat-f { grid-column: 2; grid-row: 3; }
}

