noun
taxing one's ingenuity in devising something; agonizing over design or creation; making strenuous efforts to devise good ways and means
A yojijukugo describing the intense mental effort and creative struggle involved in designing, planning, or devising something. Often used in literary or formal contexts to emphasize the painstaking process of creation.
彼の新作は意匠惨憺の末に生まれた傑作だ。
His new work is a masterpiece born after much agonizing over its design.
意匠惨憺して練り上げた企画がようやく採用された。
The plan, devised after strenuous efforts, was finally adopted.
苦心惨憺 also means taking great pains, but it is broader and refers to any kind of hard work or struggle, not specifically to creative design or ingenuity.
A yojijukugo composed of 意匠 (design, idea) and 惨憺 (distressing, painful), literally meaning 'distressing design'. The exact historical origin is uncertain, but it is a classical Chinese-derived expression used to describe the agony of creation.