:root {
  color-scheme: light;
  --ink: #173c43;
  --ink-soft: #4c6d70;
  --muted: #607878;
  --paper: #fffdf4;
  --surface: #ffffff;
  --surface-soft: #f4fbf8;
  --line: #cfe2dc;
  --line-strong: #a8cbc1;
  --sea: #0b7b78;
  --sea-dark: #075b59;
  --sea-soft: #d8f1e9;
  --coral: #c94f23;
  --coral-dark: #a63e18;
  --coral-soft: #ffeadf;
  --sun: #f6bd3d;
  --sun-soft: #fff2b8;
  --review: #b3452f;
  --review-soft: #fff0ea;
  --shadow: 0 18px 48px rgba(29, 91, 84, 0.12);
  --shadow-small: 0 8px 22px rgba(29, 91, 84, 0.1);
  --radius-small: 10px;
  --radius: 16px;
  --radius-large: 24px;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 8% 2%, rgba(255, 255, 255, 0.92) 0 7rem, transparent 7.1rem),
    linear-gradient(180deg, #dff6f2 0, #f3fbf7 30rem, #f7f4e9 100%);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(215, 91, 42, 0.42);
  outline-offset: 3px;
}

a {
  color: var(--sea-dark);
}

[hidden] {
  display: none !important;
}

.skip-link {
  background: var(--ink);
  border-radius: 0 0 8px 8px;
  clip-path: inset(50%);
  color: #fff;
  height: 1px;
  left: 1rem;
  overflow: hidden;
  padding: 0.75rem 1rem;
  position: fixed;
  top: 0;
  white-space: nowrap;
  width: 1px;
  z-index: 100;
}

.skip-link:focus {
  clip-path: none;
  height: auto;
  top: 0;
  width: auto;
}

.memory-shell {
  margin: 0 auto;
  max-width: 1480px;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 2rem;
}

.memory-hero {
  align-items: stretch;
  background: rgba(255, 253, 244, 0.94);
  border: 1px solid rgba(168, 203, 193, 0.82);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(250px, 360px) 250px;
  min-height: 220px;
  overflow: hidden;
  position: relative;
}

.memory-hero__copy {
  align-content: center;
  display: grid;
  padding: 1.75rem 0.5rem 1.75rem 2rem;
  position: relative;
  z-index: 2;
}

.memory-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.memory-nav a {
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.memory-nav a:hover {
  text-decoration: underline;
}

.eyebrow,
.section-kicker,
.task-kicker {
  color: var(--coral-dark);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

.memory-hero h1 {
  font-family: "STKaiti", "KaiTi", "PingFang SC", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
  margin: 0;
}

.hero-summary {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.75;
  margin: 0.85rem 0 0;
  max-width: 35rem;
}

.memory-hero__scene {
  background: linear-gradient(180deg, #bdece7 0 52%, #78c9bf 52% 72%, #2b9b91 72% 100%);
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
  min-height: 220px;
  overflow: hidden;
  position: relative;
}

.scene-sun {
  background: var(--sun);
  border: 7px solid rgba(255, 244, 190, 0.7);
  border-radius: 50%;
  height: 54px;
  position: absolute;
  right: 40px;
  top: 22px;
  width: 54px;
}

.scene-cloud,
.scene-cloud::before,
.scene-cloud::after {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  position: absolute;
}

.scene-cloud {
  height: 10px;
  left: 80px;
  top: 36px;
  width: 62px;
}

.scene-cloud::before,
.scene-cloud::after {
  content: "";
}

.scene-cloud::before {
  height: 25px;
  left: 12px;
  top: -12px;
  width: 28px;
}

.scene-cloud::after {
  height: 17px;
  right: 8px;
  top: -8px;
  width: 22px;
}

.scene-cloud--two {
  left: 205px;
  opacity: 0.75;
  top: 78px;
  transform: scale(0.7);
}

.scene-island {
  background: #f0d991;
  border-radius: 50% 55% 42% 48%;
  bottom: 28px;
  box-shadow: inset 0 11px 0 #70b96b;
  height: 92px;
  left: 78px;
  position: absolute;
  transform: rotate(-3deg);
  width: 230px;
}

.scene-lighthouse {
  background: repeating-linear-gradient(180deg, #fff8e7 0 17px, #e36d3e 17px 29px);
  bottom: 77px;
  height: 95px;
  left: 190px;
  position: absolute;
  transform: perspective(90px) rotateX(-4deg);
  width: 34px;
  z-index: 2;
}

.scene-lighthouse::before {
  background: var(--coral-dark);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
  height: 22px;
  left: -7px;
  position: absolute;
  top: -25px;
  width: 48px;
}

.scene-lighthouse::after {
  background: #ffe68f;
  box-shadow: -34px 4px 22px 7px rgba(255, 230, 143, 0.48);
  content: "";
  height: 10px;
  left: 8px;
  position: absolute;
  top: -10px;
  width: 18px;
}

.scene-lighthouse i {
  background: var(--sea-dark);
  bottom: 0;
  height: 26px;
  left: 10px;
  position: absolute;
  width: 14px;
}

.scene-path {
  border: 5px dashed rgba(255, 255, 255, 0.8);
  border-bottom: 0;
  border-left-color: transparent;
  border-radius: 50%;
  bottom: 44px;
  height: 60px;
  left: 25px;
  position: absolute;
  transform: rotate(-8deg);
  width: 170px;
}

.scene-boat {
  background: var(--coral);
  border-radius: 0 0 14px 14px;
  bottom: 45px;
  height: 16px;
  left: 29px;
  position: absolute;
  transform: rotate(7deg);
  width: 46px;
}

.scene-boat::before {
  border-bottom: 30px solid #fff8e3;
  border-left: 3px solid transparent;
  border-right: 23px solid transparent;
  content: "";
  left: 18px;
  position: absolute;
  top: -32px;
}

.hero-metrics {
  align-content: center;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 1.25rem;
  position: relative;
  z-index: 3;
}

.hero-metrics div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 45px;
}

.hero-metrics div:last-child {
  border-bottom: 0;
}

.hero-metrics dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.hero-metrics dd {
  color: var(--sea-dark);
  font-size: 1.12rem;
  font-weight: 850;
  margin: 0;
}

.memory-layout {
  align-items: start;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) 330px;
  margin-top: 1.25rem;
}

.memory-main,
.side-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-small);
}

.memory-main {
  border-radius: var(--radius-large);
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 1.75rem);
}

.journey-head,
.side-card__heading,
.task-card__topline,
.plan-progress > div:first-child {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.journey-head {
  gap: 1rem;
}

.journey-head h2,
.side-card h2,
.welcome-card h2,
.task-card h2,
.result-panel h2 {
  letter-spacing: -0.025em;
  margin: 0;
}

.journey-head h2 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.session-controls {
  align-items: center;
  display: flex;
  flex: none;
  gap: 0.75rem;
}

.session-controls span {
  color: var(--sea-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-height: 44px;
  padding: 0 0.35rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.memory-path {
  counter-reset: none;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
}

.memory-path li {
  align-items: center;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 54px;
  padding-right: 1rem;
  position: relative;
}

.memory-path li:not(:last-child)::after {
  background: var(--line);
  content: "";
  height: 3px;
  left: calc(100% - 0.8rem);
  position: absolute;
  top: 26px;
  transform: translateX(-50%);
  width: 1.4rem;
}

.memory-path li > span {
  align-items: center;
  background: var(--surface-soft);
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  display: flex;
  font-size: 0.8rem;
  font-weight: 850;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.memory-path li > div {
  min-width: 0;
}

.memory-path strong,
.memory-path small {
  display: block;
}

.memory-path strong {
  font-size: 0.86rem;
}

.memory-path small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.1rem;
}

.memory-path li.is-active > span {
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: 0 0 0 5px var(--coral-soft);
  color: #fff;
}

.memory-path li.is-active strong {
  color: var(--coral-dark);
}

.memory-path li.is-complete > span {
  background: var(--sea);
  border-color: var(--sea);
  color: #fff;
}

.memory-path li.is-complete:not(:last-child)::after {
  background: var(--sea);
}

.welcome-card,
.task-card,
.result-panel {
  background: var(--paper);
  border: 1px solid #e6dcb9;
  border-radius: var(--radius);
  min-height: 430px;
}

.welcome-card {
  align-items: center;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.welcome-card__mark {
  align-items: center;
  background: var(--sun-soft);
  border: 2px solid #e3b53b;
  border-radius: 50%;
  color: #9e6b00;
  display: flex;
  font-size: 2.5rem;
  height: 84px;
  justify-content: center;
  transform: rotate(-8deg);
  width: 84px;
}

.welcome-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.welcome-card p:not(.task-kicker) {
  color: var(--ink-soft);
  line-height: 1.8;
  margin: 0.8rem 0;
  max-width: 42rem;
}

.welcome-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.welcome-rules li {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.welcome-rules span {
  color: var(--coral-dark);
  font-size: 1.1rem;
  margin-right: 0.2rem;
}

.primary-button,
.result-actions button,
.recall-tools button,
.sound-button,
.meaning-choices button {
  border-radius: var(--radius-small);
  font-weight: 800;
  min-height: 44px;
}

.primary-button {
  background: var(--sea);
  border: 1px solid var(--sea-dark);
  box-shadow: 0 5px 0 var(--sea-dark);
  color: #fff;
  padding: 0.75rem 1.25rem;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: #096d6a;
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled) {
  box-shadow: 0 2px 0 var(--sea-dark);
  transform: translateY(3px);
}

.task-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  padding: clamp(1rem, 3vw, 2rem);
}

.task-card__topline {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.phase-badge {
  background: var(--coral-soft);
  border: 1px solid #efb89f;
  border-radius: 999px;
  color: var(--coral-dark);
  padding: 0.32rem 0.7rem;
}

.task-heading {
  margin: 1.1rem auto 0;
  max-width: 680px;
  text-align: center;
  width: 100%;
}

.task-heading h2 {
  font-size: clamp(1.35rem, 2.7vw, 2rem);
}

.task-heading > p:last-child {
  color: var(--muted);
  line-height: 1.65;
  margin: 0.4rem 0 0;
}

.memory-cue {
  align-content: center;
  display: grid;
  justify-items: center;
  margin: 1.1rem auto;
  max-width: 760px;
  min-height: 150px;
  text-align: center;
  width: 100%;
}

.memory-cue > strong {
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: clamp(2.7rem, 7vw, 5.3rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.memory-cue > strong.is-prompt {
  color: var(--sea-dark);
  font-family: inherit;
  font-size: clamp(1.8rem, 4vw, 3.15rem);
  letter-spacing: 0;
}

.memory-cue > span {
  color: var(--sea-dark);
  font-size: 0.95rem;
  margin-top: 0.45rem;
}

.memory-cue > p {
  color: var(--ink-soft);
  font-size: 1.12rem;
  line-height: 1.65;
  margin: 0.6rem 0 0;
}

.sound-button {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--sea-dark);
  margin-top: 0.75rem;
  padding: 0.55rem 0.9rem;
}

.sound-button:hover:not(:disabled) {
  background: var(--sea-soft);
}

.spell-pattern {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.spell-pattern span {
  align-items: center;
  background: #fff;
  border-bottom: 3px solid var(--sun);
  border-radius: 7px 7px 3px 3px;
  display: flex;
  font-size: 1rem;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  text-transform: uppercase;
  width: 30px;
}

.memory-clue-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0 auto 1rem;
  max-width: 760px;
  width: 100%;
}

.memory-clue-grid.has-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.context-card,
.confusable-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  padding: 0.85rem 1rem;
}

.context-card {
  border-left: 4px solid var(--sun);
}

.confusable-card {
  border-left: 4px solid var(--coral);
}

.clue-card__heading {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.clue-card__heading > span {
  align-items: center;
  background: var(--sun-soft);
  border-radius: 50%;
  color: #8a6200;
  display: flex;
  font-size: 0.82rem;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.confusable-card .clue-card__heading > span {
  background: var(--coral-soft);
  color: var(--coral-dark);
}

.clue-card__heading h3 {
  color: var(--ink-soft);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  margin: 0;
}

.context-card > p {
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.96rem;
  line-height: 1.65;
  margin: 0;
}

.confusable-pair {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.confusable-pair > b {
  color: var(--coral-dark);
}

.confusable-pair p {
  min-width: 0;
  margin: 0;
}

.confusable-pair strong,
.confusable-pair span {
  display: block;
  overflow-wrap: anywhere;
}

.confusable-pair strong {
  color: var(--sea-dark);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 1rem;
}

.confusable-pair span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
  margin-top: 0.15rem;
}

.meaning-choices {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto 1rem;
  max-width: 760px;
  width: 100%;
}

.meaning-choices button {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  line-height: 1.45;
  min-height: 58px;
  padding: 0.7rem 1rem;
  text-align: left;
}

.meaning-choices button:hover:not(:disabled) {
  background: var(--sea-soft);
  border-color: var(--sea);
}

.meaning-choices button.is-selected {
  border-color: var(--coral);
  box-shadow: inset 4px 0 0 var(--coral);
}

.meaning-choices button.is-correct {
  background: var(--sea-soft);
  border-color: var(--sea);
}

.meaning-choices button.is-wrong {
  background: var(--review-soft);
  border-color: var(--review);
}

.recall-form {
  margin: 0 auto;
  max-width: 760px;
  width: 100%;
}

.recall-form > label {
  color: var(--ink-soft);
  display: block;
  font-size: 0.83rem;
  font-weight: 750;
  margin-bottom: 0.45rem;
}

.recall-form > input {
  background: #fff;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-small);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  height: 54px;
  letter-spacing: 0.08em;
  padding: 0 0.9rem;
  text-align: center;
  text-transform: lowercase;
  width: 100%;
}

.recall-form > input:focus {
  border-color: var(--sea);
}

.answer-slots {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  min-height: 18px;
  padding: 0.4rem 0;
}

.answer-slots span {
  background: var(--line-strong);
  border-radius: 999px;
  height: 3px;
  width: 18px;
}

.answer-slots span.is-filled {
  background: var(--sea);
}

.answer-slots span.is-hinted {
  background: var(--sun);
}

.recall-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.2rem 0 0.75rem;
}

.recall-tools button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.76rem;
  padding: 0.4rem 0.75rem;
}

.recall-tools button:hover:not(:disabled) {
  background: #fff;
  border-color: var(--sea);
}

.letter-bank-wrap {
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-small);
  padding: 0.75rem;
}

.letter-bank-wrap > span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.letter-bank button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-bottom: 4px solid var(--line-strong);
  border-radius: 9px;
  display: flex;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 1rem;
  font-weight: 850;
  height: 46px;
  justify-content: center;
  text-transform: uppercase;
  width: 46px;
}

.letter-bank button:hover:not(:disabled) {
  border-color: var(--sea);
  transform: translateY(-1px);
}

.letter-bank button.is-used {
  background: #edf2ef;
  border-bottom-width: 1px;
  color: #91a29d;
  transform: translateY(3px);
}

.recall-form > .primary-button {
  display: block;
  margin: 0.8rem auto 1rem;
  min-width: 170px;
}

.memory-feedback {
  border-left: 5px solid var(--sea);
  border-radius: var(--radius-small);
  line-height: 1.65;
  margin: 0 auto 1rem;
  max-width: 760px;
  padding: 0.8rem 1rem;
  width: 100%;
}

.memory-feedback strong,
.memory-feedback span {
  display: block;
}

.memory-feedback span {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.answer-comparison {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin-top: 0.65rem;
}

.answer-comparison .answer-comparison__label {
  color: var(--ink-soft);
  display: inline;
  font-size: 0.72rem;
  margin: 0 0.25rem 0 0;
}

.answer-comparison b {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.9rem;
  height: 27px;
  justify-content: center;
  text-transform: uppercase;
  width: 25px;
}

.answer-comparison b.is-match {
  border-color: var(--sea);
  color: var(--sea-dark);
}

.answer-comparison b.is-mismatch {
  background: #fff4de;
  border-color: var(--review);
  color: var(--review);
}

.memory-feedback.is-correct {
  background: var(--sea-soft);
  border-color: var(--sea);
}

.memory-feedback.is-wrong {
  background: var(--review-soft);
  border-color: var(--review);
}

.memory-feedback.is-hint {
  background: var(--sun-soft);
  border-color: var(--sun);
}

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

.task-actions .primary-button {
  min-width: 180px;
}

.result-panel {
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.result-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.result-heading__star {
  align-items: center;
  background: var(--sun-soft);
  border: 2px solid var(--sun);
  border-radius: 50%;
  color: #916000;
  display: flex;
  flex: none;
  font-size: 1.8rem;
  height: 64px;
  justify-content: center;
  width: 64px;
}

.result-heading p:last-child {
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0.35rem 0 0;
}

.result-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.5rem 0;
}

.result-metrics div {
  border: 1px solid var(--line);
  border-top-width: 5px;
  border-radius: var(--radius-small);
  padding: 0.85rem;
  text-align: center;
}

.result-metrics__remembered {
  border-top-color: var(--sea) !important;
}

.result-metrics__hinted {
  border-top-color: var(--sun) !important;
}

.result-metrics__review {
  border-top-color: var(--review) !important;
}

.result-metrics dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.result-metrics dd {
  font-size: 1.75rem;
  font-weight: 900;
  margin: 0.25rem 0 0;
}

.result-words {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-word {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 0.25rem 0.6rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.65rem 0.75rem;
}

.result-word strong,
.result-word span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-word span {
  color: var(--muted);
  font-size: 0.74rem;
}

.result-word em {
  border-radius: 999px;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  grid-row: 1 / 3;
  padding: 0.3rem 0.55rem;
}

.result-word.is-remembered em {
  background: var(--sea-soft);
  color: var(--sea-dark);
}

.result-word.is-hinted em {
  background: var(--sun-soft);
  color: #765000;
}

.result-word.is-review em {
  background: var(--review-soft);
  color: var(--review);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.result-actions button {
  padding: 0.65rem 1rem;
}

.result-actions button:not(.primary-button) {
  background: #fff;
  border: 1px solid var(--line-strong);
}

.memory-side {
  align-items: start;
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.side-card {
  border-radius: var(--radius);
  padding: 1rem;
}

.side-card h2 {
  font-size: 1rem;
}

.side-card__heading {
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.side-card__heading > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.plan-card {
  border-top: 5px solid var(--coral);
}

.plan-card label {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.plan-card label > span {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 750;
}

.plan-card select {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  min-height: 44px;
  padding: 0 0.7rem;
  width: 100%;
}

.plan-progress {
  background: var(--surface-soft);
  border-radius: 9px;
  margin: 0.9rem 0;
  padding: 0.75rem;
}

.plan-progress span,
.plan-progress p {
  color: var(--muted);
  font-size: 0.72rem;
}

.plan-progress p {
  margin: 0.5rem 0 0;
}

.plan-progress__track {
  background: #dbeae5;
  border-radius: 999px;
  height: 7px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.plan-progress__track i {
  background: var(--sea);
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 240ms ease;
}

.plan-card > .primary-button {
  width: 100%;
}

.queue-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.queue-preview p {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.65;
  margin: 0;
}

.queue-preview span {
  background: var(--sea-soft);
  border: 1px solid #b2dbd0;
  border-radius: 999px;
  color: var(--sea-dark);
  font-size: 0.7rem;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  padding: 0.3rem 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-metrics {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.archive-metrics div {
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 0.65rem 0.35rem;
  text-align: center;
}

.archive-metrics dt {
  color: var(--muted);
  font-size: 0.66rem;
}

.archive-metrics dd {
  color: var(--sea-dark);
  font-size: 1.15rem;
  font-weight: 900;
  margin: 0.2rem 0 0;
}

.retention-card {
  border-top: 5px solid var(--sea);
}

.estimate-badge {
  background: var(--sea-soft);
  border: 1px solid #b2dbd0;
  border-radius: 999px;
  color: var(--sea-dark) !important;
  padding: 0.25rem 0.5rem;
}

.retention-chart {
  display: block;
  height: auto;
  margin-top: 0.25rem;
  overflow: visible;
  width: 100%;
}

.retention-chart__grid line {
  stroke: #d9e9e4;
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.retention-chart__line {
  fill: none;
  stroke: var(--sea);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.retention-chart__dots circle {
  fill: #fff;
  stroke: var(--coral);
  stroke-width: 3;
}

.retention-chart.is-empty {
  opacity: 0.38;
}

.retention-days {
  color: var(--muted);
  display: grid;
  font-size: 0.6rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: -0.9rem 0 0;
  text-align: center;
}

.retention-summary {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.55;
  margin: 0.75rem 0 0;
}

.retention-note {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.55;
  margin: 0.45rem 0 0;
}

.method-card ol {
  display: grid;
  gap: 0.7rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
}

.method-card li {
  align-items: start;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 32px 1fr;
}

.method-card li > span {
  color: var(--coral-dark);
  font-size: 0.68rem;
  font-weight: 900;
  padding-top: 0.15rem;
}

.method-card p {
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
  margin: 0;
}

.method-card strong {
  color: var(--ink);
  display: block;
}

.memory-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.75rem;
  justify-content: space-between;
  padding: 1.25rem 0 0;
}

.memory-footer p {
  margin: 0;
}

.memory-footer a {
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 1160px) {
  .memory-hero {
    grid-template-columns: minmax(0, 1fr) 290px 225px;
  }

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

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

@media (max-width: 860px) {
  .memory-hero {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .memory-hero__copy {
    padding: 1.5rem;
  }

  .memory-hero__scene {
    clip-path: none;
  }

  .hero-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0.75rem 1.25rem;
  }

  .hero-metrics div {
    border-bottom: 0;
    display: grid;
    justify-content: center;
    text-align: center;
  }

  .welcome-card {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .welcome-card__mark {
    font-size: 2rem;
    height: 62px;
    width: 62px;
  }

  .welcome-card > .primary-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 680px) {
  .memory-shell {
    padding: 0.75rem 0.75rem 1.5rem;
  }

  .memory-hero {
    display: block;
    min-height: 0;
  }

  .memory-hero__copy {
    padding: 1.25rem;
  }

  .memory-hero__scene {
    display: none;
  }

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

  .hero-metrics dt {
    font-size: 0.65rem;
  }

  .hero-metrics dd {
    font-size: 0.95rem;
  }

  .journey-head {
    align-items: start;
    display: grid;
  }

  .session-controls {
    justify-content: space-between;
    width: 100%;
  }

  .memory-path {
    gap: 0.45rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-path li {
    background: var(--surface-soft);
    border-radius: 9px;
    padding: 0.4rem;
  }

  .memory-path li::after {
    display: none;
  }

  .welcome-card,
  .task-card,
  .result-panel {
    min-height: 0;
  }

  .welcome-card {
    display: block;
    padding: 1.25rem;
  }

  .welcome-card__mark {
    margin-bottom: 1rem;
  }

  .welcome-card > .primary-button {
    margin-top: 1rem;
    width: 100%;
  }

  .meaning-choices,
  .result-words {
    grid-template-columns: minmax(0, 1fr);
  }

  .memory-clue-grid.has-pair {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .memory-footer {
    align-items: start;
    display: grid;
    gap: 0.5rem;
  }
}

@media (max-width: 420px) {
  .memory-hero h1 {
    font-size: 2.45rem;
  }

  .hero-summary {
    font-size: 0.86rem;
  }

  .hero-metrics {
    padding: 0.65rem;
  }

  .memory-main {
    padding: 0.75rem;
  }

  .memory-path li {
    gap: 0.4rem;
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .memory-path li > span {
    height: 30px;
    width: 30px;
  }

  .memory-path small {
    display: none;
  }

  .task-card,
  .result-panel {
    padding: 1rem;
  }

  .memory-cue > strong {
    font-size: clamp(2.35rem, 15vw, 4rem);
  }

  .memory-cue > strong.is-prompt {
    font-size: 1.8rem;
  }

  .result-metrics {
    gap: 0.4rem;
  }

  .result-metrics div {
    padding: 0.65rem 0.25rem;
  }

  .result-metrics dt {
    font-size: 0.64rem;
  }

  .result-metrics dd {
    font-size: 1.35rem;
  }

  .result-heading__star {
    height: 50px;
    width: 50px;
  }

  .result-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
