/* Mi-NB · NB School (Slice 6) */
.school-root { padding-bottom: 8px; }
.school-h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; margin: 0; }
.school-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.school-sec { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 24px 0 8px; }
.school-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.school-summary { padding: 16px; margin-top: 16px; }
.school-summary .big { font-size: 20px; font-weight: 650; }
.school-segbar { display: grid; gap: 4px; margin-top: 12px; }
.school-segbar i { display: block; height: 4px; border-radius: 2px; background: var(--hairline); }
.school-segbar i.on { background: var(--ink); }
.school-segbar i.red { background: var(--red-strong, #B42318); }
.school-segbar i.amb { background: var(--amber-strong, #8A5300); }
.school-summary .meta { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.school-summary .meta b { color: var(--ink); font-weight: 600; }
.school-list { overflow: hidden; }
.school-mrow {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 16px;
  border: none; border-bottom: 1px solid var(--hairline); background: transparent; text-align: left;
  cursor: pointer; min-height: 52px; font: inherit; color: inherit;
}
.school-mrow:last-child { border-bottom: none; }
.school-mrow .num {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--hairline);
  display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--muted); flex-shrink: 0;
}
.school-mrow .num.done { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.school-mrow .num.red { border-color: #F97066; color: #B42318; background: var(--red-bg); }
html[data-theme="dark"] .school-mrow .num.red { color: #F97066; }
.school-mrow .body { flex: 1; min-width: 0; }
.school-mrow .t { font-size: 13px; font-weight: 600; line-height: 1.35; }
.school-mrow .m { font-size: 11px; color: var(--muted); margin-top: 2px; }
.school-mrow .why { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.school-mrow .st { text-align: right; flex-shrink: 0; }
.school-mrow .st .s1 { font-size: 13px; font-weight: 600; }
.school-mrow .st .s2 { font-size: 11px; color: var(--muted); margin-top: 2px; }
.school-mrow.locked .t { color: var(--muted); }
.school-st-red { color: #B42318; }
html[data-theme="dark"] .school-st-red { color: #F97066; }
.school-note-foot { font-size: 11px; color: var(--muted); margin-top: 16px; text-align: center; line-height: 1.4; }
.school-back {
  display: inline-flex; align-items: center; gap: 4px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; padding: 8px 0; margin-bottom: 8px;
}
.school-reason { padding: 12px 16px; margin-top: 16px; display: flex; gap: 12px; }
.school-reason .rt { font-size: 13px; font-weight: 600; }
.school-reason .rm { font-size: 11px; color: var(--muted); margin-top: 4px; }
.school-vrow {
  display: flex; gap: 12px; align-items: center; padding: 8px 16px; min-height: 52px; width: 100%;
  border: none; border-bottom: 1px solid var(--hairline); background: transparent; text-align: left; cursor: pointer; font: inherit;
}
.school-vrow:last-child { border-bottom: none; }
.school-vph {
  width: 32px; height: 56px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--rail);
  display: grid; place-items: center; color: var(--muted); flex-shrink: 0; font-size: 10px;
}
.school-vrow.locked { cursor: default; }
.school-vrow.locked .t { color: var(--muted); }
.school-vstate { margin-left: auto; font-size: 11px; font-weight: 600; flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.school-quizbox { padding: 16px; margin-top: 16px; }
.school-qhint { font-size: 11px; color: var(--muted); text-align: center; margin-top: 8px; display: flex; gap: 4px; align-items: center; justify-content: center; }
.school-quiet { font-size: 11px; color: var(--muted); text-align: center; margin-top: 8px; }
.school-empty { text-align: center; padding: 48px 24px; margin-top: 24px; }
.school-loading { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.school-err { padding: 16px; margin-top: 16px; border: 1px solid var(--hairline); border-radius: var(--radius); }
.school-err p { font-size: 13px; margin: 0 0 12px; }
.school-tag-demo { font-size: 10px; border: 1px dashed var(--muted); border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }

/* Immersive player / quiz */
html.school-immersive .bottomnav,
html.school-immersive #app-rail { display: none !important; }
html.school-immersive.mi-nb-authed body { padding-bottom: 0; }
#school-stage {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 130;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
#school-stage.on { display: block; }
html.school-stage-open { overflow: hidden; }
.school-player { background: #0b0b0c; min-height: 100dvh; color: #f5f5f3; display: flex; flex-direction: column; }
.school-ptop { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 0 8px; border-bottom: 1px solid #2a2a2c; }
.school-ptop .school-back { color: #f5f5f3; }
.school-ptop .pt { font-size: 13px; font-weight: 600; }
.school-ptop .pm { font-size: 11px; color: #9a9a96; }
.school-player-fs {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: min(1100px, 100%);
  margin: 0 auto;
  align-self: center;
}
.school-player-fs:fullscreen,
.school-player-fs:-webkit-full-screen {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  background: #0b0b0c;
}
.school-player-fs:fullscreen .school-pstage,
.school-player-fs:-webkit-full-screen .school-pstage {
  flex: 1;
  min-height: 0;
}
.school-player-fs:fullscreen .school-video-wrap,
.school-player-fs:-webkit-full-screen .school-video-wrap {
  width: 100%;
  max-width: none;
  max-height: none;
  height: 100%;
  aspect-ratio: auto;
}
.school-pstage { flex: 1; display: flex; align-items: center; justify-content: center; background: #000; min-height: 0; position: relative; }
.school-video-wrap {
  position: relative;
  width: min(100%, 1100px, calc((100dvh - 220px) * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 220px);
  background: #000;
}
.school-video-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; }
.school-cap { position: absolute; left: 12px; right: 12px; bottom: 10px; text-align: center; pointer-events: none; z-index: 2; }
.school-cap span {
  background: rgba(11, 11, 12, 0.84); color: #f5f5f3; font-size: 17px; font-weight: 600; line-height: 1.6;
  padding: 3px 10px; border-radius: 6px; box-decoration-break: clone;
}
.school-resume-chip {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(20, 20, 19, 0.82); color: #f5f5f3; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; z-index: 2;
}
.school-imp-chip {
  position: absolute; top: 12px; right: 12px; background: rgba(20, 20, 19, 0.82); color: #f5f5f3;
  font-size: 10px; font-weight: 600; padding: 4px 8px; border-radius: 999px; z-index: 2;
}
.school-ended-ov {
  position: absolute; inset: 0; background: rgba(11, 11, 12, 0.78); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: #f5f5f3; z-index: 3;
  padding: 16px;
}
.school-ended-ov .btn-primary,
.school-ended-ov .btn-secondary { min-width: 200px; }
.school-vctl { padding: 4px 16px 8px; }
.school-track { position: relative; height: 24px; display: flex; align-items: center; cursor: pointer; }
.school-track .rail { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
.school-track .watched { position: absolute; left: 0; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.42); }
.school-track .played { position: absolute; left: 0; height: 4px; border-radius: 2px; background: #f5f5f3; }
.school-track .knob {
  position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #f5f5f3;
  transform: translateX(-7px); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.school-ctlrow { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.school-ctlrow button {
  width: 40px; height: 40px; border-radius: var(--radius); border: none; background: transparent;
  color: #f5f5f3; cursor: pointer;
}
.school-ctlrow button.pressed { background: rgba(255, 255, 255, 0.14); }
.school-ctlrow .time { font-size: 11px; margin-left: 4px; color: #d8d8d4; }
.school-pbottom { padding: 12px 16px 16px; background: var(--bg); border-top: 1px solid var(--hairline); color: var(--ink); }
.school-pbottom .btn-primary { width: 100%; }

/* Quiz */
.school-quiz { min-height: 100dvh; background: var(--bg); display: flex; flex-direction: column; }
.school-qtop { display: flex; align-items: center; min-height: 56px; padding: 0 8px; border-bottom: 1px solid var(--hairline); position: sticky; top: 0; z-index: 5; background: var(--bg); }
.school-qtop .qc { flex: 1; text-align: center; font-size: 13px; font-weight: 600; }
.school-qprog { padding: 12px 16px 0; }
.school-pbar { height: 4px; border-radius: 2px; background: var(--hairline); overflow: hidden; }
.school-pbar i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.school-qbody { padding: 16px 16px 120px; flex: 1; }
.school-qvid { font-size: 11px; color: var(--muted); }
.school-qprompt { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; margin-top: 8px; }
.school-opt {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 16px; min-height: 52px;
  border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--surface); text-align: left;
  cursor: pointer; font-size: 15px; line-height: 1.4; font-family: inherit; color: inherit;
}
.school-opt.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.school-opt.right { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.school-opt.wrong { border-color: #B42318; box-shadow: inset 0 0 0 1px #B42318; background: var(--red-bg); }
html[data-theme="dark"] .school-opt.wrong { border-color: #F97066; box-shadow: inset 0 0 0 1px #F97066; }
.school-opt.dim { opacity: 0.55; pointer-events: none; }
.school-opt .mark {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--hairline); flex-shrink: 0; margin-top: 2px;
}
.school-opt.right .mark { background: var(--ink); border-color: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 11px; }
.school-opt.wrong .mark { background: #B42318; border-color: #B42318; color: #fff; display: grid; place-items: center; }
.school-opt .tag { display: block; font-size: 11px; font-weight: 600; margin-top: 4px; }
.school-opt.wrong .tag { color: #B42318; }
.school-fb { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface); }
.school-fb .ft { font-size: 13px; font-weight: 650; }
.school-fb .why-h { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-top: 12px; }
.school-fb .vlink { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: underline; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.school-qfoot {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px 16px; background: var(--bg);
  border-top: 1px solid var(--hairline); z-index: 20; max-width: 600px; margin: 0 auto;
}
.school-qfoot .btn-primary { width: 100%; }
.school-qfoot .school-qhint { margin-top: 8px; }

/* Results */
.school-res { padding: 24px 16px; margin-top: 16px; text-align: center; }
.school-res .score { font-size: 28px; font-weight: 650; margin-top: 8px; }
.school-res .rs { font-size: 13px; color: var(--muted); margin-top: 4px; }
.school-crit { margin-top: 16px; padding: 16px; border: 1px solid #B42318; border-radius: var(--radius); text-align: left; }
html[data-theme="dark"] .school-crit { border-color: #F97066; }
.school-crit h3 { font-size: 13px; font-weight: 650; color: #B42318; margin: 0 0 8px; }
html[data-theme="dark"] .school-crit h3 { color: #F97066; }
.school-mmore {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px;
  padding: 12px 16px; border: none; border-top: 1px solid var(--hairline); background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.school-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; padding: 0 16px 24px; }

/* Sheets (above #school-stage z-index 130 when quiz/player open) */
#school-sheets .school-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(11, 11, 12, 0.45); z-index: 140; display: none;
}
#school-sheets .school-sheet-backdrop.on { display: block; }
#school-sheets .school-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 600px; margin: 0 auto;
  background: var(--elevated); border: 1px solid var(--hairline); border-bottom: none;
  border-radius: 10px 10px 0 0; z-index: 150; padding: 8px 16px 24px; max-height: 90dvh; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.28s ease-out;
}
#school-sheets .school-sheet.on { transform: translateY(0); }
.school-sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--hairline); margin: 4px auto 12px; }
.school-sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.school-sheet-h h2 { font-size: 15px; font-weight: 650; margin: 0; }
.school-tline { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.school-tline.now { font-weight: 600; }
.school-tline.ahead { color: var(--muted); }

/* School PIN sheet (reuse login pad sizing) */
.school-pin-decl {
  border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px; display: flex; gap: 12px;
  align-items: flex-start; margin: 12px 0; cursor: pointer;
}
.school-pin-decl input { margin-top: 3px; }
.school-pin-dots { display: flex; gap: 12px; justify-content: center; margin: 12px 0; }
.school-pin-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--hairline); }
.school-pin-dot.filled { background: var(--ink); border-color: var(--ink); }
.school-pin-dot.err { background: #B42318; border-color: #B42318; }
.school-pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.school-pin-key {
  min-height: 52px; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--surface);
  font-size: 18px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.school-pin-key:disabled { opacity: 0.35; cursor: not-allowed; }
.school-pin-alert { font-size: 13px; color: #B42318; margin: 8px 0; }
.school-pin-lockbox {
  border: 1px solid #B42318; background: var(--red-bg); border-radius: var(--radius); padding: 12px; margin: 12px 0;
}
.school-pin-label { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }

@media (prefers-reduced-motion: reduce) {
  .school-sheet { transition: none; }
}
