.student-profile-shell {
  display: grid;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.student-profile-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #d7e9e7;
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 10%, rgba(7, 140, 139, 0.10), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f4fbfa 100%);
  box-shadow: 0 12px 34px rgba(26, 76, 74, 0.06);
}

.student-profile-hero::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  left: -55px;
  bottom: -90px;
  border-radius: 50%;
  background: rgba(35, 179, 95, 0.08);
  pointer-events: none;
}

.student-profile-hero-top,
.student-profile-identity,
.student-profile-tags,
.student-attention-card,
.student-section-head,
.student-homework-card-top,
.student-portfolio-card-head,
.student-portfolio-pills {
  display: flex;
  align-items: center;
}

.student-profile-hero-top {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.student-profile-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.student-profile-identity {
  position: relative;
  z-index: 1;
  gap: 16px;
}

.student-profile-avatar {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 28px;
  background: #e9f5f3;
  color: var(--teal-dark);
  box-shadow: 0 8px 24px rgba(7, 140, 139, 0.12);
  font-size: 24px;
  font-weight: 800;
}

.student-profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.student-profile-avatar.has-photo img {
  opacity: 1;
}

.student-profile-avatar.has-photo > span {
  visibility: hidden;
}

.student-profile-copy {
  min-width: 0;
}

.student-profile-kicker,
.student-section-head > div > span {
  display: block;
  margin-bottom: 4px;
  color: #078c8b;
  font-size: 13px;
  font-weight: 700;
}

.student-profile-copy h2 {
  margin: 0;
  color: #202227;
  font-size: 27px;
}

.student-profile-copy p {
  margin: 5px 0 0;
  color: #6f7580;
  font-size: 15px;
}

.student-profile-tags {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.student-profile-tags span,
.student-section-count {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 4px 10px;
  border: 1px solid #dcebea;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  color: #536165;
  font-size: 13px;
  font-weight: 700;
}

.student-profile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.student-summary-card {
  min-height: 145px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(36, 55, 54, 0.04);
}

.student-summary-card .student-summary-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 16px;
}

.student-summary-card.attendance .student-summary-icon {
  color: #078c8b;
  background: #e9f5f3;
}

.student-summary-card.homework .student-summary-icon {
  color: #c47b0b;
  background: #fff1d9;
}

.student-summary-card.portfolio .student-summary-icon {
  color: #3f842f;
  background: #e7f4ef;
}

.student-summary-card small,
.student-summary-card span {
  display: block;
  color: #747b86;
}

.student-summary-card strong {
  display: block;
  margin: 6px 0 4px;
  color: #202227;
  font-size: 21px;
}

.student-attention-card {
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid #f1d8c9;
  border-radius: 21px;
  background: #fff9f5;
}

.student-attention-card.calm {
  border-color: #cfe8d7;
  background: #f6fcf8;
}

.student-attention-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #c66f18;
  background: #fff0dc;
}

.student-attention-card.calm .student-attention-icon {
  color: #299456;
  background: #e7f5ec;
}

.student-attention-card small {
  color: #7b7068;
}

.student-attention-card strong {
  display: block;
  margin-top: 2px;
  color: #202227;
  font-size: 17px;
}

.student-attention-card p {
  margin: 3px 0 0;
  color: #747b86;
}

.student-profile-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(36, 55, 54, 0.035);
}

.student-section-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.student-section-head h3 {
  margin: 0;
  color: #202227;
  font-size: 19px;
}

.student-attendance-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #e2eceb;
  border-radius: 18px;
  background: #f9fcfb;
}

.student-attendance-strip > div {
  padding: 14px;
  text-align: center;
  border-inline-start: 1px solid #e2eceb;
}

.student-attendance-strip > div:first-child {
  border-inline-start: 0;
}

.student-attendance-strip small {
  display: block;
  color: #747b86;
}

.student-attendance-strip strong {
  display: block;
  margin-top: 5px;
  color: #202227;
  font-size: 20px;
}

.student-homework-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.student-homework-card {
  padding: 14px;
  border: 1px solid #e4ebe9;
  border-radius: 18px;
  background: #fcfefd;
}

.student-homework-card-top {
  justify-content: space-between;
  gap: 8px;
}

.student-homework-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #c47b0b;
  background: #fff1d9;
}

.student-homework-card h4 {
  margin: 12px 0 0;
  color: #202227;
  font-size: 16px;
}

.student-homework-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0;
  color: #747b86;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.student-homework-card small {
  display: block;
  margin-top: 8px;
  color: #078c8b;
}

.student-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.student-portfolio-card {
  overflow: hidden;
  border: 1px solid #dde9e8;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(35, 74, 70, 0.04);
}

.student-portfolio-media {
  display: grid;
  gap: 4px;
  min-height: 200px;
  padding: 4px;
  background: #eaf5f1;
}

.student-portfolio-media.single {
  grid-template-columns: 1fr;
}

.student-portfolio-media.multi {
  grid-template-columns: 1.45fr .85fr;
  grid-template-rows: repeat(2, 98px);
}

.student-portfolio-media.multi .student-portfolio-image-button:first-child {
  grid-row: 1 / span 2;
}

.student-portfolio-image-button {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: #dcece8;
  cursor: zoom-in;
}

.student-portfolio-image-button:focus-visible {
  outline: 3px solid rgba(7,140,139,.25);
  outline-offset: 2px;
}

.student-portfolio-image {
  width: 100%;
  height: 100%;
  min-height: 196px;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease;
}

.student-portfolio-media.multi .student-portfolio-image {
  min-height: 0;
}

.student-portfolio-image-button:hover .student-portfolio-image {
  transform: scale(1.025);
}

.student-media-count {
  position: absolute;
  left: 9px;
  bottom: 9px;
  min-width: 35px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 3px 8px;
  border-radius: 11px;
  background: rgba(255,255,255,.92);
  color: #078c8b;
  font-weight: 800;
}

.student-portfolio-card-body {
  padding: 15px;
}

.student-portfolio-card-head {
  gap: 10px;
}

.student-portfolio-file-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #3f842f;
  background: #e7f4ef;
}

.student-portfolio-card-head h4 {
  margin: 0;
  color: #202227;
  font-size: 16px;
}

.student-portfolio-card-head small {
  display: block;
  margin-top: 3px;
  color: #078c8b;
}

.student-portfolio-card-body > p {
  margin: 12px 0 0;
  color: #687179;
  line-height: 1.9;
}

.student-portfolio-pills {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.student-pill-star {
  color: #946100;
  background: #fff4cb;
}

.student-pill-strength {
  color: #267044;
  background: #e7f5ec;
}

.student-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 24px;
}

.student-media-viewer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(4, 18, 18, .88);
  cursor: zoom-out;
}

.student-media-viewer-card {
  position: relative;
  z-index: 1;
  width: min(980px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 22px;
  background: #0a1515;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
}

.student-media-viewer-card header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 18px;
  color: #fff;
  background: #102020;
}

.student-media-viewer-close {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.student-media-viewer-canvas {
  height: min(76vh, 760px);
  display: grid;
  place-items: center;
  padding: 12px;
}

.student-media-viewer-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.student-profile-error {
  display: grid;
  gap: 14px;
}

@media (max-width: 900px) {
  .student-profile-summary,
  .student-portfolio-grid {
    grid-template-columns: 1fr;
  }

  .student-homework-grid {
    grid-template-columns: 1fr;
  }

  .student-attendance-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .student-profile-hero {
    padding: 15px;
    border-radius: 20px;
  }

  .student-profile-identity {
    align-items: flex-start;
  }

  .student-profile-avatar {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    border-radius: 23px;
  }

  .student-profile-copy h2 {
    font-size: 22px;
  }

  .student-profile-section {
    padding: 14px;
  }

  .student-portfolio-media.multi {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 170px 90px;
  }

  .student-portfolio-media.multi .student-portfolio-image-button:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .student-media-viewer {
    padding: 10px;
  }
}
