/* Popup sizing is independent of workspace and document print layout. */
@media screen{
 #corporate-workspace #editor{width:min(760px,calc(100% - 32px));--cm-editor-content-width:60%;--cm-label-width:125px;--cm-field-gap:14px}
 #corporate-workspace #editor.contact-editor{width:min(850px,calc(100% - 32px))}
 #corporate-workspace #editor:not(:has(#editor-fields>*,#editor-extra>*)){width:min(520px,calc(100% - 32px))}
 #corporate-workspace #editor.add-corporation-editor{width:min(475px,calc(100% - 32px))}
 #corporate-workspace #editor #editor-title{padding-right:0}
 #corporate-workspace #editor .dialog-actions{width:var(--cm-editor-content-width);margin-inline:auto;flex-wrap:wrap}
 #corporate-workspace #editor .field-label{max-width:100%;min-width:0}
 #corporate-workspace #editor .address-locality{grid-template-columns:minmax(0,1fr)}
 #corporate-workspace #editor .address-locality>.field-label:last-child{grid-template-columns:minmax(90px,var(--cm-label-width)) minmax(0,1fr)}
 #corporate-workspace #editor:has(.role-permissions,.widget-picker){width:min(850px,calc(100% - 32px))}
 #corporate-workspace #editor .widget-picker{grid-template-columns:repeat(2,minmax(0,1fr))}
 #corporate-workspace #editor .colour-codes{grid-template-columns:repeat(3,minmax(0,1fr))}
 #corporate-workspace #editor .colour-codes>label:first-child{grid-column:1/-1}
 /* Wide document rows and previews need usable column/document width. */
 #corporate-workspace #editor:has(.table-scroll):not(.add-corporation-editor){width:min(950px,calc(100% - 32px));--cm-editor-content-width:100%}
 #corporate-workspace #editor:has(.receipt-items,.receipt-batch){width:min(1300px,94vw);--cm-editor-content-width:100%}
 #corporate-workspace #editor .recoverable-corporations .table-scroll{max-width:100%}
 #corporate-workspace #preferences-dialog{width:min(680px,calc(100% - 32px))}
 #corporate-workspace #preferences-dialog>header{position:relative;display:block}
 #corporate-workspace #preferences-title{width:60%;margin-inline:auto;font-size:23px}
 #corporate-workspace #preferences-close{position:absolute;right:0;top:0}
 #corporate-workspace .billing-editor{width:min(560px,calc(100% - 32px))}
 #corporate-workspace .billing-editor>header{position:relative;display:block}
 #corporate-workspace .billing-editor>header>h2,#corporate-workspace .billing-editor>section,#corporate-workspace .billing-editor>.error{width:60%;margin-inline:auto;overflow-wrap:anywhere}
 #corporate-workspace .billing-editor>header>.addons-close{position:absolute;right:0;top:0}
 #corporate-workspace .billing-editor .billing-option{flex-wrap:wrap;gap:6px;padding:12px;min-height:0}
 #corporate-workspace .billing-editor .billing-facts{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:10px}
 #corporate-workspace .billing-editor .billing-actions{gap:8px}
 #corporate-workspace .billing-editor .billing-actions button{min-width:100px;max-width:100%;flex:0 1 auto}
}
@media screen and (max-width:700px){
 #corporate-workspace #editor,#corporate-workspace #editor.contact-editor,#corporate-workspace #editor.add-corporation-editor{--cm-editor-content-width:100%;--cm-label-width:100px}
 #corporate-workspace #preferences-title,#corporate-workspace #workspace-preferences{width:100%}
 #corporate-workspace #preferences-title{padding-right:36px}
 #corporate-workspace .billing-editor>header>h2,#corporate-workspace .billing-editor>section,#corporate-workspace .billing-editor>.error{width:100%}
 #corporate-workspace .billing-editor>header>h2{padding-right:36px}
}
