:root {
  --ink: #15243b;
  --muted: #718096;
  --line: #dfe5ec;
  --blue: #1976d2;
  --blue-soft: #eaf4ff;
  --green: #23856d;
  --yellow: #f3b340;
  --paper: #fff;
  --bg: #f5f7fa;
}
.training-current-meaning {
  max-width: min(620px, 90%);
  color: var(--ink);
  font-size: 22px;
  line-height: 1.45;
  text-align: center;
}
.review-batch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
}
.review-batch-tabs button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.review-batch-tabs button.active {
  border-color: var(--green);
  background: #e7f4ee;
  color: var(--green);
}
.review-batch-tabs small {
  color: var(--muted);
  font-size: 10px;
}
.review-mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}
.review-mode-picker button {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.review-mode-picker b,
.review-mode-picker span,
.review-mode-picker small {
  display: block;
}
.review-mode-picker b {
  font-size: 17px;
}
.review-mode-picker small {
  margin-top: 11px;
  color: #28715e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}
.review-mode-picker span {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #e5ebe8;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.review-mode-picker button.active {
  border-color: var(--green);
  background: #edf7f3;
  box-shadow: 0 0 0 2px rgba(35, 133, 109, 0.1);
}
.review-mode-picker button,
.review-nine-grid button,
.review-batch-tabs button,
.review-metrics article {
  background: #eef3f0;
  border-color: #d8e1dc;
  box-shadow:
    5px 5px 10px #cbd5d0,
    -5px -5px 10px #fff;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}
.review-mode-picker button:hover,
.review-nine-grid button:hover,
.review-batch-tabs button:hover {
  transform: translateY(-2px);
}
.review-mode-picker button.active,
.review-nine-grid button.active,
.review-batch-tabs button.active {
  transform: none;
  background: #e4f2ec;
  box-shadow:
    inset 4px 4px 8px #c2d6cd,
    inset -4px -4px 8px #fff;
}
.review-practice-view {
  padding: 32px max(20px, calc((100% - 940px) / 2)) 60px;
}
.review-practice-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.review-practice-header span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}
.review-practice-header h1 {
  margin: 7px 0 5px;
  font-size: 30px;
}
.review-practice-header p {
  margin: 0;
  color: var(--muted);
}
.review-practice-progress {
  min-width: 180px;
}
.review-practice-progress strong {
  display: block;
  margin-bottom: 8px;
  text-align: right;
}
.review-practice-progress progress {
  width: 100%;
  accent-color: var(--green);
}
.review-practice-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(28, 62, 51, 0.1);
}
.review-mode-route {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}
.review-mode-route span {
  flex: 1;
  padding: 9px;
  border-radius: 5px;
  background: #edf2ef;
  color: #718079;
  text-align: center;
  font-size: 12px;
}
.review-mode-route span.active {
  background: #23856d;
  color: #fff;
  font-weight: 800;
}
.review-mode-route span.done {
  background: #d9efe6;
  color: #17624f;
}
.review-practice-stage {
  min-height: 400px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  text-align: center;
}
.review-practice-stage > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.review-practice-stage h2 {
  margin: 0;
  font-size: 24px;
}
.review-focus-word {
  font: 900 64px Arial;
  color: #173f34;
}
.review-focus-word mark {
  background: transparent;
  color: #d14d45;
}
.review-focus-meaning {
  font-size: 22px;
  color: #2c6556;
}
.review-read-count {
  display: flex;
  gap: 8px;
}
.review-read-count i {
  width: 34px;
  height: 8px;
  border-radius: 6px;
  background: #dce5e1;
}
.review-read-count i.done {
  background: #23856d;
}
.review-syllable-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.review-syllable-item {
  display: grid;
  gap: 7px;
  padding: 15px;
  border: 1px solid #cad8d2;
  border-radius: 7px;
  background: #fbfcfa;
}
.review-syllable-item.read {
  border-color: #23856d;
  background: #edf7f3;
}
.review-syllable-item button {
  border: 0;
  background: transparent;
  color: #17624f;
  font: 800 25px Arial;
  cursor: pointer;
}
.review-syllable-item small {
  color: var(--muted);
}
.review-syllable-item input,
.review-full-spelling {
  width: 100%;
  height: 48px;
  border: 1px solid #c8d4ce;
  border-radius: 6px;
  text-align: center;
  font: 800 24px Arial;
  outline: none;
}
.review-syllable-item input:focus,
.review-full-spelling:focus {
  border-color: #23856d;
  box-shadow: 0 0 0 3px rgba(35, 133, 109, 0.1);
}
.review-memory {
  width: min(660px, 100%);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  text-align: left;
}
.review-memory img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 7px;
}
.review-memory-copy {
  display: grid;
  align-content: center;
  gap: 12px;
}
.review-memory-copy strong {
  font: 900 34px Arial;
}
.review-memory-copy p {
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
}
.review-memory-chunks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.review-memory-chunks span {
  padding: 6px 9px;
  border-radius: 5px;
  background: #edf7f3;
  color: #17624f;
  font-weight: 800;
}
.review-practice-feedback {
  min-height: 22px;
  margin: 10px 0;
  color: #17624f;
  text-align: center;
  font-weight: 700;
}
.review-practice-feedback.error {
  color: #b23d34;
}
.review-practice-card > footer {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}
.review-practice-card > footer button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #cad5d0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.review-practice-card #reviewPracticeAction {
  border-color: #23856d;
  background: #23856d;
  color: #fff;
  font-weight: 800;
}
.review-practice-card #reviewPracticeAction:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.review-node-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 5px;
  background: #fff2d7;
  color: #855b0b;
  font-weight: 800;
}
.memory-cover .cover-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-template-columns: 1fr;
}
.memory-cover .cover-caption strong,
.memory-cover .memory-cover-fallback strong {
  display: none !important;
}
.memory-cover .cover-caption span {
  max-width: 100%;
  text-align: center;
}
@media (max-width: 680px) {
  .review-mode-picker {
    grid-template-columns: 1fr;
  }
  .review-practice-header {
    align-items: start;
    flex-direction: column;
  }
  .review-practice-progress {
    width: 100%;
  }
  .review-memory {
    grid-template-columns: 1fr;
  }
  .review-memory img {
    width: min(240px, 100%);
    margin: auto;
  }
  .review-focus-word {
    font-size: 46px;
  }
  .review-practice-card {
    padding: 16px;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1040px) / 2));
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  border-radius: 7px;
  font: 800 19px Arial;
}
.brand strong {
  font-size: 18px;
}
.lesson-count {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.lesson-count b {
  color: var(--muted);
  font-weight: 500;
}
.lesson-count span {
  background: #edf7f3;
  color: var(--green);
  padding: 5px 9px;
  border-radius: 5px;
  font-weight: 700;
}
.page {
  width: min(1040px, calc(100% - 32px));
  margin: 34px auto 64px;
}
.lesson-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 28px;
}
.eyebrow {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}
.lesson-head h1 {
  margin: 7px 0 2px;
  font: 800 56px/1 Arial;
}
.lesson-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}
.sound-button {
  width: 42px;
  height: 42px;
  border: 1px solid #a9cce9;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  padding-left: 4px;
}
.main-sound {
  width: 54px;
  height: 54px;
  background: var(--blue);
  color: #fff;
  border: 0;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(25, 118, 210, 0.2);
}
button,
input {
  font: inherit;
  letter-spacing: 0;
}
.steps {
  height: 78px;
  display: grid;
  grid-template-columns: 1fr 48px 1fr 48px 1fr;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 34px;
  margin-bottom: 18px;
}
.steps i {
  border-top: 2px solid #d8e0e8;
}
.step {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: #9aa6b4;
  cursor: pointer;
}
.step > b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid #cbd4de;
  border-radius: 50%;
}
.step span > * {
  display: block;
}
.step strong {
  font-size: 16px;
}
.step small {
  margin-top: 3px;
  font-size: 11px;
}
.step.active {
  color: var(--blue);
}
.step.active > b {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.step.done {
  color: var(--green);
}
.step.done > b {
  border-color: var(--green);
  color: var(--green);
}
.stage {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 30px 38px 34px;
  box-shadow: 0 8px 28px rgba(22, 43, 68, 0.06);
}
.stage[hidden] {
  display: none;
}
.stage > header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.stage > header > span {
  font: 800 24px Arial;
  color: #b7c2ce;
}
.stage h2 {
  margin: 0;
  font-size: 20px;
}
.stage header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.find-board {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
}
.word-display {
  font: 800 76px/1 Arial;
}
.word-display mark,
.syllable mark {
  color: var(--blue);
  background: transparent;
}
.ipa-button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #c7dff3;
  background: var(--blue-soft);
  color: var(--ink);
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
}
.ipa-button span {
  font-size: 11px;
  background: #fff;
  color: var(--blue);
  padding: 3px 5px;
}
.ipa-button strong {
  font: 600 20px Arial;
}
.ipa-button b {
  color: var(--blue);
}
.legend {
  font-size: 12px;
  color: var(--muted);
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 2px;
  margin-right: 6px;
}
.next-button {
  display: block;
  margin: 0 auto;
  border: 0;
  border-radius: 6px;
  padding: 12px 20px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.next-button span {
  margin-left: 12px;
}
.syllable-board {
  min-height: 235px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}
.syllable {
  position: relative;
  width: 230px;
  height: 154px;
  border: 1px solid #cbd9e7;
  background: #fff;
  border-radius: 7px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  cursor: pointer;
}
.syllable:hover {
  border-color: var(--blue);
  background: #f8fbff;
}
.syllable > span {
  position: absolute;
  top: 0;
  left: 0;
  background: #edf4fa;
  color: #58728d;
  padding: 5px 8px;
  font-size: 10px;
}
.syllable strong {
  font: 800 48px Arial;
}
.syllable small {
  font: 18px Arial;
  color: var(--muted);
}
.syllable > b {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--blue);
}
.plus,
.spell-dot {
  font-size: 30px;
  color: #aab5c1;
}
.whole-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 14px;
  background: #f5f7f9;
  margin-bottom: 24px;
}
.whole-line span {
  color: var(--muted);
  font-size: 12px;
}
.whole-line strong {
  font: 800 24px Arial;
}
.spell-board {
  display: grid;
  grid-template-columns: 1fr 36px 1fr;
  align-items: end;
  gap: 14px;
  padding: 44px 70px 32px;
}
.spell-part {
  display: grid;
  gap: 9px;
}
.spell-part > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.spell-part span {
  font-weight: 700;
  font-size: 13px;
}
.mini-sound,
.hint-button {
  border: 1px solid #b8d5ed;
  background: #fff;
  color: var(--blue);
  border-radius: 5px;
  padding: 6px 9px;
  cursor: pointer;
}
.spell-part input {
  width: 100%;
  height: 64px;
  border: 2px solid #cbd6e2;
  border-radius: 6px;
  text-align: center;
  font: 800 34px Arial;
  text-transform: lowercase;
  outline: none;
}
.spell-part input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.spell-part input.correct {
  border-color: var(--green);
  background: #f0faf6;
}
.spell-part input.wrong {
  border-color: #d74e45;
  background: #fff5f4;
}
.spell-part small {
  color: var(--muted);
  font-size: 11px;
}
.spell-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.hint-button,
.check-button {
  padding: 11px 18px;
  font-weight: 700;
}
.check-button {
  border: 0;
  background: var(--green);
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
}
.feedback {
  height: 25px;
  text-align: center;
  font-weight: 700;
  color: var(--green);
  margin: 15px 0 0;
}
.playing {
  animation: pulse 0.7s ease;
}
@keyframes pulse {
  50% {
    transform: scale(0.94);
    filter: brightness(0.92);
  }
}
@media (max-width: 680px) {
  .topbar {
    padding: 0 16px;
  }
  .lesson-count b {
    display: none;
  }
  .page {
    width: calc(100% - 20px);
    margin-top: 22px;
  }
  .lesson-head h1 {
    font-size: 44px;
  }
  .steps {
    padding: 0 12px;
    grid-template-columns: 1fr 14px 1fr 14px 1fr;
  }
  .step {
    gap: 6px;
  }
  .step > b {
    width: 29px;
    height: 29px;
  }
  .step small {
    display: none;
  }
  .stage {
    padding: 22px 16px 28px;
  }
  .word-display {
    font-size: 56px;
  }
  .syllable-board {
    gap: 9px;
  }
  .syllable {
    width: 44%;
    height: 140px;
  }
  .syllable strong {
    font-size: 36px;
  }
  .plus {
    font-size: 22px;
  }
  .spell-board {
    grid-template-columns: 1fr;
    padding: 30px 6px 24px;
  }
  .spell-dot {
    display: none;
  }
  .spell-part input {
    height: 56px;
  }
  .lesson-head {
    padding-inline: 4px;
  }
}
.word-display {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-bottom: 30px;
}
.word-display mark {
  position: relative;
}
.word-display mark::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: calc(100% + 3px);
  border-top: 2px solid #8bc0ec;
}
.word-display mark::after {
  content: attr(data-ipa);
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  transform: translateX(-50%);
  color: var(--blue);
  font: 700 17px/1 Arial;
  white-space: nowrap;
}
.learning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}
.stage-column,
.stage-column .stage {
  height: 100%;
}
.stage-column .stage {
  min-height: 560px;
}
.memory-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 30px 28px;
  box-shadow: 0 8px 28px rgba(22, 43, 68, 0.06);
}
.memory-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.memory-panel > header div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.memory-panel h2 {
  margin: 0;
  font-size: 20px;
}
.memory-panel > header span {
  color: var(--green);
  font: 800 19px Arial;
}
.memory-panel > header small {
  color: var(--muted);
}
.memory-map {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 34px;
  min-height: 280px;
}
.root-word {
  position: relative;
  padding: 14px 10px;
  border-radius: 6px;
  background: #e8f2ff;
  color: #b33c34;
  text-align: center;
  font: 800 22px Arial;
}
.root-word::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 34px;
  border-top: 2px solid #7893a2;
}
.branches {
  border-left: 2px solid #7893a2;
  display: grid;
  gap: 28px;
  padding-left: 22px;
}
.branches div {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
}
.branches div::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 22px;
  border-top: 2px solid #7893a2;
}
.branches b {
  grid-row: 1/3;
  color: var(--blue);
  font: 800 23px Arial;
}
.branches span {
  font-weight: 800;
}
.branches small {
  color: var(--muted);
  margin-top: 3px;
}
.memory-story {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.memory-story > b {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
}
.memory-story p {
  line-height: 1.8;
  margin: 12px 0;
}
.memory-story p strong {
  color: #b33c34;
}
.memory-note {
  color: #b36b27;
  font-size: 11px;
  line-height: 1.6;
  margin-top: 18px;
}
@media (max-width: 860px) {
  .learning-grid {
    grid-template-columns: 1fr;
  }
  .stage-column .stage {
    min-height: auto;
  }
  .memory-panel {
    min-height: 470px;
  }
}
@media (max-width: 680px) {
  .memory-panel {
    padding: 22px 18px;
  }
  .memory-map {
    grid-template-columns: 90px 1fr;
    gap: 26px;
  }
  .root-word::after {
    width: 26px;
  }
  .branches {
    padding-left: 16px;
  }
  .branches div::before {
    width: 16px;
  }
}
.memory-map.single-block {
  grid-template-columns: 1fr;
  justify-items: center;
}
.memory-map.single-block .branches {
  border-left: 0;
  padding-left: 0;
}
.memory-map.single-block .branches div {
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faf9;
}
.memory-map.single-block .branches div::before {
  display: none;
}
@media (max-width: 680px) {
  .topbar {
    gap: 10px;
  }
  .brand,
  .brand strong,
  .lesson-count {
    white-space: nowrap;
  }
  .brand strong {
    font-size: 16px;
  }
  .lesson-head {
    gap: 12px;
  }
  .lesson-head h1 {
    font-size: 40px;
  }
  .main-sound {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .step {
    display: grid;
    grid-template-columns: 29px 1fr;
    gap: 5px;
  }
  .step strong {
    font-size: 14px;
    white-space: nowrap;
  }
  .steps {
    padding-inline: 9px;
  }
}
.phoneme {
  position: relative;
  margin: 0;
  padding: 0 0 30px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.phoneme > strong {
  font: inherit;
}
.phoneme > small {
  position: absolute;
  left: 50%;
  top: calc(100% - 22px);
  transform: translateX(-50%);
  border-top: 2px solid #8bc0ec;
  padding-top: 7px;
  color: var(--blue);
  font: 700 17px/1 Arial;
  white-space: nowrap;
}
.phoneme > b {
  position: absolute;
  left: calc(50% + 24px);
  top: calc(100% - 21px);
  color: var(--blue);
  font: 700 10px Arial;
}
.phoneme:hover small,
.phoneme:focus-visible small {
  border-color: var(--blue);
}
.phoneme.playing,
.syllable.playing,
.mini-sound.playing,
.ipa-button.playing,
.sound-button.playing {
  color: var(--green);
}
.workbench-header {
  height: 66px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.workbench-header .brand span {
  width: 38px;
  height: 38px;
  font-size: 15px;
}
.workbench-header .brand div strong,
.workbench-header .brand div small {
  display: block;
}
.workbench-header .brand div small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}
.tool-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.workspace {
  height: calc(100vh - 66px);
  display: grid;
  grid-template-columns: 380px minmax(760px, 1fr);
  overflow: hidden;
}
.editor {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px;
  overflow: auto;
}
.word-generator > label,
.editor-panel > label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}
.generate-row {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 8px;
}
.generate-row input,
.editor-panel input,
.editor-panel textarea,
.import-dialog textarea {
  width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #fff;
  padding: 10px 11px;
  outline: none;
}
.generate-row input {
  min-width: 0;
  font: 800 17px Arial;
}
.generate-row button,
#confirmImportButton {
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.import-button {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border: 1px dashed #82aa9c;
  border-radius: 6px;
  background: #f5faf7;
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
}
.quick-words {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.quick-words button,
.view-switch button {
  border: 1px solid #cad5df;
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  padding: 6px 11px;
  cursor: pointer;
}
.quick-words button.active,
.view-switch button.active {
  border-color: #8eb5a8;
  background: #e9f4ef;
  color: var(--green);
  font-weight: 700;
}
.editor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 24px -22px 0;
  border-block: 1px solid var(--line);
}
.editor-tabs button {
  height: 48px;
  border: 0;
  background: #fafbfc;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.editor-tabs button.active {
  background: #fff;
  color: var(--green);
  box-shadow: inset 0 -3px var(--green);
}
.editor-panel {
  display: none;
  padding-top: 20px;
}
.editor-panel.active {
  display: block;
}
.editor-panel label {
  margin-bottom: 15px;
}
.editor-panel input,
.editor-panel textarea {
  display: block;
  margin-top: 7px;
  resize: vertical;
}
.editor-panel input[readonly] {
  background: #f5f7f8;
  color: var(--muted);
}
.editor-note {
  border-left: 3px solid #8caea1;
  background: #f2f6f4;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.chunk-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.priority-rule {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}
.priority-rule span {
  background: #e9f4ef;
  color: var(--green);
  padding: 5px 7px;
  border-radius: 4px;
}
.current-phonetics {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  padding: 12px;
  background: #edf5f1;
  border-left: 3px solid var(--green);
}
.current-phonetics span {
  color: var(--muted);
  font-size: 12px;
}
.current-phonetics strong {
  font: 800 17px Arial;
}
.current-phonetics b {
  grid-column: 1/-1;
  font: 700 17px Arial;
  color: var(--green);
}
.phonetic-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}
.phonetic-tabs button {
  border: 0;
  background: #fff;
  padding: 10px;
  color: var(--muted);
  font-weight: 700;
}
.phonetic-tabs button.active {
  color: var(--green);
  box-shadow: inset 0 -3px var(--green);
}
.phonetic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.phonetic-grid button {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
  padding: 9px;
}
.phonetic-grid strong,
.phonetic-grid small {
  display: block;
}
.phonetic-grid strong {
  font: 800 20px Arial;
}
.phonetic-grid small {
  margin-top: 4px;
  color: var(--muted);
}
.preview-shell {
  overflow: auto;
  padding: 18px 24px 42px;
}
.preview-toolbar {
  width: min(1180px, 100%);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.preview-toolbar > span i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #2da77d;
}
.view-switch {
  display: flex;
  gap: 5px;
}
.preview-shell .page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 34px 36px;
  border-top: 8px solid var(--green);
  background: #f8fafb;
  box-shadow: 0 16px 46px rgba(36, 61, 53, 0.12);
}
.preview-shell .lesson-head {
  padding-inline: 4px;
}
.student-view .legend,
.student-view .memory-story p,
.student-view .memory-note {
  filter: blur(6px);
  user-select: none;
}
.import-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 50, 41, 0.25);
}
.import-dialog::backdrop {
  background: rgba(24, 42, 36, 0.52);
}
.import-dialog form > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.import-dialog header strong,
.import-dialog header small {
  display: block;
}
.import-dialog header small {
  margin-top: 4px;
  color: var(--muted);
}
.import-dialog header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  font-size: 21px;
}
.import-dialog textarea {
  display: block;
  width: calc(100% - 44px);
  margin: 18px 22px;
}
.file-picker {
  display: flex;
  justify-content: center;
  margin: 0 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  font-weight: 700;
}
.file-picker input {
  display: none;
}
.import-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 18px 22px;
}
.import-dialog footer button {
  min-width: 90px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.import-dialog #confirmImportButton {
  background: var(--green);
  color: #fff;
}
@media (max-width: 1100px) {
  .workspace {
    display: block;
    height: auto;
    overflow: visible;
  }
  .editor {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .preview-shell {
    padding-inline: 12px;
  }
  .preview-shell .page {
    width: 100%;
  }
}
@media (max-width: 680px) {
  .workbench-header {
    padding-inline: 14px;
  }
  .workbench-header .brand div small {
    display: none;
  }
  .header-tools > span {
    display: none;
  }
  .editor {
    padding: 16px;
  }
  .editor-tabs {
    margin-inline: -16px;
  }
  .preview-shell {
    padding: 10px 6px 30px;
  }
  .preview-shell .page {
    width: 100%;
    padding: 20px 10px 26px;
  }
  .preview-shell .lesson-head {
    padding-inline: 4px;
  }
  .preview-toolbar {
    padding-inline: 4px;
  }
}
@media print {
  .workbench-header,
  .editor,
  .preview-toolbar {
    display: none;
  }
  .workspace,
  .preview-shell {
    display: block;
    height: auto;
    padding: 0;
    overflow: visible;
  }
  .preview-shell .page {
    width: 100%;
    box-shadow: none;
    border-top: 0;
  }
}

/* Eye-comfort paper theme: lower glare while retaining the established blue and green accents. */
:root {
  --ink: #17283e;
  --muted: #536579;
  --line: #cfd9d2;
  --paper: #f8faf5;
  --bg: #e8eee8;
}
body,
.app-content,
.preview-shell {
  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    0deg,
    rgba(37, 72, 58, 0.018) 0,
    rgba(37, 72, 58, 0.018) 1px,
    transparent 1px,
    transparent 5px
  );
}
.workbench-header,
.topbar,
.main-sidebar,
.editor,
.steps,
.stage,
.memory-panel {
  background-color: rgba(248, 250, 245, 0.98);
}
.preview-shell .page {
  background-color: #f6f8f2;
  box-shadow: 0 16px 46px rgba(36, 61, 53, 0.16);
}
.overview-meaning,
.memory-face,
.cover-caption,
.syllable,
.mini-sound,
.hint-button,
.quick-words button,
.view-switch button,
.phonetic-tabs button,
.phonetic-grid button,
.recent-words button,
.book-list button,
.filter-row button,
.week-strip i,
.home-metrics {
  background-color: #fbfcf8;
}
.editor-tabs button,
.whole-line,
.generate-row input,
.editor-panel input,
.editor-panel textarea,
.import-dialog textarea,
.global-search input {
  background-color: #f5f8f3;
}
.stage header p,
.legend,
.whole-line span,
.spell-part small,
.branches small,
.memory-panel > header small,
.memory-note,
.practice-copy span,
.practice-feedback,
.phoneme-spellings,
.source-badge,
.sidebar-book span,
.sidebar-book small,
.plan-list span small,
.recent-words span,
.library-list small,
.setting-list label small {
  color: #526478;
}
.step small,
.syllable > span,
.syllable em,
.branches small,
.memory-note,
.source-badge,
.phoneme-spellings,
.sidebar-book span,
.sidebar-book small,
.plan-list span small,
.recent-words span,
.library-list small {
  font-size: 12px;
  line-height: 1.55;
}
.stage header p,
.legend,
.whole-line span,
.spell-part small,
.practice-copy span,
.practice-feedback,
.setting-list label small {
  font-size: 13px;
  line-height: 1.6;
}
@media print {
  body,
  .app-content,
  .preview-shell {
    background: #fff;
    background-image: none;
  }
}

/* Start card and pronunciation reference */
.steps[hidden],
.memory-cover-fallback[hidden],
.memory-map[hidden],
.memory-story[hidden],
.memory-unavailable[hidden] {
  display: none !important;
}
.reference-panel {
  display: none;
  padding-top: 18px;
}
.reference-panel.active {
  display: block;
}
.reference-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.reference-heading strong {
  font-size: 15px;
}
.reference-heading span {
  color: var(--muted);
  font: 700 12px Arial;
}
.reference-grid button {
  cursor: pointer;
}
.reference-grid button:hover,
.reference-grid button:focus-visible {
  border-color: #8eb5a8;
  background: #f5faf7;
  outline: 0;
}
.reference-grid button.playing {
  border-color: var(--green);
  color: var(--green);
}
.combination-grid strong {
  color: var(--green);
  font-size: 18px;
}
.overview-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.overview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.source-badge {
  padding: 5px 8px;
  border-radius: 4px;
  background: #edf5f1;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}
.overview-word {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 2px;
}
.overview-word h1 {
  margin: 0;
  font: 800 64px/1 Arial;
  text-transform: lowercase;
}
.accent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.accent-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid #c7dff3;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.accent-card span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #fff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}
.accent-card strong {
  font: 700 17px Arial;
}
.accent-card b {
  color: var(--blue);
  font-size: 11px;
}
.overview-meaning {
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border-block: 1px solid var(--line);
  background: #fff;
}
.overview-meaning span {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.overview-meaning strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.55;
}
.lesson-group-tracker {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 10px 22px;
  padding: 13px 16px;
  border: 1px solid #bedcd3;
  border-radius: 7px;
  background: linear-gradient(115deg, #f1fbf7, #fffdf3);
  box-shadow: 0 7px 18px rgba(35, 133, 109, 0.08);
}
.lesson-group-heading,
.lesson-group-stat {
  display: grid;
  gap: 2px;
}
.lesson-group-heading span,
.lesson-group-stat span {
  color: #6e827b;
  font-size: 11px;
  font-weight: 700;
}
.lesson-group-heading strong {
  color: var(--green);
  font-size: 20px;
}
.lesson-group-stat strong {
  color: var(--ink);
  font: 800 17px/1.2 Arial;
  font-variant-numeric: tabular-nums;
}
.lesson-group-tracker progress {
  grid-column: 1/-1;
  width: 100%;
  height: 7px;
  accent-color: var(--green);
}
.lesson-group-complete {
  position: fixed;
  z-index: 1320;
  left: 50%;
  top: 42%;
  display: grid;
  justify-items: center;
  gap: 7px;
  width: min(440px, calc(100vw - 32px));
  padding: 24px 28px;
  border: 2px solid #f1bd3e;
  border-radius: 8px;
  background: linear-gradient(145deg, #fffdf2, #fff4c7);
  box-shadow: 0 22px 70px rgba(74, 47, 8, 0.28);
  pointer-events: none;
  animation: group-complete-show 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.lesson-group-complete span {
  color: #a06b0a;
  font-size: 13px;
  font-weight: 900;
}
.lesson-group-complete strong {
  color: #185c4c;
  font-size: 30px;
}
.lesson-group-complete small {
  color: #6d765f;
  font-weight: 700;
}
@keyframes group-complete-show {
  0% {
    opacity: 0;
    transform: translate(-50%, -35%) scale(0.65);
  }
  18%,
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.94);
  }
}

/* Two-round bilingual follow-reading gate */
.read-aloud {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px 18px;
  margin-top: auto;
  padding: 18px;
  border: 1px solid #b8d9ce;
  border-radius: 7px;
  background: #f3faf7;
}
.practice-copy {
  display: grid;
  gap: 4px;
}
.practice-copy strong {
  font-size: 17px;
}
.practice-copy span {
  color: var(--muted);
  font-size: 12px;
}
.practice-dots {
  display: flex;
  gap: 7px;
}
.practice-dots i {
  width: 23px;
  height: 7px;
  border-radius: 4px;
  background: #ccd9d4;
}
.practice-dots i.done {
  background: var(--green);
}
.practice-button {
  grid-column: 1/-1;
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.practice-button:disabled {
  cursor: wait;
  opacity: 0.72;
}
.practice-feedback {
  grid-column: 1/-1;
  min-height: 22px;
  margin: 0;
  color: #49665d;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* The mnemonic image is the front; the map is revealed on the first click. */
.memory-flip {
  position: relative;
  min-height: 500px;
  margin-top: 18px;
  perspective: 1200px;
  cursor: pointer;
  outline: none;
}
.memory-flip:focus-visible {
  box-shadow: 0 0 0 3px rgba(35, 133, 109, 0.2);
}
.memory-flip-inner {
  position: absolute;
  inset: 0;
  transition: transform 0.42s ease;
  transform-style: preserve-3d;
}
.memory-flip.flipped .memory-flip-inner {
  transform: rotateY(180deg);
}
.memory-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 6px;
  backface-visibility: hidden;
  background: #fff;
}
.memory-cover {
  display: grid;
  grid-template-rows: 1fr auto;
  background: #edf3f1;
}
.memory-cover img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center top;
}
.cover-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.cover-caption strong {
  font: 800 28px Arial;
  color: var(--ink);
}
.cover-caption span {
  max-width: 58%;
  color: var(--green);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  text-align: right;
}
.memory-cover-fallback {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  background: #edf3f1;
}
.memory-cover-fallback strong {
  font: 800 48px Arial;
  color: var(--green);
  text-transform: lowercase;
}
.memory-cover-fallback span {
  color: var(--muted);
  font-size: 13px;
}
.memory-back {
  transform: rotateY(180deg);
  padding: 0 4px;
  overflow: auto;
}
.memory-back .memory-map {
  min-height: 275px;
}
.memory-back .memory-story {
  padding-inline: 4px;
}
.syllable {
  height: 184px;
  min-width: 140px;
  flex: 1 1 150px;
  padding: 30px 12px 28px;
}
.syllable strong {
  font-size: 40px;
}
.syllable em {
  max-width: 180px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  font-style: normal;
}
.syllable-board {
  min-height: 245px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.spell-board {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  padding: 38px 24px 30px;
}
.spell-part {
  flex: 1 1 150px;
}
.spell-dot {
  flex: 0 0 auto;
  padding-bottom: 40px;
}
.memory-scene {
  width: min(310px, 90%);
  min-height: 360px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  gap: 18px;
  padding: 36px 18px 22px;
  background: #eef6fb;
}
.scene-cues {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.scene-cues i {
  font-size: 42px;
  font-style: normal;
  filter: drop-shadow(0 5px 6px rgba(21, 36, 59, 0.12));
}
.scene-ladder {
  width: 34px;
  height: 58px;
  display: grid !important;
  grid-template-rows: repeat(4, 1fr);
  gap: 5px;
  padding: 4px 0;
  border-inline: 5px solid #8a5b31;
}
.scene-ladder span {
  display: block;
  border-top: 4px solid #8a5b31;
}
.scene-subject {
  font-size: 112px;
  line-height: 1;
  filter: drop-shadow(0 12px 12px rgba(21, 36, 59, 0.14));
}
.memory-scene p {
  margin: 0;
  color: #40556e;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}
.memory-unavailable {
  min-height: 410px;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}
.memory-unavailable strong {
  color: var(--ink);
  font-size: 20px;
}
.memory-unavailable span {
  font-size: 13px;
}
.memory-flip[aria-disabled="true"] {
  cursor: default;
}

.reference-grid button {
  position: relative;
}
.reference-grid button.in-word {
  border-color: #8bc0ec;
  background: #eaf4ff;
  box-shadow: inset 4px 0 var(--blue);
}
.reference-grid button > b {
  position: absolute;
  right: 9px;
  top: 10px;
  color: var(--blue);
  font-size: 10px;
}
.phoneme-spellings {
  display: block;
  margin-top: 6px;
  padding-right: 12px;
  color: #466b8b;
  font-size: 10px;
  line-height: 1.45;
}
.reference-grid button.playing {
  border-color: var(--green);
  background: #edf8f4;
  box-shadow: inset 4px 0 var(--green);
}
.reference-grid .phonetic-memory-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  align-content: start;
  gap: 5px;
  height: auto;
  min-height: 0;
  padding: 10px 8px;
  background: #fff;
  overflow: visible;
}
.phonetic-memory-card > strong {
  font-size: 22px;
}
.phonetic-memory-card > small {
  color: var(--muted);
  font-size: 10px;
}
.phonetic-memory-card > img {
  grid-column: 1/-1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}
.phonetic-memory-card .phoneme-spellings {
  grid-column: 1/-1;
  margin: 0;
  padding: 0;
}
.reference-grid .phonetic-memory-card > b {
  top: 15px;
}

@media (max-width: 680px) {
  .overview-stage {
    gap: 14px;
  }
  .overview-word h1 {
    font-size: 48px;
  }
  .accent-card strong {
    font-size: 16px;
  }
  .accent-grid {
    grid-template-columns: 1fr 1fr;
  }
  .overview-meaning {
    padding: 14px;
  }
  .overview-meaning strong {
    font-size: 21px;
  }
  .read-aloud {
    padding: 15px;
  }
  .memory-flip {
    min-height: 450px;
  }
  .memory-cover-fallback strong {
    font-size: 38px;
  }
  .cover-caption strong {
    font-size: 24px;
  }
  .syllable-board {
    gap: 9px;
  }
  .syllable {
    min-width: 120px;
    height: 174px;
  }
  .plus {
    display: none;
  }
  .spell-board {
    padding-inline: 6px;
  }
  .spell-dot {
    display: none;
  }
}

/* Application shell and home */
.global-search {
  width: min(420px, 36vw);
  display: grid;
  grid-template-columns: 1fr 42px;
}
.global-search input {
  height: 40px;
  border: 1px solid #ccd6df;
  border-radius: 6px 0 0 6px;
  padding: 0 13px;
  background: #f8fafb;
  outline: none;
}
.global-search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 133, 109, 0.1);
}
.global-search button {
  border: 0;
  border-radius: 0 6px 6px 0;
  background: var(--green);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.app-shell {
  height: calc(100vh - 66px);
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  overflow: hidden;
}
.main-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #edf2ef;
  border-right: 1px solid #d2ddd7;
  padding: 20px 14px 16px;
  box-shadow: inset -8px 0 16px rgba(55, 80, 71, 0.05);
}
.main-sidebar nav {
  display: grid;
  gap: 10px;
}
.main-sidebar nav button {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  background: #edf2ef;
  color: #526174;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    5px 5px 10px #cbd5d0,
    -5px -5px 10px #fff;
}
.main-sidebar nav button i {
  width: 24px;
  font-style: normal;
  color: #8090a2;
  font: 700 18px Arial;
  text-align: center;
}
.main-sidebar nav button.active {
  background: #e4f2ec;
  color: var(--green);
  box-shadow:
    inset 4px 4px 8px #c2d6cd,
    inset -4px -4px 8px #fff;
}
.main-sidebar nav button.active i {
  color: var(--green);
}
.sidebar-book {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.sidebar-book span,
.sidebar-book small {
  color: var(--muted);
  font-size: 11px;
}
.sidebar-book strong {
  font-size: 14px;
}
.app-content {
  min-width: 0;
  overflow: auto;
  background: #f6f8fa;
}
.app-view[hidden] {
  display: none !important;
}
.home-view,
.simple-view {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 30px 34px 54px;
}
.home-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.home-heading span,
.simple-view > header > span,
.home-section header span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.home-heading h1,
.simple-view > header h1 {
  margin: 6px 0 0;
  font-size: 30px;
  line-height: 1.3;
}
.home-heading time {
  color: var(--muted);
  font-size: 13px;
}
.learning-hero {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  border-radius: 8px;
  background: url("assets/teacher-cover.jpg") center 42% / cover no-repeat;
}
.learning-hero::before {
  content: "";
  position: absolute;
  inset: 0 48% 0 0;
  background: rgba(12, 56, 47, 0.82);
}
.hero-copy {
  position: relative;
  z-index: 1;
  width: 52%;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 42px;
  color: #fff;
}
.hero-copy > span {
  font-size: 12px;
  font-weight: 700;
  color: #bfe1d6;
}
.hero-copy h2 {
  margin: 8px 0 6px;
  font-size: 28px;
  line-height: 1.35;
}
.hero-copy > p {
  margin: 0;
  color: #dcece7;
  font-size: 13px;
}
.hero-copy blockquote {
  max-width: 470px;
  margin: 23px 0 18px;
  padding-left: 14px;
  border-left: 3px solid #f3b340;
  font-size: 18px;
  line-height: 1.7;
  font-weight: 700;
}
.hero-progress {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 6px 16px;
  margin-bottom: 20px;
}
.hero-progress > div {
  display: grid;
  gap: 3px;
}
.hero-progress span {
  font-size: 11px;
  color: #bad7cf;
}
.hero-progress strong {
  font-size: 14px;
}
.hero-progress progress {
  width: 100%;
  height: 7px;
  accent-color: #f3b340;
}
.hero-actions {
  display: flex;
  gap: 10px;
}
.continue-learning,
.change-book,
.selected-book button,
.empty-state button {
  min-height: 43px;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}
.continue-learning {
  border: 0;
  background: #fff;
  color: #126651;
}
.change-book {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #fff;
}
.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 24px;
  background: #fff;
  border-block: 1px solid var(--line);
}
.home-metrics > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 18px 22px;
}
.home-metrics > div + div {
  border-left: 1px solid var(--line);
}
.home-metrics span {
  color: var(--muted);
  font-size: 12px;
}
.home-metrics strong {
  grid-row: 1/3;
  grid-column: 2;
  font: 800 30px Arial;
  color: var(--ink);
}
.home-metrics small {
  color: #8794a3;
  font-size: 11px;
}
.home-detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  margin-top: 34px;
}
.home-section {
  border-top: 3px solid var(--green);
  padding-top: 18px;
}
.home-section header h2 {
  margin: 5px 0 0;
  font-size: 20px;
}
.plan-list {
  display: grid;
  margin-top: 17px;
}
.plan-list > div {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
}
.plan-list b {
  font: 800 15px Arial;
  color: #9aa8b5;
}
.plan-list span {
  display: grid;
  gap: 4px;
}
.plan-list span strong {
  font-size: 14px;
}
.plan-list span small {
  color: var(--muted);
  font-size: 11px;
}
.plan-list em {
  font-style: normal;
  color: var(--green);
  font-size: 11px;
}
.recent-words {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 17px;
}
.recent-words button {
  min-height: 72px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}
.recent-words button:hover {
  border-color: #8eb5a8;
  background: #f3f9f6;
}
.recent-words b {
  font: 800 19px Arial;
}
.recent-words span {
  color: var(--muted);
  font-size: 11px;
}
.lesson-view {
  height: 100%;
}
.lesson-view .workspace {
  height: 100%;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
}
.back-home {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}
.simple-view > header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.simple-view > header p {
  margin: 8px 0 0;
  color: var(--muted);
}
.filter-row {
  display: flex;
  gap: 11px;
  margin: 24px 0;
}
.filter-row button {
  min-height: 42px;
  border: 0;
  background: #edf2ef;
  padding: 0 20px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    4px 4px 8px #cbd5d0,
    -4px -4px 8px #fff;
}
.filter-row button.active {
  color: var(--green);
  background: #e4f2ec;
  box-shadow:
    inset 3px 3px 6px #c8d9d1,
    inset -3px -3px 6px #fff;
}
.selected-book {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}
.selected-book span {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}
.selected-book h2 {
  margin: 6px 0;
  font-size: 22px;
}
.selected-book p {
  margin: 0;
  color: var(--muted);
}
.selected-book button,
.empty-state button {
  border: 0;
  background: var(--green);
  color: #fff;
}
.book-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 25px;
}
.book-list button {
  min-height: 112px;
  display: grid;
  gap: 7px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}
.book-list button.active {
  border-color: #84b3a3;
  background: #f3f9f6;
}
.book-list span,
.book-list small {
  color: var(--muted);
}
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 10px;
}
.library-toolbar button {
  border: 0;
  background: var(--green);
  color: #fff;
  border-radius: 5px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
}
.library-list {
  display: grid;
}
.library-list button {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 62px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.library-list button:hover {
  background: #f0f7f4;
}
.library-list b {
  font: 800 20px Arial;
}
.library-list span {
  color: #4f6174;
}
.library-list small {
  color: var(--muted);
}
.empty-state {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.empty-state strong {
  font-size: 22px;
}
.empty-state span {
  color: var(--muted);
}
.empty-state button {
  margin-top: 8px;
}
.history-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  border-block: 1px solid var(--line);
}
.history-summary > div {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 25px;
}
.history-summary > div + div {
  border-left: 1px solid var(--line);
}
.history-summary strong {
  font: 800 34px Arial;
  color: var(--green);
}
.history-summary span {
  color: var(--muted);
  font-size: 12px;
}
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-top: 34px;
}
.week-strip span {
  display: grid;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.week-strip i {
  height: 86px;
  border: 1px solid var(--line);
  background: #fff;
}
.week-strip span:first-child i {
  border-color: #76ad9a;
  background: #e9f4ef;
}
.setting-list {
  display: grid;
  margin-top: 24px;
}
.setting-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 4px;
  border-bottom: 1px solid var(--line);
}
.setting-list label span {
  display: grid;
  gap: 5px;
}
.setting-list label small {
  color: var(--muted);
}
.setting-list input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}
body:not([data-current-view="lesson"]) .tool-icon,
body:not([data-current-view="lesson"]) #saveState {
  display: none;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .home-view,
  .simple-view {
    padding-inline: 24px;
  }
  .learning-hero::before {
    right: 42%;
  }
  .hero-copy {
    width: 60%;
    padding-inline: 30px;
  }
  .home-detail-grid {
    grid-template-columns: 1fr;
  }
  .lesson-view .workspace {
    display: block;
    height: auto;
    overflow: visible;
  }
}
@media (max-width: 820px) {
  .workbench-header {
    position: relative;
    z-index: 3;
  }
  .app-shell {
    height: auto;
    display: block;
    overflow: visible;
  }
  .main-sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: block;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: auto;
  }
  .main-sidebar nav {
    display: flex;
    min-width: max-content;
    gap: 9px;
  }
  .main-sidebar nav button {
    width: 124px;
    height: 50px;
    flex: 0 0 auto;
  }
  .sidebar-book {
    display: none;
  }
  .app-content {
    overflow: visible;
  }
  .home-view,
  .simple-view {
    padding: 24px 18px 44px;
  }
  .home-heading {
    align-items: flex-start;
  }
  .learning-hero {
    min-height: 390px;
    background-position: 58% center;
  }
  .learning-hero::before {
    right: 32%;
  }
  .hero-copy {
    width: 72%;
    min-height: 390px;
    padding: 26px;
  }
  .home-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .home-metrics > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .home-metrics > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }
  .lesson-view {
    height: auto;
  }
  .lesson-view .workspace {
    height: auto;
  }
  .book-list {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .workbench-header {
    height: auto;
    min-height: 116px;
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .workbench-header .brand {
    flex: 1;
  }
  .global-search {
    order: 3;
    width: 100%;
  }
  .app-shell {
    min-height: calc(100vh - 116px);
  }
  .main-sidebar {
    top: 0;
  }
  .home-heading h1,
  .simple-view > header h1 {
    font-size: 24px;
  }
  .home-heading time {
    display: none;
  }
  .learning-hero {
    min-height: 410px;
    background-position: 62% center;
  }
  .learning-hero::before {
    right: 12%;
    background: rgba(12, 56, 47, 0.84);
  }
  .hero-copy {
    width: 90%;
    min-height: 410px;
    padding: 24px 20px;
  }
  .hero-copy h2 {
    font-size: 23px;
  }
  .hero-copy blockquote {
    font-size: 16px;
  }
  .hero-actions {
    display: grid;
  }
  .home-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .home-metrics > div {
    padding: 15px;
  }
  .home-metrics strong {
    font-size: 26px;
  }
  .recent-words {
    grid-template-columns: 1fr;
  }
  .plan-list > div {
    grid-template-columns: 34px 1fr;
  }
  .plan-list em {
    grid-column: 2;
  }
  .book-list {
    grid-template-columns: 1fr;
  }
  .library-list button {
    grid-template-columns: 1fr auto;
  }
  .library-list button span {
    grid-column: 1;
  }
  .history-summary {
    grid-template-columns: 1fr;
  }
  .history-summary > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

body:is(
    [data-current-view="lesson"],
    [data-current-view="assessment"],
    [data-current-view="reviewPractice"],
    [data-current-view="specialTrainingRun"]
  )
  .app-shell {
  grid-template-columns: minmax(0, 1fr);
}
body:is(
    [data-current-view="lesson"],
    [data-current-view="assessment"],
    [data-current-view="reviewPractice"],
    [data-current-view="specialTrainingRun"]
  )
  .main-sidebar {
  display: none;
}
.immersive-home-button {
  margin: 0 0 18px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}
.header-brand-group {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.header-back-home {
  display: none;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: #edf2ef;
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    3px 3px 7px #cbd5d0,
    -3px -3px 7px #fff;
}
body:is(
    [data-current-view="lesson"],
    [data-current-view="assessment"],
    [data-current-view="reviewPractice"],
    [data-current-view="specialTrainingRun"]
  )
  .header-back-home {
  display: block;
}
body:is(
    [data-current-view="lesson"],
    [data-current-view="assessment"],
    [data-current-view="reviewPractice"],
    [data-current-view="specialTrainingRun"]
  )
  .global-search {
  display: none;
}
.preview-toolbar {
  justify-content: flex-end;
}
@media (max-width: 620px) {
  .header-brand-group {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
  .header-brand-group .brand {
    min-width: 0;
  }
  .header-back-home {
    padding-inline: 11px;
    white-space: nowrap;
  }
}
.restart-learning {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.selected-book-actions {
  display: flex;
  gap: 9px;
}
.selected-book-actions .secondary {
  border: 1px solid #83aa9c;
  background: #fff;
  color: var(--green);
}

/* Brand imagery uses watermark-free derivatives of the supplied mascot artwork. */
.brand-logo {
  width: 40px;
  height: 40px;
  display: block;
  flex: 0 0 40px;
  border-radius: 7px;
  object-fit: cover;
}
.learning-hero {
  background: #f4f8f6 url("assets/boyang-home-hero.webp") right center/auto 100%
    no-repeat;
}
.learning-hero::before {
  background: rgba(12, 56, 47, 0.88);
}
@media (max-width: 820px) {
  .main-sidebar {
    scrollbar-width: none;
  }
  .main-sidebar::-webkit-scrollbar {
    display: none;
  }
  .learning-hero {
    background-position: right center;
  }
}

/* Interactive vowel highlights and word-specific British pronunciation rules. */
.word-display .phoneme {
  font: inherit;
  color: var(--blue);
}
.word-display .phoneme > b {
  left: calc(50% + 30px);
  top: calc(100% - 23px);
  font-size: 9px;
}
.vowel-rule-panel {
  width: min(680px, 100%);
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.vowel-rule-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.vowel-rule-panel > header strong {
  font-size: 15px;
}
.vowel-rule-panel > header span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.vowel-rule-list article {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 5px 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.vowel-rule-list article > div {
  grid-row: 1/3;
  display: grid;
  align-content: start;
  gap: 5px;
}
.vowel-rule-list article > div > strong {
  font: 800 20px Arial;
  color: var(--ink);
}
.vowel-rule-list article > div > strong span {
  color: var(--blue);
}
.vowel-rule-list article small {
  color: var(--muted);
  font-size: 10px;
}
.vowel-rule-list article p {
  margin: 0;
  color: #43566e;
  font-size: 12px;
  line-height: 1.65;
}
.vowel-rule-list article em {
  color: #a35b1f;
  font-size: 11px;
  font-style: normal;
}
@media (max-width: 680px) {
  .vowel-rule-list article {
    grid-template-columns: 1fr;
  }
  .vowel-rule-list article > div {
    grid-row: auto;
  }
  .vowel-rule-panel {
    padding-inline: 4px;
  }
}

/* Keep every spelling block and its plus sign on one memorisable line. */
.syllable-board {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 7px;
  scrollbar-width: thin;
}
.syllable-board .syllable {
  width: 100%;
  min-width: 0;
  height: 184px;
  padding-inline: 7px;
}
.syllable-board .plus {
  display: grid;
  place-items: center;
  height: 184px;
}
.syllable-board[data-segment-count="3"] .syllable strong {
  font-size: 34px;
}
.syllable-board[data-segment-count="3"] .syllable em {
  font-size: 10px;
}
.syllable-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--green);
  background: #f2f7f5;
  font-size: 12px;
}
.syllable-summary span {
  color: var(--muted);
}
.syllable-summary strong {
  color: var(--green);
}
.syllable-summary b {
  font: 700 15px Arial;
}
.syllable-summary em {
  margin-left: auto;
  color: #a35b1f;
  font-size: 10px;
  font-style: normal;
}
.whole-line {
  gap: 10px;
  padding-inline: 10px;
  flex-wrap: nowrap;
}
.whole-line > span,
.whole-line > strong {
  white-space: nowrap;
}
.whole-line > strong {
  font-size: 21px;
}
@media (max-width: 680px) {
  .syllable-board {
    justify-content: stretch;
  }
  .syllable-board .plus {
    display: grid;
  }
  .syllable-board .syllable {
    min-width: 0;
  }
  .syllable-summary {
    flex-wrap: wrap;
  }
  .syllable-summary em {
    width: 100%;
    margin-left: 0;
  }
  .whole-line {
    gap: 8px;
  }
  .whole-line > strong {
    font-size: 19px;
  }
}

/* Timed spelling hints and the one-shot success reward. */
.spell-part input::placeholder {
  color: #4f5660;
  opacity: 0;
  transition: opacity 0.24s ease;
}
.spell-part input.hint-visible::placeholder,
.spell-part input.hint-locked::placeholder {
  opacity: 0.72;
}
.spell-part input.hint-fading::placeholder {
  opacity: 0;
}
.hint-button:has(+ .check-button) {
  min-width: 142px;
}
.confetti-burst {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  pointer-events: none;
}
.confetti-burst i {
  position: absolute;
  width: 8px;
  height: 28px;
  border-radius: 50% 12% 50% 14%;
  opacity: 0;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.85),
    transparent 32%,
    rgba(0, 0, 0, 0.16) 75%,
    rgba(255, 255, 255, 0.4)
  );
  box-shadow: 1px 2px 3px rgba(35, 31, 21, 0.2);
  animation: confetti-pop 1.55s cubic-bezier(0.18, 0.72, 0.3, 1) forwards;
}
.confetti-burst .paper-confetti-1 {
  width: 15px;
  height: 9px;
  border-radius: 48% 12% 45% 14%;
}
.confetti-burst .paper-confetti-2 {
  width: 6px;
  height: 38px;
  border-radius: 50%;
  clip-path: polygon(
    0 0,
    100% 5%,
    70% 28%,
    100% 51%,
    65% 74%,
    100% 100%,
    0 94%,
    30% 72%,
    0 49%,
    34% 25%
  );
}
@keyframes confetti-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0);
  }
  8% {
    opacity: 1;
  }
  42% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x1)), calc(-50% + var(--y1)))
      scale(1) rotate(var(--spin1));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x2)), calc(-50% + var(--y2)))
      scale(0.9) rotate(var(--spin));
  }
}
@media (prefers-reduced-motion: reduce) {
  .confetti-burst i {
    animation-duration: 0.35s;
  }
  .spell-part input::placeholder {
    transition: none;
  }
}

/* Reversible mnemonic sentences: cue -> spelling block -> target meaning -> word. */
.branches span {
  color: #a35b1f;
}
.memory-story p {
  font-size: 15px;
  line-height: 2;
}
.memory-story .story-cue {
  color: #a35b1f;
  font-weight: 800;
}
.memory-story .story-code {
  color: var(--blue);
  font-weight: 800;
}
.memory-story .story-meaning {
  color: var(--green);
  font-weight: 800;
}
.memory-story .story-word {
  color: #b33c34;
  font-weight: 800;
}
.filter-row button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.unit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0 4px;
  border-bottom: 1px solid var(--line);
}
.book-list button {
  cursor: pointer;
}
.book-list {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.book-list button small {
  min-height: 16px;
}
.library-list button[data-entry-type="phrase"] {
  opacity: 0.72;
}
.library-list button[data-entry-type="phrase"] small {
  color: #8a6d32;
}
.wordbook-tabs {
  display: flex;
  gap: 6px;
  margin-top: 24px;
  border-bottom: 1px solid var(--line);
}
.wordbook-tabs button {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 0 18px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}
.wordbook-tabs button.active {
  border-bottom-color: var(--green);
  color: var(--green);
}
.wordbook-tabs b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  margin-left: 5px;
  border-radius: 11px;
  background: #e8eef1;
  color: #536579;
  font: 700 12px Arial;
}
.wordbook-tabs button.active b {
  background: #dcefe8;
  color: var(--green);
}
.wordbook-panel {
  padding-top: 22px;
}
.wordbook-panel[hidden] {
  display: none !important;
}
.wordbook-add {
  display: grid;
  grid-template-columns: 1fr 1.25fr auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  background: #eef4f1;
  border: 1px solid #d7e4de;
  border-radius: 6px;
}
.wordbook-add label {
  display: grid;
  gap: 7px;
}
.wordbook-add label span {
  font-size: 12px;
  font-weight: 800;
  color: #536579;
}
.wordbook-add input {
  height: 42px;
  border: 1px solid #cbd8d2;
  border-radius: 5px;
  background: #fff;
  padding: 0 12px;
  outline: none;
}
.wordbook-add input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 133, 109, 0.1);
}
.wordbook-add button,
.wordbook-toolbar button {
  min-height: 40px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: #fff;
  color: var(--green);
  padding: 0 15px;
  font-weight: 800;
  cursor: pointer;
}
.wordbook-add button,
.wordbook-toolbar button:last-child {
  background: var(--green);
  color: #fff;
}
.wordbook-toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wordbook-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 2px 10px;
  border-bottom: 1px solid var(--line);
}
.wordbook-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}
.wordbook-toolbar > div:last-child {
  display: flex;
  gap: 8px;
}
.wordbook-toolbar span {
  color: var(--muted);
  font-size: 12px;
}
.wordbook-list {
  display: grid;
}
.wordbook-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}
.wordbook-word {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) 1fr;
  align-items: center;
  gap: 20px;
  min-height: 70px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.wordbook-word:hover b {
  color: var(--green);
}
.wordbook-word b {
  font: 800 20px Arial;
}
.wordbook-word span {
  color: #4f6174;
}
.wordbook-list article > small {
  color: var(--muted);
}
.wordbook-delete {
  border: 0;
  background: transparent;
  color: #8b5860;
  cursor: pointer;
  padding: 8px;
}
.error-word-meta {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 4px 12px;
  min-width: 260px;
}
.error-word-meta em {
  font-style: normal;
  color: #a55245;
  font-weight: 800;
}
.error-word-meta span {
  font-size: 12px;
  color: #7a5960;
}
.error-word-meta small {
  grid-column: 1/3;
  color: var(--muted);
}
.wordbook-empty {
  min-height: 250px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
}
.wordbook-empty strong {
  color: var(--ink);
  font-size: 18px;
}
@media (max-width: 700px) {
  .wordbook-add {
    grid-template-columns: 1fr;
  }
  .wordbook-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .wordbook-list article {
    grid-template-columns: 1fr auto;
  }
  .wordbook-word {
    grid-template-columns: 1fr;
  }
  .error-word-meta {
    grid-column: 1/3;
    min-width: 0;
    padding-bottom: 14px;
  }
  .wordbook-list article > small {
    display: none;
  }
}
.phrase-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f7f8f1;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 50, 41, 0.25);
}
.phrase-dialog::backdrop {
  background: rgba(24, 42, 36, 0.52);
}
.phrase-dialog form {
  padding: 24px;
}
.phrase-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.phrase-dialog header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #e9efea;
  font-size: 20px;
}
.phrase-dialog-word {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.phrase-dialog-word strong {
  font: 800 38px Arial;
}
.phrase-dialog-word button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.phrase-dialog form > b {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  color: #263e37;
}
.phrase-dialog form > p {
  margin: 24px 0 12px;
  color: #526478;
}
.phrase-dialog blockquote {
  margin: 0;
  padding: 18px;
  border-left: 4px solid #e2a837;
  background: #fff;
}
.phrase-dialog blockquote strong,
.phrase-dialog blockquote span {
  display: block;
}
.phrase-dialog blockquote strong {
  font: 700 20px Arial;
}
.phrase-dialog blockquote span {
  margin-top: 8px;
  color: #526478;
}
.memory-formula {
  grid-column: 1/-1;
  margin: 8px 0 0;
  padding: 9px 12px;
  border-left: 3px solid var(--green);
  background: #edf6f2;
  color: #1d6f5b;
  font: 800 15px Arial;
}
.feedback-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px 8px 9px;
  border: 1px solid #b9d2c8;
  border-radius: 7px;
  background: #fff;
  color: #155d4c;
  box-shadow: 0 9px 24px rgba(31, 73, 61, 0.18);
  cursor: pointer;
}
.feedback-fab span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #23856d;
  color: #fff;
  font: 900 17px Arial;
}
.feedback-fab b {
  font-size: 14px;
}
.feedback-fab:hover {
  border-color: #23856d;
  transform: translateY(-1px);
}
.content-feedback-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 50, 41, 0.28);
}
.content-feedback-dialog::backdrop {
  background: rgba(22, 39, 34, 0.5);
}
.content-feedback-dialog form {
  padding: 0;
}
.content-feedback-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.content-feedback-dialog header span,
.content-feedback-dialog header strong {
  display: block;
}
.content-feedback-dialog header span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.content-feedback-dialog header strong {
  margin-top: 4px;
  font-size: 20px;
}
.content-feedback-dialog header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef3f0;
  color: #42584f;
  font-size: 21px;
  cursor: pointer;
}
.feedback-context {
  margin: 18px 22px 0;
  padding: 13px 15px;
  border-left: 4px solid var(--green);
  background: #f1f7f4;
}
.feedback-context span,
.feedback-context strong,
.feedback-context small {
  display: block;
}
.feedback-context span {
  color: #61756d;
  font-size: 11px;
}
.feedback-context strong {
  margin-top: 3px;
  font: 800 23px Arial;
}
.feedback-context small {
  margin-top: 4px;
  color: #526478;
}
.content-feedback-dialog fieldset {
  margin: 18px 22px 0;
  padding: 0;
  border: 0;
}
.content-feedback-dialog legend {
  margin-bottom: 10px;
  font-weight: 800;
}
.feedback-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.feedback-options label {
  position: relative;
  cursor: pointer;
}
.feedback-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.feedback-options span {
  min-height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid #ccd8d2;
  border-radius: 6px;
  background: #fbfcfa;
  color: #40544d;
  font-size: 13px;
}
.feedback-options input:checked + span {
  border-color: #23856d;
  background: #eaf5f0;
  color: #17624f;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(35, 133, 109, 0.1);
}
.feedback-options input:focus-visible + span {
  outline: 3px solid rgba(25, 118, 210, 0.22);
}
.feedback-text-label {
  display: block;
  margin: 16px 22px 0;
  font-size: 13px;
  font-weight: 800;
}
.feedback-text-label textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px 11px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  resize: vertical;
  outline: none;
}
.feedback-text-label textarea:focus {
  border-color: #23856d;
  box-shadow: 0 0 0 3px rgba(35, 133, 109, 0.1);
}
.feedback-submit-state {
  min-height: 20px;
  margin: 12px 22px 0;
  color: #17624f;
  font-size: 12px;
  font-weight: 700;
}
.feedback-submit-state.error {
  color: #b23d34;
}
.content-feedback-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px 20px;
}
.content-feedback-dialog footer button {
  min-width: 92px;
  min-height: 40px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.content-feedback-dialog #feedbackSubmitButton {
  border-color: #23856d;
  background: #23856d;
  color: #fff;
  font-weight: 800;
}
.content-feedback-dialog #feedbackSubmitButton:disabled {
  opacity: 0.65;
  cursor: wait;
}
@media (max-width: 680px) {
  .feedback-fab {
    right: 12px;
    bottom: 12px;
    padding-right: 10px;
  }
  .feedback-options {
    grid-template-columns: 1fr 1fr;
  }
  .content-feedback-dialog {
    max-height: calc(100vh - 12px);
  }
  .content-feedback-dialog header {
    padding: 16px;
  }
  .feedback-context,
  .content-feedback-dialog fieldset,
  .feedback-text-label {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* Final paper-theme overrides must follow all feature-specific styles. */
body,
.app-content,
.preview-shell {
  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    0deg,
    rgba(37, 72, 58, 0.018) 0,
    rgba(37, 72, 58, 0.018) 1px,
    transparent 1px,
    transparent 5px
  );
}
.workbench-header,
.topbar,
.main-sidebar,
.editor,
.steps,
.stage,
.memory-panel {
  background-color: rgba(248, 250, 245, 0.98);
}
.preview-shell .page {
  background-color: #f6f8f2;
  box-shadow: 0 16px 46px rgba(36, 61, 53, 0.16);
}
.overview-meaning,
.memory-face,
.cover-caption,
.syllable,
.mini-sound,
.hint-button,
.quick-words button,
.view-switch button,
.phonetic-tabs button,
.phonetic-grid button,
.recent-words button,
.book-list button,
.filter-row button,
.week-strip i,
.home-metrics {
  background-color: #fbfcf8;
}
.editor-tabs button,
.whole-line,
.generate-row input,
.editor-panel input,
.editor-panel textarea,
.import-dialog textarea,
.global-search input {
  background-color: #f5f8f3;
}
.stage header p,
.legend,
.whole-line span,
.spell-part small,
.branches small,
.memory-panel > header small,
.memory-note,
.practice-copy span,
.practice-feedback,
.phoneme-spellings,
.source-badge,
.sidebar-book span,
.sidebar-book small,
.plan-list span small,
.recent-words span,
.library-list small,
.setting-list label small {
  color: #526478;
}
.step small,
.syllable > span,
.syllable em,
.branches small,
.memory-note,
.source-badge,
.phoneme-spellings,
.sidebar-book span,
.sidebar-book small,
.plan-list span small,
.recent-words span,
.library-list small {
  font-size: 12px;
  line-height: 1.55;
}
.stage header p,
.legend,
.whole-line span,
.spell-part small,
.practice-copy span,
.practice-feedback,
.setting-list label small {
  font-size: 13px;
  line-height: 1.6;
}
.memory-cover img {
  object-fit: contain;
  object-position: center;
  background: #edf3f1;
}
.memory-panel.spelling-answer-hidden .cover-caption {
  justify-content: flex-end;
}
.memory-panel.spelling-answer-hidden .cover-caption strong,
.memory-panel.spelling-answer-hidden .memory-cover-fallback strong {
  display: none;
}
.memory-panel.spelling-answer-hidden
  .memory-flip:not(.flipped)
  .memory-flip-inner {
  transform: none !important;
}
.memory-panel.spelling-answer-hidden .memory-flip {
  cursor: pointer;
  pointer-events: auto;
}
.cover-caption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
.cover-caption span {
  max-width: none;
  font-size: 18px;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
}
@media (max-width: 860px) {
  .memory-flip {
    aspect-ratio: 7/10;
  }
}
@media (max-width: 680px) {
  .cover-caption {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .cover-caption span {
    font-size: 17px;
  }
}
@media print {
  body,
  .app-content,
  .preview-shell {
    background: #fff;
    background-image: none;
  }
}
/* The teaching workflow uses one consistent British RP voice. */
.accent-grid {
  grid-template-columns: 1fr;
}
.manual-dictation[hidden],
.letter-assembly[hidden] {
  display: none !important;
}
.steps {
  grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr;
  padding-inline: 24px;
}
.phoneme-trainer {
  min-height: 430px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 20px;
  padding: 28px 0 12px;
}
.phonics-word .sound-token {
  display: inline-block;
  padding: 0 1px;
  background: transparent;
}
.phonics-word .sound-token.consonant {
  color: #1688b8;
}
.phonics-word .sound-token.combination {
  color: #7656bb;
}
.phonics-word .sound-token.vowel {
  color: #d94b52;
}
.sound-color-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 12px;
}
.sound-color-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sound-color-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.sound-color-legend .consonant {
  background: #1688b8;
}
.sound-color-legend .combination {
  background: #7656bb;
}
.sound-color-legend .vowel {
  background: #d94b52;
}
.phoneme-tap-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(650px, 100%);
}
.phoneme-tap-grid button {
  min-width: 74px;
  min-height: 70px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  border: 1px solid #d5dde5;
  border-radius: 6px;
  background: #fff;
  padding: 9px 11px;
  cursor: pointer;
}
.phoneme-tap-grid button:hover,
.phoneme-tap-grid button.playing {
  border-color: #4f9bbd;
  background: #f3fafc;
}
.phoneme-tap-grid strong {
  font: 800 22px Arial;
}
.phoneme-tap-grid small {
  grid-column: 1;
  color: var(--muted);
  font: 17px Arial;
}
.phoneme-tap-grid b {
  grid-row: 1/3;
  grid-column: 2;
  color: var(--blue);
}
.reference-follow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 0 auto 22px;
  padding: 12px 16px;
  background: #f4f8f6;
  border: 1px solid #d6e4de;
  border-radius: 6px;
  width: max-content;
  max-width: 100%;
}
.reference-follow div {
  display: grid;
  gap: 3px;
}
.reference-follow span {
  color: var(--muted);
  font-size: 11px;
}
.assembly-practice,
.letter-assembly {
  min-height: 390px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 26px;
  padding: 28px 0;
}
.assembly-sound {
  width: 52px;
  height: 52px;
  background: var(--blue);
  color: #fff;
  border: 0;
}
.assembly-slots {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-height: 68px;
}
.assembly-slot {
  min-width: 54px;
  height: 62px;
  display: grid;
  place-items: center;
  border-bottom: 3px solid #718092;
  color: var(--ink);
  font: 800 28px Arial;
}
.assembly-slot.empty {
  color: transparent;
}
.assembly-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.assembly-bank button {
  min-width: 72px;
  height: 48px;
  border: 1px solid #ced8e1;
  border-radius: 5px;
  background: #fff;
  color: #4e5f72;
  font: 800 20px Arial;
  cursor: pointer;
}
.assembly-bank button:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.assembly-bank button:disabled {
  opacity: 0.28;
  cursor: default;
}
.next-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.dictation-levels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 0 0;
}
.dictation-levels span {
  color: #a2adb8;
  font-size: 12px;
  font-weight: 700;
}
.dictation-levels span.active {
  color: var(--green);
}
.dictation-levels i {
  width: 52px;
  border-top: 2px solid #d5dde4;
}
.letter-slots {
  gap: 3px;
}
.letter-slots .assembly-slot {
  min-width: 34px;
  height: 52px;
  font-size: 23px;
}
.letter-bank button {
  min-width: 45px;
}
.manual-dictation {
  min-height: 390px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
}
.manual-dictation label {
  display: grid;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.manual-dictation input {
  width: min(520px, 72vw);
  height: 76px;
  border: 0;
  border-bottom: 3px solid #647487;
  background: transparent;
  outline: 0;
  text-align: center;
  font: 800 44px Arial;
  text-transform: lowercase;
}
.manual-dictation input:focus {
  border-bottom-color: var(--blue);
}
.manual-dictation input.correct {
  border-color: var(--green);
  color: var(--green);
}
.manual-dictation input.wrong {
  border-color: #d74e45;
  color: #d74e45;
}
@media (max-width: 680px) {
  .steps {
    grid-template-columns: 1fr 8px 1fr 8px 1fr 8px 1fr;
    padding-inline: 5px;
  }
  .step {
    grid-template-columns: 25px 1fr;
  }
  .step > b {
    width: 25px;
    height: 25px;
  }
  .step strong {
    font-size: 12px;
  }
  .phoneme-trainer {
    min-height: 360px;
  }
  .phonics-word {
    font-size: 48px;
  }
  .phoneme-tap-grid button {
    min-width: 64px;
  }
  .assembly-slot {
    min-width: 42px;
    font-size: 23px;
  }
  .letter-slots .assembly-slot {
    min-width: 26px;
  }
  .manual-dictation input {
    width: 82vw;
    font-size: 34px;
  }
}
.blend-overview {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 30px 10px 22px;
  border-bottom: 1px solid var(--line);
}
.blend-overview .word-display {
  font-size: 62px;
}
.blend-meaning {
  max-width: 760px;
  padding: 6px 18px 9px;
  border-bottom: 3px solid #b9d8cc;
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}
.blend-overview .dual-ipa { gap: 8px; }
.blend-overview .ipa-button { gap: 8px; min-height: 42px; padding: 7px 11px; }
.blend-overview .ipa-button strong { font-size: 16px; }
.blend-overview .ipa-button span { padding: 2px 4px; }
.actual-syllable {
  display: inline-block;
  transform-origin: center bottom;
}
.actual-syllable.playing {
  animation: syllable-speak 0.52s ease-in-out infinite alternate;
  filter: drop-shadow(0 5px 8px rgba(24, 107, 146, 0.22));
}
.syllable-color-0 {
  color: #1688b8;
}
.syllable-color-1 {
  color: #d94b52;
}
.syllable-color-2 {
  color: #23856d;
}
.syllable-color-3 {
  color: #7656bb;
}
.blend-syllable-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}
.blend-syllable-strip button {
  min-width: 112px;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #d5dde5;
  border-radius: 5px;
  background: #fff;
  padding: 7px 11px;
  cursor: pointer;
}
.blend-syllable-strip button.playing {
  border-color: #4f9bbd;
  background: #edf8fc;
  box-shadow: 0 0 0 3px rgba(79, 155, 189, 0.12);
}
.blend-syllable-strip strong {
  font: 800 20px Arial;
}
.blend-syllable-strip small {
  grid-column: 1;
  color: var(--muted);
  font: 16px Arial;
}
.colored-whole-ipa { display: flex; align-items: center; gap: 0; }
.colored-whole-ipa i { color: #718096; font-style: normal; }
.colored-whole-ipa .ipa-consonant { color: #1688b8; }
.colored-whole-ipa .ipa-vowel { color: #d94b52; }
.blend-syllable-strip b {
  grid-row: 1/3;
  grid-column: 2;
  color: var(--blue);
}
.blend-syllable-strip .blend-whole-word {
  border-color: #9dc6e7;
  background: #f2f8fd;
}
@keyframes syllable-speak {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-5px) scale(1.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .actual-syllable.playing {
    animation: none;
    text-decoration: underline;
    text-decoration-thickness: 4px;
    text-underline-offset: 7px;
  }
}
#stage2 .syllable-summary {
  margin-top: 18px;
}
#stage2 .syllable-board {
  min-height: 0;
  align-items: stretch;
  gap: 12px;
  padding: 18px 0 22px;
}
#stage2 .syllable {
  width: auto;
  height: auto;
  min-height: 140px;
  padding: 24px 15px 34px;
}
#stage2 .syllable strong {
  font-size: 42px;
}
#stage2 .syllable em {
  max-width: 240px;
}
#stage2 .whole-line {
  margin-top: 18px;
}
@media (max-width: 680px) {
  .blend-overview .word-display {
    font-size: 48px;
  }
  .blend-meaning {
    font-size: 19px;
  }
  .blend-syllable-strip button {
    min-width: 96px;
  }
  .blend-syllable-strip {
    gap: 5px;
  }
  #stage2 .syllable-board {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
  #stage2 .syllable-board .plus {
    display: none;
  }
}
@media (max-width: 680px) {
  .blend-meaning { padding-inline: 8px; font-size: 24px; }
  .blend-overview .dual-ipa { width: 100%; grid-template-columns: 1fr 1fr; }
  .blend-overview .ipa-button { min-width: 0; padding-inline: 7px; }
  .blend-overview .ipa-button strong { font-size: 14px; }
}
.phonics-word .sound-token {
  transform-origin: center bottom;
}
.phonics-word .sound-token.playing {
  animation: syllable-speak 0.52s ease-in-out infinite alternate;
  filter: drop-shadow(0 5px 8px rgba(24, 107, 146, 0.22));
}
.quick-words[hidden] {
  display: none !important;
}
.current-sound-summary {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #d8e2dd;
  border-radius: 6px;
  background: #f7faf7;
}
.current-sound-summary > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 11px;
}
.current-sound-summary > header span {
  color: var(--muted);
  font-size: 12px;
}
.current-sound-summary > header strong {
  font: 800 17px Arial;
  color: var(--ink);
}
#currentSoundGroups {
  display: grid;
  gap: 8px;
}
.current-sound-group {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}
.current-sound-group h3 {
  margin: 0;
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
}
.current-sound-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.current-sound-group button {
  min-width: 72px;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #cbd8df;
  border-radius: 5px;
  background: #fff;
  padding: 5px 8px;
  cursor: pointer;
}
.current-sound-group button:hover,
.current-sound-group button.playing {
  border-color: #4f9bbd;
  background: #edf8fc;
}
.current-sound-group button strong {
  font: 800 17px Arial;
}
.current-sound-group button small {
  grid-column: 1;
  color: var(--muted);
  font: 12px Arial;
}
.current-sound-group button b {
  grid-row: 1/3;
  grid-column: 2;
  color: var(--blue);
  font-size: 11px;
}
.current-sound-group.consonant h3 {
  color: #1688b8;
}
.current-sound-group.vowel h3 {
  color: #d94b52;
}
.current-sound-group.combination h3 {
  color: #7656bb;
}
.current-sound-empty {
  padding: 9px;
  color: #a6afb5;
  font-size: 12px;
}
.current-sound-summary > header {
  display: block;
}
.current-sound-summary > header strong {
  font: 800 13px Arial;
  color: var(--ink);
}
.current-sound-group.combination button {
  border-color: #cbbbea;
  background: #f6f1fc;
}
.current-sound-group.combination button:hover,
.current-sound-group.combination button.playing {
  border-color: #7656bb;
  background: #eee5fa;
  box-shadow: 0 0 0 3px rgba(118, 86, 187, 0.12);
}
.current-sound-group.combination button strong,
.current-sound-group.combination button b {
  color: #7656bb;
}
.learning-audio-controls {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 5px 7px;
  border: 1px solid #d4dfda;
  border-radius: 7px;
  background: #f5f8f6;
  box-shadow: 0 3px 10px rgba(31, 65, 52, 0.07);
}
body[data-current-view="lesson"] .learning-audio-controls {
  display: flex;
}
.audio-control-group {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
}
.audio-control-group > span {
  color: #77847f;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.voice-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  border: 1px solid #b8d0c7;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}
.header-rate-switch {
  grid-template-columns: repeat(3, minmax(48px, 1fr));
}
.rate-picker {
  position: relative;
}
.rate-picker summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #b8d0c7;
  border-radius: 5px;
  background: #fff;
  color: #62736d;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.rate-picker summary::-webkit-details-marker {
  display: none;
}
.rate-picker summary span {
  color: #77847f;
  font-size: 10px;
}
.rate-picker summary strong {
  color: var(--green);
}
.rate-picker summary i {
  font-style: normal;
  transition: transform .18s ease;
}
.rate-picker[open] summary i {
  transform: rotate(180deg);
}
.rate-picker .header-rate-switch {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: 174px;
  box-shadow: 0 8px 22px rgba(31, 65, 52, .16);
}
.header-auto-reading {
  min-height: 32px;
  flex: 0 0 auto;
}
.voice-switch button {
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #62736d;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.voice-switch button + button {
  border-left: 1px solid #d2ded9;
}
.voice-switch button.active {
  background: var(--green);
  color: #fff;
}
.header-voice-switch {
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  body[data-current-view="lesson"] .learning-audio-controls {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .workbench-header:has(.learning-audio-controls) {
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    padding-block: 8px;
  }
  .app-shell {
    min-height: calc(100vh - 66px);
  }
}
@media (max-width: 560px) {
  body[data-current-view="lesson"] .learning-audio-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .audio-control-group {
    grid-template-columns: 62px 1fr;
  }
  .voice-switch button {
    height: 32px;
  }
}
.assembly-slot {
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  cursor: pointer;
}
.assembly-slot:disabled {
  opacity: 1;
  cursor: default;
}
.assembly-slot:not(.empty):hover,
.assembly-slot.playing {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.soft-keyboard {
  width: min(680px, 88vw);
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #d7e0e7;
  border-radius: 7px;
  background: #f3f6f4;
  box-shadow: 0 5px 16px rgba(26, 49, 70, 0.06);
}
.soft-key-row {
  display: flex;
  justify-content: center;
  gap: 7px;
}
.soft-key-row button {
  width: 52px;
  height: 46px;
  border: 1px solid #cbd6dd;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: 700 20px Arial;
  text-transform: lowercase;
  cursor: pointer;
  box-shadow: 0 2px 0 #c5ced5;
}
.soft-key-row button:hover,
.soft-key-row button:focus-visible {
  border-color: var(--blue);
  color: var(--blue);
  background: #f4faff;
  outline: 0;
}
.soft-key-row button:active {
  transform: translateY(2px);
  box-shadow: none;
}
.soft-key-row .soft-key-action {
  width: 68px;
  color: #526478;
  font:
    700 13px "Microsoft YaHei",
    sans-serif;
}
.soft-key-row .soft-key-delete {
  font: 700 22px Arial;
}
.soft-key-row .soft-key-symbol {
  width: 44px;
  color: var(--green);
  font-size: 22px;
}
.special-dictation-keyboard {
  width: min(680px, 100%);
  margin-inline: auto;
}
.special-training-card > header > div {
  display: grid;
  grid-template-columns: 1fr auto auto auto !important;
  align-items: center;
  gap: 20px;
}
.special-training-card #specialStreak {
  color: #c26d12;
  font-size: 13px;
}
.special-training-card #specialTimer,
.assessment-progress #assessmentTimer {
  color: #526478;
  font: 800 14px/1 Arial;
  font-variant-numeric: tabular-nums;
}
.special-result #specialResultScore {
  display: none;
}
.assessment-view {
  width: min(1050px, 100%);
  margin: 0 auto;
  padding: 30px 34px 60px;
}
.assessment-card {
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 620px;
  padding: 28px;
  border-color: #d5dfda;
  border-radius: 8px;
  background: #f7faf7;
  box-shadow: 0 16px 38px rgba(31, 65, 52, 0.1);
}
.assessment-companion {
  min-height: 74px;
  display: grid;
  grid-template-columns: 58px auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: stretch;
  gap: 3px 14px;
  padding: 10px 16px;
  border-right: 0;
  border-bottom: 1px solid #dce5df;
  text-align: left;
}
.assessment-companion img {
  grid-row: 1/3;
  width: 52px;
  height: 52px;
  margin: 0;
}
.assessment-companion span,
.assessment-companion strong {
  margin: 0;
}
.assessment-companion p {
  grid-column: 3;
  grid-row: 1/3;
  justify-self: end;
  max-width: 430px;
  margin: 0;
  text-align: right;
}
.assessment-stage {
  min-height: 490px;
  background: #f7faf7;
}
.assessment-options button {
  min-height: 68px;
  border-color: #d3ddd8;
  border-radius: 7px;
  background: #edf2ef;
  box-shadow:
    4px 4px 8px #ccd6d1,
    -4px -4px 8px #fff;
  font-weight: 800;
}
.assessment-options button:hover {
  transform: translateY(-1px);
  box-shadow:
    5px 6px 10px #c9d3ce,
    -4px -4px 8px #fff;
}
@media (max-width: 680px) {
  .assessment-view {
    padding: 22px 12px 42px;
  }
  .assessment-companion {
    display: none;
  }
  .assessment-card {
    padding: 20px 12px;
  }
  .assessment-options {
    grid-template-columns: 1fr;
  }
}
.test-history-table {
  overflow: auto;
}
.test-history-head,
.test-history-table article {
  min-width: 820px;
  display: grid;
  grid-template-columns: 150px 130px minmax(230px, 1fr) 80px 80px 80px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.test-history-head {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.test-history-table article {
  border-bottom: 1px solid #e2e9e5;
}
.test-history-table article time,
.test-history-table article span {
  color: var(--muted);
  font-size: 12px;
}
.test-history-table article b {
  font-size: 13px;
}
.test-history-table article b small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
}
.test-history-table article strong {
  color: var(--green);
  font-size: 18px;
}

/* Unified dimensional surfaces: interactive and informational blocks share one visual language. */
:root {
  --surface: #eef3f0;
  --surface-line: #d4dfd9;
  --surface-shadow: 7px 8px 16px rgba(58, 79, 70, 0.18);
  --surface-highlight: -6px -6px 13px rgba(255, 255, 255, 0.92);
  --control-radius: 7px;
  --control-speed: 150ms;
  --control-focus: 0 0 0 3px rgba(35, 133, 109, 0.2);
  --control-raised:
    4px 4px 8px rgba(58, 79, 70, 0.16), -4px -4px 8px rgba(255, 255, 255, 0.88);
  --control-primary: 0 5px 12px rgba(35, 133, 109, 0.2);
  --control-pressed:
    inset 3px 3px 6px rgba(75, 108, 94, 0.22),
    inset -3px -3px 6px rgba(255, 255, 255, 0.85);
}

/* Global button system: roles keep their shape, while interaction behavior stays consistent. */
button {
  font-family: inherit;
  letter-spacing: 0;
  transition:
    background-color var(--control-speed) ease,
    border-color var(--control-speed) ease,
    color var(--control-speed) ease,
    box-shadow var(--control-speed) ease,
    transform var(--control-speed) ease,
    opacity var(--control-speed) ease;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 0;
  box-shadow: var(--control-focus) !important;
}
button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}
button:disabled {
  opacity: 0.46;
  cursor: not-allowed !important;
  box-shadow: none !important;
}
.continue-learning,
.unit-continue,
.check-button,
.next-button,
#confirmImportButton,
[data-special-submit],
[data-assessment-next] {
  border-radius: var(--control-radius);
  box-shadow: var(--control-primary);
}
.change-book,
.unit-restart,
.hint-button,
.back-home,
[data-return-home] {
  border-radius: var(--control-radius);
}
.main-sidebar nav button,
.grade-menu button,
.edition-menu button,
.volume-menu button,
.filter-row button,
.view-switch button {
  box-shadow: var(--control-raised);
}
.main-sidebar nav button.active,
.grade-menu button.active,
.edition-menu button.active,
.volume-menu button.active,
.filter-row button.active,
.view-switch button.active {
  box-shadow: var(--control-pressed) !important;
}
.tool-icon,
.sound-button,
.mini-sound,
.special-audio-button {
  transition-duration: var(--control-speed);
}
.tool-icon:not(:disabled):hover,
.sound-button:not(:disabled):hover,
.mini-sound:not(:disabled):hover,
.special-audio-button:not(:disabled):hover {
  border-color: #79aa9a;
  color: var(--green);
  box-shadow: 0 3px 8px rgba(49, 77, 66, 0.14);
}
.unit-list .unit-card {
  transition:
    background-color var(--control-speed) ease,
    border-color var(--control-speed) ease,
    box-shadow var(--control-speed) ease;
}
.unit-list .unit-card .unit-restart {
  border: 1px solid #8ab3a5;
  background: #fff;
  color: var(--green);
  box-shadow: none;
}
.unit-list .unit-card .unit-continue {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: var(--control-primary);
}
.unit-list .unit-card .unit-restart:not(:disabled):hover {
  background: #f2f8f5;
  box-shadow: 0 3px 8px rgba(49, 77, 66, 0.12);
}
.unit-list .unit-card .unit-continue:not(:disabled):hover {
  background: #176f5b;
  border-color: #176f5b;
  box-shadow: 0 6px 14px rgba(35, 133, 109, 0.24);
}

.pronunciation-bridge {
  width: min(760px, calc(100% - 20px));
  margin: 22px auto 8px;
  padding: 18px 20px;
  border: 1px solid #b9d5ca;
  border-left: 4px solid var(--green);
  border-radius: 7px;
  background: #f2f8f5;
}
.pronunciation-bridge[hidden] { display: none !important; }
.pronunciation-bridge > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.pronunciation-bridge > header span { color: var(--green); font-size: 11px; font-weight: 900; }
.pronunciation-bridge > header h3 { margin: 4px 0 0; font-size: 17px; }
.pronunciation-bridge > header button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 6px; background: #23856d; color: #fff; font-weight: 800; cursor: pointer; }
.pronunciation-bridge-core { display: grid; grid-template-columns: 150px 1fr; gap: 18px; margin-top: 16px; }
.pronunciation-bridge [hidden] { display: none !important; }
.bridge-cue, .bridge-target { padding: 13px 15px; border: 1px solid #d4e3dc; border-radius: 6px; background: #fff; }
.bridge-cue { display: grid; justify-items: center; align-content: center; }
.bridge-cue span, .bridge-target > span { color: #687c74; font-size: 11px; font-weight: 800; }
.bridge-cue strong { color: #b4514b; font-size: 30px; }
.bridge-cue small { margin-top: 2px; color: #7c8b85; font: 13px Arial; }
.bridge-target strong { display: block; margin: 5px 0; color: #18324a; font: 800 25px Arial; }
.bridge-target p { margin: 0; color: #526a61; font-size: 12px; line-height: 1.6; }
.bridge-learning-point { margin: 14px 0 10px; }
.bridge-learning-point > span,
.bridge-blocks-title { display: block; margin: 0 0 6px; color: #526a61; font-size: 11px; font-weight: 900; }
.bridge-learning-point p { margin: 0; }
.bridge-correction { padding: 10px 12px; border-left: 3px solid #d59b3d; background: #fff8e8; color: #77551c; font-size: 13px; line-height: 1.65; }
.bridge-blocks-title { margin-top: 12px; }
.bridge-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.bridge-blocks button { display: grid; grid-template-columns: 48px 58px 1fr 16px; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #d6e2dc; border-radius: 6px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.bridge-blocks button strong { color: var(--green); font: 800 18px Arial; }
.bridge-blocks button strong s { color: #9ba8a3; text-decoration: line-through 2px #c45f55; text-decoration-thickness: 2px; }
.bridge-letter-alert { padding: 0 1px; border-radius: 3px; background: #ffe0dc; color: #c43f35; font-weight: 900; }
.bridge-blocks button b { color: #18324a; font: 800 16px Arial; }
.bridge-blocks button span, .bridge-articulation { color: #536a61; font-size: 12px; line-height: 1.6; }
.bridge-teacher-view { padding-top: 11px; border-top: 1px solid #d8e5df; }
.bridge-blocks button i { color: #1976d2; font-style: normal; }
.pronunciation-bridge.irregular-folding { border-left-color: #1976d2; background: #f2f7fb; }
.pronunciation-bridge.irregular-folding > header span { color: #176da8; }
.pronunciation-bridge.bridge-unavailable { border-left-color: #a9b7b1; background: #f7f9f8; }
.pronunciation-bridge.bridge-unavailable > header span { color: #61736c; }
.pronunciation-bridge.bridge-unavailable .bridge-correction { margin-top: 16px; color: #40534c; }
.pronunciation-bridge.bridge-unavailable .bridge-articulation { color: #718079; }
.pronunciation-bridge.bridge-unavailable .bridge-student-view > span,
.pronunciation-bridge.bridge-unavailable .bridge-blocks-title,
.pronunciation-bridge.bridge-unavailable .bridge-teacher-view { display: none; }
.pronunciation-bridge.bridge-unavailable .bridge-sources em { color: #718079; font-style: normal; }
.bridge-articulation { margin: 10px 0 0; }
.bridge-narration { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; margin-top: 10px; padding: 0 11px; border: 1px solid #b9d5ca; border-radius: 18px; background: #fff; color: #176b57; font-size: 12px; font-weight: 800; cursor: pointer; }
.bridge-narration:hover, .bridge-narration.playing { border-color: #23856d; background: #e7f4ee; }
.bridge-narration.paused { border-color: #d19a3b; background: #fff8e8; color: #855b0b; }
.bridge-narration span { font-size: 15px; }
.bridge-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #d6e2dc; font-size: 11px; }
.bridge-sources span { color: #687c74; font-weight: 800; }
.bridge-sources a { color: #176da8; text-decoration: none; }
@media (max-width: 680px) {
  .pronunciation-bridge { width: 100%; padding: 15px 13px; }
  .pronunciation-bridge > header { align-items: flex-start; }
  .pronunciation-bridge-core { grid-template-columns: 105px 1fr; gap: 8px; }
  .bridge-blocks { grid-template-columns: 1fr; }
  .bridge-blocks button { grid-template-columns: 44px 54px 1fr 14px; }
}
.report-summary {
  gap: 14px;
  margin: 28px 0 38px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.report-summary::before,
.report-summary::after {
  display: none;
}
.report-summary > div {
  min-height: 136px;
  align-content: center;
  padding: 22px 16px;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--surface-shadow), var(--surface-highlight);
}
.report-summary > div + div {
  border-left: 1px solid var(--surface-line);
}
.report-summary > div::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 14px;
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: #1688b8;
  box-shadow: 0 5px 12px rgba(22, 136, 184, 0.24);
}
.report-summary > div:nth-child(2)::before {
  background: #ef8c43;
}
.report-summary > div:nth-child(3)::before {
  background: #29a277;
}
.report-summary > div:nth-child(4)::before {
  background: #4f7fc4;
}
.report-summary > div:nth-child(5)::before {
  background: #d25d58;
}
.report-summary > div::after {
  bottom: 14px;
  width: 28px;
  border-top: 3px solid var(--ai-signal);
}
.report-summary strong {
  font-size: 36px;
  text-shadow: 0 1px #fff;
}
.report-grid {
  gap: 22px;
}
.report-section > header {
  padding: 0 4px;
}
.report-section > header + div,
.report-section > #reportUnits,
.report-section > #reportAssessmentRecords {
  padding: 18px;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--surface-shadow), var(--surface-highlight);
}
.score-compare-grid article,
.unit-detail-scores article,
.assessment-scores article,
.assessment-comparison,
.report-empty {
  border-color: #d0dcd6;
  border-radius: 7px;
  background: #f6f9f7;
  box-shadow:
    4px 5px 10px rgba(59, 80, 71, 0.14),
    -4px -4px 9px rgba(255, 255, 255, 0.9);
}
.status-distribution > button,
.error-breakdown > button,
.weak-word-list button,
.report-unit-row,
.test-history-table article {
  margin-bottom: 10px;
  border: 1px solid #d3ded8 !important;
  border-radius: 7px !important;
  background: #edf2ef !important;
  box-shadow:
    4px 5px 10px rgba(58, 79, 70, 0.15),
    -4px -4px 9px rgba(255, 255, 255, 0.9);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}
.status-distribution > button:hover,
.error-breakdown > button:hover,
.weak-word-list button:hover,
.report-unit-row:hover {
  transform: translateY(-2px);
  box-shadow:
    6px 7px 13px rgba(58, 79, 70, 0.2),
    -5px -5px 10px #fff;
}
.report-table {
  gap: 9px;
  border-top: 0;
}
.report-table-head {
  border-bottom: 0;
}
.report-table > .report-unit-detail {
  margin: -5px 8px 10px;
  width: auto;
  border: 1px solid #c9d9d3;
  border-radius: 0 0 7px 7px;
  background: #e7f0ec;
  box-shadow: inset 3px 3px 8px rgba(84, 108, 98, 0.11);
}
.test-history-table article {
  border-bottom: 1px solid #d3ded8;
}
.home-metrics {
  gap: 14px;
  border: 0;
  background: transparent;
}
.home-metrics > div {
  min-height: 98px;
  border: 1px solid var(--surface-line) !important;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--surface-shadow), var(--surface-highlight);
}
.home-metrics > div:nth-child(1) {
  border-top: 5px solid #1688b8 !important;
}
.home-metrics > div:nth-child(2) {
  border-top: 5px solid #ef8c43 !important;
}
.home-metrics > div:nth-child(3) {
  border-top: 5px solid #29a277 !important;
}
.home-metrics > div:nth-child(4) {
  border-top: 5px solid #4f7fc4 !important;
}
.plan-list {
  gap: 10px;
}
.plan-list > div,
.recent-words button {
  border: 1px solid var(--surface-line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow:
    4px 5px 10px rgba(58, 79, 70, 0.14),
    -4px -4px 9px #fff;
}
.plan-list > div {
  padding: 15px 14px;
}
.recent-words {
  gap: 10px;
}
.selected-book,
.wordbook-panel,
.wordbook-toolbar,
.review-group-actions,
.empty-state,
.setting-list label,
.current-sound-summary {
  border: 1px solid var(--surface-line) !important;
  border-radius: 8px !important;
  background: var(--surface) !important;
  box-shadow: var(--surface-shadow), var(--surface-highlight);
}
.book-list button,
.wordbook-list article,
.review-queue article,
.review-queue button,
.review-metrics article,
.review-mode-picker button,
.review-nine-grid button,
.review-batch-tabs button,
.special-training-selectors section {
  border: 1px solid var(--surface-line) !important;
  border-radius: 8px !important;
  background: var(--surface) !important;
  box-shadow:
    5px 6px 12px rgba(58, 79, 70, 0.16),
    -5px -5px 10px #fff !important;
}
.book-list,
.unit-list,
.wordbook-list,
.review-queue,
.review-metrics {
  gap: 12px;
}
.setting-list {
  gap: 14px;
}
.setting-list label {
  padding: 18px;
}
.accent-card,
.phonetic-grid button,
.syllable,
.blend-syllable-strip button,
.spell-choice,
.letter-choice,
.soft-key-row button {
  box-shadow:
    3px 4px 8px rgba(57, 77, 69, 0.14),
    -3px -3px 7px rgba(255, 255, 255, 0.9);
}
@media (max-width: 820px) {
  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-summary > div {
    min-height: 118px;
  }
  .report-section > header + div,
  .report-section > #reportUnits,
  .report-section > #reportAssessmentRecords {
    padding: 12px;
  }
}
.test-history-head {
  margin-bottom: 12px;
  border: 1px solid #b9d0c7;
  border-radius: 7px;
  background: #dfece7;
  color: #294e45;
  box-shadow: inset 0 -2px 0 rgba(35, 133, 109, 0.12);
}
.test-history-head > span,
.test-history-table article > * {
  min-width: 0;
  padding: 4px 12px;
}
.test-history-head > span + span,
.test-history-table article > * + * {
  border-left: 1px solid #c7d8d1;
}
.test-history-table article:nth-child(odd) {
  background: #e8f0ec !important;
}
.test-history-table article:nth-child(even) {
  background: #f2f5f3 !important;
}
.test-history-table article > strong {
  align-self: stretch;
  display: grid;
  place-items: center;
  margin: -4px -8px;
  padding: 8px;
  border: 1px solid #acd2c2;
  border-radius: 6px;
  background: #dff1e9;
}
.test-history-table article > b {
  color: #183a32;
}
.test-history-table article > span:nth-of-type(2),
.test-history-table article > span:nth-of-type(3) {
  text-align: center;
}
.report-section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.report-section-title-row h2 {
  margin: 0;
}
.report-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid #9fc5b9;
  border-radius: 5px;
  background: #e5f1ed;
  color: #176d5b;
  box-shadow: 0 2px 0 #b6d2c9;
  font-size: 12px;
  font-weight: 800;
}
.report-inline-toggle:hover {
  background: #d8ebe5;
}
.report-inline-toggle b {
  padding: 1px 5px;
  border-radius: 4px;
  background: #c9e3da;
  color: #185e50;
  font-size: 11px;
}
.report-inline-toggle i {
  font-style: normal;
  transition: transform 0.18s ease;
}
.report-inline-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}
.error-breakdown {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.error-breakdown > button {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 12px;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  text-align: left;
}
.error-breakdown > button > span {
  color: #29473f;
  font-size: 16px;
  font-weight: 800;
}
.error-breakdown > button > strong {
  min-width: 58px;
  color: #1688b8;
  font: 900 30px/1 Arial;
  text-align: right;
}
.error-breakdown > button > i {
  grid-column: 1/3;
  width: 100%;
  height: 12px;
  border: 1px solid #d0ddd7;
  border-radius: 6px;
  background: #dce6e1;
  box-shadow: inset 2px 2px 4px rgba(61, 83, 74, 0.14);
}
.error-breakdown > button > i > b {
  height: 100%;
  border-radius: 5px;
  background: #1688b8;
  box-shadow: 0 2px 7px rgba(22, 136, 184, 0.3);
}
.error-breakdown > button:nth-child(2) > strong,
.error-breakdown > button:nth-child(2) > i > b {
  color: #ef8c43;
  background: #ef8c43;
}
.error-breakdown > button:nth-child(3) > strong,
.error-breakdown > button:nth-child(3) > i > b {
  color: #8a65c7;
  background: #8a65c7;
}
.error-breakdown > button:nth-child(4) > strong,
.error-breakdown > button:nth-child(4) > i > b {
  color: #d25d58;
  background: #d25d58;
}
.error-breakdown > button:nth-child(5) > strong,
.error-breakdown > button:nth-child(5) > i > b {
  color: #29a277;
  background: #29a277;
}
@media (max-width: 680px) {
  .error-breakdown {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .soft-keyboard {
    width: calc(100vw - 42px);
    gap: 6px;
    padding: 9px 7px;
  }
  .soft-key-row {
    gap: 4px;
  }
  .soft-key-row button {
    width: calc((100vw - 88px) / 10);
    max-width: 40px;
    min-width: 24px;
    height: 42px;
    font-size: 17px;
  }
  .soft-key-row .soft-key-action {
    width: 44px;
    min-width: 40px;
    font-size: 11px;
  }
  .soft-key-row .soft-key-symbol {
    width: 32px;
    min-width: 28px;
    font-size: 19px;
  }
  .soft-key-row .soft-key-delete {
    font-size: 19px;
  }
}
.assessment-view {
  padding: 34px max(24px, calc((100% - 920px) / 2)) 60px;
}
.assessment-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}
.assessment-header span,
.assessment-mode {
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
}
.assessment-header h1 {
  margin: 8px 0 5px;
  font-size: 30px;
}
.assessment-header p {
  margin: 0;
  color: var(--muted);
}
.assessment-progress {
  width: 180px;
  display: grid;
  gap: 8px;
  text-align: right;
}
.assessment-progress progress {
  width: 100%;
  accent-color: var(--green);
}
.assessment-card {
  min-height: 560px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf6;
  box-shadow: 0 14px 34px rgba(31, 65, 52, 0.09);
}
.assessment-card > section {
  width: min(680px, 100%);
  display: grid;
  justify-items: center;
  gap: 24px;
}
.assessment-word {
  font: 800 58px Arial;
}
.assessment-options {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.assessment-options button {
  min-height: 66px;
  border: 1px solid #cbd7d0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.assessment-options button:hover {
  border-color: var(--green);
  background: #eef7f2;
}
.assessment-audio {
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.assessment-dictation-meaning {
  max-width: 90%;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.4;
  text-align: center;
}
.assessment-card input {
  width: min(520px, 90%);
  height: 72px;
  border: 0;
  border-bottom: 3px solid #647487;
  background: transparent;
  text-align: center;
  outline: 0;
  font: 800 42px Arial;
}
.assessment-submit {
  min-width: 150px;
  padding: 13px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.assessment-keyboard {
  width: min(650px, 100%);
  display: grid;
  gap: 6px;
}
.assessment-keyboard .soft-key-row button {
  height: 42px;
}
.assessment-feedback {
  min-height: 24px;
  color: #d24c43;
  font-weight: 700;
}
.assessment-scores {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.assessment-scores article,
.assessment-comparison {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: center;
}
.assessment-scores strong {
  display: block;
  font-size: 28px;
  color: var(--green);
}
.assessment-scores span {
  color: var(--muted);
  font-size: 12px;
}
.assessment-comparison {
  width: 100%;
  line-height: 1.8;
}
.pretest-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #e5bd66;
  border-radius: 6px;
  background: #fff7df;
  color: #7e5711;
}
.pretest-warning strong {
  flex: 0 0 auto;
}
.pretest-warning span {
  font-size: 13px;
}
.review-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0;
}
.review-metrics article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.review-metrics strong,
.review-metrics span {
  display: block;
}
.review-metrics strong {
  font-size: 25px;
  color: var(--green);
}
.review-metrics span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.review-queue {
  display: grid;
  gap: 8px;
}
.review-queue button {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.review-queue b {
  font: 800 19px Arial;
}
.review-queue span {
  color: var(--muted);
}
.review-queue em {
  color: #c76a20;
  font-style: normal;
  font-size: 12px;
}
.review-plan-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #cddfd7;
  background: #f2f8f5;
  color: var(--muted);
  font-size: 12px;
}
.review-plan-note strong {
  flex: 0 0 auto;
  color: var(--green);
}
.review-nine-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.review-nine-grid button {
  min-height: 82px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.review-nine-grid button.active {
  background: #e7f4ee;
  border-color: var(--green);
}
.review-nine-grid b {
  font: 800 24px Arial;
  color: var(--green);
}
.review-nine-grid span,
.review-nine-grid em {
  font-size: 10px;
  font-style: normal;
  color: var(--muted);
}
.review-group-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 12px;
}
.review-group-actions button {
  padding: 10px 18px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.review-group-actions button:disabled {
  opacity: 0.4;
}
.review-item {
  display: grid;
  grid-template-columns: 120px minmax(140px, 1fr) 130px 96px;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.review-item em {
  color: #b76b25;
  font-style: normal;
  font-size: 12px;
}
.review-item button {
  display: block;
  padding: 9px 12px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.review-item button:hover {
  filter: brightness(0.94);
}
@media (max-width: 680px) {
  .assessment-view {
    padding: 22px 10px 40px;
  }
  .assessment-header {
    display: grid;
  }
  .assessment-progress {
    width: 100%;
    text-align: left;
  }
  .assessment-card {
    min-height: 520px;
    padding: 28px 12px;
  }
  .assessment-word {
    font-size: 46px;
  }
  .assessment-options {
    grid-template-columns: 1fr;
  }
  .assessment-scores,
  .review-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .review-plan-note {
    align-items: flex-start;
  }
  .review-nine-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .review-item {
    grid-template-columns: 1fr auto;
  }
  .review-item > span {
    grid-column: 1/3;
  }
  .review-item > em {
    grid-column: 1;
  }
  .review-item > button {
    grid-column: 2;
    grid-row: 2/4;
  }
  .pretest-warning {
    align-items: flex-start;
  }
}
.assessment-card > section[hidden] {
  display: none !important;
}
.assessment-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.assessment-forgot {
  min-width: 120px;
  padding: 12px 18px;
  border: 1px solid #bdc9c2;
  border-radius: 6px;
  background: #fff;
  color: #637168;
  font-weight: 700;
  cursor: pointer;
}
.assessment-forgot:hover {
  border-color: #b76b25;
  color: #9b571d;
  background: #fff9f2;
}
.assessment-options button.answer-correct,
.assessment-options button.answer-correct:disabled {
  border-color: #4f9e7b;
  background: #e5f4ec;
  color: #17654b;
  box-shadow: inset 0 0 0 2px rgba(79, 158, 123, 0.16);
}
.assessment-options button.answer-wrong,
.assessment-options button.answer-wrong:disabled {
  border-color: #d6a25b;
  background: #fff4df;
  color: #855515;
}
.assessment-options button:disabled {
  cursor: default;
  opacity: 1;
}
.assessment-feedback.is-correct {
  color: #21785d;
}
.assessment-feedback.is-wrong {
  color: #9a651f;
}
.assessment-card input.answer-correct {
  border-bottom-color: #4f9e7b;
  background: #eef8f3;
}
.assessment-card input.answer-wrong {
  border-bottom-color: #d6a25b;
  background: #fff8eb;
}
.assessment-card {
  grid-template-columns: 190px minmax(0, 1fr);
  place-items: stretch;
  align-content: stretch;
  gap: 34px;
  min-height: 590px;
}
.assessment-companion {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  border-right: 1px solid #dce5df;
  text-align: center;
}
.assessment-companion img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin-bottom: 22px;
  filter: drop-shadow(0 8px 12px rgba(31, 80, 61, 0.12));
}
.assessment-companion span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.assessment-companion strong {
  margin-top: 6px;
  font-size: 16px;
}
.assessment-companion p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.assessment-stage {
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
}
.assessment-stage > section {
  width: min(680px, 100%);
  display: grid;
  justify-items: center;
  gap: 24px;
}
.assessment-stage > section[hidden] {
  display: none !important;
}
.assessment-options button {
  grid-template-columns: 42px 1fr;
  align-items: center;
  text-align: left;
  padding: 12px 20px 12px 12px;
}
.assessment-options button i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf3ef;
  color: #567068;
  font: 800 14px Arial;
  font-style: normal;
}
.assessment-options button span {
  justify-self: center;
  padding-right: 34px;
}
.assessment-options button.answer-correct i {
  background: #4f9e7b;
  color: #fff;
}
.assessment-options button.answer-wrong i {
  background: #d6a25b;
  color: #fff;
}
@media (max-width: 820px) {
  .assessment-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .assessment-companion {
    min-height: auto;
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: 14px;
    border-right: 0;
    border-bottom: 1px solid #dce5df;
    text-align: left;
  }
  .assessment-companion img {
    grid-row: 1/4;
    width: 58px;
    height: 58px;
    margin: 0;
  }
  .assessment-companion p {
    margin: 5px 0 0;
  }
  .assessment-stage {
    padding-top: 18px;
  }
}
@media (max-width: 620px) {
  .assessment-companion {
    display: none;
  }
  .assessment-card {
    display: grid;
  }
  .assessment-options button span {
    padding-right: 0;
  }
}
.report-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 28px 0 34px;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}
.report-summary > div {
  display: grid;
  gap: 5px;
  padding: 22px;
  text-align: center;
}
.report-summary > div + div {
  border-left: 1px solid var(--line);
}
.report-summary strong {
  font: 800 31px Arial;
  color: var(--green);
}
.report-summary span {
  color: var(--muted);
  font-size: 12px;
}
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.report-section {
  border-top: 3px solid var(--green);
  padding-top: 15px;
}
.report-section > header span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.report-section > header h2 {
  margin: 4px 0 16px;
  font-size: 19px;
}
.report-empty {
  min-height: 130px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px dashed #cbd7d0;
  color: var(--muted);
  text-align: center;
}
.improvement-bars,
.error-breakdown,
.status-distribution {
  display: grid;
  gap: 14px;
}
.improvement-bars > div,
.error-breakdown > div {
  display: grid;
  grid-template-columns: 88px 1fr 52px;
  align-items: center;
  gap: 10px;
}
.improvement-bars i,
.error-breakdown i {
  height: 9px;
  overflow: hidden;
  border-radius: 2px;
  background: #e6ece8;
}
.improvement-bars i b,
.error-breakdown i b {
  display: block;
  height: 100%;
  background: var(--green);
}
.improvement-bars strong,
.error-breakdown strong {
  text-align: right;
}
.status-distribution > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
}
.status-distribution span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-distribution span i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d08d36;
}
.status-distribution span i.learning {
  background: var(--blue);
}
.status-distribution span i.stable {
  background: var(--green);
}
.status-distribution progress {
  grid-column: 1/3;
  width: 100%;
  height: 7px;
  accent-color: var(--green);
}
.report-units {
  margin-bottom: 32px;
}
.report-table {
  display: grid;
  border-top: 1px solid var(--line);
}
.report-table > div {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) repeat(4, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}
.report-table-head {
  color: var(--muted);
  font-size: 11px;
}
.report-table em {
  color: var(--green);
  font-style: normal;
  font-size: 12px;
}
.weak-word-list {
  display: grid;
}
.weak-word-list button {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.weak-word-list button:hover {
  background: #edf6f2;
}
.weak-word-list b {
  font: 800 17px Arial;
}
.weak-word-list span {
  color: var(--muted);
}
.weak-word-list em {
  color: #b76b25;
  font-style: normal;
  font-size: 11px;
}
.report-generated {
  text-align: right;
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 820px) {
  .report-summary {
    grid-template-columns: repeat(3, 1fr);
  }
  .report-summary > div:nth-child(4) {
    border-left: 0;
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
  .report-table > div {
    grid-template-columns: minmax(130px, 1.8fr) repeat(4, 1fr);
    font-size: 12px;
  }
}
@media (max-width: 620px) {
  .report-summary {
    grid-template-columns: 1fr 1fr;
  }
  .report-summary > div:nth-child(odd) {
    border-left: 0;
  }
  .report-table {
    overflow: auto;
  }
  .report-table > div {
    min-width: 620px;
  }
}

/* Learning report: clear score evidence with a restrained AI telemetry language. */
:root {
  --ai-cyan: #1688b8;
  --ai-cyan-soft: #e7f5f8;
  --ai-signal: #55c8c2;
}
.learning-report-view > header {
  position: relative;
  padding: 4px 0 18px 20px;
  border-left: 3px solid var(--ai-cyan);
}
.learning-report-view > header::after {
  display: none;
}
.report-summary {
  position: relative;
  border-color: #9fc5c7;
  background-color: rgba(245, 251, 248, 0.88);
  box-shadow: inset 0 3px var(--ai-cyan);
}
.report-summary::before,
.report-summary::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--ai-cyan);
  border-style: solid;
}
.report-summary::before {
  left: 0;
  top: 0;
  border-width: 2px 0 0 2px;
}
.report-summary::after {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
}
.report-summary strong {
  color: #176f79;
  font-variant-numeric: tabular-nums;
}
.report-summary > div {
  position: relative;
}
.report-summary > div::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 18px;
  border-top: 2px solid var(--ai-signal);
  transform: translateX(-50%);
}
.report-section {
  position: relative;
  border-top-color: var(--ai-cyan);
}
.report-section::before {
  content: "";
  position: absolute;
  right: 0;
  top: -6px;
  width: 9px;
  height: 9px;
  background: var(--ai-signal);
  box-shadow:
    -16px 0 #a7d9d7,
    -32px 0 #d1e8e6;
}
.report-section > header span {
  color: #167d86;
  letter-spacing: 0;
}
.report-section > header h2 {
  font-size: 21px;
}
.report-focus-unit {
  border-left: 1px solid #b6d4d5;
  padding-left: 16px;
}
.report-focus-unit > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.report-focus-unit > header span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #52727a;
  font-size: 11px;
}
.report-focus-unit > header span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ai-signal);
  box-shadow: 0 0 0 4px rgba(85, 200, 194, 0.14);
}
.report-focus-unit > header strong {
  font-size: 13px;
}
.score-compare-grid {
  display: grid;
  gap: 9px;
}
.score-compare-grid article {
  padding: 12px 13px;
  border: 1px solid #bed4d6;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.74);
  box-shadow: 3px 3px 0 rgba(22, 136, 184, 0.06);
}
.score-compare-grid article > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.score-compare-grid article > header span {
  color: #38566a;
  font-size: 12px;
  font-weight: 800;
}
.score-compare-grid article > header b {
  color: var(--green);
  font: 800 14px Arial;
}
.score-flow {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
  margin: 8px 0;
}
.score-flow > div {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.score-flow > div:last-child {
  justify-content: flex-end;
}
.score-flow small {
  color: var(--muted);
  font-size: 10px;
}
.score-flow strong {
  color: var(--ink);
  font: 800 27px Arial;
  font-variant-numeric: tabular-nums;
}
.score-flow > div:last-child strong {
  color: var(--ai-cyan);
}
.score-flow em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}
.score-flow > i {
  color: var(--ai-cyan);
  font-style: normal;
  text-align: center;
}
.score-signal {
  position: relative;
  height: 4px;
  background: #dbe6e5;
}
.score-signal span,
.score-signal b {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  background: #9eacae;
}
.score-signal b {
  top: 2px;
  background: var(--ai-cyan);
}
.report-table {
  border-top-color: #9fc5c7;
}
.report-table-head {
  padding: 0 14px;
}
.report-table > button.report-unit-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) repeat(4, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.report-unit-row:hover,
.report-unit-row[aria-expanded="true"] {
  background: #edf8f7;
}
.report-unit-row b {
  font-size: 15px;
}
.report-unit-row span,
.report-unit-row strong {
  font-variant-numeric: tabular-nums;
}
.report-unit-row strong {
  color: var(--ai-cyan);
}
.report-unit-row em {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--green);
  font-style: normal;
  font-size: 12px;
}
.report-unit-row em i {
  font: 700 17px Arial;
  transition: transform 0.2s;
}
.report-unit-row[aria-expanded="true"] em i {
  transform: rotate(180deg);
}
.report-table > .report-unit-detail {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 18px 22px;
  border-bottom: 1px solid #9fc5c7;
  background-color: #f1f8f6;
}
.report-table > .report-unit-detail[hidden] {
  display: none;
}
.unit-detail-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.unit-detail-scores article {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #c7dcda;
  background: #fbfdfb;
}
.unit-detail-scores article > span {
  grid-column: 1/4;
  color: #3e6870;
  font-size: 12px;
  font-weight: 800;
}
.unit-detail-scores article > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  gap: 2px;
}
.unit-detail-scores article > div:last-child {
  justify-content: end;
  text-align: right;
}
.unit-detail-scores article > div small,
.unit-detail-scores article > div em {
  grid-column: 1/3;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}
.unit-detail-scores strong {
  font: 800 24px Arial;
  color: var(--ink);
  white-space: nowrap;
}
.unit-detail-scores article > div:last-child strong {
  color: var(--ai-cyan);
}
.unit-detail-scores article > i {
  color: var(--ai-cyan);
  font-style: normal;
  text-align: center;
}
.unit-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 14px 0 12px;
  padding-top: 12px;
  border-top: 1px solid #d1e1df;
  color: #597077;
  font-size: 11px;
}
.unit-detail-meta span {
  white-space: nowrap;
}
.unit-detail-words {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.unit-detail-words > span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #c6d8d6;
  background: #fff;
}
.unit-detail-words b {
  font: 700 13px Arial;
}
.unit-detail-words small {
  color: #9a651f;
  font-size: 10px;
  white-space: nowrap;
}
.unit-detail-words > em {
  color: var(--green);
  font-size: 11px;
  font-style: normal;
}
.status-distribution progress {
  accent-color: var(--ai-cyan);
}
.status-distribution span i.learning {
  background: var(--ai-cyan);
}
.error-breakdown i b {
  background: var(--ai-cyan);
}
@media (max-width: 820px) {
  .learning-report-view > header::after {
    position: static;
    display: inline-block;
    margin-top: 12px;
  }
  .score-compare-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .unit-detail-scores {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .score-compare-grid {
    grid-template-columns: 1fr;
  }
  .report-table > button.report-unit-row {
    min-width: 620px;
  }
  .report-unit-detail {
    min-width: 620px;
  }
  .learning-report-view > header {
    padding-left: 12px;
  }
}

/* Keep assessment feedback local so changing questions never repaints the page shell. */
.assessment-card {
  contain: layout;
  isolation: isolate;
  overflow: hidden;
}
.assessment-stage {
  min-height: 510px;
  background-color: #f8faf6;
}
.assessment-card input,
.assessment-options button {
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}
@media (prefers-reduced-motion: reduce) {
  .assessment-card input,
  .assessment-options button {
    transition: none;
  }
}
/* Letter ordering uses feedback tones; phoneme audio belongs to the phonics stages. */
.letter-bank button.correct-choice {
  border-color: #4f9e7b;
  background: #e8f6ef;
  color: #17654b;
}
.letter-bank button.wrong {
  border-color: #d6a25b;
  background: #fff4df;
  color: #855515;
  animation: letter-choice-nudge 0.28s ease;
}
@keyframes letter-choice-nudge {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}
/* Assessment result levels: clear score, restrained high-score egg, full-screen perfect celebration. */
.assessment-result-hero {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 8px 12px 14px;
  text-align: center;
}
.assessment-result-hero > div {
  display: flex;
  align-items: baseline;
  justify-content: center;
}
.assessment-result-hero strong {
  font: 900 76px/1 Arial;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.assessment-result-hero em {
  margin-left: 6px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}
.assessment-result-hero > b {
  color: #516173;
  font-size: 13px;
}
.assessment-result-hero.is-high {
  border-radius: 7px;
  background: #fff9e8;
  box-shadow: inset 0 0 0 1px #f0d68b;
}
.assessment-result-hero.is-high strong {
  color: #c48312;
}
.assessment-result-hero.is-perfect {
  position: relative;
  padding-top: 16px;
  background: #fff6cf;
  box-shadow:
    inset 0 0 0 2px #e5b72e,
    0 12px 30px rgba(196, 131, 18, 0.18);
}
.assessment-result-hero.is-perfect strong {
  font-size: 104px;
  color: #b96f08;
  text-shadow: 0 3px 0 #ffe68a;
}
.assessment-result-hero.is-perfect > b {
  color: #8a5109;
  font-size: 17px;
}
.result-trophy {
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 9px 10px rgba(172, 104, 7, 0.28));
  animation: trophy-arrive 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes trophy-arrive {
  0% {
    opacity: 0;
    transform: translateY(-28px) scale(0.55) rotate(-12deg);
  }
  70% {
    transform: translateY(4px) scale(1.1) rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
.assessment-celebration {
  position: fixed;
  inset: 0;
  z-index: 1200;
  overflow: hidden;
  pointer-events: none;
}
.floating-perfect-trophy {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(360px, 56vw);
  height: min(360px, 56vw);
  object-fit: contain;
  filter: drop-shadow(0 24px 32px rgba(87, 50, 4, 0.38));
  animation: floating-trophy-show 3.9s cubic-bezier(0.18, 0.76, 0.24, 1) both;
}
@keyframes floating-trophy-show {
  0% {
    opacity: 0;
    transform: translate(-50%, -42%) scale(0.28) rotate(-9deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1.12) rotate(3deg);
  }
  27%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.86) rotate(0);
  }
}
.assessment-celebration .ribbon {
  position: absolute;
  width: 10px;
  height: 22px;
  border-radius: 2px;
  animation: assessment-ribbon 2.2s ease-in var(--delay) both;
}
.assessment-celebration .firework {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 4px solid currentColor;
  border-radius: 50%;
  background: transparent !important;
  box-shadow:
    0 -28px currentColor,
    20px -20px currentColor,
    28px 0 currentColor,
    20px 20px currentColor,
    0 28px currentColor,
    -20px 20px currentColor,
    -28px 0 currentColor,
    -20px -20px currentColor;
  animation: assessment-firework 1.25s ease-out var(--delay) both;
}
.assessment-celebration.is-perfect .ribbon {
  animation-duration: 3.7s;
}
@keyframes assessment-ribbon {
  0% {
    opacity: 0;
    transform: translate3d(0, -10vh, 0) rotate(0);
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), var(--fall), 0) rotate(var(--spin));
  }
}
@keyframes assessment-firework {
  0% {
    opacity: 0;
    transform: scale(0.1);
  }
  20% {
    opacity: 1;
  }
  75% {
    opacity: 1;
    transform: scale(1.35);
  }
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}
@media (max-width: 620px) {
  .assessment-result-hero strong {
    font-size: 62px;
  }
  .assessment-result-hero.is-perfect strong {
    font-size: 84px;
  }
  .result-trophy {
    width: 82px;
    height: 82px;
  }
  .floating-perfect-trophy {
    width: min(290px, 68vw);
    height: min(290px, 68vw);
  }
}
@media (prefers-reduced-motion: reduce) {
  .result-trophy,
  .floating-perfect-trophy,
  .assessment-celebration i {
    animation-duration: 0.2s !important;
  }
}
/* Textbook hierarchy: grade, edition, volume, then unit learning state. */
.book-list {
  display: block;
  margin-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.grade-menu {
  display: flex;
  gap: 14px;
  padding: 6px 7px 22px;
  overflow-x: auto;
}
.grade-menu,
.edition-menu {
  scrollbar-width: none;
}
.grade-menu::-webkit-scrollbar,
.edition-menu::-webkit-scrollbar {
  display: none;
}
.book-list .grade-menu button {
  min-width: 118px;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: #edf2ef;
  color: #536578;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    6px 6px 12px #cbd5d0,
    -6px -6px 12px #fff;
}
.book-list .grade-menu button.active {
  background: #e4f2ec;
  color: var(--green);
  box-shadow:
    inset 4px 4px 8px #c2d6cd,
    inset -4px -4px 8px #fff;
}
.edition-level {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: stretch;
  gap: 16px;
  padding: 20px 7px;
  border-top: 1px solid #dce5e0;
  border-bottom: 1px solid #dce5e0;
}
.edition-level > span {
  display: grid;
  place-items: center;
  min-height: 50px;
  border-radius: 9px;
  background: #edf2ef;
  color: #65776c;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow:
    4px 4px 8px #cbd5d0,
    -4px -4px 8px #fff;
}
.edition-menu {
  display: flex;
  align-items: stretch;
  gap: 13px;
  overflow-x: auto;
  padding: 1px 5px 7px;
}
.book-list .edition-menu button {
  min-width: 170px;
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 0 20px;
  border: 0;
  border-radius: 9px;
  background: #edf2ef;
  color: #536578;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    5px 5px 10px #cbd5d0,
    -5px -5px 10px #fff;
}
.book-list .edition-menu button.active {
  background: #e4f2ec;
  color: #13745b;
  box-shadow:
    inset 4px 4px 8px #c2d6cd,
    inset -4px -4px 8px #fff;
}
.volume-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 290px));
  gap: 16px;
  padding: 22px 7px 7px;
}
.book-list .volume-menu button {
  min-height: 100px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 18px;
  border: 0;
  border-radius: 10px;
  background: #edf2ef;
  text-align: center;
  cursor: pointer;
  box-shadow:
    6px 6px 12px #cbd5d0,
    -6px -6px 12px #fff;
}
.book-list .volume-menu button.active {
  background: #e4f2ec;
  color: var(--green);
  box-shadow:
    inset 4px 4px 8px #c2d6cd,
    inset -4px -4px 8px #fff;
}
.volume-menu strong {
  font-size: 22px;
}
.volume-menu small {
  color: var(--muted);
  font-size: 12px;
}
.unit-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 24px 0 4px;
  border-bottom: 0;
}
.unit-list .unit-card {
  position: relative;
  min-width: 0;
  height: auto;
  min-height: 338px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 5px 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.unit-list .unit-card:hover {
  border-color: #9abeb2;
  background: #f6fbf8;
}
.unit-list .unit-card.active {
  border-color: var(--green);
  background: #eef7f3;
  box-shadow: inset 0 3px var(--green);
}
.unit-attempts {
  align-self: start;
  color: #637486;
  font-size: 11px;
  font-weight: 700;
}
.unit-assessment {
  justify-self: end;
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}
.unit-assessment b {
  font-size: 11px;
  color: #7a8795;
}
.unit-assessment small {
  font-size: 10px;
  color: #8c98a5;
}
.unit-assessment.complete b {
  color: var(--green);
}
.unit-assessment.started b {
  color: #b46a1e;
}
.unit-card > strong {
  grid-column: 1/2;
  align-self: end;
  margin-top: 13px;
  font: 800 25px Arial;
}
.unit-card > em {
  grid-column: 2;
  align-self: end;
  justify-self: end;
  color: #5e7083;
  font-style: normal;
  font-size: 12px;
}
.unit-score-grid {
  grid-column: 1/3;
  display: grid;
  gap: 0;
  margin-top: 13px;
  border-block: 1px solid #dce5e1;
}
.unit-score-row {
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(66px, 1fr) auto 16px auto 36px;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid #e5ebe8;
  color: #607286;
  font-size: 10px;
}
.unit-score-row:last-child {
  border-bottom: 0;
}
.unit-score-row > b {
  font-size: 10px;
  color: #40566b;
}
.unit-score-row > small {
  white-space: nowrap;
  font-size: 9px;
}
.unit-score-row > small strong {
  margin-left: 2px;
  color: var(--ink);
  font: 800 13px Arial;
}
.unit-score-row > i {
  color: #1688b8;
  font-style: normal;
  text-align: center;
}
.unit-score-row > em {
  justify-self: end;
  color: var(--green);
  font: 800 11px Arial;
  font-style: normal;
}
.unit-progress-copy {
  grid-column: 1/3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 17px;
  color: #627386;
}
.unit-progress-copy b,
.unit-progress-copy small {
  font-size: 11px;
}
.unit-card > progress {
  grid-column: 1/3;
  width: 100%;
  height: 7px;
  accent-color: var(--green);
}
.unit-learning-actions {
  grid-column: 1/3;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 8px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #dce5e1;
}
.unit-learning-actions button {
  height: 40px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.unit-restart {
  border: 1px solid #8ab3a5;
  background: #fff;
  color: var(--green);
}
.unit-restart:hover {
  background: #f2f8f5;
}
.unit-continue {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 10px rgba(35, 133, 109, 0.18);
}
.unit-continue:hover {
  background: #176f5b;
}
@media (max-width: 980px) {
  .unit-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .edition-level {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .unit-list {
    grid-template-columns: 1fr;
  }
  .unit-list .unit-card {
    min-height: 330px;
  }
  .unit-learning-actions {
    grid-template-columns: 1fr 1.25fr;
  }
}

/* Shared navigation selection: selected items use the same pressed surface as the main sidebar. */
.grade-menu button.active,
.edition-menu button.active,
.volume-menu button.active,
.book-list > button.active,
.filter-row button.active,
.view-switch button.active {
  border-color: #86b3a3 !important;
  background: #e4f2ec !important;
  color: #13745b !important;
  box-shadow:
    inset 4px 4px 8px #c2d6cd,
    inset -4px -4px 8px #fff !important;
}
.grade-menu button.active strong,
.edition-menu button.active strong,
.volume-menu button.active strong,
.book-list > button.active strong {
  color: #13745b !important;
}
.unit-list .unit-card.active {
  border-color: #78aa99;
  background: #e4f2ec;
  box-shadow:
    inset 4px 4px 9px #c2d6cd,
    inset -4px -4px 9px #fff;
}
.unit-list .unit-card.active > strong {
  color: #13745b;
}

/* Full-score celebration: cool paper background with realistic canvas fireworks. */
.assessment-result-hero.is-perfect {
  background: #edf8f6;
  box-shadow:
    inset 0 0 0 2px #69b9aa,
    0 12px 30px rgba(25, 112, 96, 0.16);
}
.assessment-result-hero.is-perfect strong {
  color: #137a68;
  text-shadow: 0 3px 0 #c8eee6;
}
.assessment-result-hero.is-perfect > b {
  color: #235b55;
}
.perfect-fireworks-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: rgba(7, 24, 35, 0.18);
}
.assessment-celebration .ribbon {
  z-index: 3;
  width: var(--ribbon-width, 10px);
  height: var(--ribbon-height, 22px);
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.assessment-celebration .ribbon {
  border-radius: 55% 10% 48% 14%;
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.82),
    transparent 28%,
    rgba(0, 0, 0, 0.18) 72%,
    rgba(255, 255, 255, 0.35)
  );
  box-shadow: 1px 3px 5px rgba(28, 23, 12, 0.24);
}
.assessment-celebration .ribbon-1 {
  border-radius: 8% 55% 12% 50%;
  clip-path: polygon(
    0 0,
    100% 6%,
    72% 30%,
    100% 52%,
    68% 76%,
    100% 100%,
    0 94%,
    28% 72%,
    0 48%,
    32% 24%
  );
}
.assessment-celebration .ribbon-2 {
  border-radius: 50%;
  transform-origin: center top;
}
@media (max-width: 640px) {
  .lesson-group-tracker {
    grid-template-columns: 1fr 1fr;
  }
  .lesson-group-heading {
    grid-column: 1/-1;
  }
  .lesson-group-tracker progress {
    grid-column: 1/-1;
  }
  .lesson-group-complete strong {
    font-size: 25px;
  }
}

.special-training-view {
  width: min(1050px, 100%);
  margin: 0 auto;
  padding: 30px 34px 60px;
}
.special-training-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.special-training-header span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.special-training-header h1 {
  margin: 6px 0;
  font-size: 30px;
}
.special-training-header p {
  margin: 0;
  color: var(--muted);
}
.special-training-header > div:last-child {
  display: grid;
  justify-items: end;
  gap: 5px;
}
.special-training-header > div:last-child strong {
  font-size: 18px;
}
.special-training-header > div:last-child small {
  color: var(--muted);
}
.special-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.special-mode-grid button {
  min-height: 150px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-content: center;
  gap: 5px 16px;
  padding: 22px;
  border: 0;
  border-radius: 10px;
  background: #edf2ef;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow:
    7px 7px 14px #cbd5d0,
    -7px -7px 14px #fff;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}
.special-mode-grid button:hover {
  transform: translateY(-3px);
  box-shadow:
    9px 10px 18px #c7d1cc,
    -7px -7px 14px #fff;
}
.special-mode-grid i {
  grid-row: 1/3;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #dcece5;
  color: var(--green);
  font: 900 21px Arial;
  font-style: normal;
  box-shadow:
    inset 2px 2px 4px rgba(35, 83, 67, 0.1),
    inset -2px -2px 4px #fff;
}
.special-mode-grid b {
  font-size: 20px;
}
.special-mode-grid span {
  color: var(--muted);
  font-size: 13px;
}
.special-training-card {
  margin-top: 26px;
  padding: 28px;
  border: 1px solid #d5dfda;
  border-radius: 8px;
  background: #f7faf7;
  box-shadow: 0 16px 38px rgba(31, 65, 52, 0.1);
}
.special-training-card > header {
  display: grid;
  gap: 9px;
}
.special-training-card > header > div {
  display: flex;
  justify-content: space-between;
  color: var(--green);
  font-weight: 800;
}
.special-training-card progress {
  width: 100%;
  height: 8px;
  accent-color: var(--green);
}
.special-question {
  min-height: 450px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  text-align: center;
}
.special-question > span {
  color: var(--muted);
  font-weight: 700;
}
.special-prompt-word {
  font: 900 68px Arial;
}
.special-prompt-meaning {
  max-width: 680px;
  font-size: 31px;
  line-height: 1.5;
}
.special-options {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.special-options button {
  min-height: 68px;
  padding: 10px 16px;
  border: 1px solid #d3ddd8;
  border-radius: 7px;
  background: #edf2ef;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    4px 4px 8px #ccd6d1,
    -4px -4px 8px #fff;
}
.special-word-options button {
  font: 800 21px Arial;
}
.special-audio-button {
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 50%;
  background: #1976d2;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(25, 118, 210, 0.25);
}
.special-dictation-input {
  width: min(520px, 90%);
  height: 70px;
  border: 0;
  border-bottom: 3px solid #637487;
  background: transparent;
  text-align: center;
  outline: 0;
  font: 900 40px Arial;
}
.special-dictation-actions {
  display: flex;
  gap: 12px;
}
.special-dictation-actions button,
.special-result button {
  min-width: 130px;
  padding: 12px 18px;
  border: 1px solid #9bb5ac;
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}
.special-dictation-actions button:last-child,
.special-result button:first-child {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.special-feedback {
  min-height: 25px;
  margin: 0;
  text-align: center;
  font-weight: 800;
}
.special-feedback.correct {
  color: var(--green);
}
.special-feedback.wrong {
  color: #c1543d;
}
.special-result {
  min-height: 480px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  text-align: center;
}
.special-result > span {
  color: var(--green);
  font-weight: 800;
}
.special-result > strong {
  font: 900 78px Arial;
  color: var(--green);
}
.special-result p {
  color: var(--muted);
}
.special-result > div {
  display: flex;
  gap: 10px;
}
.special-result button:last-child {
  background: #fff;
  color: var(--green);
}
@media (max-width: 680px) {
  .special-training-view {
    padding: 22px 12px 42px;
  }
  .special-training-header {
    align-items: start;
    flex-direction: column;
  }
  .special-training-header > div:last-child {
    justify-items: start;
  }
  .special-mode-grid {
    grid-template-columns: 1fr;
  }
  .special-options {
    grid-template-columns: 1fr;
  }
  .special-prompt-word {
    font-size: 52px;
  }
  .special-training-card {
    padding: 20px 12px;
  }
  .selected-book-actions {
    flex-direction: column;
  }
}

.review-nine-grid {
  position: relative;
  grid-template-columns: repeat(9, minmax(72px, 1fr));
  gap: 4px;
  margin: 32px 0 26px;
  padding: 0 8px;
  background: transparent;
  overflow: visible;
}
.review-nine-grid::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 6%;
  right: 6%;
  top: 31px;
  height: 5px;
  border-radius: 5px;
  background: #cddbd5;
  box-shadow:
    inset 0 2px 3px rgba(32, 74, 59, 0.16),
    0 1px 0 #fff;
}
.review-nine-grid button {
  position: relative;
  z-index: 1;
  min-height: 104px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.review-nine-grid b {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 5px solid #eef3f0;
  border-radius: 50%;
  background: #d9e2de;
  color: #75847e;
  font: 900 22px Arial;
  box-shadow:
    5px 6px 11px #bcc8c2,
    -4px -4px 9px #fff,
    inset 2px 2px 3px rgba(55, 77, 68, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}
.review-nine-grid span {
  margin-top: 4px;
  color: #687972;
  font-size: 11px;
  font-weight: 800;
}
.review-nine-grid em {
  color: #8a9892;
  font-size: 10px;
}
.review-nine-grid button.has-words b {
  background: #23856d;
  color: #fff;
  box-shadow:
    0 0 0 3px #bde3d4,
    0 7px 15px rgba(35, 133, 109, 0.32),
    inset 0 2px 2px rgba(255, 255, 255, 0.35);
}
.review-nine-grid button:nth-child(3n + 2).has-words b {
  background: #287ca8;
  box-shadow:
    0 0 0 3px #c4deec,
    0 7px 15px rgba(40, 124, 168, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.35);
}
.review-nine-grid button:nth-child(3n).has-words b {
  background: #d99a25;
  box-shadow:
    0 0 0 3px #f2dfb5,
    0 7px 15px rgba(190, 124, 18, 0.3),
    inset 0 2px 2px rgba(255, 255, 255, 0.38);
}
.review-nine-grid button.active b {
  transform: translateY(-5px) scale(1.12);
  color: #fff;
  background: #d95d4c;
  box-shadow:
    0 0 0 4px #ffd8cd,
    0 10px 22px rgba(191, 69, 49, 0.4),
    inset 0 2px 2px rgba(255, 255, 255, 0.4);
}
.review-nine-grid button.active::after {
  content: "◆";
  position: absolute;
  top: -19px;
  color: #e09e2d;
  font-size: 16px;
  filter: drop-shadow(0 2px 3px rgba(126, 76, 7, 0.25));
  animation: memory-node-spark 1.5s ease-in-out infinite;
}
.review-nine-grid button:not(.is-empty):hover b {
  transform: translateY(-4px);
}
@keyframes memory-node-spark {
  50% {
    transform: translateY(-3px) scale(1.12);
    filter: drop-shadow(0 4px 6px rgba(126, 76, 7, 0.32));
  }
}
@media (max-width: 820px) {
  .review-nine-grid {
    grid-template-columns: repeat(9, 76px);
    overflow-x: auto;
    padding: 4px 8px 12px;
  }
  .review-nine-grid::before {
    left: 38px;
    right: auto;
    width: 608px;
  }
}

.special-training-selectors {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.55fr);
  gap: 14px;
  margin-top: 24px;
}
.special-training-selectors label {
  display: grid;
  gap: 7px;
}
.special-training-selectors span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.special-training-selectors select {
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #edf2ef;
  color: var(--ink);
  font-weight: 800;
  outline: none;
  box-shadow:
    5px 5px 10px #cbd5d0,
    -5px -5px 10px #fff;
}
.special-training-selectors select:focus {
  box-shadow:
    inset 3px 3px 6px #c7d4ce,
    inset -3px -3px 6px #fff,
    0 0 0 2px rgba(35, 133, 109, 0.2);
}
.special-training-run-view .special-training-card {
  margin-top: 0;
}
@media (max-width: 680px) {
  .special-training-selectors {
    grid-template-columns: 1fr;
  }
}
.special-training-selectors {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px;
  border: 1px solid #d8e1dc;
  border-radius: 9px;
  background: #edf2ef;
  box-shadow:
    6px 6px 12px #cbd5d0,
    -6px -6px 12px #fff;
}
.special-training-selectors section {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 12px;
}
.special-training-selectors section > span {
  color: #62746d;
  font-size: 12px;
  font-weight: 900;
}
.special-training-selectors nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.special-training-selectors button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: #edf2ef;
  color: #53665e;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    3px 3px 7px #c8d2cd,
    -3px -3px 7px #fff;
}
.special-training-selectors button.active {
  background: #e1f0e9;
  color: var(--green);
  box-shadow:
    inset 3px 3px 6px #c3d3cb,
    inset -3px -3px 6px #fff;
}
.special-training-selectors button small {
  margin-left: 6px;
  color: #84918c;
  font-size: 10px;
}
@media (max-width: 680px) {
  .special-training-selectors section {
    grid-template-columns: 1fr;
  }
  .special-training-selectors nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 3px;
  }
  .special-training-selectors button {
    flex: 0 0 auto;
  }
}

.mnemonic-study {
  min-height: 520px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0;
  padding: 30px 6px;
}
.mnemonic-study-map {
  display: grid;
  grid-template-columns: 112px minmax(220px, 360px);
  align-items: center;
  justify-content: center;
  gap: 32px;
  min-height: 300px;
  padding: 18px 0 34px;
}
.mnemonic-study-map > .root-word {
  position: relative;
}
.mnemonic-study-map > .root-word::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 32px;
  border-top: 2px solid #7893a2;
}
.mnemonic-study-map .branches {
  min-height: 240px;
  align-content: center;
}
.mnemonic-study-story {
  padding: 28px 6px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}
.mnemonic-study-story > span {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.mnemonic-study-story p {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 2.05;
  word-break: normal;
  overflow-wrap: break-word;
}
.mnemonic-study-story p span {
  display: inline;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.mnemonic-narration { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; margin-top: 12px; padding: 0 12px; border: 1px solid #b9d5ca; border-radius: 18px; background: #fff; color: #176b57; font-size: 12px; font-weight: 800; cursor: pointer; }
.mnemonic-narration:hover, .mnemonic-narration.playing { border-color: #23856d; background: #e7f4ee; }
.mnemonic-narration.paused { border-color: #d19a3b; background: #fff8e8; color: #855b0b; }
.mnemonic-narration span { font-size: 15px; }
.mnemonic-narration[hidden] { display: none !important; }
.mnemonic-study-story .story-cue {
  color: #9b541b;
  font-weight: 900;
  border-bottom: 2px solid rgba(155, 84, 27, 0.28);
}
.mnemonic-study-story .story-code {
  color: #1976d2;
  font-weight: 900;
}
.mnemonic-study-story .story-meaning {
  color: #14745b;
  font-weight: 900;
  border-bottom: 2px solid rgba(20, 116, 91, 0.26);
}
.mnemonic-study-story .story-word {
  color: #b33c34;
  font-weight: 900;
}
.mnemonic-study-empty {
  grid-column: 1/-1;
  min-height: 330px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
}
.mnemonic-study-empty strong {
  color: var(--ink);
  font-size: 21px;
}
.mnemonic-study-empty[hidden],
.mnemonic-study-story[hidden],
#mnemonicStudyBranches[hidden],
#mnemonicStudyRoot[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .mnemonic-study-map {
    grid-template-columns: 92px minmax(180px, 1fr);
    gap: 26px;
  }
  .mnemonic-study-story {
    padding-inline: 4px;
  }
}
.special-training-card[hidden],
.special-result[hidden],
.special-mode-grid[hidden] {
  display: none !important;
}
/* Temporarily suppress the unreliable stage-two spelling-block breakdown. */
#stage2 .syllable-summary,
#stage2 .syllable-board {
  display: none !important;
}
.unit-reinforce-button {
  margin-top: 16px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.error-breakdown > button {
  width: 100%;
  display: grid;
  grid-template-columns: 88px 1fr 52px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.status-distribution > button {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.error-breakdown > button:hover,
.status-distribution > button:hover {
  background: #edf8f7;
}
.status-distribution > button progress {
  grid-column: 1/3;
  width: 100%;
  height: 7px;
  accent-color: var(--ai-cyan);
}
.report-drilldown {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #a9c9c5;
  border-radius: 8px;
  background: #eaf3ef;
  box-shadow:
    inset 3px 3px 8px rgba(94, 123, 112, 0.13),
    inset -3px -3px 8px rgba(255, 255, 255, 0.82);
}
.report-drilldown[hidden] {
  display: none;
}
.report-drilldown > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.report-drilldown > header > div {
  display: grid;
  gap: 3px;
}
.report-drilldown > header span {
  color: var(--muted);
  font-size: 11px;
}
.report-drilldown > header > button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 8px rgba(33, 93, 75, 0.22);
}
.report-drilldown > div {
  max-height: 410px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 11px;
  padding: 2px 7px 7px 2px;
  scrollbar-width: thin;
}
.report-drilldown > div button {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #b7cec7;
  border-radius: 7px;
  background: #f4f7f5;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow:
    4px 4px 9px rgba(83, 110, 100, 0.18),
    -3px -3px 8px rgba(255, 255, 255, 0.9);
}
.report-drilldown > div button:hover {
  border-color: #5d9f8c;
  background: #dfefe8;
  transform: translateY(-1px);
}
.report-drilldown b {
  font: 900 18px Arial;
}
.report-drilldown small {
  color: #526a78;
  font-size: 13px;
  line-height: 1.35;
}
/* Full-bodied menu language shared across navigation and selector surfaces. */
:is(
    .main-sidebar nav,
    .edition-menu,
    .grade-menu,
    .volume-menu,
    .filter-row,
    .wordbook-tabs,
    .review-mode-picker,
    .review-batch-tabs,
    .special-training-selectors,
    .phonetic-tabs,
    .editor-tabs
  )
  button {
  border: 1px solid #c8d6d0;
  background: #f3f6f4;
  color: #40566a;
  box-shadow:
    4px 4px 9px rgba(90, 111, 102, 0.2),
    -3px -3px 8px rgba(255, 255, 255, 0.95),
    inset 0 1px rgba(255, 255, 255, 0.8);
  font-weight: 800;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}
:is(
    .main-sidebar nav,
    .edition-menu,
    .grade-menu,
    .volume-menu,
    .filter-row,
    .wordbook-tabs,
    .review-mode-picker,
    .review-batch-tabs,
    .special-training-selectors,
    .phonetic-tabs,
    .editor-tabs
  )
  button:hover {
  border-color: #87ad9f;
  background: #eef5f1;
  transform: translateY(-1px);
}
:is(
    .main-sidebar nav,
    .edition-menu,
    .grade-menu,
    .volume-menu,
    .filter-row,
    .wordbook-tabs,
    .review-mode-picker,
    .review-batch-tabs,
    .special-training-selectors,
    .phonetic-tabs,
    .editor-tabs
  )
  button:is(.active, [aria-pressed="true"]) {
  border-color: #4b9a82;
  background: #dcefe7;
  color: #126550;
  box-shadow:
    inset 4px 4px 8px rgba(72, 119, 101, 0.2),
    inset -4px -4px 8px rgba(255, 255, 255, 0.8),
    0 3px 8px rgba(36, 103, 82, 0.12);
  transform: none;
}
.edition-menu button,
.grade-menu button,
.volume-menu button,
.review-batch-tabs button,
.wordbook-tabs button,
.phonetic-tabs button,
.editor-tabs button {
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 7px;
}
.review-mode-picker button,
.special-training-selectors button {
  min-height: 72px;
  border-radius: 8px;
}
.weak-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  padding: 9px 10px;
  border: 1px solid #bdd3cd;
  border-radius: 7px;
  background: #eaf3ef;
}
.weak-list-toolbar span {
  color: #526a78;
  font-size: 12px;
  font-weight: 800;
}
.weak-list-toolbar button {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 8px rgba(33, 93, 75, 0.2);
}
.unit-detail-scores article {
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr);
}
.unit-detail-scores article > span {
  grid-column: 1/6;
}
.review-colored-word {
  font: 900 64px Arial;
}
.review-colored-word .tone-0 {
  color: #168bc1;
}
.review-colored-word .tone-1 {
  color: #df4d58;
}
.review-colored-word .tone-2 {
  color: #23856d;
}
.review-accent-ipa {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.review-accent-ipa button {
  padding: 10px 15px;
  border: 1px solid #b9d6eb;
  border-radius: 6px;
  background: #eef7ff;
  color: #173f5f;
  font: 700 17px Arial;
  cursor: pointer;
}
.review-accent-ipa b {
  margin-right: 9px;
  padding: 3px 6px;
  background: #fff;
  color: #2380c5;
}
.review-order-slots,
.review-order-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.review-order-slots i {
  display: grid;
  place-items: center;
  min-width: 92px;
  height: 58px;
  padding: 0 16px;
  border: 2px dashed #9ab9ad;
  border-radius: 7px;
  background: #f4faf7;
  color: #17624f;
  font: 900 24px Arial;
  font-style: normal;
}
.review-order-bank button {
  min-width: 92px;
  height: 52px;
  padding: 0 18px;
  border: 1px solid #8ebcad;
  border-radius: 7px;
  background: #fff;
  color: #17624f;
  font: 900 23px Arial;
  cursor: pointer;
  box-shadow: 0 4px 0 #d4e7e0;
}
.review-order-bank button:disabled {
  opacity: 0.35;
  box-shadow: none;
}
.review-order-reset {
  border: 0;
  background: transparent;
  color: #39786a;
  text-decoration: underline;
  cursor: pointer;
}
.steps {
  grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr 22px 1fr 22px 1fr;
  padding-inline: 18px;
}
.step {
  gap: 8px;
}
.step strong {
  font-size: 14px;
}
@media (max-width: 680px) {
  .steps {
    height: auto;
    min-height: 86px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 8px;
  }
  .steps > i {
    display: none;
  }
  .step {
    display: grid;
    justify-items: center;
    grid-template-columns: 1fr;
    text-align: center;
  }
  .step span {
    min-width: 0;
  }
  .step strong {
    font-size: 11px;
    white-space: normal;
  }
  .step small {
    display: none;
  }
}
.dual-ipa {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.accent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 560px) {
  .accent-grid {
    grid-template-columns: 1fr;
  }
  .dual-ipa {
    display: grid;
    grid-template-columns: 1fr;
  }
}
.error-breakdown > button:nth-child(2) > strong {
  color: #ef8c43;
  background: transparent;
}
.error-breakdown > button:nth-child(2) > i > b {
  color: inherit;
  background: #ef8c43;
}
.error-breakdown > button:nth-child(3) > strong {
  color: #8a65c7;
  background: transparent;
}
.error-breakdown > button:nth-child(3) > i > b {
  color: inherit;
  background: #8a65c7;
}
.error-breakdown > button:nth-child(4) > strong {
  color: #d25d58;
  background: transparent;
}
.error-breakdown > button:nth-child(4) > i > b {
  color: inherit;
  background: #d25d58;
}
.error-breakdown > button:nth-child(5) > strong {
  color: #29a277;
  background: transparent;
}
.error-breakdown > button:nth-child(5) > i > b {
  color: inherit;
  background: #29a277;
}
.review-item button {
  background: #dcece5 !important;
  color: #173f34 !important;
  text-shadow: none !important;
}
.review-mode-picker button {
  position: relative;
  overflow: hidden;
}
.review-mode-picker button.active {
  border-color: #176f59 !important;
  background: #23856d !important;
  color: #fff !important;
  box-shadow:
    inset 5px 5px 10px #176b56,
    inset -4px -4px 9px #43a087,
    0 0 0 3px rgba(35, 133, 109, 0.18) !important;
}
.review-mode-picker button.active::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: #f0bd45;
}
.review-mode-picker button.active::after {
  content: "已选择";
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #fff;
  color: #176f59;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(18, 70, 55, 0.22);
}
.review-mode-picker button.active b,
.review-mode-picker button.active small,
.review-mode-picker button.active span {
  color: #fff !important;
}
.review-mode-picker button.active span {
  border-top-color: rgba(255, 255, 255, 0.3);
}
.report-grid {
  align-items: stretch;
}
.report-grid > .report-section {
  display: flex;
  flex-direction: column;
}
.report-grid > .report-section > header + div {
  flex: 1;
}
.report-period-section > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.report-period-tabs {
  display: flex;
  gap: 8px;
}
.report-period-tabs button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: #e8eeeb;
  color: #52675f;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    3px 3px 7px #c8d2cd,
    -3px -3px 7px #fff;
}
.report-period-tabs button.active {
  background: #23856d;
  color: #fff;
  box-shadow:
    inset 3px 3px 6px #176b56,
    inset -2px -2px 5px #4ca087;
}
.period-report-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.period-report-metrics article {
  min-height: 92px;
  display: grid;
  place-content: center;
  gap: 4px;
  border: 1px solid #ccdcd5;
  border-radius: 7px;
  background: #edf3f0;
  text-align: center;
  box-shadow:
    4px 5px 10px rgba(58, 79, 70, 0.14),
    -4px -4px 9px #fff;
}
.period-report-metrics article:nth-child(2) {
  background: #eef5fa;
}
.period-report-metrics article:nth-child(3) {
  background: #fff5e7;
}
.period-report-metrics article:nth-child(4) {
  background: #f3effa;
}
.period-report-metrics strong {
  color: #176f79;
  font: 900 28px Arial;
}
.period-report-metrics small {
  margin-left: 3px;
  font-size: 12px;
}
.period-report-metrics span {
  color: #5e7169;
  font-size: 11px;
  font-weight: 800;
}
.period-report-detail {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.period-report-detail section {
  padding: 14px;
  border: 1px solid #d1ded8;
  border-radius: 7px;
  background: #f4f8f6;
}
.period-report-detail b {
  color: #29473f;
  font-size: 13px;
}
.period-report-detail p {
  margin: 8px 0 0;
  color: #52675f;
  line-height: 1.7;
}
.period-learning-analysis > div {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}
.period-learning-analysis p {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #23856d;
  background: #edf4f1;
}
.period-learning-analysis p:nth-child(2) {
  border-left-color: #1688b8;
}
.period-learning-analysis p:nth-child(3) {
  border-left-color: #d89426;
}
.period-learning-analysis p:nth-child(4) {
  border-left-color: #8a65c7;
}
.period-learning-analysis p strong {
  display: block;
  margin-bottom: 3px;
  color: #29473f;
  font-size: 12px;
}
.period-weak-words {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.period-weak-words span {
  padding: 6px 10px;
  border-radius: 5px;
  background: #dfeee8;
  color: #17624f;
  font: 800 13px Arial;
}
.period-weak-words em {
  color: var(--muted);
  font-style: normal;
}
.assessment-view {
  width: 100%;
  max-width: 1050px;
  min-width: 0;
}
.assessment-header {
  width: 100%;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 200px;
  align-items: end;
}
.assessment-header > div {
  min-width: 0;
}
.assessment-header h1 {
  word-break: keep-all;
  overflow-wrap: normal;
}
.assessment-card {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  place-items: stretch;
  align-content: stretch;
  padding: 28px;
}
.assessment-companion {
  min-height: 74px;
  align-self: auto;
  display: grid;
  grid-template-columns: 58px auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: stretch;
  gap: 3px 14px;
  padding: 10px 16px;
  border-right: 0;
  border-bottom: 1px solid #dce5df;
  text-align: left;
}
.assessment-companion img {
  grid-row: 1/3;
  width: 52px;
  height: 52px;
  margin: 0;
}
.assessment-companion span,
.assessment-companion strong {
  margin: 0;
}
.assessment-companion p {
  grid-column: 3;
  grid-row: 1/3;
  justify-self: end;
  max-width: 430px;
  margin: 0;
  text-align: right;
}
.assessment-stage {
  min-height: 490px;
  padding-top: 18px;
}
.assessment-review-navigation {
  display: flex;
  justify-content: flex-start;
  padding-top: 18px;
}
.assessment-review-navigation button,
.review-return-bar button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 7px;
  background: #dcece5;
  color: #17624f;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    4px 4px 8px #c7d3cd,
    -4px -4px 8px #fff;
}
.assessment-review-navigation button:hover,
.review-return-bar button:hover {
  background: #23856d;
  color: #fff;
}
.review-return-bar {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 max(18px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid #d2ddd7;
  background: #edf2ef;
}
.review-return-bar[hidden] {
  display: none;
}
.review-return-bar:not([hidden]) + .workspace {
  height: calc(100% - 52px);
}
@media (max-width: 680px) {
  .report-period-section > header {
    align-items: stretch;
    flex-direction: column;
  }
  .report-period-tabs button {
    flex: 1;
  }
  .period-report-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .assessment-header {
    grid-template-columns: 1fr !important;
  }
  .assessment-progress {
    width: 100%;
  }
  .assessment-companion {
    display: none;
  }
  .assessment-card {
    padding: 20px 12px;
  }
}
.unified-test-view {
  width: min(1050px, 100%);
  margin: 0 auto;
  padding: 30px 34px 60px;
}
.unified-test-card {
  margin: 0 !important;
  min-height: 620px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(490px, 1fr) auto;
  gap: 0 !important;
  padding: 28px !important;
  border: 1px solid #d5dfda !important;
  border-radius: 8px !important;
  background: #f7faf7 !important;
  box-shadow: 0 16px 38px rgba(31, 65, 52, 0.1) !important;
  contain: layout;
  isolation: isolate;
  overflow: hidden;
}
.unified-test-header {
  width: 100%;
  min-height: 88px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
  gap: 18px;
  padding: 0 4px 18px;
  border-bottom: 1px solid #dce5df;
}
.unified-test-header > div {
  min-width: 0;
}
.unified-test-header progress {
  width: 100%;
  accent-color: var(--green);
}
.unified-test-question {
  width: 100%;
  min-width: 0;
  min-height: 490px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  padding-top: 18px;
}
.unified-test-feedback {
  min-height: 25px;
  margin: 0;
  text-align: center;
  font-weight: 800;
}
.unified-test-feedback.is-correct {
  color: #21785d;
}
.unified-test-feedback.is-wrong {
  color: #9a651f;
}
.unified-test-keyboard {
  width: min(650px, 100%);
}
@media (max-width: 680px) {
  .unified-test-view {
    padding: 22px 12px 42px;
  }
  .unified-test-card {
    padding: 20px 12px !important;
  }
  .unified-test-header {
    grid-template-columns: 1fr;
  }
  .unified-test-question {
    min-height: 440px;
  }
}
:is(.assessment-options, .special-options) button {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.14s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}
:is(.assessment-options, .special-options) button:active:not(:disabled) {
  transform: translateY(3px) scale(0.992);
  box-shadow:
    inset 3px 3px 7px rgba(58, 79, 70, 0.2),
    inset -2px -2px 5px #fff;
}
:is(.assessment-options, .special-options) button:disabled {
  opacity: 1;
  cursor: default;
}
:is(.assessment-options, .special-options) button.answer-selected {
  animation: test-choice-press 0.24s ease-out;
}
:is(.assessment-options, .special-options) button.answer-correct,
:is(.assessment-options, .special-options) button.answer-correct:disabled {
  border-color: #2a9b74;
  background: #dff4e9;
  color: #145f49;
  box-shadow:
    inset 3px 3px 7px rgba(31, 119, 88, 0.16),
    0 0 0 3px rgba(42, 155, 116, 0.12);
}
:is(.assessment-options, .special-options) button.answer-correct::after {
  content: "✓";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #16805f;
  font: 900 24px Arial;
}
:is(.assessment-options, .special-options) button.answer-wrong,
:is(.assessment-options, .special-options) button.answer-wrong:disabled {
  border-color: #dd806e;
  background: #fff0ec;
  color: #8f3f32;
  box-shadow:
    inset 3px 3px 7px rgba(168, 73, 57, 0.12),
    0 0 0 3px rgba(221, 128, 110, 0.1);
  animation: test-choice-wrong 0.28s ease-out;
}
:is(.assessment-options, .special-options) button.answer-wrong::after {
  content: "×";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #c14f3d;
  font: 900 25px Arial;
}
@keyframes test-choice-press {
  45% {
    transform: translateY(3px) scale(0.992);
  }
}
@keyframes test-choice-wrong {
  35% {
    transform: translateX(-4px);
  }
  70% {
    transform: translateX(4px);
  }
}
.context-return-navigation {
  display: flex;
  justify-content: flex-start;
  padding-top: 18px;
}
.context-return-bar {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 max(18px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid #d2ddd7;
  background: #edf2ef;
}
.context-return-bar + .workspace {
  height: calc(100% - 52px);
}
.context-return-navigation button,
.context-return-bar button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 7px;
  background: #dcece5;
  color: #17624f;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    4px 4px 8px #c7d3cd,
    -4px -4px 8px #fff;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.context-return-navigation button:hover,
.context-return-bar button:hover {
  transform: translateY(-1px);
  background: #23856d;
  color: #fff;
  box-shadow:
    5px 6px 10px #becdc6,
    -4px -4px 8px #fff;
}
.context-return-navigation button:active,
.context-return-bar button:active {
  transform: translateY(2px);
  box-shadow:
    inset 3px 3px 6px #176b56,
    inset -2px -2px 5px #4ca087;
}
.lesson-view .context-return-bar {
  height: 58px;
  padding-left: calc(340px + max(24px, (100% - 340px - 1180px)/2));
  padding-right: max(24px, (100% - 340px - 1180px)/2);
  background: #f3f6f4;
}
.lesson-view .context-return-bar + .workspace {
  height: calc(100% - 58px);
}
.lesson-view .context-return-bar button {
  min-height: 38px;
  padding: 0 14px;
  box-shadow:
    2px 3px 7px rgba(69, 96, 85, 0.18),
    -2px -2px 6px #fff;
}
@media (max-width: 1100px) {
  .lesson-view .context-return-bar {
    padding-inline: 18px;
  }
  .lesson-view .context-return-bar + .workspace {
    height: auto;
  }
}

/* Keep the desktop learning structure on landscape phones and tablets. */
@media (orientation: landscape) and (min-width: 700px) and (max-width: 1100px) {
  .lesson-view {
    height: 100%;
  }
  .lesson-view .context-return-bar + .workspace {
    height: calc(100% - 58px);
  }
  .lesson-view .workspace {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    height: 100%;
    overflow: hidden;
  }
  .lesson-view .editor {
    min-width: 0;
    padding: 12px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    overflow: auto;
  }
  .lesson-view .editor-tabs {
    width: 100%;
    margin-inline: 0;
  }
  .lesson-view .preview-shell {
    min-width: 0;
    padding: 10px;
    overflow: auto;
  }
  .lesson-view .preview-shell .page {
    width: 100%;
    padding: 16px;
  }
  .lesson-view .learning-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
    gap: 10px;
  }
  .lesson-view .stage-column .stage {
    min-height: 520px;
  }
  .lesson-view .memory-panel {
    min-width: 0;
    min-height: 520px;
    padding: 16px;
  }
}
@media (max-width: 620px) {
  .lesson-view .context-return-bar {
    height: 54px;
    padding-inline: 12px;
  }
  .lesson-view .context-return-bar button {
    max-width: 100%;
    min-height: 36px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.grouped-word-collection {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.word-collection-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 3px 9px;
  scrollbar-width: thin;
}
.word-collection-tabs button {
  min-height: 42px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #cad8d2;
  border-radius: 7px;
  background: #edf2ef;
  color: #496058;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    3px 4px 8px rgba(58, 79, 70, 0.16),
    -3px -3px 7px #fff;
}
.word-collection-tabs button small {
  color: #7d8d87;
  font-size: 10px;
}
.word-collection-tabs button.active {
  border-color: #176f59;
  background: #23856d;
  color: #fff;
  box-shadow:
    inset 3px 3px 6px #176b56,
    inset -2px -2px 5px #4ca087,
    0 3px 8px rgba(35, 133, 109, 0.2);
}
.word-collection-tabs button.active small {
  color: #d9f2e9;
}
.word-collection-panel {
  display: grid;
  gap: 10px;
}
.word-collection-panel[hidden] {
  display: none !important;
}
.word-collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #bdd3cd;
  border-radius: 7px;
  background: #eaf3ef;
}
.word-collection-toolbar span {
  color: #526a78;
  font-size: 12px;
  font-weight: 800;
}
.word-collection-toolbar button {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 8px rgba(33, 93, 75, 0.2);
}
.word-collection-toolbar button:active {
  transform: translateY(2px);
  box-shadow: inset 3px 3px 6px #176b56;
}
.report-drill-word-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 11px;
  max-height: 410px;
  overflow: auto;
  padding: 2px 7px 7px 2px;
}
.report-drill-word-list button {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #b7cec7;
  border-radius: 7px;
  background: #f4f7f5;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow:
    4px 4px 9px rgba(83, 110, 100, 0.18),
    -3px -3px 8px rgba(255, 255, 255, 0.9);
}
.report-drill-word-list button:hover {
  border-color: #5d9f8c;
  background: #dfefe8;
  transform: translateY(-1px);
}
.unit-detail-words .unit-detail-word {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #c6d8d6;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.period-weak-words button {
  padding: 6px 10px;
  border: 1px solid #bdd8cc;
  border-radius: 5px;
  background: #dfeee8;
  color: #17624f;
  font: 800 13px Arial;
  cursor: pointer;
}
.wordbook-list-host {
  display: grid;
  gap: 12px;
}
@media (max-width: 620px) {
  .word-collection-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .word-collection-toolbar button {
    width: 100%;
  }
  .word-collection-tabs {
    padding-inline: 3px;
  }
}
@media (max-width: 1100px) {
  .error-breakdown {
    grid-template-columns: 1fr;
  }
}

/* Final role layer: command hierarchy must win over generic raised-surface rules. */
.ai-guide-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}
.ai-guide-controls[hidden] {
  display: none !important;
}
.ai-guide-controls .mnemonic-narration,
.ai-guide-controls .bridge-narration {
  margin-top: 0;
}
.ai-guide-auto {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd8d2;
  border-radius: 18px;
  background: #f5f8f6;
  color: #587068;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.ai-guide-auto i {
  position: relative;
  width: 27px;
  height: 15px;
  border-radius: 10px;
  background: #bdc9c4;
}
.ai-guide-auto i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}
.ai-guide-auto.active {
  border-color: #8fc3b2;
  background: #e8f5f0;
  color: #176b57;
}
.ai-guide-auto.active i {
  background: #23856d;
}
.ai-guide-auto.active i::after {
  transform: translateX(12px);
}
.memory-ai-guide-controls {
  margin-top: 10px;
}
.unit-list .unit-card .unit-restart {
  border-color: #8ab3a5;
  background: #fff;
  color: var(--green);
  box-shadow: none;
}
.unit-list .unit-card .unit-continue {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: var(--control-primary);
}
.unit-list .unit-card .unit-restart:not(:disabled):hover {
  background: #f2f8f5;
  box-shadow: 0 3px 8px rgba(49, 77, 66, 0.12);
}
.unit-list .unit-card .unit-continue:not(:disabled):hover {
  background: #176f5b;
  border-color: #176f5b;
  box-shadow: 0 6px 14px rgba(35, 133, 109, 0.24);
}
