/* A book has a cover, chapters, reading pages and a final goal. */
#reader .reader-book-identity {
  justify-content: flex-start;
  padding: 3px 0;
  border: 0;
  background: transparent;
  text-align: left;
  box-shadow: none;
  border-radius: 8px;
}
#reader .reader-book-identity:hover .brand-symbol {
  background: var(--reader-soft);
  outline: 1px solid var(--reader-accent);
}
.identity-copy > small {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.book-home-label {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--reader-accent);
  font-size: 10px;
}
#reader .reader-finale-shortcut {
  display: inline-flex;
  flex-shrink: 0;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  font-size: 12px;
}
.reader-finale-shortcut small {
  font:
    650 10px "Noto Sans",
    sans-serif;
  white-space: nowrap;
}
#reader .reader-finale-shortcut[data-finale-state="ready"],
#reader .reader-finale-shortcut[data-finale-state="solved"] {
  --button-face: #d6edce;
  --button-highlight: #eef8df;
  --button-bottom: #b8d7b7;
  --button-edge: #668d66;
  --button-line: #92b68a;
  --button-ink: #27583d;
}
#reader[data-mode="overview"] .reader-heading {
  display: none;
}
#reader[data-mode="overview"] .reader-main {
  grid-template-rows: minmax(0, 1fr);
}
#reader-content[data-mode="overview"] {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.book-overview {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 12px 35px;
}
.book-welcome {
  display: grid;
  grid-template-columns: minmax(170px, 28%) minmax(0, 1fr);
  gap: clamp(25px, 4vw, 55px);
  align-items: center;
  padding: 20px 10px 30px;
}
#reader .overview-cover {
  display: grid;
  gap: 17px;
  padding: 0;
  width: 100%;
  max-width: 270px;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.overview-cover-art {
  display: block;
  position: relative;
  background: white;
  border-radius: 5px;
  overflow: hidden;
  transform: perspective(900px) rotateY(-7deg) rotate(-3deg);
  box-shadow:
    3px 0 0 #fffdf5,
    5px 0 0 #c8c6b8,
    9px 12px 25px #18372c25;
}
.overview-cover-art::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 3px;
  width: 7px;
  background: linear-gradient(90deg, #15382b18, transparent);
  pointer-events: none;
}
.overview-cover-art svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 430px;
}
.overview-cover-caption {
  display: flex;
  justify-content: center;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: var(--reader-accent);
}
.overview-kicker {
  color: var(--reader-accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}
.book-welcome h1 {
  margin: 8px 0 14px;
  font:
    650 clamp(25px, 3vw, 38px)/1.12 var(--book-title-font, "Fredoka"),
    sans-serif;
  color: var(--reader-ink);
}
.book-welcome-copy > p {
  max-width: 48em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ui-muted);
}
.overview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  margin: 22px 0;
}
.overview-stats > span {
  display: grid;
  gap: 3px;
  color: var(--ui-muted);
  font-size: 11px;
}
.overview-stats strong {
  font:
    650 23px/1.1 var(--book-title-font, "Fredoka"),
    sans-serif;
  color: var(--reader-ink);
}
.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 4px;
}
#reader .overview-actions button {
  min-height: 44px;
  max-width: 100%;
  font-size: 12px;
}
.book-welcome-copy .overview-resume-note {
  margin: 12px 0 0;
  font-size: 10px;
}
.overview-finale {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
  margin: 10px 0 28px;
  border: 1px solid #d6bc7c;
  border-radius: 15px;
  background: linear-gradient(120deg, #fff7df, #fffdf7);
  box-shadow: 0 3px 0 #aa89351a;
}
.overview-finale-seal {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #efd59b;
  border: 4px solid #fffdf3;
  color: #88632c;
  box-shadow: 0 2px 0 #a8843340;
}
.overview-finale-seal .reader-icon {
  width: 30px;
  height: 30px;
}
.overview-finale h2 {
  margin: 6px 0 8px;
  font:
    650 25px/1.2 var(--book-title-font, "Fredoka"),
    sans-serif;
}
.overview-finale p {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.6;
  max-width: 72em;
}
.overview-finale-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  margin-bottom: 16px;
}
.overview-finale-progress strong {
  font-size: 12px;
}
.overview-finale-progress progress {
  height: 5px;
  width: min(100%, 260px);
  accent-color: #b38a38;
}
.overview-finale[data-finale-state="ready"],
.overview-finale[data-finale-state="solved"] {
  background: linear-gradient(120deg, #e3f2df, #fffdf7);
  border-color: #90b88d;
}
.overview-finale[data-finale-state="ready"] progress,
.overview-finale[data-finale-state="solved"] progress {
  accent-color: #4f8759;
}
.overview-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 12px;
}
.overview-section-heading h2 {
  margin: 0;
  font:
    600 23px/1.3 var(--book-title-font, "Fredoka"),
    sans-serif;
}
.overview-section-heading > span {
  font-size: 11px;
  color: var(--ui-muted);
}
.overview-chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
#reader .overview-chapter {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 3px 0 #183b2b10;
}
#reader .overview-chapter:hover {
  border-color: var(--chapter-accent);
  background: color-mix(in srgb, var(--chapter-accent) 4%, white);
}
.overview-chapter-mark {
  display: grid;
  gap: 4px;
  place-items: center;
  flex-shrink: 0;
  width: 45px;
  height: 58px;
  padding: 7px;
  color: var(--chapter-accent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--chapter-accent) 12%, white);
}
.overview-chapter-mark small {
  font-size: 9px;
  font-weight: 700;
}
.overview-chapter-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.overview-chapter-copy strong {
  font:
    600 16px/1.25 var(--book-title-font, "Fredoka"),
    sans-serif;
}
.overview-chapter-copy > span {
  font-size: 10px;
  line-height: 1.5;
  color: var(--ui-muted);
}
.overview-chapter-copy > small {
  font-size: 10px;
  color: var(--chapter-accent);
}
.overview-chapter-copy progress {
  width: 100%;
  height: 4px;
  accent-color: var(--chapter-accent);
  margin: 5px 0;
}
.overview-chapter > .reader-icon {
  flex-shrink: 0;
  width: 17px;
  color: var(--chapter-accent);
}
.overview-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#reader .overview-page-grid button {
  display: flex;
  gap: 10px;
  padding: 12px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  border-color: var(--ui-line);
  background: #ffffffa0;
  text-align: left;
}
.overview-page-grid button > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.overview-page-grid strong {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.overview-page-grid small {
  font-size: 9px;
  color: var(--ui-muted);
}
.overview-page-grid button > .reader-icon {
  width: 16px;
  flex-shrink: 0;
  color: var(--reader-accent);
}
.finale-intro {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
.finale-intro > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  color: #8b6328;
  background: #f6e6bd;
}
.finale-intro p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}
.finale-meter strong {
  white-space: nowrap;
}
.finale-collection {
  margin: 20px 0 12px;
}
.finale-collection > summary {
  padding: 11px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.finale-tiles {
  margin-top: 10px;
}
.finale-book-link {
  margin-top: 20px;
}
#reader .finale-check {
  min-height: 44px;
}
@media (max-width: 900px) {
  .reader-nav-toggle > span,
  .reader-menu > button > span {
    display: none;
  }
  .finale-shortcut-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .book-welcome {
    grid-template-columns: minmax(160px, 27%) minmax(0, 1fr);
    gap: 28px;
  }
  .overview-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  #reader .reader-book-identity {
    flex: 0 0 34px;
    min-height: 38px;
    padding: 0;
  }
  .reader-book-identity .identity-copy {
    display: none;
  }
  .reader-book-identity .brand-symbol {
    display: grid;
  }
  #reader .book-view-switch button {
    padding: 6px 5px;
    font-family: "Noto Sans", sans-serif;
  }
  #reader .reader-finale-shortcut {
    width: 38px;
    min-height: 38px;
    padding: 4px;
  }
  .reader-finale-shortcut > .reader-icon {
    width: 18px;
    height: 18px;
    transform: translateY(-5px);
  }
  .reader-finale-shortcut small {
    position: absolute;
    bottom: 1px;
    left: 1px;
    right: 1px;
    font-size: 8px;
    line-height: 10px;
    text-align: center;
  }
  .book-overview {
    padding: 4px 3px 25px;
  }
  .book-welcome {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 20px 5px 15px;
  }
  #reader .overview-cover {
    max-width: 170px;
  }
  .book-welcome-copy {
    text-align: center;
  }
  .book-welcome h1 {
    font-size: 27px;
  }
  .book-welcome-copy > p {
    font-size: 12px;
  }
  .overview-stats,
  .book-welcome-copy .overview-actions {
    justify-content: center;
  }
  .overview-stats {
    gap: 22px;
  }
  .overview-chapter-grid,
  .overview-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .overview-finale {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 14px;
    gap: 12px;
  }
  .overview-finale-seal {
    width: 36px;
    height: 36px;
    border-width: 2px;
  }
  .overview-finale-seal .reader-icon {
    width: 20px;
    height: 20px;
  }
  .overview-finale h2 {
    font-size: 22px;
  }
}
@media (max-width: 360px) {
  .reader-top {
    padding: 0 8px;
    gap: 6px;
  }
  .reader-top-actions {
    gap: 4px;
  }
  #reader .book-view-switch button {
    font-size: 10px;
  }
}
