/* Заголовок и действия занимают один ряд. Переносится текст, а не кнопка над ним. */
.heading-row,:is(.pf-card-head,.pf-modal-head,.co-modal-head,.co-tpl-head,.tasks-dialog-head){display:flex;align-items:center;flex-wrap:nowrap;min-width:0}
.heading-row__title,:is(.pf-card-head,.pf-modal-head,.co-modal-head,.co-tpl-head,.tasks-dialog-head)>:is(.pf-card-title,.pf-modal-title,.co-tpl-title,.tasks-dialog-title){flex:1 1 auto;min-width:0;margin:0;overflow-wrap:anywhere}
.heading-row__actions,:is(.pf-card-head,.pf-modal-head,.co-modal-head,.co-tpl-head,.tasks-dialog-head)>:is(button,.pf-btn,.co-icon-btn,.tasks-icon){flex-shrink:0}
.heading-row__title.is-truncated{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Название системы и настройки — один первый ряд; метаданные используют ширину ниже. */
.pf-systems .pf-sys{grid-template-columns:var(--co-button-height) minmax(0,1fr) auto;column-gap:var(--space-3);row-gap:var(--space-1);align-items:center}
.pf-sys>.pf-sys-main,.pf-sys-main>.pf-sys-text,.pf-sys>.pf-sys-tools{display:contents}
.pf-sys-main>.pf-tile{grid-column:1;grid-row:1;align-self:center;justify-self:center}
.pf-sys-text>.pf-sys-name{grid-column:2;grid-row:1;min-width:0;align-self:center;overflow-wrap:anywhere}
.pf-sys>.pf-sys-tools>.pf-system-gear{grid-column:3;grid-row:1;align-self:center;justify-self:end}
.pf-sys-text>.pf-sys-meta,.pf-sys-text>.pf-muted,.pf-sys>.pf-sys-tools>.pf-system-help{grid-column:2 / -1;min-width:0;overflow-wrap:anywhere}
.pf-sys>.pf-sys-tools>.pf-system-help{justify-self:start;max-width:100%}
.pf-sys-meta>.pf-conn{min-width:0;overflow-wrap:anywhere}
.pf-sys-meta>.pf-conn::before{flex-shrink:0}
/* Старые абсолютные крестики не должны оставаться выше многострочного названия. */
.pf-modal:has(.pf-modal-close)>.pf-modal-head{padding-right:0;align-items:center}
.pf-modal-head>.pf-modal-close{position:relative;inset:auto;flex-shrink:0}
.tasks-dialog-head:has(>.tasks-task-tools){display:flex;align-items:center;padding:0;min-height:var(--co-button-height)}
.tasks-dialog-head>.tasks-task-tools{position:static;display:flex;flex:0 0 auto}
/* Legacy AppDialog: первый ряд — заголовок и крестик; текст и действия ниже на всю ширину. */
.app-dialog:has(>.app-dialog-title):has(>.app-dialog-close):not(dialog:not([open])):not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:var(--space-2)}
.app-dialog:has(>.app-dialog-title):has(>.app-dialog-close)>*{grid-column:1 / -1}
.app-dialog:has(>.app-dialog-close)>.app-dialog-title{grid-column:1;grid-row:1;min-width:0;padding-right:0;overflow-wrap:anywhere}
.app-dialog:has(>.app-dialog-title)>.app-dialog-close{position:relative;inset:auto;grid-column:2;grid-row:1;flex-shrink:0}
/* Проектные формы сохраняют свои размеры, но не отдельное место под крестик. */
:is(.project-setup-dialog,.project-dialog,.employee-create-dialog)>header{display:flex;align-items:center;flex-wrap:nowrap;min-width:0;margin-right:0}
:is(.project-setup-dialog,.project-dialog,.employee-create-dialog)>header>:is(h2,h3){flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
:is(.project-setup-dialog,.project-dialog,.employee-create-dialog)>header>.chat-icon-button{position:relative;inset:auto;flex-shrink:0}

:is(.heading-row,.pf-card-head,.pf-modal-head,.co-modal-head,.co-tpl-head,.tasks-dialog-head)[hidden]{display:none}
