.amu-learner {
  --learner-ink: #162b41;
  --learner-gold: #856124;
  --learner-line: #dadbd7;
  box-sizing: border-box;
  width: min(42rem, calc(100% - 2rem));
  max-width: 42rem;
  max-height: min(90dvh, 54rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--learner-ink);
  background: #fffdf8;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 1.5rem;
  box-shadow: 0 2rem 8rem rgba(4,16,32,.4);
  font: 1rem/1.55 var(--sans);
  text-align: start;
  color-scheme: light;
}
.amu-learner *, .amu-learner *::before, .amu-learner *::after { box-sizing: border-box; }
.amu-learner::backdrop { background: rgba(10,23,38,.74); backdrop-filter: blur(5px); }
.amu-learn-top { position: sticky; top: 0; z-index: 1; display: flex; gap: .8rem; align-items: center; min-height: 4.5rem; padding: .65rem clamp(1.2rem, 4vw, 2.35rem); color: #faf5e9; background: #152c43; }
.amu-learn-brand { font: 700 1.45rem/1 var(--sans); letter-spacing: .015em; color: #e1c180; }
.amu-learn-product { font-size: .9rem; }
.amu-learn-top .app-back, .reader-back { max-width: 52%; line-height: 1.2; text-wrap: balance; }
.amu-learn-top .app-back { color: #fff; background: transparent; border-color: #94a3b3; }
.amu-learn-top .app-back:hover { background: #263e55; }
@media (max-width: 26rem) { .amu-learn-product { display: none; } }
.amu-learn-dismiss { margin-inline-start: auto; width: 2.75rem; height: 2.75rem; padding: 0; color: white; background: transparent; border: 1px solid #667786; border-radius: 50%; font: 400 1.7rem/1 var(--sans); cursor: pointer; }
.amu-learn-body { padding: clamp(1.3rem, 5vw, 2.5rem); }
.amu-learn-label { display: block; margin: 0 0 .6rem; color: var(--learner-gold); font-size: .78rem; font-weight: 700; line-height: 1.4; letter-spacing: .09em; text-transform: uppercase; }
.amu-learn-title { margin: 0; color: var(--learner-ink); font: 600 clamp(1.8rem, 5vw, 2.55rem)/1.12 var(--sans); letter-spacing: -.035em; }
.amu-learn-summary { color: #465466; margin: .85rem 0 0; font-size: 1rem; }
.amu-learn-article { margin: 1.5rem 0 1rem; padding: clamp(1rem, 3.5vw, 1.5rem); border: 1px solid #e2ddcf; border-radius: 1rem; background: #f6f3e9; }
.amu-learn-article h3 { margin: 0; font: 600 1.25rem/1.35 var(--sans); color: var(--learner-ink); }
.amu-learn-text { white-space: pre-line; margin: .7rem 0 0; color: #344455; }
.amu-learn-reference { display: inline-flex; align-items: center; min-height: 2.75rem; color: #395977; text-underline-offset: .2em; text-decoration: underline; }
.amu-learn-actions { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: flex-end; gap: .6rem; margin-top: 1.5rem; }
.amu-learn-primary, .amu-learn-secondary { min-height: 2.85rem; padding: .65rem 1.1rem; border-radius: .65rem; font: 600 .94rem/1.4 var(--sans); cursor: pointer; }
.amu-learn-primary { border: 1px solid #152e45; background: #152e45; color: #fffdf7; }
.amu-learn-secondary { border: 1px solid #c7c9c4; background: transparent; color: var(--learner-ink); }
.amu-learn-primary:hover { background: #24445e; }
.amu-learn-secondary:hover { background: #efede4; }
.amu-learn-track { display: flex; gap: .35rem; margin: 1.25rem 0 1.5rem; }
.amu-learn-track span { height: .28rem; border-radius: 1rem; flex: 1; background: #e4e4dd; }
.amu-learn-track span.is-filled { background: #a78342; }
.amu-learn-choices { display: grid; gap: .65rem; min-width: 0; padding: 0; margin: 0; border: 0; }
.amu-learn-prompt { float: none; width: 100%; padding: 0; margin: 0 0 1rem; font-size: 1.12rem; line-height: 1.5; font-weight: 600; }
.amu-learn-option { display: flex; align-items: flex-start; gap: .75rem; padding: .85rem .95rem; border: 1px solid var(--learner-line); background: #fff; border-radius: .7rem; cursor: pointer; color: #263d50; line-height: 1.45; }
.amu-learn-option input { appearance: auto; margin: .24rem 0 0; width: 1rem; height: 1rem; min-width: 1rem; accent-color: #274b64; }
.amu-learn-option:has(input:checked) { background: #edf1f4; border-color: #5f798d; }
.amu-learn-option.is-correct { border-color: #54856f; background: #eaf3ec; }
.amu-learn-option small { margin-inline-start: auto; padding: .12rem .22rem; color: #345c49; font-size: .8rem; font-weight: 600; }
.amu-learn-feedback { margin: 1rem 0; padding: .85rem 1rem; border-radius: .6rem; background: #ecefe9; }
.amu-learn-feedback p { margin: .2rem 0 0; }
.amu-learn-score { display: flex; align-items: baseline; flex-wrap: wrap; gap: .8rem; margin: 1.5rem 0 0; padding: 1.5rem; border-radius: 1rem; background: #f3eee1; }
.amu-learn-score b { font: 500 2.65rem/1 var(--sans); }
.amu-learn-note { font-size: .88rem; color: #655a48; }
.amu-learner :focus-visible { outline: 3px solid #98752f; outline-offset: 3px; }
.amu-learn-title:focus, .amu-learn-feedback:focus { outline: none; }
.amu-learn-brand, .amu-learn-title, .amu-learn-article h3 {
  font-family: var(--display);
  font-weight: 400;
}
@media (max-width: 34rem) {
  .amu-learner { width: calc(100% - 1rem); max-height: 94dvh; border-radius: 1rem; }
  .amu-learner { margin-top: max(.5rem, env(safe-area-inset-top)); }
  .amu-learn-top { min-height: 4rem; }
  .amu-learn-actions { justify-content: stretch; }
  .amu-learn-actions button { flex: 1 1 auto; }
}


/* Adapted from Transitions.dev modal recipe for a native dialog. */
.amu-learner[open] { animation: amu-modal-enter var(--motion-enter) var(--motion-ease); }
.amu-learner.is-closing { animation: amu-modal-exit var(--motion-exit) var(--motion-ease) forwards; }
@keyframes amu-modal-enter {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes amu-modal-exit {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.96); }
}
@media (prefers-reduced-motion: reduce) {
  .amu-learner[open], .amu-learner.is-closing { animation: none; }
}

.amu-learner.is-reading[open] {
  position: fixed; inset: 0; width: 100%; height: 100%; width: 100dvw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: #070f20; overflow: hidden; animation: none;
}
.is-reading .amu-learn-top, .is-reading .amu-learn-body > .amu-learn-label { display: none; }
.is-reading .amu-learn-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.is-reading .amu-learn-body { position: relative; padding: 0; width: 100%; height: 100%; }
.reader { position: relative; width: 100%; height: 100%; overflow: hidden; container-type: size; background: #070f20; color: #f4f6fb; }
.reader-layout {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
@media (orientation: portrait) and (pointer: coarse) {
  .reader-layout {
    inset: 0 auto auto 100%; width: 100cqh; height: 100cqw;
    transform-origin: top left; transform: rotate(90deg);
    padding: env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left) env(safe-area-inset-top);
  }
}
.reader-tools, .reader-footer, .reader-zoom-tools, .reader-thumbnails { display: flex; align-items: center; }
.reader-tools, .reader-footer { gap: .75rem; padding: .22rem .65rem; }
.reader-title-block { flex: 1; min-width: 0; }
.reader-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 650 .9rem/1.4 var(--sans); }
.reader-progress { height: 3px; margin-top: .35rem; border-radius: 3px; background: #39445a; overflow: hidden; }
.reader-progress span { display: block; height: 100%; background: var(--gold); }
.reader-count { flex: none; color: #d7e1ee; font: 600 .8rem var(--sans); }
.reader-footer { min-width: 0; background: #101e35; border-top: 1px solid #31405a; }
.reader-zoom-tools { flex: none; }
.reader-button { min-height: 44px; min-width: 44px; padding: .35rem .8rem; background: transparent; color: #f4f6fb; border: 1px solid #586980; border-radius: 999px; font: 600 .9rem var(--sans); cursor: pointer; }
.reader-button:enabled:hover { background: #273853; }
.reader-button:disabled { opacity: .45; cursor: default; }
.reader-zoom-tools .reader-button { padding: .3rem; font-size: 1.2rem; border: 0; }
.reader-zoom-tools .reader-button:nth-child(2) { font-size: .8rem; }
.reader-spread { min-height: 0; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: .45rem; align-items: center; padding: .15rem .45rem; }
.reader-spread > button { font-size: 1.65rem; padding: 0; }
.reader-sheet-area { height: 100%; min-height: 0; display: grid; place-items: center; container-type: size; }
.reader-stage { position: relative; overflow: hidden; width: min(100cqw, calc(100cqh * var(--reader-page-ratio, 1.55))); aspect-ratio: var(--reader-page-ratio, 1.55); container-type: inline-size; background: #fbf7ec; touch-action: none; user-select: none; }
.reader-stage.is-zoomed { cursor: grab; }
.reader-stage.is-zoomed:active { cursor: grabbing; }
.reader-rail { display: flex; height: 100%; transition: transform 200ms ease-out; }
.reader-frame { height: 100%; min-width: 100%; width: 100%; overflow: hidden; }
.reader-paper { position: relative; display: flex; height: 100%; background: #fbf7ec; transform-origin: top left; color: #142844; }
.paper-copy { display: flex; flex: 1; flex-direction: column; justify-content: center; padding: 5cqw; min-width: 0; }
.paper-copy small { font: 700 1.85cqw var(--sans); letter-spacing: .08em; color: #70552a; }
.paper-copy h3 { margin: 3cqw 0 2cqw; font: 400 5.8cqw/1.03 var(--display); }
.paper-copy p { margin: 0; font: 400 3.3cqw/1.42 var(--sans); }
.paper-folio { margin-top: auto; padding-top: 2cqw; font: 550 2.2cqw var(--sans); color: #586981; }
.paper-art { width: 27%; object-fit: cover; }
.reader-original { width: 100%; height: 100%; object-fit: contain; }
.reader-watermark {
  position: absolute; transform: translate(-50%, -50%);
  font: 600 .80cqw/1 var(--sans); letter-spacing: .08em; white-space: nowrap;
  color: rgb(66 50 49 / 20%); pointer-events: none; user-select: none;
}
.reader-pending { color: #cfdaea; font: 500 .82rem var(--sans); }
.reader-thumbnails { flex: 1; gap: .3rem; overflow-x: auto; }
.reader-thumbnails .reader-button { flex: none; padding: .15rem; border: 0; border-radius: .3rem; }
.reader-miniature { display: block; width: 44px; aspect-ratio: var(--reader-page-ratio, 1.55); container-type: inline-size; overflow: hidden; opacity: .6; border-radius: 3px; }
.reader-thumbnails [aria-current] .reader-miniature { opacity: 1; outline: 2px solid var(--gold); }
.reader-quiz { color: #101e35; background: var(--gold); border-color: var(--gold); white-space: nowrap; }
.reader-quiz:enabled:hover { background: #ebd09c; }
.reader-button[hidden] { display: none; }
.reader-placeholder { margin: 1rem 0; padding: 2rem 1rem; border: 1px dashed #b5c1d1; border-radius: .8rem; text-align: center; background: #f3f6fa; }
.reader-placeholder p { margin-top: .4rem; color: #53647a; }
@media (prefers-reduced-motion: reduce) { .reader-rail { transition: none; } }
