.ebook-back-wrap {
  position: fixed;
  top: calc(78px + env(safe-area-inset-top, 0px));
  left: max(16px, calc((100vw - 1160px) / 2));
  z-index: 40;
  width: auto;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.ebook-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid rgba(213, 178, 103, .38);
  border-radius: 999px;
  background: rgba(5, 12, 21, .92);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28), 0 0 11px rgba(213, 178, 103, .11);
  color: #ded8cc;
  font: 750 .78rem/1 Inter, Arial, sans-serif;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  animation: ebook-back-breathe 3.6s ease-in-out infinite;
  transition: color .22s ease, border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.ebook-back-button:hover,
.ebook-back-button:focus-visible {
  border-color: rgba(241, 213, 144, .72);
  background: rgba(9, 20, 33, .98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .32), 0 0 28px rgba(213, 178, 103, .34);
  color: #f1d590;
  animation: none;
}

.ebook-back-button:focus-visible {
  outline: 2px solid rgba(241, 213, 144, .78);
  outline-offset: 3px;
}

.ebook-back-wrap + main {
  padding-top: 52px;
}

@keyframes ebook-back-breathe {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28), 0 0 11px rgba(213, 178, 103, .11);
  }
  50% {
    box-shadow: 0 7px 22px rgba(0, 0, 0, .3), 0 0 24px rgba(213, 178, 103, .28);
  }
}

@media (max-width: 520px) {
  .ebook-back-wrap {
    top: calc(70px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
  }

  .ebook-back-button {
    min-height: 44px;
    padding: 8px 13px;
    font-size: .75rem;
    animation-duration: 4s;
  }

  .ebook-back-wrap + main {
    padding-top: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ebook-back-button {
    animation: none;
  }
}
