It just occurred to me that it is very easy to explain using Spanish: I would use "sveiki" or "labdien" (literally 'good day') when greeting a person I would address as "Ud." (a doctor, a professor, a salesperson etc.) and "čau" for people I address as "tú" (my family, friends, acquaintances not much older than me etc.). The only remaining hurdle is that Latvians seem to be more reserved and shy about using "tú" than Spanish-speaking people (according to my limited experience).
Interestingly, there is a pair of greetings that are less familiar than "čau", but not as formal as "sveiki": these are "sveiks"/"sveika" used to greet a male/a female respectively (note: not two people, but a single person, as these are essentially adjectives that have assumed a new function; the ending depends on the sex of the person, as well as the number of people). These, too, are basically for people you'd address as "tú".