/* Mastery Desk, AI Tutor 2: two-panel lesson (chat left, interactive board right), topics home. QSI colours via student.css tokens. */
.sapp .tu-topics { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.sapp .tu-topic { background:var(--s-bg); border-radius:14px; padding:12px 14px; display:flex; flex-direction:column; gap:8px; }
.sapp .tu-topic b { font-family:var(--f-round); font-size:1.05rem; }
.sapp .tu-x { padding:2px 8px; box-shadow:none; background:transparent; color:var(--s-muted); }
.sapp .tu-review { border-left:5px solid var(--s-gold); }

.sapp .tu-wrap { display:grid; grid-template-columns:minmax(300px,400px) 1fr; gap:16px; align-items:stretch; min-height:calc(100vh - 140px); }
.sapp .tu-left { display:flex; flex-direction:column; gap:10px; min-height:0; max-height:calc(100vh - 140px); }
.sapp .tu-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.sapp .tu-head b { font-family:var(--f-round); font-size:1.1rem; }
.sapp .tu-mbar { height:8px; }
.sapp .tu-chat { flex:1; overflow:auto; display:flex; flex-direction:column; gap:10px; padding:4px 2px; min-height:180px; }
.sapp .tu-bot { display:flex; gap:8px; align-items:flex-start; font-size:1.02rem; line-height:1.5; }
.sapp .tu-ava { width:34px; height:34px; flex:none; border-radius:50%; display:grid; place-items:center; background:var(--sky); font-size:1.1rem; }
.sapp .tu-me { align-self:flex-end; max-width:85%; background:var(--s-accent); color:var(--s-accent-ink); padding:8px 12px; border-radius:16px 16px 4px 16px; }
.sapp .tu-replay { border:0; background:none; cursor:pointer; opacity:.55; font-size:.9rem; padding:0 2px; }
.sapp .tu-replay:hover { opacity:1; }
.sapp .tu-choices { display:flex; flex-direction:column; gap:6px; }
.sapp .tu-choice { text-align:left; background:var(--sky); color:var(--sky-i); box-shadow:none; border:2px solid transparent; }
.sapp .tu-choice:hover { border-color:var(--s-accent); }
.sapp .tu-dots { display:flex; gap:5px; padding:6px 42px; }
.sapp .tu-dots i { width:8px; height:8px; border-radius:50%; background:var(--s-muted); animation:tuBlink 1s infinite; }
.sapp .tu-dots i:nth-child(2) { animation-delay:.15s; } .sapp .tu-dots i:nth-child(3) { animation-delay:.3s; }
@keyframes tuBlink { 0%,80%,100% { opacity:.25 } 40% { opacity:1 } }

.sapp .tu-board { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; text-align:center; min-height:420px; position:relative; overflow:hidden;
  background:radial-gradient(circle at 50% 40%, var(--s-card), var(--s-bg)); }
.sapp .tu-btitle { font-family:var(--f-round); font-size:1.3rem; font-weight:700; }
.sapp .tu-cap { font-family:var(--f-round); font-size:1.15rem; }
.sapp .tu-big { font-size:4rem; line-height:1; }
.sapp .tu-empty { display:flex; flex-direction:column; align-items:center; gap:8px; opacity:.8; }
.sapp .tu-in { animation:tuIn .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes tuIn { from { transform:scale(.85); opacity:0 } to { transform:none; opacity:1 } }

/* dots */
.sapp .tu-dots-wrap { display:flex; flex-wrap:wrap; gap:18px; justify-content:center; max-width:560px; }
.sapp .tu-group { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; max-width:160px; padding:12px; border-radius:50%; background:color-mix(in srgb, var(--c) 12%, transparent); }
.sapp .tu-group.tu-free { max-width:420px; border-radius:24px; }
.sapp .tu-dot { width:26px; height:26px; border-radius:50%; background:var(--c); cursor:pointer; transition:transform .15s; box-shadow:inset 0 -3px 0 rgba(0,0,0,.18); }
.sapp .tu-dot:hover { transform:scale(1.15); }
.sapp .tu-dot.on { outline:4px solid var(--s-gold); outline-offset:2px; }
.sapp .tu-count { font-family:var(--f-round); font-size:1.1rem; }
/* array */
.sapp .tu-array { display:grid; gap:8px; max-width:440px; width:100%; }
.sapp .tu-array i { aspect-ratio:1; border-radius:8px; background:var(--s-accent); cursor:pointer; box-shadow:inset 0 -3px 0 rgba(0,0,0,.18); }
.sapp .tu-array i.on { background:var(--s-gold); }
/* fraction */
.sapp .tu-frac { display:flex; flex-direction:column; align-items:center; gap:16px; }
.sapp .tu-pie { width:220px; height:220px; }
.sapp .tu-slice { fill:var(--s-card); stroke:var(--s-ink); stroke-width:2; cursor:pointer; transition:fill .15s; }
.sapp .tu-slice.on { fill:var(--s-accent); }
.sapp .tu-fbar { display:flex; width:320px; max-width:90%; height:38px; border:2px solid var(--s-ink); border-radius:8px; overflow:hidden; }
.sapp .tu-fbar i { flex:1; border-right:2px solid var(--s-ink); cursor:pointer; background:var(--s-card); }
.sapp .tu-fbar i:last-child { border-right:0; } .sapp .tu-fbar i.on { background:var(--s-gold); }
.sapp .tu-fr { display:inline-flex; flex-direction:column; align-items:center; vertical-align:middle; margin-right:6px; line-height:1.1; }
.sapp .tu-fr span { width:26px; border-top:2px solid currentColor; }
/* number line */
.sapp .tu-nl { width:100%; max-width:620px; color:var(--s-ink); }
.sapp .tu-nl text { font:600 16px var(--f-body); fill:currentColor; }
.sapp .tu-tick { cursor:pointer; }
/* flashcard + keypad */
.sapp .tu-flash { display:flex; gap:24px; align-items:center; justify-content:center; flex-wrap:wrap; }
.sapp .tu-card { min-width:200px; padding:40px 30px; border-radius:16px; background:var(--s-card); border:3px solid var(--s-ink); font:700 2.6rem var(--f-round); box-shadow:6px 6px 0 var(--s-line); transition:background .2s; }
.sapp .tu-card.right { background:var(--sage); } .sapp .tu-card.wrong { background:var(--peach); }
.sapp .tu-keypad { display:grid; grid-template-columns:repeat(3,58px); gap:8px; padding:14px; border-radius:18px; background:#28395b; }
.sapp .tu-kout { grid-column:1/-1; background:#fff; color:#242424; border-radius:10px; font:700 1.5rem var(--f-round); padding:6px; min-height:44px; }
.sapp .tu-key { height:52px; border:0; border-radius:50%; background:#fff; color:#28395b; font:700 1.3rem var(--f-round); cursor:pointer; }
.sapp .tu-key.ok { background:#1f8a4c; color:#fff; } .sapp .tu-key.del { background:#c2412d; color:#fff; }
.sapp .tu-key:active { transform:scale(.92); }
/* bars, steps, emoji */
.sapp .tu-bars { width:100%; max-width:520px; display:flex; flex-direction:column; gap:10px; }
.sapp .tu-barrow { display:grid; grid-template-columns:110px 1fr 50px; gap:10px; align-items:center; text-align:left; }
.sapp .tu-barrow div { background:var(--s-line); border-radius:8px; height:26px; overflow:hidden; }
.sapp .tu-barrow i { display:block; height:100%; border-radius:8px; }
.sapp .tu-steps { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:center; }
.sapp .tu-step { width:120px; padding:12px 8px; border-radius:16px; background:color-mix(in srgb, var(--c) 14%, var(--s-card)); border:2px solid var(--c); font-weight:700; }
.sapp .tu-se { font-size:2rem; }
.sapp .tu-arrow { font-size:1.4rem; color:var(--s-muted); }
.sapp .tu-emojis { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; font-size:2.6rem; max-width:520px; }
.sapp .tu-wrapup { display:flex; flex-direction:column; align-items:center; gap:10px; width:min(420px,100%); }
.sapp .tu-wrapup .bar { width:100%; }

/* LEVEL UP! */
.tu-levelup { position:fixed; inset:0; z-index:50; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none; background:rgba(14,20,36,.55); }
.tu-levelup.go { animation:tuLv 2.6s ease forwards; }
.tu-lv1, .tu-lv2 { font:900 clamp(3rem,10vw,7rem)/0.95 "Courier New", monospace; color:#efc018; text-shadow:6px 6px 0 #c2412d, 0 0 30px rgba(239,192,24,.6); letter-spacing:.06em; }
.tu-lv3 { margin-top:14px; font:700 1.3rem var(--f-round, sans-serif); color:#fff; }
@keyframes tuLv { 0% { opacity:0; transform:scale(.6) } 15% { opacity:1; transform:scale(1.08) } 25% { transform:scale(1) } 80% { opacity:1 } 100% { opacity:0 } }

@media (max-width:820px) {
  .sapp .tu-wrap { grid-template-columns:1fr; }
  .sapp .tu-board { order:-1; min-height:300px; }
  .sapp .tu-left { max-height:none; }
  .sapp .tu-chat { max-height:42vh; }
  .sapp .tu-keypad { grid-template-columns:repeat(3,50px); } .sapp .tu-key { height:46px; }
  .sapp .tu-card { font-size:2rem; padding:28px 20px; min-width:150px; }
}
