Now that you mention it, I had myself convinced I was writing a .css file when in actuality the Custom Code pages are accepting HTML instead.
I think I’ll try to use a JS script to do as you said, check URL, then find and add classes to the elements I was targeting in my CSS instead, thanks for the suggestion!
EDIT: Thanks to @russian-dima’s suggestion, I managed to style the elements directly via JS! Also combined this to have my dynamic pages postMessage() for my CustomCode to detect, so that I do not have to hardcode the URLs.