golfed to 1054 - mostly reusing a single "≢" call instead of 3 separate ones +&- and >&<, but also many other small things (but there are still a couple golfing opportunities, including obvious redundant parentheses which i can't be bothered to manually remove)
https://tio.run/##pVRLasNADN33FF5KoAdRN7lB7xEodBNot71AFoFCe4X2Zr5IKmk@nvE4JSWOiSyN9ObpjezD2xHP74fj68vl8jSfPkkBZSKS@fTFZM9mhcMpl0JJWd0yhAWWBpX4QS215EUpMkhCjpDCnPn87R4AzvhlmdptM5OE5QF1wMBLTmacPGTEoYE/MC1pqaIV0Jpa7IyllQVtbJPT6pqJN1C9DTrMgYFmlyylEJmdP368nKkhs2TCl@Nk4lS6Zphuoi0rTEFDKEfjwNHQ6QXGBrU6GDpoDB1jtytfhRNxeGgdOeoEU6lc2zqp@eAs3oDd…