:root {
  --paper: #faf8f3;
  --ink: #211c49;
  --purple: #4f2f90;
  --muted: #554e68;
  --line: #dcd5e7;
  --surface: #fff;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.5 "Instrument Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--purple); text-underline-offset: .18em; }
h1, h2, p { margin: 0 0 .65rem; }
h1, h2 { font-family: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif; line-height: 1.08; }
h1 { font-size: clamp(2rem, 5vw, 3.9rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); letter-spacing: -.024em; }
button, input, select { font: inherit; }
button, input:not([type="checkbox"]), select { min-height: 46px; border-radius: .45rem; }
button {
  cursor: pointer;
  padding: .65rem 1rem;
  color: white;
  border: 1px solid transparent;
  background: var(--purple);
  font-weight: 700;
}
button:hover:not(:disabled) { background: var(--ink); }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #00819b; outline-offset: 3px; }
.frame { width: min(1080px, calc(100% - 2rem)); margin-inline: auto; }
.mast { border-bottom: 1px solid var(--line); background: var(--surface); }
.mast-inner, .brand, .reader-title, .reader-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mast-inner { min-height: 68px; }
.brand { justify-content: flex-start; font-weight: 750; color: var(--ink); text-decoration: none; gap: .55rem; }
.brand img { object-fit: contain; }
.mast-back { font-size: .92rem; }
.access { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(1.25rem, 5vw, 4.5rem); padding-block: clamp(1.6rem, 6vw, 5rem); }
.access-intro { padding-block: 1rem; }
.access-intro > p:not(.label) { color: var(--muted); font-size: 1.1rem; max-width: 35ch; margin-bottom: 1.2rem; }
.label { color: var(--purple); font-weight: 750; }
.access-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--purple); padding: clamp(1rem, 4vw, 2.25rem); border-radius: .6rem; }
.access-card label, .field label { display: block; font-size: .92rem; font-weight: 700; margin-bottom: .3rem; }
form input:not([type="checkbox"]) { width: 100%; padding: .6rem .75rem; border: 1px solid #8f829e; color: var(--ink); background: white; margin-bottom: 1rem; }
.access-card .permission { display: flex; align-items: flex-start; gap: .65rem; margin-bottom: 1rem; font-weight: 500; }
.permission input { margin: .1rem 0 0; inline-size: 1.2rem; block-size: 1.2rem; flex: none; accent-color: var(--purple); }
.verified { color: #27583a; font-weight: 700; }
form button[type="submit"] { width: 100%; }
form > p { color: var(--muted); margin-bottom: 1.2rem; }
.privacy { margin: 1rem 0 0; font-size: .9rem; }
.link-button { background: transparent; color: var(--purple); text-decoration: underline; text-underline-offset: .18em; }
.link-button:hover:not(:disabled) { background: #ede6f7; }
#status:not([hidden]) { border-left: 3px solid var(--purple); padding: .6rem .8rem; color: var(--muted); background: #f1ebfa; }
.reader { padding-block: 1.6rem 2rem; }
.reader-title { align-items: flex-end; margin-bottom: .85rem; }
.reader-title h1 { margin: 0; }
.reader-title .label { margin: 0 0 .25rem; }
#reading-for { margin: .35rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.reader-title .actions { justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .65rem; padding: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: .65rem; }
.toolbar .field:first-child { flex: 1 1 14rem; }
.toolbar select { max-width: 100%; width: 100%; color: var(--ink); padding: .45rem .6rem; border: 1px solid #8f829e; background: #fff; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.jump-to-links { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .45rem .7rem; font-weight: 700; }
.quiet { background: white; color: var(--purple); border-color: var(--line); }
.quiet:hover:not(:disabled) { color: white; background: var(--purple); }
.pager { display: flex; align-items: center; justify-content: center; gap: .85rem; padding: .6rem 0; }
.folio { min-width: 5ch; text-align: center; font-variant-numeric: tabular-nums; }
.viewport { overflow: auto; max-width: 100%; border: 1px solid var(--line); border-radius: .3rem; padding: .5rem; background: #eae4f1; }
#page-art { display: block; width: min(100%, 780px); height: auto; margin: 0 auto; user-select: none; -webkit-touch-callout: none; background: var(--paper); }
.zoomed #page-art { width: 1120px; max-width: none; }
.page-links { padding: .95rem; margin-top: .65rem; background: white; border: 1px solid var(--line); border-radius: .65rem; overflow-wrap: anywhere; scroll-margin-block-start: 1rem; }
.page-links h2 { font-size: 1.15rem; }
.page-links ul { margin: 0; padding-inline-start: 1.2rem; }
.page-links a { display: inline-flex; align-items: center; min-height: 44px; }
.reader-foot { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); flex-wrap: wrap; color: var(--muted); }
@media (max-width: 690px) {
  .access { grid-template-columns: 1fr; }
  .mast-inner { gap: .5rem; }
  .brand { font-size: .9rem; }
  .mast-back { font-size: .82rem; }
  .reader-title { display: block; }
  .reader-title .actions { justify-content: flex-start; margin-top: .25rem; }
  .reader-title .link-button { flex: 0 1 auto; padding-inline: .35rem; font-size: .84rem; white-space: nowrap; }
}
@media (max-width: 460px) {
  .toolbar .field:first-child { flex-basis: 100%; }
  .toolbar .actions { flex: 1; }
  .actions button { flex: 1; padding-inline: .5rem; }
  .actions .jump-to-links { flex: 1; }
}
@media print {
  .reader, .access, .mast { display: none !important; }
}
.student-choices { list-style: none; padding: 0; margin: 0 0 16px; }
.student-choices li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-top: 1px solid #dfdce6; }
.student-choices strong, .student-choices span { grid-column: 1; overflow-wrap: anywhere; }
.student-choices button:nth-of-type(1) { grid-column: 2; grid-row: 1 / span 2; }
.student-choices button:nth-of-type(2) { grid-column: 1 / -1; justify-self: start; }
.guidance-reader {
  --paper: #f7f6fa;
  --purple: #3c2b84;
  --muted: #61606c;
  --line: #dfdce6;
  font-family: "Segoe UI", Arial, sans-serif;
}
.guidance-reader h1, .guidance-reader h2 { font-family: inherit; }
