.reader-page {
  display: grid;
  gap: 22px;
  padding: 12px 0 10px;
}

.reader-page--live {
  min-height: calc(100vh - 138px);
  gap: 16px;
}

.reader-page--live + .footer {
  display: none;
}

.reader-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 22px;
  align-items: stretch;
}

.reader-hero__copy,
.reader-hero__art,
.reader-topbar,
.reader-paper-wrap,
.reader-side__card,
.reader-gate {
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.reader-hero__copy {
  padding: 28px;
}

.reader-hero__lead {
  margin: 0;
  max-width: 660px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.65;
}

.reader-hero__art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 40%),
    linear-gradient(140deg, rgba(207, 227, 244, 0.7), rgba(246, 239, 230, 0.92));
}

.reader-hero__art img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

.reader-gate {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.8fr);
  gap: 18px;
  align-items: center;
  padding: 28px;
}

.reader-gate--waiting {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
}

.reader-gate__badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(207, 227, 244, 0.78);
  color: #164e63;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-gate__copy {
  display: grid;
  gap: 12px;
}

.reader-gate__copy p,
.reader-side__card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.reader-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reader-gate__card,
.reader-gate__status-note {
  min-height: 170px;
  border-radius: 22px;
  padding: 20px;
  border: 1px solid rgba(47, 111, 149, 0.14);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(207, 227, 244, 0.56)),
    #fff;
}

.reader-gate__card {
  display: grid;
  gap: 10px;
}

.reader-gate__card span {
  display: inline-flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: #24435a;
}

.reader-gate__status-note {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #24435a;
  font-family: "Fraunces", serif;
  font-size: 26px;
  line-height: 1.35;
}

.reader-shell {
  display: grid;
  gap: 18px;
  min-height: 0;
}

.reader-topbar {
  padding: 18px 20px;
}

.reader-topbar__field {
  display: grid;
  gap: 8px;
  max-width: 420px;
  font-weight: 600;
}

.reader-topbar select,
.reader-nav__jump input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

.reader-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reader-paper-wrap {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 36%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(245, 239, 225, 0.98));
  min-height: 0;
}

.reader-paper-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.reader-paper-meta h2 {
  margin-bottom: 4px;
}

.reader-paper-meta p,
.reader-paper-meta__page {
  margin: 0;
  color: var(--ink-soft);
}

.reader-paper-meta__eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #8a6a3b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reader-paper {
  position: relative;
  display: flex;
  align-items: stretch;
  padding: 32px 38px;
  min-height: 720px;
  border-radius: 18px 24px 22px 20px;
  border: 1px solid #d6c9ac;
  background:
    linear-gradient(90deg, rgba(141, 107, 54, 0.08), rgba(141, 107, 54, 0.02) 30px, transparent 30px),
    linear-gradient(180deg, rgba(255, 252, 236, 0.98), rgba(248, 242, 220, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 14px 30px rgba(91, 74, 53, 0.14);
}

.reader-paper::before,
.reader-paper::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(168, 136, 78, 0.16), rgba(168, 136, 78, 0.04));
}

.reader-paper::before {
  left: 12px;
}

.reader-paper::after {
  right: 10px;
}

.reader-paper__page {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  color: #30261a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.82;
  white-space: pre-wrap;
  word-break: normal;
}

.reader-word {
  display: inline;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: inset 0 -0.045em 0 rgba(156, 194, 227, 0.1);
  transition: box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}

.reader-word:hover,
.reader-word.is-active {
  background: rgba(210, 228, 244, 0.55);
  box-shadow:
    inset 0 -0.12em 0 rgba(93, 140, 176, 0.72),
    0 0 0 1px rgba(93, 140, 176, 0.16);
}

.reader-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(47, 111, 149, 0.2);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(31, 41, 55, 0.14);
  color: #23455b;
  line-height: 1.5;
}

.reader-selection-tooltip {
  position: absolute;
  z-index: 4;
  max-width: min(420px, calc(100% - 44px));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(113, 95, 51, 0.18);
  background: rgba(255, 252, 246, 0.98);
  box-shadow: 0 16px 36px rgba(70, 57, 39, 0.16);
}

.reader-selection-tooltip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reader-selection-tooltip__meta {
  margin-top: 10px;
  color: #8b7b5f;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.reader-selection-tooltip__content {
  margin-top: 12px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.reader-selection-tooltip__content.is-muted {
  color: var(--ink-soft);
}

.reader-selection-tooltip__content.is-error {
  color: #8f2f2f;
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.reader-nav__center,
.reader-nav__jump {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-nav__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #cbb48f;
  background: #fffaf0;
  color: #5a4322;
  font-size: 22px;
}

.reader-nav__arrow.is-disabled {
  opacity: 0.42;
}

.reader-nav__label {
  color: var(--ink-soft);
  font-weight: 600;
}

.reader-side {
  display: grid;
  gap: 14px;
}

.reader-side__card {
  padding: 18px;
}

.reader-side__card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.65;
}

@media (max-width: 920px) {
  .reader-hero,
  .reader-layout,
  .reader-overview,
  .reader-gate,
  .reader-gate--waiting {
    grid-template-columns: 1fr;
  }

  .reader-page--live {
    min-height: 0;
  }

  .reader-paper {
    min-height: 0;
    padding: 26px 24px;
  }

  .reader-paper__page {
    font-size: 18px;
    line-height: 1.72;
  }

  .reader-nav {
    justify-content: center;
  }
}

@media (min-width: 921px) {
  .reader-page--live .reader-shell {
    min-height: calc(100vh - 138px);
    grid-template-rows: auto auto 1fr;
  }

  .reader-page--live .reader-layout {
    min-height: 0;
  }

  .reader-page--live .reader-paper-wrap {
    min-height: 0;
  }

  .reader-page--live .reader-paper {
    min-height: 0;
    height: 100%;
  }
}
