:root {
  --ink: #25231f;
  --muted: #777269;
  --paper: #fffaf3;
  --card: rgba(255, 255, 255, 0.88);
  --orange: #ff8055;
  --orange-dark: #e85f35;
  --yellow: #ffd66b;
  --green: #5bbd8b;
  --purple: #8c78e8;
  --line: #eadfd1;
  --shadow: 0 20px 60px rgba(112, 78, 50, 0.12);
}

* { box-sizing: border-box; }

html { background: #fff8ee; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 2%, rgba(255, 214, 107, 0.22), transparent 30%),
    radial-gradient(circle at 90% 28%, rgba(140, 120, 232, 0.1), transparent 26%),
    #fff8ee;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, textarea { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .55;
}

.ambient-one {
  width: 180px;
  height: 180px;
  top: 18%;
  left: -100px;
  background: #ffe2a1;
}

.ambient-two {
  width: 220px;
  height: 220px;
  right: -130px;
  bottom: 10%;
  background: #dcd4ff;
}

.app-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 calc(42px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px 14px 14px 5px;
  color: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  font-weight: 800;
  background: var(--ink);
  box-shadow: 0 7px 16px rgba(37, 35, 31, .16);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.65);
  font-size: 20px;
  cursor: pointer;
}

.hidden { display: none !important; }

.hero-card, .progress-card, .lesson-card, .material-card, .challenge-card {
  border: 1px solid rgba(234, 223, 209, .9);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card {
  position: relative;
  min-height: 340px;
  padding: 38px 32px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,246,226,.92));
}

.hero-copy { position: relative; z-index: 2; max-width: 430px; }

.eyebrow, .section-label {
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.hero-card h1 {
  margin: 14px 0;
  font-size: clamp(32px, 8vw, 48px);
  line-height: 1.15;
  letter-spacing: -.04em;
}

.hero-card p {
  width: min(100%, 390px);
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.primary-button, .run-button, .next-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: var(--orange);
  box-shadow: 0 10px 22px rgba(255, 128, 85, .28);
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.primary-button { padding: 0 22px; }
.primary-button:active, .run-button:active, .next-button:active { transform: translateY(2px); }

.hero-art {
  position: absolute;
  right: 20px;
  bottom: 8px;
  width: 210px;
  height: 185px;
  opacity: .9;
}

.snake {
  position: absolute;
  background: var(--yellow);
  box-shadow: inset -8px -8px 0 rgba(224, 164, 30, .13);
}

.snake-head {
  right: 15px;
  bottom: 54px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 80px;
  height: 63px;
  padding-right: 18px;
  border-radius: 45% 48% 45% 20%;
  color: var(--ink);
  font-size: 8px;
}

.snake-head::after {
  content: "●";
  position: absolute;
  right: 18px;
  top: 20px;
  font-size: 8px;
}

.snake-body {
  right: 73px;
  bottom: 25px;
  width: 95px;
  height: 100px;
  border-radius: 48px 0 0 48px;
  transform: rotate(-8deg);
}

.code-bubble {
  position: absolute;
  top: 2px;
  right: 0;
  width: 155px;
  padding: 10px 12px 13px;
  border: 1px solid #e5d8ca;
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 25px rgba(83, 65, 49, .12);
  transform: rotate(3deg);
}

.code-bubble i, .editor-bar i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: #ff8069;
}

.code-bubble i:nth-child(2), .editor-bar i:nth-child(2) { background: #ffd05a; }
.code-bubble i:nth-child(3), .editor-bar i:nth-child(3) { background: #64c58f; }
.code-bubble code { display: block; margin-top: 8px; font-size: 11px; }

.progress-card { margin-top: 18px; padding: 27px 24px 18px; }
.progress-heading { display: flex; justify-content: space-between; align-items: end; }
.progress-heading h2 { margin: 6px 0 0; font-size: 22px; }
.progress-heading strong { color: var(--muted); font-size: 13px; }

.progress-track {
  height: 7px;
  margin: 18px 0 22px;
  overflow: hidden;
  border-radius: 10px;
  background: #eee7df;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffb35d);
  transition: width .35s ease;
}

.unlock-button {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid #ead7ff;
  border-radius: 16px;
  text-align: left;
  color: #5d4d8e;
  background: #faf6ff;
  cursor: pointer;
}

.unlock-button > span:first-child {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #eee6ff;
}

.unlock-button strong, .unlock-button small { display: block; }
.unlock-button strong { font-size: 13px; }
.unlock-button small { margin-top: 3px; color: #8c80a9; font-size: 10px; }
.unlock-button b { font-size: 15px; }
.unlock-button.enabled { color: #327354; border-color: #c9e8d8; background: #f2fbf6; }
.unlock-button.enabled > span:first-child { background: #dff4e8; }
.unlock-button.enabled small { color: #71927f; }

.mistake-button {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: -9px 0 18px;
  padding: 12px 14px;
  border: 1px solid #eddcd5;
  border-radius: 16px;
  text-align: left;
  background: #fffaf7;
  cursor: pointer;
}

.mistake-button > span:first-child {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff0ea;
}

.mistake-button strong, .mistake-button small { display: block; }
.mistake-button strong { font-size: 13px; }
.mistake-button small { margin-top: 3px; color: #9a8177; font-size: 10px; }
.mistake-button b {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border-radius: 99px;
  color: white;
  background: var(--orange);
  font-size: 10px;
}

.mistake-panel {
  margin: -8px 0 19px;
  padding: 10px;
  border: 1px solid #eee2da;
  border-radius: 15px;
  background: #fffdfb;
}

.mistake-empty { padding: 14px; color: var(--muted); text-align: center; font-size: 12px; }
.mistake-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid #f2e9e3;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.mistake-item:last-child { border-bottom: 0; }
.mistake-item strong, .mistake-item small { display: block; }
.mistake-item strong { font-size: 12px; }
.mistake-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mistake-item b { color: var(--orange-dark); font-size: 11px; }

.lesson-list { display: grid; gap: 7px; }

.chapter-block + .chapter-block { margin-top: 21px; }

.chapter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 8px;
}

.chapter-heading span {
  color: #a36d49;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.chapter-heading small { color: #aaa39a; font-size: 10px; }
.chapter-lessons { display: grid; gap: 7px; }

.chapter-challenge {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px dashed #d8ccef;
  border-radius: 15px;
  text-align: left;
  color: #66558f;
  background: #fbf8ff;
  cursor: pointer;
}

.chapter-challenge span:first-child { font-size: 20px; }
.chapter-challenge strong, .chapter-challenge small { display: block; }
.chapter-challenge strong { font-size: 12px; }
.chapter-challenge small { margin-top: 3px; color: #9589ad; font-size: 10px; }
.chapter-challenge.done { color: #347154; border-color: #a9d6bf; background: #f2faf5; }
.chapter-challenge:disabled { cursor: not-allowed; opacity: .45; }

.lesson-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 9px;
  border: 0;
  border-radius: 16px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.lesson-item:hover { background: #fff7eb; }
.lesson-item.locked { cursor: not-allowed; opacity: .48; }

.lesson-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #f4eee7;
  font-weight: 800;
}

.lesson-item.current .lesson-number { color: white; background: var(--orange); }
.lesson-item.done .lesson-number { color: white; background: var(--green); }
.lesson-meta strong, .lesson-meta small { display: block; }
.lesson-meta strong { font-size: 14px; }
.lesson-meta small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.lesson-status { color: var(--muted); font-size: 17px; }
.lesson-item.done .lesson-status { color: var(--green); }
.home-note { margin: 17px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 16px;
  color: var(--muted);
  font-size: 12px;
}

.phase-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 18px;
}

.phase-nav button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 0;
  color: #9b958d;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.phase-nav button span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: #8f8981;
  background: #eee7df;
  font-size: 11px;
}

.phase-nav button.active { color: var(--orange-dark); }
.phase-nav button.active span { color: white; background: var(--orange); }
.phase-nav i { width: 34px; height: 1px; background: #ded5ca; }

.back-button {
  padding: 7px 0;
  border: 0;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.lesson-card { padding: 27px 25px; }
.lesson-title-row { display: flex; align-items: center; gap: 15px; }
.lesson-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff1d2;
  font-size: 25px;
}

.lesson-title-row h1 { margin: 5px 0 0; font-size: clamp(23px, 6vw, 31px); letter-spacing: -.03em; }
.story { margin: 22px 2px; color: #57524b; font-size: 15px; line-height: 1.85; }

.lesson-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.lesson-facts span {
  padding: 8px 11px;
  border-radius: 99px;
  color: var(--muted);
  background: #f7f1e9;
  font-size: 11px;
}

.lesson-facts b { color: #5c5750; font-weight: 700; }

.material-card { margin-top: 18px; padding: 27px 25px; }

.reading-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid #eee5db;
}

.reading-head h2 { margin: 6px 0 0; font-size: 22px; }
.reading-head > span {
  padding: 6px 9px;
  border-radius: 99px;
  color: #7b746c;
  background: #f3eee8;
  font-size: 10px;
  font-weight: 800;
}

.material-content { padding: 5px 0 3px; }

.material-block {
  padding: 18px 1px;
  border-bottom: 1px solid #f0e8df;
}

.material-block:last-child { border-bottom: 0; }

.material-block h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-size: 17px;
}

.material-block h3 span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #fff0dd;
  font-size: 13px;
}

.material-block p {
  margin: 8px 0;
  color: #5f5a53;
  font-size: 14px;
  line-height: 1.9;
}

.material-block ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #5f5a53;
  font-size: 14px;
  line-height: 1.9;
}

.material-block code, .challenge-card > p code, .quiz-box code, .lesson-summary code {
  padding: 2px 6px;
  border-radius: 6px;
  color: #c25230;
  background: #ffe9db;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}

.example-box {
  margin: 13px 0 5px;
  overflow: hidden;
  border-radius: 14px;
  background: #292b33;
}

.example-label {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  color: #9ca0aa;
  background: #202229;
  font-size: 10px;
}

.example-box pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  color: #f5d58c;
  font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.output-box {
  margin-top: -4px;
  padding: 11px 14px;
  border-radius: 0 0 14px 14px;
  color: #d7eee2;
  background: #343740;
  font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tip-box {
  margin-top: 12px;
  padding: 13px 14px;
  border-left: 3px solid var(--yellow);
  border-radius: 4px 12px 12px 4px;
  color: #6b5d43;
  background: #fff8df;
  font-size: 12px;
  line-height: 1.7;
}

.quiz-box {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid #e3d9fb;
  border-radius: 19px;
  background: #f9f6ff;
}

.quiz-label { color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.quiz-box h3 { margin: 8px 0 14px; font-size: 15px; line-height: 1.6; }
.quiz-options { display: grid; gap: 8px; }

.quiz-option {
  padding: 12px 13px;
  border: 1px solid #e2dbea;
  border-radius: 12px;
  text-align: left;
  background: white;
  font-size: 13px;
  cursor: pointer;
}

.quiz-option.correct { color: #28744e; border-color: #88cbaa; background: #edf9f3; }
.quiz-option.wrong { color: #a94b31; border-color: #e9a995; background: #fff1ed; }
.quiz-feedback { min-height: 18px; margin: 10px 2px 0; color: #6b655e; font-size: 12px; line-height: 1.6; }

.lesson-summary {
  margin-top: 16px;
  padding: 18px 18px 12px;
  border-radius: 17px;
  background: #f4f8f5;
}

.lesson-summary > span { color: #36775a; font-size: 12px; font-weight: 800; }
.lesson-summary ul { margin: 10px 0 0; padding-left: 19px; color: #546158; font-size: 13px; line-height: 1.8; }

.to-practice-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 15px;
  border: 1px solid #f0b59f;
  border-radius: 15px;
  color: var(--orange-dark);
  background: #fff7f2;
  font-weight: 800;
  cursor: pointer;
}

.challenge-card { margin-top: 18px; padding: 25px; }
.challenge-head { display: flex; justify-content: space-between; gap: 15px; }
.challenge-head h2 { margin: 6px 0 0; font-size: 21px; }
.points {
  align-self: start;
  padding: 7px 10px;
  border-radius: 99px;
  color: #94651e;
  background: #fff2c6;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.challenge-card > p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.editor-wrap { margin-top: 18px; overflow: hidden; border-radius: 17px; background: #25272e; box-shadow: 0 15px 30px rgba(28, 28, 30, .17); }
.editor-bar { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; color: #9ca0aa; background: #1d1e24; font-size: 10px; }

.editor { display: grid; grid-template-columns: 38px 1fr; min-height: 178px; }
.editor pre {
  margin: 0;
  padding: 16px 10px;
  color: #656873;
  text-align: right;
  background: #212229;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: none;
}

.editor textarea {
  width: 100%;
  min-height: 178px;
  padding: 16px 14px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: #f5d58c;
  caret-color: white;
  background: #292b33;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  tab-size: 4;
}

.quick-keys {
  display: flex;
  gap: 7px;
  padding: 9px;
  overflow-x: auto;
  border-top: 1px solid #373943;
  background: #24262d;
}

.quick-keys button {
  min-width: 42px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #434650;
  border-radius: 8px;
  color: #dddfe6;
  background: #31343d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.quick-keys .snippet-key { color: #f6d795; min-width: auto; }

.action-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 16px; }
.secondary-button {
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.run-button { min-height: 50px; box-shadow: none; }
.run-button:disabled { opacity: .65; cursor: wait; }
.play-icon { font-size: 11px; }

.result-panel {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  margin-top: 16px;
  padding: 17px;
  border-radius: 16px;
  border: 1px solid #e7e0d7;
  background: #f7f4f0;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: white;
  background: #8f8a83;
  font: 12px ui-monospace, monospace;
}

.result-panel strong { font-size: 13px; }
.result-panel pre { margin: 6px 0 0; white-space: pre-wrap; color: #5e5a54; font: 12px/1.6 ui-monospace, monospace; }
.result-panel p { margin: 6px 0 0; color: #6f6961; font-size: 12px; line-height: 1.5; }
.result-panel.success { border-color: #b8e3cd; background: #effaf4; }
.result-panel.success .result-icon { background: var(--green); }
.result-panel.error { border-color: #f1c4b6; background: #fff3ef; }
.result-panel.error .result-icon { background: var(--orange); }

.hint-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.hint-actions button {
  padding: 9px 13px;
  border: 1px solid #e9d7a8;
  border-radius: 12px;
  color: #886627;
  background: #fff9e7;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.hint-actions span { color: var(--muted); font-size: 10px; }

.reference-answer {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #282a31;
}

.reference-answer > span { color: #f2cf7f; font-size: 11px; font-weight: 800; }
.reference-answer pre { margin: 9px 0; overflow-x: auto; color: #e9e7df; font: 12px/1.7 ui-monospace, monospace; }
.reference-answer small { color: #989ba5; font-size: 10px; }

.next-button { width: 100%; margin-top: 12px; background: var(--green); box-shadow: 0 10px 22px rgba(91, 189, 139, .2); }

.review-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding-top: max(30px, env(safe-area-inset-top));
  background: rgba(31, 27, 23, .48);
  backdrop-filter: blur(5px);
}

.review-sheet {
  width: min(100%, 720px);
  max-height: 94vh;
  padding: 25px 22px calc(25px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 27px 27px 0 0;
  background: var(--paper);
  box-shadow: 0 -15px 50px rgba(0,0,0,.16);
}

.review-topbar { display: flex; justify-content: space-between; align-items: start; }
.review-topbar h2 { margin: 6px 0 0; font-size: 23px; }
.review-topbar button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: 24px;
  cursor: pointer;
}
.review-intro { color: var(--muted); font-size: 13px; line-height: 1.7; }
.review-questions { display: grid; gap: 13px; }
.review-question { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.review-question h3 { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
.review-options { display: grid; gap: 7px; }
.review-option {
  padding: 11px;
  border: 1px solid #e7dfd7;
  border-radius: 11px;
  text-align: left;
  background: #fcfaf8;
  font-size: 12px;
  cursor: pointer;
}
.review-option.selected { border-color: var(--purple); background: #f4f0ff; }
.review-option.correct { color: #28744e; border-color: #88cbaa; background: #edf9f3; }
.review-option.wrong { color: #a94b31; border-color: #e9a995; background: #fff1ed; }
.review-submit { width: 100%; margin-top: 15px; }
.review-result { margin-top: 13px; padding: 15px; border-radius: 14px; color: #356c51; background: #edf8f2; font-size: 13px; line-height: 1.7; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 11px 17px;
  border-radius: 99px;
  color: white;
  background: rgba(37, 35, 31, .92);
  box-shadow: 0 8px 25px rgba(0,0,0,.18);
  font-size: 12px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 560px) {
  .app-shell { width: min(100% - 22px, 760px); }
  .topbar { margin-bottom: 17px; }
  .hero-card { min-height: 390px; padding: 29px 23px; }
  .hero-card h1 { max-width: 310px; }
  .hero-card p { max-width: 300px; font-size: 14px; }
  .hero-art { right: -5px; bottom: 0; transform: scale(.78); transform-origin: right bottom; }
  .progress-card, .lesson-card, .material-card, .challenge-card { border-radius: 23px; }
  .progress-card { padding: 23px 17px 14px; }
  .lesson-card, .material-card, .challenge-card { padding: 21px 18px; }
  .lesson-item { grid-template-columns: 42px 1fr auto; gap: 9px; padding-inline: 5px; }
  .lesson-title-row { align-items: flex-start; }
  .action-row { grid-template-columns: 105px 1fr; }
}

@media (min-width: 700px) {
  .hero-art { right: 38px; bottom: 20px; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
