Have had similar dramas with CSS. Opus/Sonnet seem to have far less taste and discipline in writing CSS - constantly they are trying to slam in changes with !important or inline styles rather than think through how to do it properly.
We can blame AI for slopcoding but it's just what we've been doing for decades now - who cares if it takes 9000 lines to do what in theory Linus and Knuth and Carmack could do in 3000? Our CPUs eat a million lines of code for breakfast and demand more.