html, body {
  margin: 0;
  height: 100%;
  background: #161616;
  color: #f3f3f3;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  min-height: 100%;
  min-height: 100dvh;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  pointer-events: none;
}

.topbar strong,
.topbar span {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
}

.stage {
  box-sizing: border-box;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 58px 28px 18px;
}

#book {
  width: 100%;
  height: calc(100dvh - 76px);
}

#book .stf__canvas {
  width: 100%;
  height: 100%;
}

.nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 72px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e34603;
  font-size: 54px;
  line-height: 1;
  cursor: pointer;
}

.nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.nav.prev { left: 4px; }
.nav.next { right: 4px; }

.status {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #161616;
  text-align: center;
  padding: 24px;
}

.status[hidden] {
  display: none;
}

.status p {
  margin: 0;
  font-size: 16px;
}

.chooser {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 20px;
  box-sizing: border-box;
}

.chooser h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
}

.chooser a {
  display: block;
  width: min(420px, 100%);
  box-sizing: border-box;
  text-decoration: none;
  color: #111;
  background: #f7f4ee;
  border-radius: 12px;
  padding: 22px 24px;
}

.chooser a strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

.chooser a span {
  color: #444;
  font-size: 14px;
}

@media (max-width: 800px) {
  .stage {
    padding: 54px 6px 12px;
  }
  .nav {
    width: 40px;
    font-size: 46px;
  }
}
