/* Workflow-only refinements: existing portal colours, typography and controls. */
.wf-editor,.wf-editor .panel,.wf-editor [data-r8-panel]{min-width:0;max-width:100%}
.wf-intro,.wf-section-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.wf-intro h2{margin-top:0}.wf-intro p{margin-bottom:0}
.wf-intro>.wf-backup{flex:0 1 22rem;min-width:0;max-width:100%}.wf-backup .button{min-height:44px;white-space:normal;max-width:100%}.wf-backup small,.wf-backup [role=status]{display:block;overflow-wrap:anywhere;font-size:.875rem;line-height:1.5;margin-top:.4rem;color:var(--muted,#5f6b82)}
.wf-intro>div,.wf-section-head>div{flex:1 1 22rem;min-width:0}
.wf-section-head>.field{flex:0 1 20rem;min-width:0;max-width:100%}
.wf-editor h2{margin-top:1.25rem}.wf-editor .wf-section-head h2{margin-top:0}
.wf-editor p,.wf-editor small,.wf-dialog p{overflow-wrap:anywhere}
.wf-table-scroll{width:100%;max-width:100%;overflow:auto;margin:1rem 0;border:1px solid var(--line,#dce3ec);border-radius:.8rem}
.wf-table-scroll:focus-visible{outline:2px solid var(--portal-accent,#a62878);outline-offset:3px}
.wf-table{width:100%;min-width:44rem;table-layout:fixed;border-collapse:collapse;margin:0}
.wf-table th,.wf-table td{padding:.8rem;vertical-align:top;text-align:left;white-space:normal;overflow-wrap:anywhere;border-bottom:1px solid var(--line,#dce3ec)}
.wf-table tbody tr:last-child td{border-bottom:0}
.wf-table th{background:var(--portal-accent-soft,#f4e7f0);font-size:.875rem}
.wf-table td>.field+.field,.wf-secondary .field{margin-top:.7rem}
.wf-table .field{display:grid;gap:.35rem;min-width:0;margin:0}
.wf-table .field>span{font-size:.875rem}
.wf-table :is(input,select,textarea){min-width:0!important;width:100%;max-width:100%;font:inherit}
.wf-table :is(input,select){min-height:44px;height:auto}
.wf-table small,.wf-save-bar small{display:block;margin-top:.4rem;color:var(--muted,#5f6b82);line-height:1.5}
.wf-route-table{min-width:54rem}.wf-route-table th:nth-child(1){width:7%}.wf-route-table th:nth-child(2){width:22%}.wf-route-table th:nth-child(3){width:22%}.wf-route-table th:nth-child(4){width:14%}.wf-route-table th:nth-child(5){width:20%}.wf-route-table th:nth-child(6){width:15%}
.wf-order-buttons{display:flex;flex-wrap:wrap;gap:.25rem;margin-top:.5rem}.wf-order-buttons .button{min-width:44px;min-height:44px;padding:.35rem;flex:1 1 44px}
.wf-editor .r8-step-number{width:2rem;min-height:2rem;height:auto}
.wf-toggle{display:flex;gap:.6rem;align-items:flex-start;min-height:44px;padding:.5rem 0;cursor:pointer;margin:0}
.wf-toggle>input[type=checkbox]{width:1.2rem!important;min-width:1.2rem!important;height:1.2rem!important;min-height:0!important;flex:0 0 1.2rem;margin:.15rem 0 0!important;accent-color:var(--portal-accent,#a62878)}
.wf-toggle span{min-width:0;overflow-wrap:anywhere}.wf-disabled-row>td{background:var(--surface-soft,#f7f8fb)}
.wf-secondary{margin:.5rem 0}.wf-secondary summary{min-height:44px;padding:.65rem 0;cursor:pointer;font-weight:600;overflow-wrap:anywhere}
.wf-secondary .button{margin-top:.75rem;width:100%;white-space:normal}
.wf-secondary summary:focus-visible,.wf-path-band summary:focus-visible,.wf-history-version summary:focus-visible{outline:2px solid var(--portal-accent,#a62878);outline-offset:2px}
.wf-amount-pair,.wf-limit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin-top:.6rem}
.wf-route-table .wf-amount-pair{grid-template-columns:minmax(0,1fr)}
.wf-rule-table th:first-child{width:30%}.wf-rule-table th:nth-child(2){width:17%}
.wf-policy-table th:first-child{width:27%}.wf-policy-table th:nth-child(2){width:32%}
.wf-save-bar{background:var(--surface,#fff);border-top:1px solid var(--line,#dce3ec);padding:1rem;border-radius:.8rem;margin-top:1rem}
.wf-save-bar>div{flex:1 1 24rem;min-width:0}.wf-save-bar .button{flex:0 1 auto;white-space:normal}
.wf-protected{padding:1rem;border-left:3px solid var(--portal-accent,#a62878);background:var(--surface-soft,#f7f8fb)}
.wf-path-band,.wf-history-version{border:1px solid var(--line,#dce3ec);border-radius:.8rem;padding:1rem;margin:1rem 0;min-width:0}
.wf-path-band>summary,.wf-history-version>summary{cursor:pointer;min-height:44px;overflow-wrap:anywhere}.wf-path-band>summary span,.wf-history-version>summary span{display:block;color:var(--muted,#5f6b82);margin-top:.4rem}
.wf-path{display:flex;gap:.7rem;flex-wrap:wrap;padding:0;list-style:none;counter-reset:workflow}
.wf-path li{counter-increment:workflow;flex:1 1 12rem;min-width:0;border:1px solid var(--line,#dce3ec);border-radius:.6rem;padding:.8rem;background:var(--surface,#fff);overflow-wrap:anywhere}
.wf-path li:before{content:counter(workflow);display:inline-grid;place-items:center;min-width:1.7em;min-height:1.7em;border-radius:50%;background:var(--portal-accent-soft,#f4e7f0);color:var(--portal-accent,#a62878);margin-bottom:.5rem;font-weight:700}
.wf-path li strong,.wf-path li span,.wf-path li small{display:block}.wf-path li span{margin-top:.3rem}
.wf-dialog{box-sizing:border-box;position:fixed;inset:0;margin:auto;padding:0;width:64rem;max-width:calc(100vw - 2rem);max-height:calc(100dvh - 2rem);border:1px solid var(--line,#dce3ec);border-radius:1rem;color:var(--text,#172338);background:var(--surface,#fff);font:inherit}
.wf-dialog[open]{display:flex;flex-direction:column}.wf-dialog::backdrop{background:rgb(15 23 42 / .55)}
.wf-dialog-head,.wf-dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding:1rem;border-bottom:1px solid var(--line,#dce3ec);flex-shrink:0}
.wf-dialog-head h2{margin:0;flex:1 1 14rem;font-size:1.2rem;overflow-wrap:anywhere}.wf-dialog-head .button{min-width:44px;min-height:44px}
.wf-dialog-content{overflow:auto;min-height:0;padding:0 1rem 1rem;overscroll-behavior:contain}
.wf-dialog-actions{border-top:1px solid var(--line,#dce3ec);border-bottom:0;justify-content:flex-end}.wf-dialog-actions .button{white-space:normal;min-height:44px}
.wf-impact{padding:.7rem 1rem;background:var(--portal-accent-soft,#f4e7f0);border-radius:.6rem;margin-top:1rem}
.wf-changes-table{min-width:36rem}.wf-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:720px){
 .wf-intro{padding:1rem}.wf-intro .button,.wf-section-head>.button{width:100%}
 .wf-tabs button{flex:1 1 calc(50% - .5rem);min-width:0}.wf-editor .panel{padding:1rem}
 .wf-table-scroll{border:0;overflow:visible}.wf-table{display:block;min-width:0!important;border:0}.wf-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .wf-table tbody{display:grid;gap:1rem}.wf-table tr{display:block;border:1px solid var(--line,#dce3ec);border-radius:.75rem;background:var(--surface,#fff);min-width:0}
 .wf-table td{display:block;width:auto!important;border:0;padding:.65rem .8rem;min-width:0}.wf-table td:before{content:attr(data-label);display:block;font-size:.85rem;color:var(--muted,#5f6b82);font-weight:700;margin-bottom:.4rem}.wf-table td:empty{display:none}
 .wf-route-table td:first-child{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--line,#dce3ec)}.wf-route-table td:first-child:before{margin:0}.wf-order-buttons{margin:0 0 0 auto;flex-wrap:nowrap}
 .wf-route-table .wf-amount-pair{grid-template-columns:repeat(2,minmax(0,1fr))}.wf-secondary{margin:0}
 .wf-save-bar .button{width:100%;flex:1 1 100%}.wf-dialog{max-width:calc(100vw - 1rem);max-height:calc(100dvh - 1rem);border-radius:.75rem}.wf-dialog-head,.wf-dialog-actions{gap:.5rem;padding:.75rem}.wf-dialog-actions .button{flex:1 1 10rem}.wf-dialog-content{padding:0 .75rem .75rem}
 .wf-path-band,.wf-history-version{padding:.75rem}.wf-path li{flex-basis:100%}
}
@media(max-width:380px){.wf-amount-pair,.wf-limit-grid,.wf-route-table .wf-amount-pair{grid-template-columns:minmax(0,1fr)}}

/* Payment voucher: keep totals and payment facts readable at every width. */
.pv-summary{display:flex;flex-wrap:wrap;gap:12px;margin:16px 0}
.pv-summary article{display:grid;gap:4px;padding:12px 18px;border:1px solid var(--border,#e3e8ee);border-radius:12px;background:var(--surface,#fff);min-width:160px}
.pv-summary small,.pv-facts dt{color:var(--muted,#66758a);font-size:.82rem}
.pv-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 24px;margin:20px 0 4px}
.pv-facts>div{min-width:0}.pv-facts dd{margin:5px 0 0;overflow-wrap:anywhere}
#ed-payment-review{border-left:4px solid var(--primary,#a52b7e)}
@media(max-width:800px){.pv-facts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.pv-facts{grid-template-columns:1fr;gap:14px}.pv-summary{display:grid;grid-template-columns:1fr 1fr}.pv-summary article{min-width:0;padding:12px}}
