{% if theme.dark_mode.enabled %} {% else %} {% endif %} {# System pages (/_hcms/mem/* login/register/reset, error pages) render OUTSIDE the normal theme context: every {{ theme.* }} AND get_asset_url('../../…') comes back empty here, so external s load nothing and the page is unstyled. Two consequences handled below: 1. The token bake is GUARDED — an empty `--color-primary: ;` would defeat the `var(--color-primary, #fallback)` fallbacks in system-pages.css, so we only emit a token when the theme value is actually present (works on error pages that DO carry context; falls back cleanly on membership pages that don't). 2. The stylesheet is INLINED via {% include %} (compile-time template composition — the same mechanism that makes {% extends %} work here — which is unaffected by the missing theme context). system-pages.css is fully self-contained: it defines its own --system-* tokens and every --color-* reference carries a hex fallback. We deliberately do NOT pull in modern.css (it bundles forms.css, which double-styles HubSpot's membership widgets, and its brand tokens can't bake here anyway). #} {# Additional CSS blocks #} {% block additional_css %}{% endblock %} {{ standard_header_includes }}