Help with Fold-entity-row to toggle header toggle + change state color

hello everyone, i am trying to solve this issue for days but am not able to do it and really it is driving me crazy.
actually i am having a lovelace card includes a custom fold entity row and i need to acheive 2 things as shown below but i can only have 1 of them done, not both together at the same time, as shown in the below image:

1st: this custom fold entity row to toggle the header toggle of the main card
2nd: to have the state color true for it

it is only 1 row if i add it then i have 1st feature but the 2nd is not done, and when i delete this row then i lose the 1st feature but i get the 2nd done.

so please help to have both features (toggle the header + state color)
thank you in advance.

Any one faced this issue before or can help to solve it?