#chapters {
  position: fixed;
  top: 3vh;
  left: 3vw;
  right: auto;
  z-index: 10;
  display: block;
  max-width: 42vw;
  padding: 0;
  font-size: 0.5rem;
  line-height: 1.35;
  background: transparent;
  pointer-events: none;
}

#chapters a {
  display: none;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  opacity: 0;
  pointer-events: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 100ms, opacity 100ms;
}

#chapters a:first-child {
  margin-right: 0;
}

#chapters a:hover,
#chapters a:focus-visible {
  color: var(--ink);
  opacity: 1;
  outline: none;
}

#chapters a.active {
  display: block;
  color: var(--ink);
  opacity: 1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
}

body.cover #chapters {
  display: none;
}

#fullscreen-toggle {
  position: fixed;
  left: 3vw;
  bottom: 3.5vh;
  z-index: 12;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

#fullscreen-toggle:hover,
#fullscreen-toggle:focus-visible {
  color: var(--ink);
  outline: none;
}

body.is-fullscreen #fullscreen-toggle,
html:fullscreen #fullscreen-toggle,
html:-webkit-full-screen #fullscreen-toggle {
  display: none;
}

body.mode-control #fullscreen-toggle {
  display: none;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 10;
}

#page-number {
  position: absolute;
  right: 3vw;
  bottom: 3.5vh;
  font-size: 0.5rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

#progress {
  height: 5px;
  width: 100%;
  border-top: 1px solid var(--rule);
  background: transparent;
}

#progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 120ms linear;
}
