.rewards-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 12px 0 28px;
}
.rewards-heading h2 {
  font-size: clamp(26px, 3vw, 38px);
  margin: 8px 0;
}
.rewards-kicker,
.history-book-intro > span,
.history-feature small {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  color: #527b67;
}
.coin-purse {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 12px;
  background: #fff2c9;
  padding: 20px 28px;
  border-radius: 24px;
  min-width: 150px;
  text-align: center;
}
.coin-purse > b,
.coin-purse > span {
  font-size: 32px;
}
.coin-purse small {
  grid-column: 1/-1;
}
.rewards-help,
.rewards-home-banner,
.history-feature {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #e9f1df;
  border: 1px solid #cbdcbd;
  border-radius: 24px;
  padding: 24px;
  margin: 24px 0;
}
.rewards-help > span,
.history-feature > span {
  font-size: 48px;
}
.rewards-help p,
.rewards-home-banner p,
.history-feature p {
  margin: 6px 0;
  line-height: 1.7;
}
.rewards-help > p,
.history-feature > div,
.rewards-home-banner > div {
  flex: 1;
}
.reward-card-grid,
.quest-card-grid,
.book-chapters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.reward-card,
.quest-card {
  background: #fffdf5;
  border: 1px solid #e1dbc9;
  border-radius: 24px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 5px 0 #e5e8d9;
}
.reward-card h3,
.quest-card h3 {
  margin: 0;
}
.reward-card p,
.quest-card p {
  line-height: 1.7;
  flex: 1;
  margin: 0;
}
.reward-card > strong {
  color: #805b1b;
}
.reward-card button {
  width: 100%;
}
.reward-art,
.quest-icon {
  font-size: 44px;
}
.reward-empty {
  text-align: center;
  background: #fff8e7;
  border: 2px dashed #e2cf9d;
  border-radius: 28px;
  padding: 42px 24px;
}
.reward-empty > span {
  font-size: 64px;
}
.reward-empty p {
  max-width: 600px;
  margin: 14px auto;
  line-height: 1.8;
}
.reward-empty button {
  margin: 6px;
}
.reward-requests {
  margin-top: 40px;
}
.reward-request {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fffdf6;
  border: 1px solid #dddccf;
  border-radius: 18px;
  padding: 18px;
  margin: 12px 0;
}
.reward-request > span {
  font-size: 32px;
}
.reward-request > div {
  flex: 1;
}
.reward-request p {
  margin: 5px 0;
}
.reward-request small,
.rewards-muted {
  color: #596c64;
}
.quest-week {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: #eef2e8;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 25px;
}
.quest-week h3 {
  margin: 8px 0;
}
.quest-week p {
  line-height: 1.7;
  max-width: 550px;
}
.quest-week label {
  display: grid;
  gap: 8px;
  max-width: 100%;
}
.quest-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.quest-card progress {
  width: 100%;
  height: 14px;
  accent-color: #579577;
}
.quest-card.ready {
  border: 2px solid #91b68b;
}
.quest-card.collected {
  background: #e9f3e2;
}
.reward-paused {
  padding: 20px;
  background: #fff0cb;
  border-radius: 15px;
}
.parent-rewards {
  padding: 24px;
  background: #fff8e8;
  border: 1px solid #dfd5ba;
  border-radius: 24px;
  margin: 24px 0;
}
.parent-rewards form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.parent-rewards label {
  display: grid;
  gap: 7px;
}
.parent-rewards input,
.parent-rewards select,
.parent-rewards textarea {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.parent-rewards textarea {
  min-height: 80px;
}
.parent-rewards .reward-card-grid {
  margin: 22px 0;
}
.history-book-intro {
  padding: 32px;
  background: #f3ead1;
  border: 1px solid #ddd1b2;
  border-radius: 24px;
  margin: 20px 0 25px;
}
.history-book-intro h3 {
  font-size: 30px;
  margin: 12px 0;
}
.history-book-intro p {
  max-width: 700px;
  line-height: 1.8;
}
.book-chapters {
  margin-top: 24px;
}
.book-chapter {
  padding: 0 !important;
  text-align: left !important;
  overflow: hidden;
  border-radius: 22px !important;
  background: #fff9ec !important;
  border: 1px solid #dbd1b6 !important;
  color: #344d44 !important;
  box-shadow: 0 5px 0 #e3dec9 !important;
  transition: transform 0.2s;
}
.book-chapter:hover {
  transform: translateY(-4px);
}
.book-chapter svg {
  display: block;
  width: 100%;
  height: auto;
}
.book-chapter > div {
  padding: 20px;
}
.book-chapter h3 {
  font-size: 21px;
  margin: 8px 0;
}
.book-chapter small {
  font-size: 12px;
  color: #666a55;
}
.book-chapter p {
  font-size: 13px;
  margin-bottom: 0;
}
.history-reader {
  background: #fffaf0;
  border: 1px solid #e1d4b8;
  border-radius: 26px;
  padding: 30px;
  box-shadow: 0 8px 0 #e4ddc5;
}
.book-top,
.book-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: #637562;
}
.book-top {
  border-bottom: 1px solid #e6dcc7;
  padding-bottom: 20px;
}
.book-reader-title {
  text-align: center;
  margin: 30px 0;
}
.book-reader-title > small {
  letter-spacing: 1px;
  color: #637562;
}
.book-reader-title h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 10px 0 20px;
}
.book-reader-title .controls {
  justify-content: center;
}
.history-reader button[aria-pressed="true"] {
  background: #466e57;
  color: white;
}
.book-spread {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 35px;
  align-items: start;
}
.book-spread figure {
  margin: 0;
  position: sticky;
  top: 20px;
}
.book-spread svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}
.book-spread figcaption {
  font-size: 12px;
  color: #687366;
  line-height: 1.7;
  padding: 12px 4px;
}
.book-prose > p {
  font-size: 17px;
  line-height: 1.95;
  margin: 0 0 22px;
}
.book-short {
  font-size: 23px !important;
}
.book-word {
  background: #f0e8d4;
  border-radius: 16px;
  padding: 18px;
  line-height: 1.7;
}
.book-word p {
  margin: 5px 0 0;
}
.book-wonder {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #e8eddf;
  padding: 22px;
  border-radius: 18px;
  margin: 28px 0;
}
.book-wonder > span {
  font-size: 36px;
}
.book-wonder p {
  line-height: 1.7;
  margin: 6px 0;
}
.book-bottom {
  padding: 12px 0 22px;
}
.book-sources {
  padding: 20px 0;
  border-top: 1px solid #e3d8c0;
  line-height: 1.8;
}
.book-sources summary {
  cursor: pointer;
  font-weight: 700;
}
.book-sources a {
  color: #376b59;
}
.history-reader .controls small {
  line-height: 1.6;
  flex: 1;
}
.history-library > .controls {
  align-items: end;
}
.history-library label {
  display: grid;
  gap: 7px;
}
.rewards-heading p {
  line-height: 1.7;
}
.rewards-shop button,
.weekly-quests button,
.history-reader button,
.history-library button {
  min-height: 44px;
}
.rewards-shop,
.weekly-quests,
.history-reader,
.history-library {
  min-width: 0;
}
@media (max-width: 850px) {
  .reward-card-grid,
  .quest-card-grid,
  .book-chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .book-spread {
    grid-template-columns: 1fr;
  }
  .book-spread figure {
    position: static;
    max-width: 640px;
    margin: auto;
  }
  .quest-week {
    align-items: start;
    flex-direction: column;
  }
  .history-feature {
    flex-wrap: wrap;
  }
  .parent-rewards form {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 540px) {
  .rewards-heading {
    align-items: start;
    flex-direction: column;
  }
  .coin-purse {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 12px 18px;
    gap: 12px;
  }
  .coin-purse small {
    font-size: 12px;
  }
  .reward-card-grid,
  .quest-card-grid,
  .book-chapters {
    grid-template-columns: 1fr;
  }
  .rewards-help,
  .rewards-home-banner {
    flex-wrap: wrap;
    padding: 20px;
  }
  .history-feature {
    padding: 20px;
  }
  .history-feature > span {
    font-size: 35px;
  }
  .reward-request {
    flex-wrap: wrap;
  }
  .history-reader {
    padding: 18px 14px;
    border-radius: 18px;
  }
  .book-top {
    flex-wrap: wrap;
    font-size: 12px;
  }
  .book-top > span:nth-child(2) {
    order: 3;
    width: 100%;
  }
  .book-spread {
    gap: 12px;
  }
  .book-prose > p {
    font-size: 16px;
  }
  .book-reader-title h2 {
    font-size: 28px;
  }
  .book-bottom {
    gap: 6px;
  }
  .book-bottom button {
    font-size: 12px;
    padding: 10px;
  }
  .book-wonder {
    padding: 16px;
    gap: 12px;
  }
  .quest-week {
    padding: 20px;
  }
  .quest-week select {
    max-width: 100%;
    font-size: 13px;
  }
  .parent-rewards {
    padding: 18px;
  }
  .history-book-intro {
    padding: 24px;
  }
  .history-book-intro h3 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .book-chapter {
    transition: none;
  }
  .book-chapter:hover {
    transform: none;
  }
}
.parent-rewards-title,
.parent-request-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.parent-reward-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 24px 0;
}
.parent-reward-shelf article,
.parent-request-list article {
  padding: 18px;
  background: #fffdf7;
  border: 1px solid #e4d9bf;
  border-radius: 16px;
  margin: 12px 0;
}
.parent-reward-shelf article {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.parent-reward-shelf article > div {
  flex: 1;
  min-width: 120px;
}
.parent-reward-shelf small {
  display: block;
  margin-top: 6px;
}
.parent-request-copy {
  display: flex;
  align-items: center;
  gap: 15px;
}
.parent-request-copy > span {
  font-size: 32px;
}
.parent-request-copy p {
  margin: 8px 0;
}
.parent-rewards .quest-enable,
.parent-rewards .reward-check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.parent-rewards input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.parent-rewards .controls {
  grid-column: 1/-1;
}
.parent-rewards .controls > label {
  flex: 1;
  min-width: 70px;
}
@media (max-width: 850px) {
  .parent-reward-columns {
    grid-template-columns: 1fr;
  }
}
.subject-book.book-science .history-book-intro,
.subject-book-feature.book-science {
  background: #e0edf0;
  border-color: #b9d3d8;
}
.subject-book.book-english .history-book-intro,
.subject-book-feature.book-english {
  background: #efe2ef;
  border-color: #d7bed9;
}
.subject-book.book-science .book-example {
  background: #e3eff1;
  border-color: #b9d3d8;
}
.subject-book.book-english .book-example {
  background: #f0e4f0;
  border-color: #d7bed9;
}
.book-example {
  border: 1px solid;
  border-radius: 18px;
  padding: 20px;
  margin: 20px 0;
  line-height: 1.8;
}
.book-example p {
  margin: 8px 0 0;
}
.subject-book .book-word {
  min-height: 0;
}
.subject-book-feature h3 {
  margin: 8px 0;
}
.subject-book .book-top > span {
  line-height: 1.6;
}
.subject-book .book-spread figure svg {
  background: #e3ede5;
}
.subject-book .book-sources a {
  display: inline-block;
  min-height: 44px;
  padding: 8px 0;
}
.subject-book #subjectBookNextChapter {
  margin-bottom: 22px;
}
.subject-book-feature > button {
  flex-shrink: 0;
}
@media (max-width: 540px) {
  .subject-book-feature > button {
    width: 100%;
  }
  .subject-book .book-reader-title .controls > button {
    width: 100%;
  }
  .subject-book .book-bottom button {
    font-size: 12px;
    min-width: 0;
  }
  .subject-book #subjectBookNextChapter {
    width: 100%;
    white-space: normal;
  }
}
.subject-book.book-maths .history-book-intro,
.subject-book-feature.book-maths {
  background: #edf0d8;
  border-color: #cad2a8;
}
.subject-book.book-maths .book-example {
  background: #fff1cc;
  border-color: #dfce94;
}
.math-worked-steps {
  padding: 22px;
  background: #eef2e3;
  border: 1px solid #c7d6b7;
  border-radius: 20px;
  margin: 22px 0;
}
.math-worked-steps h3 {
  margin: 0 0 20px;
  font-size: 21px;
}
.math-worked-steps ol {
  list-style: none;
  counter-reset: math-step;
  padding: 0;
  margin: 0;
}
.math-worked-steps li {
  counter-increment: math-step;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  line-height: 1.8;
  border-bottom: 1px solid #d9e1cc;
}
.math-worked-steps li::before {
  content: counter(math-step);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #527c5d;
  color: #fff;
  font-weight: 800;
}
.math-worked-steps li[hidden],
.math-worked-steps button[hidden] {
  display: none !important;
}
.math-worked-steps .controls {
  margin-top: 18px;
}
.math-worked-steps #mathStepStatus {
  font-size: 13px;
  line-height: 1.7;
  color: #4c6654;
  margin-bottom: 0;
}
.math-table-example {
  border: 1px solid #d6cfb7;
  border-radius: 24px;
  padding: 28px;
  background: #fff8e6;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 30px;
  margin: 25px 0;
}
.math-table-example h3 {
  font-size: 26px;
  line-height: 1.4;
}
.math-table-example p {
  line-height: 1.8;
}
.math-table-example label {
  display: grid;
  gap: 10px;
}
.math-table-example svg {
  width: 100%;
  display: block;
  border-radius: 18px;
}
.math-table-example ol {
  line-height: 1.9;
  padding-left: 24px;
}
.math-table-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.math-table-facts span {
  background: #edf1df;
  padding: 8px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}
.book-maths .book-reader-title h2:focus {
  outline-offset: 6px;
}
.book-maths .book-prose {
  min-width: 0;
}
@media (max-width: 850px) {
  .math-table-example {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 540px) {
  .math-worked-steps {
    padding: 18px 14px;
  }
  .math-worked-steps li {
    gap: 10px;
    font-size: 15px;
  }
  .math-worked-steps .controls > button {
    width: 100%;
    white-space: normal;
  }
  .math-table-example {
    padding: 20px 15px;
  }
  .math-table-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .math-table-example .controls button {
    width: 100%;
  }
}
.subject-book.book-geography .history-book-intro,
.world-book-entry {
  background: #e4eef0;
  border-color: #bdd1d5;
}
.book-fun-fact {
  background: #fff0c6;
  border: 1px solid #e4cc86;
  border-radius: 18px;
  padding: 20px;
  margin: 20px 0;
  line-height: 1.8;
}
.book-fun-fact p {
  margin: 8px 0 0;
}
.world-book-flag-picture {
  background: #e5ece0;
  border-radius: 22px;
  padding: 32px 22px;
  text-align: center;
}
.book-geography .world-book-flag-picture .explorer-flag {
  display: block;
  width: 100%;
  max-width: 430px;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: contain;
  border-radius: 0;
  margin: 0 auto 22px;
  box-shadow: 0 8px 20px #52756520;
}
.world-book-flag-picture strong {
  display: block;
  font-size: 25px;
}
.world-book-flag-picture p {
  line-height: 1.7;
  font-size: 15px;
}
.world-book-flag-compare,
.world-book-place-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: #e8eedf;
  border-radius: 22px;
  padding: 24px;
  text-align: center;
}
.world-book-flag-compare > div {
  display: grid;
  gap: 12px;
  align-content: start;
}
.book-geography .world-book-flag-compare img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: contain;
  border-radius: 0;
}
.world-book-place-compare span {
  font-size: 13px;
  line-height: 1.7;
}
.world-book-filters {
  background: #eef1e6;
  border-radius: 18px;
  padding: 20px;
  margin: 20px 0;
}
.world-book-filters label {
  flex: 1;
  min-width: 180px;
}
.world-book-filters input,
.world-book-filters select {
  width: 100%;
  min-height: 44px;
}
.parent-first-setup {
  max-width: 850px;
}
.parent-first-setup form {
  max-width: 620px;
  display: grid;
  gap: 20px;
  margin: 25px 0;
}
.parent-first-setup label {
  display: grid;
  gap: 8px;
}
.family-setup-welcome {
  max-width: 850px;
  margin: auto;
}
.family-setup-welcome > p {
  max-width: 650px;
  margin: 24px auto;
  line-height: 1.9;
}
.family-setup-welcome .primary {
  margin: 12px;
}
.world-book-entry button {
  white-space: normal;
}
.book-geography #worldBookVisit {
  margin: 12px 0 25px;
  white-space: normal;
}
@media (max-width: 540px) {
  .world-book-flag-picture {
    padding: 22px 15px;
  }
  .world-book-flag-compare,
  .world-book-place-compare {
    padding: 16px;
    gap: 12px;
  }
  .world-book-flag-compare b {
    font-size: 13px;
  }
  .world-book-filters label {
    min-width: 0;
    width: 100%;
  }
  .world-book-entry {
    padding: 20px;
  }
  .world-book-entry > button {
    width: 100%;
  }
  .parent-first-setup {
    padding: 20px;
  }
  .parent-first-setup .controls {
    align-items: stretch;
  }
  .parent-first-setup .controls > * {
    width: 100%;
  }
  .family-setup-welcome > button {
    max-width: 100%;
    white-space: normal;
    margin: 12px 0;
  }
}
