Without looking at code is kind hard. But I would probably say that the css links are using relative path. so if you are in a route /foo/bar, is trying to load /foo/bar/style.css and if you change to route /pim/pam/pum will try to load /pim/pam/pum/style.css.
But this is just wild guess. Try to had a initial / to <link _rel_="stylesheet" _href_="/styles.css">