.study-sheet {
  box-sizing: border-box;
  width: min(46rem, calc(100% - 2rem));
  max-height: 84dvh;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f4edde;
  color: #30261d;
  border: 1px solid #9c8768;
  border-radius: 6px;
  padding: 0;
  box-shadow: 0 20px 80px #160e0aa6;
  font: 1rem/1.5 system-ui;
  color-scheme: light;
}
.study-sheet::backdrop {
  background: #19140db8;
}
.study-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #cdbfa6;
}
.study-sheet h2,
.study-sheet h3,
.study-sheet blockquote,
.shelf-reader strong {
  font-family: Georgia, serif;
}
.study-sheet h2 {
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 0;
}
.study-sheet > div {
  padding: 16px 20px 24px;
}
.study-sheet label {
  display: grid;
  gap: 4px;
  margin: 8px 0;
}
.study-sheet button,
.study-sheet input,
.study-sheet select,
.study-sheet textarea,
.shelf-reader button {
  font: inherit;
  color: inherit;
  border: 1px solid #b0a087;
  border-radius: 4px;
  background: #fbf6ec;
  box-sizing: border-box;
  min-height: 44px;
  padding: 7px 10px;
  max-width: 100%;
}
.study-sheet button,
.shelf-reader button {
  cursor: pointer;
}
.study-sheet button:disabled {
  opacity: 0.55;
}
.study-sheet :focus-visible,
.shelf-reader :focus-visible {
  outline: 3px solid #8a492c;
  outline-offset: 1px;
}
.study-sheet select,
.study-sheet textarea {
  width: 100%;
}
.study-sheet summary {
  padding: 10px 0;
  cursor: pointer;
}
.study-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.study-sheet details {
  border-top: 1px solid #c9bba4;
  margin-top: 12px;
}
.shelf-plan {
  aspect-ratio: 1.55;
  position: relative;
  background: #e6dbc4;
  border: 2px solid #8b7150;
  margin: 8px 0;
}
.shelf-plan button {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 0.82em;
  min-height: 22px;
  height: 6.5%;
  width: 10%;
  padding: 0;
  line-height: 1;
}
.map-here {
  position: absolute;
  color: #8b382d;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}
.shelf-reader {
  position: fixed;
  z-index: 15;
  bottom: max(6rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  box-sizing: border-box;
  max-width: 94%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #30261d;
  background: #f4edde;
  border: 1px solid #aa9578;
  border-radius: 4px;
  touch-action: pan-y;
}
.shelf-reader strong {
  flex-basis: 100%;
  text-align: center;
}
.study-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.study-spread article {
  min-width: 0;
}
.study-sheet blockquote {
  margin: 10px 0;
  padding: 4px 0 4px 12px;
  border-left: 2px solid #9b6243;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .study-spread {
    grid-template-columns: 1fr;
  }
  .study-sheet > div {
    padding: 12px;
  }
  .study-sheet {
    max-height: 88dvh;
  }
  .shelf-plan {
    aspect-ratio: 1.12;
  }
}

.study-sheet [hidden] {
  display: none !important;
}
.plan-table {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22%;
  height: 3.3%;
  background: #b9a789;
  border: 1px solid #937b58;
  border-radius: 2px;
}
.shelf-plan.upper {
  border: 8px double #9a805a;
}
.study-sheet label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 10px;
}
.study-sheet input[type="checkbox"] {
  min-height: 0;
  order: -1;
  width: 20px;
  height: 20px;
}
