.comic-hero {
  padding-bottom: 8px;
}

.comic-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 8px 0 24px;
}

.comic-langs-label {
  margin: 0;
  font-weight: 700;
  color: #102a56;
}

.comic-lang-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.comic-flag {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  border: 2px solid rgba(16, 42, 86, 0.12);
  box-shadow: 0 4px 12px rgba(16, 42, 86, 0.08);
}

.comic-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.comic-flag.is-on {
  outline: 3px solid #155eef;
  outline-offset: 2px;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-bottom: 48px;
}

.comic-card {
  background: var(--white, #fff);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(16, 42, 86, 0.08);
}

.comic-card-link {
  display: grid;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.comic-card-cover {
  aspect-ratio: 3 / 4;
  background: var(--ice-blue, #ddf3ff);
}

.comic-card-cover > .comic-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* the placeholder logo keeps its own small size (lander.css .he-book-logo) */
.comic-card-cover .he-book-logo { width: 26%; height: auto; object-fit: contain; }
/* the Amazon front cover is a finished cover: no gloss or spine shading drawn over it */
.comic-card-cover.is-amazon-cover::before,
.comic-card-cover.is-amazon-cover::after { display: none; }

.comic-card-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.comic-card-body h2 {
  margin: 0;
  font-size: 1.25rem;
}

.comic-card-body p {
  margin: 0;
  color: rgba(16, 42, 86, 0.72);
}

.comic-meta {
  font-size: 0.85rem;
  font-weight: 700;
}

.comic-card .btn,
.comic-tools .btn-secondary,
.reader-nav .btn {
  width: auto;
}

.comic-tools .btn-secondary {
  background: transparent;
  color: var(--discovery-orange, #ff8a34);
  border: 2px solid var(--discovery-orange, #ff8a34);
  text-decoration: none;
}

.comic-empty {
  background: #fff;
  border-radius: 28px;
  padding: 32px;
  margin-bottom: 48px;
}

body.is-comic-page {
  background: #fff9f0;
}

body.is-comic-page .site-header,
body.is-comic-page .site-footer,
body.is-comic-page .skip {
  display: none;
}

body.is-comic-page.is-reading {
  background: #f6f1e7;
}

.comic-reader-page {
  min-height: var(--reader-vh, 100vh);
  min-height: 100dvh;
}

.comic-reader {
  outline: none;
  min-height: var(--reader-vh, 100vh);
  min-height: 100dvh;
}

.book-cover-screen {
  position: relative;
  min-height: var(--reader-vh, 100vh);
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  padding: 28px 20px 40px;
}

.book-cover-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}

.book-cover-brand img {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(16, 42, 86, 0.16);
}

.book-cover-card {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(240px, 420px);
  gap: 36px;
  align-items: center;
  width: min(840px, 100%);
}

.book-cover-art {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 8px 18px 18px 8px;
  overflow: hidden;
  background: #d7e6f4;
  box-shadow:
    8px 12px 0 rgba(16, 42, 86, 0.08),
    0 22px 48px rgba(16, 42, 86, 0.2);
}

.book-cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover-art .book-cover-logo {
  position: absolute;
  z-index: 2;
  object-fit: contain;
  pointer-events: none;
}

.book-cover-copy {
  display: grid;
  gap: 16px;
}

.book-cover-copy h1,
.book-cover-copy .book-cover-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.15;
  font-family: Fredoka, var(--font-display), system-ui, sans-serif;
  font-weight: 700;
  color: #16315f;
}

.book-cover-sub {
  margin: 0;
  font-weight: 700;
  color: #155eef;
}

.book-cover-syn {
  margin: 0;
  color: rgba(16, 42, 86, 0.78);
  font-size: 1rem;
  line-height: 1.5;
}

.book-cover-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 8px;
}

.book-cover-tools .book-open {
  margin-top: 0;
}

.book-lang {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}

.book-lang select {
  font: 700 0.95rem var(--font-body, inherit);
  border-radius: 16px;
  border: 2px solid rgba(16, 42, 86, 0.12);
  padding: 12px 14px;
  background: #ddf3ff;
  color: #102a56;
}

.book-open {
  justify-self: start;
  margin-top: 8px;
}

.book-stage {
  min-height: var(--reader-vh, 100vh);
  min-height: 100dvh;
  height: var(--reader-vh, 100vh);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 48px 22px;
  box-sizing: border-box;
  position: relative;
}

.book-top {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.book-title-block {
  min-width: 0;
}

.book-name {
  margin: 0;
  color: #16315f;
  font-family: Fredoka, var(--font-display), system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.book-name-sub {
  margin: 3px 0 0;
  color: rgba(22, 49, 95, 0.55);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
}

/* Reading-mode switch («Full book / Comic only / Story only») is retired for now:
   it stole the title’s space on desktop and was already hidden on phones. */
.book-modes {
  display: none !important;
}

.book-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.book-icon-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #16315f;
  box-shadow: 0 8px 20px rgba(22, 49, 95, 0.1);
  display: grid;
  place-items: center;
  cursor: pointer;
  font: 700 1.35rem/1 Fredoka, var(--font-display), system-ui, sans-serif;
}

.book-icon-btn svg {
  width: 20px;
  height: 20px;
}

.book-icon-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.book-lang-tool {
  position: relative;
}

.book-lang-btn {
  width: auto;
  min-width: 64px;
  padding: 0 12px 0 14px;
  gap: 2px;
  display: inline-flex;
  font-size: 1.02rem;
  letter-spacing: -0.04em;
}

.book-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 8;
  min-width: 180px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(22, 49, 95, 0.16);
}

.book-lang-menu[hidden] {
  display: none;
}

.book-lang-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: #16315f;
  font: 700 0.95rem var(--font-body), Nunito Sans, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.book-lang-selected {
  font-size: 0.75rem;
  font-weight: 700;
  color: #155eef;
}

.book-lang-menu button:hover,
.book-lang-menu button.is-current {
  background: #e7efff;
}

.book-focus-exit {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
}

body.is-book-focus .book-top {
  display: none;
}

body.is-book-focus .book-focus-exit {
  display: grid;
}

body.is-book-focus .book-stage {
  padding: 16px 48px 18px;
}

.book-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1180px, 100%);
  flex: 1 1 auto;
  min-height: 0;
}

.book-nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #6d7890;
  box-shadow: 0 8px 22px rgba(22, 49, 95, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.book-nav svg {
  width: 22px;
  height: 22px;
}

.book-nav.is-prev { left: -60px; }
.book-nav.is-next { right: -60px; }

.book-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.book-close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.book {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

body.is-book-focus .book {
  width: 100%;
  height: 100%;
}

.book-spine {
  display: none;
}

.book-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: none;
}

.book-dots {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.book-dot {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.book-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d5dbe3;
}

.book-dot.is-on::after {
  width: 10px;
  height: 10px;
  background: #2f6fe4;
}

.book-dot:disabled {
  cursor: default;
}

.book-scrub {
  display: none;
  position: relative;
  align-items: center;
  flex: 1 1 180px;
  min-width: 0;
  height: 44px;
}

.book-scrub input[type="range"] {
  width: 100%;
  height: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(22, 49, 95, 0.14);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.book-scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2f6fe4;
  box-shadow: 0 4px 10px rgba(16, 42, 86, 0.2);
  cursor: pointer;
}

.book-scrub input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2f6fe4;
  box-shadow: 0 4px 10px rgba(16, 42, 86, 0.2);
  cursor: pointer;
}

.book-scrub-badge {
  position: absolute;
  top: -8px;
  left: 0;
  z-index: 2;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #2f6fe4;
  color: #fff;
  font: 700 0.95rem Fredoka, var(--font-display), system-ui, sans-serif;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
}

.book-scrub.is-dragging .book-scrub-badge {
  opacity: 1;
  min-width: 52px;
  height: 52px;
  font-size: 1.45rem;
  top: -14px;
}

.book-progress-label {
  margin: 0;
  color: #8b93a7;
  font-family: "Nunito Sans", var(--font-body), system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}

.book .reader-page {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
  border-radius: 22px;
  box-shadow: none;
}

/* Live HTML bubbles may sit on the page edge; keep their stroke/tails visible. */
.book .reader-page.reader-comic {
  overflow: visible;
}

.book .reader-comic {
  background: transparent;
  border-radius: 22px;
}

.book .reader-nar {
  background: #fffdf8;
  border-radius: 22px;
}

.reader-plate {
  box-sizing: border-box;
  height: 100%;
  padding: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-art {
  position: relative;
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 3 / 4;
  flex: 0 1 auto;
  background: transparent;
  border: 0;
  border-radius: 22px;
  box-shadow: none;
  overflow: visible;
}

.reader-art img,
.reader-full,
.reader-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.reader-full {
  position: absolute;
  inset: 0;
}

.reader-art img.reader-flat,
.reader-full.reader-flat {
  object-fit: cover;
  background: transparent;
}

.reader-panel {
  position: absolute;
  overflow: visible;
}

.reader-bubble {
  position: absolute;
  z-index: 2;
  background: transparent;
  border: 0;
  padding: 0;
  color: #1a2332;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  overflow: visible;
}

.reader-bubble-fit {
  position: relative;
  width: 100%;
  height: 100%;
  font-size: calc(var(--bubble-font, 14) * 1px);
}

.reader-bubble-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16% 14% 18%;
  box-sizing: border-box;
  text-align: center;
}

.reader-bubble-copy {
  display: block;
  width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

.reader-bubble.is-narrative .reader-bubble-text {
  padding: 4px 8px;
}

.reader-bubble.is-thought .reader-bubble-text {
  position: absolute;
  left: 14%;
  top: 10%;
  width: 72%;
  height: 52%;
  padding: 0;
}

.reader-bubble.is-narrative .reader-bubble-body {
  fill: #fff4c4;
}

.reader-bubble.is-thought .reader-bubble-body {
  fill: #fff;
  stroke: #1a1a1a;
  stroke-width: 2.2;
}

.reader-bubble-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.reader-bubble-body {
  fill: #fff;
  stroke: #1a1a1a;
  stroke-width: 3.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.reader-story {
  position: relative;
  box-sizing: border-box;
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 32px 40px 28px;
  color: #102a56;
}

.reader-story-title {
  margin: 0 0 6px;
  color: #2f6fe4;
  font-family: Fredoka, var(--font-display), system-ui, sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
}

.reader-story-sub {
  margin: 0 0 18px;
  color: #16315f;
  font-family: Fredoka, var(--font-display), system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  text-align: center;
}

.reader-story-body {
  position: relative;
  z-index: 1;
  max-width: 38em;
  font-family: "Nunito Sans", var(--font-body), system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.reader-story-body p {
  margin: 0 0 0.45em;
}

/* Une ligne vide entre le grand titre (ou son sous-titre) et le début du texte. */
.reader-story-title + .reader-story-body,
.reader-story-sub + .reader-story-body {
  margin-top: 1.4em;
}

/* Only author-applied Eliot style is blue — never auto-colour dialogue quotes. */
.reader-story-body .eliot-mark {
  color: #155eef;
  font-weight: inherit;
}

.reader-story-body b,
.reader-story-body strong {
  font-weight: 800;
}

.reader-story-body em,
.reader-story-body i {
  font-style: italic;
}

.reader-story-body u {
  text-decoration: underline;
}

.reader-story-body h1,
.reader-story-body h2,
.reader-story-body h3,
.reader-story-body h4,
.reader-story-body h5,
.reader-story-body h6 {
  margin: 0.2em 0 0.45em;
  color: #102a56;
  font-family: Fredoka, var(--font-display), system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}

.reader-story-body h1 { font-size: 1.55em; }
.reader-story-body h2 { font-size: 1.35em; }
.reader-story-body h3 { font-size: 1.2em; }
.reader-story-body h4 { font-size: 1.08em; }
.reader-story-body h5 { font-size: 1em; }
.reader-story-body h6 { font-size: 0.92em; }

.reader-story-body ul,
.reader-story-body ol {
  margin: 0 0 0.85em;
  padding-left: 1.25em;
}

.reader-story-body li {
  margin: 0 0 0.35em;
}

.book-hotspot {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 4;
}

.book-hotspot.is-prev {
  left: 0;
}

.book-hotspot.is-next {
  right: 0;
}

.book-pager {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  color: rgba(255, 255, 255, 0.86);
  margin-top: 8px;
}

.book-pager .btn {
  width: auto;
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
}

.reader-cta {
  position: absolute;
  inset: auto 16px 16px;
  background: rgba(255, 249, 240, 0.94);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
}

.reader-page.is-restricted .reader-cta {
  position: relative;
  inset: auto;
  margin: 24px;
}

/* Library grid: phones only. */
@media (max-width: 800px) {
  .comic-grid {
    grid-template-columns: 1fr;
  }
}

/* Reader, one page at a time: phones, and tablets held upright (iPad 768–1024 px wide in portrait). */
@media (max-width: 800px), (orientation: portrait) and (max-width: 1100px) {
  .book-cover-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .book-cover-art {
    width: min(260px, 70vw);
  }

  .book-cover-tools,
  .book-open {
    justify-content: center;
    justify-self: center;
  }

  body.is-comic-page.is-reading {
    overflow: hidden;
    background: #f6f1e7;
  }

  .comic-reader-page,
  .comic-reader {
    height: var(--reader-vh, 100vh);
    height: 100dvh;
    min-height: 0;
  }

  .book-stage {
    display: flex;
    flex-direction: column;
    height: var(--reader-vh, 100vh);
    height: 100dvh;
    min-height: 0;
    gap: 8px;
    padding: 10px 10px max(8px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow: hidden;
    touch-action: pan-y;
  }

  .book-top {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
    width: 100%;
  }

  .book-title-block {
    display: none;
  }

  .book-tools {
    justify-content: center;
    justify-self: center;
  }

  .book-icon-btn[data-fullscreen],
  .book-focus-exit {
    display: none;
  }

  body.is-book-focus .book-top {
    display: grid;
  }

  .comic-reader.is-lang-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(16, 42, 86, 0.46);
  }

  .book-lang-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    z-index: 50;
    width: min(320px, calc(100vw - 40px));
    max-height: min(70vh, 520px);
    max-height: min(70dvh, 520px);
    margin: 0;
    padding: 10px;
    overflow: auto;
    transform: translate(-50%, -50%);
  }

  .book-lang-menu button {
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .book-frame {
    width: 100%;
  }

  .book-nav {
    display: none;
  }

  .book-dots {
    display: none;
  }

  .book-scrub {
    display: flex;
  }

  .book-progress {
    width: 100%;
    margin-top: auto;
  }

  .book-frame,
  .book.is-mobile,
  .reader-story {
    overflow-x: hidden;
    touch-action: pan-y;
  }

  .book-scrub,
  .book-scrub input {
    touch-action: pan-x;
  }

  .book-nav.is-prev { left: 0; }
  .book-nav.is-next { right: 0; }

  .book,
  .book.is-mobile {
    grid-template-columns: 1fr;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  body.is-book-focus .book,
  body.is-book-focus .book.is-mobile {
    width: calc(100% - 8px);
    height: calc(var(--reader-vh, 100vh) - 24px);
    height: calc(100dvh - 24px);
  }

  .book .reader-page,
  .reader-plate,
  .reader-art,
  .reader-story {
    min-height: 0;
    height: 100%;
  }

  .book.is-mobile .reader-plate {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .book.is-mobile .reader-art {
    container-type: size;
    flex: 0 1 auto;
    width: 100%;
    height: auto;
    max-height: 100%;
    aspect-ratio: 3 / 4;
  }

  .book.is-mobile .reader-bubble-fit {
    font-size: calc(var(--bubble-font, 14) * 100cqmin / 560);
  }

  .book-close {
    background: rgba(16, 42, 86, 0.82);
    color: #fff;
  }

  .book-spine,
  .book-hotspot {
    display: none;
  }

  .reader-art {
    aspect-ratio: auto;
  }

  .reader-full,
  .reader-art > img,
  .reader-panel img {
    object-fit: contain;
  }

  .reader-story {
    padding: 18px 16px 14px;
  }

  .reader-story-title {
    font-size: 24px;
    margin-bottom: 4px;
  }

  .reader-story-sub {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .reader-story-body {
    font-size: 13px;
  }

}

.reader-art.is-empty {
  background: #f6f1e7;
}

.reader-end {
  background: #fffdf8;
  border-radius: 22px;
}

.end-next {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  height: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.end-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  color: #102a56;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(16, 42, 86, 0.12);
}

.end-card img,
.end-card-fallback {
  width: 168px;
  height: 94px;
  object-fit: cover;
  border-radius: 12px;
  background: #202020;
  display: block;
}

.end-card:has(.is-badge) {
  grid-template-columns: 72px 1fr;
}

.end-card img.is-badge {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: transparent;
  margin: 0 auto;
}

.end-card small {
  display: block;
  color: #606060;
  font: 700 0.78rem/1.2 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.end-card strong {
  display: block;
  margin-top: 4px;
  font: 700 1.05rem/1.25 var(--font-display);
}

@media (max-width: 800px), (orientation: portrait) and (max-width: 1100px) {
  .book.is-mobile.is-ending {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    min-height: 0;
    overflow: auto;
    gap: 24px;
    padding: 8px 0 12px;
  }

  .book.is-mobile.is-ending .reader-page,
  .book.is-mobile.is-ending .reader-plate,
  .book.is-mobile.is-ending .end-next {
    height: auto;
    min-height: 0;
    overflow: visible;
    flex: 0 0 auto;
  }

  .book.is-mobile.is-ending .reader-comic,
  .book.is-mobile.is-ending .reader-plate {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .book.is-mobile.is-ending .reader-art {
    width: min(78vw, 360px);
    max-width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 3 / 4;
    flex: 0 0 auto;
  }

  .book.is-mobile.is-ending .reader-end,
  .book.is-mobile.is-ending .end-next {
    width: min(100%, 420px);
    justify-content: flex-start;
  }

  .end-card {
    grid-template-columns: 120px 1fr;
  }

  .end-card:has(.is-badge) {
    grid-template-columns: 64px 1fr;
  }

  .end-card img,
  .end-card-fallback {
    width: 120px;
    height: 68px;
  }

  .end-card img.is-badge {
    width: 48px;
    height: 48px;
  }
}

.comic-document {
  background: #fff;
  color: #102a56;
  padding: 48px 0 72px;
}

.comic-document-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.comic-document-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 42rem;
}

.comic-document-head h1,
.comic-pages h2,
.comic-story h2,
.comic-chapter h3 {
  margin: 0;
  font-family: Fredoka, var(--font-display), system-ui, sans-serif;
  line-height: 1.15;
}

.comic-kicker {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #155eef;
  font-size: 0.82rem;
}

.comic-document-sub,
.comic-document-head .lede,
.comic-document-head p,
.comic-chapter p {
  margin: 0;
}

.comic-document-sub {
  font-weight: 700;
  color: #155eef;
}

.comic-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.comic-pages,
.comic-story {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.comic-pages figure {
  margin: 0;
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.comic-pages img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #ddf3ff;
}

.comic-pages figcaption {
  color: rgba(16, 42, 86, 0.72);
  font-size: 0.95rem;
  line-height: 1.45;
}

.comic-chapter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 42rem;
}

/* Pages + story as text for search engines and screen readers, folded for readers who use the book above. */
.comic-more {
  border-top: 1px solid rgba(16, 42, 86, 0.12);
  padding-top: 20px;
}

.comic-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  background: #ddf3ff;
  color: #102a56;
  font: 700 1rem Fredoka, var(--font-display), system-ui, sans-serif;
  cursor: pointer;
  list-style: none;
}

.comic-more > summary::-webkit-details-marker {
  display: none;
}

.comic-more > summary::after {
  content: "▾";
  transition: transform 0.15s ease;
}

.comic-more[open] > summary::after {
  transform: rotate(180deg);
}

.comic-more[open] > summary {
  margin-bottom: 28px;
}

.comic-more > section + section {
  margin-top: 40px;
}

.comic-pages figcaption {
  font-weight: 700;
}

/* Reading: a lighter top bar — close, sound, language (Aa) and full-screen buttons at half size.
   An invisible ring keeps each button easy to tap. */
.book-top .book-icon-btn {
  position: relative;
  width: 24px;
  height: 24px;
  font-size: 0.85rem;
  box-shadow: 0 3px 10px rgba(22, 49, 95, 0.1);
}
.book-top .book-icon-btn::after {
  content: "";
  position: absolute;
  inset: -9px;
}
.book-top .book-icon-btn svg {
  width: 11px;
  height: 11px;
}
.book-top .book-lang-btn {
  min-width: 34px;
  padding: 0 6px 0 8px;
  font-size: 0.72rem;
}
.book-top .book-lang-btn svg {
  width: 9px;
  height: 9px;
}
.book-top .book-tools {
  gap: 10px;
}
.book-stage {
  gap: 12px;
}
@media (max-width: 800px), (orientation: portrait) and (max-width: 1100px) {
  .book-stage {
    gap: 6px;
  }
}
/* The presentation page keeps the paragraphs of the summary. */
.book-cover-syn {
  white-space: pre-line;
}
/* «Back to the collection» sits beside the language button: a link styled like the other round icons. */
.book-library-btn {
  text-decoration: none;
}
.book-library-btn:focus-visible {
  outline: 3px solid #2f6fe4;
  outline-offset: 2px;
}
/* Desktop top bar: title left, tools right — room for long book names. */
@media (min-width: 801px) and (orientation: landscape), (min-width: 1101px) {
  .book-top .book-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    box-shadow: 0 6px 16px rgba(22, 49, 95, 0.1);
  }
  .book-top .book-icon-btn::after {
    inset: -4px;
  }
  .book-top .book-icon-btn svg {
    width: 17px;
    height: 17px;
  }
  .book-top .book-lang-btn {
    min-width: 54px;
    padding: 0 10px 0 12px;
    font-size: 0.95rem;
  }
  .book-top .book-lang-btn svg {
    width: 11px;
    height: 11px;
  }
  .book-title-block {
    overflow: hidden;
  }
  .book-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .book-top .book-tools {
    gap: 8px;
  }
}

/* The comic page is never cropped: the box is 3:4 (sized by js/comic-reader.js) and the page image is
   drawn whole inside it, with the bubbles drawn on it. Offsets spelled out for browsers without «inset». */
.reader-full {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.reader-full,
.reader-art > img.reader-full,
.reader-art img.reader-flat,
.reader-full.reader-flat {
  object-fit: contain;
}

/* Phones / upright tablets: same bleed so edge bubbles are not clipped by the stage. */
@media (max-width: 800px), (orientation: portrait) and (max-width: 1100px) {
  .reader-plate {
    padding: 8px;
  }
  .book .reader-page.reader-comic,
  .book.is-mobile .reader-art {
    overflow: visible;
  }
}
/* Text of the bubbles drawn in HTML follows the page width (reference page 560 px wide). */
.reader-bubble-fit,
.book.is-mobile .reader-bubble-fit {
  font-size: calc(var(--bubble-font, 14) * var(--art-w, 560) / 560 * 1px);
}
/* Upright tablets: one page at a time, with story text sized for a large screen. */
@media (min-width: 601px) and (max-width: 1100px) and (orientation: portrait) {
  .book-stage {
    padding: 14px 24px max(14px, env(safe-area-inset-bottom));
  }
  .reader-story {
    padding: 36px 48px 28px;
  }
  .reader-story-title {
    font-size: 36px;
    margin-bottom: 8px;
  }
  .reader-story-sub {
    font-size: 18px;
    margin-bottom: 14px;
  }
}

/* Amazon: «Only on Amazon» / «Also in print» on library cards, buttons on the reader cover */
.comic-card-cover { position: relative; }
.comic-card-badge {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.94); color: #102a56; font: 800 0.78rem var(--font-body, system-ui, sans-serif);
  box-shadow: 0 2px 8px rgba(16, 42, 86, 0.18);
}
.comic-card-badge.is-amazon-only { background: #ffd814; color: #0f1111; }
.book-cover-tools .book-printed { margin-top: 0; }
/* Amazon buttons: Amazon's own call-to-action colours (yellow button, near-black text) */
.btn.book-amazon, .book-amazon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #ffd814; border: 2px solid #fcd200; color: #0f1111; font-weight: 700;
  box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}
.btn.book-amazon:hover, .book-amazon:hover { background: #f7ca00; border-color: #f2c200; color: #0f1111; }
.btn.book-amazon:focus-visible, .book-amazon:focus-visible { outline: 3px solid #007185; outline-offset: 2px; background: #f7ca00; color: #0f1111; }
.btn.book-amazon:active, .book-amazon:active { background: #f0b800; border-color: #e6b000; }
.book-amazon-ic { flex: 0 0 auto; color: #0f1111; }

/* Next waits for the next page's art (downloaded while the current page is read): a small ring turns on the button */
.book-nav.is-waiting { opacity: 1; cursor: progress; color: #b6bfd0; }
.book-nav.is-waiting::after {
  content: ""; position: absolute; inset: -3px; border-radius: 999px; border: 3px solid transparent; border-top-color: #155eef; border-right-color: #155eef;
  animation: book-nav-wait 0.8s linear infinite;
}
@keyframes book-nav-wait { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .book-nav.is-waiting::after { animation-duration: 2.4s; }
}
/* a page reached by the dots or the slider: its bubbles appear with the art, never before it */
.reader-art.is-art-loading .reader-bubble { visibility: hidden; }
/* phones (no arrows): a swipe waits for the next page with the same ring at the page edge */
.comic-reader.is-next-waiting .book-frame { position: relative; }
.comic-reader.is-next-waiting .book-frame::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 30px; height: 30px; margin-top: -15px; border-radius: 999px; z-index: 8;
  border: 3px solid rgba(21, 94, 239, 0.18); border-top-color: #155eef; background: rgba(255, 255, 255, 0.85);
  animation: book-nav-wait 0.8s linear infinite;
}

/* Desktop spread: the comic page uses the whole height of its half (its story page is sized to match it by
   js/comic-reader.js fitArts), so both pages of the spread are the same size. Phones and upright tablets unchanged. */
.book:not(.is-mobile):not(.is-ending) > .reader-comic > .reader-plate { padding: 0; }
.reader-art.is-art-loading { background: #ece5d6; }
/* the two choices of the cover screen: same size (a <button> does not inherit the font size of the page) */
.book-cover-tools .btn { font-size: 1rem; line-height: 1.2; min-height: 50px; }

/* ---------- yellow marks on story pages (same as the printed book) ---------- */
.reader-nar.has-marks {
  position: relative;
}
.rd-mark {
  display: inline-block;
  height: calc(1.9em * var(--rd-mark-s, 1));
  width: auto;
  vertical-align: middle;
  pointer-events: none;
}
.reader-story-title .rd-mark {
  height: calc(1.15em * var(--rd-mark-s, 1));
  margin: -0.2em 0.18em 0;
}
.rd-mark-corner {
  position: absolute;
  z-index: 1;
  line-height: 0;
}
.rd-mark-corner .rd-mark {
  height: calc(46px * var(--rd-mark-s, 1));
}
.rd-mark-corner.is-tl { top: 10px; left: 12px; }
.rd-mark-corner.is-tr { top: 10px; right: 12px; }
.rd-mark-corner.is-bl { bottom: 12px; left: 12px; }
.rd-mark-corner.is-br { bottom: 12px; right: 12px; }
.rd-mark-end {
  text-align: center;
  margin: 0.6em 0 0;
}
.rd-mark-end .rd-mark {
  height: calc(40px * var(--rd-mark-s, 1));
}

/* ---------- the cover spread: the book opens on its front cover (left) and its summary (right) ---------- */
.reader-intro-cover .reader-art {
  position: relative;
}

.reader-intro-cover .reader-flat {
  object-fit: cover;
}

.reader-intro-logo {
  position: absolute;
  z-index: 2;
  object-fit: contain;
  pointer-events: none;
}

.reader-intro-story {
  justify-content: center;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.reader-intro-brand {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.reader-intro-title {
  margin: 0;
  font: 700 clamp(1.7rem, 2.6vw, 2.5rem) / 1.08 Fredoka, var(--font-display), system-ui, sans-serif;
  color: #155eef;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.reader-intro-syn {
  max-width: 34em;
  font-family: "Nunito Sans", var(--font-body), system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.55;
  color: #102a56;
}

.reader-intro-syn p {
  margin: 0 0 0.6em;
}

.reader-intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.reader-intro-actions .book-start {
  font-size: 1.05rem;
  padding: 12px 22px;
}

@media (max-width: 800px), (orientation: portrait) and (max-width: 1100px) {
  .reader-intro-brand {
    width: 60px;
    height: 60px;
  }
}

/* ---------- the book in plain HTML under the reader (title, summary, characters, pages) ---------- */
.book-about {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  color: #102a56;
}

.book-about-inner {
  display: grid;
  grid-template-columns: minmax(200px, 300px) 1fr;
  gap: 40px;
  align-items: start;
}

.book-about-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px 14px 14px 6px;
  box-shadow: 0 18px 34px rgba(16, 42, 86, 0.22);
}

.book-about-kicker {
  margin: 0 0 6px;
  font: 700 0.95rem var(--font-body, "Nunito Sans"), system-ui, sans-serif;
  color: #ff8a34;
}

.book-about h1 {
  margin: 0 0 6px;
  font: 700 clamp(2rem, 4vw, 3rem) / 1.05 Fredoka, var(--font-display), system-ui, sans-serif;
  color: #155eef;
}

.book-about-sub {
  margin: 0 0 12px;
  font: 600 1.15rem Fredoka, var(--font-display), system-ui, sans-serif;
}

.book-about h2 {
  margin: 22px 0 8px;
  font: 700 1.25rem Fredoka, var(--font-display), system-ui, sans-serif;
  color: #102a56;
}

.book-about-syn {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 62ch;
}

.book-about-cast {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.book-about-cast li {
  font-weight: 700;
  background: #ddf3ff;
  border-radius: 999px;
  padding: 4px 14px;
}

.book-about-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
}

.book-about-facts dt {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.book-about-facts dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.book-about-facts a {
  color: #155eef;
}

.book-about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

.book-about-h {
  margin-top: 44px !important;
}

.book-about-pages {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px 28px;
}

.book-about-pages li {
  font-size: 0.95rem;
  line-height: 1.45;
}

.book-about-pages strong {
  display: block;
  color: #155eef;
}

.book-about-more {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
  font-weight: 700;
}

.book-about-more a {
  color: #155eef;
}

@media (max-width: 760px) {
  .book-about {
    padding: 40px 18px 48px;
  }
  .book-about-inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .book-about-cover {
    max-width: 260px;
  }
}
