/* Shared business spacing: section boundaries must survive nested injected content. */
#dialog{width:1040px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:0;overflow:hidden}
#dialog-form{display:flex;flex-direction:column;max-height:calc(100dvh - 32px);min-height:0}
.dialoghead,.dialogfoot{flex:none;position:relative}.dialogbody{flex:1;min-height:0;max-height:none;overflow:auto;padding:26px 30px;scrollbar-gutter:stable}
.dialogbody .formgrid{column-gap:24px;row-gap:22px}.dialogbody .field{gap:10px;min-width:0;font-size:13px}.dialogbody .field>span{color:#46546b;line-height:1.5}.dialogbody .input,.dialogbody select{min-height:40px}.dialogbody textarea{padding:12px;line-height:1.7}
.dialogbody>h3{margin:28px 0 16px;padding-top:22px;border-top:1px solid #e3e8f1;font-size:15px}.dialogbody>h3:first-child{margin-top:0;padding-top:0;border:0}
.dialogbody>.form-section,.dialogbody>.detail-section,.dialogbody>div:has(>h3:first-child),.dialogbody>section:has(>h3:first-child){display:flow-root;margin-top:28px;padding-top:22px;border-top:1px solid #e3e8f1}
.dialogbody :is(.form-section,.detail-section)>h3,.dialogbody>div>h3:first-child,.dialogbody>section>h3:first-child{margin:0 0 18px;font-size:15px;color:#29374e}
.dialogbody>.field+.field,.dialogbody>.tablewrap+.field,.dialogbody>.detail-table-wrap+.formgrid,.dialogbody>.tablewrap+.tablewrap{margin-top:22px}
.dialogbody>.formgrid+.field{margin-top:22px}.dialogbody .workflow-actions{gap:10px;margin:22px 0}.dialogbody .workflow-actions .btn.primary{margin-left:auto}.dialogbody .infobox,.dialogbody .warningbox{line-height:1.75;margin:16px 0 22px}
.detail-table-wrap{border:1px solid #dde4ee;border-radius:9px;overflow:hidden;margin:16px 0 22px;min-width:0}.detail-table{table-layout:fixed;width:100%;border-collapse:collapse}.detail-table .detail-label{width:17%}.detail-table th,.detail-table td{border-bottom:1px solid #e2e7ef;border-right:1px solid #e2e7ef;padding:13px 15px;line-height:1.7;font-size:13px;white-space:normal;vertical-align:top;overflow-wrap:anywhere;text-align:left}.detail-table th{font-weight:500;background:#f4f6fa;color:#5a667b}.detail-table td{background:#fff;color:#27364d}.detail-table tr:last-child>*{border-bottom:0}.detail-table tr>*:last-child{border-right:0}.detail-table .detail-blank{background:#fafbfd}
.dialogbody .tablewrap{max-width:100%;border:1px solid #dde4ee;border-radius:9px;margin-bottom:20px}.dialogbody .tablewrap table{min-width:600px;width:100%}.dialogbody .tablewrap th{font-size:12px;font-weight:600;padding:13px 14px}.dialogbody .tablewrap td{padding:13px 14px;line-height:1.7;white-space:normal;min-width:80px;max-width:300px;overflow-wrap:anywhere}.dialogbody .tablewrap input[type=number]{min-width:76px;width:90px}.dialogbody .tablewrap select{min-width:100px}.dialogbody .history-table td:last-child{min-width:180px}.dialogbody .tablewrap td .btn{white-space:nowrap}.dialogbody .tablewrap label{display:flex;align-items:center;gap:9px}.dialogbody .tablewrap input[type=checkbox]{flex:none}.detail-focus{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;background:#f3efff;border:1px solid #d9cef5;border-radius:10px;margin-bottom:22px}.detail-focus strong{font-size:18px;color:#342352}.detail-focus p{margin-top:7px;font-size:13px;color:#615476;line-height:1.6}.detail-focus .badge{flex:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.content>.card+.card,.cardbody>.tablewrap+.tablewrap{margin-top:24px}.cardhead{gap:16px}.cardhead .row{flex-wrap:wrap}.cardbody:empty{display:none}.content .tablewrap td{line-height:1.7}.content .tablewrap td:last-child{white-space:normal;min-width:105px}.content .tablewrap th{line-height:1.7}.content>.filterbar{margin-bottom:22px}.content .stack{gap:24px}.recordline{line-height:1.7}.certcard{margin:20px 0}.section-tools{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin-bottom:20px}.section-tools .field{min-width:180px}.section-tools .btn{height:40px}.dense-note{font-size:12px;color:#63718a;line-height:1.7;margin:12px 0}.report-tabs{display:flex;gap:8px;margin-bottom:22px;border-bottom:1px solid #dde4ee;padding-bottom:12px}.report-tabs button.active{background:#5840bd;color:white}.import-errors{color:#a92f3b}.field input:focus-visible,.field select:focus-visible,.field textarea:focus-visible{outline:2px solid #967cdd;outline-offset:2px}.dialogfoot .btn{min-height:40px}
@media(max-width:760px){#dialog{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}#dialog-form{max-height:calc(100dvh - 16px)}.dialogbody{padding:20px 16px}.dialoghead,.dialogfoot{padding:16px}.detail-table .detail-label{width:21%}.detail-table th,.detail-table td{padding:10px 8px;font-size:12px}.dialogbody .formgrid{row-gap:20px}.detail-focus{align-items:flex-start}.detail-focus strong{font-size:16px}.dialogbody .workflow-actions .btn.primary{margin-left:0}.section-tools{align-items:stretch}.section-tools .field{min-width:0;flex:1}.dialogbody .tablewrap table{min-width:580px}}
#dialog:has(.dialogbody>p:only-child){width:460px}
#dialog:has(.dialogbody>.field):not(:has(.formgrid,.tablewrap,.detail-table-wrap)){width:640px}
/* V1.4 shared page rhythm: one heading row, explicit section spacing, readable tabs. */
.pagehead{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:20px;min-height:42px}.pagehead>.row{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:none}.pagehead h1{margin:0;white-space:nowrap}.cardhead{padding:18px 22px 12px;min-height:0}.cardhead h2{margin:0}.cardhead+.cardbody{padding-top:8px}.cardbody>.filterbar:first-child{padding:0 0 18px;margin:0}.cardbody>.section-tools:first-child{margin-top:4px;margin-bottom:18px}.tabs{gap:12px;padding:10px 18px 0;display:flex;flex-wrap:wrap;overflow:visible}.tabs .tab{min-height:44px;padding:10px 14px 12px;gap:9px;font-size:13px;white-space:nowrap;border-radius:6px 6px 0 0}.tabs .tab.active{background:#f3efff;color:#5036b3;font-weight:650}.tabs .tab small{font-size:11px;min-width:20px;text-align:center;line-height:20px;padding:0 4px}.business-list>.filterbar{padding:18px 22px}.scope-switch{display:flex;gap:6px;width:fit-content;background:#e9edf5;border:1px solid #dfe4ed;padding:4px;border-radius:9px;margin:0 0 18px}.scope-switch button{background:transparent;border:0;border-radius:6px;color:#546179;padding:9px 16px;cursor:pointer;font-size:13px}.scope-switch button.active{background:white;color:#5136b2;box-shadow:0 1px 4px #22304918;font-weight:650}.phase-flow{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:20px 0}.phase-flow .flowstep{min-width:0;white-space:normal;line-height:1.5}.dialogbody>.detail-table-wrap+.btn,.dialogbody>.details+.btn{margin-top:4px;margin-bottom:10px}.dialogbody>.btn+.btn{margin-left:10px}.dialogbody .detail-section>.btn{margin-right:10px;margin-top:4px}.detailtabs{display:flex;gap:12px;flex-wrap:wrap;padding-bottom:14px;margin-bottom:22px}.detailtabs button{padding:11px 14px;min-height:42px;white-space:nowrap}.tablefoot .pages{align-items:center;gap:12px}.cardbody:has(>.filterbar)>.tablewrap{margin-top:0}
@media(max-width:760px){.pagehead{align-items:flex-start;gap:14px}.pagehead>.row{justify-content:flex-start;width:100%}.pagehead h1{font-size:22px}.tabs{padding:8px 10px 0;gap:4px}.tabs .tab{padding:9px 10px;font-size:12px;min-height:42px}.business-list>.filterbar{padding:16px}.cardhead{padding:16px 16px 10px}.scope-switch{max-width:100%;flex-wrap:wrap}.scope-switch button{padding:9px 11px}.phase-flow{grid-template-columns:repeat(2,minmax(0,1fr))}.detailtabs{gap:6px}.detailtabs button{padding:10px;font-size:12px}.dialogbody>.btn+.btn{margin:6px 8px 6px 0}}
.business-list .tablewrap table{width:100%;table-layout:fixed;min-width:900px}.business-list .tablewrap td,.business-list .tablewrap th{white-space:normal;overflow-wrap:anywhere;padding:14px 16px}.business-list .person{min-width:0;gap:8px}.business-list .person>div{min-width:0}.business-list .person small{max-width:130px}.business-list .tablewrap th:first-child{width:175px}.business-list .tablewrap th:last-child{width:105px}.task-list .tablewrap th:nth-child(3){width:180px}.business-list .person .avatar{flex:none}
.assessment-next{padding:12px 16px;border:1px solid #e3dcf7;border-radius:8px;background:#faf8ff;align-items:center}.assessment-next .muted{font-size:13px}.dialogbody>.assessment-next{margin:0 0 20px}
.filterbar label.searchfield{flex-wrap:nowrap;gap:8px;min-height:40px}.filterbar .searchfield svg{flex:0 0 15px}.filterbar .searchfield .input{min-width:0;flex:1;width:0}
