Robuta

https://www.bram.us/2022/11/17/style-a-parent-element-based-on-its-number-of-children-using-css-has/
Leverage CSS :has() and :nth-child() to style a parent based on the number of children it has.
parent elementstylebasednumberchildren