.reader-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 85px);
  align-items: start;
}
.reader-entry-grid, .reader-entry-single { padding-bottom: clamp(55px, 7vw, 95px); }
.reader-entry-single > section { max-width: 560px; margin-inline: auto; }
.reader-entry-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 20px; max-width: 460px; }
.reader-entry-form label { margin-top: 8px; font-size: .94rem; font-weight: 650; }
.reader-entry-form input:not([type=hidden]) {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  font: inherit;
  font-size: max(16px, 1em);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
}
.reader-entry-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reader-entry-form small { color: var(--muted); }
.reader-entry .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}
.reader-entry .button:hover { border-color: var(--ink); }
.reader-entry .button.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.reader-entry .button.accent:hover { background: #7f2819; border-color: #7f2819; }
.reader-entry-form .button { width: fit-content; margin-top: 12px; }
.reader-entry-links { font-size: .94rem; }
.reader-entry-message { border-left: 3px solid var(--accent); background: var(--soft); padding: 10px 13px; }
.reader-entry-confirmation { border-left: 3px solid #496653; background: var(--soft); padding: 18px 22px; }
.reader-entry-confirmation h2 { font-size: 1.6rem; }
.reader-entry-confirmation p { margin-top: 10px; }
.reader-entry-book {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px 22px;
  margin-top: 20px;
  padding: clamp(15px, 3vw, 26px);
  background: var(--soft);
}
.reader-entry-cover img { width: 100%; height: auto; }
.reader-entry-book h3 a { text-decoration: none; }
.reader-entry-book h3 a:hover { color: var(--accent); text-decoration: underline; }
.reader-entry-book p { margin-top: 5px; }
.reader-entry-choices { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.reader-entry-choices .button { min-height: 44px; margin-top: 0; }
.reader-account-email { margin: 18px 0 22px; }
.reader-account-email dt { font-size: .88rem; color: var(--muted); }
.reader-account-email dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.reader-account-password { padding: 14px 0; border-block: 1px solid var(--line); }
.reader-account-password summary { font-weight: 650; cursor: pointer; }
.reader-account-password .reader-entry-form { margin-top: 12px; }
.reader-edition :focus-visible { outline: 2px solid #456e58; outline-offset: 3px; }
@media (max-width: 700px) {
  .reader-entry-grid { grid-template-columns: minmax(0, 1fr); }
  .reader-entry-book { grid-template-columns: 78px minmax(0, 1fr); }
  .reader-entry-form .button { width: 100%; }
}

html:has(.reader-edition) { scroll-padding-top: 6rem; }
.reader-edition .viewer { margin-top: 0; }
.reader-edition .reader-toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: .2rem .75rem;
  padding: .45rem .55rem; margin: 0 0 .7rem; border-bottom: 1px solid #c4ac83;
  background: #f7f1e6; color: #503e2a; font: .85rem/1.25 system-ui, sans-serif;
}
.reader-toolbar a, .reader-toolbar button {
  color: inherit; min-height: 2.35rem; padding: .4rem .16rem;
  display: inline-flex; align-items: center; background: transparent; border: 0;
  font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .18em;
}
.reader-edition .book { user-select: none; -webkit-user-select: none; }
.reader-edition .book a { -webkit-touch-callout: default; }
.reader-edition .reader-photo {
  display: block; width: 100%; margin: 0; padding: 0; border: 0; background: transparent;
  cursor: zoom-in; -webkit-touch-callout: none;
}
.reader-edition .reader-photo img { -webkit-touch-callout: none; }
.reader-edition .reader-photo:focus-visible { outline-offset: 0; }
.reader-edition .reader-dialog {
  box-sizing: border-box; width: min(96vw, 73rem); max-width: 96vw; padding: .6rem;
  border: 1px solid #c4ac83; border-radius: .4rem; color: #262019; background: #fff;
}
.reader-dialog::backdrop { background: #160f09c9; }
.reader-dialog form { display: flex; justify-content: flex-end; margin: 0 0 .4rem; }
.reader-dialog button { font: 1rem system-ui; min-height: 2.3rem; cursor: pointer; }
.reader-dialog img { display: block; width: 100%; height: min(72vh, 700px); object-fit: contain; user-select: none; -webkit-touch-callout: none; }
@media (max-width: 575px) {
  .reader-edition .sheet.blank { display: none; }
  .reader-edition .viewer { margin-bottom: 12px; padding-inline: 4px; }
  .reader-edition .sheet { padding-inline: max(25px, 6vw); }
  .reader-edition .hero img { max-height: none; }
}
@media print {
  .reader-edition > * { display: none !important; }
}
