.reader-page {
  min-height: 100vh;
  background: #f3f0e9;
}

.reader-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(29, 37, 36, 0.14);
  background: rgba(247, 244, 238, 0.96);
  backdrop-filter: blur(12px);
}

.reader-brand img {
  display: block;
  width: min(280px, 52vw);
  height: auto;
}

.reader-back {
  color: #254858;
  font-weight: 800;
  text-decoration: none;
}

.reader-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(38px, 6vw, 70px) 0 54px;
}

.reader-intro {
  max-width: 840px;
  margin-bottom: 28px;
}

.reader-intro h1 {
  margin-top: 7px;
  font-size: clamp(34px, 5vw, 60px);
}

.reader-intro > p:last-child {
  color: #46524e;
  font-size: 18px;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.reader-toc {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 118px);
  overflow: auto;
  border: 1px solid #d4d5d0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(23, 40, 36, 0.08);
}

.reader-toc summary {
  padding: 18px 20px;
  color: #254858;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.reader-toc nav {
  padding: 0 14px 18px;
}

.reader-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reader-toc a {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  color: #394743;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.reader-toc a:hover,
.reader-toc a:focus-visible,
.reader-toc a[aria-current="page"] {
  background: #e6eef1;
  color: #254858;
}

.reader-toc a[aria-current="page"] {
  font-weight: 850;
}

.reader-stage {
  min-width: 0;
}

.reader-toolbar {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) minmax(110px, auto);
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.reader-toolbar p {
  margin: 0;
  overflow: hidden;
  color: #46524e;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-nav-button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid #bec8c9;
  border-radius: 999px;
  background: #fff;
  color: #254858;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.reader-nav-button:hover,
.reader-nav-button:focus-visible {
  border-color: #365f72;
  background: #e6eef1;
}

.reader-nav-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.reader-frame-wrap {
  position: relative;
  min-height: 76vh;
  overflow: hidden;
  border: 1px solid #d4d5d0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(23, 40, 36, 0.12);
}

.reader-frame-wrap::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: #54605c;
  content: "Buchseite wird geladen …";
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.reader-frame-wrap[data-loading="true"]::before {
  opacity: 1;
}

#book-frame {
  display: block;
  width: 100%;
  height: 76vh;
  min-height: 620px;
  border: 0;
  background: #fff;
}

.reader-toolbar-bottom {
  margin: 12px 0 0;
}

.reader-followup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  margin-top: 30px;
  padding: clamp(24px, 4vw, 38px);
  border-radius: 20px;
  background: #e6eef1;
}

.reader-followup h2 {
  margin-top: 5px;
  font-size: clamp(27px, 3vw, 38px);
}

.reader-followup p:last-child {
  margin-bottom: 0;
  color: #46524e;
}

.reader-download {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  padding: 22px;
  text-align: center;
}

.reader-download p {
  margin: 0;
  font-weight: 750;
}

.reader-footer {
  margin-top: 0;
}

@media (max-width: 900px) {
  .reader-layout {
    grid-template-columns: 1fr;
  }

  .reader-toc {
    position: static;
    max-height: none;
  }

  .reader-toc:not([open]) {
    overflow: hidden;
  }
}

@media (max-width: 620px) {
  .reader-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .reader-brand img {
    width: min(230px, 76vw);
  }

  .reader-back {
    font-size: 14px;
  }

  .reader-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .reader-toolbar p {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  #book-frame {
    min-height: 560px;
    height: 72vh;
  }

  .reader-followup {
    grid-template-columns: 1fr;
  }

  .reader-followup .button {
    width: 100%;
  }
}
