The statement is ready. Goal: the summary shows the smallest possible number of transfers, and next to it an explanation for an ordinary person: how much was spent in total, how much each one paid, what their share is, what their outcome is and why there are exactly this many transfers.
Accepted decisions. The minimum is found like this: the transfers needed are n minus g, where n is the number of participants with a non-zero balance and g is the largest number of zero-sum groups they can be split into. g is found by an exact search over subsets, inside each group the former greedy pass works. The limit of the exact search is 16 participants with a non-zero balance, beyond that the calculation stops being instant. If there are more such participants, a fallback works: a greedy pass over all, it is correct and gives at most n minus 1 transfers, but does not guarantee the minimum; the result marks this with a flag, and the interface honestly says so. The result is deterministic: among equal options the participant with the smaller number is taken, transfers are sorted by debtor, then by recipient. A non-zero sum of balances is a contract error, the calculation throws an exception. How much was paid and what the share is are counted in the domain logic, the balance outcome is computed in one place. The wording does not depend on gender, declension goes through Intl.PluralRules. The note about kopecks is shown only if there is an expense that does not divide evenly.
Plan: add counting the total of the expenses and a check of uneven division; extend the balance with the fields paid and share; rewrite the transfer calculation (exact group search, greedy pass inside groups, sorting, the limit as a constant); add declension of numerals and a module with the explanation texts; in the summary section show the transfers, the phrase "why this many" and the block "How it is calculated" with a row per participant and notes; add the minimum of styles, do not touch the mobile layout.
Done criteria: make check is green; for balances 300, 200, minus 200, minus 300 exactly two transfers come out, although the greedy one gave three; one paid for three — two transfers of 300 rubles; mutual 500 for 500 — no transfers, 700 for 300 — one transfer of 400 rubles; 100 rubles for three — shares 33.34, 33.33 and 33.33, the sum of the transfers adds up to the kopeck; after the transfers all balances are zero; zero expenses — only the hint without the block "How it is calculated"; exactly at the limit and one above the limit the behavior is checked; the result repeats, the input data does not change. In the interface for "Ann paid 900 for three" the total, the rows per participant and the phrase about two transfers are visible. For "Ann 300 for Ben, Clara 200 for Eve" the phrase starts with "2 transfers instead of 3".
The tests lie next to the code and cover all the listed cases, as well as declension, the explanation texts and the interface scenarios.
Out of scope: the "Share" link, the mobile layout, the README and Pages. Noticed on the way and not fixed: the aria-live area hangs on the whole summary section, and a screen reader will read a lot of text on every change.