/* A list can live in the main column or inside a Turbo detail frame. */
.workspace :is(main, #admin_detail):has(> .list-section),
.workspace .list-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.workspace main:has(> .list-section) { padding-bottom: clamp(12px, 2vh, 24px); }
.workspace main:has(> .list-section) > * { width: 100%; }
.workspace :is(main, #admin_detail):has(> .list-section) > :not(.list-section),
.workspace .list-section > :not(.table-wrap, .list-section) { flex: none; }
.workspace .list-section.card { overflow: visible; }
.workspace main:has(> .desk-section#trace) { display: block; }
.workspace .desk-section > .table-wrap { max-height: 50dvh; }

:is(.workspace .list-section, .report-results) > .table-wrap {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scroll-padding-top: 3rem;
}
:is(.workspace .list-section, .report-results) > .table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: inset 0 -1px var(--line);
}
.report-results > .table-wrap { max-height: 50dvh; }
.workspace .list-section > .subnav { margin: 0; row-gap: 0; }

@media (min-width: 761px) and (min-height: 640px) {
  body:not(.store-workspace) .report-filters {
    position: sticky;
    top: 0;
    z-index: 2;
    background: white;
  }
  .workspace-pane:has(.detail-panel:not([hidden])) .report-filters { position: static; }
}

/* If the controls take up most of the viewport, keep the rows reachable. */
@media (max-height: 420px), (max-width: 480px) and (max-height: 600px) {
  .workspace :is(main, #admin_detail):has(> .list-section) { display: block; }
  .workspace .list-section > .table-wrap { max-height: 50dvh; }
}
