/* Portal Guru > Tugas > Riwayat Tugas: list dan scroll khusus mobile. */
@media (max-width: 767px) {
  .teacher-task-history {
    display: flex !important;
    flex: 1 1 0% !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  .teacher-task-history > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.75rem !important;
  }

  .teacher-task-history-header {
    flex: 0 0 auto !important;
    padding: 0.75rem !important;
  }

  .teacher-task-history-header h2 {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }

  .teacher-task-history-header p {
    display: none !important;
  }

  .teacher-task-history-list {
    display: flex !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 0 !important;
    max-height: none !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom)) !important;
    padding-right: 0.125rem !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
  }

  .teacher-task-history-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "head head"
      "title delete"
      "meta date"
      "footer footer" !important;
    flex: 0 0 auto !important;
    gap: 0.25rem 0.5rem !important;
    padding: 0.75rem !important;
    border-radius: 0.875rem !important;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.05) !important;
  }

  .teacher-task-history-item-head {
    display: contents !important;
  }

  .teacher-task-history-tags {
    grid-area: head;
    gap: 0.375rem !important;
    min-width: 0;
    padding-right: 2.5rem;
  }

  .teacher-task-history-tags span {
    max-width: 48%;
    overflow: hidden;
    padding: 0.2rem 0.5rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-task-history-item-head > button {
    grid-area: delete;
    align-self: center;
    padding: 0.55rem !important;
  }

  .teacher-task-history-title {
    grid-area: title;
    min-width: 0;
    margin: 0.125rem 0 0 !important;
    overflow: hidden;
    font-size: 0.925rem !important;
    line-height: 1.25rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-task-history-meta {
    grid-area: meta;
    min-width: 0;
    margin: 0 !important;
  }

  .teacher-task-history-date {
    grid-area: date;
    align-self: center;
    margin: 0 !important;
    padding-left: 0.5rem;
    font-size: 0.65rem !important;
  }

  .teacher-task-history-meta span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
  }

  .teacher-task-history-footer {
    grid-area: footer;
    margin-top: 0.25rem !important;
    padding-top: 0.5rem !important;
  }

  .teacher-task-history-footer > div:first-child {
    overflow: hidden;
    font-size: 0.7rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-task-history-action {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.65rem !important;
    white-space: nowrap;
  }
}
