How do I get category and page ID’s?

get_queried_object() has a property with that ID.

But you don’t really need it, because the <body> tag should have a class with the current category / page ID…