/* Keep workspace lists fluid without changing table or form behavior. */
.layout .workspace .page-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px;
}

/* A short list fits its rows; long lists shrink inside the available screen. */
.layout .workspace .page-content--viewport {
  flex-direction: column;
}
.layout .workspace .viewport-page.el-card {
  flex: 0 1 auto;
  height: auto;
  max-height: 100%;
}
.layout .workspace .viewport-page.el-card > .el-card__body {
  height: 100%;
}
.layout .workspace .viewport-page .viewport-table {
  flex: 0 1 auto;
}

/* Log and points panels have their own table layout and can size naturally. */
.layout .workspace .log-panel,
.layout .workspace .points-panel {
  flex: 0 1 auto;
  height: auto;
  min-height: 0;
  max-height: 100%;
}
.layout .workspace .log-panel > :not(.table-region),
.layout .workspace .points-panel > :not(.table-region) {
  flex-shrink: 0;
}
.layout .workspace .log-panel .table-region,
.layout .workspace .points-panel .table-region {
  flex: 0 1 auto;
  min-height: 120px;
}

.layout .workspace .el-table__empty-text {
  width: 100%;
  padding: 24px 16px;
  line-height: 1.6;
}

/* Give the panel's percentage table height a definite, shrinkable flex parent. */
@media (min-width: 768px) {
  .layout .workspace .main-scrollbar:has(.log-panel, .points-panel) > .el-scrollbar__wrap {
    overflow: hidden;
  }
  .layout .workspace .main-scrollbar:has(.log-panel, .points-panel) > .el-scrollbar__wrap > .el-scrollbar__view {
    height: 100%;
  }
  .layout .workspace .page-content:has(> .log-panel, > .points-panel) {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 1100px) {
  .layout .workspace .page-content {
    padding: 16px;
  }
}

@media (max-width: 767px) {
  .layout .workspace .page-content {
    padding: 12px;
  }
  .layout .workspace .log-panel,
  .layout .workspace .points-panel {
    max-height: none;
  }
  .layout .workspace .log-panel .table-region,
  .layout .workspace .points-panel .table-region {
    flex: 0 1 auto;
    height: min(480px, 60dvh);
  }
}
