:root {
  --ink: #17202a;
  --muted: #657080;
  --line: #d9e0e7;
  --panel: #ffffff;
  --soft: #f3f6f8;
  --accent: #0f766e;
  --accent-dark: #0b5d57;
  --warm: #f2b84b;
  --danger: #bd3c37;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #e9eef2;
}

body.student-teaching-active {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}

.sidebar {
  background: #f8fafb;
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  overflow-y: auto;
}

.brand h1 {
  margin: 4px 0 10px;
  font-size: 30px;
  line-height: 1.18;
}

.brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.search-row {
  margin: 22px 0;
}

.search-row input,
.filter-row select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.audio-overview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
}

.audio-overview div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.audio-overview span {
  color: var(--muted);
  font-size: 13px;
}

.audio-overview strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e7edf0;
  overflow: hidden;
  margin-top: 10px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.production-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.production-links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 8px;
}

.production-links a:first-child {
  grid-column: 1 / -1;
  border-color: var(--accent);
  background: #e7f5f3;
}

.filter-row {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.filter-row label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.group {
  margin-bottom: 20px;
}

.group h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

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

.phoneme-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 4px;
}

.phoneme-btn:hover,
.phoneme-btn.active {
  border-color: var(--accent);
  background: #e7f5f3;
  color: var(--accent-dark);
  font-weight: 700;
}

.phoneme-btn span {
  font-size: 17px;
  line-height: 1;
}

.phoneme-btn small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.phoneme-btn.audio-partial {
  border-color: #d8c7a2;
  background: #fff8e8;
}

.phoneme-btn.audio-complete {
  border-color: #b8ddd8;
  background: #e7f5f3;
}

.phoneme-btn.audio-complete small,
.phoneme-btn.audio-partial small {
  color: var(--accent-dark);
}

.app.mode-phonetics.phonetics-overview-mode {
  grid-template-columns: 1fr;
}

.app.mode-phonetics.phonetics-overview-mode .sidebar {
  display: none;
}

.app.mode-phonetics:not(.phonetics-overview-mode) .sidebar {
  padding-top: 8px;
}

.app.mode-phonetics:not(.phonetics-overview-mode) .brand,
.app.mode-phonetics:not(.phonetics-overview-mode) #phoneticsSidebar > .search-row,
.app.mode-phonetics:not(.phonetics-overview-mode) #phoneticsSidebar > .audio-overview,
.app.mode-phonetics:not(.phonetics-overview-mode) #phoneticsSidebar > .production-links {
  display: none;
}

.app.mode-phonetics:not(.phonetics-overview-mode) #phoneticsSidebar .filter-row {
  margin-top: 0;
}

#phoneticsStage.phonetics-overview {
  background:
    radial-gradient(circle at 12% 8%, rgba(92, 211, 203, 0.22), transparent 28%),
    linear-gradient(135deg, #eefcf9 0%, #eef5ff 100%);
}

#phoneticsStage .phonetics-overview-panel {
  display: none;
}

#phoneticsStage.phonetics-overview .phonetics-overview-panel {
  display: grid;
  gap: 18px;
  width: min(1400px, 100%);
  margin: 0 auto;
}

#phoneticsStage.phonetics-overview > .topbar,
#phoneticsStage.phonetics-overview > .teacher-panel,
#phoneticsStage.phonetics-overview > .content-grid,
#phoneticsStage.phonetics-overview > .practice-area,
#phoneticsStage.phonetics-overview > .script-area {
  display: none;
}

.phonetics-overview-header {
  display: grid;
  position: relative;
  min-height: 50px;
  padding: 0 132px;
  align-items: start;
  justify-items: center;
  text-align: center;
}

.phonetics-overview-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 82px);
  line-height: 1.02;
}

.phonetics-overview-header-actions {
  position: absolute;
  top: 6px;
  right: 0;
  display: flex;
  gap: 8px;
}

.phonetics-overview-home-btn,
.phonetics-overview-back-btn {
  min-height: 42px;
  border: 1px solid rgba(20, 163, 150, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 900;
  padding: 0 18px;
  box-shadow: 0 10px 22px rgba(20, 163, 150, 0.16);
}

.phonetics-overview-home-btn {
  background: var(--accent);
  color: #fff;
}

.phonetics-overview-home-btn:hover {
  background: var(--accent-dark);
}

.phonetics-overview-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}

.phonetics-overview-group,
.phonetics-selected-card {
  border: 1px solid rgba(20, 163, 150, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(21, 78, 92, 0.1);
}

.phonetics-overview-group {
  padding: 18px 22px 18px;
}

.phonetics-chart-heading {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
}

.phonetics-chart-main-title {
  grid-column: 2;
  margin: 0;
  color: var(--accent-dark);
  font-size: clamp(24px, 2.5vw, 34px);
  text-align: center;
}

.phonetics-chart-pill {
  width: max-content;
  max-width: 100%;
  margin: 0 auto -6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #17b8b0, var(--accent));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  padding: 10px 28px;
  position: relative;
  transform: translateY(-8px);
  z-index: 1;
}

.phonetics-chart-table {
  width: 100%;
  border: 1px solid rgba(20, 163, 150, 0.2);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  overflow: hidden;
  table-layout: fixed;
}

.phonetics-chart-table tbody tr:first-child th,
.phonetics-chart-table tbody tr:first-child td {
  border-top: 0;
}

.phonetics-chart-table th,
.phonetics-chart-table td {
  border-top: 1px solid rgba(20, 163, 150, 0.14);
  padding: 7px 9px;
  vertical-align: middle;
}

.phonetics-chart-family {
  width: 48px;
  border-right: 1px solid rgba(20, 163, 150, 0.12);
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.phonetics-chart-label {
  width: 76px;
  color: #30445a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
}

.consonant-table .phonetics-chart-label {
  width: 58px;
}

.consonant-table {
  table-layout: auto;
}

.phonetics-chart-table.consonant-table th,
.phonetics-chart-table.consonant-table td {
  padding-left: 4px;
  padding-right: 4px;
}

.consonant-table .phonetics-chart-family {
  width: 40px;
  font-size: 18px;
}

.phonetics-chart-pair-label {
  width: 56px;
  border-right: 1px solid rgba(20, 163, 150, 0.12);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  white-space: pre-line;
}

.consonant-table .phonetics-chart-pair-label {
  width: 42px;
  font-size: 16px;
}

.phonetics-chart-sounds {
  min-width: 0;
}

.phonetics-chart-sound-cell {
  min-width: 58px;
  text-align: center;
}

.consonant-table .phonetics-chart-sound-cell {
  min-width: 48px;
}

.phonetics-chart-sound-cell .phonetics-overview-phoneme {
  width: 100%;
}

.phonetics-chart-sound-list {
  display: grid;
  gap: 3px;
  align-items: stretch;
}

.phonetics-overview-phoneme {
  min-width: 0;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 5px 4px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.phonetics-overview-phoneme:hover,
.phonetics-overview-phoneme.active {
  border-color: var(--accent);
  background: #e3f8f5;
  color: var(--accent-dark);
}

.phonetics-overview-phoneme strong {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1;
  white-space: nowrap;
}

.phonetics-overview-phoneme span {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  word-break: keep-all;
}

.consonant-table .phonetics-overview-phoneme {
  min-height: 46px;
  padding: 4px 2px;
}

.consonant-table .phonetics-overview-phoneme strong {
  font-size: clamp(17px, 1.45vw, 22px);
}

.consonant-table .phonetics-overview-phoneme span {
  font-size: 13px;
}

.phonetics-overview-actions {
  display: flex;
  justify-content: center;
}

.phonetics-course-stack {
  width: 100%;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.phonetics-course-resource {
  width: 100%;
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(20, 163, 150, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(231, 245, 243, 0.94));
  box-shadow: 0 16px 34px rgba(21, 78, 92, 0.1);
  padding: 16px 18px;
}

.phonetics-course-stack .phonetics-course-resource {
  width: 100%;
}

.phonetics-course-copy {
  display: grid;
  gap: 5px;
}

.phonetics-course-copy span {
  width: fit-content;
  border-radius: 999px;
  background: #dff4f1;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 3px 10px;
}

.phonetics-course-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 1.8vw, 28px);
}

.phonetics-course-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.phonetics-course-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.phonetics-course-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(20, 163, 150, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-dark);
  font-weight: 900;
  padding: 0 16px;
  text-decoration: none;
}

.phonetics-course-link.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(20, 163, 150, 0.16);
}

.phonetics-course-link:hover {
  border-color: var(--accent);
  background: #e3f8f5;
}

.phonetics-course-link.primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.phonetics-overview-detail-btn {
  min-height: 56px;
  border: 1px solid rgba(20, 163, 150, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  padding: 0 28px;
}

.phonetics-overview-detail-btn:hover {
  border-color: var(--accent);
  background: #e3f8f5;
}

.phonetics-selected-card {
  display: grid;
  gap: 10px;
  justify-self: center;
  width: min(620px, 100%);
  padding: 18px 20px;
}

.phonetics-selected-card > span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.phonetics-selected-card > strong {
  color: var(--ink);
  font-size: 46px;
  line-height: 1;
}

.phonetics-selected-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.phonetics-selected-card .primary-btn {
  justify-self: start;
  margin-top: 4px;
}

.stage {
  padding: 28px;
  overflow-y: auto;
}

.view-stage:not(.active) {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h2 {
  margin: 2px 0 0;
  font-size: 52px;
}

#phoneticsStage.phonetics-detail {
  display: flex;
  flex-direction: column;
  background: #fff;
}

#phoneticsStage.phonetics-detail .topbar {
  order: 0;
  min-height: 108px;
  align-items: center;
  margin: 0 0 44px;
  padding: 22px 28px;
  background: #e6edf2;
}

#phoneticsStage.phonetics-detail .topbar h2 {
  font-size: clamp(54px, 5vw, 76px);
  line-height: 1;
}

#phoneticsStage.phonetics-detail .teacher-panel,
#phoneticsStage.phonetics-detail .content-grid {
  display: none;
}

#phoneticsStage.phonetics-detail .script-area {
  order: 1;
  margin-top: 0;
  margin-bottom: 78px;
  border: 0;
  background: transparent;
  padding: 0;
}

#phoneticsStage.phonetics-detail .practice-area {
  order: 2;
  margin-top: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

#phoneticsStage.phonetics-detail .script-area h3,
#phoneticsStage.phonetics-detail .practice-area h3 {
  font-size: 20px;
}

#phoneticsStage.phonetics-detail .script-area p {
  max-width: 1120px;
  font-size: 17px;
  line-height: 1.9;
}

#phoneticsStage.phonetics-detail .word-list {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 26px;
}

#phoneticsStage.phonetics-detail .word-card {
  min-height: 98px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 16px;
  cursor: pointer;
}

.actions .primary-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.teacher-panel {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.avatar {
  --mouth-open: 0;
  width: 66px;
  min-height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  overflow: hidden;
  position: relative;
}

.photo-teacher {
  position: relative;
  width: 46px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  background: #d9e0e7;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12);
}

.photo-teacher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.photo-mouth {
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: rgba(108, 31, 37, 0.78);
  transform: translateX(-50%);
  opacity: 0;
}

.avatar.has-photo .face {
  display: none;
}

.avatar.speaking .photo-mouth {
  animation: photoTalk 420ms infinite;
  opacity: 1;
}

.avatar.audio-reactive .photo-mouth {
  animation: none;
  opacity: 1;
  width: calc(9px + (var(--mouth-open) * 3px));
  height: calc(3px + (var(--mouth-open) * 7px));
}

.face {
  position: relative;
  width: 72px;
  height: 88px;
  border-radius: 42% 42% 46% 46%;
  background: #f0c7a8;
  box-shadow: inset 0 -10px 0 rgba(122, 82, 56, 0.08);
}

.hair {
  position: absolute;
  left: 5px;
  top: -7px;
  width: 62px;
  height: 28px;
  border-radius: 50% 50% 30% 30%;
  background: #263238;
}

.eye {
  position: absolute;
  top: 34px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20252b;
}

.eye.left {
  left: 20px;
}

.eye.right {
  right: 20px;
}

.nose {
  position: absolute;
  left: 34px;
  top: 44px;
  width: 5px;
  height: 12px;
  border-radius: 8px;
  background: rgba(125, 74, 48, 0.22);
}

.mouth {
  position: absolute;
  left: 27px;
  top: 64px;
  width: 19px;
  height: 7px;
  border-radius: 0 0 18px 18px;
  background: #8f2f35;
  transition: height 120ms ease, top 120ms ease;
}

.avatar.speaking .mouth {
  animation: talk 420ms infinite;
}

.avatar.audio-reactive .mouth {
  animation: none;
  height: calc(6px + (var(--mouth-open) * 14px));
  top: calc(65px - (var(--mouth-open) * 7px));
}

@keyframes talk {
  0%, 100% {
    height: 6px;
    top: 65px;
  }
  50% {
    height: 17px;
    top: 60px;
  }
}

@keyframes photoTalk {
  0%, 100% {
    height: 3px;
    width: 11px;
  }
  50% {
    height: 7px;
    width: 9px;
  }
}

.lesson-card,
.content-grid article,
.practice-area,
.script-area {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lesson-card {
  padding: 20px;
}

.transfer-line {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.transfer-line span {
  color: var(--muted);
}

.transfer-line strong {
  display: inline-grid;
  min-width: 62px;
  min-height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #fff5df;
  color: #7c4a00;
  font-size: 24px;
}

.lesson-card p,
.content-grid p,
.script-area p {
  margin: 0;
  line-height: 1.8;
}

.teacher-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px !important;
}

.teacher-identity-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.teacher-identity-status span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.teacher-identity-status.photo-ready span:first-child,
.teacher-identity-status.voice-ready span:last-child {
  border-color: #b8ddd8;
  background: #e7f5f3;
  color: var(--accent-dark);
}

.audio-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.audio-status span,
.word-card em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d8c7a2;
  border-radius: 8px;
  background: #fff8e8;
  color: #7c4a00;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.audio-status.partial span {
  border-color: #d8c7a2;
  background: #fff8e8;
  color: #7c4a00;
}

.audio-status.missing span {
  border-color: #e1b6b4;
  background: #fff1f0;
  color: #9b2c2a;
}

.audio-status.complete span,
.word-card.has-audio em {
  border-color: #b8ddd8;
  background: #e7f5f3;
  color: var(--accent-dark);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.content-grid article {
  padding: 18px;
}

h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.practice-area,
.script-area {
  margin-top: 16px;
  padding: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.word-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.word-card {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
  cursor: pointer;
}

.word-card:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.word-card.active {
  border-color: var(--warm);
  background: #fff6e5;
}

.word-card strong {
  display: block;
  font-size: 19px;
  margin-bottom: 6px;
}

.word-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.word-card em {
  margin-top: 8px;
}

.notice {
  color: var(--danger);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.mode-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.mode-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.sidebar-view,
.view-stage {
  display: none;
}

.sidebar-view.active,
.view-stage.active {
  display: block;
}

.word-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0 12px;
}

.word-overview > div,
.word-dashboard article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.word-overview span,
.word-dashboard span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.word-overview strong,
.word-dashboard strong {
  color: var(--accent-dark);
  font-size: 22px;
}

.word-library-nav {
  display: grid;
  gap: 8px;
}

.word-library-nav button {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}

.word-library-nav button.active {
  border-color: var(--accent);
  background: #e7f5f3;
}

.word-library-nav strong,
.word-library-nav span {
  display: block;
}

.word-library-nav span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

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

.app.mode-words .sidebar {
  display: none;
}

.mode-words #wordsSidebar .word-overview,
.mode-words #wordsSidebar .search-row,
.mode-words #wordsSidebar .filter-row,
.mode-words #wordsSidebar .word-library-nav {
  display: none;
}

.words-stage {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 16%, rgba(45, 196, 190, 0.18), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(88, 141, 244, 0.16), transparent 24%),
    linear-gradient(180deg, #f8fdff 0%, #eef7fb 62%, #e8f4fb 100%);
}

.words-data-refresh-status {
  position: sticky;
  top: 8px;
  z-index: 20;
  width: fit-content;
  min-height: 0;
  margin: 8px 12px -4px auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f7ef;
  color: #17633d;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.words-data-refresh-status.visible { opacity: 1; }
.words-data-refresh-status.error { background: #fff0ee; color: var(--danger); }

.words-stage .topbar h2 {
  font-size: 38px;
}

.student-home-page,
.word-memory-menu {
  display: none;
}

.student-home-page.active,
.word-memory-menu.active {
  min-height: calc(100vh - 56px);
  display: grid;
  position: relative;
}

.student-home-page.active {
  grid-template-rows: auto minmax(150px, 0.8fr) auto auto;
  gap: clamp(18px, 3vh, 34px);
}

.word-memory-menu.active {
  grid-template-rows: auto auto minmax(320px, 1fr);
  gap: clamp(18px, 3vh, 30px);
}

.home-top-actions,
.memory-menu-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.memory-menu-top {
  justify-content: flex-end;
}

.home-account-btn,
.memory-back-btn,
.home-bottom-bar button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #10233a;
  box-shadow: 0 14px 34px rgba(48, 92, 132, 0.13);
  cursor: pointer;
  font-weight: 900;
  padding: 0 22px;
}

.memory-back-btn.primary {
  border: 1px solid #168f78;
  background: #168f78;
  color: #fff;
}

.home-account-btn {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.home-account-btn span {
  width: 20px;
  height: 20px;
  display: inline-block;
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(circle at 50% 28%, #1699b4 0 28%, transparent 30%),
    radial-gradient(ellipse at 50% 86%, #1699b4 0 48%, transparent 50%);
}

.memory-back-btn::before {
  content: "<";
  margin-right: 8px;
  font-weight: 900;
}

.student-home-hero,
.memory-menu-title {
  align-self: center;
  text-align: center;
}

.home-kicker {
  width: fit-content;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #5a6f84;
  font-weight: 900;
  padding: 6px 14px;
}

.student-home-hero h2,
.memory-menu-title h2 {
  margin: 0;
  color: #10233a;
  font-size: clamp(54px, 8vw, 92px);
  line-height: 1.05;
  letter-spacing: 0;
}

.student-home-hero h2 span {
  color: #14a7b7;
}

.student-home-hero p:last-child,
.memory-menu-title p {
  margin: 14px 0 0;
  color: #6c7d91;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 800;
}

.home-feature-grid {
  width: min(1440px, 100%);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 28px);
}

.home-feature-card,
.memory-option-card {
  position: relative;
  border: 1px solid rgba(211, 225, 235, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(48, 92, 132, 0.12);
  color: #10233a;
  cursor: pointer;
  text-align: center;
}

.home-feature-card {
  min-height: clamp(230px, 24vw, 330px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px 20px;
}

.home-feature-card.disabled {
  cursor: default;
  opacity: 0.72;
}

.home-feature-card.primary {
  border-color: rgba(20, 167, 183, 0.32);
}

.home-card-icon {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #37d5c8, #168fb1);
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, 0.28), 0 12px 26px rgba(27, 153, 177, 0.24);
}

.home-card-icon::before {
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.home-card-icon.voice::before {
  content: "|||";
  letter-spacing: 3px;
}

.home-card-icon.words::before {
  content: "A";
}

.home-card-icon.library::before {
  content: "[]";
  font-size: 24px;
}

.home-card-icon.plan::before {
  content: "✓";
}

.home-feature-card strong {
  display: block;
  font-size: clamp(24px, 2.2vw, 34px);
}

.home-feature-card em {
  max-width: 220px;
  color: #66788c;
  font-size: clamp(15px, 1.35vw, 19px);
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
}

.home-feature-card i,
.memory-option-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #1499ad;
  box-shadow: 0 8px 18px rgba(48, 92, 132, 0.15);
  font-size: 34px;
  font-style: normal;
  line-height: 1;
}

.home-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #587086;
  font-size: 20px;
  font-weight: 900;
}

.memory-menu-title h2 {
  font-size: clamp(50px, 6vw, 76px);
}

.memory-option-list {
  width: min(1180px, 100%);
  justify-self: center;
  align-self: center;
  display: grid;
  gap: 26px;
}

.memory-option-card {
  min-height: 230px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 72px;
  gap: clamp(18px, 3vw, 46px);
  align-items: center;
  padding: clamp(24px, 4vw, 46px);
  text-align: left;
}

.memory-option-copy strong,
.memory-option-copy em {
  display: block;
}

.memory-option-copy strong {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
}

.memory-option-copy em {
  margin-top: 14px;
  color: #66788c;
  font-size: clamp(18px, 2vw, 25px);
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
}

.memory-option-art {
  width: min(190px, 100%);
  aspect-ratio: 1.25;
  justify-self: center;
  display: block;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #64dacf, #18a4b8);
  box-shadow: 0 20px 42px rgba(20, 153, 173, 0.2);
}

.library-art {
  clip-path: polygon(16% 12%, 78% 5%, 92% 86%, 28% 96%);
}

.upload-art {
  border-radius: 8px 8px 24px 24px;
  clip-path: polygon(4% 28%, 38% 28%, 46% 16%, 96% 16%, 96% 92%, 4% 92%);
}

.memory-bottom-bar {
  align-self: end;
}

.words-stage.page-home #studentAccountPanel,
.words-stage.page-home #studentFlow,
.words-stage.page-home #advancedWordsWorkspace,
.words-stage.page-word-memory #studentAccountPanel,
.words-stage.page-word-memory #studentFlow,
.words-stage.page-word-memory #advancedWordsWorkspace,
.words-stage.page-intake #studentHomePage,
.words-stage.page-intake #wordMemoryMenu,
.words-stage.page-intake #studentAccountPanel,
.words-stage.page-intake #studentFlow,
.words-stage.page-intake #advancedWordsWorkspace,
.words-stage.page-library #studentHomePage,
.words-stage.page-library #wordMemoryMenu,
.words-stage.page-library #studentFlow,
.words-stage.page-library #advancedWordsWorkspace,
.words-stage.page-account #studentHomePage,
.words-stage.page-account #wordMemoryMenu,
.words-stage.page-account #studentFlow,
.words-stage.page-account #advancedWordsWorkspace,
.words-stage.page-learning #studentHomePage,
.words-stage.page-learning #wordMemoryMenu,
.words-stage.page-learning #studentAccountPanel,
.words-stage.page-learning #advancedWordsWorkspace {
  display: none !important;
}

.words-stage.page-account #studentAccountPanel,
.words-stage.page-library #studentAccountPanel {
  display: grid;
}

.words-stage.page-library .account-profile-card,
.words-stage.page-library .student-homework-panel,
.words-stage.page-library .account-metric-grid,
.words-stage.page-library #studentPersonalDbPanel,
.words-stage.page-library #studentMembershipPanel {
  display: none;
}

.wizard-step-label {
  margin: 0 0 8px;
  color: #587086;
  font-weight: 900;
  letter-spacing: 0;
}

.wizard-step-bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.wizard-step-bar span {
  color: #587086;
  font-weight: 900;
}

.wizard-step-bar div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.wizard-step-bar button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 0 14px;
}

.wizard-step-bar button:first-child {
  border-color: #bddbd7;
  color: var(--accent-dark);
}

.words-stage.page-intake .student-intake-modal.active {
  position: static;
  inset: auto;
  z-index: auto;
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: stretch;
  padding: clamp(10px, 2vw, 28px) 0;
  background: transparent;
}

.words-stage.page-intake .student-intake-card {
  width: min(1080px, 100%);
  max-height: none;
  justify-self: center;
  align-self: center;
  overflow: visible;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 46px rgba(48, 92, 132, 0.12);
  padding: clamp(24px, 4vw, 42px);
}

.words-stage.page-intake .student-intake-card h2 {
  max-width: 900px;
  font-size: clamp(42px, 5.8vw, 68px);
}

.words-stage.page-intake .student-intake-card p {
  max-width: 980px;
  font-size: clamp(17px, 1.75vw, 23px);
}

.words-stage.page-intake .student-intake-card textarea {
  min-height: clamp(220px, 30vh, 340px);
  border-color: var(--accent);
  font-size: 20px;
}

.words-stage.page-intake .student-drop-zone {
  min-height: 138px;
  background: rgba(248, 250, 251, 0.86);
}

.words-stage.page-intake .student-modal-actions button {
  min-height: 54px;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 900;
}

.words-stage.page-learning .student-flow.active {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.words-stage.page-learning .student-hero,
.words-stage.page-learning .student-settings-drawer,
.words-stage.page-learning .student-steps {
  display: none;
}

.words-stage.page-learning .student-panel.active {
  min-height: calc(100vh - 56px);
  align-content: start;
}

.word-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.word-progress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  margin-bottom: 14px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.word-progress-track span {
  background: var(--warm);
}

.student-login-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.52);
}

.student-login-modal.active {
  display: grid;
}

.student-login-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1fr);
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
}

.login-hero-panel,
.login-method-panel {
  padding: clamp(22px, 4vw, 44px);
}

.login-hero-panel {
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(22, 78, 99, 0.94)),
    #0f766e;
  color: #fff;
}

.login-hero-panel .eyebrow {
  color: #d9fff9;
}

.login-hero-panel h2 {
  margin: 8px 0 14px;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.05;
}

.login-hero-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.7;
}

.login-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.login-benefits span {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  padding: 8px 12px;
  font-weight: 800;
}

.login-method-panel {
  display: grid;
  gap: 16px;
}

.phone-login-box {
  display: grid;
  gap: 12px;
}

.phone-login-box h3 {
  margin: 0;
  font-size: 26px;
}

.phone-login-box label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.phone-login-box input,
.invite-row input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  color: var(--ink);
  font: inherit;
}

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

.phone-login-box button,
.scan-login-card,
#studentDemoLoginBtn,
.account-actions button,
.invite-row button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 0 14px;
}

.phone-login-box .primary-btn,
.account-actions .primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.student-login-status {
  min-height: 40px;
  margin: 0;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #f4f9fc;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.scan-login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scan-login-card {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.scan-login-card strong,
.scan-login-card em {
  display: block;
}

.scan-login-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.mock-qr {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #0f172a 12px, transparent 12px 20px, #0f172a 20px 26px, transparent 26px),
    linear-gradient(#0f172a 10px, transparent 10px 18px, #0f172a 18px 24px, transparent 24px),
    #fff;
  border: 8px solid #f1f5f9;
}

.scan-login-card.wechat {
  border-color: #b8e2ca;
  background: #f1fff7;
}

.scan-login-card.alipay {
  border-color: #bfd6ff;
  background: #f3f7ff;
}

.student-account-panel {
  display: none;
  gap: 14px;
  margin-bottom: 18px;
}

.student-account-panel.active {
  display: grid;
}

.account-profile-card,
.student-homework-panel,
.student-study-loop-panel,
.student-personal-db-panel,
.student-membership-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.account-profile-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.account-profile-card h2 {
  margin: 4px 0 6px;
  font-size: clamp(28px, 3vw, 42px);
}

.account-profile-card p {
  margin: 0;
  color: var(--muted);
}

.student-homework-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 18px;
  align-items: center;
  border-color: #f2c779;
  background: linear-gradient(135deg, #fff7e7 0%, #fffdf7 48%, #eefaf7 100%);
  box-shadow: 0 16px 34px rgba(145, 93, 26, 0.1);
}

.homework-copy h3 {
  margin: 4px 0 10px;
  max-width: 780px;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.12;
  letter-spacing: 0;
}

.homework-copy p:last-child {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.homework-actions {
  display: grid;
  gap: 10px;
}

.homework-actions button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 0 16px;
}

.homework-actions .primary-btn {
  border-color: #d97706;
  background: #d97706;
  color: #fff;
}

.account-actions,
.invite-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.account-metric-grid,
.membership-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-metric-grid article,
.membership-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.account-metric-grid span,
.membership-grid span,
.account-metric-grid em,
.membership-grid em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.account-metric-grid span,
.membership-grid span {
  font-size: 13px;
  font-weight: 800;
}

.account-metric-grid strong,
.membership-grid strong {
  display: block;
  margin: 6px 0;
  color: var(--accent-dark);
  font-size: clamp(24px, 3vw, 36px);
}

.account-metric-grid em,
.membership-grid em {
  font-size: 13px;
  line-height: 1.35;
}

.student-study-loop-panel {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
}

.study-loop-controls {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(130px, 0.7fr) minmax(280px, 2fr);
  gap: 10px;
  align-items: end;
}

.study-loop-library-field {
  min-width: 0;
}

.study-loop-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.study-loop-controls select,
.study-loop-controls input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
}

.study-loop-controls button,
.student-plan-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
}

.study-loop-controls .primary-btn,
.student-plan-actions .primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.student-plan-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
  border: 1px solid #d6e7e5;
  border-radius: 8px;
  background: #eef9f7;
  padding: 12px 14px;
}

.student-plan-summary strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.student-plan-summary span {
  color: var(--muted);
  font-weight: 700;
}

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

.student-library-group-cards {
  display: grid;
  gap: 14px;
}

.student-library-group {
  display: grid;
  gap: 10px;
  border: 1px solid #d6e7e5;
  border-radius: 8px;
  background: #fbfefd;
  padding: 14px;
}

.library-group-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.library-group-heading h4,
.library-group-heading p {
  margin: 0;
}

.library-group-heading h4 {
  color: var(--accent-dark);
  font-size: 18px;
}

.library-group-heading p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.5;
}

.library-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.library-group-card {
  display: grid;
  gap: 5px;
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.library-group-card:hover:not(:disabled),
.library-group-card:focus-visible {
  border-color: var(--accent);
  background: #f1fbf9;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
  outline: 0;
  transform: translateY(-1px);
}

.library-group-card.active {
  border-color: var(--accent);
  background: #e7f5f3;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.library-group-card.pending {
  border-style: dashed;
  background: #f8fafb;
  color: var(--muted);
  cursor: not-allowed;
}

.library-group-card span,
.library-group-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.library-group-card strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.25;
}

.library-group-card.active strong,
.library-group-card.active span,
.library-group-card.active em {
  color: var(--accent-dark);
}

.student-personal-db-panel {
  display: grid;
  gap: 12px;
}

.personal-library-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.personal-library-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

.personal-library-tabs button.active {
  border-color: var(--accent);
  background: #e7f5f3;
  color: var(--accent-dark);
}

.personal-word-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.personal-word-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.personal-word-card.status-mastered {
  border-left-color: var(--accent);
  background: #f2fbf8;
}

.personal-word-card.status-review,
.personal-word-card.status-unknown,
.personal-word-card.status-weak,
.personal-word-card.status-spelling {
  border-left-color: var(--danger);
  background: #fff8f7;
}

.personal-word-card strong {
  font-size: 23px;
}

.personal-word-card span {
  color: var(--ink);
  line-height: 1.45;
}

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

.student-membership-panel {
  display: block;
}

.student-membership-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
}

.student-membership-panel summary::marker {
  color: var(--accent);
}

.student-membership-panel > .section-title,
.student-membership-panel > .membership-grid,
.student-membership-panel > .invite-row {
  margin-top: 12px;
}

.student-membership-panel.active {
  display: grid;
}

.invite-row {
  justify-content: flex-start;
}

.invite-row input {
  max-width: 260px;
}

.student-flow {
  min-height: calc(100vh - 48px);
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.student-flow.active {
  display: grid;
}

.student-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.student-hero h2 {
  margin: 4px 0 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: 0;
}

.student-hero-actions,
.student-modal-actions,
.student-teacher-actions,
.student-flow-nav,
.student-teach-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-flow-nav {
  justify-content: flex-end;
}

.student-flow-nav button {
  min-height: 42px;
  border: 1px solid #b9d8d0;
  border-radius: 10px;
  background: #fff;
  color: var(--accent-dark);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
}

.student-flow-nav .primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.student-teacher-actions {
  box-sizing: border-box;
  padding-right: var(--student-presenter-safe-width);
}

.student-hero-actions button,
.student-modal-actions button,
.student-teacher-actions button,
.student-bottom-bar button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.student-settings-drawer,
.advanced-words-workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.student-settings-drawer {
  justify-self: end;
  margin-top: -8px;
  max-width: 360px;
  padding: 0 12px;
}

.student-settings-drawer summary,
.advanced-words-workspace summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--muted);
}

.student-settings-drawer summary {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.student-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 12px;
}

.student-settings-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

.advanced-words-workspace {
  margin-top: 22px;
  padding: 0 16px;
}

.advanced-words-workspace summary {
  min-height: 54px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.advanced-words-workspace summary span {
  color: var(--ink);
}

.advanced-words-workspace summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.advanced-words-body {
  display: grid;
  gap: 16px;
  padding: 0 0 18px;
}

.student-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.student-steps span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.student-steps span.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.student-panel {
  display: none;
  min-height: min(680px, calc(100vh - 220px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.student-panel.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
}

.student-word-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  overflow: auto;
  align-content: flex-start;
  align-items: stretch;
  padding-right: 4px;
}

.student-word-game {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
}

.student-game-intro,
.student-game-card,
.student-game-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(255, 255, 255, 0.96));
  padding: 18px;
}

.student-game-intro h4,
.student-game-card h4,
.student-game-result h4 {
  margin: 8px 0;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0;
}

.student-game-intro p,
.student-game-result p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
}

.student-game-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--accent);
  padding: 0 10px;
  font-weight: 900;
}

.student-game-head,
.student-game-answer-row,
.student-game-actions,
.student-game-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.student-game-head {
  justify-content: space-between;
}

.student-game-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.14);
  overflow: hidden;
}

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

.student-game-prompt {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.student-game-prompt span,
.student-game-prompt em {
  color: var(--muted);
  font-weight: 800;
}

.student-game-prompt strong {
  color: var(--ink);
  font-size: clamp(20px, 2.5vw, 32px);
}

.student-game-answer-row input {
  min-width: min(360px, 100%);
  flex: 1 1 260px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
}

.student-game-actions {
  margin-top: 14px;
}

.student-game-answer-row button,
.student-game-actions button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
}

.student-game-answer-row .primary-btn,
.student-game-actions .primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.student-game-result.success {
  border-color: rgba(13, 148, 136, 0.4);
}

.student-game-result.retry {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.13), rgba(255, 255, 255, 0.96));
}

.student-game-summary span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  font-weight: 900;
  color: var(--ink);
}

.student-correction-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  align-content: start;
  padding-right: 4px;
}

.student-correction-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(160px, 1.25fr) minmax(170px, 1fr) 82px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.student-correction-row.removed {
  opacity: 0.55;
  background: #f8fafb;
}

.correction-raw span,
.correction-edit span,
.correction-note span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.correction-raw strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.correction-edit input {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-weight: 800;
}

.correction-note strong {
  display: inline-grid;
  min-width: 38px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
}

.correction-note span {
  margin-top: 5px;
  line-height: 1.35;
}

.student-correction-row button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.student-manual-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border: 2px solid #c6dcef;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(21, 35, 47, 0.08);
}

.student-manual-add summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  list-style: none;
}

.student-manual-add summary::-webkit-details-marker {
  display: none;
}

.student-manual-add summary::after {
  content: "+";
  float: right;
  color: var(--accent-dark);
  font-weight: 900;
}

.student-manual-add[open] summary::after {
  content: "-";
}

.manual-add-copy,
.student-manual-add strong,
.student-manual-add span {
  display: block;
}

.student-manual-add strong {
  color: var(--ink);
  font-size: 18px;
}

.student-manual-add span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.student-manual-add textarea {
  width: 100%;
  min-height: 124px;
  border: 2px solid #b9d3e8;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  resize: vertical;
  font: inherit;
  font-size: 17px;
  line-height: 1.5;
}

.student-manual-add textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.16);
  outline-offset: 0;
}

.manual-add-actions {
  display: flex;
  justify-content: flex-end;
}

.student-manual-add button {
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 900;
}

.ai-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  background: rgba(20, 29, 38, 0.42);
  padding: 18px;
}

.ai-settings-modal.active {
  display: grid;
}

.ai-settings-card {
  width: min(620px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(21, 35, 47, 0.2);
}

.ai-settings-card h3 {
  margin: 0;
  font-size: 24px;
}

.ai-settings-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.ai-settings-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ai-settings-card input[type="url"],
.ai-settings-card input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  font: inherit;
}

.ai-toggle-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
}

.ai-toggle-row input {
  width: 18px;
  height: 18px;
}

.ai-status-text {
  min-height: 40px;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #f4f9fc;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 700;
}

.ai-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ai-settings-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.student-word {
  position: relative;
  width: max-content;
  min-width: 112px;
  max-width: min(360px, 100%);
  min-height: 74px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 10px 14px;
  text-align: center;
  flex: 0 1 auto;
}

.student-word.short {
  min-width: 112px;
}

.student-word.medium {
  min-width: 154px;
}

.student-word.long {
  min-width: 210px;
}

.student-word strong,
.student-word span {
  display: block;
}

.student-word strong {
  font-size: clamp(18px, 2vw, 27px);
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  white-space: normal;
}

.student-word span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.student-word.selected {
  border-color: var(--accent);
  background: #e7f5f3;
}

.student-word.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 7px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

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

.student-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.student-bottom-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}

.student-bottom-actions .primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

#studentCorrectPanel .student-bottom-actions #studentBackToInputBtn {
  display: none;
}

#studentCorrectPanel .student-bottom-actions #studentCorrectionHomeBtn {
  min-width: 160px;
}

.student-teacher-card {
  --slide-accent: #0d9488;
  --slide-accent-dark: #0f766e;
  --slide-bg: #f7fbfa;
  --slide-soft: #ecfdf5;
  --slide-line: #cbd5df;
  --student-presenter-size: clamp(146px, 14.2vw, 202px);
  --student-presenter-offset: 18px;
  --student-presenter-action-space: 34px;
  --student-presenter-gap: 18px;
  --student-presenter-safe-width: calc(var(--student-presenter-size) + var(--student-presenter-offset) + var(--student-presenter-gap));
  --student-slide-gap: 12px;
  --student-card-pad: 14px 18px;
  --student-route-gap: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 100%;
  position: relative;
  color: #0f172a;
  overflow: visible;
}

.student-teacher-card.theme-amber {
  --slide-accent: #d97706;
  --slide-accent-dark: #b45309;
  --slide-bg: #fffaf0;
  --slide-soft: #fff3cf;
}

.student-teacher-card.theme-rose {
  --slide-accent: #e11d48;
  --slide-accent-dark: #be123c;
  --slide-bg: #fff7f8;
  --slide-soft: #ffe4e9;
}

.student-teacher-card.theme-teal {
  --slide-accent: #0d9488;
  --slide-accent-dark: #0f766e;
  --slide-bg: #f1fbf9;
  --slide-soft: #dff7f3;
}

.student-teacher-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 9px;
  background: var(--slide-accent);
  z-index: 0;
}

.student-teacher-avatar {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.student-teacher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-teacher-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-content: stretch;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.student-slide-counter,
.student-phonetic {
  color: var(--muted);
  font-weight: 700;
}

.student-slide-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}

.student-exit-btn {
  min-height: 38px;
  border: 1px solid var(--slide-accent);
  border-radius: 8px;
  background: var(--slide-accent);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 900;
}

.student-teach-nav {
  flex: 0 0 auto;
}

.student-teach-nav .student-exit-btn.secondary {
  background: #fff;
  color: var(--slide-accent-dark);
}

.student-level-tags {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.student-level-tags span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 8px;
  background: var(--slide-accent);
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
}

.student-slide-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "word word"
    "meaning related"
    "methods methods"
    "example example";
  gap: var(--student-slide-gap);
  align-items: start;
  align-content: start;
  box-sizing: border-box;
  overflow: visible;
}

.student-word-stage,
.student-memory-stage {
  min-width: 0;
  min-height: 0;
  display: contents;
}

.student-teacher-main h3 {
  margin: 0;
  font-size: clamp(36px, 4.2vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: keep-all;
}

.student-word-title {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  font-weight: 950;
}

.student-phonetic,
.student-meaning,
.student-example,
.student-method p {
  margin: 0;
  line-height: 1.65;
}

.student-example {
  font-size: clamp(16px, 1.22vw, 22px);
}

.student-meaning {
  display: grid;
  gap: 6px;
  font-size: clamp(16px, 1.3vw, 22px);
  font-weight: 800;
  line-height: 1.42;
}

.student-meaning p {
  margin: 0;
}

.student-meaning strong {
  color: var(--slide-accent-dark);
}

.student-phonetic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.student-phonetic-row span {
  color: var(--muted);
}

.student-phonetic-row button {
  min-height: 32px;
  border: 1px solid var(--slide-accent);
  border-radius: 8px;
  background: #e7f5f3;
  color: var(--slide-accent-dark);
  cursor: pointer;
  font-weight: 900;
  padding: 0 10px;
}

.student-speech-part {
  position: relative;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: var(--student-card-pad);
  overflow: visible;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.word-part,
.meaning-part,
.example-part,
.phonics-part,
.memory-route-card,
.related-part {
  border-color: rgba(203, 213, 223, 0.9);
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.word-part {
  grid-area: word;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: end;
  justify-content: start;
  justify-items: start;
  column-gap: 16px;
  min-height: 0;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.word-replay-btn {
  align-self: end;
  min-height: 38px;
  margin-bottom: 0.45em;
  border: 1px solid var(--slide-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--slide-accent) 10%, #fff);
  color: var(--slide-accent-dark);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.word-replay-btn:hover {
  background: color-mix(in srgb, var(--slide-accent) 16%, #fff);
}

.meaning-part {
  grid-area: meaning;
  background: #fff;
}

.example-part {
  grid-area: example;
  background: #f8fafc;
  margin-right: var(--student-presenter-safe-width);
}

.phonics-part {
  grid-area: phonics;
}

.student-memory-route {
  grid-area: methods;
}

.related-part {
  grid-area: related;
}

.phonics-part,
.memory-route-card {
  overflow: visible;
}

.student-teacher-card.density-light {
  --student-slide-gap: 12px;
  --student-card-pad: 13px 17px;
  --student-route-gap: 8px;
}

.student-teacher-card.density-medium {
  --student-slide-gap: 10px;
  --student-card-pad: 11px 15px;
  --student-route-gap: 7px;
}

.student-teacher-card.density-dense,
.student-teacher-card.density-tight {
  --student-slide-gap: 8px;
  --student-card-pad: 8px 12px;
  --student-route-gap: 6px;
}

.student-teacher-card.density-ultra {
  --student-slide-gap: 6px;
  --student-card-pad: 6px 9px;
  --student-route-gap: 5px;
}

.student-teacher-card.term-long .student-word-title,
.student-teacher-card.term-extra-long .student-word-title {
  letter-spacing: -0.01em;
}

.student-teacher-card.density-dense .student-meaning,
.student-teacher-card.density-tight .student-meaning {
  font-size: clamp(19px, 1.8vw, 28px);
}

.student-teacher-card.density-ultra .student-meaning {
  font-size: clamp(17px, 1.55vw, 24px);
}

.student-teacher-card.density-dense .memory-card-head strong,
.student-teacher-card.density-tight .memory-card-head strong,
.student-teacher-card.density-ultra .memory-card-head strong {
  font-size: clamp(14px, 1.05vw, 18px);
}

.student-teacher-card.density-dense .student-example,
.student-teacher-card.density-tight .student-example,
.student-teacher-card.density-ultra .student-example,
.student-teacher-card.density-dense .memory-route-card p,
.student-teacher-card.density-tight .memory-route-card p,
.student-teacher-card.density-ultra .memory-route-card p,
.student-teacher-card.density-dense .student-phonics-strip span,
.student-teacher-card.density-tight .student-phonics-strip span,
.student-teacher-card.density-ultra .student-phonics-strip span {
  font-size: clamp(15px, 1.25vw, 20px);
  line-height: 1.45;
}

.student-teacher-card.density-ultra .memory-route-card {
  grid-template-columns: minmax(120px, 0.2fr) minmax(0, 1fr);
  gap: 9px;
}

.student-speech-part.active {
  border-color: var(--slide-accent);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--slide-accent) 22%, transparent);
}

.student-speech-part.active .karaoke-line {
  text-decoration-line: underline;
  text-decoration-color: var(--slide-accent);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
  animation: studentKaraokePulse 1.1s ease-in-out infinite;
}

.phonics-audio-token {
  display: inline-block;
  border-radius: 6px;
  padding: 0 0.18em;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--slide-accent) 48%, transparent);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.16em;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.phonics-audio-token:focus-visible,
.phonics-rule-list [data-phoneme-keys]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--slide-accent) 45%, transparent);
  outline-offset: 3px;
}

.phonics-audio-token.segment-active,
.phonics-audio-token.phoneme-active {
  background: color-mix(in srgb, var(--slide-accent) 17%, #fff);
  color: var(--slide-accent-dark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--slide-accent) 18%, transparent);
  animation: studentPhonemePulse 1s ease-in-out infinite;
}

.part-label {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--slide-accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.student-memory-route {
  min-height: 0;
  display: grid;
  gap: var(--student-route-gap);
  grid-auto-rows: auto;
  align-items: stretch;
  overflow: visible;
  padding-right: 0;
}

.student-flow.teaching-fullscreen .student-memory-route .memory-route-card:nth-child(3) {
  margin-right: var(--student-presenter-safe-width);
}

.memory-route-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.22fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  align-content: center;
}

.memory-route-card.association {
  background: #fffaf0;
}

.memory-route-card.root {
  background: #f6f8ff;
}

.memory-route-card.phonics {
  background: #effaf8;
}

.memory-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.memory-card-head strong {
  display: block;
  font-size: clamp(16px, 1.25vw, 22px);
}

.memory-card-head em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.route-number {
  width: clamp(26px, 2.1vw, 34px);
  height: clamp(26px, 2.1vw, 34px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--slide-accent);
  font-weight: 900;
  flex: 0 0 auto;
}

.memory-route-card p,
.student-related-empty {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  font-size: clamp(16px, 1.18vw, 22px);
}

.student-related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-related-chips span {
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
  color: #354252;
  line-height: 1.35;
  font-weight: 700;
}

.ai-detail-status {
  margin: 10px 0 0;
  border: 1px solid #f1c77d;
  border-radius: 8px;
  background: #fff8e8;
  color: #7a4c05;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
}

.student-presenter {
  --ai-teacher-size: var(--student-presenter-size);
  position: absolute;
  right: var(--student-presenter-offset);
  bottom: var(--student-presenter-action-space);
  width: var(--ai-teacher-size);
  height: var(--ai-teacher-size);
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
}

.student-presenter .ai-teacher-photo-frame {
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  transform: none;
  box-shadow: none;
  overflow: hidden;
}

.student-presenter .ai-teacher-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.student-presenter .ai-teacher-eye {
  position: absolute;
  top: 34.8%;
  width: 17px;
  height: 3px;
  border-radius: 999px;
  background: rgba(63, 39, 32, 0.78);
  opacity: 0;
  transform: translateX(-50%) scaleY(0.2);
  transform-origin: center;
  pointer-events: none;
}

.student-presenter .ai-teacher-eye.left {
  left: 39%;
}

.student-presenter .ai-teacher-eye.right {
  left: 61%;
}

.student-presenter .ai-teacher-mouth {
  display: none;
  position: absolute;
  left: 50%;
  top: 54.4%;
  bottom: auto;
  width: calc(var(--ai-teacher-size) * 0.2);
  height: calc(var(--ai-teacher-size) * 0.065);
  border-radius: 0 0 999px 999px;
  overflow: hidden;
  opacity: 0.96;
  transform: translate(-50%, -50%) scaleY(0.68);
  transform-origin: center center;
  transition: width 90ms ease, height 90ms ease, border-radius 90ms ease, transform 90ms ease, filter 90ms ease, opacity 90ms ease;
  pointer-events: none;
}

.student-presenter .ai-teacher-mouth img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--ai-teacher-size);
  height: var(--ai-teacher-size);
  max-width: none;
  object-fit: cover;
  object-position: center 42%;
  transform: translate(-50%, -54.4%);
}

.student-teacher-card.speaking .student-presenter {
  box-shadow: none;
}

.student-teacher-card.speaking .ai-teacher-photo-frame {
  animation: aiTeacherNod 1.6s ease-in-out infinite;
}

.student-teacher-card.speaking .ai-teacher-photo {
  animation: aiTeacherGlow 1.8s ease-in-out infinite;
}

.student-teacher-card.speaking .ai-teacher-eye {
  animation: aiTeacherBlink 4.2s ease-in-out infinite;
}

.student-teacher-card.speaking .ai-teacher-mouth {
  filter: brightness(1.04) saturate(1.08);
}

.student-teacher-card.viseme-rest .ai-teacher-mouth,
.student-teacher-card:not(.speaking) .ai-teacher-mouth {
  width: calc(var(--ai-teacher-size) * 0.2);
  height: calc(var(--ai-teacher-size) * 0.055);
  border-radius: 0 0 999px 999px;
  transform: translate(-50%, -50%) scaleY(0.54) scaleX(0.98);
}

.student-teacher-card.viseme-closed .ai-teacher-mouth {
  width: calc(var(--ai-teacher-size) * 0.235);
  height: calc(var(--ai-teacher-size) * 0.032);
  border-radius: 999px;
  transform: translate(-50%, -50%) scaleY(0.38) scaleX(1.06);
}

.student-teacher-card.viseme-open .ai-teacher-mouth {
  width: calc(var(--ai-teacher-size) * 0.21);
  height: calc(var(--ai-teacher-size) * 0.108);
  border-radius: 48% 48% 54% 54%;
  transform: translate(-50%, -50%) scaleY(1.18) scaleX(1.02);
}

.student-teacher-card.viseme-wide .ai-teacher-mouth {
  width: calc(var(--ai-teacher-size) * 0.285);
  height: calc(var(--ai-teacher-size) * 0.058);
  border-radius: 999px;
  transform: translate(-50%, -50%) scaleY(0.78) scaleX(1.22);
}

.student-teacher-card.viseme-round .ai-teacher-mouth {
  width: calc(var(--ai-teacher-size) * 0.155);
  height: calc(var(--ai-teacher-size) * 0.095);
  border-radius: 50%;
  transform: translate(-50%, -50%) scaleY(1.1) scaleX(0.86);
}

.student-teacher-card.viseme-narrow .ai-teacher-mouth {
  width: calc(var(--ai-teacher-size) * 0.17);
  height: calc(var(--ai-teacher-size) * 0.055);
  border-radius: 999px;
  transform: translate(-50%, -50%) scaleY(0.7) scaleX(0.76);
}

.student-phonics-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 10px 12px;
}

.student-phonics-strip span {
  color: var(--muted);
  line-height: 1.55;
}

.student-phonics-strip button {
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #e7f5f3;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.student-phonics-popover {
  display: none;
}

.student-phonics-popover.active {
  display: block;
}

.student-phonics-popover.auto-active {
  display: block;
}

.student-phonics-popover.manual-active {
  position: fixed;
  top: 82px;
  right: 330px;
  bottom: 86px;
  left: 24px;
  z-index: 5020;
  display: block;
  overflow: auto;
  border: 1px solid #bfd9d5;
  border-radius: 8px;
  background: #fbfefd;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.18);
}

.student-phonics-popover.manual-active .phonics-mini-panel {
  min-height: 100%;
  border: 0;
  box-shadow: none;
}

.student-phonics-popover.manual-active .phonics-mini-head {
  position: sticky;
  top: -14px;
  z-index: 2;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fbfefd;
  padding: 2px 0 10px;
}

.student-phonics-popover.manual-active .phonics-rule-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.student-phonics-popover.manual-active .phonics-rule-book-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-teacher-actions button.active {
  border-color: var(--warm);
  background: #fff8e8;
  color: var(--ink);
}

.student-teacher-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.student-flow.teaching-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: block;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  background: #f5f7f6;
}

.student-flow.teaching-fullscreen .student-hero,
.student-flow.teaching-fullscreen .student-steps,
.student-flow.teaching-fullscreen .student-panel:not(#studentTeachPanel) {
  display: none !important;
}

.student-flow.teaching-fullscreen #studentTeachPanel.active {
  display: grid;
  grid-template-rows: auto;
  align-content: safe center;
  min-height: 100dvh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #eef3f6 0%, #f8fafc 100%);
  padding: clamp(10px, 2vw, 24px);
}

.student-flow.teaching-fullscreen .student-teacher-card {
  --student-presenter-size: clamp(112px, 10vw, 156px);
  --student-presenter-action-space: 28px;
  --student-presenter-gap: 12px;
  --student-slide-gap: 9px;
  --student-card-pad: 10px 14px;
  --student-route-gap: 8px;
  min-height: 0;
  height: auto;
  grid-template-columns: minmax(0, 1fr);
}

.student-flow.teaching-fullscreen .student-teacher-main {
  min-height: 0;
  gap: 8px;
  overflow: visible;
}

.student-flow.teaching-fullscreen .student-slide-top {
  min-height: 34px;
}

.student-flow.teaching-fullscreen .student-slide-layout {
  grid-template-rows: auto auto auto auto;
  align-content: start;
  overflow: auto;
  padding-bottom: 6px;
}

.student-flow.teaching-fullscreen .word-part {
  align-content: center;
}

.student-flow.teaching-fullscreen .student-teacher-main h3 {
  color: #0f172a;
  font-size: clamp(34px, 3.8vw, 58px);
}

.student-flow.teaching-fullscreen .student-meaning {
  font-size: clamp(16px, 1.35vw, 22px);
  line-height: 1.36;
}

.student-flow.teaching-fullscreen .student-phonetic {
  font-size: clamp(15px, 1.45vw, 22px);
}

.student-flow.teaching-fullscreen .student-memory-route {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
}

.student-flow.teaching-fullscreen .memory-route-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  align-content: start;
}

.student-flow.teaching-fullscreen .memory-card-head {
  gap: 8px;
}

.student-flow.teaching-fullscreen .memory-card-head strong {
  font-size: clamp(14px, 1.05vw, 18px);
}

.student-flow.teaching-fullscreen .memory-card-head em {
  font-size: 12px;
}

.student-flow.teaching-fullscreen .student-related-chips span {
  padding: 6px 9px;
}

.student-flow.teaching-fullscreen .memory-route-card p,
.student-flow.teaching-fullscreen .student-example,
.student-flow.teaching-fullscreen .student-phonics-strip span {
  font-size: clamp(15px, 1.16vw, 19px);
  line-height: 1.42;
}

.student-flow.teaching-fullscreen .student-teacher-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  align-items: center;
  padding: 10px var(--student-presenter-safe-width) 0 0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0), rgba(248, 250, 252, 0.96) 34%);
}

.student-flow.teaching-fullscreen .student-teacher-actions button {
  min-height: 46px;
}

.student-speech-status {
  grid-column: 1 / -1;
  flex: 1 0 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid #c9ddd8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  color: #355d55;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.student-speech-status[data-state="error"] {
  border-color: #efc27a;
  background: #fff8e8;
  color: #8a4d0f;
}

.student-speech-status[data-state="complete"] {
  border-color: #9dd7c8;
  background: #effbf7;
  color: #0f6f5e;
}

@keyframes studentKaraokePulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@keyframes studentPhonemePulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@keyframes aiTeacherNod {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(1.5px);
  }
}

@keyframes aiTeacherGlow {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.04) saturate(1.05);
  }
}

@keyframes aiTeacherBlink {
  0%,
  88%,
  100% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.2);
  }
  91%,
  94% {
    opacity: 0.9;
    transform: translateX(-50%) scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-speech-part.active .karaoke-line,
  .phonics-audio-token.segment-active,
  .phonics-audio-token.phoneme-active {
    animation: none;
  }

  .student-teacher-card.speaking .ai-teacher-photo-frame,
  .student-teacher-card.speaking .ai-teacher-photo,
  .student-teacher-card.speaking .ai-teacher-eye,
  .student-teacher-card.speaking .ai-teacher-mouth {
    animation: none;
  }

  .student-presenter .ai-teacher-mouth {
    transition: none;
  }
}

.phonics-mini-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #bfd9d5;
  border-radius: 8px;
  background: #fbfefd;
  padding: 14px;
}

.phonics-mini-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.phonics-close-btn {
  display: none;
  min-height: 36px;
  margin-left: auto;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 0 14px;
}

.student-phonics-popover.manual-active .phonics-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.phonics-mini-head span,
.phonics-mini-panel p,
.phonics-rule-list em {
  color: var(--muted);
  line-height: 1.55;
}

.phonics-mini-panel p {
  margin: 0;
}

.phonics-focus {
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #e7f5f3;
  padding: 9px 10px;
  color: var(--accent-dark) !important;
  font-weight: 800;
}

.phonics-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.phonics-rule-list span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 8px 10px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.phonics-rule-list [data-phoneme-keys] {
  cursor: pointer;
}

.phonics-rule-list span.phonics-rule-active {
  border-color: var(--slide-accent);
  background: color-mix(in srgb, var(--slide-accent) 10%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--slide-accent) 15%, transparent);
}

.phonics-rule-list b,
.phonics-rule-list em {
  display: block;
}

.phonics-rule-list em {
  margin-top: 4px;
  font-style: normal;
  font-size: 13px;
}

.phonics-rule-book {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.phonics-rule-book summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 900;
}

.phonics-rule-source {
  margin-top: 8px !important;
  border-left: 4px solid var(--warm);
  border-radius: 6px;
  background: #fff8e8;
  padding: 8px 10px;
  color: #7a4c05 !important;
  font-weight: 800;
}

.phonics-rule-book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.phonics-rule-book-grid article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.phonics-rule-book-grid span {
  width: fit-content;
  border-radius: 999px;
  background: #fff4d8;
  color: #7a4c05;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.phonics-rule-book-grid strong {
  color: var(--ink);
}

.phonics-rule-book-grid p,
.phonics-rule-book-grid em {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-style: normal;
  font-size: 13px;
}

.student-method {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
}

.student-intake-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 42, 0.56);
}

.student-intake-modal.active {
  display: grid;
}

.student-intake-card {
  width: min(820px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  display: grid;
  gap: 14px;
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 22px 70px rgba(23, 32, 42, 0.25);
}

.student-intake-card h2 {
  margin: 4px 0 6px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: 0;
}

.student-intake-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.student-intake-card textarea {
  width: 100%;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  font: inherit;
}

.student-drop-zone {
  display: grid;
  gap: 6px;
  min-height: 108px;
  align-content: center;
  border: 1px dashed #b9c4ce;
  border-radius: 8px;
  background: #f8fafb;
  padding: 14px;
  cursor: pointer;
}

.student-drop-zone span,
.student-intake-status {
  color: var(--muted);
  line-height: 1.55;
}

.student-intake-status.busy,
#studentCorrectStatus.busy,
.intake-status.busy,
.intake-item.busy em {
  border: 1px solid #f3b2ad;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff2f0 0%, #ffe0dc 50%, #fff2f0 100%);
  background-size: 220% 100%;
  color: #b42318;
  padding: 9px 10px;
  font-weight: 900;
  animation: aiBusyPulse 1.15s ease-in-out infinite, aiBusySweep 2.4s linear infinite;
  box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.16);
}

@keyframes aiBusyPulse {
  0%, 100% {
    border-color: #f3b2ad;
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.12);
  }

  50% {
    border-color: #dc3d31;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
  }
}

@keyframes aiBusySweep {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 220% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-intake-status.busy,
  #studentCorrectStatus.busy,
  .intake-status.busy,
  .intake-item.busy em {
    animation: none;
  }
}

.student-drop-zone input {
  display: none;
}

.student-drop-zone.dragging,
.student-drop-zone:focus-visible {
  border-color: var(--accent);
  background: #e7f5f3;
  outline: 0;
}

.student-dictation-summary {
  display: grid;
  gap: 12px;
}

.write-five {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.write-five input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  font-weight: 800;
}

.word-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.word-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.word-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

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

.word-workspace.word-tab-panel.active {
  display: grid;
}

.word-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  margin-bottom: 18px;
}

.library-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.library-card {
  min-height: 112px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  cursor: pointer;
}

.library-card.active {
  border-color: var(--accent);
  background: #e7f5f3;
}

.library-card span,
.library-card strong,
.library-card em {
  display: block;
}

.library-card span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.library-card strong {
  margin: 8px 0;
  font-size: 18px;
}

.library-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.4;
}

.paste-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 12px;
}

.paste-grid textarea,
.dictation-answer-row input,
.plan-controls input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.upload-placeholder {
  display: grid;
  gap: 6px;
  align-content: center;
  border: 1px dashed #b9c4ce;
  border-radius: 8px;
  background: #f8fafb;
  padding: 14px;
  cursor: pointer;
  min-height: 142px;
}

.upload-placeholder span,
.upload-placeholder em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}

.upload-placeholder.dragging,
.upload-placeholder:focus-visible {
  border-color: var(--accent);
  background: #e7f5f3;
  outline: 0;
}

.upload-placeholder input {
  display: none;
}

.intake-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.intake-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.intake-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.intake-item.busy {
  border-color: #f3b2ad;
  background: #fff7f5;
}

.intake-item.ready {
  border-color: #b8ddd8;
  background: #f0faf8;
}

.intake-item.pending {
  border-color: #d8c7a2;
  background: #fffaf0;
}

.intake-item strong,
.intake-item span,
.intake-item em {
  display: block;
}

.intake-item span,
.intake-item em {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.intake-item em {
  font-style: normal;
}

.inline-actions {
  margin-top: 12px;
}

.plan-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 160px));
  gap: 12px;
  align-items: end;
}

.plan-controls label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-controls button,
.learning-head button,
.dictation-answer-row button,
.word-status-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.word-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.study-word-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.study-word {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.study-word.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.word-main {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.word-main strong,
.word-main span,
.word-main em {
  display: block;
}

.word-main strong {
  font-size: 20px;
}

.word-main span {
  color: var(--muted);
  line-height: 1.45;
  margin: 4px 0;
}

.word-main em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
}

.word-status-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--line);
  background: #f8fafb;
  padding: 8px;
}

.word-status-actions button {
  min-height: 32px;
  padding: 0 6px;
  font-size: 12px;
}

.learning-card {
  display: grid;
  gap: 14px;
}

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

.learning-head h4 {
  margin: 4px 0;
  font-size: 44px;
  line-height: 1.05;
}

.learning-head span,
.learning-head p {
  margin: 0;
  color: var(--muted);
}

.learning-card dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.learning-card dt {
  color: var(--accent-dark);
  font-weight: 700;
}

.learning-card dd {
  margin: 0;
  line-height: 1.7;
}

.other-methods {
  display: grid;
  gap: 8px;
}

.other-methods span,
.empty-state {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 10px 12px;
  color: var(--muted);
  line-height: 1.5;
}

.today-task-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.demo-guide {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.demo-guide.active {
  border-color: #d8c7a2;
  background: #fff8e8;
}

.demo-guide span {
  color: var(--muted);
  line-height: 1.5;
}

.today-task-group {
  display: grid;
  gap: 8px;
}

.today-task-group h4 {
  margin: 0;
  color: var(--accent-dark);
}

.today-task-words {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.today-task-words button,
.notebook-word {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.today-task-words strong,
.today-task-words span,
.notebook-word strong,
.notebook-word span,
.notebook-word em {
  display: block;
}

.today-task-words span,
.notebook-word span,
.notebook-word em {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.notebook-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.notebook-word em {
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 700;
}

.dictation-box {
  display: grid;
  gap: 12px;
}

.dictation-prompt {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 14px;
}

.dictation-prompt span,
.dictation-prompt em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.dictation-prompt strong {
  display: block;
  margin: 8px 0;
  font-size: 20px;
  line-height: 1.5;
}

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

.dictation-result {
  min-height: 44px;
}

.dictation-result strong,
.dictation-result span {
  display: block;
}

.dictation-result .ok {
  color: var(--accent-dark);
}

.dictation-result .bad {
  color: var(--danger);
}

.dictation-summary {
  display: grid;
  gap: 12px;
}

.dictation-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dictation-history span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 8px 10px;
}

.dictation-history .ok {
  color: var(--accent-dark);
}

.dictation-history .bad {
  color: var(--danger);
}

@media (max-width: 900px) {
  .student-teacher-card {
    --student-presenter-size: clamp(118px, 20vw, 150px);
    --student-presenter-offset: 12px;
    --student-presenter-action-space: 76px;
    --student-presenter-gap: 12px;
  }

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

  .app.mode-words .sidebar {
    order: 2;
  }

  .app.mode-words #wordsStage {
    order: 1;
  }

  .sidebar {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .phonetics-overview-body {
    grid-template-columns: 1fr;
  }

  .phonetics-overview-header {
    padding: 0;
  }

  .phonetics-overview-header-actions {
    position: static;
    justify-self: center;
  }

  .phonetics-overview-group {
    overflow-x: auto;
  }

  .phonetics-chart-heading,
  .phonetics-course-stack {
    grid-template-columns: 1fr;
  }

  .phonetics-chart-main-title {
    grid-column: auto;
  }

  .phonetics-course-resource {
    grid-template-columns: 1fr;
  }

  .phonetics-course-links {
    justify-content: flex-start;
  }

  .avatar {
    justify-self: start;
  }

  .teacher-panel {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .avatar {
    width: 58px;
    min-height: 70px;
  }

  .photo-teacher {
    width: 40px;
    height: 52px;
  }

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

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

  .word-dashboard,
  .student-login-card,
  .student-homework-panel,
  .home-feature-grid,
  .account-metric-grid,
  .membership-grid,
  .study-loop-controls,
  .library-cards,
  .word-workspace,
  .paste-grid,
  .today-task-words,
  .notebook-list,
  .dictation-history,
  .student-correction-row,
  .student-teacher-card {
    grid-template-columns: 1fr;
  }

  .student-hero,
  .account-profile-card,
  .student-bottom-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .student-settings-drawer {
    justify-self: stretch;
    max-width: none;
  }

  .advanced-words-workspace summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
  }

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

  .student-panel {
    min-height: 620px;
  }

  .student-word {
    min-width: 104px;
  }

  .student-word.medium {
    min-width: 138px;
  }

  .student-word.long {
    min-width: min(260px, 100%);
  }

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

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

  .student-phonics-popover.manual-active {
    inset: 64px 14px 82px;
  }

  .student-phonics-popover.manual-active .phonics-rule-list,
  .student-phonics-popover.manual-active .phonics-rule-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-home-page.active,
  .word-memory-menu.active,
  .words-stage.page-intake .student-intake-modal.active,
  .words-stage.page-learning .student-flow.active,
  .words-stage.page-learning .student-panel.active {
    min-height: calc(100vh - 36px);
  }

  .home-feature-grid {
    width: min(520px, 100%);
  }

  .home-feature-card {
    min-height: 170px;
  }

  .memory-option-card {
    grid-template-columns: 132px minmax(0, 1fr) 48px;
    min-height: 180px;
  }

  .memory-option-art {
    width: 118px;
  }
}

@media (max-width: 520px) {
  .stage,
  .sidebar {
    padding: 18px 14px;
  }

  .production-links {
    grid-template-columns: 1fr;
  }

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

  .phonetics-chart-table {
    min-width: 560px;
  }

  .phonetics-overview-header h2 {
    font-size: 34px;
  }

  .phonetics-overview-phoneme {
    min-height: 64px;
  }

  .phonetics-course-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .word-list {
    grid-template-columns: 1fr;
  }

  .word-dashboard,
  .student-homework-panel,
  .home-feature-grid,
  .memory-option-card,
  .account-metric-grid,
  .membership-grid,
  .personal-word-list,
  .study-loop-controls,
  .scan-login-grid,
  .code-row,
  .invite-row,
  .word-status-actions,
  .dictation-answer-row,
  .student-answer-row,
  .learning-card dl,
  .plan-controls,
  .word-tabs,
  .student-steps,
  .student-manual-add,
  .write-five,
  .student-phonics-strip,
  .phonics-rule-list,
  .phonics-rule-book-grid {
    grid-template-columns: 1fr;
  }

  .student-flow {
    min-height: auto;
  }

  .student-panel {
    padding: 14px;
  }

  .student-hero h2 {
    font-size: 26px;
  }

  .words-stage {
    padding: 18px 14px;
  }

  .student-home-page.active {
    gap: 16px;
  }

  .wizard-step-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-step-bar div {
    justify-content: stretch;
  }

  .wizard-step-bar button {
    flex: 1 1 130px;
  }

  .home-top-actions,
  .memory-menu-top,
  .home-bottom-bar {
    align-items: stretch;
  }

  .home-top-actions {
    justify-content: stretch;
  }

  .home-account-btn,
  .memory-back-btn,
  .home-bottom-bar button {
    min-height: 46px;
    padding: 0 14px;
  }

  .student-home-hero h2,
  .memory-menu-title h2 {
    font-size: 44px;
  }

  .student-home-hero p:last-child,
  .memory-menu-title p {
    font-size: 16px;
  }

  .home-feature-card {
    min-height: 132px;
    grid-template-columns: 70px minmax(0, 1fr) 38px;
    justify-items: start;
    align-content: center;
    gap: 12px;
    text-align: left;
  }

  .home-card-icon {
    grid-row: span 2;
    width: 62px;
    height: 62px;
    box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.28), 0 10px 20px rgba(27, 153, 177, 0.18);
  }

  .home-card-icon::before {
    font-size: 24px;
  }

  .home-feature-card strong {
    align-self: end;
    font-size: 22px;
  }

  .home-feature-card em {
    align-self: start;
    font-size: 14px;
  }

  .home-feature-card i {
    grid-row: span 2;
    align-self: center;
  }

  .memory-option-list {
    gap: 14px;
  }

  .memory-option-card {
    min-height: 178px;
    padding: 18px;
    text-align: center;
  }

  .memory-option-art {
    width: 120px;
  }

  .memory-option-copy strong {
    font-size: 26px;
  }

  .memory-option-copy em {
    font-size: 15px;
  }

  .words-stage.page-intake .student-intake-card {
    padding: 18px;
  }

  .words-stage.page-intake .student-intake-card h2 {
    font-size: 34px;
  }

  .words-stage.page-intake .student-intake-card p,
  .words-stage.page-intake .student-intake-card textarea {
    font-size: 16px;
  }

  .words-stage.page-intake .student-intake-card textarea {
    min-height: 220px;
  }

  .student-teacher-main h3 {
    font-size: 54px;
  }

  .student-intake-card {
    padding: 16px;
  }

  .learning-head {
    flex-direction: column;
  }

  .learning-head h4 {
    font-size: 34px;
  }

  .teacher-panel {
    grid-template-columns: 1fr;
  }

  .avatar {
    justify-self: start;
  }

  .student-phonics-popover.manual-active {
    inset: 58px 10px 74px;
  }

  .student-phonics-popover.manual-active .phonics-rule-list,
  .student-phonics-popover.manual-active .phonics-rule-book-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .student-flow.teaching-fullscreen .student-slide-layout {
    grid-template-columns: minmax(280px, 0.9fr) minmax(330px, 1.1fr);
    grid-template-areas:
      "word word"
      "meaning related"
      "methods methods"
      "example example";
  }

  .student-flow.teaching-fullscreen .student-teacher-main h3 {
    max-width: 100%;
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  .student-teacher-card {
    --student-presenter-size: clamp(76px, 22vw, 92px);
    --student-presenter-offset: 10px;
    --student-presenter-action-space: 12px;
    --student-presenter-gap: 8px;
    --student-presenter-safe-width: calc(var(--student-presenter-size) + var(--student-presenter-gap));
  }

  .student-flow.teaching-fullscreen #studentTeachPanel.active {
    min-height: 0;
    height: 100dvh;
    box-sizing: border-box;
    align-content: stretch;
    padding: 8px;
  }

  .student-flow.teaching-fullscreen .student-teacher-card,
  .student-flow.teaching-fullscreen .student-teacher-main {
    min-height: 0;
    height: 100%;
  }

  .student-flow.teaching-fullscreen .student-teacher-main {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  .student-flow.teaching-fullscreen .student-slide-top {
    min-height: 40px;
    gap: 6px;
  }

  .student-flow.teaching-fullscreen .student-level-tags {
    display: none;
  }

  .student-flow.teaching-fullscreen .student-teach-nav {
    gap: 6px;
  }

  .student-flow.teaching-fullscreen .student-exit-btn {
    min-height: 40px;
    padding: 0 9px;
    font-size: 14px;
  }

  .student-flow.teaching-fullscreen .student-slide-layout {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, max-content);
    grid-auto-rows: max-content;
    grid-template-areas:
      "word"
      "meaning"
      "related"
      "methods"
      "example";
    min-height: 0;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0;
    padding-bottom: 12px;
  }

  .student-flow.teaching-fullscreen .word-part {
    min-height: max-content;
    column-gap: 8px;
  }

  .student-flow.teaching-fullscreen .word-replay-btn {
    min-height: 36px;
    padding: 0 10px;
    font-size: 14px;
  }

  .student-flow.teaching-fullscreen .related-part {
    margin-right: 0;
  }

  .student-flow.teaching-fullscreen .student-memory-route {
    grid-template-columns: 1fr;
  }

  .student-flow.teaching-fullscreen .student-memory-route .memory-route-card,
  .student-flow.teaching-fullscreen .student-teacher-card.density-ultra .memory-route-card {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }

  .student-flow.teaching-fullscreen .student-memory-route .memory-route-card:nth-child(3),
  .student-flow.teaching-fullscreen .example-part {
    margin-right: 0;
  }

  .student-flow.teaching-fullscreen .student-teacher-actions {
    position: relative;
    bottom: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px var(--student-presenter-safe-width) max(8px, env(safe-area-inset-bottom)) 0;
  }

  .student-flow.teaching-fullscreen .student-teacher-actions button {
    grid-column: auto;
    min-height: 44px;
    padding: 0 8px;
    font-size: 14px;
    line-height: 1.15;
  }

  .student-flow.teaching-fullscreen #studentSpeakAgainBtn,
  .student-flow.teaching-fullscreen #studentGoMatchingBtn {
    grid-column: 1 / -1;
  }

  .student-flow.teaching-fullscreen .student-speech-status {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .student-flow.teaching-fullscreen .student-presenter {
    right: 0;
    bottom: 12px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .student-teacher-card {
    --student-presenter-size: clamp(92px, 21vh, 122px);
    --student-presenter-offset: 10px;
    --student-presenter-action-space: 26px;
    --student-presenter-gap: 10px;
  }

  .student-flow.teaching-fullscreen #studentTeachPanel.active {
    min-height: 0;
    height: 100dvh;
    box-sizing: border-box;
    align-content: stretch;
    padding: 8px;
  }

  .student-flow.teaching-fullscreen .student-teacher-card,
  .student-flow.teaching-fullscreen .student-teacher-main {
    min-height: 0;
    height: 100%;
  }

  .student-flow.teaching-fullscreen .student-teacher-main {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .student-flow.teaching-fullscreen .student-slide-layout {
    grid-template-columns: minmax(250px, 0.88fr) minmax(0, 1.12fr);
    grid-template-rows: repeat(4, max-content);
    grid-auto-rows: max-content;
    grid-template-areas:
      "word word"
      "meaning related"
      "methods methods"
      "example example";
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .student-flow.teaching-fullscreen .word-part {
    min-height: max-content;
  }

  .student-flow.teaching-fullscreen .student-teacher-main {
    gap: 7px;
  }

  .student-flow.teaching-fullscreen .student-speech-part {
    padding: 6px 8px;
  }

  .student-flow.teaching-fullscreen .student-teacher-main h3 {
    max-width: 100%;
  }

  .student-flow.teaching-fullscreen .student-meaning {
    font-size: clamp(18px, 3vw, 28px);
  }

  .student-flow.teaching-fullscreen .student-teacher-actions {
    gap: 6px;
    padding-top: 6px;
  }

  .student-flow.teaching-fullscreen .student-teacher-actions button {
    min-height: 36px;
    padding: 0 9px;
  }

  .student-flow.teaching-fullscreen .student-related-chips span {
    padding: 5px 7px;
  }
}

/* Mobile teacher lesson: one document-scrolling page with six visible sections. */
.student-teacher-card .part-label b {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  place-items: center;
  border-radius: 50%;
  background: var(--slide-accent);
  color: #fff;
  font-size: 13px;
}

.student-teacher-card .memory-route-card.is-placeholder p {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 720px), (max-height: 520px) and (orientation: landscape) {
  body.student-teaching-active {
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .stage.words-stage.page-learning {
    overflow-y: visible;
    touch-action: pan-y;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen #studentTeachPanel.active {
    height: auto;
    min-height: 100dvh;
    align-content: start;
    overflow: visible;
    padding: 8px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-card,
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-main {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-main {
    grid-template-rows: auto auto auto auto;
    align-content: start;
    gap: 8px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-slide-layout {
    grid-row: 3;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(5, max-content);
    grid-auto-rows: max-content;
    grid-template-areas:
      "word"
      "meaning"
      "related"
      "methods"
      "example";
    height: auto;
    min-height: 0;
    overflow: visible;
    overscroll-behavior: auto;
    padding: 0;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-memory-route {
    grid-template-columns: minmax(0, 1fr);
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-memory-route .memory-route-card,
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-card.density-ultra .memory-route-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-memory-route .memory-route-card:nth-child(3),
  .words-stage.page-learning .student-flow.teaching-fullscreen .example-part {
    margin-right: 0;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-actions {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0 -2px;
    border: 1px solid #b9ddd4;
    border-radius: 12px;
    padding: 8px;
    background: rgba(248, 252, 250, 0.97);
    box-shadow: 0 8px 22px rgba(26, 91, 77, 0.14);
    backdrop-filter: blur(10px);
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen #studentSpeakAgainBtn,
  .words-stage.page-learning .student-flow.teaching-fullscreen #studentGoMatchingBtn,
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-speech-status {
    grid-column: 1 / -1;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-presenter {
    position: static;
    grid-row: 4;
    width: clamp(82px, 24vw, 104px);
    height: clamp(82px, 24vw, 104px);
    margin: 0 0 8px;
    justify-self: end;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen [data-speech-part] {
    scroll-margin-top: 190px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-slide-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, max-content);
    grid-template-areas:
      "word word"
      "meaning related"
      "methods methods"
      "example example";
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-memory-route {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen #studentSpeakAgainBtn,
  .words-stage.page-learning .student-flow.teaching-fullscreen #studentGoMatchingBtn,
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-speech-status {
    grid-column: 1 / -1;
  }
}

/* Word adventure refresh: scoped to the student word-memory journey. */
.words-stage {
  --adventure-cream: #fbfaf5;
  --adventure-surface: #ffffff;
  --adventure-ink: #10243e;
  --adventure-muted: #607087;
  --adventure-teal: #138a72;
  --adventure-teal-dark: #0b6a59;
  --adventure-teal-soft: #eaf7f2;
  --adventure-sky: #eaf3ff;
  --adventure-violet: #f1edff;
  --adventure-lime: #dff4ba;
  --adventure-line: #dce6e2;
  background: var(--adventure-cream);
  color: var(--adventure-ink);
}

.words-stage button,
.words-stage input,
.words-stage textarea,
.words-stage select {
  font-family: inherit;
}

.words-stage button:focus-visible,
.words-stage input:focus-visible,
.words-stage textarea:focus-visible,
.words-stage select:focus-visible,
.words-stage [tabindex="0"]:focus-visible {
  outline: 3px solid rgba(19, 138, 114, 0.28);
  outline-offset: 3px;
}

.words-stage .primary-btn,
.words-stage .student-plan-actions .primary-btn,
.words-stage .student-matching-cta {
  border-color: var(--adventure-teal);
  background: var(--adventure-teal);
  color: #fff;
}

.words-stage .primary-btn:hover:not(:disabled),
.words-stage .student-plan-actions .primary-btn:hover:not(:disabled),
.words-stage .student-matching-cta:hover:not(:disabled) {
  border-color: var(--adventure-teal-dark);
  background: var(--adventure-teal-dark);
}

.word-memory-menu {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid var(--adventure-line);
  border-radius: 26px;
  background: var(--adventure-surface);
  box-shadow: 0 22px 54px rgba(48, 71, 88, 0.1);
}

.memory-menu-title {
  max-width: 760px;
}

.memory-menu-title h2,
.word-adventure-intro h2 {
  margin: 4px 0 10px;
  color: var(--adventure-ink);
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.memory-menu-title > p:last-child,
.word-adventure-intro p:last-child {
  color: var(--adventure-muted);
  font-size: 18px;
  line-height: 1.65;
}

.word-adventure-path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 2px;
  padding: 14px;
  border: 1px solid var(--adventure-line);
  border-radius: 20px;
  background: #f8fbfa;
}

.word-adventure-path.compact {
  margin: 24px 0;
}

.word-adventure-path span {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #7b8797;
}

.word-adventure-path strong {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid #cbd5df;
  border-radius: 50%;
  background: #fff;
  font-size: 14px;
}

.word-adventure-path em {
  overflow: hidden;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.word-adventure-path .active {
  color: var(--adventure-teal-dark);
}

.word-adventure-path .active strong {
  border-color: var(--adventure-teal);
  background: var(--adventure-teal);
  color: #fff;
}

.memory-option-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.memory-option-card {
  min-height: 180px;
  border: 1px solid var(--adventure-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(48, 71, 88, 0.08);
}

.memory-option-card.primary {
  border-color: #b8d4f5;
  background: #f7fbff;
}

.memory-option-copy strong {
  color: var(--adventure-ink);
}

.words-stage.page-library #studentAccountPanel {
  width: min(1488px, 100%);
  margin: 0 auto;
}

.words-stage.page-library .student-study-loop-panel {
  display: block;
  overflow: hidden;
  border-color: #e6e2d8;
  border-radius: 24px;
  background: #fffdf8;
  box-shadow: 0 22px 58px rgba(48, 71, 88, 0.1);
  padding: 0;
}

.word-adventure-dashboard {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 2.7vw, 40px);
  background:
    radial-gradient(circle at 92% 9%, rgba(35, 181, 150, 0.08), transparent 19%),
    radial-gradient(circle at 8% 82%, rgba(43, 132, 217, 0.06), transparent 18%),
    #fffdf8;
}

.word-adventure-dashboard-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.word-adventure-brand {
  display: flex;
  align-items: center;
  color: var(--adventure-ink);
}

.word-adventure-brand strong,
.word-adventure-brand em {
  display: block;
}

.word-adventure-brand strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.word-adventure-brand em {
  margin-top: 2px;
  color: #61718a;
  font-size: 12px;
  font-style: normal;
}

.word-adventure-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.word-adventure-text-action,
.word-adventure-help-btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #53657d;
  cursor: pointer;
  font-weight: 850;
  padding: 0 12px;
}

.word-adventure-text-action:hover {
  background: #f1f6f4;
  color: var(--adventure-teal-dark);
}

.word-adventure-help-btn {
  border-color: #dcdedb;
  background: #fff;
  color: var(--adventure-ink);
  box-shadow: 0 5px 14px rgba(48, 71, 88, 0.06);
}

.word-adventure-help {
  position: absolute;
  z-index: 5;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 56px));
  border: 1px solid #dce6e2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(48, 71, 88, 0.16);
  padding: 15px 17px;
}

.word-adventure-help strong,
.word-adventure-help p {
  display: block;
  margin: 0;
}

.word-adventure-help p {
  margin-top: 6px;
  color: var(--adventure-muted);
  line-height: 1.55;
}

.word-adventure-intro {
  display: block;
  min-height: 0;
  max-width: 930px;
  border-radius: 0;
  background: transparent;
  padding: 16px 8px 0;
}

.word-adventure-intro h2 {
  margin: 2px 0 8px;
  font-size: clamp(42px, 4.6vw, 68px);
  line-height: 1.04;
}

.word-adventure-intro .wizard-step-label {
  color: var(--adventure-teal-dark);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.word-adventure-intro p:last-child {
  margin: 0;
  font-size: 16px;
}

.word-adventure-path {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 8px 6px;
}

.word-adventure-path span {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  overflow: visible;
}

.word-adventure-path span::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 35px;
  left: 71px;
  width: calc(100% - 54px);
  border-top: 2px dashed #d6dce2;
}

.word-adventure-path span:last-child::after {
  display: none;
}

.word-adventure-path strong {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border: 3px solid #d8dce0;
  background: #f8f7f5;
  color: #9299a7;
  font-size: 22px;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.72);
}

.word-adventure-path em {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  overflow: visible;
  padding-right: 6px;
  white-space: normal;
}

.word-adventure-path em b,
.word-adventure-path em small {
  display: block;
}

.word-adventure-path em b {
  color: #536078;
  font-size: 14px;
  line-height: 1.2;
}

.word-adventure-path em small {
  color: #78869a;
  font-size: 11px;
  line-height: 1.35;
}

.word-adventure-path .active strong {
  border-color: #6bbca9;
  background: #eefaf6;
  color: var(--adventure-teal-dark);
}

.word-adventure-path .active em b {
  color: var(--adventure-teal-dark);
}

.word-adventure-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
  gap: 22px;
  align-items: stretch;
}

.word-adventure-workspace {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.student-plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 14px;
  align-items: stretch;
}

.student-plan-builder,
.student-plan-upload-card,
.student-plan-teacher-card,
.student-library-recommendations {
  border: 1px solid var(--adventure-line);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
}

.student-plan-builder {
  display: grid;
  gap: 15px;
  border-color: #7ac7b4;
  box-shadow: 0 10px 28px rgba(19, 138, 114, 0.07);
}

.student-plan-upload-card {
  display: grid;
  gap: 14px;
  border-color: #bdd7f4;
  background: #fbfdff;
  box-shadow: 0 10px 28px rgba(38, 123, 207, 0.06);
}

.student-plan-card-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.student-plan-card-heading h3,
.student-plan-card-heading p {
  margin: 0;
}

.student-plan-card-heading h3 {
  color: var(--adventure-ink);
  font-size: 20px;
  line-height: 1.25;
}

.student-plan-card-heading h3 small {
  display: inline-block;
  margin-left: 6px;
  border: 1px solid #9fd8ca;
  border-radius: 999px;
  background: #effaf6;
  color: var(--adventure-teal-dark);
  padding: 3px 7px;
  font-size: 10px;
  vertical-align: 2px;
}

.student-plan-card-heading p {
  margin-top: 4px;
  color: var(--adventure-muted);
  font-size: 12px;
  line-height: 1.45;
}

.words-stage .study-loop-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.student-plan-control-row {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.student-plan-control-row > span {
  color: #394b62;
  font-size: 13px;
  font-weight: 900;
}

.student-plan-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d9e1e5;
  border-radius: 9px;
  background: #fff;
}

.student-plan-size-segments {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.student-plan-custom-size {
  grid-column: 2;
  display: grid;
  grid-template-columns: auto minmax(90px, 150px) auto;
  gap: 8px;
  align-items: center;
  color: #51667d;
  font-size: 12px;
  font-weight: 800;
}

.student-plan-custom-size[hidden] {
  display: none;
}

.student-plan-custom-size input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #a8cfc5;
  border-radius: 9px;
  background: #fff;
  color: #20364f;
  font: inherit;
  padding: 7px 10px;
}

.student-plan-custom-size input:focus {
  border-color: var(--adventure-teal);
  box-shadow: 0 0 0 3px rgba(21, 151, 124, 0.12);
  outline: 0;
}

.student-plan-custom-size input[aria-invalid="true"] {
  border-color: #d95555;
  box-shadow: 0 0 0 3px rgba(217, 85, 85, 0.1);
}

.student-plan-custom-size em {
  font-style: normal;
  white-space: nowrap;
}

.student-plan-segments button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-left: 1px solid #e2e7ea;
  border-radius: 0;
  background: #fff;
  color: #41536b;
  cursor: pointer;
  font-weight: 900;
  padding: 0 6px;
}

.student-plan-segments button:first-child {
  border-left: 0;
}

.student-plan-segments button:hover,
.student-plan-segments button.active {
  background: var(--adventure-teal);
  color: #fff;
}

.student-plan-native-control {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.words-stage .study-loop-controls .study-loop-library-field select {
  width: 100%;
  min-height: 40px;
  border-color: var(--adventure-line);
  border-radius: 9px;
  background: #fff;
  color: #2b3f58;
  font-size: 13px;
  font-weight: 750;
  padding: 7px 10px;
}

.student-plan-status {
  margin: 0;
  border: 1px solid #d5e9e3;
  border-radius: 10px;
  background: #eff8f5;
  color: #466a61;
  padding: 9px 11px;
  font-size: 11px;
  line-height: 1.45;
}

.student-plan-file-types {
  min-height: 96px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #c9dcee;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.student-plan-file-types span {
  border: 1px solid #dce9f5;
  border-radius: 8px;
  background: #f7fbff;
  color: #4284c3;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 850;
  transform: rotate(-3deg);
}

.student-plan-file-types span:nth-child(even) {
  transform: rotate(3deg);
}

.student-plan-upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.student-plan-upload-actions button {
  min-height: 43px;
  border: 1px solid #318bdd;
  border-radius: 9px;
  background: #fff;
  color: #1873c7;
  cursor: pointer;
  font-weight: 900;
}

.student-plan-upload-actions .student-plan-upload-primary {
  background: #247fd3;
  color: #fff;
}

.student-plan-upload-note {
  margin: 0;
  color: #6b7c92;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.words-stage .student-plan-summary {
  display: grid;
  gap: 8px;
  border: 0;
  border-top: 1px solid #dbe5df;
  border-bottom: 1px solid #dbe5df;
  border-radius: 0;
  background: transparent;
  padding: 15px 0;
}

.words-stage .student-plan-summary strong {
  color: var(--adventure-ink);
  font-size: 15px;
  line-height: 1.5;
}

.words-stage .student-plan-summary span {
  color: var(--adventure-muted);
  font-size: 12px;
  line-height: 1.55;
}

.student-plan-teacher-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  border-color: #b8d9c5;
  background: linear-gradient(180deg, #f4fbf6 0%, #fffef9 58%, #f5fbf7 100%);
  padding: 0 14px 16px;
}

.student-plan-teacher-card > img {
  width: calc(100% + 28px);
  height: 214px;
  margin: 0 -14px;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 17px 17px 0 0;
  -webkit-mask-image: linear-gradient(#000 82%, transparent 100%);
  mask-image: linear-gradient(#000 82%, transparent 100%);
}

.student-plan-teacher-message {
  display: grid;
  gap: 5px;
  margin-top: -14px;
  border: 1px solid #dce7dd;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(48, 71, 88, 0.07);
  padding: 13px;
}

.student-plan-teacher-message > span {
  height: 17px;
  color: #63bba5;
  font: 900 31px/1 Georgia, serif;
}

.student-plan-teacher-message strong {
  color: var(--adventure-ink);
  font-size: 15px;
  line-height: 1.4;
}

.student-plan-teacher-message p {
  margin: 0;
  color: var(--adventure-muted);
  font-size: 12px;
  line-height: 1.5;
}

.student-plan-teacher-card > .primary-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 10px;
  font-size: 17px;
}

.student-library-recommendations {
  min-width: 0;
  display: grid;
  gap: 11px;
  padding: 14px;
}

.student-library-recommendations-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.student-library-recommendations-head h3 {
  margin: 0;
  color: #30465d;
  font-size: 15px;
}

.student-library-recommendations-head span {
  color: #297fc9;
  font-size: 11px;
  font-weight: 800;
}

.words-stage .student-library-group-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(155px, 0.78fr);
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 7px;
  scroll-snap-type: inline proximity;
  scrollbar-width: thin;
}

.words-stage .library-group-card {
  min-height: 78px;
  border-radius: 11px;
  padding: 10px;
  scroll-snap-align: start;
}

.words-stage .library-group-card strong {
  font-size: 15px;
}

.words-stage .library-group-card span,
.words-stage .library-group-card em {
  font-size: 10px;
}

.words-stage .library-group-card.active {
  border-color: var(--adventure-teal);
  background: var(--adventure-teal-soft);
  box-shadow: 0 8px 20px rgba(19, 138, 114, 0.12);
}

.word-adventure-goals {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.25fr);
  gap: 18px;
  align-items: center;
  border: 1px solid #dbe8e3;
  border-radius: 15px;
  background: linear-gradient(90deg, #eff8f5, #fbfdfc);
  padding: 13px 18px;
}

.word-adventure-goals > div {
  display: grid;
  gap: 3px;
}

.word-adventure-goals strong {
  color: #1c6759;
  font-size: 15px;
}

.word-adventure-goals > div span {
  color: #698077;
  font-size: 11px;
}

.word-adventure-goals ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.word-adventure-goals li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border: 1px solid #dce9e4;
  border-radius: 10px;
  background: #fff;
  color: #546b64;
  padding: 9px 11px;
  font-size: 11px;
}

.word-adventure-goals li span {
  color: #d68b00;
  font-size: 15px;
  font-weight: 950;
}

.words-stage.page-intake .student-intake-modal.active {
  min-height: 0;
  padding: 18px 0;
}

.words-stage.page-intake .student-intake-card {
  width: min(1240px, 100%);
  gap: 20px;
  border: 1px solid var(--adventure-line);
  border-radius: 26px;
  background: var(--adventure-surface);
  box-shadow: 0 20px 50px rgba(48, 71, 88, 0.1);
  padding: clamp(20px, 3vw, 36px);
}

.words-stage.page-intake .student-intake-card h2 {
  margin: 4px 0 8px;
  color: var(--adventure-ink);
  font-size: clamp(34px, 4.2vw, 54px);
  letter-spacing: -0.035em;
}

.words-stage.page-intake .student-intake-card > div > p:last-child {
  margin: 0;
  color: var(--adventure-muted);
  font-size: 17px;
}

.student-intake-method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(210px, 0.72fr) minmax(250px, 0.93fr);
  gap: 14px;
  align-items: stretch;
}

.student-intake-method {
  min-width: 0;
  min-height: 250px;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--adventure-line);
  border-radius: 20px;
  background: #fff;
  padding: 18px;
}

.student-intake-method.paste-method {
  border-color: #b9ddd4;
  background: #fbfefd;
}

.student-intake-method.direct-method {
  background: var(--adventure-violet);
}

.words-stage.page-intake .student-drop-zone.student-intake-method {
  min-height: 250px;
  border: 1px solid #bfd6f2;
  background: #f8fbff;
  text-align: left;
}

.intake-method-number {
  width: fit-content;
  border-radius: 999px;
  background: var(--adventure-ink);
  color: #fff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.student-intake-method h3,
.student-intake-method p {
  margin: 0;
}

.student-intake-method h3 {
  color: var(--adventure-ink);
  font-size: 23px;
}

.student-intake-method p {
  color: var(--adventure-muted);
  line-height: 1.55;
}

.words-stage.page-intake .student-intake-method textarea {
  width: 100%;
  min-height: 144px;
  resize: vertical;
  border: 1px solid #b9d8d0;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  font-size: 16px;
  line-height: 1.55;
}

.student-intake-method > button {
  min-height: 50px;
  align-self: end;
  border: 1px solid var(--adventure-line);
  border-radius: 12px;
  background: #fff;
  color: var(--adventure-ink);
  cursor: pointer;
  font-weight: 900;
  padding: 8px 14px;
}

.student-intake-method input[type="file"] {
  display: none;
}

.student-intake-method .primary-btn {
  border-color: var(--adventure-teal);
  background: var(--adventure-teal);
  color: #fff;
}

.words-stage.page-intake .student-intake-status {
  min-height: 48px;
  margin: 0;
  border: 1px solid var(--adventure-line);
  border-radius: 14px;
  background: #f8fbfa;
  padding: 12px 14px;
}

.words-stage.page-learning .student-flow.active {
  width: min(1320px, 100%);
  min-height: 0;
  margin: 0 auto;
  gap: 14px;
  border-radius: 24px;
  background: var(--adventure-surface);
  padding: clamp(12px, 2vw, 24px);
  box-shadow: 0 18px 46px rgba(48, 71, 88, 0.09);
}

.words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-hero {
  display: flex;
  min-height: 0;
  border: 0;
  border-radius: 18px;
  background: var(--adventure-teal-soft);
  padding: 16px 20px;
}

.words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-hero h2 {
  margin: 2px 0 0;
  color: var(--adventure-ink);
  font-size: clamp(24px, 3vw, 38px);
}

.words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.words-stage .student-steps span {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--adventure-line);
  border-radius: 13px;
  background: #f8faf9;
  color: #7b8797;
  padding: 8px;
  text-align: center;
}

.words-stage .student-steps span.active {
  border-color: var(--adventure-teal);
  background: var(--adventure-teal);
  color: #fff;
}

.words-stage.page-learning .student-panel.active {
  min-height: 0;
  border: 1px solid var(--adventure-line);
  border-radius: 20px;
  background: #fff;
  padding: clamp(16px, 2vw, 24px);
}

.words-stage .student-correction-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: min(56vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.words-stage .student-correction-row {
  min-width: 0;
  border-radius: 14px;
  background: #fbfcfb;
}

.words-stage .student-word-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
  min-height: 0;
  max-height: min(58vh, 660px);
  overflow: auto;
  padding: 4px;
}

.words-stage .student-word {
  min-height: 80px;
  border-radius: 15px;
}

.words-stage .student-bottom-bar {
  position: sticky;
  bottom: 8px;
  z-index: 5;
  border: 1px solid var(--adventure-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(48, 71, 88, 0.1);
}

.words-stage .legacy-spelling-entry {
  display: none;
}

.words-stage .student-teacher-card,
.words-stage .student-teacher-card.theme-amber,
.words-stage .student-teacher-card.theme-rose,
.words-stage .student-teacher-card.theme-teal {
  --slide-accent: #168f78;
  --slide-accent-dark: #0f6f5e;
  --slide-soft: #e7f6f1;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  border: 1px solid #b9ddd4;
  border-radius: 22px;
  background: #f8fcfa;
  color: var(--adventure-ink);
  box-shadow: 0 18px 42px rgba(26, 91, 77, 0.1);
}

.words-stage .student-teacher-card::before {
  display: none;
}

.words-stage .student-teacher-main {
  grid-template-columns: minmax(0, 1fr);
}

.words-stage .student-slide-counter,
.words-stage .student-level-tags span,
.words-stage .part-label,
.words-stage .route-number {
  border-color: #c8e3dc;
  background: var(--adventure-teal-soft);
  color: var(--adventure-teal-dark);
}

.words-stage .student-word-title,
.words-stage .student-meaning strong,
.words-stage .memory-card-head strong {
  color: var(--adventure-ink);
}

.words-stage .student-speech-part.active,
.words-stage .student-speech-part.active .karaoke-line {
  border-color: var(--adventure-teal);
  color: var(--adventure-teal-dark);
}

.words-stage .student-presenter .ai-teacher-photo-frame {
  border-color: #fff;
  box-shadow: 0 12px 30px rgba(19, 106, 89, 0.2);
}

.words-stage .student-teacher-actions {
  border-top: 1px solid #dcebe7;
}

.words-stage .student-teacher-actions button {
  border-radius: 11px;
}

.words-stage .student-matching-cta {
  font-weight: 900;
}

.student-matching-game {
  width: min(960px, 100%);
  margin: 0 auto;
}

.student-matching-head,
.student-matching-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.student-matching-head {
  margin-bottom: 10px;
}

.student-matching-head > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--adventure-muted);
  font-size: 13px;
}

.student-matching-head strong {
  color: var(--adventure-ink);
}

.student-matching-column {
  display: grid;
  gap: 10px;
  align-content: start;
}

.student-match-card {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--adventure-line);
  border-radius: 16px;
  background: #fff;
  color: var(--adventure-ink);
  cursor: pointer;
  padding: 12px 16px;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.student-match-card:hover:not(:disabled) {
  border-color: #9fcfc3;
  box-shadow: 0 8px 18px rgba(36, 84, 74, 0.09);
  transform: translateY(-1px);
}

.student-match-card.chinese {
  background: #f8fbff;
}

.student-match-card strong {
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.35;
}

.student-match-card span {
  color: var(--adventure-muted);
  font-size: 13px;
}

.student-match-card.selected {
  border-color: #6c5fc4;
  background: var(--adventure-violet);
  box-shadow: 0 0 0 3px rgba(108, 95, 196, 0.12);
}

.student-match-card.matched {
  border-color: var(--adventure-teal);
  background: var(--adventure-teal-soft);
  color: var(--adventure-teal-dark);
  opacity: 0.72;
}

.student-match-card.wrong {
  border-color: #dc5f6b;
  background: #fff1f2;
  animation: studentMatchShake 260ms ease-in-out;
}

.student-matching-feedback {
  min-height: 44px;
  margin: 14px 0 0;
  border-radius: 12px;
  background: #f5f8f7;
  color: var(--adventure-muted);
  padding: 11px 14px;
  text-align: center;
  font-weight: 800;
}

.student-matching-feedback.correct {
  background: var(--adventure-teal-soft);
  color: var(--adventure-teal-dark);
}

.student-matching-feedback.wrong {
  background: #fff1f2;
  color: #a93442;
}

.student-matching-result {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 1px solid #c8e3dc;
  border-radius: 22px;
  background: var(--adventure-teal-soft);
  padding: clamp(24px, 5vw, 56px);
  text-align: center;
}

.student-matching-result h4 {
  margin: 0;
  color: var(--adventure-ink);
  font-size: clamp(30px, 4vw, 48px);
}

.student-matching-result p {
  max-width: 650px;
  margin: 0;
  color: var(--adventure-muted);
  font-size: 17px;
  line-height: 1.65;
}

.student-matching-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.student-matching-actions button {
  min-height: 48px;
  border: 1px solid var(--adventure-line);
  border-radius: 12px;
  background: #fff;
  color: var(--adventure-ink);
  cursor: pointer;
  font-weight: 900;
  padding: 0 18px;
}

.student-matching-actions .primary-btn {
  border-color: var(--adventure-teal);
  background: var(--adventure-teal);
  color: #fff;
}

.words-stage .dictation-box {
  width: min(920px, 100%);
  margin: 0 auto;
}

.words-stage .dictation-prompt.student-dictation-prompt {
  min-height: 136px;
  border: 1px solid #c9e7df;
  border-radius: 18px;
  background: var(--adventure-teal-soft);
  padding: 20px;
}

.words-stage .dictation-prompt.student-dictation-prompt strong {
  font-size: clamp(24px, 3.5vw, 38px);
}

.words-stage .dictation-answer-row.student-answer-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin-top: 12px;
}

.words-stage .dictation-answer-row.student-answer-row input {
  min-height: 56px;
  border-color: #b9d8d0;
  border-radius: 14px;
  font-size: 20px;
}

.words-stage .dictation-answer-row.student-answer-row button {
  min-width: 110px;
  min-height: 56px;
  border-radius: 14px;
}

.student-dictation-summary {
  border: 1px solid #c9e7df;
  border-radius: 20px;
  background: #f8fcfa;
  padding: 20px;
}

.student-completion-vocab {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  border: 1px solid #d8d0fa;
  border-radius: 20px;
  background: var(--adventure-violet);
  padding: 20px;
}

.student-completion-vocab-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.student-completion-vocab-head h4 {
  margin: 6px 0 0;
  color: var(--adventure-ink);
  font-size: 28px;
}

.student-completion-stats,
.student-completion-words {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.student-completion-stats span,
.student-completion-words > span {
  border: 1px solid rgba(112, 93, 189, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.student-completion-stats span {
  text-align: center;
  font-weight: 900;
}

.student-completion-words > span {
  display: grid;
  gap: 4px;
}

.student-completion-words em {
  color: var(--adventure-muted);
  font-style: normal;
  font-size: 12px;
}

.student-completion-sync {
  margin: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--adventure-muted);
  padding: 10px 12px;
  text-align: center;
  font-weight: 800;
}

.student-completion-sync.synced {
  color: var(--adventure-teal-dark);
}

.words-stage .student-login-card {
  overflow: hidden;
  border-radius: 24px;
}

.words-stage .login-hero-panel {
  background: var(--adventure-teal-dark);
}

@keyframes studentMatchShake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

@media (max-width: 1280px) {
  .phonetics-overview-body {
    grid-template-columns: 1fr;
  }

  .words-stage .student-correction-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .word-adventure-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .student-plan-teacher-card {
    grid-template-columns: 190px minmax(220px, 1fr) minmax(260px, 1.2fr);
    grid-template-rows: auto auto;
    align-items: center;
    padding: 14px;
  }

  .student-plan-teacher-card > img {
    grid-row: 1 / 3;
    width: 190px;
    height: 176px;
    margin: 0;
    border-radius: 13px;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .student-plan-teacher-message {
    margin: 0;
  }

  .student-plan-teacher-card > .primary-btn {
    grid-column: 3;
  }

  .words-stage .student-library-group-cards {
    grid-template-columns: none;
  }

  .student-intake-method-grid {
    grid-template-columns: 1fr 1fr;
  }

  .student-intake-method.paste-method {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .words-stage {
    padding: 10px;
  }

  .words-stage.page-intake .student-intake-status.busy {
    position: fixed;
    top: 12px;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    z-index: 80;
    width: auto;
    max-width: 560px;
    margin: 0 auto;
    border-width: 2px;
    padding: 14px 16px;
    box-shadow: 0 12px 34px rgba(120, 24, 18, 0.28);
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
  }

  .words-stage .student-panel > .section-title {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .words-stage .student-correction-row button {
    min-height: 44px;
  }

  .word-memory-menu,
  .words-stage.page-library .student-study-loop-panel,
  .words-stage.page-intake .student-intake-card,
  .words-stage.page-learning .student-flow.active {
    border-radius: 18px;
    padding: 16px;
  }

  .words-stage.page-library .student-study-loop-panel {
    overflow: visible;
    padding: 0;
  }

  .word-adventure-dashboard {
    gap: 16px;
    padding: 16px;
  }

  .word-adventure-dashboard-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .word-adventure-brand strong {
    font-size: 17px;
  }

  .word-adventure-brand em {
    display: none;
  }

  .word-adventure-top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .word-adventure-text-action,
  .word-adventure-help-btn {
    min-height: 44px;
    padding: 0 9px;
    font-size: 12px;
  }

  .memory-menu-title h2,
  .word-adventure-intro h2,
  .words-stage.page-intake .student-intake-card h2 {
    font-size: 34px;
  }

  .memory-option-list,
  .student-plan-layout,
  .student-intake-method-grid,
  .student-matching-board,
  .student-matching-head,
  .words-stage .student-correction-list {
    grid-template-columns: 1fr;
  }

  .memory-option-card {
    min-height: 138px;
  }

  .word-adventure-intro {
    min-height: 0;
    padding: 6px 0 0;
  }

  .word-adventure-path,
  .words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-steps {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
  }

  .word-adventure-path span {
    min-width: 150px;
    grid-template-columns: 52px minmax(0, 1fr);
    justify-items: stretch;
    gap: 8px;
    text-align: left;
  }

  .word-adventure-path strong {
    width: 52px;
    height: 52px;
    font-size: 17px;
  }

  .word-adventure-path span::after {
    top: 26px;
    left: 51px;
  }

  .word-adventure-path em {
    width: 100%;
  }

  .words-stage .study-loop-controls {
    grid-template-columns: 1fr;
  }

  .words-stage .study-loop-library-field {
    grid-column: auto;
  }

  .student-plan-control-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .student-plan-custom-size {
    grid-column: 1;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .student-plan-segments button {
    min-height: 44px;
  }

  .student-plan-upload-actions {
    grid-template-columns: 1fr;
  }

  .student-plan-upload-actions button {
    min-height: 48px;
  }

  .student-plan-teacher-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 0 14px 14px;
  }

  .student-plan-teacher-card > img {
    grid-row: auto;
    width: calc(100% + 28px);
    height: 200px;
    margin: 0 -14px;
    border-radius: 17px 17px 0 0;
    -webkit-mask-image: linear-gradient(#000 82%, transparent 100%);
    mask-image: linear-gradient(#000 82%, transparent 100%);
  }

  .student-plan-teacher-card > .primary-btn {
    grid-column: auto;
  }

  .word-adventure-goals {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .word-adventure-goals ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-plan-actions,
  .student-matching-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .student-plan-actions button,
  .student-matching-actions button,
  .student-intake-method > button {
    width: 100%;
    min-height: 48px;
  }

  .student-intake-method.paste-method {
    grid-column: auto;
  }

  .student-intake-method,
  .words-stage.page-intake .student-drop-zone.student-intake-method {
    min-height: 0;
  }

  .words-stage.page-intake .student-intake-method textarea {
    min-height: 126px;
  }

  .words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-hero {
    padding: 14px;
  }

  .words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-hero h2 {
    font-size: 25px;
  }

  .words-stage .student-word-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .words-stage .student-bottom-bar {
    bottom: 4px;
    display: grid;
    gap: 10px;
  }

  .words-stage .student-bottom-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-matching-head {
    display: none;
  }

  .student-matching-board {
    gap: 10px;
  }

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

  .student-match-card {
    min-height: 72px;
    padding: 10px 12px;
  }

  .student-matching-column:first-child::before,
  .student-matching-column:last-child::before {
    grid-column: 1 / -1;
    color: var(--adventure-muted);
    font-size: 12px;
    font-weight: 900;
  }

  .student-matching-column:first-child::before {
    content: "先选英文";
  }

  .student-matching-column:last-child::before {
    content: "再选中文";
  }

  .words-stage .dictation-answer-row.student-answer-row {
    grid-template-columns: 1fr 1fr;
  }

  .words-stage .dictation-answer-row.student-answer-row input {
    grid-column: 1 / -1;
  }

  .words-stage .dictation-answer-row.student-answer-row button {
    min-width: 0;
  }

  .student-completion-stats,
  .student-completion-words {
    grid-template-columns: 1fr;
  }

  .student-completion-vocab-head {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .words-stage *,
  .words-stage *::before,
  .words-stage *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .words-stage .student-match-card:hover:not(:disabled) {
    transform: none;
  }
}

@media (max-width: 720px) {
  .app.mode-phonetics:not(.phonetics-overview-mode) {
    grid-template-columns: 1fr;
  }

  .app.mode-phonetics:not(.phonetics-overview-mode) .sidebar {
    display: none;
  }

  #phoneticsStage.phonetics-detail {
    min-height: 100vh;
    padding: 10px;
  }

  #phoneticsStage.phonetics-detail .topbar {
    min-height: 0;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 16px;
  }

  #phoneticsStage.phonetics-detail .topbar h2 {
    font-size: 48px;
  }

  #phoneticsStage.phonetics-detail .topbar .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #phoneticsStage.phonetics-detail .topbar .actions button {
    min-height: 44px;
    padding: 0 8px;
  }

  .words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-steps {
    grid-template-columns: repeat(5, minmax(96px, 1fr));
  }

  .word-adventure-path {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

  .words-stage .student-steps span {
    min-width: 96px;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .home-feature-card {
    grid-template-columns: 62px minmax(0, 1fr) 42px;
    grid-template-areas:
      "icon title arrow"
      "icon subtitle arrow";
    padding: 18px 16px;
  }

  .home-card-icon {
    grid-area: icon;
  }

  .home-feature-card strong {
    grid-area: title;
  }

  .home-feature-card em {
    grid-area: subtitle;
    max-width: none;
  }

  .home-feature-card i {
    grid-area: arrow;
  }
}

/* Mobile cross-browser hardening: keep content readable and gestures predictable. */
button,
a,
[role="button"] {
  touch-action: manipulation;
}

.phonetics-overview-phoneme {
  min-width: 44px;
  min-height: 44px;
}

.phonetics-swipe-hint {
  display: none;
  margin: 0;
}

@media (max-width: 900px), (max-height: 720px) {
  .student-login-modal {
    place-items: start center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .student-login-card {
    flex: 0 0 auto;
    max-height: none;
    margin: 0;
  }
}

@media (max-width: 900px) {
  .phonetics-swipe-hint {
    display: block;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 10px;
    background: rgba(236, 253, 250, 0.86);
    padding: 9px 12px;
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
  }

  .student-teacher-actions button,
  .student-bottom-bar button,
  .student-flow-nav button,
  .student-modal-actions button,
  .home-account-btn,
  .memory-back-btn,
  .home-bottom-bar button {
    min-height: 44px;
  }

  .words-stage .student-correction-list,
  .words-stage .student-word-grid {
    max-height: none;
    overflow: visible;
  }

  .phonetics-overview-group {
    scrollbar-color: var(--accent) rgba(15, 118, 110, 0.12);
    scrollbar-width: auto;
  }

  .phonetics-overview-group::-webkit-scrollbar {
    height: 8px;
  }

  .phonetics-overview-group::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--accent);
  }
}

@media (max-width: 720px) {
  .words-stage.page-learning .student-flow.teaching-fullscreen {
    inset: 0;
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    border-radius: 0;
  }

  .student-home-hero h2,
  .memory-menu-title h2 {
    font-size: clamp(32px, 10vw, 40px);
  }

  .words-stage.page-intake .student-intake-card h2,
  .word-adventure-intro h2 {
    font-size: clamp(28px, 8.6vw, 34px);
  }

  .student-home-hero,
  .memory-menu-title,
  .word-adventure-intro,
  .student-panel,
  .student-intake-card,
  .account-profile-card,
  .student-homework-panel {
    min-width: 0;
    max-width: 100%;
  }

  .student-correction-row input,
  .student-answer-row input,
  .student-intake-card textarea {
    min-width: 0;
    font-size: 16px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .words-stage.page-learning .student-flow.teaching-fullscreen {
    inset: 0;
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    border-radius: 0;
  }

  .app.mode-phonetics:not(.phonetics-overview-mode) {
    grid-template-columns: 1fr;
  }

  .app.mode-phonetics:not(.phonetics-overview-mode) .sidebar {
    display: none;
  }

  #phoneticsStage.phonetics-detail {
    min-height: 100dvh;
    padding: 8px;
  }

  #phoneticsStage.phonetics-detail .topbar {
    min-height: 0;
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  #phoneticsStage.phonetics-detail .topbar h2 {
    font-size: clamp(34px, 9vh, 46px);
  }

  .student-home-page.active,
  .word-memory-menu.active,
  .words-stage.page-intake .student-intake-modal.active,
  .words-stage.page-learning .student-flow.active,
  .words-stage.page-learning .student-panel.active {
    min-height: 0;
  }

  .student-home-page,
  .word-memory-menu,
  .student-account-panel,
  .student-flow,
  .student-panel {
    gap: 8px;
  }

  .student-home-hero {
    padding: 4px 0;
  }

  .student-home-hero h2,
  .memory-menu-title h2,
  .word-adventure-intro h2 {
    margin-block: 2px 4px;
    font-size: clamp(25px, 8vh, 32px);
  }

  .student-home-hero p:last-child,
  .memory-menu-title > p:last-child,
  .word-adventure-intro > p:last-child {
    display: none;
  }

  .home-feature-grid {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .home-feature-card {
    min-height: 132px;
    padding: 12px;
  }

  .home-feature-card strong {
    font-size: 19px;
  }

  .words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-hero,
  .words-stage.page-learning .student-flow:not(.teaching-fullscreen) .student-steps {
    display: none !important;
  }

  .words-stage.page-learning .student-panel.active {
    min-height: 0 !important;
    padding: 10px;
  }

  .words-stage .student-correction-list,
  .words-stage .student-word-grid {
    max-height: none;
    overflow: visible;
  }

  .words-stage .student-bottom-bar {
    bottom: 2px;
    padding: 8px 10px;
  }

  .account-profile-card,
  .student-homework-panel,
  .student-personal-db-panel,
  .student-membership-panel,
  .student-study-loop-panel {
    padding: 12px;
  }

  .account-profile-card h2,
  .homework-copy h3 {
    font-size: clamp(24px, 7vh, 30px);
  }
}

/* Compact phone teacher lesson: more learning content without shrinking tap safety. */
@media (max-width: 720px) {
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-card {
    --student-slide-gap: 6px;
    --student-card-pad: 7px 9px;
    --student-route-gap: 5px;
    border-radius: 14px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-main {
    gap: 6px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-slide-top {
    min-height: 36px;
    gap: 5px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-slide-counter {
    font-size: 14px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-exit-btn {
    min-height: 38px;
    padding: 0 8px;
    font-size: 13px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-word-title {
    line-height: 1;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-word-replay-btn,
  .words-stage.page-learning .student-flow.teaching-fullscreen .word-replay-btn {
    min-height: 34px;
    padding: 0 9px;
    font-size: 13px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-meaning {
    gap: 3px;
    font-size: 16px;
    line-height: 1.35;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .part-label,
  .words-stage.page-learning .student-flow.teaching-fullscreen .memory-card-head strong {
    font-size: 15px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-card .part-label b {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    font-size: 11px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-example,
  .words-stage.page-learning .student-flow.teaching-fullscreen .memory-route-card p,
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-related-chips span,
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-phonics-strip span {
    font-size: 15px;
    line-height: 1.4;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-related-chips {
    gap: 5px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-related-chips span {
    padding: 4px 7px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-memory-route .memory-route-card,
  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-card.density-ultra .memory-route-card {
    gap: 5px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-actions {
    gap: 5px;
    border-radius: 10px;
    padding: 6px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-teacher-actions button {
    min-height: 40px;
    padding: 0 6px;
    font-size: 13px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-speech-status {
    min-height: 36px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen .student-presenter {
    width: clamp(72px, 22vw, 92px);
    height: clamp(72px, 22vw, 92px);
  }

  .words-stage.page-learning .student-flow.teaching-fullscreen [data-speech-part] {
    scroll-margin-top: 160px;
  }
}
