{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {# aria-live on the always-present wrapper, not role="alert" per message, so messages that land in it via a fragment swap are announced. `assertive` only for errors — a success confirmation should not interrupt the reader. #}