/* Compositions based on the approved v2 mockups. */
.site-header { background: #ffffffdf; border-bottom: 1px solid var(--line); }
.topbar { max-width: 1440px; min-height: 88px; padding: 16px 40px; gap: 32px; justify-content: start; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); flex-shrink: 0; }
button.brand { background: transparent; border: 0; padding: 0; min-height: 48px; text-align: left; }
.brand-icon { position: relative; display: grid; place-items: center; width: 48px; height: 48px; color: var(--teal); }
.brand-icon>.icon { width: 45px; height: 45px; }.brand-icon .brand-star { width: 22px; height: 22px; position: absolute; left: 17px; top: -4px; color: #a87516; fill: var(--lemon); stroke-width: 1; }
.topbar .brand-icon { color: var(--teal); }
.topbar .brand-type { display: flex; flex-direction: column; line-height: 1.2; color: var(--ink); font-size: inherit; }
.topbar .brand-name { color: var(--teal-dark); font-size: 12px; font-weight: 750; letter-spacing: .08em; margin-bottom: 3px; text-align: left; }.brand-type strong { font-family: var(--font-heading); font-weight: 800; font-size: 23px; letter-spacing: -.05em; }
.site-nav { display: flex; align-items: center; gap: 10px; margin-left: 25px; }
.site-nav button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; font-weight: 700; padding: 10px 22px; min-height: 48px; white-space: nowrap; }
.site-nav button:hover,.site-nav button[aria-current=page] { color: var(--teal-dark); background: #d9f5ef; }
.profile-note { margin-left: auto; display: flex; gap: 12px; align-items: center; white-space: nowrap; }.topbar .profile-note>span { font-size: 12px; }
.profile-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--peach); border: 2px solid white; }
.profile-avatar img { width: 55px; max-width: none; height: 70px; object-fit: cover; object-position: top; transform: translate(-7px,-4px); }
.shell { max-width: 1400px; padding: 24px 40px 32px; }.lesson-toolbar { gap: 16px; }.lesson-toolbar nav { min-width: 0; }
.steps { gap: 8px; margin: 0 0 24px; }.steps li { background: #e7f3ef; }.steps .active { background: var(--teal); color: white; }.steps .past { background: #d9eee8; }
.step-button { padding: 10px 19px; min-height: 44px; font-weight: 650; }.review-toolbar { margin: 0 0 20px; }
.review-link { min-height: 44px; padding: 9px 16px; background: #f6f2ff; border-color: #d9d1ee; color: var(--lilac-ink); font-weight: 650; }.review-link span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; background: white; border-radius: 50%; }
main { background: transparent; padding: 0; border-radius: 0; scroll-margin-top: 24px; }
.home-hero { position: relative; min-height: 330px; border-radius: 30px; background: linear-gradient(105deg,#e5faf2,#e6f7f0 50%,#e9f4ef); overflow: hidden; margin-bottom: 24px; }
.hero-copy { position: relative; z-index: 2; width: 52%; padding: 48px 40px; }.hero-copy h1 { font-size: clamp(38px,4.4vw,60px); font-weight: 800; line-height: 1.28; margin-bottom: 16px; }.hero-copy h1 span { color: var(--teal); }
.hero-copy>p:last-of-type { font-size: 17px; max-width: 360px; }.hero-copy .eyebrow { font-size: 10px; letter-spacing: .16em; }
.hero-spark { color: #be8d2d; position: absolute; left: 370px; top: 38px; transform: rotate(15deg); }.hero-spark svg { width: 32px; height: 32px; }
.hero-scene { position: absolute; inset: 0 0 0 43%; overflow: hidden; }.scene-window { position: absolute; inset: 25px 35px 40px 90px; border: 10px solid #ffffffad; border-radius: 70px 70px 0 0; background: linear-gradient(90deg,transparent 48%,#ffffffa6 49%,#ffffffa6 51%,transparent 52%),linear-gradient(#d7f1e7 52%,#fff9e5); box-shadow: 0 0 0 1px #d4e9e0; }
.hero-melo { position: absolute; width: 360px; height: 450px; max-width: 70%; left: -20px; top: 5px; transform: rotate(-4deg); z-index: 2; }.hero-nael { position: absolute; width: 430px; height: 538px; max-width: 70%; right: -28px; top: -8px; transform: rotate(4deg); z-index: 1; }
.scene-books { position: absolute; bottom: 25px; left: 20px; transform: rotate(-8deg); }.scene-books i { display: block; width: 125px; height: 24px; border: 4px solid #a8d8ce; background: white; border-radius: 4px; }.scene-books i:nth-child(2) { width: 140px; border-color: #c5bce0; }
.scene-note { position: absolute; right: 12px; top: 60px; transform: rotate(9deg); padding: 18px; background: #fffbe7; color: #718f94; font: 15px/1.8 cursive; }.scene-star { position: absolute; top: 15px; right: 30%; color: #a77e1f; font-size: 32px; }
.home-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 24px; align-items: stretch; }
.book-card,.journey,.activity-card,.reading-card,.mentor-card,.recall-card,.library-card { border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); background: white; padding: 28px; min-width: 0; }
.card-heading { display: flex; align-items: center; gap: 10px; color: var(--teal-dark); font-size: 18px; margin: 0 0 24px; }.home-book { display: grid; grid-template-columns: minmax(130px,.65fr) minmax(0,1.35fr); gap: 28px; align-items: start; }
.cover { box-shadow: 5px 8px 0 #dce8e2; border-radius: 12px; }.book-title { font-family: var(--font-heading); color: var(--ink); font-size: clamp(26px,3vw,40px); font-weight: 900; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.03em; }.home-book h3 { font-size: 17px; font-weight: 500; }.home-book .lead { font-size: 15px; line-height: 1.7; }
.book-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }.book-tags span { background: var(--soft); color: var(--teal-dark); font-size: 12px; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }.book-tags span:nth-child(2) { background: var(--lilac); color: var(--lilac-ink); }.book-tags span:nth-child(3) { background: var(--peach); color: var(--peach-ink); }
.exposure-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }.home-book select { font-size: 14px; }.home-book .select-field { margin-bottom: 12px; }.home-book .primary { width: auto; justify-content: flex-start; margin-top: 0; }
.journey { background: linear-gradient(140deg,#f7f4ff,#eee8ff); border-color: #e1d9f1; overflow: hidden; padding-bottom: 0; }.journey h2 { font-size: 21px; display: flex; gap: 10px; align-items: center; }.journey h2 .icon { color: #7a63b7; }
.journey-route { position: relative; list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 12px 0 0; margin: 18px 0 0; }.journey-route::before { content: ''; border-top: 2px dashed #c6b8ed; position: absolute; top: 40px; inset-inline: 15%; }.journey-route li { position: relative; display: flex; align-items: center; flex-direction: column; text-align: center; gap: 6px; }.journey-route li>span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--teal); background: white; }.journey-route li:nth-child(2)>span { color: #9b7421; background: #fffbed; }.journey-route li:nth-child(3)>span { color: var(--peach-ink); background: #fff0e9; }.journey-route strong { font-size: 15px; }.journey-route small { font-size: 12px; color: #665d7f; }
.journey-friend { position: relative; display: flex; align-items: center; min-height: 150px; margin-top: 8px; }.journey-nael { height: 160px; width: 160px; align-self: end; object-position: bottom; }.journey-friend .speech { transform: rotate(-5deg); font-size: 17px; margin-left: -8px; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }.quick-links form { width: 100%; }.quick-link { width: 100%; display: flex; align-items: center; text-align: left; gap: 18px; padding: 22px 26px; border: 1px solid #dfd5fa; border-radius: 20px; color: var(--ink); background: #f3effe; }.quick-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }.quick-link>.icon { width: 36px; height: 36px; color: var(--lilac-ink); }.quick-link strong,.quick-link small { display: block; }.quick-link strong { font-size: 18px; }.quick-link small { font-size: 13px; color: var(--muted); }.quick-links form:last-child .quick-link { background: #e9f9f3; border-color: var(--line); }.quick-links form:last-child .icon { color: var(--teal); }
.activity-layout,.reading-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; align-items: start; }.activity-card { padding: 36px; }.activity-card>h1 { font-size: 32px; }
.mentor-card { padding: 22px; background: linear-gradient(#f4fffb,white); position: sticky; top: 24px; }.mentor-card>h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }.mentor-card>h2 .icon { color: #a57a15; }.mentor-portrait { position: relative; height: 235px; overflow: hidden; margin: 0 -12px; }.mentor-melo { width: 245px; max-width: none; position: absolute; left: 35px; top: 25px; }.mentor-portrait .speech { position: absolute; z-index: 1; top: 0; left: 0; width: 155px; font-size: 14px; padding: 12px; transform: rotate(-5deg); }.mentor-note { background: #eff8f3; padding: 16px; border-radius: 16px; font-size: 14px; }.mentor-note p { margin: 0; }
.learner-note { display: flex; gap: 8px; align-items: center; margin-top: 16px; }.learner-sticker { width: 80px; height: 95px; }.learner-note p { font-size: 12px; margin: 0; }.learner-note strong,.learner-note span { display: block; }.learner-note span { color: var(--muted); margin-top: 6px; }
.reading-heading { margin-bottom: 20px; }.reading-heading h1 { margin-bottom: 8px; }.part-nav { gap: 8px; margin: 16px 0 22px; }.part-nav .secondary { min-height: 44px; padding: 8px 13px; font-size: 12px; }.part-nav .secondary[aria-current=page] { background: var(--teal); color: white; }
.reading-grid { display: block; }.reading-grid figure { margin: 0 0 30px; max-width: none; }.reading-grid figure img { max-height: 260px; width: 100%; object-fit: contain; border-radius: 16px; background: #f8f9f1; }.book-paragraph { font-family: var(--font-reading); font-size: 22px; line-height: 1.95; letter-spacing: .005em; }
.word-link { color: var(--teal-dark); background: #fff0bc80; border-bottom: 2px solid #4aa69c; border-radius: 3px; padding-inline: 1px; }.word-link:hover { background: var(--lemon); }.word-link:focus-visible { outline-offset: 2px; }
.phrase-guide-tools { padding: 16px; border-radius: 16px; background: #fffffff5; box-shadow: 0 4px 16px #173e4308; }.phrase-guide-tools p { font-size: 12px; }#phrase-guide-toggle { font-size: 13px; }.pos-options { gap: 8px; }.pos-toggle[aria-pressed=true] { background: white; color: var(--ink); border-color: currentColor; box-shadow: inset 0 0 0 1px; }.pos-toggle { font-size: 12px; }.phrase-guide-enabled .phrase-chunk { background: #e4f2eb; }
#gloss-popup,.reading-help-popup { background: white; border-radius: 24px; box-shadow: 0 24px 80px #173e4333; padding: 24px; width: min(480px,calc(100% - 32px)); }.popup-teacher { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; color: var(--teal-dark); font-size: 13px; font-weight: 700; }.popup-teacher .character { width: 54px; height: 60px; object-fit: cover; object-position: top; border-radius: 50%; background: var(--soft); }
#gloss-title,.reading-help-popup h2 { font-family: var(--font-reading); font-size: 28px; }.story-sense { background: #f5f1ff; border: 0; border-radius: 16px; padding: 18px; }#gloss-save { background: var(--peach); color: var(--peach-ink); border-color: #f6cbb9; }#gloss-meaning { font-size: 22px; }.listen-button { min-height: 44px; padding: 8px 13px; font-size: 13px; }.pronunciation-tip { font-size: 12px; }
.review-card { border: 1px solid var(--line); border-radius: 20px; padding: 24px; background: #fcfaff; }.review-card h2 { font-family: var(--font-reading); }.review-card button { font-size: 13px; }
.recall-title { text-align: center; margin: 12px 0 32px; }.recall-title h1 { margin-bottom: 8px; }.recall-layout { display: grid; grid-template-columns: minmax(160px,.6fr) minmax(0,1.4fr) minmax(160px,.6fr); gap: 24px; align-items: start; }.recall-card { padding: 32px; border-color: #acdcd2; text-align: center; }.recall-card>h1 { font-family: var(--font-reading); font-size: clamp(30px,3vw,44px); }.recall-card .pronunciation,.recall-card .audio-tools { justify-content: center; }.recall-card .pronunciation-tip { text-align: left; }.recall-card>.lead { font-size: 16px; }
.recall-answer { padding: 24px 0; background: transparent; border-block: 1px dashed var(--line); border-radius: 0; animation: card-reveal .22s ease-out; }.recall-answer h2 { font-size: 13px; color: var(--muted); }.recall-answer .definition { font-size: 26px; color: var(--teal-dark); }.recall-answer .model { font-size: 22px; }.recall-card>h2 { font-size: 20px; }.recall-ratings { flex-wrap: wrap; gap: 8px; }.recall-ratings .inline-form { flex: 0 1 auto; min-width: 0; }.recall-ratings button { min-height: 62px; padding: 12px 8px; border-radius: 16px; font-size: 14px; }.recall-ratings form:nth-child(2) button { background: var(--lilac); color: var(--lilac-ink); border-color: #ded3f5; }.recall-ratings form:nth-child(3) button { background: var(--peach); color: var(--peach-ink); border-color: #f6cbb9; }.recall-card>.actions { justify-content: center; }.recall-card>.actions button { font-size: 13px; }
.recall-card .pronunciation-detail { margin: 4px 0 0; }.recall-card .pronunciation-detail summary { color: var(--muted); font-size: 12px; min-height: 36px; }.recall-card .pronunciation-block { margin-bottom: 8px; }.recall-card .recall-answer { margin: 12px 0; padding: 16px 0; }.recall-card .recall-answer p { margin-bottom: 10px; }#recall-flip { min-height: 44px; font-size: 12px; margin: 0 0 14px; }.recall-card .recall-ratings { margin-top: 12px; }
.recall-companion { padding-top: 30px; }.recall-melo { width: 100%; height: 330px; object-fit: cover; object-position: top; }.recall-nael { width: 100%; height: 260px; }.recall-learner .speech { font-size: 15px; transform: rotate(4deg); }.companion-message { position: relative; margin-top: -18px; background: white; border: 1px solid var(--line); border-radius: 20px; padding: 18px; }.companion-message h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }.companion-message p { font-size: 14px; margin: 0; }.companion-message.surface-peach { background: #fff0e9; }.companion-message .icon { width: 20px; }
.source-quote,.own-sentence { font-family: var(--font-reading); }.sentence-parts { font-family: var(--font-reading); }.sentence-parts span,.sentence-parts strong { border-radius: 10px; }.finish-list { gap: 14px; }.finish-list p { padding: 18px; border-radius: 16px; background: var(--soft); border: 0; font-size: 14px; }.finish-list p:nth-child(2) { background: var(--lilac); }.finish-list p:nth-child(3) { background: var(--peach); }.finish-list strong { display: inline-block; margin-bottom: 8px; }.expression-summary li>span { font-family: var(--font-reading); }
.library-heading { margin: 12px 0 28px; }.library-card { max-width: 850px; display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 32px; align-items: start; }.library-card .book-title { font-size: 30px; }
footer { font-size: 12px; padding: 28px 8px 0; }.footer-heading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }.footer-heading span { margin-right: auto; }.footer-heading a { min-height: 44px; display: inline-flex; align-items: center; }.footer-details { border-top: 1px solid var(--line); padding-top: 8px; }
.system-catalog { max-width: 1160px; margin: 12px auto 60px; padding: 40px; border-radius: 28px; background: white; }.system-catalog section { padding: 24px 0; border-top: 1px solid var(--line); }.swatches { list-style: none; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); padding: 0; gap: 16px; }.swatch span { display: block; height: 80px; border-radius: 16px; border: 1px solid var(--line); }.swatch strong,.swatch code { display: block; font-size: 12px; margin-top: 8px; }.swatch-mint span { background: var(--mint); }.swatch-teal span { background: var(--teal); }.swatch-ink span { background: var(--ink); }.swatch-lilac span { background: var(--lilac); }.swatch-peach span { background: var(--peach); }.swatch-lemon span { background: var(--lemon); }.system-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }.system-cards article { border-radius: 20px; padding: 24px; }
@keyframes card-reveal { from { opacity: .5; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media(min-width:1100px) { #gloss-popup { margin: 0; top: 160px; left: auto; right: max(24px,calc((100vw - 1400px)/2 + 40px)); width: 380px; max-height: calc(100dvh - 190px); }#gloss-popup::backdrop { background: #173e4318; } }
@media(max-width:1100px) {
  .topbar { padding-inline: 28px; gap: 20px; }.site-nav { gap: 0; margin-left: 0; }.site-nav button { padding-inline: 16px; }.profile-note>span { display: none; }.shell { padding-inline: 28px; }
  .hero-copy { padding: 40px 30px; }.hero-melo { left: -5px; width: 300px; height: auto; top: 18px; }.hero-nael { right: -10px; width: 300px; height: auto; top: 20px; }.home-grid { grid-template-columns: 1.45fr 1fr; gap: 18px; }.home-book { gap: 18px; grid-template-columns: 110px minmax(0,1fr); }.book-card,.journey { padding: 22px; }.journey { padding-bottom: 0; }.journey h2 { font-size: 18px; }.journey-route strong { font-size: 13px; }.journey-route small { font-size: 11px; }.journey-friend .speech { font-size: 14px; padding: 12px; }
  .activity-layout,.reading-layout { grid-template-columns: minmax(0,1fr) 265px; gap: 20px; }.mentor-card { padding: 18px; }.mentor-melo { left: 18px; width: 230px; }.mentor-card h2 { font-size: 16px; }.learner-note { flex-direction: column; text-align: center; }.activity-card { padding: 28px; }.step-button { padding-inline: 14px; }
  .recall-layout { grid-template-columns: 170px minmax(0,1fr); gap: 20px; }.recall-learner { display: none; }.recall-card { padding: 28px; }.recall-melo { height: 260px; }.finish-list { grid-template-columns: 1fr; gap: 6px; }.finish-list p { margin-bottom: 0; }.swatches { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width:820px) {
  .topbar { gap: 12px; flex-wrap: wrap; padding: 14px 22px; }.brand-type strong { font-size: 21px; }.site-nav { order: 3; width: 100%; justify-content: center; }.site-nav button { padding-inline: 28px; }.profile-note { margin-left: auto; }.shell { padding: 20px 22px 28px; }
  .home-hero { min-height: 305px; }.hero-copy { padding: 34px 28px; width: 55%; }.hero-copy h1 { font-size: 36px; }.hero-copy p:last-of-type { font-size: 15px; max-width: 240px; }.hero-copy .eyebrow { max-width: 220px; }.hero-spark { left: 260px; top: 22px; }.hero-scene { left: 48%; }.hero-melo { max-width: 80%; width: 280px; height: auto; top: 60px; left: -8px; }.hero-nael { width: 200px; height: auto; max-width: 60%; right: -18px; top: 28px; }.scene-note { display: none; }
  .home-grid { grid-template-columns: 1fr; }.home-book { grid-template-columns: 175px minmax(0,1fr); gap: 28px; }.journey { position: relative; padding-right: 190px; min-height: 225px; }.journey-friend { position: absolute; right: 10px; bottom: 0; display: block; }.journey-nael { width: 155px; }.journey-friend .speech { position: absolute; right: 8px; top: -20px; margin: 0; white-space: nowrap; font-size: 13px; }
  .activity-layout,.reading-layout { grid-template-columns: minmax(0,1fr); }.mentor-card { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }.mentor-card>h2 { grid-column: 1/-1; margin: 0; }.mentor-portrait { height: 160px; margin: 0; grid-row: span 2; }.mentor-melo { width: 175px; top: 8px; left: auto; right: 0; }.mentor-portrait .speech { width: 140px; top: 8px; font-size: 13px; }.learner-note { flex-direction: row; margin: 0; text-align: left; }.learner-sticker { height: 60px; width: 50px; }.mentor-note { align-self: end; }.reading-heading h1 { font-size: 30px; }
  .lesson-toolbar { flex-wrap: wrap; gap: 0; }.review-toolbar { margin: -8px 0 20px; }.steps { gap: 6px; margin-bottom: 20px; }.recall-layout { grid-template-columns: minmax(0,1fr); }.recall-teacher { display: none; }.recall-title h1 { font-size: 32px; }.recall-card>h1 { font-size: 38px; }.library-card { grid-template-columns: 150px minmax(0,1fr); gap: 24px; }.system-catalog { margin: 12px 22px; padding: 28px; }.system-cards { grid-template-columns: 1fr; }
}
@media(max-width:540px) {
  .topbar { padding: 12px 16px; }.brand-icon { width: 38px; height: 38px; }.brand-icon>.icon { width: 36px; height: 36px; }.brand-icon .brand-star { width: 18px; height: 18px; left: 14px; top: -2px; }.brand { gap: 9px; }.topbar .brand-type { max-width: none; text-align: left; }.brand-type strong { font-size: 20px; }.topbar .brand-name { font-size: 10px; }.profile-avatar { width: 34px; height: 34px; }.site-nav { gap: 6px; justify-content: stretch; }.site-nav button { flex: 1; padding-inline: 12px; font-size: 13px; min-height: 44px; }
  .shell { padding: 16px 14px 24px; }.home-hero { min-height: 410px; border-radius: 24px; margin-bottom: 18px; }.hero-copy { padding: 28px 24px; width: 100%; }.hero-copy h1 { font-size: 34px; margin-bottom: 12px; }.hero-copy .eyebrow { font-size: 8px; margin-bottom: 12px; max-width: none; }.hero-copy p:last-of-type { max-width: 230px; font-size: 14px; }.hero-spark { left: auto; right: 26px; top: 40px; }.hero-scene { inset: 180px 0 0 20%; }.hero-melo { width: 245px; left: 0; top: 30px; max-width: 75%; }.hero-nael { width: 190px; right: -6px; top: 10px; }.scene-window { inset: 10px 20px 10px 15px; }.scene-books { left: 0; }
  .book-card,.journey { padding: 20px; }.card-heading { font-size: 17px; margin-bottom: 20px; }.home-book { grid-template-columns: 95px minmax(0,1fr); gap: 18px; }.home-book .book-title { font-size: 23px; }.home-book h3 { font-size: 14px; }.home-book .lead { font-size: 13px; }.book-tags span { padding: 4px 8px; font-size: 10px; }.home-book form { grid-column: 1/-1; }.home-book-copy { display: contents; }.home-book-copy>.book-title,.home-book-copy>h3,.home-book-copy>.lead,.home-book-copy>.book-tags { grid-column: 2; }.home-book-copy>.book-title { grid-row: 1; }.home-book>.cover { grid-row: 1/5; }.home-book-copy>h3 { margin: -6px 0 0; }.home-book-copy>.lead { margin: -6px 0 0; }.home-book-copy>.book-tags { margin: 0; }.home-book { row-gap: 12px; }
  .journey { padding-right: 20px; padding-bottom: 120px; min-height: 300px; }.journey-route { gap: 8px; }.journey-route strong { font-size: 14px; }.journey-friend { right: 24px; bottom: -5px; }.journey-nael { width: 115px; height: 120px; }.journey-friend .speech { top: 18px; right: 115px; }.quick-links { gap: 12px; grid-template-columns: 1fr; margin-top: 18px; }.quick-link { padding: 18px 22px; }.quick-link strong { font-size: 16px; }
  .steps { gap: 5px; }.step-button { padding: 8px 12px; font-size: 12px; }.review-link { font-size: 12px; }.activity-card,.reading-card { padding: 24px 20px; border-radius: 20px; }.activity-card>h1 { font-size: 28px; }.book-paragraph { font-size: 21px; line-height: 1.95; }.reading-grid figure { margin-bottom: 24px; }.reading-grid figure img { max-height: 240px; }.part-nav .inline-form { width: calc(50% - 4px); }.part-nav button { width: 100%; font-size: 11px; }
  .phrase-guide-tools { padding: 12px; position: static; }.phrase-guide-tools>p { flex-basis: 100%; }.pos-options { gap: 6px; }.pos-toggle { font-size: 12px; padding: 6px; }.pos-state { margin-left: 2px; font-size: 10px; }.mentor-card { padding: 18px; gap: 12px; grid-template-columns: 1fr; }.mentor-portrait { display: none; }.mentor-note { padding: 14px; }.learner-sticker { height: 65px; width: 65px; }
  .actions { gap: 10px; }.support,.feedback,.explanation,.next-step { padding: 18px; }.model { font-size: 21px; }.choice { padding: 14px; }.choice input { margin-top: 4px; }.choice span { font-size: 15px; }#gloss-popup,.reading-help-popup { padding: 22px 20px; }
  .recall-title { text-align: left; margin-bottom: 22px; }.recall-title h1 { font-size: 29px; }.recall-title p { font-size: 15px; }.recall-card { padding: 24px 20px; }.recall-card>h1 { font-size: 32px; }.recall-answer .definition { font-size: 23px; }.recall-answer .model { font-size: 21px; }.recall-ratings { flex-wrap: wrap; }.recall-ratings button { min-height: 52px; }
  .library-card { grid-template-columns: 90px minmax(0,1fr); padding: 20px; gap: 18px; }.library-card .book-title { font-size: 23px; }.library-card .actions button { font-size: 13px; }.system-catalog { margin: 12px 14px; padding: 24px 20px; }.swatches { grid-template-columns: repeat(2,minmax(0,1fr)); }.system-catalog h1 { font-size: 28px; }
}

/* A single commissioned scene replaces the separate character arrangement. */
.home-hero:has(.hero-illustration) { min-height: 400px; }
.hero-scene.hero-scene-illustrated { inset: 0 0 0 43%; }
.hero-illustration { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; mask-image: linear-gradient(to right,transparent,#000 14%); -webkit-mask-image: linear-gradient(to right,transparent,#000 14%); }
@media (max-width: 820px) {
  .home-hero:has(.hero-illustration) { min-height: 560px; }
  .home-hero:has(.hero-illustration) .hero-copy { width: 100%; }
  .hero-scene.hero-scene-illustrated { inset: 220px 0 0; }
  .hero-illustration { object-position: 50% 30%; mask-image: linear-gradient(to bottom,transparent,#000 12%); -webkit-mask-image: linear-gradient(to bottom,transparent,#000 12%); }
}
@media (max-width: 540px) {
  .home-hero:has(.hero-illustration) { min-height: 520px; }
  .hero-scene.hero-scene-illustrated { inset: 240px 0 0; }
}

/* Nael's cheering corner: keep feet, speech and tap target together. */
.journey { display: flex; flex-direction: column; padding: 28px 28px 20px; }
.journey-friend { position: relative; inset: auto; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); align-items: center; justify-items: center; gap: 8px; width: 100%; max-width: 440px; min-height: 230px; flex: 1; padding-top: 18px; margin: auto auto 0; }
.journey-character { position: relative; display: block; width: min(100%,210px); height: 210px; padding: 0 4px 12px; background: transparent; border: 0; border-radius: 28px; color: #ac7c1d; -webkit-tap-highlight-color: transparent; }
.journey-character::before { content: ''; position: absolute; bottom: 4px; left: 18%; right: 18%; height: 13px; background: #9b86bc25; border-radius: 50%; }
.journey-character .journey-nael { position: relative; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transform-origin: 50% 88%; }
.journey-message { min-width: 0; width: 100%; padding-bottom: 10px; }
.journey-friend .speech { position: static; inset: auto; max-width: 100%; margin: 0; padding: 13px 15px; white-space: normal; word-break: keep-all; font-size: 16px; line-height: 1.6; transform: rotate(-4deg); }
.journey-tap-hint { margin: 14px 0 0; font-size: 11px; color: #6c5b86; text-align: center; }
.journey-spark { position: absolute; opacity: 0; pointer-events: none; }
.spark-one { top: 16px; left: 0; }.spark-two { right: 0; top: 52px; }
.journey-spark svg { width: 22px; height: 22px; fill: #ffe18a70; }
.is-welcoming .journey-nael { animation: nael-intro 1.2s ease-in-out 2; }
.is-cheering .journey-nael { animation: nael-cheer .85s ease-in-out; }
.is-welcoming .journey-spark { animation: nael-spark 1.2s ease-in-out 2; }
.is-cheering .journey-spark { animation: nael-spark .85s ease-in-out; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .journey-character:not(.is-welcoming):not(.is-cheering):hover .journey-nael { transform: translateY(-3px) rotate(-2deg); transition: transform .2s ease; }
}
@keyframes nael-intro {
  0%,100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-5px) rotate(-3deg); }
  65% { transform: translateY(-2px) rotate(3deg); }
}
@keyframes nael-cheer {
  0%,100% { transform: translateY(0) rotate(0) scale(1); }
  18% { transform: translateY(3px) scale(1.025,.97); }
  42% { transform: translateY(-15px) rotate(-5deg) scale(.98,1.025); }
  66% { transform: translateY(-7px) rotate(4deg); }
  83% { transform: translateY(2px) scale(1.02,.98); }
}
@keyframes nael-spark {
  0%,100% { opacity: 0; transform: scale(.65) rotate(-10deg); }
  35%,60% { opacity: 1; transform: scale(1.1) rotate(8deg); }
}
@media (max-width:1100px) {
  .journey { padding: 22px 22px 16px; }
  .journey-character { height: 185px; }
  .journey-friend .speech { font-size: 14px; padding: 12px; }
}
@media (max-width:820px) {
  .journey { padding: 24px; min-height: 0; }
  .journey-friend { max-width: 400px; min-height: 220px; margin-top: 10px; }
  .journey-character { height: 200px; }
  .journey-friend .speech { font-size: 16px; }
}
@media (max-width:540px) {
  .journey { padding: 20px 20px 16px; }
  .journey-friend { min-height: 210px; gap: 4px; padding-top: 12px; }
  .journey-character { height: 185px; }
  .journey-friend .speech { font-size: 14px; padding: 12px; }
}
@media (prefers-reduced-motion:reduce) {
  .journey-character .journey-nael { animation: none !important; transform: none !important; transition: none !important; }
  .journey-spark { animation: none !important; }
}

/* Reading aids share the mentor sidebar instead of occupying the book column. */
.mentor-reading { display: block; }
.mentor-reading > h2 { margin-bottom: 20px; }
.mentor-reading .phrase-guide-tools { position: static; display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.reading-tool + .reading-tool { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.reading-tool-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; margin-bottom: 6px; }
.reading-tool-heading h3 { margin: 0; font-size: 14px; font-weight: 700; }
.reading-tool-caption { color: var(--muted); font-size: 10px; white-space: nowrap; }
.mentor-reading #phrase-guide-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.mentor-reading #phrase-guide-toggle { min-height: 44px; min-width: 78px; padding: 5px 0 5px 8px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: transparent; border: 0; box-shadow: none; font-size: 11px; }
.mentor-reading #phrase-guide-state { margin: 0; font-weight: 400; }
.switch-track { position: relative; display: block; width: 36px; height: 22px; border-radius: 999px; background: #d7e4df; transition: background-color .18s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #173e4320; transition: transform .18s; }
.reading-switch[aria-pressed=true] .switch-track { background: var(--teal); }
.reading-switch[aria-pressed=true] .switch-track::after { transform: translateX(14px); }
.mentor-reading .pos-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); max-width: none; gap: 6px; margin-top: 5px; }
.mentor-reading .pos-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 5px; border: 1px solid #dde8e3; border-radius: 12px; background: white; font-size: 12px; box-shadow: none; }
.mentor-reading .pos-toggle .pos-state { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pos-marker { position: relative; width: 12px; height: 12px; border: 1px solid currentColor; border-radius: 50%; flex-shrink: 0; opacity: .5; }
.mentor-reading .pos-toggle[data-pos=verb] { color: var(--pos-verb); }
.mentor-reading .pos-toggle[data-pos=noun] { color: var(--pos-noun); }
.mentor-reading .pos-toggle[data-pos=adjective] { color: var(--pos-adjective); }
.mentor-reading .pos-toggle[aria-pressed=true] { border-color: currentColor; background: #f7f9fc; box-shadow: none; }
.pos-toggle[aria-pressed=true] .pos-marker { opacity: 1; background: currentColor; }
.pos-toggle[aria-pressed=true] .pos-marker::after { content: ''; position: absolute; width: 3px; height: 5px; left: 3px; top: 1px; border: solid white; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.mentor-reading .mentor-portrait { height: 150px; margin: 20px -12px 0; }
.mentor-reading .mentor-melo { width: 180px; top: 8px; left: auto; right: 0; }
.mentor-reading .mentor-portrait .speech { font-size: 12px; width: 135px; }
.mentor-reading .learner-note { display: none; }
.mentor-reading .mentor-note { padding: 14px; font-size: 12px; }
@media (max-width:820px) {
  .reading-layout > .mentor-reading { order: -1; padding: 20px; }
  .mentor-reading > h2 { margin-bottom: 14px; }
  .mentor-reading .phrase-guide-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .mentor-reading .reading-tool + .reading-tool { margin: 0; padding: 0 0 0 24px; border-top: 0; border-left: 1px solid var(--line); }
  .mentor-reading .mentor-portrait,.mentor-reading .mentor-note { display: none; }
}
@media (max-width:540px) {
  .reading-layout > .mentor-reading { padding: 18px; }
  .mentor-reading .phrase-guide-tools { grid-template-columns: 1fr; gap: 12px; }
  .mentor-reading .reading-tool + .reading-tool { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .mentor-reading #phrase-guide-note br { display: none; }
  .reading-tool-heading { margin-bottom: 3px; }
}

/* Short scene activities: optional, separate from the book's learning stages. */

.scene-hub-hero { display: flex; justify-content: space-between; gap: 24px; min-height: 270px; padding: 36px 40px; border-radius: 28px; background: linear-gradient(115deg,#e7f6ef,#f0ebff); overflow: hidden; }
.scene-hub-hero h1 { font-size: clamp(32px,3.5vw,48px); margin-bottom: 14px; }.scene-hub-hero .lead { font-size: 16px; }
.scene-badges { display: flex; gap: 8px; flex-wrap: wrap; }.scene-badges span { background: #ffffffb0; border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--teal-dark); }
.scene-hero-friend { display: flex; align-items: center; gap: 12px; flex: 0 0 340px; }.scene-hero-friend .character { width: 165px; height: 205px; }.scene-hero-friend .speech { margin: 0; transform: rotate(-4deg); font-size: 15px; }
.scene-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 18px; }.scene-section-heading h2 { margin: 0; }.scene-section-heading>span { font-size: 12px; color: var(--muted); }
.scene-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.scene-choice { border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: white; box-shadow: var(--shadow-card); display: flex; flex-direction: column; min-width: 0; }
.scene-choice-art { position: relative; min-height: 165px; display: flex; flex-direction: column; align-items: start; justify-content: space-between; padding: 22px; color: #1b6967; background: #e0f4ed; }.scene-choice-art>span { font-size: 10px; font-weight: 800; letter-spacing: .12em; }.scene-choice-art>.icon { position: absolute; right: 28px; top: 25px; width: 52px; height: 52px; opacity: .5; }.scene-choice-art strong { font: 850 26px/1.2 var(--font-heading); letter-spacing: -.02em; }.scene-art-2 { background: #eee7fb; color: #645099; }
.scene-choice-copy { display: flex; flex-direction: column; align-items: start; padding: 24px; flex: 1; }.scene-choice-copy .eyebrow { font-size: 10px; }.scene-choice-copy h2 { font-size: 21px; margin: 0 0 10px; }.scene-choice-copy>p { font-size: 14px; }.scene-choice-copy>.primary { margin-top: auto; font-size: 14px; }
.scene-book-tag { display: flex; gap: 7px; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 24px; }.scene-book-tag .icon { width: 17px; height: 17px; }
.scene-coming { padding: 30px 24px; justify-content: center; align-items: start; border-style: dashed; box-shadow: none; background: #ffffff90; }.scene-coming-icon { display: grid; place-items: center; background: #fff5d9; color: #987636; width: 65px; height: 65px; border-radius: 20px; margin-bottom: 24px; }.scene-coming-icon svg { width: 34px; height: 34px; }.scene-coming h2 { font-size: 21px; }.scene-coming>p { font-size: 14px; }.scene-preparing { font-size: 12px; padding: 7px 12px; border-radius: 999px; background: #edf1f0; color: var(--muted); }
.scene-hub-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; }.scene-hub-footer p { color: var(--muted); font-size: 13px; margin: 0; }
.scene-breadcrumb { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }.scene-breadcrumb .secondary { background: transparent; border: 0; padding-left: 0; color: var(--teal-dark); font-size: 13px; }.scene-breadcrumb>span { font-size: 11px; color: var(--muted); }
.scene-activity-heading { margin-bottom: 28px; }.scene-activity-heading h1 { font-size: clamp(28px,3vw,40px); margin-bottom: 10px; }.scene-activity-heading>p:last-child { color: var(--muted); font-size: 16px; }
.scene-activity-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; align-items: start; }.scene-workspace { min-width: 0; }.scene-step { padding: 28px; background: white; border: 1px solid var(--line); border-radius: 24px; margin-bottom: 20px; box-shadow: var(--shadow-card); }.scene-step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }.scene-step-title>span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--soft); color: var(--teal-dark); font: 800 12px/1 var(--font-ui); }.scene-step-title>h2 { margin: 0; font-size: 20px; }.scene-step>.select-field { max-width: 300px; margin-bottom: 22px; }.scene-step .secondary { font-size: 13px; }
.scene-dialogue-label { margin: 22px 0 10px; font-size: 11px; color: var(--muted); }.scene-quote { margin: 0 0 20px; padding: 24px; border-radius: 20px 20px 20px 5px; background: #f2f8f4; font: 500 23px/1.8 var(--font-reading); color: var(--ink); overflow-wrap: anywhere; }.scene-step textarea { margin-bottom: 14px; }.scene-step .label { font-size: 16px; margin-top: 0; }.scene-notice { padding: 12px 14px; border-radius: 12px; color: var(--teal-dark); background: var(--soft); font-size: 13px; margin: 16px 0 0; }.scene-step .support { margin-bottom: 0; font-size: 15px; }
.scene-mode-options { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }.scene-mode-options button { flex: 0 1 auto; min-width: 0; border-radius: 16px; font-size: 14px; min-height: 58px; }.scene-mode-options button .icon { width: 20px; }.scene-practice { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 22px; }.scene-practice h3 { font-size: 17px; }.scene-practice>p { font-size: 15px; }.scene-frame { padding: 18px; border-radius: 16px; background: #f6f2ff; margin: 20px 0; }.scene-frame>span { color: var(--lilac-ink); font-size: 11px; }.scene-frame>p[lang=en] { font-family: var(--font-reading); font-size: 23px; margin: 8px 0; }.scene-frame>.quiet[lang=en] { font-size: 14px; }
.scene-connection { position: sticky; top: 24px; background: #f7f4ff; border: 1px solid #e2d9f2; border-radius: 24px; padding: 24px; }.scene-connection>h2 { display: flex; gap: 8px; align-items: center; font-size: 17px; }.scene-target { font: 850 27px/1.25 var(--font-reading); color: var(--lilac-ink); margin: 20px 0 14px; overflow-wrap: anywhere; }.scene-connection>p:not(.scene-target) { font-size: 13px; }.scene-book-form { display: inline-block; padding: 5px 10px; background: white; border-radius: 8px; font: 700 15px/1.5 var(--font-reading); margin-bottom: 10px; }.scene-connection>.secondary { font-size: 13px; background: white; }.scene-melo { margin-top: 22px; }.scene-melo .character { width: 170px; height: 180px; object-fit: cover; object-position: top; margin: auto; }.scene-melo p { position: relative; font-size: 12px; background: white; border-radius: 14px; padding: 14px; margin: 0; }
.scene-end-actions { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin-top: 22px; }.scene-source { color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 30px; }.scene-source p { margin-bottom: 8px; }.scene-wrapup { text-align: center; max-width: 760px; margin: 30px auto; padding: 44px; background: white; border: 1px solid var(--line); border-radius: 28px; }.scene-wrapup>.icon { width: 48px; height: 48px; color: #ac801c; fill: var(--lemon); margin: 10px 0 22px; }.scene-wrapup h1 { font-size: 31px; }.scene-wrapup .lead[lang=en] { font: 800 30px/1.4 var(--font-reading); color: var(--teal); }.scene-wrapup-note { padding: 22px; border-radius: 18px; background: #f4f0ff; margin: 24px 0; }.scene-wrapup-note>p { margin: 8px 0 0; }.scene-wrapup .actions { justify-content: center; }
@media(max-width:1100px) { .scene-choice-grid { gap: 16px; }.scene-choice-copy { padding: 20px; }.scene-choice-copy h2 { font-size: 19px; }.scene-choice-art { padding: 20px; min-height: 145px; }.scene-choice-art strong { font-size: 24px; }.scene-activity-grid { grid-template-columns: minmax(0,1fr) 250px; gap: 20px; }.scene-connection { padding: 20px; }.scene-step { padding: 24px; }.scene-hero-friend { flex-basis: 280px; gap: 0; }.scene-hero-friend .character { width: 140px; }.scene-hero-friend .speech { font-size: 13px; padding: 12px; } }
@media(max-width:820px) { .scene-hub-hero { padding: 28px; }.scene-hero-friend { flex-basis: 190px; flex-direction: column; }.scene-hero-friend .character { width: 120px; height: 150px; }.scene-hub-hero h1 { font-size: 34px; }.scene-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.scene-coming { grid-column: 1/-1; display: block; padding: 24px; }.scene-coming-icon { float: left; margin: 0 22px 20px 0; }.scene-coming h2 { margin-top: 0; }.scene-activity-grid { grid-template-columns: minmax(0,1fr); }.scene-connection { position: static; }.scene-melo { display: none; }.scene-hub-footer { flex-direction: column; align-items: start; } }
@media(max-width:540px) { .site-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }.site-nav button { font-size: 12px; padding: 8px 4px; white-space: normal; line-height: 1.4; }.scene-hub-hero { padding: 24px 22px; min-height: 0; }.scene-hub-hero h1 { font-size: 30px; }.scene-hub-hero .lead { font-size: 14px; }.scene-hero-friend { display: none; }.scene-badges { gap: 6px; }.scene-badges span { font-size: 11px; padding: 5px 9px; }.scene-section-heading { align-items: start; flex-direction: column; gap: 5px; }.scene-section-heading h2 { font-size: 20px; }.scene-choice-grid { grid-template-columns: minmax(0,1fr); }.scene-choice-art { min-height: 135px; }.scene-choice-copy { padding: 22px; }.scene-coming { grid-column: auto; }.scene-coming-icon { float: none; margin: 0 0 18px; }.scene-breadcrumb { gap: 8px; }.scene-breadcrumb>span { font-size: 10px; }.scene-activity-heading h1 { font-size: 28px; }.scene-step { padding: 22px 18px; }.scene-step-title>h2 { font-size: 18px; }.scene-quote { padding: 20px; font-size: 21px; }.scene-wrapup { padding: 28px 22px; margin: 16px auto; }.scene-wrapup h1 { font-size: 27px; } }
.scene-hero-friend .speech { word-break: keep-all; }

/* Generated scene artwork and complete, speaker-labelled dialogue. */
.scene-illustration { margin: 0 0 24px; }
.scene-illustration > img { display: block; width: 100%; height: auto; aspect-ratio: 3/2; object-fit: cover; object-position: 50% 0; border-radius: 18px; background: #edf6f1; }
.scene-illustration > figcaption { color: var(--muted); font-size: 11px; margin-top: 8px; }
.scene-choice-art.has-scene-image { min-height: 210px; overflow: hidden; color: white; }
.has-scene-image > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.has-scene-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#122e3a38,transparent 35%,#122e3ab0); }
.has-scene-image > span,.has-scene-image > strong { position: relative; z-index: 1; text-shadow: 0 1px 4px #122e3a60; }
.scene-dialogue-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 24px 0 16px; font-size: 11px; color: var(--muted); }
.scene-dialogue-heading > a { min-height: 36px; display: inline-flex; align-items: center; text-decoration: none; font-size: 12px; font-weight: 700; }
.scene-dialogue { border-top: 1px solid var(--line); padding: 16px 0 8px; margin-bottom: 18px; }
.scene-direction { color: #6c7b80; background: #f5f8f6; border-radius: 10px; padding: 12px 16px; margin: 14px 0 20px; font: italic 13px/1.7 var(--font-reading); }
.scene-dialogue-row { padding: 16px 20px; background: #f3f8f5; border-radius: 16px; margin: 14px 0; border: 1px solid transparent; }
.scene-speaker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--teal-dark); font-weight: 800; margin-bottom: 8px; }
.scene-dialogue-row > p { font: 400 21px/1.8 var(--font-reading); margin: 0; overflow-wrap: anywhere; }
.actor-mitsuri { background: #fff4f0; }.actor-mitsuri .scene-speaker { color: #9c5268; }.actor-urokodaki { background: #f4f0fb; }.actor-urokodaki .scene-speaker { color: var(--lilac-ink); }
.scene-dialogue-row.is-target-line { background: #fff9df; border: 1px solid #e1c879; border-left: 4px solid #b38b27; padding-left: 17px; scroll-margin-top: 32px; }
.scene-focus-tag { padding: 3px 8px; border-radius: 999px; background: #ffe79c; color: #745313; font-size: 10px; }
.is-target-line mark { background: #ffe18a; color: inherit; border-radius: 4px; padding: .04em .18em; font-weight: 800; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
@media(max-width:540px) {
  .scene-choice-art.has-scene-image { min-height: 190px; }
  .scene-illustration > img { aspect-ratio: 3/2; border-radius: 14px; }
  .scene-direction { padding: 12px; font-size: 12px; }
  .scene-dialogue-row { padding: 14px 16px; }.scene-dialogue-row > p { font-size: 20px; }
  .scene-dialogue-row.is-target-line { padding-left: 13px; }
}

/* Password-protected hosted preview. */
.access-page { min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(at 15% 15%,#e0f6ed,transparent 55%),var(--mint); }
.access-card { width: 100%; max-width: 470px; padding: 36px; background: white; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-card); }
.access-card>.brand { margin-bottom: 32px; }.access-card h1 { font-size: 29px; }.access-card input[type=password] { display: block; width: 100%; min-height: 48px; border: 1px solid #aaccc1; border-radius: 12px; padding: 10px 14px; color: var(--ink); background: #f7fbf9; margin-bottom: 20px; }.access-card .primary { width: auto; }.access-error { color: #98394d; padding: 12px 16px; border-radius: 12px; background: #fff0f1; font-size: 14px; }
.hosted-session-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }.hosted-session-bar form { margin: 0; }.hosted-session-bar .text-link { font-size: 12px; min-height: 40px; }

.scene-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }

.steps li.bonus-step:not(.active) { background: #fff0c4; color: #735414; }
@media(max-width:540px) { .scene-choice-grid { grid-template-columns: 1fr; } }

/* 원본 그림책의 각 문단과 삽화를 같은 묶음으로 읽는다. */
.storybook-page { display: grid; grid-template-columns: minmax(180px,.85fr) minmax(0,1.3fr); gap: 28px; align-items: start; padding: 32px 0; border-bottom: 1px solid var(--line); }
.storybook-page:first-of-type { padding-top: 0; }.storybook-page:last-child { border-bottom: 0; padding-bottom: 0; }
.reading-grid .storybook-page figure { margin: 0; min-width: 0; }.reading-grid .storybook-page figure img { width: 100%; height: auto; max-height: 360px; object-fit: contain; }
.storybook-page-text { min-width: 0; }.storybook-page-text .reading-block:last-child { margin-bottom: 0; }
@media(max-width:1100px) { .storybook-page { grid-template-columns: 1fr; gap: 24px; }.reading-grid .storybook-page figure { width: 100%; max-width: 420px; margin-inline: auto; } }
@media(max-width:540px) { .storybook-page { padding-block: 24px; gap: 20px; }.reading-grid .storybook-page figure img { max-height: 320px; } }

/* 현재 챕터에 관한 멜로 AI 읽기 도움 */
body.chat-open { overflow: hidden; }
#reading-text .book-paragraph,#reading-text .word-link { user-select: text; -webkit-user-select: text; }
.selection-chat { position: fixed; z-index: 50; display: inline-flex; align-items: center; justify-content: center; gap: 7px; max-width: calc(100vw - 16px); min-height: 42px; padding: 10px 16px; border: 1px solid #006d68; border-radius: 24px; background: var(--teal); color: white; font-size: 13px; font-weight: 700; line-height: 1.4; box-shadow: 0 5px 20px #173e4330; white-space: nowrap; touch-action: manipulation; }
.selection-chat .icon { width: 18px; height: 18px; }
.selection-chat:hover:not(:disabled) { background: var(--teal-dark); }
.selection-chat:disabled { color: #526e62; background: #ecf3ef; border-color: #cbded3; opacity: 1; }
.melo-chat-open { width: fit-content; margin: 12px 0; display: inline-grid; grid-template-columns: 24px auto; align-items: center; justify-content: start; gap: 2px 8px; padding: 10px 16px; text-align: left; }
.melo-chat-open span { grid-column: 2; font-size: 11px; font-weight: 400; opacity: .9; }
.melo-chat { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: min(850px, calc(100dvh - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: #fbfefc; box-shadow: 0 20px 90px #173e4333; overflow: auto; }
.melo-chat[open] { display: flex; flex-direction: column; }
.melo-chat::backdrop { background: #143b4166; backdrop-filter: blur(4px); }
.melo-chat button:focus-visible,.melo-chat summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 20px 24px 12px; flex-shrink: 0; }
.chat-header h2 { font-size: 22px; margin: 2px 0; }
.chat-header .eyebrow { font-size: 10px; margin: 0; }
.chat-header > div:nth-child(2) { flex: 1; min-width: 0; }
.chat-header .gloss-close { margin-left: 0; flex-shrink: 0; }
.chat-header .chat-reset { display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); flex-shrink: 0; box-shadow: none; }
.chat-header .chat-reset:hover { background: #eef3f0; color: var(--ink); }
.chat-header .chat-reset .icon { width: 18px; height: 18px; }
.chat-avatar { width: 48px; height: 48px; border-radius: 50%; background: #e4f4ed; overflow: hidden; flex-shrink: 0; }
.chat-avatar .character { width: 62px; max-width: none; height: auto; transform: translate(-5px,-5px); }
.chat-chapter { display: flex; align-items: center; gap: 8px; padding: 10px 24px; background: #edf7f1; border-block: 1px solid var(--line); font-size: 13px; flex-shrink: 0; }
.chat-chapter .icon { width: 17px; height: 17px; }
.chat-messages { overflow-y: auto; overscroll-behavior: contain; min-height: 170px; flex: 1 1 auto; padding: 22px 24px 8px; }
.chat-message { border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 14px 18px; background: white; margin-bottom: 18px; max-width: 94%; overflow-wrap: anywhere; }
.chat-message p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.85; font-size: 15px; }
.chat-speaker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--teal); }
.chat-message-avatar { display: block; width: 34px; height: 34px; flex: 0 0 34px; overflow: hidden; border-radius: 50%; background: #e4f4ed; }
.chat-message-avatar .character { display: block; width: 45px; max-width: none; height: auto; transform: translate(-5px,-3px); }
.chat-reader .chat-message-avatar { background: #f5efff; }
.chat-reader { background: #e5f3ed; border-radius: 18px 18px 4px 18px; margin-left: auto; max-width: 85%; }
.chat-message blockquote { margin: 14px 0 4px; border-left: 3px solid #abd5c3; padding: 6px 12px; font: 16px/1.7 var(--font-reading); background: #f3f9f5; }
.chat-message small { color: var(--muted); font-size: 10px; }
.chat-bottom { padding: 12px 24px 16px; flex-shrink: 0; background: #fbfefc; }
.chat-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.chat-suggestions button { min-height: 34px; padding: 6px 12px; border: 1px solid #e1e8e4; background: white; color: #5b7470; font-size: 12px; border-radius: 18px; box-shadow: none; }
.chat-suggestions button:hover { background: #f0f6f2; border-color: #bed5c9; }
.chat-selection-label { margin: 0 0 4px; font-size: 10px; color: var(--muted); }
.chat-selected-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; margin: 0 0 9px; padding-left: 10px; border-left: 2px solid #abd5c3; font-size: 13px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.chat-selection-actions .chat-suggestions button[aria-pressed=true] { background: #e4f3ec; border-color: #95c4b2; color: var(--teal-dark); }
.chat-status { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.chat-status:empty { display: none; }
.chat-composer { margin: 0; }
.chat-input-box { display: flex; align-items: flex-end; gap: 10px; min-height: 58px; padding: 10px 10px 10px 16px; border: 1px solid #dce5e0; border-radius: 22px; background: #f3f6f4; transition: border-color .15s, box-shadow .15s; }
.chat-input-box:focus-within { border-color: #7eb8a7; box-shadow: 0 0 0 2px #00837e12; }
.chat-composer textarea { display: block; flex: 1; width: 100%; min-width: 0; min-height: 26px; max-height: 136px; resize: none; padding: 5px 0; margin: 0; border: 0; border-radius: 0; outline: none; background: transparent; box-shadow: none; color: var(--ink); font-size: 16px; line-height: 26px; overflow-y: auto; }
.chat-composer textarea:focus-visible { outline: none; box-shadow: none; }
.chat-composer textarea::placeholder { color: #82918b; }
.chat-composer button { display: grid; place-items: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 8px; margin: 0; border: 0; border-radius: 50%; color: white; background: var(--teal); box-shadow: none; }
.chat-composer button .icon { width: 20px; height: 20px; }
.chat-composer button:hover:not(:disabled) { background: var(--teal-dark); }
.chat-composer button:disabled { background: #e0e7e3; color: #9aa8a0; opacity: 1; }
.chat-composer button.is-stopping { background: #173e43; }
.chat-loading-content { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 16px; }
.chat-loading-spinner { display: block; flex: 0 0 20px; width: 20px; height: 20px; margin-top: 3px; border: 2px solid #d5e9e0; border-top-color: var(--teal); border-radius: 50%; animation: chat-loading-spin .85s linear infinite; }
.chat-loading .chat-loading-title { margin: 0; font-size: 14px; font-weight: 700; }
.chat-loading .chat-loading-detail { margin: 4px 0 0; font-size: 12px; line-height: 1.75; color: var(--muted); }
.chat-loading-steps { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }
.chat-loading-steps li { flex: 1; padding: 6px 0; border-top: 2px solid #e6eeea; font-size: 10px; color: #8a9b92; white-space: nowrap; }
.chat-loading-steps li.is-active { color: var(--teal-dark); border-color: var(--teal); font-weight: 700; }
.chat-loading-steps li.is-done { color: #5f8875; border-color: #a2ceba; }
.chat-message.chat-error { background: #faf8f4; border-color: #e7dfd3; }
.chat-error p { font-size: 13px; color: #74654f; }
@keyframes chat-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chat-loading-spinner { animation: none; } }
.chat-footer-note { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; font-size: 10px; color: #7a8c84; line-height: 1.6; }
.chat-footer-note > p { margin: 0; }
.chat-info { margin: 0; }
.chat-info summary { min-height: 24px; color: #647e73; font-size: 10px; list-style: none; text-decoration: underline; text-underline-offset: 2px; }
.chat-info summary::-webkit-details-marker { display: none; }
.chat-info[open] { flex-basis: 100%; padding: 8px 12px; border-radius: 12px; background: #eff5f1; }
.chat-info p { margin: 4px 0 0; font-size: 11px; line-height: 1.7; }
.chat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 720px) { .mentor-reading .melo-chat-open { margin-bottom: 0; } }
@media (max-width: 480px) {
  .melo-chat { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  .chat-header { padding: 16px 16px 10px; }.chat-header h2 { font-size: 20px; }
  .chat-chapter { padding: 10px 16px; }.chat-messages { padding: 16px 12px 0; }
  .chat-bottom { padding: 12px 16px; }.chat-header { gap: 8px; }.chat-header h2 { font-size: 18px; }.chat-header .chat-avatar { width: 40px; height: 40px; }
  .chat-message { max-width: 98%; padding: 12px 14px; }.chat-message p { font-size: 14px; }
  .chat-footer-note { font-size: 9px; gap: 4px; }.chat-input-box { padding-left: 14px; }
}
