.reader-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 84px;
  padding: 16px max(16px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}

.reader-back {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.reader-back:hover,
.reader-back:focus-visible {
  color: var(--accent);
}

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

.reader-title .section-label {
  margin-bottom: 4px;
}

.reader-title h1 {
  max-width: none;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-actions {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.reader-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.reader-download {
  justify-self: end;
}

.reader-shell {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.reader-status,
.reader-fallback {
  width: min(100%, 760px);
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
  text-align: center;
}

.reader-status:empty {
  display: none;
}

.pdf-viewer {
  display: grid;
  gap: 28px;
  justify-items: center;
}

.pdf-page {
  width: fit-content;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(30, 37, 40, 0.09);
}

.pdf-page canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #ffffff;
}

.text-reader-shell {
  width: min(100%, 960px);
}

.essay-page {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(30, 37, 40, 0.09);
}

.essay-page h2 {
  max-width: 680px;
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.essay-dek {
  max-width: 680px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.essay-body {
  display: grid;
  gap: 18px;
}

.essay-body p {
  margin: 0;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.86;
}

@media (max-width: 700px) {
  .reader-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 76px;
    padding: 12px;
  }

  .reader-back {
    grid-column: 1;
  }

  .reader-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .reader-title h1 {
    white-space: normal;
  }

  .reader-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
  }

  .reader-date {
    font-size: 0.78rem;
  }

  .reader-download {
    min-height: 40px;
    padding: 0 12px;
  }

  .reader-shell {
    padding: 20px 10px 48px;
  }

  .pdf-viewer {
    gap: 18px;
  }

  .pdf-page {
    padding: 6px;
    border-radius: 6px;
  }

  .essay-page {
    padding: 24px 18px;
  }

  .essay-page h2 {
    font-size: clamp(1.9rem, 11vw, 2.8rem);
  }

  .essay-dek {
    margin-bottom: 26px;
    font-size: 1rem;
  }

  .essay-body p {
    font-size: 1rem;
    line-height: 1.78;
  }
}
