@media screen {
    /* Divide the heading from bare content. An inset card already marks the boundary. */
    :where(
        .organization-section:not(.document-totals-preview, [data-case-margin]),
        .administration-panel,
        .affiliation-panel,
        .record-detail-card,
        .document-numbering-card,
        .portal-insight-panel,
        .portal-panel,
        .planning-slot-card,
        .report-context-admin-section,
        .itv-dossier-media
    ) > :where(
        h2,
        h3,
        header:has(h2, h3),
        div:has(> h2, > h3),
        .organization-section-heading,
        .administration-panel-heading,
        .legal-entity-section-heading
    ):where(:nth-child(1 of :not([hidden], input[type="hidden"], link, script, style, template))):where(:has(
        ~ :nth-child(2 of :not([hidden], input[type="hidden"], link, script, style, template)):not(
            hr,
            .organization-section,
            .administration-panel,
            .affiliation-panel,
            .document-numbering-card,
            .portal-panel,
            .portal-insight-panel,
            .planning-slot-card,
            .record-detail-card,
            .record-detail-card-grid,
            .workspace-entity-card,
            .workspace-entity-card-grid,
            .portal-insight-grid,
            .form-inset-card,
            .quote-situations,
            .sales-case-summary,
            .image-presentation-field,
            .organization-profile-prefill,
            .document-sequence-policy,
            .document-numbering-tabs,
            .report-model-options,
            .report-frame-cards
        )
    )) {
        padding-block-end: .85rem;
        border-block-end: 1px solid var(--border);
    }

    :where(.form-inset-card, form fieldset:not([class]):has(> legend:not(.sr-only, .visually-hidden, [hidden])):has(> .field-grid)) {
        min-inline-size: 0;
        margin: 0;
        padding: 1rem;
        border: 1px solid var(--border);
        border-radius: .85rem;
    }

    :where(.form-inset-card, form fieldset:not([class]):has(> .field-grid)) > legend {
        max-inline-size: 100%;
        padding-inline: .4rem;
        color: var(--text);
        font-size: .9rem;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .form-inset-card > .field-grid { margin-block: 0; }
    .form-inset-card-legend { display: flex; align-items: center; gap: .4rem; }
    @media (max-width: 45rem) {
        :where(.form-inset-card) { padding: .85rem; }
    }
}

.ui-action-bar > .ui-action-bar-status {
    display: block;
}
