:root {
  color-scheme: light;
  --paper: #fbf5e7;
  --white: #fffdf8;
  --ink: #293e45;
  --muted: #596364;
  --green: #195c73;
  --green-dark: #12465a;
  --light: #f6ead0;
  --line: #ded2bc;
  --gold: #e7b848;
  --sans: ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.5; }
button, select, input { font: inherit; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
button, select, input, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid #9c5a26; outline-offset: 3px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; z-index: 4; top: 1rem; left: 1rem; color: white; background: var(--green-dark); padding: .65rem 1rem; border-radius: .5rem; }
.shell { max-width: 1200px; margin-inline: auto; padding-inline: 32px; }
.topbar { background: var(--white); border-bottom: 1px solid #e6e9df; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--green); color: #fae9af; flex: none; }
.brand-mark svg, .timer svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.2rem; line-height: 1.18; letter-spacing: -.02em; }
.brand-note { display: block; margin-top: 3px; font-size: .63rem; letter-spacing: .15em; color: var(--muted); font-weight: 750; }
.timer { display: flex; align-items: center; gap: 9px; padding: 5px 5px 5px 12px; min-height: 43px; border: 1px solid var(--line); border-radius: 50px; background: #fff4d8; white-space: nowrap; }
.timer svg { width: 18px; height: 18px; color: var(--green); }
#timer-value { font-variant-numeric: tabular-nums; font-weight: 780; font-size: .9rem; }
#timer-button { border: 0; border-radius: 30px; padding: 6px 12px; min-height: 32px; background: var(--green); color: white; font-size: .74rem; font-weight: 750; }
#timer-button:hover { background: var(--green-dark); }
.time-up { background: #f9e9bf; }
.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 266px; margin-top: 28px; padding: 27px 39px; border: 1px solid #dfbd76; border-radius: 25px; background: #f4df9e; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { font-size: .67rem; font-weight: 850; letter-spacing: .125em; }
.hero-label { display: inline-flex; align-items: center; gap: 7px; border-radius: 30px; padding: 6px 10px; background: #fff6da; color: #7e3515; }
.hero-label span { font-size: .82rem; }
.hero h1 { margin: 9px 0 12px; font-family: var(--serif); font-size: clamp(3.25rem, 6vw, 5.15rem); font-weight: 700; letter-spacing: -.075em; line-height: .86; color: #343f39; }
.hero h1 em { color: #a84718; font-weight: 500; }
.hero p { margin: 0; max-width: 345px; font-size: .97rem; font-weight: 570; color: #534d3d; }
.hero-art { position: absolute; right: 0; bottom: 0; width: min(62%, 680px); height: auto; pointer-events: none; }
.hero-stamp { position: absolute; z-index: 1; top: 21px; right: 24px; width: 72px; height: 72px; display: grid; place-content: center; background: #f9e8b5; color: #315b48; border: 1px solid #c6aa61; border-radius: 50%; transform: rotate(11deg); font-size: .59rem; font-weight: 850; line-height: 1.07; text-align: center; letter-spacing: .12em; }
.hero-stamp b { margin-top: 3px; }
.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 19px 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.setting { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.setting > label, .setting > span { font-weight: 850; letter-spacing: .11em; font-size: .65rem; color: var(--muted); }
.setting select { min-height: 38px; padding: 6px 28px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcf7; color: var(--ink); font-size: .85rem; font-weight: 700; }
.levels { display: flex; gap: 2px; padding: 3px; border: 1px solid #ded2bc; border-radius: 9px; background: #f7eed9; }
.levels button { border: 0; border-radius: 6px; padding: 6px 11px; background: transparent; font-size: .79rem; font-weight: 750; }
.levels button:hover { background: #efe0bc; }
.levels button[aria-pressed="true"] { color: white; background: var(--green); }
.level-note { flex: 1 1 200px; margin: 0; color: var(--muted); font-size: .76rem; }
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { display: grid; gap: 12px; }
.route, .grownup, .activity { border: 1px solid var(--line); border-radius: 17px; background: var(--white); }
.route { padding: 15px 12px 13px; }
.route-head { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 0 4px 9px; }
.route-head h2 { margin: 0; font: 700 1.14rem var(--serif); }
.route-head > span, .time-chip { background: #f6edcf; border-radius: 30px; color: #65501e; font-weight: 850; font-size: .63rem; letter-spacing: .06em; padding: 4px 8px; white-space: nowrap; }
#steps { display: grid; gap: 4px; }
#steps button { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 8px; min-height: 51px; width: 100%; text-align: left; padding: 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; }
#steps button:hover { background: #f3f7ee; }
#steps button[aria-current] { background: #eaf2f5; border-color: #c7dce4; }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #f7ebd2; color: #76522b; font-size: .71rem; font-weight: 800; }
[aria-current] .step-number, .done .step-number { background: var(--green); color: #fff; }
#steps strong, #steps small { display: block; }
#steps strong { font-size: .82rem; }
#steps small { color: var(--muted); font-size: .71rem; }
.step-arrow { color: var(--green); font-size: 1rem; line-height: 1; }
.route-foot { margin: 9px 3px 0; border-top: 1px solid var(--line); padding: 10px 2px 0; font-size: .72rem; color: var(--muted); }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 5px; }
.progress i { height: 5px; border-radius: 20px; background: #eee4d1; }
.progress i.filled { background: #a84a1b; }
.grownup { padding: 11px 15px; background: #f6ebd5; }
.grownup summary { min-height: 24px; font-size: .84rem; font-weight: 750; }
.grownup summary span { color: #a84a1b; margin-right: 4px; }
.grownup p { margin: 9px 0 2px; font-size: .82rem; color: var(--muted); }
.activity { padding: 23px 27px 21px; min-width: 0; box-shadow: 0 3px 0 #eee1c9; }
.panel-head { margin-bottom: 17px; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-label { display: flex; align-items: center; gap: 7px; color: var(--green); }
.panel-label i { width: 8px; height: 8px; border-radius: 50%; background: #ba551f; }
.panel-head h2 { margin: 7px 0 2px; font: 700 clamp(1.85rem, 4vw, 2.72rem)/1.11 var(--serif); letter-spacing: -.045em; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: .94rem; }
.theme-tag { display: inline-block; margin-top: 11px; border-radius: 6px; padding: 4px 8px; background: #f7e6b3; color: var(--green); font-size: .62rem; letter-spacing: .11em; font-weight: 850; }
.passage { background: #fffcf4; border: 1px solid #e5d9c0; border-radius: 12px; padding: 15px 20px; color: #333e43; font: 1.19rem/1.66 var(--serif); }
.passage p { margin: 0 0 11px; }
.passage p:last-child { margin-bottom: 0; }
.vocabulary { margin-top: 19px; }
.vocabulary h3 { margin: 0; font: 700 1.27rem var(--serif); }
.vocabulary h3 span { color: #ba551f; font-size: .95rem; margin-right: 3px; }
.vocabulary > p { margin: 2px 0 9px; color: var(--muted); font-size: .82rem; }
.vocab-grid, .word-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-items: start; }
.vocab-grid details { border: 1px solid var(--line); border-radius: 9px; background: #fffbf0; padding: 7px 10px; }
.vocab-grid summary, .word-hint summary, .story-lookback summary { color: var(--green); font-weight: 780; }
.vocab-grid summary { min-height: 27px; }
.vocab-grid p { margin: 5px 0; font-size: .81rem; }
.example { color: var(--muted); font-style: italic; }
.tip { margin: 17px 0 0; padding: 10px 12px; border-left: 3px solid #d7b966; border-radius: 0 7px 7px 0; background: #faf3dd; color: #4f472f; font-size: .85rem; }
.panel-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.primary, .secondary { min-height: 42px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 780; font-size: .87rem; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.primary span { margin-left: 5px; }
.secondary { background: #f8efdc; border-color: var(--line); }
.secondary:hover { background: #e7f0f4; }
.secondary span { margin-right: 4px; }
.word-grid { align-items: stretch; }
.word-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fffbf0; }
.word-top { display: flex; justify-content: space-between; gap: 4px; align-items: center; color: var(--green); }
.word-parts { margin: 7px 0 6px; font: 700 clamp(1.12rem, 2.15vw, 1.7rem)/1.2 var(--serif); overflow-wrap: anywhere; }
.word-hint { margin-bottom: 8px; font-size: .79rem; }
.word-hint p { margin: 4px 0; }
.word-card input { min-height: 40px; width: 100%; padding: 6px 8px; background: white; color: var(--ink); border: 1px solid #c8bb9c; border-radius: 7px; }
.word-actions { display: flex; gap: 4px 9px; flex-wrap: wrap; align-items: center; margin-top: 7px; }
.small-button { min-height: 32px; padding: 3px 9px; color: var(--green-dark); background: #e3eef3; border: 1px solid #c7dce4; border-radius: 6px; font-size: .76rem; font-weight: 800; }
.small-button:hover { background: #cbdfe8; }
.link-button { border: 0; padding: 3px 0; color: var(--green-dark); background: transparent; font-size: .77rem; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: #875024; }
.word-feedback { margin: 6px 0 0; font-size: .77rem; font-weight: 650; }
.word-feedback:empty { margin: 0; }
.good { color: #286139; }
.try { color: #8f3c19; }
.shown { color: #38586a; }
.story-lookback { margin-bottom: 15px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: #fffbf0; font-size: .88rem; }
.story-lookback .passage { margin-top: 8px; }
.questions { display: grid; gap: 13px; }
.question { min-width: 0; margin: 0; padding: 5px 11px 10px; border: 1px solid var(--line); border-radius: 11px; }
.question legend { padding: 0 5px; font-weight: 790; font-size: .99rem; }
.question legend span { display: inline-grid; place-items: center; margin-right: 4px; width: 24px; height: 24px; border-radius: 7px; background: #e9f3e4; color: var(--green); font-size: .8rem; }
.option { display: flex; align-items: center; gap: 9px; min-height: 43px; margin-top: 3px; padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-size: .92rem; }
.option:hover { background: #f8efdc; }
.option:has(:checked) { border-color: #98bdcc; background: #e7f2f7; }
.option input { width: 17px; height: 17px; flex: none; accent-color: var(--green); }
.answer-count { margin: 12px 0 0; color: var(--muted); font-size: .84rem; font-weight: 700; }
.review-callout, .score { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; padding: 15px; border: 1px solid #dfc789; border-radius: 11px; background: #f4e4b5; }
.review-star { display: grid; place-items: center; min-width: 37px; height: 37px; border-radius: 10px; background: #f8e8b6; color: var(--green); font-size: 1.22rem; }
.review-callout h3, .score h3 { margin: 0; font: 700 1.32rem var(--serif); }
.review-callout p, .score p { margin: 3px 0 0; font-size: .85rem; color: var(--muted); }
.review-callout .primary { margin-left: auto; }
.review-list { display: grid; gap: 10px; margin: 14px 0 0; padding-left: 24px; }
.review-list li { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.review-list li::marker { color: var(--green); font-weight: 800; }
.review-list h3 { margin: 0; font-size: .92rem; }
.review-list p { margin: 3px 0; font-size: .85rem; }
.review-heading { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: center; justify-content: space-between; }
.review-badge { padding: 2px 7px; border-radius: 20px; background: #f7efd9; font-size: .68rem; font-weight: 800; }
.review-badge.good { background: #eaf1dd; }
.explanation { color: var(--muted); }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin: 19px 0 22px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: .77rem; }
dialog { max-width: min(420px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--white); padding: 22px; }
dialog::backdrop { background: #293e4585; }
dialog h2 { margin: 0; font: 700 1.5rem var(--serif); }
dialog p { margin: 8px 0 13px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 880px) {
  .shell { padding-inline: 22px; }
  .hero { min-height: 230px; padding-left: 27px; }
  .layout { grid-template-columns: 209px minmax(0, 1fr); gap: 13px; }
  .activity { padding-inline: 19px; }
  .word-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .shell { padding-inline: 13px; }
  .topbar-inner { min-height: 65px; }
  .brand { gap: 7px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand strong { font-size: .99rem; }
  .brand-note { font-size: .53rem; }
  .timer { gap: 5px; padding: 3px 3px 3px 7px; min-height: 37px; }
  .timer svg { display: none; }
  #timer-value { font-size: .78rem; }
  #timer-button { min-height: 31px; padding-inline: 7px; font-size: .68rem; }
  .hero { margin-top: 13px; min-height: 223px; padding: 16px; border-radius: 16px; }
  .hero h1 { font-size: clamp(2.8rem, 10vw, 4.1rem); }
  .hero p { max-width: 210px; font-size: .84rem; }
  .hero-art { width: min(69%, 355px); }
  .hero-stamp { width: 45px; height: 45px; right: 12px; top: 10px; font-size: .42rem; }
  .settings { margin-block: 11px; padding: 10px; gap: 6px 12px; }
  .settings > .setting { min-height: 41px; }
  .level-note { flex-basis: 100%; }
  .layout { display: flex; flex-direction: column; gap: 10px; }
  .sidebar { display: contents; }
  .route, .activity, .grownup { width: 100%; }
  .grownup { order: 3; }
  .route { padding: 9px 9px 8px; }
  .route-head { padding-bottom: 5px; }
  #steps { grid-template-columns: 1fr 1fr; gap: 3px; }
  #steps button { min-height: 45px; grid-template-columns: 24px 1fr auto; gap: 5px; padding: 3px 4px; }
  .step-number { width: 23px; height: 23px; border-radius: 6px; font-size: .64rem; }
  #steps strong { font-size: .73rem; }
  #steps small { font-size: .65rem; }
  .route-foot { padding-top: 5px; margin-top: 5px; }
  .progress { margin-top: 3px; }
  .activity { padding: 14px 12px; }
  .passage { padding: 11px 12px; font-size: 1.13rem; }
  .vocab-grid { grid-template-columns: 1fr; gap: 5px; }
  .review-callout .primary { margin-left: 0; }
}
@media (max-width: 370px) {
  .brand strong { font-size: .88rem; }
  .hero p { max-width: 172px; }
  .hero-label { font-size: .59rem; }
  .levels button { padding-inline: 7px; }
}

/* The library room palette follows the brick, sign, door, and foliage artwork. */
.hero { min-height: 328px; padding: 34px 39px; background: #f5dfa2; }
.hero-copy { width: 58%; }
.hero h1 { font-size: clamp(2.8rem, 4.5vw, 4.1rem); line-height: 1.02; letter-spacing: -.055em; margin-block: 14px; }
.hero p { max-width: 350px; }
.hero-art { right: 0; width: 39%; height: 100%; object-fit: cover; object-position: center 47%; border-left: 7px solid #b65a29; }
.hero-stamp { right: 15px; top: 14px; background: #fff3cd; border-color: #b8792e; width: 66px; height: 66px; font-size: .63rem; }
.hero-label { font-size: .75rem; letter-spacing: .07em; }
.topbar { border-top: 5px solid #b75223; }
.brand-note { color: #a7461a; font-size: .75rem; }
.brand-mark { background: #195c73; color: #f6cf65; }
.route { border-top: 4px solid #b75223; }
.grownup { border-top: 3px solid #688347; }
.activity { border-top: 4px solid #195c73; }
.time-chip, .route-head > span { background: #f3dc95; color: #5b4515; font-size: .75rem; }
.setting > label, .setting > span { font-size: .75rem; }
.level-note { font-size: .875rem; }
.levels button { font-size: .875rem; }
.levels button[aria-pressed="true"] { background: #a7461a; }
.panel-label { font-size: .75rem; }
#steps strong { font-size: .875rem; }
#steps small { font-size: .8125rem; }
.theme-tag { font-size: .75rem; }
.passage { box-shadow: inset 4px 0 0 #e6b449; }
.vocab-grid details:nth-child(1) { border-top: 3px solid #b75223; }
.vocab-grid details:nth-child(2) { border-top: 3px solid #195c73; }
.vocab-grid details:nth-child(3) { border-top: 3px solid #688347; }
.word-card { border-top: 3px solid #d6a83c; }
.tip { border-left-color: #b75223; }
#steps button[aria-current] { border-color: #c4d8e0; background: #e8f1f5; }
.primary { background: #195c73; }
.primary:hover { background: #12465a; }
.grownup summary, .link-button, .route-foot, .footer { font-size: .875rem; }
@media (max-width: 680px) {
  .hero { min-height: 250px; padding: 18px 15px; }
  .hero-copy { width: 61%; }
  .hero h1 { font-size: clamp(2rem, 6.8vw, 2.9rem); }
  .hero p { max-width: 95%; font-size: .9rem; }
  .hero-label { max-width: 95%; font-size: .69rem; }
  .hero-art { width: 36%; border-left-width: 4px; }
  .hero-stamp { display: none; }
  .brand-note { font-size: .64rem; }
  #steps strong { font-size: .81rem; }
  #steps small { font-size: .75rem; }
}

.bonus { margin-top: 22px; border: 1px solid var(--line); border-top: 4px solid #688347; border-radius: 16px; background: var(--white); overflow: hidden; }
.bonus > summary { padding: 16px 20px; color: var(--ink); font-size: 1.25rem; font-family: var(--serif); font-weight: 700; }
.bonus > summary small { display: block; margin: 3px 0 0 20px; font: .875rem/1.5 var(--sans); color: var(--muted); }
#bonus-activities { padding: 0 20px 20px; }
.bonus-intro { margin: 0 0 16px; font-size: 1rem; color: var(--muted); }
.bonus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.bonus-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fffcf4; }
.bonus-card h2 { margin: 0; font: 700 1.5rem var(--serif); }
.bonus-card > p { margin: 7px 0 13px; }
.bonus-label { display: block; font-size: 1rem; font-weight: 750; margin: 13px 0 5px; }
.bonus select { width: 100%; min-height: 45px; padding: 8px 29px 8px 9px; color: var(--ink); background: white; border: 1px solid #c8bb9c; border-radius: 7px; font-size: 1rem; }
.bonus .secondary { margin-top: 16px; }
.bonus-feedback { font-weight: 700; }
.bonus-feedback:empty { display: none; }
.bonus-key { margin-top: 13px; font-size: 1rem; }
.bonus-key summary { font-weight: 750; color: var(--green); }
.bonus-key li { margin-bottom: 5px; }
.writing-card { margin-top: 15px; }
.writing-card textarea { width: 100%; resize: vertical; padding: 12px; color: var(--ink); background: white; border: 1px solid #c8bb9c; border-radius: 8px; font: 1.1rem/1.6 var(--sans); }
.writing-note, .writing-help { font-size: .9rem; color: var(--muted); }
.bonus select, .setting select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23195c73' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
@media (max-width: 680px) {
  .bonus-grid { grid-template-columns: 1fr; }
  #bonus-activities { padding: 0 12px 12px; }
  .bonus > summary { padding: 14px 12px; }
  .bonus-card { padding: 13px; }
}
