Can anyone tell me where i have gone wrong with this code

  - type: template
    entity: input_boolean.notifications
    icon: mdi:bell
    tap_action:
      action: toggle
    hold_action:
      action: none
    card_mod:
      style: |
        /* Notification indicator */
        ha-card:after {
          /* Turn on indicator if there is a notification */
          {% set notifications = (expand(states.light.all_lights) | selectattr('state', 'eq', 'on') | list | count)
                               + (expand(states.binary_sensor.all_windows) | selectattr( 'state', 'eq', 'on') | list | count) 
                               + states('sensor.devices_with_low_battery') | int (0) %}
                               + states('sensor.devices_with_low_battery') | int (0) %}') | int %}
          {% if notifications > 0 %}
            content: "";
          {% endif %}

          /* Position & style notification */
          position: absolute;
          background: rgb(var(--rgb-red));
          border-radius: 50%;
          top: 6px;
          right: 6px;
          width: 8px;
          height: 8px;
        } 
alignment: justify

i get this log error and i dont know what i have done wrong.
Error while processing template: Template<template=(/* Notification indicator / ha-card:after { / Turn on indicator if there is a notification / {% set notifications = (expand(states.light.all_lights) | selectattr(‘state’, ‘eq’, ‘on’) | list | count) + (expand(states.group.all_windows) | selectattr( ‘state’, ‘eq’, ‘on’) | list | count) + states(‘sensor.devices_with_low_battery’) | int %} + states(‘sensor.devices_with_low_battery’) | int %}') | int %} {% if notifications > 0 %} content: “”; {% endif %} / Position & style notification */ position: absolute; background: rgb(var(–rgb-red)); border-radius: 50%; top: 6px; right: 6px; width: 8px; height: 8px; }) renders=2>

if any one can help thanks alot.
thanks

There is one opening {% and 3 closing %} here. Not sure if multiline is allowed for those. Best try it in developer tools → template

This is definitely wrong as was noticed by farmio.
The “%}” parts after “int (0)” should be removed.
Also, a quote in “int (0) %}')” is misplaced.
And “states(‘sensor.devices_with_low_battery’)” appears twice.

Why not just “background: var(–red-color)”? Or is “–rgb-red” some user-defined var?

did you try the template in the template editor of dev tools before putting it live in the system?