@font-face {
  font-family: "Andika";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/andika-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Andika";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/andika-latin-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --word-font: "Andika", "Trebuchet MS", Arial, sans-serif;
  --bg: #edf8f5;
  --panel: #fbfdf8;
  --surface: #f3fbf3;
  --control: #fffdf7;
  --ink: #20343a;
  --muted: #61747a;
  --line: #cfe1da;
  --blue: #4f87a3;
  --green: #4f9378;
  --red: #b56560;
  --amber: #c8963f;
  --peach: #efaa90;
  --mint: #a7dbbd;
  --sky: #a8d8ef;
  --lemon: #efd665;
  --soft-blue: #e6f4fb;
  --soft-green: #e5f6ec;
  --soft-red: #f7e7e2;
  --shadow: 0 12px 28px rgba(32, 52, 58, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  touch-action: pan-x pan-y;
}

body {
  background:
    linear-gradient(90deg, rgba(79, 135, 163, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(79, 147, 120, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf5 0, #f4fbf7 280px, var(--bg) 100%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
  color: var(--ink);
  font-family: var(--ui-font);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(79, 135, 163, 0.18);
}

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

.app {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.orientation-lock {
  display: none;
}

@media (orientation: portrait) {
  .orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--bg);
    color: var(--ink);
    padding: 24px;
    text-align: center;
  }

  .orientation-lock > div {
    display: grid;
    gap: 10px;
    max-width: 360px;
  }

  .orientation-lock strong {
    font-size: 32px;
  }

  .orientation-lock span {
    color: var(--muted);
    font-size: 18px;
  }
}

.topbar,
.parent-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.94);
  padding: 12px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions,
.parent-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.star-counter {
  display: inline-flex;
  min-height: 42px;
  min-width: 86px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 150, 63, 0.42);
  border-radius: 8px;
  background: #fff6c8;
  color: #5b4b1a;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(200, 150, 63, 0.12);
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--sky) 0 48%, var(--lemon) 48% 82%, var(--peach) 82% 100%);
  color: #2f3f3c;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.brand h1 {
  font-size: 24px;
  line-height: 1.1;
}

#progressText,
.muted-text,
.field span,
.word-cn,
.quiz-meta,
.done-copy {
  color: var(--muted);
}

.child-view {
  display: grid;
  gap: 16px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.child-view button,
.child-view canvas,
.child-view .hero-panel,
.child-view .quiz-card,
.child-view .study-card,
.child-view .write-card,
.child-view .done-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.child-view input,
.child-view select,
.child-view textarea {
  -webkit-user-select: text;
  user-select: text;
}

.app-version {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.hero-panel,
.panel,
.quiz-card,
.study-card,
.write-card,
.done-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.compact-hero {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  box-shadow: none;
}

.compact-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--peach), var(--lemon), var(--mint), var(--sky));
}

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

.hero-title {
  overflow-wrap: anywhere;
  font-size: clamp(30px, 6vw, 64px);
  line-height: 1.06;
  font-weight: 850;
}

.compact-hero .hero-title {
  font-size: 22px;
}

.hero-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
}

.compact-hero .hero-subtitle {
  margin-top: 4px;
  font-size: 15px;
}

.word-progress {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.word-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(79, 135, 163, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.9);
}

.word-dot.done {
  border-color: rgba(79, 147, 120, 0.34);
  background: var(--mint);
}

.word-dot.active {
  border-color: rgba(200, 150, 63, 0.46);
  background: var(--lemon);
  box-shadow: 0 0 0 4px rgba(239, 214, 101, 0.24);
}

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

.word-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  min-height: 92px;
}

.word-tile strong,
.record-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.word-tile strong,
.masked-word,
.choice-button,
.study-word,
.single-write-word,
.write-word,
.image-card strong {
  font-family: var(--word-font);
  font-variant-ligatures: none;
}

.word-cn {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.step-indicator {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: min(560px, 48vw);
  pointer-events: none;
}

.step-pill {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: default;
  user-select: none;
}

.step-index {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.95);
  color: #7b8278;
  box-shadow: inset 0 0 0 1px rgba(84, 99, 91, 0.16);
  font-size: 12px;
  font-weight: 900;
}

.step-name {
  white-space: nowrap;
}

.step-pill.active {
  color: #51472b;
}

.step-pill.done {
  color: #557765;
}

.step-pill.active .step-index {
  background: var(--lemon);
  color: #51472b;
  box-shadow: 0 0 0 4px rgba(239, 214, 101, 0.22);
}

.step-pill.done .step-index {
  background: #a8ddb8;
  color: #245c45;
  box-shadow: inset 0 0 0 1px rgba(79, 147, 120, 0.24);
  font-size: 15px;
}

.quiz-card,
.study-card,
.write-card,
.done-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.focus-card {
  position: relative;
  overflow: hidden;
  min-height: min(560px, calc(100vh - 210px));
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(243, 251, 243, 0.84)),
    var(--panel);
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.focus-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: linear-gradient(90deg, var(--peach), var(--lemon), var(--mint), var(--sky));
}

.focus-card.ok {
  border-color: rgba(93, 127, 108, 0.55);
  background: var(--panel);
}

.focus-card.no {
  border-color: rgba(166, 107, 97, 0.5);
  background: var(--panel);
}

.quiz-top,
.write-top,
.panel-head {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.quiz-top h2,
.write-top h2 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.08;
}

.study-card {
  grid-template-rows: minmax(0, 1fr) auto;
  text-align: center;
  align-content: stretch;
}

.study-card .submit-strip {
  justify-content: center;
  text-align: center;
}

.study-card .write-actions {
  justify-content: center;
}

.study-main {
  display: grid;
  gap: 18px;
  align-content: center;
  justify-items: center;
  min-height: 0;
}

.study-nav-strip {
  align-self: end;
  min-height: 112px;
}

.study-nav-actions {
  display: grid;
  grid-template-columns: minmax(132px, 132px) minmax(220px, max-content);
  justify-content: center;
  align-items: center;
  min-height: 48px;
}

.study-nav-button {
  min-width: 132px;
}

.study-next-button {
  min-width: 220px;
}

.invisible-nav-button {
  visibility: hidden;
  pointer-events: none;
}

.study-word {
  overflow-wrap: anywhere;
  font-size: clamp(46px, 10vw, 92px);
  line-height: 1.04;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.study-cn {
  color: #9d6058;
  font-size: clamp(24px, 5vw, 44px);
  font-weight: 800;
}

.study-example {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.study-example-row {
  display: inline-flex;
  max-width: min(680px, 100%);
  justify-content: center;
  align-items: center;
  gap: 10px;
  justify-self: center;
  flex-wrap: wrap;
}

.sound-button {
  justify-self: center;
  min-width: min(260px, 100%);
  min-height: 58px;
  border: 1px solid rgba(79, 147, 120, 0.38);
  border-radius: 8px;
  background: linear-gradient(180deg, #effbef, #dff4e6);
  color: #2f654f;
  font-weight: 850;
  box-shadow: 0 3px 0 rgba(79, 147, 120, 0.16);
}

.mini-sound-button {
  min-height: 34px;
  border: 1px solid rgba(79, 135, 163, 0.28);
  border-radius: 8px;
  background: var(--soft-blue);
  color: #4f7182;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
}

.quiz-sound-button {
  min-width: min(320px, 100%);
  min-height: 66px;
  font-size: 22px;
}

.dictation-hint {
  color: var(--muted);
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.quiz-meta {
  font-weight: 700;
}

.masked-word {
  overflow-wrap: anywhere;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: 0;
  white-space: pre-wrap;
  text-align: center;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 14px;
  width: min(520px, 100%);
  justify-self: center;
}

.word-choices {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  width: min(680px, 100%);
}

.choice-button {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(79, 135, 163, 0.08);
}

.chunk-choice-button {
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: 0;
}

.word-choice-button {
  min-height: 92px;
  font-size: clamp(24px, 4vw, 34px);
}

.meaning-answer {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.meaning-answer strong {
  overflow-wrap: anywhere;
  font-family: var(--word-font);
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1.08;
}

.remember-button {
  justify-self: center;
  min-width: min(260px, 100%);
  min-height: 62px;
}

.choice-button:active {
  border-color: var(--blue);
  background: var(--soft-blue);
}

@media (hover: hover) and (pointer: fine) {
  .choice-button:hover,
  .plain-button:hover,
  .quiet-button:hover,
  .icon-button:hover {
    border-color: var(--blue);
    background: var(--soft-blue);
  }
}

.feedback {
  min-height: 28px;
  text-align: center;
  font-weight: 800;
}

.feedback.no {
  display: inline-flex;
  justify-self: center;
  min-height: 34px;
  align-items: center;
  border-radius: 8px;
  background: var(--soft-red);
  padding: 0 14px;
}

.feedback.ok {
  color: var(--green);
}

.feedback.no {
  color: var(--red);
}

.write-list {
  display: grid;
  gap: 14px;
}

.write-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

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

.write-word {
  overflow-wrap: anywhere;
  font-size: clamp(24px, 5vw, 42px);
  line-height: 1.08;
  font-weight: 850;
}

.single-write-word {
  overflow-wrap: anywhere;
  text-align: center;
  font-size: clamp(38px, 8vw, 82px);
  line-height: 1.05;
  font-weight: 900;
}

.single-write-item {
  background: transparent;
  border: 0;
  padding: 0;
}

.single-canvas {
  height: min(470px, 52vh);
}

.writing-canvas,
.correction-canvas {
  display: block;
  width: 100%;
  height: 210px;
  border: 1px solid #cfd8cf;
  border-radius: 8px;
  background:
    linear-gradient(0deg, transparent 31px, rgba(184, 206, 216, 0.22) 32px),
    #f2f6ea;
  background-size: 100% 32px, auto;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.32),
    inset 12px 0 0 rgba(232, 180, 158, 0.16);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.correction-canvas {
  height: 180px;
}

.write-actions,
.dialog-actions,
.stack-actions,
.correction-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.submit-strip {
  position: static;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.done-card {
  min-height: 420px;
  place-items: center;
  text-align: center;
}

.done-title {
  color: #557765;
  font-size: clamp(40px, 8vw, 76px);
  line-height: 1;
  font-weight: 900;
}

.reward-line {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  margin-top: 24px;
  border: 1px solid rgba(200, 150, 63, 0.38);
  border-radius: 8px;
  background: #fff6c8;
  color: #5b4b1a;
  padding: 12px 18px;
  font-size: 24px;
  font-weight: 900;
  transform-origin: center;
  animation: reward-pop 520ms cubic-bezier(0.2, 1.2, 0.28, 1) both;
}

.reward-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255, 255, 255, 0.52) 48%, transparent 62% 100%);
  transform: translateX(-120%);
  pointer-events: none;
  animation: reward-shine 900ms ease-out 160ms both;
}

.reward-star {
  display: inline-block;
  font-size: 32px;
  line-height: 1;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 5px 0 rgba(200, 150, 63, 0.16));
  animation: reward-star-hop 900ms ease-out both;
}

.reward-total {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.done-content {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.done-content .done-copy {
  margin: 0;
}

.done-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.primary-button,
.plain-button,
.quiet-button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--control);
  color: var(--ink);
}

.primary-button {
  border-color: rgba(79, 135, 163, 0.56);
  background: linear-gradient(180deg, #5d97b2, #4f7f99);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(42, 86, 103, 0.18);
}

@keyframes reward-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes reward-star-hop {
  0% {
    transform: translateY(0) scale(0.82) rotate(-8deg);
  }
  28% {
    transform: translateY(-18px) scale(1.18) rotate(10deg);
  }
  48% {
    transform: translateY(0) scale(0.98) rotate(-4deg);
  }
  68% {
    transform: translateY(-8px) scale(1.08) rotate(5deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes reward-shine {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reward-line,
  .reward-line::after,
  .reward-star {
    animation: none;
  }
}

.quiet-button {
  color: var(--muted);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  padding: 0;
  place-items: center;
  font-weight: 900;
}

.danger-button {
  color: var(--red);
}

.dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
}

.dialog::backdrop {
  background: rgba(24, 32, 51, 0.38);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  padding: 0 12px;
}

.pin-input {
  -webkit-text-security: disc;
  text-security: disc;
  font-variant-numeric: tabular-nums;
}

.error-text {
  min-height: 22px;
  color: var(--red);
  font-weight: 700;
}

.parent-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  background:
    linear-gradient(180deg, #f5f7f1 0, var(--bg) 280px),
    var(--bg);
  padding: 20px;
}

.parent-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.parent-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.panel .panel-head {
  justify-content: space-between;
  text-align: left;
}

.status-panel {
  grid-column: 1 / -1;
}

.records-panel {
  grid-column: 1;
}

.handwriting-panel {
  grid-column: 2;
}

.settings-panel {
  grid-column: 1;
}

.sync-panel {
  grid-column: 2;
}

.sync-code-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 12px;
}

.sync-code-card span {
  color: var(--muted);
  font-size: 13px;
}

.sync-code-card strong {
  font-size: 24px;
  letter-spacing: 0;
}

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

.status-card,
.record-card,
.image-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.status-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(17px, 1.9vw, 22px);
  line-height: 1.18;
}

.status-card span {
  color: var(--muted);
  font-size: 14px;
}

.status-card.primary-status {
  grid-column: span 2;
  border-color: rgba(79, 135, 163, 0.42);
  background: #fffdf7;
}

.status-card.primary-status strong {
  font-size: clamp(24px, 3vw, 34px);
}

.status-card.wide {
  grid-column: span 2;
}

.unit-gate-card {
  display: grid;
  gap: 8px;
  align-content: start;
}

.small-confirm-button {
  min-height: 38px;
  justify-self: start;
  padding-inline: 16px;
  font-size: 15px;
}

.records-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.record-card {
  width: 100%;
  text-align: left;
}

.record-card.active {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.record-detail {
  display: grid;
  gap: 12px;
}

.image-card img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf2;
}

.handwriting-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.handwriting-shot {
  display: grid;
  gap: 6px;
}

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

.grading-panel {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.grading-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.grade-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
}

.grade-button.selected {
  border-color: rgba(79, 147, 120, 0.46);
  background: var(--soft-green);
  color: #2f654f;
  box-shadow: inset 0 0 0 1px rgba(79, 147, 120, 0.18);
}

.grade-button[data-grade="wrong"].selected,
.grade-button[data-grade="unclear"].selected {
  border-color: rgba(181, 101, 96, 0.48);
  background: var(--soft-red);
  color: #8c4d49;
}

.review-write-card {
  align-content: start;
}

.review-write-head {
  display: grid;
  gap: 6px;
  text-align: center;
}

.review-write-head h2 {
  font-size: 34px;
}

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

.review-write-item {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1.2fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.review-write-word,
.review-write-original {
  display: grid;
  gap: 6px;
}

.review-write-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--word-font);
  font-size: 24px;
}

.review-write-item span {
  color: var(--muted);
}

.review-write-label,
.correction-open-label {
  font-size: 13px;
}

.correction-button,
.small-button {
  min-height: 34px;
  padding: 0 12px;
  justify-self: start;
}

.review-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--lemon);
  color: var(--ink);
  font-weight: 900;
}

.review-write-item img,
.missing-writing {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.missing-writing {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.review-correction {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

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

.correction-head span {
  color: var(--ink);
  font-weight: 800;
}

.correction-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%) translateY(18px);
  max-width: min(520px, calc(100vw - 32px));
  border-radius: 8px;
  background: #3f5551;
  color: #fff;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

.update-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 52;
  transform: translateX(-50%) translateY(18px);
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: #fffdf9;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.update-banner.show {
  opacity: 1;
  transform: translateX(-50%);
  pointer-events: auto;
}

.update-banner[hidden] {
  display: none;
}

.update-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .app,
  .parent-view {
    width: 100%;
  }

  .app {
    padding: 12px 10px 24px;
  }

  .topbar,
  .hero-head,
  .submit-strip,
  .parent-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .word-strip,
  .choices,
  .status-cards,
  .parent-grid {
    grid-template-columns: 1fr;
  }

  .step-indicator {
    justify-content: flex-start;
    max-width: 100%;
  }

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

  .writing-canvas,
  .correction-canvas {
    height: 190px;
  }

  .review-write-list,
  .review-write-item {
    grid-template-columns: 1fr;
  }
}
