:root {
  color-scheme: dark;
  font-family: Georgia, 'Times New Roman', serif;
  background: #242424;
  color: #e7e5e0;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

main {
  max-width: 620px;
  margin: 36px auto 0;
  padding: 0 28px 76px;
}

#chapter h1 {
  font-size: 38px;
  font-weight: normal;
  letter-spacing: -1px;
  line-height: 1.03;
  margin: 0 0 38px;
}

#chapter > p {
  font-size: 19px;
  line-height: 1.45;
  margin: 0 0 1.1em;
  overflow-wrap: break-word;
}

footer {
  position: fixed;
  bottom: calc(3px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  padding: 0 16px;
  pointer-events: none;
}

.footer-inner {
  height: 44px;
  max-width: 588px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  font-family: system-ui, sans-serif;
}

footer button {
  border: 0;
  border-radius: 4px;
  font: 11px system-ui, sans-serif;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  color: #b8b6b0;
  background: #242424d9;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid #e7e5e0;
  outline-offset: 3px;
}

#back { justify-self: start; }
#next { grid-column: 2; justify-self: end; }

@media (max-width: 360px) {
  main { padding-left: 23px; padding-right: 23px; }
}
