/* ==========================================================================
   mastery-teacher.css — the teacher cohort view (mastery/teacher.html):
   levels heatmap (pupils x concepts), misconception heatmap, flags, who is
   due or stuck. Mobile-first: tables scroll inside their own box at 320px.
   Colours: theme tokens via the mastery.css aliases.
   ========================================================================== */
.m-cohort-pick { margin: 0 0 1.25rem; max-width: 420px; }
.m-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--m-radius); }
.m-scroll:focus-visible { outline: 3px solid var(--m-accent-2); outline-offset: 2px; }
.m-heat { border-collapse: separate; border-spacing: 2px; font-size: .78rem; min-width: 100%; }
.m-heat th { font-weight: 600; text-align: left; padding: .3rem .4rem; white-space: nowrap; }
.m-heat thead th { color: var(--muted); font-size: .72rem; }
.m-hm-unit { text-align: center !important; border-bottom: 2px solid rgba(var(--m-accent-rgb), .5); }
.m-hm-c { text-align: center !important; }
.m-hm-name { position: sticky; left: 0; z-index: 1; background: var(--navy2); min-width: 7.5rem; }
.m-hm { position: relative; width: 2.1rem; min-width: 2.1rem; height: 2.1rem; text-align: center; font-weight: 700; font-size: .72rem;
  border-radius: 6px; background: var(--navy3); color: var(--white); }
.m-legend .m-hm { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin: 0 .2rem 0 .6rem; height: 1.6rem; width: 1.8rem; min-width: 1.8rem; }
.m-legend { font-size: .78rem; color: var(--muted); line-height: 2.2; }
.m-hm--too_little_evidence { background: rgba(var(--m-accent-rgb), .18); }
.m-hm--insecure { background: transparent; box-shadow: inset 0 0 0 2px var(--orange); }
.m-hm--developing { background: rgba(var(--m-accent-rgb), .45); }
.m-hm--secure { background: transparent; box-shadow: inset 0 0 0 2px var(--success); }
.m-hm--mastered { background: var(--success); color: var(--ia-text); }
.m-hm--refresh { background: rgba(var(--gold-rgb), .35); }
.m-hm--gw-ready { background: transparent; box-shadow: inset 0 0 0 2px var(--success); }
.m-hm--gw-not_yet_ready { box-shadow: inset 0 0 0 2px var(--orange); background: transparent; }
.m-hm.is-due::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.m-hm-key { margin: .6rem 0 0; font-size: .82rem; }
.m-hm-key summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; }
.m-hm-key ul { padding-left: 1.1rem; columns: 1; }

.m-heat--mis th[scope="row"] { white-space: normal; min-width: 11rem; }
.m-heat--mis code { font-size: .74rem; }
.m-mis-concept { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
.m-mis { min-width: 5rem; padding: .35rem .5rem; border-radius: 6px; vertical-align: top; font-weight: 700; background: var(--navy3); }
.m-mis--1 { background: rgba(var(--m-accent-rgb), .15); }
.m-mis--2 { background: rgba(var(--m-accent-rgb), .3); }
.m-mis--3 { background: rgba(var(--m-accent-rgb), .45); }
.m-mis--4 { background: rgba(var(--m-accent-rgb), .6); }
.m-mis-names { display: block; font-weight: 400; font-size: .72rem; color: var(--white); }

.m-flag { margin: 0 0 1rem; }
.m-flag ul, .m-who { padding-left: 1.1rem; margin: .25rem 0; }
.m-flag li, .m-who li { margin: .3rem 0; }
.m-flag-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 .2rem; }
.m-flag-form { display: grid; gap: .4rem; margin: .4rem 0; }
.m-flag-form .m-input { width: 100%; }
.m-flag-done { color: var(--muted); }
.m-flag-history { margin-top: .75rem; }
.m-flag-history ol { padding-left: 1.1rem; }
.m-flag-history li { margin: .35rem 0; }
.m-flag-status { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.m-flag-code { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 4px; background: var(--m-work); color: var(--ia-text); }

@media (min-width: 768px) {
  .m-hm-key ul { columns: 2; }
  .m-heat { font-size: .82rem; }
}
