How to correct wrong iCloud imap server in Mac Mail app?

Mac Mail app always displays iCloud mailbox as an "offline server", while other mailboxes work well. Mac Mail app shows iCloud incoming mail server unrelated to iCloud and to my iCloud ID. The outgoing mail server line is empty.

The same iCloud mail account works well on the web and on iPhones but does not work with the Mac Mail app.

I have tried resetting the account, rebooting, reloading, etc., and also checked all Help articles and forums, but did not find any guidelines on how to correct incoming and outgoing server addresses for Mac Mail app.

MasOS: 14.5 Beta (23F5049f)