/* Readable explanations and examples revealed one step at a time. */
.book-lesson-layout { grid-template-columns: 210px minmax(0, 1fr); align-items: start; }
.book-lesson-layout > .lesson-outline { display: block; }
.book-rich-lesson { padding: clamp(20px, 3vw, 38px); }
.book-rich-lesson h2 { scroll-margin-top: 24px; }
.book-rich-lesson h3 { font-size: 20px; line-height: 1.4; }
.book-rich-lesson .lesson-text { color: #514a60; line-height: 1.8; max-width: 70ch; }
.lesson-story p + p { margin-top: 14px; }
.lesson-goal { display: flex; gap: 12px; padding: 16px 18px; margin: 0 0 24px; border-radius: 12px; background: #f4f1fa; font-size: 15px; color: #5f5278; line-height: 1.65; }
.lesson-goal .icon { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; }
.lesson-outline .lesson-bookmark-note { font-size: 13px; line-height: 1.7; color: #756d80; margin-top: 16px; }
.desktop-lesson-plan h2 { margin: 8px 0 0; }
.book-lesson-layout .lesson-outline button { color: #685d76; font-size: 14px; line-height: 1.45; }
.mobile-lesson-picker { display: none; }
.teaching-figure { margin: 0; padding: 22px; background: #faf8fd; border: 1px solid #e7e0f0; border-radius: 16px; min-width: 0; }
.teaching-figure figcaption { font-size: 14px; color: #6a5f77; line-height: 1.6; margin-top: 18px; text-align: center; }
.teaching-figure .book-data-table th, .teaching-figure .book-data-table td { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; min-width: 70px; }
.teaching-figure .book-data-table th[scope=row] { background: #f7f4fb; font-weight: 600; }
.teaching-bar-row + .teaching-bar-row { margin-top: 18px; }
.teaching-bar-row > strong { display: block; font-size: 14px; margin-bottom: 7px; color: #635471; }
.teaching-bar-track { width: 100%; }
.teaching-bar { display: flex; min-height: 52px; }
.teaching-bar > span { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 3px; min-width: 0; background: #ded5f1; border: 1px solid #b5a4d2; font-size: 15px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.teaching-bar > span:first-child { border-radius: 9px 0 0 9px; }
.teaching-bar > span:last-child { border-radius: 0 9px 9px 0; }
.teaching-bar > span:only-child { border-radius: 9px; }
.teaching-bar > span.green { background: #d5e8da; border-color: #92b99e; }
.teaching-groups, .teaching-layers { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 14px; }
.teaching-groups > div { padding: 12px; border: 1px solid #b9a8d8; background: #eee7f8; border-radius: 12px; }
.teaching-groups > div.loose { background: #fbefd9; border-color: #d8b76e; }
.teaching-array { display: grid; grid-template-columns: repeat(var(--columns), 18px); justify-content: center; gap: 6px; }
.teaching-array i { display: block; width: 18px; height: 18px; border-radius: 4px; background: #8b73b5; }
.teaching-groups .teaching-array { grid-template-columns: repeat(3, 14px); }
.teaching-groups .teaching-array i { width: 14px; height: 14px; border-radius: 50%; }
.teaching-groups .loose i { background: #b78a34; }
.teaching-groups span, .teaching-layers span, .teaching-array-wrap > span { display: block; text-align: center; font-size: 13px; color: #6b5d7d; margin-top: 10px; }
.teaching-layers > div { padding: 12px; border: 1px solid #b9a8d8; border-radius: 10px; background: #ede6f7; }
.teaching-jumps { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.teaching-jumps > strong { background: #e8dff5; border-radius: 10px; padding: 12px; font-size: 20px; min-width: 44px; text-align: center; }
.teaching-jump-change { display: flex; flex-direction: column; align-items: center; font-size: 14px; color: #796194; font-weight: 750; }
.teaching-jump-change b { font-size: 22px; }
.teaching-strips > div + div { margin-top: 20px; }
.teaching-strips strong { display: block; margin-bottom: 8px; font-size: 14px; }
.teaching-strip { display: flex; width: 100%; height: 38px; border-left: 1px solid #a18ac0; }
.teaching-strip i { flex: 1; background: #e5dcf3; border: 1px solid #a18ac0; border-left: 0; }
.worked-example { margin: 0 0 24px; padding: 22px; background: #fff; border: 1px solid #dcd1ea; border-radius: 16px; }
.worked-heading { display: flex; gap: 13px; align-items: flex-start; }
.worked-heading > span { display: grid; place-items: center; padding: 9px; border-radius: 11px; color: #705792; background: #f0eafa; }
.worked-heading p { font-size: 14px; line-height: 1.65; color: #746880; margin: 7px 0 18px; }
.worked-steps { list-style: none; padding: 0; margin: 0; }
.worked-steps li { display: flex; gap: 12px; padding: 20px 0; border-top: 1px solid #eee8f2; scroll-margin-top: 24px; }
.worked-steps li > div { min-width: 0; flex: 1; }
.worked-number { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: #eee7f8; color: #6c4f8b; font-weight: 800; font-size: 14px; }
.worked-steps h4 { font-size: 16px; line-height: 1.5; }
.worked-steps p { font-size: 16px; color: #5b5067; line-height: 1.7; }
.worked-steps .worked-calculation { font-size: 21px; font-weight: 800; line-height: 1.55; color: #695083; margin: 9px 0; overflow-wrap: anywhere; }
.worked-example > .button { white-space: normal; text-align: left; min-height: 48px; }
.worked-count { font-size: 12px; margin-left: 4px; }
.worked-done { display: flex; gap: 9px; color: #417452; font-size: 14px; margin: 8px 0; line-height: 1.6; }
.worked-done .icon { flex-shrink: 0; }
.teaching-takeaway > div { min-width: 0; }
.teaching-takeaway strong { display: block; margin-bottom: 6px; font-size: 14px; color: #756333; }
.teaching-takeaway p { line-height: 1.75; font-size: 16px; }
.probe-hint { margin-top: 18px; color: #665476; }
.probe-hint summary { cursor: pointer; padding: 10px 0; min-height: 44px; font-weight: 650; font-size: 15px; }
.probe-hint summary .icon { vertical-align: middle; width: 18px; height: 18px; margin-right: 4px; }
.probe-hint p { padding: 14px; background: #f0eaf6; border-radius: 10px; font-size: 16px; line-height: 1.7; }
.book-probe > p, .book-probe fieldset label, .probe-feedback p { font-size: 16px; line-height: 1.7; }
.book-probe fieldset input { flex-shrink: 0; }
.lesson-words { border-top: 1px solid #e8e1ee; border-bottom: 1px solid #e8e1ee; padding: 6px 0; margin: 24px 0; }
.lesson-words summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.lesson-words dt { font-weight: 750; margin: 16px 0 6px; }
.lesson-words dd { margin: 0 0 16px; line-height: 1.75; color: #65576f; }
.lesson-recap { padding: 22px; background: #f0f7f1; border: 1px solid #d2e4d6; border-radius: 16px; margin: 24px 0; }
.lesson-recap ul { padding-left: 22px; margin: 16px 0 24px; }
.lesson-recap li { margin: 10px 0; line-height: 1.7; }
.lesson-recap p { margin-top: 12px; line-height: 1.75; }
.book-rich-lesson .lesson-controls { margin-top: 28px; flex-wrap: wrap; }
.app-version { white-space: nowrap; }
@media (max-width: 1000px) {
  .book-lesson-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .book-lesson-layout > .lesson-outline { padding: 16px; border: 1px solid #e5deed; border-radius: 14px; background: #fff; }
  .desktop-lesson-plan { display: none; }
  .mobile-lesson-picker { display: block; color: #685775; font-size: 13px; font-weight: 700; }
  .mobile-lesson-picker select { display: block; width: 100%; max-width: 100%; padding: 12px; margin-top: 8px; border: 1px solid #cfc1df; background: #f8f5fb; border-radius: 10px; color: #5b436e; font: inherit; font-size: 15px; min-height: 48px; text-overflow: ellipsis; }
  .book-lesson-layout .book-page-reference { margin-top: 12px; }
  .lesson-outline .lesson-bookmark-note { margin-top: 6px; }
}
@media (max-width: 600px) {
  .book-rich-lesson { padding: 20px 16px; }
  .book-rich-lesson h2 { font-size: 25px; }
  .book-rich-lesson h3 { font-size: 19px; }
  .lesson-goal { padding: 13px; font-size: 14px; }
  .teaching-figure { padding: 14px 10px; }
  .teaching-bar > span { font-size: 13px; }
  .worked-example { padding: 16px 12px; }
  .worked-heading { gap: 9px; }
  .worked-heading > span { padding: 6px; }
  .worked-steps li { gap: 8px; }
  .worked-steps .worked-calculation { font-size: 19px; }
  .worked-example > .button { width: 100%; justify-content: center; padding: 13px 10px; }
  .worked-count { white-space: nowrap; }
  .lesson-recap { padding: 18px; }
  .teaching-array { grid-template-columns: repeat(var(--columns), 15px); gap: 5px; }
  .teaching-array i { width: 15px; height: 15px; }
}

/* Cyfry zajmują równe kolumny także na ekranie telefonu. */
.written-sum { width: max-content; max-width: 100%; margin: 0 auto; font: 650 clamp(18px, 4vw, 26px)/1.7 ui-monospace, monospace; }
.written-row { display: grid; grid-template-columns: repeat(var(--written-columns), 1.35em); text-align: center; }
.written-row span { border-right: 1px solid #e4dbef; }
.written-rule { border-top: 2px solid #806796; }
.written-division { width: max-content; max-width: 100%; margin: 0 auto; font: 650 clamp(18px, 4vw, 26px)/1.5 ui-monospace, monospace; white-space: pre; color: #584080; }
.written-lattice { width: max-content; margin: 0 auto; }
.lattice-row { display: flex; }
.lattice-row > b, .lattice-cell { width: 64px; height: 64px; }
.lattice-row > b { display: grid; place-items: center; font-size: 23px; }
.lattice-cell { position: relative; border: 1px solid #a390c7; background: linear-gradient(135deg, transparent 49%, #a390c7 50%, transparent 51%); font: 650 23px ui-monospace, monospace; }
.lattice-cell i { position: absolute; left: 9px; top: 5px; font-style: normal; }
.lattice-cell em { position: absolute; right: 9px; bottom: 5px; font-style: normal; }
.fractions-visual { display: block; width: 100%; max-width: 540px; height: auto; margin: 0 auto; color: #514369; font-family: inherit; font-size: 20px; }
.fractions-question { max-width: 540px; margin: 1rem auto; }
.decimals-visual { display: block; width: 100%; max-width: 540px; height: auto; margin: 0 auto; font-family: inherit; font-size: 20px; color: #594674; }
.decimal-grid { max-width: 260px; }
.decimals-visual text { font-size: 20px; font-family: inherit; }
.decimals-question { max-width: 540px; margin: 1rem auto; }
.decimal-places { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; }
.decimal-places > div { display: grid; justify-items: center; gap: .45rem; padding: .7rem; border: 1px solid #dfd4ec; border-radius: 12px; background: #fcfaff; min-width: 66px; }
.decimal-places span { font-size: .78rem; }
.decimal-places strong, .decimal-places > b { font-size: 1.6rem; color: #655080; }
.decimal-calculation { width: max-content; max-width: 100%; margin: 0 auto; font: 600 clamp(1.2rem, 4vw, 1.8rem)/1.55 monospace; color: #655080; white-space: pre; }
.answer-inputs label:has(input[inputmode="decimal"]) { max-width: 100%; min-width: 0; }
.answer-inputs input[inputmode="decimal"] { width: 240px; max-width: 100%; font-size: clamp(20px, 4vw, 30px); }
.area-visual { display: block; width: 100%; max-width: 500px; height: auto; margin: 0 auto; color: #446c7c; }
.area-visual text { font-family: inherit; font-size: 18px; fill: #405c68; }
.area-question { max-width: 500px; margin: 1rem auto; }
.solids-visual { display: block; width: 100%; max-width: 540px; height: auto; margin: 0 auto; }
.solids-visual text { font-family: inherit; font-size: 18px; fill: #405c68; }
.solids-question { max-width: 540px; margin: 1rem auto; }
.solids-rotation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.solids-rotation > div { min-width: 0; padding: 8px; border: 1px solid #d2dce6; border-radius: 12px; text-align: center; }
.solids-rotation > div:first-child { grid-column: 1 / -1; width: 60%; justify-self: center; }
