Iran wary but pragmatic as Taliban resurges next door