.student-history-entry[hidden],
.student-history-panel[hidden],
.student-history-load-more[hidden] { display: none !important; }

.student-history-entry {
  display: grid;
  width: 100%;
  margin-top: 18px;
  padding: 17px 19px;
  border: 1px solid #d4c4e0;
  border-radius: 16px;
  color: #58436d;
  text-align: left;
  background: linear-gradient(135deg, #fff, #fbf6ff);
  cursor: pointer;
}
.student-history-entry span { font-size: 15px; font-weight: 850; }
.student-history-entry:hover,
.student-history-entry:focus-visible { border-color: #8a60b1; outline: 3px solid rgba(128, 91, 168, .14); }

.account-drawer.is-workspace {
  box-sizing: border-box;
  width: min(920px, 100%);
  padding-inline: clamp(24px, 4vw, 48px);
}
.student-history-panel { min-width: 0; }
.student-history-heading { display: flex; align-items: flex-start; gap: 18px; }
.student-history-heading button,
.student-history-load-more {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #ccb9da;
  border-radius: 13px;
  color: #674e7f;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  background: #fff;
  cursor: pointer;
}
.student-history-heading h3 { margin: 0; color: #4c3a60; font-size: clamp(24px, 3vw, 34px); }
.student-history-status { min-height: 22px; margin: 20px 0 8px; color: #766782; font-size: 13px; }
.student-history-status[data-kind="error"] { color: #a33f50; }
.student-history-status[data-kind="success"] { color: #28735f; }

.student-history-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 12px 0 24px;
  border-block: 1px solid #eadfec;
}
.student-history-summary div { padding: 17px 16px; border-right: 1px solid #eadfec; }
.student-history-summary div:nth-child(4n) { border-right: 0; }
.student-history-summary div:nth-child(n+5) { border-top: 1px solid #eadfec; }
.student-history-summary div:last-child { grid-column: span 2; border-right: 0; }
.student-history-summary span { display: block; color: #887a90; font-size: 12px; }
.student-history-summary strong { display: block; margin-top: 5px; color: #5b456f; font-size: 25px; }
.student-history-empty { padding: 44px 20px; border: 1px dashed #d9c7e5; border-radius: 17px; color: #86778f; text-align: center; line-height: 1.7; }
.student-history-list { display: grid; gap: 13px; }
.student-history-card { padding: 19px; border: 1px solid #e3d7e9; border-radius: 18px; background: #fff; }
.student-history-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.student-history-kicker { color: #bd467e; font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.student-history-card h4 { margin: 5px 0 0; color: #4f3e60; font-size: 17px; }
.student-history-badge { padding: 6px 10px; border-radius: 999px; color: #6c5b76; font-size: 11px; font-weight: 800; background: #f1ebf4; }
.student-history-badge.is-completed { color: #256b58; background: #e8f5ef; }
.student-history-badge.is-in_progress { color: #7b5819; background: #fff3dc; }
.student-history-card-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0 0; }
.student-history-card-metrics div { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 11px; background: #faf7fc; }
.student-history-card-metrics dt { color: #82748a; font-size: 12px; }
.student-history-card-metrics dd { margin: 0; color: #554466; font-weight: 850; }
.student-history-scores { display: grid; gap: 7px; margin-top: 13px; }
.student-history-scores > div { display: flex; justify-content: space-between; padding-top: 9px; border-top: 1px solid #efe7f1; color: #75667e; font-size: 13px; }
.student-history-scores strong { color: #5a416f; }
.student-history-no-score { margin: 0; color: #918597; font-size: 12px; }
.student-history-load-more { display: block; margin: 18px auto 0; }

@media (max-width: 680px) {
  .account-drawer.is-workspace { width: 100%; padding-inline: 22px; }
  .student-history-panel { min-width: 0; }
  .student-history-heading { display: grid; }
  .student-history-heading button { justify-self: start; }
  .student-history-summary div { padding-inline: 9px; }
  .student-history-summary { grid-template-columns: repeat(2, 1fr); }
  .student-history-summary div:nth-child(2n) { border-right: 0; }
  .student-history-summary div:nth-child(n+3) { border-top: 1px solid #eadfec; }
  .student-history-summary strong { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .student-history-entry { transition: none; }
}
