大宝律令
The structure of the royal household and ranks for court ladies were defined in Taihō Code and Yōrō Code. In these Codes, there were originally to have been twelve sections, and the various ranks for ladies' of the Imperial household within the Kōkyū were defined.