Hi,
Various ways to do that. It depends on how fancy you want to get.
If you didn’t mind using numbers, you could simply do something like this in your template:
<div class="doc[*parent*]">
blah blah blah
</div>
So if your parent is document 5, you’d get a class value of "doc5". If there’s no parent, it would be "doc0". I added the verbiage "doc" because as I recall CSS objects to classes and ID’s beginning with numbers. A little abstract, maybe, but would be dirt-simple, and no TV needed, it’s automagic.
Cheers, Dave