{# The site-wide popup: the maintenance notice (app.MAINTENANCE_NOTICE, off when "") and, for the demo accounts only,
the sign-up notice with its link (owner, 2026-10-11: demo visitors still see it). The signed-out landing page has no
popup since the landing rebuild (owner, 2026-10-08); it carries the sign-up link instead. #}
{% set npath = request.url.path if request else '' %}
{% set signup_cta = signup_on() and is_demo(user) and npath != '/signup' %}
{% if maintenance_notice() or signup_cta %}
{% endif %}
{# The add-email popup (owner, 2026-10-11): a registered account with no email on file (made before email was required
at sign-up), once per browser session, on every app page but Settings. Demo accounts never see it. #}
{% if not (maintenance_notice() or signup_cta) and request and npath not in ('/settings', '/settings/email') and needs_email(user) %}
{% endif %}