# Task 2: subscription calculator

Build one complete, self-contained HTML document for tracking subscription costs. Return only the HTML source; do not wrap it in Markdown fences or add an explanation. The document must work offline with no external assets, libraries, build step, or server. The user should be able to save/download the HTML file and open it locally.

Each entry has a name, a price, a billing period (monthly or annual), and a “Cancel before renewal” toggle. Let the user add and remove entries. Persist the list and cancellation choices locally across reloads when browser storage is available. If storage is blocked or unavailable, keep the calculator usable for the current page and show a brief, accurate notice that changes will not persist.

Show annualized active spend in USD: multiply active monthly prices by 12, add active annual prices once, and exclude entries marked for cancellation. Calculate in integer cents, then format displayed values to two decimal places. Reject blank, negative, non-numeric, more-than-two-decimal, and unsafe-range prices without changing the saved total. Do not use floating-point accumulation for money.

Acceptance checks:

1. A monthly entry, annual entry, add/remove controls, cancellation toggle, and annualized total are present and usable.
2. `$15.00/month` plus `$120.00/year` displays `$300.00/year`.
3. Toggling either entry for cancellation removes its annualized cost; toggling it back restores the cost. Removing an entry removes its cost.
4. Valid entries and cancellation states survive reload when local storage is available.
5. Blank, negative, non-numeric, over-precision, and out-of-range inputs are rejected with a clear message; existing valid entries and totals remain intact.
6. If local storage reads or writes throw, the document remains interactive in memory and clearly reports that persistence is unavailable.
7. All currency arithmetic uses integer cents, with displayed equivalents rounded/formatted to cents. The document has no network dependency and remains usable on a narrow screen and with a keyboard.

Keep the implementation compact and understandable. Do not claim that data is encrypted or sent nowhere based on browser storage alone.
