bool isRefreshTokenScopeAlias(String scope) {
  final normalized = scope.trim().toLowerCase();
  return normalized == 'offline' || normalized == 'offline_access';
}

List<String> filterConsentScopes(Iterable<String> scopes) {
  return scopes
      .map((scope) => scope.trim())
      .where((scope) => scope.isNotEmpty && !isRefreshTokenScopeAlias(scope))
      .toList(growable: false);
}
