Card-mod style applies only to the preview

The following works in the frontend editors preview but not for the real card…

type: custom:github-flexi-card
url: true
attribute_urls: true
secondary_info: '{latest_release_tag}'
attributes:
  - views
  - clones
  - stargazers
  - forks
  - open_issues
  - open_pull_requests
entities:
  - entity: sensor.addon_ddns
    icon: mdi:cloud
    name: Cloudflare DDNS
card_mod:
  style:
    div:nth-child(1)>github-entity:
      $: |
        .icon ha-icon {
          color: var(--paper-item-icon-color) !important;
        }
        ha-icon {
          color: var(--switch-unchecked-button-color) !important
        }
        {% if state_attr('sensor.addon_ddns', 'open_issues') > 0 %}
          div:nth-child(7)>ha-icon {
            color: red !important
          }
        {% endif %}
        {% if state_attr('sensor.addon_ddns', 'open_pull_requests') > 0 %}
          div:nth-child(8)>ha-icon {
            color: green !important
          }
        {% endif %}

I can’t find any differences between the HTML structure of the preview and the final card.