Hearts and Celtic have secured spots in next season's Champions League qualifiers, with Hearts aiming for a first league title since 1960.