/* Test-site history rail layout */
.workspace-history-drawer {
  display: grid;
  position: sticky;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  min-height: 0;
  overflow: visible;
}

.workspace-history-drawer > .page-logout-btn {
  position: absolute;
  top: -58px;
  right: 28px;
  width: 210px;
  margin: 0;
  z-index: 5;
}

.workspace-history-drawer .history-drawer-card {
  height: 100%;
  max-height: none;
  min-height: 0;
}

.workspace-history-drawer .history-drawer-list {
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.workspace-history-drawer .packaging-history-panel {
  position: static;
  inset: auto;
  z-index: auto;
  width: auto;
  height: 100%;
  max-height: none;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.packaging-recent-records {
  min-height: 0;
  overflow: auto;
}

body:not(.packaging-task-active) .workspace-history-drawer .packaging-history-panel {
  display: none;
}

body.packaging-task-active .workspace-history-drawer {
  display: grid !important;
}

body.packaging-task-active .workspace-history-drawer .history-drawer-card {
  display: none;
}

body.packaging-task-active .workspace-history-drawer .packaging-history-panel {
  display: grid;
}

@media (max-width: 760px) {
  .workspace-history-drawer {
    height: auto;
    max-height: none;
    grid-template-rows: auto minmax(0, auto);
  }

  .workspace-history-drawer > .page-logout-btn {
    position: static;
    justify-self: stretch;
    width: auto;
    margin: 0;
  }

  .workspace-history-drawer .packaging-history-panel,
  .workspace-history-drawer .history-drawer-card {
    height: auto;
  }
}
