.amfs-home {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 100;
  display: grid;
  place-items: center;
  width: clamp(44px, 7vmin, 72px);
  aspect-ratio: 1;
  text-decoration: none;
  border-radius: 6px;
}
.amfs-home img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px #35200d70);
}
.amfs-home:focus-visible { outline: 3px solid #163d34; outline-offset: 3px }
@media (orientation: landscape) {
  #board:not([hidden]) .art-home {
    background: #f7eddb url("/amfs-home-school.webp") center / contain no-repeat;
  }
  body:has(#board:not([hidden]) .art-home) > .amfs-home { display: none }
}

.amfs-back { --back-image: url("/amfs-back.webp") }
body .amfs-back:not(#back) {
  position: fixed;
  inset: auto auto max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  z-index: 100;
  display: block;
  width: clamp(54px, 9vmin, 86px);
  height: clamp(44px, 7vmin, 64px);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--back-image) center / contain no-repeat;
  color: transparent;
  font-size: 0;
  text-decoration: none;
  box-shadow: none;
}
.amfs-back:focus-visible { outline: 3px solid #163d34; outline-offset: 3px }
@media (orientation: portrait) {
  #board #back.amfs-back {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 100;
    width: clamp(54px, 9vmin, 86px);
    height: clamp(44px, 7vmin, 64px);
    padding: 0;
    background: var(--back-image) center / contain no-repeat;
    color: transparent;
    font-size: 0;
  }
}

/* Start each page at the top while keeping horizontally centered artwork. */
html body { align-items: start; align-content: start }
html body > main { margin-block-start: 0; padding-block-start: 0 }
html body > main:has(#cabinet:not([hidden])) { align-items: start; align-content: start }
@media (orientation: landscape) {
  html body > main.lesson-view { align-items: start; align-content: start }
}
