/* A4 landscape preview — soft watercolor / pastel children's book */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Literata:ital,opsz,wght@0,7..72,500;0,7..72,700;1,7..72,500&family=Nunito:wght@400;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --ink: #2a3540;
  --ink-soft: #5a6874;
  --cream: #faf6f0;
  --sand: #efe2d2;
  --sky: #b8d4c8;
  --rose: #f0b8a8;
  --sage: #8fb89a;
  --gold: #e8a060;
  --key: #c45c3e;
  --key-soft: #a84a32;
  --frost: rgba(255, 248, 240, 0.84);
  --frost-strong: rgba(255, 252, 246, 0.93);
  --felt-peach: #f2c4a8;
  --felt-coral: #e89070;
  --felt-sage: #a8c4b0;
  --page-w: 297mm;
  --page-h: 210mm;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: #3d4f5f;
  color: var(--ink);
  line-height: 1.45;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.65rem 1.25rem;
  background: #1e2a35;
  color: #f0e6d8;
  font-size: 0.9rem;
}
.toolbar a {
  color: #f0c987;
  text-decoration: none;
  font-weight: 700;
}
.toolbar .pdf-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b2b 0%, #ff3d57 100%);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(255, 107, 43, 0.35);
}
.toolbar .pdf-btn:hover { filter: brightness(1.06); }

.book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1rem 3rem;
}

.page {
  width: min(100%, 1100px);
  aspect-ratio: 297 / 210;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(232, 180, 184, 0.25), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(197, 221, 232, 0.35), transparent 45%),
    linear-gradient(160deg, #faf6f0 0%, #f3ebe0 55%, #ebe3d6 100%);
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  padding: 1.6rem 2rem;
  position: relative;
  overflow: hidden;
  page-break-after: always;
}

.page::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(212, 165, 116, 0.35);
  border-radius: 2px;
  pointer-events: none;
}

/* COVER */
.cover {
  background:
    linear-gradient(180deg, rgba(40, 110, 140, 0.12), transparent 42%),
    radial-gradient(ellipse at 50% 28%, #b8e0f0 0%, transparent 55%),
    linear-gradient(165deg, #e8f6fa 0%, #c5e4f0 42%, #8ec4d8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cover-inner { position: relative; z-index: 1; max-width: 28rem; }
.series {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.cover h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.cover h1 span { color: #1a6b8a; }
.subtitle {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--ink-soft);
}
.cover-cat {
  margin: 1.4rem auto;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.55);
  border-radius: 999px;
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
}
.author { margin-top: 1.5rem; font-size: 0.95rem; color: var(--ink-soft); }

/* PARENT / MAP */
.parent-note h2, .map h2, .chapter h2, .coloring h2, .end h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.65rem;
  margin-bottom: 0.85rem;
  color: #5c4030;
}
.parent-note p, .parent-note li { font-size: 1.02rem; margin-bottom: 0.55rem; }
.parent-note ul { padding-left: 1.25rem; margin: 0.75rem 0; }
.hint {
  margin-top: 1rem;
  padding: 0.65rem 0.9rem;
  background: rgba(168, 197, 176, 0.35);
  border-radius: 8px;
  font-size: 0.95rem;
}

.journey {
  columns: 2;
  column-gap: 2rem;
  padding-left: 1.25rem;
  font-size: 1.05rem;
}
.journey li { margin-bottom: 0.45rem; break-inside: avoid; }
.vocab-preview {
  margin-top: 1.25rem;
  font-size: 1.05rem;
  padding: 0.6rem 0.9rem;
  background: rgba(197, 221, 232, 0.5);
  border-radius: 8px;
}

/* CHAPTER — full-bleed art; text opens as frosted ferman over art */
.chapter {
  --wash: var(--frost);
  --wash-edge: rgba(255, 248, 238, 0.45);
  background: #d4c4a8;
  z-index: 0;
  padding: 0 !important;
  display: block !important;
  overflow: hidden;
  box-shadow: none;
}
.chapter > * { position: relative; z-index: 2; }

/* Soft vignette only — art stays visible */
.chapter::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(40, 30, 20, 0.12) 0%, transparent 22%, transparent 45%, rgba(40, 30, 20, 0.18) 100%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(60, 40, 25, 0.2), transparent 65%);
  opacity: 1;
  animation: none;
}
.chapter::after {
  content: '';
  position: absolute;
  inset: 0;
  border: none;
  pointer-events: none;
  z-index: 6;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

/* Scene tints unused for overlay cards — keep solid cream for contrast */

/* Full-bleed illustration — edge to edge */
.story-bleed {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: none;
  box-shadow: none;
}
.story-bleed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
}

/* Overlay copy layer — positioned into negative space */
.chapter-copy {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1.2rem 1rem;
  margin: 0;
  overflow: visible;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
}
.chapter-copy > * { pointer-events: auto; max-width: min(38%, 21rem); }

.chapter-num {
  position: absolute;
  top: 0.65rem;
  right: 1.1rem;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 2px 10px rgba(30, 25, 20, 0.45);
  z-index: 5;
  line-height: 1;
  opacity: 1;
}
/* Keep chapter number opposite of text cluster */
.chapter:has(.text-pos-tr) .chapter-num,
.chapter:has(.text-pos-br) .chapter-num {
  right: auto;
  left: 1.1rem;
}
.chapter:has(.text-pos-tl) .chapter-num,
.chapter:has(.text-pos-bl) .chapter-num {
  right: 1.1rem;
  left: auto;
}

/* ---- text position presets (negative space of each art) ---- */
.text-pos-tr {
  align-items: flex-end;
  justify-content: flex-start;
  padding-left: 52%;
  padding-right: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 30%;
}
.text-pos-tl {
  align-items: flex-start;
  justify-content: flex-start;
  padding-right: 52%;
  padding-left: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 30%;
}
.text-pos-br {
  align-items: flex-end;
  justify-content: flex-end;
  padding-left: 52%;
  padding-right: 1rem;
  padding-top: 36%;
  padding-bottom: 0.85rem;
}
.text-pos-bl {
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 52%;
  padding-left: 1rem;
  padding-top: 36%;
  padding-bottom: 0.85rem;
}
.text-pos-tm {
  align-items: center;
  justify-content: flex-start;
  padding-inline: 22%;
  padding-top: 0.75rem;
  padding-bottom: 40%;
}

/* Compact title chip — art stays full-bleed when body is closed */
.chapter-head {
  flex: 0 0 auto;
  width: 100%;
  max-width: inherit;
  padding: 0.45rem 0.7rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(20, 30, 15, 0.16);
  background: var(--frost);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
}
.chapter h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.22rem;
  margin-bottom: 0.06rem;
  color: #1f2a1c;
  line-height: 1.12;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.chapter h2 span {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5a6b3a;
  margin-top: 0.04rem;
  letter-spacing: 0.02em;
}
.wonder {
  font-family: 'Caveat', cursive;
  font-size: 1.08rem;
  color: #3d2f24;
  margin: 0.1rem 0 0;
  line-height: 1.25;
}

.story-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(139, 94, 60, 0.4);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.95) 0%, rgba(245, 232, 214, 0.92) 100%);
  color: #5a4334;
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 2px 8px rgba(60, 40, 20, 0.1);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.story-toggle::after {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid #8b5e3c;
  border-bottom: 2px solid #8b5e3c;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.2s ease;
}
.story-toggle[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(225deg);
}
.story-toggle:hover {
  border-color: rgba(139, 94, 60, 0.6);
  transform: translateY(-1px);
}
.story-toggle:focus-visible {
  outline: 2px solid #8b5e3c;
  outline-offset: 2px;
}

/* Ferman — smooth open/close via grid 0fr→1fr (no max-height fight) */
.chapter-body.ferman {
  display: block;
  width: 100%;
  max-width: inherit;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.chapter-body[hidden] {
  display: none !important;
}
.ferman-scroll {
  position: relative;
  width: 100%;
  padding-inline: 0.15rem;
}
.ferman-rod {
  position: relative;
  z-index: 3;
  height: 0.9rem;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #c9a36a 0%, #f0d9a8 28%, #b8894a 52%, #7a5528 100%);
  box-shadow:
    0 2px 6px rgba(40, 25, 10, 0.28),
    inset 0 1px 0 rgba(255, 245, 220, 0.55),
    inset 0 -2px 3px rgba(50, 30, 10, 0.28);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.45s ease;
}
.ferman-rod::before,
.ferman-rod::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8c888 0%, #8a6230 55%, #5a3c18 100%);
  transform: translateY(-50%);
  box-shadow: 0 1px 2px rgba(40, 25, 10, 0.35);
}
.ferman-rod::before { left: -0.2rem; }
.ferman-rod::after { right: -0.2rem; }
.ferman-rod--top { margin-bottom: -0.3rem; }
.ferman-rod--bottom { margin-top: -0.3rem; }

.chapter-body.ferman.is-open .ferman-rod--top {
  transform: scaleX(1.02);
  animation: ferman-rod-tap 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.chapter-body.ferman.is-closing .ferman-rod--top {
  transform: scaleX(0.98);
}
.chapter-body.ferman.is-open .ferman-rod--bottom {
  animation: ferman-rod-drop 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ferman-veil {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
}
.chapter-body.ferman.is-open .ferman-veil {
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows 0.78s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}
.chapter-body.ferman.is-closing .ferman-veil {
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.58s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease 0.12s;
}
.ferman-veil-inner {
  overflow: hidden;
  min-height: 0;
}

.ferman-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-inline: 0.2rem;
  padding: 0.7rem 0.8rem 0.75rem;
  border-left: 1px solid rgba(140, 100, 55, 0.22);
  border-right: 1px solid rgba(140, 100, 55, 0.22);
  background:
    linear-gradient(90deg, rgba(120, 80, 40, 0.07) 0%, transparent 8%, transparent 92%, rgba(120, 80, 40, 0.07) 100%),
    linear-gradient(180deg, rgba(255, 250, 238, 0.9) 0%, rgba(255, 244, 226, 0.84) 55%, rgba(248, 236, 214, 0.86) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 10px 28px rgba(30, 20, 10, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
}
.chapter-body.ferman.is-open .ferman-sheet > * {
  animation: ferman-rise 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.chapter-body.ferman.is-open .ferman-sheet > *:nth-child(1) { animation-delay: 0.14s; }
.chapter-body.ferman.is-open .ferman-sheet > *:nth-child(2) { animation-delay: 0.22s; }
.chapter-body.ferman.is-open .ferman-sheet > *:nth-child(3) { animation-delay: 0.3s; }
.chapter-body.ferman.is-open .ferman-sheet > *:nth-child(4) { animation-delay: 0.38s; }
.chapter-body.ferman.is-closing .ferman-sheet > * {
  animation: ferman-fall 0.32s ease both;
}
.chapter-body.ferman.is-closing .ferman-sheet > *:nth-child(1) { animation-delay: 0.12s; }
.chapter-body.ferman.is-closing .ferman-sheet > *:nth-child(2) { animation-delay: 0.08s; }
.chapter-body.ferman.is-closing .ferman-sheet > *:nth-child(3) { animation-delay: 0.04s; }
.chapter-body.ferman.is-closing .ferman-sheet > *:nth-child(4) { animation-delay: 0s; }

@keyframes ferman-rod-tap {
  0% { transform: scaleX(0.96) translateY(-2px); }
  60% { transform: scaleX(1.03) translateY(0); }
  100% { transform: scaleX(1); }
}
@keyframes ferman-rod-drop {
  from { transform: translateY(-0.4rem); opacity: 0.55; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes ferman-rise {
  from { opacity: 0; transform: translateY(-0.45rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ferman-fall {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-0.25rem); }
}
@media (prefers-reduced-motion: reduce) {
  .ferman-veil,
  .chapter-body.ferman.is-open .ferman-veil,
  .chapter-body.ferman.is-closing .ferman-veil {
    transition: none !important;
  }
  .chapter-body.ferman.is-open .ferman-veil { grid-template-rows: 1fr; opacity: 1; }
  .chapter-body.ferman.is-open .ferman-sheet > *,
  .chapter-body.ferman.is-closing .ferman-sheet > *,
  .chapter-body.ferman.is-open .ferman-rod--top,
  .chapter-body.ferman.is-open .ferman-rod--bottom {
    animation: none !important;
  }
}

.chapter-copy.is-expanded {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0.6rem;
}

.chapter .verse.wash {
  flex: 0 1 auto;
  width: 100%;
  max-width: inherit;
  margin: 0;
  padding: 0;
  font-family: 'Literata', Georgia, serif;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
  color: #1e2a1c;
  background: transparent;
  border: none;
  box-shadow: none;
  align-self: stretch;
}
.verse p { margin-bottom: 0.3rem; }
.verse p:last-child { margin-bottom: 0; }
.verse .soft {
  font-family: 'Literata', Georgia, serif;
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 500;
  color: #4a5c48;
  margin-top: 0.25rem;
}
.verse .label {
  color: var(--key-soft);
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}
.key {
  color: var(--key);
  font-weight: 700;
  font-style: normal;
}
.word-box .key {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05em;
  letter-spacing: 0.03em;
}

.chapter .word-box {
  flex: 0 0 auto;
  width: 100%;
  max-width: inherit;
  margin: 0;
  padding: 0.35rem 0.55rem;
  color: #1e2a1c;
  border: none;
  border-radius: 8px;
  align-self: stretch;
  background: rgba(220, 236, 210, 0.9);
  border-left: 3px solid rgba(90, 130, 70, 0.75);
  font-family: 'Nunito', sans-serif;
  font-size: 0.74rem;
  line-height: 1.35;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.word-box span {
  display: inline;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a6b3a;
  margin-right: 0.3rem;
  font-weight: 800;
}

.chapter .care-box {
  flex: 0 0 auto;
  width: 100%;
  max-width: inherit;
  margin: 0;
  padding: 0.35rem 0.55rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #1e2a1c;
  border-radius: 8px;
  background: rgba(210, 236, 244, 0.92);
  border-left: 3px solid rgba(40, 120, 150, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.care-box span {
  display: inline;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a6b8a;
  margin-right: 0.3rem;
  font-weight: 800;
}

.chapter .mini-q {
  flex: 0 0 auto;
  width: 100%;
  max-width: inherit;
  margin: 0;
  padding: 0.35rem 0.55rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #1e2a1c;
  border-radius: 8px;
  background: rgba(210, 228, 236, 0.9);
  border-left: 3px solid rgba(70, 120, 130, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.mini-q strong { color: #2a5a66; }

/* Coloring pages keep slots */
.illust-slot, .coloring-slot {
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(139, 94, 60, 0.18);
  border-radius: 10px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  overflow: hidden;
}
.illust-slot.filled, .coloring-slot.filled {
  border-style: solid;
  border-color: rgba(139, 94, 60, 0.16);
  background: rgba(255,255,255,0.55);
  padding: 0;
  box-shadow: none;
}

.coloring .activity-block {
  margin-top: 0.55rem;
  padding: 0.5rem 0.75rem 0.55rem;
  background: rgba(197, 221, 232, 0.42);
  border-radius: 8px;
}
.coloring .activity-lead {
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  color: #6b4c3b;
  margin-bottom: 0.3rem;
}
.coloring .activity-qs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.coloring .activity-qs li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ink);
}
.coloring .activity-qs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #8b5e3c;
  opacity: 0.55;
}
.coloring-slot {
  min-height: 280px;
  max-height: 360px;
  padding: 0.5rem !important;
}
.coloring-slot img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  display: block;
  background: #fff;
  margin: 0 auto;
}

.draft .draft-note {
  margin-top: 2rem;
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  color: var(--ink-soft);
  text-align: center;
}

.words { list-style: none; font-size: 1.08rem; }
.words li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(139, 94, 60, 0.15);
}
.closing {
  margin-top: 1.5rem;
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  text-align: center;
  color: #6b4c3b;
}

.page.chapter {
  display: block;
  padding: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
}

@page {
  size: A4 landscape;
  margin: 0;
}

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html, body { background: #faf6f0 !important; }
  .toolbar { display: none !important; }
  .book { padding: 0; gap: 0; }
  .page {
    width: 297mm !important;
    height: 210mm !important;
    max-width: none !important;
    aspect-ratio: auto !important;
    box-shadow: none;
    border-radius: 0;
    page-break-after: always;
    break-after: page;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .chapter::before {
    background: linear-gradient(180deg, rgba(40,30,20,0.08) 0%, transparent 30%, transparent 50%, rgba(40,30,20,0.12) 100%);
  }
  .story-toggle { display: none !important; }
  .chapter-body[hidden] {
    display: block !important;
  }
  .chapter-body.ferman .ferman-veil {
    grid-template-rows: 1fr !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .chapter-body.ferman .ferman-sheet > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  /* PDF: frosted sheet over full-bleed art */
  .chapter-head,
  .ferman-sheet {
    -webkit-backdrop-filter: blur(16px) saturate(1.12) !important;
    backdrop-filter: blur(16px) saturate(1.12) !important;
    background: rgba(255, 248, 236, 0.82) !important;
  }
  .chapter-body.ferman {
    background: transparent !important;
  }
  .chapter .verse.wash {
    font-size: 0.78rem;
    line-height: 1.36;
  }
  .chapter .word-box {
    background: rgba(220, 236, 210, 0.92) !important;
  }
  .chapter .mini-q {
    background: rgba(210, 228, 236, 0.92) !important;
  }
}

/* ===== PDF: full-page art, then text (no overlay covering illustrations) ===== */
html.pdf-export .toolbar { display: none !important; }
html.pdf-export .book { padding: 0; gap: 0; }
html.pdf-export .page {
  width: 297mm !important;
  height: 210mm !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  box-shadow: none;
  border-radius: 0;
  page-break-after: always;
  break-after: page;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
html.pdf-export .story-toggle { display: none !important; }

html.pdf-export .page.chapter.pdf-art-only {
  padding: 0 !important;
  overflow: hidden !important;
  background: #1a1520 !important;
}
html.pdf-export .page.chapter.pdf-art-only.layout-panel-left,
html.pdf-export .page.chapter.pdf-art-only.layout-panel-right {
  display: block !important;
}
html.pdf-export .page.chapter.pdf-art-only::before,
html.pdf-export .page.chapter.pdf-art-only::after {
  display: none !important;
}
html.pdf-export .page.chapter.pdf-art-only .chapter-copy {
  display: none !important;
}
html.pdf-export .page.chapter.pdf-art-only .story-bleed {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
}
html.pdf-export .page.chapter.pdf-art-only .story-bleed img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
html.pdf-export .page.chapter.pdf-art-only .chapter-num {
  z-index: 2;
  color: rgba(255,255,255,0.85);
}

html.pdf-export .page.chapter.pdf-text-only {
  padding: 1.1rem 1.6rem 1.2rem !important;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(232, 180, 184, 0.18), transparent 50%),
    linear-gradient(160deg, #faf6f0 0%, #f3ebe0 100%) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
html.pdf-export .page.chapter.pdf-text-only.layout-panel-left,
html.pdf-export .page.chapter.pdf-text-only.layout-panel-right {
  display: flex !important;
}
html.pdf-export .page.chapter.pdf-text-only::before,
html.pdf-export .page.chapter.pdf-text-only::after {
  display: none !important;
}
html.pdf-export .page.chapter.pdf-text-only .story-bleed {
  display: none !important;
}
html.pdf-export .page.chapter.pdf-text-only .chapter-copy {
  position: relative !important;
  inset: auto !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
  overflow: auto !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  background: transparent !important;
  pointer-events: auto !important;
}
html.pdf-export .page.chapter.pdf-text-only .chapter-copy > * {
  max-width: none !important;
  width: 100% !important;
  pointer-events: auto !important;
}
html.pdf-export .page.chapter.pdf-text-only .chapter-copy.text-pos-tr,
html.pdf-export .page.chapter.pdf-text-only .chapter-copy.text-pos-tl,
html.pdf-export .page.chapter.pdf-text-only .chapter-copy.text-pos-br,
html.pdf-export .page.chapter.pdf-text-only .chapter-copy.text-pos-bl {
  padding: 0 !important;
  align-items: stretch !important;
}
html.pdf-export .page.chapter.pdf-text-only .chapter-body,
html.pdf-export .page.chapter.pdf-text-only .chapter-body[hidden] {
  display: block !important;
  position: relative !important;
  margin-top: 0.45rem !important;
}
html.pdf-export .page.chapter.pdf-text-only .ferman-veil {
  grid-template-rows: 1fr !important;
  opacity: 1 !important;
  transition: none !important;
}
html.pdf-export .page.chapter.pdf-text-only .ferman-rod {
  display: none !important;
}
html.pdf-export .page.chapter.pdf-text-only .ferman-sheet,
html.pdf-export .page.chapter.pdf-text-only .chapter-head,
html.pdf-export .page.chapter.pdf-text-only .verse.wash {
  background: rgba(255, 252, 246, 0.98) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.pdf-export .page.chapter.pdf-text-only .ferman-sheet {
  box-shadow: 0 4px 18px rgba(60, 40, 30, 0.08) !important;
  border: 1px solid rgba(200, 170, 140, 0.35) !important;
  max-height: none !important;
  overflow: visible !important;
}
html.pdf-export .page.chapter.pdf-text-only .ferman-sheet > * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
html.pdf-export .page.chapter.pdf-text-only .chapter-num {
  color: rgba(80, 60, 50, 0.35);
  text-shadow: none;
  position: absolute;
  top: 0.5rem;
  right: 1rem;
}
html.pdf-export .page.chapter.pdf-text-only .chapter .verse.wash,
html.pdf-export .page.chapter.pdf-text-only .verse.wash {
  font-size: 0.84rem;
  line-height: 1.4;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
}

html.pdf-export .page.coloring {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.3rem !important;
  padding: 0.7rem 1rem 0.75rem !important;
}
html.pdf-export .page.coloring > h2 {
  flex-shrink: 0;
  margin: 0 !important;
}
html.pdf-export .page.coloring .coloring-slot {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0.25rem !important;
  background: #fff !important;
}
html.pdf-export .page.coloring .coloring-slot img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
}
html.pdf-export .page.coloring .activity-block {
  flex-shrink: 0;
  margin-top: 0.25rem !important;
}
