Card_mod not working first time

When I open App HA for the first time the first cards screen does not show the Card_mod styles. When I recharge or change the screen it is solved. I don’t know what to do. Thank you.

Car_mod not working

Card_mod ok

type: vertical-stack
  - show_name: false
    show_icon: true
    type: button
      action: call-service
      service: script.apagado_total
      target: {}
    entity: script.apagado_total
    icon_height: 50px
      style: |
        ha-card {
            background: rgba(100, 130, 140, 0.95);
            --card-mod-icon-color: white;