Text this: Shape optimized acoustic metagratings for anomalous refraction under strong thermoviscous effects