:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee7;
  --text: #22231f;
  --muted: #6f7169;
  --line: #ddd9ce;
  --primary: #2f6f63;
  --primary-dark: #214f47;
  --accent-soft: #f6e5d8;
  --warn: #b45f2a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #e9efe9 0%, var(--bg) 42%);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.topbar {
  padding: 24px 20px 18px;
  background: #e7efe9;
  border-bottom: 1px solid rgba(47, 111, 99, 0.12);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  letter-spacing: 0;
}

.subtle {
  color: var(--muted);
  line-height: 1.6;
}

.page {
  padding: 18px 16px 28px;
}

.summary-band,
.question-band,
.feedback-band,
.rating-band,
.completion-band {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.share-card,
.share-copy {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.share-card {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #eef5f1 100%);
}

.share-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--primary-dark);
  background: #dce9e4;
  font-size: 13px;
  font-weight: 700;
}

.share-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.share-metrics div {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.share-metrics strong,
.share-metrics span {
  display: block;
}

.share-metrics strong {
  font-size: 20px;
}

.share-metrics span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.share-insight {
  margin-bottom: 0;
  color: #33352f;
  line-height: 1.75;
}

.share-copy {
  margin-top: 14px;
}

.share-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.inline-action {
  margin-top: 14px;
}

.special-band {
  margin-top: 14px;
}

.type-band {
  margin-bottom: 14px;
}

.type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.type-chip {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbf8;
  cursor: pointer;
}

.type-chip strong,
.type-chip span {
  font-size: 13px;
}

.type-chip span {
  color: var(--muted);
}

.type-chip.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.type-chip.active span {
  color: rgba(255, 255, 255, 0.82);
}

.type-chip:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.special-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.special-card {
  display: grid;
  width: 100%;
  gap: 6px;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfbf8;
  text-align: left;
  cursor: pointer;
}

.special-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.special-card strong {
  font-size: 16px;
}

.special-card span {
  color: var(--muted);
  line-height: 1.5;
}

.special-card em {
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

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

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

.metric strong {
  display: block;
  font-size: 20px;
  line-height: 1.15;
}

.metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  color: #fff;
  background: var(--primary);
}

.secondary-btn {
  color: var(--primary-dark);
  background: #dce9e4;
}

.ghost-btn {
  color: var(--primary-dark);
  background: transparent;
  border: 1px solid var(--line);
}

.small-btn {
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.small-action {
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.button-row > button {
  flex: 1;
}

.question-meta,
.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-meta {
  margin-bottom: 14px;
}

.pill,
.keyword {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.pill {
  background: var(--surface-2);
  color: var(--muted);
}

.keyword {
  background: var(--accent-soft);
  color: #7d421f;
}

.scene-text {
  margin: 14px 0 0;
  color: #33352f;
  font-size: 16px;
  line-height: 1.8;
}

.option-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.option {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  text-align: left;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.option.selected {
  border-color: var(--primary);
  background: #e7f0ec;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0 0 14px;
}

.step {
  height: 5px;
  border-radius: 99px;
  background: #d9d5cb;
}

.step.active {
  background: var(--primary);
}

.textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.6;
  background: var(--surface);
  color: var(--text);
}

.voice-input-row {
  display: grid;
  grid-template-columns: 1fr 76px;
  align-items: stretch;
  gap: 10px;
}

.voice-input-row .textarea {
  min-height: 126px;
}

.voice-btn {
  min-height: 126px;
  border: 1px solid #9fc9c0;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #edf6f3;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.voice-btn.active {
  color: #fff;
  background: var(--warn);
  border-color: var(--warn);
}

.voice-btn.pending {
  opacity: 0.72;
}

.word-count {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  text-align: right;
}

.word-count.warn {
  color: var(--warn);
}

.feedback-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.feedback-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.feedback-block p {
  margin-bottom: 0;
  line-height: 1.75;
  color: #33352f;
}

.rating-band {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.rating-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.rating-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rating-btn {
  min-height: 44px;
  color: var(--primary-dark);
  background: #f7f2ea;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

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

.ability-insight {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ability-insight h3 {
  margin-bottom: 4px;
}

.ability-insight p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.ability-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ability-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
}

.ability-chip strong,
.ability-chip span {
  font-size: 13px;
}

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

.record-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
}

.record-item strong {
  line-height: 1.45;
}

.record-item span,
.record-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.score-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.score-row {
  display: grid;
  grid-template-columns: 92px 1fr 28px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.progress-card {
  display: grid;
  gap: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #eef6f0 100%);
}

.progress-scene {
  position: relative;
  min-height: 150px;
  border: 1px solid rgba(47, 111, 99, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(232, 242, 236, 0.86) 0%, rgba(251, 248, 241, 0.92) 70%),
    radial-gradient(circle at 18% 20%, rgba(246, 229, 216, 0.9), transparent 28%);
}

.progress-board {
  position: absolute;
  left: 22px;
  top: 18px;
  display: grid;
  gap: 7px;
  width: 104px;
  padding: 12px;
  border: 2px solid #2f6f63;
  border-radius: 8px;
  background: #f7fbf6;
  box-shadow: 0 8px 0 rgba(47, 111, 99, 0.08);
}

.progress-board span {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #cddfd6;
}

.progress-board span:nth-child(2) {
  width: 74%;
}

.progress-board span:nth-child(3) {
  width: 50%;
}

.progress-teacher,
.progress-child {
  position: absolute;
  bottom: 30px;
}

.progress-teacher {
  left: 168px;
}

.progress-child {
  right: 72px;
  transform: scale(0.86);
  transform-origin: bottom center;
}

.teacher-head,
.child-head {
  width: 42px;
  height: 42px;
  border: 3px solid #214f47;
  border-radius: 50%;
  background: #f7d9c5;
}

.teacher-body,
.child-body {
  width: 50px;
  height: 54px;
  margin-top: -4px;
  border: 3px solid #214f47;
  border-radius: 18px 18px 10px 10px;
  background: #88b7aa;
}

.child-body {
  background: #f0b46e;
}

.progress-desk {
  position: absolute;
  left: 210px;
  right: 34px;
  bottom: 24px;
  height: 18px;
  border-radius: 999px;
  background: #d8b58a;
}

.progress-desk::before,
.progress-desk::after {
  position: absolute;
  top: 16px;
  width: 8px;
  height: 28px;
  border-radius: 999px;
  background: #a37750;
  content: "";
}

.progress-desk::before {
  left: 24px;
}

.progress-desk::after {
  right: 24px;
}

.progress-copy h3 {
  margin-bottom: 6px;
}

.progress-copy p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.cartoon-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9d6ca;
}

.cartoon-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6f63, #8bb9a8);
  animation: progress-slide 1.5s ease-in-out infinite;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-35%);
  }
  50% {
    transform: translateX(85%);
  }
  100% {
    transform: translateX(230%);
  }
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #ddd8cd;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.toast {
  margin-top: 12px;
  color: var(--warn);
  font-size: 14px;
  line-height: 1.5;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 420px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 23px;
  }

  .progress-teacher {
    left: 148px;
  }

  .progress-child {
    right: 38px;
  }

  .progress-desk {
    left: 182px;
    right: 20px;
  }
}
