#helperModal {
  align-items: stretch;
  justify-items: center;
  padding: 12px;
}

#helperModal .modal-panel {
  width: min(1440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

#helperModal .modal-head {
  flex: 0 0 auto;
  z-index: 8;
}

#helperModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#helperModal .modal-body > .select-row {
  flex: 0 0 auto;
  display: grid !important;
  grid-template-columns: minmax(150px, .62fr) minmax(220px, 1fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

#helperModal .modal-body > .select-row > div {
  min-width: 0;
}

#helperModal #loadHelperBtn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 44px;
  padding: 0 18px;
  color: #fff !important;
  white-space: nowrap;
}

#helperModal .toolbar,
#helperModal #helperStatus {
  flex: 0 0 auto;
}

#helperModal #helperRenderArea {
  flex: 1 1 auto;
  min-height: 320px;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

#helperModal #helperRenderArea > .student-strip {
  grid-template-columns: minmax(280px, 1.45fr) repeat(3, minmax(150px, .55fr));
}

#helperModal #helperRenderArea .panel {
  margin-top: 14px;
}

#helperModal #helperRenderArea .table-wrap {
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

#helperModal #helperRenderArea .course-table {
  min-width: 920px;
}

#helperModal .helper-floating-panel {
  border-color: #f2d19b;
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

#helperModal .helper-floating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

#helperModal .helper-floating-card {
  min-width: 0;
  border: 1px solid #f2d19b;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

#helperModal .helper-floating-name {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  word-break: keep-all;
}

#helperModal .helper-floating-meta {
  margin-top: 6px;
  color: #8a4b08;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

body.advanced-motion #helperModal #helperRenderArea {
  box-shadow: 0 18px 48px rgba(15,23,42,.07), 0 1px 0 rgba(255,255,255,.8) inset;
}

@media (max-width: 900px) {
  #helperModal .modal-body > .select-row {
    grid-template-columns: 1fr 1fr;
  }

  #helperModal #loadHelperBtn {
    width: 100%;
  }
}

@media (max-width: 680px) {
  #helperModal {
    padding: 8px;
  }

  #helperModal .modal-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  #helperModal .modal-body {
    padding: 12px;
  }

  #helperModal .modal-body > .select-row,
  #helperModal #helperRenderArea > .student-strip {
    grid-template-columns: 1fr;
  }

  #helperModal #helperRenderArea {
    min-height: 300px;
  }
}
