.teacher-entry {
  position: absolute;
  right: 22px;
  top: 20px;
  z-index: 4;
  color: #2d5146;
  background: #fff9e7b8;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 12px;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.exit-key {
  background: #fff9e7b8;
  border: 1px solid #2d514630;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 12px;
  min-height: 44px;
  margin-left: 10px;
}
.scan-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}
.scan #scan-status {
  min-height: 40px;
}
.photo-code {
  background: transparent;
  min-height: 44px;
  display: block;
  margin: 20px auto 0;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.photo-code input {
  display: block;
  max-width: 250px;
  margin-top: 10px;
  font-size: 12px;
}
.teacher-page {
  min-height: 100svh;
  background: #f7edd9;
  color: #2d5146;
}
.teacher-art {
  height: 210px;
  position: relative;
  background:
    linear-gradient(#ead8b530, #ead8b530),
    url(/optimized/listening-landscape-1600-885604d24a0db656.webp) 64% 50% / cover;
}
.teacher-art > a {
  position: absolute;
  left: 25px;
  top: 26px;
  display: block;
}
.teacher-art img {
  width: 145px;
}
.teacher-paper {
  padding: 30px 24px 50px;
}
.teacher-paper h1 {
  font: normal clamp(32px, 6vw, 43px) / 1.1 var(--serif);
  letter-spacing: -1px;
  margin: 12px 0 18px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1px;
}
.intro {
  font-size: 14px;
  color: #62735d;
  margin-bottom: 30px;
}
.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 8px;
  background: #2d5146;
  color: #fff5dd;
  text-decoration: none;
  font: 700 14px var(--sans);
  cursor: pointer;
  gap: 8px;
}
.quiet-link {
  display: block;
  color: #60755f;
  margin: 22px 0;
  font-size: 13px;
}
.form-error {
  color: #824137;
  margin-bottom: 20px;
}
.teacher-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quiet-button {
  background: transparent;
  font-size: 12px;
  padding: 10px;
  min-height: 44px;
}
#grant-form {
  display: grid;
  gap: 14px;
}
#grant-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
}
#grant-form input,
#grant-form select {
  width: 100%;
  min-width: 0;
  background: #fff9ed;
  border: 1px solid #2d514640;
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  color: #2d5146;
  min-height: 46px;
}
#grant-form input {
  font-size: 16px;
}
.keys-note {
  font-size: 11px;
  color: #61715d;
  margin: 12px 0 34px;
}
.teacher-paper h2 {
  font: normal 24px var(--serif);
  margin: 0 0 16px;
}
.teacher-paper h2 span {
  font: 12px var(--sans);
  margin-left: 10px;
}
.key-row {
  border-top: 1px solid #2d514628;
  padding: 17px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.key-row h3 {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.key-row p {
  font-size: 11px;
  color: #64725b;
  margin-top: 4px;
}
.key-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.key-actions button {
  background: #ede3ca;
  border-radius: 6px;
  font-size: 12px;
  padding: 10px;
  min-height: 44px;
}
.key-actions button:first-child {
  background: #2d5146;
  color: #fff5dd;
}
.empty-keys {
  color: #6f7a62;
  font-size: 14px;
  padding: 20px 0;
}
dialog {
  border: 1px solid #c9bea4;
  border-radius: 16px;
  background: #fff8e8;
  color: #2d5146;
  padding: 26px;
  max-width: min(92vw, 520px);
  box-shadow: 0 20px 70px #163c3b30;
}
dialog::backdrop {
  background: #183d3570;
  backdrop-filter: blur(4px);
}
dialog p {
  margin: 10px 0 20px;
}
dialog button {
  padding: 12px 18px;
  border-radius: 7px;
  min-height: 44px;
  background: #e9dfc7;
}
dialog .solid {
  background: #2d5146;
  color: #fff5dd;
}
/* A printed library key, laid out like a small cloth-bound book. */
#qr-ticket {
  width: 460px;
  max-width: calc(100vw - 24px);
  max-height: calc(100svh - 24px);
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: #ece3ce;
  overflow-y: auto;
}
.ticket {
  position: relative;
  isolation: isolate;
  text-align: center;
  background: #fffaf0;
  border-radius: 3px 10px 10px 3px;
  padding-left: 13px;
  overflow: hidden;
  border: 1px solid #bca77b;
  box-shadow:
    3px 3px 0 #d8c8a8,
    5px 5px 0 #f5ecd8,
    0 12px 28px #2d51461c;
}
.ticket:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 13px;
  background: linear-gradient(
    90deg,
    #1e3f35,
    #426553 40%,
    #2d5146 75%,
    #1e3f35
  );
  z-index: 2;
}
.ticket-cover {
  position: relative;
  aspect-ratio: 2.2;
  overflow: hidden;
  border-bottom: 1px solid #c7af7b;
}
.ticket-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}
.ticket-logo {
  position: absolute;
  left: 6%;
  top: 16%;
  width: 34%;
  height: auto;
}
.ticket-page {
  position: relative;
  padding: 22px 22px 19px;
}
.ticket-page:before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid #c5ad7c80;
  pointer-events: none;
}
.ticket .ticket-kicker {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #77816a;
  margin: 0 0 8px;
}
.ticket h2 {
  font: normal clamp(24px, 6vw, 30px) / 1.12 var(--serif);
  overflow-wrap: anywhere;
  margin: 0;
}
.ticket .ticket-subtitle {
  font-size: 11px;
  color: #62735d;
  margin: 8px 0 0;
}
.ticket-code {
  width: min(100%, 228px);
  margin: 16px auto 18px;
  padding: 5px;
  background: #fffaf0;
  border: 1px solid #c5ad7c;
  border-radius: 6px;
}
.qr-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}
.ticket-validity {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid #c5ad7c80;
  padding-top: 14px;
  margin: 0 10px;
  gap: 4px;
}
.ticket-validity > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #65765e;
}
.ticket-validity time {
  font: normal clamp(21px, 5vw, 25px) / 1.2 var(--serif);
  color: #24483d;
}
.ticket-validity small {
  font-size: 10px;
  color: #66755f;
}
.ticket .ticket-footnote {
  font: italic 11px var(--serif);
  color: #77816a;
  margin: 18px 0 0;
}
.ticket-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
  align-items: center;
}
.ticket-actions button {
  font-size: 12px;
  padding: 11px 8px;
}
.ticket-actions a {
  font-size: 12px;
  color: #2d5146;
  padding: 10px;
  text-align: center;
  min-height: 44px;
}
@media (max-width: 380px) {
  #qr-ticket {
    padding: 10px;
  }
  .ticket-page {
    padding: 18px 18px 16px;
  }
  .ticket-code {
    width: 198px;
    margin: 14px auto;
  }
  .ticket .ticket-footnote {
    font-size: 10px;
  }
}
.confirm-key button {
  margin: 5px;
}
.confirm-key p {
  font-size: 17px;
}
@media (min-width: 600px) {
  .teacher-paper {
    padding: 38px 50px 60px;
  }
  .teacher-art {
    height: 360px;
    background-position: 64% 30%;
  }
  .teacher-art img {
    width: 180px;
  }
  .teacher-art > a {
    left: 50px;
    top: 40px;
  }
  #grant-form {
    grid-template-columns: minmax(0, 1fr) 145px;
  }
  #grant-form button {
    grid-column: 1/-1;
  }
  .teacher-paper > .solid-button {
    min-width: 260px;
  }
}
@media (min-width: 900px) and (orientation: landscape) {
  .teacher-page {
    display: grid;
    grid-template-columns: 39% 61%;
    min-height: 760px;
    overflow: hidden;
    border-radius: 8px;
  }
  .teacher-art {
    height: 100%;
    background-image:
      linear-gradient(#ead8b530, #ead8b530), url(/optimized/listening-portrait-960-a9f0baf5166fb9fd.webp);
    background-position: 50% 80%;
  }
  .teacher-art > a {
    left: 0;
    right: 0;
    text-align: center;
    top: 40px;
  }
  .teacher-art img {
    width: 210px;
  }
  .teacher-paper {
    padding: 38px 40px;
  }
  .teacher-entry {
    right: 26px;
    top: 24px;
  }
}
@media (max-width: 450px) {
  .entry-cover .home-header {
    padding-top: 82px;
  }
  .entry-cover .logo {
    width: 185px;
  }
  .teacher-entry {
    top: 16px;
    right: 16px;
  }
  .home.library .catalog-heading {
    flex-wrap: wrap;
    gap: 10px;
  }
  .home.library .catalog h1 {
    font-size: 23px;
  }
}
@media print {
  @page {
    size: A4;
    margin: 15mm;
  }
  body > *:not(#qr-ticket) {
    display: none !important;
  }
  body {
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
  }
  #qr-ticket {
    display: block;
    position: static;
    max-width: none;
    max-height: none;
    overflow: visible;
    width: 100mm;
    border: 0;
    box-shadow: none;
    margin: 0 auto;
    padding: 0;
    background: white;
  }
  .ticket {
    break-inside: avoid;
    box-shadow: none;
    border-radius: 1mm 3mm 3mm 1mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .ticket-cover {
    aspect-ratio: 2.2;
  }
  .ticket-page {
    padding: 6mm 6mm 5mm;
  }
  .ticket-code {
    width: 53mm;
    margin: 4mm auto;
  }
  .ticket h2 {
    font-size: 23pt;
  }
  .ticket-validity time {
    font-size: 18pt;
  }
  .ticket-actions {
    display: none !important;
  }
  #qr-ticket::backdrop {
    display: none;
  }
}
