For the benefit of other brave souls who want a clearer picture of what I did (rightly or wrongly), here's a picture. I take no responsibility if your house burns down! It's starting to make sense to me. Note that the L1 and L2 on the thermostat have black and red leads (respectively) which I capped to the black and white power supplies, but I've shown the L2 as a single white supply wire to emphasize the origin.