:root {
  --ink: #111111;
  --graphite: #1b1f24;
  --navy: #12386b;
  --blue: #2b7fd3;
  --cyan: #21c7d8;
  --ice: #d8eaff;
  --porcelain: #f7f3ec;
  --paper: #fffaf3;
  --line: rgba(17, 17, 17, .12);
  --muted: #657180;
  --good: #12a56f;
  --bad: #d34a4a;
  --warn: #d58b19;
  --shadow: 0 24px 70px rgba(18, 56, 107, .16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 12%, rgba(33, 199, 216, .24), transparent 26%),
    linear-gradient(135deg, #fffaf3 0%, #f7f3ec 47%, #d8eaff 100%);
  color: var(--ink);
  font-family: Inter, Manrope, Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(255, 250, 243, .82);
  border-bottom: 1px solid rgba(17, 17, 17, .1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.mark {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  background: var(--graphite);
  color: var(--paper);
  border-radius: 17px 17px 17px 5px;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 16px 32px rgba(27, 31, 36, .18);
}

.mark::before {
  content: "";
  position: absolute;
  inset: -6px auto auto -7px;
  width: 21px;
  height: 21px;
  border-left: 3px solid var(--cyan);
  border-bottom: 3px solid var(--cyan);
  transform: rotate(-17deg);
}

.brand b {
  display: block;
  font-size: 15px;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-switch {
  display: flex;
  gap: 8px;
  padding: 6px;
  max-width: min(760px, 100%);
  overflow-x: auto;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.role-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--graphite);
  font-size: 13px;
  font-weight: 800;
}

.role-btn.active {
  background: var(--navy);
  color: var(--paper);
  box-shadow: 0 10px 24px rgba(18, 56, 107, .22);
}

.local-mode-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 12px clamp(18px, 4vw, 46px);
  background: #fff1d6;
  color: #573c14;
  border-bottom: 1px solid #e7c477;
  font-size: 13px;
}

.local-mode-notice[hidden] {
  display: none;
}

.local-mode-notice a {
  color: #173b72;
  font-weight: 800;
}

body.student-mode .role-switch {
  display: none;
}

body.student-mode .topbar {
  justify-content: center;
}

.screen {
  display: none;
  min-height: calc(100vh - 87px);
  padding: clamp(18px, 4vw, 46px);
}

.screen.active {
  display: block;
}

.label {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  color: var(--graphite);
  font-size: clamp(38px, 6vw, 78px);
  font-weight: 950;
  line-height: .94;
}

h2 {
  color: var(--graphite);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 920;
  line-height: .98;
}

p {
  color: rgba(17, 17, 17, .72);
  font-size: 16px;
  line-height: 1.52;
}

.student-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.student-side {
  display: grid;
  gap: 16px;
}

.lesson-card {
  position: relative;
  min-height: 410px;
  padding: 28px;
  overflow: hidden;
  border-radius: 26px;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.lesson-card::before {
  content: "x²  √x  25%  y = kx + b";
  position: absolute;
  top: 22px;
  right: -24px;
  color: rgba(216, 234, 255, .16);
  font-size: 34px;
  font-weight: 900;
  transform: rotate(-8deg);
  white-space: nowrap;
}

.lesson-card::after {
  content: "";
  position: absolute;
  right: -68px;
  bottom: -76px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: var(--cyan);
}

.lesson-card .label {
  color: #b8d9ff;
}

.lesson-card h1 {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  color: var(--paper);
  font-size: clamp(36px, 4vw, 58px);
}

.lesson-card p:last-child {
  position: relative;
  z-index: 1;
  max-width: 300px;
  margin-top: 24px;
  color: rgba(255, 250, 243, .78);
}

.mini-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-progress div,
.teacher-note,
.task-board,
.phone,
.phone-commentary,
.dashboard {
  border: 1px solid rgba(17, 17, 17, .12);
  background: rgba(255, 250, 243, .82);
  box-shadow: var(--shadow);
}

.mini-progress div {
  min-height: 96px;
  padding: 14px;
  border-radius: 18px;
}

.xp-card {
  min-height: 132px;
  padding: 18px;
  border: 1px solid rgba(33, 199, 216, .35);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(216, 234, 255, .94), rgba(234, 249, 251, .92));
  box-shadow: var(--shadow);
}

.xp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.xp-top span,
.xp-top b {
  color: var(--navy);
  font-weight: 950;
}

.xp-top span {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.xp-card p {
  margin-top: 12px;
  color: rgba(18, 56, 107, .78);
  font-size: 14px;
  font-weight: 750;
}

.streak-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 250, 243, .68);
  box-shadow: inset 0 0 0 1px rgba(18, 56, 107, .1);
}

.streak-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.streak-head span {
  color: var(--navy);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.streak-head b {
  color: var(--blue);
  font-size: 14px;
  font-weight: 950;
}

.streak-lights {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.streak-lights i {
  position: relative;
  display: block;
  height: 34px;
  border-radius: 13px 13px 13px 4px;
  background: rgba(18, 56, 107, .14);
  box-shadow: inset 0 0 0 1px rgba(18, 56, 107, .08);
  transform: skewX(-8deg);
  transition: background .28s ease, box-shadow .28s ease, transform .28s ease;
}

.streak-lights i::after {
  content: "";
  position: absolute;
  inset: 8px 10px;
  border-top: 3px solid rgba(255, 250, 243, .42);
  border-radius: 50%;
  opacity: 0;
}

.streak-lights i.on {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow:
    0 0 0 4px rgba(33, 199, 216, .1),
    0 10px 22px rgba(33, 199, 216, .28);
}

.streak-lights i.on::after {
  opacity: 1;
}

.streak-lights i.pop {
  animation: streakPop .46s cubic-bezier(.2, 1.25, .3, 1) both;
}

.streak-lights.reset i {
  animation: streakReset .34s ease both;
}

.xp-track {
  position: relative;
  height: 18px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 56, 107, .13);
}

.xp-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 243, .6), transparent);
  animation: xpShine 2.6s ease-in-out infinite;
}

.xp-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 24px rgba(33, 199, 216, .42);
  transition: width .72s cubic-bezier(.2, .9, .2, 1);
}

.mini-progress span,
.teacher-note span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mini-progress b {
  display: block;
  margin-top: 12px;
  color: var(--navy);
  font-size: 24px;
  line-height: 1;
}

.teacher-note {
  min-height: 138px;
  padding: 18px;
  border-radius: 20px;
  border-left: 5px solid var(--cyan);
}

.teacher-note.active {
  background: #eaf9fb;
}

.teacher-note p {
  margin-top: 10px;
}

.teacher-note img {
  display: block;
  width: min(100%, 520px);
  max-height: 320px;
  object-fit: contain;
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(18, 56, 107, .12);
  background: white;
}

.task-board {
  position: relative;
  min-height: 680px;
  padding: clamp(24px, 4vw, 52px);
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 250, 243, .92), rgba(247, 243, 236, .88)),
    radial-gradient(circle at 85% 22%, rgba(33, 199, 216, .16), transparent 28%);
}

.task-board::after {
  content: "";
  position: absolute;
  inset: auto 34px 34px auto;
  width: 110px;
  height: 14px;
  border-bottom: 4px solid var(--cyan);
  border-radius: 50%;
  transform: rotate(-3deg);
  opacity: .85;
}

.task-board.success {
  animation: boardSuccess 1.15s cubic-bezier(.18, .9, .24, 1) both;
}

.task-board.wrong {
  animation: boardWrong .4s ease both;
}

.task-board.success::before {
  content: "";
  position: absolute;
  inset: -38%;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(33, 199, 216, .3), transparent 17%),
    conic-gradient(from 180deg, transparent, rgba(33, 199, 216, .34), transparent, rgba(43, 127, 211, .26), transparent);
  opacity: 0;
  animation: successWave 1.1s ease-out both;
  pointer-events: none;
}

.task-board > * {
  position: relative;
  z-index: 1;
}

.level-up {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(255, 250, 243, .24);
  opacity: 0;
  transform: scale(.94);
  pointer-events: none;
}

.level-up.show {
  animation: levelScene 2.15s cubic-bezier(.17, .94, .22, 1) both;
}

.level-ring {
  position: relative;
  display: grid;
  width: min(270px, 46vw);
  height: min(270px, 46vw);
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fffaf3 0 45%, rgba(255, 250, 243, .72) 46% 58%, rgba(33, 199, 216, .2) 59% 100%);
  box-shadow:
    0 0 0 14px rgba(33, 199, 216, .13),
    0 0 0 34px rgba(43, 127, 211, .08),
    0 32px 90px rgba(18, 56, 107, .28);
}

.level-ring::before,
.level-ring::after {
  content: "";
  position: absolute;
  inset: -26px;
  border: 3px solid rgba(33, 199, 216, .56);
  border-radius: 50%;
  opacity: 0;
}

.level-up.show .level-ring::before {
  animation: ringPulse 1.25s ease-out .1s both;
}

.level-up.show .level-ring::after {
  animation: ringPulse 1.25s ease-out .28s both;
}

.check-draw {
  width: 150px;
  height: 150px;
  overflow: visible;
}

.check-draw circle,
.check-draw path {
  fill: none;
  stroke: var(--cyan);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 9;
  filter: drop-shadow(0 8px 12px rgba(33, 199, 216, .24));
}

.check-draw circle {
  stroke: var(--blue);
  stroke-dasharray: 310;
  stroke-dashoffset: 310;
}

.check-draw path {
  stroke-dasharray: 92;
  stroke-dashoffset: 92;
}

.level-up.show .check-draw circle {
  animation: drawCircle .52s ease-out .12s both;
}

.level-up.show .check-draw path {
  animation: drawCheck .42s cubic-bezier(.2, 1.16, .32, 1) .46s both;
}

.level-copy {
  position: absolute;
  top: calc(50% + min(170px, 28vw));
  left: 50%;
  min-width: min(390px, calc(100% - 36px));
  padding: 18px 22px;
  border-radius: 22px;
  background: var(--graphite);
  color: var(--paper);
  text-align: center;
  transform: translateX(-50%) translateY(14px);
  opacity: 0;
  box-shadow: 0 22px 58px rgba(17, 17, 17, .24);
}

.level-up.show .level-copy {
  animation: levelCopy 1.18s ease-out .55s both;
}

.level-copy span,
.level-copy em {
  display: block;
  color: rgba(255, 250, 243, .66);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.level-copy b {
  display: block;
  margin: 5px 0;
  color: var(--paper);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--graphite);
}

.pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--paper);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.task-body {
  max-width: 850px;
  padding: 42px 0 34px;
}

.task-body p {
  margin-bottom: 16px;
  color: var(--graphite);
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 650;
  line-height: 1.28;
}

.whiteboard {
  margin: 10px 0 26px;
  overflow: hidden;
  border: 1px solid rgba(18, 56, 107, .15);
  border-radius: 14px;
  background: #fff;
}

.whiteboard[hidden] {
  display: none;
}

.whiteboard-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(18, 56, 107, .12);
  background: #f7f9fc;
}

.board-colors {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-right: 4px;
}

.board-color,
.board-tool,
.board-zoom {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(18, 56, 107, .16);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.board-color {
  width: 22px;
  height: 22px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(18, 56, 107, .18);
}

.board-color.active {
  box-shadow: 0 0 0 2px var(--navy);
}

.board-tool.active,
.board-zoom:active {
  background: var(--navy);
  color: white;
}

.board-spacer {
  flex: 1;
  min-width: 8px;
}

.board-size-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border: 1px solid rgba(18, 56, 107, .12);
  border-radius: 8px;
  background: white;
}

.board-size-slider {
  width: 76px;
  height: 24px;
  margin: 0 2px;
  accent-color: var(--navy);
  cursor: ew-resize;
}

.board-size-btn {
  width: 23px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #f0f3f8;
  color: var(--navy);
  font-size: 17px;
  font-weight: 850;
  cursor: pointer;
}

.board-size-value {
  min-width: 17px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.whiteboard-canvas-wrap {
  position: relative;
  height: min(56vh, 560px);
  min-height: 400px;
  overflow: hidden;
  background-color: white;
  background-image: radial-gradient(rgba(18, 56, 107, .13) .7px, transparent .7px);
  background-size: 18px 18px;
}

.whiteboard-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.whiteboard-cursor-size {
  position: absolute;
  z-index: 2;
  display: none;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  border: 1.5px solid rgba(18, 56, 107, .95);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .45);
  pointer-events: none;
}

.whiteboard-cursor-size.visible {
  display: block;
}

.whiteboard-cursor-size.eraser {
  border-color: rgba(73, 86, 103, .9);
  background: rgba(73, 86, 103, .1);
}

.whiteboard-canvas-wrap canvas.read-only {
  cursor: default;
}

.whiteboard-canvas-wrap canvas.moving {
  cursor: grab;
}

.whiteboard-canvas-wrap canvas.moving.dragging {
  cursor: grabbing;
}

.teacher-whiteboard {
  margin: 14px 0 20px;
}

.teacher-whiteboard .whiteboard-canvas-wrap {
  height: min(44vh, 460px);
  min-height: 340px;
}

.formula-strip {
  display: inline-flex;
  margin-top: 16px;
  padding: 18px 24px;
  border-radius: 18px;
  background: var(--ice);
  color: var(--navy);
  font-size: clamp(22px, 2vw, 34px);
  font-weight: 900;
}

.answer-form {
  max-width: 720px;
  margin-top: 6px;
}

.answer-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--graphite);
  font-size: 14px;
  font-weight: 900;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 62px;
  padding: 0 18px;
  border: 2px solid rgba(17, 17, 17, .16);
  border-radius: 17px;
  outline: 0;
  background: white;
  color: var(--graphite);
  font-size: 22px;
  font-weight: 850;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 5px rgba(43, 127, 211, .13);
}

.primary-btn,
.quiet-btn,
.help-btn,
.icon-btn,
.quick-grid button,
.table-row button,
.nav {
  border: 0;
  font-weight: 900;
}

.primary-btn {
  min-height: 62px;
  padding: 0 24px;
  border-radius: 17px;
  background: var(--navy);
  color: var(--paper);
  box-shadow: 0 16px 34px rgba(18, 56, 107, .2);
}

.primary-btn:hover,
.quick-grid button:hover,
.table-row button:hover {
  transform: translateY(-1px);
}

.input-rule {
  display: none;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.feedback {
  min-height: 58px;
  margin-top: 18px;
  color: var(--graphite);
  font-size: 20px;
  font-weight: 900;
}

.feedback.good {
  color: var(--good);
}

.feedback.bad {
  color: var(--bad);
}

.student-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ask-form {
  max-width: 720px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(33, 199, 216, .28);
  border-radius: 20px;
  background: #eefcff;
}

.ask-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ask-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ask-row input {
  min-height: 50px;
  font-size: 16px;
  font-weight: 750;
}

.quiet-btn,
.help-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
}

.quiet-btn {
  background: rgba(18, 56, 107, .08);
  color: var(--navy);
}

.help-btn {
  background: #fdebd1;
  color: #7a4300;
}

.quick-help {
  background: rgba(33, 199, 216, .16);
  color: var(--navy);
}

.teacher-stage {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.phone {
  width: min(100%, 390px);
  min-height: 760px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 42px;
  background: var(--graphite);
  color: var(--paper);
}

.phone-status,
.phone-head,
.control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phone-status {
  min-height: 34px;
  padding: 0 10px;
  color: rgba(255, 250, 243, .62);
  font-size: 12px;
  font-weight: 900;
}

.phone-head {
  padding: 18px 12px 14px;
}

.phone-head h2 {
  max-width: 230px;
  color: var(--paper);
  font-size: 34px;
}

.phone .label {
  color: var(--cyan);
}

.icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, .1);
  color: var(--paper);
  font-size: 20px;
}

.alert-strip {
  display: grid;
  gap: 3px;
  margin: 0 8px 14px;
  padding: 14px;
  border-radius: 18px;
  background: #fff4e5;
  color: #603400;
}

.alert-strip span {
  font-size: 13px;
  font-weight: 750;
}

.notification-center,
.lesson-roster {
  display: grid;
  gap: 8px;
  margin: 0 8px 14px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 250, 243, .08);
}

.notification-head,
.panel-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 250, 243, .68);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.panel-caption {
  margin: 0 12px 8px;
}

.notification-head b {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--cyan);
  color: var(--graphite);
}

.notice-row,
.roster-row {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 250, 243, .1);
  color: var(--paper);
}

.notice-row {
  display: grid;
  grid-template-columns: 10px 82px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 46px;
  padding: 9px;
  text-align: left;
}

.notice-row b,
.notice-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-row small {
  color: rgba(255, 250, 243, .68);
  font-weight: 800;
}

.empty-notice {
  margin: 0;
  color: rgba(255, 250, 243, .58);
  font-size: 12px;
  font-weight: 850;
}

.student-list {
  display: grid;
  gap: 8px;
}

.student-row {
  display: grid;
  grid-template-columns: 12px 1fr 40px;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: rgba(255, 250, 243, .08);
  color: var(--paper);
  text-align: left;
}

.student-row.selected {
  outline: 2px solid var(--cyan);
}

.student-row b,
.student-row small {
  display: block;
}

.student-row small {
  margin-top: 4px;
  color: rgba(255, 250, 243, .62);
  font-size: 12px;
  font-weight: 750;
}

.student-row small em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 950;
}

.student-row strong {
  color: var(--cyan);
  font-size: 18px;
  text-align: right;
}

.signal {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--good);
}

.danger .signal {
  background: var(--bad);
  box-shadow: 0 0 0 6px rgba(211, 74, 74, .14);
}

.warn .signal {
  background: var(--warn);
}

.control-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 24px;
  background: var(--paper);
  color: var(--graphite);
}

.lesson-roster {
  margin-top: 14px;
}

.roster-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  text-align: left;
}

.roster-row b,
.roster-row span {
  display: block;
}

.roster-row span {
  margin-top: 3px;
  color: rgba(255, 250, 243, .62);
  font-size: 12px;
  font-weight: 780;
}

.student-direct-link {
  display: block;
  max-width: 238px;
  margin-top: 5px;
  overflow: hidden;
  color: rgba(216, 234, 255, .68);
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.copy-student-link,
.mini-reset-btn {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 250, 243, .12);
  color: var(--paper);
  font-size: 11px;
  font-weight: 950;
}

.mini-reset-btn {
  background: #ffe1db;
  color: #a92f2f;
}

.roster-row.active {
  opacity: .58;
}

.launch-student {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 13px;
  background: var(--cyan);
  color: var(--graphite);
  font-size: 19px;
  font-weight: 950;
}

.launch-student:disabled {
  background: rgba(255, 250, 243, .14);
  color: rgba(255, 250, 243, .45);
}

.roster-row.active .launch-student {
  background: #ffe1db;
  color: #a92f2f;
}

.danger-action {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 16px;
  background: #ffe1db;
  color: #a92f2f;
  font-weight: 950;
}

.control-title span,
.control-title b {
  font-size: 13px;
  font-weight: 900;
}

.control-title b {
  color: var(--blue);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.quick-grid button {
  min-height: 52px;
  border-radius: 16px;
  background: var(--navy);
  color: var(--paper);
}

.quick-grid button:nth-child(4) {
  background: var(--cyan);
  color: var(--graphite);
}

.teacher-question {
  margin-top: 12px;
  padding: 13px;
  border-radius: 17px;
  background: #fff4e5;
  color: #603400;
}

.teacher-question span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.teacher-question p {
  color: inherit;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.3;
}

.queue {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.queue-section {
  display: grid;
  gap: 6px;
}

.queue-section > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.queue-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.queue-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(18, 56, 107, .08);
}

.queue-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.queue-row b {
  font-size: 13px;
}

.queue-row.current {
  background: #d8eaff;
}

.queue-row.auto {
  background: #e6fbff;
}

.queue-row.done {
  background: #edf9f4;
}

.phone-commentary {
  position: relative;
  min-height: 560px;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(125deg, rgba(255, 250, 243, .95), rgba(247, 243, 236, .92)),
    url("./nikita.jpg") right bottom / 38% auto no-repeat;
}

.phone-commentary::after {
  content: "";
  position: absolute;
  right: -64px;
  bottom: 40px;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background: var(--cyan);
  z-index: -1;
}

.phone-commentary h1 {
  font-size: clamp(40px, 5vw, 72px);
}

.phone-commentary > p:not(.label) {
  max-width: 560px;
  margin-top: 22px;
  font-size: 18px;
}

.desktop-hint {
  max-width: 360px;
  margin-top: 34px;
  padding: 22px;
  border-left: 5px solid var(--cyan);
  border-radius: 0 20px 20px 0;
  background: rgba(216, 234, 255, .82);
}

.desktop-hint span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.desktop-hint b {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 24px;
}

.desktop-hint p {
  margin-top: 8px;
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 720px;
  overflow: hidden;
  border-radius: 30px;
  background: var(--paper);
}

.dash-nav {
  padding: 26px 18px;
  background: var(--graphite);
  color: var(--paper);
}

.compact {
  margin-bottom: 36px;
}

.compact .mark {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.nav {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 5px 0;
  padding: 0 14px;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 250, 243, .66);
  text-align: left;
}

.nav.active {
  background: var(--blue);
  color: white;
}

.dash-main {
  padding: clamp(24px, 4vw, 42px);
}

.dash-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.metrics div {
  min-height: 118px;
  padding: 18px;
  border-radius: 20px;
  background: #eef6ff;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.metrics b {
  display: block;
  margin-top: 14px;
  color: var(--navy);
  font-size: 42px;
  line-height: 1;
}

.teacher-table {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr .7fr .9fr .8fr;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: white;
  font-weight: 750;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row.head {
  min-height: 48px;
  background: #f3f7fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.table-row.hot {
  background: #fff2f2;
}

.table-row.warm {
  background: #fff8ed;
}

.table-row button {
  min-height: 38px;
  border-radius: 13px;
  background: var(--navy);
  color: var(--paper);
}

.program-builder {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 22px;
  min-height: 760px;
}

.program-sidebar,
.program-main,
.learning-plan,
.student-home {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 250, 243, .88);
  box-shadow: var(--shadow);
}

.program-sidebar {
  padding: 20px;
}

.side-head {
  padding: 10px 8px 22px;
}

.side-head h2 {
  margin-bottom: 12px;
  font-size: 31px;
}

.program-item {
  display: block;
  width: 100%;
  min-height: 78px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: var(--graphite);
  text-align: left;
}

.program-item.active {
  border-color: var(--cyan);
  background: #eaf9fb;
}

.program-item b,
.program-item span {
  display: block;
}

.program-item b {
  font-size: 16px;
}

.program-item span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.program-item.ghost {
  display: grid;
  place-items: center;
  border-style: dashed;
  background: rgba(18, 56, 107, .05);
  color: var(--navy);
  font-weight: 900;
  text-align: center;
}

.program-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.compact-primary {
  width: 100%;
  min-height: 48px;
}

.program-main,
.learning-plan,
.student-home {
  padding: clamp(22px, 3vw, 34px);
}

.program-top,
.plan-hero,
.student-home-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
}

.level-card {
  flex: 0 0 280px;
  padding: 20px;
  border-radius: 28px;
  background: var(--graphite);
  color: var(--paper);
  box-shadow: 0 26px 70px rgba(17, 17, 17, .22);
}

.level-card span,
.level-card em {
  display: block;
  color: rgba(255, 250, 243, .62);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.level-card b {
  display: block;
  margin: 4px 0 8px;
  color: var(--cyan);
  font-size: 74px;
  line-height: .9;
}

.level-card .primary-btn {
  width: 100%;
  margin-top: 16px;
  background: var(--cyan);
  color: var(--graphite);
}

.program-top h1,
.plan-hero h1,
.student-home-hero h1 {
  max-width: 840px;
  font-size: clamp(38px, 5vw, 66px);
}

.builder-actions,
.plan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.entity-map {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 26px;
}

.entity-map div {
  min-height: 94px;
  padding: 15px;
  border-radius: 18px;
  background: #edf6ff;
}

.entity-map span,
.plan-module small,
.route-card span,
.route-card em,
.video-card span,
.video-card small,
.bank-task span,
.trial-bank span,
.trial-upload span,
.trial-result span,
.assign-trial span,
.student-stats span,
.roadmap-item span,
.home-theory a span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.entity-map b {
  display: block;
  margin-top: 10px;
  color: var(--navy);
  font-size: 17px;
  line-height: 1.15;
}

.builder-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 300px;
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.builder-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .75fr);
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.program-tree-editor {
  display: grid;
  gap: 12px;
}

.builder-node {
  border: 1px solid rgba(18, 56, 107, .1);
  border-radius: 18px;
  background: rgba(255, 250, 243, .72);
}

.builder-node summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 36px 36px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
}

.builder-node summary b,
.builder-leaf b {
  color: var(--graphite);
}

.builder-node summary span,
.builder-leaf span,
.builder-leaf em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.builder-node summary button,
.builder-leaf button,
.builder-node-actions button,
.builder-side-head button,
.builder-side-row button {
  min-height: 32px;
  border: 0;
  border-radius: 11px;
  background: rgba(18, 56, 107, .08);
  color: var(--navy);
  font-weight: 950;
}

.builder-topic,
.builder-prototype {
  margin: 8px 10px 10px 18px;
}

.builder-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}

.builder-leaf {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(90px, auto) 34px 34px;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  margin: 8px 12px;
  padding: 9px 10px;
  border-radius: 14px;
  background: white;
}

.task-leaf {
  grid-template-columns: 90px minmax(0, 1fr) minmax(120px, auto) 34px 34px;
}

.builder-side-head,
.builder-side-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.builder-side-row {
  grid-template-columns: minmax(0, 1fr) 32px;
  padding: 10px;
  border-radius: 14px;
  background: white;
}

.builder-side-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.empty-builder {
  padding: 24px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 900;
}

.todo-action {
  opacity: .72;
}

.module-column,
.topic-editor,
.task-bank-preview,
.route-editor,
.lesson-launch,
.current-module,
.home-theory,
.module-roadmap {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.module-column,
.task-bank-preview,
.route-editor,
.lesson-launch,
.current-module,
.home-theory,
.module-roadmap {
  padding: 16px;
}

.module-card,
.plan-module,
.route-card,
.roadmap-item {
  border-radius: 18px;
  background: rgba(18, 56, 107, .06);
}

.module-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px;
}

.module-card.selected,
.plan-module.current,
.route-card.active,
.roadmap-item.open {
  background: #d8eaff;
}

.module-card.locked,
.plan-module.locked {
  opacity: .62;
}

.module-card b,
.module-card span,
.module-card strong {
  display: block;
}

.module-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.module-card strong {
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
}

.topic-editor {
  padding: 18px;
}

.topic-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.theory-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.video-card {
  min-height: 132px;
  padding: 14px;
  border-radius: 17px;
  background: var(--graphite);
  color: var(--paper);
}

.video-card span,
.video-card small {
  color: rgba(255, 250, 243, .62);
}

.video-card b {
  display: block;
  margin: 11px 0;
  line-height: 1.2;
}

.prototype-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.prototype-row {
  display: grid;
  grid-template-columns: 60px 1fr 82px 82px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(18, 56, 107, .06);
}

.prototype-row.active {
  outline: 2px solid var(--cyan);
  background: #ecfbff;
}

.prototype-row span {
  color: var(--blue);
  font-weight: 900;
}

.prototype-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.prototype-row button {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--navy);
  color: var(--paper);
  font-weight: 900;
}

.task-bank-preview h2,
.lesson-launch h2,
.current-module h2,
.home-theory h2 {
  margin-bottom: 16px;
  font-size: 29px;
}

.bank-task {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.bank-task b,
.bank-task span {
  display: block;
}

.similar-rule {
  margin-top: 16px;
  padding: 14px;
  border-left: 4px solid var(--cyan);
  border-radius: 0 16px 16px 0;
  background: #eaf9fb;
  color: var(--navy);
  font-weight: 850;
  line-height: 1.35;
}

.trial-builder {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 250, 243, .98), rgba(237, 246, 255, .88)),
    radial-gradient(circle at 94% 12%, rgba(33, 199, 216, .2), transparent 28%);
}

.trial-builder-head,
.trial-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.trial-builder-head h2 {
  max-width: 760px;
  color: var(--navy);
  font-size: clamp(30px, 3vw, 44px);
}

.trial-builder-grid {
  display: grid;
  grid-template-columns: 1.15fr .9fr .9fr;
  gap: 14px;
  margin-top: 16px;
}

.trial-bank,
.trial-upload,
.trial-result,
.assign-trial,
.next-trial,
.trial-chart-card {
  border-radius: 22px;
  background: white;
}

.trial-bank,
.trial-upload,
.trial-result {
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(18, 56, 107, .08);
}

.trial-bank b,
.trial-upload b,
.trial-result b,
.assign-trial b,
.next-trial h2 {
  display: block;
  margin-top: 8px;
  color: var(--navy);
}

.trial-task-row {
  display: grid;
  grid-template-columns: 70px 1fr auto auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  margin-top: 10px;
  padding: 9px;
  border-radius: 14px;
  background: rgba(18, 56, 107, .06);
}

.trial-task-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.trial-task-row i,
.trial-chip-row i {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eaf9fb;
  color: #05606b;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.upload-fields {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.upload-fields div {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(17, 17, 17, .05);
  color: var(--graphite);
  font-weight: 850;
}

.trial-result p,
.assign-trial p {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.trial-chip-row,
.trial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.assign-trial {
  margin-top: 14px;
  padding: 14px;
  background: #fff4d8;
  box-shadow: inset 0 0 0 2px rgba(213, 139, 25, .18);
}

.assign-trial .quiet-btn {
  width: 100%;
  margin-top: 12px;
  background: var(--paper);
}

.learning-plan,
.student-home {
  min-height: 760px;
}

.plan-hero p,
.student-home-hero p {
  max-width: 760px;
  margin-top: 16px;
  font-size: 18px;
}

.plan-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 310px;
  gap: 16px;
  margin-top: 28px;
}

.plan-modules {
  display: grid;
  gap: 10px;
}

.plan-module {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 13px;
}

.plan-module span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  color: var(--paper);
  font-weight: 950;
}

.plan-module b,
.plan-module small {
  display: block;
}

.plan-module small {
  grid-column: 2;
  margin-top: -18px;
}

.route-editor {
  display: grid;
  gap: 10px;
}

.route-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 14px;
}

.route-card.theory {
  background: #eaf9fb;
}

.route-card.trial {
  background:
    linear-gradient(135deg, rgba(18, 56, 107, .96), rgba(33, 199, 216, .62)),
    var(--navy);
  color: var(--paper);
}

.route-card.trial span,
.route-card.trial em {
  color: rgba(255, 250, 243, .72);
}

.route-card span {
  color: var(--blue);
}

.route-card b,
.route-card em {
  display: block;
}

.route-card em {
  margin-top: 5px;
  font-style: normal;
}

.lesson-launch p {
  margin-top: 10px;
}

.launch-state {
  margin-top: 20px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 56, 107, .08);
  color: var(--navy);
  font-weight: 900;
}

.launch-state.live {
  background: #eaf9fb;
  color: #05606b;
}

.student-home-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr .8fr;
  gap: 16px;
  margin-top: 28px;
}

.trial-dashboard {
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 16px;
  margin-top: 18px;
}

.next-trial,
.trial-chart-card {
  padding: 18px;
  border: 1px solid var(--line);
}

.next-trial {
  background:
    linear-gradient(135deg, rgba(18, 56, 107, .98), rgba(27, 31, 36, .96)),
    var(--navy);
  color: var(--paper);
}

.next-trial .label {
  color: rgba(216, 234, 255, .76);
}

.next-trial h2 {
  margin-bottom: 16px;
  color: var(--paper);
  font-size: clamp(28px, 3vw, 42px);
}

.trial-meta span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 243, .12);
  color: rgba(255, 250, 243, .86);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.next-trial .primary-btn {
  width: 100%;
  margin-top: 24px;
}

.trial-chart-card {
  background:
    linear-gradient(135deg, rgba(255, 250, 243, .98), rgba(234, 249, 251, .92)),
    white;
}

.trial-chart-head h2 {
  color: var(--navy);
  font-size: clamp(28px, 3vw, 42px);
}

.trial-chart-head strong {
  display: grid;
  min-width: 104px;
  min-height: 58px;
  place-items: center;
  border-radius: 18px;
  background: #fff4d8;
  color: #8a5600;
  font-size: 24px;
  font-weight: 950;
}

.trial-chart {
  width: 100%;
  height: auto;
  margin-top: 8px;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(18, 56, 107, .12);
  stroke-width: 2;
}

.chart-axis {
  stroke: rgba(18, 56, 107, .28);
  stroke-width: 2;
}

.goal-line {
  stroke: #d58b19;
  stroke-width: 3;
  stroke-dasharray: 8 9;
}

.result-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-point {
  fill: var(--paper);
  stroke: var(--blue);
  stroke-width: 5;
}

.result-point.current {
  fill: var(--cyan);
  stroke: var(--navy);
}

.axis-label,
.goal-label,
.point-label {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.goal-label,
.point-label {
  fill: var(--navy);
  font-size: 16px;
  font-weight: 950;
}

.student-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.quest-path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(90deg, rgba(18, 56, 107, .08), rgba(33, 199, 216, .13));
}

.quest-path::before {
  content: "";
  position: absolute;
  left: 42px;
  right: 42px;
  top: 50%;
  height: 6px;
  border-radius: 99px;
  background: rgba(18, 56, 107, .14);
  transform: translateY(-50%);
}

.quest-node {
  position: relative;
  z-index: 1;
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  place-items: center;
  border-radius: 18px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(18, 56, 107, .12);
}

.quest-node.done {
  background: var(--navy);
  color: var(--paper);
}

.quest-node.active {
  background: var(--cyan);
  color: var(--graphite);
  animation: activeQuest 1.8s ease-in-out infinite;
}

.student-stats div {
  padding: 15px;
  border-radius: 17px;
  background: #edf6ff;
}

.student-stats .score-tile.mid {
  background: #fff4d8;
  box-shadow: inset 0 0 0 2px rgba(213, 139, 25, .25);
}

.student-stats .score-tile.mid span,
.student-stats .score-tile.mid b {
  color: #8a5600;
}

.student-stats b {
  display: block;
  margin-top: 9px;
  color: var(--navy);
  font-size: 30px;
}

.progress-line {
  height: 14px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(18, 56, 107, .1);
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.home-theory a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-weight: 900;
  text-decoration: none;
}

.home-theory a b {
  display: block;
}

.home-theory .theory-unlocked {
  margin-top: 10px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(216, 234, 255, .9), rgba(234, 249, 251, .95));
  box-shadow: inset 0 0 0 1px rgba(33, 199, 216, .24);
}

.home-theory .theory-unlocked::before {
  content: "▶";
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: var(--navy);
  color: var(--paper);
}

.home-theory .theory-locked {
  margin-top: 10px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: rgba(17, 17, 17, .05);
  color: rgba(17, 17, 17, .42);
}

.home-theory a:last-child {
  border-bottom: 0;
}

.roadmap-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
}

.module-map {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 250, 243, .96), rgba(247, 243, 236, .9)),
    radial-gradient(circle at 90% 20%, rgba(33, 199, 216, .18), transparent 34%);
}

.module-map-hero {
  margin-top: 26px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(27, 31, 36, .98), rgba(18, 56, 107, .96)),
    radial-gradient(circle at 84% 16%, rgba(33, 199, 216, .32), transparent 36%);
  color: var(--paper);
}

.module-map-hero .label,
.module-map-hero .module-map-head > span {
  color: rgba(216, 234, 255, .78);
}

.module-map-hero h2,
.module-map-hero .module-info b {
  color: var(--paper);
}

.module-map-hero .game-module {
  background: rgba(255, 250, 243, .08);
}

.module-map-hero .game-module.done {
  background: rgba(8, 115, 79, .34);
  box-shadow: inset 0 0 0 1px rgba(219, 247, 236, .26);
}

.module-map-hero .game-module.active {
  background: rgba(33, 199, 216, .17);
  box-shadow: inset 0 0 0 2px rgba(33, 199, 216, .62);
}

.module-map-hero .game-module.current-module {
  box-shadow: inset 0 0 0 3px rgba(251, 192, 45, .72);
}

.module-map-hero .module-progress {
  background: rgba(255, 250, 243, .16);
}

.module-map-hero .module-info small {
  color: rgba(216, 234, 255, .78);
}

.module-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.module-map-head h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.module-map-head > span {
  max-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

.exam-checklist-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(18, 56, 107, .1);
  border-radius: 24px;
  background: var(--paper);
}

.student-active-theory {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(18, 56, 107, .1);
  border-radius: 24px;
  background: var(--paper);
}

.student-theory-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.student-theory-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  background: #f6f8fb;
  border: 1px solid rgba(18, 56, 107, .08);
}

.student-theory-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.student-theory-card b {
  color: var(--graphite);
  font-size: 17px;
}

.student-theory-card em,
.student-theory-card p {
  margin: 0;
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
}

.student-theory-card a {
  width: max-content;
  margin-top: 4px;
  color: var(--navy);
  font-weight: 950;
}

.exam-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 10px;
}

.exam-tile {
  position: relative;
  display: grid;
  min-height: 92px;
  place-items: center;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(var(--cyan) var(--pct), rgba(18, 56, 107, .13) 0) border-box;
  border: 4px solid transparent;
  color: var(--navy);
  text-align: center;
}

.exam-tile.done {
  background:
    linear-gradient(#edf9f4, #edf9f4) padding-box,
    conic-gradient(#08734f var(--pct), rgba(8, 115, 79, .18) 0) border-box;
}

.exam-tile b,
.exam-tile span,
.exam-tile em {
  display: block;
}

.exam-tile b {
  font-size: 18px;
  font-weight: 950;
}

.exam-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.exam-tile em {
  font-style: normal;
  font-weight: 950;
}

.game-module {
  width: 100%;
  min-height: 86px;
  margin-top: 10px;
  padding: 14px;
  border-radius: 22px;
  border: 0;
  background: rgba(18, 56, 107, .06);
  text-align: left;
}

.module-select-surface {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 92px;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.game-module.active {
  background: #eaf9fb;
  box-shadow: inset 0 0 0 2px rgba(33, 199, 216, .45);
}

.game-module.done {
  background: #edf9f4;
  box-shadow: inset 0 0 0 1px rgba(8, 115, 79, .16);
}

.game-module.locked {
  opacity: .64;
}

.game-module.selected {
  outline: 3px solid rgba(47, 111, 237, .26);
}

.game-module.current-module {
  box-shadow: inset 0 0 0 3px rgba(251, 192, 45, .55);
}

.module-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-left: 78px;
}

.module-actions-row button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.module-route-btn {
  background: var(--navy);
  color: var(--paper);
}

.module-open-btn {
  background: #eef3f9;
  color: var(--navy);
}

.module-activate-btn {
  background: #d9f7fb;
  color: #0e5361;
}

.module-activate-btn.selected,
.module-activate-btn:disabled {
  background: #dbf7ec;
  color: #08734f;
  cursor: default;
}

.module-badge {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: var(--navy);
  color: var(--paper);
  font-size: 18px;
  font-weight: 950;
}

.game-module.active .module-badge {
  background: var(--cyan);
  color: var(--graphite);
  animation: activeQuest 1.8s ease-in-out infinite;
}

.game-module.done .module-badge {
  background: #08734f;
}

.module-info b {
  display: block;
  margin-bottom: 10px;
  color: var(--graphite);
  font-size: 18px;
}

.module-info small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.module-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.module-title-line b {
  margin-bottom: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.block-status {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  text-transform: lowercase;
}

.block-status.mastered {
  background: #dbf7ec;
  color: #08734f;
}

.block-status.study {
  background: #d9f7fb;
  color: #0e5361;
}

.block-status.practice {
  background: #fff4d8;
  color: #8a5600;
}

.block-status.locked {
  background: rgba(17, 17, 17, .08);
  color: var(--muted);
}

.module-map-hero .block-status.locked {
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 250, 243, .7);
}

.module-progress {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 56, 107, .12);
}

.module-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.grade {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: 16px;
  font-weight: 950;
}

.grade.good {
  background: #dbf7ec;
  color: #08734f;
}

.grade.mid {
  background: #fff4d8;
  color: #8a5600;
}

.grade.locked {
  background: rgba(17, 17, 17, .08);
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  min-width: min(420px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--graphite);
  color: var(--paper);
  box-shadow: 0 24px 64px rgba(17, 17, 17, .25);
  font-weight: 850;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.success-burst {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
}

.success-burst.show {
  opacity: 1;
}

.success-burst span {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 14px;
  height: 68px;
  border-radius: 999px;
  background: var(--cyan);
  transform-origin: center 142px;
  animation: spark 1.05s ease-out both;
}

.success-burst span:nth-child(1) { transform: rotate(0deg) translateY(-20px); }
.success-burst span:nth-child(2) { transform: rotate(62deg) translateY(-20px); background: var(--blue); }
.success-burst span:nth-child(3) { transform: rotate(130deg) translateY(-20px); }
.success-burst span:nth-child(4) { transform: rotate(218deg) translateY(-20px); background: var(--blue); }
.success-burst span:nth-child(5) { transform: rotate(292deg) translateY(-20px); }

@keyframes boardSuccess {
  0% { box-shadow: var(--shadow); }
  35% { box-shadow: 0 0 0 10px rgba(33, 199, 216, .26), 0 34px 90px rgba(18, 56, 107, .24); transform: translateY(-4px) scale(1.006); }
  72% { box-shadow: 0 0 0 18px rgba(33, 199, 216, .08), 0 30px 76px rgba(18, 56, 107, .18); }
  100% { box-shadow: var(--shadow); transform: translateY(0); }
}

@keyframes successWave {
  0% { opacity: 0; transform: scale(.54) rotate(0deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.28) rotate(42deg); }
}

@keyframes levelScene {
  0% { opacity: 0; transform: scale(.94); }
  12% { opacity: 1; transform: scale(1); }
  76% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.03); }
}

@keyframes ringPulse {
  0% { opacity: .85; transform: scale(.78); }
  100% { opacity: 0; transform: scale(1.28); }
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  0% { stroke-dashoffset: 92; transform: scale(.92); transform-origin: center; }
  100% { stroke-dashoffset: 0; transform: scale(1); transform-origin: center; }
}

@keyframes levelCopy {
  0% { opacity: 0; transform: translateX(-50%) translateY(22px) scale(.96); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes boardWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

@keyframes spark {
  0% { opacity: 0; scale: .35; }
  30% { opacity: 1; }
  100% { opacity: 0; scale: 1.42; translate: 0 -112px; }
}

@keyframes xpShine {
  0% { transform: translateX(-100%); opacity: .2; }
  45% { opacity: .85; }
  100% { transform: translateX(100%); opacity: .2; }
}

@keyframes activeQuest {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(33, 199, 216, .28), 0 14px 30px rgba(18, 56, 107, .12);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(33, 199, 216, .16), 0 18px 38px rgba(18, 56, 107, .18);
  }
}

@keyframes streakPop {
  0% { transform: skewX(-8deg) scale(.82); }
  55% { transform: skewX(-8deg) scale(1.12); }
  100% { transform: skewX(-8deg) scale(1); }
}

@keyframes streakReset {
  0%, 100% { transform: skewX(-8deg) translateX(0); }
  35% { transform: skewX(-8deg) translateX(-3px); }
  70% { transform: skewX(-8deg) translateX(3px); }
}

@media (max-width: 980px) {
  .student-layout,
  .teacher-stage,
  .dashboard,
  .program-builder,
  .builder-grid,
  .trial-builder-grid,
  .plan-workspace,
  .trial-dashboard,
  .student-home-grid {
    grid-template-columns: 1fr;
  }

  .entity-map,
  .theory-block {
    grid-template-columns: repeat(2, 1fr);
  }

  .program-top,
  .plan-hero,
  .student-home-hero {
    flex-direction: column;
  }

  .builder-actions,
  .plan-actions {
    justify-content: flex-start;
  }

  .lesson-card {
    min-height: 300px;
  }

  .dash-nav {
    display: none;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: auto;
    padding: 16px;
  }

  .table-row.head {
    display: none;
  }
}

@media (max-width: 1260px) and (min-width: 981px) {
  .builder-grid,
  .trial-builder-grid,
  .plan-workspace,
  .trial-dashboard,
  .student-home-grid {
    grid-template-columns: 1fr;
  }

  .entity-map {
    grid-template-columns: repeat(3, 1fr);
  }

  .program-top,
  .plan-hero,
  .student-home-hero {
    flex-direction: column;
  }

  .builder-actions,
  .plan-actions {
    justify-content: flex-start;
  }

  .module-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

.module-card {
  margin-bottom: 0;
  }
}

.wide-action {
  width: 100%;
  margin-top: 14px;
}

.phone-status #wsState {
  color: var(--cyan);
  font-weight: 950;
  text-transform: uppercase;
}

.student-row small i {
  font-style: normal;
}

[hidden] {
  display: none !important;
}

.login-card {
  display: grid;
  gap: 18px;
  max-width: 720px;
  margin: clamp(28px, 8vw, 92px) auto;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 250, 243, .94);
  box-shadow: var(--shadow);
}

.teacher-auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #fffaf3 0%, #f7f3ec 48%, #d8eaff 100%);
}

.teacher-auth-panel {
  display: grid;
  width: min(100%, 430px);
  gap: 14px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.teacher-auth-panel .mark {
  margin: 0 auto 8px 7px;
}

.teacher-auth-panel h1 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 32px;
}

.teacher-auth-panel label {
  color: var(--graphite);
  font-size: 14px;
  font-weight: 800;
}

.teacher-auth-panel input {
  min-height: 54px;
  border-color: var(--line);
  font-size: 17px;
}

.teacher-auth-error {
  min-height: 18px;
  margin: 0;
  color: #b43131;
  font-size: 13px;
  font-weight: 750;
}

.teacher-auth-student-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.teacher-logout {
  flex: 0 0 auto;
}

.login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
}

.login-form input,
.hint-form textarea {
  width: 100%;
  border: 2px solid transparent;
  border-radius: 16px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  outline: 0;
}

.login-form input {
  min-height: 54px;
  padding: 0 16px;
}

.login-form input:focus,
.hint-form textarea:focus {
  border-color: var(--cyan);
}

.login-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.login-buttons button,
.student-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #eaf9fb;
  color: #05606b;
  font-weight: 950;
}

.student-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.student-tab.active {
  background: var(--navy);
  color: var(--paper);
  box-shadow: 0 14px 30px rgba(18, 56, 107, .2);
}

.student-tab-panel {
  display: none;
}

.student-tab-panel.active {
  display: block;
}

.compact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.answer-row button:disabled,
.answer-row input:disabled {
  opacity: .52;
  cursor: not-allowed;
}

.answer-locked-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.answer-locked-note[hidden] {
  display: none;
}

.lesson-ended {
  display: grid;
  min-height: 620px;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.lesson-ended img {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  object-fit: cover;
  border: 10px solid var(--paper);
  border-radius: 42px;
  box-shadow: 0 30px 70px rgba(18, 56, 107, .22);
}

.lesson-ended h2 {
  font-size: clamp(44px, 7vw, 82px);
}

.lesson-ended p {
  max-width: 560px;
  color: var(--navy);
  font-size: 22px;
  font-weight: 850;
}

.teacher-actions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-actions-grid button:last-child {
  grid-column: 1 / -1;
  background: var(--navy);
  color: var(--paper);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 17, 17, .48);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(820px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 40px 90px rgba(17, 17, 17, .28);
}

.modal-panel .icon-btn,
.route-drawer .icon-btn {
  background: rgba(18, 56, 107, .1);
  color: var(--navy);
}

.builder-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.builder-form label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 950;
}

.builder-form input,
.builder-form textarea,
.builder-form select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(18, 56, 107, .16);
  border-radius: 14px;
  background: white;
  color: var(--graphite);
  font: inherit;
}

.builder-form textarea {
  min-height: 110px;
  resize: vertical;
}

.builder-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.builder-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.builder-modal-panel {
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.asset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-thumb {
  display: grid;
  gap: 6px;
  width: 128px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(18, 56, 107, .06);
  text-decoration: none;
}

.students-directory {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 243, .92);
  box-shadow: var(--shadow);
}

.directory-head,
.directory-actions,
.directory-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.directory-head { margin-bottom: 24px; }
.directory-head h1 { margin: 3px 0 6px; font-size: 34px; }
.directory-head p:last-child { margin: 0; color: var(--muted); }
.directory-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.directory-table { width: 100%; min-width: 990px; border-collapse: collapse; text-align: left; }
.directory-table th { padding: 13px 12px; background: rgba(18, 56, 107, .06); color: var(--muted); font-size: 11px; text-transform: uppercase; }
.directory-table td { padding: 13px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.directory-main-row > td { min-height: 68px; }
.directory-table td:first-child { min-width: 145px; }
.directory-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.directory-table td:first-child strong { display: block; color: var(--navy); }
.directory-live { display: inline-block; margin: 4px 0 0; padding: 3px 7px; border-radius: 999px; background: #e2f6f0; color: #167457; font-size: 10px; font-style: normal; }
.goal-score { color: var(--navy); font-size: 19px; }
.directory-module-list { display: grid; gap: 5px; min-width: 170px; }
.directory-module-details > summary { color: var(--navy); cursor: pointer; font-size: 12px; font-weight: 800; }
.directory-module-details[open] { margin: -4px 0; }
.directory-module-details .directory-module-list { margin-top: 7px; }
.directory-module { font-size: 12px; color: var(--navy); }
.directory-module.mastered { color: #168b70; }
.directory-notes { display: block; max-width: 210px; overflow: hidden; color: #596370; font-size: 12px; text-overflow: ellipsis; }
.muted-value { color: var(--muted); font-size: 12px; }
.directory-actions { justify-content: flex-end; gap: 4px; }
.directory-icon { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px; background: #f0f4f8; color: var(--navy); font-size: 16px; }
.directory-icon.danger-icon { color: #b53d3d; }
.directory-detail-row > td { padding: 0 12px; background: rgba(18, 56, 107, .025); }
.directory-detail-row details > summary { padding: 9px 0; color: var(--navy); cursor: pointer; font-size: 12px; font-weight: 850; }
.directory-detail-row details > summary span { margin-left: 8px; color: var(--muted); font-weight: 650; }
.directory-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; padding: 8px 0 16px; }
.directory-detail-grid section > b { display: block; margin-bottom: 8px; color: var(--navy); }
.mini-action,
.directory-comment button,
.directory-lesson > button { border: 0; background: transparent; color: var(--navy); font-size: 12px; font-weight: 800; cursor: pointer; }
.directory-comment,
.directory-lesson { padding: 10px 0; border-top: 1px solid var(--line); }
.directory-comment time { color: var(--muted); font-size: 11px; }
.directory-comment p { margin: 5px 0 7px; white-space: pre-wrap; }
.directory-comment div { display: flex; gap: 10px; }
.directory-lesson { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.directory-lesson b,
.directory-lesson span { display: block; }
.directory-lesson span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.lesson-task-details { grid-column: 1 / -1; font-size: 12px; }
.lesson-task-details summary { cursor: pointer; color: var(--navy); font-weight: 750; }
.lesson-task-details ul { margin: 7px 0 0; padding-left: 18px; color: var(--muted); }
.directory-footnote { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.directory-empty { padding: 32px !important; color: var(--muted); text-align: center; }
.student-edit-panel { width: min(600px, 100%); }
.student-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.student-link-result { overflow-wrap: anywhere; padding: 12px; border-radius: 10px; background: #e4f5ef; color: #176b52; font-size: 13px; }

@media (max-width: 680px) {
  .students-directory { padding: 16px 12px; border-radius: 16px; }
  .directory-head { align-items: flex-start; flex-direction: column; }
  .directory-head h1 { font-size: 28px; }
  .directory-head .primary-btn { width: 100%; }
  .directory-detail-grid { grid-template-columns: 1fr; }
  .student-form-grid { grid-template-columns: 1fr 1fr; }
  .student-edit-panel { padding: 15px; }
}

.asset-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.asset-link,
.asset-list a {
  color: var(--blue);
  font-weight: 900;
}

.exam-tag-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
}

.exam-tag-row,
.issued-row,
.plan-detail-task,
.plan-detail-theory {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(18, 56, 107, .05);
}

.exam-tag-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 8px;
}

.exam-tag-row button {
  border: 0;
  border-radius: 10px;
  background: rgba(224, 64, 64, .12);
  color: #9b1c1c;
  font-weight: 950;
}

.trial-manual-grid {
  margin-top: 6px;
}

.plan-structure-detail {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.plan-detail-head h2 {
  margin-top: 4px;
}

.plan-detail-topic,
.plan-detail-prototype {
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}

.plan-detail-topic summary,
.plan-detail-prototype summary {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  cursor: pointer;
}

.plan-detail-task,
.plan-detail-theory {
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 8px;
}

.plan-detail-task b,
.plan-detail-theory b,
.issued-row b {
  overflow-wrap: anywhere;
}

.plan-detail-task span,
.plan-detail-theory span,
.issued-row span {
  color: var(--blue);
  font-weight: 950;
}

.plan-detail-task em,
.plan-detail-theory em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.issued-materials {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.issued-row {
  grid-template-columns: 70px 1fr;
}

.teacher-plan-profile {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.teacher-level-mini,
.teacher-trial-mini {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
}

.teacher-level-mini span,
.teacher-trial-mini span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.teacher-level-mini b,
.teacher-trial-mini b {
  font-size: 28px;
  line-height: 1;
}

.teacher-level-mini em,
.teacher-trial-mini small {
  color: var(--muted);
  font-style: normal;
  font-weight: 850;
}

.teacher-trial-mini svg {
  width: 100%;
  height: 72px;
}

.teacher-trial-mini line {
  stroke: rgba(224, 64, 64, .42);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.teacher-trial-mini polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.teacher-trial-mini circle {
  fill: var(--cyan);
  stroke: var(--navy);
  stroke-width: 3;
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal-head,
.route-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hint-context {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(18, 56, 107, .06);
}

.hint-context span,
.selected-route > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hint-context p {
  margin-top: 7px;
  color: var(--graphite);
  font-weight: 800;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hint-answer-context {
  border-left: 3px solid #15825d;
  background: #e5f6ee;
}

.hint-answer-history {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hint-answer-history > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.hint-answer-history > div {
  display: grid;
  gap: 6px;
}

.hint-answer-history > div > p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.hint-attempt-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(17, 17, 17, .035);
  font-size: 13px;
}

.hint-attempt-row b {
  color: var(--muted);
}

.hint-attempt-row span {
  min-width: 0;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.hint-attempt-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.hint-attempt-row.correct em {
  color: #08734f;
}

.hint-attempt-row.incorrect em {
  color: #ad3b32;
}

.hint-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.hint-form label {
  color: var(--navy);
  font-weight: 950;
}

.hint-form textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}

.photo-loader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px dashed rgba(18, 56, 107, .28);
  border-radius: 16px;
  background: rgba(33, 199, 216, .08);
  color: var(--navy);
  font-weight: 950;
}

.photo-loader input {
  max-width: 210px;
  font-size: 12px;
}

.route-drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 105;
  width: min(720px, calc(100vw - 28px));
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 243, .98);
  box-shadow: 0 34px 86px rgba(17, 17, 17, .24);
}

.drawer-note {
  margin: 12px 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.insert-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 18px;
  background: var(--paper);
}

.insert-panel label,
.plan-edit-head span,
.selected-route > span {
  color: var(--navy);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}

.insert-panel select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(18, 56, 107, .18);
  border-radius: 14px;
  background: white;
  color: var(--graphite);
  font-weight: 850;
}

.route-tree {
  display: grid;
  gap: 10px;
}

.route-stack-panel,
.prototype-control-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.route-stack-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 0 0 1px rgba(18, 56, 107, .08);
}

.route-stack-row.current {
  background: #eaf9fb;
  box-shadow: inset 0 0 0 2px rgba(33, 199, 216, .5);
}

.route-stack-row > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 11px;
  background: var(--navy);
  color: var(--paper);
  font-weight: 950;
}

.route-stack-row b,
.route-stack-row em,
.route-stack-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.route-stack-row em {
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.route-stack-row small {
  margin-top: 5px;
  color: var(--blue);
  font-weight: 950;
}

.route-topic-block {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 0 0 1px rgba(18, 56, 107, .08);
}

.route-topic-block.current {
  background: #eaf9fb;
  box-shadow: inset 0 0 0 2px rgba(33, 199, 216, .5);
}

.route-topic-block.closed {
  background: #edf9f4;
}

.route-topic-block summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.route-topic-block summary b,
.route-topic-block summary span {
  overflow-wrap: anywhere;
}

.route-topic-block summary span {
  color: var(--muted);
  font-weight: 850;
}

.route-prototype-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  position: relative;
  margin-top: 10px;
  padding: 12px 12px 12px 18px;
  border-radius: 16px;
  background: rgba(18, 56, 107, .05);
  overflow: hidden;
}

.route-prototype-control::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: rgba(18, 56, 107, .22);
}

.route-prototype-control.attention-red {
  background: rgba(224, 64, 64, .08);
  box-shadow: inset 0 0 0 1px rgba(224, 64, 64, .18);
}

.route-prototype-control.attention-red::before {
  background: #e04040;
}

.route-prototype-control.attention-yellow {
  background: rgba(255, 191, 71, .12);
  box-shadow: inset 0 0 0 1px rgba(255, 191, 71, .28);
}

.route-prototype-control.attention-yellow::before {
  background: #d88700;
}

.route-prototype-control.attention-green {
  background: rgba(8, 115, 79, .09);
  box-shadow: inset 0 0 0 1px rgba(8, 115, 79, .18);
}

.route-prototype-control.attention-green::before {
  background: #08734f;
}

.route-prototype-control.skipped {
  opacity: .68;
  background: rgba(17, 17, 17, .05);
}

.route-prototype-control b,
.route-prototype-control em,
.route-prototype-control small {
  display: block;
  overflow-wrap: anywhere;
}

.route-prototype-control em {
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.route-prototype-control small {
  margin-top: 5px;
  color: var(--blue);
  font-weight: 950;
}

.prototype-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.prototype-title-line b {
  min-width: 0;
}

.prototype-title-line span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(18, 56, 107, .08);
  color: var(--navy);
  font-size: 11px;
  font-weight: 950;
  text-transform: lowercase;
}

.attention-red .prototype-title-line span {
  background: rgba(224, 64, 64, .14);
  color: #9b1c1c;
}

.attention-yellow .prototype-title-line span {
  background: rgba(255, 191, 71, .22);
  color: #8a5600;
}

.attention-green .prototype-title-line span {
  background: rgba(8, 115, 79, .14);
  color: #08734f;
}

.prototype-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.prototype-buttons button,
.route-stack-row button {
  border: 0;
  border-radius: 12px;
  padding: 9px 10px;
  font-weight: 950;
}

.add-prototype-task {
  background: #dbf7ec;
  color: #08734f;
}

.remove-prototype-task,
.route-stack-row .remove-plan-task {
  background: rgba(224, 64, 64, .12);
  color: #9b1c1c;
}

.skip-prototype {
  background: #fff4d8;
  color: #8a5600;
}

.skip-prototype.return {
  background: #d9f7fb;
  color: #0e5361;
}

.route-node {
  border-radius: 18px;
  background: rgba(18, 56, 107, .06);
}

.route-node.dragging {
  opacity: .45;
}

.route-node summary,
.route-prototype-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
}

.route-topic {
  margin: 10px 0 10px 16px;
  background: rgba(33, 199, 216, .11);
}

.route-prototype {
  margin: 8px 8px 8px 24px;
  background: white;
}

.route-task-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px;
}

.route-task-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.route-task-list span {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(18, 56, 107, .07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.route-node label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--navy);
  font-weight: 950;
}

.route-node input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  accent-color: var(--cyan);
}

.route-node small {
  color: var(--muted);
  font-weight: 800;
}

.route-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.route-controls button {
  min-height: 30px;
  min-width: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: var(--paper);
  font-weight: 950;
}

.selected-route {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: #fff4d8;
}

.plan-edit-list {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(18, 56, 107, .06);
}

.plan-edit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.plan-edit-head b {
  color: var(--muted);
  font-size: 12px;
}

#routePlanList {
  display: grid;
  gap: 8px;
}

.route-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(18, 56, 107, .1);
  border-radius: 16px;
  background: white;
}

.route-plan-row.current {
  box-shadow: inset 0 0 0 2px rgba(33, 199, 216, .34);
}

.route-plan-row.will-remove {
  border-color: rgba(211, 74, 74, .35);
  background: #fff0ee;
}

.route-plan-row b,
.route-plan-row span {
  display: block;
}

.route-plan-row b {
  color: var(--graphite);
  font-size: 14px;
}

.route-plan-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.remove-plan-task,
.remove-selection {
  border: 0;
  border-radius: 12px;
  background: rgba(211, 74, 74, .1);
  color: #a92f2f;
  font-size: 12px;
  font-weight: 950;
}

.remove-plan-task {
  min-height: 36px;
}

#selectedRouteBlocks {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.selected-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--navy);
  font-weight: 950;
}

.selected-block span {
  color: #8a5600;
}

.selected-block.removal {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #fff0ee;
}

.remove-selection {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

@media (max-width: 680px) {
  .login-form,
  .compact-actions,
  .teacher-actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .whiteboard-toolbar {
    gap: 5px;
    padding: 6px;
  }

  .board-tool,
  .board-zoom {
    width: 30px;
    height: 30px;
  }

  .board-size-btn {
    width: 21px;
    height: 25px;
  }

  .board-size-slider {
    width: 60px;
  }

  .board-colors {
    gap: 5px;
  }

  .board-color {
    width: 18px;
    height: 18px;
  }

  .whiteboard-canvas-wrap {
    height: 42vh;
    min-height: 310px;
    max-height: 440px;
  }

  .teacher-whiteboard .whiteboard-canvas-wrap {
    height: 38vh;
    min-height: 280px;
    max-height: 380px;
  }

  #hintModal {
    align-items: end;
    padding: 8px;
  }

  #hintModal .modal-panel {
    padding: 14px;
    border-radius: 18px 18px 12px 12px;
  }

  .hint-attempt-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .hint-attempt-row em {
    grid-column: 2;
    white-space: normal;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  body.student-mode .topbar {
    align-items: center;
    padding: 12px 14px;
  }

  body.student-mode .brand small {
    display: none;
  }

  .role-switch {
    width: 100%;
  }

  .role-btn {
    flex: 1;
  }

  .screen {
    min-height: calc(100vh - 135px);
    padding: 14px;
  }

  .mini-progress,
  .metrics,
  .answer-row,
  .ask-row,
  .entity-map,
  .theory-block,
  .trial-task-row,
  .student-stats {
    grid-template-columns: 1fr;
  }

  .trial-builder-head,
  .trial-chart-head,
  .module-map-head {
    flex-direction: column;
  }

  .module-map-head > span {
    max-width: none;
    text-align: left;
  }

  .task-head,
  .dash-head {
    flex-direction: column;
  }

  .task-board {
    min-height: auto;
  }

  .student-actions {
    display: grid;
  }

  .level-card {
    flex-basis: auto;
    width: 100%;
  }

  .quest-path::before {
    left: 34px;
    right: 34px;
  }

  .phone {
    width: 100%;
    min-height: 0;
    padding: 12px;
    border-radius: 24px;
  }

  .phone-head h2 {
    max-width: 190px;
    font-size: 28px;
  }

  .roster-row {
    grid-template-columns: 1fr;
  }

  .roster-actions {
    justify-content: space-between;
  }

  .student-direct-link {
    max-width: 100%;
  }

  .phone-commentary {
    min-height: 420px;
  }

  .prototype-row,
  .route-card,
  .game-module,
  .module-select-surface {
    grid-template-columns: 1fr;
  }

  .module-actions-row {
    padding-left: 0;
  }

  .module-map-head {
    flex-direction: column;
  }

  .module-map-head > span {
    max-width: none;
    text-align: left;
  }

  .module-column {
    display: block;
  }
}
