Check out my app called Cold Turkey Blocker:
https://getcoldturkey.com
You can count time used in non-foregrounded windows by going to Settings > Statistics and turning on the strict feature.
You can count time used in non-foregrounded windows by going to Settings > Statistics and turning on the strict feature.
Plus I’d prefer something that has mobile support.