.source-edit-trigger,[data-source-editor]{display:none!important}
.source-project-editable .source-edit-trigger,.source-project-editable [data-source-editor]{display:inline-block!important}
.source-edit-trigger{border:1px solid var(--line,#E4E4E2);background:#fff;color:var(--ink,#262829);border-radius:7px;padding:4px 10px;margin:0;font-size:11px;font-weight:700;cursor:pointer;font-family:inherit;white-space:nowrap}
.source-edit-trigger:hover{border-color:var(--charcoal,#4C4D4F)}
.source-edit-trigger:focus-visible{outline:2px solid var(--charcoal,#4C4D4F);outline-offset:2px}
.source-edit-trigger + .source-document-trigger{margin-left:4px}
#sourceEditor{width:min(850px,94vw);max-height:88vh;box-sizing:border-box;padding:24px;border:1px solid #d2d8d2;border-radius:12px;color:#26392c;background:#fff;font:14px/1.5 system-ui;box-shadow:0 18px 70px #0003}
#sourceEditor::backdrop{background:#10241888}
#sourceEditor .source-editor-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
#sourceEditor h2{margin:0;font-size:21px}
#sourceEditor h3{font-size:15px;overflow-wrap:anywhere}
#sourceEditor [data-message]:not(:empty){padding:12px;background:#f0f5ec;border-radius:6px}
#sourceEditor .source-editor-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;border:0;padding:0;margin:16px 0}
#sourceEditor label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600}
#sourceEditor input,#sourceEditor select,#sourceEditor textarea{box-sizing:border-box;max-width:100%;width:100%;padding:8px;border:1px solid #c8d1c8;border-radius:5px;font:14px system-ui;color:#253b2a;background:white}
#sourceEditor input[type=checkbox]{width:20px;height:20px}
#sourceEditor button{padding:8px 12px;border:1px solid #bdcbbd;border-radius:5px;background:#f5f8f5;color:#26402c;font:13px system-ui;cursor:pointer}
#sourceEditor button:disabled,#sourceEditor fieldset:disabled{opacity:.55;cursor:default}
#sourceEditor .source-editor-actions{display:flex;gap:10px;margin-top:18px}
#sourceEditor [data-save]{background:#2f5238;color:#fff}
#sourceEditor .source-editor-row{display:block;width:100%;text-align:left;margin:5px 0;overflow-wrap:anywhere}
#sourceEditor dt{font-weight:600;margin-top:12px}#sourceEditor dt small{font-weight:400}#sourceEditor dd{margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}
#sourceEditor [data-rows]{margin-top:15px}
@media(max-width:600px){#sourceEditor .source-editor-fields{grid-template-columns:1fr}#sourceEditor{padding:16px}}

/* Financial editing follows the supplied dynamic-51 model's cmodal/detgrid UI. */
body:has(#sourceEditor[open]){overflow:hidden}
#sourceEditor.financial-source-editor{width:min(820px,calc(100vw - 40px));max-height:90vh;padding:0;border:0;border-radius:12px;color:var(--ink,#262829);background:#fff;font:12px/1.45 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 24px 60px #0005}
#sourceEditor.financial-source-editor::backdrop{background:rgba(38,40,41,.55)}
#sourceEditor.financial-source-editor .source-editor-head{padding:14px 18px 6px;position:sticky;top:0;background:white;z-index:3}
#sourceEditor.financial-source-editor h2{font:800 16px/1.4 Inter,sans-serif;color:var(--ink);overflow-wrap:anywhere}
#sourceEditor.financial-source-editor [data-close]{font-size:0;border:0;background:none;padding:6px;color:var(--grey);min-width:28px;min-height:28px}
#sourceEditor.financial-source-editor [data-close]::after{content:'✕';font-size:16px}
#sourceEditor.financial-source-editor [data-content]{padding:6px 18px 0}
#sourceEditor.financial-source-editor [data-message]:empty{display:none}
#sourceEditor.financial-source-editor [data-message]:not(:empty){margin:8px 18px;padding:10px 12px;background:#fbf1d6;color:var(--ink);border-radius:7px}
#sourceEditor.financial-source-editor .source-model-fields{border:0;margin:0;padding:0;min-width:0}
#sourceEditor.financial-source-editor .detgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:12px 14px 14px;background:#fff}
#sourceEditor.financial-source-editor .detf{min-width:0}
#sourceEditor.financial-source-editor label{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.4px;color:var(--grey,#8c8f91);font-weight:700;margin-bottom:4px}
#sourceEditor.financial-source-editor input,#sourceEditor.financial-source-editor select,#sourceEditor.financial-source-editor textarea{width:100%;max-width:100%;border:1px solid var(--line,#e4e4e2);border-radius:7px;padding:6px 8px;font-family:inherit;font-size:12px;line-height:1.4;color:var(--ink);background:#fff}
#sourceEditor.financial-source-editor input:focus,#sourceEditor.financial-source-editor select:focus,#sourceEditor.financial-source-editor textarea:focus{outline:none;border-color:var(--yellow,#f1d30e);box-shadow:0 0 0 2px rgba(241,211,14,.3)}
#sourceEditor.financial-source-editor textarea{resize:vertical;min-height:46px}
#sourceEditor.financial-source-editor input[type=checkbox]{width:16px;height:16px;accent-color:#2e7d5b;cursor:pointer}
#sourceEditor.financial-source-editor .source-wide{grid-column:1/-1}
#sourceEditor.financial-source-editor .source-span-two{grid-column:span 2}
#sourceEditor.financial-source-editor .detval{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;padding:6px 0;color:var(--ink)}
#sourceEditor.financial-source-editor .source-calculated small{display:block;font-size:9px;font-weight:400;color:var(--grey)}
#sourceEditor.financial-source-editor .source-unavailable{color:var(--grey)}
#sourceEditor.financial-source-editor .amtwrap{display:flex;align-items:center;justify-content:flex-end;gap:2px;font-weight:700;color:var(--grey)}
#sourceEditor.financial-source-editor .amtwrap input{text-align:right;max-width:110px;font-variant-numeric:tabular-nums}
#sourceEditor.financial-source-editor .idet-h{padding:0;margin:2px 0 7px;font-size:9.5px;text-transform:uppercase;letter-spacing:.5px;color:var(--grey);font-weight:700}
#sourceEditor.financial-source-editor .source-table-scroll{max-width:100%;overflow-x:auto}
#sourceEditor.financial-source-editor .pa-hist{width:100%;margin:0 0 10px;border:0;border-collapse:collapse;background:#fff}
#sourceEditor.financial-source-editor .pa-hist th{background:#fff;color:var(--grey);font-size:9.5px;letter-spacing:.3px;text-transform:uppercase;padding:5px 8px;border-bottom:1px solid var(--line);text-align:left}
#sourceEditor.financial-source-editor .pa-hist td{padding:5px 8px;border-bottom:1px solid #efefec;font-size:11px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#sourceEditor.financial-source-editor .pa-hist .r{text-align:right}
#sourceEditor.financial-source-editor .pa-hist .c{text-align:center}
#sourceEditor.financial-source-editor .alloc-tbl select{font-size:11px;padding:3px 6px;min-width:140px;max-width:250px}
#sourceEditor.financial-source-editor .alloc-tbl input{font-size:11px;padding:3px 6px;width:88px}
#sourceEditor.financial-source-editor .alloc-foot td{font-weight:700;border-top:1px solid var(--line);background:#fafaf8}
#sourceEditor.financial-source-editor .alloc-foot.ok td{color:var(--green)}
#sourceEditor.financial-source-editor .alloc-foot.war td{color:var(--red)}
#sourceEditor.financial-source-editor button{font-family:inherit;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font-size:11.5px;font-weight:600;cursor:pointer;transition:background .15s,border-color .15s}
#sourceEditor.financial-source-editor button:hover{border-color:var(--charcoal)}
#sourceEditor.financial-source-editor button:focus-visible{outline:2px solid var(--yellow);outline-offset:2px}
#sourceEditor.financial-source-editor button:disabled{opacity:.5;cursor:default}
#sourceEditor.financial-source-editor [data-add-allocation]{background:var(--yellow);border-color:transparent}
#sourceEditor.financial-source-editor .source-invoice-detail{padding:10px 14px 12px}
#sourceEditor.financial-source-editor .pa-dettabs{display:inline-flex;margin-bottom:10px;border:1px solid var(--line);border-radius:8px;overflow:hidden}
#sourceEditor.financial-source-editor .pa-dettabs button{border:0;border-radius:0;padding:5px 13px;text-transform:uppercase;font-size:10px;letter-spacing:.4px;color:var(--grey)}
#sourceEditor.financial-source-editor .pa-dettabs button.on{background:var(--charcoal);color:#fff}
#sourceEditor.financial-source-editor .source-support{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:12px 14px}
#sourceEditor.financial-source-editor .source-support-stacked{grid-template-columns:1fr}
#sourceEditor.financial-source-editor .source-release-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}
#sourceEditor.financial-source-editor .source-additional{margin:8px 14px;color:var(--grey);font-size:11px}
#sourceEditor.financial-source-editor summary{cursor:pointer;padding:6px 0}
#sourceEditor.financial-source-editor .source-editor-actions{position:sticky;bottom:0;display:flex;align-items:center;gap:10px;margin-top:8px;padding:14px 0 18px;background:#fff;z-index:2}
#sourceEditor.financial-source-editor .source-actions-spacer{flex:1}
#sourceEditor.financial-source-editor [data-browse]{font-size:11px;color:var(--grey);border-color:transparent;padding:6px 0}
#sourceEditor.financial-source-editor [data-save]{background:var(--yellow,#f1d30e);color:var(--ink);border:0;padding:9px 18px;font-size:13px;font-weight:800}
#sourceEditor.financial-source-editor [data-cancel]{padding:9px 16px;font-size:13px}
#sourceEditor.financial-source-editor [hidden]{display:none!important}

@media(max-width:600px){#sourceEditor.financial-source-editor{width:calc(100vw - 20px);max-height:94dvh}#sourceEditor.financial-source-editor [data-content]{padding:4px 10px 0}#sourceEditor.financial-source-editor .detgrid,#sourceEditor.financial-source-editor .source-support,#sourceEditor.financial-source-editor .source-release-grid{grid-template-columns:1fr;padding:10px 4px}#sourceEditor.financial-source-editor .source-span-two{grid-column:auto}#sourceEditor.financial-source-editor .source-editor-actions{gap:6px;flex-wrap:wrap}#sourceEditor.financial-source-editor [data-browse]{width:100%;text-align:left}}
@media(prefers-reduced-motion:reduce){#sourceEditor.financial-source-editor button{transition:none}}
#sourceEditor.financial-source-editor .source-comment-add{display:flex;gap:6px;margin-top:8px}
#sourceEditor.financial-source-editor .source-comment-add input{min-width:0;flex:1}
#sourceEditor.financial-source-editor [data-post-comment]{background:var(--yellow);border-color:transparent;padding:5px 11px}
#sourceEditor.financial-source-editor .source-comment-edit{margin-top:6px;font-size:10px;color:var(--grey)}
#sourceEditor.financial-source-editor .cmt{display:flex;padding:5px 0;border-bottom:1px solid var(--line);font-size:11px}
#sourceEditor.financial-source-editor .cmt-tx{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink)}
#sourceEditor.financial-source-editor .cmt-empty{color:var(--grey-lt);font-size:11px}
button[data-source-invoice-check]{cursor:pointer;font-family:inherit}
button[data-source-invoice-check]:disabled{cursor:not-allowed;opacity:.55}
button[data-source-invoice-check][aria-busy=true]{cursor:progress;opacity:.75}

/* Invoice modal: the dynamic-51 field grid, single SOV, and supporting columns. */
#sourceEditor.source-invoice-editor [data-content]{padding-bottom:4px}
#sourceEditor.source-invoice-editor [data-browse]{display:none}
#sourceEditor.source-invoice-editor .source-invoice-detail{padding:10px 16px 12px 33px}
#sourceEditor.source-invoice-editor .source-support{padding:0;margin-top:12px}
#sourceEditor.source-invoice-editor .ss-sov{min-width:700px}
#sourceEditor.source-invoice-editor .ss-sov input{width:88px;padding:3px 6px;font-size:11px}
#sourceEditor.source-invoice-editor .ss-tot td{background:var(--d0,#f1f1ef);font-weight:700;border-top:2px solid var(--line,#e4e4e2)}
#sourceEditor.source-invoice-editor .ss-var.ok td{color:var(--green,#2e7d5b)}
#sourceEditor.source-invoice-editor .ss-var.war td{color:var(--amber,#a66d00);background:var(--softyel,#fff9db)}
#sourceEditor.source-invoice-editor .invamt-col{color:var(--sub,#2e7d5b);font-weight:700}
#sourceEditor.source-invoice-editor .attlist{display:flex;flex-direction:column;gap:6px}
#sourceEditor.source-invoice-editor .attrow{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line,#e4e4e2);border-radius:8px;padding:6px 9px;font-size:12px;flex-wrap:wrap}
#sourceEditor.source-invoice-editor .attname{flex:1;min-width:80px;color:var(--ink,#262829);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#sourceEditor.source-invoice-editor .attmini{font-size:11px;font-weight:700;padding:3px 9px;border-radius:6px}
#sourceEditor.source-invoice-editor .attupload{display:inline-flex;align-items:center;gap:6px;margin-top:7px;background:var(--charcoal,#4c4d4f);color:#fff;border-radius:8px;padding:7px 12px;font-size:12px;font-weight:700;text-decoration:none}
#sourceEditor.source-invoice-editor .source-support>.detf>label{font-size:9.5px;letter-spacing:.5px;margin:2px 0 7px}
#sourceEditor.source-invoice-editor [data-file-message]:empty{display:none}
#sourceEditor.source-invoice-editor .source-invoice-additional{border-top:1px solid var(--line,#e4e4e2);padding-top:4px}
@media(max-width:820px){#sourceEditor.source-invoice-editor .source-support{grid-template-columns:1fr}}
