:root {
  --ink: #16364a;
  --muted: #617b89;
  --paper: #ffffff;
  --mist: #f5fbfc;
  --line: #dbeaec;
  --teal: #0e9c91;
  --teal-dark: #08766f;
  --blue: #3286d9;
  --blue-soft: #e6f2ff;
  --green-soft: #e8f8ee;
  --yellow: #ffc94a;
  --yellow-soft: #fff5d6;
  --coral: #f47d68;
  --coral-soft: #fff0ed;
  --shadow: 0 16px 40px rgba(21, 72, 83, 0.11);
  --shadow-soft: 0 8px 22px rgba(21, 72, 83, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #edf8f8;
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.lucide-icon {
  display: block;
  flex: 0 0 auto;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #e6f8f9 0, #f7fbfa 280px, #f7fbfa 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(219, 234, 236, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--teal);
  color: white;
  font-size: 18px;
}

.role-switch {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4faf9;
}

.student-mini {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--teal-dark);
  font-weight: 900;
  padding: 7px 10px;
  cursor: pointer;
}

.student-mini small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-switch button {
  min-width: 74px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 10px;
}

.role-switch button.active {
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(31, 93, 99, 0.1);
  color: var(--teal-dark);
}

.layout {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  width: min(100%, 1240px);
  min-height: calc(100vh - 66px);
  margin: 0 auto;
}

.sidebar {
  padding: 24px 14px;
  border-right: 1px solid var(--line);
}

.student-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 20px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow-soft);
  color: #a46900;
  font-weight: 900;
}

.student-chip strong,
.student-chip small {
  display: block;
}

.student-chip small {
  color: var(--muted);
  font-size: 12px;
}

.chip-action {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
  cursor: pointer;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-btn:hover,
.nav-btn.active {
  background: #daf3f0;
  color: var(--teal-dark);
}

.nav-icon {
  width: 20px;
  color: var(--teal-dark);
  font-size: 16px;
  text-align: center;
}

.main {
  min-width: 0;
  padding: 28px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-head h1,
.page-head h2,
.page-head p {
  margin: 0;
}

.page-head h1 {
  font-size: 24px;
}

.page-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 10px;
  box-shadow: var(--shadow-soft);
}

.pill strong {
  color: var(--ink);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
}

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

.card {
  border: 1px solid rgba(219, 234, 236, 0.85);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.hero {
  position: relative;
  min-height: 344px;
  overflow: hidden;
  background: #0fa8b4 url("./assets/learning-map.png") center 52% / cover;
  color: white;
}

.hero::after {
  position: absolute;
  inset: 0;
  background: rgba(4, 88, 104, 0.42);
  content: "";
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 344px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.hero h1,
.hero p {
  margin: 0;
}

.hero h1 {
  max-width: 560px;
  font-size: 30px;
  line-height: 1.25;
}

.hero p {
  max-width: 560px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.progress-box {
  width: min(100%, 430px);
}

.progress-line {
  height: 9px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

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

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal);
  color: white;
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.btn-yellow {
  background: var(--yellow);
  color: #6a4a00;
}

.btn-yellow:hover {
  background: #ffd66e;
}

.btn-soft {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.btn-soft:hover {
  background: var(--mist);
}

.btn-coral {
  background: var(--coral-soft);
  color: #b24535;
}

.btn-wide {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--teal-dark);
  font-size: 17px;
}

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

.metric {
  padding: 15px;
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  margin-top: 5px;
  font-size: 24px;
}

.metric .tiny {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

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

.section-card {
  padding: 18px;
}

.section-card h2,
.section-card h3,
.section-card p {
  margin: 0;
}

.section-card h2 {
  font-size: 17px;
}

.section-card h3 {
  font-size: 15px;
}

.section-card p {
  color: var(--muted);
  font-size: 13px;
}

.voice-teacher {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 0;
}

.teacher-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--teal-dark);
  font-weight: 900;
}

.teacher-avatar.custom {
  background: var(--yellow-soft);
  color: #a46900;
}

.teacher-title strong,
.teacher-title span {
  display: block;
}

.teacher-title span {
  color: var(--muted);
  font-size: 12px;
}

.reward-row,
.word-row,
.book-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.reward-row:last-child,
.word-row:last-child,
.book-row:last-child {
  border-bottom: 0;
}

.check-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--teal);
}

.check-row span {
  min-width: 0;
}

.reward-row strong,
.reward-row small,
.word-row strong,
.word-row small,
.book-row strong,
.book-row small {
  display: block;
}

.reward-row small,
.word-row small,
.book-row small {
  color: var(--muted);
  font-size: 12px;
}

.unit-list {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.unit-group {
  padding: 12px 0;
}

.unit-group > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.unit-chip-row {
  gap: 7px;
}

.unit-chip {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  padding: 7px 9px;
  text-align: left;
}

.unit-chip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.unit-chip.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.mini-badge {
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #8d6100;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.study-shell {
  max-width: 820px;
  margin: 0 auto;
}

.study-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.study-progress {
  flex: 1;
}

.study-progress .progress-line {
  background: #dcecef;
}

.word-card {
  min-height: 560px;
  padding: 28px;
  text-align: center;
}

.word-card .word-main {
  margin: 42px 0 0;
  font-size: 52px;
  line-height: 1.1;
}

.phonetic {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.meaning-box {
  max-width: 580px;
  margin: 22px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.meaning {
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 900;
}

.sentence {
  margin-top: 17px;
  color: var(--ink);
  font-size: 17px;
}

.sentence-with-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sentence-audio {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--mist);
  color: var(--teal-dark);
}

.sentence-audio:hover {
  border-color: var(--teal);
  background: var(--green-soft);
}

.translation {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.word-audio-btn {
  min-height: 54px;
  margin-top: 14px;
  padding: 12px 20px;
  font-size: 16px;
}

.recording-box {
  max-width: 580px;
  margin: 22px auto 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--mist);
  text-align: left;
}

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

.recording-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.recording-head b,
.recording-head em {
  color: var(--teal-dark);
  font-size: 18px;
  font-style: normal;
}

.recording-head em {
  color: var(--muted);
  font-size: 13px;
}

.recording-script {
  margin: 14px 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.score-reaction {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  min-height: 52px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  border: 1px solid rgba(16, 132, 120, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(38, 64, 68, 0.08);
  animation: score-card-in 520ms ease-out both;
}

.score-reaction span {
  font-size: 28px;
  line-height: 1;
  transform-origin: center;
  animation: score-emoji-bounce 1200ms ease-out both;
}

.score-reaction strong {
  color: var(--ink);
  font-size: 18px;
}

.score-reaction small {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.score-reaction.score-perfect {
  border-color: rgba(25, 150, 102, 0.36);
  box-shadow: 0 12px 28px rgba(25, 150, 102, 0.16);
}

.score-reaction.score-try {
  border-color: rgba(215, 94, 75, 0.34);
  box-shadow: 0 12px 28px rgba(215, 94, 75, 0.13);
}

.score-celebration {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.18);
  animation: score-overlay-out 1300ms ease-out both;
}

.score-celebration-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 220px;
  padding: 26px 30px;
  border: 1px solid rgba(16, 132, 120, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 26px 70px rgba(30, 63, 73, 0.22);
  animation: score-center-pop 1300ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.score-celebration-card span {
  font-size: 64px;
  line-height: 1;
  animation: score-emoji-bounce 1000ms ease-out both;
}

.score-celebration-card strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.score-celebration-card small {
  color: var(--teal-dark);
  font-size: 16px;
  font-weight: 900;
}

@keyframes score-card-in {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes score-center-pop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.56) rotate(-5deg);
  }
  22% {
    opacity: 1;
    transform: translateY(0) scale(1.12) rotate(3deg);
  }
  48% {
    transform: translateY(0) scale(1) rotate(0);
  }
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-44px) scale(0.76);
  }
}

@keyframes score-overlay-out {
  0%,
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes score-emoji-bounce {
  0% {
    transform: scale(0.72) rotate(-8deg);
  }
  38% {
    transform: scale(1.18) rotate(5deg);
  }
  62% {
    transform: scale(0.96) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.recording-actions {
  justify-content: center;
}

.record-btn {
  min-width: 152px;
}

.recording-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

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

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.compact-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.system-panel {
  margin-bottom: 16px;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.system-grid div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.system-grid strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
}

.system-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.backup-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 650px;
  margin: 30px auto 0;
}

.answer {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.answer:hover {
  border-color: var(--teal);
  background: #f2fbfa;
}

.answer.correct {
  border-color: #57b576;
  background: var(--green-soft);
  color: #237841;
}

.answer.wrong {
  border-color: var(--coral);
  background: var(--coral-soft);
  color: #a43e31;
}

.feedback {
  max-width: 650px;
  margin: 16px auto 0;
  padding: 14px;
  border-radius: 7px;
  background: var(--green-soft);
  color: #276c43;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.feedback.retry {
  background: var(--yellow-soft);
  color: #7a5a0c;
}

.map-card {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #0fa8b4 url("./assets/learning-map.png") center / cover;
}

.map-card::after {
  position: absolute;
  inset: 0;
  background: rgba(2, 93, 100, 0.16);
  content: "";
}

.map-title,
.map-nodes {
  position: relative;
  z-index: 1;
}

.map-title {
  padding: 22px;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 70, 87, 0.4);
}

.map-title h1,
.map-title p {
  margin: 0;
}

.map-title p {
  margin-top: 4px;
}

.map-node {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 74px;
  min-height: 74px;
  place-items: center;
  border: 4px solid white;
  border-radius: 50%;
  box-shadow: 0 9px 20px rgba(18, 86, 86, 0.22);
  color: white;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.map-node.done {
  background: var(--teal);
}

.map-node.current {
  background: var(--coral);
  transform: scale(1.08);
}

.map-node.locked {
  background: #789397;
}

.map-node.one {
  bottom: 12%;
  left: 18%;
}

.map-node.two {
  bottom: 24%;
  left: 43%;
}

.map-node.three {
  right: 27%;
  bottom: 42%;
}

.map-node.four {
  right: 11%;
  bottom: 60%;
}

.challenge-panel {
  align-self: start;
}

.challenge-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.challenge-stats div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
  padding: 12px;
}

.challenge-stats strong,
.challenge-stats span {
  display: block;
}

.challenge-stats strong {
  font-size: 25px;
}

.challenge-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.challenge-rules {
  margin: 12px 0 18px;
}

.level-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 18px;
}

.level-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.level-dot.current {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #1f4f8f;
}

.level-dot.passed {
  border-color: rgba(49, 163, 120, 0.35);
  background: #e9f8f1;
  color: #15724f;
}

.level-dot.current.passed {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #1f4f8f;
}

.level-dot.locked {
  background: var(--mist);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.level-more {
  display: grid;
  height: 34px;
  min-width: 42px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.challenge-hint {
  margin-top: 10px;
  text-align: center;
}

.challenge-card {
  min-height: 520px;
  padding: 28px;
  text-align: center;
}

.challenge-type {
  display: inline-flex;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #8d6100;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
}

.challenge-word {
  margin-top: 42px;
  font-size: 44px;
  font-weight: 900;
  line-height: 1.15;
}

.challenge-options {
  margin-top: 34px;
}

.challenge-input-wrap {
  display: flex;
  max-width: 520px;
  gap: 10px;
  margin: 34px auto 0;
}

.challenge-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  padding: 10px 12px;
}

.challenge-result {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.challenge-medal {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin: 6px auto 12px;
  border-radius: 50%;
  background: var(--yellow);
  color: #6a4a00;
  font-size: 36px;
  font-weight: 900;
}

.challenge-review {
  margin-top: 10px;
  text-align: left;
}

.table-wrap {
  overflow-x: auto;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
}

.simple-table th,
.simple-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}

.simple-table th {
  color: var(--muted);
  font-size: 12px;
}

.status {
  border-radius: 999px;
  background: var(--green-soft);
  color: #267944;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.status.warm {
  background: var(--yellow-soft);
  color: #8d6100;
}

.summary {
  padding: 16px;
  border-left: 4px solid var(--teal);
  background: #f2fbfa;
  color: #345f67;
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  color: var(--muted);
  font-size: 12px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #c9d9db;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(33, 77, 84, 0.22);
  content: "";
  transition: 0.18s ease;
}

.toggle.on {
  background: var(--teal);
}

.toggle.on::after {
  transform: translateX(20px);
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  display: grid;
  inset: 0;
  place-items: center;
  padding: 20px;
  background: rgba(13, 53, 65, 0.42);
}

.modal {
  width: min(100%, 680px);
  max-height: min(760px, 92vh);
  overflow-y: auto;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.modal-head,
.modal-body,
.modal-foot {
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

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

.student-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.student-row.active {
  border-color: var(--teal);
  background: #effaf7;
}

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

.student-row small,
.student-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.student-create {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.student-create h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.empty {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  max-width: 320px;
  border-radius: 7px;
  background: #173f4d;
  box-shadow: var(--shadow);
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 15px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(230, 248, 249, 0.96), rgba(247, 251, 250, 0.98)),
    url("./assets/learning-map.png") center / cover;
}

.auth-panel {
  width: min(100%, 420px);
  border: 1px solid rgba(219, 234, 236, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-brand {
  justify-content: center;
}

.auth-copy {
  margin-top: 22px;
  text-align: center;
}

.auth-copy h1,
.auth-copy p {
  margin: 0;
}

.auth-copy h1 {
  font-size: 24px;
}

.auth-copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.auth-error {
  border-radius: 7px;
  background: var(--coral-soft);
  color: #b24535;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 10px;
}

.top-logout {
  min-height: 36px;
  margin-left: 10px;
  padding: 7px 10px;
  white-space: nowrap;
}

.report-panel {
  margin-top: 16px;
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.calendar-day {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--mist);
  padding: 9px;
}

.calendar-day.active {
  border-color: rgba(14, 156, 145, 0.32);
  background: var(--green-soft);
}

.calendar-day strong,
.calendar-day span {
  display: block;
}

.calendar-day strong {
  font-size: 14px;
}

.calendar-day span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.report-columns h3 {
  margin-bottom: 10px;
}

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

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .main {
    padding: 24px;
  }

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

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

  .hero h1 {
    font-size: 28px;
  }
}

@media (max-width: 900px) {
  .topbar {
    justify-content: flex-start;
    padding: 0 18px;
  }

  .student-mini {
    margin-left: 0;
  }

  .role-switch {
    margin-left: auto;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 5px 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(255, 255, 255, 0.96);
  }

  .student-chip {
    display: none;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .nav-btn {
    justify-content: center;
    gap: 3px;
    flex-direction: column;
    padding: 7px 2px;
    font-size: 11px;
  }

  .main {
    padding: 18px 16px 82px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

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

  .panel-head,
  .backup-row,
  .word-row {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-actions {
    justify-content: flex-start;
  }

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

  .report-columns,
  .search-row {
    grid-template-columns: 1fr;
  }

  .calendar-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero {
    min-height: 316px;
  }

  .hero-content {
    min-height: 316px;
    padding: 18px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .modal {
    width: min(100%, 720px);
    max-height: 88vh;
  }
}

@media (max-width: 620px) {
  .topbar {
    flex-wrap: wrap;
    min-height: 58px;
    padding: 0 14px;
    padding-block: 10px;
  }

  .brand {
    flex: 1 1 auto;
    font-size: 16px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .role-switch button {
    min-width: 57px;
    padding: 6px 7px;
    font-size: 12px;
  }

  .student-mini {
    order: 3;
    flex: 1 1 100%;
    justify-content: center;
  }

  .top-logout {
    max-width: 92px;
    min-height: 34px;
    overflow: hidden;
    padding: 7px 8px;
    font-size: 12px;
    text-overflow: ellipsis;
  }

  .auth-shell {
    align-items: stretch;
    padding: 14px;
  }

  .auth-panel {
    align-self: center;
    padding: 18px;
  }

  .page-head h1 {
    font-size: 21px;
  }

  .hero-bottom {
    display: block;
  }

  .hero-bottom .btn {
    width: 100%;
    margin-top: 15px;
  }

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

  .word-card {
    min-height: 500px;
    padding: 18px;
  }

  .word-card .word-main {
    margin-top: 38px;
    font-size: 42px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .map-card {
    min-height: 520px;
  }

  .map-node {
    width: 62px;
    min-height: 62px;
    border-width: 3px;
    font-size: 11px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 8px;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding: 14px;
  }

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

@media (max-width: 420px) {
  .main {
    padding-inline: 12px;
  }

  .metric-grid,
  .system-grid {
    grid-template-columns: 1fr;
  }

  .word-card .word-main {
    font-size: 38px;
  }

  .side-nav {
    gap: 2px;
  }

  .nav-btn {
    font-size: 10px;
  }
}
