/* Fonts are served from this site (no outside font service). See fonts/LICENSE.txt. */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('../fonts/fredoka.woff2') format('woff2'); }
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/lexend.woff2') format('woff2'); }

/* math101: a maths notebook you can play. Graph paper, marker ink, sticker buttons. */
:root {
  --ink: #18224f;
  --paper: #f3f7ff;
  --grid: #dbe5fa;
  --white: #fff;
  --blue: #2f6bff;
  --yellow: #ffcf33;
  --green: #12b76a;
  --red: #f04438;
  --purple: #7a5af8;
  --muted: #5b668f;
  --display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Lexend', 'Verdana', system-ui, sans-serif;
  --press: 0 5px 0 var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 18px/1.5 var(--body);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: 2.2rem; } h2 { font-size: 1.7rem; } h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: var(--blue); }
b { font-weight: 600; }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px 16px 64px; }
.muted { color: var(--muted); font-size: .95rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }

/* ---------- buttons ---------- */
.btn, .choice, .key, .pm {
  font: 600 1.15rem/1.2 var(--display); color: var(--ink); background: var(--white);
  border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--press);
  padding: 14px 22px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s, box-shadow .06s; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:active, .choice:active, .key:active, .pm:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.go { background: var(--yellow); }
.btn.big { font-size: 1.5rem; padding: 18px 44px; }
.btn.small { font-size: 1rem; padding: 8px 18px; box-shadow: 0 3px 0 var(--ink); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { font-size: 1.5rem; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--ink); background: var(--white); box-shadow: 0 3px 0 var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: none; }
.speak { font-size: 1.1rem; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: var(--white); cursor: pointer; margin-left: 10px; vertical-align: middle; flex: none; }
.row { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 18px; }
.row.wrap { flex-wrap: wrap; padding: 0; max-width: none; }

/* ---------- home ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 18px; }
.logo { font: 700 1.9rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo span { background: var(--yellow); border: 3px solid var(--ink); border-radius: 10px; padding: 0 8px; margin-left: 2px; display: inline-block; transform: rotate(-3deg); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 14px 4px 6px; font-weight: 600; }
.chip .av { font-size: 1.6rem; }
.panel { background: var(--white); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 7px 0 var(--ink); padding: 22px; margin-bottom: 30px; }
.next-up { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: var(--blue); color: #fff; }
.next-up .big-emoji { font-size: 4rem; margin: 0; }
.next-up p { opacity: .92; }
.section-title { margin: 0 0 14px 4px; }
.lessons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; padding: 0; list-style: none; }
.lesson { background: var(--white); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--press); padding: 14px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 4px; min-height: 150px; transition: transform .06s, box-shadow .06s; }
.lesson:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.lesson .em { font-size: 2.3rem; line-height: 1; }
.lesson .nm { font: 600 1.1rem/1.2 var(--display); }
.lesson .gm { color: var(--muted); font-size: .85rem; }
.lesson .st { margin-top: auto; font-size: 1.4rem; letter-spacing: 2px; color: #c9d2ea; }
.lesson .st b { color: #f5a400; font-weight: 400; }
.lesson.boss { background: var(--ink); color: #fff; }
.lesson.boss .gm { color: #b8c2ea; }
.lesson.boss .st { color: #4a568a; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 44px 44px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 2px dashed var(--grid); font-weight: 500; }
.board li:last-child { border-bottom: 0; }
.board .rk { font: 700 1.3rem var(--display); text-align: center; }
.board .av { font-size: 1.7rem; }
.board .me { background: #fff6cf; border-radius: 12px; }
.board .n { font: 600 1.1rem var(--display); min-width: 64px; text-align: right; }
.soon { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 0; }
.soon li { background: rgba(255, 255, 255, .7); border: 2px dashed #9aa6cf; color: var(--muted); border-radius: 12px; padding: 6px 12px; font-size: .9rem; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
details.chapter { margin-bottom: 14px; }
details.chapter > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--white); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); padding: 12px 16px; font: 600 1.2rem/1.2 var(--display); }
details.chapter > summary::-webkit-details-marker { display: none; }
details.chapter > summary::after { content: '▸'; margin-left: 4px; font-size: 1.2rem; }
details.chapter[open] > summary::after { content: '▾'; }
details.chapter[open] > summary { background: #fff6cf; margin-bottom: 16px; }
.ch-em { font-size: 1.6rem; } .ch-nm { flex: 1; min-width: 180px; } .ch-st { font: 600 1rem var(--display); color: var(--muted); white-space: nowrap; }
details.chapter .lessons { margin-bottom: 22px; }
details.chapter .challenge-tag { margin-left: 0; }
.sheet-pick { font: 500 1rem var(--body); padding: 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); max-width: 100%; }
.foot { text-align: center; margin-top: 30px; }
.voice-pick { margin-top: 12px; }
.voice-pick select { font: 500 .95rem var(--body); padding: 8px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); max-width: 260px; }

/* ---------- sign in ---------- */
.field { display: block; margin: 16px 0 6px; font: 600 1.1rem var(--display); }
input[type=text], input[type=password] { font: 500 1.3rem var(--body); padding: 12px 14px; border: 3px solid var(--ink); border-radius: 14px; width: 100%; max-width: 340px; color: var(--ink); background: #fff; }
.picks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 420px; }
.picks button { font-size: 1.9rem; aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 14px; background: var(--white); cursor: pointer; position: relative; padding: 0; }
.picks button.on { background: var(--yellow); }
.picks button .ord { position: absolute; top: -8px; right: -8px; background: var(--ink); color: #fff; font: 700 .8rem var(--display); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.err { color: #b42318; font-weight: 600; min-height: 1.5em; margin-top: 10px; }
.tabs { display: flex; gap: 10px; margin-bottom: 6px; }
.tabs button { font: 600 1.05rem var(--display); border: 3px solid var(--ink); background: var(--white); color: var(--ink); border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; }

/* ---------- lesson frame ---------- */
.lesson-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.lesson-title { font: 600 1.25rem/1.2 var(--display); text-align: center; flex: 1; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 14px 0; }
.steps li { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; border-radius: 999px; border: 3px solid #b9c5ea; color: #8390bd; background: rgba(255, 255, 255, .6); font: 600 1rem var(--display); }
.steps li.on { border-color: var(--ink); color: var(--ink); background: var(--yellow); }
.steps li.done { border-color: var(--green); color: #0b7a47; background: #e3f9ee; }
.stage { background: var(--white); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); padding: 22px 18px 26px; min-height: 440px; text-align: center; }
.scene { min-height: 250px; display: grid; place-items: center; padding: 10px 0; overflow: hidden; }
.caption { font: 500 1.45rem/1.35 var(--display); max-width: 30ch; margin: 12px auto 0; display: flex; align-items: center; justify-content: center; }
.pips { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; background: #d3dbf3; }
.pips i.on { background: var(--ink); width: 30px; border-radius: 6px; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; text-align: left; }
.tag { font: 600 1rem var(--display); background: var(--ink); color: #fff; border-radius: 999px; padding: 5px 14px; }
.score { font: 600 1.15rem var(--display); }
.streak { font: 600 1rem var(--display); color: #c2410c; min-width: 8em; text-align: right; }
.card-big { display: grid; justify-items: center; gap: 12px; padding: 14px 0; }
.big-emoji { font-size: 5rem; line-height: 1.1; }
.levelup { font: 600 1.15rem var(--display); background: #efeaff; border: 3px solid var(--purple); border-radius: 14px; padding: 8px 16px; }
.stars-big { font-size: 5rem; line-height: 1; color: #d3dbf3; letter-spacing: 6px; }
.stars-big .got { color: #f5a400; display: inline-block; animation: pop .5s both; }

/* ---------- game track ---------- */
.track { position: relative; height: 54px; margin: 0 6px 14px; }
.tr-line { position: absolute; left: 0; right: 0; top: 36px; border-top: 5px dotted #b9c5ea; }
.tr-run, .tr-goal { position: absolute; top: 0; font-size: 2.1rem; line-height: 1; }
.tr-run { left: 0; transition: left .5s cubic-bezier(.3, 1.4, .5, 1); }
.tr-goal { right: 0; }
.boss-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.boss-face { font-size: 2.6rem; animation: bob 1.6s ease-in-out infinite; }
.hp { height: 22px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.hp i { display: block; height: 100%; background: var(--red); transition: width .4s; }
.hearts { font-size: 1.4rem; letter-spacing: 2px; }
.timebar { margin-bottom: 14px; }
.timebar i { background: var(--blue); transition: width 1s linear; }

/* ---------- questions ---------- */
.q-visual { min-height: 90px; display: grid; place-items: center; margin-bottom: 8px; }
.q-prompt { font: 500 1.5rem/1.3 var(--display); margin: 6px 0 16px; display: flex; align-items: center; justify-content: center; }
.q-prompt .words { font-size: 1.45rem; }
.blank { background: var(--yellow); border-radius: 8px; padding: 0 12px; border: 2px solid var(--ink); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; margin: 0 auto; }
.choices.three { grid-template-columns: repeat(3, 1fr); max-width: 420px; }
.choices.list { grid-template-columns: 1fr; }
.choices.list .choice { font-size: 1.05rem; font-family: var(--body); font-weight: 500; text-align: left; justify-content: flex-start; }
.choice { font-size: 1.5rem; padding: 18px 10px; min-height: 68px; }
.choices.three .choice { font-size: 2.2rem; }
.choice.right, .pad-disp.right, .btn.right { background: #c9f5df; border-color: #0b7a47; }
.choice.wrong, .pad-disp.wrong, .btn.wrong { background: #ffe1de; border-color: #b42318; animation: shake .3s; }
.choice[disabled] { cursor: default; opacity: .75; }
.choice.right[disabled] { opacity: 1; }
.choices.bubbles { gap: 18px 26px; padding: 10px 0 16px; }
.choices.bubbles .choice { border-radius: 999px; background: #dff1ff; border-color: var(--blue); box-shadow: inset -6px -8px 0 rgba(47, 107, 255, .15), 0 5px 0 var(--blue); animation: bob 2.8s ease-in-out infinite; }
.choices.bubbles .choice.right { background: #c9f5df; }
.choices.bubbles .choice.wrong { background: #ffe1de; animation: shake .3s; }
.choices.cards { grid-template-columns: 1fr 1fr; gap: 20px; }
.choices.cards .choice { font-size: 1.9rem; min-height: 130px; border-radius: 22px; background: #eaf8ef; }
.choices.line { max-width: 620px; grid-template-columns: 1fr 1fr; gap: 40%; }
.choices.line .choice { background: #d9f7e6; border-radius: 999px; font-size: 1.3rem; padding: 14px 6px; }
.q-fb { min-height: 2.2em; margin-top: 16px; font: 600 1.2rem/1.4 var(--display); }
.q-fb.good { color: #0b7a47; }
.q-fb.hint { color: #7a4b00; background: #fff6cf; border-radius: 14px; padding: 10px 14px; display: inline-block; }
.q-fb.bad { color: var(--ink); background: #fff1ef; border: 3px solid #f6b4ad; border-radius: 16px; padding: 12px 16px; display: inline-grid; gap: 10px; justify-items: center; font-weight: 500; }
.cmp { display: flex; align-items: center; justify-content: center; gap: 16px; font: 600 2.1rem var(--display); margin: 6px 0; }
.cmp i { font-style: normal; width: 64px; height: 64px; border-radius: 16px; border: 3px dashed var(--ink); display: grid; place-items: center; background: #fff6cf; }
.cmp i.sym { border-style: solid; background: var(--green); color: #fff; }
.pad-disp { font: 600 2.2rem var(--display); border: 3px solid var(--ink); border-radius: 16px; min-width: 220px; display: inline-block; padding: 8px 18px; margin-bottom: 14px; background: #f7f9ff; }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; justify-content: center; }
.key { padding: 12px 0; font-size: 1.5rem; }
.key.ok { background: var(--yellow); }

/* ---------- number pictures ---------- */
.digits { font: 600 2rem/1 var(--display); letter-spacing: .04em; white-space: nowrap; display: inline-flex; align-items: baseline; }
.digits.xl { font-size: 3.4rem; } .digits.xxl { font-size: clamp(2.6rem, 9vw, 4.6rem); }
.dg { display: inline-block; padding: 2px 3px; border-radius: 8px; }
.dg.hi { background: var(--yellow); box-shadow: 0 0 0 3px var(--ink); margin: 0 4px; }
.pl0, .per0 { color: #b97a00; } .pl1, .per1 { color: #0b8f52; } .pl2 { color: var(--blue); } .pl3, .per2 { color: var(--purple); }
.cm { color: var(--ink); }
.cm.grow { display: inline-block; animation: commaIn .6s .7s both; }
.blocks { display: flex; gap: 22px; align-items: flex-end; justify-content: center; flex-wrap: wrap; --u: 8px; }
.blocks.small { --u: 5px; gap: 10px; }
.bk-group { display: flex; align-items: flex-end; gap: 4px; }
.bk { display: block; border: 2px solid var(--ink); flex: none; }
.bk-on { width: calc(var(--u) + 4px); height: calc(var(--u) + 4px); background: var(--yellow); border-radius: 2px; }
.bk-te { width: calc(var(--u) + 4px); height: calc(var(--u) * 10); background: var(--green); border-radius: 2px;
  background-image: repeating-linear-gradient(0deg, transparent 0 calc(var(--u) - 1px), rgba(24, 34, 79, .55) calc(var(--u) - 1px) var(--u)); }
.bk-hu { width: calc(var(--u) * 10); height: calc(var(--u) * 10); background: #6f9bff; border-radius: 3px;
  background-image: repeating-linear-gradient(0deg, transparent 0 calc(var(--u) - 1px), rgba(24, 34, 79, .5) calc(var(--u) - 1px) var(--u)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--u) - 1px), rgba(24, 34, 79, .5) calc(var(--u) - 1px) var(--u)); }
.bk-th { width: calc(var(--u) * 10); height: calc(var(--u) * 10); background: #a48bff; border-radius: 3px; margin: calc(var(--u) * 2) calc(var(--u) * 2) 0 0;
  background-image: repeating-linear-gradient(0deg, transparent 0 calc(var(--u) - 1px), rgba(24, 34, 79, .5) calc(var(--u) - 1px) var(--u)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--u) - 1px), rgba(24, 34, 79, .5) calc(var(--u) - 1px) var(--u));
  box-shadow: calc(var(--u) * .5) calc(var(--u) * -.5) 0 #7a5af8, calc(var(--u)) calc(var(--u) * -1) 0 #7a5af8, calc(var(--u) * 1.5) calc(var(--u) * -1.5) 0 #6a48ee, calc(var(--u) * 2) calc(var(--u) * -2) 0 #5b3be0; }
.bk-g-hu .bk + .bk { margin-left: calc(var(--u) * -7.5); }
.bk-g-th .bk + .bk { margin-left: calc(var(--u) * -8); }
.bk-g-on { flex-wrap: wrap; max-width: calc((var(--u) + 8px) * 5); }
.builder { display: flex; gap: 10px; justify-content: center; align-items: stretch; margin-bottom: 16px; --u: 6px; }
.bld-col { flex: 1; max-width: 190px; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: #f7f9ff; }
.bld-name { font: 600 .95rem var(--display); }
.c-th { background: #f1edff; } .c-hu { background: #eaf1ff; } .c-te { background: #e6f9ef; } .c-on { background: #fff8dc; }
.bld-stack { min-height: 92px; justify-content: center; flex-wrap: wrap; }
.bld-stack.bk-g-hu, .bld-stack.bk-g-th { flex-wrap: nowrap; }
.bld-stack.bk-g-hu .bk + .bk { margin-left: calc(var(--u) * -9); }
.bld-stack.bk-g-th .bk + .bk { margin-left: calc(var(--u) * -9.4); }
.bld-stack .bk-th { margin-right: calc(var(--u) * 2); }
.bld-ctl { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.bld-n { font: 700 1.7rem var(--display); min-width: 1.2em; }
.pm { width: 48px; height: 48px; padding: 0; font-size: 1.7rem; border-radius: 50%; box-shadow: 0 3px 0 var(--ink); }

/* ---------- fill-in boxes ---------- */
.fill { font: 600 1.5rem/1.6 var(--display); margin-bottom: 14px; display: inline-block; text-align: left; }
.slot { font: 700 1.4rem/1.3 var(--display); color: var(--ink); background: #fff; border: 3px solid #9aa6cf; border-radius: 10px; padding: 2px 8px; margin: 2px 3px; cursor: pointer; vertical-align: middle; text-align: center; }
.slot { min-height: 1.75em; }
.slot.cur { border-color: var(--ink); background: var(--yellow); }
.slot.wrong { border-color: #b42318; background: #ffe1de; }
.slot.shown { border-color: #0b7a47; background: #c9f5df; }
.fill table { border-collapse: separate; border-spacing: 6px; margin: 0 auto; }
.fill td, .fill th { text-align: center; padding: 4px 6px; }
.area th { font: 700 1.3rem var(--display); color: var(--purple); }
.area td { border: 3px solid var(--ink); border-radius: 12px; background: #eef2ff; min-width: 92px; height: 70px; }
.area td.b { background: #e6f9ef; } .area td.c { background: #fff8dc; } .area td.d { background: #ffe9e6; }
.vert { font: 700 1.7rem/1.5 var(--display); display: inline-grid; text-align: right; }
.vert .bar { border-top: 4px solid var(--ink); margin-top: 2px; padding-top: 4px; }
.vert small { font: 500 .9rem var(--body); color: var(--muted); margin-left: 8px; }
.fill .rowline { display: block; }
.fill small { font: 500 .9rem var(--body); color: var(--muted); margin-left: 12px; }

/* ---------- word problems ---------- */
.story { display: block; font: 500 1.25rem/1.5 var(--body); text-align: left; background: #fff8dc; border: 3px solid var(--ink); border-radius: 16px; padding: 14px 18px; max-width: 34em; margin: 0 auto 4px; }
.q-prompt .ask { display: block; font: 600 1.3rem var(--display); margin-top: 10px; text-align: center; }
.q-prompt:has(.story) { align-items: flex-start; }
.choices.ops { grid-template-columns: repeat(4, 1fr); max-width: 420px; }
.choices.ops .choice { font-size: 2.2rem; }
.bm { display: grid; gap: 6px; width: 320px; font: 700 1.3rem var(--display); }
.bm > div { display: flex; gap: 6px; }
.bm span { flex: 1; border: 3px solid var(--ink); border-radius: 10px; padding: 8px 4px; background: #eaf1ff; text-align: center; }
.bm .w span { background: #fff8dc; } .bm span.q { background: var(--yellow); }

/* ---------- fractions ---------- */
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-weight: 700; line-height: 1.15; margin: 0 4px; }
.fr > span:first-child, .fr > .slot:first-child { border-bottom: 3px solid currentColor; padding: 0 6px 1px; }
.fr > .slot:first-child { border: 3px solid #9aa6cf; margin-bottom: 6px; position: relative; }
.fr > .slot:first-child::after { content: ''; position: absolute; left: -6px; right: -6px; bottom: -8px; border-bottom: 3px solid var(--ink); }
.fr > .slot.cur:first-child { border-color: var(--ink); } .fr > .slot.wrong:first-child { border-color: #b42318; } .fr > .slot.shown:first-child { border-color: #0b7a47; }
.fr > span:last-child { padding: 1px 6px 0; }
.mx { display: inline-flex; align-items: center; font-weight: 700; }
.fbars { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; vertical-align: middle; }
.fbar { display: inline-flex; width: 240px; height: 46px; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; }
.fbar i { flex: 1; border-right: 2px solid var(--ink); }
.fbar i:last-child { border-right: 0; }
.fbar i.on { background: #6f9bff; }
.fbar.g i.on { background: #3ecf8e; } .fbar.y i.on { background: var(--yellow); }
.fbar.sm { width: 150px; height: 30px; border-width: 2px; }
.choice .fbar { width: 170px; height: 34px; }
.choice .fr { font-size: 1.5rem; }
.fgrid { display: inline-grid; width: 200px; height: 150px; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; vertical-align: middle; }
.fgrid i { border: 1px solid var(--ink); }
.fgrid i.c { background: #cfe0ff; } .fgrid i.r { background: #fff3c2; } .fgrid i.both { background: #3ecf8e; }
.hgrid { display: inline-grid; grid-template-rows: repeat(10, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; width: 170px; height: 170px; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; background: #fff; vertical-align: middle; }
.hgrid i { border: 1px solid #9aa6cf; }
.hgrid i.on { background: #6f9bff; }
.fill sup, .fact sup, .choice sup { font-size: .6em; }
.rect { position: relative; display: inline-block; border: 4px solid var(--ink); border-radius: 6px; background: #eaf1ff; margin: 26px 34px 6px 6px; }
.rect b { position: absolute; font: 700 1.3rem var(--display); }
.rect .t { top: -32px; left: 50%; transform: translateX(-50%); } .rect .s { right: -30px; top: 50%; transform: translateY(-50%); }
.layers { display: inline-flex; flex-direction: column; gap: 6px; align-items: center; }
.layers .fgrid { border-width: 2px; background: #dff1ff; }
.shape, .plane { vertical-align: middle; max-width: 100%; }
.choice .shape { margin: 0 auto; }
.fline { width: min(100%, 560px); margin: 56px auto 34px; padding: 0 20px; }
.fl-bar { position: relative; height: 6px; background: var(--ink); border-radius: 3px; }
.fl-bar i { position: absolute; top: -8px; width: 3px; height: 22px; margin-left: -1px; background: var(--ink); }
.fl-bar i.whole { top: -13px; height: 32px; width: 5px; margin-left: -2px; }
.fl-bar i b { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); font: 700 1.2rem var(--display); }
.fl-frog { position: absolute; top: -46px; font-size: 2rem; transform: translateX(-50%); }
.q-prompt .fr, .sc-label .fr, .caption .fr { font-size: 1.1em; }
.cmp .fr { font-size: 1.9rem; }

/* ---------- multiplication pictures ---------- */
.arr { display: inline-grid; gap: 6px; padding: 10px; border: 3px solid var(--ink); border-radius: 14px; background: #fff8dc; }
.arr .dot { width: 24px; height: 24px; border-radius: 50%; background: #e9a23b; border: 2px solid var(--ink); display: block; }
.arr .dot.alt { background: #6f9bff; }
.arr .dot.fade { opacity: .18; }
.arr.small { gap: 4px; padding: 6px; border-width: 2px; }
.arr.small .dot { width: 15px; height: 15px; }
.plates { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.plates .arr { border-radius: 50%; padding: 18px; background: #fff; }
.ab { display: grid; gap: 14px; justify-items: center; margin-bottom: 16px; }
.ab-pic { min-height: 120px; display: grid; place-items: center; }
.ab-ctls { display: flex; gap: 14px; }
.ab-ctl { border: 3px solid var(--ink); border-radius: 16px; padding: 8px 14px 10px; background: #f7f9ff; display: grid; gap: 6px; justify-items: center; }
.choices.tiles { grid-template-columns: repeat(3, 1fr); max-width: 440px; gap: 10px; }
.choices.tiles .choice { min-height: 60px; padding: 12px 6px; background: #eef2ff; }
.fact { font: 700 2.6rem var(--display); }
.fact .blank { padding: 0 14px; }
.facts { display: grid; grid-template-columns: repeat(5, auto); gap: 8px; justify-content: center; }
.facts b { font: 600 1.15rem var(--display); background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 4px 10px; animation: pop .4s both; }
.facts b.hot { background: var(--yellow); }
.facts.two { grid-template-columns: repeat(2, auto); gap: 6px 18px; }
.facts.two b { font-size: 1.35rem; padding: 3px 14px; }
.challenge-tag { font: 600 .8rem var(--display); background: var(--purple); color: #fff; border-radius: 999px; padding: 2px 10px; margin-left: 10px; vertical-align: middle; }
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.flow b { font: 700 2rem var(--display); background: #fff8dc; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 14px; animation: pop .5s both; }
.flow i { font: 600 1rem var(--display); font-style: normal; color: var(--purple); animation: pop .4s both; }

/* ---------- scenes ---------- */
.sc-row { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; --u: 8px; }
.sc-col { display: flex; flex-direction: column; align-items: center; gap: 14px; --u: 8px; width: 100%; }
.sc-row > .sc-col { width: auto; }
.sc-label { font: 600 1.6rem var(--display); }
.sc-label.late { animation: pop .5s 2s both; }
.snap { display: flex; --u: 8px; }
.snap-te { flex-direction: column; gap: 8px; animation: gap0 .7s 1s forwards; }
.snap-hu { gap: 8px; animation: gap0 .7s 1s forwards; }
.snap-th { position: relative; width: 190px; height: 200px; align-self: center; }
.snap-th .bk { position: absolute; left: 0; bottom: 0; transform: translate(calc(var(--k) * 11px), calc(var(--k) * -12px)); animation: stack .8s 1s forwards; }
.chunks { display: flex; gap: 12px; justify-content: center; }
.chunk { border: 3px solid currentColor; border-radius: 16px; padding: 10px 14px; display: grid; gap: 2px; animation: pop .5s both; background: #fff; }
.chunk b { font: 700 clamp(1.8rem, 7vw, 3rem)/1 var(--display); }
.chunk span { font: 600 1rem var(--display); }
.chunk.zero { opacity: .35; border-style: dashed; }
.ladder { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ladder b { font: 700 2rem var(--display); background: #fff8dc; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 12px; }
.ladder .x10 { font: 600 1rem var(--display); font-style: normal; color: var(--purple); animation: pop .4s both; }
.expand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.expand b { font: 700 1.9rem var(--display); }
.expand i { font: 600 1.6rem var(--display); font-style: normal; color: var(--muted); }
.align { display: grid; gap: 6px; }
.al-row { display: flex; gap: 6px; justify-content: center; }
.al-row .dg { font: 700 2.2rem var(--display); width: 54px; height: 62px; display: grid; place-items: center; border: 3px solid #c5cfee; border-radius: 12px; }
.al-row .dg.same { color: #9aa6cf; }
.al-row .dg.hi { margin: 0; }
.rule { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rule div { border: 3px solid var(--ink); border-radius: 18px; padding: 16px 18px; display: grid; gap: 6px; }
.rule b { font: 700 1.7rem var(--display); letter-spacing: .1em; }
.rule span { font: 600 1.2rem var(--display); }
.rule .stay { background: #eaf1ff; } .rule .up { background: #d9f7e6; }
.nline { width: min(100%, 600px); margin: 96px auto 6px; align-self: stretch; }
.nl-bar { position: relative; height: 8px; background: var(--ink); border-radius: 4px; margin: 0 26px; }
.nl-tick { position: absolute; top: -7px; width: 3px; height: 22px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.nl-tick.mid { height: 30px; top: -11px; background: var(--purple); }
.nl-tick.end { height: 34px; top: -13px; width: 5px; margin-left: -2px; }
.nl-frog { position: absolute; top: -58px; font-size: 2.2rem; line-height: 1; transform: translateX(-50%); display: grid; justify-items: center; transition: left .9s cubic-bezier(.4, 1.5, .5, 1); }
.nl-frog.hop { animation: hopY .9s; }
.nl-x { font: 700 .95rem var(--display); background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; position: absolute; top: -24px; white-space: nowrap; }
.nl-labels { display: flex; justify-content: space-between; margin-top: 18px; font: 700 1.2rem var(--display); }
.nl-labels span { min-width: 52px; text-align: center; }
.nl-mid { color: var(--purple); font-size: 1rem; }
.pop { animation: pop .5s both; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti span { position: absolute; top: -40px; animation: fall 2.2s ease-in forwards; }

@keyframes pop { from { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes bob { 50% { transform: translateY(-9px); } }
@keyframes gap0 { to { gap: 0; } }
@keyframes stack { to { transform: translate(calc(var(--k) * 2px), calc(var(--k) * -2px)); } }
@keyframes commaIn { from { transform: scale(0); width: 0; opacity: 0; } to { transform: scale(1); width: .35em; opacity: 1; } }
@keyframes hopY { 50% { transform: translate(-50%, -34px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ---------- coach ---------- */
table.coach { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.coach th, table.coach td { padding: 8px 6px; border-bottom: 2px solid var(--grid); text-align: left; vertical-align: top; }
table.coach th { font: 600 .95rem var(--display); }
table.coach td.c { text-align: center; white-space: nowrap; }
.weak { display: inline-block; background: #fff1ef; border: 2px solid #f6b4ad; border-radius: 8px; padding: 0 6px; margin: 2px 4px 2px 0; font-size: .85rem; }
.strong { display: inline-block; background: #e3f9ee; border: 2px solid #9ae0bd; border-radius: 8px; padding: 0 6px; margin: 2px 4px 2px 0; font-size: .85rem; }
.scroll-x { overflow-x: auto; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .lessons { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
  .next-up { grid-template-columns: auto 1fr; }
  .next-up .btn { grid-column: 1 / -1; }
  .steps .st-nm { display: none; }
  .caption { font-size: 1.25rem; }
  .blocks, .sc-row, .sc-col, .snap { --u: 6px; }
  .builder { --u: 4px; gap: 6px; }
  .bld-stack { min-height: 70px; }
  .pm { width: 42px; height: 42px; }
  .choice { font-size: 1.25rem; }
  .digits.xl { font-size: 2.6rem; }
  .arr .dot { width: 18px; height: 18px; }
  .arr { gap: 4px; }
  .fact { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- classes ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cls-pick .tabs { flex-wrap: wrap; margin: 10px 0 2px; }
.cls-pick .tabs button { font-size: .95rem; padding: 6px 14px; }
details.join { text-align: center; margin-top: 14px; }
details.join summary { cursor: pointer; display: inline-block; text-decoration: underline; color: var(--muted, #5b6791); font-weight: 500; }
details.join input { font: 600 1.1rem var(--display); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- staff area (teach.html) ---------- */
input[type=email] { font: 500 1.3rem var(--body); padding: 12px 14px; border: 3px solid var(--ink); border-radius: 14px; width: 100%; max-width: 340px; color: var(--ink); background: #fff; }
.panel.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
label.f { display: block; margin-top: 14px; }
label.f > span { display: block; font: 600 1rem var(--display); margin-bottom: 5px; }
label.f select, .addto select { font: 500 1.05rem var(--body); padding: 11px 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); max-width: 100%; }
.formrow { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 14px; }
.formrow label.f { flex: 1 1 200px; }
.formrow input { max-width: none; font-size: 1.1rem; }
.staffbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.staffbar .role { font: 600 .85rem var(--display); background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.tabs.staff { flex-wrap: wrap; margin-bottom: 18px; }
.tabs.staff button[aria-current=true] { background: var(--ink); color: #fff; }
.linkish { background: none; border: 0; padding: 0; font: 600 1.05rem var(--body); color: var(--blue); text-decoration: underline; cursor: pointer; text-align: left; }
code.code { font: 700 1.05rem ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .12em; background: #fff6cf; border: 2px solid var(--ink); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
code.code.big { font-size: 1.9rem; padding: 6px 16px; display: inline-block; margin-top: 4px; }
.codebox { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; background: var(--paper); border: 3px dashed var(--ink); border-radius: 16px; padding: 14px 18px; margin-top: 14px; }
table.coach tr.dim td { opacity: .55; }
table.coach td.acts { white-space: normal; min-width: 240px; }
table.coach td.acts .btn { margin: 2px 6px 2px 0; }
.addto { display: inline-flex; gap: 6px; align-items: center; margin-right: 6px; }
.addto select { padding: 6px 8px; font-size: .95rem; border-width: 2px; border-radius: 10px; max-width: 160px; }
.btn.danger { background: #fff1ef; }
.linkbox { background: #e3f9ee; border: 3px solid var(--ink); border-radius: 16px; padding: 14px 16px; margin-top: 16px; }
.linkbox input.link { font: 500 .95rem ui-monospace, Menlo, Consolas, monospace; max-width: none; flex: 1 1 320px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.tile { border: 3px solid var(--ink); border-radius: 16px; padding: 12px 14px; background: var(--paper); }
.tile b { display: block; font: 700 1.7rem var(--display); }
.tile span { color: var(--muted); font-size: .95rem; }
#flash { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 500; max-width: 90vw; z-index: 50; }
#flash.bad { background: #b42318; }
.panel details > summary { cursor: pointer; font-weight: 600; }

/* ---------- mastery levels ---------- */
.lv { display: inline-block; border: 2px solid var(--ink); border-radius: 8px; padding: 0 7px; margin: 2px 4px 2px 0; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.lv-none { background: #fff; color: #8b96bd; }
.lv-help { background: #ffd9d4; }
.lv-learn { background: #fff0b8; }
.lv-near { background: #d3f3e2; }
.lv-known { background: #12b76a; color: #fff; }
span.lv.lv-none { border-color: #c9d2ea; }
.legend { margin: 12px 0 0; }
table.heat td.c { font-weight: 600; min-width: 46px; border-left: 2px solid #fff; }
table.heat td.who { white-space: nowrap; }
table.heat th.up { vertical-align: bottom; padding: 4px 2px 8px; }
table.heat th.up span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); max-height: 190px; font-size: .85rem; line-height: 1.15; text-align: left; }
table.factgrid { border-collapse: collapse; }
table.factgrid th { font: 600 .95rem var(--display); padding: 4px; min-width: 34px; text-align: center; }
table.factgrid td { width: 36px; height: 34px; text-align: center; font-weight: 700; border: 2px solid #fff; border-radius: 6px; }
table.coach tr.grp td { font: 600 1rem var(--display); background: var(--paper); }
ul.plain { list-style: none; margin: 8px 0 0; padding: 0; }
ul.plain li { padding: 8px 0; border-bottom: 2px dashed var(--grid); }
ul.plain li:last-child { border-bottom: 0; }
.tile.lv-known span, .tile.lv-known b { color: #fff; }
@media print {
  .noprint, .staffbar, nav.tabs.staff, header.top, #flash, #answers { display: none !important; }
  html, body { background: #fff !important; }
  body { font-size: 10.5pt; }
  .wrap { max-width: none !important; width: auto; padding: 0 !important; margin: 0 !important; }
  .panel { box-shadow: none; border-width: 1.5px; border-radius: 12px; break-inside: avoid; margin: 0 0 12px; padding: 12px 14px; }
  .panel h1 { font-size: 18pt; }
  .panel h2 { font-size: 13pt; break-after: avoid; }
  table.coach { font-size: 9.5pt; }
  table.coach tr, ul.plain li { break-inside: avoid; }
  .lv, .lv-none, .lv-help, .lv-learn, .lv-near, .lv-known, .tile, table.coach tr.grp td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .scroll-x { overflow: visible; }
  .linkish { color: inherit; text-decoration: none; }
  .panel:has(table.coach) { break-inside: auto; }
  table.coach thead { display: table-header-group; }
  table.factgrid th { min-width: 26px; padding: 2px; font-size: 9pt; }
  table.factgrid td { width: 27px; height: 22px; font-size: 9pt; }
  .tiles { margin-top: 8px; }
  .tile { padding: 8px 12px; }
}

/* ---------- student report ---------- */
.reportbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 12px 0 16px; }
.seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.seg button { font: 600 .95rem var(--display); border: 0; background: transparent; color: var(--ink); padding: 8px 14px; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.rhead { display: flex; gap: 16px; align-items: center; }
.ravatar { font-size: 3rem; line-height: 1; width: 76px; height: 76px; display: grid; place-items: center; background: #fff6cf; border: 3px solid var(--ink); border-radius: 20px; flex: none; }
.tile.kpi { background: #fff; }
.tile.kpi span { display: block; font-size: .9rem; }
.tile.kpi b { font-size: 2rem; margin: 2px 0; }
.delta { font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.delta.up { color: #006300; font-weight: 600; }
.delta.down { color: #b42318; font-weight: 600; }
.summary { margin-top: 16px; background: var(--paper); border-left: 6px solid var(--ink); border-radius: 10px; padding: 12px 16px; }
.summary p { margin: 6px 0 0; }
.figs { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px 26px; align-items: start; margin-top: 12px; }
.report .figs:has(.fig + .fig .chart:not(.cal)) { grid-template-columns: 1fr 1fr; }
figure.fig { margin: 0; min-width: 0; }
figure.fig figcaption { margin-bottom: 6px; font-size: .95rem; }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--body); }
.chart.cal svg { max-width: 230px; }
.chart .nodata { padding: 22px 0; }
.chartkey { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: .82rem; color: var(--muted); margin: 0 0 8px; }
.chartkey i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chartkey .right { margin-left: auto; }
.chart.cal .chartkey { margin: 6px 0 0; gap: 4px; }
.chart.cal .chartkey i { margin-right: 0; }
ol.plan { margin: 10px 0 0; padding-left: 26px; }
ol.plan li { padding: 8px 0; border-bottom: 2px dashed var(--grid); }
ol.plan li:last-child { border-bottom: 0; }
ol.plan li::marker { font: 700 1.1rem var(--display); }
ul.plain.tight li { padding: 5px 0; border-bottom: 0; }
.fine { font-size: .85rem; margin: 4px 0 12px; }
.duo { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 22px; align-items: stretch; }
.duo > .panel { min-width: 0; }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .figs, .report .figs:has(.fig + .fig .chart:not(.cal)) { grid-template-columns: 1fr; } }
@media print {
  .chart svg rect, .chart svg circle, .chart svg path, .chartkey i, .ravatar, .summary { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report .panel h1 { font-size: 17pt; }
  .ravatar { width: 54px; height: 54px; font-size: 2rem; border-width: 2px; }
  .tile.kpi b { font-size: 1.45rem; }
  .tiles { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .summary { margin-top: 10px; padding: 8px 12px; }
  .report.parent .panel { margin-bottom: 8px; padding: 9px 12px; }
  .report.parent { font-size: 9.5pt; }
  .report.parent ol.plan li { padding: 4px 0; }
  .report.parent .chart svg { max-height: 150px; }
  .report a { color: inherit; text-decoration: none; }
  .report.parent { zoom: 0.66; }
  .report.parent .howto p { margin: 2px 0; }
  .report.parent:lang(es) { zoom: 0.61; }
  .duo { grid-template-columns: 1.15fr 1fr !important; gap: 0 10px; }
  .report.parent .howto .legend { margin: 0; }
  .report.teacher { zoom: 0.86; }
  .report.teacher .panel { break-inside: auto; }
  .report figure.fig, .report .tiles, .report .summary, .report ol.plan li, .report .rhead, .report table.factgrid, .report .chart { break-inside: avoid; }
  .report .panel h2 + p { break-after: avoid; }
  .report.parent .figs { grid-template-columns: 1.5fr 1fr; }
}
.chart.bars { max-width: 720px; }

/* ---------- My practice (student home) ---------- */
.panel.practice h2 { margin-bottom: 8px; }
ul.prac { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.prac li { display: flex; align-items: center; gap: 14px; border: 3px solid var(--ink); border-radius: 16px; padding: 10px 14px; background: #fff6cf; }
ul.prac li.done { background: #e3f9ee; }
ul.prac .em { font-size: 2rem; }
ul.prac .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
ul.prac .nm b { font: 600 1.15rem var(--display); }
ul.prac .nm small { color: var(--muted); font-size: .9rem; }
input[type=date] { font: 500 1.05rem var(--body); padding: 10px 12px; border: 3px solid var(--ink); border-radius: 14px; color: var(--ink); background: #fff; }

/* ---------- announcements ---------- */
p.note { background: #e3f1ff; border: 3px solid var(--ink); border-radius: 16px; padding: 10px 16px; margin: 0 0 14px; font-weight: 500; }
p.note small { color: var(--muted); font-weight: 400; }
textarea { font: 500 1.05rem var(--body); padding: 10px 12px; border: 3px solid var(--ink); border-radius: 14px; width: 100%; max-width: 640px; color: var(--ink); background: #fff; display: block; }
label.chk { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-weight: 500; }
label.chk input { width: 20px; height: 20px; accent-color: var(--ink); }
.chkcol { margin: 10px 0 4px; }
.chkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 18px; margin: 4px 0 8px; padding: 8px 12px; background: var(--paper); border-radius: 12px; }
.panel details select, .reportbar select, .panel .row select { font: 500 1rem var(--body); padding: 8px 10px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.meter { height: 16px; background: #eef2fb; border-radius: 8px; overflow: hidden; max-width: 720px; }
.meter i { display: block; height: 100%; background: #2a78d6; border-radius: 8px; }
p.note .btn { margin-left: 8px; }

/* ---------- challenges ---------- */
.fact.chal { font-size: 1.9rem; line-height: 1.35; }
.story { display: block; font: 500 1.25rem/1.5 var(--body); max-width: 640px; margin: 0 auto; }
.lesson.hard { border-style: dashed; background: #fff8ee; }
.lesson.hard2 { background: #ffefe9; }
.lesson .hard-tag { font: 600 .8rem var(--display); background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; align-self: flex-start; }
@media (max-width: 600px) { .fact.chal { font-size: 1.45rem; } .story { font-size: 1.1rem; } }

/* quiet line at the very bottom of the home page: the dedication, and the privacy link at the right */
.tiny-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .75rem; color: #8f99b8; max-width: 860px; margin: -44px auto 0; padding: 0 22px 16px; }
.tiny-foot a { font-size: .7rem; color: #a3acc6; text-decoration: none; }
.tiny-foot a:hover, .tiny-foot a:focus { color: var(--muted); text-decoration: underline; }

/* ---------- english101: sentences, chunks, passages, the gist chart ---------- */
.sent { font: 600 1.55rem/1.6 var(--display); display: inline-block; max-width: 26em; }
.sent .hi, .hi { background: var(--yellow); border-radius: 8px; padding: 1px 6px; box-shadow: 0 0 0 2px var(--ink); }
.sent.bad { color: #8a1c12; }
.labs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: flex-start; }
.lab { display: grid; justify-items: center; gap: 4px; animation: pop .5s both; }
.lab b { font: 600 1.45rem var(--display); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; background: #fff; }
.lab i { font: 600 .9rem var(--display); font-style: normal; color: var(--muted); }
.lab.who b { background: #dff1ff; } .lab.did b { background: #d9f7e6; } .lab.ww b { background: #ece6ff; } .lab.why b { background: #ffe9d2; } .lab.join b { background: var(--yellow); }
.lab.miss b { border-style: dashed; color: var(--muted); background: #fff; }
.lab:nth-child(2) { animation-delay: .4s; } .lab:nth-child(3) { animation-delay: .8s; } .lab:nth-child(4) { animation-delay: 1.2s; } .lab:nth-child(5) { animation-delay: 1.6s; }
.stack { display: grid; gap: 14px; justify-items: center; }
.stack .arrow { font-size: 1.6rem; }
.tray { min-height: 76px; border: 3px dashed #9aa6cf; border-radius: 16px; background: #fff; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; max-width: 640px; margin: 0 auto 14px; }
.tray.right { border-style: solid; border-color: #0b7a47; background: #c9f5df; }
.tray.wrong { border-color: #b42318; background: #ffe1de; animation: shake .3s; }
.tray.shown { border-style: solid; border-color: #0b7a47; background: #c9f5df; font: 600 1.25rem var(--display); }
.bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 60px; max-width: 640px; margin: 0 auto 16px; }
.wchunk { font: 600 1.2rem var(--display); color: var(--ink); background: #eef2ff; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 14px; cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
.wchunk.in { background: var(--yellow); box-shadow: none; }
.passage { text-align: left; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 14px 18px; max-width: 640px; margin: 0 auto; font: 400 1.08rem/1.6 var(--body); }
.passage b.t { display: block; font: 600 1.25rem var(--display); margin-bottom: 4px; }
.gist { border-collapse: collapse; margin: 0 auto; background: #fff; font: 500 1rem/1.3 var(--body); max-width: 100%; }
.gist th, .gist td { border: 2px solid var(--ink); padding: 8px 10px; text-align: center; vertical-align: middle; }
.gist th { font: 600 1rem var(--display); background: #eef2ff; }
.gist th small { display: block; font-weight: 500; color: var(--muted); }
.gist td { min-width: 5.5em; height: 3.2em; }
.gist td.on { background: #fff8dc; font-weight: 600; }
.q-visual .gist { font-size: .92rem; }
.choices.list .choice { font-size: 1.12rem; line-height: 1.4; padding: 14px 16px; }
.choices.words .choice { font-size: 1.35rem; }
@media (max-width: 560px) { .sent { font-size: 1.25rem; } .gist { font-size: .8rem; } .gist th, .gist td { padding: 5px 4px; } }

.booktag { display: inline-block; font: 600 1.05rem var(--display); background: #fff8dc; border: 3px solid var(--ink); border-radius: 999px; padding: 6px 16px; }

.typed { display: block; width: 100%; max-width: 620px; margin: 0 auto 14px; font: 600 1.3rem/1.4 var(--display); color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 12px 14px; text-align: center; }
.typed.long { min-height: 96px; text-align: left; font: 500 1.15rem/1.5 var(--body); resize: vertical; }
.typed.wrong { border-color: #b42318; background: #ffe1de; animation: shake .3s; }
.typed.right, .typed.shown { border-color: #0b7a47; background: #c9f5df; }
