Trucking companies and truck owner-operators are scrambling to figure out how to operate under a new California law that toughens definitions of nonemployee drivers, upending decadeslong practices that have allowed truckers to work as independent contractors.