/* 背景：权限设置必须优先展示模块与业务行，旧长说明及巨大表格在手机首屏难以配置。
 * 约束：单一内容滚动、头部一行、原生44px控件；窄屏动作两列且不出现无效签名/反签控件。
 * 禁止：全局body滚动锁、隐藏父表单、缩小可点区域换取紧凑，或横向溢出遮住动作。
 * 验证：七宽与Edge/WebKit模拟触摸、缩高软键盘视口；真实苹果/微信另行记录。 */
/* 实际单据壳只保留编辑器一个标题；父壳负责滚动/软键盘高度，编辑器不再建立第二滚动锁。
 * 只限定data-page-permission-dialog，不能把其它签名、横向表格或普通单据一起改动。 */
[data-page-permission-dialog] .document-sheet{width:min(1100px,calc(100vw - 16px));padding:0;max-height:calc(100dvh - 16px);overflow:auto}
[data-page-permission-dialog] .pp-editor{border:0}
/* 已复现：旧手机样式.quick-nav button:nth-child(n){display:block!important}覆盖浏览器默认[hidden]，
 * 导致show撤销后JS已hidden=true、直达已拒绝，但快捷按钮仍可见。仅对实际导航权控节点强制隐藏，
 * 禁止扩大到带data-module的业务表单/签名区；七宽与真实触摸快捷回归检查计算display及无越权进入。 */
#quickNav [data-module][hidden],#mainMenu [data-module][hidden],#mainMenu .xc-menu-entry[hidden],#mainMenu .menu-group[hidden]{display:none!important}
.pp-editor{font:14px/1.4 system-ui,-apple-system,"Microsoft YaHei",sans-serif;color:#182434;background:#fff;max-width:1100px;margin:0 auto;border:1px solid #dce3ec;border-radius:10px;overflow:hidden}
.pp-editor *{box-sizing:border-box}.pp-editor [hidden]{display:none!important}
.pp-editor button,.pp-editor select,.pp-editor input{font:inherit;min-height:44px;border:1px solid #c9d2df;border-radius:6px;padding:6px 9px;color:inherit;background:#fff;min-width:0}
.pp-editor select,.pp-editor input{width:100%}.pp-editor button{cursor:pointer}.pp-editor :disabled{cursor:default;opacity:.6}
.pp-editor :focus-visible{outline:2px solid #365acf;outline-offset:2px}
/* 组织三页和父部门选择保持紧凑原生控件，44px点击区域不靠阻止touchmove换取。
 * hidden必须盖过工具栏display；窄屏工具可换行，表格只在自身滚动，不推宽整页。
 * 统一七宽及WebKit验证：首屏可见列表、纵向滑动不误选、键盘出现后选择/取消仍可达。 */
.organization-page,.organization-form{min-width:0}.organization-page [hidden],.organization-form [hidden]{display:none!important}.organization-page .button,.organization-form .button,.organization-form select,.organization-parent-tools input{min-height:44px!important;min-width:44px!important}.organization-parent-tools{display:flex;gap:6px;flex-wrap:wrap}.organization-parent-tools input{flex:1 1 140px;min-width:0}.organization-page .table-card{max-width:100%;overflow-x:auto}.organization-page .data-table td{white-space:normal;overflow-wrap:anywhere}.organization-page .data-table td .button{margin:2px;font-size:12px;padding:6px 8px}.organization-page .page-head{padding-top:6px;padding-bottom:6px}.organization-page .simple-master-tools{flex-wrap:wrap}.organization-page .simple-master-tools input{min-width:0;flex:1 1 120px}
/* 本人菜单偏好紧凑原生选择，不截获touchmove；模块折叠减少首屏占用，44px只给真实触控区域。
 * 不能把个人HIDE控件复用为岗位授权开关；七宽统一验证首屏、select选择、软键盘及纵向滚动。 */
/* 附件与员工归属新增工具区保持44px原生触控、紧凑换行；hidden须压过既有button样式。
 * 禁止为防误传拦截touchmove或整个弹窗滚动；busy只禁写控件，查看区和关闭仍有原生命周期。
 * 七宽回归检查长文件名换行、软键盘后选择/取消可达及无横向溢出，原签名/表格样式不受此范围影响。 */
.xc-attachment-manager{min-width:0;padding:8px}.xc-attachment-manager [hidden]{display:none!important}.xc-attachment-manager .button{min-height:44px!important;min-width:44px!important}.xc-attachment-manager .document-actions{display:flex;flex-wrap:wrap;gap:6px}.xc-attachment-manager [aria-disabled=true]{opacity:.55}.xc-attachment-manager .attachment-card{min-width:0;overflow-wrap:anywhere}.xc-attachment-manager [data-attachment-state]{margin:6px 0;min-height:18px}
/* Edge 触控桌面 1440×844 会命中 app.css 的低高度压缩：附件内容按钮虽已 44px，外层右上角/底部关闭
 * 和预计收款日窗动作仍会降到 28–30px。必须以实际附件管理器或 expectedDate 表单限定整个弹窗，
 * 让大屏平板、触控笔记本与手机采用同一 44px 命中下限；hidden 仍由上方专用规则控制，不能被显形。
 * 禁止放宽全部 documentModal、只修手机断点或只修内容区。七宽 Edge/WebKit 验证中心 tap、关闭可达、
 * 预计日期输入与保存、无横向溢出；普通签名、横表和其他紧凑弹窗不受此覆盖。 */
@media(max-width:768px),(pointer:coarse),(any-pointer:coarse){
  body #documentModal:has(.xc-attachment-manager) button,
  body #documentModal:has(.xc-attachment-manager) [data-attachment-picker],
  body #documentModal:has(input[name="expectedDate"]) button,
  body #documentModal:has(input[name="expectedDate"]) input[name="expectedDate"]{
    min-width:44px!important;min-height:44px!important;height:auto!important;max-height:none!important;box-sizing:border-box;
  }
  body #documentModal:has(.xc-attachment-manager) .document-sheet>header>button,
  body #documentModal:has(input[name="expectedDate"]) .document-sheet>header>button{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
}
.pp-preferences{margin-top:12px;padding:8px;border:1px solid #dde4ec;border-radius:8px;background:#fff;min-width:0}.pp-preference-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.pp-preference-head h3{margin:0;font-size:15px}.pp-preference-head small,.pp-preference-note{font-size:12px;color:#586879}.pp-preference-head>div:last-child{display:flex;gap:6px}.pp-preferences .button,.pp-preferences select,.pp-preferences summary{min-height:44px!important;min-width:44px!important;height:auto!important}.pp-preferences summary{display:flex;align-items:center;cursor:pointer;font-size:14px}.pp-preference-row{display:grid;grid-template-columns:minmax(0,1fr) 100px;align-items:center;gap:8px;padding:4px 0;border-top:1px solid #edf0f4;font-size:13px}.pp-preference-row small{display:block;font-size:11px;color:#65758a}.pp-preference-row select{width:100%;font-size:14px}.pp-preferences details{border-top:1px solid #dde4ec}.pp-preference-note{margin:5px 0;overflow-wrap:anywhere}
/* 范围与动作同一业务行，手机两列内保持原生44px选择区域；共享提示换行，不创建横向滚动容器。
 * 范围select允许正常纵向手势/软键盘视口变化，禁止为压高度添加touchmove拦截。七宽测试核溢出。 */
.pp-scope label{display:grid;grid-template-columns:74px minmax(0,220px);gap:3px 6px;align-items:center;max-width:100%;flex:1}.pp-scope label small{grid-column:1/-1;overflow-wrap:anywhere}.pp-scope-related{flex-basis:100%;overflow-wrap:anywhere}
.pp-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 10px;border-bottom:1px solid #e2e8f0}.pp-head h2{font-size:16px;margin:0;line-height:1.3}.pp-head button{min-height:36px;font-size:13px}
/* 模块批量操作集中在列表前，常用显示/修改直接点击；次要拒绝/恢复默认收进原生details。
 * 页面采用浅色分行及清晰的动作列，避免多层大卡片；范围仍与业务行相邻。手机两列、44px触控，
 * 不固定遮挡列表，不拦截滚动。七宽浏览器回归检查首屏、展开操作、软键盘及共享范围提示。 */
.pp-bulk{margin:8px 0;padding:10px;background:#eef7f8;border:1px solid #cfe5e7;border-radius:10px}
.pp-bulk-heading{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:6px}.pp-bulk-heading b{font-size:13px;color:#155765}.pp-bulk-heading small,.pp-bulk-note{font-size:11px;color:#617685;overflow-wrap:anywhere}.pp-bulk-note{display:block;margin:5px 0}
.pp-bulk-quick{display:flex;gap:6px;flex-wrap:wrap;align-items:flex-start}.pp-editor [data-pp-bulk-allow]{background:#087a88;color:#fff;border-color:#087a88;font-weight:600}.pp-editor [data-pp-bulk-allow="edit"]{background:#fff;color:#087a88;border-color:#9acbd0}
.pp-bulk-more{flex:1;min-width:135px}.pp-bulk-more summary{cursor:pointer;min-height:44px;padding:11px 8px;color:#426574;font-size:13px}.pp-bulk-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:6px;margin-top:5px}.pp-bulk-scope{display:flex;gap:6px;align-items:center;margin-top:6px}.pp-bulk-scope label{display:flex;gap:8px;align-items:center;flex:1;font-size:12px;white-space:nowrap}.pp-bulk-scope select{max-width:240px}.pp-bulk-scope button{white-space:nowrap}
.pp-editor .pp-page{margin-top:6px;padding:10px;border:1px solid #e2eaf0;border-radius:8px;background:#fff}.pp-editor .pp-page:nth-child(even){background:#f8fafc}.pp-editor .pp-page h3{color:#234c61}.pp-editor .pp-actions select{background:#fff;border-color:#d4e0e7}.pp-editor .pp-actions small{line-height:1.5}.pp-editor .pp-scope{padding-top:6px;border-top:1px dashed #e1e8ee}.pp-editor .pp-head{background:#f6fafb}
@media(max-width:600px){.pp-bulk{padding:7px;margin:6px 0}.pp-bulk-quick{display:grid;grid-template-columns:1fr 1fr}.pp-bulk-more{grid-column:1/-1}.pp-bulk-more summary{padding:11px 0;min-height:44px}.pp-editor .pp-page{padding:8px}.pp-bulk-scope label{gap:5px}.pp-head h2{overflow-wrap:anywhere}.pp-editor .pp-head button{min-height:44px;flex-shrink:0}}
/* 桌面把数据范围放到同一行右侧，避免每页额外占一整行；手机保留上方的两列动作和下方范围。 */
@media(min-width:900px){.pp-editor .pp-page{grid-template-columns:130px minmax(0,1fr) 230px;align-items:start}.pp-editor .pp-page:not(:has(.pp-scope)){grid-template-columns:130px minmax(0,1fr)}.pp-editor .pp-scope{grid-column:auto;display:block;border:0;padding:0}.pp-editor .pp-scope label{display:grid;grid-template-columns:1fr;gap:3px}.pp-editor .pp-scope-related{display:block;margin-top:3px}.pp-bulk{display:grid;grid-template-columns:1fr 360px;gap:0 12px}.pp-bulk-heading{grid-column:1/-1}.pp-bulk-scope{margin-top:0;align-self:start}.pp-bulk-note{grid-column:1/-1}}
/* 全局ID用次级文字显示在姓名附近；长姓名可截断而ID可选择复制，不挤掉退出按钮。 */
.side-footer>span{min-width:0}.side-footer #userGlobalId{display:block;font-size:11px;white-space:nowrap;user-select:text}.side-footer #logout{flex-shrink:0}.employee-global-id{display:block;font-size:11px;color:#617685;white-space:nowrap;user-select:text}
.pp-tools{display:grid;grid-template-columns:minmax(120px,1fr) minmax(120px,2fr);gap:8px;padding:8px 10px 0}
.pp-status{font-size:12px;color:#556377;margin:6px 10px;min-height:17px}.pp-status.pp-error{color:#a62323}.pp-editor>[data-pp-reload]{margin:0 10px 8px}
.pp-body{padding:0 10px 10px}.pp-module-grant{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:6px 0;border-bottom:1px solid #dce3ec}.pp-module-grant label{display:grid;grid-template-columns:minmax(110px,1fr) 150px;align-items:center;gap:3px 10px;flex:1}.pp-module-grant small{grid-column:1/-1;font-size:11px}.pp-module-grant b{font-size:14px}.pp-module-grant output{font-size:12px;white-space:nowrap;color:#60718a}
.pp-page{padding:8px 0;border-bottom:1px solid #e7edf4;display:grid;grid-template-columns:160px minmax(0,1fr);gap:8px}.pp-page h3{font-size:14px;font-weight:600;margin:9px 0;overflow-wrap:anywhere}.pp-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.pp-actions label{display:grid;gap:3px}.pp-actions span{font-size:12px;color:#47566c}.pp-actions small{font-size:11px;overflow-wrap:anywhere}.pp-allowed{color:#246842}.pp-denied{color:#8c4b23}.pp-scope{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:11px;color:#62728a}.pp-scope button{font-size:12px;min-height:36px}.pp-empty{font-size:13px;color:#64748b;padding:18px 6px;text-align:center}
@media(max-width:600px){.pp-editor{border-radius:0;border-left:0;border-right:0}.pp-tools{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;padding:6px 8px 0}.pp-head{padding:4px 8px}.pp-body{padding:0 8px 8px}.pp-status{margin:5px 8px}.pp-module-grant{gap:6px}.pp-module-grant label{grid-template-columns:minmax(0,1fr) 116px;gap:3px 5px}.pp-module-grant b{font-size:13px}.pp-module-grant output{font-size:11px}.pp-page{display:block;padding:7px 0}.pp-page h3{margin:0 0 4px;font-size:14px}.pp-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.pp-actions small{font-size:10px}.pp-scope{margin-top:4px}.pp-editor select{font-size:14px;padding-right:4px}}

/* B固定写入口的实际触控区域：旧app.css表格/弹窗28px会让手机归属、停启用及模板条款难点按。
 * 仅覆盖本批明确data属性及xc-fixed-action-editor根；不按所有button泛扩张桌面表格。
 * 320/360/375/390/414/768/桌面统一验收尺寸、横溢出和关闭可达，44px不能代替真实触摸事件验证。 */
#content [data-product-status],#content [data-product-delete],#content [data-assign-user],#content [data-user-status],
#templateTable [data-template-edit],#templateTable [data-template-delete],#content #importTemplate,#content #backEContract,
#documentModal.xc-fixed-action-editor button,#documentModal.xc-fixed-action-editor select {
  min-width:44px!important;min-height:44px!important;height:auto!important;box-sizing:border-box;white-space:normal;
}
#documentModal.xc-fixed-action-editor .document-grid {min-width:0}
#documentModal.xc-fixed-action-editor footer {display:flex;flex-wrap:wrap;gap:6px}
#documentModal.xc-fixed-action-editor .template-block-actions {display:flex;flex-wrap:wrap;gap:4px}
/* 商品导入与公共库复用documentShell的关闭、背景inert及滚动锁；内容采用两列紧凑归属表单。
 * 旧marketplace全局540px单列不得让四个基础字段占满手机首屏；仅这两个实际工具覆盖。
 * Edge 触控模式 1440px 已复现：app.css 的桌面共享规则以 body+#documentModal+三个 :not 属性把
 * 动态 smart-picker 搜索 input 的 min-height 压到 28px，内容与内边距最终只有 43px；所以这里必须用
 * 同样的排除条件再叠加产品弹窗和控件类，最终强制 auto 且至少 44px。禁止只在手机断点补高、改回
 * 原生 select、删除桌面共享门禁或扩大到其他弹窗。七宽 Edge/WebKit 验证真实命中、长错误换行、
 * 未知恢复说明及无横向溢出，未以样式声明代替触摸验证。 */
#documentModal.xc-public-library-import .marketplace-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#documentModal.xc-public-library-import .marketplace-panel{padding:8px;box-shadow:none}
#documentModal.xc-public-library-import .marketplace-panel p{margin:4px 0}
#documentModal.xc-public-library-import .marketplace-warning{padding:6px 8px;margin:0}
@media(max-width:768px),(pointer:coarse),(any-pointer:coarse){
  #documentModal.xc-public-library-import button,#documentModal.xc-public-library-import select,
  #documentModal.xc-product-import-editor button,#documentModal.xc-product-import-editor select,
  body #documentModal.xc-product-import-editor input.smart-picker-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]){min-height:44px!important;min-width:44px!important;height:auto!important;white-space:normal;box-sizing:border-box}
  body #documentModal.xc-public-library-import input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]){min-height:44px!important;min-width:44px!important;height:auto!important;box-sizing:border-box}
}
#documentModal.xc-public-library-import footer,#documentModal.xc-product-import-editor .pi-actions{display:flex;gap:6px;flex-wrap:wrap}
#documentModal.xc-public-library-import [data-library-feedback]{margin:0;overflow-wrap:anywhere}
#documentModal.xc-product-import-editor .pi-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#documentModal.xc-product-import-editor .pi-grid [data-pi-file]{grid-column:1/-1}
#documentModal.xc-product-import-editor .pi-panel{padding:8px;margin:6px 0}
#documentModal.xc-product-import-editor h2{font-size:1rem;margin:4px 0}

/* 报价分享/设备/合同生成与历史共用紧凑弹窗域；不改通用画布、横表和纵向滚动手势。
 * 控件至少44px，四字段可两列，长反馈折行；七宽和真实tap在整包冻结后验收。 */
@media(max-width:768px),(pointer:coarse),(any-pointer:coarse){#documentModal.xc-quotation-action-editor button,#documentModal.xc-quotation-action-editor select,
#documentModal.quotation-share-modal button,#documentModal.quotation-share-modal select{min-width:44px!important;min-height:44px!important;height:auto!important;box-sizing:border-box;white-space:normal}}
#documentModal.xc-quotation-action-editor footer,#documentModal.quotation-share-modal footer{display:flex;flex-wrap:wrap;gap:6px}
#documentModal.xc-quotation-action-editor [role=status],#documentModal.quotation-share-modal [role=status]{overflow-wrap:anywhere}
/* 报价主编辑器在 1440px 触控 Edge 中被桌面紧凑规则压成 28–34px，返回箭头、行上移/下移及保存按钮
 * 均无法满足真实命中门禁；320–768 虽由手机规则补到 44px，不能据此放过触控笔记本和大屏平板。
 * 只以真实 data-quotation-editor 表单反向限定当前 documentModal，所有可见按钮至少 44px且允许文字换行；
 * 禁止放宽整个 documentModal、只修箭头、用测试过滤小按钮，或恢复固定 28/34px。验证覆盖七宽 Edge/WebKit，
 * 中心 tap uncovered、横向无溢出，轻扫选择和普通纵向滚动仍由原组件处理。 */
@media(max-width:768px),(pointer:coarse),(any-pointer:coarse){body #documentModal:has(form[data-quotation-editor="1"]) button{min-width:44px!important;min-height:44px!important;height:auto!important;box-sizing:border-box;white-space:normal}}

/* 电子合同详情、通知分享和 A4 预览在 1440×844 的触控 Edge 中仍会命中 app.css 的低高度桌面压缩规则：
 * 关闭按钮被固定为 28px，高频签署/分享/历史/A4 动作也只有 30px；这会让大屏平板和触控笔记本漏过
 * 与手机相同的 44px 命中约束。这里只用三种真实电子合同壳标识覆盖可见按钮，详情打开时签署权限、
 * 通知重试与 A4 返回仍由各自脚本控制，hidden 的 display 状态不由本规则改写。必须保持至少 44px、
 * 允许长文字自然换行；禁止退回仅在手机断点补高、只修右上角关闭、放宽整个 documentModal，或用
 * 测试忽略桌面触控按钮。验证方法：七宽 Edge/WebKit 逐一检查中心 tap 未被遮挡、动作可达、无横向
 * 溢出，并在 1440×844 复核关闭与全部详情动作的计算宽高均不小于 44px。 */
@media(max-width:768px),(pointer:coarse),(any-pointer:coarse){
  body #documentModal[data-readonly-econtract-id] button,
  body #documentModal.econtract-share-modal button,
  body #documentModal:has(.econtract-preview-sheet) button{
    min-width:44px!important;min-height:44px!important;height:auto!important;max-height:none!important;
    box-sizing:border-box;white-space:normal;
  }
  body #documentModal[data-readonly-econtract-id] .document-sheet>header>button,
  body #documentModal.econtract-share-modal .document-sheet>header>button,
  body #documentModal:has(.econtract-preview-sheet) .document-sheet>header>button{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
}

/* 出库手写签收同样使用 documentShell；1440×844 会进入 app.css 的桌面低高度压缩，实际旋转、清除、
 * 确认和取消按钮从手机/平板的 44px 降为 30px，右上角关闭也会降到 28px。签名需要连续 pointer/touch
 * 操作，结束动作不能在触控笔记本上变成小命中区。必须保留源码创建的 signature-editor 布局类，并按
 * 专用 stockout-signature-editor 宿主反向限定本次 documentModal，使全部可见按钮保持至少 44px；同时
 * 保留画布 touch-action、pointer capture、取消脏签名
 * 确认及弹窗关闭时的监听/滚动锁释放。禁止缩小按钮换取低高度、仅修手机断点、改动画布尺寸或放宽
 * 所有单据弹窗。验证：page-permission-stockout-sign-browser 七宽 Edge/WebKit 测量按钮矩形、中心 tap，
 * 并覆盖 pointercancel/身份切换/同 ID 重开后旧 pad 已销毁且没有重复签名写入。 */
@media(max-width:768px),(pointer:coarse),(any-pointer:coarse){
  body #documentModal:has(.stockout-signature-editor) button{
    min-width:44px!important;min-height:44px!important;height:auto!important;max-height:none!important;
    box-sizing:border-box;white-space:normal;
  }
  body #documentModal:has(.stockout-signature-editor) .document-sheet>header>button{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
}
@media(max-width:767px){#documentModal.xc-quotation-action-editor .document-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#documentModal.xc-quotation-action-editor .document-grid .wide{grid-column:1/-1}#documentModal.quotation-share-modal .panel{padding:8px;margin:6px 0}#documentModal.quotation-share-modal h3{font-size:1rem;margin:4px 0}}
