/* ================= LEITOR NATIVO — FOLIO EDITORIAL ESCURO ================= */
.reader-view {
  color-scheme: dark;
  --r-table: #07070A;
  --r-bg: #131318;
  --r-surface: #18181F;
  --r-surface-2: #1E1E27;
  --r-text: #EAE6DD;
  --r-text-soft: #B4AEA2;
  --r-text-muted: #7C766C;
  --r-border: rgba(255, 255, 255, 0.08);
  --r-accent: #D6A456;
  --r-accent-2: #D6A456;
  --r-font-size: 18px;
  --r-line-height: 1.76;
  --r-max-width: 820px;

  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background-color: var(--r-table);
  background-image:
    radial-gradient(960px 520px at 50% 0%, color-mix(in srgb, var(--r-accent) 11%, transparent), transparent 72%);
  color: var(--r-text);
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.26s var(--ease-out);
}

.reader-view.is-visible {
  opacity: 1;
}

.reader-view[data-reader-theme="warm-dark"] {
  --r-table: #0D0A08;
  --r-bg: #181411;
  --r-surface: #1F1915;
  --r-surface-2: #27201B;
  --r-text: #EDE6DA;
  --r-text-soft: #BEB2A2;
  --r-text-muted: #887C6C;
  --r-border: rgba(235, 210, 175, 0.10);
}

.reader-view[data-reader-theme="sepia"] {
  color-scheme: light;
  --r-table: #181410;
  --r-bg: #F6F2E8;
  --r-surface: #FAF7F0;
  --r-surface-2: #EFE9DB;
  --r-text: #1B1714;
  --r-text-soft: #4A423A;
  --r-text-muted: #786D61;
  --r-border: rgba(35, 28, 20, 0.14);
}

.reader-progress-track {
  height: 2px;
  width: 100%;
  background: transparent;
  position: relative;
  z-index: 12;
}

.reader-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--r-accent), color-mix(in srgb, var(--r-accent-2) 60%, #FFFFFF));
  transition: width 0.18s ease-out;
}

/* TOPBAR FLUTUANTE MINIMALISTA */
.reader-topbar {
  height: 58px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(14, 14, 19, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  opacity: 0.72;
  transition: opacity 0.3s ease, background-color 0.3s ease;
  z-index: 30;
}

.reader-topbar:hover,
.reader-topbar:focus-within {
  opacity: 1;
}

.reader-top-left,
.reader-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reader-btn,
.reader-icon-btn {
  height: 36px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: #EAE6DD;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.25s var(--ease-out);
}

.reader-btn {
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.reader-icon-btn {
  width: 36px;
  padding: 0;
}

.reader-btn:hover,
.reader-icon-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--r-accent);
  transform: translateY(-1px);
}

.reader-icon-btn.is-active {
  background: color-mix(in srgb, var(--r-accent) 20%, transparent);
  border-color: var(--r-accent);
  color: var(--r-accent);
}

.reader-aa-btn {
  font-family: var(--font-serif);
  font-size: 15px;
}

.reader-title-group {
  display: flex;
  align-items: baseline;
  min-width: 0;
  margin-left: 8px;
}

.reader-book-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #F2EFE9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* POPOVER AA & DOWNLOADS */
.reader-popover-anchor {
  position: relative;
}

.reader-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 312px;
  padding: 16px;
  border-radius: 14px;
  background: #17171E;
  color: #EAE6DD;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.65);
  z-index: 45;
  animation: modalRise 0.2s var(--ease-out);
}

.reader-downloads-popover {
  width: 276px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dl-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 13px;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dl-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--r-accent);
  transform: translateX(2px);
}

.dl-link small {
  color: #9E978B;
  font-size: 11px;
}

.aa-group + .aa-group {
  margin-top: 14px;
}

.aa-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #8C867B;
  margin-bottom: 6px;
}

.aa-theme-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.aa-theme-btn {
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: #EAE6DD;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.aa-theme-btn.active {
  border-color: var(--r-accent);
  background: color-mix(in srgb, var(--r-accent) 18%, transparent);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.swatch-dark { background: #131318; }
.swatch-warm-dark { background: #261C15; }
.swatch-sepia { background: #F3ECE0; }

.aa-segmented {
  display: flex;
  padding: 3px;
  border-radius: 9px;
  background: #101015;
  gap: 2px;
}

.aa-segmented button {
  flex: 1;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #8D877D;
  cursor: pointer;
}

.aa-segmented button.active {
  background: #23232D;
  color: #F4F0E8;
}

.aa-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 9px;
  padding: 3px;
}

.aa-stepper button {
  width: 48px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: #23232D;
  color: #F4F0E8;
  font-weight: 700;
  cursor: pointer;
}

.aa-stepper span {
  font-size: 13px;
  font-weight: 600;
}

.aa-row-2 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ================= GAVETA FLUTUANTE DO SUMARIO ================= */
.reader-shell {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.reader-sidebar-backdrop {
  position: fixed;
  inset: 58px 0 0 0;
  background: rgba(4, 4, 6, 0.58);
  backdrop-filter: blur(4px);
  z-index: 22;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.reader-view.is-toc-collapsed .reader-sidebar-backdrop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.reader-sidebar {
  color-scheme: dark;
  position: fixed;
  top: 58px;
  bottom: 0;
  left: 0;
  width: 332px;
  max-width: 88vw;
  z-index: 26;
  background: rgba(16, 16, 22, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 18px 0 48px rgba(0, 0, 0, 0.65);
  color: #EAE6DD;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.34s var(--ease-out), visibility 0.34s;
}

.reader-view.is-toc-collapsed .reader-sidebar {
  transform: translateX(-105%);
  visibility: hidden;
  pointer-events: none;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  gap: 6px;
}

.sidebar-tab {
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #8E877D;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-tab.active {
  background: #23232D;
  color: #F2EFE9;
}

.sidebar-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-filter-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-filter-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #0D0D12;
  color: #F2EFE9;
  font-size: 13px;
  outline: none;
}

.reader-toc-list,
.reader-bookmarks-list,
.reader-scroll-container,
.reader-search-results,
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.reader-toc-list::-webkit-scrollbar,
.reader-bookmarks-list::-webkit-scrollbar,
.reader-scroll-container::-webkit-scrollbar,
.reader-search-results::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.reader-toc-list::-webkit-scrollbar-track,
.reader-bookmarks-list::-webkit-scrollbar-track,
.reader-scroll-container::-webkit-scrollbar-track,
.reader-search-results::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.reader-toc-list::-webkit-scrollbar-thumb,
.reader-bookmarks-list::-webkit-scrollbar-thumb,
.reader-scroll-container::-webkit-scrollbar-thumb,
.reader-search-results::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.reader-toc-list::-webkit-scrollbar-thumb:hover,
.reader-bookmarks-list::-webkit-scrollbar-thumb:hover,
.reader-scroll-container::-webkit-scrollbar-thumb:hover,
.reader-search-results::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.reader-toc-list::-webkit-scrollbar-button,
.reader-bookmarks-list::-webkit-scrollbar-button,
.reader-scroll-container::-webkit-scrollbar-button,
.reader-search-results::-webkit-scrollbar-button,
.table-scroll::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.reader-view[data-reader-theme="sepia"] .reader-scroll-container {
  scrollbar-color: rgba(120, 109, 97, 0.35) transparent;
}

.reader-view[data-reader-theme="sepia"] .reader-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(120, 109, 97, 0.32);
}

.reader-view[data-reader-theme="sepia"] .reader-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 109, 97, 0.52);
}

.reader-toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 28px;
}

.toc-part-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--r-accent);
  padding: 16px 10px 6px;
}

.toc-chap-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 2px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border: none;
  border-left: 2.5px solid transparent;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: #DCD6CA;
  cursor: pointer;
  transition: transform 0.24s var(--ease-out), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.toc-chap-btn:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.toc-chap-btn.active {
  background: color-mix(in srgb, var(--r-accent) 14%, transparent);
  border-left-color: var(--r-accent);
  color: #FFFFFF;
}

.toc-chap-num {
  font-size: 10px;
  font-weight: 600;
  color: #8A8378;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.toc-chap-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.32;
}

.toc-subheadings {
  margin: 4px 0 10px 14px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-sub-btn {
  border: none;
  background: transparent;
  text-align: left;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #989186;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.toc-sub-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(3px);
}

.toc-sub-btn.active {
  color: var(--r-accent);
  font-weight: 600;
}

/* Marcadores */
.bookmark-composer {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bookmark-composer textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #0D0D12;
  color: #F2EFE9;
  font-size: 13px;
  resize: vertical;
  outline: none;
}

.reader-bookmarks-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bookmark-card {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease;
}

.bookmark-card:hover {
  transform: translateX(3px);
  border-color: var(--r-accent);
}

.bookmark-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bookmark-card-top strong {
  font-size: 13px;
}

.bookmark-del-btn {
  border: none;
  background: transparent;
  color: #8C867B;
  cursor: pointer;
  font-size: 16px;
}

.bookmark-card p {
  margin: 0;
  font-size: 12.5px;
  color: #B4AEA2;
}

/* ================= FOLIO ABERTO DO LIVRO ================= */
.reader-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.reader-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 36px 24px 96px;
  cursor: pointer;
}

.reader-article-wrap {
  max-width: var(--r-max-width);
  margin: 0 auto;
  perspective: 2000px;
}

.reader-view[data-reader-width="narrow"] .reader-article-wrap {
  --r-max-width: 680px;
}

.reader-view[data-reader-width="wide"] .reader-article-wrap {
  --r-max-width: 1020px;
}

.reader-folio {
  position: relative;
  cursor: default;
  background: var(--r-bg);
  border: 1px solid var(--r-border);
  border-radius: 6px 14px 14px 6px;
  padding: 58px 72px 68px;
  box-shadow:
    inset 22px 0 38px -22px rgba(0, 0, 0, 0.65),
    0 28px 80px rgba(0, 0, 0, 0.62);
  transform-origin: left center;
  overflow: hidden;
}

.reader-view[data-reader-theme="sepia"] .reader-folio {
  box-shadow:
    inset 20px 0 32px -20px rgba(60, 40, 15, 0.18),
    0 28px 80px rgba(0, 0, 0, 0.55);
}

.reader-folio.is-turning-next {
  animation: pageTurnNext 0.42s var(--ease-out);
}

.reader-folio.is-turning-prev {
  animation: pageTurnPrev 0.42s var(--ease-out);
}

@keyframes pageTurnNext {
  0% {
    opacity: 0.45;
    transform: rotateY(10deg) translateX(24px);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
}

@keyframes pageTurnPrev {
  0% {
    opacity: 0.45;
    transform: rotateY(-10deg) translateX(-24px);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
}

.reader-page-turn-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.08), transparent 40%, rgba(0, 0, 0, 0.28));
}

.reader-folio.is-turning-next .reader-page-turn-fx,
.reader-folio.is-turning-prev .reader-page-turn-fx {
  animation: sheenSweep 0.42s var(--ease-out);
}

@keyframes sheenSweep {
  from { opacity: 0.9; }
  to { opacity: 0; }
}

.reader-chapter-body {
  font-family: var(--font-serif);
  font-size: var(--r-font-size);
  line-height: var(--r-line-height);
  text-align: justify;
  hyphens: auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.reader-view[data-reader-font="editorial"] .reader-chapter-body {
  font-family: Georgia, 'Times New Roman', serif;
}

.reader-view[data-reader-font="sans"] .reader-chapter-body {
  font-family: var(--font-sans);
}

.reader-view[data-reader-align="left"] .reader-chapter-body {
  text-align: left;
  hyphens: none;
}

/* ================= COMPONENTES ENCICLOPEDICOS NO FOLIO (ESTILO ORIGINAL) ================= */
.reader-chapter-body .part-banner {
  background: #1A1614;
  color: #D4A55A;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid #C69749;
  margin-bottom: 6px;
  text-align: left;
}

.reader-chapter-body .part-banner .part-kicker {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #D49B4B;
}

.reader-chapter-body .part-banner h1.part-title,
.reader-chapter-body .part-banner .part-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.18;
  color: #FAF4E8;
  margin: 4px 0 3px;
}

.reader-chapter-body .part-banner .part-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #C7D4DF;
  margin: 0;
}

.reader-view[data-book-slug="ark-survival-evolved"] .reader-chapter-body .part-banner {
  background: linear-gradient(135deg, #0C1B26 0%, #132C3E 100%);
  border-bottom-color: #D49B4B;
  padding: 14px 24px;
}

.reader-chapter-body .chapter-header {
  background: linear-gradient(135deg, #211915 0%, #141110 100%);
  color: #F6F2E8;
  padding: 26px 28px 24px;
  margin: 0 0 32px;
  border-left: 5px solid #C69749;
  border-radius: 4px 10px 10px 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.reader-chapter-body .part-banner + .chapter-header {
  border-radius: 0 0 10px 4px;
}

.reader-view[data-book-slug="outer-wilds"] .reader-chapter-body .chapter-header {
  background: linear-gradient(135deg, #131929 0%, #202A42 100%);
  border-left-color: #D49B4B;
}

.reader-view[data-book-slug="pathologic-2"] .reader-chapter-body .chapter-header {
  background: linear-gradient(135deg, #1A1514 0%, #371313 100%);
  border-left-color: #C49448;
}

.reader-view[data-book-slug="ark-survival-evolved"] .reader-chapter-body .chapter-header {
  background: linear-gradient(135deg, #0E2231 0%, #09151E 100%);
  border-left-color: #D49B4B;
}

.reader-chapter-body .chapter-header.part-ii  { border-left-color: #C69749; background: linear-gradient(135deg, #271E13 0%, #14110F 100%); }
.reader-chapter-body .chapter-header.part-iii { border-left-color: #5D7B73; background: linear-gradient(135deg, #182221 0%, #111515 100%); }
.reader-chapter-body .chapter-header.part-iv  { border-left-color: #A1321B; background: linear-gradient(135deg, #2B1310 0%, #140E0D 100%); }
.reader-chapter-body .chapter-header.part-v   { border-left-color: #6B4D78; background: linear-gradient(135deg, #211726 0%, #131015 100%); }

.reader-chapter-body .chapter-num {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #D4A55A;
  margin-bottom: 8px;
}

.reader-chapter-body .chapter-header h1,
.reader-chapter-body .chapter-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  color: #FAF6EE;
  text-align: left;
}

.reader-chapter-body .chapter-epigraph {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92em;
  color: #DED0B8;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 165, 90, 0.34);
  text-align: left;
}

.reader-chapter-body h1 {
  font-family: var(--font-display);
  font-size: 2.1em;
  line-height: 1.15;
  margin: 1.2em 0 0.6em;
  text-align: left;
}

.reader-chapter-body h2 {
  font-family: var(--font-display);
  font-size: 1.65em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--r-text);
  border-bottom: 1px solid var(--r-border);
  padding-bottom: 8px;
  margin: 1.8em 0 0.8em;
  text-align: left;
  scroll-margin-top: 82px;
}

.reader-chapter-body h3 {
  font-family: var(--font-sans);
  font-size: 1.04em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--r-accent);
  margin: 1.45em 0 0.5em;
  text-align: left;
}

.reader-chapter-body p {
  margin: 0 0 1.05em;
}

.reader-chapter-body .dropcap::first-letter,
.reader-chapter-body p.lead::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.55em;
  line-height: 0.82;
  padding: 5px 12px 0 0;
  font-weight: 700;
  color: var(--r-accent);
}

.reader-chapter-body ul,
.reader-chapter-body ol {
  margin: 0.6em 0 1.25em;
  padding-left: 1.45em;
}

.reader-chapter-body li {
  margin-bottom: 0.5em;
}

/* Pranchas com hover cinematografico */
.reader-chapter-body .figure {
  position: relative;
  margin: 1.8em 0;
  padding: 14px;
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: 12px;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.3s ease;
}

.reader-chapter-body .figure:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--r-accent) 48%, var(--r-border));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.reader-chapter-body .figure img {
  width: 100%;
  max-height: 490px;
  object-fit: cover;
  border-radius: 7px;
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
  background: #0B0B0E;
  transition: transform 0.55s var(--ease-out);
}

.reader-chapter-body .figure.contain img {
  object-fit: contain;
}

.reader-chapter-body .figure:hover img {
  transform: scale(1.015);
}

.reader-chapter-body .figure-caption {
  font-family: var(--font-sans);
  font-size: 0.77em;
  line-height: 1.52;
  color: var(--r-text-soft);
  margin-top: 11px;
  text-align: left;
}

.reader-chapter-body .figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 1.6em 0;
}

.reader-chapter-body .figure-pair .figure {
  margin: 0;
}

.reader-chapter-body .figure-pair .figure img {
  max-height: 270px;
}

/* Diagramas SVG */
.reader-chapter-body .diagram-box {
  background: #0B0B0F;
  color: #F2EFE9;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--r-accent) 42%, var(--r-border));
  border-radius: 12px;
  margin: 1.7em 0;
  cursor: zoom-in;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.3s ease;
}

.reader-chapter-body .diagram-box:hover {
  transform: translateY(-3px);
  border-color: var(--r-accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.reader-chapter-body .diagram-box svg {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.reader-chapter-body .diagram-caption {
  font-family: var(--font-sans);
  font-size: 0.77em;
  line-height: 1.5;
  color: #D2C8B6;
  margin-top: 12px;
  text-align: left;
}

/* Callouts originais tintados */
.reader-chapter-body .callout {
  background: var(--r-surface-2);
  border: 1px solid var(--r-border);
  border-left: 4px solid var(--r-accent);
  border-radius: 3px 10px 10px 3px;
  padding: 16px 20px;
  margin: 1.5em 0;
  text-align: left;
}

.reader-chapter-body .callout.gold { border-left-color: #C69749; background: color-mix(in srgb, #C69749 9%, var(--r-surface-2)); }
.reader-chapter-body .callout.dark { border-left-color: #846994; background: color-mix(in srgb, #6B4D78 11%, var(--r-surface-2)); }
.reader-chapter-body .callout.nomai { border-left-color: #5C72B8; background: color-mix(in srgb, #4A5C96 12%, var(--r-surface-2)); }
.reader-chapter-body .callout.stranger { border-left-color: #388E73; background: color-mix(in srgb, #2A6F5A 12%, var(--r-surface-2)); }
.reader-chapter-body .callout.quantum { border-left-color: #8B68C7; background: color-mix(in srgb, #6B4C9A 12%, var(--r-surface-2)); }
.reader-chapter-body .callout.steppe { border-left-color: #B6853C; background: color-mix(in srgb, #8E6324 11%, var(--r-surface-2)); }
.reader-chapter-body .callout.plague { border-left-color: #B33B3B; background: color-mix(in srgb, #8F2525 13%, var(--r-surface-2)); }
.reader-chapter-body .callout.theatre { border-left-color: #7D5E8C; background: color-mix(in srgb, #5C4668 12%, var(--r-surface-2)); }
.reader-chapter-body .callout.canon { border-left-color: #498769; background: color-mix(in srgb, #2F5C45 12%, var(--r-surface-2)); }
.reader-chapter-body .callout.element { border-left-color: #7A4694; background: color-mix(in srgb, #5B2C6F 13%, var(--r-surface-2)); }
.reader-chapter-body .callout.helena { border-left-color: #2B8465; background: color-mix(in srgb, #1E6049 13%, var(--r-surface-2)); }
.reader-chapter-body .callout.rockwell { border-left-color: #B56727; background: color-mix(in srgb, #8C4B16 13%, var(--r-surface-2)); }
.reader-chapter-body .callout.hlna { border-left-color: #1D7F96; background: color-mix(in srgb, #1A6E82 13%, var(--r-surface-2)); }
.reader-chapter-body .callout.tek { border-left-color: #228EA3; background: color-mix(in srgb, #1D7A8C 13%, var(--r-surface-2)); }

.reader-chapter-body .callout-title {
  font-family: var(--font-sans);
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--r-accent);
  margin-bottom: 6px;
}

.reader-chapter-body .callout p:last-child {
  margin-bottom: 0;
}

/* Dialogos e peca teatral */
.reader-chapter-body .dialogue-block,
.reader-chapter-body .play-cast {
  background: color-mix(in srgb, #4A3A58 10%, var(--r-surface-2));
  border: 1px solid var(--r-border);
  border-left: 4px solid #7E6991;
  border-radius: 3px 10px 10px 3px;
  padding: 16px 20px;
  margin: 1.5em 0;
  font-size: 0.94em;
  text-align: left;
}

.reader-chapter-body .dialogue-head,
.reader-chapter-body .dialogue-speaker {
  font-family: var(--font-sans);
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--r-accent);
  margin-bottom: 10px;
}

.reader-chapter-body .dialogue-quote {
  font-style: italic;
  line-height: 1.56;
  color: var(--r-text);
  margin-bottom: 8px;
}

.reader-chapter-body .dialogue-note {
  font-size: 0.9em;
  line-height: 1.48;
  color: var(--r-text-soft);
  margin: 0;
}

.reader-chapter-body .dialogue-line {
  margin-bottom: 8px;
  line-height: 1.56;
}

.reader-chapter-body .dialogue-line:last-child {
  margin-bottom: 0;
}

.reader-chapter-body .speaker,
.reader-chapter-body .play-speaker {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--r-text);
}

.reader-chapter-body .play-act {
  margin: 1.9em 0 1.1em;
  padding: 11px 16px;
  background: #201716;
  color: #F5EFE4;
  border-top: 2px solid #C49448;
  border-bottom: 2px solid #C49448;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.8em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.reader-chapter-body .play-stage {
  font-style: italic;
  color: var(--r-text-soft);
  border-left: 2.5px solid #C49448;
  padding: 4px 0 4px 14px;
  margin: 12px 0;
  text-align: left;
}

/* Grids de itens, cards e retratos */
.reader-chapter-body .item-grid,
.reader-chapter-body .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 14px;
  margin: 1.5em 0;
}

.reader-chapter-body .card {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-top: 3.5px solid #C88A36;
  border-radius: 8px;
  padding: 15px 17px;
  text-align: left;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.25s ease;
}

.reader-chapter-body .card.nomai { border-top-color: #5C72B8; }
.reader-chapter-body .card.hearthian { border-top-color: #3B826E; }
.reader-chapter-body .card.stranger { border-top-color: #287D64; }

.reader-chapter-body .item-card,
.reader-chapter-body .portrait-card {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-left: 4px solid var(--r-accent);
  border-radius: 4px 10px 10px 4px;
  padding: 14px 16px;
  text-align: left;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.25s ease;
}

.reader-chapter-body .item-card.abyss,
.reader-chapter-body .portrait-card.abyss { border-left-color: #7D5E8C; }
.reader-chapter-body .item-card.chaos { border-left-color: #B44933; }
.reader-chapter-body .item-card.royal,
.reader-chapter-body .portrait-card.crown { border-left-color: #4D8075; }
.reader-chapter-body .portrait-card.gods { border-left-color: #C69749; }
.reader-chapter-body .portrait-card.kin { border-left-color: #B6853C; }
.reader-chapter-body .portrait-card.utopian { border-left-color: #4D748C; }
.reader-chapter-body .portrait-card.meta { border-left-color: #7D5E8C; }

.reader-chapter-body .item-card:hover,
.reader-chapter-body .card:hover,
.reader-chapter-body .portrait-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--r-accent) 55%, var(--r-border));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.reader-chapter-body .item-card,
.reader-chapter-body .portrait-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0.9em 0;
}

.reader-chapter-body .item-grid .item-card {
  margin: 0;
}

.reader-chapter-body .item-thumb {
  width: 64px;
  min-width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #0B0B0E;
  border: 1px solid color-mix(in srgb, var(--r-accent) 45%, transparent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-chapter-body .item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reader-chapter-body .item-thumb svg {
  width: 72%;
  height: 72%;
  display: block;
}

.reader-chapter-body .portrait-thumb {
  width: 86px;
  min-width: 86px;
  height: 94px;
  border-radius: 8px;
  background: #0B0B0E;
  border: 1px solid var(--r-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-chapter-body .portrait-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.reader-chapter-body .item-body,
.reader-chapter-body .portrait-body,
.reader-chapter-body .portrait-info {
  flex: 1;
  min-width: 0;
}

.reader-chapter-body .item-title,
.reader-chapter-body .item-body h4,
.reader-chapter-body .card-name,
.reader-chapter-body .portrait-info h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.98em;
  color: var(--r-text);
  margin: 0 0 2px;
}

.reader-chapter-body .item-meta,
.reader-chapter-body .card-role,
.reader-chapter-body .role {
  font-family: var(--font-sans);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--r-accent);
  margin-bottom: 7px;
}

.reader-chapter-body .item-quote {
  font-style: italic;
  font-size: 0.88em;
  color: var(--r-text-soft);
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px dashed var(--r-border);
}

.reader-chapter-body .item-body p,
.reader-chapter-body .portrait-body p {
  font-size: 0.88em;
  line-height: 1.54;
  margin: 0;
}

/* Tabelas responsivas limpas */
.reader-chapter-body .table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
  border-radius: 10px;
  border: 1px solid var(--r-border);
}

.reader-chapter-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.82em;
  line-height: 1.48;
  text-align: left;
}

.reader-chapter-body th {
  background: #1C1816;
  color: #FAF4E8;
  font-size: 0.82em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 13px;
  border-bottom: 1px solid var(--r-border);
}

.reader-view[data-book-slug="outer-wilds"] .reader-chapter-body th {
  background: #192136;
}

.reader-view[data-book-slug="pathologic-2"] .reader-chapter-body th {
  background: #241716;
}

.reader-chapter-body td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--r-border);
  vertical-align: top;
}

.reader-chapter-body tr:nth-child(even) td {
  background: color-mix(in srgb, var(--r-surface-2) 55%, transparent);
}

.reader-chapter-body mark.search-hit {
  background: #E8BD55;
  color: #141210;
  padding: 0 3px;
  border-radius: 3px;
}

/* RODAPE DO CAPITULO */
.reader-chapter-footer {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--r-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.chapter-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid var(--r-border);
  background: var(--r-surface);
  color: var(--r-text);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: transform 0.3s var(--ease-out), border-color 0.25s ease, box-shadow 0.3s ease;
}

.chapter-nav-btn.next {
  text-align: right;
  align-items: flex-end;
}

.chapter-nav-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--r-accent);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

.chapter-nav-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.chapter-nav-btn .nav-dir {
  font-size: 11px;
  color: var(--r-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.chapter-nav-btn strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* PDF VIEWER NATIVO */
.reader-pdf-wrap {
  cursor: default;
  max-width: 1060px;
  margin: 0 auto;
  height: 100%;
  min-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reader-pdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: 10px;
}

.reader-pdf-actions {
  display: flex;
  gap: 8px;
}

.reader-pdf-frame {
  flex: 1;
  width: 100%;
  min-height: 76vh;
  border: 1px solid var(--r-border);
  border-radius: 12px;
  background: #1B1B20;
}

/* BUSCA NO LIVRO */
.reader-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.reader-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
}

.modal-close-inline {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 12px;
  cursor: pointer;
}

.reader-search-meta {
  padding: 8px 18px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.reader-search-results {
  overflow-y: auto;
  max-height: 55vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-hit-item {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: transform 0.22s var(--ease-out), border-color 0.2s ease;
}

.search-hit-item:hover {
  transform: translateX(4px);
  border-color: var(--accent);
}

.search-hit-item strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 3px;
}

.search-hit-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.search-hit-item mark {
  background: #E8BD55;
  color: #141210;
  padding: 0 2px;
  border-radius: 2px;
}

.reader-view.is-lightbox-open .reader-scroll-container {
  overflow: hidden !important;
  touch-action: none;
}

/* LIGHTBOX */
.lightbox-modal {
  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 64px;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  animation: fadeIn 0.22s ease;
}

.lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, 0.92);
  backdrop-filter: blur(12px);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 24px;
  cursor: pointer;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 26px;
  cursor: pointer;
}

.lightbox-arrow.prev { left: 16px; }
.lightbox-arrow.next { right: 16px; }

.lightbox-body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(92vw, 1120px);
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
}

.lightbox-stage {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-stage img.is-loaded {
  opacity: 1;
}

.lightbox-svg-wrap {
  width: 100%;
  max-width: min(92vw, 980px);
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage svg {
  width: 100%;
  max-width: min(92vw, 960px);
  max-height: 100%;
  height: auto;
  display: block;
  background: #0B0B0F;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-loader {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18, 18, 24, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #EAE6DD;
  font-size: 13px;
}

.lightbox-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--r-accent, #D6A456);
  animation: lbSpin 0.8s linear infinite;
}

@keyframes lbSpin {
  to { transform: rotate(360deg); }
}

.lightbox-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-radius: 12px;
  background: rgba(18, 18, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #EAE6DD;
  font-size: 13.5px;
  text-align: center;
}

.lightbox-error p {
  margin: 0;
}

.lightbox-caption-bar {
  flex-shrink: 0;
  max-height: 22dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 4px 2px;
  color: #E7E2D8;
  font-size: 13.5px;
}

.lightbox-counter {
  opacity: 0.65;
  white-space: nowrap;
}

.reader-chapter-body .card,
.reader-chapter-body .portrait-card,
.reader-chapter-body .item-card,
.reader-chapter-body .table-scroll {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

/* CAPA DE ABERTURA NO LEITOR (PRIMEIRA ABERTURA) */
.reader-folio.is-cover-page {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 10px 0 24px;
  max-width: min(560px, 92vw);
  margin: 0 auto;
  overflow: visible;
}

.reader-folio.is-cover-page .reader-chapter-footer {
  display: none;
}

.reader-cover-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.reader-cover-frame {
  width: min(460px, 82vw, calc(74vh * 2 / 3));
  aspect-ratio: 2 / 3;
  position: relative;
  border-radius: 5px 14px 14px 5px;
  overflow: hidden;
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.reader-cover-frame:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow:
    0 36px 84px rgba(0, 0, 0, 0.80),
    0 0 0 1px color-mix(in srgb, var(--r-accent) 45%, rgba(255, 255, 255, 0.14));
}

.reader-cover-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--r-accent) 55%, rgba(255, 255, 255, 0.16));
  background: rgba(18, 18, 24, 0.90);
  color: #F4F0E8;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background-color 0.2s ease, border-color 0.2s ease;
}

.reader-cover-start-btn:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--r-accent) 26%, #16161C);
  border-color: var(--r-accent);
}

@media (hover: none), (pointer: coarse) {
  .reader-topbar {
    opacity: 1;
  }
  .reader-chapter-body .figure:hover,
  .reader-chapter-body .figure:hover img,
  .reader-chapter-body .diagram-box:hover,
  .reader-cover-frame:hover,
  .chapter-nav-btn:hover:not(:disabled) {
    transform: none;
  }
}

@media (max-width: 960px) {
  .reader-scroll-container {
    padding: 18px 10px 76px;
  }
  .reader-folio {
    padding: 34px 24px 44px;
    border-radius: 10px;
  }
  .reader-chapter-body .figure-pair {
    grid-template-columns: 1fr;
  }
  .reader-chapter-footer {
    grid-template-columns: 1fr;
  }
  .lightbox-modal {
    padding: 20px;
  }
}

@media (max-width: 720px) {
  .reader-topbar {
    height: 54px;
    padding: 0 10px;
    gap: 8px;
    opacity: 1;
  }
  .reader-top-left {
    flex: 1;
    min-width: 0;
    gap: 6px;
  }
  .reader-top-right {
    flex-shrink: 0;
    gap: 5px;
  }
  #reader-back-btn {
    width: 34px;
    height: 34px;
    padding: 0;
  }
  #reader-back-btn span {
    display: none;
  }
  .reader-icon-btn {
    width: 34px;
    height: 34px;
  }
  .reader-aa-btn {
    height: 34px;
    padding: 0 11px;
    font-size: 14px;
  }
  #reader-fullscreen-btn {
    display: none;
  }
  .reader-title-group {
    margin-left: 2px;
    flex: 1;
    min-width: 0;
  }
  .reader-book-title {
    font-size: 16px;
  }

  .reader-sidebar-backdrop {
    inset: 56px 0 0 0;
  }
  .reader-sidebar {
    top: 56px;
    width: min(320px, 86vw);
  }

  .reader-popover {
    position: fixed;
    top: 62px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: 420px;
    margin: 0 auto;
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
  }
  .reader-downloads-popover {
    width: auto;
  }
  .aa-theme-btn {
    font-size: 11px;
    padding: 0 6px;
    gap: 5px;
    white-space: nowrap;
  }

  .reader-folio.is-cover-page {
    padding: 6px 0 18px;
    max-width: 100%;
  }
  .reader-cover-stage {
    gap: 18px;
  }
  .reader-cover-frame {
    width: min(350px, 84vw, calc((100dvh - 170px) * 2 / 3));
  }

  .reader-scroll-container {
    padding: 12px 8px 64px;
  }
  .reader-folio {
    padding: 24px 18px 34px;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  }
  .reader-chapter-body .part-banner,
  .reader-view[data-book-slug="ark-survival-evolved"] .reader-chapter-body .part-banner {
    padding: 10px 14px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .reader-chapter-body .chapter-header {
    padding: 18px 16px 18px;
    margin: 0 0 22px;
    border-left-width: 4px;
  }
  .reader-chapter-body .chapter-num {
    font-size: 10px;
    letter-spacing: 0.14em;
  }
  .reader-chapter-body .chapter-header h1,
  .reader-chapter-body .chapter-title {
    font-size: clamp(23px, 6.6vw, 30px);
    line-height: 1.15;
  }
  .reader-chapter-body .chapter-epigraph {
    font-size: 0.88em;
    margin-top: 10px;
    padding-top: 10px;
  }
  .reader-chapter-body .item-grid,
  .reader-chapter-body .card-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .reader-chapter-body .item-card,
  .reader-chapter-body .portrait-card {
    padding: 12px 13px;
    gap: 11px;
  }
  .reader-chapter-body .item-thumb {
    width: 50px;
    min-width: 50px;
    height: 50px;
  }
  .reader-chapter-body .portrait-thumb {
    width: 64px;
    min-width: 64px;
    height: 74px;
  }
  .reader-chapter-body .callout,
  .reader-chapter-body .dialogue-block,
  .reader-chapter-body .play-cast {
    padding: 13px 14px;
  }
  .reader-chapter-body .figure {
    padding: 10px;
    margin: 1.3em 0;
  }
  .reader-chapter-body .figure img {
    width: 100%;
    height: auto;
    max-height: 55dvh;
    object-fit: contain;
    background: #0B0B0E;
  }
  .reader-chapter-body .diagram-box {
    padding: 12px;
    margin: 1.3em 0;
  }
  .reader-chapter-body .dropcap::first-letter,
  .reader-chapter-body p.lead::first-letter {
    font-size: 3em;
    padding: 4px 9px 0 0;
  }
  .reader-chapter-body th,
  .reader-chapter-body td {
    padding: 8px 10px;
  }
  .reader-chapter-footer {
    margin-top: 36px;
    padding-top: 20px;
    gap: 10px;
  }
  .chapter-nav-btn {
    padding: 12px 14px;
  }
  .chapter-nav-btn strong {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .reader-pdf-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .reader-pdf-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .reader-pdf-actions a {
    justify-content: center;
  }
  .reader-search-bar {
    padding: 12px 14px;
  }
  .reader-search-bar input {
    font-size: 16px;
    min-width: 0;
  }
  .reader-search-results {
    max-height: 60dvh;
  }

  .lightbox-modal {
    padding: 58px 12px 68px;
  }
  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
  .lightbox-arrow {
    top: auto;
    bottom: 14px;
    transform: none;
    width: 42px;
    height: 42px;
    font-size: 24px;
  }
  .lightbox-arrow.prev {
    left: 18px;
  }
  .lightbox-arrow.next {
    right: 18px;
  }
  .lightbox-body {
    max-width: 100%;
    gap: 10px;
  }
  .lightbox-svg-wrap {
    max-width: 100%;
  }
  .lightbox-stage svg {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 10px;
  }
  .lightbox-caption-bar {
    max-height: 20dvh;
    font-size: 12.5px;
    gap: 10px;
  }
}
