.student-receipt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 13rem);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  max-width: 100%;
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid var(--line);
  border-top: .3rem solid var(--teal);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  break-inside: avoid;
}

.student-receipt h3 {
  margin: 0;
  color: var(--forest);
  font-weight: 800;
  font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  line-height: 1.15;
}
.student-receipt p { margin: .55rem 0 0; line-height: 1.45; }
.student-receipt__id { display: grid; gap: .12rem; }
.student-receipt__id strong { color: var(--forest); font-size: .85rem; }
.student-receipt__id code { font-family: ui-monospace, monospace; font-size: .9rem; overflow-wrap: anywhere; }
.student-receipt__photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 12rem;
  margin-top: .8rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
}
.student-receipt__code { display: grid; justify-items: center; gap: .5rem; }
.student-qr-image {
  display: block;
  width: min(100%, 13rem);
  height: auto;
  border: 1px solid var(--line);
  background: white;
  image-rendering: pixelated;
}
.student-receipt--compact { grid-template-columns: minmax(0, 1fr) minmax(0, 11rem); }
.student-receipt--compact .student-receipt__photo { max-height: 6rem; }

@media (max-width: 42rem) {
  .student-receipt { grid-template-columns: 1fr; }
  .student-receipt__code canvas { width: min(100%, 14rem); }
}

@media print {
  .student-receipt {
    grid-template-columns: 1fr 1.65in;
    gap: .25in;
    padding: .16in;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .student-receipt__photo { max-height: 1in; }
  .student-receipt__code canvas { width: 1.65in; }
  .student-receipt__save { display: none; }
}
