/*
 * Melontik-compatible table body sizing.
 * Layout only: no table data, filters, calculations or API behaviour is changed.
 */

:is(
  body.layout-autosize-order .order-profit-panel,
  body.layout-autosize-return .return-loss-panel,
  body.layout-autosize-category .category-profit-panel,
  body.layout-autosize-product-profit .product-profit-panel
) :is(.report-table-wrap, .category-report-wrap, .product-report-wrap),
body.layout-autosize-product-settings .product-settings-wrap,
body.layout-autosize-live .live-table-wrap {
  height: auto !important;
  min-height: 128px !important;
  max-height: 100vh !important;
  flex: 0 0 auto !important;
  overflow: auto !important;
}

/* A short/empty product report must follow the same compact body rule. */
body.layout-autosize-product-profit .pp-loading {
  min-height: 128px !important;
}

/* Keep the existing full-screen fill behaviour intact. */
:is(
  body.layout-autosize-order,
  body.layout-autosize-return,
  body.layout-autosize-category,
  body.layout-autosize-product-profit,
  body.layout-autosize-product-settings,
  body.layout-autosize-live
) .live-panel-fullscreen :is(
  .report-table-wrap,
  .category-report-wrap,
  .product-report-wrap,
  .product-settings-wrap,
  .live-table-wrap
) {
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 auto !important;
}
