feels like a case of a system prompt should be enforcing the AI to avoid usage of arbitrary numbers like specific pixel counts and to leverage modern css standard for sizes.
that gave the best results so far - tweaking the system prompt to make sure the agent respects the project's ui system, is aware of dark mode and responsiveness, etc.