EU, UK agree on terms of Brexit transition deal