/*
 * Filament centres uncontained tabs with `mx-auto`, which both the relation
 * manager tab row and the record sub navigation row get because each is built
 * as `contained(false)`. Both rows are built inside Filament, so there is no
 * hook to reach them, and the tabs read better lined up with the form beneath
 * them than floating in the middle.
 */
.fi-sc-tabs > .fi-tabs:not(.fi-contained),
.fi-page-sub-navigation-tabs:not(.fi-contained) {
    margin-inline: 0 auto;
}

/*
 * A record with as many tabs as a coverholder agreement runs past the width of
 * the page, and Filament scrolls that row sideways with no scrollbar to say so,
 * which leaves half the tabs looking as though they do not exist. Wrapping onto
 * a second line keeps every tab in sight.
 */
.fi-page-sub-navigation-tabs:not(.fi-contained) {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: calc(var(--spacing) * 1);
}

/*
 * A row of tabs that links between lists, rather than one Filament builds,
 * sits straight in the page's schema, which stretches it across the page. It
 * is sized to its tabs and lined up on the left like the rows above.
 */
.fi-tabs.fi-link-tabs:not(.fi-contained) {
    margin-inline: 0 auto;
    width: fit-content;
}
