Banks closed a record number of branches last year as the pandemic pushed more customers to online and mobile banking.