/*
 * Blocks that share a row end on the same line.
 *
 * Registered first on both panels. Every other stylesheet here dresses one
 * screen; this one is a rule about all of them.
 *
 * Sections span the full width by default (see AppServiceProvider), so most
 * pages never put two side by side. Where a page deliberately does — the order
 * review cards two by two, a pair of dashboard widgets — each card would
 * otherwise be only as tall as its own content, and the shorter one leaves a
 * hole beneath itself. The grid row is already as tall as its tallest cell; what
 * was missing is the card filling the cell.
 *
 * Filament puts a schema component three levels inside its grid cell —
 * `.fi-grid-col > .fi-sc-component > .fi-sc-section > section.fi-section` — so
 * the height is handed down each level. `:has()` keeps that to cells which hold
 * a section; a field's wrapper is left alone.
 *
 * A collapsed section keeps its own height. Stretched, it would be an empty card
 * the size of its neighbour, which is the gap this file exists to remove.
 */

.fi-sc.fi-grid > .fi-grid-col > .fi-sc-component:has(> .fi-sc-section),
.fi-sc.fi-grid > .fi-grid-col > .fi-sc-component > .fi-sc-section,
.fi-sc.fi-grid > .fi-grid-col > .fi-sc-component > .fi-sc-section > .fi-section:not(.fi-collapsed) {
    height: 100%;
}

/*
 * Dashboard widgets: the same rule one level shallower. A widget's root is the
 * grid cell, and a card-shaped widget — a chart, a list in a section — is its
 * direct child.
 */
.fi-wi > .fi-wi-widget > .fi-section:not(.fi-collapsed) {
    height: 100%;
}
