@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(fonts/fredoka-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(fonts/fredoka-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url(fonts/nunito-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(fonts/nunito-latin-800-normal.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --bg: #eef5ff;
  --dots: #d3e3fb;
  --paper: #ffffff;
  --ink: #1d1d3b;
  --muted: #5b5b7a;
  --line: #1d1d3b;
  --soft: #f3f1ff;
  --tangerine: #ff8a3d;
  --sky: #3aa0ff;
  --grass: #2fbf71;
  --berry: #ef476f;
  --sun: #ffd23f;
  --grape: #8e6cf0;
  --good: #1a9e5a;
  --good-bg: #dcf8e8;
  --bad: #d63052;
  --bad-bg: #ffe3e8;
  --try: #a35a00;
  --try-bg: #fff1d6;
  --r: 18px;
  --shadow: 5px 5px 0 var(--ink);
  --font-d: Fredoka, Nunito, system-ui, sans-serif;
  --font-b: Nunito, system-ui, sans-serif;
  --accent: #ff3f80; --accent-ink: #ffffff;
  --accent2: #2f6bff; --accent2-ink: #ffffff;
  --page-ink: var(--ink);
  --pattern: radial-gradient(var(--dots) 2px, transparent 2.5px);
  --pattern-size: 26px 26px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image: var(--pattern);
  background-size: var(--pattern-size);
  color: var(--ink);
  font: 600 17px/1.5 var(--font-b);
  min-height: 100vh;
}
h1, h2, h3, .display { font-family: var(--font-d); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0 0 10px; }
a { color: #1565c0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.small { font-size: 14px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.wrap { max-width: 920px; margin: 0 auto; padding: 16px 16px 60px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border: 3px solid var(--line); border-radius: 14px;
  background: var(--paper); box-shadow: 0 4px 0 var(--ink);
  font-family: var(--font-d); font-weight: 600; font-size: 18px;
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.orange { background: var(--tangerine); color: #fff; }
.btn.blue { background: var(--sky); color: #fff; }
.btn.sun { background: var(--sun); }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 16px; border-width: 2px; box-shadow: 0 3px 0 var(--ink); }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; text-decoration: underline; }
.chip {
  border: 2px solid var(--line); border-radius: 999px; background: var(--paper); padding: 6px 12px; min-height: 38px; font-weight: 700;
}
.chip.on { background: var(--sun); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

.card {
  background: var(--paper); border: 3px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px;
}

/* ---------- student player ---------- */
/* bright band around the lesson; calm card inside */
.band { background: var(--accent2); color: var(--accent2-ink); border: 3px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 16px 10px; margin-bottom: 18px; display: grid; gap: 10px; }
.band-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.band .ltitle { font-family: var(--font-d); font-size: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.band-btn { border: 2px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 14px; min-height: 40px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.band-btn.sun { background: var(--sun); }
.band-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.trail { display: flex; gap: 4px; margin: 0; align-items: center; }
.trail button { flex: 1 1 0; min-width: 6px; height: 14px; padding: 0; border-radius: 999px; border: 2px solid var(--line); background: rgba(255, 255, 255, .6); transition: transform .15s; }
.trail button.done { background: var(--sun); }
.trail button.part { background: linear-gradient(90deg, var(--sun) 50%, rgba(255, 255, 255, .6) 50%); }
.trail button.here { transform: scaleY(1.6); background-color: #fff; box-shadow: 0 0 0 2px var(--accent2-ink); }
.trail button.here.done { background: var(--sun); }
.trail button:hover { transform: scaleY(1.4); }
.band-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 14px; }
.stage { border-top-width: 12px; border-top-color: var(--type, var(--line)); max-width: 860px; margin: 0 auto; }
.stage[data-type="slide"] { --type: var(--accent2); } .stage[data-type="poll"] { --type: #ff5fa2; } .stage[data-type="check"] { --type: #22c55e; }
.stage[data-type="open"] { --type: #3b9bff; } .stage[data-type="draw"] { --type: #ff8a3d; } .stage[data-type="match"] { --type: #8b5cf6; }
.stage[data-type="blanks"] { --type: #f5b800; } .stage[data-type="order"] { --type: #14b8a6; } .stage[data-type="sort"] { --type: #ef4444; }
.navbar { max-width: 860px; margin-left: auto; margin-right: auto; }
body.focus { background: #15182e !important; background-image: none !important; --page-ink: #f4f3ff; transition: background .3s; }
body.focus .band { background: transparent; border-color: transparent; box-shadow: none; padding: 0 0 4px; color: #f4f3ff; }
body.focus .band .ltitle, body.focus .band-meta { visibility: hidden; }
body.focus .trail button { border-color: #5b5f8a; background: #2a2e52; }
body.focus .trail button.done { background: var(--sun); border-color: var(--sun); }
body.focus .trail button.here { box-shadow: 0 0 0 2px #fff; }
body.focus .stage { box-shadow: 0 0 0 6px rgba(255, 255, 255, .08), 0 20px 60px rgba(0, 0, 0, .5); }
.section-tag { display: inline-block; background: var(--accent2); color: var(--accent2-ink); border: 2px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.stage { min-height: 320px; }
.navbar { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.counter { font-weight: 800; color: var(--page-ink); opacity: .75; }

.slide-title { font-size: 30px; margin-bottom: 12px; }
.slide-body { font-size: 20px; }
.slide-body ul { padding-left: 24px; margin: 6px 0 12px; }
.slide-body li { margin-bottom: 6px; }
.slide-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.slide-img { width: 100%; border-radius: 12px; border: 3px solid var(--line); }
.video { position: relative; padding-top: 56.25%; margin-bottom: 14px; border-radius: 12px; overflow: hidden; border: 3px solid var(--line); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.act-head { margin-bottom: 14px; }
.act-tag { display: inline-block; border: 2px solid var(--line); border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: 14px; margin-bottom: 10px; background: var(--sun); }
.act-poll { background: #ffd8f0; } .act-check { background: #c8f7dc; } .act-open { background: #d6ecff; }
.act-draw { background: #ffe0c7; } .act-match { background: #e6dcff; } .act-blanks { background: #fff3b0; }
.act-order { background: #c9f3f5; } .act-sort { background: #ffd6d6; }
.act-prompt { font-size: 24px; }
.hint { margin: 0 0 10px; }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; min-height: 56px;
  border: 3px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 4px 0 var(--ink); font-size: 18px;
}
.choice:hover:not(:disabled) { background: var(--soft); }
.choice .dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--sun); font-family: var(--font-d); }
.choice.picked { background: #e6dcff; }
.choice.right { background: var(--good-bg); border-color: var(--good); }
.choice.right .dot { background: var(--grass); color: #fff; }
.choice.wrong { background: var(--bad-bg); border-color: var(--bad); text-decoration: line-through; }
.choice:disabled { cursor: default; }

.feedback { display: none; margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 2px solid; }
.feedback.show { display: block; }
.feedback.good { background: var(--good-bg); border-color: var(--good); }
.feedback.bad { background: var(--bad-bg); border-color: var(--bad); }
.feedback.try { background: var(--try-bg); border-color: var(--try); }

textarea.answer, .field input, .field textarea, .field select, input.text {
  width: 100%; border: 3px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 17px;
}
textarea.answer { font-size: 18px; margin-bottom: 8px; resize: vertical; }

.draw-tools { margin-bottom: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.swatch.on { box-shadow: 0 0 0 4px var(--sky); }
.draw-pad { border: 3px solid var(--line); border-radius: 14px; background: #fff center/contain no-repeat; overflow: hidden; margin-bottom: 10px; }
.draw-pad canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.match-col { display: grid; gap: 10px; align-content: start; }
.tile { border: 3px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px; min-height: 52px; text-align: left; box-shadow: 0 3px 0 var(--ink); font-size: 17px; }
.tile.sel { outline: 4px solid var(--sky); outline-offset: 2px; }
.tile.right { border-color: var(--good); box-shadow: 0 3px 0 var(--good); }
.tile.wrong { border-color: var(--bad); box-shadow: 0 3px 0 var(--bad); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bank-word { border: 2px dashed var(--line); border-radius: 10px; padding: 3px 10px; background: #fffbe6; font-weight: 800; }
.blanks-text { font-size: 19px; line-height: 2.1; margin-bottom: 8px; }
input.blank { border: 0; border-bottom: 3px solid var(--line); background: #f3f1ff; border-radius: 6px 6px 0 0; padding: 2px 6px; font-weight: 800; font-size: 18px; max-width: 100%; }
input.blank.right { background: var(--good-bg); border-color: var(--good); }
input.blank.wrong { background: var(--bad-bg); border-color: var(--bad); }

.order { list-style: none; counter-reset: o; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.order-item { counter-increment: o; display: flex; align-items: center; gap: 8px; border: 3px solid var(--line); border-radius: 12px; background: #fff; padding: 8px 10px; box-shadow: 0 3px 0 var(--ink); }
.order-item::before { content: counter(o); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--sun); border: 2px solid var(--line); display: grid; place-items: center; font-family: var(--font-d); }
.order-item.right { border-color: var(--good); }
.order-item.wrong { border-color: var(--bad); background: var(--bad-bg); }
.order-text { flex: 1; }
.mini { width: 38px; height: 38px; border: 2px solid var(--line); border-radius: 10px; background: var(--soft); }
.mini:disabled { opacity: .3; }

.tray { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; padding: 10px; border: 3px dashed var(--line); border-radius: 14px; margin-bottom: 12px; background: #fffdf3; align-items: center; }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 10px; }
.bin { border: 3px solid var(--line); border-radius: 14px; background: #fff; min-height: 130px; padding: 10px; }
.bin.ready { background: #eef7ff; outline: 3px dashed var(--sky); }
.bin-name { font-family: var(--font-d); font-weight: 600; font-size: 18px; margin-bottom: 8px; }
.bin-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.card-chip { border: 2px solid var(--line); border-radius: 10px; background: #e6dcff; padding: 6px 10px; font-weight: 700; }
.card-chip.sel { outline: 3px solid var(--sky); outline-offset: 2px; background: var(--sun); }
.card-chip.right { background: var(--good-bg); border-color: var(--good); }
.card-chip.wrong { background: var(--bad-bg); border-color: var(--bad); }

.start { text-align: center; padding: 34px 22px; }
.start h1 { font-size: 36px; margin-bottom: 10px; }
.goal { display: inline-block; text-align: left; background: #fff8d6; border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 12px 0 18px; max-width: 600px; }
.stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.stat { border: 3px solid var(--line); border-radius: 14px; padding: 10px 16px; background: #fff; min-width: 110px; }
.stat b { display: block; font-family: var(--font-d); font-size: 28px; }
.big-emoji { font-size: 60px; line-height: 1; }
.review { text-align: left; margin-top: 18px; }
.review li { margin-bottom: 6px; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }

@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .start h1 { font-size: 28px; }
  .slide-title { font-size: 24px; }
  .slide-body, .act-prompt { font-size: 19px; }
  .slide-cols { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .match { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { font-size: 15px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.stage h2[tabindex="-1"]:focus { outline: none; }
.layout-top .slide-cols, .layout-big .slide-cols { grid-template-columns: 1fr; }
.layout-left .slide-cols { grid-template-columns: 1fr 1.2fr; }
.layout-big .slide-img { order: -1; }
.slide-card.tinted { background: var(--tint); color: var(--tint-ink); margin: -22px; padding: 22px; border-radius: calc(var(--r) - 3px); min-height: 320px; }
.banner { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; border: 3px solid var(--line); margin-bottom: 14px; }
@media (max-width: 640px) { .layout-left .slide-cols { grid-template-columns: 1fr; } .slide-card.tinted { margin: -16px; padding: 16px; } }
.band .counter { color: inherit; opacity: 1; }
@media (max-width: 520px) {
  .band-row { flex-wrap: wrap; }
  .band .ltitle { flex-basis: 100%; order: -1; white-space: normal; font-size: 18px; }
  .band-row .spacer { display: none; }
  .band-btn { flex: 1; }
  body.focus .band .ltitle { display: none; }
}

/* badges */
.badge-toast { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; background: var(--sun); color: var(--ink); border: 3px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 18px 10px 12px; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.badge-toast.out { opacity: 0; transform: translate(-50%, -20px); transition: .5s; }
.badge-toast .bt-emoji { font-size: 40px; line-height: 1; }
.badge-toast small { display: block; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; }
.badge-toast b { font-family: var(--font-d); font-size: 20px; }
@keyframes pop { from { transform: translate(-50%, -30px) scale(.6); opacity: 0; } }
.game-sum { margin-top: 18px; display: grid; gap: 12px; justify-items: center; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; width: 100%; margin: 6px 0; }
.badge { border: 2px dashed #b9bdd3; border-radius: 16px; padding: 10px 8px; display: grid; justify-items: center; gap: 2px; text-align: center; background: #f6f7fb; color: var(--muted); }
.badge.got { border: 3px solid var(--line); background: #fff8d6; color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.badge .b-emoji { font-size: 34px; line-height: 1.1; filter: grayscale(1); opacity: .6; }
.badge.got .b-emoji { filter: none; opacity: 1; }
.badge b { font-family: var(--font-d); font-size: 16px; }
.badge small { font-size: 12px; font-weight: 700; line-height: 1.3; }
.btn.small:not(.primary):not(.blue):not(.orange) { color: var(--ink); }

/* effects */
.fx-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fx-row select { flex: 1 1 180px; }
#app, .wrap { position: relative; z-index: 1; }
.stage.fx-move { animation-duration: .45s; animation-timing-function: cubic-bezier(.2,.8,.3,1.1); animation-fill-mode: both; }
.stage.fx-fade { animation-name: fxFade; }
.stage.fx-slide { animation-name: fxSlide; }
.stage.fx-pop { animation-name: fxPop; }
.stage.fx-flip { animation-name: fxFlip; animation-duration: .6s; }
.fx-reveal { animation: fxUp .5s both; }
@keyframes fxFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes fxSlide { from { opacity: 0; transform: translateX(60px) } to { opacity: 1; transform: none } }
@keyframes fxPop { 0% { opacity: 0; transform: scale(.85) } 70% { transform: scale(1.02) } 100% { opacity: 1; transform: none } }
@keyframes fxFlip { from { opacity: 0; transform: perspective(900px) rotateY(-70deg) } to { opacity: 1; transform: none } }
@keyframes fxUp { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .stage.fx-move, .fx-reveal { animation: none !important; } }

/* tables on slides */
.table-wrap { overflow-x: auto; margin: 10px 0; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .95em; background: #fff; }
.table-wrap th, .table-wrap td { border: 2px solid var(--line, #d9dcef); padding: 8px 12px; text-align: left; vertical-align: top; }
.table-wrap th { background: color-mix(in srgb, var(--accent2, #2f6bff) 14%, #fff); font-weight: 700; }
.table-wrap tbody tr:nth-child(even) td { background: #f7f8ff; }

.model-ans { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #eefbf3; border: 2px solid #9fe0b8; color: #14532d; font-weight: 600; white-space: pre-wrap; }
.model-ans small { display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; color: #1a7f45; margin-bottom: 2px; }

/* slide pictures */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.slide-shot { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.slide-words { margin-top: 10px; }
.slide-words summary { cursor: pointer; font-weight: 700; color: var(--accent2, #2f6bff); }
.act-img { display: block; max-width: 100%; max-height: 420px; margin: 10px 0 4px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.pic-row { display: flex; gap: 8px; align-items: center; }
.pic-row input { flex: 1; }
/* reading lessons: passages */
.slide-body blockquote, .act-quote { margin: 10px 0 14px; padding: 12px 16px; border-left: 6px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); border-radius: 0 12px 12px 0; font-size: 19px; line-height: 1.55; color: #1d1d3b; }
.act-quote { white-space: pre-wrap; }

/* ---------- Annotate It card ---------- */
.stage[data-type="annotate"] { --type: #f5b800; max-width: 980px; }
.annot-src { margin: -4px 0 10px; color: var(--muted); font-style: italic; }
.annot-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 3; background: var(--paper); padding: 6px 0; }
.annot-lbl { font-weight: 800; }
.annot-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.annot-tag { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); padding: 4px 12px 4px 6px; min-height: 40px; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.annot-tag i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.annot-tag[aria-pressed="true"] { background: var(--ink); color: #fff; }
.annot-hint { margin: 4px 0 10px; }
.annot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 820px) { .annot-grid { grid-template-columns: minmax(0, 1fr) 240px; } .annot-side { position: sticky; top: 60px; max-height: 70vh; overflow: auto; } }
.annot-text { font-size: 1.1em; line-height: 2; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; border: 2px solid var(--line); border-radius: 12px; background: #fffef8; padding: 6px 16px; color: #1d1d3b; }
.annot-p { margin: 10px 0; }
.annot-num { display: inline-block; min-width: 26px; margin-right: 6px; padding: 0 6px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: .8em; font-weight: 800; text-align: center; line-height: 1.6; }
.annot-text .w { cursor: pointer; border-radius: 3px; padding: 3px 0; }
.annot-text .w.b { font-weight: 800; }
.annot-text .w:hover { box-shadow: inset 0 -2px 0 #9a9ab8; }
.annot-text .hl.c0 { background: #ffe066; } .annot-text .hl.c1 { background: #8ce99a; } .annot-text .hl.c2 { background: #a5d8ff; }
.annot-text .hl.c3 { background: #fcc2d7; } .annot-text .hl.c4 { background: #ffc078; } .annot-text .hl.c5 { background: #d0bfff; }
.annot-text .hl.sel { box-shadow: inset 0 -3px 0 var(--ink); }
.annot-text .w.end::after { content: attr(data-n); display: inline-block; margin-left: 2px; vertical-align: super; font-size: 11px; line-height: 16px; min-width: 16px; padding: 0 3px; border-radius: 8px; background: var(--ink); color: #fff; text-align: center; font-weight: 800; }
.annot-text .w.pend { outline: 3px dashed var(--accent); outline-offset: 1px; }
.annot-text .w.drag { background: #e3e3f5; }
.annot-ed { border: 2px solid var(--line); border-left: 10px solid var(--hl, var(--sun)); border-radius: 12px; background: var(--paper); padding: 10px 12px; margin: 4px 0 12px; line-height: 1.4; font-size: 16px; display: grid; gap: 8px; box-shadow: var(--shadow); -webkit-user-select: text; user-select: text; }
.annot-ed.pend { border-left-color: var(--accent); }
.annot-ed p { margin: 0; }
.annot-q { font-style: italic; color: var(--muted); max-height: 4.5em; overflow: auto; }
.annot-ta { width: 100%; box-sizing: border-box; font: inherit; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 64px; }
.annot-side h3 { margin: 0 0 6px; font-size: 17px; }
.annot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.annot-item { display: grid; gap: 4px; width: 100%; text-align: left; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); padding: 8px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.annot-item.on { box-shadow: 0 0 0 3px var(--accent2); }
.annot-badge { justify-self: start; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 8px; font-weight: 800; font-size: 12px; color: #1d1d3b; }
.annot-item q { color: var(--muted); font-style: italic; }
.annot-note { font-weight: 700; }
.annot-note.none { font-weight: 600; color: var(--muted); }

/* ---------- Lesson notebook ---------- */
.band-btn .nb-count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; line-height: 20px; }
.nb-bg { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 45, .45); display: flex; justify-content: flex-end; }
.nb { background: var(--paper); color: var(--ink); width: min(460px, 100%); height: 100%; overflow: auto; border-left: 3px solid var(--line); padding: 14px 16px 30px; box-sizing: border-box; display: grid; align-content: start; gap: 12px; }
.nb-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -14px; background: var(--paper); padding: 6px 0; z-index: 1; }
.nb-head h2 { margin: 0; font-size: 22px; flex: 1; }
.nb-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-filters .chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.nb-add { display: grid; gap: 6px; background: var(--soft); border: 2px solid var(--line); border-radius: 12px; padding: 10px; }
.nb-add textarea { font: inherit; border: 2px solid var(--line); border-radius: 10px; padding: 8px; min-height: 60px; }
.nb-group { border-top: 2px dashed #c9c9dd; padding-top: 8px; }
.nb-group h3 { font-size: 16px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.nb-group h3 span { flex: 1; }
.nb-entry { border: 2px solid var(--line); border-left-width: 10px; border-radius: 10px; padding: 8px 10px; margin: 6px 0; display: grid; gap: 4px; font-size: 15px; }
.nb-entry q { font-style: italic; }
.nb-entry .nb-tag { justify-self: start; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 8px; font-weight: 800; font-size: 12px; color: #1d1d3b; }
.nb-entry.note { border-left-color: var(--accent2); background: #f7f9ff; }
.nb-entry .row { justify-content: flex-end; }
.nb-foot { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) { .band-btn .bb-txt { display: none; } .band-btn { padding: 6px 10px; } }
.annot-text .sp { padding: 3px 0; }
@media (max-width: 600px) {
  .annot-lbl { display: none; }
  .annot-tag { min-height: 34px; font-size: 13px; padding: 2px 10px 2px 4px; gap: 4px; }
  .annot-tag i { width: 18px; height: 18px; }
  .annot-text { padding: 4px 10px; }
  .annot-ed { padding: 8px; }
}
/* note box: in the margin column (wide screens) or docked at the bottom (small screens), never over the text */
.annot-slot .annot-ed { margin: 0 0 12px; box-shadow: 3px 3px 0 var(--ink); font-size: 15px; }
.annot-slot .annot-tag, .annot-ed.dock .annot-tag { min-height: 32px; font-size: 13px; padding: 2px 9px 2px 4px; gap: 4px; }
.annot-slot .annot-tag i, .annot-ed.dock .annot-tag i { width: 16px; height: 16px; }
.annot-slot .annot-tags { gap: 4px; }
.annot-ed.dock { position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom, 0px)); z-index: 40; margin: 0; max-width: 840px; margin-inline: auto; max-height: 45vh; overflow: auto; padding: 8px 10px; gap: 6px; box-shadow: 0 -4px 18px rgba(20, 20, 45, .25), 3px 3px 0 var(--ink); }
.annot-ed.dock .annot-q { max-height: 1.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.annot-ed.dock .annot-tags { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.annot-ed.dock .annot-tag { flex: none; }
.annot-ed.dock .annot-ta { min-height: 48px; }
.act-annot.docked { padding-bottom: 46vh; }

/* ---------- Draw It: a little paint studio (colors left, picture tools right, paper in the middle) ---------- */
.studio { display: grid; grid-template-columns: 138px minmax(0, 1fr) 138px; grid-template-areas: "colors paper tools"; gap: 10px; align-items: start; margin-bottom: 8px; }
.studio-colors { grid-area: colors; }
.studio-tools { grid-area: tools; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.studio .draw-pad { grid-area: paper; width: 100%; max-width: calc((100vh - 270px) * 900 / 520); justify-self: center; margin: 0; border: 4px solid var(--ink); border-radius: 16px; background-color: #fff; }
.studio .draw-pad canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.studio-panel { background: #ff7a45; border: 3px solid var(--ink); border-radius: 18px; padding: 8px; box-shadow: 4px 4px 0 var(--ink); }
.studio-colors { display: flex; flex-direction: column; gap: 8px; }
.studio-now { display: none; height: 52px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; align-items: center; justify-content: space-around; padding: 0 6px; }
.studio-now .now-ico svg { width: 38px; height: 38px; display: block; }
.studio-now .now-dot { border-radius: 50%; border: 2px solid var(--ink); max-width: 34px; max-height: 34px; }
.studio .swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.studio .swatch { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; border: 3px solid var(--ink); box-shadow: none; padding: 0; cursor: pointer; }
.studio .swatch.on { outline: 4px solid #fff; outline-offset: -1px; transform: scale(1.08); box-shadow: 0 0 0 6px var(--ink); }
.tile-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 50px; padding: 3px 2px 2px; background: #7fd3ff; border: 3px solid var(--ink); border-radius: 14px; font: 800 11px/1.1 Nunito, system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.tile-btn svg { width: 30px; height: 30px; display: block; }
.tile-btn.on { background: var(--sun); box-shadow: inset 0 0 0 3px #fff; }
.tile-btn.wide { grid-column: span 2; flex-direction: row; gap: 6px; min-height: 44px; font-size: 13px; background: #ffe4d6; }
.tile-btn.wide svg { width: 26px; height: 26px; }
.tile-btn:disabled { opacity: .45; cursor: default; }
.tile-btn:focus-visible, .studio .swatch:focus-visible { outline: 4px solid var(--sky); outline-offset: 2px; }
.draw-look { margin: 0; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 2px 4px 4px; text-align: center; }
.draw-look figcaption { font-weight: 800; font-size: 12px; }
.draw-look img { display: block; width: 100%; max-height: 11vh; object-fit: contain; border-radius: 8px; }
.draw-act .act-head { margin-bottom: 8px; }
.draw-hint { margin: 0 0 6px; }
.my-drawing { margin: 14px auto; max-width: 460px; }
.my-drawing figcaption { font-weight: 800; margin-bottom: 4px; }
.my-drawing img { width: 100%; border: 3px solid var(--line); border-radius: 14px; background: #fff; }
@media (max-width: 760px) {
  .studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "colors" "paper" "tools"; }
  .studio .draw-pad { max-width: none; }
  .studio-colors { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .draw-look { display: flex; align-items: center; gap: 6px; }
  .draw-look img { width: auto; max-height: 56px; }
  .studio-now { display: flex; height: 44px; width: 86px; }
  .studio .swatches { display: flex; flex-wrap: wrap; gap: 5px; flex: 1 1 100%; }
  .studio .swatch { width: 34px; height: 34px; }
  .studio-tools { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
  .tile-btn.wide { grid-column: span 2; }
}

/* ---------- Little learners (K-2): bigger targets, read-aloud ---------- */
.read-btn { float: right; margin: 0 0 8px 10px; font-size: 18px; }
body.kids .read-btn { font-size: 22px; padding: 10px 18px; background: #ffd23f; border-color: #e0b400; }
body.kids .navbar .btn { font-size: 22px; padding: 14px 28px; min-height: 56px; }
body.kids .draw-act .act-tag { display: none; }
body.kids .slide-body { font-size: 26px; line-height: 1.45; }
body.kids .act-prompt { font-size: 26px; }
body.kids .choice { font-size: 22px; min-height: 60px; }
body.kids .band .bb-txt, body.kids .band-meta .stars { display: none; }
@media (max-width: 640px) {
  body.kids .slide-body, body.kids .act-prompt { font-size: 21px; }
  body.kids .read-btn span { display: none; }
}
