:root {
  color-scheme: light;
  --bg: #f5f0e7;
  --panel: #fffdf8;
  --panel-border: #e2d4be;
  --text: #24313a;
  --muted: #6a767e;
  --primary: #1f7a6c;
  --primary-dark: #15574d;
  --secondary: #fff4d8;
  --secondary-border: #d9c9a0;
  --correct-bg: #e4f6ea;
  --correct-border: #69a77b;
  --wrong-bg: #fdeaea;
  --wrong-border: #cb7a7a;
  --shadow: 0 12px 30px rgba(36, 49, 58, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.75), transparent 35%),
    linear-gradient(180deg, #f7f2e9 0%, var(--bg) 100%);
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.app-header {
  margin-bottom: 18px;
  text-align: center;
}

.app-header h1,
.panel h2 {
  margin: 0;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.screen {
  display: none;
}

.screen-active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.debug-panel {
  margin-top: 24px;
  border-top: 2px solid #efe4d4;
  padding-top: 10px;
}

.debug-panel h3 {
  margin: 0;
  font-size: 1.05rem;
}

.debug-summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-size: 1rem;
  padding: 8px 2px;
  user-select: none;
}

.debug-summary::marker {
  color: var(--primary);
}

.debug-panel-body {
  padding-top: 10px;
}

.support-text,
.prompt-label,
.score-text {
  color: var(--muted);
}

.button-stack,
.button-row,
.lesson-list,
.options-container,
.voice-list {
  display: grid;
  gap: 14px;
}

.voice-chip {
  padding: 12px 14px;
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  background: #fff;
  font-size: 0.98rem;
}

.voice-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.voice-control {
  display: grid;
  gap: 8px;
}

.voice-control span {
  color: var(--text);
  font-size: 0.98rem;
}

.voice-select {
  min-height: 52px;
  border-radius: 14px;
  border: 2px solid var(--panel-border);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.voice-chip strong,
.voice-chip span {
  display: block;
}

.voice-chip span {
  margin-top: 4px;
  color: var(--muted);
}

.voice-chip.is-match {
  border-color: var(--primary);
  background: #eef8f5;
}

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

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.primary-button,
.secondary-button,
.text-button,
.lesson-list-button,
.option-button {
  min-height: 56px;
  border-radius: 18px;
  border: 2px solid transparent;
  padding: 14px 18px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-dark);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary-button,
.lesson-list-button {
  background: var(--secondary);
  border-color: var(--secondary-border);
  color: var(--text);
}

.text-button {
  min-height: auto;
  padding: 8px 10px;
  background: transparent;
  color: var(--primary-dark);
}

.lesson-list-button {
  text-align: left;
}

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

.lesson-list-button strong,
.lesson-list-button span {
  display: block;
}

.lesson-list-button span {
  margin-top: 4px;
  color: var(--muted);
}

.lesson-done-badge {
  display: inline-block;
  margin-top: 10px;
  font-style: normal;
  font-size: 0.88rem;
  color: #355247;
  background: #e8efe7;
  border: 1px solid #b8d0bf;
  border-radius: 999px;
  padding: 4px 10px;
}

.lesson-done-button {
  min-width: 84px;
  min-height: 56px;
  border-radius: 16px;
  border: 2px solid var(--secondary-border);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
}

.item-card {
  display: grid;
  gap: 16px;
}

.daily-words-panel {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 38%),
    linear-gradient(180deg, #fbf7ef 0%, #f4ede1 100%);
}

.daily-words-support-text {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1rem;
}

.daily-words-list {
  display: grid;
  gap: 18px;
}

.daily-word-card,
.daily-complete-card,
.daily-reuse-card {
  border-radius: 24px;
  border: 2px solid #e2d8c5;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 24px rgba(36, 49, 58, 0.05);
}

.daily-word-card {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.daily-word-card[data-state="in-progress"] {
  border-color: #d8c7a7;
}

.daily-word-card[data-state="completed"] {
  border-color: #93bc9f;
  background: linear-gradient(180deg, rgba(250, 255, 251, 0.98) 0%, rgba(241, 250, 244, 0.96) 100%);
}

.daily-word-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.daily-word-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.daily-word-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
}

.daily-word-hint,
.daily-card-status,
.daily-example-text,
.daily-starter,
.daily-check-prompt,
.daily-task-text,
.daily-reuse-prompt,
.daily-response-info {
  margin: 0;
}

.daily-word-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.05rem;
}

.daily-card-status {
  color: var(--primary-dark);
  font-size: 0.96rem;
}

.daily-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f7efdc;
  border: 1px solid #e3d2af;
  color: #5b513d;
  font-size: 0.92rem;
}

.daily-word-card[data-state="completed"] .daily-state-badge {
  background: #e3f3e8;
  border-color: #96bc9f;
  color: #355247;
}

.daily-section {
  display: grid;
  gap: 10px;
}

.daily-section-label {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.daily-examples {
  gap: 12px;
}

.daily-example-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #ece1cf;
}

.daily-example-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f7efdc;
  color: #5b513d;
  font-size: 0.84rem;
}

.daily-response-input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border-radius: 18px;
  border: 2px solid var(--panel-border);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 14px 16px;
}

.daily-response-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.daily-mini-button {
  min-height: 46px;
  border-radius: 14px;
  padding: 10px 14px;
}

.daily-skip-button {
  min-height: 46px;
  border-radius: 14px;
  padding: 10px 12px;
}

.daily-contrast-box {
  display: grid;
  gap: 8px;
}

.daily-contrast-line {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #eadfce;
  background: #fff;
}

.daily-contrast-line.is-weaker {
  color: #7a6c58;
}

.daily-contrast-line.is-stronger {
  background: #f4faee;
  border-color: #cfe1c8;
}

.daily-check-options {
  display: grid;
  gap: 10px;
}

.daily-check-option {
  min-height: 58px;
}

.daily-check-feedback {
  min-height: 0;
}

.daily-task-text {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8f4eb;
  border: 1px dashed #d8c7a7;
}

.daily-complete-card,
.daily-reuse-card {
  margin-top: 18px;
  padding: 18px 20px;
}

.daily-complete-card h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.prepositions-panel {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 40%),
    linear-gradient(180deg, #f8f2e8 0%, #efe5d6 100%);
}

.prepositions-support-text {
  margin-top: 0;
  margin-bottom: 16px;
}

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

.preposition-step-tab {
  min-height: 50px;
  border-radius: 16px;
  border: 2px solid #ddceb5;
  background: rgba(255, 250, 241, 0.92);
  color: var(--text);
  padding: 10px 8px;
  cursor: pointer;
}

.preposition-step-tab.is-active {
  background: #eef8f5;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.preposition-step-tab:disabled {
  opacity: 0.58;
  cursor: default;
}

.prepositions-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.98);
  border: 2px solid #e2d8c5;
  min-height: 560px;
}

.prepositions-feedback {
  margin-top: 14px;
}

.prepositions-button-row {
  margin-top: 16px;
}

.preposition-step-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.preposition-eyebrow {
  margin-bottom: 8px;
}

.preposition-word-title,
.preposition-task-title {
  margin: 0;
  line-height: 1.1;
}

.preposition-word-title {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.preposition-task-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.preposition-hint,
.preposition-example-sentence,
.preposition-helper-text,
.preposition-scene-caption,
.preposition-room-example,
.preposition-model-text {
  margin: 0;
}

.preposition-hint {
  color: var(--muted);
  font-size: 1.05rem;
}

.preposition-example-sentence {
  font-size: 1.16rem;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff8ea;
  border: 1px solid #e7d6b8;
}

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

.preposition-mini-button {
  min-height: 48px;
  border-radius: 14px;
}

.preposition-scene-card {
  display: grid;
  gap: 10px;
}

.preposition-scene-caption {
  font-size: 1.04rem;
  color: var(--text);
}

.preposition-scene-stage {
  position: relative;
  min-height: 290px;
  border-radius: 24px;
  border: 2px solid #dfd1ba;
  background:
    linear-gradient(180deg, #fffaf1 0%, #f8f0e1 64%, #efe0c6 64%, #e6d2b1 100%);
  overflow: hidden;
}

.preposition-scene-stage.is-drag-stage {
  touch-action: none;
}

.scene-object {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 18px;
  user-select: none;
  -webkit-user-select: none;
}

.scene-object-label {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  font-size: 0.84rem;
  color: #544d42;
  white-space: nowrap;
}

.scene-object-glyph {
  font-size: 2rem;
  line-height: 1;
}

.scene-object.is-ball,
.scene-object.is-apple,
.scene-object.is-cat,
.scene-object.is-dog {
  border-radius: 999px;
}

.scene-object.is-ball {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #ffffff 12%, #f4f1e2 13%, #e9c655 42%, #cf9d1f 100%);
}

.scene-object.is-apple {
  background: radial-gradient(circle at 34% 28%, #ffd3d3 0%, #ffb6b6 20%, #d94f4f 56%, #a93030 100%);
}

.scene-object.is-book {
  background: linear-gradient(180deg, #6ea6f0 0%, #4274b9 100%);
  border: 2px solid #2d578f;
  border-radius: 10px;
}

.scene-object.is-pencil {
  background: linear-gradient(90deg, #f9df73 0%, #f1bf3e 72%, #ef8c5a 72%, #ef8c5a 100%);
  border: 2px solid #cc9c22;
  border-radius: 999px;
}

.scene-object.is-house,
.scene-object.is-box {
  background: rgba(255, 255, 255, 0.16);
}

.scene-object.is-house .scene-object-glyph,
.scene-object.is-box .scene-object-glyph,
.scene-object.is-cat .scene-object-glyph,
.scene-object.is-dog .scene-object-glyph,
.scene-object.is-shoes .scene-object-glyph {
  font-size: 2.4rem;
}

.scene-object.is-table {
  background: transparent;
}

.table-top {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 22px;
  height: 26px;
  border-radius: 14px;
  background: linear-gradient(180deg, #c98f54 0%, #9a6430 100%);
}

.table-leg {
  position: absolute;
  top: 48px;
  width: 12px;
  bottom: 8px;
  border-radius: 12px;
  background: #845124;
}

.table-leg.is-left {
  left: 28px;
}

.table-leg.is-right {
  right: 28px;
}

.scene-object.is-chair {
  background: transparent;
}

.chair-back,
.chair-seat,
.chair-leg {
  position: absolute;
  background: #8a5e35;
  border-radius: 10px;
}

.chair-back {
  left: 46px;
  top: 8px;
  width: 30px;
  height: 54px;
}

.chair-seat {
  left: 24px;
  top: 56px;
  width: 70px;
  height: 18px;
}

.chair-leg {
  top: 74px;
  width: 10px;
  height: 44px;
}

.chair-leg.is-left {
  left: 30px;
}

.chair-leg.is-right {
  right: 30px;
}

.scene-object.is-basket {
  background: transparent;
}

.basket-rim {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  height: 18px;
  border-radius: 999px;
  border: 4px solid #b9894c;
  background: #f2d2a0;
}

.basket-body {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 14px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #f4d39c 0%, #d19a55 100%);
  border: 3px solid #b67d3f;
}

.drop-zone {
  position: absolute;
  border-radius: 16px;
  border: 2px dashed transparent;
  background: transparent;
  pointer-events: none;
}

.drop-zone.is-hint {
  border-color: rgba(31, 122, 108, 0.45);
  background: rgba(31, 122, 108, 0.08);
}

.scene-object.is-draggable {
  z-index: 6;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 10px 18px rgba(36, 49, 58, 0.12);
}

.scene-object.is-draggable.is-grabbing {
  cursor: grabbing;
  transform: scale(1.04);
}

.preposition-choice-options,
.preposition-room-examples {
  display: grid;
  gap: 10px;
}

.preposition-choice-button {
  text-align: left;
  min-height: 58px;
}

.preposition-answer-box,
.preposition-room-box {
  display: grid;
  gap: 12px;
}

.preposition-answer-input {
  min-height: 120px;
}

.preposition-model-answer {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f6f8ef;
  border: 1px solid #dbe4c5;
}

.preposition-room-example {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #e8dcc7;
}

.articles-panel {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.86), transparent 42%),
    linear-gradient(180deg, #fbf6ee 0%, #efe5d5 100%);
}

.articles-support-text {
  margin-top: 0;
  margin-bottom: 16px;
}

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

.articles-step-tab {
  min-height: 50px;
  border-radius: 16px;
  border: 2px solid #ddceb5;
  background: rgba(255, 250, 241, 0.92);
  color: var(--text);
  padding: 10px 8px;
  cursor: pointer;
}

.articles-step-tab.is-active {
  background: #eef8f5;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.articles-step-tab:disabled {
  opacity: 0.58;
  cursor: default;
}

.articles-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.98);
  border: 2px solid #e2d8c5;
  min-height: 520px;
}

.articles-feedback {
  margin-top: 14px;
}

.articles-button-row {
  margin-top: 16px;
}

.articles-step-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.articles-eyebrow {
  margin-bottom: 8px;
}

.articles-word-title,
.articles-task-title {
  margin: 0;
  line-height: 1.15;
}

.articles-word-title {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.articles-task-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.articles-hint,
.articles-example-line,
.articles-answer-line,
.articles-starter {
  margin: 0;
}

.articles-hint {
  color: var(--muted);
  font-size: 1.05rem;
}

.articles-example-list,
.articles-option-grid {
  display: grid;
  gap: 10px;
}

.articles-example-line {
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff8ea;
  border: 1px solid #e7d6b8;
  font-size: 1.08rem;
}

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

.articles-mini-button {
  min-height: 48px;
  border-radius: 14px;
}

.articles-option-button {
  min-height: 58px;
  text-align: left;
}

.articles-answer-box {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f6f8ef;
  border: 1px solid #dbe4c5;
}

.articles-response-input {
  min-height: 120px;
}

.grammar-test-panel {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.86), transparent 42%),
    linear-gradient(180deg, #f4f8ed 0%, #e8f0df 100%);
}

.grammar-welcome {
  display: grid;
  gap: 14px;
  align-content: center;
  text-align: center;
}

.grammar-welcome h3,
.grammar-welcome p,
.grammar-built-sentence {
  margin: 0;
}

.grammar-welcome h3 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.grammar-welcome p { font-size: 1.1rem; line-height: 1.5; }

.grammar-answer-input {
  width: 100%;
  min-height: 62px;
  border: 2px solid #b9cda8;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  padding: 12px 14px;
}

.grammar-answer-input.is-correct { border-color: #69a77b; background: #e4f6ea; }
.grammar-answer-input.is-wrong { border-color: #d1a157; background: #fff8df; }

.grammar-reminder {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f8ef;
  border: 1px solid #dbe4c5;
  color: var(--primary-dark);
  font-weight: 700;
}

.grammar-built-sentence {
  min-height: 62px;
  padding: 16px;
  border: 2px dashed #cbbbd8;
  border-radius: 16px;
  background: #faf7fc;
  font-size: 1.25rem;
  text-align: center;
}

.grammar-word-card {
  width: 100%;
  min-height: 82px;
  border: 2px solid #b89d76;
  border-radius: 18px;
  background: #fff2d7;
  color: #5a4325;
  cursor: grab;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
}

.grammar-sort-zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grammar-sort-zone { min-height: 108px; border: 2px dashed #abc4b1; border-radius: 18px; background: #f5fbf3; color: #315540; cursor: pointer; font: inherit; font-weight: 700; padding: 12px; }
.grammar-sort-zone.is-correct { border-style: solid; border-color: #69a77b; background: #e4f6ea; }

.number-elevator-panel {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.86), transparent 38%),
    linear-gradient(180deg, #edf8f4 0%, #e7f1f9 100%);
}

.number-elevator-instruction,
.number-elevator-feedback {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 700;
}

.number-elevator-result {
  margin: 0 0 14px;
  text-align: center;
  font-size: clamp(3.5rem, 12vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1e4d61;
}

.number-elevator-board {
  overflow-x: auto;
  padding-bottom: 8px;
}

.elevator-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(106px, 1fr));
  min-width: 590px;
  border: 3px solid #6c9bab;
  border-radius: 20px;
  overflow: hidden;
  background: #fffdf8;
}

.elevator-place {
  min-height: 190px;
  display: grid;
  grid-template-rows: auto 1fr;
  border-left: 2px solid #b9d1d8;
  background: linear-gradient(180deg, #eef8f6 0%, #fffdf8 46%);
}

.elevator-place:first-child { border-left: 0; }

.elevator-place-label {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-bottom: 2px solid #b9d1d8;
  color: #335564;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.elevator-slot {
  display: grid;
  place-items: center;
  min-height: 126px;
  padding: 14px;
}

.digit-card {
  width: 82px;
  min-height: 96px;
  border: 3px solid #cf8840;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff3cf, #ffd77a);
  box-shadow: 0 6px 0 #d49b40;
  color: #613810;
  cursor: grab;
  font-family: Arial, sans-serif;
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1;
  touch-action: manipulation;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.digit-card:hover,
.digit-card:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 11px 0 #d49b40;
  outline: none;
}

.number-elevator-task {
  min-height: 12px;
  margin-top: 16px;
}

.elevator-question,
.tens-explanation {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px solid #bfd7d1;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.92);
  font-size: clamp(1.08rem, 2.5vw, 1.3rem);
  line-height: 1.5;
}

.elevator-question p { margin: 0 0 2px; font-weight: 700; }

.elevator-option,
.why-button {
  min-height: 54px;
  border: 2px solid #a4c7c0;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 10px 14px;
  text-align: left;
}

.elevator-option.is-helpful { border-color: var(--primary); background: #e4f6ea; }
.why-button { width: fit-content; text-align: center; color: var(--primary-dark); }
.elevator-cancel { text-decoration: line-through; color: var(--muted); }
.number-elevator-actions { grid-template-columns: 1fr; margin-top: 14px; }

.number-worlds-panel {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(180deg, #f9f0fd 0%, #e8f5fc 100%);
}

.world-menu,
.world-choices {
  display: grid;
  gap: 12px;
}

.world-menu { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.world-card,
.mastery-report {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 2px solid #d4c4dd;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
}

.world-visual {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow-x: auto;
  padding: 14px;
  border-radius: 18px;
  background: #fffdf8;
  color: #34516a;
  font-family: Arial, sans-serif;
  font-size: clamp(1.05rem, 3vw, 1.7rem);
  text-align: center;
}

.world-visual--bundles b,
.world-visual--zoom b {
  padding: 12px;
  border: 2px solid #bd8546;
  border-radius: 12px;
  background: #fff0b5;
}

.world-visual--money b {
  min-width: 50px;
  padding: 14px 8px;
  border: 2px solid #789c71;
  border-radius: 8px;
  background: #e4f2dc;
  color: #23543a;
}

.world-visual--road { color: #725390; }
.world-visual--road span { color: #b28dcb; }
.world-visual--tens { color: #69451e; }
.world-visual--code { color: #276456; }
.world-problem { margin: 0; color: #2c5267; font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 700; text-align: center; }
.world-question { margin: 0; font-size: clamp(1.15rem, 3vw, 1.4rem); font-weight: 700; }
.world-feedback { margin: 0; padding: 12px; border-radius: 14px; background: #e8f6ec; color: #215535; line-height: 1.45; }
.is-not-quite { opacity: 0.65; }
.number-worlds-back { width: 100%; margin-top: 14px; }
.mastery-report p { margin: 0; padding: 9px 0; border-bottom: 1px solid #ded5e4; font-family: Arial, sans-serif; font-size: 0.9rem; }
.mastery-report p:last-child { border-bottom: 0; }

.number-worksheet {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 2px solid #d4c4dd;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
}

.number-worksheet h3 {
  margin: 12px 0 2px;
  color: #725390;
}

.number-worksheet h3:first-child { margin-top: 0; }

.worksheet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(106px, 160px);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e4dce9;
  font-family: Arial, sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
}

.worksheet-row input {
  width: 100%;
  min-height: 54px;
  border: 2px solid #bfaed0;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 8px 12px;
}

.worksheet-row input.is-correct { border-color: #5f9b71; background: #e7f6ea; }
.worksheet-row input.is-incorrect { border-color: #d1a157; background: #fff8df; }
.worksheet-feedback { margin: 8px 0 0; color: var(--primary-dark); font-weight: 700; }

.column-card { align-items: stretch; }
.column-steps { margin: 0; color: #725390; font-family: Arial, sans-serif; font-size: 0.9rem; font-weight: 700; text-align: center; }
.column-layout { margin: 0 auto; padding: 14px 18px; overflow: auto; border-radius: 16px; background: #fffdf8; color: #24313a; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 700; line-height: 1.08; }
.column-input { width: 100%; min-height: 56px; border: 2px solid #bfaed0; border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-size: 1.2rem; padding: 8px 12px; }
.column-input.is-incorrect { border-color: #d1a157; background: #fff8df; }
.column-fields { display: grid; gap: 12px; }
.column-fields label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 150px); align-items: center; gap: 12px; font-family: Arial, sans-serif; font-weight: 700; }

@media (max-width: 480px) {
  .worksheet-row { grid-template-columns: 1fr; gap: 7px; }
}

.calm-panel {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 35%),
    linear-gradient(180deg, #f8f3ea 0%, #efe4d0 100%);
}

.calm-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.calm-toggle {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  background: #fff;
  touch-action: manipulation;
  font-size: 0.96rem;
}

.calm-color-panel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(38px, 46px);
  gap: 8px;
  position: relative;
  z-index: 2;
  overflow-x: auto;
  padding: 0 2px 4px 0;
  margin: 0;
  flex: 1 1 auto;
}

.color-button {
  min-height: 38px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px var(--panel-border);
  cursor: pointer;
  touch-action: manipulation;
}

.color-button[data-color="#b56090"] { background: #b56090; }
.color-button[data-color="#7f5526"] { background: #7f5526; }
.color-button[data-color="#4c658e"] { background: #4c658e; }
.color-button[data-color="#3a6145"] { background: #3a6145; }
.color-button[data-color="#d98b3f"] { background: #d98b3f; }
.color-button[data-color="#7a5fb3"] { background: #7a5fb3; }
.color-button[data-color="#c94f4f"] { background: #c94f4f; }
.color-button[data-color="#f2c94c"] { background: #f2c94c; }

.color-button.is-selected {
  box-shadow: 0 0 0 3px var(--text);
}

.calm-toggle input {
  width: 16px;
  height: 16px;
}

.calm-quick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  position: relative;
  z-index: 2;
}

.calm-toggle-inline {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.calm-action-button {
  flex: 0 0 auto;
  min-height: 40px;
  border-radius: 12px;
  padding: 8px 12px;
  white-space: nowrap;
}

.calm-lesson-text {
  margin-top: 0;
  margin-bottom: 12px;
}

.calm-stickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.sticker-button {
  min-height: 48px;
  min-width: 48px;
  border-radius: 14px;
  border: 2px solid var(--panel-border);
  background: #fff;
  color: var(--text);
  padding: 6px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.sticker-button.is-selected {
  border-color: var(--primary);
  background: #eef8f5;
}

.calm-canvas-shell {
  border: 2px solid #d7c19a;
  border-radius: 22px;
  overflow: hidden;
  background: #e9d7b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1;
}

.calm-canvas {
  display: block;
  width: 100%;
  height: min(68vh, 560px);
  touch-action: none;
}

.calm-panel .voice-select,
.calm-panel .secondary-button,
.calm-panel .text-button {
  touch-action: manipulation;
}

.calm-panel .voice-control {
  gap: 6px;
}

.calm-panel .voice-control span {
  font-size: 0.93rem;
}

.calm-panel .voice-select {
  min-height: 46px;
  border-radius: 12px;
  padding: 8px 10px;
}

.story-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.story-strip-block {
  height: 16px;
  border-radius: 999px;
  background: #eadfce;
  border: 2px solid #d9c9a0;
}

.story-strip-block.is-earned {
  background: #9ad3ae;
  border-color: #5e9e73;
}

.sequence-order-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--panel-border);
  border-radius: 18px;
  background: #fcf7ef;
}

.scene-box {
  display: grid;
  gap: 16px;
}

.scene-row {
  display: grid;
  gap: 10px;
}

.scene-option-grid {
  display: grid;
  gap: 10px;
}

.scene-selection,
.scene-option {
  min-height: 56px;
  border-radius: 16px;
  border: 2px solid var(--panel-border);
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
}

.scene-selection.is-empty {
  background: #f7f1e6;
  border-style: dashed;
  color: var(--muted);
}

.scene-selection.is-correct {
  background: var(--correct-bg);
  border-color: var(--correct-border);
}

.scene-selection.is-wrong {
  background: var(--wrong-bg);
  border-color: var(--wrong-border);
}

.scene-option:hover,
.scene-option:focus-visible,
.scene-selection:hover,
.scene-selection:focus-visible {
  transform: translateY(-1px);
}

.sequence-order-label {
  margin: 0;
  color: var(--muted);
}

.sequence-order-slots,
.sequence-card-grid {
  display: grid;
  gap: 12px;
}

.sequence-slot,
.sequence-card {
  min-height: 58px;
  border-radius: 16px;
  border: 2px solid var(--panel-border);
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
}

.sequence-slot.is-empty {
  background: #f7f1e6;
  border-style: dashed;
  color: var(--muted);
}

.sequence-slot.is-correct {
  background: var(--correct-bg);
  border-color: var(--correct-border);
}

.sequence-slot.is-wrong {
  background: var(--wrong-bg);
  border-color: var(--wrong-border);
}

.sequence-card:hover,
.sequence-card:focus-visible,
.sequence-slot:hover,
.sequence-slot:focus-visible {
  transform: translateY(-1px);
}

.type-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8efe7;
  color: #355247;
  font-size: 0.95rem;
}

.illustration-placeholder {
  min-height: 130px;
  border: 2px dashed var(--panel-border);
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #faf5ec;
  overflow: hidden;
  padding: 0;
}

.illustration-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.illustration-text {
  margin: 0;
  padding: 24px;
  text-align: center;
}

.prompt-label,
.prompt-text {
  margin: 0;
}

.prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.prompt-text {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.4;
}

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

.option-button {
  text-align: left;
  background: #fff;
  border-color: var(--panel-border);
  color: var(--text);
}

.listen-button {
  min-height: 52px;
  min-width: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--secondary-border);
  background: #fff7e5;
  color: var(--primary-dark);
  cursor: pointer;
}

.listen-button-large {
  min-width: 86px;
}

.listen-button:hover,
.listen-button:focus-visible {
  transform: translateY(-1px);
}

.listen-button.is-speaking {
  background: #e7f4f0;
  border-color: var(--primary);
}

.option-button:hover,
.option-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible,
.lesson-list-button:hover,
.lesson-list-button:focus-visible,
.text-button:hover,
.text-button:focus-visible,
.listen-button:hover,
.listen-button:focus-visible {
  transform: translateY(-1px);
}

.option-button.is-selected {
  border-color: var(--primary);
  background: #eef8f5;
}

.option-button.is-correct {
  border-color: var(--correct-border);
  background: var(--correct-bg);
}

.option-button.is-wrong {
  border-color: var(--wrong-border);
  background: var(--wrong-bg);
}

.feedback-box {
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f6f1e8;
  color: var(--text);
}

.feedback-box[data-tone="correct"] {
  background: var(--correct-bg);
  border: 2px solid var(--correct-border);
}

.feedback-box[data-tone="wrong"] {
  background: var(--wrong-bg);
  border: 2px solid var(--wrong-border);
}

@media (max-width: 640px) {
  .app-shell {
    padding: 18px 12px 28px;
  }

  .panel {
    padding: 18px;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .calm-controls {
    grid-template-columns: 1fr;
  }

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

  .prompt-row,
  .option-row {
    grid-template-columns: 1fr;
  }

  .daily-word-top,
  .daily-word-actions,
  .daily-response-actions {
    display: grid;
  }

  .daily-example-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .prepositions-step-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preposition-step-top,
  .preposition-inline-actions {
    display: grid;
  }

  .articles-step-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .articles-step-top,
  .articles-inline-actions {
    display: grid;
  }
}
