:root {
  color: #26211f;
  background: #9fe8ee;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --learning-font: Verdana, Arial, "Liberation Sans", sans-serif;
  --cream: #9fe8ee;
  --paper: #ffffff;
  --peach: #ffd3c2;
  --peach-strong: #ff7f62;
  --mint: #c9f0dd;
  --sky: #d5efff;
  --ink: #26211f;
  --soft-heading: #314544;
  --muted: #655b57;
  --line: rgba(38, 33, 31, 0.14);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #9fe8ee;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

.app-home-button {
  position: absolute;
  top: 10px;
  left: 0;
  z-index: 20;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(38, 33, 31, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero,
.dashboard-hero {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

.home-hero {
  position: relative;
  height: calc(clamp(88px, 10vw, 140px) + 141px);
  padding-top: 8px;
  padding-right: 360px;
  align-items: center;
}

.home-brand {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 120px;
}

.home-hero > .home-brand {
  position: absolute;
  top: 74px;
  left: 0;
  width: 100%;
  justify-content: center;
}

.home-brand img {
  width: clamp(88px, 10vw, 140px);
  height: clamp(88px, 10vw, 140px);
  object-fit: contain;
  flex: 0 0 auto;
}

.home-brand-copy {
  display: grid;
  gap: 8px;
}

.home-brand h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 0.96;
}

.home-qr {
  position: absolute;
  top: 8px;
  left: 0;
  width: 180px;
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.home-qr img {
  display: block;
  width: 180px;
  height: 180px;
  max-width: none;
  object-fit: contain;
  border: 6px solid #ffffff;
  border-radius: 10px;
}

.home-section-heading {
  justify-content: flex-start;
}

.dashboard-hero {
  position: relative;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 24px;
  height: 380px;
  padding: 0 24px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-hero .apprentice-figure.size-hero .apprentice-image {
  width: auto;
  height: 380px;
  max-width: none;
  max-height: 380px;
}

.dashboard-hero .apprentice-figure {
  align-self: center;
  justify-self: end;
  margin: 0;
  padding: 0 14px;
  transform: none;
}

.dashboard-brand {
  position: absolute;
  top: 58px;
  left: 50%;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
}

.dashboard-brand img {
  width: 138px;
  height: 138px;
  object-fit: contain;
}

.dashboard-brand h1 {
  font-size: clamp(1.8rem, 5vw, 4rem);
}

.dashboard-hero-copy {
  display: grid;
  gap: 6px;
  align-self: end;
  padding: 0 0 24px;
}

.dashboard-hero .apprentice-figure.size-hero {
  width: min(400px, 100%);
  min-height: 0;
  overflow: visible;
  background: transparent;
}

.eyebrow,
.summary-label,
.card-kicker {
  color: #b86656;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.2rem;
}

.intro {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.selection-panel,
.control-section,
.start-panel,
.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.selection-panel {
  padding: 22px;
}

.start-nav {
  display: flex;
  justify-content: flex-end;
  margin: -10px 0 18px;
}

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

.character-heading-row {
  align-items: baseline;
  justify-content: flex-start;
}

.section-heading p,
.dashboard-card p,
.character-title,
.character-style {
  color: var(--muted);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 18px;
  align-items: stretch;
}

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

.profile-card {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: center;
  min-height: 190px;
  padding: 22px;
  border: 2px solid rgba(38, 33, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.profile-card.has-apprentice {
  min-height: 300px;
  align-content: start;
  cursor: default;
}

.profile-card:hover,
.profile-card:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #9fe8ee;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 900;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 850;
}

.profile-apprentice-name {
  color: var(--soft-heading);
  font-weight: 800;
}

.profile-status {
  color: var(--muted);
  line-height: 1.4;
}

.profile-apprentice-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.profile-apprentice-choice {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(38, 33, 31, 0.1);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.profile-apprentice-choice:hover,
.profile-apprentice-choice:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(38, 33, 31, 0.12);
}

.profile-continue-label {
  margin-top: 4px;
  color: #2F5C63;
  font-weight: 900;
}

.character-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: 100%;
  min-height: 470px;
  padding: 22px;
  border: 2px solid rgba(38, 33, 31, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 245, 239, 0.95) 100%),
    radial-gradient(circle at 50% 32%, rgba(255, 211, 194, 0.58), transparent 11rem);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.character-card:hover,
.character-card:focus-visible,
.pill:hover,
.pill:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
  transform: translateY(-2px);
}

.character-card.is-selected,
.pill.is-selected {
  border-color: #ff7f62;
  box-shadow:
    0 0 0 4px rgba(255, 127, 98, 0.24),
    var(--shadow);
}

.character-name {
  font-size: 1.45rem;
  font-weight: 850;
}

.character-title,
.character-style {
  max-width: 360px;
  line-height: 1.45;
}

.apprentice-preview-section {
  margin-top: 18px;
}

.apprentice-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 14px;
}

.preview-stage-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(38, 33, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-align: center;
}

.preview-stage-card.is-current {
  border-color: #ff7f62;
  box-shadow: 0 0 0 4px rgba(255, 127, 98, 0.18);
}

.preview-stage-card.is-locked {
  opacity: 0.64;
}

.preview-stage-card.is-unlocked {
  border-color: #2f7d55;
  background: rgba(225, 248, 235, 0.96);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(47, 125, 85, 0.14);
}

.preview-stage-card.is-unlocked:hover,
.preview-stage-card.is-unlocked:focus-visible {
  border-color: #21633d;
  outline: none;
  transform: translateY(-2px);
}

.apprentice-figure {
  position: relative;
  display: grid;
  place-items: end center;
  width: 100%;
  min-height: 250px;
  padding: 18px 14px 0;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 20%, var(--apprentice-accent-soft), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 250, 252, 0.72));
}

.apprentice-image {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 220px);
  max-height: 100%;
  object-fit: contain;
}

.apprentice-figure.size-card {
  min-height: 310px;
}

.apprentice-figure.size-card .apprentice-image {
  width: min(100%, 280px);
}

.apprentice-figure.size-hero {
  width: min(300px, 100%);
  min-height: 330px;
  justify-self: end;
}

.apprentice-figure.size-dashboard {
  width: min(210px, 100%);
  min-height: 240px;
  justify-self: end;
}

.apprentice-figure.size-compact {
  width: min(180px, 100%);
  min-height: 220px;
  justify-self: end;
}

.profile-card .apprentice-figure.size-compact {
  width: min(230px, 100%);
  min-height: 250px;
  justify-self: center;
}

.profile-card .apprentice-figure.size-compact .apprentice-image {
  width: min(100%, 210px);
}

.apprentice-aura {
  position: absolute;
  inset: 18px 18px auto;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--apprentice-accent) 32%, white), transparent 68%);
  opacity: 0.9;
}

.apprentice-stage-chip {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--soft-heading);
  font-size: 0.78rem;
  font-weight: 900;
}

.apprentice-honors-plaque {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5de98, #d8b458);
  color: #5f4a1d;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.apprentice-panel {
  margin-top: 16px;
}

.apprentice-panel.is-compact {
  margin-top: 0;
}

.apprentice-panel .section-heading {
  align-items: center;
}

.apprentice-progress-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: baseline;
  color: var(--muted);
}

.apprentice-progress-copy strong {
  color: var(--ink);
  font-size: 1.8rem;
}

.apprentice-progress-bar {
  height: 14px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 92, 99, 0.12);
}

.apprentice-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--apprentice-accent, #ff7f62), #2F5C63);
}

.apprentice-stage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.apprentice-stage-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.apprentice-stage-card.is-current {
  border-color: rgba(47, 92, 99, 0.34);
  background: rgba(222, 246, 247, 0.9);
}

.apprentice-stage-card.is-hidden {
  color: var(--muted);
  background: rgba(245, 248, 248, 0.8);
}

.apprentice-encouragement {
  margin-top: 12px;
  color: #2F5C63;
  font-weight: 800;
}

.upgrade-notice {
  color: #21633d;
  font-weight: 900;
}

.apprentice-roster-panel,
.locked-apprentice-panel {
  margin-top: 16px;
}

.apprentice-roster-panel {
  padding: 16px;
}

.apprentice-roster-panel .section-heading {
  margin-bottom: 10px;
}

.apprentice-roster-grid,
.personality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 14px;
}

.apprentice-roster-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 10px;
}

.apprentice-roster-card,
.personality-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 2px solid rgba(38, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.apprentice-roster-card {
  grid-template-columns: 180px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 8px 14px;
  padding: 12px;
}

.apprentice-roster-card .apprentice-figure {
  grid-row: 1 / 3;
}

.apprentice-roster-card .action-row {
  justify-content: flex-start;
}

.personality-card {
  cursor: pointer;
  text-align: left;
}

.personality-card:hover,
.personality-card:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
}

.personality-card.is-selected,
.apprentice-roster-card.is-active {
  border-color: #ff7f62;
  box-shadow: 0 0 0 4px rgba(255, 127, 98, 0.18);
}

.personality-card span,
.apprentice-roster-card p {
  color: var(--muted);
  line-height: 1.45;
}

.meet-panel,
.completion-apprentice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.completion-apprentice {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.completion-apprentice strong {
  font-size: 1.4rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.control-section {
  padding: 20px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.start-panel,
.dashboard-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.start-panel {
  padding: 18px 20px;
}

.start-panel > div:not(.action-row) {
  display: grid;
  gap: 4px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
}

.primary-action {
  border: 0;
  background: #ff7f62;
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 127, 98, 0.3);
}

.secondary-action {
  border: 2px solid rgba(38, 33, 31, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.preview-action {
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid color-mix(in srgb, var(--preview-color) 72%, #26211f);
  border-radius: 999px;
  background: var(--preview-color);
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--preview-color) 30%, transparent);
}

.danger-action {
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid #d95858;
  border-radius: 999px;
  background: #fff5f5;
  color: #9f3030;
  cursor: pointer;
  font-weight: 850;
}

.apprentice-roster-card .danger-action {
  border-color: #b91c1c;
  background: #dc2626;
  color: #ffffff;
}

.small-action {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 48px;
}

.dashboard-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
}

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

.dashboard-card strong {
  font-size: 2rem;
}

.today-practice-card {
  align-content: start;
}

.today-practice-card .primary-action {
  justify-self: start;
}

.today-practice-card p strong {
  font-size: inherit;
}

.lesson-choice-panel {
  margin-top: 16px;
}

.level-selector-panel {
  margin-top: 16px;
}

.level-selector-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-panel {
  margin-top: 16px;
}

.settings-form {
  margin-bottom: 16px;
}

.home-language-panel {
  margin-bottom: 16px;
}

.home-language-panel .section-heading {
  align-items: center;
}

.home-language-widget {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.home-language-illustration {
  width: 70px;
  height: auto;
  object-fit: contain;
}

.home-language-stack {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.home-language-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.home-language-kicker {
  color: rgba(38, 33, 31, 0.72);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.home-language-trigger {
  display: inline-flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-width: 208px;
  min-height: 68px;
  padding: 0 22px;
  border: 2px solid rgba(139, 221, 230, 0.82);
  border-radius: 18px;
  background: rgba(239, 252, 255, 0.92);
  box-shadow: 0 18px 40px rgba(64, 124, 130, 0.16);
  color: #171718;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.home-language-trigger:hover,
.home-language-trigger:focus-visible {
  border-color: rgba(108, 207, 220, 0.96);
  outline: none;
}

.home-language-trigger-label {
  font-size: 1.06rem;
  font-weight: 700;
}

.home-language-trigger-chevron {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.home-language-widget.is-open .home-language-trigger-chevron {
  transform: rotate(180deg);
}

.home-language-menu {
  position: relative;
  display: grid;
  width: min(360px, calc(100vw - 48px));
  padding: 14px 28px;
  border: 1px solid rgba(38, 33, 31, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 48px rgba(82, 109, 113, 0.18);
  backdrop-filter: blur(14px);
}

.home-language-menu::before {
  content: "";
  position: absolute;
  top: -11px;
  right: 30px;
  width: 22px;
  height: 22px;
  border-top: 1px solid rgba(38, 33, 31, 0.08);
  border-left: 1px solid rgba(38, 33, 31, 0.08);
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(45deg);
}

.language-menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 28px 18px;
  border: 0;
  border-bottom: 1px solid rgba(38, 33, 31, 0.12);
  background: transparent;
  color: #121212;
  cursor: pointer;
  text-align: left;
}

.language-menu-item:last-child {
  border-bottom: 0;
}

.language-menu-item:hover,
.language-menu-item:focus-visible,
.language-menu-item.is-active {
  color: #0f6067;
  outline: none;
}

.language-menu-item-label {
  font-size: 1.08rem;
  font-weight: 700;
}

.language-menu-item-greeting {
  justify-self: end;
  color: rgba(38, 33, 31, 0.7);
  font-size: 1.02rem;
  font-weight: 500;
  text-align: right;
}

.text-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.text-field input,
.text-field select {
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

.field-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.progress-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.progress-summary-grid article,
.history-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.progress-summary-grid article > strong {
  justify-self: center;
  text-align: center;
}

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

.history-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.lesson-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.lesson-choice-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 18px 54px 18px 18px;
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.lesson-vocabulary-count {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid rgba(38, 33, 31, 0.14);
  border-radius: 999px;
  background: #f7f3f0;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.lesson-choice-card:hover,
.lesson-choice-card:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
}

.lesson-empty-state {
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.lesson-panel {
  display: grid;
  gap: clamp(12px, 1.7vw, 18px);
  padding: clamp(16px, 2.3vw, 26px);
}

.lesson-panel.is-teaching-activity,
.lesson-panel.is-choice-activity {
  gap: clamp(11px, 1.6vw, 17px);
  padding-top: clamp(15px, 2.2vw, 25px);
  padding-bottom: clamp(15px, 2.2vw, 25px);
}

.lesson-panel.is-mandarin-choice-activity {
  gap: clamp(9px, 1.3vw, 14px);
  padding-top: clamp(13px, 2vw, 22px);
  padding-bottom: clamp(13px, 2vw, 22px);
}

.lesson-panel > .section-heading h1.lesson-title,
.matching-game-panel h1.matching-title,
.lesson-panel > .section-heading h1.lesson-screen-title,
.matching-game-panel h1.lesson-screen-title {
  color: #58c7cf;
  font-size: clamp(1.25rem, 2.1vw, 1.65rem) !important;
  line-height: 1.05 !important;
  text-align: right;
}

.lesson-panel > h1.lesson-title,
.lesson-panel > h1.lesson-screen-title {
  color: #58c7cf;
  font-size: clamp(1.75rem, 2.6vw, 36px) !important;
  line-height: 1.05 !important;
  text-align: center;
}

.lesson-panel > .section-heading,
.matching-game-panel > .section-heading {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  min-height: 58px;
  margin-bottom: 0;
}

.lesson-panel > .section-heading > div:first-child,
.matching-game-panel > .section-heading > div:first-child {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  gap: 8px;
}

.lesson-panel > .section-heading .eyebrow,
.matching-game-panel > .section-heading .eyebrow {
  justify-self: start;
}

.lesson-panel > .section-heading .intro,
.matching-game-panel > .section-heading .intro {
  justify-self: start;
  max-width: 680px;
}

.lesson-panel > .section-heading .lesson-meta,
.matching-game-panel > .section-heading .lesson-meta {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-items: end;
  z-index: 1;
}

.lesson-question {
  display: grid;
  gap: clamp(12px, 1.5vw, 18px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.lesson-question h2,
.lesson-instruction-heading {
  color: #c78100;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.15;
  text-transform: uppercase;
}

.lesson-prompt-vocabulary {
  text-transform: none;
}

.lesson-panel.is-teaching-activity .lesson-instruction-heading,
.lesson-panel.is-choice-activity .lesson-instruction-heading {
  font-size: clamp(1.18rem, 2.15vw, 1.52rem);
}

.lesson-panel.is-teaching-activity .lesson-question,
.lesson-panel.is-choice-activity .lesson-question {
  gap: clamp(11px, 1.4vw, 17px);
}

.lesson-panel.is-mandarin-choice-activity .lesson-question {
  gap: clamp(9px, 1.2vw, 14px);
}

.vocabulary-preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 900px);
  min-height: clamp(210px, 30vw, 350px);
  justify-self: center;
  align-content: center;
  padding: clamp(24px, 3.4vw, 38px);
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.vocabulary-preview.is-study-card {
  width: min(92%, 880px);
  min-height: clamp(205px, 25vw, 305px);
}

.vocabulary-preview strong {
  font-size: clamp(4.5rem, 8.8vw, 7.25rem);
  line-height: 1;
}

.vocabulary-preview.is-study-card strong[data-auto-fit-text] {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.vocabulary-preview-word.is-mandarin {
  font-size: clamp(4.1rem, 7vw, 5.8rem);
  line-height: 1.1;
}

.vocabulary-preview p {
  margin: 0;
  color: #4f4a49;
  font-size: clamp(2.15rem, 4.3vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
}

.vocabulary-preview-pinyin {
  color: var(--muted);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.vocabulary-audio-actions,
.pronunciation-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  justify-self: center;
}

.pronunciation-practice [data-action="speak-vocabulary"] {
  touch-action: none;
  user-select: none;
}

.pronunciation-practice {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.pronunciation-practice .summary-label {
  color: #d88c00;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  letter-spacing: 0.06em;
}

.pronunciation-practice > strong {
  font-size: clamp(4rem, 8vw, 6.4rem);
  line-height: 1;
}

.pronunciation-practice > strong.vocabulary-preview-word.is-mandarin {
  font-size: clamp(4.1rem, 7vw, 5.8rem);
}

.lesson-prompt-vocabulary,
.lesson-panel.is-teaching-activity .vocabulary-preview.is-study-card > strong,
.lesson-panel.is-teaching-activity .vocabulary-preview.is-study-card > p,
.lesson-panel.is-teaching-activity .vocabulary-preview-pinyin,
.lesson-panel.is-pronunciation-activity .pronunciation-practice > strong,
.lesson-panel.is-pronunciation-activity .vocabulary-preview-pinyin {
  font-family: var(--learning-font);
}

.pronunciation-hint {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  text-transform: none;
}

.pronunciation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.speech-capture-display .is-interim {
  color: var(--muted);
}

.speech-interim-label {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pronunciation-feedback {
  min-height: 1.4em;
}

.pronunciation-feedback p {
  margin: 0;
  color: var(--muted);
}

.pronunciation-feedback.is-correct {
  color: var(--muted);
}

.pronunciation-feedback.is-retry {
  color: var(--muted);
}

.pronunciation-beta-notice {
  display: grid;
  gap: 4px;
  width: min(100%, 880px);
  padding: 10px 12px;
  border: 1px solid rgba(47, 92, 99, 0.14);
  border-radius: 10px;
  background: rgba(245, 248, 248, 0.62);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.pronunciation-beta-notice strong {
  color: var(--text);
  font-size: 0.82rem;
}

.pronunciation-beta-notice p {
  margin: 0;
}

.speech-recognition-debug {
  display: none;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 92, 99, 0.14);
  border-radius: 8px;
  background: rgba(245, 248, 248, 0.82);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.speech-recognition-debug p,
.speech-recognition-debug ol {
  margin: 0;
}

.speech-recognition-debug ol {
  display: grid;
  gap: 2px;
  padding-left: 20px;
}

.speech-capture-display {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: min(74%, 760px);
  min-height: 150px;
  align-content: center;
  padding: clamp(18px, 2.5vw, 26px);
  border: 1px solid rgba(47, 92, 99, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.speech-capture-display p {
  margin: 0;
}

.speech-capture-display p:first-child {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.speech-capture-display p:nth-child(2) {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.05;
}

.speech-capture-error {
  color: #8f2525;
  font-weight: 800;
}

.lesson-meta {
  display: grid;
  gap: 4px;
  text-align: right;
  color: var(--ink);
  font-size: 1.1rem;
}

.lesson-center-action,
.pronunciation-actions .primary-action {
  justify-self: center;
  min-width: 160px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 8px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(12px, 1.65vw, 20px);
  width: min(1120px, 100%);
  justify-self: center;
  justify-content: center;
}

.lesson-panel.is-mandarin-choice-activity .choice-grid {
  gap: clamp(10px, 1.45vw, 18px);
}

.choice-button {
  display: grid;
  align-content: center;
  justify-items: center;
  height: clamp(150px, 14.6vw, 210px);
  min-height: clamp(150px, 14.6vw, 210px);
  padding: clamp(18px, 2.45vw, 28px) clamp(18px, 2.8vw, 34px);
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: clamp(2.3rem, 4.23vw, 4.42rem);
  font-weight: 800;
  line-height: 1.08;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  grid-column: span 2;
}

.choice-auto-fit-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  line-height: 1.05;
}

.lesson-panel.is-choice-activity .choice-button {
  height: clamp(150px, 14.2vw, 205px);
  min-height: clamp(150px, 14.2vw, 205px);
}

.lesson-panel.is-mandarin-choice-activity .choice-button {
  height: auto;
  min-height: clamp(111px, 10.9vw, 153px);
}

.lesson-panel.is-spanish-beginner-2-places-2-lesson .choice-button {
  height: clamp(108px, 10.8vw, 150px);
  min-height: clamp(108px, 10.8vw, 150px);
  padding: clamp(15px, 2vw, 23px) clamp(10px, 1.6vw, 18px);
  font-size: clamp(1.85rem, 3.35vw, 3.5rem);
}

.lesson-panel.is-beginner-3-communication-verbs-english-choices
  .choice-grid {
  gap: clamp(10px, 1.3vw, 16px);
}

.lesson-panel.is-beginner-3-communication-verbs-english-choices
  .choice-button {
  height: clamp(150px, 14.2vw, 205px);
  min-height: clamp(150px, 14.2vw, 205px);
  padding: clamp(18px, 2.45vw, 28px) clamp(18px, 2.8vw, 34px);
  font-size: clamp(2.3rem, 4.23vw, 4.42rem);
}

.choice-button.is-medium-answer {
  font-size: clamp(2.15rem, 3.8vw, 3.9rem);
}

.choice-button.is-long-answer,
.choice-button.is-long-phrase-answer {
  font-size: clamp(1.9rem, 3.35vw, 3.35rem);
}

.choice-button.is-very-long-answer {
  font-size: clamp(1.65rem, 2.95vw, 2.95rem);
}

.lesson-panel.is-beginner-3-communication-verbs-english-choices
  .choice-auto-fit-text {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.lesson-panel.is-spanish-beginner-2-places-2-lesson
  .vocabulary-preview.is-study-card {
  min-height: clamp(175px, 21vw, 255px);
}

.lesson-panel.is-spanish-beginner-2-places-2-lesson
  .vocabulary-preview.is-study-card
  strong {
  font-size: clamp(3.25rem, 6.4vw, 5.25rem);
}

.choice-button:nth-child(4):nth-last-child(2) {
  grid-column: 2 / span 2;
}

.choice-button:nth-child(4):last-child {
  grid-column: 3 / span 2;
}

.choice-option-primary,
.matching-option-primary {
  display: block;
}

.choice-option-primary.is-mandarin {
  max-width: 100%;
  font-size: clamp(3.76rem, 6.2vw, 5.26rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.matching-option-primary.is-mandarin {
  font-size: clamp(4rem, 6.6vw, 5.6rem);
  line-height: 1.1;
}

.choice-option-secondary {
  display: block;
  max-width: 100%;
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(1.36rem, 2.16vw, 1.74rem);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  word-break: normal;
  overflow-wrap: break-word;
}

.choice-auto-fit-text,
.choice-option-primary,
.choice-option-secondary,
.matching-option [data-matching-option-text],
.matching-option .matching-option-text,
.matching-option-primary,
.matching-option-secondary {
  font-family: var(--learning-font);
}

.matching-option-secondary {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
}

.choice-button:disabled {
  cursor: default;
}

.choice-button.is-selected {
  border-color: #ff7f62;
}

.choice-button.is-correct {
  border-color: #45b978;
  background: #e8fff1;
  transform: scale(1.025);
}

.choice-button.is-incorrect {
  border-color: #e65f5f;
  background: #fff0f0;
}

.spelling-answer {
  min-height: clamp(86px, 12vw, 130px);
  padding: clamp(18px, 3vw, 28px);
  border: 2px dashed rgba(38, 33, 31, 0.2);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
}

.spelling-answer.is-correct {
  border-color: #45b978;
  background: #e8fff1;
  color: #21633d;
}

.spelling-answer.is-incorrect {
  border-color: #e65f5f;
  background: #fff0f0;
  color: #8f2525;
}

.letter-tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.letter-tile {
  min-width: 58px;
  min-height: 58px;
  padding: 12px 16px;
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 900;
}

.lesson-panel.is-spelling-activity .spelling-answer,
.lesson-panel.is-spelling-activity .letter-tile,
.lesson-panel.is-spelling-activity .spelling-hint strong,
.lesson-panel.is-spelling-activity .lesson-prompt-vocabulary {
  font-family: var(--learning-font);
  font-feature-settings: "liga" 0, "calt" 0;
  font-variant-ligatures: none;
  font-weight: 800;
}

.letter-tile:hover,
.letter-tile:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
}

.letter-tile.is-used {
  opacity: 0.38;
}

.letter-tile.is-blank {
  border-color: rgba(38, 33, 31, 0.28);
}

.spelling-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.spelling-actions .secondary-action,
.spelling-actions .primary-action {
  min-width: 110px;
  padding-inline: 18px;
}

.spelling-actions [data-action="spelling-backspace"] {
  min-width: 170px;
}

.spelling-message {
  margin: 0;
  font-weight: 800;
}

.spelling-message.is-incorrect {
  color: #8f2525;
}

.spelling-hint {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.spelling-hint strong {
  color: var(--ink);
  font-size: inherit;
}

.feedback-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  justify-items: start;
  padding: clamp(16px, 2.1vw, 24px) clamp(22px, 3.2vw, 42px);
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.feedback-card.is-correct {
  border-color: #13a454;
}

.feedback-card.is-incorrect {
  border-color: #e65f5f;
}

.feedback-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #13884b;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.feedback-card.is-choice-activity .feedback-heading {
  font-size: clamp(1.3rem, 2.6vw, 2.02rem);
}

.feedback-card.is-incorrect .feedback-heading {
  color: #8f2525;
}

.feedback-check {
  color: #13a454;
}

.feedback-card p {
  color: var(--ink);
  font-size: clamp(1.1rem, 2vw, 1.38rem);
  line-height: 1.4;
}

.feedback-card .primary-action {
  justify-self: center;
  min-width: 190px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 8px;
  font-size: 1.05rem;
}

.feedback-card.is-beginner-3-communication-verbs-english-choices {
  gap: 6px;
  padding: 10px clamp(18px, 2.4vw, 30px);
}

.feedback-card.is-beginner-3-communication-verbs-english-choices
  .feedback-heading {
  font-size: clamp(1.2rem, 2.1vw, 1.65rem);
}

.feedback-card.is-beginner-3-communication-verbs-english-choices p {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.25;
}

.feedback-card.is-beginner-3-communication-verbs-english-choices
  .primary-action {
  min-height: 44px;
}

.matching-game-panel {
  gap: 20px;
}

.matching-status {
  margin: 0;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.matching-status.is-correct {
  color: #21633d;
}

.matching-status.is-incorrect {
  color: #8f2525;
}

.matching-columns {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(250px, 340px);
  gap: 16px;
  justify-content: center;
  align-items: start;
  margin: 0;
  width: fit-content;
}

.matching-content {
  display: grid;
  grid-template-columns: auto minmax(280px, 380px);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  justify-content: center;
}

.matching-apprentice {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
  place-items: center;
  align-content: center;
  align-self: center;
}

.matching-game-panel .matching-apprentice h1.matching-title {
  z-index: 2;
  margin: 0;
  color: #58c7cf;
  text-align: center;
}

.apprentice-figure.size-matching {
  width: min(380px, 100%);
  min-height: 440px;
}

.apprentice-figure.size-matching .apprentice-image {
  width: min(100%, 360px);
}

.matching-complete-actions {
  justify-content: center;
}

.matching-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-content: start;
}

.matching-column-title {
  margin: 0;
  font-size: 1rem;
  text-align: center;
  color: var(--soft-heading);
}

.matching-option-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.matching-option {
  display: grid;
  place-items: center;
  width: 100%;
  height: 66px;
  min-height: 66px;
  padding: 10px 18px;
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 800;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.matching-option.is-medium-answer {
  font-size: 1.02rem;
}

.matching-option.is-long-answer,
.matching-option.is-long-phrase-answer {
  font-size: 0.96rem;
}

.matching-option.is-very-long-answer {
  font-size: 0.9rem;
}

.matching-option.has-secondary-label {
  height: auto;
  min-height: 66px;
  padding: 10px 18px;
}

.matching-option [data-matching-option-text],
.matching-option .matching-option-text {
  display: block;
  max-width: 100%;
  line-height: 1.08;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
}

.matching-option .matching-option-primary.is-mandarin {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.matching-option .matching-option-secondary {
  font-size: 1rem;
  margin-top: 6px;
  text-align: center;
}

.matching-option:hover,
.matching-option:focus-visible {
  border-color: var(--peach-strong);
  outline: none;
  transform: translateY(-1px);
}

.matching-option.is-selected {
  border-color: var(--peach-strong);
  background: #fff4ea;
}

.matching-option.is-matched {
  border-color: #45b978;
  background: #e8fff1;
  color: #21633d;
  cursor: default;
  opacity: 1;
  pointer-events: none;
}

.matching-option.is-matched:disabled {
  border-color: #45b978;
  background: #e8fff1;
  color: #21633d;
  opacity: 1;
}

.matching-option:disabled:not(.is-matched) {
  cursor: wait;
}

.lesson-complete-actions {
  justify-content: center;
}

.story-bonus-action {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--story-bonus-color, #ff7f62);
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--story-bonus-color, #ff7f62) 30%, transparent);
}

.story-fill-in-panel {
  gap: 14px;
}

.story-fill-in-card {
  justify-self: center;
  width: min(1240px, 100%);
  gap: 18px;
  padding: clamp(20px, 2.6vw, 30px);
  border: 2px solid rgba(38, 33, 31, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(38, 33, 31, 0.08);
}

.story-fill-in-card.uses-spacious-seasons-weather-layout {
  width: min(1360px, 100%);
  gap: 20px;
}

.story-fill-in-card.uses-spacious-seasons-weather-layout
  .story-fill-in-story {
  margin-top: clamp(8px, 1vw, 14px);
  padding-inline: clamp(18px, 1.8vw, 26px);
  line-height: 2.55;
}

.story-fill-in-card .lesson-instruction-heading {
  margin: 0;
  color: #d59a20;
  font-size: clamp(1.02rem, 1.4vw, 1.22rem);
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.story-fill-in-story {
  display: block;
  width: 100%;
  padding: clamp(22px, 2.6vw, 32px);
  border: 2px solid rgba(38, 33, 31, 0.1);
  border-radius: 8px;
  background: #fffaf7;
  color: var(--ink);
  font-size: clamp(1.25rem, 1.9vw, 1.69rem);
  font-weight: 850;
  line-height: 2.35;
  text-align: left;
  white-space: normal;
}

.story-fill-in-card.uses-compact-german-spanish-months-typography
  .story-fill-in-story {
  font-size: clamp(1.15rem, 1.75vw, 1.55rem);
  line-height: 2.115;
}

.story-fill-in-card.uses-beginner-2-late-story-typography
  .story-fill-in-story {
  font-size: clamp(1.125rem, 1.71vw, 1.521rem);
}

.story-fill-in-card.uses-compact-beginner-3-travel-layout
  .story-fill-in-story {
  padding-block: clamp(14px, 1.7vw, 20px);
  line-height: 1.85;
}

.story-fill-in-card.uses-compact-beginner-3-travel-typography
  .story-fill-in-story {
  font-size: clamp(1.125rem, 1.71vw, 1.521rem);
}

.story-fill-in-card.preserves-original-beginner-3-travel-mandarin-type
  .story-fill-in-story {
  font-size: clamp(1.25rem, 1.9vw, 1.69rem);
}

.story-prototype-heading-group {
  display: grid;
  gap: 4px;
  width: 100%;
  justify-items: center;
}

.story-prototype-heading-group .lesson-instruction-heading {
  color: #4d4d4d;
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  font-weight: 800;
}

.story-prototype-title {
  margin: 0 0 3px;
  color: #2f5f8f;
  font-size: clamp(1.22rem, 1.7vw, 1.48rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: center;
}

.story-blank-wrap {
  display: inline-grid;
  grid-template-rows: 16px auto;
  gap: 4px;
  align-items: center;
  justify-items: center;
  margin: 0 5px;
  vertical-align: middle;
}

.story-color-hint {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(38, 33, 31, 0.25);
  border-radius: 999px;
  background: var(--story-hint-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.story-color-hint.has-label {
  width: auto;
  min-width: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4d4d4d;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 16px;
  text-align: center;
  box-shadow: none;
}

.story-color-hint.has-emoji {
  width: auto;
  min-width: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.35em;
  line-height: 1;
  text-align: center;
  box-shadow: none;
}

.story-blank-wrap:has(> .story-color-hint.has-emoji) {
  grid-template-rows: 20px auto;
}

.story-blank {
  position: relative;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 5px 9px;
  border: 2px solid rgba(38, 33, 31, 0.16);
  border-radius: 8px;
  background: #fffaf7;
  color: var(--ink);
  cursor: pointer;
}

.story-blank.has-inline-marker {
  isolation: isolate;
}

.story-blank-marker {
  display: inline-grid;
  place-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 100%;
  min-width: 100%;
  min-height: 1em;
  font-size: 1.25em;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -74%);
}

.story-blank:hover,
.story-blank:focus-visible,
.story-blank.is-selected {
  border-color: var(--peach-strong);
  outline: none;
}

.story-blank.is-correct {
  border-color: #45b978;
  background: #e8fff1;
}

.story-blank.is-incorrect {
  border-color: #d84a3a;
  background: #fff0ed;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank-wrap {
  grid-template-rows: 14px auto;
  row-gap: 2px;
  transform: translateY(-5px);
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-color-hint {
  transform: translateY(-5px);
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks .story-blank {
  position: relative;
  gap: 5px;
  min-height: 42px;
  padding: 5px 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank.has-inline-marker {
  isolation: isolate;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank-marker {
  top: 50%;
  width: 100%;
  min-width: 100%;
  min-height: 1em;
  font-size: 1.12em;
  transform: translate(-50%, -74%);
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank:hover,
.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank:focus-visible,
.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank.is-selected {
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  box-shadow: none;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-letter-slot {
  position: relative;
  z-index: 1;
  border-bottom: 3px solid #746c68;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank:focus:not(.is-correct):not(.is-incorrect)
  .story-letter-slot,
.story-fill-in-card.uses-approved-german-beginner-story-blanks:not(
    :has(.story-blank:focus)
  )
  .story-blank.is-selected:not(.is-correct):not(.is-incorrect)
  .story-letter-slot {
  border-bottom-color: #2563EB;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank.is-incorrect {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank.is-incorrect
  .story-letter-slot {
  border-bottom-color: #d84a3a;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank.is-correct {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank.is-correct
  .story-letter-slot {
  border-bottom-color: transparent;
}

.story-fill-in-card.uses-approved-german-beginner-story-blanks
  .story-blank.is-correct::after {
  position: absolute;
  right: 1px;
  bottom: 3px;
  left: 1px;
  height: 3px;
  border-radius: 999px;
  background: #45b978;
  content: "";
}

.story-blank:disabled {
  cursor: default;
  opacity: 1;
}

.story-letter-slot {
  display: inline-grid;
  place-items: center;
  position: relative;
  z-index: 1;
  width: 20px;
  min-height: 30px;
  border-bottom: 3px solid currentColor;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.story-letter-slot,
.story-letter-separator,
.story-letter-button,
.story-letter-character,
.story-letter-pinyin {
  font-family: var(--learning-font);
}

.story-fill-in-card.uses-spacious-seasons-weather-layout .story-blank {
  gap: 6px;
}

.story-fill-in-card.uses-spacious-seasons-weather-layout .story-letter-slot {
  flex: 0 0 clamp(22px, 1.8vw, 26px);
  width: clamp(22px, 1.8vw, 26px);
  min-height: 36px;
  font-size: clamp(1.35rem, 1.65vw, 1.52rem);
}

.story-letter-separator {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-height: 30px;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.story-letter-separator.is-space {
  width: 12px;
}

.story-letter-separator.is-hyphen {
  width: 10px;
}

.story-fill-in-card.uses-compact-beginner-3-travel-layout
  .story-blank-wrap {
  grid-template-rows: 0 auto;
  row-gap: 0;
}

.story-fill-in-card.uses-compact-beginner-3-travel-layout
  .story-blank {
  min-height: 36px;
  padding-block: 3px;
}

.story-fill-in-card.uses-compact-beginner-3-travel-layout
  .story-letter-slot,
.story-fill-in-card.uses-compact-beginner-3-travel-layout
  .story-letter-separator {
  min-height: 26px;
}

.story-fill-in-card.uses-compact-beginner-3-travel-typography
  .story-letter-slot,
.story-fill-in-card.uses-compact-beginner-3-travel-typography
  .story-letter-separator {
  font-size: 1.125rem;
}

.story-fill-in-card.preserves-original-beginner-3-travel-mandarin-type
  .story-letter-slot,
.story-fill-in-card.preserves-original-beginner-3-travel-mandarin-type
  .story-letter-separator {
  font-size: 1.25rem;
}

.story-letter-bank {
  display: grid;
  grid-template-columns: repeat(30, minmax(30px, 1fr));
  gap: 6px;
  width: min(1080px, 100%);
  justify-self: center;
}

.story-letter-button {
  display: inline-grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 6px 3px;
  overflow: hidden;
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.story-letter-bank.is-traditional-mandarin-bank {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  width: min(1100px, 100%);
}

.story-letter-bank.is-traditional-mandarin-bank.is-balanced-bank {
  grid-template-columns: repeat(var(--mandarin-bank-columns), minmax(92px, 1fr));
  gap: 8px;
  width: min(980px, 100%);
}

.story-letter-button.is-traditional-mandarin-key {
  grid-template-rows: auto auto;
  gap: 3px;
  min-height: 82px;
  padding: 8px 5px 7px;
}

.story-letter-button.is-traditional-mandarin-key
  .story-letter-character {
  font-size: 2.55rem;
  font-weight: 900;
  line-height: 0.98;
}

.story-letter-button.is-traditional-mandarin-key.is-multi-character
  .story-letter-character {
  font-size: 1.62rem;
}

.story-letter-button.is-traditional-mandarin-key
  .story-letter-pinyin {
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.05;
  text-align: center;
}

.story-letter-bank.is-traditional-mandarin-bank.is-balanced-bank
  .story-letter-button.is-traditional-mandarin-key {
  min-height: 96px;
  padding: 10px 6px 8px;
}

.story-letter-bank.is-traditional-mandarin-bank.is-balanced-bank
  .story-letter-button.is-traditional-mandarin-key
  .story-letter-character {
  font-size: 3rem;
  line-height: 0.96;
}

.story-letter-bank.is-traditional-mandarin-bank.is-balanced-bank
  .story-letter-button.is-traditional-mandarin-key.is-multi-character
  .story-letter-character {
  font-size: 1.9rem;
}

.story-letter-bank.is-traditional-mandarin-bank.is-balanced-bank
  .story-letter-button.is-traditional-mandarin-key
  .story-letter-pinyin {
  font-size: 0.88rem;
  line-height: 1.08;
}

.story-fill-in-card.preserves-original-beginner-3-travel-mandarin-type
  .story-letter-button.is-traditional-mandarin-key {
  min-height: 82px;
  padding: 8px 4px 7px;
}

.story-fill-in-card.preserves-original-beginner-3-travel-mandarin-type
  .story-letter-button.is-traditional-mandarin-key
  .story-letter-character {
  font-size: 2.59rem;
}

.story-fill-in-card.preserves-original-beginner-3-travel-mandarin-type
  .story-letter-button.is-traditional-mandarin-key.is-multi-character
  .story-letter-character {
  font-size: 1.57rem;
}

.story-fill-in-card.preserves-original-beginner-3-travel-mandarin-type
  .story-letter-button.is-traditional-mandarin-key
  .story-letter-pinyin {
  font-size: 0.86rem;
}

.story-letter-bank.is-traditional-mandarin-months-bank {
  grid-template-columns: repeat(12, minmax(76px, 1fr));
  column-gap: 4px;
  row-gap: 0;
  width: min(1040px, 100%);
  justify-self: center;
}

.story-letter-button.is-traditional-mandarin-months-key {
  gap: 2px;
  min-height: 62px;
  padding: 5px 3px 4px;
}

.story-letter-button.is-traditional-mandarin-months-key
  .story-letter-character {
  font-size: 1.3rem;
}

.story-letter-button.is-traditional-mandarin-months-key
  .story-letter-pinyin {
  font-size: 0.68rem;
}

.story-fill-in-controls {
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.story-control-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  font-size: 1rem;
  font-weight: 900;
}

.story-control-button span {
  font-size: 1.1rem;
  line-height: 1;
}

.story-fill-in-feedback {
  margin: 0;
  font-weight: 850;
  text-align: center;
}

.story-fill-in-feedback.is-correct {
  color: #21633d;
}

.story-fill-in-feedback.is-incorrect {
  color: #8f2525;
}

.story-result-panel {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: center;
  width: min(980px, 100%);
  justify-self: center;
  padding: 16px 22px;
  border: 1px solid rgba(214, 167, 45, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff7e5);
}

.story-result-panel .apprentice-figure.size-compact {
  justify-self: center;
  min-height: 170px;
}

.story-result-panel .apprentice-image {
  width: min(100%, 150px);
}

.story-result-copy {
  display: grid;
  gap: 10px;
}

.story-result-copy p,
.story-result-copy strong {
  margin: 0;
}

.story-result-copy hr {
  width: 100%;
  height: 1px;
  border: 0;
  background: rgba(38, 33, 31, 0.12);
}

.story-result-copy strong span {
  color: #d71920;
}

.story-retry-row {
  display: flex;
  justify-content: center;
}

.app-shell.is-story-champion {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.app-shell.is-story-champion .app-home-button {
  top: 10px;
  left: clamp(84px, 12vw, 220px);
}

@media (min-width: 701px) {
  .app-shell.is-story-champion {
    height: 100vh;
    overflow: hidden;
  }
}

.story-champion-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 4px;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px clamp(10px, 3vw, 42px) 10px;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.story-champion-panel h1 {
  position: relative;
  z-index: 2;
  margin: 2px 0 0;
  color: #d69200;
  font-size: clamp(2.5rem, 5vw, 4.3rem);
  font-weight: 950;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 2px 0 #fff3b0,
    0 5px 14px rgba(177, 110, 0, 0.22);
}

.story-champion-panel > p {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 2px 0 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.45;
  text-align: center;
}

.story-champion-apprentice {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  margin: 0 0 -74px;
  background: transparent;
  box-shadow: none;
  filter: none;
  backdrop-filter: none;
  transform: translateY(-76px);
}

.story-champion-apprentice .apprentice-figure.size-hero {
  align-self: stretch;
  justify-self: center;
  width: min(450px, 54vh);
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  backdrop-filter: none;
  transform: none;
}

.story-champion-apprentice .apprentice-aura {
  inset: 14% 7% 3%;
  height: auto;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--apprentice-accent) 32%, transparent) 0%,
    color-mix(in srgb, var(--apprentice-accent) 14%, transparent) 48%,
    transparent 74%
  );
  box-shadow: none;
  filter: none;
  backdrop-filter: none;
  opacity: 0.5;
}

.story-champion-apprentice .apprentice-image {
  width: min(100%, 440px);
}

.story-champion-apprentice
  .apprentice-figure.character-samantha.stage-1.size-hero {
  transform: translateY(-14px);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-1.size-hero {
  width: min(387px, 48vh);
  transform: translateY(-9px);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-2.size-hero {
  width: min(338px, 42vh);
  transform: translateY(-24px);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-2.size-hero
  .apprentice-image {
  width: min(100%, 386px, 48vh);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-3.size-hero {
  width: min(386px, 48vh);
  transform: translateY(-18px);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-3.size-hero
  .apprentice-image {
  width: min(100%, 386px, 48vh);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-4.size-hero {
  width: min(332px, 41vh);
  transform: translateY(-8px);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-4.size-hero
  .apprentice-image {
  width: min(100%, 332px, 41vh);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-5.size-hero {
  width: min(338px, 42vh);
  transform: translateY(-24px);
}

.story-champion-apprentice
  .apprentice-figure.character-sienna.stage-5.size-hero
  .apprentice-image {
  width: min(100%, 338px, 42vh);
}

.story-champion-apprentice
  .apprentice-figure.character-samantha.stage-2.size-hero {
  width: min(395px, 48vh);
  transform: translateY(21px);
}

.story-champion-apprentice
  .apprentice-figure.character-odin.stage-3.size-hero,
.story-champion-apprentice
  .apprentice-figure.character-samantha.stage-3.size-hero {
  width: min(340px, 42vh);
  transform: translateY(-8px);
}

.story-champion-apprentice
  .apprentice-figure.character-odin.stage-4.size-hero,
.story-champion-apprentice
  .apprentice-figure.character-samantha.stage-4.size-hero {
  width: min(340px, 42vh);
  transform: translateY(-12px);
}

.story-champion-apprentice
  .apprentice-figure.character-odin.stage-5.size-hero,
.story-champion-apprentice
  .apprentice-figure.character-samantha.stage-5.size-hero {
  width: min(340px, 42vh);
  transform: translateY(-12px);
}

.story-bonus-panel {
  display: grid;
  position: relative;
  z-index: 1;
  justify-items: center;
  gap: 4px;
  width: min(640px, calc(100% - 72px));
  margin: 0;
  padding: 20px clamp(18px, 3vw, 30px) 10px;
  border: 2px solid color-mix(in srgb, var(--story-aura) 28%, white);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.96);
  transform: translateY(-34px);
  box-shadow:
    0 20px 42px rgba(38, 33, 31, 0.16),
    0 0 18px color-mix(in srgb, var(--story-aura) 28%, transparent),
    0 0 42px color-mix(in srgb, var(--story-aura) 18%, transparent);
}

.story-medal {
  position: absolute;
  z-index: 3;
  top: -30px;
  left: clamp(26px, 8vw, 70px);
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 3px solid #a96400;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.95) 0 4%, transparent 10%),
    radial-gradient(circle, #ffe88a 0 43%, #f5b91c 44% 54%, #c77b00 55% 62%, #ffd253 63% 74%, #b66a00 75% 100%);
  color: #fff8cf;
  font-size: 2.35rem;
  line-height: 1;
  text-shadow:
    0 1px 0 #fff7bd,
    0 3px 2px rgba(118, 68, 0, 0.5);
  box-shadow:
    inset 0 0 0 2px rgba(255, 242, 158, 0.82),
    inset -5px -7px 10px rgba(133, 73, 0, 0.2),
    inset 4px 4px 8px rgba(255, 255, 255, 0.38),
    0 9px 16px rgba(112, 61, 0, 0.3);
  isolation: isolate;
}

.story-medal::before,
.story-medal::after {
  position: absolute;
  z-index: -1;
  bottom: -42px;
  width: 23px;
  height: 51px;
  border: 1px solid rgba(117, 16, 23, 0.45);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #ee4a3e 0%, #c9242b 58%, #98131c 100%);
  content: "";
  filter: drop-shadow(0 4px 3px rgba(100, 20, 16, 0.24));
  clip-path: polygon(0 0, 100% 0, 92% 100%, 51% 79%, 8% 100%);
}

.story-medal::before {
  left: 8px;
  transform: rotate(7deg);
}

.story-medal::after {
  right: 8px;
  transform: rotate(-7deg);
}

.story-bonus-panel strong {
  color: #8c6100;
  font-size: clamp(1rem, 1.45vw, 1.25rem);
}

.story-bonus-panel > span {
  color: #13aeb8;
  font-size: clamp(2rem, 3.9vw, 2.9rem);
  font-weight: 950;
  line-height: 1;
}

.story-claim-button {
  width: min(420px, 100%);
  min-height: 34px;
  border: 2px solid rgba(19, 174, 184, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #078e96;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

.story-claim-button:disabled {
  border-color: rgba(38, 33, 31, 0.14);
  background: #e8e8e8;
  color: #77716d;
  cursor: default;
}

.story-champion-continue {
  width: min(290px, 100%);
  min-height: 36px;
  margin-top: 0;
  font-size: 0.94rem;
}

.story-confetti {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.story-confetti span {
  position: absolute;
  top: var(--confetti-y);
  left: var(--confetti-x);
  width: var(--confetti-width);
  height: var(--confetti-height);
  border-radius: var(--confetti-radius);
  background: var(--confetti-color);
  opacity: var(--confetti-opacity);
  transform: rotate(var(--confetti-rotate));
  pointer-events: none;
}

.story-confetti .is-square {
  border-radius: 1px;
}

.story-confetti .is-circle {
  border-radius: 50%;
}

.story-confetti .is-streamer {
  border: 0;
  border-left: 3px solid var(--confetti-color);
  border-radius: 50%;
  background: transparent;
}

@media (max-width: 700px) {
  /* Keep the QR code separate from the centered Speak-Free mark on phones. */
  .home-hero {
    height: 410px;
    padding-right: 0;
    padding-top: 0;
  }

  .home-hero > .home-brand {
    top: 96px;
    left: 50%;
    width: max-content;
    transform: translateX(-50%);
  }

  .home-qr {
    top: 230px;
    left: 50%;
    width: 132px;
    transform: translateX(-50%);
  }

  .home-qr img {
    width: 132px;
    height: 132px;
    border-width: 4px;
  }

  .story-fill-in-card {
    padding: 14px;
  }

  .story-letter-bank {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  }

  .story-letter-bank.is-traditional-mandarin-bank {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .story-letter-bank.is-traditional-mandarin-bank.is-balanced-bank {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 7px;
  }

  .story-letter-bank.is-traditional-mandarin-months-bank {
    grid-template-columns: repeat(12, minmax(72px, 1fr));
    width: max-content;
  }

  .story-fill-in-story {
    line-height: 2.45;
  }

  .story-fill-in-card.uses-spacious-seasons-weather-layout {
    padding: 10px;
  }

  .story-fill-in-card.uses-spacious-seasons-weather-layout
    .story-fill-in-story {
    margin-top: 8px;
    padding: 14px 8px;
    line-height: 2.7;
  }

  .story-fill-in-card.uses-spacious-seasons-weather-layout .story-blank {
    gap: 3px;
  }

  .story-fill-in-card.uses-spacious-seasons-weather-layout
    .story-blank-wrap {
    margin-inline: 1px;
  }

  .story-fill-in-card.uses-spacious-seasons-weather-layout
    .story-letter-slot {
    flex-basis: 20px;
    width: 20px;
    min-height: 32px;
    font-size: 1.25rem;
  }

  .story-result-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .story-bonus-panel {
    width: 100%;
    padding-top: 28px;
  }

  .story-medal {
    top: -22px;
    left: 18px;
    width: 66px;
    height: 66px;
    font-size: 2rem;
  }

  .story-champion-panel {
    height: auto;
    min-height: 100svh;
    padding-inline: 0;
  }

  .story-champion-panel h1 {
    font-size: clamp(2.35rem, 11.7vw, 4.05rem);
  }

  .story-champion-apprentice {
    min-height: 324px;
    margin-bottom: -54px;
    transform: translateY(-54px);
  }

  .story-champion-apprentice .apprentice-figure.size-hero {
    width: min(416px, 98vw);
    min-height: 416px;
  }

  .story-champion-apprentice .apprentice-image {
    width: min(100%, 405px);
  }

  .story-champion-apprentice
    .apprentice-figure.character-samantha.stage-1.size-hero {
    transform: translateY(-10px);
  }

  .story-champion-apprentice
    .apprentice-figure.character-sienna.stage-1.size-hero {
    width: min(374px, 90vw);
    transform: translateY(-5px);
  }

  .story-champion-apprentice
    .apprentice-figure.character-sienna.stage-2.size-hero {
    width: min(330px, 78vw);
    transform: translateY(-66px);
  }

  .story-champion-apprentice
    .apprentice-figure.character-sienna.stage-2.size-hero
    .apprentice-image {
    width: min(100%, 330px, 78vw);
  }

  .story-champion-apprentice
    .apprentice-figure.character-samantha.stage-2.size-hero {
    width: min(382px, 90vw);
    transform: translateY(-10px);
  }

  .story-champion-apprentice
    .apprentice-figure.character-odin.stage-3.size-hero,
  .story-champion-apprentice
    .apprentice-figure.character-samantha.stage-3.size-hero {
    width: min(332px, 78vw);
    transform: translateY(-6px);
  }

  .story-champion-apprentice
    .apprentice-figure.character-odin.stage-4.size-hero,
  .story-champion-apprentice
    .apprentice-figure.character-samantha.stage-4.size-hero {
    width: min(332px, 78vw);
    transform: translateY(-8px);
  }

  .story-champion-apprentice
    .apprentice-figure.character-odin.stage-5.size-hero,
  .story-champion-apprentice
    .apprentice-figure.character-samantha.stage-5.size-hero {
    width: min(332px, 78vw);
    transform: translateY(-8px);
  }

  .app-shell.is-story-champion .app-home-button {
    left: clamp(56px, 14vw, 112px);
  }

  .story-bonus-panel {
    transform: translateY(-24px);
  }
}

@media (max-width: 900px) {
  .story-letter-bank.is-traditional-mandarin-bank.is-balanced-bank {
    grid-template-columns: repeat(5, minmax(96px, 1fr));
    width: min(640px, 100%);
  }

  .matching-content {
    grid-template-columns: 1fr;
  }

  .matching-apprentice {
    grid-row: 2;
  }

  .apprentice-figure.size-matching {
    width: min(320px, 100%);
    min-height: 380px;
    justify-self: center;
  }

  .dashboard-hero .apprentice-figure.size-hero .apprentice-image {
    width: 255px;
    height: auto;
    max-width: 36vw;
    max-height: 100%;
    transform: none;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    gap: 6px;
    height: auto;
    padding: 10px 18px;
  }

  .dashboard-brand {
    position: static;
    grid-column: auto;
    transform: none;
  }

  .dashboard-hero-copy {
    padding-top: 0;
  }

  .dashboard-hero .apprentice-figure.size-hero {
    width: min(320px, 100%);
    min-height: 0;
    justify-self: center;
    margin: 0;
    transform: none;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 28px 0;
  }

  .app-home-button {
    top: 2px;
  }

  .character-grid,
  .profile-grid,
  .lesson-choice-grid,
  .progress-summary-grid,
  .settings-grid,
  .dashboard-grid,
  .dashboard-hero,
  .meet-panel,
  .completion-apprentice {
    grid-template-columns: 1fr;
  }

  .dashboard-card.wide {
    grid-column: auto;
  }

  .section-heading,
  .start-panel,
  .dashboard-actions,
  .history-item {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .matching-columns {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .lesson-panel > .section-heading,
  .matching-game-panel > .section-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lesson-panel > .section-heading .lesson-meta,
  .matching-game-panel > .section-heading .lesson-meta {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    justify-items: start;
    text-align: left;
  }

  .lesson-panel > .section-heading h1.lesson-title,
  .lesson-panel > .section-heading h1.lesson-screen-title {
    text-align: left;
  }

  .vocabulary-preview,
  .vocabulary-preview.is-study-card,
  .speech-capture-display {
    width: 100%;
  }

  .choice-button {
    min-height: 116px;
  }

  .feedback-card {
    grid-template-columns: 1fr;
  }

  .feedback-card .primary-action {
    justify-self: center;
    min-width: min(100%, 230px);
  }

  .dashboard-hero .apprentice-figure.size-hero .apprentice-image {
    width: 240px;
    height: auto;
    max-width: 100%;
    transform: none;
  }

  .dashboard-brand {
    grid-column: auto;
  }

  .dashboard-brand img {
    width: 114px;
    height: 114px;
  }

  .dashboard-hero .apprentice-figure.size-hero {
    width: min(260px, 100%);
    min-height: 0;
    margin: 0;
  }

  .apprentice-roster-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .apprentice-roster-card .apprentice-figure {
    grid-row: auto;
    justify-self: center;
  }

  .dashboard-hero .apprentice-figure,
  .apprentice-figure.size-hero,
  .apprentice-figure.size-dashboard,
  .apprentice-figure.size-compact {
    width: min(220px, 100%);
    justify-self: center;
  }
}

@media (max-height: 980px) and (max-width: 1800px) {
  .lesson-panel.is-mandarin-choice-activity {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .lesson-panel.is-mandarin-choice-activity > .section-heading {
    min-height: 46px;
  }

  .lesson-panel.is-mandarin-choice-activity .lesson-question {
    gap: 7px;
  }

  .lesson-panel.is-mandarin-choice-activity .lesson-instruction-heading {
    font-size: clamp(1.08rem, 1.85vw, 1.36rem);
    line-height: 1.08;
  }

  .lesson-panel.is-mandarin-choice-activity .choice-grid {
    gap: 8px 12px;
  }

  .lesson-panel.is-mandarin-choice-activity .choice-button {
    min-height: clamp(104px, 10.5vw, 142px);
    padding-top: clamp(12px, 1.8vw, 20px);
    padding-bottom: clamp(12px, 1.8vw, 20px);
  }

  .lesson-panel.is-mandarin-choice-activity .choice-option-secondary {
    margin-top: 6px;
  }

  .feedback-card.is-mandarin-choice-activity {
    gap: 6px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .feedback-card.is-mandarin-choice-activity .feedback-heading {
    font-size: clamp(1.2rem, 2.2vw, 1.72rem);
  }

  .feedback-card.is-mandarin-choice-activity p {
    font-size: clamp(1rem, 1.6vw, 1.16rem);
    line-height: 1.25;
  }

  .feedback-card.is-mandarin-choice-activity .primary-action {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    width: calc(100% - 16px);
    max-width: 100%;
    padding: 22px 0;
    overflow-x: hidden;
  }

  .selection-panel,
  .lesson-panel,
  .matching-game-panel {
    max-width: 100%;
    overflow: hidden;
  }

  .selection-panel {
    padding: 14px;
  }

  .section-heading {
    gap: 8px;
    margin-bottom: 12px;
  }

  .section-heading p,
  .intro {
    font-size: 0.95rem;
    line-height: 1.42;
  }

  .dashboard-hero {
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px 8px;
  }

  .dashboard-brand {
    gap: 6px;
  }

  .dashboard-brand img {
    width: 76px;
    height: 76px;
  }

  .dashboard-brand h1 {
    font-size: 2rem;
    line-height: 1;
  }

  .dashboard-hero-copy {
    padding-bottom: 8px;
  }

  .dashboard-hero .apprentice-figure.size-hero,
  .dashboard-hero .apprentice-figure {
    width: min(170px, 100%);
  }

  .dashboard-hero .apprentice-figure.size-hero .apprentice-image {
    width: 170px;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .dashboard-card {
    gap: 6px;
    min-height: 0;
    padding: 12px;
  }

  .dashboard-card strong {
    font-size: 1.45rem;
  }

  .apprentice-roster-panel,
  .lesson-choice-panel,
  .level-selector-panel,
  .progress-panel {
    margin-top: 12px;
  }

  .apprentice-roster-panel {
    padding: 12px;
  }

  .apprentice-roster-grid {
    gap: 8px;
  }

  .apprentice-roster-card {
    gap: 8px;
    padding: 10px;
  }

  .apprentice-roster-card .apprentice-figure,
  .profile-card .apprentice-figure.size-compact,
  .apprentice-figure.size-compact {
    width: min(150px, 100%);
    min-height: 150px;
  }

  .profile-card .apprentice-figure.size-compact .apprentice-image,
  .apprentice-figure.size-compact .apprentice-image {
    width: min(100%, 135px);
  }

  .apprentice-stage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .apprentice-stage-card {
    gap: 4px;
    padding: 9px;
  }

  .apprentice-progress-copy strong {
    font-size: 1.35rem;
  }

  .lesson-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .lesson-choice-card {
    gap: 6px;
    min-height: 0;
    padding: 12px 46px 12px 12px;
  }

  .lesson-vocabulary-count {
    top: 8px;
    right: 8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    font-size: 0.7rem;
  }

  .lesson-choice-card strong {
    font-size: 1rem;
    line-height: 1.18;
  }

  .lesson-choice-card .summary-label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }

  .lesson-panel {
    gap: 10px;
    padding: 12px;
  }

  .lesson-panel.is-teaching-activity,
  .lesson-panel.is-choice-activity,
  .lesson-panel.is-mandarin-choice-activity {
    gap: 9px;
    padding: 12px;
  }

  .lesson-panel > .section-heading,
  .matching-game-panel > .section-heading {
    gap: 8px;
    min-height: 0;
  }

  .lesson-panel > .section-heading h1.lesson-title,
  .lesson-panel > .section-heading h1.lesson-screen-title,
  .matching-game-panel h1.lesson-screen-title {
    font-size: 1.2rem !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere;
  }

  .lesson-meta {
    font-size: 0.95rem;
  }

  .lesson-question,
  .lesson-panel.is-teaching-activity .lesson-question,
  .lesson-panel.is-choice-activity .lesson-question,
  .lesson-panel.is-mandarin-choice-activity .lesson-question {
    gap: 9px;
    max-width: 100%;
    overflow: hidden;
  }

  .lesson-question h2,
  .lesson-instruction-heading,
  .lesson-panel.is-teaching-activity .lesson-instruction-heading,
  .lesson-panel.is-choice-activity .lesson-instruction-heading {
    max-width: 100%;
    font-size: 1.05rem;
    line-height: 1.18;
    letter-spacing: 0.01em;
    overflow-wrap: anywhere;
  }

  .vocabulary-preview,
  .vocabulary-preview.is-study-card {
    gap: 6px;
    width: 100%;
    min-height: 148px;
    padding: 16px 12px;
  }

  .vocabulary-preview strong {
    max-width: 100%;
    font-size: clamp(2.7rem, 15vw, 4.25rem);
    overflow-wrap: anywhere;
  }

  .vocabulary-preview-word.is-mandarin,
  .pronunciation-practice > strong.vocabulary-preview-word.is-mandarin {
    font-size: clamp(2.45rem, 14vw, 3.7rem);
  }

  .vocabulary-preview p {
    max-width: 100%;
    font-size: clamp(1.25rem, 7vw, 1.9rem);
    overflow-wrap: anywhere;
  }

  .vocabulary-preview-pinyin,
  .choice-option-secondary,
  .matching-option-secondary {
    font-size: clamp(0.95rem, 4.8vw, 1.25rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .choice-grid,
  .lesson-panel.is-mandarin-choice-activity .choice-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: hidden;
  }

  .choice-button,
  .choice-button:nth-child(4):nth-last-child(2),
  .choice-button:nth-child(4):last-child {
    grid-column: auto;
  }

  .choice-button {
    width: 100%;
    max-width: 100%;
    height: 96px;
    min-height: 96px;
    padding: 12px 10px;
    font-size: clamp(1.55rem, 9vw, 2.35rem);
    line-height: 1.05;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
  }

  .choice-button.is-medium-answer {
    font-size: clamp(1.42rem, 7.5vw, 2.12rem);
  }

  .choice-button.is-long-answer,
  .choice-button.is-long-phrase-answer {
    font-size: clamp(1.18rem, 6.3vw, 1.78rem);
  }

  .choice-button.is-very-long-answer {
    font-size: clamp(1.05rem, 5.5vw, 1.52rem);
  }

  .choice-option-primary.is-mandarin,
  .matching-option-primary.is-mandarin {
    font-size: clamp(2.25rem, 13vw, 3.25rem);
    line-height: 1.05;
  }

  .choice-option-secondary {
    margin-top: 6px;
  }

  .feedback-card {
    gap: 8px;
    padding: 12px;
  }
}

@media (max-width: 380px) {
  .lesson-choice-grid,
  .apprentice-stage-list {
    grid-template-columns: 1fr;
  }

  .lesson-choice-card {
    padding: 10px 44px 10px 12px;
  }
}

/* ========================================
   Selection Screen (Create New Apprentice → Choose Language)
   Page-scoped vertical spacing fix
   ======================================== */
.is-selection .hero {
  margin-bottom: 132px;  /* was 92px — adds another 40px gap below icon/title */
}

.is-selection .control-section:first-of-type {
  margin-top: 24px;  /* pushes first white box (Language) down */
}

.is-selection .start-panel {
  margin-top: 32px;  /* preserves relationship to first box */
}
