Compact-like totally dense subgroups of compact groups