:root {
  --ink: #070706;
  --panel: rgba(15, 13, 10, 0.78);
  --line: rgba(238, 229, 206, 0.14);
  --bone: #efe7d2;
  --muted: #b9ac91;
  --gold: #c68d55;
  color: var(--bone);
  background: var(--ink);
  font: 16px/1.4 Aptos, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.reader {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  height: 100svh;
  height: 100dvh;
  max-height: 100svh;
  max-height: 100dvh;
  background:
    radial-gradient(ellipse at 34% 38%, rgba(178, 74, 47, 0.16), transparent 38%),
    radial-gradient(ellipse at 76% 72%, rgba(60, 111, 100, 0.16), transparent 35%),
    #070706;
}

.reader-header {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  flex-shrink: 0;
  padding:
    max(12px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    14px
    max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(6, 5, 4, 0.92);
  backdrop-filter: blur(14px);
}

.reader-header-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(239, 231, 210, 0.16);
  border-radius: 6px;
  background: rgba(239, 231, 210, 0.06);
  color: var(--bone);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.home-link:hover {
  border-color: rgba(198, 141, 85, 0.5);
  background: rgba(198, 141, 85, 0.14);
  color: var(--gold);
}

.reader-reset-access {
  cursor: pointer;
  font-family: inherit;
}

.reader-download {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.reader-download-toggle {
  cursor: pointer;
  font-family: inherit;
}

.reader-download.is-open .reader-download-toggle {
  border-color: rgba(198, 141, 85, 0.5);
  background: rgba(198, 141, 85, 0.14);
  color: var(--gold);
}

.reader-download-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  padding: 6px;
  border: 1px solid rgba(239, 231, 210, 0.18);
  border-radius: 8px;
  background: rgba(12, 11, 9, 0.97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.reader-download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--bone);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.reader-download-item:hover {
  background: rgba(198, 141, 85, 0.14);
  color: var(--gold);
}

.reader-download-item.is-locked {
  color: var(--muted);
}

.reader-download-item.is-locked::after {
  content: "backers";
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(198, 141, 85, 0.85);
}

.audio-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(239, 231, 210, 0.16);
  border-radius: 6px;
  background: rgba(239, 231, 210, 0.06);
  color: var(--bone);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.audio-toggle:hover {
  border-color: rgba(198, 141, 85, 0.5);
  background: rgba(198, 141, 85, 0.14);
  color: var(--gold);
}

.audio-toggle.is-off {
  opacity: 0.45;
}

.reader-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.15;
}

.build-label {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-help-launch {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(198, 141, 85, 0.44);
  border-radius: 999px;
  background: rgba(198, 141, 85, 0.12);
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.reader-help-launch:hover {
  border-color: rgba(198, 141, 85, 0.72);
  background: rgba(198, 141, 85, 0.2);
}

.page-counter {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(239, 231, 210, 0.12);
  border-radius: 6px;
  background: rgba(239, 231, 210, 0.04);
  text-align: right;
  white-space: nowrap;
}

.page-counter-label {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-counter strong {
  color: var(--bone);
  font-size: 15px;
  font-weight: 700;
}

.reader-display-size {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(239, 231, 210, 0.12);
  border-radius: 6px;
  background: rgba(239, 231, 210, 0.04);
}

.reader-display-size-heading {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.reader-display-size output {
  min-width: 3.1rem;
  color: var(--bone);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  flex: 0 0 auto;
}

.reader-display-size-slider {
  width: min(148px, 30vw);
  height: 18px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  flex: 1 1 auto;
  accent-color: #c68d55;
}

.reader-display-size-slider:focus-visible {
  outline: 2px solid rgba(198, 141, 85, 0.65);
  outline-offset: 2px;
}

.reader-display-size-slider:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.reader-display-size-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(239, 231, 210, 0.18);
}

.reader-display-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 1px solid rgba(198, 141, 85, 0.85);
  border-radius: 50%;
  background: #efe7d2;
  box-shadow: 0 0 0 2px rgba(198, 141, 85, 0.18);
}

.reader-display-size-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(239, 231, 210, 0.18);
}

.reader-display-size-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(198, 141, 85, 0.85);
  border-radius: 50%;
  background: #efe7d2;
  box-shadow: 0 0 0 2px rgba(198, 141, 85, 0.18);
}

.controls {
  display: flex;
  gap: 8px;
}

.controls button {
  padding: 8px 11px;
  border: 1px solid rgba(239, 231, 210, 0.16);
  border-radius: 6px;
  background: rgba(239, 231, 210, 0.08);
  color: var(--bone);
  cursor: pointer;
}

.controls button:hover {
  border-color: rgba(198, 141, 85, 0.5);
  background: rgba(198, 141, 85, 0.16);
}

.reader-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding:
    clamp(4px, 0.75svh, 8px)
    max(clamp(6px, 1vw, 12px), env(safe-area-inset-right))
    max(clamp(4px, 0.75svh, 8px), env(safe-area-inset-bottom))
    max(clamp(6px, 1vw, 12px), env(safe-area-inset-left));
}

.reader-stage.reader-stage--scaled {
  align-items: flex-start;
  overflow: auto;
}

.reader-tap-zone {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  width: 40%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.reader-tap-zone--previous { left: 0; }
.reader-tap-zone--next { right: 0; }

/* Opening veil — hide empty StPageFlip until cover + first spread are decoded */
.reader.is-preparing .book {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.reader.is-preparing .reader-tap-zone,
.reader.is-preparing .controls,
.reader.is-preparing .reader-help-launch {
  pointer-events: none;
  opacity: 0.35;
}

.reader-load-veil {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(198, 141, 85, 0.1), transparent 52%),
    rgba(7, 7, 6, 0.92);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.reader:not(.is-preparing) .reader-load-veil {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.reader-load-veil__inner {
  max-width: 22rem;
  text-align: center;
}

.reader-load-veil__eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.reader-load-veil__title {
  margin: 0 0 14px;
  color: var(--bone);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: normal;
  letter-spacing: 0.02em;
}

.reader-load-veil__progress {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.reader-load-veil.is-failed .reader-load-veil__title {
  color: var(--bone);
}

.reader-load-veil.is-failed .reader-load-veil__progress {
  color: var(--gold);
}

/* Opening veil hard-fail (Retry) — legacy path; never soft-open an empty book. */
.reader-load-veil.is-hard-failed {
  pointer-events: auto;
}

.reader-load-veil.is-hard-failed .reader-load-veil__retry {
  display: inline-block;
  margin-top: 16px;
  appearance: none;
  border: 1px solid rgba(198, 141, 85, 0.55);
  border-radius: 2px;
  background: rgba(198, 141, 85, 0.16);
  color: var(--bone);
  padding: 10px 16px;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.reader-load-veil:not(.is-hard-failed) .reader-load-veil__retry {
  display: none;
}

.reader-soft-toast {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 12;
  transform: translateX(-50%);
  max-width: min(22rem, calc(100% - 28px));
  padding: 10px 14px;
  border: 1px solid rgba(198, 141, 85, 0.35);
  border-radius: 8px;
  background: rgba(8, 7, 5, 0.92);
  color: var(--bone);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.reader-soft-toast.is-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

.reader-stage::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(239, 231, 210, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 231, 210, 0.014) 1px, transparent 1px);
  background-size: 30px 30px;
  content: "";
  mask-image: radial-gradient(ellipse at center, black, transparent 76%);
  pointer-events: none;
}

.reader-help-tip {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 22;
  width: min(330px, calc(100vw - 28px));
  padding: 12px 36px 12px 12px;
  border: 1px solid rgba(198, 141, 85, 0.24);
  border-radius: 8px;
  background: rgba(8, 7, 5, 0.92);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36);
  color: var(--bone);
}

.reader-help-tip[hidden] {
  display: none !important;
}

.reader-help-tip-title {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reader-help-tip-body {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.reader-help-tip-body kbd {
  display: inline-block;
  min-width: 22px;
  margin: 0 2px;
  padding: 1px 6px;
  border: 1px solid rgba(239, 231, 210, 0.22);
  border-radius: 4px;
  background: rgba(239, 231, 210, 0.08);
  color: var(--bone);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.reader-help-tip-close {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(239, 231, 210, 0.75);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.reader-help-tip-close:hover {
  background: rgba(198, 141, 85, 0.14);
  color: var(--gold);
}

.book {
  position: relative;
  z-index: 2;
  flex-shrink: 1;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  background: var(--ink);
  /* box-shadow avoids filter repaints on every StPageFlip transform frame */
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62);
}

.book canvas {
  border: none;
  background: transparent;
}

/* Match page edge color — pure #000 flashed during StPageFlip curl */
.stf__parent,
.stf__wrapper,
.stf__block {
  background: var(--ink);
}

.mobile-pdf-download,
.mobile-controls-toggle {
  display: none;
}

/* StPageFlip's bundled CSS misspells this selector as .sft__wrapper.
   Without an explicit height, the mobile wrapper collapses and hides every page. */
.stf__wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.stf__item {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Promote flip layers only while curling — avoids permanent will-change cost */
.book.is-flipping .stf__item,
.book.is-flipping .stf__block {
  will-change: transform;
}

.reader-page {
  overflow: hidden;
  aspect-ratio: 1100 / 1674;
  background: transparent;
}

.reader-page--blank {
  background:
    radial-gradient(ellipse at center, rgba(239, 231, 210, 0.035), transparent 56%),
    var(--ink);
}

.reader-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Page-local placeholder when src is assigned but paint is incomplete.
   Build 178 nail: never hide in-flight art (opacity 0 made healthy WebPs look
   like a dead reader). Paper under + Loading/Retry overlay; img stays opacity 1
   so bytes paint the moment the browser has a bitmap. */
.reader-page.is-loading {
  background:
    linear-gradient(180deg, #f3ead6 0%, #e8dcc0 48%, #ddd0b0 100%);
  position: relative;
}

.reader-page.is-loading img {
  opacity: 1;
}

.reader-page.is-failed {
  background:
    linear-gradient(180deg, #efe2c8 0%, #e2d2b0 100%);
  position: relative;
}

.reader-page.is-failed img {
  opacity: 0.2;
}

.reader-page-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  pointer-events: none;
  color: #5a4a32;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
}

.reader-page-placeholder__msg {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.reader-page-placeholder__retry {
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(90, 74, 50, 0.35);
  border-radius: 4px;
  background: rgba(255, 250, 240, 0.9);
  color: #3d3224;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
}

.reader.has-page-lifecycle .reader-page.is-loading {
  background:
    linear-gradient(180deg, #f3ead6 0%, #e8dcc0 48%, #ddd0b0 100%);
}

/* Overlap facing pages 1px to hide center hairline (StPageFlip --left / --right) */
.book .reader-page.--left img {
  width: calc(100% + 1px);
  max-width: none;
}

.reader-backer-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 3, 2, 0.82);
  backdrop-filter: blur(10px);
}

.reader-backer-gate-preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.reader-backer-gate-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: blur(18px) brightness(0.45);
  transform: scale(1.08);
  opacity: 0.55;
}

.reader-backer-gate[hidden] {
  display: none !important;
}

.reader-backer-gate-card {
  position: relative;
  z-index: 1;
  width: min(420px, 94vw);
  padding: 32px 28px 28px;
  border: 1px solid rgba(198, 141, 85, 0.28);
  border-radius: 8px;
  background: rgba(12, 10, 8, 0.96);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.reader-backer-gate-card.shake {
  animation: reader-gate-shake 0.45s ease;
}

@keyframes reader-gate-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

.reader-backer-gate-eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-backer-gate-title {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 600;
  line-height: 1.2;
}

.reader-backer-gate-body {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.reader-backer-gate-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.reader-backer-gate-input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border: none;
  border-bottom: 1px solid rgba(239, 231, 210, 0.22);
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font-size: 15px;
  text-align: center;
  letter-spacing: 0.06em;
}

.reader-backer-gate-input:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

.reader-backer-gate-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(239, 231, 210, 0.35);
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.reader-backer-gate-toggle:hover {
  color: var(--gold);
  background: rgba(198, 141, 85, 0.08);
}

.reader-backer-gate-toggle.showing {
  color: var(--gold);
}

.reader-backer-gate-toggle svg {
  display: block;
  pointer-events: none;
}

.reader-backer-gate-toggle .pw-toggle-icon--hide {
  display: none;
}

.reader-backer-gate-toggle.showing .pw-toggle-icon--show {
  display: none;
}

.reader-backer-gate-toggle.showing .pw-toggle-icon--hide {
  display: block;
}

.reader-backer-gate-btn {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  padding: 13px 16px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #c68d55 0%, #9b7040 100%);
  color: #070706;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.reader-backer-gate-btn:hover {
  filter: brightness(1.06);
}

.reader-backer-gate-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.reader-backer-gate-btn--secondary {
  margin-top: 4px;
  background: rgba(198, 141, 85, 0.18);
  color: var(--bone);
  border: 1px solid rgba(198, 141, 85, 0.35);
}

.reader-backer-gate-btn--secondary:hover {
  filter: brightness(1.08);
}

.reader-backer-gate-paywall {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reader-backer-gate-code,
.reader-backer-gate-restore {
  margin-top: 4px;
}

.reader-backer-gate-link {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.reader-backer-gate-link--subtle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.reader-backer-gate-error {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: #d4846a;
  font-size: 13px;
}

.reader-backer-gate-dismiss {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.book .reader-page.--right img {
  width: calc(100% + 1px);
  max-width: none;
  margin-left: -1px;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .reader {
    height: 100svh;
    height: 100dvh;
    min-height: 100svh;
    padding-top: calc(56px + env(safe-area-inset-top) + var(--reader-test-banner-height, 0px));
  }

  .mobile-pdf-download,
  .mobile-controls-toggle {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top) + var(--reader-test-banner-height, 0px));
    right: max(8px, env(safe-area-inset-right));
    z-index: 30;
    display: inline-flex;
    padding: 8px 11px;
    border: 1px solid rgba(239, 231, 210, 0.28);
    border-radius: 999px;
    background: rgba(7, 7, 6, 0.82);
    color: var(--bone);
    font: 600 13px/1 inherit;
    backdrop-filter: blur(10px);
    min-height: 44px;
    align-items: center;
    text-decoration: none;
  }

  .mobile-pdf-download {
    left: max(8px, env(safe-area-inset-left));
    right: auto;
  }

  .reader.mobile-controls-collapsed .reader-header {
    display: none;
  }

  .reader.mobile-controls-collapsed .reader-stage {
    height: auto;
  }

  .reader-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .reader-meta {
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
  }

  .reader-display-size {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .reader-display-size-slider {
    width: min(220px, 52vw);
    max-width: none;
  }

  .reader-help-tip {
    right: 10px;
    bottom: 10px;
    width: min(340px, calc(100vw - 20px));
  }

  .reader-stage {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
}
