:root {
  --green: #1E9E6A; --forest: #0F3D2E; --coral: #FF6B5A; --sun: #FFC233; --sky: #3FA7F5; --cream: #FFF8EC; --ink: #1F2A33;
  --coral-deep: #C0392B; --green-deep: #147A52; --mint: #E8F5F0; --line: #DCE7E0; --gc: #FFC233;
}
.g0 { --gc: #FF6B5A; } .g1 { --gc: #FFC233; } .g2 { --gc: #FF9A3C; } .g3 { --gc: #1E9E6A; } .g4 { --gc: #3FA7F5; } .g5 { --gc: #8B6FE8; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Lexend, system-ui, sans-serif; color: var(--ink); background: var(--cream); font-size: 17px; line-height: 1.4; }
svg { display: block; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: #fff; border-bottom: 1.5px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: Fredoka; font-weight: 600; font-size: 20px; color: var(--forest); }
.brand .logo { width: 34px; height: 34px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; color: #566F62; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a { text-decoration: none; } .crumbs a:hover { text-decoration: underline; }
.crumbs b { color: var(--forest); font-weight: 600; }
.stars { display: flex; align-items: center; gap: 6px; background: #FFF3D1; border: 2px solid var(--sun); border-radius: 999px; padding: 4px 12px 4px 6px; font-family: Fredoka; font-weight: 600; font-size: 18px; color: var(--forest); }
.stars .ico { width: 26px; height: 26px; }
.stars.pop { animation: pop .4s ease; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.foot { display: flex; justify-content: space-between; max-width: 1000px; margin: 0 auto; padding: 0 16px 28px; font-size: 13px; color: #566F62; }
.tlink { color: #566F62; }

/* ---------- headers */
.hdr { display: flex; align-items: center; gap: 16px; background: var(--mint); border-radius: 22px; padding: 16px 20px; position: relative; }
.badge { flex: none; width: 74px; height: 72px; border-radius: 16px; background: #157A52; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: Fredoka; font-weight: 600; font-size: 32px; line-height: 1; }
.badge small { font-size: 12px; font-weight: 500; margin-bottom: 3px; }
.ht h1 { margin: 0; font-family: Fredoka; font-weight: 600; font-size: 34px; line-height: 1.05; color: var(--forest); }
.goal { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 18px; margin-top: 4px; }
.smini { width: 24px; height: 28px; flex: none; }
.std { position: absolute; right: 18px; top: 12px; font-size: 12px; color: #4F6E62; }
@media (min-width: 761px) { .ht h1 { padding-right: 120px; } } /* a long title never runs under the standards in the corner */
.part { font-family: Fredoka; font-weight: 600; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--green-deep); margin: 8px 4px -4px; }

/* ---------- sections */
.sec { border-radius: 20px; padding: 14px 18px 16px; background: #fff; }
.sec h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: Fredoka; font-weight: 600; font-size: 21px; color: var(--forest); line-height: 1.1; flex-wrap: wrap; }
.sec h2 .ico { width: 30px; height: 30px; flex: none; }
.sec h2 em { font-family: Lexend; font-style: normal; font-weight: 400; font-size: 16px; color: var(--ink); }
.warm { background: #FFF9EB; border: 2px solid var(--sun); }
.learn { background: #F1FAF6; border: 2px solid var(--green); }
.watch { background: #fff; border: 2.5px dashed var(--green); }
.tog { background: #ECF6FE; }
.prac { background: #fff; border: 1.5px solid #CFDDD5; }
.chal { background: #FFF0CC; border: 2px solid var(--sun); }
.exit { background: #fff; border: 2.5px solid var(--coral); }
.home { background: #ECF6FE; } .home p { font-size: 16px; }
.howgo { background: #F2F8F4; }
.tnotes { background: #FDECEA; border: 1.5px dashed var(--coral-deep); }
.tnotes p { font-size: 15px; margin-bottom: 6px; }

/* ---------- maths */
.eq { font-weight: 500; font-size: 28px; line-height: 1.3; white-space: nowrap; }
.eq.big { font-size: 34px; text-align: center; margin-top: 6px; }
.eq .gap { display: inline-block; width: 1.2em; }
.eq.multi { display: flex; flex-wrap: wrap; column-gap: 28px; row-gap: 6px; white-space: normal; }
.eq.multi .seg { white-space: nowrap; }
.qt { font-size: 17px; line-height: 1.35; }
.bx { display: inline-block; vertical-align: middle; width: calc(26px + var(--w, 1) * 16px); min-width: 52px; height: 52px; margin: 0 3px; border: 2.5px solid var(--forest); border-radius: 10px; background: #fff;
  font: 600 26px Lexend, sans-serif; color: var(--forest); text-align: center; padding: 0; outline: none; transition: border-color .15s, background .15s; -webkit-appearance: none; appearance: none; }
.bx:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(63,167,245,.25); }
.bx.ok { border-color: var(--green); background: #E3F5EC; color: var(--green-deep); }
.bx.no { border-color: var(--coral); background: #FFECE9; animation: shake .35s; }
.bx.sm { width: 22px; min-width: 22px; height: 22px; border-width: 2px; border-radius: 5px; vertical-align: -4px; }
span.bx { display: inline-flex; align-items: center; justify-content: center; }
.bx.shown, .shown .bx { border-color: var(--green); color: var(--green-deep); background: #E3F5EC; }
.ansrow { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.unit span { font-size: 18px; font-weight: 500; margin-right: 10px; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- learn & watch */
.ltext p { font-size: 20px; line-height: 1.35; font-weight: 500; }
.lv { display: flex; justify-content: center; margin-top: 10px; }
.vrow { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.vis { min-width: 0; max-width: 100%; }
.lv .vis svg { height: 200px; width: auto; max-width: 100%; }
.lv .vis svg.nl, .lv .vis svg.plates, .lv .vis svg.flip, .lv .vis svg.lady { width: 640px; height: auto; max-width: 100%; }
.lv .vis svg.bond { height: 160px; } .lv .vis svg.balance { height: 190px; }
.cap { text-align: center; font-weight: 500; color: var(--forest); }
.lnote { text-align: center; color: var(--green-deep); font-weight: 500; }
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.wgrid ol { margin: 8px 0 0; padding-left: 26px; font-size: 17px; line-height: 1.5; font-weight: 500; }
.wv { display: flex; justify-content: center; min-width: 0; }
.wv .vrow { width: 100%; }
.wv .vis { flex: 1 1 0; min-width: 0; }
.wv .vis svg { width: 100%; height: auto; max-height: 170px; }

/* ---------- items */
.it { display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; }
.ih { display: flex; align-items: flex-start; gap: 8px; }
.ih .num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; font-family: Fredoka; font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.ih .ico { flex: none; width: 28px; height: 28px; margin-top: 2px; }
.ib { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.ib.stack { flex-direction: column; gap: 8px; }
.ib.side { flex-wrap: nowrap; justify-content: flex-start; }
.ib.side .ans { flex: 1; min-width: 0; }
.it .vis svg { height: 96px; width: auto; max-width: 100%; }
.it .vis svg.nl { width: 420px; height: auto; }
.it .vis svg.says { height: 84px; } .it .vis svg.bond { height: 110px; } .it .vis svg.house { height: 130px; }
.it .vis svg.b10 { height: 124px; } .it .vis svg.col { height: 150px; } .lv .vis svg.col, .wv .vis svg.col { height: 190px; width: auto; } .it .vis svg.tape { height: 110px; width: auto; max-width: 100%; }
.it.done::after { content: ""; position: absolute; top: 8px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat; }
/* room for that check mark, so it never sits on a long question's words (on screen only: print has no check marks) */
@media screen { .it:not(.wit):not(.sq) > .ih { padding-right: 32px; } }
.hint { display: flex; align-items: center; gap: 8px; background: #FFF9EB; border: 1.5px solid var(--sun); border-radius: 12px; padding: 6px 10px; font-size: 15px; }
.hint .smini { width: 26px; height: 30px; }
.hint[hidden] { display: none; }

.wrow { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 14px 24px; }
.it.wit { flex-direction: row; align-items: center; }
.it.wit .eq { font-size: 24px; }
.it.wit .bx { height: 46px; min-width: 46px; font-size: 22px; }
.it.wit .vis svg { height: 70px; } .it.wit .vis svg.bond { height: 90px; }
.it.wit .ib { flex-wrap: nowrap; }
.it.wit.done::after { display: none; }
/* quick taps on a tablet (a child answering fast) never zoom the page; pinching to zoom still works */
button, a, input, select, textarea, label, summary, [role=button] { touch-action: manipulation; }
/* a warm-up question with answer buttons: the question on top, its buttons in a row below (side by side they wrap raggedly) */
.it.wit:has(.choice) { flex-direction: column; align-items: stretch; flex: 1 1 100%; }
.it.wit:has(.choice) .ib, .it.wit:has(.choice) .choice { align-items: flex-start; justify-content: flex-start; }
/* several of them sit side by side in even columns on a wide screen (one under another on a phone), not one per row */
@media screen { .wrow:has(> .it.wit .choice) { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 28px; } }

.trow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.it.tcell { background: #fff; border-radius: 14px; padding: 12px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.it.cell { border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; }
.it.cell.done { border-color: #9FD8BD; background: #FBFEFC; }
.row2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.erow { display: flex; flex-direction: column; gap: 12px; }
.it.ccell .vis svg { height: 84px; } .it.ecell .vis svg { height: 80px; }

/* choices, match, facts, open, tap */
.choice { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.choice button, .match button { border: 2.5px solid #CFDDD5; background: #fff; border-radius: 999px; padding: 8px 20px; font-weight: 600; font-size: 20px; cursor: pointer; min-height: 50px; min-width: 60px; }
.choice button:hover, .match button:hover { border-color: var(--sky); }
.choice button.sel { border-color: var(--sky); background: #ECF6FE; }
.choice button.ok, .match button.ok { border-color: var(--green); background: #E3F5EC; color: var(--green-deep); }
.choice button.no, .match button.no { border-color: var(--coral); background: #FFECE9; animation: shake .35s; }
.choice button.chk { background: var(--green); color: #fff; border-color: var(--green); }
.choice.multi { flex-direction: column; align-items: center; }
.choice.pics button { font-size: 44px; line-height: 1; padding: 10px 22px; min-height: 76px; min-width: 96px; border-radius: 22px; }
.match { display: flex; justify-content: center; gap: 60px; }
.ml, .mr { display: flex; flex-direction: column; gap: 10px; }
.match button { min-width: 64px; font-family: Fredoka; font-size: 22px; }
.match button.sel { border-color: var(--sky); background: #ECF6FE; }
.facts { display: flex; flex-direction: column; gap: 8px; }
.frow { display: flex; align-items: center; gap: 4px; font-size: 24px; font-weight: 500; flex-wrap: nowrap; }
.frow .bx { min-width: 46px; width: 50px; height: 46px; font-size: 22px; }
.frow.ok .bx { border-color: var(--green); background: #E3F5EC; color: var(--green-deep); }
.frow.no .bx { border-color: var(--coral); background: #FFECE9; }
.open { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.open.ok .bx { border-color: var(--green); background: #E3F5EC; color: var(--green-deep); }
.tap { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tapo { border: none; background: none; padding: 0; cursor: pointer; width: 50px; height: 50px; }
.tapo svg { width: 50px; height: 50px; }
.tonly { display: none; }
.teacher .tonly { display: block; }
.tnote { color: var(--coral-deep); font-weight: 500; font-size: 15px; text-align: center; }

/* faces */
.faces { display: flex; justify-content: space-around; gap: 8px; }
.faces button { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 2.5px solid transparent; border-radius: 14px; padding: 6px 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.faces button .face { width: 50px; height: 50px; }
.faces button.sel { border-color: var(--green); background: #E3F5EC; }

/* celebrate + nav */
.celebrate { display: flex; align-items: center; gap: 20px; background: #FFF3D1; border: 3px solid var(--sun); border-radius: 24px; padding: 18px 24px; }
.celebrate[hidden] { display: none; }
.celebrate .sprout { width: 110px; height: auto; flex: none; }
.celebrate h2 { font-family: Fredoka; font-weight: 600; font-size: 30px; margin: 0 0 4px; color: var(--forest); }
.celebrate p { margin-bottom: 12px; font-size: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: #157A52; color: #fff; text-decoration: none; font-family: Fredoka; font-weight: 600; font-size: 18px; border: 2.5px solid var(--green); }
.btn.ghost { background: #fff; color: var(--forest); border-color: #CFDDD5; }
.pn { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- unit page */
.uhdr, .ghdr { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #157A52; color: #fff; border-radius: 22px; padding: 18px 24px; }
.uhdr small, .ghdr small { font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.uhdr h1, .ghdr h1 { font-family: Fredoka; font-weight: 600; font-size: 36px; margin: 0; line-height: 1.05; }
.uhdr .logo { width: 56px; height: 56px; }
.ghdr { background: var(--gc); color: var(--forest); } .ghdr .sprout { width: 90px; height: auto; }
.uwill { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; background: #fff; border-radius: 20px; padding: 14px 20px; }
.uwill h2 { font-family: Fredoka; font-weight: 600; font-size: 21px; color: var(--forest); margin: 0 0 4px; }
.uwill ul { margin: 0; padding-left: 22px; font-size: 18px; line-height: 1.55; font-weight: 500; }
.uwill .says { width: 100%; max-width: 380px; height: auto; }
.seek { background: #FFF9EB; border: 2px solid var(--sun); }
.seek .scene { width: 100%; height: auto; border-radius: 16px; }
.sqrow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.it.sq { flex-direction: row; align-items: center; justify-content: center; background: #fff; border-radius: 14px; padding: 8px; gap: 6px; }
.it.sq > svg { width: 44px; height: 44px; flex: none; }
.it.sq.done::after { display: none; }
.lgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lcard { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 12px; text-decoration: none; background: #fff; }
.lcard:hover { border-color: var(--green); }
.lnum { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--mint); color: var(--forest); font-family: Fredoka; font-weight: 600; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.lcard b { display: block; font-family: Fredoka; font-weight: 600; font-size: 18px; color: var(--forest); }
.lcard em { font-style: normal; font-size: 14px; color: #4A5A52; }
.lcard > span:nth-child(2) { flex: 1; min-width: 0; }
.lst { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #CFDDD5; }
.lcard.done .lst { background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; border-color: var(--green); }
.lcard.done .lnum { background: var(--green); color: #fff; }
.garden { width: 100%; height: auto; }
.gfl .fill { display: none; } .gfl.done .fill { display: inline; } .gfl.done .line { display: none; }
.wordgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.words .wcard { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.wcard b { display: block; font-family: Fredoka; font-weight: 600; font-size: 18px; color: var(--forest); }
.wcard span { font-size: 15px; }
.family summary { display: flex; align-items: center; gap: 8px; font-family: Fredoka; font-weight: 600; font-size: 21px; color: var(--forest); cursor: pointer; list-style: none; }
.family summary .ico { width: 30px; height: 30px; }
.family p { margin-top: 10px; font-size: 17px; line-height: 1.55; }

/* ---------- grade + home */
.ugrid { display: flex; flex-direction: column; gap: 10px; }
.ucard { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 16px; text-decoration: none; background: #fff; }
a.ucard:hover { border-color: var(--green); }
.ucard.soon { opacity: .55; }
.unum { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--gc); color: var(--forest); font-family: Fredoka; font-weight: 600; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.ucard b { display: block; font-family: Fredoka; font-weight: 600; font-size: 20px; color: var(--forest); }
.ucard em { font-style: normal; font-size: 14px; color: #4A5A52; }
.ucard > span:nth-child(2) { flex: 1; }
.go { font-family: Fredoka; font-weight: 600; color: var(--green-deep); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--sun); border-radius: 26px; padding: 24px 28px; }
.hero h1 { font-family: Fredoka; font-weight: 600; font-size: 42px; margin: 0 0 6px; color: var(--forest); }
.hero p { font-size: 19px; } .hero .sprout { width: 120px; height: auto; flex: none; }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.gcard { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 22px; background: #fff; border: 3px solid var(--gc); text-decoration: none; }
.gcard:hover { transform: translateY(-2px); }
.gcard svg { width: 56px; height: 56px; }
.gcard b { font-family: Fredoka; font-weight: 600; font-size: 26px; color: var(--forest); }
.gcard em { font-style: normal; color: #4A5A52; }

/* ---------- small screens */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .pgrid, .trow, .row2, .row3, .wgrid, .uwill, .lgrid { grid-template-columns: 1fr; }
  .ht h1 { font-size: 26px; } .goal { font-size: 16px; }
  .std { display: none; }
  .eq { font-size: 24px; } .eq.big { font-size: 28px; }
  .ltext p { font-size: 18px; }
  .sqrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crumbs { display: none; }
  .hero { flex-direction: column; text-align: center; } .hero h1 { font-size: 32px; }
  .ib.side { flex-wrap: wrap; }
}

.it .vis svg.clock { height: 170px; } .it.wit .vis svg.clock { height: 104px; } .it.ecell .vis svg.clock { height: 140px; }
.it .vis svg.graph { height: 220px; } .it.wit .vis svg.graph { height: 110px; } .it.ecell .vis svg.graph { height: 150px; }
.lv .vis svg.graph { height: 270px; } .wv .vis svg.graph { max-height: 230px; }

/* ---------- step mode (signed-in students: one section at a time) */
.stepmode .part { display: none; }
.stepmode .stepitem:not(.on) { display: none !important; }
.stepmode .pn { display: none; }
.stepbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: 58px; z-index: 4; background: var(--cream); padding: 6px 0; }
.sdots { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.sdot { width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid #CFDDD5; background: #fff; font: 600 16px Fredoka, sans-serif; color: #566F62; cursor: pointer; }
.sdot.seen { background: #E3F5EC; border-color: var(--green); color: var(--green-deep); }
.sdot.on { background: var(--green); border-color: var(--green); color: #fff; transform: scale(1.12); }
.whole { background: none; border: none; color: #566F62; text-decoration: underline; cursor: pointer; font-size: 14px; }
.stepfoot { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
.stepfoot .btn { flex: 0 1 150px; min-width: 0; } /* 150 px each, narrower on the smallest phones */
.stepfoot .btn:disabled { opacity: .4; cursor: default; }
.sec h2 .speak { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #BFE0FB; background: #ECF6FE; cursor: pointer; font-size: 18px; }
.stepmode .stepitem.on.sec, .stepmode .stepitem.on .sec { font-size: 19px; }
.stepmode .stepitem.on .eq { font-size: 32px; }
.it .vis svg.arr, .it .vis svg.sq, .it .vis svg.shp, .it .vis svg.shares, .it .vis svg.mtab, .it .vis svg.area, .it .vis svg.iot, .it .vis svg.fline, .it .vis svg.strips, .it .vis svg.tline, .it .vis svg.jug, .it .vis svg.dial, .it .vis svg.amodel, .it .vis svg.angle, .it .vis svg.protr, .it .vis svg.geo, .it .vis svg.grow, .it .vis svg.pvs, .it .vis svg.lmul, .it .vis svg.ldiv, .it .vis svg.dgrid, .it .vis svg.iso, .it .vis svg.cgrid, .it .vis svg.qtree { width: auto; height: auto; max-width: 100%; max-height: 210px; }
.it.wit .vis svg.arr, .it.ecell .vis svg.arr, .it.wit .vis svg.shp, .it.ecell .vis svg.shp, .it.wit .vis svg.shares, .it.ecell .vis svg.shares { max-height: 150px; }
/* stacked fractions: <span class="fr"><span>3</span><span>4</span></span>, boxes allowed in either place */
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; margin: 0 .12em; }
.fr > span { display: block; text-align: center; padding: 0 .22em; }
.fr > span:first-child { border-bottom: .1em solid currentColor; padding-bottom: .08em; }
.fr > span:last-child { padding-top: .08em; }
.fr .bx { margin: 1px 0; }
.qt .fr, .lv p .fr, .wgrid li .fr, .choice button .fr { font-size: .92em; }
.lv .vis svg.mtab { height: 300px; } .wv .vis svg.mtab { max-height: 260px; }
.it .vis svg.mtab { max-height: 260px; }
.lv .vis svg.area { height: auto; width: auto; max-width: 100%; max-height: 300px; } .wv .vis svg.area { width: auto; max-width: 100%; }
.lv .vis svg.iot, .wv .vis svg.iot { width: auto; height: auto; max-width: 100%; }
.lv .vis svg.fline, .wv .vis svg.fline { width: auto; height: auto; max-width: 100%; }
.lv .vis svg.shares { height: auto; width: auto; max-width: 100%; max-height: 220px; }
.eq:has(.fr) { white-space: normal; line-height: 1.6; } .eq.multi:has(.fr) .seg { white-space: normal; }
.lv .vis svg.fline { width: 460px; max-width: 100%; height: auto; }
.lv .vis svg.strips, .wv .vis svg.strips { width: 420px; max-width: 100%; height: auto; }
.lv .vis svg.tline, .wv .vis svg.tline { width: 480px; max-width: 100%; height: auto; } .lv .vis svg.jug, .lv .vis svg.dial { height: 240px; width: auto; }
.it .vis svg.jug { max-height: 190px; } .it .vis svg.dial { max-height: 150px; }
.it .eq { white-space: normal; } .it .eq.multi .seg { white-space: normal; }
.lv .vis svg.amodel, .wv .vis svg.amodel { width: auto; height: auto; max-width: 100%; }
.lv .vis svg.angle, .lv .vis svg.protr, .lv .vis svg.geo, .wv .vis svg.angle, .wv .vis svg.protr, .wv .vis svg.geo { width: auto; height: auto; max-width: 100%; max-height: 240px; }
.eq.big { white-space: normal; overflow-wrap: anywhere; }
.lv .vis svg.ldiv, .wv .vis svg.ldiv, .lv .vis svg.lmul, .wv .vis svg.lmul { width: auto; height: auto; max-width: 100%; max-height: 360px; }
.lv .vis svg.dgrid, .wv .vis svg.dgrid { width: auto; height: auto; max-width: 100%; max-height: 300px; }
.lv .vis svg.iso, .wv .vis svg.iso { width: auto; height: auto; max-width: 100%; max-height: 300px; }
.lv .vis svg.cgrid, .wv .vis svg.cgrid { width: auto; height: auto; max-width: 100%; max-height: 360px; } .it .vis svg.cgrid { max-height: 340px; }
.lv .vis svg.qtree, .wv .vis svg.qtree { width: auto; height: auto; max-width: 100%; max-height: 340px; }
.it .vis svg.scene { width: auto; height: auto; max-width: 100%; max-height: 200px; } .lv .vis svg.scene, .wv .vis svg.scene { width: auto; height: auto; max-width: 100%; max-height: 240px; }
.it .vis svg.hc { width: 100%; height: auto; max-width: 380px; max-height: none; } .it.wit .vis svg.hc, .it.ecell .vis svg.hc { width: 100%; height: auto; max-width: 300px; }

/* ---------- English */
.ela .ltext p { font-size: 21px; }
.wds { font-size: 22px; line-height: 2.1; font-weight: 500; color: var(--ink); }
.bx.wd { width: calc(30px + var(--w, 3) * 15px); min-width: 64px; height: 46px; font-size: 22px; text-transform: none; vertical-align: baseline; }
.wds .bx:not(.wd) { width: 50px; min-width: 50px; height: 44px; font-size: 22px; margin-right: 8px; }
.emos { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.emo { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; padding: 8px 10px 6px; border-radius: 16px; background: var(--mint); }
.emo > span { font-size: 46px; line-height: 1.05; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emo em { font-style: normal; font-weight: 600; font-size: 17px; color: var(--forest); }
.ctx { background: #FFF8EC; border: 2px solid #F3E2BD; border-radius: 14px; padding: 10px 14px; margin: 0 0 8px; text-align: left; }
.ctx p { margin: 0 0 4px; font-size: 18px; line-height: 1.45; }
.ctx p:last-child { margin: 0; }
.srcnote { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 14px; color: var(--muted, #5B6B63); }
.srcnote .ico { width: 20px; height: 20px; }
.sec.read { background: #FFFDF7; border: 2px solid #F3E2BD; }
.rtext { max-width: 720px; margin: 0 auto; }
.rhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; }
.rhead h3 { margin: 0; font-family: Fredoka; font-weight: 600; font-size: 26px; color: var(--forest); }
.say { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 14px 6px 8px; border-radius: 999px; border: 2px solid #BFE0FB; background: #ECF6FE; cursor: pointer;
  font: 600 16px Lexend, sans-serif; color: var(--forest); }
.say .ico { width: 26px; height: 26px; }
.rtext p { font-size: 23px; line-height: 1.6; margin: 0 0 10px; color: var(--ink); }
.rtext.info p { font-size: 21px; }
.rtext p.pl { margin: 0; }
.rnote { font-size: 15px; color: var(--muted, #5B6B63); }
.choice.lab { justify-content: flex-start; align-items: center; width: 100%; }
.choice .clab { min-width: 92px; font: 600 21px Lexend, sans-serif; color: var(--forest); text-align: right; margin-right: 6px; }
.wr { width: 100%; }
.wr textarea { width: 100%; box-sizing: border-box; border: 2.5px solid #CFDDD5; border-radius: 14px; padding: 10px 12px; font: 500 20px/1.6 Lexend, sans-serif; color: var(--ink); resize: vertical;
  background: repeating-linear-gradient(#fff, #fff 31px, #E6EEEA 32px); }
.wr textarea:focus { outline: none; border-color: var(--sky); }
.wcheck { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.wcheck .wct { font-weight: 600; color: var(--forest); }
.wcheck input { width: 18px; height: 18px; vertical-align: -3px; accent-color: var(--green); }
h2.subj { font-family: Fredoka; font-weight: 600; font-size: 26px; color: var(--forest); margin: 22px 4px 10px; }
@media print { .say { display: none; } }
.rtext h4.rh { margin: 14px 0 4px; font-family: Fredoka; font-weight: 600; font-size: 21px; color: var(--green-deep); }
.rtext p.pl:empty { height: 16px; }
.rtext.poem p.pl { padding-left: 1.6em; text-indent: -1.6em; }  /* a long line wraps with a hanging indent */
.rtext table.rtab, .ctx table.rtab { border-collapse: collapse; width: 100%; margin: 6px 0 12px; font-size: 18px; }
.rtab th, .rtab td { border: 1.5px solid var(--line, #DCE7E0); padding: 6px 10px; text-align: left; }
.rtab th { background: var(--mint, #E8F5F0); font-weight: 600; color: var(--forest, #0F3D2E); }
.rtabw { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 520px) { .rtext table.rtab, .ctx table.rtab { font-size: 15px; } .rtab th, .rtab td { padding: 5px 6px; overflow-wrap: break-word; } }
aside.tf { margin: 8px 0 12px; padding: 10px 14px; border-radius: 12px; font-size: 18px; line-height: 1.5; border-left: 5px solid var(--sky, #3FA7F5); background: #ECF6FE; }
aside.tf b { color: var(--forest, #0F3D2E); }
aside.tf-caption { font-style: italic; background: transparent; border-left-color: var(--line, #DCE7E0); }
aside.tf-sidebar { background: #FFF3D1; border-left-color: var(--sun, #FFC233); }
.lnk { color: #1A6FD6; text-decoration: underline; text-underline-offset: 2px; }
.rtext i.sd, .ctx i.sd { color: #5B6B75; }
.rtext b.spk, .ctx b.spk { color: var(--forest, #0F3D2E); letter-spacing: 0.02em; }
.wsave { min-height: 18px; font-size: 13px; color: var(--green-deep); margin-top: 4px; }
.wfb { margin-top: 8px; padding: 10px 14px; border-radius: 12px; background: #E3F5EC; border: 2px solid #B9E4CC; font-size: 16px; color: var(--forest); }
.isay { flex: none; margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #BFE0FB; background: #ECF6FE; cursor: pointer; padding: 3px; }
.isay .ico { width: 24px; height: 24px; }
@media print { .isay { display: none; } }

/* visitors on a sample lesson: a way back to the website */
.visitor-bar { position: sticky; top: 0; z-index: 50; display: flex; gap: 10px 16px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 16px; background: #0F3D2E; color: #fff; font-size: 15px; }
.visitor-bar a { color: #fff; font-weight: 600; }
.visitor-bar a.go { background: #FFC233; color: #0F3D2E; padding: 6px 14px; border-radius: 999px; text-decoration: none; }
