CSS to hide the Activity or Messages tabs on the group detail page

Look higher up in the HTML. Each of those pages has a unique class that gets added to the <body> tag.

For example, on the /messages page, you’ll see this.

unique page class in browser inspect tools

This class won’t be added on the other pages, only on the messages page.

Discourse uses SCSS. So, you can nest selectors like so

// styles for the /messages page
.user-messages-page {
  // hide user avatar/name/username
  .user-profile-names,
  .user-profile-avatar {
    display: none;
  }
}

Regular CSS works too.