Britain and the European Union have agreed to a transition period to avoid a "cliff edge" Brexit next year - though only after London accepted a potential solution for Northern Ireland's land border that may face stiff opposition at home.