Estabas totalmente en lo cierto.

English Translation

You were totally right.

I’m confused on the grammatical function of “lo” here.

This is a regular article + adjective = noun phrase, only because the article is neuter, it refers to the quality in the abstract rather than something or someone specific. Compare ‘el malo’ = ‘he who is bad, the bad one’ with ‘lo malo’ = ‘that which is bad’, or here ‘lo cierto’ = ‘that which is true, the truth’.

2 Likes